/* Spill's rules. Everything below obeys these; change a rule here, not a value there.

   Colour   belongs to your words. Phrases, their highlights and their lines carry colour.
            Everything else (controls, status, focus, the mic) is ink on white.
   Surface  is flat white. Hairlines separate. Only the mic, the one physical object, has a shadow.
   Type     Bricolage for the app and your phrases, Source Serif for your prose. Five sizes.
   Motion   three speeds, two curves. --ease moves everything. --spring is kept for the two
            moments a phrase becomes yours: when it lands and when it's ticked off.
            Anything leaving takes 0.7 of its way in. Only transform and opacity animate.
   Modes    in Spill you gather and edit phrases; in Write you place them. */
:root {
  --paper: #fff;
  --ink: #17153b;
  --soft: #6f6d8e;      /* secondary text */
  --faint: #b9b7cc;     /* placeholders, resting controls */
  --hair: #eceaf4;      /* the only border */
  --wash: #f6f5fb;      /* the only fill */
  --p0: #2b50ff; --p1: #e6248a; --p2: #f25c05; --p3: #0a9f5b; --p4: #7a3df0; --p5: #008fa8;   /* your words */

  --ui: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --prose: "Source Serif 4", Georgia, serif;
  --fs-s: .875rem;      /* status, quiet controls */
  --fs: 1rem;           /* controls, what you said */
  --fs-l: 1.25rem;      /* wordmark, phrases while writing */
  --fs-xl: 1.5rem;      /* the empty invitation */
  --fs-d: 2.125rem;     /* phrases while spilling */
  --fs-prose: 1.25rem;

  --gutter: max(32px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --bar: 64px;

  --t-fast: 120ms;      /* presses, colour */
  --t: 240ms;           /* a state changing */
  --t-slow: 480ms;      /* something travelling */
  --t-out: 170ms;       /* leaving: 0.7 of --t */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
html { -webkit-tap-highlight-color: transparent; }
body { font-family: var(--ui); font-size: var(--fs); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
textarea:focus-visible, .label:focus-visible, .add input:focus-visible { outline: none; }

/* ---------- bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 5; height: var(--bar);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter); background: var(--paper);
}
.wordmark { font-weight: 700; font-size: var(--fs-l); letter-spacing: -.03em; }
.wordmark { white-space: nowrap; }
/* On a phone the header is tight: the wordmark shortens to "kindling" rather than wrapping. */
@media (max-width: 420px) { .wm-rest { display: none; } }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-right: -12px; }
.quiet { padding: 8px 12px; border-radius: 999px; font-size: var(--fs-s); color: var(--soft); transition: color var(--t-fast), background var(--t-fast); }
.quiet.armed { color: var(--ink); background: var(--wash); font-weight: 600; }
.count { font-size: var(--fs-s); color: var(--soft); margin-right: 8px; font-variant-numeric: tabular-nums; }
.count.all { color: var(--ink); font-weight: 600; }
body[data-mode="spill"] .write-only, body[data-mode="spill"] .count { display: none; }

/* The mode switch is one component everywhere: two words, a dash under the current one. */
.modes { display: flex; gap: 4px; }
.mode { position: relative; padding: 10px 14px; font-weight: 600; color: var(--faint); transition: color var(--t) var(--ease); }
.mode::after {
  content: ""; position: absolute; left: calc(50% - 10px); width: 20px; bottom: 3px; height: 2px; border-radius: 2px;
  background: var(--ink); transform: scaleX(0); transition: transform var(--t) var(--ease);
}
.mode[aria-pressed="true"] { color: var(--ink); }
.mode[aria-pressed="true"]::after { transform: scaleX(1); }

/* ---------- layout ---------- */
.stage {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 56px; padding: 20px var(--gutter) 0; max-width: 1240px; margin: 0;   /* flush left, on the wordmark's edge */
}
body[data-mode="write"] .stage { grid-template-columns: minmax(0, .42fr) minmax(0, 1fr); }
.rail {
  position: sticky; top: calc(var(--bar) + 20px); align-self: start;
  max-height: calc(100vh - var(--bar) - 32px); overflow-y: auto; padding: 4px 8px 140px 4px; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
/* A blank note is a poster: one headline, one sentence, one action (the mic), two quiet ways in.
   The working layout only appears once there is something to work with. */
.empty { display: none; }
body.blank .empty { display: block; }
body.blank .stage { grid-template-columns: minmax(0, 1fr); }
body.blank .pane-spill, body.blank .phrases, body.blank .add { display: none; }
body.blank .rail { overflow: visible; }
.empty h1 { margin: 0 0 0 -.04em; font-size: clamp(4.5rem, 13vw, 12rem); font-weight: 700; letter-spacing: -.065em; line-height: .86; }
.empty p { margin-top: 32px; font-size: var(--fs-l); line-height: 1.3; letter-spacing: -.015em; max-width: 23em; }
.starts { display: flex; gap: 24px; margin-top: 20px; }
.link { padding: 8px 0; font-weight: 600; text-decoration: underline 2px; text-underline-offset: 5px; transition: color var(--t-fast); }

/* ---------- phrases: a thread running top to bottom ---------- */
.phrases { list-style: none; margin: 0; padding: 0; position: relative; }
.phrases::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: 20px; width: 2px; background: var(--hair); border-radius: 2px; }
.phrase { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; animation: land var(--t-slow) var(--spring) both; }
.phrase.settled { animation: none; }
.phrase.leaving { opacity: 0; transform: scale(.96); transition: opacity var(--t-out) var(--ease), transform var(--t-out) var(--ease); }
@keyframes land { from { opacity: 0; transform: translateY(-12px) scale(.94); } }

.dot {
  position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--c); background: var(--paper); display: grid; place-items: center;
  transition: background var(--t) var(--ease);
}
.dot::before { content: ""; position: absolute; inset: -13px; }                 /* 44px target */
.dot svg { width: 10px; height: 10px; opacity: 0; transform: scale(.4); transition: opacity var(--t-out) var(--ease), transform var(--t-out) var(--ease); }
.phrase.used .dot { background: var(--c); }
.phrase.used .dot svg { opacity: 1; transform: none; transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--spring); }
.phrase.pop .dot { animation: tick var(--t-slow) var(--spring); }
@keyframes tick { 40% { transform: scale(1.5); } }

