/*
 * Cravio brand: the ONE place to change the look (web app + desktop app).
 * Palette: Obsidian & Champagne (approved 2026-10). Values come from src/ui/brand-tokens.ts;
 * test/unit/brand-tokens.test.ts checks this file matches it and that every text/background pair
 * passes WCAG AA. Inter only (600 headings, 400 body), bundled (assets/fonts): the CSP only allows
 * fonts from the app itself, and there is no font CDN. Logo: assets/logo.svg (Concept A, recoloured).
 *
 * Themes: light is the default (desktop, per the brand board). `<html data-theme="dark">` switches to
 * dark (web and desktop when Appearance is Dark, or Match system and the device is dark).
 * Champagne is used sparingly. On light it is a fill only; accent-coloured text uses --accent-text.
 */
@font-face { font-family: 'Inter'; src: url('fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* palette */
  --obsidian: #0B0D12;
  --graphite: #1C1F26;
  --champagne: #C8A96A;
  --pewter: #8C8F99;
  --ivory: #F5F2EA;
  --champagne-ink: #7A5F2E;
  --pewter-ink: #5C5F69;

  /* light theme (desktop default) */
  --bg: #F5F2EA;
  --bg-raised: #EDE9DF;
  --surface: #FFFFFF;
  --bg-hover: #E9E4D9;
  --bg-pressed: #DFD9CC;
  --line: #E6E1D6;
  --line-strong: #CBC4B4;
  --text: #0B0D12;
  --text-dim: #3A3D46;
  --text-faint: #5C5F69;
  --strong: #0B0D12;
  --on-strong: #F5F2EA;
  --strong-hover: #1C1F26;
  --accent: #C8A96A;
  --accent-hover: #D3B77E;
  --accent-pressed: #B8995B;
  --accent-ink: #0B0D12;
  --accent-text: #7A5F2E;
  --accent-soft: #F0E8D7;
  --ok: #2E7049;
  --ok-soft: #E3EDE2;
  --warn: #8F5512;
  --warn-soft: #F5E7D0;
  --bad: #B3261E;
  --bad-soft: #F6E0DA;
  --on-bad: #FFFFFF;
  --focus: #7A5F2E;
  --bubble-me: #0B0D12;
  --on-bubble-me: #F5F2EA;

  /* derived (both themes) */
  --bg-card: var(--surface);
  --tint: var(--text);                   /* translucent washes: color-mix(in srgb, var(--tint) 6%, transparent) */
  --shadow-rgb: 11, 13, 18;              /* obsidian, for shadows */
  --scrim: rgba(11, 13, 18, .38);
  --rec: #D92D20;                        /* the universal "recording" red */
  --on-rec: #FFFFFF;
  --paper: #FFFFFF;                      /* real page content (screenshots, PDFs) stays on white */
  --media: #000000;
  /* file-type badges: data colours, muted to sit with the palette (white text, AA) */
  --ft-default: #5C5F69; --ft-pdf: #A8322B; --ft-doc: #3D5A99; --ft-sheet: #2E7049; --ft-slides: #A4521C;
  --on-ft: #FFFFFF;
  --ft-archive: #6A4C93; --ft-audio: #2C6E7F; --ft-video: #9A3A64; --ft-code: #1C1F26; --ft-image: #3E6F66;

  --brand-name: 'Cravio';
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, sans-serif;
  --font-display: var(--font);
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0B0D12;
  --bg-raised: #13161C;
  --surface: #1C1F26;
  --bg-hover: #252932;
  --bg-pressed: #2D323C;
  --line: #2A2E37;
  --line-strong: #3A3F4A;
  --text: #F5F2EA;
  --text-dim: #BDBAB2;
  --text-faint: #8C8F99;
  --strong: #F5F2EA;
  --on-strong: #0B0D12;
  --strong-hover: #E6E2D8;
  --accent: #C8A96A;
  --accent-hover: #D3B77E;
  --accent-pressed: #B8995B;
  --accent-ink: #0B0D12;
  --accent-text: #C8A96A;
  --accent-soft: #343230;
  --ok: #7CC79A;
  --ok-soft: #1E2D26;
  --warn: #E5A25A;
  --warn-soft: #33291D;
  --bad: #F08C82;
  --bad-soft: #3A2225;
  --on-bad: #0B0D12;
  --focus: #C8A96A;
  --bubble-me: #2A2E37;
  --on-bubble-me: #F5F2EA;

  --scrim: rgba(5, 6, 9, .62);
  --shadow-rgb: 0, 0, 0;
  color-scheme: dark;
}

/* Sign-up v1 screens (auth-start*, renderer/signup.ts) always wear the brand's dark board: Obsidian #0B0D12 ground,
   Graphite #1C1F26 surfaces, Ivory #F5F2EA text, Pewter #8C8F99 for quiet text, Champagne #C8A96A only for focus,
   links and the recommended tag, Inter throughout. Scoped to those screens; the rest of the app keeps its theme. */
.onboard.auth[data-screen^="auth-start"] {
  --bg: #0B0D12;
  --bg-raised: #13161C;
  --surface: #1C1F26;
  --bg-hover: #252932;
  --bg-pressed: #2D323C;
  --line: #2A2E37;
  --line-strong: #3A3F4A;
  --text: #F5F2EA;
  --text-dim: #BDBAB2;
  --text-faint: #8C8F99;
  --strong: #F5F2EA;
  --on-strong: #0B0D12;
  --strong-hover: #E6E2D8;
  --accent: #C8A96A;
  --accent-hover: #D3B77E;
  --accent-pressed: #B8995B;
  --accent-ink: #0B0D12;
  --accent-text: #C8A96A;
  --accent-soft: #343230;
  --ok: #7CC79A;
  --ok-soft: #1E2D26;
  --warn: #E5A25A;
  --warn-soft: #33291D;
  --bad: #F08C82;
  --bad-soft: #3A2225;
  --on-bad: #0B0D12;
  --focus: #C8A96A;
  --bubble-me: #2A2E37;
  --on-bubble-me: #F5F2EA;

  --scrim: rgba(5, 6, 9, .62);
  --shadow-rgb: 0, 0, 0;
  color-scheme: dark;
}

/* Keyboard focus: one champagne ring everywhere. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Cravio AI web app. Brand tokens and fonts come from desktop/src/renderer/brand.css (prepended by the build);
   theme from Settings (Appearance): index.html starts dark; web/src/appearance.ts sets data-theme. Mobile first; two panes from 900 px. */
:root {
  --radius: 14px;
  /* polish tokens (v2): one type scale, a 4-pt spacing grid, five radii, three speeds. Colours live in brand.css. */
  --t-large: 600 28px/34px var(--font-display);
  --t-title: 600 20px/26px var(--font-display);
  --t-headline: 600 17px/22px var(--font);
  --t-body: 400 16px/22px var(--font);
  --t-callout: 400 15px/20px var(--font);
  --t-footnote: 400 13px/18px var(--font);
  --t-caption: 500 12px/16px var(--font);
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-full: 999px;
  --m-fast: 120ms; --m-base: 200ms; --m-slow: 320ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-sheet: cubic-bezier(.22, 1.18, .36, 1);
  --shadow-1: 0 8px 24px rgba(var(--shadow-rgb), .32);
  --shadow-2: 0 20px 50px rgba(var(--shadow-rgb), .45);
  --tap: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { -webkit-text-size-adjust: 100%; }
#app { height: 100%; }
h1 { font: 700 26px/1.2 var(--font-display); margin: 6px 0 4px; letter-spacing: -0.01em; }
h3 { font: 600 18px/1.3 var(--font-display); margin: 0 0 8px; }
p { margin: 0 0 8px; }
a { color: var(--accent-text); text-decoration: none; }
code { font-family: var(--font-mono); font-size: 0.9em; background: color-mix(in srgb, var(--tint) 7%, transparent); padding: 1px 5px; border-radius: 6px; }
button, input, textarea, select { font: inherit; color: inherit; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.fine { font-size: 12.5px; color: var(--text-faint); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row.spread { justify-content: space-between; }
.row.end { justify-content: flex-end; padding: 12px 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.pad { padding: 16px; }
.label { font-size: 11.5px; letter-spacing: .12em; color: var(--text-faint); font-weight: 600; }
.section-label { font: var(--t-footnote); font-weight: 600; color: var(--text-faint); padding: 20px 20px 8px; letter-spacing: 0; }
.i { display: inline-flex; width: 20px; height: 20px; flex: none; }
.i svg { width: 100%; height: 100%; }
.ok { color: var(--ok); }
.ok.big { font-size: 17px; text-align: center; padding: 12px 0; }
.danger-text { color: var(--bad) !important; }
.only-wide { display: none; }
[hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-card); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--bg-hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--bad); color: var(--on-bad); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.small { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
.btn.block { width: 100%; min-height: 52px; font-size: 16px; }
.link-btn { background: none; border: 0; color: var(--accent-text); padding: 8px 0; cursor: pointer; font-weight: 500; }
.link-btn:disabled { color: var(--text-faint); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--text-dim); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.tiny { width: 28px; height: 28px; }
.icon-btn.tiny .i { width: 16px; height: 16px; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* splash + full-screen gates (sign-in, microphone, connect) */
.splash { height: 100%; display: grid; place-items: center; background: var(--bg); }
.splash img { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); opacity: .85; } }
.gate { min-height: 100%; display: flex; justify-content: center; padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); background: radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--bg); }
.gate-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; padding-top: 4vh; }
.gate-card.center { align-items: stretch; text-align: center; }
.gate-card.center .mark, .gate-card.center .mic-orb { align-self: center; }
.gate .back { margin-left: -8px; }
.mark { filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 35%, transparent)); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
input, textarea, select { width: 100%; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; font-size: 16px; color: var(--text); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw .link-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13.5px; }
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: -6px; }
.hint.ok { color: var(--ok); }
.code-input { text-align: center; font: 600 28px var(--font-mono); letter-spacing: .4em; padding: 14px 8px 14px calc(8px + .4em); }
.code-input.wide { letter-spacing: .2em; font-size: 26px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--line); font-size: 14px; text-align: left; }
.note.bad { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 8%, transparent); color: var(--bad); }
.note.warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); flex-direction: column; gap: 4px; }
.note.warn ol { margin: 4px 0 0; padding-left: 20px; color: var(--text-dim); }
.note.warn li { margin: 3px 0; }
.mail-badge, .mic-orb { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text); box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 6%, transparent); margin: 6px 0 8px; }
.mail-badge { width: 64px; height: 64px; }
.mic-orb .i { width: 38px; height: 38px; }
.mic-orb.off { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); box-shadow: 0 0 0 10px color-mix(in srgb, var(--warn) 5%, transparent); }
.choice { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-card); cursor: pointer; }
.choice:hover { border-color: var(--accent-text); }
.choice > .i:first-child { width: 28px; height: 28px; color: var(--accent-text); }
.big-code { font: 700 44px/1.1 var(--font-mono); letter-spacing: .12em; text-align: center; padding: 18px 0; color: var(--text); }
.how { margin: 0; padding-left: 22px; color: var(--text-dim); }
.how li { margin: 6px 0; }
p.bad { color: var(--bad); }

/* shell */
.shell { height: 100%; display: flex; flex-direction: column; }
.list-pane, .main-pane { display: flex; flex-direction: column; min-height: 0; }
.list-pane { flex: 1; overflow-y: auto; padding-bottom: calc(72px + var(--safe-bottom)); }
.main-pane { display: none; }
.shell.has-main .list-pane { display: none; }
.shell.has-main .main-pane { display: flex; flex: 1; }
.demo-ribbon { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); font-size: 12px; text-align: center; padding: calc(4px + var(--safe-top)) 8px 4px; }
.shell[data-demo] .bar { padding-top: 10px; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px; padding: calc(10px + var(--safe-top)) 10px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); min-height: 60px; }
.bar .title { display: flex; flex-direction: column; line-height: 1.2; padding-left: 4px; }
.bar .title small { font-size: 12px; }
.switcher { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; font-size: 18px; padding: 6px 10px; border-radius: 12px; cursor: pointer; font-family: var(--font-display); }
.switcher:hover { background: var(--bg-hover); }
.switcher .i { width: 16px; height: 16px; color: var(--text-faint); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--tint) 8%, transparent); color: var(--text-dim); text-transform: none; margin-left: 6px; }
.badge.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
/* Cost cut 2: the cloud coding price, shown before it can be turned on. */
.cloud-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.cloud-price .amount { font: var(--t-large); color: var(--accent-text); }
.cloud-price .per { font: var(--t-callout); color: var(--text-dim); }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.menu { position: fixed; z-index: 50; min-width: 260px; max-width: 320px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: 0 20px 50px rgba(var(--shadow-rgb), .45); }
.menu-label { font-size: 11px; letter-spacing: .12em; color: var(--text-faint); padding: 8px 10px 4px; font-weight: 600; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--bg-hover); }
.menu-item small { display: block; color: var(--text-faint); font-size: 12px; }
.menu-item .i { color: var(--text-dim); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around; padding: 6px 8px calc(6px + var(--safe-bottom)); background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-faint); padding: 4px 14px; border-radius: 12px; }
.tab.on { color: var(--accent-text); }
.shell.has-main .tabbar { display: none; }
body[data-route="settings"] .shell.has-main .tabbar { display: flex; }
body[data-route="settings"] .main-pane { padding-bottom: calc(72px + var(--safe-bottom)); }

