/* Atlas · Chart Room (dark) and Paper (light).
   One accent (lamp amber) for what is live or needs you; note kinds are told apart by
   shape (map-legend glyphs), agents by their own colour. Fonts are vendored (OFL). */

@font-face { font-family: "Geist"; src: url("vendor/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("vendor/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("vendor/fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("vendor/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --radius: 14px;
  --acc: #F4BF4F;
  /* Chart Room */
  --bg: #0B0E13; --bg-2: #0E1218; --sunk: #0F1319; --stage: #090C10; --surface: #11151C; --raised: #171C25; --raised-2: #1C2230;
  --line: #232A36; --line-2: #1E2530; --line-3: #1A2029; --line-strong: #2A3240;
  --text: #ECE9E2; --text-hi: #FFFFFF; --text-2: #CBD0D8; --soft: #A7AEBA; --faint: #8C94A1; --dim: #3A4150; --track: #262E3B;
  --grid: #121820; --edge: #343F52;
  --insight: #82AAFF; --map: #BBA0FF; --capture: #67CFE0; --source: #9AA3B0; --question: #F07C8C; --sketch: #F59AC8; --sketch-dim: #7A4D66; --project: #5FD4B2;
  --ok: #6FD39A; --ok-bg: #1D2B1A; --bad: #F07C8C; --warn-bg: #2A2312; --warn-fg: #E9C877;
  --agent-1: #EE9670; --agent-2: #C2E27A; --agent-3: #82AAFF; --agent-4: #BBA0FF; --agent-5: #67CFE0; --agent-6: #F59AC8;
  --you-bg: #ECE9E2; --you-fg: #0B0E13;
  --info-bg: #0F2228; --info-line: #1E3C44; --info-text: #CFE9EE;
  --note-bg: #12160E; --note-line: #2C3A1E; --note-text: #DCE3CF;
  --link-bg: #151C2B; --link-fg: #C9D8FF;
  --on-acc: #15110A; --acc-ink: var(--acc);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F2F3F5; --bg-2: #EBEDF0; --sunk: #F7F8FA; --stage: #FBFBFC; --surface: #FFFFFF; --raised: #ECEEF2; --raised-2: #E4E8EE;
    --line: #DDE1E7; --line-2: #E2E5EA; --line-3: #E8EBEF; --line-strong: #C9CFD8;
    --text: #14171C; --text-hi: #000000; --text-2: #2B313B; --soft: #4A5260; --faint: #626B78; --dim: #B9C0CA; --track: #DDE1E7;
    --grid: #EEF0F3; --edge: #C3CAD4;
    --insight: #2F5BD3; --map: #7048D0; --capture: #0B7C90; --source: #6B7380; --question: #C23A50; --sketch: #C2407F; --sketch-dim: #E9A9C8; --project: #0F7A60;
    --ok: #1D7F4C; --ok-bg: #DDF1E5; --bad: #C23A50; --warn-bg: #FBF0D4; --warn-fg: #7A5200;
    --agent-1: #B4532A; --agent-2: #4E7A16; --agent-3: #2F5BD3; --agent-4: #7048D0; --agent-5: #0B7C90; --agent-6: #C2407F;
    --you-bg: #14171C; --you-fg: #FFFFFF;
    --info-bg: #E3F4F7; --info-line: #B7E0E8; --info-text: #0E4D59;
    --note-bg: #F3F7EA; --note-line: #D4E4B8; --note-text: #2F4410;
    --link-bg: #E7EDFB; --link-fg: #1F3F9E;
    --acc-ink: #7A5F27;
    --shadow: 0 1px 2px rgba(20, 23, 28, .06), 0 10px 28px rgba(20, 23, 28, .08);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F2F3F5; --bg-2: #EBEDF0; --sunk: #F7F8FA; --stage: #FBFBFC; --surface: #FFFFFF; --raised: #ECEEF2; --raised-2: #E4E8EE;
  --line: #DDE1E7; --line-2: #E2E5EA; --line-3: #E8EBEF; --line-strong: #C9CFD8;
  --text: #14171C; --text-hi: #000000; --text-2: #2B313B; --soft: #4A5260; --faint: #626B78; --dim: #B9C0CA; --track: #DDE1E7;
  --grid: #EEF0F3; --edge: #C3CAD4;
  --insight: #2F5BD3; --map: #7048D0; --capture: #0B7C90; --source: #6B7380; --question: #C23A50; --sketch: #C2407F; --sketch-dim: #E9A9C8; --project: #0F7A60;
  --ok: #1D7F4C; --ok-bg: #DDF1E5; --bad: #C23A50; --warn-bg: #FBF0D4; --warn-fg: #7A5200;
  --agent-1: #B4532A; --agent-2: #4E7A16; --agent-3: #2F5BD3; --agent-4: #7048D0; --agent-5: #0B7C90; --agent-6: #C2407F;
  --you-bg: #14171C; --you-fg: #FFFFFF;
  --info-bg: #E3F4F7; --info-line: #B7E0E8; --info-text: #0E4D59;
  --note-bg: #F3F7EA; --note-line: #D4E4B8; --note-text: #2F4410;
  --link-bg: #E7EDFB; --link-fg: #1F3F9E;
  --acc-ink: #7A5F27;
  --shadow: 0 1px 2px rgba(20, 23, 28, .06), 0 10px 28px rgba(20, 23, 28, .08);
  color-scheme: light;
}

/* kinds: a hue per family, a shape per kind (see .g) */
[data-t] { --hue: var(--faint); }
[data-t="insight"], [data-t="frame"] { --hue: var(--insight); }
[data-t="map"] { --hue: var(--map); }
[data-t="capture"] { --hue: var(--capture); }
[data-t="source"], [data-t="external"] { --hue: var(--source); }
[data-t="question"] { --hue: var(--question); }
[data-t="sketch"], [data-t="spec"] { --hue: var(--sketch); }
[data-t="project"], [data-t="thread"], [data-t="decision"], [data-t="lesson"], [data-t="group"] { --hue: var(--project); }
[data-t="note"], [data-t="you"] { --hue: var(--text); }
[data-t="agent"] { --hue: var(--soft); }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--text-hi); text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
[hidden] { display: none !important; }  /* components set display; hidden must still win */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::placeholder { color: var(--faint); }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 13px; height: 13px; }
svg.i.ok { stroke: var(--ok); stroke-width: 1.9; }
@keyframes atlasPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); flex: none; animation: atlasPulse 1.6s ease-in-out infinite; display: inline-block; }
@media (prefers-reduced-motion: reduce) { .pulse, .av .dot.working { animation: none; } }
.mono { font-family: var(--mono); }
.kicker { font: 500 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }

/* glyphs: the shape of a kind */
.g { width: 12px; height: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.g::before { content: ""; box-sizing: border-box; width: 8px; height: 8px; border-radius: 50%; background: var(--hue); }
.g[data-t="map"]::before { width: 7px; height: 7px; border-radius: 0; background: none; border: 1.5px solid var(--hue); transform: rotate(45deg); }
.g[data-t="capture"]::before { width: 9px; height: 9px; background: none; border: 1.5px dashed var(--hue); }
.g[data-t="source"]::before, .g[data-t="group"]::before, .g[data-t="you"]::before { border-radius: 2px; background: none; border: 1.5px solid var(--hue); }
.g[data-t="frame"]::before { width: 10px; height: 8px; border-radius: 0; background: none; border-top: 1.5px solid var(--hue); border-bottom: 1.5px solid var(--hue); }
.g[data-t="question"]::before, .g[data-t="agent"]::before { background: none; border: 1.5px solid var(--hue); }
.g[data-t="sketch"]::before, .g[data-t="spec"]::before { width: 0; height: 0; border-radius: 0; background: none; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--hue); }
.g[data-t="sketch"]::before { border-bottom-color: var(--sketch-dim); }
.g[data-t="project"]::before, .g[data-t="note"]::before { border-radius: 2px; }
.g[data-t="thread"]::before { width: 10px; height: 2.5px; border-radius: 2px; }
.g[data-t="decision"]::before { width: 7px; height: 7px; border-radius: 0; transform: rotate(45deg); }
.g[data-t="lesson"]::before { background: none; border: 2px solid var(--hue); }

/* avatars: an agent's colour and monogram; the user is ink */
.av { --av: var(--agent-3); position: relative; width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--av) 20%, var(--surface)); color: var(--av); font: 600 10.5px/1 var(--sans); letter-spacing: .01em; }
.av.sq { border-radius: 8px; }
.av.you { background: var(--you-bg); color: var(--you-fg); font-weight: 700; }
.av.s { width: 20px; height: 20px; font-size: 8.5px; } .av.s.sq { border-radius: 6px; }
.av.m { width: 22px; height: 22px; font-size: 9.5px; } .av.m.sq { border-radius: 7px; }
.av.l { width: 30px; height: 30px; font-size: 11px; } .av.l.sq { border-radius: 9px; }
.av .dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); background: var(--faint); }
.av .dot.listening { background: var(--ok); }
.av .dot.working { background: var(--acc); animation: atlasPulse 1.6s ease-in-out infinite; }
.av .dot.away { background: var(--soft); }

/* ------------------------------------------------------------------ shell */
.topbar { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: -.01em; color: var(--text); white-space: nowrap; min-height: 40px; }
.brand:hover { text-decoration: none; }
.brand svg { width: 22px; height: 22px; fill: none; stroke: var(--acc-ink); stroke-width: 1.6; }
.search { flex: 1; max-width: 620px; }
.search-box { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--faint); }
.search-box:focus-within { border-color: var(--soft); }
.search-box input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font: inherit; font-size: 14px; }
kbd { font: 11px var(--mono); padding: 2px 6px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--soft); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.presence { display: flex; align-items: center; gap: 6px; }
.ppill { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px 0 6px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; }
.ppill:hover { border-color: var(--line-strong); text-decoration: none; }
.ppill .st { font: 11px var(--mono); color: var(--faint); }
.ppill .st.working { color: var(--acc-ink); } .ppill .st.listening { color: var(--ok); } .ppill .st.away { color: var(--soft); }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.unread-dot { position: absolute; top: 3px; right: 1px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px; background: var(--acc); color: var(--on-acc); font: 600 10.5px/17px var(--sans); text-align: center; box-shadow: 0 0 0 2px var(--bg); }