.label {
  color: var(--c); font-weight: 700; font-size: var(--fs-d); line-height: 1.12; letter-spacing: -.035em;
  min-width: 1ch; border-radius: 6px; padding: 1px 4px; margin-left: -4px; overflow-wrap: anywhere;
  transition: opacity var(--t) var(--ease), background var(--t-fast);
}
.label:focus { background: var(--wash); }
.phrase.used .label { opacity: .45; }                                            /* used = ticked dot + quiet words, nothing else */
.remove { position: relative; opacity: 0; width: 28px; height: 28px; border-radius: 50%; color: var(--faint); font-size: var(--fs-l); line-height: 1; flex: none; transition: opacity var(--t-fast), color var(--t-fast); }
.remove::before { content: ""; position: absolute; inset: -8px; }
.remove:focus-visible { opacity: 1; }

.add { margin: 8px 0 0 30px; }
.add input { border: 0; border-bottom: 2px solid transparent; background: none; padding: 8px 0; width: 12em; font-weight: 600; transition: border-color var(--t-fast); }
.add input::placeholder { color: var(--faint); }
.add input:focus { border-color: var(--hair); }

/* Write: phrases are for placing, not editing. */
body[data-mode="write"] .label { font-size: var(--fs-l); letter-spacing: -.02em; cursor: pointer; }
body[data-mode="write"] .phrase { padding: 6px 0; }
body[data-mode="write"] .remove, body[data-mode="write"] .add { display: none; }

/* ---------- panes ---------- */
.pane { min-width: 0; padding-bottom: 180px; }
body[data-mode="spill"] .pane-write, body[data-mode="write"] .pane-spill { display: none; }
textarea { display: block; width: 100%; border: 0; resize: none; background: transparent; overflow: hidden; padding: 0; }
textarea::placeholder { color: var(--faint); }

.pane-spill { display: flex; flex-direction: column; }
/* The status line sits above what you said and stays in view however long that gets. */
.grab { position: sticky; top: var(--bar); z-index: 1; margin-top: -20px; padding-top: 20px; min-height: 48px; background: var(--paper); }
.grabber, .peek { display: none; }
#transcript, .said-mirror, .interim, .peek { font-size: var(--fs); line-height: 1.6; }
#transcript { color: var(--soft); min-height: 3.2em; }
.interim { color: var(--faint); min-height: 1.6em; }
.status { font-size: var(--fs-s); line-height: 1.4; color: var(--soft); }
.status:empty { display: none; }

.draft-wrap { position: relative; max-width: 39em; }
#draft, .mirror {
  font-family: var(--prose); font-size: var(--fs-prose); line-height: 1.75; letter-spacing: 0;
  white-space: pre-wrap; overflow-wrap: break-word; padding: 0; margin: 0;
}
#draft { position: relative; min-height: 60vh; }
.mirror { position: absolute; inset: 0; color: transparent; pointer-events: none; }
.mirror mark {
  color: transparent; border-radius: 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  box-shadow: inset 0 -2px 0 var(--c);
}

/* ---------- where each idea came from ----------
   What you said keeps a faint tint, in the accent, over the words each idea was drawn from.
   When an idea lands, its words sweep in, left to right, one after another. */