/* banners */
.banners { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 0; }
.banner { display: block; width: 100%; text-align: left; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-card); padding: 12px; cursor: pointer; color: var(--text); }
.banner-row { display: flex; align-items: center; gap: 12px; }
.banner-row > .i:first-child { color: var(--accent-text); }
.banner.takeover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.banner.spend.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.banner.spend.warn .i:first-child { color: var(--warn); }
.banner.spend.stopped { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.banner.spend.stopped .i:first-child { color: var(--bad); }
.banner.mic-banner { cursor: default; border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.banner.mic-banner .denied { margin-top: 10px; }
.banner.install { cursor: default; }
.app-icon { border-radius: 9px; flex: none; }

/* thread list */
.threads { display: flex; flex-direction: column; padding: 0 8px; }
.thread-row { display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 14px; color: var(--text); }
.thread-row:hover, .thread-row.active { background: var(--bg-hover); }
.thread-row .preview { color: var(--text-dim); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-row.unread strong, .thread-row.unread .preview { color: var(--text); font-weight: 600; }
.thread-row .row { gap: 10px; }
.count { background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; border-radius: 99px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; flex: none; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--bg-hover), var(--surface)); color: var(--accent-text); font: 700 18px var(--font-display); flex: none; border: 1px solid var(--line); }
.avatar.team { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.empty { text-align: center; padding: 32px 20px; }

/* thread */
.thread-pane, .live-pane, .page { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; overflow-anchor: auto; }
.msg { display: flex; flex-direction: column; max-width: min(86%, 640px); }
.msg .bubble { padding: 10px 14px; border-radius: 18px; background: var(--bg-card); border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg .bubble p:last-child, .msg .bubble ul:last-child, .msg .bubble ol:last-child { margin-bottom: 0; }
.msg .bubble ul, .msg .bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.msg .bubble .hd { font-weight: 700; }
.msg .meta { font-size: 11.5px; color: var(--text-faint); padding: 3px 6px; display: flex; align-items: center; gap: 2px; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.user .bubble { background: var(--bubble-me); color: var(--on-bubble-me); border-color: transparent; border-bottom-right-radius: 6px; }
.msg.user .bubble code { background: rgba(var(--shadow-rgb), .12); }
.msg.bot { align-self: flex-start; }
.msg.bot .bubble { border-bottom-left-radius: 6px; }
.msg.bot .who { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); padding: 0 4px 4px; }
.msg.result .bubble { border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
/* H1-01/H1-02: the bot's "On it" and progress lines while it works: one quiet Pewter line, no bubble. */
.msg.msg-interim { flex-direction: row; align-items: baseline; gap: 6px; align-self: flex-start; max-width: 90%; margin: 2px 0; font: var(--t-footnote); color: var(--text-faint); }
.msg.msg-interim .who-inline { font-weight: 600; }
.msg.system { align-self: center; font-size: 12.5px; color: var(--text-faint); text-align: center; max-width: 90%; }
.msg.step { flex-direction: row; align-items: center; gap: 8px; align-self: flex-start; font-size: 13px; color: var(--text-dim); background: color-mix(in srgb, var(--tint) 3%, transparent); border: 1px dashed var(--line); border-radius: 12px; padding: 6px 10px; }
.msg.step .i { width: 16px; height: 16px; color: var(--accent-text); }
.mention { color: var(--accent-text); font-weight: 600; }
.msg.user .mention { color: var(--accent); text-decoration: underline; }
.quote { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-faint); padding: 0 6px 4px; }
.quote .i { width: 14px; height: 14px; }
@keyframes blink { 50% { opacity: 0; } }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.msgs .card { max-width: min(92%, 640px); align-self: flex-start; display: flex; flex-direction: column; gap: 6px; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-head .i { color: var(--accent-text); }
.card-head strong { flex: 1; }
.card.approval.pending { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent); }
.card.takeover.waiting { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.card p { margin: 0; font-size: 14px; }
.progress { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--tint) 8%, transparent); overflow: hidden; margin: 6px 0; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.progress.warn i { background: var(--warn); }
.progress.stopped i { background: var(--bad); }
.composer { padding: 8px 10px calc(8px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea { resize: none; border-radius: 22px; padding: 11px 16px; max-height: 140px; line-height: 1.35; }
.composer .send, .composer .mic-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; cursor: pointer; }
.composer .send { background: var(--accent); color: var(--accent-ink); }
.composer .send:disabled { opacity: .4; }
.composer .mic-btn { background: var(--bg-card); color: var(--accent-text); border: 1px solid var(--line); touch-action: none; user-select: none; -webkit-user-select: none; }
.replying { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); padding: 0 6px 6px; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); animation: breathe 1s infinite; }

/* live screen */
.live-pane .note { margin: 10px 12px 0; }
.live-pane .note .i { color: var(--accent-text); }
.url { font-size: 12px; color: var(--text-faint); padding: 8px 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame-wrap { flex: 1; min-height: 200px; display: grid; place-items: center; padding: 0 12px; }
.frame { max-width: 100%; max-height: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); cursor: crosshair; touch-action: manipulation; }
.frame:not([src]) { display: none; }
.live-pane form { padding: 10px 12px; }

/* settings + pages */
.page { overflow-y: auto; }
.group .card.list { margin: 0 12px; padding: 4px 0; }
.setting { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; color: var(--text); border-bottom: 1px solid var(--line); cursor: default; }
a.setting, button.setting, label.setting { cursor: pointer; }
.setting:last-child { border-bottom: 0; }
.setting > .i:first-child { color: var(--accent-text); }
.setting.danger > .i:first-child, .setting.danger .title { color: var(--bad); }
.setting .title { font-weight: 600; }
.setting .meta { font-size: 13px; color: var(--text-dim); }
.setting > .i:last-child { color: var(--text-faint); width: 16px; height: 16px; }
.setting input[type=number] { width: 92px; padding: 8px 10px; font-size: 15px; }
.quiet-times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiet-times input[type=time] { width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; font-size: 15px; }
.toggle { position: relative; width: 50px; height: 30px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: .2s; }
.toggle span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--ivory); transition: .2s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(20px); }
.big-stat { margin: 12px; display: flex; flex-direction: column; gap: 4px; }
.stat { font: 700 40px var(--font-display); }
.card.ask { display: flex; gap: 12px; align-items: flex-start; }
.card.ask .i { width: 32px; height: 32px; color: var(--accent-text); }
.transcript { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 24px; }
.tline { max-width: 88%; }
.tline.in { align-self: flex-start; }
.tline.out { align-self: flex-end; }
.tline .meta { font-size: 12px; color: var(--text-dim); padding: 0 6px 3px; }
.tline .bubble { background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.tline.out .bubble { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.radio { display: flex; align-items: center; gap: 10px; padding: 8px 4px; cursor: pointer; }
.radio input { width: 18px; height: 18px; accent-color: var(--accent-text); }
.placeholder { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; opacity: .8; }

/* sheets + toast */
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); align-self: center; margin-bottom: 6px; }
.sheet .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.sheet .actions .btn { min-height: 50px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px); opacity: .5; } }
#toast.bad { background: var(--bad); color: var(--on-bad); }

/* install guide */
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.install-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 6px 12px; align-items: start; }
.install-steps .num { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }
.install-steps .art { grid-column: 2; }
.install-steps .art svg { width: 100%; max-width: 300px; height: auto; display: block; }
.install-steps p { margin: 2px 0 0; font-size: 14px; }

/* wide screens: list + chat side by side */
@media (min-width: 900px) {
  .only-narrow { display: none !important; }
  .only-wide { display: grid; }
  .shell { flex-direction: row; flex-wrap: wrap; }
  .demo-ribbon { width: 100%; order: -2; } /* before the tab rail (order -1), or the rail takes a row of its own */
  .shell .list-pane, .shell.has-main .list-pane { display: flex; width: 360px; flex: none; border-right: 1px solid var(--line); padding-bottom: 0; height: 100%; }
  .main-pane, .shell.has-main .main-pane { display: flex; flex: 1; min-width: 0; height: 100%; }
  /* after the rule above: the demo ribbon takes a row, so the panes (and the composer) must not overflow it */
  .shell[data-demo] .list-pane, .shell[data-demo] .main-pane, .shell.has-main[data-demo] .list-pane, .shell.has-main[data-demo] .main-pane { height: calc(100% - 26px); }
  .tabbar, .shell.has-main .tabbar, body[data-route="settings"] .shell.has-main .tabbar { position: static; order: -1; flex-direction: column; justify-content: flex-start; gap: 6px; width: 76px; height: 100%; border-top: 0; border-right: 1px solid var(--line); padding: 16px 6px; display: flex; }
  .shell[data-demo] .tabbar { height: calc(100% - 26px); }
  body[data-route="settings"] .main-pane { padding-bottom: 0; }
  .backdrop { align-items: center; }
  .sheet { border-radius: 24px; }
  .sheet .grab { display: none; }
  .msgs { padding: 20px 28px; }
  #toast { bottom: 32px; }
}
.licence { white-space: pre-wrap; font-size: 12px; }

/* v1.6 Efficient AI */
.ai-switch { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg-card); color: var(--text); font: 600 13px/1 var(--font); cursor: pointer; white-space: nowrap; }
.ai-switch .i { width: 15px; height: 15px; }
.ai-switch.efficient { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ai-switch.efficient .i { color: var(--accent-text); }
@media (max-width: 380px) { .ai-switch span { display: none; } }
.choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.choices .choice { width: 100%; color: var(--text); }
.choices .choice.on { border-color: var(--accent-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.choices .choice strong { display: block; }
.choices .choice small { display: block; margin-top: 2px; }
.choice-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text); }
.choice-ico .i { width: 18px; height: 18px; }
.check { display: flex; gap: 8px; align-items: center; justify-content: flex-start; font-size: 14px; margin: 4px 0 10px; }
.check input { width: 18px; height: 18px; flex: none; margin: 0; padding: 0; accent-color: var(--accent-text); }
.notice { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-dim); }
.notice .i { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent-text); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 2px; flex: none; }
.seg button { border: 0; background: none; color: var(--text-dim); font: 600 12.5px/1 var(--font); padding: 7px 10px; border-radius: 99px; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.thread-pane > .banner.eff { margin: 8px 12px 0; width: auto; cursor: default; }
.banner.eff .row.end { padding: 8px 0 0; gap: 8px; }
.banner.spend.eff.warn .banner-row .i:first-child { color: var(--warn); }
.banner.spend.eff.stopped .banner-row .i:first-child { color: var(--bad); }
.eff-meter .pct { font: 700 18px/1 var(--font-display); }
.eff-meter .pct.warn80, .eff-meter .pct.warn95 { color: var(--warn); }
.eff-meter .pct.stopped { color: var(--bad); }
.media-msg { max-width: min(420px, 86%); }
.media-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--bg-card); }
.media-slot { display: grid; place-items: center; min-height: 160px; background: var(--bg-raised); }
.media-slot img, .media-slot video { display: block; width: 100%; max-height: 420px; object-fit: contain; background: var(--media); }
.media-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 160px; padding: 16px; text-align: center; background: var(--bg-raised); color: var(--text-dim); }
.media-wait.bad { color: var(--bad); }
.media-wait .spin { width: 22px; height: 22px; color: var(--accent-text); }
.media-cap { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 13.5px; }
.media-cap .i { width: 16px; height: 16px; color: var(--accent-text); flex: none; }

/* ---------------------------------------------------------------- Assistant (v1.6 §10) */
body[data-route="assistant"] .shell.has-main .tabbar { display: flex; }
body[data-route="assistant"] .main-pane { padding-bottom: calc(72px + var(--safe-bottom)); }
@media (min-width: 900px) {
  body[data-route="assistant"] .shell.has-main .tabbar { position: static; order: -1; flex-direction: column; justify-content: flex-start; gap: 6px; width: 76px; height: 100%; border-top: 0; border-right: 1px solid var(--line); padding: 16px 6px; }
  body[data-route="assistant"] .main-pane { padding-bottom: 0; }
}
.assist p.small, .sheet p.small { font-size: 13.5px; margin: 0; }
.assist .pad.small { padding: 4px 16px 0; }
.assist button.plain { border: 0; background: none; color: inherit; text-align: left; padding: 0; cursor: pointer; font: inherit; min-width: 0; }
.setting.routine.off .title, .setting.routine.off > .i:first-child { color: var(--text-dim); }
.sheet small.bad { color: var(--bad); }
.sheet .field select, .sheet .field textarea { width: 100%; }
/* §10.2 background helpers */
.helper { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.card .helper:first-child, .card .title + .helper { border-top: 0; }
.helper .title { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.helper .meta { color: var(--text-dim); font-size: 13.5px; margin-top: 2px; }
.helper.cancelled .title { color: var(--text-dim); }
.helper .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--text-dim); }
.helper .dot.run { background: var(--accent); animation: helper-pulse 1.2s ease-in-out infinite; }
.helper .dot.ok { background: var(--ok); }
.helper .dot.bad { background: var(--bad); }
.badge.run { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }
@keyframes helper-pulse { 50% { opacity: .35; } }
.helpers-card .card { padding: 0; overflow: hidden; max-width: 520px; }
.helpers-card .card > .title { gap: 8px; padding: 12px 16px 4px; font-weight: 600; }
.helpers-card .card > .title .i { color: var(--accent-text); }

/* v1.7 chat attachments (§11) */
.attach { position: relative; overflow: hidden; cursor: pointer; flex: none; align-self: flex-end; }
.attach .file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.attach-tray { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 8px; }
.file-chips { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.msg.user .file-chips { align-items: flex-end; }
.file-chip { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--bg-card); color: var(--text); border-radius: 12px; padding: 8px 10px; min-width: 200px; max-width: min(320px, 80vw); text-align: left; }
.file-chip[role="button"] { cursor: pointer; }
.file-chip.gone { opacity: .6; }
.file-chip.risky { border-color: var(--warn); }
.chip-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.chip-badge { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; color: var(--on-ft); background: var(--ft-default); }
.chip-badge.t-pdf { background: var(--ft-pdf); } .chip-badge.t-doc { background: var(--ft-doc); } .chip-badge.t-sheet { background: var(--ft-sheet); }
.chip-badge.t-slides { background: var(--ft-slides); } .chip-badge.t-archive { background: var(--ft-archive); } .chip-badge.t-audio { background: var(--ft-audio); }
.chip-badge.t-video { background: var(--ft-video); } .chip-badge.t-code { background: var(--ft-code); } .chip-badge.t-image { background: var(--ft-image); }
.chip-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chip-line { font-size: 12px; opacity: .7; }
.chip-warn { font-size: 11px; color: var(--warn); }
.file-preview { display: block; max-width: 100%; max-height: 60vh; margin: 0 auto; border-radius: 8px; }
.file-preview.pdf { width: 100%; height: 60vh; border: 0; background: var(--paper); }
/* v1.6 prepaid credit packages */
.choices.packages .pkg { gap: 12px; }
.pkg-price { font-weight: 700; white-space: nowrap; color: var(--text); }
.pkg-price.tbd { font-weight: 500; font-size: 12px; color: var(--text-dim); }
.notice.warn { color: var(--text); }
.notice.warn .i { color: var(--warn); }
/* §10.3 skills */
.setting.suggestion { border-left: 3px solid var(--accent); }
.suggestion-card .card.pad { padding: 12px 16px; max-width: 520px; }
.suggestion-card .card .title { gap: 8px; font-weight: 600; }
.suggestion-card .card .row { gap: 8px; margin-top: 8px; }

/* §10.4 connectors */
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.checks .check { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.bad-text { color: var(--bad); }
.setting.compact { padding: 8px 12px; }
.badge.bad { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad); }

/* §10.5 drafts */
.drafts { display: flex; flex-direction: column; gap: 12px; }
.draft-card .title { gap: 8px; align-items: center; font-weight: 600; }
.draft-card .draft-lines { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.draft-card .draft-line { display: flex; gap: 8px; }
.draft-card .draft-line .k { width: 56px; flex: none; }
.draft-card .draft-line .v { word-break: break-word; }
.draft-card .draft-text { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--text-faint) 12%, transparent); white-space: pre-wrap; max-height: 260px; overflow: auto; }
.draft-card.closed .draft-text { max-height: 90px; opacity: .8; }
.draft-card .draft-warn { margin-top: 8px; display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.draft-card .draft-acts { gap: 8px; margin-top: 10px; }
.draft-card .draft-acts { flex-wrap: wrap; }
.draft-card .draft-copy-note { margin-top: 8px; }
.draft-card .badge.ok { color: var(--ok); }
.draft-card .badge.bad, .small.bad { color: var(--bad); }

/* §10.6 inbox */
p.warn { color: var(--warn); }
.setting.unread .title { font-weight: 700; }
.inbox-head .row { gap: 12px; align-items: center; }
.mail-text { white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.5; margin: 0; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--text-faint) 10%, transparent); max-height: 50vh; overflow: auto; }

/* §10.9 videos */
.video-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.video-body .title { gap: 8px; align-items: center; font-weight: 600; }
.video-body .pre { white-space: pre-wrap; line-height: 1.5; margin: 4px 0 0; }
.video-body .warn { color: var(--warn); margin: 4px 0 0; }
.video-item { align-items: flex-start; }

/* §10.10 meetings */
.meeting-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.meeting-body p { white-space: pre-wrap; margin: 0; }
.meeting-body .title { gap: 8px; font-weight: 600; flex-wrap: wrap; }
.meeting-item { align-items: flex-start; }
.meeting-live { display: flex; flex-direction: column; gap: 10px; margin: 0 16px 8px; }
.meeting-lines { display: flex; flex-direction: column; gap: 4px; font-size: 13px; border-left: 3px solid var(--accent); padding-left: 10px; }

/* §10.11 coding */
.coding-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.coding-body .title { gap: 8px; font-weight: 600; flex-wrap: wrap; }
.coding-body p { white-space: pre-wrap; margin: 0; }
.coding-body .files { display: flex; flex-direction: column; gap: 2px; font: 12px/1.5 ui-monospace, Menlo, monospace; }
.coding-body .file { display: flex; gap: 10px; } .coding-body .file > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.coding-body .a, pre.diff .a { color: var(--ok); } .coding-body .r, pre.diff .r { color: var(--bad); }
.coding-body .acts { gap: 8px; flex-wrap: wrap; }
.coding-item { align-items: flex-start; }
pre.diff { font: 12px/1.45 ui-monospace, Menlo, monospace; max-height: 60vh; overflow: auto; margin: 0; white-space: pre; padding: 10px; border-radius: 8px; background: color-mix(in srgb, var(--text-faint) 10%, transparent); }
pre.diff .h { color: var(--accent-text); } pre.diff .f { font-weight: 600; }

/* §10.12 group chats */
.check-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.section-label.row button.plain { font-size: 12px; color: var(--text-dim); background: none; border: 0; padding: 4px 0; cursor: pointer; } /* was grey-on-grey (2.6:1): fails WCAG AA */
.room-item, .link-item { gap: 8px; align-items: flex-start; }