.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 60px); }
body.chat-open .layout { grid-template-columns: 232px minmax(0, 1fr) var(--chat-w, 360px); }
.sidebar { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; padding: 16px 12px 32px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.nav-section { margin: 18px 10px 6px; display: flex; align-items: center; font: 500 10.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.nav-section a { margin-left: auto; letter-spacing: .06em; color: var(--soft); }
.nav-group { padding: 4px 10px 2px 32px; font-size: 12px; color: var(--faint); }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 8px; color: var(--soft); font-size: 13.5px; }
.nav-link:hover { background: var(--raised); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--raised); color: var(--text); font-weight: 500; }
.nav-link.primary { min-height: 36px; font-size: 14px; }
.nav-link .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-flow { align-self: center; display: inline-flex; align-items: center; gap: 6px; height: 26px; margin: 3px 0; padding: 0 13px 0 10px; border: 1px solid color-mix(in srgb, var(--acc) 45%, var(--line)); border-radius: 99px;
  background: color-mix(in srgb, var(--acc) 10%, transparent); color: var(--acc-ink); font: 500 11px var(--mono); letter-spacing: .03em; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.nav-flow svg { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.nav-flow:hover, .nav-flow:focus-visible { background: color-mix(in srgb, var(--acc) 20%, transparent); border-color: var(--acc); outline: none; }
.nav-flow:hover svg, .nav-flow:focus-visible svg { transform: translateY(2px); }
.nav-flow:active { transform: scale(.96); }
.nav-flow.idle { color: var(--faint); border-color: var(--line); background: none; }  /* nothing waiting: present, not calling */
dialog.confirm { width: min(440px, calc(100vw - 32px)); padding: 22px 22px 18px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog.confirm::backdrop { background: rgb(0 0 0 / .5); }
dialog.confirm h2 { margin: 0 0 8px; font: 400 26px/1.15 var(--serif); }
dialog.confirm p { margin: 0 0 18px; color: var(--text-2); line-height: 1.55; }
.confirm-acts { display: flex; justify-content: flex-end; gap: 8px; }
.nav-link .count { font: 11px var(--mono); color: var(--faint); }
.nav-link.zero { opacity: .55; }
.nav-link .new-count, .nav-link .unread-count { font: 600 10.5px/1 var(--mono); padding: 3px 6px; border-radius: 99px; background: var(--acc); color: var(--on-acc); }
.nav-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 4px 10px 0 32px; font-size: 12px; color: var(--faint); }
.nav-sub a { color: var(--soft); }

.main { min-width: 0; padding: 36px 40px 72px; overflow-x: hidden; }
.main.bleed { padding: 0; overflow: hidden; }
.loading, .empty { color: var(--faint); padding: 32px 0; }

/* the operator dock (right) */
.dock { display: none; position: sticky; top: 60px; height: calc(100vh - 60px); border-left: 1px solid var(--line-2); background: var(--bg-2); flex-direction: column; min-width: 0; }
body.chat-open .dock { display: flex; }
.dock-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; z-index: 6; cursor: col-resize; touch-action: none; }
.dock-grip::after { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.dock-grip:hover::after, body.dock-resizing .dock-grip::after { background: var(--acc); }
body.dock-resizing { cursor: col-resize; user-select: none; }
body.dock-resizing iframe { pointer-events: none; }
.dock-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.dock-title { font-weight: 600; }
.dock-sub { font-size: 12px; color: var(--faint); }
.dock .chat-log { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px; display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------------------------------------------ building blocks */
.sec-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 14px; }
.sec-h h2 { margin: 0; font: 500 11.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.sec-h h2.acc { color: var(--acc-ink); }
.sec-h .sub { font-size: 13px; color: var(--faint); }
.sec-h .more { margin-left: auto; font-size: 13px; color: var(--soft); }
h1.serif, .serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.005em; }
h1.page { margin: 0; font: 400 clamp(44px, 5vw, 64px)/1 var(--serif); letter-spacing: -.01em; }
.page-sub { margin: 10px 0 0; max-width: 700px; font-size: 16.5px; line-height: 1.55; color: var(--soft); }
.page-sub b { color: var(--text); font-weight: 600; }
.hero { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; }
.hero-row > :first-child { flex: 1 1 420px; }
.acc-text { color: var(--acc-ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--soft); text-decoration: none; color: var(--text); }
/* actions are ink; amber is kept for what is live or needs you */
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.btn.primary:hover { opacity: .88; color: var(--bg); border-color: var(--text); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--soft); }
.btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn.outline { background: transparent; }
.btn.mono { font-family: var(--mono); font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; background: var(--raised); color: var(--soft); font: 11.5px/1.5 var(--mono); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge.bad { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--bad); }
.badge.acc { background: color-mix(in srgb, var(--acc) 16%, var(--surface)); color: var(--acc-ink); }
.badge.agent { background: color-mix(in srgb, var(--av) 13%, var(--surface)); color: var(--av); }
.badge.kind { background: none; padding: 0; color: var(--hue); letter-spacing: .12em; text-transform: uppercase; gap: 7px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 3px 10px; border-radius: 99px; background: var(--raised); border: 1px solid var(--line); font-size: 12.5px; color: var(--text); }
.chip:hover { border-color: var(--hue, var(--line-strong)); text-decoration: none; }
.chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--text); transition: border-color .12s, transform .12s; }
a.card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--hue) 55%, var(--line)); transform: translateY(-1px); color: var(--text); }
.card-kind { display: flex; align-items: center; gap: 7px; font: 10.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.card-kind .k { color: var(--hue); }
.card-title { font-weight: 600; font-size: 14.5px; line-height: 1.38; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-desc { color: var(--soft); font-size: 13.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font: 11.5px var(--mono); color: var(--faint); }
.list { display: flex; flex-direction: column; gap: 10px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input { height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; min-width: 260px; outline: none; }
.toolbar input:focus { border-color: var(--soft); }
.facet { min-height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--soft); font-size: 12.5px; cursor: pointer; }
.facet .n { opacity: .6; margin-left: 4px; font-family: var(--mono); }
.facet.on { background: var(--raised-2); border-color: var(--soft); color: var(--text); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.seg button { min-height: 32px; padding: 0 12px; border-radius: 7px; border: 0; background: transparent; color: var(--soft); font-size: 12.5px; cursor: pointer; }
.seg button.on, .seg button[aria-pressed="true"] { background: var(--raised-2); color: var(--text); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
body.undo-on .toast:not(.undo) { bottom: 82px; }
.toast.undo { display: flex; align-items: center; gap: 14px; padding: 6px 6px 6px 16px; }
.toast.undo .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 48ch; }
.toast.undo .n { font: 11px var(--mono); opacity: .7; }
.undo-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border-radius: 8px; border: 0; background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); font-weight: 600; cursor: pointer; }
.undo-btn kbd { border-color: color-mix(in srgb, var(--bg) 35%, transparent); color: inherit; opacity: .8; }

/* hover card: where a link goes */
.hovercard { position: fixed; z-index: 70; width: min(360px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); pointer-events: none; display: flex; flex-direction: column; gap: 6px; }
.hc-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font: 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.hc-kind .k { color: var(--hue); }
.hc-title { font: 400 19px/1.2 var(--serif); color: var(--text); overflow-wrap: anywhere; }
.hc-desc { font-size: 13px; line-height: 1.5; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hc-meta { font: 11.5px var(--mono); color: var(--faint); }

/* quote bar: over a selected passage */
.quote-bar { position: fixed; z-index: 65; display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: var(--text); box-shadow: var(--shadow); }
.quote-bar button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--bg); font-size: 13px; font-weight: 500; cursor: pointer; }
.quote-bar button:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); }
.bubble .q { display: block; margin: 2px 0 6px; padding: 2px 0 2px 10px; border-left: 2px solid var(--line-strong); color: var(--soft); font-style: italic; }
.bubble .qsrc { display: block; margin-top: 4px; font: normal 11px var(--mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble .qsrc::before { content: "— "; }

/* drop a file or link */
.drop-veil { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(3px); pointer-events: none; }
.drop-box { max-width: 460px; padding: 34px 40px; border-radius: 18px; border: 2px dashed var(--capture); background: var(--surface); text-align: center; display: flex; flex-direction: column; gap: 8px; }
.drop-box .serif { font-size: 36px; line-height: 1.1; }
.drop-box p { margin: 0; color: var(--soft); }

/* palette (⌘K) */
.pal-back { position: fixed; inset: 0; z-index: 75; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(2px); }
.pal { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); overflow: hidden; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 52px; border-bottom: 1px solid var(--line-2); color: var(--faint); }
.pal-in input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font: 16px var(--sans); }
.pal-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; }
.pal-sec { padding: 10px 10px 4px; font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.pal-row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.pal-row .ico { flex: none; width: 18px; display: inline-flex; justify-content: center; color: var(--soft); }
.pal-row .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-row .lbl .faint { color: var(--faint); }
.pal-row .sub { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11.5px var(--mono); color: var(--faint); }
.pal-row.on { background: var(--raised-2); color: var(--text); }
.pal-empty { padding: 18px 12px; color: var(--faint); }
.pal-foot { display: flex; gap: 16px; padding: 10px 10px 4px; margin-top: 4px; border-top: 1px solid var(--line-3); font-size: 12px; color: var(--faint); }
.pal-foot kbd { margin-right: 4px; }

/* ------------------------------------------------------------------ home */
.main { container-type: inline-size; }
.home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: 36px; row-gap: 44px; align-items: start;
  grid-template-areas: "hero hero" "shift shift" "metab metab" "needs feed" "recent recent"; }
