/* =====================================================================
   DEIMIX HUB - mock v4. The design system first, then the four page
   templates, then each page.
   Layer 0: tokens. Layer 1: components. Layer 2: the shell and the band.
   Layer 3: the templates (list and detail, sequence, settings, desk).
   Layer 4: pages. Every page reuses 0-3 and owns only its own section of 4.
   ===================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
  /* the brand kit, verbatim */
  --ink: #0B1117;
  --panel: #131C25;
  --panel-2: #1A2530;
  --line: #25333F;
  --text: #E7ECF0;
  --muted: #8598A6;
  --amber: #E9A23B;               /* the wordmark's full stop. Nothing else. */

  /* derived from the kit, for depth */
  --ink-deep: #080D12;
  --panel-3: #213040;
  --line-strong: #344857;
  --faint: #5F7383;
  --soft-text: #C9D4DC;

  /* the grammar: what each colour MEANS */
  --forward: #2F7FF0;             /* forward buttons ONLY. Never decoration, headlines, tags. */
  --forward-hover: #4A93F8;
  --forward-press: #2369D6;
  --choice: #F2762E;              /* a choice, or a step inside the same page. Never forward. */
  --choice-soft: rgba(242, 118, 46, 0.14);
  --choice-line: rgba(242, 118, 46, 0.55);
  --danger: #F0776B;
  --danger-soft: rgba(240, 119, 107, 0.12);
  --ok: #4CC38A;
  --ok-soft: rgba(76, 195, 138, 0.13);
  --focus: #DCE6EE;

  /* item states - library, published, gone out (never mixed) */
  --state-library: #8598A6;
  --state-published: #4CC38A;
  --state-goneout: #5CC8C0;

  /* page hues - only on the band's icon tile and the sidebar marker */
  --hue-home: #2EC4A6;
  --hue-library: #9B8CFF;
  --hue-brand: #E98C6B;
  --hue-account: #C9A6F2;
  --hue-signin: #2EC4A6;
  --hue-kit: #8598A6;

  /* pillars - the poster tool's PILLAR_COLOR, except LOCAL: sand here, so
     amber stays the mark's alone. */
  --pillar-PAIN: #E98C6B;
  --pillar-TEACH: #6FB8E8;
  --pillar-PROOF: #7CD992;
  --pillar-FEATURE: #C9A6F2;
  --pillar-FOUNDER: #F2A6C9;
  --pillar-LOCAL: #D7C291;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Anek Tamil', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-tamil: 'Anek Tamil', 'IBM Plex Sans', system-ui, sans-serif;

  --radius-small: 6px;
  --radius: 10px;
  --radius-large: 14px;

  --sidebar-open: 232px;
  --sidebar-shut: 68px;
  --gutter: 24px;
  --shadow-lift: 0 18px 50px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[lang="ta"], .tamil { font-family: var(--font-tamil); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.svg-icon { width: 20px; height: 20px; flex: none; display: inline-block; }
.svg-icon.small { width: 16px; height: 16px; }
.svg-icon.large { width: 24px; height: 24px; }
.mono-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.mono-text { font-family: var(--font-mono); font-size: .9em; }
.muted { color: var(--muted); }

/* ------------------------------------------------------------- wordmark */
.wordmark { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; line-height: 1; }
.wordmark .full-stop { color: var(--amber); }

/* ------------------------------------------------------------- buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: var(--radius-small);
  font-family: var(--font-body); font-size: 14px; font-weight: 600; line-height: 1;
  border: 1px solid transparent; background: transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
  text-decoration: none; user-select: none;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button .svg-icon { width: 18px; height: 18px; }
.button.small { height: 32px; padding: 0 11px; font-size: 13px; gap: 7px; }
.button.small .svg-icon { width: 16px; height: 16px; }
.forward-short { display: none; }

/* BLUE - forward. One per page, top right. The only blue on any screen. */
.button-forward { background: var(--forward); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 18px rgba(47,127,240,.28); }
.button-forward:hover:not(:disabled) { background: var(--forward-hover); }
.button-forward:active:not(:disabled) { background: var(--forward-press); }
/* greyed, never hidden: forward is not offered until the step can be taken */
.button-forward:disabled { background: var(--panel-3); color: var(--faint); box-shadow: none; cursor: not-allowed; }

/* GREY outline - back, cancel, a secondary action */
.button-back, .button-quiet { border-color: var(--line-strong); color: var(--text); background: transparent; }
.button-back:hover:not(:disabled), .button-quiet:hover:not(:disabled) { border-color: var(--muted); background: rgba(255,255,255,.03); }
.button-quiet:disabled, .button-back:disabled { color: var(--faint); border-color: var(--line); cursor: not-allowed; }

/* a tool inside a panel - download, copy. Solid, calm, never blue. */
.button-tool { background: var(--panel-2); border-color: var(--line-strong); color: var(--text); }
.button-tool:hover:not(:disabled) { background: var(--panel-3); border-color: var(--muted); }
.button-tool:disabled { color: var(--faint); cursor: progress; }

/* RED outline - destructive. Never the loudest thing on a screen. */
.button-danger { border-color: rgba(240,119,107,.45); color: var(--danger); }
.button-danger:hover { border-color: var(--danger); background: var(--danger-soft); }

.link-button { background: none; border: 0; padding: 4px 0; color: var(--text); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.link-button:hover { text-decoration-color: var(--text); }
.link-button .svg-icon { width: 17px; height: 17px; color: var(--muted); }
.link-button.small-link { font-size: 12.5px; padding: 0; color: var(--muted); }
.link-button.small-link:hover { color: var(--text); }
.link-button.tiny-link { font-size: 12.5px; padding: 0; }

.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--radius-small); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-button:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.icon-button.is-on { background: var(--choice-soft); color: var(--choice); border-color: var(--choice-line); }

/* ------------------------------------------------------------- fields */
.field { display: flex; flex-direction: column; gap: 7px; }
.field + .field { margin-top: 16px; }
.field-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: var(--radius-small);
  background: var(--ink-deep); border: 1px solid var(--line-strong); color: var(--text);
  font-family: var(--font-body); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--soft-text); box-shadow: 0 0 0 3px rgba(220,230,238,.12); }