.said-wrap { position: relative; }
.said-wrap #transcript { position: relative; }
.said-mirror {
  position: absolute; inset: 0; pointer-events: none; color: transparent;
  white-space: pre-wrap; overflow-wrap: break-word;
}
.said-mirror mark {
  color: transparent; border-radius: 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(var(--tint), var(--tint)) no-repeat left / 100% 100%;
  --tint: color-mix(in srgb, var(--accent, var(--ink)) 14%, transparent);
  transition: --tint var(--t) var(--ease);
}
.said-mirror mark.fresh { animation: sweep var(--t-slow) var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes sweep { from { background-size: 0% 100%; } }
.said-mirror mark.hot { --tint: color-mix(in srgb, var(--accent, var(--ink)) 30%, transparent); }

/* ---------- connectors ---------- */
.lines { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 3; }
/* Hairlines at rest, quieter while you type, full strength only for the idea you point at. */
.lines { transition: opacity var(--t-slow) var(--ease); }
body.writing .lines { opacity: .35; transition-duration: var(--t); }
.lines .link { color: var(--c, var(--accent, var(--ink))); opacity: 0; transition: opacity var(--t) var(--ease); }
.lines .link.on { opacity: .45; }
.lines .link.off { opacity: 0; transition-duration: var(--t-out); }
body.linking .lines .link.on { opacity: .15; }
body.linking .lines .link.hot { opacity: 1; }
.lines .ln {
  fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--t-slow) var(--ease);
}
.lines .link.on .ln { stroke-dashoffset: 0; }
.lines .end { fill: currentColor; }
.mirror mark { transition: box-shadow var(--t) var(--ease), background var(--t) var(--ease); }
.phrase .label { transition: opacity var(--t) var(--ease), background var(--t-fast); }
body.linking .phrase.hot .label { opacity: 1; background: var(--wash); }
body[data-mode="spill"] .lines { display: none; }

/* ---------- mic and dock ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 28px; z-index: 4; display: grid; justify-items: center; pointer-events: none; }
.dock .mode, .tally { display: none; }
body[data-mode="write"] .dock { display: none; }
.dock-mid { display: grid; place-items: center; }
.mic {
  pointer-events: auto; position: relative; width: 72px; height: 72px; border-radius: 50%;
  background: var(--ink); color: var(--paper); display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(23,21,59,.26); transition: transform var(--t-fast) var(--ease);
}
.mic:active { transform: scale(.94); }
.mic svg { grid-area: 1 / 1; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.mic .i-stop, .mic[aria-pressed="true"] .i-mic { opacity: 0; transform: scale(.6); }
.mic[aria-pressed="true"] .i-stop { opacity: 1; transform: none; }
.mic[aria-pressed="true"]::before, .mic[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ink); animation: ring 1.8s ease-out infinite;
}
.mic[aria-pressed="true"]::after { animation-delay: .9s; }
@keyframes ring { from { opacity: .5; } to { transform: scale(1.9); opacity: 0; } }
.mic[disabled] { background: var(--faint); box-shadow: none; cursor: not-allowed; }

/* ---------- accent picker: one colour for everything that means "used" ---------- */
.accent-pick { position: relative; }
.accent-btn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.accent-btn span { width: 14px; height: 14px; border-radius: 50%; background: var(--accent, var(--ink)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 20%, transparent); transition: transform var(--t-fast) var(--ease); }
.accent-btn:active span { transform: scale(.85); }
.swatches {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 8; display: flex; gap: 6px; padding: 8px;
  background: var(--paper); border: 1px solid var(--ink); transform-origin: top right;
  animation: pop-in var(--t) var(--ease);
}
.swatches[hidden] { display: none; }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.swatch { position: relative; width: 28px; height: 28px; border-radius: 50%; background: var(--s); transition: transform var(--t-fast) var(--ease); }
.swatch::before { content: ""; position: absolute; inset: -4px; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--s); }
.swatch:active { transform: scale(.9); }

/* Hover is a mouse thing; on touch it would stick after a tap. */
@media (hover: hover) and (pointer: fine) {
  .quiet:hover { background: var(--wash); color: var(--ink); }
  .link:hover { color: var(--soft); }
  .mode:hover { color: var(--ink); }
  .phrase:hover .remove { opacity: 1; }
  .remove:hover { color: var(--ink); }
  body[data-mode="write"] .label:hover { background: var(--wash); }
  .mic:not([disabled]):hover { transform: scale(1.05); }
  .mic:not([disabled]):active { transform: scale(.94); }
}

/* ---------- switching modes: each phrase travels to its new place ---------- */
::view-transition-group(*) { animation-duration: var(--t-slow); animation-timing-function: var(--ease); }
::view-transition-old(*), ::view-transition-new(*) { animation-duration: var(--t); animation-timing-function: var(--ease); }
::view-transition-old(root) { animation-duration: var(--t-out); }
/* The panes hand off rather than crossfade: what you said lifts away first, then the draft rises in
   once the ideas are already on their way to the rail. */