.home > .hero { grid-area: hero; margin: 0; }
.home > .h-shift { grid-area: shift; } .home > .h-metab { grid-area: metab; } .home > .h-needs { grid-area: needs; }
.home > .h-feed { grid-area: feed; } .home > .h-recent { grid-area: recent; }
.needs-all { display: none; margin-top: 8px; }
.needs-list.clip .need:nth-child(n+6) { display: none; }  /* the five most pressing; the rest behind "show all" */
.needs-all.d { display: inline-flex; }
@container (max-width: 640px) {
  .home { grid-template-columns: minmax(0, 1fr); row-gap: 34px; grid-template-areas: "hero" "needs" "shift" "metab" "feed" "recent"; }
  .needs-list.clip .need:nth-child(n+4) { display: none; }  /* on top of a narrow page: the first three, then "show all" */
  .needs-all { display: inline-flex; }
  .need { padding: 12px 14px; gap: 10px 12px; }
}
.home-greet { font: 400 clamp(46px, 5.4vw, 66px)/1 var(--serif); letter-spacing: -.01em; margin: 0; }
.home-sec { margin-top: 44px; }
.shift { display: flex; flex-wrap: wrap; gap: 14px; }
.agent-card { flex: 1 1 280px; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.agent-card.working { flex-grow: 1.5; border-color: color-mix(in srgb, var(--acc) 30%, var(--line)); }
.agent-card .ac-head { display: flex; align-items: center; gap: 10px; }
.agent-card .ac-name { font-weight: 600; font-size: 15px; }
.agent-card .ac-state { margin-left: auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.agent-card .ac-state.working { color: var(--acc-ink); } .agent-card .ac-state.listening { color: var(--ok); } .agent-card .ac-state.away { color: var(--soft); }
.agent-card .ac-state .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.agent-card .ac-task { font-size: 15.5px; line-height: 1.45; overflow-wrap: anywhere; }
.agent-card .ac-last { font-size: 14px; line-height: 1.55; color: var(--soft); overflow-wrap: anywhere; }
.agent-card .ac-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.agent-card .ac-foot .meta { margin-left: auto; font: 11.5px var(--mono); color: var(--faint); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--soft); }
.steps li { display: flex; align-items: flex-start; gap: 10px; overflow-wrap: anywhere; }
.steps li svg, .steps li .pulse { margin-top: 3px; }
.steps li .pulse { margin-left: 3px; margin-right: 4px; }
.steps li.live { color: var(--text); }
.dispatch { border-style: dashed; border-width: 1.5px; border-color: var(--line-strong); background: transparent; }

.metab { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; padding: 14px; }
.stage { flex: 1 1 150px; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 10px; background: var(--raised); color: var(--text); min-width: 0; }
a.stage:hover { text-decoration: none; color: var(--text); outline: 1px solid color-mix(in srgb, var(--hue) 45%, transparent); }
.stage .num { font: 500 36px/1.05 var(--mono); letter-spacing: -.03em; }
.stage .num small { font-size: 20px; color: var(--faint); }
.stage .what { font-size: 12.5px; color: var(--soft); }
.stage .what.acc { color: var(--acc-ink); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.spark span { flex: 1; border-radius: 2px; background: var(--hue); opacity: .35; min-height: 2px; }
.spark span.today { opacity: 1; }
.flow-arrow { flex: 0 0 22px; display: flex; align-items: center; justify-content: center; color: var(--dim); }
.flow-sep { flex: 0 0 1px; margin: 8px 6px; background: var(--line); }

.cols { display: flex; flex-wrap: wrap; gap: 36px; }
.cols > * { flex: 1 1 340px; min-width: 0; }
.cols > .wide { flex-grow: 1.3; }
.needs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.need { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.need .ico { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--raised); display: inline-flex; align-items: center; justify-content: center; color: var(--soft); }
.need .ico .g { transform: scale(1.3); }
.need .txt { flex: 1 1 180px; min-width: 0; }
.need .t { font-weight: 600; overflow-wrap: anywhere; }
.need .s { font-size: 13px; color: var(--soft); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.need .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.feed-day { margin: 14px 0 0; font-size: 13px; font-weight: 600; color: var(--soft); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-3); }
.feed .time { flex: none; width: 44px; padding-top: 2px; font: 11.5px var(--mono); color: var(--faint); }
.feed li.unseen .time { color: var(--acc-ink); }
.feed .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; color: var(--soft); overflow-wrap: anywhere; }
.feed .body b { color: var(--text); font-weight: 600; }
.feed .verb { font: 12.5px var(--mono); color: var(--soft); }
.feed li.grp summary { cursor: pointer; list-style: none; }
.feed li.grp summary::-webkit-details-marker { display: none; }
.feed li.grp summary::after { content: " ›"; color: var(--faint); }
.feed li.grp details[open] summary::after { content: " ⌄"; }
.feed.sub { margin: 6px 0 2px; padding-left: 10px; border-left: 1px solid var(--line); }
.feed.sub li { padding: 8px 0; border-top: 0; }
.feed.sub li .av { display: none; }

/* snooze a row of Needs you */
.later { position: relative; }
.later > summary { list-style: none; padding: 0 9px; }
.later > summary::-webkit-details-marker { display: none; }
.later-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 150px; display: flex; flex-direction: column; padding: 4px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.later-menu button { all: unset; padding: 8px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.later-menu button:hover { background: var(--raised); }
.snoozed { margin-top: 12px; font-size: 13px; color: var(--faint); }
.snoozed summary { cursor: pointer; }
.snoozed .mini-list { margin-top: 10px; }
.snoozed .t { color: var(--soft); }
.snoozed .btn { min-height: 28px; }

/* the tour: an invitation on Home, and the walk itself */
.tour-cta { display: flex; align-items: center; gap: 14px; margin: 0 0 6px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--acc) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--acc) 35%, var(--line)); color: var(--text); }
a.tour-cta:hover { text-decoration: none; border-color: var(--acc); color: var(--text); }
.tour-cta .play { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--acc); color: var(--on-acc); display: inline-flex; align-items: center; justify-content: center; }
.tour-cta .play svg { width: 13px; height: 13px; }
.tour-cta .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--soft); }
.tour-cta .txt b { font-size: 14.5px; color: var(--text); }
.tour-cta.quiet { background: var(--surface); border-color: var(--line); border-style: dashed; }
.tour-hero { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 28px; max-width: 820px; }
.tour-intro { font-size: 16px; color: var(--soft); }
.tour { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.tour-rail { flex: 1 1 260px; max-width: 340px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; }
.tour-rail button { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--soft); cursor: pointer; }
.tour-rail button:hover { background: var(--raised); color: var(--text); }
.tour-rail li.on button { background: var(--raised); color: var(--text); }
.tour-rail .n { flex: none; width: 20px; font: 11.5px/20px var(--mono); color: var(--faint); text-align: right; }
.tour-rail li.on .n { color: var(--hue, var(--text)); }
.tour-rail .t { flex: 1; min-width: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tour-rail .look { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--acc); }
.tour-stage { flex: 999 1 520px; min-width: 0; max-width: 820px; display: flex; flex-direction: column; gap: 16px; padding: 24px 28px; scroll-margin-top: 80px; }
.stop-k { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.stop-title { display: flex; align-items: flex-start; gap: 10px; font: 400 30px/1.14 var(--serif); color: var(--text); overflow-wrap: anywhere; }
.stop-title .g { margin-top: 12px; transform: scale(1.3); }
.stop-why { font-size: 16.5px; }
.stop-quote blockquote { margin: 0; }
.stop-desc { margin: 0; font-size: 15px; line-height: 1.6; color: var(--soft); }
.stop-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); }
.banner .reader { font: inherit; color: inherit; }
.banner .reader p { margin: 0; display: inline; }
.stop-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 6px; }
.stop-acts .sp { flex: 1; }
.rest-group { display: flex; flex-direction: column; gap: 10px; }
details.rest-group summary { cursor: pointer; font-size: 14px; color: var(--text-2); }
details.rest-group[open] summary { margin-bottom: 10px; }

