/* Ghostwriter UI. Azure on cool paper: Material 3 tonal surfaces and nav rail, Apple-quiet chrome and type.
   Display: Fraunces (soft optical serif). Interface: Figtree. One accent. Class names are the contract with app.js. */
:root {
  color-scheme: light;
  --paper: #F5F8FC; --surface: #FFFFFF; --surface-low: #EEF3F9; --ink: #14212E; --ink-2: #4B5A6A; --ink-3: #6B7987;
  --line: #D8E1EC; --line-2: #E8EEF5;
  --accent: #0A6EE0; --accent-ink: #0856B3; --accent-soft: #E8F1FD; --accent-soft-2: #D4E6FB; --accent-line: #BBD6F7;
  --ok: #1B7F4C; --ok-soft: #E3F4EA; --warn: #9A6200; --warn-soft: #FBF2DC; --danger: #BF3B2F; --danger-soft: #FBE9E6;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20,33,46,.05), 0 10px 28px -20px rgba(20,33,46,.22);
  --shadow-lift: 0 2px 6px rgba(20,33,46,.06), 0 18px 40px -22px rgba(20,33,46,.28);
  --halo: 0 0 0 4px rgba(10,110,224,.18);
  --font: "Figtree", -apple-system, "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --rail: 76px; --top: 58px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
::selection { background: var(--accent-soft-2); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; font-variation-settings: "SOFT" 50; letter-spacing: -.012em; margin: 0 0 8px; color: var(--ink); }
h1 { font-size: 30px; line-height: 1.15; } h2 { font-size: 22px; line-height: 1.25; } h3 { font-size: 17.5px; line-height: 1.3; }
p { margin: 0 0 8px; }
.muted { color: var(--ink-2); } .small { font-size: 12px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.hidden { display: none !important; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font-family: inherit; }
.btn, .chip, .rail a, .tabs button, .doclist button, .sessions .s, input, select, textarea { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease; }

/* ---------- shell ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); display: flex; align-items: center; gap: 12px;
  padding: 0 16px 0 22px; background: rgba(245,248,252,.82); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line); z-index: 20; }
/* Kalamkaar wordmark: the medallion (ink ring and dots, madder nib) and "Kalam" in ink, "kaar" in madder. Madder appears
   nowhere else in the UI; the portal stays azure. Final pick 2026-10-12 (variant G). */
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.wordmark .mark { width: 30px; height: 30px; flex: 0 0 auto; }
.wordmark .word { font: 400 22px/1 "Yatra One", var(--display); letter-spacing: .01em; }
.wordmark .word em { font-style: normal; color: #B23A2B; }
.wordmark:hover { text-decoration: none; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; align-items: center; justify-content: center; flex: 0 0 auto; margin-left: -8px; }
.menu-btn:hover { background: var(--surface-low); }
.rail-backdrop { display: none; }
.rail { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--rail); border-right: 1px solid var(--line);
  background: var(--paper); padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; z-index: 15; }
.rail a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 2px; border-radius: 12px;
  color: var(--ink-2); font-size: 11px; font-weight: 600; letter-spacing: .01em; text-decoration: none; position: relative; }
.rail a:hover { background: var(--surface-low); color: var(--ink); text-decoration: none; }
.rail a.on { background: var(--accent-soft); color: var(--accent-ink); }
.rail a.on svg.i { stroke-width: 2; }
.rail a .count { position: absolute; top: 5px; right: 12px; }
main { margin: var(--top) 0 0 var(--rail); padding: 28px 28px 40px; }
.page { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
@media (min-width: 1280px) {
  :root { --rail: 224px; }
  .rail { padding: 14px 12px; }
  .rail a { flex-direction: row; gap: 12px; padding: 9px 12px; font-size: 14px; font-weight: 500; }
  .rail a.on { font-weight: 600; }
  .rail a .count { position: static; margin-left: auto; }
}
@media (max-width: 767px) {
  /* the page list becomes a drawer under the top bar, opened by the three-line button; nothing sits at the bottom */
  .menu-btn { display: inline-flex; }
  .rail { width: min(300px, 86vw); padding: 10px 10px 24px; gap: 2px; transform: translateX(-104%); transition: transform .22s ease; box-shadow: var(--shadow-lift); overflow-y: auto; }
  body.menu-open .rail { transform: none; }
  .rail a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; font-size: 15px; font-weight: 500; }
  .rail a svg.i { width: 22px; height: 22px; }
  .rail a .count { position: static; margin-left: auto; }
  .rail-backdrop { position: fixed; inset: var(--top) 0 0 0; background: rgba(20,33,46,.28); z-index: 14; }
  body.menu-open .rail-backdrop { display: block; }
  main { margin-left: 0; padding: 16px 16px 32px; }
  .topbar { padding: 0 12px; gap: 8px; overflow: hidden; }
  .topbar .chip { flex: 0 1 auto; min-width: 0; }
  .topbar .chip { flex: 0 0 auto; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .topbar .chip.model { display: none; }
  .topbar .chip .count { flex: 0 0 auto; }
  .wordmark { flex: 0 0 auto; } .wordmark .word { font-size: 19px; } .wordmark .mark { width: 26px; height: 26px; }
  h1 { font-size: 25px; }
  /* Write on a phone: the switch hugs the top bar, the chat is the whole screen, the composer is locked to the bottom */
  .page:has(> .write) { margin-top: -6px; }
  .write-switch { display: flex; gap: 3px; padding: 3px; border-radius: 999px; background: var(--surface-low); margin: 0 0 6px; }
  .write-switch button { flex: 1; height: 30px; border: 0; border-radius: 999px; background: none; font: 600 13px var(--font); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .write-switch button.on { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow); }
  .write-switch .dot { width: 8px; height: 8px; border-radius: 50%; background: #B23A2B; }
  .write.show-draft .chat { display: none; }
  .write:not(.show-draft) .draft { display: none; }
  .write.write { gap: 0; }   /* outranks the desktop grid gap declared later in the file */
  .write .chat { height: calc(100vh - var(--top) - 46px); height: calc(100dvh - var(--top) - 46px); min-height: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .chat-head { padding: 6px 8px; } .chat-head .title { display: none; }
  .chat-head .btn span { display: none; }   /* icons only: Sessions, Regenerate, New */
  .chat-head .btn { padding: 0 9px; }
  .composer textarea { height: 42px; min-height: 42px; padding: 10px 12px; line-height: 1.45; overflow-y: hidden; }
  #mic { height: 42px; padding: 0 10px; }
  .composer textarea.tall { overflow-y: auto; }
  .write .transcript { padding: 14px 12px calc(var(--composer-h, 120px) + 12px); }   /* outranks the later .transcript rule */
  .composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); gap: 6px; box-shadow: 0 -6px 18px -12px rgba(20,33,46,.25); }
  .write.show-draft .composer { display: none; }
  .composer .modes { gap: 5px; }
  .composer .modes .chip { flex: 0 0 auto; height: 26px; padding: 0 10px; font-size: 12.5px; }
  .composer textarea { min-height: 40px; }
  main { padding: 10px 16px 0; }
  .draft { max-height: none; margin-bottom: 20px; }
}
@media (min-width: 768px) { .write-switch { display: none; } }

/* ---------- primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); background: var(--surface); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(10,110,224,.25), inset 0 1px 0 rgba(255,255,255,.14); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.text { border-color: transparent; background: transparent; color: var(--accent-ink); padding: 0 10px; }
.btn.text:hover { background: var(--accent-soft); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--ink-3); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.primary.busy::after { border-color: #fff; border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font: 600 12px var(--font); color: var(--ink-2); cursor: default; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font: 600 11px/18px var(--font); background: var(--surface-low); color: var(--ink-2); white-space: nowrap; }
.badge.proposed { background: var(--surface-low); color: var(--ink-2); }
.badge.trial { background: var(--accent-soft); color: var(--accent-ink); }
.badge.confirmed, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.retired { background: transparent; color: var(--ink-3); text-decoration: line-through; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font: 700 11px/18px var(--font); text-align: center; }
label.f { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
input, select, textarea { font: 14px/1.5 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; width: 100%; min-width: 0; }
input:hover, select:hover, textarea:hover { border-color: #C3CFDC; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--halo); }
.btn:focus-visible, .chip:focus-visible, .rail a:focus-visible, .tabs button:focus-visible { outline: none; box-shadow: var(--halo); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234B5A6A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; letter-spacing: .01em; border-bottom: 1px solid var(--line); padding: 9px 8px; white-space: nowrap; }
td { border-bottom: 1px solid var(--line-2); padding: 9px 8px; vertical-align: top; }
tbody tr:hover td { background: var(--paper); }
.table-wrap { overflow-x: auto; max-width: 100%; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty p { margin-bottom: 12px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 9px 12px; font: 600 13px var(--font); color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; border-radius: 8px 8px 0 0; }
.tabs button:hover { color: var(--ink); background: var(--surface-low); }
.tabs button.on { color: var(--accent-ink); border-bottom-color: var(--accent); background: none; }
.meter { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.meter.near > i { background: var(--warn); } .meter.over > i { background: var(--danger); }
pre.block { white-space: pre-wrap; word-break: break-word; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 6px 0; font: 12.5px/1.55 var(--mono); max-height: 360px; overflow: auto; }
blockquote { margin: 6px 0; padding: 4px 12px; border-left: 3px solid var(--accent); color: var(--ink-2); font-style: italic; }

/* ---------- toasts + dialogs ---------- */
.toasts { position: fixed; left: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
@media (max-width: 767px) { .toasts { bottom: 16px; } }
.toast { background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 12px; box-shadow: var(--shadow-lift); font-size: 13px; display: flex; gap: 10px; align-items: baseline; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
.toast a { color: #CFE3FF; font-weight: 600; }
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--ink); background: var(--surface); box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgba(20,33,46,.32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog .dlg-body { padding: 18px 22px 22px; overflow-y: auto; max-height: calc(100vh - 140px); }
dialog .dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
dialog .dlg-head h2 { margin: 0; }
dialog .dlg-x { width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; margin-right: -8px; }
dialog .dlg-x:hover { background: var(--surface-low); color: var(--ink); }
dialog .dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); }
.drawer { position: fixed; top: var(--top); right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--line);
  z-index: 30; padding: 18px; overflow-y: auto; box-shadow: var(--shadow-lift); }

/* ---------- markdown ---------- */
.md { font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3, .md h4 { margin: 18px 0 6px; }
.md h1:first-child, .md h2:first-child { margin-top: 0; }
.md h4 { font: 700 12.5px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.md ul, .md ol { padding-left: 22px; margin: 4px 0 10px; }
.md li { margin: 2px 0; }
.md code { font: 12.5px var(--mono); background: var(--surface-low); padding: 1px 5px; border-radius: 5px; }
.md table { margin: 8px 0 14px; display: block; overflow-x: auto; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- write ---------- */
.write { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 18px; align-items: start; }
@media (max-width: 1023px) { .write { grid-template-columns: minmax(0, 1fr); } }
.chat { display: flex; flex-direction: column; height: calc(100vh - var(--top) - 56px); min-height: 480px; padding: 0; position: relative; overflow: hidden; }
@media (max-width: 1023px) { .chat { height: 70vh; } }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-head .title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transcript { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, var(--surface), #FBFCFE); }
.bubble { max-width: 86%; padding: 11px 15px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.bubble.user { align-self: flex-end; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink); border-bottom-right-radius: 5px; }
.bubble.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--shadow); }
/* the post as an editable block at the end of the chat */
.draft-block { align-self: stretch; max-width: 100%; background: var(--surface); border: 1px solid var(--accent-line); border-radius: 16px; padding: 10px 12px 8px; box-shadow: var(--shadow); }
.draft-block .db-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.draft-block .db-head b { font-size: 13px; }
.draft-block .db-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.draft-block .db-tools .btn { padding: 0 8px; height: 30px; }
.draft-block textarea { width: 100%; min-height: 120px; border: 0; padding: 4px 2px; background: transparent; font: 14.5px/1.6 var(--font); color: var(--ink); resize: none; overflow-y: auto; border-radius: 0; }
.draft-block textarea:focus { outline: none; box-shadow: none; }
.draft-block .db-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 6px; margin-top: 4px; min-height: 30px; }
.phone-only { display: none; }
@media (max-width: 767px) { .phone-only { display: inline-flex; } .draft-block { padding: 8px 10px 6px; } }
.bubble.assistant.streaming::after { content: "▍"; color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tool-row { align-self: flex-start; font-size: 12px; color: var(--ink-3); max-width: 100%; }
.tool-row summary { cursor: pointer; list-style: none; display: flex; gap: 6px; align-items: center; }
.tool-row summary::-webkit-details-marker { display: none; }
.tool-row pre { font: 11.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 4px 0 0; }
.status-line { font-style: italic; color: var(--ink-3); font-size: 12.5px; }
/* a draft run: steps that tick off; collapses to one line when done */
.progress { align-self: stretch; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 13px; }
.progress ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.progress li { display: flex; align-items: center; gap: 9px; color: var(--ink-3); }
.progress li.skip { display: none; }
.progress li.active { color: var(--ink); font-weight: 600; } .progress li.done { color: var(--ink-2); } .progress li.failed { color: var(--danger); }
.progress .st { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; box-sizing: border-box; }
.progress li.active .st { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.progress li.done .st { border: 0; background: var(--ok); position: relative; }
.progress li.done .st::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.progress li.failed .st { border-color: var(--danger); }
.progress .dt { margin-left: auto; color: var(--ink-3); font-weight: 500; font-size: 12px; white-space: nowrap; }
.progress .notes:empty { display: none; } .progress .note { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); } .progress .note.warn { color: var(--danger); }
.progress details.raw { margin-top: 6px; } .progress details.raw summary { cursor: pointer; font-size: 11.5px; color: var(--ink-3); list-style: none; } .progress details.raw summary::-webkit-details-marker { display: none; }
.progress details.raw pre { font: 11px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 4px 0 0; }
.progress.complete ol, .progress.complete .notes { display: none; } .progress.complete details.raw { margin-top: 2px; }
.progress.complete .sum { color: var(--ok); font-weight: 600; font-size: 12.5px; }
.progress.complete .sum::before { content: "✓ "; }
.error-line { color: var(--danger); font-size: 13px; background: var(--danger-soft); padding: 7px 11px; border-radius: 10px; align-self: stretch; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.composer .modes { display: flex; gap: 6px; align-items: center; position: relative; min-height: 28px; }
.mode-hint { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-pill { gap: 4px; padding-right: 4px; } .mode-pill .pill-x { border: 0; background: none; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.mode-pill .pill-x:hover { background: rgba(0,0,0,.08); } .mode-pill .pill-x svg.i { width: 12px; height: 12px; }
.chip.mini { height: 24px; padding: 0 8px; font-size: 11.5px; } .chip.mini svg.i { width: 13px; height: 13px; }
#more-btn { height: 28px; } #more-btn svg.i { width: 14px; height: 14px; }
.more-menu { position: absolute; right: 0; bottom: calc(100% + 6px); width: min(320px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 6px; z-index: 30; display: flex; flex-direction: column; gap: 2px; }
.more-menu.hidden { display: none; }
.more-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 10px; cursor: pointer; font: 13.5px var(--font); color: var(--ink); }
.more-menu button span { font-size: 12px; color: var(--ink-3); } .more-menu button:hover { background: var(--surface-low); } .more-menu button.on { background: var(--accent-soft); color: var(--accent-ink); }
.more-menu .sep { height: 1px; background: var(--line-2); margin: 4px 6px; }
.composer .input { display: flex; gap: 8px; align-items: flex-end; }
#mic { height: 46px; padding: 0 12px; gap: 6px; flex: 0 0 auto; }
#mic.rec { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
#mic.rec svg.i { animation: blink 1.1s steps(1) infinite; }
#mic .rec-time { font: 600 12px var(--mono); }
.composer textarea { min-height: 46px; max-height: 200px; resize: none; border-radius: 14px; }
.sessions { position: absolute; inset: 49px auto 0 0; width: min(300px, 90%); background: var(--surface); border-right: 1px solid var(--line); z-index: 5; overflow-y: auto; padding: 8px; box-shadow: var(--shadow-lift); }
.sessions .s { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 10px; cursor: pointer; font: 13px var(--font); color: var(--ink); }
.sessions .s:hover { background: var(--surface-low); } .sessions .s.on { background: var(--accent-soft); color: var(--accent-ink); }
.sessions .s small { display: block; color: var(--ink-3); }
.draft { position: sticky; top: calc(var(--top) + 28px); max-height: calc(100vh - var(--top) - 56px); overflow-y: auto; }
@media (max-width: 1023px) { .draft { position: static; max-height: none; } }
.post-text { font-family: var(--display); font-variation-settings: "SOFT" 50; font-size: 16.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.hook { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 8px; background: var(--surface); }
.hook:hover { border-color: var(--accent-line); }
.hook .n { font-family: var(--display); font-size: 19px; color: var(--accent); margin-right: 6px; }
.check { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.check .mark { font-weight: 700; width: 16px; flex: none; }
.check.pass .mark { color: var(--ok); } .check.fail .mark { color: var(--danger); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-2); font-weight: 600; } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.status-pill { font: 600 11px/20px var(--font); padding: 0 8px; border-radius: 999px; background: var(--surface-low); color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.status-pill.posted { background: var(--ok-soft); color: var(--ok); }

/* ---------- brain ---------- */
.brain { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .brain { grid-template-columns: minmax(0, 1fr); } }
.doclist button { display: block; width: 100%; text-align: left; border: 1px solid transparent; background: none; padding: 8px 10px; border-radius: 12px; cursor: pointer; font: 600 13px var(--font); color: var(--ink); }
.doclist button:hover { background: var(--surface-low); }
.doclist button.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.doclist .meta { display: flex; justify-content: space-between; font: 500 11px var(--font); color: var(--ink-3); margin: 3px 0 4px; }
@media (max-width: 900px) { .doclist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; } }

/* ---------- inbox ---------- */
.prop { display: flex; flex-direction: column; gap: 6px; }
.prop .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- misc pages ---------- */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat .v { font-family: var(--display); font-variation-settings: "SOFT" 50; font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.arm { display: flex; flex-direction: column; gap: 10px; }
.arm .post-text { flex: 1; }
.stepper { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.stepper button { display: flex; align-items: center; gap: 6px; }
.stepper .n { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-low); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.stepper .on .n { background: var(--accent); color: #fff; }
.stepper .chip.optional small { font-size: 10px; color: var(--ink-3); margin-left: 2px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form .grid2 { gap: 14px; }
.notice { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink); border-radius: 12px; padding: 11px 13px; font-size: 13px; }
.dim { opacity: .5; }

.draft .tabs button { padding: 8px 8px; font-size: 12.5px; }

/* ---------- LinkedIn-style preview: imitates LinkedIn (system font, neutral greys), so it stays outside the app theme ---------- */
.li-wrap { position: relative; }
.li-devices { display: inline-flex; gap: 4px; margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
.li-dev { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 32px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); cursor: pointer; }
.li-dev.on { background: var(--surface-low); color: var(--ink); border-color: var(--ink-3); }
.li-dev svg.i { width: 16px; height: 16px; }
.li-card { --li-ink: #191919; --li-grey: #666666; --li-line: #E0E0E0; border: 1px solid var(--li-line); border-radius: 8px; background: #fff; padding: 12px 16px 6px; max-width: 555px; margin: 0 auto;
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif; color: var(--li-ink); box-shadow: 0 0 0 1px rgba(0,0,0,.02), 0 2px 4px rgba(0,0,0,.06); transition: max-width .2s ease; }
.li-wrap.phone .li-card { max-width: 360px; }
.li-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.li-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font: 700 18px/48px var(--font); text-align: center; flex: 0 0 auto; overflow: hidden; display: inline-block; object-fit: cover; }
img.li-avatar { object-fit: cover; }
.li-avatar.big { width: 64px; height: 64px; line-height: 64px; font-size: 24px; }
.li-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.li-who { min-width: 0; line-height: 1.3; }
.li-who b { font-size: 14px; font-weight: 600; color: var(--li-ink); }
.li-headline { font-size: 12px; color: var(--li-grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-time { font-size: 12px; color: var(--li-grey); display: flex; align-items: center; gap: 3px; }
.li-globe svg.i { width: 13px; height: 13px; stroke-width: 1.8; }
.li-body { white-space: pre-wrap; font-size: 14px; line-height: 1.43; color: var(--li-ink); word-break: break-word; }
.li-more { border: 0; background: none; color: var(--li-grey); font: 600 14px inherit; cursor: pointer; padding: 0 2px; }
.li-more:hover { color: #0A66C2; text-decoration: underline; }
.li-social { display: flex; justify-content: space-between; align-items: center; padding: 8px 0 4px; font-size: 12px; color: var(--li-grey); border-bottom: 1px solid var(--li-line); margin-top: 8px; }
.li-reacts { display: inline-flex; align-items: center; gap: 2px; }
.li-react { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; }
.li-react.like { background: #0A66C2; } .li-react.like svg.i { width: 10px; height: 10px; stroke-width: 2.2; }
.li-react.love { background: #DF704D; margin-left: -4px; }
.li-actions { display: flex; justify-content: space-around; padding: 4px 0 0; margin-top: 4px; }
.li-actions span { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: #404040; padding: 10px 8px; border-radius: 4px; }
.li-actions span:hover { background: #F3F2EF; }
.li-actions svg.i { width: 18px; height: 18px; stroke-width: 1.8; }
.li-wrap.phone .li-actions span { font-size: 12px; padding: 8px 4px; gap: 4px; }
.tabs { scrollbar-width: thin; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 28px; }
.tabs button { padding: 9px 10px; }

@media (prefers-reduced-motion: reduce) { .btn, .chip, .rail a, .tabs button, .doclist button, .sessions .s, input, select, textarea { transition: none; } }

/* ---------- review dashboard ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.chart-grid .card.wide { grid-column: 1 / -1; }
.chart-grid .card + .card { margin-top: 0; }
.chart svg { display: block; max-width: 100%; height: auto; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
.findings { border-color: var(--accent-line); background: linear-gradient(180deg, #FFFFFF, #F7FAFE); }
.findings-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.findings-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; }
.findings-list .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--ink-3); }
.findings-list li.win .dot { background: var(--ok); } .findings-list li.watch .dot { background: var(--warn); }
.stat .small { margin-top: 2px; }

/* ---------- polish pass (2026-10-11): breathing room, aligned parts, chart boxes ---------- */
.draft > .card, .draft.card { padding: 20px 20px 22px; }
.draft .card-head { margin-bottom: 6px; }
.draft .tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 0; margin: 14px 0 12px; padding: 0; -webkit-mask-image: none; mask-image: none; overflow: visible; }
.draft .tabs button { border: 1px solid transparent; border-radius: 999px; padding: 6px 11px; font-size: 12.5px; color: var(--ink-2); }
.draft .tabs button:hover { background: var(--surface-low); color: var(--ink); }
.draft .tabs button.on { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.draft h2, .draft h3 { line-height: 1.3; }
.draft .status-pill { vertical-align: middle; }
.li-wrap { margin-top: 10px; }
.hook { padding: 12px 14px; margin-bottom: 10px; }
.hook .hook-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hook .n { font-size: 18px; line-height: 1; margin: 0; }
.hook p, .hook .text { margin: 0 0 8px; line-height: 1.5; }
.hook .btn.text { padding-left: 0; padding-right: 0; height: 28px; }
.hook .btn.text:hover { background: transparent; text-decoration: underline; }
.check { padding: 10px 0; gap: 10px; align-items: flex-start; }
.check .mark { margin-top: 1px; }
.check .small { margin-top: 2px; }
.entry-text { font-size: 14.5px; line-height: 1.55; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.prop { gap: 8px; }
.prop p { margin: 0; }
.prop blockquote { margin: 2px 0; }
.prop .foot { margin-top: 2px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 6px 0 12px; }
.md li { margin: 4px 0; line-height: 1.6; }
.md h2 { margin-top: 24px; } .md h3 { margin-top: 20px; }
.md table td, .md table th { padding: 8px 10px; }
.doclist button { padding: 9px 12px; margin-bottom: 2px; }
.doclist .meter { margin-bottom: 2px; }
input[type="file"] { padding: 7px 10px; font-size: 13px; color: var(--ink-2); background: var(--surface); cursor: pointer; }
input[type="file"]::file-selector-button { font: 600 12.5px var(--font); color: var(--ink); background: var(--surface-low); border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; margin-right: 10px; cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--line-2); }
.chart-box { width: 100%; min-height: 160px; }
.chart-empty { height: 100%; min-height: 150px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 13px; background: var(--paper); border-radius: 10px; text-align: center; padding: 12px; }
.chart-grid { gap: 16px; margin: 16px 0; }
.chart .card-head { margin-bottom: 8px; align-items: flex-start; }
.chart .card-head .small { line-height: 1.4; }
.strip { gap: 16px; }
.page-head { margin-bottom: 22px; }
.card + .card { margin-top: 16px; }
.form > label.f + label.f { margin-top: 2px; }
.stepper { margin-bottom: 20px; }
.kv { row-gap: 8px; }
.chat-head { padding: 12px 14px; }
.composer { padding: 12px 14px 14px; }
.transcript { padding: 20px; gap: 12px; }
@media (max-width: 767px) { .draft .tabs button { padding: 6px 9px; font-size: 12px; } }
.strip { align-items: stretch; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .l { margin-top: 2px; }

/* ---------- eagle-eye pass: every control reads as a control ---------- */
.btn.text { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; padding: 0 12px; }
.btn.text:hover { background: var(--accent-soft-2); border-color: transparent; text-decoration: none; }
.btn.text.danger, .btn.text[data-del], .btn.text[data-del-bn], .btn.text[data-rmkey], .btn.text[data-rm] { background: var(--surface-low); color: var(--ink-2); }
.btn.text.danger:hover, .btn.text[data-del]:hover, .btn.text[data-del-bn]:hover, .btn.text[data-rmkey], .btn.text[data-rm]:hover { background: var(--danger-soft); color: var(--danger); }
.btn.text.sm { padding: 0 10px; }
.hook .btn.text { padding: 0 12px; }
.draft .tabs button { border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.draft .tabs button:hover { border-color: var(--ink-3); background: var(--surface); color: var(--ink); }
.draft .tabs button.on { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.tabs button { padding: 9px 14px; }
.chat-head .btn.text, .page-head .btn.text { padding: 0 12px; }
.chart .card-head { flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 10px; }
.chart .card-head .small { font-size: 12.5px; line-height: 1.45; }
.chart-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.chart-key span { display: inline-flex; align-items: center; gap: 6px; }
.chart-key .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--ink-3); display: inline-block; }
.chart-key .sw.ok { background: var(--ok); } .chart-key .sw.warn { background: var(--warn); }
.li-more { color: #0A66C2; font-weight: 600; }

/* ---------- profile studio ---------- */
.pf-grid { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 980px) { .pf-grid { grid-template-columns: 1fr; } }
.pf-grid > div:last-child { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pf-grid .card { margin: 0; }
.pf-grid .f > span:first-child, .pf-grid .f > .row:first-child { font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
.count-pill { font: 600 11.5px/18px var(--font); padding: 0 8px; border-radius: 999px; background: var(--surface-low); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.score { font-family: var(--display); font-variation-settings: "SOFT" 50; font-weight: 600; font-size: 22px; line-height: 1; padding: 6px 12px; border-radius: 12px; background: var(--surface-low); color: var(--ink); }
.score small { font: 600 11px var(--font); margin-left: 3px; color: var(--ink-3); }
.big-score { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 24px; background: var(--surface-low); flex: 0 0 auto; }
.big-score span { font-family: var(--display); font-variation-settings: "SOFT" 50; font-size: 40px; font-weight: 600; line-height: 1; }
.big-score small { font: 600 11px var(--font); color: var(--ink-3); margin-top: 4px; }
/* one tone rule for every pill and score */
:is(.score, .big-score, .fact, .count-pill).ok { background: var(--ok-soft); color: var(--ok); }
:is(.score, .big-score, .fact, .count-pill).warn { background: var(--warn-soft); color: var(--warn); }
:is(.score, .big-score, .fact, .count-pill).danger { background: var(--danger-soft); color: var(--danger); }
.card.part .verdict { margin: 0 0 10px; font-size: 14.5px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.fact { font: 500 12px/20px var(--font); padding: 1px 9px; border-radius: 999px; background: var(--surface-low); color: var(--ink-2); border: 1px solid transparent; }
.pf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } @media (max-width: 700px) { .pf-cols { grid-template-columns: 1fr; } }
.pf-list { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.55; } .pf-list li { margin: 0 0 5px; }
.pf-list.ok li::marker { color: var(--ok); } .pf-list.fix li::marker { color: var(--accent); } .pf-list.top { font-weight: 500; }
.rewrite { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); }
.rewrite p { margin: 6px 0 0; white-space: pre-wrap; font-size: 14px; }
.headline-out { font-size: 16px; line-height: 1.5; margin: 0 0 6px; } .headline-out mark { background: var(--accent-soft); color: var(--accent-ink); padding: 1px 2px; border-radius: 4px; }
.about-out { white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.about-out .fold { display: inline; background: var(--accent-soft); border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.plan { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--surface-low); } .plan p { margin: 4px 0 10px; font-size: 14px; }
.hl-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.hl-opt { display: flex; align-items: center; gap: 10px; text-align: left; font: 500 13.5px/1.4 var(--font); padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.hl-opt:hover { border-color: var(--ink-3); } .hl-opt.on { border-color: var(--accent-line); background: var(--accent-soft); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 600 12.5px var(--font); color: var(--ink-2); cursor: pointer; }
.swatch i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); }
.swatch.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
.bn-wrap { position: relative; border-radius: 12px; margin: 4px 0 40px; }
.bn-wrap img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); aspect-ratio: 4 / 1; object-fit: cover; }
.bn-photo { position: absolute; left: 3%; bottom: -24%; width: 20%; aspect-ratio: 1; }
.bn-photo .li-avatar { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.6vw; line-height: 1; border: 4px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.bn-photo .li-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bn-item img { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; }

/* ---------- first-run nudges: a banner on every page, a checklist on Write, a badge on the rail ---------- */
.setup-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; padding: 10px 12px 10px 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink); font-size: 13.5px; }
.setup-banner > span { display: inline-flex; align-items: center; gap: 8px; } .setup-banner svg.i { width: 18px; height: 18px; flex: 0 0 auto; }
.setup-card { margin: 0 0 14px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--accent-line); }
.setup-steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.setup-steps li { display: flex; align-items: flex-start; gap: 12px; }
.setup-steps li div { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; } .setup-steps li div span { color: var(--ink-2); font-size: 12.5px; }
.setup-steps .tick { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-low); color: var(--ink-2); font: 700 12px/24px var(--font); text-align: center; flex: 0 0 auto; }
.setup-steps li.done .tick { background: var(--ok-soft); color: var(--ok); } .setup-steps li.done b { text-decoration: line-through; color: var(--ink-3); font-weight: 500; }

/* ---------- onboarding: one post at a time, stacked under its category ---------- */
.collector { display: flex; flex-direction: column; gap: 14px; }
.collector-add { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--surface-low); }
.collector-add label.f { max-width: 320px; } .collector-add p { margin: -2px 0 0; }
.collector-group h4 { margin: 0 0 4px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.collector-group + .collector-group { margin-top: 10px; }
.collector-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.collector-item > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- top-right: the person as a round photo or initial ---------- */
#user-chip { padding: 0; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; justify-content: center; flex: 0 0 auto; max-width: 34px; }
#user-chip .li-avatar.sm { width: 34px; height: 34px; font-size: 14px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
#user-chip .li-avatar.sm img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- folds: one tap opens a section; closed by default ---------- */
details.fold { margin: 0 0 14px; }
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font: 600 14px var(--font); color: var(--ink); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ""; width: 7px; height: 7px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details.fold[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold > .card, details.fold > .grid2, details.fold > .chart-grid { margin-top: 0; }
details.fold[open] > :not(summary) { border-top-left-radius: 0; border-top-right-radius: 0; }

/* ---------- intake, history, digest, experiments ---------- */
.moment { padding: 12px 0; border-top: 1px solid var(--line-2); } .moment:first-of-type { border-top: 0; } .moment p { margin: 6px 0 0; font-size: 14px; }
.version { padding: 10px 0; border-top: 1px solid var(--line-2); } .version:first-child { border-top: 0; } .version pre { margin: 8px 0 0; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.digest ul.digest-lines { margin: 0 0 10px; padding-left: 18px; font-size: 14.5px; line-height: 1.6; } .digest li.goal { color: var(--accent-ink); } .digest li.exp { color: var(--ink-2); }
.digest .suggestion { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.xrow { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; } .xrow:first-child { border-top: 0; }
.xrow.closed { color: var(--ink-2); }