.pane-spill { view-transition-name: said; }
.pane-write { view-transition-name: draft; }
::view-transition-old(said) { animation: pane-out var(--t-out) var(--ease) both; }
::view-transition-new(said) { animation: pane-in var(--t) var(--ease) both; animation-delay: 160ms; }
::view-transition-old(draft) { animation: pane-out var(--t-out) var(--ease) both; }
::view-transition-new(draft) { animation: pane-in var(--t-slow) var(--ease) both; animation-delay: 220ms; }
@keyframes pane-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes pane-in { from { opacity: 0; transform: translateY(14px); } }
/* The automatic move after you finish talking takes its time, so you see where everything goes. */
html.auto-advance::view-transition-group(*) { animation-duration: 640ms; }
html.auto-advance::view-transition-new(draft) { animation-duration: 560ms; animation-delay: 320ms; }

/* ---------- phone: the same rules in an app shell ----------
   Mode switch and mic move to a bottom dock, what you said becomes a sheet,
   and while writing the phrases ride above the keyboard as a strip. */
@media (max-width: 760px) {
  :root {
    --gutter: max(20px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    --bar: 52px; --fs-d: 1.875rem; --fs-prose: 1.125rem;
    --sb: env(safe-area-inset-bottom, 0px);
    --dock: calc(68px + var(--sb)); --peek: 124px;   /* grab 44 + two lines + room for the raised mic */ --strip: 58px; --kb: 0px;
  }
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body { display: flex; flex-direction: column; height: 100dvh; min-height: 0; }
  .bar, .dock, .dot, .grab, .peek { -webkit-user-select: none; user-select: none; }

  .bar { position: static; flex: none; height: calc(var(--bar) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); grid-template-columns: 1fr auto; }
  .bar .modes, .bar .count { display: none; }

  .stage, body[data-mode="write"] .stage {
    display: block; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    max-width: none; width: 100%; margin: 0; padding: 8px var(--gutter) calc(var(--dock) + var(--peek) + 32px);
  }
  .pane { padding-bottom: 0; }
  .rail { position: static; max-height: none; overflow: visible; padding: 0; }
  .empty { margin-top: 20px; }
  .empty h1 { font-size: 24vw; }
  .empty p { margin-top: 24px; }
  .phrase { scroll-margin-bottom: calc(var(--peek) + 32px); }
  .remove { opacity: 1; }

  /* What you said: a sheet that peeks its latest words. It slides; nothing resizes. */
  .pane-spill {
    position: fixed; left: 0; right: 0; bottom: var(--dock); z-index: 4; display: block;
    height: min(72dvh, calc(100dvh - 140px)); padding: 0;
    background: var(--paper); border-top: 1px solid var(--hair); border-radius: 20px 20px 0 0;
    transform: translateY(calc(100% - var(--peek))); transition: transform var(--t-out) var(--ease);
    will-change: transform;
  }
  .pane-spill.open { transform: none; transition-duration: var(--t); }
  .pane-spill.dragging { transition: none; }
  .grab { position: absolute; top: 0; left: 0; right: 0; height: 44px; min-height: 0; margin: 0; padding: 20px var(--gutter) 0; z-index: 2; background: var(--paper); border-radius: 20px 20px 0 0; touch-action: none; }
  .grabber { display: block; position: absolute; left: calc(50% - 18px); top: 8px; width: 36px; height: 4px; border-radius: 4px; background: var(--hair); }
  .status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .peek {
    position: absolute; top: 44px; left: 0; right: 0; height: calc(var(--peek) - 44px); z-index: 1; padding: 0 var(--gutter) 29px;
    display: flex; align-items: flex-end; overflow: hidden; background: var(--paper); color: var(--soft);
    touch-action: none; transition: opacity var(--t) var(--ease);
  }
  .peek.is-empty { color: var(--faint); }
  .pane-spill.open .peek { opacity: 0; pointer-events: none; transition-duration: var(--t-out); }
  .sheet-body { height: 100%; overflow-y: auto; padding: 44px var(--gutter) 20px; }
  #transcript { min-height: 1.6em; }
  .interim { min-height: 0; }

  /* Dock: Spill, the mic, Write. In Write the middle shows how many phrases are used. */
  .dock, body[data-mode="write"] .dock {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; justify-items: stretch;
    bottom: 0; height: var(--dock); padding: 0 var(--gutter) var(--sb);
    background: var(--paper); border-top: 1px solid var(--hair); pointer-events: auto; z-index: 6;
  }
  .dock .mode { display: block; }
  .dock .mode::after { bottom: 16px; }
  .dock-mid { width: 96px; }
  .dock-mid > * { grid-area: 1 / 1; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
  .mic { width: 64px; height: 64px; margin-top: -24px; box-shadow: 0 8px 22px rgba(23,21,59,.24), 0 0 0 6px var(--paper); }
  .tally { display: block; font-size: var(--fs-s); font-weight: 600; color: var(--soft); font-variant-numeric: tabular-nums; opacity: 0; transform: scale(.8); }
  .tally.all { color: var(--ink); }
  body[data-mode="write"] .mic { opacity: 0; transform: scale(.6); pointer-events: none; transition-duration: var(--t-out); }
  body[data-mode="write"] .tally { opacity: 1; transform: none; }

  /* Write: the thread becomes a strip of chips. */
  body[data-mode="write"] .stage { padding-bottom: calc(var(--dock) + var(--strip) + 32px); }
  body[data-mode="write"] .rail {
    position: fixed; left: 0; right: 0; top: auto; bottom: var(--dock); z-index: 4; height: var(--strip);
    background: var(--paper); border-top: 1px solid var(--hair); padding: 9px var(--gutter);
    overflow-x: auto; overflow-y: hidden;
  }
  body[data-mode="write"] .phrases { display: flex; flex-wrap: nowrap; gap: 8px; width: max-content; }
  body[data-mode="write"] .phrases::before, body[data-mode="write"] .empty { display: none; }
  body[data-mode="write"] .phrase { gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--c) 9%, var(--paper)); animation: none; transition: transform var(--t-fast) var(--ease); }
  body[data-mode="write"] .phrase:active { transform: scale(.96); }
  body[data-mode="write"] .label { font-size: var(--fs); white-space: nowrap; padding: 0; margin: 0; }
  body[data-mode="write"] .dot { width: 14px; height: 14px; border-width: 2px; }
  body[data-mode="write"] .dot::before { inset: -13px -6px -13px -12px; }
  #draft { min-height: 40dvh; }

  /* Keyboard up: the dock steps aside; strip and sheet sit on the keys. */
  body.kb .dock { display: none; }
  body.kb .rail, body.kb .pane-spill { bottom: var(--kb); }
  body.kb .pane-spill { height: min(72dvh, calc(100dvh - var(--kb) - 72px)); }
  body.kb .stage { padding-bottom: calc(var(--kb) + var(--strip) + 32px); }
}