/* ------------------------------------------------------------------ reader */
.reader-wrap { display: flex; flex-wrap: wrap; gap: 0; margin: -36px -40px -72px; }
.reader-main { flex: 999 1 520px; min-width: 0; padding: 40px clamp(20px, 4vw, 56px) 64px; display: flex; justify-content: center; }
.reader-col { width: 100%; max-width: 740px; display: flex; flex-direction: column; gap: 22px; }
.margin { flex: 1 1 280px; min-width: 0; padding: 36px 26px 48px; border-left: 1px solid var(--line-2); background: var(--bg-2); display: flex; flex-direction: column; gap: 30px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); }
.crumbs a { color: var(--soft); }
.crumbs .nav { margin-left: auto; display: flex; align-items: center; gap: 6px; font: 12px var(--mono); color: var(--faint); }
.crumbs .nav .icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); }
.crumbs .nav .icon-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font: 11.5px var(--mono); color: var(--faint); }
.e-title { margin: 0; font: 400 clamp(36px, 3.6vw, 50px)/1.06 var(--serif); letter-spacing: -.01em; overflow-wrap: anywhere; text-wrap: balance; }
.e-title.t-m { font-size: clamp(30px, 2.7vw, 38px); line-height: 1.12; }
.e-title.t-s { font-size: clamp(26px, 2.2vw, 31px); line-height: 1.16; }
.e-title.t-xs { font-size: clamp(22px, 1.8vw, 26px); line-height: 1.22; }
.e-desc { margin: 0; font-size: 18px; line-height: 1.55; color: var(--soft); }
.fixes { display: inline-block; }
.fixes summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 2px 3px 2px 10px; border-radius: 99px; cursor: pointer;
  background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); font: 11.5px var(--mono); }