.input.has-icon { padding-left: 40px; }
.input.mono-input { font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.input-wrap > .svg-icon { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.input-wrap .input-trailing { position: absolute; right: 4px; }
.input.is-wrong { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-error { color: var(--danger); font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; }
.field-error .svg-icon { width: 17px; height: 17px; margin-top: 1px; }
.field-hint { color: var(--muted); font-size: 13px; }
.field-hint.is-warning { color: var(--choice); }
.field-hint.is-changed { color: var(--choice); display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.field-hint b.plain { color: var(--text); font-weight: 600; }

/* ------------------------------------------- segmented control (a choice) */
.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: 9px; background: var(--ink-deep); border: 1px solid var(--line); flex: none; }
.segment {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 7px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.segment .svg-icon { width: 16px; height: 16px; }
.segment:hover { color: var(--text); background: var(--panel-2); }
.segment[aria-pressed="true"] { color: var(--choice); background: var(--choice-soft); border-color: var(--choice-line); }
.segment .count { font-family: var(--font-mono); font-size: 11px; color: inherit; opacity: .8; }

/* ----------------------------------------------------- chips (a choice) */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip.is-small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.chip .svg-icon { width: 15px; height: 15px; color: var(--muted); }
.chip .count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.chip .dot { width: 8px; height: 8px; border-radius: 2px; }
.chip:hover { border-color: var(--muted); background: rgba(255,255,255,.03); }
.chip[aria-pressed="true"] { border-color: var(--choice-line); background: var(--choice-soft); color: var(--choice); }
.chip[aria-pressed="true"] .svg-icon, .chip[aria-pressed="true"] .count { color: var(--choice); }

/* ------------------------------------------------ picker (not the native dropdown) */
.picker { position: relative; display: inline-block; flex: none; }
.picker-button {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px;
  border-radius: var(--radius-small); border: 1px solid var(--line-strong); background: transparent;
  color: var(--text); font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.picker-button:hover { border-color: var(--muted); background: rgba(255,255,255,.03); }
.picker-button .picker-name { color: var(--muted); }
.picker-button .svg-icon { width: 16px; height: 16px; color: var(--muted); }
.picker.is-set .picker-button { border-color: var(--choice-line); background: var(--choice-soft); }
.picker.is-set .picker-value { color: var(--choice); }
.picker-list {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 230px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lift); list-style: none; margin: 0;
}
.picker-list.align-right { left: auto; right: 0; }
.picker-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.picker-option .tick { width: 16px; height: 16px; color: var(--choice); visibility: hidden; }
.picker-option[aria-selected="true"] .tick { visibility: visible; }
.picker-option[aria-selected="true"] { color: var(--choice); }
.picker-option:hover, .picker-option.is-active { background: var(--panel-2); }
.picker-option .svg-icon.small { color: var(--muted); }
.picker-option .dot { width: 8px; height: 8px; border-radius: 50%; }
.picker-option .option-note { margin-left: auto; padding-left: 14px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ----------------------------------------------------- tabs (a choice) */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 11px;
  border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tab .svg-icon { width: 17px; height: 17px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--choice); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--choice); }
.tab .count { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--panel-3); color: var(--muted); }

/* ------------------------------------------------- chips that only label */
.state-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.state-chip .svg-icon { width: 13px; height: 13px; }
.state-chip.is-library { color: var(--state-library); background: rgba(133,152,166,.13); }
.state-chip.is-published { color: var(--state-published); background: var(--ok-soft); }
.state-chip.is-goneout { color: var(--state-goneout); background: rgba(92,200,192,.12); }
.stale-tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: #E3B8A6; border: 1px dashed rgba(233,140,107,.5); }
.stale-tag .svg-icon { width: 13px; height: 13px; }
.pillar-tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.pillar-tag::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--pillar-color, var(--muted)); }
.lang-tag { display: inline-flex; align-items: center; height: 19px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--muted); }
.sample-tag { display: inline-flex; align-items: center; height: 19px; padding: 0 6px; border-radius: 4px; border: 1px dashed var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--text); text-transform: uppercase; white-space: nowrap; font-weight: 500; vertical-align: middle; }