/* ================= looks =================
   Three alternative aesthetics over the same rules and layout. Each restates the tokens,
   then changes only what its idea needs. Switch with the look button in the bar or ?look=. */

/* --- Mono: one hue. Your words are cobalt in six depths; the app is the same blue, nearly black. --- */
:root[data-look="mono"] {
  --ink: #0a1550; --soft: #56629a; --faint: #aab4da; --hair: #e2e7fb; --wash: #f1f4ff;
  --p0: #1f3fff; --p1: #0b24b8; --p2: #5873ff; --p3: #081a86; --p4: #8196ff; --p5: #2e4fe6;
}
[data-look="mono"] .mic { background: var(--p0); box-shadow: 0 10px 28px rgba(31,63,255,.3); }
[data-look="mono"] .mic[aria-pressed="true"]::before, [data-look="mono"] .mic[aria-pressed="true"]::after { border-color: var(--p0); }
[data-look="mono"] .mode::after { background: var(--p0); }

/* --- Geist: one typeface doing everything, set tight and precise. Neutral greys, small radii, mono for numbers and status. --- */
:root[data-look="geist"] {
  --ink: #0a0a0a; --soft: #666; --faint: #a1a1a1; --hair: #eaeaea; --wash: #fafafa;
  --p0: #0070f3; --p1: #e5484d; --p2: #7928ca; --p3: #0a9f5b; --p4: #f76808; --p5: #0091a8;
  --ui: "Geist", ui-sans-serif, system-ui, sans-serif; --prose: "Geist", ui-sans-serif, system-ui, sans-serif;
}
[data-look="geist"] .wordmark { font-weight: 600; letter-spacing: -.045em; }
[data-look="geist"] .label { font-weight: 600; letter-spacing: -.055em; line-height: 1.08; }
[data-look="geist"] body[data-mode="write"] .label { letter-spacing: -.03em; }
[data-look="geist"] .mode { font-weight: 500; }
[data-look="geist"] .status, [data-look="geist"] .count, [data-look="geist"] .tally { font-family: "Geist Mono", ui-monospace, monospace; font-size: .8125rem; letter-spacing: -.01em; }
[data-look="geist"] .quiet { border-radius: 6px; }
[data-look="geist"] #draft, [data-look="geist"] .mirror { line-height: 1.7; letter-spacing: -.011em; }
[data-look="geist"] .mirror mark { border-radius: 3px; }
[data-look="geist"] .mic { box-shadow: 0 4px 14px rgba(0,0,0,.2); }
[data-look="geist"] .empty h1 { font-weight: 600; letter-spacing: -.07em; }

/* --- Bierut: a poster. One bold grotesque, black on white, black rules, and red for one thing only:
       what's been used. The order is real, so phrases are numbered; using one strikes it through. --- */