.fixes summary::-webkit-details-marker { display: none; }
.fixes summary .btn { min-height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11px; }
.fixes[open] { flex-basis: 100%; }
.fixes ul { margin: 8px 0 0; padding: 10px 14px 10px 30px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font: 13px/1.55 var(--sans); color: var(--soft); max-height: 220px; overflow-y: auto; }
.trust { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding: 16px 18px; }
.meter { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; }
.meter .bars { display: flex; gap: 4px; }
.meter .bars span { flex: 1; height: 6px; border-radius: 3px; background: var(--track); }
.meter .bars span.on { background: var(--hue, var(--insight)); }
.meter .labels { display: flex; justify-content: space-between; gap: 6px; font: 11px var(--mono); color: var(--faint); }
.meter .labels .cur { color: var(--text); }
.meter.ended .bars span { background: var(--track); }
.trust-lines { flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--soft); }
.trust-lines span { display: flex; align-items: flex-start; gap: 8px; }
.trust-lines svg { margin-top: 2px; }
.banner { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info-text); }
.banner.attn { background: color-mix(in srgb, var(--acc) 9%, var(--surface)); border-color: color-mix(in srgb, var(--acc) 35%, var(--line)); color: var(--text); }
.banner.attn svg { color: var(--acc-ink); }
.banner.quiet { background: var(--sunk); border-color: var(--line-2); color: var(--soft); }
.banner.bad { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); color: var(--text); }
.banner svg { margin-top: 2px; }
.reader { font: 16.5px/1.75 var(--sans); color: var(--text-2); overflow-wrap: anywhere; }
.reader > :first-child { margin-top: 0; }
.reader > h1:first-child { display: none; }
.reader h1, .reader h2, .reader h3, .reader h4 { color: var(--text); letter-spacing: -.01em; line-height: 1.3; margin: 1.5em 0 .5em; font-weight: 600; }
.reader h1 { font-size: 1.3em; } .reader h2 { font-size: 1.12em; } .reader h3 { font-size: 1.02em; }
.reader p, .reader ul, .reader ol { margin: 0 0 1em; }
.reader li { margin: .25em 0; }
.reader strong { color: var(--text); }
.reader blockquote { margin: 1.2em 0; padding: 16px 20px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line-2); font: 21px/1.38 var(--serif); color: var(--text); }
.reader blockquote p { margin: 0; }
.reader code { font: .86em var(--mono); background: var(--raised); color: var(--text); padding: .12em .4em; border-radius: 5px; }
.reader pre { background: var(--sunk); border: 1px solid var(--line-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
.reader pre code { background: none; padding: 0; font-size: 13px; line-height: 1.55; }
.reader table { border-collapse: collapse; font: 14px/1.45 var(--sans); margin: 1em 0; display: block; overflow-x: auto; }
.reader th, .reader td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.reader th { background: var(--raised); color: var(--text); }
.reader hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }
.reader a { color: var(--text); text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }
.reader a[href^="#/e/"] { text-decoration: none; padding: 0 7px; border-radius: 6px; background: var(--link-bg); color: var(--link-fg); }
.reader a[href^="#/e/"]:hover { filter: brightness(1.1); }
.reader a[href^="#/missing/"] { color: var(--bad); text-decoration: underline dashed; }
.reader img { max-width: 100%; border-radius: 8px; }
.rel-table { display: flex; flex-direction: column; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.rel-table > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 11px 16px; background: var(--surface); }
.rel-table > div + div { border-top: 1px solid var(--line-3); }
.rel-table .rel { flex: 0 0 104px; font: 11.5px var(--mono); color: var(--soft); }
.rel-table .rel.in { color: var(--faint); }
.rel-table a { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.moves-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; }
.moves-bar .lbl { padding: 0 6px; font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.moves-bar .sep { width: 1px; height: 22px; margin: 0 2px; background: var(--line); }
.margin h3 { margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.margin h3 a { margin-left: auto; font: 12.5px var(--sans); letter-spacing: 0; text-transform: none; color: var(--soft); }
.chain { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 16px; }
.chain::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.chain li { position: relative; display: flex; gap: 14px; }
.chain .node { flex: none; width: 13px; height: 13px; margin-top: 3px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-2); }
.chain li.here .node::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--hue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hue) 22%, var(--bg-2)); }
.chain .k { display: block; font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.chain li.here .k { color: var(--hue); }
.chain a, .chain span.t { font-size: 13.5px; overflow-wrap: anywhere; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; }
.mini-list li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-list a, .mini-list .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .when { margin-left: auto; flex: none; font: 11px var(--mono); color: var(--faint); }
.mini-list.hist li { align-items: flex-start; }
.mini-list.hist .t { white-space: normal; color: var(--soft); font-size: 13px; }
.path { font: 11.5px var(--mono); color: var(--faint); overflow-wrap: anywhere; }
.neigh-box { position: relative; border-radius: 12px; background: var(--stage); border: 1px solid var(--line-2); overflow: hidden; }
svg.neigh { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; }
svg.neigh line { stroke: var(--edge); stroke-width: 1.2; }
svg.neigh line.in { stroke-dasharray: 3 3; }
svg.neigh text { font: 10.5px var(--sans); fill: var(--soft); }
svg.neigh a:hover text { fill: var(--text); }
.neigh-key { padding: 8px 12px; font-size: 11.5px; color: var(--faint); border-top: 1px solid var(--line-2); }

/* ------------------------------------------------------------------ projects */
.group-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; padding-bottom: 12px; margin: 0 0 16px; border-bottom: 1px solid var(--line-2); }
.group-h h2 { margin: 0; font: italic 400 30px/1.1 var(--serif); }
.group-h .rules { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); min-width: 0; flex: 1 1 260px; }
.group-h .rules span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-h .more { margin-left: auto; font-size: 13px; color: var(--soft); }
.pcards { display: flex; flex-wrap: wrap; gap: 16px; }
.pcard { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.pcard.live { border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); }
.pcard.paused .p-title { color: var(--soft); }
.p-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.p-head .g { transform: scale(1.25); }
.p-title { font: 400 30px/1 var(--serif); color: var(--text); }
.p-alias { font-size: 12.5px; color: var(--faint); }
.live-strip { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--acc) 13%, var(--surface)); font-size: 13px; }
.live-strip .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.live-strip .t b { font-weight: 600; }
.p-last { display: flex; flex-direction: column; gap: 4px; }
.p-last .txt { font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.p-next { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--soft); overflow-wrap: anywhere; }
.p-next svg { margin-top: 3px; }
.p-next b { color: var(--text); font-weight: 500; }
.p-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.p-stats a, .p-stats div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--raised); color: var(--text); }
.p-stats a:hover { text-decoration: none; outline: 1px solid var(--line-strong); }
.p-stats .n { font: 500 22px/1.15 var(--mono); letter-spacing: -.02em; }
.p-stats .n.zero { color: var(--faint); } .p-stats .n.acc { color: var(--acc-ink); }
.p-stats .l { font-size: 12px; color: var(--soft); }
.p-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-top: 2px; }
.p-foot .co { flex: 1 1 160px; min-width: 0; display: inline-flex; align-items: center; gap: 6px; font: 11.5px var(--mono); color: var(--faint); overflow-wrap: anywhere; }
.p-foot .co.warn { color: var(--faint); }
.sparkline { width: 112px; height: 22px; flex: none; }
.sparkline path { fill: var(--project); }
.across { display: flex; flex-direction: column; gap: 28px; }
.across h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.across h3.acc { color: var(--acc-ink); }
.xcard { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
a.xcard:hover { text-decoration: none; border-color: var(--line-strong); color: var(--text); }
.xcard + .xcard { margin-top: 8px; }
.xcard .s { font: 11px var(--mono); color: var(--faint); }
.xcard .blk { padding: 6px 10px; border-radius: 8px; background: var(--raised); color: var(--text-2); font-size: 13px; }

/* project page */
.p-hero h1 { margin: 0; font: 400 clamp(52px, 6vw, 76px)/.95 var(--serif); letter-spacing: -.01em; overflow-wrap: anywhere; }
.p-hero .row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.p-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font: 12px var(--mono); color: var(--faint); }
.p-meta span { display: inline-flex; align-items: center; gap: 6px; }
.p-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px; margin-top: 32px; }
.p-layout > .main-col { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 40px; }
.p-layout > .side-col { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.h-serif { margin: 0; font: 400 30px/1.15 var(--serif); }
.left-off { display: flex; flex-direction: column; gap: 16px; padding: 24px 26px; border-radius: 18px; }
.left-off .lines { display: flex; flex-direction: column; gap: 12px; }
.left-off .line { display: flex; gap: 12px; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.left-off .line .th { display: block; font: 11px var(--mono); color: var(--faint); margin-bottom: 2px; }
.thread-list { display: flex; flex-direction: column; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.thread { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.thread + .thread { border-top: 1px solid var(--line-3); }
.thread.live { background: color-mix(in srgb, var(--acc) 6%, var(--surface)); }
.thread .th-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.thread .th-title { font-size: 16px; font-weight: 600; }
.thread .row { display: flex; gap: 10px; font-size: 14px; line-height: 1.5; }
.thread .row .k { flex: none; width: 58px; padding-top: 2px; font: 11.5px var(--mono); color: var(--faint); }
.thread .row .k.warn { color: var(--bad); }
.thread .row .blk { padding: 2px 10px; border-radius: 8px; background: var(--raised); color: var(--text-2); }
.thread .log { list-style: none; margin: 0 0 0 68px; padding: 0 0 0 14px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.5; color: var(--soft); }
.thread .log .w { font: 11.5px var(--mono); color: var(--faint); }
.dec-proposed { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 20px; border-radius: 16px; background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--acc) 55%, var(--line)); }
.dec-proposed .txt { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dec-proposed .t { font-size: 16px; font-weight: 600; }
.dec-list { display: flex; flex-direction: column; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.dec-list > a { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 20px; color: var(--text); }
.dec-list > a:hover { background: var(--raised); text-decoration: none; }
.dec-list > a + a { border-top: 1px solid var(--line-3); }
.dec-list .t { flex: 1 1 280px; font-size: 14.5px; }
.dec-list .when { font: 11.5px var(--mono); color: var(--faint); }
.dec-list .sup .t { text-decoration: line-through; text-decoration-color: var(--dim); color: var(--faint); }
.lessons { display: flex; flex-wrap: wrap; gap: 14px; }
.lesson { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.lesson.provisional { border-style: dashed; border-color: var(--line-strong); }
.lesson .t { font-size: 15.5px; font-weight: 600; line-height: 1.4; color: var(--text); }
.lesson .ev { font-size: 13px; line-height: 1.5; color: var(--soft); }
.boot-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--track); }
.boot-bar span { height: 100%; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; font-size: 12.5px; color: var(--soft); }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.cmd { font: 12px var(--mono); padding: 6px 10px; border-radius: 8px; background: var(--sunk); border: 1px solid var(--line-2); color: var(--soft); overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.timeline li { position: relative; display: flex; gap: 14px; }
.timeline .dot { flex: none; width: 11px; height: 11px; margin-top: 4px; border-radius: 50%; background: var(--av, var(--faint)); box-shadow: 0 0 0 3px var(--bg); }
.timeline .w { display: block; font: 11px var(--mono); color: var(--faint); }
.timeline .t { font-size: 13.5px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ chat: messages and blocks */
.amsg { display: flex; gap: 12px; align-self: stretch; }
.amsg .abody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.amsg .who { font: 11px var(--mono); color: var(--faint); }
.umsg { align-self: flex-end; max-width: 84%; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.umsg .ctx { font: 10.5px var(--mono); color: var(--faint); text-align: right; }
.bubble { max-width: 100%; min-width: 0; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--raised-2); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.via { padding: 6px 12px; border-radius: 99px; font-size: 13px; }
.bubble code { font: .88em var(--mono); }
.msg.system { align-self: center; font-size: 12.5px; color: var(--faint); text-align: center; }
.day-div { display: flex; align-items: center; gap: 12px; font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.day-div::before, .day-div::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.run { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line-2); }
.run.live { border-color: color-mix(in srgb, var(--acc) 30%, var(--line)); }
.run .run-h { display: flex; align-items: center; gap: 8px; font: 11px var(--mono); color: var(--faint); }
.run .run-h .live-tag { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--acc-ink); }
.run .steps { font-size: 13px; gap: 6px; }
.typing { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--acc-ink); }
.bmd.reader { font: 14.5px/1.6 var(--sans); color: var(--text); }
.dock .bmd.reader { font-size: 13.5px; }
.bmd.reader p:last-child { margin-bottom: 0; }
.bmd.reader blockquote { font-size: 17px; padding: 10px 14px; }
.btitle { font: 500 10.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.berror { font-size: 12.5px; color: var(--bad); }
.opened { font: 11.5px var(--mono); color: var(--faint); }
.opened a { color: var(--soft); }
.bnotes { display: flex; flex-direction: column; gap: 8px; }
.bnote { border-radius: 12px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--hue) 30%, var(--line)); overflow: hidden; }
.bnote-head { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; cursor: pointer; }
.bnote-head:hover { background: var(--raised); }
.bnote-head:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.bnote-kind { display: flex; align-items: center; gap: 8px; font: 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.bnote-kind .k { color: var(--hue); }
.bnote-kind .caret { margin-left: auto; transition: transform .15s; display: inline-flex; }
.bnote.open .bnote-kind .caret { transform: rotate(180deg); }
.bnote-title { font: 400 20px/1.18 var(--serif); color: var(--text); overflow-wrap: anywhere; }
.dock .bnote-title { font-size: 17px; }
.bnote-desc { font-size: 13px; color: var(--soft); overflow-wrap: anywhere; }
.bnote-body { padding: 4px 14px 14px; border-top: 1px solid var(--line-2); }
.bnote-body .reader { font-size: 14.5px; max-height: 420px; overflow-y: auto; margin: 12px 0; }
.bnote-moves { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.bchoices { display: flex; flex-wrap: wrap; gap: 6px; }
.bchoices .btitle { width: 100%; margin-bottom: 0; font: 13px var(--sans); letter-spacing: 0; text-transform: none; color: var(--soft); }
.choice { min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--acc) 35%, var(--line)); background: color-mix(in srgb, var(--acc) 8%, var(--surface)); color: var(--text); font-size: 13px; cursor: pointer; text-align: left; }
.choice:hover:not(:disabled) { border-color: var(--acc); }
.choice:disabled { opacity: .5; cursor: default; }
.choice.chosen { opacity: 1; border-color: var(--acc); background: color-mix(in srgb, var(--acc) 18%, var(--surface)); }
.bcheck { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.bcheck label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.bcheck input { accent-color: var(--text); }
.bcheck .btn { align-self: flex-start; margin-top: 6px; }
.bchart, .bgraph { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { font: 11px var(--sans); fill: var(--soft); }
.bgraph svg.neigh { max-width: 380px; margin: 0 auto; }
iframe.bhtml { width: 100%; height: 240px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: block; }

/* composer */
.composer { position: relative; margin: 0; padding: 12px 16px 16px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.composer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; color: var(--faint); min-height: 0; }
.composer-meta:empty { display: none; }
.to-select { appearance: none; min-height: 30px; padding: 0 28px 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238C94A1' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 8px center / 12px; color: var(--text); font: 12px var(--sans); cursor: pointer; }
.ctx-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; max-width: 100%; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); font: 11.5px var(--mono); color: var(--soft); overflow: hidden; }
.ctx-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-chip input { margin: 0; accent-color: var(--text); }
.ctx-chip[hidden] { display: none; }
.composer-box { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.composer-box:focus-within { border-color: var(--soft); }
.composer-box textarea { flex: 1; min-width: 0; resize: none; background: transparent; border: 0; outline: none; color: var(--text); font: 14px/1.5 var(--sans); max-height: 200px; }
.send { flex: none; width: 38px; height: 38px; border-radius: 9px; border: 0; background: var(--text); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.send svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cmd-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 30; display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; }
.cmd-pop .cmd { all: unset; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.cmd-pop .cmd b { font: 500 12.5px var(--mono); color: var(--text); }
.cmd-pop .cmd .args { font: 12px var(--mono); color: var(--faint); }
.cmd-pop .cmd .help { flex: 1 1 160px; font-size: 13px; color: var(--soft); }
.cmd-pop .cmd.on, .cmd-pop .cmd:hover { background: var(--raised-2); }
.cmd-pop .cmd.on b { color: var(--text-hi); }

/* operator page: conversation + workbench */
.op { display: flex; flex-wrap: wrap; height: calc(100vh - 60px); }
.op-conv { flex: 1 1 440px; min-width: 0; height: 100%; display: flex; flex-direction: column; border-right: 1px solid var(--line-2); }
.op-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.op-bar .meta { margin-left: auto; font: 11.5px var(--mono); color: var(--faint); }
.op-conv .chat-log { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 24px 10px; display: flex; flex-direction: column; gap: 18px; }
.op-conv .composer { padding: 12px 24px 20px; }
.op-wb { flex: 1.25 1 480px; min-width: 0; height: 100%; display: flex; flex-direction: column; background: var(--bg-2); }
.wb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 24px; border-bottom: 1px solid var(--line-2); }
.wb-bar .who { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--soft); }
.switch { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 32px; height: 18px; border-radius: 99px; background: var(--line-strong); transition: background .15s; }
.switch .track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch input:checked + .track { background: var(--text); }
.switch input:checked + .track::after { transform: translateX(14px); background: var(--bg); }
.switch input:focus-visible + .track { outline: 2px solid var(--text); outline-offset: 2px; }
.wb-tabs { display: flex; gap: 2px; padding: 6px 16px 0; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.wb-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; max-width: 260px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--faint); font-size: 13px; cursor: pointer; white-space: nowrap; }
.wb-tabs button span.t { overflow: hidden; text-overflow: ellipsis; }
.wb-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.wb-body { flex: 1; overflow-y: auto; padding: 28px 40px 28px; }
.wb-body .reader-col { max-width: 760px; gap: 18px; }
.wb-empty { margin: auto; max-width: 420px; padding: 60px 20px; text-align: center; color: var(--faint); }
.wb-empty .serif { font-size: 28px; color: var(--soft); }
.wb-moves { border-top: 1px solid var(--line-2); background: var(--bg); }
.live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--acc) 45%, var(--line)); font: 10.5px var(--mono); color: var(--acc-ink); }