/* §10.13 bot templates */
.tpl-preview { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.tpl-preview p { margin: 2px 0; }
.tpl-instr { white-space: pre-wrap; max-height: 160px; overflow: auto; background: color-mix(in srgb, var(--text-faint) 8%, transparent); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; margin: 0; }
textarea[data-testid="tpl-out"], textarea[data-testid="tpl-in"] { width: 100%; margin: 8px 0; font-family: ui-monospace, monospace; font-size: 12px; box-sizing: border-box; }
input[data-testid="tpl-file"] { margin-top: 6px; }

/* §10.14 cards and reactions */
.todo { display: grid; gap: 6px; margin-top: 8px; }
.todo-item { display: flex; gap: 8px; align-items: center; }
.todo-item .box { width: 16px; height: 16px; border: 1.5px solid currentColor; opacity: .8; border-radius: 4px; display: inline-grid; place-items: center; font-size: 11px; }
.todo-item.done span:last-child { text-decoration: line-through; opacity: .6; }
.todo-item.doing span:last-child { font-weight: 600; }
/* #263: failed plan/todo step — existing --bad error token, muted tint */
.todo-item.failed { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); border-radius: 6px; }
.todo-item.failed .box { border-color: var(--bad); color: var(--bad); }
.goal-part.failed { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); border-radius: 6px; }
.goal-part.failed .box { border-color: var(--bad); color: var(--bad); }
.assist-card .options { gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.assist-card .row input[type=password] { flex: 1; min-width: 120px; }
.assist-card pre.cmd, .assist-card pre.out { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--text-faint) 14%, transparent); font: 12px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
.assist-card .blocked .title { color: var(--bad); }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.msg.user .reactions { justify-content: flex-end; }
.reaction { border: 1px solid color-mix(in srgb, var(--text-faint) 35%, transparent); background: transparent; color: inherit; border-radius: 999px; padding: 1px 8px; font-size: 13px; cursor: pointer; }
.reaction.mine { border-color: var(--accent-text); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.reaction.big { font-size: 22px; padding: 4px 8px; border: 0; }
.react-picks { gap: 6px; flex-wrap: wrap; justify-content: center; }

/* §10.15 screen recording */
.rec-bar { position: fixed; top: max(6px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--rec); color: var(--on-rec); font-size: 13px; font-weight: 600; box-shadow: 0 4px 16px rgba(var(--shadow-rgb), .25); max-width: calc(100vw - 16px); }
.rec-bar .rec-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-bar.paused { background: var(--strong); color: var(--on-strong); }
.rec-bar.saving { background: var(--ft-default); }
.rec-bar .rec-stop { background: var(--on-rec); color: var(--rec); border: 0; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--on-rec); display: inline-block; flex: none; animation: rec-blink 1.2s infinite; }
.rec-card .rec-dot { background: var(--rec); margin-right: 6px; }
.rec-bar.paused .rec-dot { animation: none; opacity: .6; }
/* §10.21 the desktop-control bar (below the recording bar when both show) */
.desk-bar { position: fixed; top: max(6px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--strong); color: var(--on-strong); font-size: 13px; font-weight: 600; box-shadow: 0 4px 16px rgba(var(--shadow-rgb), .25); max-width: calc(100vw - 16px); }
.is-recording .desk-bar { top: calc(max(6px, env(safe-area-inset-top)) + 44px); }
/* Room for the bar, so it never covers a header or a button. */
body.is-desktop #app { height: calc(100% - 50px); margin-top: 50px; }
body.is-desktop.is-recording #app { height: calc(100% - 94px); margin-top: 94px; }
.desk-bar .desk-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.desk-bar.paused .desk-dot { background: var(--warn); }
.desk-bar.user .desk-dot { background: var(--ok); }
.desk-bar .btn { background: color-mix(in srgb, var(--on-strong) 16%, transparent); color: var(--on-strong); border: 0; }
.desk-bar .desk-stop { background: var(--accent); color: var(--accent-ink); }
.desk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; flex: none; animation: rec-blink 1.2s infinite; }
.desk-card .desk-dot { background: var(--accent); margin-right: 6px; }
.desk-bar.paused .desk-dot, .desk-bar.user .desk-dot { animation: none; opacity: .7; }
.desk-log { display: flex; flex-direction: column; gap: 2px; padding: 0 12px 12px; font-size: 13px; }
.desk-log-row { padding: 6px 8px; border-radius: 6px; background: var(--card, color-mix(in srgb, var(--text-faint) 6%, transparent)); overflow-wrap: anywhere; }
.desk-log-row.bad { color: var(--bad); }
.desk-log-row.warn { color: var(--warn); }
@keyframes rec-blink { 50% { opacity: .25; } }
.file-videos { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.video-slot video { width: 100%; max-width: 480px; max-height: 360px; border-radius: 12px; background: var(--media); display: block; }
.btn.danger { background: var(--bad); color: var(--on-bad); border-color: var(--bad); }

/* §10.22 B6: Projects */
.project-row { text-align: left; width: 100%; }
.project-row .sub, [data-testid="project-bot"] .sub, .note .sub { display: block; font-size: 12px; }
.note .strike { text-decoration: line-through; }
.note .tag { margin-right: 4px; }
.note .tag.warn { background: var(--warn-soft); color: var(--warn); }
.brief-card { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.brief-card summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.brief-card .kv { display: grid; grid-template-columns: 9em 1fr; gap: 8px; font-size: 13px; padding: 4px 0; }
.brief-card .kv .v { white-space: pre-wrap; color: inherit; }
.brief-card.tone-bad summary strong { color: var(--bad); }
.brief-card .handoff { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.rules { margin: 6px 0 0 18px; }

.bot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 12px; }
.bot-row + .bot-row { border-top: 1px solid var(--line); }
.bot-row .grow { flex: 1 1 220px; min-width: 0; }
.bot-row label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ================================================================ polish v2: motion, depth, pressed states
   Colours are the same palette as above; only spacing, type, radii and motion change. Everything that moves animates
   transform/opacity only (60 fps), and prefers-reduced-motion turns it into plain fades or nothing (end of file). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* type + headers */
.bar .title strong, .bar strong.title { font: var(--t-headline); }
.bar.root { border-bottom-color: transparent; background: var(--bg); padding: calc(14px + var(--safe-top)) 20px 6px; min-height: 0; }
.large-title { font: var(--t-large); letter-spacing: -0.015em; margin: 0; }
.head-btn { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 4px 8px; margin-left: -2px; border-radius: var(--r-sm); cursor: pointer; min-width: 0; color: var(--text); flex-direction: row !important; }
.head-btn .title-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.head-btn .title-text strong { font: var(--t-headline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-btn .title-text small { font: var(--t-caption); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: var(--tap); height: var(--tap); }
.icon-btn.tiny { width: 32px; height: 32px; }

/* pressed states: a quick scale-down on press, a soft spring back (transform only) */
.btn, .icon-btn, .send, .mic-btn, .thread-row, a.setting, button.setting, label.setting, .menu-item, .choice, .pill, .tb, .reaction, .tab, .head-btn, .switcher, .banner, .file-chip[role="button"], .plain.add, .project-row, .mention-opt {
  transition: transform var(--m-slow) var(--ease-spring), background-color var(--m-base) var(--ease), opacity var(--m-base) var(--ease);
}
.btn:active:not(:disabled), .icon-btn:active, .send:active:not(:disabled), .pill:active, .tb:active, .reaction:active, .head-btn:active, .switcher:active, .plain.add:active, .file-chip[role="button"]:active { transform: scale(.94); transition-duration: var(--m-fast); transition-timing-function: var(--ease); }
.thread-row:active, a.setting:active, button.setting:active, label.setting:active, .menu-item:active, .choice:active, .banner:active, .project-row:active, .mention-opt:active { transform: scale(.985); background: var(--bg-hover); transition-duration: var(--m-fast); }
.tab:active { transform: scale(.9); transition-duration: var(--m-fast); }
.btn { border-radius: var(--r-md); }
.btn.small { min-height: 36px; border-radius: var(--r-sm); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* lists + rows */
.setting { min-height: 52px; padding: 12px 16px; gap: 14px; }
.setting .title { font: var(--t-callout); font-weight: 600; }
.setting .meta { font: var(--t-footnote); }
.group .card.list { margin: 0 16px; padding: 0; overflow: hidden; border-radius: var(--r-md); }
.thread-row { padding: 10px 10px; border-radius: var(--r-md); min-height: 64px; }
.threads { padding: 0 8px 12px; }
.threads .section-label { padding: 18px 12px 6px; }
.section-label.row { display: flex; align-items: center; }
.plain.add { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 6px; margin: -12px -6px -12px 0; border: 0; background: none; color: var(--accent-text); font: var(--t-footnote); font-weight: 600; cursor: pointer; border-radius: var(--r-sm); }
.plain.add .i { width: 16px; height: 16px; }

/* avatars: tinted from the palette by name */
.avatar { width: 48px; height: 48px; font: 700 18px var(--font-display); --tone: var(--accent); color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent); }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; border-width: 1px; }
.avatar.md { width: 48px; height: 48px; }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.avatar.team { --tone: var(--accent); }
.tone-0 { --tone: var(--accent); } .tone-1 { --tone: var(--ok); } .tone-2 { --tone: var(--warn); } .tone-3 { --tone: var(--bad); } .tone-4 { --tone: var(--text-dim); } .tone-5 { --tone: color-mix(in srgb, var(--accent) 60%, var(--strong)); }
.bar .head-btn .avatar.sm { width: 34px; height: 34px; font-size: 14px; }

/* offline */
.offline-banner { display: flex; align-items: center; gap: 8px; margin: 8px 16px 0; padding: 10px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--warn) 10%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font: var(--t-footnote); color: var(--text); animation: drop-in var(--m-slow) var(--ease-out); }
.offline-banner .dot { background: var(--warn); }
@keyframes drop-in { from { opacity: 0; transform: translate3d(0, -8px, 0); } }
.banner { border-radius: var(--r-md); }
.banner.install { padding: 8px 10px; }
.banner.install .app-icon { width: 28px; height: 28px; }

/* ---------------------------------------------------------------- skeletons */
.skeleton { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.skel { display: block; height: 12px; border-radius: var(--r-full); background: var(--bg-card); position: relative; overflow: hidden; }
.skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tint) 6%, transparent), transparent); transform: translate3d(-100%, 0, 0); animation: shimmer 1.4s var(--ease) infinite; }
@keyframes shimmer { to { transform: translate3d(100%, 0, 0); } }
.skel.thin { height: 10px; opacity: .7; }
.skel.tall { height: 30px; border-radius: var(--r-sm); }
.skel-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px; }
.skel-row.compact { padding: 12px 16px; }
.skel-avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; }
.skel-icon { width: 22px; height: 22px; flex: none; border-radius: var(--r-xs); }
.skel-lines { display: flex; flex-direction: column; gap: 8px; }
.skel-msg { display: flex; padding: 2px 0; }
.skel-msg.me { justify-content: flex-end; }
.skel-bubble { height: 40px; border-radius: 18px; }
.skel-card { display: flex; flex-direction: column; gap: 10px; margin: 0 16px; padding: 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--bg-card) 55%, transparent); border: 1px solid var(--line); }
.skeleton.messages { padding: 4px 0; gap: 10px; }
.skeleton.stat { padding-top: 16px; gap: 12px; }
.card.list .skeleton { padding: 0; }

/* ---------------------------------------------------------------- screen push / pop (Web Animations in transitions.ts) */
.nav-ghost { position: fixed; z-index: 3; pointer-events: none; overflow: hidden; background: var(--bg); will-change: transform, opacity; contain: layout paint; }
.nav-ghost.top { z-index: 6; box-shadow: -12px 0 32px rgba(var(--shadow-rgb), .35); }
.nav-front { position: relative; z-index: 5; background: var(--bg); will-change: transform; box-shadow: -12px 0 32px rgba(var(--shadow-rgb), .35); }
.shell.peek .list-pane { display: flex !important; position: fixed; inset: 0; z-index: 1; transform: translate3d(-28%, 0, 0); }
.shell.peek .main-pane { position: relative; z-index: 4; }
.dragging { transition: none !important; }

/* ---------------------------------------------------------------- sheets: spring in, drag down to dismiss */
.backdrop { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.backdrop::before { content: ''; position: absolute; inset: 0; background: rgba(var(--shadow-rgb), .6); opacity: var(--dim, 1); animation: fade var(--m-base) var(--ease); transition: opacity var(--m-slow) var(--ease); }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; background: var(--bg-raised); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 0 20px calc(18px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-2); animation: sheet-in 420ms var(--ease-sheet); transition: transform var(--m-slow) var(--ease-out); will-change: transform; }
.sheet-handle { position: sticky; top: 0; z-index: 1; margin: 0 -20px; padding: 8px 20px 4px; background: var(--bg-raised); touch-action: none; cursor: grab; display: flex; flex-direction: column; }
.sheet-handle h3 { font: var(--t-title); margin: 6px 0 2px; }
.sheet .grab { width: 36px; height: 5px; border-radius: var(--r-full); background: var(--line); align-self: center; margin: 0 0 4px; }
.sheet.dragging, .dragging .sheet { animation: none; }
.backdrop.closing { pointer-events: none; }
.backdrop.closing::before { opacity: 0; }
.backdrop.closing .sheet { transform: translate3d(0, 105%, 0) !important; transition: transform 260ms var(--ease); }
@keyframes sheet-in { from { transform: translate3d(0, 100%, 0); } }
.sheet .actions .btn { min-height: 50px; }
.sheet .card.list { margin: 0; padding: 0; overflow: hidden; }
.shell[data-demo] .bar.root { padding-top: 16px; }
@media (min-width: 900px) {
  .backdrop { align-items: center; }
  .sheet { border-radius: var(--r-lg); border-bottom: 1px solid var(--line); animation: pop-in 260ms var(--ease-out); }
  .sheet-handle { cursor: default; }
  .sheet .grab { display: none; }
  .backdrop.closing .sheet { transform: scale(.96) !important; opacity: 0; transition: transform 180ms var(--ease), opacity 180ms var(--ease); }
}
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } }
.info-head { display: flex; align-items: center; gap: 14px; padding: 4px 0 6px; }
.info-head strong { font: var(--t-headline); display: block; }
.info-head .dim { font: var(--t-footnote); color: var(--text-dim); }
.sheet .setting .ai-switch { flex: none; }

/* ---------------------------------------------------------------- toast: springs up, icon + text */
#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); z-index: 90; display: flex; align-items: center; gap: 8px; background: var(--text); color: var(--bg); padding: 10px 16px 10px 12px; border-radius: var(--r-full); font: var(--t-callout); font-weight: 600; opacity: 0; pointer-events: none; width: max-content; max-width: calc(100% - 32px); box-shadow: var(--shadow-1); transform: translate3d(-50%, 24px, 0) scale(.96); transition: transform 240ms var(--ease), opacity 200ms var(--ease); }
#toast.show { opacity: 1; transform: translate3d(-50%, 0, 0) scale(1); transition: transform 460ms var(--ease-spring), opacity 160ms var(--ease); }
#toast .toast-i { width: 18px; height: 18px; color: var(--bg); }
#toast.bad .toast-i { color: var(--on-bad); }
#toast .toast-text { min-width: 0; text-align: left; }
.shell.has-main ~ #toast, body[data-route="t"] #toast { bottom: calc(84px + var(--safe-bottom)); }

/* ---------------------------------------------------------------- chat */
.msgs { gap: 2px; padding: 12px 12px 10px; }
.msg { animation: none; }
.msg.first { margin-top: 10px; }
.msgs > :first-child { margin-top: 0; }
.msg .bubble { border-radius: 20px; padding: 9px 14px; font: var(--t-body); }
.msg .meta { display: none; font: var(--t-caption); font-weight: 400; padding: 3px 8px 0; }
.msg.last .meta, .msg .meta:has(.badge), .msg .meta:has([data-testid="reply-pct"]), .msg .meta:has([data-testid="reply-cost"]), .msg.result .meta { display: flex; }
.msg.user .bubble { border-bottom-right-radius: 20px; }
.msg.user:not(.first) .bubble { border-top-right-radius: 6px; }
.msg.user:not(.last) .bubble { border-bottom-right-radius: 6px; }
.msg.user.last .bubble { border-bottom-right-radius: 6px; }
.msg.bot .bubble { border-bottom-left-radius: 20px; }
.msg.bot:not(.first) .bubble { border-top-left-radius: 6px; }
.msg.bot:not(.last) .bubble, .msg.bot.last .bubble { border-bottom-left-radius: 6px; }
.msg.bot .who { font: var(--t-caption); color: var(--text-dim); padding: 0 6px 4px; }
.msg.system, .msg.step, .msgs > .card { margin: 10px 0; }
.msg.bot { position: relative; }
.msg .more { position: absolute; top: 50%; right: -38px; margin-top: -16px; opacity: 0; transition: opacity var(--m-base) var(--ease); }
.msg:hover .more, .msg .more:focus-visible { opacity: 1; }
@media (hover: none) { .msg .more { display: none; } }
.msg.user .meta { justify-content: flex-end; }