/* ---------------------------------------------------- type tiles (icon) */
.type-tile { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.type-tile .svg-icon { width: 18px; height: 18px; }
.type-tile.is-article { color: #C3B9FF; }
.type-tile.is-post { color: #FFB79A; }
.type-tile.is-linkedin { color: #B8D0E0; }
.type-tile.is-status { color: #8EE3B0; }

/* --------------------------------------------------------------- cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-large); }
.card.is-quiet { background: transparent; border-style: dashed; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head .link-button, .card-head .button { white-space: nowrap; flex: none; }
.card-head h2 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.card-head h2 .svg-icon { color: var(--muted); }
.card-body { padding: 12px 20px 18px; }
.card-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card.is-quiet .card-body { padding-bottom: 6px; }

/* ----------------------------------------------------------- stat tile */
.stat-tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 5px; min-width: 0; position: relative; overflow: hidden; text-align: left; color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s; }
button.stat-tile:hover { border-color: var(--muted); }
.stat-tile .stat-number { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.stat-tile .stat-what { color: var(--muted); font-size: 13.5px; padding-right: 22px; }
.stat-tile .stat-icon { position: absolute; right: 16px; top: 16px; color: var(--faint); }
.stat-tile.is-attention .stat-number { color: #F2B79A; }
.stat-tile .stat-sample { align-self: flex-start; margin-top: 4px; }

/* ------------------------------------------------- the OPEN placeholder */
.open-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px dashed #6E8496; border-radius: 8px; color: #B9C6D0; font-size: 13px; line-height: 1.5; background: rgba(110,132,150,.06); }
.open-note b { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; font-weight: 500; padding: 2px 6px; border-radius: 4px; background: #2A3A48; color: var(--text); flex: none; margin-top: 1px; }
.open-note.is-tiny { padding: 6px 9px; font-size: 12px; }

/* --------------------------------------------------------- empty state */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 24px; color: var(--muted); }
.empty .empty-picture { width: 60px; height: 60px; border-radius: 17px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); margin-bottom: 6px; }
.empty .empty-picture .svg-icon { width: 26px; height: 26px; }
.empty h3 { color: var(--text); font-size: 17px; }
.empty p { max-width: 340px; font-size: 14px; }
.empty.is-small { padding: 18px 8px; gap: 4px; }
.empty.is-small h3 { font-size: 15px; }
.empty.is-left { align-items: flex-start; text-align: left; padding: 8px 0; }

/* -------------------------------------------------------------- toast */
.toast-stack { position: fixed; z-index: 90; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lift);
  animation: toast-in .28s var(--ease);
}
.toast.is-leaving { animation: toast-out .22s ease forwards; }
.toast .toast-icon { width: 20px; height: 20px; color: var(--ok); margin-top: 1px; }
.toast.is-info .toast-icon { color: var(--soft-text); }
.toast .toast-title { font-weight: 600; font-size: 14px; }
.toast .toast-text { color: var(--muted); font-size: 13px; margin-top: 2px; }
.toast .icon-button { width: 28px; height: 28px; margin-left: auto; }
.toast .icon-button .svg-icon { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------- dialog */
.dialog-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(5,9,13,.72); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; } }
.dialog { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-lift); animation: dialog-in .22s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dialog-head { display: flex; gap: 14px; padding: 22px 22px 0; }
.dialog-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--soft-text); }
.dialog.is-destructive .dialog-mark { background: var(--danger-soft); border-color: rgba(240,119,107,.35); color: var(--danger); }
.dialog.is-informational .dialog-mark { color: var(--muted); }
.dialog-title { font-size: 18px; line-height: 1.3; }
.dialog-description { color: var(--muted); font-size: 14px; margin-top: 6px; }
.dialog-body { padding: 18px 22px 4px; }
.dialog-body .field + .field { margin-top: 14px; }
.dialog-actions { display: flex; justify-content: space-between; gap: 10px; padding: 18px 22px 22px; }
.dialog-actions .spacer { flex: 1; }

/* the four places something goes out - each a choice, so orange when picked */
.place-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.place {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 11px; cursor: pointer; text-align: left;
  border: 1px solid var(--line-strong); background: var(--ink-deep); color: var(--text);
}
.place:hover:not(:disabled) { border-color: var(--muted); }
.place .place-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); flex: none; }
.place .place-name { font-weight: 600; font-size: 14px; }
.place .place-note { font-size: 12px; color: var(--muted); }
.place .place-tick { margin-left: auto; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: none; }
.place .place-tick .svg-icon { width: 14px; height: 14px; }
.place[aria-pressed="true"] { border-color: var(--choice-line); background: var(--choice-soft); }
.place[aria-pressed="true"] .place-icon { color: var(--choice); background: rgba(242,118,46,.16); }
.place[aria-pressed="true"] .place-tick { background: var(--choice); border-color: var(--choice); color: #1B0F06; }
.place:disabled { opacity: .55; cursor: not-allowed; }
.place:disabled .place-note { color: var(--state-goneout); }

/* ===================================================================
   LAYER 2 - THE SHELL: sidebar, the mock pill, the band
   =================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-open) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .22s var(--ease); }
.app.sidebar-is-shut { grid-template-columns: var(--sidebar-shut) minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #0E161D, #0B1117 70%); border-right: 1px solid var(--line); overflow: hidden; z-index: 30; }
.sidebar-top { display: flex; align-items: center; height: 58px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.sidebar-brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.sidebar-brand .wordmark { font-size: 22px; }
.sidebar-brand .hub-word { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--muted); padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 4px; transform: translateY(-3px); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 16px; }
.nav-group-name { padding: 0 10px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 10px;
  border: 0; border-radius: 8px; background: transparent; color: #A8B8C4; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left;
}
.nav-item .svg-icon { color: var(--muted); }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item:hover .svg-icon { color: var(--text); }
.nav-item[aria-current="page"] { background: var(--panel-2); color: var(--text); }
.nav-item[aria-current="page"] .svg-icon { color: var(--page-hue); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--page-hue); }
.sidebar-bottom { border-top: 1px solid var(--line); padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: none; }
.sidebar-toggle { color: var(--muted); }
.person-block { display: flex; align-items: center; gap: 4px; padding: 4px 0 0; }
.person-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.person-link:hover, .person-link[aria-current="page"] { background: var(--panel-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-family: var(--font-display); font-weight: 700; font-size: 12.5px; color: #07120F; background: var(--hue-home); }
.avatar.is-marketing { background: var(--hue-library); color: #120E26; }
.person-text { display: flex; flex-direction: column; min-width: 0; }
.person-name { font-weight: 600; font-size: 13.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-role { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* shut: icons only, with a control to reopen it */
.sidebar-is-shut .sidebar-top { padding: 0; justify-content: center; }
.sidebar-is-shut .sidebar-brand .wordmark-long, .sidebar-is-shut .hub-word { display: none; }
.sidebar-is-shut .wordmark-short { display: inline; }
.wordmark-short { display: none; }
.sidebar-is-shut .nav-item { justify-content: center; padding: 0; }
.sidebar-is-shut .nav-item .nav-text, .sidebar-is-shut .nav-group-name, .sidebar-is-shut .person-text, .sidebar-is-shut .toggle-text, .sidebar-is-shut .mock-pill-who { display: none; }
.sidebar-is-shut .person-block { flex-direction: column; }
.sidebar-is-shut .person-link { justify-content: center; flex: none; }
.sidebar-is-shut .sidebar-toggle { justify-content: center; padding: 0; }
.sidebar-is-shut .nav-item:hover::after, .sidebar-is-shut .sidebar-toggle:hover::after {
  content: attr(data-label); position: fixed; left: calc(var(--sidebar-shut) + 8px); padding: 6px 10px; border-radius: 7px;
  background: var(--panel-3); border: 1px solid var(--line-strong); color: var(--text); font-size: 13px; white-space: nowrap; box-shadow: var(--shadow-lift); z-index: 50;
}

/* THE MOCK PILL - the mock's own control. Small, dashed, in a corner that
   holds no content. It never floats over the page. */
.mock-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 8px; border-radius: 99px; cursor: pointer;
  background: repeating-linear-gradient(-45deg, #141B22, #141B22 6px, #10171D 6px, #10171D 12px);
  border: 1px dashed #6E8496; color: var(--muted); font-size: 12px; white-space: nowrap; align-self: flex-start;
}
.mock-pill:hover { color: var(--text); border-color: var(--muted); }
.mock-pill-word { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--text); }
.mock-pill .svg-icon.small { width: 13px; height: 13px; }
.mock-pill.is-sidebar { margin: 0 0 4px 8px; }
.sidebar-is-shut .mock-pill.is-sidebar { margin: 0 auto 4px; padding: 0 6px; }
.sidebar-is-shut .mock-pill.is-sidebar .svg-icon { display: none; }
.mock-pill.is-phone { margin-left: auto; }
.mock-menu { position: fixed; z-index: 95; width: 280px; padding: 6px; background: var(--panel); border: 1px dashed #6E8496; border-radius: 12px; box-shadow: var(--shadow-lift); }
.mock-menu-head { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }
.mock-menu-label { padding: 10px 10px 4px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.mock-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; font-size: 13.5px; }
.mock-menu-item:hover, .mock-menu-item:focus-visible { background: var(--panel-2); }
.mock-menu-item .svg-icon { width: 17px; height: 17px; color: var(--muted); }
.mock-menu-item .tick { margin-left: auto; color: var(--choice); visibility: hidden; }
.mock-menu-item[aria-checked="true"] { color: var(--choice); }
.mock-menu-item[aria-checked="true"] .tick { visibility: visible; }
.mock-link { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border-radius: 6px; border: 1px dashed #6E8496; background: rgba(110,132,150,.06); color: var(--soft-text); font-size: 12.5px; cursor: pointer; vertical-align: middle; }
.mock-link b { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; font-weight: 500; padding: 1px 5px; border-radius: 4px; background: #2A3A48; color: var(--text); }
.mock-link:hover { border-color: var(--muted); color: var(--text); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar-mobile { display: none; }

/* THE BAND - every page's identity in one element.
   Full on desks and forms; one slim row on list pages; and on long pages a
   slim copy (the ghost) slides in once the full band has scrolled away. */
.band { position: relative; padding: 20px var(--gutter) 18px; border-bottom: 1px solid var(--line); background:
  radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--page-hue) 12%, transparent) 0%, transparent 46%), var(--ink); }
.band-row { display: flex; align-items: center; gap: 16px; }
.band-tile { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; color: var(--page-hue); background: color-mix(in srgb, var(--page-hue) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--page-hue) 38%, transparent); }
.band-tile .svg-icon { width: 24px; height: 24px; }
.band-words { min-width: 0; flex: 1; }
.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.breadcrumb .svg-icon { width: 14px; height: 14px; color: var(--faint); }
.breadcrumb button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.breadcrumb button:hover { color: var(--text); text-decoration: underline; }
.band h1 { font-size: 25px; line-height: 1.15; }
.band-lead { color: var(--muted); margin-top: 5px; font-size: 14.5px; }
.band-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.band-back { margin-right: 2px; }

.band.is-compact { padding: 9px var(--gutter); background: var(--ink); }
.band.is-compact .band-row { gap: 12px; min-height: 36px; }
.band.is-compact .band-tile { width: 30px; height: 30px; border-radius: 9px; }
.band.is-compact .band-tile .svg-icon { width: 17px; height: 17px; }
.band.is-compact h1 { font-size: 18px; white-space: nowrap; }
.band.is-compact .band-lead { margin: 6px 0 2px 42px; font-size: 13.5px; }
.band-inline { display: flex; align-items: center; gap: 16px; min-width: 0; overflow: hidden; margin-left: 6px; }
.band-stat { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.band-stat strong { color: var(--text); font-family: var(--font-display); font-size: 14px; }
.band-stat .svg-icon { width: 14px; height: 14px; }
.band-about { width: 30px; height: 30px; }
.band-about .svg-icon { width: 17px; height: 17px; }

.band-ghost { position: sticky; top: 0; z-index: 25; height: 0; overflow: visible; }
.band-ghost > .band-row { height: 54px; padding: 0 var(--gutter); background: rgba(11,17,23,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  transform: translateY(-100%); opacity: 0; transition: transform .2s var(--ease), opacity .2s; pointer-events: none; gap: 12px; }
.band-ghost.is-shown > .band-row { transform: none; opacity: 1; pointer-events: auto; }
.band-ghost .band-tile { width: 30px; height: 30px; border-radius: 9px; }
.band-ghost .band-tile .svg-icon { width: 17px; height: 17px; }
.band-ghost h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band-ghost .button { height: 34px; }

/* ===================================================================
   LAYER 3a - TEMPLATE: SEQUENCE (sign-in, reset, join)
   =================================================================== */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); --page-hue: var(--hue-signin); }