/* empty vault */
.empty-hero { max-width: 720px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 16px; }
.empty-hero h1 { margin: 0; font: 400 clamp(40px, 5vw, 58px)/1.02 var(--serif); }
.empty-hero p { color: var(--soft); margin: 0; font-size: 16px; }
.empty-hero .composer { border: 0; padding: 8px 0 0; }

/* ------------------------------------------------------------------ constellation (graph.js) */
.gx { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: calc(100vh - 60px); }
.gx-side { min-width: 0; overflow-y: auto; padding: 24px 20px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 24px; }
.gx-side h3 { margin: 0 0 10px; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.gx-stat .n { font: 500 30px/1.1 var(--mono); letter-spacing: -.03em; }
.gx-stat .n small { font: 14px var(--sans); letter-spacing: 0; color: var(--soft); }
.gx-stat .s { font-size: 13px; color: var(--soft); }
.gx-search { position: relative; }
.gx-search input { width: 100%; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 12px; font: inherit; outline: none; }
.gx-search input:focus { border-color: var(--soft); }
.gx-sugg { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; z-index: 5; }
.gx-sugg button { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 8px; align-items: center; padding: 8px 10px; font-size: 13px; cursor: pointer; color: var(--text); }
.gx-sugg button:hover { background: var(--raised); }
.gx-legend { display: flex; flex-direction: column; gap: 2px; }
.gx-leg { all: unset; display: flex; align-items: center; gap: 10px; padding: 5px 8px; margin: 0 -8px; border-radius: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.gx-leg .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.gx-leg .n { margin-left: auto; font: 11.5px var(--mono); color: var(--faint); }
.gx-leg:hover, .gx-leg.on { background: var(--raised); color: var(--text); }
.gx-extra { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--soft); }
.gx-extra label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.gx-extra input { accent-color: var(--text); }
.gx-shapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 13px; color: var(--soft); }
.gx-shapes li { display: flex; align-items: center; gap: 9px; }
.gx-shapes .g { --hue: var(--soft); }
.gx-glow { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--faint); }
.gx-glow span { width: 10px; height: 10px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 10px var(--acc); flex: none; }
.gx-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 20px; }
.gx-stage { position: relative; flex: 1; min-height: 320px; border-radius: 16px; background-color: var(--stage); border: 1px solid var(--line-3); overflow: hidden;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 96px 96px; background-position: -1px -1px; }
.gx-canvas { position: absolute; inset: 0; cursor: grab; }
.gx-title { position: absolute; left: 22px; top: 16px; z-index: 2; pointer-events: none; display: flex; flex-direction: column; gap: 2px; }
.gx-title .serif { font-size: 34px; line-height: 1.05; }
.gx-zoom { position: absolute; right: 14px; bottom: 14px; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.gx-zoom .icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); }
.gx-card { position: absolute; top: 14px; right: 14px; z-index: 3; width: min(340px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow-y: auto; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.gx-card .x { position: absolute; top: 6px; right: 6px; }
.gx-kind { display: flex; align-items: center; gap: 7px; font: 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.gx-dot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; flex: none; }
.gx-ttl { font: 400 21px/1.15 var(--serif); margin: 8px 0 4px; overflow-wrap: anywhere; }
.gx-meta { font-size: 12.5px; color: var(--soft); }
.gx-desc { font-size: 13.5px; color: var(--soft); margin: 10px 0 12px; }
.gx-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gx-nb-h { font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 14px 0 6px; }
.gx-nb { display: flex; flex-direction: column; gap: 5px; }
.gx-nb a { display: flex; gap: 7px; align-items: baseline; font-size: 13px; }
.replay { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.replay .bars { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 3px; height: 74px; }
.replay .bars button { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.replay .bars .b { display: block; border-radius: 3px; background: var(--line-2); min-height: 4px; }
.replay .bars button.past .b { background: var(--dim); }
.replay .bars button.on .b { background: var(--acc); }
.replay .bars .l { display: block; height: 14px; font: 10.5px var(--mono); text-align: center; white-space: nowrap; overflow: hidden; color: var(--faint); }
.replay .bars button.on .l { color: var(--text); }
.replay .play { flex: none; width: 46px; height: 46px; margin-bottom: 20px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.replay .play svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }

/* ------------------------------------------------------------------ mobile + narrow */
.tabbar { display: none; }
.only-mobile { display: none !important; }
body.reading.chat-open .layout { grid-template-columns: 232px minmax(0, 1fr); }
body.reading.chat-open .dock { position: fixed; right: 0; top: 60px; width: min(var(--chat-w, 400px), 100vw); z-index: 30; box-shadow: var(--shadow); }
@media (max-width: 1180px) {
  body.chat-open .layout { grid-template-columns: 232px minmax(0, 1fr); }
  body.chat-open .dock { position: fixed; right: 0; top: 60px; width: min(var(--chat-w, 380px), 100vw); z-index: 30; box-shadow: var(--shadow); }
}
@media (max-width: 980px) {
  .op-wb { display: none; }
  .gx { grid-template-columns: 1fr; }
  .gx-side { display: none; }
}
@media (max-width: 760px) {
  .layout, body.chat-open .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; position: fixed; top: 60px; left: 0; bottom: 0; width: 280px; height: auto; z-index: 35; background: var(--bg); box-shadow: var(--shadow); }
  body.nav-open .sidebar { display: flex; }
  .only-mobile { display: inline-flex !important; }
  .topbar { gap: 8px; padding: 0 10px; }
  .brand span, .search kbd, .ppill .nm, .ppill .st { display: none; }
  .search { min-width: 0; }
  .search-box { padding: 0 10px; }
  .top-actions { flex: none; gap: 2px; }
  .presence { gap: 2px; }
  .ppill { padding: 0 3px; min-height: 36px; border: 0; background: none; }
  .icon-btn { width: 36px; }
  #chat-toggle { display: none; }
  .main { padding: 22px 16px 96px; }
  .reader-wrap { margin: -22px -16px -96px; }
  .reader-main { padding: 24px 16px 40px; }
  .margin { border-left: 0; border-top: 1px solid var(--line-2); padding: 24px 16px 96px; }
  body.chat-open .dock { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 4px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; font-size: 11px; color: var(--faint); }
  .tabbar a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on svg { stroke: var(--acc-ink); }
  .tabbar a:hover { text-decoration: none; }
  .op { height: calc(100vh - 60px - 64px); }
  .op-conv .chat-log { padding: 16px; }
  .op-conv .composer { padding: 10px 12px 12px; }
  .op-bar { padding: 10px 16px; }
  .choice { min-height: 46px; width: 100%; border-radius: 12px; font-size: 14.5px; }
  .home-sec { margin-top: 34px; }
  .flow-arrow, .flow-sep { display: none; }
  .gx { height: calc(100vh - 60px - 64px); }
  .gx-main { padding: 12px; }
  .toast { bottom: 84px; }
  body.undo-on .toast:not(.undo) { bottom: 142px; }
  .tour-rail { position: static; max-width: none; max-height: 40vh; }
  .tour-stage { padding: 18px 16px; }
  .stop-title { font-size: 25px; }
  .p-layout { margin-top: 24px; }
  .thread .log { margin-left: 0; }
}

/* cabinet cards: written by / mentioned in */
.men-group { margin: 0 0 18px; }
.men-group details { border-top: 1px solid var(--line-3); }
.men-group summary { display: flex; align-items: center; gap: 8px; padding: 9px 2px; cursor: pointer; list-style: none; font-size: 14px; }
.men-group summary::-webkit-details-marker { display: none; }
.men-group summary .mono { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.men-group .mini-list { margin: 0 0 10px 22px; }