/* your message: rises from the composer with a spring; the bot's reply fades up */
.msg.user.enter { animation: send-in 380ms var(--ease-spring) both; transform-origin: 100% 100%; }
.msg.bot.enter, .msgs > .card.enter, .msg.system.enter, .msg.step.enter { animation: reply-in 300ms var(--ease-out) both; transform-origin: 0 100%; }
@keyframes send-in { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.92); } }
@keyframes reply-in { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.98); } }
.msg.pending .bubble { opacity: .78; }
.msg.pending .meta { display: flex; }

/* streaming: the reply grows inside a bubble already shaped like the final one; the caret is a soft beam */
.msg.live .bubble { animation: reply-in 260ms var(--ease-out); }
.msg.live:not(:first-child) .bubble { animation: none; }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -3px; border-radius: 1px; background: var(--accent); animation: caret 1.05s var(--ease) infinite; }
@keyframes caret { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
.meta.ghost { visibility: hidden; }

/* a calm "Working…" pill */
.typing { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 14px; border-radius: var(--r-full); background: var(--bg-card); border: 1px solid var(--line); font: var(--t-footnote); color: var(--text-dim); max-width: min(86%, 520px); }
.typing.enter { animation: reply-in 300ms var(--ease-out) both; }
.typing-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.typing .dots i { width: 5px; height: 5px; animation: calm 1.6s var(--ease) infinite; }
.typing .dots i:nth-child(2) { animation-delay: .2s; }
.typing .dots i:nth-child(3) { animation-delay: .4s; }
/* H2-35: above the oldest message: a quiet "Show earlier messages", a small loading row, then the start of the chat. */
.earlier { align-self: center; display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); margin: 4px 0 10px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-full); background: transparent; font: var(--t-footnote); color: var(--text-dim); }
button.earlier { cursor: pointer; transition: background var(--m-fast) var(--ease), color var(--m-fast) var(--ease); }
button.earlier:hover { background: var(--bg-card); color: var(--text); }
button.earlier:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.earlier.loading { background: var(--bg-card); }
.earlier .dots i { width: 5px; height: 5px; animation: calm 1.6s var(--ease) infinite; }
.earlier .dots i:nth-child(2) { animation-delay: .2s; }
.earlier .dots i:nth-child(3) { animation-delay: .4s; }
.earlier.start { border-color: transparent; color: var(--text-faint); }
@keyframes calm { 0%, 80%, 100% { transform: scale(.7); opacity: .35; } 40% { transform: scale(1); opacity: 1; } }

/* empty chat */
.empty-chat { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 16px; animation: reply-in 400ms var(--ease-out) both; }
.empty-chat h3 { font: var(--t-title); margin: 8px 0 0; }
.empty-chat p { font: var(--t-callout); max-width: 320px; }
.suggestions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; width: 100%; }
.pill { min-height: var(--tap); padding: 0 18px; border-radius: var(--r-full); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--bg-card)); color: var(--text); font: var(--t-callout); font-weight: 500; cursor: pointer; animation: reply-in 360ms var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 60ms); }

/* long-press tapbacks */
.tapback-layer { position: fixed; inset: 0; z-index: 75; background: rgba(var(--shadow-rgb), .55); animation: fade var(--m-base) var(--ease); }
.tapback-layer.closing, .tapback.closing, .tapback-menu.closing { opacity: 0; transition: opacity 160ms var(--ease); pointer-events: none; }
.tapback { position: fixed; z-index: 77; display: flex; gap: 2px; padding: 5px; border-radius: var(--r-full); background: var(--bg-raised); border: 1px solid var(--line); box-shadow: var(--shadow-2); animation: pop-in 280ms var(--ease-spring) both; transform-origin: 50% 100%; }
.tb { width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: transparent; font-size: 24px; line-height: 1; display: grid; place-items: center; cursor: pointer; animation: tb-in 360ms var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 28ms); }
.tb:hover { background: var(--bg-hover); }
.tb.mine { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.tb.more { color: var(--text-dim); background: var(--bg-card); }
.tb.more .i { width: 20px; height: 20px; }
@keyframes tb-in { from { opacity: 0; transform: translate3d(0, 8px, 0) scale(.5); } }
.tapback-menu { position: fixed; z-index: 77; min-width: 220px; animation: pop-in 240ms var(--ease-out) both; transform-origin: 50% 0; }
.tapback-menu .menu-item { min-height: var(--tap); justify-content: flex-start; }
.msg.lifted { position: relative; z-index: 76; }
.msg.lifted .bubble { box-shadow: var(--shadow-1); }
.msg.pressing .bubble { transform: scale(.97); transition: transform 460ms var(--ease); }
.msg .bubble { transition: transform var(--m-slow) var(--ease-spring); }
.msg { -webkit-touch-callout: none; }
.msg .bubble { -webkit-user-select: text; user-select: text; }
@media (hover: none) { .msg .bubble { -webkit-user-select: none; user-select: none; } }

/* reactions */
.reaction { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 9px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--bg-card); font-size: 13px; }
.reaction .n { font: var(--t-caption); color: var(--text-dim); }
.reaction.mine { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 16%, var(--bg-card)); }
.reaction.mine .n { color: var(--accent-text); }
.reaction.pop { animation: pop 420ms var(--ease-spring); }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
.react-picks .reaction.big { animation: tb-in 360ms var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 24ms); }

/* approvals */
.card.approval.pending { padding: 14px 16px; gap: 8px; border-radius: var(--r-md); animation: reply-in 300ms var(--ease-out) both; }
.expiry { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--r-full); background: color-mix(in srgb, var(--tint) 6%, transparent); font: var(--t-caption); color: var(--text-dim); }
.expiry .i { width: 13px; height: 13px; color: var(--text-faint) !important; }
.approval-acts { gap: 8px; margin-top: 4px; }
.approval-acts .btn { flex: 1; min-height: var(--tap); }
.card.approval.resolved { flex-direction: row !important; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-full); background: transparent; font: var(--t-footnote); }
.res-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.res-ico .i { width: 13px; height: 13px; }
.res-ico.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.res-ico.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.res-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-dim); }
.res-state { font: var(--t-caption); }
.res-state.ok { color: var(--ok); } .res-state.bad { color: var(--bad); }

/* composer */
.composer { padding: 8px 10px calc(8px + var(--safe-bottom)); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); position: relative; }
.composer textarea { min-height: 44px; height: 44px; padding: 11px 16px; border-radius: 22px; font: var(--t-body); line-height: 20px; transition: border-color var(--m-base) var(--ease), box-shadow var(--m-base) var(--ease); }
.composer-row { position: relative; align-items: flex-end; }
.composer-row > .icon-btn, .composer-row > .attach { width: var(--tap); height: var(--tap); }
.composer .send { animation: pop-in 220ms var(--ease-spring); }
.composer .send.sent { animation: send-pulse 360ms var(--ease-spring); }
@keyframes send-pulse { 40% { transform: scale(.82) translate3d(0, -2px, 0); } }
.mention-picker { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); max-width: 360px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; box-shadow: var(--shadow-2); display: flex; flex-direction: column; animation: pop-in 200ms var(--ease-out); transform-origin: 0 100%; z-index: 8; }
.mention-opt { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 10px; border: 0; background: none; border-radius: var(--r-sm); text-align: left; cursor: pointer; color: var(--text); }
.mention-opt:hover { background: var(--bg-hover); }

/* hold to talk: the button swells, two rings breathe with your voice, a strip with the level meter slides over the composer */
.composer .mic-btn { position: relative; overflow: visible; isolation: isolate; transition: transform 380ms var(--ease-spring), background-color var(--m-base) var(--ease), color var(--m-base) var(--ease); }
.mic-btn .i { position: relative; z-index: 2; }
.mic-btn .ring { position: absolute; inset: 0; border-radius: 50%; background: var(--bad); opacity: 0; transform: scale(1); z-index: 0; pointer-events: none; transition: transform 90ms linear, opacity var(--m-base) var(--ease); }
.mic-btn.rec { background: var(--bad); color: var(--on-bad); border-color: transparent; transform: scale(1.5); z-index: 9; }
.mic-btn.rec .ring.r1 { opacity: .28; animation: ring 1.6s var(--ease) infinite; }
.mic-btn.rec .ring.r2 { opacity: .14; animation: ring 1.6s var(--ease) .4s infinite; }
@keyframes ring { 50% { opacity: .08; } }
.composer.cancelling .mic-btn.rec { background: var(--text-faint); }
.composer.cancelling .mic-btn .ring { opacity: 0 !important; }
.mic-btn.shake { animation: shake 400ms var(--ease); }
@keyframes shake { 20%, 60% { transform: translate3d(-4px, 0, 0); } 40%, 80% { transform: translate3d(4px, 0, 0); } }
.rec-strip { position: absolute; left: 0; right: 56px; top: 0; bottom: 0; z-index: 7; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 22px; background: var(--bg-raised); border: 1px solid var(--line); animation: strip-in 260ms var(--ease-out) both; transform: translate3d(var(--slide, 0px), 0, 0); }
.rec-strip.out { opacity: 0; transform: translate3d(calc(var(--slide, 0px) - 12px), 0, 0); transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
.rec-strip.cancelled { opacity: 0; transform: translate3d(-40%, 0, 0); transition: opacity 220ms var(--ease), transform 220ms var(--ease); }
@keyframes strip-in { from { opacity: 0; transform: translate3d(24px, 0, 0); } }
.rec-live { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); flex: none; animation: rec-blink 1.2s var(--ease) infinite; }
.rec-time { font: 600 15px/1 var(--font-mono); font-variant-numeric: tabular-nums; min-width: 38px; }
.level { flex: 1; display: flex; align-items: center; gap: 2px; height: 26px; min-width: 0; overflow: hidden; }
.level i { flex: 1; max-width: 3px; min-width: 2px; height: 100%; border-radius: 2px; background: var(--accent); transform: scaleY(.12); transform-origin: 50% 50%; transition: transform 90ms linear; }
.slide-hint { display: inline-flex; align-items: center; gap: 2px; font: var(--t-footnote); color: var(--text-faint); white-space: nowrap; animation: hint 1.8s var(--ease) infinite; }
.slide-hint .i { width: 14px; height: 14px; }
@keyframes hint { 50% { transform: translate3d(-4px, 0, 0); opacity: .7; } }
.composer.cancelling .slide-hint { color: var(--bad); }
@media (max-width: 360px) { .slide-hint { display: none; } }

/* ---------------------------------------------------------------- empty states (live screen, devices, errors) */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px; margin: auto 0; animation: reply-in 360ms var(--ease-out) both; }
.empty-state.small { padding: 20px 16px; }
.empty-state h3 { font: var(--t-title); margin: 8px 0 0; }
.empty-state p { font: var(--t-callout); max-width: 340px; }
.empty-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text); }
.empty-ico .i { width: 28px; height: 28px; }
.live-pane .frame-wrap:has(.live-empty:not([hidden])) { padding: 0; }
.live-pane form { gap: 8px; }

/* ---------------------------------------------------------------- Assistant home + pages, Projects */
.assist-home .group:first-of-type .section-label { padding-top: 8px; }
.assist .assist-body { padding-bottom: 24px; }
.assist-body > .group:first-child .section-label { padding-top: 12px; }
.group-intro { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px 12px; }
.group-intro p { flex: 1; margin: 0; font: var(--t-footnote); }
.project-row { display: flex; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); cursor: pointer; }
.project-row:last-child { border-bottom: 0; }
.project-row .sub { margin-top: 2px; }
details.advanced { margin-top: 8px; }
details.advanced > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; min-height: var(--tap); }
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary::after { content: '›'; font-size: 16px; transition: transform var(--m-base) var(--ease); }
details.advanced[open] > summary::after { transform: rotate(90deg); }
details.advanced > .card { margin: 0 16px; display: flex; flex-direction: column; gap: 10px; animation: reply-in 240ms var(--ease-out); }
.page > .group, .page > section { flex: none; }
.page { padding-bottom: 24px; }

/* 44-point tap targets on touch */
@media (pointer: coarse) {
  .btn.small { min-height: var(--tap); }
  .icon-btn.tiny { width: 36px; height: 36px; }
  .seg button { min-height: 36px; }
}

/* ---------------------------------------------------------------- polish v3: onboarding, composer "+", chat list, rich replies */
.welcome-preview { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 320px; margin: 4px auto 18px; }
.wp-bubble { max-width: 82%; padding: 9px 13px; border-radius: 18px; font: var(--t-callout); text-align: left; animation: reply-in 520ms var(--ease-out) both; }
.wp-bubble.me { align-self: flex-end; background: var(--bubble-me); color: var(--on-bubble-me); border-bottom-right-radius: 6px; animation-delay: 200ms; }
.wp-bubble.bot { align-self: flex-start; background: var(--bg-card); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 6px; animation-delay: 700ms; }
.big-code { transition: opacity var(--m-base) var(--ease); }
.big-code.waiting { animation: code-wait 1.4s ease-in-out infinite; color: var(--text-faint); }
@keyframes code-wait { 50% { opacity: .45; } }
.code-life { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; margin: 0 auto 12px; max-width: 220px; }
.code-life i { display: block; height: 100%; background: var(--accent); transform-origin: left center; transition: transform 1s linear; }
.copy-code { display: flex; margin: 0 auto 8px; gap: 6px; animation: pop-in 220ms var(--ease-spring); }
.copy-code[hidden] { display: none; }
.done-orb { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 14px; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); animation: orb-pop 520ms var(--ease-spring) both; }
.done-orb .i { width: 34px; height: 34px; }
@keyframes orb-pop { from { opacity: 0; transform: scale(.5); } }
.safety-line { display: flex; align-items: center; justify-content: center; gap: 8px; font: var(--t-footnote); color: var(--text-faint); margin: 10px 0; flex-wrap: wrap; }
.safety-line .i { width: 14px; height: 14px; }
.safety-line strong { font-family: var(--font-mono); color: var(--text-dim); letter-spacing: .04em; }
.choice:hover { border-color: var(--line); }
@media (hover: hover) { .choice:hover { border-color: var(--accent-text); } }

/* composer "+": one quiet button, labelled choices above the box */
.plus-btn { color: var(--text-dim); border-radius: 50%; }
.plus-btn .i { transition: transform 260ms var(--ease-spring); }
.plus-btn.open { color: var(--accent-text); }
.plus-btn.open .i { transform: rotate(45deg); }
.plus-tray { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; padding: 6px; border-radius: var(--r-md); background: var(--bg-card); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(var(--shadow-rgb), .35); transform-origin: left bottom; animation: tray-in 240ms var(--ease-spring); }
.plus-tray[hidden] { display: none; }
@keyframes tray-in { from { opacity: 0; transform: translate3d(0, 8px, 0) scale(.96); } }
.plus-tray .tray-item { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; height: auto; min-height: var(--tap); padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font: var(--t-callout); text-align: left; cursor: pointer; }
.plus-tray .tray-item:active { background: var(--bg-hover); }
.plus-tray .tray-item > .i, .plus-tray .tray-item svg { width: 20px; height: 20px; color: var(--accent-text); flex: none; }
.plus-tray .tray-item.rec-btn::before { content: none; }

/* chat list: large title, switcher as a pill under it, search */
.home-bar { display: flex; align-items: flex-end; gap: 8px; }
.home-title { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.home-title .switcher { font: 500 13px/1 var(--font); padding: 6px 10px; margin-left: -2px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-full); color: var(--text-dim); max-width: 100%; }
.home-title .switcher .i { width: 13px; height: 13px; }
.new-chat { width: var(--tap); height: var(--tap); border-radius: 50%; background: var(--bg-card); color: var(--accent-text); flex: none; margin-bottom: 2px; }
.search { position: relative; margin: 4px 12px 6px; }
.search > .i { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--text-faint); pointer-events: none; }
.search-input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--bg-card); color: var(--text); font: var(--t-callout); -webkit-appearance: none; appearance: none; }
.search-input:focus { border-color: var(--accent-text); outline: none; }
.thread-row[hidden] { display: none; }