:root:is([data-look="bierut"], [data-look="poster"]) {
  --ink: #000; --soft: #4a4a4a; --faint: #9c9c9c; --hair: #000; --wash: #f0f0f0; --accent: #1f3fff;   /* cobalt by default; the picker overrides it */
  --p0: #000; --p1: #000; --p2: #000; --p3: #000; --p4: #000; --p5: #000;
  --ui: "Helvetica Neue", Helvetica, Arial, sans-serif; --prose: "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Poster type that still fits: phrases scale with their column so most stay on one line. */
  --fs-d: clamp(1.5rem, 7.2cqi, 2.75rem);
}
:is([data-look="bierut"], [data-look="poster"]) .rail { container-type: inline-size; }
:is([data-look="bierut"], [data-look="poster"]) .bar { border-bottom: 4px solid var(--ink); }
:is([data-look="bierut"], [data-look="poster"]) .wordmark { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.06em; }
:is([data-look="bierut"], [data-look="poster"]) .mode { font-weight: 700; }
:is([data-look="bierut"], [data-look="poster"]) .mode::after { height: 4px; bottom: 0; left: 14px; width: calc(100% - 28px); border-radius: 0; }
:is([data-look="bierut"], [data-look="poster"]) .quiet { border-radius: 0; }
:is([data-look="bierut"], [data-look="poster"]) .quiet.armed { background: var(--ink); color: var(--paper); }
:is([data-look="bierut"], [data-look="poster"]) .stage { padding-top: 28px; }
:is([data-look="bierut"], [data-look="poster"]) .empty { padding-top: 12px; }
:is([data-look="bierut"], [data-look="poster"]) .phrases { counter-reset: n; }
:is([data-look="bierut"], [data-look="poster"]) .phrases::before { display: none; }
:is([data-look="bierut"], [data-look="poster"]) .phrase { counter-increment: n; align-items: baseline; gap: 14px; padding: 10px 0 12px; border-top: 1px solid var(--ink); }
:is([data-look="bierut"], [data-look="poster"]) .dot { width: 1.7em; height: auto; border: 0; border-radius: 0; background: none; justify-items: start; font-size: var(--fs-s); font-weight: 700; font-variant-numeric: tabular-nums; }
:is([data-look="bierut"], [data-look="poster"]) .dot svg { display: none; }
:is([data-look="bierut"], [data-look="poster"]) .dot::after { content: counter(n, decimal-leading-zero); }
:is([data-look="bierut"], [data-look="poster"]) .phrase.used .dot { background: none; color: var(--accent); }
:is([data-look="bierut"], [data-look="poster"]) .label { letter-spacing: -.055em; line-height: .98; text-wrap: balance; border-radius: 0; text-decoration: line-through transparent .085em; transition: text-decoration-color var(--t) var(--ease), background var(--t-fast); }
:is([data-look="bierut"], [data-look="poster"]) .phrase.used .label { opacity: 1; text-decoration-color: var(--accent); }
:is([data-look="bierut"], [data-look="poster"]) body[data-mode="write"] .label { letter-spacing: -.03em; line-height: 1.1; }
:is([data-look="bierut"], [data-look="poster"]) body[data-mode="write"] .phrase { padding: 8px 0; }
:is([data-look="bierut"], [data-look="poster"]) .add { margin-left: calc(1.7em * .875 + 14px); }
:is([data-look="bierut"], [data-look="poster"]) #transcript, :is([data-look="bierut"], [data-look="poster"]) .peek { color: var(--ink); }
:is([data-look="bierut"], [data-look="poster"]) #draft, :is([data-look="bierut"], [data-look="poster"]) .mirror { line-height: 1.5; letter-spacing: -.012em; }
:is([data-look="bierut"], [data-look="poster"]) .mirror mark { background: none; border-radius: 0; box-shadow: inset 0 -3px 0 var(--accent); }
:is([data-look="bierut"], [data-look="poster"]) .lines .link { color: var(--accent); }
:is([data-look="bierut"], [data-look="poster"]) .mirror mark.hot { background: color-mix(in srgb, var(--accent) 10%, transparent); }
:is([data-look="bierut"], [data-look="poster"]) .mic { background: var(--accent); box-shadow: none; }
:is([data-look="bierut"], [data-look="poster"]) .mic[aria-pressed="true"]::before, :is([data-look="bierut"], [data-look="poster"]) .mic[aria-pressed="true"]::after { border-color: var(--accent); }
@media (max-width: 760px) {
    :is([data-look="bierut"], [data-look="poster"]) .bar { border-bottom-width: 3px; }
  /* The remove mark sits at the row's edge instead of taking width from the phrase. */
  :is([data-look="bierut"], [data-look="poster"]) .phrase { padding-right: 30px; }
  :is([data-look="bierut"], [data-look="poster"]) .remove { position: absolute; right: -4px; top: 50%; margin-top: -14px; }
  :is([data-look="bierut"], [data-look="poster"]) body[data-mode="write"] .phrase { padding-right: 14px; }
  :is([data-look="bierut"], [data-look="poster"]) .pane-spill, :is([data-look="bierut"], [data-look="poster"]) .grab { border-radius: 0; }
  :is([data-look="bierut"], [data-look="poster"]) .pane-spill, :is([data-look="bierut"], [data-look="poster"]) .dock, :is([data-look="bierut"], [data-look="poster"]) body[data-mode="write"] .rail { border-top-width: 2px; }
  :is([data-look="bierut"], [data-look="poster"]) .mic { box-shadow: 0 0 0 6px var(--paper); }
  :is([data-look="bierut"], [data-look="poster"]) .dock .mode::after { bottom: 12px; left: calc(50% - 16px); width: 32px; }
  :is([data-look="bierut"], [data-look="poster"]) body[data-mode="write"] .phrase { border: 1.5px solid var(--ink); border-radius: 0; background: none; padding: 0 14px 0 10px; align-items: center; gap: 8px; }
  :is([data-look="bierut"], [data-look="poster"]) body[data-mode="write"] .dot { width: auto; height: auto; border: 0; font-size: .75rem; }
  [data-look="geist"] .pane-spill, [data-look="geist"] .grab { border-radius: 12px 12px 0 0; }
  [data-look="geist"] body[data-mode="write"] .phrase { border-radius: 8px; }
}