.signin-story {
  position: relative; overflow: hidden; padding: 40px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(80% 60% at 18% 30%, rgba(46,196,166,.11), transparent 70%), radial-gradient(70% 50% at 90% 100%, rgba(155,140,255,.09), transparent 70%), #0A1016;
  border-right: 1px solid var(--line);
}
.signin-story::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(231,236,240,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(231,236,240,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(70% 70% at 30% 40%, #000, transparent); pointer-events: none; }
.signin-story > * { position: relative; }
.signin-story .wordmark { font-size: 34px; }
.signin-statement { max-width: 560px; }
.signin-statement h1 { font-size: 48px; line-height: 1.05; letter-spacing: -0.025em; }
.signin-statement h1 em { font-style: normal; color: #8FDCCB; }
.signin-statement p { color: var(--muted); font-size: 17px; margin-top: 18px; max-width: 470px; }
.signin-ledger { display: flex; gap: 28px; flex-wrap: wrap; }
.signin-ledger div { display: flex; flex-direction: column; gap: 2px; }
.signin-ledger strong { font-family: var(--font-display); font-size: 26px; }
.signin-foot { color: var(--faint); font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; margin-top: 22px; }
.signin-side { position: relative; display: flex; align-items: center; justify-content: center; padding: 64px 32px; }
.signin-corner { position: absolute; top: 18px; left: 22px; }
.signin-card { width: min(470px, 100%); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-lift); overflow: hidden; }
.step-bar { display: flex; align-items: center; gap: 10px; padding: 13px 13px 13px 15px; border-bottom: 1px solid var(--line); background: #111A22; min-height: 64px; }
.step-bar .step-progress { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.step-dots { display: flex; gap: 6px; }
.step-dots span { height: 4px; flex: 1; border-radius: 4px; background: var(--line-strong); }
.step-dots span.is-done { background: var(--ok); }
.step-dots span.is-here { background: var(--choice); }
.step-name { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signin-body { padding: 24px 26px 26px; }
.signin-body h2 { font-size: 23px; }
.signin-body .lead { color: var(--muted); margin: 8px 0 20px; }
.signin-body .lead strong { color: var(--text); font-weight: 600; }
.lead-note { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); color: var(--soft-text); font-size: 13px; margin: -6px 0 12px; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--faint); font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.passkey-button { width: 100%; height: 44px; }
.passkey-hint { margin-top: 8px; text-align: center; }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-boxes input { height: 56px; width: 100%; text-align: center; font-family: var(--font-mono); font-size: 24px; border-radius: 10px; background: var(--ink-deep); border: 1px solid var(--line-strong); color: var(--text); }
.code-boxes input:hover { border-color: var(--muted); }
.code-boxes input:focus { outline: none; border-color: var(--soft-text); box-shadow: 0 0 0 3px rgba(220,230,238,.12); }
.code-boxes.is-wrong input { border-color: var(--danger); }
.code-boxes input:nth-child(3) { margin-right: 10px; }
.alt-ways { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.alt-ways:empty { display: none; }
.method-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.method-tile { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--panel-2); color: var(--soft-text); border: 1px solid var(--line-strong); flex: none; }
.method-tile .svg-icon { width: 23px; height: 23px; }
.passkey-wait { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 10px 0 6px; }
.passkey-ring { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--soft-text); animation: ring 1.6s ease-in-out infinite; }
.passkey-ring .svg-icon { width: 34px; height: 34px; }
@keyframes ring { 50% { box-shadow: 0 0 0 12px rgba(220,230,238,.06); } }
.welcome { text-align: center; padding: 6px 0 4px; }
.welcome .welcome-mark { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(76,195,138,.4); animation: pop .5s var(--ease); }
.welcome .welcome-mark .svg-icon { width: 36px; height: 36px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.welcome h2 { font-size: 26px; }
.signin-note { margin-top: 14px; }
.mock-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.join-steps { margin: 0 0 16px; padding-left: 20px; color: var(--soft-text); display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.join-steps b { color: var(--text); }
.method-choices { display: grid; gap: 10px; }
.method-choice { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--ink-deep); text-align: left; cursor: pointer; }
.method-choice:hover { border-color: var(--muted); }
.method-choice > span { display: flex; flex-direction: column; gap: 2px; }
.method-choice > span > span { color: var(--muted); font-size: 13.5px; }
.method-choice .svg-icon { color: var(--muted); margin-top: 2px; }
.method-choice[aria-pressed="true"] { border-color: var(--choice-line); background: var(--choice-soft); }
.method-choice[aria-pressed="true"] .svg-icon, .method-choice[aria-pressed="true"] b { color: var(--choice); }
.app-setup { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.fake-qr { display: grid; grid-template-columns: repeat(21, 1fr); width: 112px; height: 112px; padding: 6px; background: #E7ECF0; border-radius: 8px; }
.fake-qr i { display: block; }
.fake-qr i.on { background: #0B1117; }
.recovery-grid { list-style: none; margin: 0 0 12px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; background: var(--ink-deep); border: 1px solid var(--line-strong); border-radius: 10px; counter-reset: code; }
.recovery-grid li { font-family: var(--font-mono); font-size: 15px; letter-spacing: .08em; counter-increment: code; }
.recovery-grid li::before { content: counter(code, decimal-leading-zero); color: var(--faint); font-size: 11px; margin-right: 10px; }
.recovery-tools { display: flex; gap: 8px; margin-bottom: 14px; }
.tick-line { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 0; cursor: pointer; font-size: 14.5px; font-weight: 500; text-align: left; }
.check-box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; color: transparent; padding: 0; }
.check-box:hover, .tick-line:hover .check-box { border-color: var(--muted); }
.check-box .svg-icon { width: 14px; height: 14px; }
.check-box[aria-checked="true"], .tick-line[aria-checked="true"] .check-box { background: var(--choice); border-color: var(--choice); color: #1B0F06; }

/* ===================================================================
   LAYER 3b - TEMPLATE: DESK (the Homes)
   =================================================================== */
.page-home { --page-hue: var(--hue-home); }
.home-body { padding: 20px var(--gutter) 64px; display: flex; flex-direction: column; gap: 18px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.home-columns { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.home-columns > div { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.desk-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: var(--text); }
.desk-row:first-child { border-top: 0; padding-top: 2px; }
.desk-row:hover .desk-row-title { text-decoration: underline; text-underline-offset: 3px; }
.desk-row-words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.desk-row-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-row-meta { color: var(--muted); font-size: 12.5px; }
.desk-row-meta b { color: #E3B8A6; font-weight: 600; }
.row-chevron { color: var(--faint); width: 16px; height: 16px; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table th { text-align: left; padding: 0 10px 8px 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); }
.mini-table td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table tbody tr { cursor: pointer; }
.mini-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.mini-table tbody tr:hover .row-title { text-decoration: underline; text-underline-offset: 3px; }
.mini-table .row-title { font-weight: 500; }
.mini-table .numeric { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed::before { content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.feed-item { position: relative; display: flex; gap: 12px; padding: 8px 0; cursor: pointer; border-radius: 8px; }
.feed-item:hover .feed-what { text-decoration: underline; text-underline-offset: 3px; }
.feed-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--state-goneout); flex: none; position: relative; }
.feed-icon .svg-icon { width: 18px; height: 18px; }
.feed-what { font-size: 14px; font-weight: 500; line-height: 1.35; }
.feed-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.feed-item.is-new .feed-icon { box-shadow: 0 0 0 3px rgba(92,200,192,.25); }

.today-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; padding: 20px; align-items: center; }
.calendar-leaf { width: 96px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-strong); text-align: center; background: var(--ink-deep); align-self: start; }
.calendar-leaf .leaf-month { background: color-mix(in srgb, var(--hue-home) 22%, var(--panel)); color: var(--hue-home); font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; padding: 6px 0; }
.calendar-leaf .leaf-day { font-family: var(--font-display); font-size: 42px; font-weight: 700; line-height: 1; padding: 12px 0 2px; }
.calendar-leaf .leaf-weekday { color: var(--muted); font-size: 12px; padding-bottom: 10px; }
.suggestion { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; }
.suggestion-art { width: 150px; height: 150px; border-radius: 10px; border: 1px solid var(--line); display: block; background: #05080B; }
.suggestion-words { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.suggestion-words h3 { font-size: 21px; line-height: 1.25; }
.suggestion-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }
.suggestion-why { color: var(--muted); font-size: 13px; }
.post-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.post-card { display: flex; flex-direction: column; border-radius: 12px; border: 1px solid var(--line); background: var(--ink-deep); overflow: hidden; cursor: pointer; text-align: left; padding: 0; color: var(--text); transition: border-color .15s, transform .15s; }
.post-card:hover { border-color: var(--muted); transform: translateY(-2px); }
.post-card .post-card-art { aspect-ratio: 1 / 1; width: 100%; display: block; background: #05080B; }
.post-card .post-card-words { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.post-card .post-card-date { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; display: flex; justify-content: space-between; }
.post-card .post-card-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.evergreen-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.evergreen-row .post-card { flex: 0 0 160px; }

.check-list { list-style: none; margin: 0; padding: 0; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.check-item:first-child { border-top: 0; padding-top: 2px; }
.check-item .check-box { margin-top: 1px; }
.check-item.is-done .check-words .check-title { color: var(--muted); text-decoration: line-through; }
.check-words .check-title { font-size: 14px; font-weight: 500; }
.check-words .check-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.due-today { color: var(--choice); }

/* ===================================================================
   LAYER 3c - TEMPLATE: LIST AND DETAIL (the content library)
   On a laptop the page is exactly one screen tall; the list and the open
   item each scroll on their own and take everything below one slim band
   and one row of filters.
   =================================================================== */
.page-library { --page-hue: var(--hue-library); }
@media (min-width: 761px) {
  .main.is-list { height: 100vh; overflow: hidden; }
  .main.is-list .page-library { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .main.is-list .library-split { flex: 1; min-height: 0; }
  .main.is-list .list-pane, .main.is-list .detail-pane { height: 100%; min-height: 0; }
  .main.is-list .detail-pane { overflow-y: auto; scrollbar-width: thin; }
}

.filter-bar { display: flex; flex-direction: column; padding: 0 var(--gutter); background: var(--ink); border-bottom: 1px solid var(--line); flex: none; }
.filter-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; flex-wrap: nowrap; min-width: 0; }
.filter-row .search-wrap { flex: 1 1 220px; min-width: 170px; max-width: 360px; }
.filter-row .search-wrap .input { height: 36px; font-size: 14px; }
.filter-row .grow { flex: 1; }
.more-button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px 0 11px; border-radius: var(--radius-small); border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: 13.5px; cursor: pointer; white-space: nowrap; flex: none; }
.more-button:hover { border-color: var(--muted); }
.more-button .svg-icon { width: 16px; height: 16px; color: var(--muted); }
.more-button[aria-expanded="true"] { background: var(--panel-2); }
.more-button.is-set { border-color: var(--choice-line); color: var(--choice); }
.more-button.is-set .svg-icon { color: var(--choice); }
.more-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--choice); color: #1B0F06; font-family: var(--font-mono); font-size: 11px; display: grid; place-items: center; }
.clear-button { width: 32px; height: 32px; }
.filter-more { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; padding: 2px 0 12px; }
.more-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.more-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.more-hint { color: var(--muted); font-size: 12.5px; }
.sort-in-more { display: none; }

.library-split { display: grid; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); }
.list-pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; }
.list-scroll { flex: 1; overflow-y: auto; scrollbar-gutter: stable; scrollbar-width: thin; }
.list-row {
  display: flex; gap: 11px; width: 100%; padding: 11px 14px 11px var(--gutter); border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--text); text-align: left; cursor: pointer; position: relative;
}
.list-row:hover { background: rgba(255,255,255,.025); }
.list-row[aria-selected="true"] { background: var(--panel); }
.list-row[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--hue-library); }
.list-row .type-tile { width: 32px; height: 32px; }
.list-row .row-words { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.list-row .row-title { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-row .row-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.list-row .row-number { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.list-row.row-flash { animation: row-flash 1.6s ease; }
@keyframes row-flash { 0%, 40% { background: rgba(92,200,192,.12); } }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px 7px var(--gutter); border-top: 1px solid var(--line); background: var(--ink); flex: none; }
.result-count { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-family: var(--font-mono); }
.result-count strong { color: var(--text); font-weight: 600; }
.page-buttons { display: flex; gap: 2px; align-items: center; }
.page-button { min-width: 30px; height: 30px; padding: 0 5px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); font-family: var(--font-mono); font-size: 12px; cursor: pointer; display: grid; place-items: center; }
.page-button:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.page-button[aria-current="page"] { color: var(--choice); border-color: var(--choice-line); background: var(--choice-soft); }
.page-button:disabled { opacity: .35; cursor: not-allowed; }
.page-button .svg-icon { width: 16px; height: 16px; }
.page-gap { color: var(--faint); padding: 0 2px; font-family: var(--font-mono); }

.detail-pane { min-width: 0; container-type: inline-size; container-name: detail; }
.detail-head { position: sticky; top: 0; z-index: 10; background: rgba(11,17,23,.96); backdrop-filter: blur(8px); padding: 14px var(--gutter) 0; border-bottom: 1px solid var(--line); }
.detail-head-row { display: flex; align-items: flex-start; gap: 12px; }
.detail-back { display: none; }
.detail-title-block { min-width: 0; flex: 1; }
.detail-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 22px; }
.detail-kicker .mono-label { margin-right: 2px; }
.detail-title-block h2 { font-size: 20px; line-height: 1.25; margin-top: 4px; }
.detail-forward { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
.detail-tabs-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.latest-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; margin-left: auto; padding-bottom: 2px; }
.latest-line span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.latest-line .svg-icon { width: 15px; height: 15px; color: var(--state-goneout); }
.latest-line strong { color: var(--text); font-weight: 600; }
.latest-line.is-fresh { animation: latest-in 1.8s ease; border-radius: 6px; }
@keyframes latest-in { 0% { background: rgba(92,200,192,.18); } 100% { background: transparent; } }
.detail-body { padding: 20px var(--gutter) 48px; container-type: inline-size; }
.detail-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.detail-tools .grow { flex: 1; }

.caption-paper { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; white-space: pre-wrap; font-size: 15.5px; line-height: 1.7; max-width: 760px; }
.caption-paper .hashtag { color: var(--soft-text); text-decoration: underline dotted var(--faint); text-underline-offset: 4px; }
.caption-paper .cta-line { display: block; margin-top: 4px; color: var(--text); font-weight: 600; }
.caption-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 760px; margin-top: 14px; }
.fact { padding: 11px 13px; border-radius: 11px; background: var(--ink-deep); border: 1px solid var(--line); min-width: 0; }
.fact .fact-value { margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }
.fact.is-wide { grid-column: 1 / -1; }

/* the side column sits beside the poster only with room for real sentences */
.poster-stage { display: grid; grid-template-columns: minmax(0, 420px) minmax(300px, 1fr); gap: 24px; align-items: start; }
.poster-frame { border-radius: 14px; overflow: hidden; border: 1px solid var(--line-strong); background: #05080B; box-shadow: var(--shadow-lift); }
.poster-frame canvas { display: block; width: 100%; height: auto; }
.poster-frame.is-story { max-width: 280px; }
.poster-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.poster-side .field + .field { margin-top: 0; }
.poster-side .field-hint { max-width: 46ch; }

.log-list { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.log-entry { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.log-entry .log-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); flex: none; color: var(--state-goneout); }
.log-entry.is-published .log-icon { color: var(--state-published); }
.log-entry.is-before-hub .log-icon, .log-entry.is-undo .log-icon { color: var(--muted); }
.log-entry .log-what { font-weight: 600; font-size: 14.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.log-entry .log-who { color: var(--muted); font-size: 13px; margin-top: 2px; }
.log-entry.is-fresh { animation: latest-in 2s ease; }
.log-entry.is-undone .log-place { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }
.log-entry.is-undone .log-icon { opacity: .5; }
.taken-back { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--danger); border: 1px solid rgba(240,119,107,.4); border-radius: 4px; padding: 1px 6px; font-weight: 500; }
.log-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.log-entry .log-when { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; margin-left: auto; }
.log-rule { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; margin-top: 14px; max-width: 760px; }
.log-rule .svg-icon { margin-top: 2px; }

.article-read { max-width: 740px; font-size: 16px; line-height: 1.75; }
.article-read h1 { font-size: 27px; line-height: 1.2; margin: 0 0 18px; }
.article-read h2 { font-size: 21px; margin: 32px 0 10px; }
.article-read h3 { font-size: 17px; margin: 24px 0 8px; }
.article-read p { margin: 0 0 16px; color: #D5DEE5; }
.article-read ul, .article-read ol { margin: 0 0 16px; padding-left: 22px; color: #D5DEE5; }
.article-read li { margin-bottom: 6px; }
.article-read blockquote { margin: 0 0 18px; padding: 12px 16px; border-left: 3px solid var(--hue-library); background: var(--panel); border-radius: 0 10px 10px 0; color: var(--text); }
.article-read blockquote p { margin: 0; }
.article-read code { font-family: var(--font-mono); font-size: .86em; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.article-read pre { background: var(--panel); border: 1px solid var(--line); padding: 14px; border-radius: 10px; overflow-x: auto; }
.article-read hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.article-read .table-wrap { overflow-x: auto; margin: 0 0 18px; }
.article-read table { border-collapse: collapse; width: 100%; font-size: 14px; }
.article-read th, .article-read td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.article-read th { font-weight: 600; color: var(--text); background: var(--panel); }
.article-read .md-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.article-read strong { color: var(--text); }
.detail-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 760px; }
.detail-empty { display: grid; place-items: center; min-height: 100%; padding: 32px; }

@container detail (max-width: 700px) {
  .detail-tabs-row { flex-direction: column-reverse; align-items: stretch; gap: 4px; }
  .latest-line { margin-left: 0; }
}
@container (max-width: 760px) {
  .poster-stage { grid-template-columns: minmax(0, 1fr); }
  .poster-frame { max-width: 420px; }
  .caption-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 460px) {
  .caption-facts, .detail-facts { grid-template-columns: minmax(0, 1fr); }
}

/* ===================================================================
   LAYER 3d - TEMPLATE: SETTINGS (Your account; the brand kit's frame)
   =================================================================== */
.page-settings { --page-hue: var(--hue-account); }
.settings-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; padding: 22px var(--gutter) 72px; align-items: start; }
.settings-index { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 2px; }
.settings-index a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.settings-index a:hover { background: var(--panel-2); color: var(--text); }
.settings-groups { display: flex; flex-direction: column; gap: 18px; max-width: 900px; min-width: 0; }
.settings-group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-large); }
.settings-group-head { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.settings-group-head > .svg-icon { color: var(--muted); margin-top: 2px; }
.settings-group-head h2 { font-size: 17px; }
.settings-group-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.settings-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: start; }
.settings-row:first-child { border-top: 0; }
.settings-name { font-weight: 600; font-size: 14.5px; }
.settings-hint { color: var(--muted); font-size: 13px; margin-top: 2px; }
.settings-control { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.settings-control .input { max-width: 380px; }
.settings-empty { font-size: 13.5px; }
.read-only { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: var(--radius-small); background: var(--ink-deep); border: 1px dashed var(--line-strong); color: var(--soft-text); font-size: 14px; }
.read-only .svg-icon { color: var(--faint); }
.passkey-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.passkey-line { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: var(--radius-small); border: 1px solid var(--line-strong); background: var(--ink-deep); font-size: 14px; }
.passkey-line > .svg-icon { color: var(--muted); width: 17px; height: 17px; }
.passkey-line .button { margin-left: auto; }
.recovery-meter { display: flex; gap: 4px; }
.recovery-meter i { width: 18px; height: 8px; border-radius: 3px; background: var(--line-strong); }
.recovery-meter i.is-left { background: var(--ok); }

/* ===================================================================
   LAYER 4 - PAGES
   =================================================================== */
/* ---- the brand kit ---- */
.page-brand { --page-hue: var(--hue-brand); }
.brand-section { scroll-margin-top: 70px; }
.brand-section + .brand-section { margin-top: 18px; padding-top: 26px; border-top: 1px solid var(--line); }
.brand-section-head { margin-bottom: 14px; }
.brand-section-head h2 { font-size: 21px; }
.brand-section-head p { color: var(--muted); margin-top: 3px; font-size: 14px; }
.brand-subhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 10px; }
.brand-subhead h3 { font-size: 15px; }
.brand-subhead .muted { font-size: 13px; }
.asset-grid { display: grid; gap: 12px; }
.asset-grid.is-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.asset-grid.is-avatars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.asset-grid.is-covers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.asset-card { margin: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.asset-art { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); display: grid; place-items: center; background: var(--ink-deep); }
.asset-art canvas { display: block; width: 100%; height: auto; }
.asset-art.is-see-through { background-image: linear-gradient(45deg, #222d38 25%, transparent 25%), linear-gradient(-45deg, #222d38 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #222d38 75%), linear-gradient(-45deg, transparent 75%, #222d38 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-color: #18222c; }
.asset-art.is-see-through.is-light { background-color: #c9d1d8; background-image: linear-gradient(45deg, #e3e8ec 25%, transparent 25%), linear-gradient(-45deg, #e3e8ec 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e3e8ec 75%), linear-gradient(-45deg, transparent 75%, #e3e8ec 75%); }
.asset-art.is-round { background: transparent; border: 0; padding: 6px; }
.asset-art.is-round canvas { border-radius: 50%; max-width: 132px; box-shadow: 0 0 0 1px var(--line-strong); }
.asset-card figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); min-width: 0; }
.asset-card figcaption b { color: var(--text); font-size: 14px; }
.asset-card figcaption .mono-text { font-size: 11.5px; overflow-wrap: anywhere; }
.asset-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.swatch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.swatch { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-align: left; cursor: pointer; min-width: 0; }
.swatch:hover { border-color: var(--muted); }
.swatch-chip { width: 52px; height: 52px; border-radius: 9px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.swatch-words { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; }
.swatch-words b { font-size: 14px; }
.swatch-words .mono-text { color: var(--soft-text); }
.swatch-role { color: var(--muted); font-size: 12.5px; }
.swatch-copy { margin-left: auto; color: var(--faint); }
.swatch:hover .swatch-copy { color: var(--text); }
.font-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.font-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; align-items: flex-start; }
.font-sample { line-height: 1.25; color: var(--text); min-height: 64px; }
.font-meta { display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: var(--muted); }
.font-meta b { color: var(--text); font-size: 14px; }
.pillar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pillar-card { display: flex; gap: 12px; align-items: stretch; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-align: left; cursor: pointer; }
.pillar-card:hover { border-color: var(--muted); }
.pillar-bar { width: 10px; border-radius: 5px; flex: none; }
.pillar-words { display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: var(--muted); }
.pillar-words b { font-family: var(--font-mono); letter-spacing: .08em; color: var(--text); font-weight: 500; }
.pillar-note { margin-top: 6px; font-size: 12.5px; color: var(--soft-text); }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rule-card { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.rule-card.is-do { border-left: 3px solid var(--ok); }
.rule-card.is-dont { border-left: 3px solid var(--danger); }
.rule-demo { border-radius: 8px; overflow: hidden; display: grid; place-items: center; min-height: 92px; background: var(--ink-deep); border: 1px solid var(--line); padding: 10px; text-align: center; }
.rule-verdict { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; }
.is-do .rule-verdict { color: var(--ok); }
.is-dont .rule-verdict { color: var(--danger); }
.rule-words b { display: block; margin-top: 4px; font-size: 14.5px; }
.rule-words p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.demo-ground .wordmark { font-size: 26px; }
.demo-fake-button { display: inline-block; padding: 8px 14px; border-radius: 6px; background: var(--amber); color: #1B1205; font-weight: 600; font-size: 13px; }
.demo-amber { position: relative; }
.demo-amber::after { content: ""; position: absolute; left: -6px; right: -6px; top: 50%; height: 2px; background: var(--danger); transform: rotate(-12deg); }
.demo-line { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.25; }
.demo-line.is-struck { text-decoration: line-through; text-decoration-color: var(--danger); text-decoration-thickness: 2px; color: var(--muted); }
.demo-number b { display: block; font-family: var(--font-display); font-size: 30px; line-height: 1; }
.demo-number span { color: var(--muted); font-size: 12px; }
.demo-console { position: relative; width: 120px; height: 66px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel); padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.demo-console i { display: block; height: 6px; border-radius: 3px; background: var(--line-strong); }
.demo-console i:nth-child(2) { width: 70%; } .demo-console i:nth-child(3) { width: 45%; }
.demo-console span { font-family: var(--font-mono); font-size: 9px; color: var(--muted); text-align: left; }
.demo-console::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 2px; background: var(--danger); transform: rotate(-24deg); }
.demo-poster { width: 92px; height: 92px; border-radius: 6px; background: radial-gradient(circle at 25% 25%, #16222D, #0B1117); display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 8px; text-align: left; }
.demo-poster .wordmark { font-size: 10px; }
.demo-poster b { font-family: var(--font-display); font-size: 14px; line-height: 1.05; color: #F2A6C9; }
.demo-cta { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.demo-dot { width: 9px; height: 9px; border-radius: 50%; background: #25D366; flex: none; }

/* ---- mock-only pages: the template kit, the mail previews ---- */
.page-kit { --page-hue: var(--hue-kit); }
.band.is-mock-page { background: repeating-linear-gradient(-45deg, rgba(20,27,34,.6), rgba(20,27,34,.6) 10px, rgba(16,23,29,.6) 10px, rgba(16,23,29,.6) 20px), var(--ink); }
.mock-page-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; padding: 2px 6px; border-radius: 4px; border: 1px dashed #6E8496; color: var(--text); }
.kit-body { padding: 22px var(--gutter) 72px; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.template-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-large); min-width: 0; }
.template-head { display: flex; gap: 12px; align-items: flex-start; }
.template-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--soft-text); }
.template-head h2 { font-size: 18px; }
.template-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.template-facts { display: grid; gap: 12px; }
.template-facts h3 { font-size: 13px; font-family: var(--font-mono); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.template-facts ul { margin: 0; padding-left: 18px; color: var(--soft-text); font-size: 13.5px; display: flex; flex-direction: column; gap: 3px; }
.template-facts p { color: var(--soft-text); font-size: 13.5px; }
.blue-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--forward); }
.template-pages { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); margin-top: auto; }
.template-pages .mono-label { margin-right: 4px; }
/* the schematic drawings - boxes, never pictures */
.schema { position: relative; height: 170px; border-radius: 10px; background: var(--ink-deep); border: 1px solid var(--line); display: grid; gap: 5px; padding: 6px; }
.schema i, .schema b, .schema em { display: block; border-radius: 4px; }
.schema i { background: var(--panel-2); border: 1px solid var(--line-strong); position: relative; }
.schema b { background: var(--line-strong); height: 8px; margin: 6px; }
.schema em.s-blue { position: absolute; right: 6px; top: 6px; width: 34px; height: 12px; background: var(--forward); }
.schema em.s-back { position: absolute; left: 6px; top: 6px; width: 24px; height: 12px; border: 1px solid var(--muted); }
.schema.is-list { grid-template-columns: 34px 120px 1fr; grid-template-rows: 16px 18px 1fr; }
.schema.is-list .s-nav { grid-row: 1 / 4; }
.schema.is-list .s-band, .schema.is-list .s-filters { grid-column: 2 / 4; }
.schema.is-list .s-more { position: absolute; right: 6px; top: 3px; width: 40px; height: 10px; border: 1px dashed var(--choice-line); }
.schema.is-list .s-list b { height: 14px; margin: 5px; }
.schema.is-list .s-detail .s-tabs { position: absolute; left: 0; right: 0; top: 26px; height: 2px; margin: 0 6px; background: var(--choice-line); }
.schema.is-sequence { grid-template-columns: 1fr 1fr; }
.schema.is-sequence .s-story { background: linear-gradient(160deg, var(--panel-2), var(--ink-deep)); }
.schema.is-sequence .s-card { align-self: center; height: 120px; margin: 0 14px; }
.schema.is-sequence .s-bar { position: relative; height: 24px; margin: 0; border-radius: 4px 4px 0 0; background: var(--panel-3); }
.schema.is-sequence .s-dots { position: absolute; left: 38px; right: 46px; top: 10px; height: 4px; background: var(--choice-line); }
.schema.is-sequence .s-field { height: 14px; margin: 12px 10px 0; }
.schema.is-settings { grid-template-columns: 34px 60px 1fr; grid-template-rows: 30px 1fr; }
.schema.is-settings .s-nav { grid-row: 1 / 3; }
.schema.is-settings .s-band { grid-column: 2 / 4; }
.schema.is-settings .s-back { left: 6px; }
.schema.is-settings .s-groups b { height: 32px; margin: 6px; background: var(--panel-3); border: 1px solid var(--line-strong); }
.schema.is-desk { grid-template-columns: 34px 1.5fr 1fr; grid-template-rows: 30px 26px 1fr; }
.schema.is-desk .s-nav { grid-row: 1 / 4; }
.schema.is-desk .s-band, .schema.is-desk .s-stats { grid-column: 2 / 4; }
.schema.is-desk .s-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; background: none; border: 0; }
.schema.is-desk .s-stats b { height: auto; margin: 0; background: var(--panel-2); border: 1px solid var(--line-strong); }
.schema.is-desk .s-left b, .schema.is-desk .s-right b { height: 34px; background: var(--panel-3); }

.mail-layout { display: grid; grid-template-columns: minmax(0, 680px) minmax(240px, 1fr); gap: 20px; align-items: start; }
.mail-controls { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.mail-window { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-large); overflow: hidden; min-width: 0; }
.mail-meta { display: grid; gap: 4px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mail-meta > div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.mail-frame { display: block; width: 100%; height: 820px; border: 0; background: #F3F5F7; }
.mail-text { margin: 0; padding: 20px; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; color: var(--soft-text); background: var(--ink-deep); }
.mail-notes { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; }
.placeholder-list { margin: 8px 0 10px; padding-left: 18px; color: var(--soft-text); font-size: 13px; }

/* ===================================================================
   NARROWER SCREENS
   =================================================================== */
@media (max-width: 1280px) {
  .band-inline .band-stat:nth-child(n+3) { display: none; }
}
@media (max-width: 1180px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-columns { grid-template-columns: minmax(0, 1fr); }
  .library-split { grid-template-columns: minmax(290px, 330px) minmax(0, 1fr); }
  .signin-statement h1 { font-size: 40px; }
  .template-grid, .rule-grid { grid-template-columns: minmax(0, 1fr); }
  .asset-grid.is-avatars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swatch-grid, .pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mail-layout { grid-template-columns: minmax(0, 1fr); }
  .mail-notes { position: static; }
}
@media (max-width: 1100px) {
  .sort-in-row { display: none; }
  .sort-in-more { display: flex; }
  .band-inline { display: none; }
  .settings-body { grid-template-columns: minmax(0, 1fr); }
  .settings-index { display: none; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .app, .app.sidebar-is-shut { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .24s var(--ease); box-shadow: var(--shadow-lift); }
  .app.drawer-is-open .sidebar { transform: none; }
  .drawer-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(5,9,13,.6); }
  .sidebar-toggle, .mock-pill.is-sidebar { display: none !important; }
  .topbar-mobile { display: flex; position: sticky; top: 0; z-index: 22; align-items: center; gap: 10px; height: 54px; padding: 0 10px 0 6px; background: rgba(11,17,23,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .topbar-mobile .wordmark { font-size: 20px; }
  .avatar-button { border: 0; background: none; padding: 0; cursor: pointer; }
  .topbar-mobile .avatar { width: 30px; height: 30px; font-size: 11.5px; }
  .band-ghost { display: none; }

  .band { padding: 14px var(--gutter) 14px; }
  .band-row { gap: 12px; align-items: flex-start; flex-wrap: wrap; }
  .band-tile { width: 38px; height: 38px; border-radius: 11px; }
  .band-tile .svg-icon { width: 20px; height: 20px; }
  .band h1 { font-size: 20px; }
  .band-lead { font-size: 13.5px; }
  .band-words { flex-basis: calc(100% - 60px); }
  .band-actions { width: 100%; justify-content: flex-end; }
  .band.is-compact .band-row { flex-wrap: nowrap; align-items: center; }
  .band.is-compact .band-actions { width: auto; }
  .band.is-compact .band-lead { margin-left: 0; }
  .band-actions .forward-long { display: none; }
  .band-actions .forward-short { display: inline; }
  .breadcrumb { font-size: 12px; }

  .home-body { padding: 14px var(--gutter) 48px; gap: 14px; }
  .stat-row { gap: 10px; }
  .stat-tile { padding: 13px; }
  .stat-tile .stat-number { font-size: 26px; }
  .stat-tile .stat-what { font-size: 12.5px; }
  .card-head { padding: 14px 16px 0; }
  .card-body { padding: 10px 16px 14px; }
  .today-hero { grid-template-columns: 1fr; padding: 16px; gap: 14px; }
  .calendar-leaf { display: none; }
  .suggestion { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .suggestion-art { width: 96px; height: 96px; }
  .suggestion-words h3 { font-size: 17px; }
  .post-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .post-card .post-card-words { padding: 8px; }
  .post-card .post-card-title { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .mini-table .hide-narrow { display: none; }

  .filter-row { flex-wrap: wrap; gap: 8px; }
  .filter-row .search-wrap { max-width: none; flex-basis: 100%; }
  .filter-row .grow { display: none; }
  .state-segments { order: 5; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .library-split { display: block; }
  .list-pane { border-right: 0; }
  .list-scroll { overflow: visible; }
  .list-row { padding: 12px var(--gutter); }
  .pagination { padding: 10px var(--gutter) 24px; }
  .detail-pane { position: fixed; inset: 0; z-index: 40; background: var(--ink); overflow-y: auto; display: none; }
  .library-split.detail-is-open .detail-pane { display: block; }
  .detail-head { padding: 10px var(--gutter) 0; }
  .detail-back { display: inline-flex; }
  .detail-head-row { flex-wrap: wrap; }
  .detail-head-row > .type-tile { display: none; }
  .detail-title-block { order: 3; flex-basis: 100%; }
  .detail-title-block h2 { font-size: 18px; }
  .detail-forward { order: 2; }
  .detail-forward .forward-long { display: none; }
  .detail-forward .forward-short { display: inline; }
  .detail-body { padding: 16px var(--gutter) 64px; }
  .caption-paper { padding: 14px 16px; font-size: 15px; }
  .poster-frame.is-story { max-width: 240px; }
  .place-grid { grid-template-columns: 1fr; }
  .dialog-head, .dialog-body, .dialog-actions { padding-left: 18px; padding-right: 18px; }
  .dialog-actions .button { white-space: normal; height: auto; min-height: 40px; padding: 10px 14px; text-align: center; }
  .dialog .segmented { flex-wrap: wrap; }
  .toast-stack { right: 16px; bottom: 16px; }
  .log-entry { flex-wrap: wrap; }
  .log-side { flex-direction: row; align-items: center; margin-left: 50px; width: calc(100% - 50px); justify-content: space-between; }

  .signin { grid-template-columns: minmax(0, 1fr); }
  .step-bar .button-forward { max-width: 46%; }
  .step-bar .button-forward { white-space: normal; text-align: left; line-height: 1.15; height: auto; min-height: 36px; padding: 6px 10px; }
  .signin-story { padding: 20px 18px 22px; border-right: 0; border-bottom: 1px solid var(--line); gap: 16px; }
  .signin-story .wordmark { font-size: 26px; }
  .signin-statement h1 { font-size: 27px; }
  .signin-statement p { font-size: 14.5px; margin-top: 8px; }
  .signin-ledger, .signin-foot { display: none; }
  .signin-side { padding: 12px 12px 40px; flex-direction: column; align-items: stretch; }
  .signin-corner { position: static; align-self: flex-end; margin-bottom: 10px; }
  .signin-body { padding: 18px 16px; }
  .step-bar { padding: 10px; gap: 8px; }
  .step-bar .button { padding: 0 10px; }
  .code-boxes { gap: 6px; }
  .code-boxes input { height: 50px; font-size: 20px; }
  .code-boxes input:nth-child(3) { margin-right: 6px; }
  .app-setup { grid-template-columns: 1fr; }

  .settings-body { padding: 14px var(--gutter) 48px; }
  .settings-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 16px; }
  .settings-group-head { padding: 14px 16px 12px; }
  .band-back { order: -1; }

  .asset-grid.is-logos, .asset-grid.is-covers, .font-grid, .swatch-grid, .pillar-grid { grid-template-columns: minmax(0, 1fr); }
  .rule-card { grid-template-columns: 110px minmax(0, 1fr); }
  .kit-body { padding: 14px var(--gutter) 48px; }
  .mail-controls .segmented { overflow-x: auto; max-width: 100%; }
  .mail-meta > div { grid-template-columns: 64px minmax(0, 1fr); }
}
.dialog-actions > .button:only-child { margin-left: auto; }