/* replies: quotes, asides and collapsed tool output */
.bubble p.bq { margin: 4px 0; padding: 2px 0 2px 10px; border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); color: var(--text-dim); }
.bubble p.aside { color: var(--text-faint); font: var(--t-footnote); }
.bubble details.activity { margin: 6px 0; border-radius: var(--r-sm); background: color-mix(in srgb, var(--tint) 3%, transparent); border: 1px solid var(--line); }
.bubble details.activity summary { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font: var(--t-caption); color: var(--text-faint); cursor: pointer; list-style: none; }
.bubble details.activity summary::-webkit-details-marker { display: none; }
.bubble details.activity summary .i { width: 14px; height: 14px; transition: transform var(--m-base) var(--ease); }
.bubble details.activity[open] summary .i { transform: rotate(90deg); }
.bubble .activity-raw { display: block; padding: 0 10px 8px; font: 12px/1.45 var(--font-mono); color: var(--text-dim); white-space: pre-wrap; word-break: break-word; }

/* assistant empty pages and spending presets */
.empty-state .example { font: var(--t-footnote); font-style: italic; }
.stack-setting { flex-direction: column; align-items: stretch; gap: 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { min-height: 36px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--line); background: transparent; color: var(--text); font: 600 14px/1 var(--font); cursor: pointer; transition: background-color var(--m-base) var(--ease), border-color var(--m-base) var(--ease), transform var(--m-fast) var(--ease); }
.preset:active { transform: scale(.95); }
.preset.on { background: var(--accent); border-color: var(--accent-text); color: var(--accent-ink); }
.custom-cap { align-items: center; gap: 8px; }
.custom-cap input { max-width: 110px; }

/* demo: a small pill, not a banner */
.demo-ribbon { background: transparent; color: var(--accent-text); font: var(--t-caption); padding: calc(6px + var(--safe-top)) 8px 2px; display: flex; justify-content: center; }
.demo-ribbon span { padding: 4px 10px; border-radius: var(--r-full); background: color-mix(in srgb, var(--accent) 14%, transparent); }
/* the splash sits on the same background as the welcome screen, so the hand-off doesn't flash */
.splash { background: var(--bg); }

/* keyboard open on a phone: the tab bar steps aside so the composer stays right above the keys */
body.kb-open .tabbar { display: none !important; }

/* landscape phones: a narrower reading column and a slimmer header */
@media (orientation: landscape) and (max-height: 500px) {
  .bar.root { padding-top: calc(6px + var(--safe-top)); }
  .large-title { font: var(--t-title); }
  .welcome-preview { display: none; }
  .msgs, .composer { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
}

/* ---------------------------------------------------------------- reduced motion: no movement, quick fades only */
/* Where will Cravio run? (web/src/connect.ts): own-server steps and "Get a Cravio server" */
.connect .gate-card.step-fwd { animation: step-fwd 360ms var(--ease-out) both; }
.connect .gate-card.step-back { animation: step-back 360ms var(--ease-out) both; }
@keyframes step-fwd { from { opacity: 0; transform: translateX(28px); } }
@keyframes step-back { from { opacity: 0; transform: translateX(-28px); } }
.connect .choice .dim { font: var(--t-footnote); margin-top: 2px; }
.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.steps li { flex: 1; display: flex; align-items: center; gap: 6px; font: var(--t-footnote); color: var(--text-faint); padding-top: 8px; border-top: 2px solid var(--line); transition: border-color var(--m-base) var(--ease), color var(--m-base) var(--ease); }
.steps li i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font: 600 11px/1 var(--font-display); font-style: normal; background: var(--bg-raised); color: var(--text-faint); flex: none; }
.steps li i .i { width: 11px; height: 11px; }
.steps li.on { color: var(--text); border-color: var(--accent); }
.steps li.on i { background: var(--accent); color: var(--accent-ink); }
.steps li.done { color: var(--text-dim); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.steps li.done i { background: var(--accent-soft); color: var(--accent-text); }
.os-notes { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius); background: var(--bg-raised); font: var(--t-footnote); color: var(--text-dim); }
.os-notes li { display: flex; gap: 8px; align-items: flex-start; }
.os-notes .i { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--text-faint); }
.field-label { display: flex; flex-direction: column; gap: 6px; font: var(--t-footnote); color: var(--text-dim); }
.step-say { margin: 4px 0 -6px; font-weight: 500; color: var(--text); }
.cmd { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--bg-raised); border: 1px solid var(--line); }
.cmd code { flex: 1; min-width: 0; font: 500 14px/1.45 var(--font-mono); color: var(--text); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.cmd-copy { flex: none; color: var(--accent-text); }
.stack.tight { gap: 10px; }
.trouble { border-radius: var(--radius); border: 1px solid var(--line); padding: 0 14px; font: var(--t-footnote); color: var(--text-dim); }
.trouble summary { display: flex; align-items: center; gap: 8px; min-height: var(--tap); cursor: pointer; color: var(--text); font-weight: 500; list-style: none; }
.trouble summary::-webkit-details-marker { display: none; }
.trouble summary .i { width: 15px; height: 15px; color: var(--accent-text); }
.trouble ul { margin: 0 0 12px; padding-left: 18px; }
.trouble li { margin: 6px 0; }
.managed-mark, .prov-orb { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--accent); }
.managed-mark .i, .prov-orb .i { width: 26px; height: 26px; }
.prov-orb { animation: prov-breathe 2.4s ease-in-out infinite; }
@keyframes prov-breathe { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 10%, transparent); } }
.included { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.included li { display: flex; gap: 12px; align-items: flex-start; animation: reply-in 420ms var(--ease-out) both; }
.included li:nth-child(2) { animation-delay: 60ms; }
.included li:nth-child(3) { animation-delay: 120ms; }
.included li:nth-child(4) { animation-delay: 180ms; }
.included strong { display: block; color: var(--text); }
.included .dim { font: var(--t-footnote); margin-top: 2px; }
.prov { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.prov li { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text-faint); transition: color var(--m-base) var(--ease); }
.prov li[data-state='on'] { color: var(--text); font-weight: 500; }
.prov li[data-state='done'] { color: var(--text-dim); }
.prov-dot { position: relative; width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); }
.prov li[data-state='on'] .prov-dot { border-color: color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); animation: spin 900ms linear infinite; }
.prov li[data-state='done'] .prov-dot { border-color: var(--ok); background: var(--ok); }
.prov li[data-state='done'] .prov-dot::after { content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.prov li.prov-done .prov-dot { animation: orb-pop 420ms var(--ease-spring) both; }
.notice.test-mode { padding: 10px 12px; border-radius: 12px; background: var(--bg-raised); }

/* ---- beginner design (docs/usability-beginner.md): step cards, reveals, pictures, help, waits ---- */
.step-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: none; }
.step-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--line); animation: reply-in 420ms var(--ease-out) both; }
.step-card:nth-child(2) { animation-delay: 70ms; }
.step-card:nth-child(3) { animation-delay: 140ms; }
.sc-num { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font: 600 14px/1 var(--font-display); }
.sc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-body > strong { font: var(--t-headline); color: var(--text); padding-top: 3px; }
.sc-sub { font: var(--t-footnote); color: var(--text-dim); margin-top: -4px; }
.cmd-copy { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font: 600 13px/1 var(--font); cursor: pointer; }
.cmd-copy .i { width: 16px; height: 16px; }
.cmd.site code { font-size: 17px; }
.send-self { gap: 8px; }
.whats { font: var(--t-footnote); color: var(--text-dim); }
.whats summary { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); cursor: pointer; color: var(--accent-text); font-weight: 500; list-style: none; }
.whats summary::-webkit-details-marker { display: none; }
.whats summary .i { width: 15px; height: 15px; }
.whats[open] summary { color: var(--text); }
.whats > p, .reveal-body { margin: 0 0 8px; animation: reply-in 300ms var(--ease-out) both; }
.reveal-body { display: flex; flex-direction: column; gap: 10px; }
.reveal-body p { margin: 0; }
.whats-row { display: flex; flex-wrap: wrap; gap: 0 16px; }
.whats-in-list { padding: 0 16px; border-bottom: 1px solid var(--line); }
.whats-in-list:last-child { border-bottom: 0; }
.setting .whats { margin-top: 2px; }
.tips { margin: 0 0 10px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.gate-card.center .whats { align-self: center; }
.choice.on { border-color: var(--accent); }
.choice.compact { padding: 12px 14px; min-height: 56px; }
.os-pick .choice strong { display: flex; align-items: center; gap: 6px; }

/* the pictures: drawn with CSS, sample data only */
.ill { margin: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); overflow: hidden; font: var(--t-footnote); }
.ill .hl { position: relative; }
.ill-email .ie-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ill-email .ie-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.ill-email .ie-ico .i { width: 15px; height: 15px; }
.ill-email .ie-head b { display: block; color: var(--text); font-weight: 600; }
.ill-email .ie-head span { color: var(--text-faint); font-size: 12px; }
.ill-email .ie-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; color: var(--text-dim); }
.ill-email .ie-row code { font: 500 13px/1.3 var(--font-mono); color: var(--text); }
.ill-email .ie-row.hl { background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.ill-term .it-bar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: var(--bg-raised); color: var(--text-faint); font-size: 11.5px; }
.ill-term .it-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.ill-term .it-bar span { margin-left: 4px; }
.ill-term .it-body { padding: 10px 12px; font: 500 12.5px/1.6 var(--font-mono); color: var(--text-dim); }
.ill-term .prompt { color: var(--accent-text); }
.ill-term .prompt::after { content: ''; display: inline-block; width: 7px; height: 13px; margin-left: 2px; vertical-align: -2px; background: var(--accent-text); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ill-app .ia-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--bg-raised); }
.ill-app .ia-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.ill-app .ia-name { margin-left: 10px; padding: 3px 8px; border-radius: 8px; color: var(--text); font-weight: 600; }
.ill-app .ia-menu { margin: 6px 10px 10px 26px; width: 74%; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-card); padding: 4px; color: var(--text-dim); }
.ill-app .ia-menu div { padding: 6px 8px; border-radius: 7px; }
.ill-app .hl { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); outline: 2px solid var(--accent); outline-offset: -2px; animation: hl-pulse 1.8s ease-in-out infinite; }
@keyframes hl-pulse { 50% { outline-color: color-mix(in srgb, var(--accent) 35%, transparent); } }

/* "What does your screen say?" over the step */
.help-layer { position: fixed; inset: 0; z-index: 40; max-width: none; padding: calc(20px + var(--safe-top)) max(20px, calc(50% - 210px)) calc(24px + var(--safe-bottom)); overflow-y: auto; background: var(--bg); }
.help-layer textarea { width: 100%; min-height: 84px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-card); color: var(--text); font: 500 14px/1.4 var(--font-mono); resize: vertical; }
.trouble-result { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--accent); }
.trouble-result.bad { border-color: color-mix(in srgb, var(--bad) 60%, var(--line)); }
.trouble-result p { margin: 0; color: var(--text-dim); font: var(--t-callout); }
.tr-what { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
.tr-what .i { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--accent-text); }
.trouble-result.bad .tr-what .i { color: var(--bad); }

/* waits: a spinner and one line; when it fails, the line says why and the button says what to do */
.wait-line { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font: var(--t-footnote); color: var(--text-dim); text-align: center; }
.wait-line .spin { width: 14px; height: 14px; color: var(--accent-text); flex: none; }
.wait-line.bad { color: var(--bad); }
.wait-line .i { width: 16px; height: 16px; flex: none; }
.big-code.dead { color: var(--text-dim); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--bad); }
.big-code.small-code { padding: 0; font-size: 0; height: 0; overflow: hidden; }
.prov li[data-state='failed'] { color: var(--bad); }
.prov li[data-state='failed'] .prov-dot { border-color: var(--bad); }

/* the demo strip: what it is, and the way out */
.demo-ribbon { align-items: center; gap: 8px; }
.demo-exit { min-height: 44px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: transparent; color: var(--accent-text); font: 600 12px/1 var(--font); cursor: pointer; position: relative; }

/* the computer is off: say it in the chat, with how to bring it back */
.peer-off { display: flex; flex-direction: column; gap: 2px; margin: 8px 12px 0; padding: 10px 14px 0; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--line); font: var(--t-footnote); }
.peer-off .po-head { display: flex; align-items: center; gap: 8px; color: var(--text); }
.peer-off .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }

/* toasts never cover a sheet's buttons */
body:has(.backdrop) #toast { top: calc(16px + var(--safe-top)); bottom: auto; }

/* 44 px tap targets for small controls */
.home-title .switcher { min-height: 44px; }
.search-input { height: 44px; }
.seg button { min-height: 44px; padding: 0 12px; }
.preset { min-height: 44px; }
.setting > button.grow.plain { min-height: 44px; }
.pill { min-height: 46px; }
.custom-cap input, .setting input[type=number] { min-height: 44px; }
[data-testid="open-transcript"] { min-height: 44px; display: inline-flex; align-items: center; }

/* Phone tab bar: four equal tabs that shrink and wrap, so all four stay reachable at 200% zoom or with large text. */
@media (max-width: 899px) {
  .tabbar .tab { flex: 1 1 0; min-width: 0; padding: 4px 2px; text-align: center; }
  .tabbar .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .skel::after, .slide-hint, .caret, .typing .dots i, .earlier .dots i, .mic-btn .ring, .rec-live { animation: none !important; }
  .mic-btn.rec { transform: none; }
}

/* What your bots can do (docs/rbac.md) */
.perm .section-label { display: flex; align-items: center; gap: 6px; }
.perm .section-label .i { width: 16px; height: 16px; }
.perm-free .section-label { color: var(--ok); }
.perm-approve .section-label { color: var(--warn); }
.perm-user .section-label { color: var(--accent-text); }
.perm-lead { margin: 0; padding: 0 20px 10px; font: var(--t-footnote); }
.perm-item .title { font-weight: 500; }