/* --- Poster: Bierut, refined. Same black, white and one red; four changes so it reads as a design, not a template.
       1. Size is meaning: ideas you kept coming back to are set biggest (.w3), passing ones smaller (.w1).
       2. A grotesque with a voice (Schibsted Grotesk) for the app and ideas; a serif for what you said and wrote.
       3. Rules have weights: a heavy rule opens the list, hairlines divide it, and numbers hang in the margin.
       4. Warm black on a barely-off white, so it reads as ink on paper rather than pixels. --- */
:root[data-look="poster"] {
  --ink: #1c1915; --soft: #57524b; --faint: #a39d94; --hair: #1c1915; --wash: #f1eee8; --paper: #fcfbf8;
  --p0: var(--ink); --p1: var(--ink); --p2: var(--ink); --p3: var(--ink); --p4: var(--ink); --p5: var(--ink);
  --ui: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --prose: "Source Serif 4", Georgia, serif;
  --fs-d: clamp(1.625rem, 7.4cqi, 3.25rem);   /* most ideas fit one line at full size; long ones break evenly */
}
[data-look="poster"] .bar { border-bottom: 1px solid var(--ink); }
[data-look="poster"] .wordmark { font-weight: 900; letter-spacing: -.05em; }
[data-look="poster"] .mode { font-weight: 700; }
[data-look="poster"] .empty h1 { font-weight: 900; letter-spacing: -.06em; line-height: .84; }
[data-look="poster"] .empty p { font-family: var(--prose); font-size: var(--fs-l); letter-spacing: 0; line-height: 1.4; }
[data-look="poster"] .label { font-weight: 800; letter-spacing: -.045em; line-height: .96; }
[data-look="poster"] .phrase.w2 .label { font-size: calc(var(--fs-d) * .72); letter-spacing: -.04em; }
[data-look="poster"] .phrase.w1 .label { font-size: calc(var(--fs-d) * .52); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
[data-look="poster"] .phrase { padding: 12px 0 14px; }
[data-look="poster"] .phrase.w1 { padding: 9px 0 10px; }
[data-look="poster"] .phrase:first-child { border-top: 5px solid var(--ink); }
[data-look="poster"] .dot { font-size: .75rem; font-weight: 700; width: 18px; }
[data-look="poster"] #transcript, [data-look="poster"] .said-mirror, [data-look="poster"] .peek, [data-look="poster"] .interim { font-family: var(--prose); font-size: 1.0625rem; line-height: 1.55; }
[data-look="poster"] #draft, [data-look="poster"] .mirror { font-family: var(--prose); font-size: var(--fs-prose); line-height: 1.65; letter-spacing: 0; }
[data-look="poster"] .mirror mark { box-shadow: inset 0 -1px 0 var(--accent); }
[data-look="poster"] .mirror mark.hot { box-shadow: inset 0 -2px 0 var(--accent); }
[data-look="poster"] .status { font-weight: 500; }
[data-look="poster"] ::selection { background: color-mix(in srgb, var(--accent) 18%, transparent); }
/* Themes: when the model groups ideas, each theme is a section head (the big type), opened by the
   heavy rule; its ideas sit under it, smaller, divided by hairlines. Size-as-meaning then works within
   the ideas' own smaller scale. Without themes (the basic picker), the list stays as above. */
.theme { display: none; }
.phrases.grouped .theme { display: flex; align-items: baseline; gap: 10px; list-style: none; }   /* count sits by the name, clear of the lines */
[data-look="poster"] .phrases.grouped .theme {
  padding: 14px 0 10px 28px; border-top: 5px solid var(--ink); margin-top: 28px;
  animation: land var(--t-slow) var(--spring) both;
}
[data-look="poster"] .phrases.grouped .theme:first-child { margin-top: 0; }
[data-look="poster"] .phrases.grouped .theme.settled { animation: none; }
[data-look="poster"] .theme-name { font-size: var(--fs-d); font-weight: 900; letter-spacing: -.05em; line-height: .95; }
[data-look="poster"] .theme-count { font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--soft); visibility: hidden; }
[data-look="poster"] .theme.done .theme-count { color: var(--accent); }
/* A theme you've written about directly gets the same red underline as its words in the draft. */
[data-look="poster"] .theme-name { text-decoration: underline 2px transparent; text-underline-offset: .14em; transition: text-decoration-color var(--t) var(--ease); }
[data-look="poster"] .theme.touched .theme-name { text-decoration-color: var(--accent); }
[data-look="poster"] body.linking .theme.hot .theme-name { background: var(--wash); }
[data-look="poster"] .phrases.grouped .phrase:first-child { border-top-width: 1px; }
[data-look="poster"] .phrases.grouped .phrase .label { font-size: calc(var(--fs-d) * .56); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
[data-look="poster"] .phrases.grouped .phrase.w3 .label { font-size: calc(var(--fs-d) * .64); font-weight: 800; }
[data-look="poster"] .phrases.grouped .phrase.w1 .label { font-size: calc(var(--fs-d) * .46); font-weight: 600; }
[data-look="poster"] .phrases.grouped .phrase { padding-top: 9px; padding-bottom: 10px; }   /* block only: phone keeps room for the × */
body[data-mode="write"] [data-look="poster"] .theme-count, [data-look="poster"] body[data-mode="write"] .theme-count { visibility: visible; }
[data-look="poster"] body[data-mode="write"] .phrases.grouped .theme { padding: 10px 0 6px 28px; margin-top: 20px; border-top-width: 3px; }
[data-look="poster"] body[data-mode="write"] .phrases.grouped .theme:first-child { margin-top: 0; }
[data-look="poster"] body[data-mode="write"] .theme-name { font-size: var(--fs-l); letter-spacing: -.035em; }
[data-look="poster"] body[data-mode="write"] .phrases.grouped .phrase .label { font-size: var(--fs); font-weight: 600; letter-spacing: -.015em; }

/* Writing: ideas become a quiet, even list; size only matters while you're gathering. */
[data-look="poster"] body[data-mode="write"] .phrase .label { font-size: var(--fs-l); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
[data-look="poster"] body[data-mode="write"] .phrase { padding: 8px 0; }
/* Desktop: the ideas line up with the wordmark; their numbers hang in the margin to the left. */
@media (min-width: 761px) {
  [data-look="poster"] .rail { margin-left: -28px; padding-left: 4px; }   /* number 18 + gap 10, less the label's own -4px */
  [data-look="poster"] .phrase { gap: 10px; }
  [data-look="poster"] .add { margin-left: 28px; }
  [data-look="poster"] .empty { margin-left: 28px; }
}
@media (max-width: 760px) {
  :root[data-look="poster"] { --fs-d: clamp(1.5rem, 9.4cqi, 2.5rem); }
  [data-look="poster"] .bar { border-bottom-width: 1px; }
  [data-look="poster"] body[data-mode="write"] .phrase .label { font-size: var(--fs); }
  [data-look="poster"] body[data-mode="write"] .phrase { padding: 0 14px 0 10px; }
  [data-look="poster"] .phrases.grouped .theme { padding-left: 0; }
  [data-look="poster"] .phrases .phrase { padding-right: 30px; }            /* room for the × at the row's edge */
  [data-look="poster"] body[data-mode="write"] .phrases.grouped .theme { display: none; }
  [data-look="poster"] body[data-mode="write"] .phrase:first-child { border-top-width: 1.5px; }
}

/* Reduced motion: nothing travels, bounces or pulses. Fades stay, so changes still read. */
@media (prefers-reduced-motion: reduce) {
  .phrase { animation-name: appear; animation-timing-function: var(--ease); animation-duration: var(--t); }
  @keyframes appear { from { opacity: 0; } }
  .phrase.pop .dot, .mic[aria-pressed="true"]::before, .mic[aria-pressed="true"]::after { animation: none; }
  .phrase.leaving, .dot svg, .phrase.used .dot svg, .mic svg, .dock-mid > *, .mic, .mic:active, body[data-mode="write"] .phrase:active { transform: none !important; }
  .pane-spill, .mode::after { transition: none; }
  .said-mirror mark.fresh { animation: appear var(--t) var(--ease) both; }
  .lines .ln { transition: none; stroke-dashoffset: 0; }
  ::view-transition-group(*) { animation: none; }
  ::view-transition-old(said), ::view-transition-new(said), ::view-transition-old(draft), ::view-transition-new(draft) { animation-name: appear; }
}