/* Teammates: org chart and orders across computers (src/ui/team-view.ts) */
.org-chart { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 8px 0 20px; }
.org-top { display: flex; justify-content: center; position: relative; padding-bottom: 18px; }
.org-top::after { content: ''; position: absolute; left: 50%; bottom: 0; height: 18px; border-left: 2px solid var(--line); }
.org-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; width: 100%; padding-top: 18px; border-top: 2px solid var(--line); }
.org-computer { flex: 1 1 220px; max-width: 320px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--bg-card); display: flex; flex-direction: column; gap: 8px; }
.org-computer.here { border-color: var(--accent); }
.org-computer.off { opacity: .6; }
.org-computer-name { font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.org-tag { font-size: 11px; font-weight: 500; color: var(--text-faint); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.org-node { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.org-node.you { border-color: var(--accent); background: var(--accent-soft); padding: 10px 16px; }
.org-node.lead { border-width: 2px; }
.org-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.org-node.indep .org-av { background: var(--warn-soft); color: var(--warn); }
.org-txt { min-width: 0; flex: 1; }
.org-name { font-weight: 600; font-size: 14px; }
.org-sub { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; }
.org-under { margin-left: 16px; padding-left: 12px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.org-direct { margin-top: 4px; padding: 8px; border: 1px dashed var(--warn); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; }
.org-direct-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); }
.org-move { flex-basis: 100%; margin-left: 40px; font-size: 11px; text-align: left; justify-content: flex-start; padding-left: 0; }
.org-node .org-txt { min-width: 120px; }
.org-order { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.org-order:last-child { border-bottom: 0; }
.org-order-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.org-route { font-weight: 600; flex: 1; min-width: 0; }
.org-dir { width: 20px; text-align: center; color: var(--text-faint); }
.org-state { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.org-state.ok { background: var(--ok-soft); color: var(--ok); }
.org-state.busy { background: var(--accent-soft); color: var(--accent-text); }
.org-state.bad { background: var(--bad-soft); color: var(--bad); }
.org-state.dim { background: color-mix(in srgb, var(--tint) 6%, transparent); color: var(--text-faint); }
.org-task { font-size: 13px; }
.org-outcome, .org-when { font-size: 12px; }

/* Goal mode: the live goal card (src/ui/goal-card.ts) */
.goal-card { display: flex; flex-direction: column; gap: 10px; }
.goal-head { display: flex; align-items: center; gap: 8px; }
.goal-title { font-weight: 600; flex: 1; min-width: 0; }
.goal-state { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.goal-state.ok { background: var(--ok-soft); color: var(--ok); }
.goal-state.busy { background: var(--accent-soft); color: var(--accent-text); }
.goal-state.bad { background: var(--bad-soft); color: var(--bad); }
.goal-state.dim { background: color-mix(in srgb, var(--tint) 6%, transparent); color: var(--text-faint); }
.goal-progress { font-size: 12px; }
.goal-parts { display: flex; flex-direction: column; gap: 6px; }
.goal-part { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.goal-part .box { width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 5px; display: grid; place-items: center; font-size: 11px; flex: none; }
.goal-part.done .box { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.goal-part.running .box { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.goal-part.failed .box { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.goal-part.redirected { color: var(--text-faint); }
.goal-part.redirected .goal-part-title { text-decoration: line-through; }
.goal-part-title { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.goal-part-sub { font-size: 12px; color: var(--text-faint); }
.goal-events { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.goal-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
.goal-bar { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--tint) 8%, transparent); overflow: hidden; margin-bottom: 4px; }
.goal-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.goal-actions { display: flex; gap: 8px; }
.job-step { display: flex; gap: 4px; }
.job-step.bad { color: var(--bad); }
.job-n { font-variant-numeric: tabular-nums; min-width: 28px; }
.job-file { display: flex; align-items: baseline; gap: 2px; min-width: 0; }
.job-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-hash { font-size: 11px; color: var(--text-faint); background: color-mix(in srgb, var(--tint) 6%, transparent); border-radius: 4px; padding: 0 4px; }

/* D-A09: company-video stage progress (src/ui/pipeline-stage-card.ts) */
.pipeline-stage-card { display: flex; flex-direction: column; gap: 10px; }
.pipeline-stages { display: flex; flex-direction: column; gap: 6px; }
.pipeline-stage .pipeline-stage-label { font-weight: 500; }
.pipeline-stage.running .pipeline-stage-label { font-weight: 600; }
.pipeline-stage-error, .pipeline-error { color: var(--bad); font-size: 12px; }
.pipeline-error { border-top: 1px solid var(--line); padding-top: 8px; }


/* The job sandbox: the hardware card (src/ui/hardware-card.ts) and the job card's Sandbox section */
.hardware-card { display: flex; flex-direction: column; gap: 10px; }
.hw-needs { display: flex; flex-direction: column; gap: 4px; }
.hw-need { display: flex; align-items: baseline; gap: 8px; font-size: var(--t-footnote, 13px); }
.hw-need .hw-mark { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; flex: none; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.hw-need.hw-short .hw-mark { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.hw-what { min-width: 84px; color: var(--text-dim); }
.hw-server { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 12px; padding: 10px 12px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.hw-server p { margin: 4px 0 0; }
.hw-server-title { color: var(--accent-text); font-weight: 600; }
.job-cmd { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-top: 1px solid var(--line); }
.job-cmd:first-of-type { border-top: 0; }
.job-cmd-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.job-cmd-line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.job-cmd-tail { margin: 2px 0 0; padding: 6px 8px; border-radius: 6px; font-size: 11px; line-height: 1.4; white-space: pre-wrap; color: var(--text-dim); background: color-mix(in srgb, var(--tint) 6%, transparent); max-height: 72px; overflow: hidden; }
.job-install { font-size: var(--t-footnote, 13px); }
.job-install-mgr { font-size: 11px; padding: 0 5px; border-radius: 4px; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* The quality layer: the Define-done card and the quality report (src/ui/quality-card.ts) */
.quality-card { display: flex; flex-direction: column; gap: 10px; }
.q-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.q-kicker { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }
.q-title { font-weight: 600; flex: 1; min-width: 0; }
.q-job { font: var(--t-headline, 600 16px/22px inherit); }
.q-sub { font-size: 13px; color: var(--text-dim, inherit); display: flex; gap: 6px; flex-wrap: wrap; }
.q-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
.q-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.q-item { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; line-height: 1.35; }
.q-box { width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 5px; display: grid; place-items: center; font-size: 11px; flex: none; margin-top: 1px; }
.q-item.pass .q-box { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.q-item.fail .q-box { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.q-item.unchecked .q-box { color: var(--text-faint); }
.q-badge { font-size: 11px; border-radius: 999px; padding: 1px 8px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.q-evidence { font-size: 12px; color: var(--text-faint); margin-top: 2px; overflow-wrap: anywhere; }
.q-expert { border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.q-expert ul { margin: 4px 0 0; padding-left: 18px; }
.q-state { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; margin-left: auto; }
.q-state.ok { background: var(--ok-soft); color: var(--ok); }
.q-state.busy { background: var(--accent-soft); color: var(--accent-text); }
.q-state.bad { background: var(--bad-soft); color: var(--bad); }
.q-progress { font-size: 12px; }
.q-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.q-help { margin: 0; }
.q-edit-rows { display: flex; flex-direction: column; gap: 6px; }
.q-edit-row { display: flex; gap: 6px; align-items: center; }
.q-input { flex: 1; min-width: 0; width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; color: inherit; }

/* Hire a bot: the "New teammate" card (src/ui/hire-card.ts) and a routine's standing secret grants (src/ui/routine-secrets.ts) */
.hire-card { display: flex; flex-direction: column; gap: 10px; }
.hire-head { display: flex; align-items: center; gap: 12px; }
.hire-avatar { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; flex: none; font-weight: 650; letter-spacing: .02em; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 16%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); }
.hire-who { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.hire-name { font-weight: 650; font-size: 16px; }
.hire-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.hire-sec { display: flex; flex-direction: column; gap: 4px; }
.hire-sec ul, .hire-sec ol { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; }
.hire-sec p { margin: 0; }
.hire-instr li { margin: 2px 0; }
.hire-skill { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.hire-skill summary { cursor: pointer; }
.hire-skill-name { font-weight: 600; }
.hire-skill ol { margin-top: 6px; }
.hire-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.hire-signin { font-style: italic; }
.hire-notes { margin: 0; padding-left: 18px; color: var(--warn); }
.hire-check { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.hire-check.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.hire-score { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.hire-next { display: flex; flex-direction: column; gap: 6px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 12px; padding: 10px 12px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.hire-edit-block { display: flex; flex-direction: column; gap: 4px; }
.hire-scope { flex: 0 0 auto; width: auto; }
.routine-secrets { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.rs-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.rs-name { font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; }
.rs-history ul { margin: 4px 0 0; padding-left: 18px; }

/* Optional add-on card (src/ui/addon-card.ts): the Remotion licence words, a link, two taps */
.addon-card { display: flex; flex-direction: column; gap: 10px; }
.addon-card p { margin: 0; }
.addon-licence { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 12px; padding: 10px 12px; background: color-mix(in srgb, var(--accent) 6%, transparent); display: flex; flex-direction: column; gap: 6px; }
.addon-licence-text { color: var(--text); line-height: 1.45; }
.addon-link { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.addon-card .row-actions .btn { white-space: nowrap; }

/* voiceover card: the full track, then each line's takes (src/ui/voiceover-card.ts) */
.voiceover-card { display: flex; flex-direction: column; gap: 10px; }
.vo-track { display: flex; flex-direction: column; gap: 4px; }
.vo-status { margin: 0; }
.vo-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.vo-line { border-top: 1px solid var(--border, rgba(140, 143, 153, .25)); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.vo-line-head { display: flex; gap: 8px; align-items: baseline; }
.vo-text { flex: 1; min-width: 0; }
.vo-take { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 6px; border-radius: 8px; }
.vo-take.chosen { background: rgba(200, 169, 106, .10); }
.vo-take-name { font-size: 12px; color: var(--text-faint); min-width: 48px; }
.vo-take .voice-player { flex: 1; min-width: 180px; }
.vo-take audio { width: 100%; height: 32px; }
.vo-take .voice-player { display: flex; align-items: center; gap: 6px; }
.vo-take .voice-player > span { white-space: nowrap; }
.vo-in { color: var(--accent-text); }

/* Picture picker card for make_video (row 17) */
.vp-about { margin: 0; }
.vp-status { margin: 0; }
.vp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.vp-pic { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 10px; }
.vp-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--bg-raised); }
.vp-none { display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 12px; }
.vp-name { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.vp-role { font: inherit; font-size: 12px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: inherit; cursor: pointer; }
.vp-role:hover:not(:disabled) { background: var(--bg-hover); }
.vp-role.on, .vp-role.on:hover:not(:disabled) { border-color: var(--text); background: color-mix(in srgb, var(--tint) 12%, transparent); }
.vp-role:disabled { cursor: default; opacity: .7; }
.vp-role.on:disabled { opacity: 1; }

/* Row 7: connect-an-app card (src/ui/connect-app-card.ts) */
.ca-card .q-head { flex-wrap: wrap; }
.ca-badge { margin-left: auto; }
.ca-reason, .ca-detail, .ca-safety, .ca-done { margin: 0; }

/* Row 18: music picker card (src/ui/music-card.ts) */
.mu-about, .mu-status, .mu-licence { margin: 0; }
.mu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mu-track { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.mu-track:hover { background: var(--bg-hover); }
.mu-track[aria-disabled="true"] { cursor: default; }
.mu-track.on { border-color: var(--text); background: color-mix(in srgb, var(--tint) 12%, transparent); }
.mu-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.mu-track.on .mu-dot { border-color: var(--text); background: radial-gradient(circle, var(--text) 45%, transparent 50%); }
.mu-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mu-meta { font-size: 12px; color: var(--text-faint); }
.mu-play { flex: none; }


/* Row 27: social post draft card (src/ui/social-card.ts) */
.sp-status { margin: 0; }
.sp-status.sp-posted { color: var(--ok); }
.sp-status.sp-failed { color: var(--bad); }
.sp-warn { margin: 0; padding: 6px 8px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); }
.sp-media { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.sp-m img, .sp-none { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--bg-raised); border: 1px solid var(--line-strong); }
.sp-none { display: flex; align-items: center; justify-content: center; padding: 4px; font-size: 11px; color: var(--text-faint); text-align: center; overflow: hidden; word-break: break-all; }
.sp-title { margin: 0; font-weight: 600; }
.sp-caption { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-meta { margin: 0; }
.sp-over { color: var(--bad); font-weight: 600; }
.sp-edit { display: flex; flex-direction: column; gap: 6px; }
.sp-edit[hidden], .sp-view[hidden], .sp-meta[hidden], .q-actions[hidden] { display: none; }
.sp-in { font: inherit; width: 100%; box-sizing: border-box; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg-raised); color: inherit; }
.sp-card { display: flex; flex-direction: column; gap: 8px; }

/* Try again (regenerate) on the latest bot answer (src/ui/try-again.ts) */
.again-btn { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-dim); font: inherit; font-size: 12px; cursor: pointer; }
.again-btn .i, .again-btn svg { width: 13px; height: 13px; }
.again-btn:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.again-btn:disabled { cursor: default; opacity: .7; }
.msg.retried .bubble, .msg.retried .bub { opacity: .62; }

/* Row 19: inbox search, conversations and attachments */
.inbox-search-bar { gap: 8px; align-items: center; margin: 4px 2px 12px; }
.inbox-search-bar input[type="search"] { flex: 1; min-width: 0; width: auto; }
.inbox-search-bar .btn { flex-shrink: 0; }
.inbox-search-bar .check { flex-shrink: 0; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; color: var(--text-dim); }
.inbox-results .snippet { font-size: 13px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
.inbox-results .snippet mark, .thread-view mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.thread-row { width: 100%; text-align: left; }
.thread-view .thread-msg { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.att-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; cursor: pointer; max-width: 260px; text-align: left; }
.att-chip:hover:not(:disabled) { border-color: var(--accent); }
.att-chip .att-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.att-chip .att-meta { font-size: 11px; color: var(--text-faint); }
.att-chip.risky .att-meta { color: var(--warn); }
.att-chip.skipped { opacity: .6; cursor: default; }
.inbox-search-wrap { padding: 0 12px; }
.inbox-search-wrap > .inbox-results > .group, .inbox-search-wrap > .inbox-results > .empty { margin-left: -12px; margin-right: -12px; }
.inbox-results > .list { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.inbox-results .thread-row { display: block; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.inbox-results .thread-row:last-child { border-bottom: 0; }
.inbox-results .thread-row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.inbox-results .thread-row .title { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.inbox-results .thread-row .meta { font-size: 13px; color: var(--text-dim); }

/* ---- Sign-up v1 (web/src/signup.ts): one passwordless screen, legal line, separate marketing opt-in */
.gate.welcome { flex-wrap: wrap; align-content: flex-start; }
.legal-footer { flex-basis: 100%; text-align: center; margin: 18px 0 0; }
.legal-footer a, .legal-line a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 2px; }
.legal-line { font-size: 13px; line-height: 1.5; color: var(--text-faint); margin: 0; }
.signup .social-slot { min-height: 44px; display: flex; justify-content: center; }
.signup .gis-button { display: flex; justify-content: center; width: 100%; }
.btn.social { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.btn.social.apple { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
.btn.social.apple:hover { background: var(--strong-hover); }
.social-glyph { display: inline-flex; }
.or-rule { display: flex; align-items: center; gap: 12px; color: var(--text-faint); font-size: 13px; }
.or-rule::before, .or-rule::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.consent-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-dim); text-align: left; cursor: pointer; }
.consent-check input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.row.center { justify-content: center; }

/* ---- No-setup first run (web/src/first-run.ts) and Add credit (web/src/credit-sheet.ts): Obsidian & Champagne */
.starter-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 16px; background: var(--strong); color: var(--on-strong); border: 1px solid color-mix(in srgb, var(--champagne) 45%, transparent); }
.starter-card .dim { color: color-mix(in srgb, var(--on-strong) 78%, transparent); margin: 0; }
.starter-card .starter-title { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.starter-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--champagne) 18%, transparent); color: var(--champagne); }
.starter-card .btn.primary { background: var(--champagne); color: var(--obsidian); border-color: var(--champagne); }
.starter-card .btn.primary:hover { background: var(--accent-hover); }
.advanced { margin-top: 6px; }
.advanced > summary { cursor: pointer; color: var(--text-dim); font-weight: 600; padding: 8px 0; }
.advanced > .stack { margin-top: 8px; }
.credit-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--strong); color: var(--champagne); margin: 0 0 4px; }
.credit-packages .choice.on { border-color: var(--champagne); box-shadow: 0 0 0 1px var(--champagne) inset; }
.credit-packages .pkg-price { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Free daily chats (web/src/free-chats.ts): quiet, never a warning colour. */
.free-line { display: flex; align-items: center; gap: 6px; padding: 6px 16px; font-size: 13px; color: var(--text-faint); }
.free-line .icon { width: 14px; height: 14px; opacity: .8; }
.free-line .link-btn { margin-left: auto; }
.list-pane .free-line { padding: 4px 12px 8px; }

/* Companies (web/src/company.ts): one column, max 720 px, one primary action per screen. */
.co-page { min-height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.co-page > .bar { position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); }
.co-body { width: 100%; max-width: 720px; margin: 0 auto; padding: var(--s-4) var(--s-4) calc(var(--s-8) + var(--safe-bottom)); display: flex; flex-direction: column; gap: var(--s-3); }
.co-hero { padding: var(--s-2) 0 var(--s-1); }
.co-hero h1 { font: var(--t-large); margin: 2px 0; }
.co-h { font: var(--t-headline); margin: var(--s-4) 0 0; color: var(--text); }
.co-next { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--bg-card)), var(--bg-card)); }
.co-next strong { font: var(--t-title); }
.co-tiles { display: grid; grid-template-columns: 1fr; gap: var(--s-2); }
@media (min-width: 700px) { .co-tiles { grid-template-columns: 1fr 1fr; } }
.co-tile { display: flex; align-items: center; gap: var(--s-3); min-height: 64px; padding: var(--s-3) var(--s-4); background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); }
.co-tile:hover { background: var(--bg-hover); }
.co-tile > .i:first-child { width: 24px; height: 24px; color: var(--accent-text); }
.co-tile .grow { display: flex; flex-direction: column; }
.co-tile .i:last-child { color: var(--text-faint); width: 16px; height: 16px; }
.co-badge { font: var(--t-caption); padding: 3px 8px; border-radius: var(--r-full); background: color-mix(in srgb, var(--tint) 10%, transparent); color: var(--text-dim); white-space: nowrap; }
.co-badge.accent { background: var(--accent); color: var(--accent-ink); }
.co-badge.warn { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--text); }
.co-badge.bad { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--text); }
.co-privacy { margin-top: var(--s-2); }
.co-bar { height: 8px; border-radius: var(--r-full); background: color-mix(in srgb, var(--tint) 10%, transparent); overflow: hidden; margin-top: var(--s-2); }
.co-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.co-bar.warn i { background: var(--warn); }
.co-bar.full i { background: var(--bad); }
.co-row { display: flex; align-items: center; gap: var(--s-2); }
.co-row .grow { display: flex; flex-direction: column; }
.co-list { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.co-person { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 64px; padding: var(--s-3) var(--s-4); background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; color: var(--text); }
.co-person:last-child { border-bottom: 0; }
.co-person:hover { background: var(--bg-hover); }
.co-person .grow { display: flex; flex-direction: column; gap: 1px; }
.co-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 600 15px var(--font-display); background: color-mix(in srgb, var(--accent) 22%, var(--bg-card)); color: var(--accent-text); }
.co-seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.co-seatcount { display: flex; flex-direction: column; gap: 2px; }
.co-seatcount strong { font: var(--t-title); }
.co-seat { display: flex; gap: var(--s-3); align-items: center; }
.co-seat input { width: 84px; min-height: 44px; text-align: center; }
.co-seat .grow { display: flex; flex-direction: column; gap: 2px; }
.co-seat p { font-size: 13.5px; }
.co-price { color: var(--accent-text); font: var(--t-footnote); font-weight: 600; }
.co-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
@media (max-width: 480px) { .co-two { grid-template-columns: 1fr; } .co-seats { grid-template-columns: 1fr; } }
.co-select, .co-body input:not([type="checkbox"]), .co-body textarea, .co-wizard input:not([type="checkbox"]), .co-wizard textarea, .co-join input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-input, var(--bg-card)); color: var(--text); font: var(--t-body); }
.co-body textarea, .co-wizard textarea { resize: vertical; }
.co-check { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; min-height: 44px; }
.co-check input { width: 22px; height: 22px; accent-color: var(--accent); }
.co-check small { grid-column: 2; }
.co-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 var(--s-2); counter-reset: s; }
.co-steps li { flex: 1; font: var(--t-caption); color: var(--text-faint); padding-top: 8px; border-top: 3px solid color-mix(in srgb, var(--tint) 12%, transparent); }
.co-steps li.on { color: var(--accent-text); border-top-color: var(--accent); }
.co-steps li.done { color: var(--text-dim); border-top-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.co-seg { align-self: flex-start; }
.co-seg button { min-height: 40px; padding: 0 16px; font-size: 14px; }
.co-done { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); margin: var(--s-4) auto var(--s-2); }
.co-done .i { width: 36px; height: 36px; }
.co-ok, .co-warn { display: flex; gap: var(--s-2); align-items: flex-start; }
.co-ok .i { color: var(--ok); }
.co-warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); color: var(--text); }
.co-warn .i { color: var(--warn); }
.co-code { display: flex; flex-direction: column; gap: var(--s-2); align-items: flex-start; }
.co-code .big-code { font: 700 28px/1.2 var(--font-mono); letter-spacing: .06em; color: var(--accent-text); }
.co-mem { display: flex; flex-direction: column; gap: var(--s-2); }
.co-mem.pending { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.co-memtext { font: var(--t-body) !important; }
.co-old { color: var(--text-faint); font-size: 13px; }
.co-actions { justify-content: flex-end; flex-wrap: wrap; }
.co-task .row { justify-content: flex-end; margin-top: var(--s-2); }
.co-spendrow { display: flex; flex-direction: column; gap: 2px; }
.co-pool .stat { font-size: 34px; }
.co-summary { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.co-audit { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.co-audit li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.co-notices { padding-left: 18px; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.co-promise summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.co-promise ul { padding-left: 18px; margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-dim); }
.co-msgs { display: flex; flex-direction: column; gap: var(--s-2); min-height: 200px; }
.co-msg { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; }
.co-msg.bot { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.co-composer { display: flex; gap: var(--s-2); align-items: flex-end; position: sticky; bottom: 0; padding: var(--s-2) 0 calc(var(--s-2) + var(--safe-bottom)); background: var(--bg); }
.co-composer textarea { flex: 1; }
.co-wizard .gate-card, .co-join .gate-card { max-width: 480px; }
.co-wizard .choice, .co-body .choice { text-align: left; }
.co-body .choice { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-card); color: var(--text); cursor: pointer; }
.co-body .choice.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.pad0 { padding: var(--s-3) 0 0; }
/* The wizard's next step is always on screen, however long the step is. */
.co-wizard .gate-card > .btn.primary, .co-page .co-body > .btn.primary.sticky { position: sticky; bottom: calc(12px + var(--safe-bottom)); z-index: 3; box-shadow: 0 -12px 24px var(--bg), var(--shadow-1); }
.co-seat p { margin: 2px 0; }
@media (max-width: 480px) { .co-seat p { display: none; } }
.co-wizard .co-seat input, .co-body .co-seat input { width: 88px; flex: none; }
.co-wizard .co-seat input[type="number"], .co-body .co-seat input[type="number"] { width: 88px; min-width: 88px; max-width: 88px; flex: none; }
.co-body .choice { align-items: flex-start; }
/* Two-step sign-in setup: the QR SVG paints its own white quiet zone (src/ui/qr.ts), dark on white in both themes so every authenticator can read it. */
.qr-box { align-self: center; overflow: hidden; border-radius: var(--r-md); border: 1px solid var(--line); }
.qr { display: block; width: 184px; height: 184px; shape-rendering: crispEdges; }
.backup-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 0; padding: 12px 16px 12px 36px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.backup-list code { font: 500 15px/22px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); letter-spacing: .02em; }

/* L-57 server offer (src/ui/server-offer.ts): Obsidian & Champagne, Inter; champagne only as the edge and the button. */
.server-offer { display: flex; flex-direction: column; gap: 10px; cursor: default; font-family: var(--font); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg-card)); }
.server-offer-line { margin: 0; color: var(--text); font-size: 15px; line-height: 21px; }
.server-offer-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.server-offer-page { display: flex; flex-direction: column; gap: 12px; font-family: var(--font); color: var(--text); }
.server-offer-lead { margin: 0; color: var(--text-dim); }
.server-offer-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.server-offer-points li { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 2px solid var(--accent); }
.server-offer-points strong { font-weight: 600; }
.server-offer-points span { color: var(--text-dim); font-size: 14px; }
.server-offer-why { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.server-offer-why-title { font-weight: 600; margin-bottom: 4px; }
.server-offer-why ul { margin: 0; padding-left: 18px; color: var(--text-dim); }
.server-offer-note { margin: 0; text-align: center; color: var(--text-faint); font-size: 13px; }

/* #292 capacityCheck on plan/job cards (src/ui/capacity-check.ts): Obsidian & Champagne, Inter; calm heads-up, no alarms. */
.capacity-check { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; padding: 8px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg-card)); font-family: var(--font, Inter, system-ui, sans-serif); color: var(--text); }
.capacity-check-line { margin: 0; color: var(--text); font-size: 14px; line-height: 20px; }
.capacity-check-suggestions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.capacity-check-suggestions li { padding-left: 12px; border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); color: var(--text-dim); font-size: 13px; line-height: 18px; }


/* Chat Markdown (src/ui/markdown.ts): code blocks with Copy, tables, links. Colours from brand tokens only. */
.bubble a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.msg.user .bubble a { color: inherit; }
.bubble .link { text-decoration: underline dotted; }
.md-code { margin: 6px 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-raised); overflow: hidden; }
.md-code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line); font: var(--t-caption); color: var(--text-faint); }
.md-copy { background: none; border: 0; border-radius: var(--r-xs); padding: 4px 8px; color: var(--accent-text); font: var(--t-caption); cursor: pointer; }
.md-copy:hover { background: var(--bg-hover); }
.md-copy:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.md-code pre { margin: 0; padding: 10px 12px; overflow-x: auto; }
.md-code pre code { background: none; padding: 0; border-radius: 0; font-size: 13px; line-height: 1.5; white-space: pre; color: var(--text); }
.md-table { margin: 6px 0 8px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.md-table table { border-collapse: collapse; width: 100%; font: var(--t-footnote); }
.md-table th, .md-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md-table th { font-weight: 600; color: var(--text); background: var(--bg-raised); }
.md-table tr:last-child td { border-bottom: 0; }
.msg.user .md-code, .msg.user .md-table { border-color: color-mix(in srgb, var(--on-bubble-me) 20%, transparent); }

/* H2-02: the multi-field form card (src/ui/form-card.ts) */
.form-card .form-fields { display: grid; gap: 12px; margin-top: 8px; }
.form-card .form-field { display: grid; gap: 4px; }
.form-card .form-toggle { grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; }
.form-card .form-toggle .form-err { grid-column: 1 / -1; }
.form-card .form-label { font-size: var(--t-footnote); color: var(--text); font-weight: 500; }
.form-card input[type='text'], .form-card input[type='number'], .form-card input[type='date'], .form-card input[type='password'], .form-card textarea {
  width: 100%; box-sizing: border-box; background: var(--bg-raised); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; font: inherit;
}
.form-card input:focus-visible, .form-card textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.form-card .form-err:empty { display: none; }
.form-card .form-err { color: var(--accent-text); font-size: var(--t-caption); }
.form-card .form-outside { border-left: 2px solid var(--accent-text); padding-left: 8px; }
.form-card .form-readout { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; }
.form-card .form-readout dt { color: var(--text-faint); font-size: var(--t-footnote); }
.form-card .form-readout dd { margin: 0; color: var(--text); }

/* H2-06: sidebar sections, pinned and hidden chats (only with the agent's `sidebar` feature) */
.thread-item { position: relative; }
.thread-item .thread-row { padding-right: 44px; }
.thread-item .thread-menu { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); opacity: 0; color: var(--text-faint); }
.thread-item:hover .thread-menu, .thread-item .thread-menu:focus-visible, .thread-item:focus-within .thread-menu { opacity: 1; }
@media (hover: none) { .thread-item .thread-menu { opacity: 1; } }
.section-label .section-edit { width: 28px; height: 28px; color: var(--text-faint); }
.section-toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; }
.section-toggle:focus-visible, .thread-menu:focus-visible, .section-edit:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.new-section { margin: 8px 8px 0; color: var(--accent-text); }
/* H2-01 Pages: card, viewer, charts, Library (src/ui/pages.ts); brand tokens only */
.page-card .pg-card-title { font-weight: 600; color: var(--text); margin: 4px 0; }
.pg-pane, .pg-viewer, .pg-library { display: grid; gap: 12px; align-content: start; }
.pg-viewer, .pg-library { max-width: 860px; padding: 16px; }
.pg-title { margin: 0; color: var(--text); }
.pg-title:focus-visible, .pg-row:focus-visible, .pg-viewer button:focus-visible, .pg-viewer select:focus-visible, .pg-viewer textarea:focus-visible, .pg-viewer input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pg-banner, .pg-old { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent-text); border-radius: var(--r-sm); background: var(--bg-raised); }
.pg-banner[hidden] { display: none; }
.pg-body { color: var(--text); line-height: 1.55; }
.pg-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.pg-kpi { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--bg-raised); }
.pg-kpi-label { font-size: var(--t-caption); color: var(--text-faint); }
.pg-kpi-value { font-size: 1.4em; font-weight: 600; color: var(--text); }
.pg-kpi-delta { font-size: var(--t-caption); color: var(--text-faint); }
.pg-kpi-delta.good { color: var(--accent-text); }
.pg-kpi-delta.bad { color: var(--bad, var(--accent-text)); }
.pg-chart { margin: 8px 0; }
.pg-svg { width: 100%; height: auto; max-height: 320px; display: block; }
.pg-svg .pg-axis { stroke: var(--line); stroke-width: 1; }
.pg-svg .pg-tick { fill: var(--text-faint); font-size: 11px; font-family: inherit; }
.pg-svg .pg-line { fill: none; stroke-width: 2; }
.pg-c0 { fill: var(--accent-text); stroke: var(--accent-text); }
.pg-c1 { fill: var(--text); stroke: var(--text); }
.pg-c2 { fill: var(--text-faint); stroke: var(--text-faint); }
.pg-c3 { fill: var(--focus); stroke: var(--focus); }
.pg-c4 { fill: var(--line); stroke: var(--line); }
.pg-c5 { fill: var(--bg-hover); stroke: var(--bg-hover); }
.pg-c6 { fill: var(--on-bubble-me); stroke: var(--on-bubble-me); }
.pg-c7 { fill: var(--bg-raised); stroke: var(--text-faint); }
.pg-svg .pg-line.pg-c0, .pg-svg .pg-line.pg-c1, .pg-svg .pg-line.pg-c2, .pg-svg .pg-line.pg-c3, .pg-svg .pg-line.pg-c4, .pg-svg .pg-line.pg-c5, .pg-svg .pg-line.pg-c6, .pg-svg .pg-line.pg-c7 { fill: none; }
.pg-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; padding: 0; margin: 6px 0; font-size: var(--t-caption); color: var(--text-faint); }
.pg-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.pg-numbers summary, .pg-history summary { cursor: pointer; color: var(--accent-text); font-size: var(--t-footnote); }
.pg-ask, .pg-share { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; background: var(--bg-raised); }
.pg-ask textarea, .pg-share select, .pg-url { width: 100%; box-sizing: border-box; background: var(--bg-raised); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 8px; font: inherit; }
.pg-h3 { margin: 0; font-size: var(--t-footnote); color: var(--text); }
.pg-radio { display: flex; gap: 8px; align-items: flex-start; }
.pg-versions { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 2px; }
.pg-versions .on { color: var(--accent-text); }
.pg-search { width: 100%; }
.pg-list { display: grid; gap: 4px; }
.pg-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-raised); color: var(--text); cursor: pointer; font: inherit; }
.pg-row:hover { background: var(--bg-hover); }
.pg-row-main { display: grid; min-width: 0; }
.pg-row-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-empty { padding: 24px 8px; text-align: center; }
.pg-error { color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Settings › Your computer (web/src/computer-recovery.ts, #293): Obsidian & Champagne; danger Reset confirm. */
.cr-intro { margin: 0; padding: 12px 14px 4px; font-size: 13.5px; }
.cr-nudge .meta { color: var(--text-dim); }
.cr-done .title { font-weight: 500; }
.cr-dialog p { margin: 0 0 4px; line-height: 1.5; }

/* Settings › Backups (web/src/backups.ts): Obsidian & Champagne tokens only; danger-styled Restore in the dialog. */
.backup-intro { margin: 0; padding: 12px 14px 4px; font-size: 13.5px; }
.backup-done .title { font-weight: 500; }
.backup-dialog p { margin: 0 0 4px; line-height: 1.5; }
.backup-dialog .backup-actions { flex-direction: row; }
.backup-dialog .backup-actions .btn { flex: 1; }
.backup-dialog .backup-actions .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 899px) { .backup-dialog .backup-actions { flex-direction: column-reverse; } }

/* Cmd-K search (web/src/search.ts): a centred palette; Champagne only for the highlighted row's edge and the marks. */
.cmdk-back { align-items: flex-start; justify-content: center; padding-top: min(14vh, 120px); }
.cmdk { width: min(640px, calc(100vw - 24px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; font-family: var(--font); }
.cmdk-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text-dim); }
.cmdk-input { flex: 1; border: 0; background: transparent; color: var(--text); font: var(--t-body); outline: none; min-height: 32px; }
.cmdk-input::-webkit-search-cancel-button { display: none; }
.cmdk-kbd { font: var(--t-caption); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.cmdk-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.cmdk-list.stale { opacity: .6; }
.cmdk-group { display: flex; flex-direction: column; gap: 2px; }
.cmdk-group-label { font: var(--t-caption); color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; padding: 10px 10px 4px; }
.cmdk-opt { padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; border-left: 2px solid transparent; }
.cmdk-opt.on { background: var(--bg-hover); border-left-color: var(--accent); }
/* H2-07/H2-36: chats, bots and teammates by name, above the message matches */
.cmdk-setting,
.cmdk-name { display: flex; align-items: center; gap: 10px; }
.cmdk-name-text { display: flex; flex-direction: column; min-width: 0; }
.cmdk-name-text strong, .cmdk-name-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-name-text mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; }
.cmdk-name-ico { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--accent); font-weight: 600; font-size: 13px; }
.cmdk-name .bot-av { flex: 0 0 auto; }
.cmdk-meta { font: var(--t-footnote); }
.cmdk-author { font-weight: 600; }
.cmdk-snippet { font: var(--t-callout); color: var(--text-dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cmdk-snippet mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); border-radius: 3px; padding: 0 1px; font-weight: 600; }
.cmdk-note { padding: 18px 12px; text-align: center; font: var(--t-callout); }
.cmdk-note.small { padding: 8px 12px; font: var(--t-footnote); }
.cmdk-more { align-self: center; margin: 6px 0; }
.cmdk-foot { padding: 8px 14px; border-top: 1px solid var(--line); font: var(--t-caption); }
@media (max-width: 899px) { .cmdk-back { padding-top: calc(12px + var(--safe-top)); } .cmdk-foot { display: none; } }
/* After a jump: the message glows briefly; "Jump to latest" sits quietly over the bottom of the chat. */
.msg.flash .bubble { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); transition: box-shadow var(--m-slow) var(--ease); }
.thread-pane { position: relative; }
/* H2-21: drop files on a chat to attach them (the desktop's hint, web tokens) */
.drop-hint { position: absolute; inset: 64px 16px 16px; border: 2px dashed var(--accent); border-radius: 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; z-index: 20; pointer-events: none; }
.drop-hint[hidden] { display: none; }
.jump-latest { position: absolute; right: 16px; bottom: 96px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--bg-card); color: var(--text-dim); font: var(--t-footnote); box-shadow: var(--shadow-1); cursor: pointer; z-index: 2; }
.jump-latest[hidden] { display: none; }
.jump-latest:hover { color: var(--text); }

/* Settings › Memory (web/src/memory.ts): pinned facts first; Champagne only on a pressed pin. */
.mem-group { display: flex; flex-direction: column; }
.mem-head { display: flex; align-items: center; gap: 6px; font: var(--t-caption); color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; padding: 10px 16px 2px; }
.mem-head svg { width: 13px; height: 13px; }
.mem-note { margin: 0; padding: 0 16px 6px; font: var(--t-footnote); }
.mem-text { white-space: normal; overflow-wrap: anywhere; }
.icon-btn.pin { color: var(--text-faint); }
.icon-btn.pin.on { color: var(--accent); }

/* H1-05/06 Stop and Message on running work */
.work-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; max-width: 60%; }
.work-controls .work-buttons { gap: 6px; }
.work-controls .work-input { gap: 6px; width: 100%; }
.work-controls .work-input .input { flex: 1; min-width: 180px; }
.work-controls .work-line { color: var(--text-dim); font-size: 13px; text-align: right; }

/* H1-15/H1-50 bot avatars: the block from src/ui/bot-avatar.ts BOT_AVATAR_CSS (keep in sync; a test checks). */
.bot-av { position: relative; background: var(--av-bg); color: var(--av-fg); border: 1px solid var(--line); font-family: var(--font-display, Inter); }
.bot-av .bot-av-glyph { position: absolute; right: -3px; bottom: -3px; width: 42%; height: 42%; min-width: 12px; min-height: 12px; border-radius: 50%; display: grid; place-items: center; background: var(--av-bg); color: var(--av-fg); box-shadow: 0 0 0 2px var(--bg); }
.bot-av .bot-av-glyph svg { width: 70%; height: 70%; }
.bot-av.sm .bot-av-glyph { display: none; }
/* After a hire: the new bot's own section, marked for a moment. */
.section-label.section-new { color: var(--accent-text); }

/* H1-15/H1-50: the "Meet <name>" starter Page link in a bot chat header */
.meet-slot { display: flex; align-items: center; }
.meet-slot:empty { display: none; }
/* ---------------------------------------------------------------- account set to be deleted (web/src/deletion.ts) */
.deletion-slot { padding: 10px 12px 0; }
.deletion-slot[hidden] { display: none; }
.banners .deletion-slot, .gate-card .deletion-slot, .stack .deletion-slot { padding: 0; }
.deletion-banner { flex-direction: row; align-items: center; gap: 10px; }
.deletion-banner strong { flex: 1; font-weight: 600; }

/* H1-13: calendar, chat and page routines (src/ui/routine-trigger-form.ts): their times on the card, quiet Pewter notes */
.routine-trigger { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; font: var(--t-footnote); color: var(--text-dim); }
.routine-trigger .trigger-note { color: var(--text-faint); }
.trigger-fields { display: flex; flex-direction: column; }
.trigger-fields[hidden], .trigger-error[hidden] { display: none; }
.trigger-error { color: var(--bad); font: var(--t-footnote); margin: 0 0 10px; }
.field [aria-invalid='true'] { border-color: var(--bad); }

/* H1-56: restore progress (src/ui/restore-progress-bar.ts): a Champagne fill on a Graphite track, used only here */
.restore-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; min-width: 0; }
.restore-bar { position: relative; height: 6px; border-radius: 3px; background: var(--graphite); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.restore-bar-fill { height: 100%; width: 0; border-radius: 3px; background: var(--champagne); transition: width .25s ease-out; }
.restore-bar.indeterminate .restore-bar-fill { position: absolute; left: 0; width: 30%; animation: restore-slide 1.2s ease-in-out infinite; }
@keyframes restore-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .restore-bar-fill { transition: none; } .restore-bar.indeterminate .restore-bar-fill { animation: none; width: 100%; opacity: .45; } }

/* ---------------------------------------------------------------- chat-first nav: the live screen in the chat */
.live-pin-slot { padding: 8px 12px 0; }
.live-pin-slot[hidden] { display: none; }
.live-card { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-card); color: var(--text); cursor: pointer; font-family: var(--font); }
.live-card.ended { cursor: default; opacity: 0.8; }
.live-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.live-card.pinned { background: var(--bg-raised); border-color: var(--line-strong); }
.live-thumb { width: 112px; height: 70px; flex: none; border-radius: var(--r-sm); object-fit: cover; background: var(--bg); border: 1px solid var(--line); }
.live-card.pinned .live-thumb { width: 72px; height: 45px; }
.live-thumb.empty { display: flex; align-items: center; justify-content: center; padding: 4px; text-align: center; font-size: var(--t-caption); color: var(--text-faint); }
.live-kicker { font-size: var(--t-caption); color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 6px; }
.live-title { font-weight: 600; margin: 2px 0; }
.live-acts { gap: 6px; flex: none; }
.live-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.66); display: flex; align-items: center; justify-content: center; padding: 16px; }
.live-overlay-card { width: min(960px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-md); }
.live-overlay-acts { gap: 8px; padding: 8px 8px 0; }
.live-overlay .live-pane { min-height: 0; }
.panel-part { margin-bottom: 8px; }
.panel-part > h3 { margin: 16px 16px 4px; font-size: var(--t-callout); color: var(--text-dim); font-weight: 600; }

/* #10: a brief in the team channel (Obsidian & Champagne) */
.msg.brief-card { align-self: stretch; max-width: 560px; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--strong); color: var(--on-strong); border: 1px solid color-mix(in srgb, var(--champagne) 40%, transparent); margin: 10px 0; }
.brief-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: color-mix(in srgb, var(--on-strong) 75%, transparent); }
.brief-head .i { width: 16px; height: 16px; color: var(--champagne); }
.brief-head .chip { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--champagne) 45%, transparent); color: var(--champagne); }
.brief-head .chip.urgent { background: var(--champagne); color: var(--obsidian); }
.brief-kind { font-size: 12px; color: var(--champagne); }
.brief-title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.brief-files { display: flex; flex-wrap: wrap; gap: 6px; }
.brief-files .chip.file { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; border-radius: 8px; background: color-mix(in srgb, var(--champagne) 14%, transparent); }
.brief-files .chip.file .i { width: 13px; height: 13px; }
.brief-line { font-size: 13px; line-height: 1.4; }
.brief-line ul { margin: 2px 0 0 18px; padding: 0; }
.brief-label { display: block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: color-mix(in srgb, var(--on-strong) 60%, transparent); }
.brief-details summary { cursor: pointer; font-size: 13px; color: var(--champagne); }
.brief-details[open] summary { margin-bottom: 6px; }
.brief-details .brief-line + .brief-line { margin-top: 6px; }
.msg.brief-card .meta { font-size: 11px; color: color-mix(in srgb, var(--on-strong) 55%, transparent); }

/* #10: a failed turn, as a plain card (Obsidian & Champagne) */
.error-card { align-self: flex-start; max-width: 520px; display: flex; flex-direction: column; gap: 8px; margin: 10px 0; padding: 12px 14px; border-radius: 14px; background: var(--strong); color: var(--on-strong); border: 1px solid color-mix(in srgb, var(--champagne) 40%, transparent); }
.error-card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.error-card-title .i { width: 16px; height: 16px; color: var(--champagne); }
.error-card-text { font-size: 14px; line-height: 1.4; color: color-mix(in srgb, var(--on-strong) 85%, transparent); }
.error-card .chip { align-self: flex-start; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--champagne) 45%, transparent); color: var(--champagne); }
.error-card-acts { display: flex; gap: 8px; }
.error-card-acts .btn.primary { background: var(--champagne); color: var(--obsidian); border-color: var(--champagne); }
.error-card-acts .btn.primary:disabled { opacity: .55; cursor: default; }
.error-card-acts .btn.ghost { color: var(--on-strong); }

/* team/229: document card Open / Save */
.document-card .document-actions { display: flex; gap: 8px; margin-top: 8px; }


/* Pilot usage meter (Obsidian track / Champagne fill) — docs/pilot/usage-view-contract.md */
.usage-meter { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.usage-meter-track { height: 10px; border-radius: 99px; background: var(--bg); border: 1px solid color-mix(in srgb, var(--text-faint) 35%, transparent); overflow: hidden; }
.usage-meter-fill { height: 100%; border-radius: 99px; background: var(--accent); width: 0%; transition: width .35s ease; }
.usage-meter-fill.warn { background: color-mix(in srgb, var(--accent) 70%, var(--danger)); }
.usage-meter-label { font: 500 14px/1.4 var(--font, Inter, system-ui, sans-serif); color: var(--text); }
.usage-meter-sub { font: 400 12px/1.4 var(--font, Inter, system-ui, sans-serif); color: var(--text-faint); }
.usage-meter.seat .usage-meter-track { height: 6px; }
.msg.limit-reached .bubble { border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--surface) 92%, var(--accent)); }
.limit-reached-acts { margin-top: 10px; display: flex; gap: 8px; }
.plan-slots { display: grid; gap: 12px; }
.plan-slot { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.plan-slot .price { color: var(--accent-text); font-weight: 600; }
.plan-slot .pending { color: var(--text-faint); }
.plan-slot-pro { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-slot-badge { font-weight: 600; }

/* #240 project status (Obsidian & Champagne; Inter from shell) */
.project-status { display: flex; flex-direction: column; gap: 12px; }
.ps-title { font-size: 1.15rem; font-weight: 600; color: var(--text); margin: 0 0 4px; }
.ps-summary { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 0.9rem; }
.ps-list { display: flex; flex-direction: column; gap: 8px; }
.ps-row { text-align: left; width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: inherit; cursor: pointer; }
.ps-row:hover, .ps-row:focus-visible { border-color: var(--accent); outline: none; }
.ps-row-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ps-name { color: var(--text); font-weight: 600; }
.ps-chip { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); background: transparent; }
.ps-chip.ps-on_track { border-color: var(--ok); }
.ps-chip.ps-at_risk, .ps-chip.ps-due_soon { border-color: var(--accent); color: var(--accent); }
.ps-chip.ps-blocked { border-color: var(--bad); }
.ps-chip.ps-waiting_on_person { border-color: var(--pewter); }
.ps-meta { margin-top: 6px; color: var(--muted); }
.ps-editor { margin-top: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--accent); border-radius: 14px; gap: 10px; }
.ps-editor .input { width: 100%; }


/* #257 project task board (Obsidian & Champagne; Inter from shell) */
.project-board-wrap { margin-top: 4px; }
.project-board { display: flex; flex-direction: column; gap: 12px; }
.pb-heading { font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 0; }
.pb-head { align-items: center; gap: 8px; }
.pb-empty { margin: 0; }
.pb-error { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.pb-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) {
  .pb-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .pb-cols { grid-template-columns: 1fr; }
}
.pb-col { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.pb-col-head { display: flex; align-items: center; justify-content: space-between; color: var(--text); font-size: 0.85rem; }
.pb-col-body { display: flex; flex-direction: column; gap: 8px; }
.pb-card { text-align: left; width: 100%; padding: 10px 12px; background: var(--bg, var(--surface)); border: 1px solid var(--line); border-radius: 12px; color: inherit; cursor: pointer; }
.pb-card:hover, .pb-card:focus-visible { border-color: var(--accent); outline: none; }
.pb-card.pb-focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pb-card.pb-overdue { border-color: var(--bad); }
.pb-card.pb-dueThisWeek { border-color: var(--accent); }
.pb-card-title { font-weight: 600; color: var(--text); }
.pb-card-meta { margin-top: 4px; }
.pb-card-acts { margin-top: 6px; }
.pb-complete { color: var(--accent); font-size: 0.8rem; cursor: pointer; }
.pb-complete:hover { text-decoration: underline; }

/* #120 / #244: offline auto-post late chip (Obsidian & Champagne — pewter text, no accent fill). */
.delivery-late {
  display: inline-block;
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}
/* R7-4 Trust page: readable documents (tables scroll sideways on a phone instead of widening the page). */
.trust-gate { display: block; max-width: 860px; margin: 0 auto; }
.trust-doc { line-height: 1.55; }
.trust-doc table { display: block; overflow-x: auto; max-width: 100%; }
/* R7-5: a simple link card in the company space (Download your things). */
.co-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
/* R7-6 Help: the form and the message threads. */
.help { display: grid; gap: 10px; }
.help input[type='text'], .help textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; }
.help-attach { display: flex; gap: 8px; align-items: flex-start; color: var(--text-dim); font-size: 14px; }
.help-ticket summary { cursor: pointer; }
.help-msg { white-space: pre-wrap; }
.help-reply { border-left: 3px solid var(--line-strong); padding-left: 10px; margin: 8px 0; }
.help-reply.cravio, .help-reply.company { border-left-color: var(--accent); }
.help-reply p { white-space: pre-wrap; margin: 2px 0 0; }
.help-follow { display: grid; gap: 6px; margin-top: 8px; }
/* #264 Apps search (Obsidian & Champagne) */
.apps-search-wrap { margin: 0 0 8px; }
.apps-search {
  width: 100%; box-sizing: border-box; border-radius: 10px; padding: 10px 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit;
}
.apps-search:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); }

/* H2-08 Threaded replies (Obsidian & Champagne; Inter from shell) */
.thread-replies {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 2px 0 6px 44px; padding: 6px 10px;
  border: 0; border-radius: 10px; cursor: pointer; text-align: left;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-raised));
  color: var(--text-dim); font: 500 12.5px/1.35 var(--font, Inter, system-ui, sans-serif);
}
.thread-replies:hover, .thread-replies:focus-visible {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-raised));
  color: var(--text); outline: none;
}
.thread-replies-count { color: var(--accent-text, var(--accent)); font-weight: 600; }
.thread-replies-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42ch; font-weight: 400; }
.msg.thread-reply { margin-left: 28px; padding-left: 12px; border-left: 2px solid color-mix(in srgb, var(--accent) 40%, var(--line)); }
.msg.user.thread-reply { margin-left: 28px; margin-right: 0; }


/* H2-61: Settings search + Cmd-K setting jumps */
.settings-search { padding: 8px 0 12px; }
.settings-search-input { width: 100%; max-width: 420px; font-family: Inter, system-ui, sans-serif; }
.settings-search-empty { padding: 8px 2px 16px; }
.setting-highlight, [data-setting-id].setting-highlight {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
  transition: outline-color 0.2s ease;
}
.cmdk-setting { display: flex; align-items: center; gap: 10px; }
.cmdk-setting .cmdk-name-ico .ico, .cmdk-setting .cmdk-name-ico svg { width: 16px; height: 16px; }
