* { margin:0; padding:0; box-sizing:border-box; }

/* ============================================================
   ORBIT DESIGN TOKENS — UI optimization pass.
   Dark theme per spec:  #0d1117 background · #58a6ff accent ·
   #e6edf3 text. Everything is driven by these variables; each
   semantic rule below simply consumes them, so the whole shell
   (chat, modals, quests, camera, tooltips) stays in one palette.
   Spacing follows an 8px grid; motion is 150–300ms; interactive
   targets are ≥44px on touch.
   ============================================================ */
:root {
    /* Surfaces (light→dark = raised→inset) */
    --bg: #0d1117;          /* app / page background                */
    --bg-inset: #010409;    /* inputs, code wells                   */
    --bg-raise: #161b22;    /* header, footer, cards, bubbles       */
    --bg-hover: #1c2128;    /* hover wash                           */
    --bg-active: #21262d;   /* pressed / active chips               */
    --line: #21262d;        /* default border                       */
    --line-strong: #30363d; /* stronger border / separators         */
    /* Text */
    --text: #e6edf3;        /* primary copy                         */
    --text-2: #b1bac4;      /* secondary copy                       */
    --text-3: #8b949e;      /* muted copy / labels                  */
    --text-4: #6e7681;      /* faint copy / placeholders            */
    /* Accent (OrbitOracle.AI blue) */
    --accent: #58a6ff;
    --accent-hi: #79c0ff;
    --accent-lo: #1f6feb;
    --accent-glow: rgba(88, 166, 255, 0.35);
    --accent-soft: rgba(88, 166, 255, 0.12);
    --accent-line: rgba(88, 166, 255, 0.4);
    /* Semantic */
    --ok: #3fb950;          --ok-soft: rgba(63, 185, 80, 0.14);
    --warn: #d29922;        --warn-soft: rgba(210, 153, 34, 0.13);
    --danger: #f85149;      --danger-soft: rgba(248, 81, 73, 0.14);
    --gold-1: #e3b341;      --gold-2: #f0883e;   /* upgrade CTA gradient */
    --gold-ink: #241500;
    /* Chrome */
    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 16px;
    --radius-xl: 22px;
    --shadow-card: 0 20px 60px rgba(1, 4, 9, 0.72);
    --shadow-pop: 0 12px 30px rgba(1, 4, 9, 0.6);
    /* Safe-area insets (0px where unsupported) */
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}

/* [hidden] must always win — every dynamic toggle in the shell relies on it. */
[hidden] { display:none !important; }

/* ---- Viewport sizing -------------------------------------------------
   Fixed flex column: header (top) + chat (flex) + footer (composer).
   Nothing may scroll the page so the composer can never be pushed off
   screen. 100dvh tracks browser-chrome-collapsed viewports; script.js
   additionally pins html/body/#app/modals to visualViewport.height so
   the soft keyboard can never hide the chat input. */
html { height:100%; }
html, body {
    height:100vh;
    height:100dvh;
    overflow:hidden;
    font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background:var(--bg);
    color:var(--text);
    -webkit-tap-highlight-color:transparent;
}

body { display:flex; flex-direction:column; }

/* ---- Modals ----------------------------------------------------------
   .modal is its own scroll container; the card uses margin:auto so on
   short screens / soft keyboard it stays centered when it fits and is
   scrollable when it does not. */
/* ---- Boot splash (v82) -------------------------------------------------
   Covers the interval between first paint and the moment script.js can reveal a
   real screen (its 1 MB download starts only after the document is parsed). It
   must never be able to block anything: pointer-events:none, and a z-index below
   both launch gates so a gate always wins. If the script never runs, this is what
   the visitor keeps — a truthful "Loading…" plus the noscript line, instead of
   the private-instance access-code screen that used to ship visible here. */
#bootSplash { position:fixed; inset:0; z-index:9000; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; background:var(--bg); color:var(--text); text-align:center; padding:24px; pointer-events:none; }
#bootSplash img { border-radius:16px; opacity:.95; }
.boot-splash-brand { font-size:19px; font-weight:700; margin:8px 0 0; letter-spacing:-.01em; }
.boot-splash-sub { font-size:13px; color:var(--text-3); margin:2px 0 0; max-width:34ch; line-height:1.55; }
/* Safe-mode boot (v105): the watchdog's failure state. The splash above ships pointer-events:none
   so it can never swallow a click while it covers the download interval — which is exactly wrong
   for the ONE state where the visitor has to press Reload, so the failed state takes the pointer
   back. It is not hidden and not removed either: verify-boot.ps1 read the element's survival as
   the boot verdict, so a real boot failure has to stay visible to the gate. */
#bootSplash.boot-splash-failed { pointer-events:auto; }
#bootSplash.boot-splash-failed .btn-primary { margin-top:14px; }
.modal { display:none; position:fixed; inset:0; width:100%; height:100vh; height:100dvh; background:rgba(1,4,9,0.82); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); align-items:center; justify-content:center; z-index:1000; overflow-y:auto; overscroll-behavior:contain; padding: calc(20px + var(--sat)) calc(20px + var(--sar)) calc(20px + var(--sab)) calc(20px + var(--sal)); }
.modal.show { display:flex; }

/* The first-run Terms gate must outrank the vault layer.
   .vault-overlay is position:fixed; inset:0 at z-index 9700 and swallows every
   click - the same trap that left the vault banner's buttons dead until it was
   raised to 9850 (see #orbitVaultBanner). At the default .modal z-index of 1000
   this modal's "Terms of Service" / "Privacy Policy" links and its
   "Accept & Enter" button were unreachable whenever any vault surface was on
   screen, which on a first launch is always: the vault prompt appears before the
   gateway is dismissed. Raised only for the gate itself, so no other modal
   changes precedence. */
#tosModal { z-index: 9960; }
/* The LOGIN gate needs exactly the same treatment — it was missed, and that is the
   bug behind "the button to the right of the box I am typing into does nothing when
   I log in". #passwordModal sat at the default .modal z-index of 1000, i.e. UNDER
   .vault-overlay (position:fixed; inset:0 at 9700, which swallows every click). On a
   first launch the vault prompt is on screen before the gateway is dismissed, so:
     - "Unlock" could not be clicked at all. The code could only be entered by
       keyboard (passwordInput's Enter handler calls unlockApp() without a click),
       which is why logging in appeared to work while nothing else did;
     - and the overlay stayed in the DOM once the reader was inside the app, so every
       click in the composer was swallowed: typing still worked because the field
       already held focus, but the Send button did nothing.
   Raised for the gate itself only, matching #tosModal, so no other modal changes
   precedence. test_vault_overlay_trap.py now fails if any launch gate is left under
   the vault layer again. */
#passwordModal { z-index: 9960; }
.modal-content { background:var(--bg-raise); border-radius:var(--radius-xl); padding:28px; max-width:430px; width:100%; max-height:80vh; overflow-y:auto; overscroll-behavior:contain; margin:auto; box-shadow:var(--shadow-card); border:1px solid var(--line-strong); position:relative; }
.modal-header { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:16px; }
.modal-header h2 { font-size:23px; line-height:1.25; }
.subtitle { color:var(--text-3); font-size:14px; text-align:center; margin-bottom:20px; }
.hint { font-size:13px; color:var(--text-3); line-height:1.5; margin:10px 0 0; }
.close-btn { background:none; border:none; color:var(--text-3); font-size:24px; line-height:1; cursor:pointer; width:44px; height:44px; display:flex; align-items:center; justify-content:center; border-radius:var(--radius-s); transition:background .15s, color .15s; touch-action:manipulation; }
.modal-body p { color:var(--text-2); font-size:14px; margin-bottom:16px; line-height:1.65; }
/* 16px inputs prevent iOS auto-zoom on focus.
   :NOT([type=checkbox]):NOT([type=radio]) IS THE FIX FOR A MEASURED DEFECT, not tidiness. A checkbox
   is an <input> too, and this rule stretched one to `width:100%` with 13px/16px padding, a border, a
   rounded background and a 12px bottom margin. In the Builder's checklist row (a flex row:
   `.tpl-step`) the checkbox therefore took the WHOLE row width while it cannot shrink
   (`.tpl-step-box{flex:0 0 auto}`), which squeezed the step text (`.tpl-step-text{flex:1 1 auto;
   min-width:0}`) to a **0px-wide ribbon** that wrapped one character per line: measured in a real
   browser at 1100x900, EVERY checklist row was **2,549px tall** and the checkbox painted as a
   **612x28 blank rounded box** — nine rows made the panel 22,509px long, which the operator reported as
   "the bottom box appears to be blank for all templates". A presence check could not see it (the text
   was all there, and every element existed); the GEOMETRY is what named it, and the geometry was
   measured by pytmp/_probe_builder_blank_box.py. */
.modal-body input:not([type="checkbox"]):not([type="radio"]), .modal-body textarea { width:100%; padding:13px 16px; border:1px solid var(--line-strong); border-radius:var(--radius-m); background:var(--bg-inset); color:var(--text); font-size:16px; margin-bottom:12px; font-family:inherit; -webkit-appearance:none; appearance:none; transition:border-color .2s, box-shadow .2s; }
.modal-body input:focus, .modal-body textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.modal-body textarea { min-height:88px; resize:vertical; }
.btn-primary { width:100%; padding:14px; background:linear-gradient(135deg, var(--accent-lo), var(--accent)); border:none; border-radius:var(--radius-m); color:#fff; font-size:16px; font-weight:700; cursor:pointer; transition:transform .15s, opacity .15s, filter .15s; touch-action:manipulation; }
.btn-primary:active { transform:scale(0.97); opacity:0.85; }
.btn-primary:disabled { opacity:0.5; cursor:not-allowed; }
.btn-secondary { padding:11px 16px; background:var(--bg-active); border:1px solid var(--line); border-radius:var(--radius-s); color:var(--text); font-size:13px; font-weight:600; cursor:pointer; margin:4px; transition:background .15s, color .15s; touch-action:manipulation; }
.btn-secondary:active { background:var(--line-strong); }
.btn-danger { padding:11px 16px; background:var(--danger-soft); border:1px solid rgba(248,81,73,.4); border-radius:var(--radius-s); color:#ffb3ad; font-size:13px; font-weight:600; cursor:pointer; margin:4px; transition:background .15s; touch-action:manipulation; }
.btn-danger:active { background:rgba(248,81,73,.28); }
/* Settings groups (model / language / API key / memory / access) */
.setting-group { margin-bottom:20px; }
.setting-group label { display:block; color:var(--text-2); font-size:13px; font-weight:600; margin-bottom:8px; }
.setting-group select { width:100%; padding:13px 16px; border:1px solid var(--line-strong); border-radius:var(--radius-m); background:var(--bg-inset); color:var(--text); font-size:16px; margin-bottom:12px; font-family:inherit; -webkit-appearance:none; appearance:none; transition:border-color .2s, box-shadow .2s; }
.setting-group select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }

/* Level Up in Settings uses the SAME native-disclosure pattern as the composer's box
   (.uplevel-nest): two axes, one box each, opened by the browser instead of by a script, so
   no Level Up control holds a permanent screen row while it is not being used. */
.setting-nest { margin-bottom:10px; }
.setting-summary { display:flex; align-items:center; gap:6px; list-style:none; cursor:pointer; background:var(--bg-active); border:1px solid var(--line); border-radius:var(--radius-m); padding:11px 13px; font-size:13px; font-weight:600; color:var(--text-2); transition:border-color .15s, color .15s; }
.setting-summary::-webkit-details-marker { display:none; }
.setting-summary:hover { color:var(--text); border-color:var(--line-strong); }
.setting-summary:focus-visible { outline:none; box-shadow:0 0 0 2px var(--accent-soft); border-color:var(--accent-line); }
.setting-summary::before { content:'▸'; font-size:10px; line-height:1; opacity:.75; }
.setting-nest[open] > .setting-summary { margin-bottom:10px; color:var(--text); border-color:var(--accent-line); }
.setting-nest[open] > .setting-summary::before { content:'▾'; }
.setting-nest-body { padding:2px 1px 0; }
.setting-nest-body .btn-secondary { margin-bottom:8px; }

/* ── Report a problem (queue item 1) ────────────────────────────────────────────────────────
   The same disclosure shape as the Settings boxes above, so it is one more row inside a box the
   reader already knows how to open — not a new kind of control to learn. The diagnosis is a <pre>
   because it is text the reader is asked to READ, and the box SCROLLS instead of growing: an
   error log must never be the thing that makes the feedback modal taller than the phone.
   The select lesson from the shape picker applies here too — a surface the page does not paint
   is a surface the app does not own — so both the box and its text carry their own colour. */
.report-nest { margin:12px 0 10px; }
.report-summary { display:flex; align-items:center; gap:6px; list-style:none; cursor:pointer; background:var(--bg-active); border:1px solid var(--line); border-radius:var(--radius-m); padding:11px 13px; font-size:13px; font-weight:600; color:var(--text-2); transition:border-color .15s, color .15s; }
.report-summary::-webkit-details-marker { display:none; }
.report-summary:hover { color:var(--text); border-color:var(--line-strong); }
.report-summary:focus-visible { outline:none; box-shadow:0 0 0 2px var(--accent-soft); border-color:var(--accent-line); }
.report-summary::before { content:'▸'; font-size:10px; line-height:1; opacity:.75; }
.report-nest[open] > .report-summary { margin-bottom:10px; color:var(--text); border-color:var(--accent-line); }
.report-nest[open] > .report-summary::before { content:'▾'; }
.report-body { padding:0 1px; }
.report-hint { font-size:12px; color:var(--text-3); margin:0 0 8px; }
.report-privacy { display:block; font-size:12px; font-weight:600; color:var(--text-2); margin-bottom:6px; }
.report-diag { margin:0 0 8px; padding:10px 11px; max-height:190px; overflow:auto; background:var(--bg-inset); border:1px solid var(--line); border-radius:var(--radius-m); color:var(--text); font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:11.5px; line-height:1.5; white-space:pre-wrap; word-break:break-word; }
.report-diag:focus-visible { outline:none; box-shadow:0 0 0 2px var(--accent-soft); border-color:var(--accent-line); }
.report-copy-status { font-size:12px; margin:6px 0 0; color:var(--text-3); }
.badge { background:var(--bg-active); padding:2px 10px; border-radius:20px; font-size:10px; font-weight:600; color:var(--text-3); margin-left:6px; text-transform:uppercase; letter-spacing:.4px; }
.project-item { background:var(--bg-inset); padding:13px 16px; border-radius:var(--radius-m); border:1px solid var(--line); margin-bottom:10px; display:flex; justify-content:space-between; align-items:center; gap:8px; }
.project-item .info { flex:1; min-width:0; }
.project-item .name { font-weight:600; color:var(--text); }
.project-item .desc { font-size:13px; color:var(--text-3); margin-top:2px; overflow-wrap:anywhere; }
/* Compact per-idea action cluster (Export / Share / Edit / Delete) — rows
   keep the 4 buttons on one line on desktop and wrap on narrow phones. */
.project-actions { display:flex; flex-wrap:wrap; gap:4px; justify-content:flex-end; flex-shrink:0; }
.project-actions .idea-action { margin:0; padding:8px 9px; line-height:1; font-size:14px; min-width:34px; text-align:center; }
/* Idea-row hover summary — a one-paragraph digest of the idea folder's
   contents (local-companion builds only; shown under the row on hover). */
.idea-fsum { position:fixed; z-index:1500; max-width:min(360px, calc(100vw - 24px)); background:var(--bg-raise); color:var(--text); border:1px solid var(--line-strong); border-radius:var(--radius-m); box-shadow:var(--shadow-pop); padding:10px 12px; display:none; pointer-events:none; font-size:13px; line-height:1.5; text-align:left; }
.idea-fsum-title { font-weight:700; color:var(--accent-hi); margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.idea-fsum-body { overflow-wrap:anywhere; }
.idea-fsum-loading { opacity:.7; font-style:italic; }

/* ---- Action sheet (quick-tool pickers: Image / Task / Coach) ----------
   One reusable sheet whose rows are filled by script.js. Rows are large
   (≥52px) so a thumb never misses on mobile. */
.sheet-content { max-width:440px; padding:20px; }
.sheet-content .modal-header { margin-bottom:8px; }
.sheet-list { display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.sheet-item { display:flex; align-items:center; gap:12px; width:100%; text-align:left; background:var(--bg-active); border:1px solid var(--line); border-radius:var(--radius-m); padding:8px 10px; min-height:52px; color:var(--text); font-size:14.5px; font-family:inherit; cursor:pointer; transition:border-color .15s, background .15s, transform .1s; touch-action:manipulation; }
.sheet-item .sheet-emoji { font-size:20px; width:36px; height:36px; flex-shrink:0; display:flex; align-items:center; justify-content:center; background:var(--bg-raise); border-radius:10px; border:1px solid var(--line); }
.sheet-item .sheet-text { flex:1; min-width:0; }
.sheet-item .sheet-text b { display:block; font-size:14.5px; font-weight:600; }
.sheet-item .sheet-text span { display:block; font-size:12px; color:var(--text-3); margin-top:1px; overflow-wrap:anywhere; }
.sheet-item .sheet-arrow { color:var(--text-4); font-size:18px; flex-shrink:0; }
.sheet-item:hover { border-color:var(--accent-line); background:var(--bg-hover); }
.sheet-item:active { transform:scale(0.985); }

/* ---- Pricing / upgrade modal ------------------------------------------
   Clean overlay comparing all five tiers (Free + Solo + Pro + Pro Max +
   Enterprise). Cards stack on phones and fan out side-by-side on wide
   screens; each "Subscribe" button redirects to WordPress checkout. */
.pricing-content { max-width:720px; }
.pricing-intro { color:var(--text-3); font-size:13.5px; margin:-4px 0 16px; }
/* Beat the generic .modal-body p defaults (specificity) */
.modal-body .pricing-intro { color:var(--text-3); margin:0 0 16px; }
.modal-body .pricing-note { color:var(--text-4); }
.pricing-grid { display:grid; grid-template-columns:1fr; gap:12px; }
.price-card { position:relative; display:flex; flex-direction:column; gap:10px; background:var(--bg-inset); border:1px solid var(--line); border-radius:var(--radius-l); padding:16px 16px 14px; transition:border-color .2s, box-shadow .2s; }
.price-card.featured { border-color:var(--accent-line); box-shadow:0 0 0 1px var(--accent-soft), 0 8px 24px rgba(1,4,9,.35); background:linear-gradient(180deg, rgba(88,166,255,.06), transparent 55%), var(--bg-inset); }
.price-card.is-current { border-color:var(--ok); box-shadow:0 0 0 1px var(--ok-soft); }
.price-head { display:flex; align-items:center; gap:8px; }
.price-name { font-weight:700; font-size:16px; color:var(--text); }
.tier-flag { margin-left:auto; font-size:9.5px; font-weight:800; letter-spacing:.8px; text-transform:uppercase; padding:3px 9px; border-radius:20px; white-space:nowrap; }
.tier-flag.free { background:var(--bg-active); color:var(--text-3); }
.tier-flag.current { background:var(--ok-soft); color:#7ee2a8; border:1px solid rgba(63,185,80,.4); }
.tier-flag.popular { background:linear-gradient(135deg, var(--gold-1), var(--gold-2)); color:var(--gold-ink); }
.price-amount { display:flex; align-items:baseline; gap:4px; }
.price-amount .price-num { font-size:26px; font-weight:800; color:var(--text); }
.price-amount .price-per { font-size:12px; color:var(--text-3); }
.price-tagline { font-size:12.5px; color:var(--text-3); margin-top:-6px; }
.price-feats { list-style:none; display:flex; flex-direction:column; gap:6px; margin:2px 0 0; }
.price-feats li { font-size:13px; color:var(--text-2); display:flex; gap:8px; align-items:flex-start; line-height:1.45; }
.price-feats li::before { content:"✓"; color:var(--ok); font-weight:800; flex-shrink:0; }
.price-feats li.no::before { content:"—"; color:var(--text-4); }
.price-cta { margin-top:auto; padding:12px 14px; border:none; border-radius:var(--radius-m); font-size:14.5px; font-weight:800; cursor:pointer; font-family:inherit; transition:transform .15s, filter .15s, background .15s; touch-action:manipulation; }
.price-cta.primary { background:linear-gradient(135deg, var(--accent-lo), var(--accent)); color:#fff; }
.price-cta.primary:hover { filter:brightness(1.1); }
.price-cta.ghost { background:transparent; border:1px solid var(--line-strong); color:var(--text-2); }
.price-cta.ghost:hover { background:var(--bg-active); color:var(--text); }
.price-cta:active { transform:scale(0.97); }
.pricing-note { font-size:12px; color:var(--text-4); line-height:1.6; text-align:center; margin:14px 0 0; }
.pricing-later { width:100%; margin:12px 0 0; }

/* ---- Pro / plan bars ---------------------------------------------------
   Free visitors see the non-blocking banner pinned above the composer
   ("You've used X of 40 free messages") whose CTA opens the pricing modal
   in-app — never a redirect. Paid Solo/Pro users see the Pro Max bar. */
.pro-chip { display:inline-block; flex-shrink:0; background:linear-gradient(135deg, var(--gold-1), var(--gold-2)); color:var(--gold-ink); font-size:10px; font-weight:800; letter-spacing:0.9px; padding:3px 9px; border-radius:20px; text-transform:uppercase; }
/* v33 — the free Pro trial pill. Same shape as the PRO chip; the ended state
   drops the gold so it reads as information rather than a badge. */
.pro-chip.trial-chip-ended { background: var(--bg-raise); color: var(--text-3); border: 1px solid var(--line-strong); }
.plan-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-shrink:0; margin:0 calc(16px + var(--sar)) 0 calc(16px + var(--sal)); padding:8px 12px; font-size:12.5px; color:var(--text-2); background:var(--warn-soft); border:1px solid rgba(210,153,34,.35); border-radius:var(--radius-m); animation:statusIn .25s ease; }
.plan-bar .plan-text { min-width:0; line-height:1.4; }
.subscribe-btn { flex-shrink:0; border:none; cursor:pointer; border-radius:20px; padding:8px 15px; font-size:12.5px; font-weight:800; color:var(--gold-ink); background:linear-gradient(135deg, var(--gold-1), var(--gold-2)); transition:transform .15s, filter .15s; touch-action:manipulation; white-space:nowrap; }
.subscribe-btn:hover { filter:brightness(1.08); }
.subscribe-btn:active { transform:scale(0.95); }
.upgrade-bar { background:var(--accent-soft); border-color:var(--accent-line); }
.upgrade-bar .subscribe-btn { background:linear-gradient(135deg, var(--accent-lo), var(--accent)); color:#fff; }

/* ---- App shell ---------------------------------------------------------
   #app owns the viewport and hides overflow; only #chatContainer scrolls. */
#app { display:flex; flex-direction:column; width:100%; max-width:600px; margin:0 auto; height:100vh; height:100dvh; overflow:hidden; }
header { display:flex; justify-content:space-between; align-items:center; flex-shrink:0; padding: calc(12px + var(--sat)) calc(16px + var(--sar)) 12px calc(16px + var(--sal)); background:var(--bg-raise); border-bottom:1px solid var(--line); }
.header-left { display:flex; align-items:center; gap:10px; min-width:0; }
.logo { height:32px; width:32px; border-radius:8px; object-fit:contain; flex-shrink:0; }
.app-name { font-size:18px; font-weight:650; white-space:nowrap; }
.status-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-left:6px; flex-shrink:0; }
.status-dot.online { background:var(--ok); box-shadow:0 0 8px rgba(63,185,80,.5); }
.status-dot.offline { background:var(--danger); box-shadow:0 0 8px rgba(248,81,73,.5); }
.header-right { display:flex; gap:2px; flex-shrink:0; }
/* Icon buttons: ≥44px touch targets, one per header control. */
.icon-btn { background:none; border:none; color:var(--text-3); font-size:20px; cursor:pointer; min-width:44px; min-height:44px; padding:6px 8px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; transition:background .15s, color .15s, transform .1s; touch-action:manipulation; }
.icon-btn:hover { background:var(--bg-active); color:var(--text); }
.icon-btn:active { transform:scale(0.92); }
.icon-btn.feedback { color:var(--ok); border:1px solid rgba(63,185,80,.45); border-radius:50%; background:var(--ok-soft); }

/* ---- Idea / folder switcher (local-companion builds only) --------------
   A slim row under the header: the dropdown shows the active idea folder
   (General when none is open) and the + New Idea button opens the create
   modal. script.js hides the row on public/serverless deploys, which have
   no local folders to switch between. */
.idea-switcher { display:flex; align-items:center; gap:8px; flex-shrink:0; padding:6px calc(16px + var(--sar)) 6px calc(16px + var(--sal)); background:var(--bg-raise); border-bottom:1px solid var(--line); }
.idea-switcher-icon { font-size:15px; line-height:1; flex-shrink:0; }
.idea-switcher-select { flex:1 1 auto; min-width:0; min-height:40px; padding:0 12px; border:1px solid var(--line-strong); border-radius:var(--radius-s); background:var(--bg-inset); color:var(--text); font-size:13.5px; font-weight:600; font-family:inherit; color-scheme:dark; cursor:pointer; transition:border-color .2s, box-shadow .2s; }
.idea-switcher-select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.idea-new-btn { flex-shrink:0; min-height:40px; padding:0 14px; border:none; border-radius:var(--radius-s); background:linear-gradient(135deg, var(--accent-lo), var(--accent)); color:#fff; font-size:13px; font-weight:700; font-family:inherit; cursor:pointer; white-space:nowrap; transition:transform .15s, filter .15s; touch-action:manipulation; }
.idea-new-btn:hover { filter:brightness(1.08); }
.idea-new-btn:active { transform:scale(0.96); }

/* PROJECT STATUS CHIP — the chat screen's half of the Projects-drawer strip.
   The WORD carries the state (a reader, a colour-blind reader and a screen reader
   all get it from the same place); the colour and the outline are the second cue,
   and only `ready` is highlighted. Unknown is dashed with a warn dot and NEVER the
   dormant look: "could not check" drawn as "no files" is a false negative. The
   ready outline is static, so it survives the global prefers-reduced-motion rule
   that zeroes every animation; the bloom into ready is the only motion, it runs
   once, and losing it costs nothing. */
.idea-status-chip { flex:0 0 auto; display:inline-flex; align-items:center; gap:6px; min-height:40px; padding:0 11px; border:1px solid var(--line-strong); border-radius:var(--radius-s); background:var(--bg-inset); color:var(--text-2); font-family:inherit; font-size:11.5px; font-weight:700; line-height:1; white-space:nowrap; cursor:pointer; touch-action:manipulation; transition:border-color .15s, color .15s; }
.idea-status-chip[hidden] { display:none; }
.idea-status-chip::before { content:''; flex:0 0 auto; width:7px; height:7px; border-radius:50%; background:var(--text-4); }
.idea-status-chip:hover { border-color:var(--accent-line); color:var(--text); }
.idea-status-chip:active { transform:scale(0.97); }
.idea-status-chip[data-state="ready"] { border-color:var(--ok); color:var(--text); box-shadow:0 0 0 1px var(--ok-soft), 0 0 10px rgba(63,185,80,.26); }
.idea-status-chip[data-state="ready"]::before { background:var(--ok); box-shadow:0 0 7px rgba(63,185,80,.6); }
.idea-status-chip[data-state="unknown"] { border-style:dashed; }
.idea-status-chip[data-state="unknown"]::before { background:var(--warn); }
.idea-status-chip.is-bloom { animation:sfStatusBloom 0.6s ease-out 1; }
@media (pointer:coarse) { .idea-status-chip { min-height:44px; } }

/* #chatScroll owns the flex slot inside #app and the newest-message overlay
   button; #chatContainer is the real scroll box inside it, so the floating
   "jump to newest" pill can overlay the chat region without scrolling away. */
#chatScroll { position:relative; flex:1 1 auto; min-height:0; min-width:0; display:flex; flex-direction:column; overflow:hidden; }
#chatContainer { flex:1 1 auto; min-height:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; padding:16px 20px 4px; display:flex; flex-direction:column; gap:12px; -webkit-overflow-scrolling:touch; scrollbar-width:thin; scrollbar-color:var(--line-strong) transparent; }
/* The chat scrollbar must be findable (some platforms/browsers hide overlay
   scrollbars until a drag starts), so give it a real track + grabbable thumb. */
#chatContainer::-webkit-scrollbar { width:8px; }
#chatContainer::-webkit-scrollbar-track { background:rgba(1,4,9,0.35); border-radius:10px; }
#chatContainer::-webkit-scrollbar-thumb { background:var(--line-strong); border-radius:10px; }
#chatContainer::-webkit-scrollbar-thumb:hover { background:#3d444d; }
/* Jump-to-newest pill: floats over the bottom-right of the chat. script.js
   shows it only while the reader is scrolled up from the newest message, so
   there is always a visible way back to the bottom (and a grab target when the
   platform hides the scrollbar). */
.jump-newest { position:absolute; right:14px; bottom:12px; z-index:30; min-width:44px; height:44px; padding:0 14px; border:none; border-radius:22px; background:linear-gradient(135deg, var(--accent-lo), var(--accent)); color:#fff; font-family:inherit; font-size:16px; font-weight:800; display:flex; align-items:center; justify-content:center; gap:6px; cursor:pointer; box-shadow:var(--shadow-pop); transition:transform .15s, filter .15s, opacity .2s; touch-action:manipulation; }
.jump-newest:hover { filter:brightness(1.1); }
.jump-newest:active { transform:scale(0.94); }
.message { display:flex; gap:12px; max-width:88%; min-width:0; animation:fadeIn 0.3s ease; }
.no-anim .message { animation:none; }
.message.user { align-self:flex-end; flex-direction:row-reverse; }
.message .avatar { width:32px; height:32px; border-radius:50%; background:var(--bg-active); display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; overflow:hidden; line-height:1; }
.message.bot .avatar { background:linear-gradient(135deg,#13233b,#0d1a2e); color:var(--accent-hi); font-size:17px; box-shadow:inset 0 0 0 1px var(--accent-line); }
.message.user .avatar { background:linear-gradient(135deg, var(--accent-lo), var(--accent)); color:#fff; font-size:17px; }
.message .bubble { background:var(--bg-raise); border:1px solid var(--line); padding:12px 16px; border-radius:16px; border-top-left-radius:4px; color:var(--text); font-size:15px; line-height:1.6; min-width:0; overflow-wrap:anywhere; word-wrap:break-word; }
.message.user .bubble { background:linear-gradient(135deg, var(--accent-lo), var(--accent)); border-color:transparent; color:#fff; border-radius:16px; border-top-right-radius:4px; }
.message .bubble .timestamp { font-size:10px; color:var(--text-4); margin-top:6px; display:block; text-align:right; }
.message.user .bubble .timestamp { color:rgba(255,255,255,0.65); }
/* Text highlight (v66): the 🖍️ Highlight action on every chat bubble wraps
   the reader-selected message text in a yellow mark. The color pair is
   fixed (not a skin token) on purpose — the mark has to read as "paper
   highlighter" on every skin and inside the gradient user bubble. */
.highlight-mark { background:#ffd166; color:#0d1117; border-radius:4px; padding:0 2px; box-decoration-break:clone; -webkit-box-decoration-break:clone; }
/* Per-message meta footer: every finalized chat bubble (user question or
   OrbitOracle.AI answer — live, cached, offline, or restored from history) ends with
   a slim meta row holding the timestamp on the left and a right-aligned
   action group: one-tap Copy on every bubble, plus one-tap 📝 Simplify
   (v64) on OrbitOracle.AI answers, so users can lift any message out of the chat
   or ask for a plain-language version of an answer. */
.msg-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:7px; flex-wrap:wrap; }
.message .bubble .msg-foot .timestamp { margin-top:0; text-align:left; }
.msg-copy-btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex-shrink:0; min-height:28px; background:none; border:1px solid transparent; color:var(--text-3); font-family:inherit; font-size:11px; font-weight:600; line-height:1; padding:0 9px; border-radius:8px; cursor:pointer; opacity:0.85; transition:background .15s, color .15s, border-color .15s, opacity .15s, transform .1s; touch-action:manipulation; }
.msg-copy-btn .msg-copy-ico { font-size:12.5px; line-height:1; }
.msg-copy-btn:hover { opacity:1; color:var(--text-2); background:var(--bg-active); border-color:var(--line); }
.msg-copy-btn:active { transform:scale(0.94); }
.message.user .msg-copy-btn { color:rgba(255,255,255,0.7); }
.message.user .msg-copy-btn:hover { color:#fff; background:rgba(255,255,255,0.16); border-color:rgba(255,255,255,0.28); }
.msg-actions { display:inline-flex; align-items:center; gap:6px; flex-wrap:wrap; }
.msg-simplify-btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex-shrink:0; min-height:28px; background:none; border:1px solid transparent; color:var(--text-3); font-family:inherit; font-size:11px; font-weight:600; line-height:1; padding:0 9px; border-radius:8px; cursor:pointer; opacity:0.85; transition:background .15s, color .15s, border-color .15s, opacity .15s, transform .1s; touch-action:manipulation; }
.msg-simplify-btn .msg-simplify-ico { font-size:12.5px; line-height:1; }
.msg-simplify-btn:hover { opacity:1; color:var(--accent-hi); background:var(--bg-active); border-color:var(--line); }
.msg-simplify-btn:active { transform:scale(0.94); }
/* 🔊 Read aloud (v52): same chip as its siblings, plus a speaking state so the
   reader can see which answer is currently being read and that a second press
   will stop it. Without this rule the chip would be an unstyled button — the
   exact failure the vault-hint test looks for. */
.msg-speak-btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex-shrink:0; min-height:28px; background:none; border:1px solid transparent; color:var(--text-3); font-family:inherit; font-size:11px; font-weight:600; line-height:1; padding:0 9px; border-radius:8px; cursor:pointer; opacity:0.85; transition:background .15s, color .15s, border-color .15s, opacity .15s, transform .1s; touch-action:manipulation; }
.msg-speak-btn .msg-speak-ico { font-size:12.5px; line-height:1; }
.msg-speak-btn:hover { opacity:1; color:var(--accent-hi); background:var(--bg-active); border-color:var(--line); }
.msg-speak-btn:active { transform:scale(0.94); }
.msg-speak-btn.is-speaking { opacity:1; color:var(--ok); border-color:var(--ok); background:var(--ok-soft); }
.msg-highlight-btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex-shrink:0; min-height:28px; background:none; border:1px solid transparent; color:var(--text-3); font-family:inherit; font-size:11px; font-weight:600; line-height:1; padding:0 9px; border-radius:8px; cursor:pointer; opacity:0.85; transition:background .15s, color .15s, border-color .15s, opacity .15s, transform .1s; touch-action:manipulation; }
.msg-highlight-btn .msg-highlight-ico { font-size:12.5px; line-height:1; }
.msg-highlight-btn:hover { opacity:1; color:#ffd166; background:var(--bg-active); border-color:var(--line); }
.msg-highlight-btn:active { transform:scale(0.94); }
.message.user .msg-highlight-btn { color:rgba(255,255,255,0.7); }
.message.user .msg-highlight-btn:hover { color:#ffd166; background:rgba(255,255,255,0.16); border-color:rgba(255,255,255,0.28); }
/* Clear-highlights (v68): the 🧹 Clear action beside Highlight strips every
   yellow mark out of one message. Coral hover reads as "removal" on every
   skin; JS hides the button until the bubble actually has marks. */
.msg-clear-btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex-shrink:0; min-height:28px; background:none; border:1px solid transparent; color:var(--text-3); font-family:inherit; font-size:11px; font-weight:600; line-height:1; padding:0 9px; border-radius:8px; cursor:pointer; opacity:0.85; transition:background .15s, color .15s, border-color .15s, opacity .15s, transform .1s; touch-action:manipulation; }
.msg-clear-btn .msg-clear-ico { font-size:12.5px; line-height:1; }
.msg-clear-btn:hover { opacity:1; color:#ff8fa3; background:var(--bg-active); border-color:var(--line); }
.msg-clear-btn:active { transform:scale(0.94); }
.message.user .msg-clear-btn { color:rgba(255,255,255,0.7); }
.message.user .msg-clear-btn:hover { color:#ff8fa3; background:rgba(255,255,255,0.16); border-color:rgba(255,255,255,0.28); }
/* ---- Level Up (interactive depth rewrite, every OrbitOracle.AI answer) ----
   Under each finished OrbitOracle.AI answer a slim row of depth chips
   (Summary · Deconstruct · History · Data · ELI5 · Spark) lets the
   reader rewrite THAT answer in a chosen style, in place. The active
   depth is highlighted; a dashed "Original" chip restores the
   pre-rewrite text. Chips use the app's CSS variables so every skin
   stays coherent, and sit between the answer and its meta footer. */
.msg-lu { display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin-top:8px; padding-top:8px; border-top:1px dashed var(--line); max-width:100%; }
/* The chips INSIDE an answer's Level Up box. They used to be drawn like disabled controls —
   transparent fill, --text-3, opacity .9 — and the operator read them exactly that way ("the
   buttons are listed there but greyed out"). A control that is available must not be painted like
   one that is not: same visual language as the composer's .quick-chip. The busy state (below)
   still dims them, which is the only dimming that MEANS something. */
.msg-lu-btn, .msg-lu-orig { display:inline-flex; align-items:center; justify-content:center; gap:4px; flex-shrink:0; background:var(--bg-active); border:1px solid var(--line); border-radius:8px; color:var(--text-2); font-family:inherit; font-size:10.5px; font-weight:600; line-height:1.3; padding:4px 8px; cursor:pointer; transition:background .15s, color .15s, border-color .15s, opacity .15s, transform .1s; touch-action:manipulation; }
.msg-lu-btn:hover { opacity:1; color:var(--accent-hi); border-color:var(--accent-line); background:var(--bg-active); }
.msg-lu-btn:active { transform:scale(.95); }
.msg-lu-btn.is-on { opacity:1; background:var(--accent-soft); border-color:var(--accent); color:var(--accent-hi); }
.msg-lu-orig { border-style:dashed; }
.msg-lu-orig:hover { opacity:1; color:var(--text); border-color:var(--line-strong); background:var(--bg-active); }
.msg-lu.is-busy .msg-lu-btn, .msg-lu.is-busy .msg-lu-orig { opacity:.45; cursor:default; }
.msg-lu-status { font-size:10px; color:var(--text-4); }
/* ---- Level Up disclosure --------------------------------------------------------
   The twelve rewrite chips used to sit in the open under every answer and wrap onto three
   or four lines on a narrow screen, pushing the answer itself off the fold. They now live
   behind one control. Tap-first, because hover does not exist on touch and this ships as
   an installable PWA; in flow rather than absolutely positioned, so it cannot be clipped
   by the chat scroller or have to negotiate the modal z-index ladder. */
.msg-lu-toggle { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex-shrink:0; min-height:26px; background:var(--bg-active); border:1px solid var(--line); color:var(--text-2); font-family:inherit; font-size:11px; font-weight:600; line-height:1; padding:0 10px; border-radius:999px; cursor:pointer; transition:background .15s, color .15s, border-color .15s, opacity .15s; }
.msg-lu-toggle:hover { opacity:1; color:var(--accent-hi); border-color:var(--accent-line); background:var(--bg-active); }
.msg-lu-toggle:active { transform:scale(.96); }
.msg-lu-toggle[aria-expanded="true"] { opacity:1; color:var(--accent-hi); background:var(--bg-active); border-color:var(--accent); }
/* width:100% drops the panel onto its own line inside .msg-lu, which already wraps. */
.msg-lu-menu { display:flex; flex-wrap:wrap; align-items:center; gap:4px; width:100%; margin-top:6px; }
/* An explicit display defeats the hidden attribute, so it is restated here. This repo has
   already been bitten once by "the hidden attribute without the CSS that makes it work" -
   without this line the panel would never actually hide. */
.msg-lu-menu[hidden] { display:none; }
/* ---- Level Up: the STACK (v123) ----------------------------------------------------
   One menu, two kinds of chip, and the CSS states which is which, because they mean
   different things: a DEPTH chip is a LAUNCHER and `.is-on` says "the rewrite on screen came
   from me"; a MOOD chip is a TOGGLE and `.is-sel` (+ aria-pressed) says "I am in the stack" —
   a fact about the READER, not about the answer. Sharing one class for two meanings is how a
   toggle ends up looking like a rewrite that is already showing while it is only waiting to be
   used, which is the same class of defect as the two boxes that once shared one name. */
.msg-lu-btn[data-mood] { border-style:dashed; }
.msg-lu-btn.is-sel { opacity:1; background:var(--accent-soft); border-color:var(--accent); color:var(--accent-hi); }
/* The line that names the stack. It is the only place the ORDER the reader picked is visible,
   and the order is what the request does with them ("a haiku, in pirate voice" is a different
   answer from "a pirate, in haiku"), so it wraps instead of truncating. */
.msg-lu-stack { flex-basis:100%; font-size:10.5px; color:var(--text-4); line-height:1.4; overflow-wrap:anywhere; }
.msg-lu-stack[hidden] { display:none; }
/* The reader's switch, on both surfaces. Same family as the disclosure pill it sits beside, and
   it states its own state to a screen reader (role="switch" + aria-checked) rather than by
   colour alone. */
.msg-lu-always, .lu-always { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex-shrink:0; min-height:30px; background:var(--bg-active); border:1px solid var(--line); color:var(--text-3); font-family:inherit; font-size:11px; font-weight:600; line-height:1; padding:0 11px; border-radius:999px; cursor:pointer; opacity:.9; transition:background .15s, color .15s, border-color .15s, opacity .15s, transform .1s; touch-action:manipulation; }
.msg-lu-always:hover, .lu-always:hover { opacity:1; color:var(--text); border-color:var(--line-strong); }
.msg-lu-always:active, .lu-always:active { transform:scale(.96); }
.msg-lu-always.is-on, .lu-always.is-on { opacity:1; background:var(--accent-soft); border-color:var(--accent); color:var(--accent-hi); }
.msg-lu-always[aria-checked="true"], .lu-always[aria-checked="true"] { opacity:1; color:var(--accent-hi); border-color:var(--accent); }
/* The composer box's own row for that switch, and the line under it that carries the STATE. */
.uplevel-always-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:8px; }
.uplevel-always-hint { margin:0; font-size:12px; color:var(--text-4); line-height:1.4; flex:1 1 auto; min-width:0; }
/* The mark on the collapsed dock: the one signal a reader gets, with the box shut, that every
   new answer is being shaped. Not a control — nothing to press — so it carries no size rule. */
.uplevel-always-flag { margin-left:4px; font-size:11px; line-height:1; }
.uplevel-always-flag[hidden] { display:none; }
.msg-lu.is-busy .msg-lu-toggle { opacity:.45; cursor:default; }
/* ---- 🖍️ Highlight actions (v92) -------------------------------------------------
   One panel that does any combination of what you want with the text you marked, instead of
   seven more buttons crowding the footer. Same disclosure mechanics as the Level Up panel:
   tap-first, in flow, and the panel restates [hidden] because it is display:flex. */
.msg-hl-actions { margin-top:8px; padding-top:8px; border-top:1px dashed var(--line); }
.msg-hl-actions[hidden] { display:none; }
.msg-hl-actions-toggle { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex-shrink:0; min-height:26px; background:none; border:1px solid var(--line); color:var(--text-3); font-family:inherit; font-size:11px; font-weight:600; line-height:1; padding:0 10px; border-radius:999px; cursor:pointer; opacity:.9; transition:background .15s, color .15s, border-color .15s, opacity .15s; }
.msg-hl-actions-toggle:hover { opacity:1; color:#ffd166; border-color:var(--accent-line); background:var(--bg-active); }
.msg-hl-actions-toggle:active { transform:scale(.96); }
.msg-hl-actions-toggle[aria-expanded="true"] { opacity:1; color:#ffd166; background:var(--bg-active); border-color:var(--accent); }
/* THE WORD GLOWS, so a reader who has just marked a passage can see that the mark connected them to
   something. The operator asked for exactly this: "I want the word Actions to glow yellow to draw the
   user to it and intuitively let them know that they are connected functions."
   Yellow is already this app's highlight colour (#ffd166 is the mark, the flash on jump-back, and the
   colour this button turns on hover), so the glow says "this is about the thing you marked" instead of
   introducing a new signal. It also carries the meaning without colour alone: the glow is a glow, and
   the sentence "Highlight actions" is on the button's aria-label either way.
   The breath is slow (2.8s) and it is switched off entirely by the global
   `@media (prefers-reduced-motion:reduce)` rule — the colour and the static glow stay. */
.msg-hl-actions-word { color:#ffd166; font-weight:800; letter-spacing:.2px; text-shadow:0 0 5px rgba(255,209,102,.5), 0 0 13px rgba(255,209,102,.22); }
.msg-hl-actions-toggle:hover .msg-hl-actions-word, .msg-hl-actions-toggle:focus-visible .msg-hl-actions-word { text-shadow:0 0 9px rgba(255,209,102,.85), 0 0 20px rgba(255,209,102,.42); }
@keyframes orbitActionsGlow {
    0%, 100% { text-shadow:0 0 5px rgba(255,209,102,.45), 0 0 12px rgba(255,209,102,.20); }
    50% { text-shadow:0 0 9px rgba(255,209,102,.85), 0 0 20px rgba(255,209,102,.42); }
}
.msg-hl-actions-word { animation:orbitActionsGlow 2.8s ease-in-out infinite; }
.msg-hl-actions-panel { display:flex; flex-direction:column; gap:1px; margin-top:7px; }
.msg-hl-actions-panel[hidden] { display:none; }
.msg-hl-act { display:flex; align-items:center; gap:8px; font-size:11.5px; color:var(--text-2); padding:3px 2px; cursor:pointer; border-radius:6px; }
.msg-hl-act:hover { background:var(--bg-active); }
.msg-hl-act input { accent-color:var(--accent); width:14px; height:14px; flex-shrink:0; cursor:pointer; margin:0; }
.msg-hl-act-lbl { line-height:1.35; }
.msg-hl-formats { display:flex; flex-wrap:wrap; gap:12px; margin-top:6px; padding-top:7px; border-top:1px solid var(--line); }
.msg-hl-apply { align-self:flex-start; margin-top:8px; min-height:28px; padding:0 15px; border-radius:999px; border:1px solid var(--accent); background:var(--accent-soft); color:var(--accent-hi); font-family:inherit; font-size:11.5px; font-weight:700; cursor:pointer; }
.msg-hl-apply:hover { background:var(--bg-active); }
.msg-hl-apply:active { transform:scale(.96); }
/* ---- 🖍️ My Highlights index (v93) ------------------------------------------------
   The anchors read back together, grouped by the project they were marked in. Rows are buttons
   so the whole quote is the jump-back target, not a small link beside it. */
.hl-idx-actions { display:flex; flex-wrap:wrap; gap:8px; margin:2px 0 12px; }
.hl-idx-group { font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--text-4); margin:12px 0 6px; }
.hl-idx-list { display:flex; flex-direction:column; gap:4px; max-height:52vh; overflow-y:auto; }
.hl-idx-row { display:flex; align-items:flex-start; gap:8px; }
.hl-idx-quote { flex:1; text-align:left; background:none; border:1px solid transparent; border-radius:8px; color:var(--text-2); font-family:inherit; font-size:12.5px; line-height:1.45; padding:7px 9px; cursor:pointer; }
.hl-idx-quote:hover { background:var(--bg-active); border-color:var(--line); color:var(--text); }
.hl-idx-del { flex-shrink:0; background:none; border:1px solid transparent; color:var(--text-4); font-size:11px; line-height:1; padding:8px 7px; border-radius:8px; cursor:pointer; }
.hl-idx-del:hover { color:#ff8fa3; border-color:var(--line); background:var(--bg-active); }
/* The flash that shows which message a jump landed on. Motion is the point, so it is the one
   thing that must not be reduced away silently - a reader who asked to be taken somewhere needs
   to see where. */
@keyframes hlIdxFlash { 0%,100% { background:transparent; } 30% { background:rgba(255,209,102,.22); } }
.hl-idx-flash { animation:hlIdxFlash 1.6s ease; border-radius:12px; }

/* ---- Mentor chat engine -----------------------------------------
   The quiet second line under a user chat message — chat line + mentor
   evaluation line. When analyzeSignals() reads a weakness or strength
   signal in the learner's message, a slim Mentor note is drawn under the
   chat text (and above the meta footer). Chrome, not content: it is never
   stored in history and Copy / Highlight skip it like the footer. */
.mentor-note { margin-top:8px; padding-top:8px; border-top:1px dashed rgba(255,255,255,0.28); font-size:12px; line-height:1.5; color:var(--text-3); }
.message.user .bubble .mentor-note { color:rgba(255,255,255,0.92); }
.mentor-note-text { display:block; min-width:0; overflow-wrap:anywhere; word-wrap:break-word; }
.message.bot .bubble .mentor-note { border-top-color:var(--line); }

/* ---- Mentor Mode: synthesis line + progress readout (v8) ---------
   Pillar 2 paints a "Synthesis" link line on an OrbitOracle.AI answer whose
   question crossed subjects, and pillar 3 paints the adaptive mentor
   line (reusing .mentor-note). Both are chrome like the footer: never
   stored, and skipped by Copy / Simplify / Highlight. */
.mentor-synthesis { margin-top:8px; padding-top:8px; border-top:1px dashed var(--accent-line); font-size:12px; line-height:1.5; color:var(--text-3); }
.mentor-synthesis-text { display:block; min-width:0; overflow-wrap:anywhere; word-wrap:break-word; }
.mentor-mode-profile { border-top:1px dashed var(--line-strong); padding-top:10px; }
.mentor-mode-line { color:var(--text-2); font-size:12.5px; line-height:1.6; margin:0 0 8px; }

/* ---- Welcome / empty state ---------------------------------------------
   Rendered by script.js when there is no chat history: OrbitOracle.AI's welcome
   message (the first bubble), a one-line empty-state note, and tappable
   suggestion chips so a brand-new visitor knows exactly what to do next. */
.welcome-hero { display:flex; flex-direction:column; align-items:center; gap:14px; padding:26px 0 18px; animation:fadeIn .3s ease; }
.welcome-hero .message { max-width:100%; width:100%; }
.welcome-hero .message .bubble { width:fit-content; max-width:100%; }
.welcome-note { font-size:12.5px; color:var(--text-4); text-align:center; line-height:1.5; }
.welcome-chips { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.sugg-chip { display:inline-flex; align-items:center; gap:7px; background:var(--bg-raise); border:1px solid var(--line-strong); color:var(--text-2); font-size:13px; font-weight:600; font-family:inherit; padding:10px 15px; min-height:44px; border-radius:22px; cursor:pointer; transition:border-color .15s, background .15s, color .15s, transform .1s; touch-action:manipulation; }
.sugg-chip:hover { border-color:var(--accent-line); color:var(--text); background:var(--bg-hover); }
.sugg-chip:active { transform:scale(0.96); }
.sugg-chip .chip-emoji { font-size:15px; }

/* ---- Footer / composer dock --------------------------------------------
   The composer is a rounded dock: quick-tool row (Image · Task · Coach),
   then the input + send row, then a slim meta row (uploading state left,
   keyboard hint right). The input is ≥56px tall and shows a focused
   placeholder so value is obvious at a glance. */
footer { padding:12px calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal)); background:var(--bg-raise); border-top:1px solid var(--line); display:flex; flex-direction:column; gap:8px; flex-shrink:0; align-items:stretch; }
.composer-dock { display:flex; flex-direction:column; gap:8px; background:var(--bg-inset); border:1px solid var(--line-strong); border-radius:20px; padding:8px; transition:border-color .2s, box-shadow .2s; }
.composer-dock:focus-within { border-color:var(--accent-line); box-shadow:0 0 0 3px var(--accent-soft); }
/* The composer's tools, INSIDE the 🚀 Level Up box. They used to be their own standing row above
   it — 40px of every screen for buttons a reader needs occasionally. In here they WRAP rather than
   scroll horizontally: a row clipped inside an open box is a row the reader cannot finish. */
.uplevel-tools { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.quick-chip { display:inline-flex; align-items:center; gap:6px; flex-shrink:0; background:var(--bg-active); border:1px solid var(--line); color:var(--text-2); font-size:12.5px; font-weight:600; font-family:inherit; padding:8px 13px; min-height:44px; border-radius:16px; cursor:pointer; transition:background .15s, border-color .15s, color .15s, transform .1s; touch-action:manipulation; }
.quick-chip:hover { border-color:var(--accent-line); color:var(--text); }
.quick-chip:active { transform:scale(0.96); background:var(--bg-hover); }
.quick-chip .qc-emoji { font-size:15px; line-height:1; }
/* 🌐 Search while it is running (v121). The glyph spins and the chip says so in words too:
   a search takes tens of seconds, and a button that looks untouched for a minute is a
   button the reader presses again. The label is swapped by script and restored from the
   same i18n key, so the two never drift. */
.quick-chip.is-busy .qc-emoji { animation:searchSpin 1.6s linear infinite; }
@keyframes searchSpin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .quick-chip.is-busy .qc-emoji { animation:none; } }

/* ---- what a search answer carries: its sources (v121) ---- */
.search-sources { margin-top:10px; padding-top:9px; border-top:1px dashed var(--line); }
.search-src-title { font-size:12px; font-weight:600; color:var(--text-2); margin-bottom:6px; }
.search-src-list { display:flex; flex-direction:column; gap:4px; }
.search-src { display:flex; align-items:center; gap:7px; min-width:0; font-size:12.5px; }
.search-src-link { color:var(--accent); text-decoration:none; border-bottom:1px dotted var(--accent-line);
  overflow-wrap:anywhere; word-break:break-word; min-width:0; }
.search-src-link:hover { border-bottom-style:solid; }
/* A tick marks a page the ANSWER actually leaned on. Read and used are different claims and
   the list would merge them without this. */
.search-src-tag { flex-shrink:0; font-size:11px; color:var(--accent); }
.search-src-loose { color:var(--text-2); overflow-wrap:anywhere; }
.search-src-unverified { margin-top:8px; font-size:12px; color:var(--text-2); }
.search-src-unverified > summary { cursor:pointer; font-weight:600; touch-action:manipulation; }
.search-src-note { margin:6px 0; line-height:1.5; }
/* 44px on a coarse pointer, same rule as every other control under a message: the disclosure
   row and the source links are BOTH tap targets on a phone. */
@media (pointer:coarse) {
  .search-src-unverified > summary { min-height:44px; display:flex; align-items:center; }
  .search-src-link { display:inline-flex; align-items:center; min-height:44px; }
}
.composer-row { display:flex; gap:8px; align-items:flex-end; width:100%; min-width:0; }
#chatInput { flex:1 1 auto; min-width:0; min-height:56px; resize:none; overflow-y:auto; max-height:180px; padding:14px 16px; border:1px solid transparent; border-radius:16px; background:var(--bg-raise); color:var(--text); font-size:16px; font-family:inherit; line-height:1.55; outline:none; -webkit-appearance:none; appearance:none; transition:background .2s; }
#chatInput::placeholder { color:var(--text-4); }
#chatInput:focus { background:var(--bg); }
.composer-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:20px; padding:0 4px 2px; }
/* Governing documents on the launch screen (index.html). Legal copy is English by
   policy, exactly like the first-run gate's own links. */
.composer-legal { display:flex; align-items:center; justify-content:center; gap:7px; padding:1px 4px 4px; font-size:11.5px; }
.composer-legal a { color:var(--text-3); text-decoration:none; }
.composer-legal a:hover, .composer-legal a:focus-visible { color:var(--accent); text-decoration:underline; }
.composer-legal span { color:var(--text-4); }
/* Uplevel per-message depth picker (composer): the shape of the NEXT answer — 🚀 icon + a
   transparent select — INSIDE the same box that holds the tools. Same visual language as
   quick-chip (one press on the summary drops all of it down; the select inside is the only
   second control, and it is the axis the reader is choosing, not a place to find the tools). */
.uplevel-nest { align-self:flex-start; max-width:100%; }
.uplevel-summary { display:inline-flex; align-items:center; gap:6px; max-width:100%; list-style:none; cursor:pointer; background:var(--bg-active); border:1px solid var(--line); border-radius:999px; padding:7px 12px; font-size:12.5px; font-weight:600; color:var(--text-2); transition:border-color .15s, color .15s; }
.uplevel-summary::-webkit-details-marker { display:none; }
.uplevel-summary:hover { color:var(--text); border-color:var(--line-strong); }
.uplevel-summary:focus-visible { outline:none; box-shadow:0 0 0 2px var(--accent-soft); border-color:var(--accent-line); }
.uplevel-summary::before { content:'▸'; font-size:10px; line-height:1; opacity:.75; }
.uplevel-nest[open] > .uplevel-summary { margin-bottom:6px; color:var(--text); border-color:var(--accent-line); }
.uplevel-nest[open] > .uplevel-summary::before { content:'▾'; }
.uplevel-row { display:flex; align-items:center; gap:6px; align-self:flex-start; max-width:100%; background:var(--bg-active); border:1px solid var(--line); border-radius:999px; padding:2px 10px 2px 8px; transition:border-color .15s; }
.uplevel-row:focus-within { border-color:var(--accent-line); }
.uplevel-icon { font-size:13px; line-height:1; }
/* A NATIVE <select> HAS TWO SURFACES: the control in the page, and the popup the BROWSER paints.
   This one had `background:transparent` on the select AND no background at all on its options, so
   the eight shapes opened onto a surface the page never coloured — the list kept this theme's
   near-white text while the popup's background was the system's, so the options looked greyed out and
   washed to the operator while remaining perfectly selectable. Both surfaces are painted here now:
   the control keeps the pill's own colour, and each option carries its own. */
.uplevel-select { background:var(--bg-active); border:none; color:var(--text); font-family:inherit; font-size:12.5px; font-weight:600; padding:6px 0; cursor:pointer; color-scheme:dark; outline:none; }
.uplevel-select option { background:var(--bg-inset); color:var(--text); }
.uplevel-select:hover { color:var(--text-2); }
.uplevel-select:focus-visible { box-shadow:0 0 0 2px var(--accent-soft); border-radius:8px; }
.uploading-chip { display:inline-flex; align-items:center; gap:8px; font-size:12px; color:var(--accent-hi); font-weight:600; }
.uploading-chip .spinner { width:14px; height:14px; border-radius:50%; border:2px solid var(--accent-soft); border-top-color:var(--accent); animation:spin .7s linear infinite; }
.composer-hint { font-size:11.5px; color:var(--text-4); text-align:right; }
.composer-hint kbd { display:inline-block; background:var(--bg-active); border:1px solid var(--line-strong); border-bottom-width:2px; border-radius:5px; padding:1px 6px; font-family:inherit; font-size:10.5px; color:var(--text-2); }
.send-btn { width:52px; height:52px; min-width:52px; border-radius:50%; background:linear-gradient(135deg, var(--accent-lo), var(--accent)); border:none; color:#fff; font-size:22px; cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:transform .15s, opacity .15s, filter .2s; touch-action:manipulation; box-shadow:0 4px 14px rgba(31,111,235,.35); }
.send-btn:hover:not(:disabled) { filter:brightness(1.1); }
.send-btn:active { transform:scale(0.92); opacity:0.85; }
.send-btn:disabled { opacity:0.4; cursor:not-allowed; box-shadow:none; }

/* Send / Stop combo (v75 — the composer's ONE action button; script.js toggles
   .stopping while a reply streams). Idle glyph is ➤; the stop glyph is a white
   rounded square (DeepSeek-style) and the button goes red. The
   body[data-skin] rule out-specifies each skin's #sendBtn accent glow. */
.send-btn .send-glyph { display:inline-block; line-height:1; }
.send-btn .stop-glyph { display:none; width:16px; height:16px; border-radius:3px; background:#fff; }
.send-btn.stopping .send-glyph { display:none; }
.send-btn.stopping .stop-glyph { display:block; }
.send-btn.stopping,
body[data-skin] #sendBtn.stopping { background:linear-gradient(135deg, #d1382f, #f85149); box-shadow:0 4px 14px rgba(248,81,73,.4); color:#fff; }
.send-btn.stopping:hover:not(:disabled) { filter:brightness(1.1); }
.send-btn.stopping:focus-visible { outline:2px solid #f85149; outline-offset:2px; }

/* Image attach preview bar (staged image above the dock). */
.img-preview-bar { display:flex; align-items:center; gap:10px; padding:8px 10px; background:var(--accent-soft); border:1px solid var(--accent-line); border-radius:14px; animation:fadeIn 0.2s ease; }
.img-preview-bar img { width:44px; height:44px; border-radius:9px; object-fit:cover; flex-shrink:0; background:var(--bg-inset); border:1px solid var(--accent-line); }
.img-preview-meta { flex:1; min-width:0; }
.img-preview-name { display:block; font-size:12.5px; color:var(--accent-hi); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.img-preview-hint { display:block; font-size:11px; color:var(--text-4); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.img-remove { flex-shrink:0; background:none; border:none; color:var(--text-3); font-size:16px; line-height:1; cursor:pointer; width:44px; height:44px; border-radius:10px; display:flex; align-items:center; justify-content:center; transition:background .15s, color .15s; }
.img-remove:hover { color:var(--danger); background:var(--danger-soft); }

/* Prompt cache (ported from the desktop console): prompts typed while OrbitOracle.AI
   is still answering are held in a small on-screen FIFO queue of removable
   chips above the composer, then auto-sent one at a time as each task
   finishes. #promptCacheBar is display:none while the queue is empty. */
.promptcache-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 10px; background:var(--bg-inset); border:1px dashed var(--accent-line); border-radius:14px; animation:fadeIn 0.2s ease; }
.promptcache-label { flex-shrink:0; font-size:11px; font-weight:800; letter-spacing:0.08em; color:var(--accent-hi); text-transform:uppercase; }
#promptCacheList { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; }
.promptcache-chip { display:inline-flex; align-items:center; gap:7px; max-width:44vw; padding:6px 8px 6px 11px; border-radius:999px; font-size:12px; color:var(--text); background:var(--bg-raise); border:1px solid var(--accent-line); }
.promptcache-text { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.promptcache-text:hover { color:var(--accent-hi); }
.promptcache-x { border:none; background:transparent; color:var(--text-3); cursor:pointer; font-size:12px; line-height:1; padding:2px 4px; border-radius:6px; font-family:inherit; }
.promptcache-x:hover { color:var(--danger); background:var(--danger-soft); }
.promptcache-clear { border:1px solid var(--accent-line); background:transparent; color:var(--text-3); cursor:pointer; font-size:11px; font-weight:700; padding:5px 9px; border-radius:999px; font-family:inherit; transition:color .15s, border-color .15s; }
.promptcache-clear:hover { color:var(--text); border-color:var(--accent); }

/* Sent image thumbnails inside a user chat bubble. */
.message.user .bubble .img-attach { display:block; max-width:240px; max-height:240px; width:auto; height:auto; border-radius:10px; object-fit:cover; border:1px solid rgba(255,255,255,0.25); margin:0 0 6px; background:rgba(0,0,0,0.2); }
.message.user .bubble .usr-text { margin-top:2px; overflow-wrap:anywhere; word-wrap:break-word; }

/* Full-screen drag-and-drop overlay. */
.drop-overlay { position:fixed; inset:0; z-index:1400; display:flex; align-items:center; justify-content:center; background:rgba(1,4,9,0.8); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); pointer-events:none; }
.drop-overlay .drop-box { padding:34px 46px; border:2px dashed var(--accent-line); border-radius:18px; color:var(--text-2); font-size:16px; font-weight:600; letter-spacing:0.3px; text-align:center; background:var(--accent-soft); box-shadow:0 0 26px rgba(88,166,255,0.18), inset 0 0 22px rgba(88,166,255,0.08); }
.drop-overlay .drop-box span { margin-left:6px; }

/* ---- Loading state: "Thinking…" + animated dots -----------------------
   The pending bot bubble shows a "Thinking…" label followed by three
   bouncing dots; the first streamed token replaces the dots in place. */
.typing { display:flex; gap:5px; padding:6px 0 8px; align-items:center; color:var(--text-3); }
.typing .typing-label { font-size:14px; color:var(--text-3); margin-right:6px; letter-spacing:.2px; }
.typing .dot { width:7px; height:7px; background:var(--accent); border-radius:50%; animation:typing 1.2s infinite; }
.typing .dot:nth-child(2) { animation-delay:0s; }
.typing .dot:nth-child(3) { animation-delay:0.2s; }
.typing .dot:nth-child(4) { animation-delay:0.4s; }
@keyframes typing { 0%,60%,100% { transform:translateY(0); opacity:.5; } 30% { transform:translateY(-7px); opacity:1; } }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ---- Real-time progress line -------------------------------------------
   While the harness works on an answer, {"k":"status"} SSE frames render
   the CURRENT step as this pulsing line inside the pending bubble, so the
   user watches live progress for a task — never a frozen "working…". */
.status-message { display:flex; align-items:center; gap:8px; margin:2px 0 6px; padding:6px 10px; border:1px solid var(--accent-line); border-left:3px solid var(--accent); border-radius:10px; background:var(--accent-soft); color:var(--accent-hi); font-size:12.5px; line-height:1.45; letter-spacing:0.2px; animation:statusIn 0.25s ease; }
.status-message .status-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); box-shadow:0 0 8px rgba(88,166,255,0.8); flex-shrink:0; margin:0; animation:statusPulse 1.1s ease-in-out infinite; }
.status-message .status-text { min-width:0; }

/* ---- 🌐 the processing trace (orbit_steps.js) ----------------------------------------------------
   The trace is a SIBLING of the answer bubble, inside the message row and NEVER inside the bubble:
   paintReply() rewrites the bubble's innerHTML on every paint, so anything in there is wiped by the
   first one. `order:-1` plus a full-width basis puts it ABOVE the answer it belongs to — the order the
   reader actually lived through — and `.has-orbit-trace` turns wrapping on for THAT ROW ALONE, so no
   message without a trace changes shape. */
.message.has-orbit-trace { flex-wrap: wrap; }
.message .orbit-trace {
  flex-basis: 100%; order: -1; min-width: 0; max-width: 100%;
  margin: 0 0 6px 44px; padding: 8px 10px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent-line);
  border-radius: 10px; background: var(--bg-inset);
  font-size: 12px; line-height: 1.5; color: var(--text-2);
  animation: statusIn 0.25s ease;
}
/* No step arrived -> no empty box. The module writes attributes, not children, on an untouched host. */
.message .orbit-trace:empty { display: none; }
.orbit-step { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.orbit-step-icon { flex: 0 0 auto; width: 14px; text-align: center; opacity: 0.9; }
.orbit-step-label { flex: 0 0 auto; color: var(--text); font-weight: 600; }
.orbit-step-detail { flex: 1 1 auto; min-width: 0; color: var(--text-2); overflow-wrap: anywhere; }
.orbit-step-ms { flex: 0 0 auto; color: var(--text-4); font-variant-numeric: tabular-nums; }
.orbit-step.is-fail .orbit-step-label { color: var(--danger); }
.orbit-step-done .orbit-step-label { color: var(--ok); }
/* COLLAPSED: the module sets data-collapsed ONCE on `done`, and only the closing row stays visible —
   a one-line "what ran" summary. Tapping re-opens it, and nothing re-collapses a trace a reader opened
   (the module's own finish() is the guard that makes that true). */
.orbit-trace[data-collapsed="1"] { cursor: pointer; }
.orbit-trace[data-collapsed="1"] .orbit-step { display: none; }
.orbit-trace[data-collapsed="1"] .orbit-step:last-child { display: flex; }
/* A phone spends its width carefully: the trace takes the bubble's own indent budget rather than adding
   a second one, and never forces a horizontal scrollbar. */
@media (max-width: 480px) {
  .message .orbit-trace { margin-left: 0; font-size: 11.5px; }
}
@keyframes statusPulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.35; transform:scale(0.72); } }
@keyframes statusIn { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:translateY(0); } }

/* ---- Markdown-rendered bot bubbles -------------------------------------- */
.bubble p { margin:6px 0; line-height:1.6; }
.bubble p:first-child { margin-top:0; }
.bubble p:last-child { margin-bottom:0; }
.bubble h1, .bubble h2, .bubble h3, .bubble h4, .bubble h5, .bubble h6 { margin:10px 0 4px; color:var(--text); line-height:1.3; font-weight:700; }
.bubble h1 { font-size:18px; } .bubble h2 { font-size:16px; } .bubble h3 { font-size:15px; }
.bubble h4, .bubble h5, .bubble h6 { font-size:14px; }
.bubble ul, .bubble ol { margin:6px 0; padding-left:22px; }
.bubble li { margin:3px 0; line-height:1.55; }
.bubble blockquote { margin:6px 0; padding:6px 12px; border-left:3px solid var(--accent); background:var(--accent-soft); border-radius:0 8px 8px 0; color:var(--text-2); }
.bubble a { color:var(--accent-hi); text-decoration:underline; text-decoration-color:var(--accent-line); text-underline-offset:2px; overflow-wrap:anywhere; }
.bubble a:hover { color:#9ecbff; }
.bubble code { font-family:Consolas,'Cascadia Code',Menlo,monospace; font-size:13px; background:var(--accent-soft); border:1px solid var(--accent-line); padding:1px 5px; border-radius:5px; }
.message.user .bubble code { background:rgba(255,255,255,.18); border-color:rgba(255,255,255,.3); color:#fff; }
.bubble .md-pre { position:relative; margin:8px 0; padding:11px 12px; overflow-x:auto; background:var(--bg-inset); border:1px solid var(--accent-line); border-radius:12px; }
.bubble .md-pre code { background:none; border:none; padding:0; font-size:12.5px; line-height:1.6; color:var(--text-2); white-space:pre; }
.bubble .md-pre[data-lang]::after { content:attr(data-lang); position:absolute; top:7px; right:10px; font-size:9.5px; letter-spacing:1.2px; color:var(--accent); opacity:0.85; text-transform:uppercase; pointer-events:none; }

/* ---- Live thinking box (deepseek-v4-pro) ------------------------------- */
.message.bot.thinkmsg { align-self:flex-start; max-width:100%; width:100%; }
.thinkmsg .bubble.thx { padding:0; overflow:hidden; border:1px dashed var(--accent-line); width:100%; max-width:none; }
.thx-head { display:flex; align-items:center; gap:8px; padding:9px 12px; cursor:pointer; user-select:none; }
.thx-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; background:var(--accent); box-shadow:0 0 8px var(--accent); animation:thxPulse 1s ease-in-out infinite; }
.thx-title { font-size:12.5px; color:var(--accent-hi); letter-spacing:0.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.thx-hint { margin-left:auto; font-size:9.5px; letter-spacing:0.8px; text-transform:uppercase; color:var(--text-4); white-space:nowrap; flex-shrink:0; }
.thx-body { max-height:220px; overflow-y:auto; padding:8px 12px 10px; border-top:1px dashed var(--accent-line); font-family:Consolas,'Cascadia Code',Menlo,monospace; font-size:12px; line-height:1.6; color:var(--text-2); background:rgba(88,166,255,0.04); display:block; }
.thx-line { white-space:pre-wrap; word-break:break-word; }
.thx-done .thx-dot { animation:none; background:var(--ok); box-shadow:0 0 8px var(--ok); }
.thx-done .thx-title { color:#7ee2a8; }
.thx-collapsed .thx-body { display:none; }
@keyframes thxPulse { 0%,100% { opacity:1; } 50% { opacity:0.25; } }

::-webkit-scrollbar { width:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--line-strong); border-radius:10px; }

/* ---- THE HEADER WRAPS WHEN IT HAS TO, AND ONLY THEN ---------------------- */
/* The operator asked for this in these words: "one line in larger screens and wrap around in small
   screens". It replaced a solution of mine that let the icon row SCROLL on a narrow phone; the reason
   to prefer the wrap is measurable, and what the measurement turned up is worth reading twice.
   THE MEASUREMENT (2026-09-26, pytmp/_probe_header_room.py, which reuses pytmp/probe_mobile_cdp.py's
   own CDP plumbing, and which grew a "what is actually in the left block" reading precisely because
   this was not what anyone assumed):
       360px viewport, 12px of padding a side       ->  336px usable
       .header-left is 305px, NOT the ~167px of logo + name: it also carries a
       "PRO TRIAL · 14D" chip (112px) and the status dot
       eight 44px icon targets                      ->  352px needed
   So the header holds ~657px of content in 336px, and BEFORE this round it resolved that by
   OVERLAPPING: `.header-left` was crushed to 72px while its 121px name and 112px chip painted over the
   icons. Nothing measured that, because an element overflowing its box is not an element past the
   viewport edge. The fix is the same shape as the request: one line while it fits, wrap when it does
   not, and let the BRAND AND CHIP keep their width instead of being squeezed under their own text.
   NO BREAKPOINT COUNTS THE ICONS, deliberately. `flex-wrap` wraps only when the content does not fit,
   so one line is the DEFAULT rather than a width I guessed, and it self-corrects as the count changes -
   the install button appears when a browser offers an install and the bell appears only with a
   companion. A `max-width` rule would have to be re-measured every time one of those changes; this
   cannot go stale. THE MEASURED RESULT, on pytmp/_probe_header_room.py, header height as the reading:
       1280 -> one line, 85px      800 -> one line, 85px
        900 -> one line, 85px      780 -> TWO lines, 121px
        768 -> two lines, 121px    600 -> two lines, 101px
        480 -> two lines, 93px     360 -> two lines, 137px (brand + TWO icon rows: 7 of 8 fit a row)
        320 -> two lines, 137px
   So: one line from about 800px up, and a second ICON row only on a phone carrying eight icons — seven
   fit one row at 360px, which is the ordinary case, and the eighth is the conditional install button
   that a browser only offers while installing is possible. */
header { flex-wrap:wrap; }
.header-left { flex-shrink:0; }                 /* the brand and the chip are not squeezed */
/* flex-grow is what keeps the icons at the RIGHT edge once they have a line of their own: without it
   the block is only as wide as its icons and a wrapped line puts it at the start, so the toolbar
   appeared under the brand's left edge instead of where every reader already looks for it. */
.header-right { flex:1 1 auto; min-width:0; flex-wrap:wrap; justify-content:flex-end; }

/* ---- Narrow phones ------------------------------------------------------ */
/* THE HEADER ICONS DO NOT SHRINK BELOW THE TOUCH MINIMUM.
   Measured 2026-09-24 with pytmp/probe_mobile_cdp.py at 12 real phone viewports: this block used to
   reduce .icon-btn to 40x40, the foldable block below to 36x36 and the landscape block to 38x38 — so
   the app gave its SMALLEST tap targets to the phones with the LEAST room for error. A narrow header
   is a real problem; the answer is a smaller GLYPH and tighter gaps, never a smaller target. */
@media (max-width:480px) {
    .modal-content { padding:20px 16px; }
    .message .bubble { font-size:14px; padding:10px 14px; }
    #chatContainer { padding:12px 12px 2px; }
    header { padding: calc(10px + var(--sat)) calc(12px + var(--sar)) 10px calc(12px + var(--sal)); }
    footer { padding:8px calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); gap:6px; }
    .composer-dock { gap:6px; padding:6px; border-radius:18px; }
    .uplevel-row { padding:1px 8px 1px 6px; }
    .uplevel-select { font-size:12px; padding:5px 0; }
    .quick-chip { padding:7px 11px; min-height:44px; font-size:12px; }
    #chatInput { padding:13px 14px; min-height:56px; }
    .send-btn { width:50px; height:50px; min-width:50px; }
    .plan-bar { margin:0 calc(12px + var(--sar)) 0 calc(12px + var(--sal)); padding:7px 10px; font-size:11.5px; }
    .subscribe-btn { padding:7px 12px; font-size:12px; }
    .icon-btn { font-size:17px; padding:4px 4px; }
    .header-right { gap:0; }
    .logo { height:28px; width:28px; }
    .img-preview-bar img { width:40px; height:40px; }
    .price-card { padding:14px 14px 12px; }
}

/* ---- Very narrow (foldables / SE-class widths) -------------------------- */
@media (max-width:340px) {
    .header-left { gap:6px; }
    .app-name { font-size:15px; max-width:74px; overflow:hidden; text-overflow:ellipsis; }
    .header-right { gap:0px; flex-shrink:1; }
    .pro-chip { padding:3px 6px; font-size:9px; letter-spacing:.5px; }
    .icon-btn { font-size:15px; padding:4px 2px; }
    .status-dot { margin-left:3px; }
    #chatContainer { gap:8px; padding:8px 8px 2px; }
    .message { gap:8px; max-width:95%; }
    .quick-chip { padding:6px 9px; min-height:44px; font-size:11px; gap:4px; }
    .send-btn { width:48px; height:48px; min-width:48px; }
}

/* ---- Short viewports / landscape phones ---------------------------------- */
@media (max-height:440px) {
    header { padding: calc(6px + var(--sat)) calc(10px + var(--sar)) 6px calc(10px + var(--sal)); }
    .logo { height:24px; width:24px; }
    .app-name { font-size:15px; }
    .icon-btn { font-size:15px; padding:2px 4px; }
    .header-right { gap:0px; }
    #chatContainer { padding:8px 10px 2px; gap:8px; }
    .message { gap:8px; }
    .message .avatar { width:26px; height:26px; font-size:14px; }
    .message .bubble { padding:8px 12px; font-size:14px; }
    footer { padding:6px calc(10px + var(--sar)) calc(8px + var(--sab)) calc(10px + var(--sal)); gap:5px; }
    .composer-dock { gap:5px; padding:5px; }
    .uplevel-tools { gap:5px; }
    .quick-chip { padding:5px 10px; min-height:44px; }
    #chatInput { padding:10px 12px; min-height:48px; max-height:104px; }
    .send-btn { width:44px; height:44px; min-width:44px; font-size:18px; }
    .composer-foot { min-height:0; }
    .img-preview-bar { padding:5px 8px; }
    .img-preview-bar img { width:32px; height:32px; }
    .modal-content { padding:14px 16px; }
    .modal-header { margin-bottom:10px; }
    .modal-header h2 { font-size:20px; }
}

/* ============================================================
   Desktop + polish layer (keyboard, hover, motion, wide screens)
   ============================================================ */

:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; }
.close-btn:focus-visible, .icon-btn:focus-visible, .btn-primary:focus-visible,
.btn-secondary:focus-visible, .btn-danger:focus-visible, .send-btn:focus-visible,
.subscribe-btn:focus-visible, .quick-chip:focus-visible, .sugg-chip:focus-visible,
.price-cta:focus-visible { outline-offset:2px; }

.modal.show .modal-content { animation:modalIn 0.18s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes modalIn { from { opacity:0; transform:translateY(10px) scale(0.985); } to { opacity:1; transform:none; } }

@media (hover:hover) and (pointer:fine) {
    .btn-primary:hover:not(:disabled) { filter:brightness(1.1); box-shadow:0 6px 18px rgba(88,166,255,.25); }
    .btn-secondary:hover { background:var(--bg-hover); }
    .btn-danger:hover { background:rgba(248,81,73,.22); }
    .close-btn:hover { color:var(--text); }
    .project-item { transition:border-color 0.2s, background 0.2s; }
    .project-item:hover { border-color:var(--line-strong); background:var(--bg-hover); }
    ::-webkit-scrollbar { width:8px; height:8px; }
    ::-webkit-scrollbar-thumb { background:var(--line-strong); }
    ::-webkit-scrollbar-thumb:hover { background:#3d444d; }
}

/* Wide screens: float the app as a desktop window. The floating window
   (tall header/footer chrome + 28px vertical margins) only makes sense on
   desktop-shaped viewports. Landscape phones (iPhone 844–932 CSS px wide,
   390–430 px tall; Android 915×412) pass the old width test alone and ended
   up with the desktop chrome on a 430 px tall screen — the composer + header
   swallowed the chat. Gate the desktop shell on BOTH dimensions; the
   short-and-wide media query below takes over for landscape phones. */
@media (min-width:720px) and (min-height:520px) {
    body {
        background:
            radial-gradient(900px 640px at 82% -12%, rgba(88,166,255,0.08), transparent 60%),
            radial-gradient(760px 560px at -8% 112%, rgba(88,166,255,0.06), transparent 60%),
            #010409;
    }
    #app { max-width:880px; margin:14px auto; height:calc(100vh - 28px); height:calc(100dvh - 28px); background:var(--bg); border:1px solid var(--line-strong); border-radius:20px; box-shadow:var(--shadow-card); }
    #chatContainer { padding:22px 28px 6px; gap:16px; }
    .message { max-width:78%; }
    .message .avatar { width:38px; height:38px; font-size:19px; }
    .message .bubble { font-size:15.5px; padding:14px 18px; }
    .message .bubble .timestamp { font-size:11px; }
    header { padding:18px 26px; }
    .logo { height:36px; width:36px; border-radius:10px; }
    .app-name { font-size:20px; }
    .status-dot { width:10px; height:10px; margin-left:8px; }
    .icon-btn { font-size:22px; min-width:48px; min-height:48px; }
    footer { padding:16px 24px calc(16px + var(--sab)) 24px; gap:12px; }
    .plan-bar { margin:0 24px; padding:10px 14px; font-size:13px; }
    .composer-dock { padding:10px; gap:10px; }
    .quick-chip { font-size:13px; padding:9px 14px; }
    #chatInput { font-size:16px; padding:15px 20px; border-radius:18px; }
    .send-btn { width:54px; height:54px; min-width:54px; }
    .modal-content { max-width:560px; padding:34px 40px; border-radius:24px; max-height:84vh; }
    .modal-header h2 { font-size:26px; }
    .subtitle { font-size:15px; }
    .setting-group label { font-size:14px; }
    .modal-body p { font-size:14.5px; }
    .btn-primary { font-size:16px; }
    .project-item { padding:14px 18px; }
    /* Pricing: real side-by-side comparison on wide screens. */
    .pricing-grid { grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); }
}

/* Landscape phones / short-and-wide windows (≥720 CSS px wide but under
   520 px tall): NOT a floating desktop window — the shell goes full-bleed
   wide so a one-hand landscape grip can still reach the composer, and the
   compact short-viewport sizing from the (max-height:440px) rules above
   keeps the header/footer slim. Without this block the app fell back to
   the centered ≤600 px phone column and wasted both landscape gutters. */
@media (min-width:720px) and (max-height:519px) {
    body { background:var(--bg); }
    #app { max-width:none; margin:0; height:100vh; height:100dvh; background:transparent; border:0; border-radius:0; box-shadow:none; }
    header { padding: calc(6px + var(--sat)) calc(18px + var(--sar)) 6px calc(18px + var(--sal)); }
    footer { padding:6px calc(18px + var(--sar)) calc(8px + var(--sab)) calc(18px + var(--sal)); gap:6px; }
    .logo { height:26px; width:26px; border-radius:7px; }
    .app-name { font-size:16px; }
    #chatContainer { padding:10px 20px 4px; }
    .message { max-width:72%; }
    .quick-chip { min-height:44px; }
    #chatInput { max-height:104px; }
    .composer-dock { border-radius:16px; }
    .modal-content { max-width:520px; padding:18px 22px; }
    .plan-bar { margin:0 18px; }
}

@media (prefers-reduced-motion:reduce) {
    *, *::before, *::after { animation-duration:0.001s !important; animation-iteration-count:1 !important; transition-duration:0.001s !important; scroll-behavior:auto !important; }
}

/* Phones/tablets (coarse pointers): skip the GPU-heavy backdrop blur behind
   overlays (the dark scrim already separates modal from chat) and make every
   remaining tap target reach the ≥44 px guideline. Desktop (fine pointers)
   keeps the frosted-glass effect and compact buttons. (.camera-overlay is
   handled by a SECOND coarse-pointer block at the end of the file — its own
   rule is defined later than this one, so at equal specificity it would win
   and re-apply the blur.) */
@media (pointer:coarse) {
    .modal, .drop-overlay { backdrop-filter:none; -webkit-backdrop-filter:none; }
    .subscribe-btn, .verify-btn { min-height:44px; display:inline-flex; align-items:center; justify-content:center; }
    .btn-secondary, .btn-danger { min-height:44px; display:inline-flex; align-items:center; justify-content:center; }
}


/* ============================================================
   DAILY QUESTS + CAMERA VERIFICATION (verify-quests.js)
   ============================================================ */
.quest-panel { flex-shrink:0; border-bottom:1px solid var(--line); background:linear-gradient(180deg, rgba(88,166,255,0.05), rgba(88,166,255,0)); padding:10px calc(16px + var(--sar)) 12px calc(16px + var(--sal)); animation:questIn .3s ease; }
.quest-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.quest-head-title { font-size:15px; font-weight:700; color:var(--text); letter-spacing:0.2px; }
.quest-xp { flex-shrink:0; background:var(--bg-active); border:1px solid var(--line-strong); color:#e3b341; font-size:12px; font-weight:800; padding:5px 12px; border-radius:20px; white-space:nowrap; }
.quest-xp.quest-bump { animation:xpBump 0.6s ease; }
@keyframes xpBump { 0% { transform:scale(1); } 35% { transform:scale(1.28); } 100% { transform:scale(1); } }
.quest-progress { font-size:12px; color:var(--text-3); margin:4px 0 8px; }
.quest-list { display:flex; flex-direction:column; gap:8px; }
.quest-item { display:flex; align-items:center; gap:10px; background:var(--bg-raise); border:1px solid var(--line); border-radius:14px; padding:8px 10px; transition:opacity .3s, border-color .3s; }
.quest-item.quest-done { opacity:0.66; border-color:rgba(63,185,80,0.35); }
.quest-emoji { width:38px; height:38px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:20px; background:var(--bg-inset); border-radius:11px; }
.quest-meta { flex:1; min-width:0; }
.quest-name { font-size:14px; font-weight:600; color:var(--text); }
.quest-point { font-size:11.5px; color:var(--text-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.quest-act { flex-shrink:0; }
.verify-btn { border:none; cursor:pointer; font-weight:800; border-radius:20px; padding:8px 16px; font-size:13px; color:#fff; background:linear-gradient(135deg, var(--accent-lo), var(--accent)); transition:transform .15s, filter .15s; touch-action:manipulation; }
.verify-btn:active { transform:scale(0.95); }
.verify-btn:disabled { opacity:0.5; cursor:wait; }
.quest-done-badge { display:inline-block; background:var(--ok-soft); color:#7ee2a8; border:1px solid rgba(63,185,80,0.45); border-radius:20px; padding:6px 12px; font-size:12px; font-weight:800; }
@keyframes questIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

/* ---- Camera overlay (verify flow) ---- */
.camera-overlay { position:fixed; inset:0; width:100%; height:100vh; height:100dvh; z-index:1200; background:rgba(1,4,9,0.96); backdrop-filter:blur(8px); display:flex; align-items:center; justify-content:center; padding:calc(14px + var(--sat)) calc(14px + var(--sar)) calc(14px + var(--sab)) calc(14px + var(--sal)); animation:camFade .2s ease; }
@keyframes camFade { from { opacity:0; } to { opacity:1; } }
.cam-sheet { width:100%; max-width:460px; background:var(--bg); border:1px solid var(--line-strong); border-radius:20px; overflow:hidden; box-shadow:var(--shadow-card); display:flex; flex-direction:column; max-height:92vh; max-height:92dvh; }
.cam-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; padding:12px 14px; border-bottom:1px solid var(--line); }
.cam-title { font-size:14px; font-weight:600; color:var(--text-2); line-height:1.4; }
.cam-close { background:none; border:none; color:var(--text-3); font-size:19px; cursor:pointer; padding:4px 10px; flex-shrink:0; border-radius:8px; }
.cam-close:active { color:var(--text); }
.cam-stage { position:relative; height:min(56vh, 460px); background:#000; overflow:hidden; }
.cam-video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.cam-still { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.scan-frame { position:absolute; inset:12% 10%; pointer-events:none; }
.scan-corner { position:absolute; width:26px; height:26px; border:3px solid var(--accent); opacity:0.95; filter:drop-shadow(0 0 6px rgba(88,166,255,0.9)); }
.scan-corner.tl { top:0; left:0; border-right:none; border-bottom:none; border-radius:6px 0 0 0; }
.scan-corner.tr { top:0; right:0; border-left:none; border-bottom:none; border-radius:0 6px 0 0; }
.scan-corner.bl { bottom:0; left:0; border-right:none; border-top:none; border-radius:0 0 0 6px; }
.scan-corner.br { bottom:0; right:0; border-left:none; border-top:none; border-radius:0 0 6px 0; }
.scan-line { position:absolute; left:2%; right:2%; top:4%; height:2px; border-radius:2px; background:linear-gradient(90deg, transparent, var(--accent), #ffffff, var(--accent), transparent); box-shadow:0 0 14px 2px rgba(88,166,255,0.75); animation:scanMove 2.4s ease-in-out infinite; }
@keyframes scanMove { 0% { top:4%; opacity:0.4; } 15% { opacity:1; } 50% { top:92%; opacity:1; } 65% { opacity:1; } 100% { top:4%; opacity:0.4; } }
.cam-msg { position:absolute; left:0; right:0; bottom:0; margin:12px; padding:12px 14px; border-radius:14px; font-size:14px; line-height:1.5; text-align:center; }
.cam-msg.busy { background:var(--accent-soft); border:1px solid var(--accent-line); color:var(--accent-hi); animation:camBusyPulse 1.4s ease-in-out infinite; }
.cam-msg.ok { background:var(--ok-soft); border:1px solid rgba(63,185,80,0.5); color:#7ee2a8; }
.cam-msg.err, .cam-msg.bad { background:var(--danger-soft); border:1px solid rgba(248,81,73,0.5); color:#ffb3ad; }
@keyframes camBusyPulse { 0%,100% { opacity:0.85; } 50% { opacity:0.5; } }
.cam-foot { display:flex; gap:10px; padding:12px 14px; border-top:1px solid var(--line); }
.cam-btn { flex:1; border:none; border-radius:14px; padding:13px 8px; font-size:14px; font-weight:800; cursor:pointer; touch-action:manipulation; }
.cam-btn.go { background:linear-gradient(135deg, var(--accent-lo), var(--accent)); color:#fff; }
.cam-btn.go:active { transform:scale(0.97); }
.cam-btn.go:disabled { opacity:0.55; cursor:wait; transform:none; }
.cam-btn.ghost { background:var(--bg-active); color:var(--text-2); }
.cam-btn.ghost:active { background:var(--line-strong); }

/* ---- XP toast ---- */
.xp-toast { position:fixed; top:calc(14px + var(--sat)); left:50%; transform:translate(-50%,-18px); z-index:1400; background:linear-gradient(135deg, var(--gold-1), var(--gold-2)); color:var(--gold-ink); font-weight:800; padding:10px 18px; border-radius:30px; box-shadow:var(--shadow-pop); font-size:14px; opacity:0; pointer-events:none; transition:transform .25s ease, opacity .25s ease; white-space:nowrap; }
.xp-toast.show { opacity:1; transform:translate(-50%,0); }

/* ---- OrbitOracle.AI toast (background commands + ephemeral notes) ---- */
.orbit-toast { position:fixed; top:calc(54px + var(--sat)); left:50%; transform:translate(-50%,-10px); z-index:1400; background:var(--bg-raise); color:var(--text); border:1px solid var(--line-strong); border-left:3px solid var(--accent); padding:9px 16px; border-radius:10px; box-shadow:var(--shadow-pop); font-size:13px; line-height:1.45; max-width:min(90vw, 440px); text-align:center; opacity:0; pointer-events:none; transition:opacity .2s ease, transform .2s ease; }
.orbit-toast.show { opacity:1; transform:translate(-50%,0); }
.orbit-toast.err { border-left-color:var(--danger); }

@media (max-width:480px) {
    .quest-panel { padding:8px calc(12px + var(--sar)) 10px calc(12px + var(--sal)); }
    .quest-item { gap:8px; padding:7px 8px; }
    .quest-emoji { width:34px; height:34px; font-size:18px; }
    .quest-point { max-width:150px; }
    .verify-btn { padding:7px 12px; font-size:12px; }
    .cam-stage { height:min(52vh, 380px); }
}

/* ============================================================
   HOVER TOOLTIPS (Tippy.js — custom "orbit" theme)
   ============================================================ */
.tippy-box[data-theme~='orbit'] {
    background-color:var(--bg-raise);
    color:var(--text);
    border:1px solid var(--line-strong);
    border-radius:6px;
    padding:0;
    font-size:12.5px;
    line-height:1.5;
    max-width:280px;
    box-shadow:var(--shadow-pop);
    text-align:left;
}
.tippy-box[data-theme~='orbit'] .tippy-content { padding:8px 12px; }
.tippy-box[data-theme~='orbit'] > .tippy-arrow { color:var(--bg-raise); }
.tippy-box[data-theme~='orbit'][data-placement^='top'] > .tippy-arrow::before { border-top-color:var(--bg-raise); }
.tippy-box[data-theme~='orbit'][data-placement^='bottom'] > .tippy-arrow::before { border-bottom-color:var(--bg-raise); }
.tippy-box[data-theme~='orbit'][data-placement^='left'] > .tippy-arrow::before { border-left-color:var(--bg-raise); }
.tippy-box[data-theme~='orbit'][data-placement^='right'] > .tippy-arrow::before { border-right-color:var(--bg-raise); }
@media (pointer:coarse) {
    .tippy-box[data-theme~='orbit'] { pointer-events:none; }
}
@media (max-width:480px) {
    .tippy-box[data-theme~='orbit'] { font-size:12px; max-width:240px; }
    .tippy-box[data-theme~='orbit'] .tippy-content { padding:7px 11px; }
}


/* ---- (retired) Kids-vs-Monsters identity picker -------------------------
   The first-launch "Are you a kid... or a monster?" cards, the plan-switch
   buttons in Settings and their #identityModal overrides were removed with the
   persona layer: first launch now just records that it happened, and the plan
   is chosen in the pricing modal. */

/* Camera overlay re-deblur for coarse pointers. Its own rule above
   (backdrop-filter:blur(8px)) is declared AFTER the coarse-pointer block, so
   at equal specificity it would win and the GPU blur would stay on phones.
   Declared last so the coarse-pointer intent always wins here. */
@media (pointer:coarse) {
    .camera-overlay { backdrop-filter:none; -webkit-backdrop-filter:none; }
}

/* ============================================================
   COMMUNITY (Idea Board · Workspaces · Showcase · Shared Memory)
   Zero-AI network features — dark theme, same design tokens.
   ============================================================ */
.community-content { width:min(760px, 96vw); max-width:760px; display:flex; flex-direction:column; max-height:86vh; }
.community-content .modal-body { overflow-y:auto; -webkit-overflow-scrolling:touch; flex:1; }

/* v53 Builder-tools modal (templates/snippets/guides) — same look as Community panes. */
.tools-content { width:min(640px, 96vw); max-width:640px; max-height:86vh; display:flex; flex-direction:column; }
.tools-content .modal-body { overflow-y:auto; -webkit-overflow-scrolling:touch; flex:1; }
.toolsPane-section { margin-bottom:18px; }
.toolsPane-section-title { font-size:13px; font-weight:700; color:var(--text-2); text-transform:uppercase; letter-spacing:.4px; margin:14px 0 8px; }
.community-tabs { display:flex; gap:6px; padding:12px 20px 0; flex-wrap:wrap; }
.community-tab { flex:1 1 auto; min-width:0; background:transparent; border:1px solid transparent; color:var(--text-3); font-size:13px; font-weight:600; padding:9px 6px; border-radius:var(--radius-m); cursor:pointer; transition:background .15s,color .15s,border-color .15s; touch-action:manipulation; }
.community-tab:hover { background:var(--bg-hover); color:var(--text-2); }
.community-tab.is-active { background:var(--accent-soft); border-color:var(--accent-line); color:var(--accent-hi); }
.community-pane { padding:4px 2px 8px; }
.community-pane .comm-section { margin-bottom:18px; }
.community-pane .comm-section-title { font-size:13px; font-weight:700; color:var(--text-2); text-transform:uppercase; letter-spacing:.4px; margin:14px 0 8px; }
.community-pane .comm-hint { font-size:12.5px; color:var(--text-3); margin:0 0 10px; line-height:1.45; }
.community-pane input[type="text"], .community-pane textarea { background:var(--bg-inset); }
.community-pane .comm-row { display:flex; gap:8px; margin-bottom:8px; }
.community-pane .comm-row input { flex:1; }
.community-pane .comm-row .btn-primary { width:auto; padding:12px 18px; flex-shrink:0; }
.community-pane .btn-secondary, .community-pane .btn-danger { width:auto; margin:0; }
/* Board posts */
.comm-post { background:var(--bg-inset); border:1px solid var(--line); border-radius:var(--radius-m); padding:13px 14px; margin-bottom:10px; }
.comm-post .comm-post-head { display:flex; justify-content:space-between; gap:10px; align-items:baseline; }
.comm-post .comm-post-title { font-size:15px; font-weight:700; color:var(--text); word-break:break-word; }
.comm-post .comm-post-by { font-size:11.5px; color:var(--text-4); white-space:nowrap; }
.comm-post .comm-post-body { font-size:13.5px; color:var(--text-2); margin:6px 0 8px; line-height:1.5; white-space:pre-wrap; word-break:break-word; }
.comm-post .comm-post-actions { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.comm-vote { display:inline-flex; align-items:center; gap:5px; background:var(--bg-active); border:1px solid var(--line); color:var(--text-2); font-size:13px; padding:5px 10px; border-radius:999px; cursor:pointer; transition:all .15s; }
.comm-vote:hover { border-color:var(--accent-line); }
.comm-vote.on { background:var(--accent-soft); border-color:var(--accent-line); color:var(--accent-hi); }
.comm-comment-toggle { font-size:12.5px; color:var(--text-3); background:none; border:none; cursor:pointer; padding:4px 6px; }
.comm-comments { margin-top:8px; border-top:1px dashed var(--line); padding-top:8px; }
.comm-comment { font-size:13px; color:var(--text-2); margin-bottom:6px; line-height:1.45; word-break:break-word; }
.comm-comment .comm-comment-by { color:var(--accent-hi); font-weight:600; }
.comm-comment .comm-comment-at { color:var(--text-4); font-size:11px; margin-left:6px; }
.comm-empty { color:var(--text-4); font-size:13px; text-align:center; padding:22px 8px; }
/* Workspaces */
.comm-ws-card { background:var(--bg-inset); border:1px solid var(--line); border-radius:var(--radius-m); padding:12px 14px; margin-bottom:10px; }
.comm-ws-card .comm-ws-name { font-weight:700; color:var(--text); font-size:15px; }
.comm-ws-card .comm-ws-desc { font-size:13px; color:var(--text-3); margin:3px 0 8px; line-height:1.4; word-break:break-word; }
.comm-ws-card .comm-ws-meta { font-size:11.5px; color:var(--text-4); margin-bottom:8px; }
.comm-ws-live { background:var(--bg-inset); border:1px solid var(--line); border-radius:var(--radius-m); padding:12px 14px; }
.comm-ws-entries { max-height:300px; overflow-y:auto; margin:10px 0; display:flex; flex-direction:column; gap:8px; -webkit-overflow-scrolling:touch; }
.comm-ws-entry { font-size:13px; color:var(--text-2); line-height:1.45; word-break:break-word; background:var(--bg-raise); border-radius:var(--radius-s); padding:8px 10px; }
.comm-ws-entry .comm-ws-entry-head { font-size:11.5px; color:var(--text-4); margin-bottom:2px; }
.comm-ws-entry .comm-ws-entry-head b { color:var(--accent-hi); font-weight:600; }
.comm-ws-file-link { color:var(--accent-hi); font-size:12.5px; text-decoration:none; }
.comm-ws-members { font-size:12px; color:var(--text-3); margin:8px 0; display:flex; flex-wrap:wrap; gap:6px; }
.comm-ws-member { background:var(--bg-active); border-radius:999px; padding:3px 10px; }
.comm-ws-composer { display:flex; gap:8px; align-items:flex-end; }
.comm-ws-composer textarea { flex:1; min-height:44px; resize:none; }
/* Showcase */
.comm-showcase-card { background:var(--bg-inset); border:1px solid var(--line); border-radius:var(--radius-m); padding:13px 14px; margin-bottom:10px; }
.comm-showcase-head { display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
.comm-showcase-name { font-weight:700; color:var(--text); }
.comm-showcase-role { font-size:11px; color:var(--gold-1); }
.comm-showcase-tagline { font-size:13px; color:var(--text-2); margin:4px 0 8px; line-height:1.45; word-break:break-word; }
.comm-plugin { display:flex; justify-content:space-between; align-items:center; gap:8px; background:var(--bg-raise); border-radius:var(--radius-s); padding:7px 10px; margin-bottom:6px; font-size:13px; }
.comm-plugin .comm-plugin-name { font-weight:600; color:var(--text); }
.comm-plugin .comm-plugin-tag { color:var(--text-3); font-size:12px; }
.comm-hire-btn { background:var(--gold-1); color:var(--gold-ink); border:none; border-radius:999px; padding:5px 12px; font-size:12px; font-weight:700; cursor:pointer; }
.comm-inbox-item { font-size:13px; color:var(--text-2); background:var(--bg-raise); border-radius:var(--radius-s); padding:8px 10px; margin-bottom:6px; line-height:1.45; word-break:break-word; }
/* Shared Memory */
.comm-mem-card { background:var(--bg-inset); border:1px solid var(--line); border-radius:var(--radius-m); padding:12px 14px; margin-bottom:10px; }
.comm-mem-name { font-weight:700; color:var(--text); font-size:14.5px; word-break:break-word; }
.comm-mem-meta { font-size:11.5px; color:var(--text-4); margin:3px 0 8px; }
.comm-mem-actions { display:flex; gap:6px; flex-wrap:wrap; }

/* ============================================================
   NETWORK EFFECTS — stats chips on Idea rows, ♡ like button,
   🔔 notification bell + inbox (see script.js NETWORK EFFECTS).
   ============================================================ */
.idea-stat-row { display:flex; align-items:center; gap:10px; margin-top:6px; flex-wrap:wrap; }
.idea-stat { font-size:11.5px; color:var(--text-3); display:inline-flex; align-items:center; gap:3px; }
.idea-stat b { font-weight:700; color:var(--text-2); font-variant-numeric:tabular-nums; }
.idea-like-btn {
  background:transparent; border:1px solid var(--line); border-radius:999px;
  width:26px; height:22px; line-height:1; padding:0; margin-left:auto;
  cursor:pointer; font-size:13px; display:inline-flex; align-items:center; justify-content:center;
  transition:transform .12s ease, border-color .12s ease;
}
.idea-like-btn:hover { transform:scale(1.12); border-color:var(--gold-1); }
.idea-like-btn.liked { border-color:#f85149; background:rgba(248,81,73,.12); }
.notif-badge {
  position:absolute; top:2px; right:-2px; min-width:16px; height:16px;
  border-radius:999px; background:#f85149; color:#fff; font-size:10px; font-weight:800;
  display:inline-flex; align-items:center; justify-content:center; padding:0 4px;
  box-shadow:0 0 0 2px var(--bg, #1e1e2e);
}
.icon-btn { position:relative; }
.notif-content .modal-body { padding-bottom:16px; }
.notif-markall { margin-bottom:10px; width:auto; }
.notif-list { max-height:46vh; overflow-y:auto; display:flex; flex-direction:column; gap:6px; }
.notif-item {
  background:var(--bg-inset); border:1px solid var(--line); border-radius:var(--radius-s);
  padding:9px 11px; font-size:13px;
}
.notif-item.unread { border-left:3px solid var(--gold-1); background:var(--bg-raise); }
.notif-item-text { color:var(--text); line-height:1.45; word-break:break-word; }
.notif-item-time { font-size:11px; color:var(--text-4); margin-top:3px; }

/* ============================================================
   SKINS (v54) — "🎨 Skin" in Settings (Settings → Skin).
   Every skin is a pure CSS-custom-property override on <body
   data-skin="...">, so the whole app (chat, modals, buttons,
   composer, community panes) re-themes through the variables it
   already uses. The default OrbitOracle.AI look sets no data-skin and is
   untouched. Applied at boot from localStorage orbit_skin by
   applySavedLook() in script.js; never affects stored data.
   ============================================================ */
body[data-skin="ocean"] {
  --bg: #0a1220;          /* deep navy                    */
  --bg-inset: #060d18;
  --bg-raise: #0f1b2e;
  --bg-hover: #14243c;
  --bg-active: #182b46;
  --line: #182b46;
  --line-strong: #27405f;
  --accent: #4cc2ff;      /* bright aqua accent           */
  --accent-hi: #8adfff;
  --accent-lo: #0b6cbd;
  --accent-glow: rgba(76, 194, 255, 0.35);
  --accent-soft: rgba(76, 194, 255, 0.12);
  --accent-line: rgba(76, 194, 255, 0.4);
}
body[data-skin="candy"] {
  --bg: #171226;          /* dark violet                  */
  --bg-inset: #100b1e;
  --bg-raise: #231a3a;
  --bg-hover: #2c2149;
  --bg-active: #33265a;
  --line: #33265a;
  --line-strong: #4a3a70;
  --accent: #ff5fd0;      /* hot candy-pink accent        */
  --accent-hi: #ff9be6;
  --accent-lo: #b3157f;
  --accent-glow: rgba(255, 95, 208, 0.35);
  --accent-soft: rgba(255, 95, 208, 0.13);
  --accent-line: rgba(255, 95, 208, 0.4);
}
body[data-skin="midnight"] {
  --bg: #04040a;          /* near-black                  */
  --bg-inset: #000003;
  --bg-raise: #0a0a14;
  --bg-hover: #12121f;
  --bg-active: #171728;
  --line: #171728;
  --line-strong: #26263c;
  --accent: #7b6bff;      /* electric violet accent      */
  --accent-hi: #a99cff;
  --accent-lo: #4f3fd8;
  --accent-glow: rgba(123, 107, 255, 0.35);
  --accent-soft: rgba(123, 107, 255, 0.13);
  --accent-line: rgba(123, 107, 255, 0.4);
}
body[data-skin="retrowave"] {
  --bg: #160c2e;          /* deep synthwave purple        */
  --bg-inset: #0d0620;
  --bg-raise: #1d1140;
  --bg-hover: #271554;
  --bg-active: #301a66;
  --line: #2c1a5c;
  --line-strong: #472a86;
  --accent: #ff2ea6;      /* hot neon-magenta accent      */
  --accent-hi: #ff86d0;
  --accent-lo: #a3126f;
  --accent-glow: rgba(255, 46, 166, 0.4);
  --accent-soft: rgba(255, 46, 166, 0.15);
  --accent-line: rgba(255, 46, 166, 0.45);
  /* Retrowave horizon: a soft neon-sun glow rising from the
     bottom edge plus magenta/cyan under-glows, purely atmospheric —
     every surface above still uses the variable tokens, so the
     whole shell (chat, modals, buttons, composer) stays legible. */
  background-image:
    radial-gradient(90% 46% at 50% 108%, rgba(255, 46, 166, 0.16), transparent 62%),
    radial-gradient(70% 34% at 18% 116%, rgba(79, 63, 216, 0.2), transparent 60%),
    radial-gradient(60% 30% at 84% 116%, rgba(18, 194, 233, 0.12), transparent 58%);
}
/* Let the sunset glow show through the app frame on the desktop card too
   (the phone column is already transparent behind the chat scroll). */
body[data-skin="retrowave"] #app { background:transparent; }
/* RetroSkin — the light-cycle grid from the RetroSkin project, worn by OrbitOracle.AI.
   Neon cyan on light-cycle black, a faint 44px grid wash and a magenta
   under-glow so the shell reads as the same skin as the desktop wallpaper
   (Projects/RetroSkin). Same contract as every other skin: pure variable
   overrides, no stored data touched. */
body[data-skin="retroskin"] {
  --bg: #05070d;          /* light-cycle black            */
  --bg-inset: #020305;
  --bg-raise: #0b1119;
  --bg-hover: #101823;
  --bg-active: #16202e;
  --line: #16202e;
  --line-strong: #24455a;
  --accent: #00ffff;      /* RetroSkin neon cyan          */
  --accent-hi: #9bfdff;
  --accent-lo: #00a6a6;
  --accent-glow: rgba(0, 255, 255, 0.35);
  --accent-soft: rgba(0, 255, 255, 0.12);
  --accent-line: rgba(0, 255, 255, 0.42);
  background-image:
    linear-gradient(rgba(0, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(90% 46% at 50% 108%, rgba(255, 0, 255, 0.13), transparent 62%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
}
body[data-skin="retroskin"] #app { background:transparent; }

/* ------------------------------------------------------------
   PALETTES (v50) — five more, same 13-token contract as the six
   above: --bg / --bg-inset / --bg-raise / --bg-hover / --bg-active
   / --line / --line-strong / --accent / --accent-hi / --accent-lo
   / --accent-glow / --accent-soft / --accent-line.

   Text colours stay in :root on purpose — a palette decides the
   MOOD (surfaces + accent), not legibility. The one exception is
   "contrast", which is an ACCESSIBILITY palette and therefore ALSO
   overrides the text tokens: a high-contrast mode that leaves the
   faint text token at 4.1:1 would be a contradiction. test_skins.js
   holds every palette to a measured WCAG floor and asserts that
   each one defines the same surface/accent set, so a palette can
   never half-theme the shell.
   ------------------------------------------------------------ */
body[data-skin="deepspace"] {
  --bg: #05070d;          /* near-black, faint blue cast  */
  --bg-inset: #010206;
  --bg-raise: #0b0f18;
  --bg-hover: #131926;
  --bg-active: #1a2233;
  --line: #1a2233;
  --line-strong: #2c3852;
  --accent: #38d9f0;      /* bright cyan                  */
  --accent-hi: #7ceaf9;
  --accent-lo: #0e7f96;
  --accent-glow: rgba(56, 217, 240, 0.34);
  --accent-soft: rgba(56, 217, 240, 0.12);
  --accent-line: rgba(56, 217, 240, 0.4);
}
body[data-skin="solarflare"] {
  --bg: #17110a;          /* charred brown                */
  --bg-inset: #0d0905;
  --bg-raise: #221809;
  --bg-hover: #2e2110;
  --bg-active: #3a2914;
  --line: #3a2914;
  --line-strong: #57401f;
  --accent: #ffb454;      /* amber                        */
  --accent-hi: #ffd08a;
  --accent-lo: #c2660a;
  --accent-glow: rgba(255, 180, 84, 0.34);
  --accent-soft: rgba(255, 180, 84, 0.13);
  --accent-line: rgba(255, 180, 84, 0.4);
}
body[data-skin="aurora"] {
  --bg: #071414;          /* deep teal-black              */
  --bg-inset: #030b0b;
  --bg-raise: #0d1f20;
  --bg-hover: #132b2c;
  --bg-active: #193637;
  --line: #193637;
  --line-strong: #275150;
  --accent: #5eead4;      /* aurora teal                  */
  --accent-hi: #a5f3e6;
  --accent-lo: #128a7d;
  --accent-glow: rgba(94, 234, 212, 0.32);
  --accent-soft: rgba(94, 234, 212, 0.12);
  --accent-line: rgba(94, 234, 212, 0.4);
}
body[data-skin="nebula"] {
  --bg: #120c1c;          /* violet-black                 */
  --bg-inset: #0a0612;
  --bg-raise: #1c1329;
  --bg-hover: #261a37;
  --bg-active: #2f2144;
  --line: #2f2144;
  --line-strong: #473363;
  --accent: #d8b4fe;      /* pale violet                  */
  --accent-hi: #ecd6ff;
  --accent-lo: #7c3aed;
  --accent-glow: rgba(216, 180, 254, 0.32);
  --accent-soft: rgba(216, 180, 254, 0.13);
  --accent-line: rgba(216, 180, 254, 0.4);
}
body[data-skin="contrast"] {
  --bg: #000000;          /* pure black — maximum contrast */
  --bg-inset: #000000;
  --bg-raise: #0b0b0b;
  --bg-hover: #161616;
  --bg-active: #1f1f1f;
  --line: #4a525c;
  --line-strong: #7d8794;
  --accent: #79c0ff;
  --accent-hi: #a5d6ff;
  --accent-lo: #1f6feb;
  --accent-glow: rgba(121, 192, 255, 0.34);
  --accent-soft: rgba(121, 192, 255, 0.16);
  --accent-line: rgba(121, 192, 255, 0.5);
  /* The accessibility palette also lifts the text tokens (see the note above):
     the faint token ships at 4.1:1 on the default background, which is fine for
     a placeholder and not fine for a palette whose entire purpose is legibility. */
  --text: #ffffff;
  --text-2: #edf2f7;
  --text-3: #cfd6dd;
  --text-4: #aab2ba;
}

/* The status-dot / brand edges pick the new accent too. */
body[data-skin="ocean"] #sendBtn,
body[data-skin="candy"] #sendBtn,
body[data-skin="midnight"] #sendBtn,
body[data-skin="retrowave"] #sendBtn,
body[data-skin="retroskin"] #sendBtn,
body[data-skin="deepspace"] #sendBtn,
body[data-skin="solarflare"] #sendBtn,
body[data-skin="aurora"] #sendBtn,
body[data-skin="nebula"] #sendBtn,
body[data-skin="contrast"] #sendBtn {
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* ============================================================
   FEATURE GATES (v56) — tier + legal-hold status badges
   Rendered by script.js applyOrbitFeatureGates(): a gated entry
   point carries data-gate-badge (chip text), data-gate-kind
   (tier | info | hold) and data-gate-hold (legal | regulatory |
   investor). The chip is a pure ::after so it survives the
   data-i18n text rewrites applyLanguage() performs. Locked tier
   rows get the accent ring so the "why" is one hover away.
   ============================================================ */
.orbit-gated { cursor: help; }
.orbit-gated::after {
  content: attr(data-gate-badge);
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  line-height: 1.7;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
  pointer-events: none;
  background: var(--bg-active);
  color: var(--text-2);
  border: 1px solid var(--line-strong);
}
/* Paid-tier labels on a storeless public build: neutral, non-locking. */
.orbit-gated[data-gate-kind="info"]::after {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
}
/* Tier lock: the visitor is below the required plan. */
.orbit-gated[data-gate-kind="tier"] {
  box-shadow: inset 0 0 0 1px var(--accent-line);
  border-radius: var(--radius-s);
}
.orbit-gated[data-gate-kind="tier"]::after {
  background: var(--accent-soft);
  color: var(--accent-hi);
  border-color: var(--accent-line);
}
/* Legal / regulatory review holds: amber warning chip. */
.orbit-gated[data-gate-kind="hold"][data-gate-hold="legal"]::after,
.orbit-gated[data-gate-kind="hold"][data-gate-hold="regulatory"]::after {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(210, 153, 34, .38);
}
/* Investor unlock holds: red chip — these are the pitch items. */
.orbit-gated[data-gate-kind="hold"][data-gate-hold="investor"]::after {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(248, 81, 73, .42);
}
/* Community tab chips must not overflow the tab row. */
.community-tab.orbit-gated { flex-wrap: nowrap; }
.community-tab.orbit-gated::after { margin-left: 5px; }
/* Compact screens: keep the chip readable but smaller. */
@media (max-width: 480px) {
  .orbit-gated::after { font-size: 9px; padding: 1px 6px; letter-spacing: .2px; }
}

/* ============================================================
   BUFF BAR + WORKSPACE PANELS (Phases B–F)
   Marketplace, AI Agents, Rosetta Stone and Collab boards — the
   panels behind the buff-bar buttons in index.html. script.js
   decides which of them a build may offer: the hosted build shows
   the three that work in a browser and removes the console-only
   Collab button, so this bar is NOT local-only. Colors use the
   shell CSS variables so every skin themes the panels too.
   ============================================================ */
.buff-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px calc(16px + var(--sar)) 10px calc(16px + var(--sal));
  background: var(--bg-raise);
  border-bottom: 1px solid var(--line);
}
.buff-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 13px;
  background: var(--bg-active);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  touch-action: manipulation;
}
.buff-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--accent-line); }
.buff-btn:active { transform: scale(.97); }
.buff-btn.is-open {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hi);
}
.buff-btn span { white-space: nowrap; }

.buff-panel {
  flex-shrink: 0;
  margin: 10px calc(16px + var(--sar)) 0 calc(16px + var(--sal));
  padding: 14px;
  background: var(--bg-raise);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  animation: statusIn .22s ease;
}
.buff-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.buff-panel-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--text); }
.buff-panel-sub { margin: 0 0 8px; font-size: 12px; color: var(--text-3); line-height: 1.45; }
.buff-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.buff-field {
  flex: 2 1 160px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--bg-inset);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  color-scheme: dark;
  transition: border-color .2s, box-shadow .2s;
}
.buff-field-sm { flex: 1 1 90px; }
/* Install instructions. Two callers share this surface: iPhone/iPad, where
   Safari fires no beforeinstallprompt so the two manual steps have to be
   written out, and the landing page's ?install=1 hand-off, which arrives on a
   browser that may or may not offer a prompt.

   IN THE FLOW, NEVER A FIXED OVERLAY. This was `position: fixed; top: 12px;
   z-index: 9860` — a full-width strip at the top of the viewport, sitting
   ABOVE #orbitVaultBanner (fixed; top: 0; z-index: 9850). The two overlapped,
   so the hint covered the vault ribbon's action row and ate its clicks: "Save
   recovery phrase" and "Not now" both went dead, and the ribbon's own handler
   could not have failed (it is hideBanner() + a flag). That is the third time
   a layer at the top of the screen has killed another layer's buttons in this
   app, so the hint stops competing for the top of the viewport at all: it is a
   flex row inside #app, under the header, exactly like .idea-switcher and
   .buff-bar. It cannot cover the ribbon, a modal, the nested-list menu or a
   toast — and being inside #app it cannot appear over the first-run gate
   either, because the gate hides #app. */
.orbit-install-hint {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 10px;
  padding: 10px calc(16px + var(--sar)) 10px calc(16px + var(--sal));
  background: var(--bg-inset);
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
}
.orbit-install-hint.is-shown { display: flex; }
.orbit-install-hint-text { flex: 1 1 auto; min-width: 0; }
.orbit-install-hint b { color: var(--accent); font-weight: 600; }
/* The one button the hand-off banner may carry (only when the browser has
   actually offered a prompt — otherwise the banner says which menu path to use
   instead of showing a button that could do nothing). */
.orbit-install-cta {
  flex: 0 0 auto;
  padding: 7px 12px;
  font-size: 12.5px;
}
.orbit-install-hint-close {
  flex: 0 0 auto;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  opacity: .7;
  cursor: pointer;
}
.orbit-install-hint-close:hover,
.orbit-install-hint-close:focus-visible { opacity: 1; }
/* Agent instructions: the one multi-line field in the buff panels. Resizable
   vertically only — horizontal resize would break the panel width. */
.buff-agent-instructions {
  flex: 1 1 100%;
  width: 100%;
  min-height: 96px;
  max-height: 320px;
  resize: vertical;
  line-height: 1.45;
}
.buff-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.buff-action {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-s);
  background: linear-gradient(135deg, var(--accent-lo), var(--accent));
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, filter .15s, opacity .15s;
  touch-action: manipulation;
}
.buff-action:hover { filter: brightness(1.08); }
.buff-action:active { transform: scale(.97); }
.buff-action:disabled { opacity: .55; cursor: default; }

.buff-list {
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-inset);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.buff-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 9px 11px;
}
.buff-item-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.buff-item-desc {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.buff-meta { font-size: 11.5px; color: var(--text-4); margin-top: 3px; font-weight: 400; }
.buff-price {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-1, #d29922);
}
.buff-tags { font-size: 11px; color: var(--accent-hi); margin-top: 4px; opacity: .85; }
.buff-empty {
  color: var(--text-4);
  font-size: 12.5px;
  text-align: center;
  padding: 14px 8px;
  margin: 0;
}
.buff-err {
  color: #f85149;
  font-size: 12.5px;
  text-align: center;
  padding: 10px 8px;
  margin: 0;
}
#rosetta-output {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  min-height: 20px;
}
/* ============================================================
   v69 BUFF PANEL UPGRADES — Marketplace buy buttons, AI Agent
   run rows + results, Collab create-board form, small panel
   header controls. Consumes the shell tokens so every skin
   themes these too. English-only product copy.
   ============================================================ */
.buff-head-btn {
  flex-shrink: 0;
  min-height: 28px;
  padding: 2px 10px;
  background: var(--bg-active);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-3);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  touch-action: manipulation;
}
.buff-head-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--accent-line); }
.buff-head-btn:active { transform: scale(.96); }
.buff-head-btn:disabled { opacity: .5; cursor: default; }
/* An agent's starter task, as a tappable chip: it FILLS the task box, it does not
   run anything, so it must not look like the primary Run button. Truncated to one
   line — a sample task can carry newlines and would otherwise stretch the card. */
.buff-try {
  align-self: flex-start;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: var(--bg-inset);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.buff-try:hover { background: var(--bg-hover); color: var(--text); border-color: var(--accent-line); }
.buff-try:active { transform: scale(.98); }
.buff-subhead {
  margin: 2px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-4);
}
/* Marketplace listing rows with a Buy action on the right. */
.buff-item-col { flex-direction: column; }
.buff-item-main { flex: 1 1 auto; min-width: 0; }
.buff-buy {
  flex-shrink: 0;
  align-self: center;
  margin-left: 10px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hi);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, opacity .15s, transform .1s;
  touch-action: manipulation;
}
.buff-buy:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.buff-buy:active { transform: scale(.96); }
.buff-buy:disabled { opacity: .5; cursor: default; background: var(--bg-active); color: var(--text-4); border-color: var(--line-strong); }
.buff-buy.is-pending, .buff-action.is-pending { opacity: .75; cursor: wait; }   /* the console's own pending look, extended to the composer-style buttons the chat-bot panel uses */
/* AI Agent cards: task input + Run, then a result line. */
.buff-run-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; width: 100%; }
.buff-run-input { flex: 1 1 170px; min-width: 0; }
.buff-run-out {
  display: none;
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--bg-inset);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.buff-run-out.is-shown { display: block; }
.buff-run-out.is-err { border-color: var(--danger); color: var(--danger); }
.buff-run-out .buff-run-head { display: block; font-weight: 700; color: var(--ok); margin-bottom: 2px; }
/* Collab board cards: meta strip under the pitch. */
.buff-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-4);
}
.buff-card-meta .buff-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg-active);
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}
.buff-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.buff-action-sm {
  flex-shrink: 0;
  min-height: 30px;
  padding: 0 13px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-lo), var(--accent));
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, filter .15s, opacity .15s;
  touch-action: manipulation;
}
.buff-action-sm:hover { filter: brightness(1.08); }
.buff-action-sm:active { transform: scale(.96); }
.buff-action-sm:disabled { opacity: .55; cursor: default; }
.buff-action-sm.is-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-3);
}
.buff-action-sm.is-ghost:hover { color: var(--text); border-color: var(--accent-line); background: var(--bg-hover); }
.buff-owner-tag { color: var(--gold-1); font-weight: 700; }
/* One-tap Simplify: active state on the footer button while the bubble is
   showing the simplified rewrite (tap again to restore the original). */
.msg-simplify-btn.is-on {
  opacity: 1;
  color: var(--accent-hi);
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* ============================================================
   MENTOR ENGINE PANEL (synthesis + mentor)
   Shared by the composer Mentor chip modal. Everything consumes
   the shell CSS variables so all skins (five, incl. retrowave) theme it. Mood hints:
   green = momentum topic, red = needs-attention topic. */
.mentor-content { max-width: 470px; padding: 20px; }
.mentor-body { padding-top: 2px; }
.mentor-mode { color: var(--accent-hi); font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.mentor-mode-desc { color: var(--text-3); font-size: 12px; line-height: 1.5; margin: 2px 0 8px; }
.mentor-hint { color: var(--text-3); font-size: 12.5px; line-height: 1.55; margin: 0 0 12px; }
.mentor-modewrap { margin-bottom: 8px; }
.mentor-modebar { display: flex; gap: 6px; margin: 0 0 4px; }
.mentor-mode-btn { flex: 1; background: var(--bg-active); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; font-weight: 700; font-family: inherit; padding: 9px 10px; border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .1s; touch-action: manipulation; }
.mentor-mode-btn:hover { border-color: var(--accent-line); color: var(--text); }
.mentor-mode-btn.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hi); }
.mentor-mode-btn:active { transform: scale(0.98); }
.mentor-caption { color: var(--text-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 4px 0 8px; }
.mentor-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mentor-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; background: var(--bg-active); border: 1px solid var(--line); border-left: 3px solid var(--line); color: var(--text-2); font-size: 12.5px; font-weight: 600; font-family: inherit; padding: 7px 11px 7px 9px; border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .1s; touch-action: manipulation; }
.mentor-chip:hover { border-color: var(--accent-line); color: var(--text); }
.mentor-chip:active { transform: scale(0.97); }
.mentor-chip.is-sel { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.mentor-chip.is-strong { border-left-color: #3fb950; }
.mentor-chip.is-weak { border-left-color: #f85149; }
.mentor-pill { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bg-raise); border: 1px solid var(--line-strong); color: var(--text-3); font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.mentor-chip.is-sel .mentor-pill { color: var(--accent-hi); border-color: var(--accent); }
.mentor-signal-label { color: var(--text-3); font-size: 12px; margin-bottom: 6px; }
.mentor-signal-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.mentor-signal { background: var(--bg-active); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; font-family: inherit; padding: 8px 12px; border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; touch-action: manipulation; }
.mentor-signal:hover { border-color: var(--accent-line); background: var(--bg-hover); }
.mentor-signal:active { transform: scale(0.97); }
.mentor-link { background: none; border: none; color: var(--text-3); font-size: 11.5px; font-family: inherit; padding: 4px 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.mentor-link:hover { color: var(--text-2); }
.mentor-out { margin-top: 6px; background: var(--bg-inset); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.mentor-out-title { color: var(--accent-hi); font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.mentor-out-text { color: var(--text); font-size: 13.5px; line-height: 1.6; margin: 0 0 8px; }
.mentor-deep { background: var(--accent-lo); border: none; color: #fff; font-size: 12.5px; font-weight: 700; font-family: inherit; padding: 8px 12px; border-radius: 12px; cursor: pointer; transition: filter .15s, transform .1s; touch-action: manipulation; }
.mentor-deep:hover { filter: brightness(1.15); }
.mentor-deep:active { transform: scale(0.98); }
.mentor-synth-btn { display: block; width: 100%; margin-top: 12px; background: var(--bg-active); border: 1px solid var(--accent-line); color: var(--accent-hi); font-size: 13px; font-weight: 700; font-family: inherit; padding: 10px 12px; border-radius: 14px; cursor: pointer; transition: background .15s, border-color .15s; touch-action: manipulation; }
.mentor-synth-btn:hover { background: var(--accent-soft); }
.mentor-profile { margin-top: 10px; }
.mentor-synth { color: var(--text-2); font-size: 12.5px; line-height: 1.65; margin: 0; background: var(--bg-active); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 12px; }

/* ---- Level Up: mentor qualities (level-up.js) --------------------------
   The Mentor modal's "turn this chat into a mentor" switch plus the
   quality grid. Consumes the shell CSS variables so every skin themes it. */
.level-up-panel { border-top:1px dashed var(--line-strong); padding-top:10px; }
.level-up-toggle { display:flex; align-items:center; gap:10px; width:100%; box-sizing:border-box; background:var(--bg-active); border:1px solid var(--line); color:var(--text-2); font-size:13px; font-weight:700; font-family:inherit; padding:10px 12px; border-radius:14px; cursor:pointer; text-align:left; transition:border-color .15s, background .15s, color .15s, transform .1s; touch-action:manipulation; }
.level-up-toggle:hover { border-color:var(--accent-line); color:var(--text); }
.level-up-toggle:active { transform:scale(0.99); }
.level-up-toggle.is-on { background:var(--accent-soft); border-color:var(--accent); color:var(--accent-hi); }
.level-up-knob { flex:0 0 auto; width:34px; height:20px; border-radius:10px; background:var(--bg-raise); border:1px solid var(--line-strong); position:relative; transition:background .15s, border-color .15s; }
.level-up-knob::after { content:""; position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:var(--text-3); transition:transform .15s, background .15s; }
.level-up-toggle.is-on .level-up-knob { background:var(--accent-lo); border-color:var(--accent); }
.level-up-toggle.is-on .level-up-knob::after { transform:translateX(14px); background:#fff; }
.level-up-toggle-text { min-width:0; overflow-wrap:anywhere; word-wrap:break-word; }
.level-up-grid { margin-top:10px; }
.level-up-chip { flex-direction:row; text-align:left; }
.level-up-chip-label { min-width:0; overflow-wrap:anywhere; word-wrap:break-word; }
.level-up-status { color:var(--text-3); font-size:12px; line-height:1.55; margin:0 0 6px; }

/* ---- Level Up: per-answer 🚀 button + nested panel (level-up.js) --------
   Every finished OrbitOracle.AI answer carries a 🚀 Level Up action beside Copy /
   Highlight / Simplify. The button nests the mentor switch and the quality
   grid inside THAT answer, so the feature can be turned on right where the
   reader is; turning it on (or tapping "Go deeper") fires one deeper
   follow-up about the answer through the normal chat path. Consumes the
   shell CSS variables so every skin themes it. */
.msg-lu-mentor-btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex-shrink:0; min-height:28px; background:none; border:1px solid transparent; color:var(--text-3); font-family:inherit; font-size:11px; font-weight:600; line-height:1; padding:0 9px; border-radius:8px; cursor:pointer; opacity:0.85; transition:background .15s, color .15s, border-color .15s, opacity .15s, transform .1s; touch-action:manipulation; }
.msg-lu-mentor-btn .msg-lu-mentor-ico { font-size:12.5px; line-height:1; }
.msg-lu-mentor-btn:hover { opacity:1; color:var(--accent-hi); background:var(--bg-active); border-color:var(--line); }
.msg-lu-mentor-btn:active { transform:scale(0.94); }
.msg-lu-mentor-btn.is-on { opacity:1; color:var(--accent-hi); background:var(--accent-soft); border-color:var(--accent); }
.msg-lu-mentor-btn[aria-expanded="true"] { opacity:1; color:var(--accent-hi); background:var(--bg-active); border-color:var(--accent-line); }
.level-up-msg-panel { margin-top:8px; padding:10px 12px; border:1px solid var(--accent-line); border-radius:12px; background:var(--bg-inset); }
.level-up-msg-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.level-up-msg-title { color:var(--accent-hi); font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; }
.level-up-msg-close { background:none; border:none; color:var(--text-3); font-family:inherit; font-size:12px; line-height:1; padding:2px 6px; border-radius:6px; cursor:pointer; }
.level-up-msg-close:hover { color:var(--text); background:var(--bg-active); }
.level-up-msg-hint { color:var(--text-3); font-size:11.5px; line-height:1.5; margin:8px 0 0; }
.level-up-msg-panel .level-up-grid { margin-bottom:4px; }
.level-up-msg-panel .level-up-chip { font-size:11.5px; padding:6px 9px; }
.level-up-deepen-btn { display:block; width:100%; margin-top:8px; background:var(--accent-lo); border:1px solid var(--accent); color:#fff; font-family:inherit; font-size:12.5px; font-weight:700; line-height:1.3; padding:9px 12px; border-radius:12px; cursor:pointer; transition:filter .15s, transform .1s, opacity .15s; touch-action:manipulation; }
.level-up-deepen-btn:hover { filter:brightness(1.12); }
.level-up-deepen-btn:active { transform:scale(0.98); }
.level-up-deepen-btn:disabled { opacity:.5; cursor:default; filter:none; }

/* ============================================================
   TASK ASSISTANT PANEL (deliverable breakdown + timeline +
   drafts). Shared by the composer Task Assistant chip modal.
   Consumes the shell CSS variables so all skins (five, incl. retrowave) theme it.
   Priority tags: red = urgent, amber = high, blue = medium,
   grey = low. */
.ta-content { max-width: 540px; padding: 20px; }
.ta-body { padding-top: 2px; }
.ta-banner { padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--bg-active); border: 1px solid var(--line); border-left: 3px solid var(--accent); margin-bottom: 12px; }
.ta-banner-human { color: var(--text); font-size: 15px; font-weight: 700; line-height: 1.5; margin-bottom: 4px; }
.ta-banner-sub { color: var(--text-3); font-size: 12px; line-height: 1.5; }
.ta-input-wrap { margin-bottom: 12px; }
.ta-input-label { color: var(--text-2); font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.ta-input { width: 100%; box-sizing: border-box; resize: vertical; min-height: 108px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg-inset); color: var(--text); font-size: 14px; font-family: inherit; line-height: 1.6; outline: none; transition: border-color .15s, box-shadow .15s; }
.ta-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ta-input::placeholder { color: var(--text-4); }
.ta-hint { color: var(--text-4); font-size: 11.5px; line-height: 1.55; margin: 6px 2px 8px; }
.ta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ta-btn { border: none; font-family: inherit; font-weight: 700; cursor: pointer; border-radius: 12px; padding: 10px 14px; font-size: 13px; transition: filter .15s, transform .1s, background .15s, border-color .15s; touch-action: manipulation; }
.ta-btn:active { transform: scale(0.98); }
.ta-btn-primary { background: linear-gradient(135deg, var(--accent-lo), var(--accent)); color: #fff; }
.ta-btn-primary:hover { filter: brightness(1.12); }
.ta-btn-ghost { background: var(--bg-active); border: 1px solid var(--line-strong); color: var(--text-2); }
.ta-btn-ghost:hover { border-color: var(--accent-line); color: var(--text); background: var(--bg-hover); }
.ta-btn-ai { display: block; width: 100%; margin-top: 10px; background: var(--accent-lo); color: #fff; }
.ta-btn-ai:hover { filter: brightness(1.15); }
.ta-status { min-height: 18px; color: var(--danger); font-size: 12px; font-weight: 600; margin: 2px 0 8px; opacity: 0; transition: opacity .2s ease; }
.ta-status.is-visible { opacity: 1; }
.ta-results { margin-top: 4px; }
.ta-count { color: var(--text-3); font-size: 11.5px; font-weight: 600; margin-bottom: 10px; }
.ta-section { margin-bottom: 14px; }
.ta-section-title { color: var(--text-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.ta-muted { color: var(--text-4); font-size: 12.5px; line-height: 1.55; margin: 0; }
.ta-reco { background: var(--bg-active); border: 1px solid var(--accent-line); border-radius: 14px; padding: 10px 12px; }
.ta-reco-why { color: var(--text-3); font-size: 11.5px; margin-top: 6px; padding-left: 30px; }
.ta-task { display: flex; gap: 9px; align-items: flex-start; padding: 7px 2px; }
.ta-check { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.ta-task-body { min-width: 0; flex: 1; }
.ta-task-desc { color: var(--text); font-size: 13.5px; line-height: 1.5; word-break: break-word; }
.ta-task.is-done .ta-task-desc { color: var(--text-4); text-decoration: line-through; }
.ta-task-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.ta-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 9px; font-size: 10.5px; font-weight: 700; background: var(--bg-raise); border: 1px solid var(--line); color: var(--text-3); }
.ta-tag.is-urgent { color: #f85149; background: var(--danger-soft); border-color: transparent; }
.ta-tag.is-high { color: #d29922; background: var(--warn-soft); border-color: transparent; }
.ta-tag.is-medium { color: var(--accent-hi); background: var(--accent-soft); border-color: transparent; }
.ta-tag.is-imp { color: var(--gold-1); background: rgba(227, 179, 65, 0.14); border-color: transparent; }
.ta-tag.is-deadline { color: var(--text-2); }
.ta-slot { background: var(--bg-active); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.ta-slot-overdue { border-color: var(--danger); background: var(--danger-soft); }
.ta-slot-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ta-slot-title { color: var(--text); font-size: 13.5px; font-weight: 800; }
.ta-slot-time { color: var(--text-3); font-size: 11px; font-weight: 600; }
.ta-slot-tip { color: var(--text-3); font-size: 11.5px; line-height: 1.5; margin: 3px 0 2px; }
.ta-slot-overdue .ta-slot-title { color: var(--danger); }
.ta-slot-list { margin-top: 2px; }
.ta-draft-label { color: var(--text-3); font-size: 12px; margin-bottom: 6px; }
.ta-draft-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ta-draft-tab { background: var(--bg-active); border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; font-weight: 600; font-family: inherit; padding: 7px 11px; border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s, color .15s; touch-action: manipulation; }
.ta-draft-tab:hover { border-color: var(--accent-line); color: var(--text); }
.ta-draft-tab.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hi); }
.ta-draft-pre { margin: 0; padding: 11px 13px; background: var(--bg-inset); border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--text); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; font-family: inherit; max-height: 240px; overflow-y: auto; }
.ta-copy-ok { color: var(--ok); font-size: 12px; font-weight: 700; min-width: 60px; }

/* ============================================================
   WORKSPACE DRAWERS (v4) — right-side GROUP CHAT + left-side
   SUBFILES sidebar. Fixed slide-over panels docked into the free
   side margin on wide screens; full drawers with a dimmed backdrop
   on narrow viewports. Both consume the shell design tokens so all
   skins (five, incl. retrowave) stay coherent. group_chat.js / subfiles.js render the
   content; body.sf-open / body.gc-open drive the visibility.
   ============================================================ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 990; background: rgba(1,4,9,0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .22s ease; pointer-events: none; }
body.sf-open #sfBackdrop,
body.gc-open #gcBackdrop { opacity: 1; pointer-events: auto; }

.drawer { position: fixed; top: 0; bottom: 0; z-index: 995; display: flex; flex-direction: column; background: var(--bg); border-color: var(--line-strong); box-shadow: var(--shadow-pop); width: min(380px, 94vw); transition: transform .25s ease, visibility .25s ease; visibility: hidden; }
.drawer-left { left: 0; border-right: 1px solid var(--line-strong); transform: translateX(-105%); }
.drawer-right { right: 0; border-left: 1px solid var(--line-strong); transform: translateX(105%); }
body.sf-open .drawer-left,
body.gc-open .drawer-right { transform: translateX(0); visibility: visible; }

/* ============================================================
   v32 — THE CONSOLE COLUMN (docked, not a slide-over)
   ------------------------------------------------------------
   #app is a centered max-width:600px shell, so on a wide screen the side
   margins are empty and the projects column belongs in the LEFT margin
   permanently — the way the desktop console's sidebar always sits beside the
   chat. Below this width there is no free margin, so the column falls back to
   the v4 slide-over (🗂 opens it, the backdrop closes it).

   body.sf-docked    = wide enough to dock; the column is visible by default
   body.sf-collapsed = the reader hid it; 🗂 brings it back
   DOCK_MIN in subfiles.js must match this media query.
   ============================================================ */
@media (min-width: 1380px) {
    .drawer-backdrop { display: none !important; }
    .drawer-left, .drawer-right { width: min(340px, calc((100vw - 640px) / 2 - 6px)); }
    body.sf-docked #sfPanel { transform: none; visibility: visible; }
    body.sf-docked.sf-collapsed #sfPanel { transform: translateX(-105%); visibility: hidden; }
}

/* ---- shared drawer head / body / foot ---- */
.drawer-head { flex-shrink: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: calc(12px + var(--sat)) 12px 12px calc(16px + var(--sal)); background: var(--bg-raise); border-bottom: 1px solid var(--line); }
.drawer-head-text { min-width: 0; flex: 1; }
.drawer-eyebrow { display: block; font-size: 10px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-4); margin-bottom: 2px; }
.drawer-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-meta { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.drawer-foot { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + var(--sab)); background: var(--bg-raise); border-top: 1px solid var(--line); }

/* ============================================================
   SUBFILES (left drawer) — project → subfolder file tree
   ============================================================ */
.sf-list { padding: 10px 12px 6px; display: flex; flex-direction: column; gap: 8px; }
.sf-note { color: var(--text-3); font-size: 11.5px; line-height: 1.55; padding: 2px 4px 4px; }
.sf-empty { margin: auto; text-align: center; color: var(--text-4); font-size: 13px; line-height: 1.6; padding: 26px 10px; }
/* ---- Document actions in the left project bar (v31) --------------------
   The desktop console keeps Notebook / Spreadsheet / My Desktop at the top of
   its left sidebar; the web bar now does the same, pinned above the scrolling
   project list so a document is always one tap away. The My Desktop menu
   expands INLINE here (the Ideas-panel copy floats fixed and is placed from
   the toggle's rect), so the drawer needs no rect math of its own. */
.sf-doc-actions { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sf-doc-actions .action-btn { flex: 1 1 auto; margin: 0; width: auto; justify-content: center; }
.sf-doc-actions .md-nest { flex: 1 1 100%; display: flex; flex-direction: column; }
.sf-doc-actions .md-nest-toggle { width: 100%; justify-content: center; }
.sf-doc-actions .md-nest-menu { position: static; width: 100%; min-width: 0; margin-top: 6px; box-shadow: none; }
/* ---- Console column furniture (v32) -----------------------------------
   New Project, the PROJECTS / TRY PRO label with its counter, and the footer
   row — the items the desktop console's sidebar carries, in its order. */
.sf-new-project { flex-shrink: 0; margin: 10px 12px 0; padding: 11px 14px; min-height: 44px; border-radius: var(--radius-m); border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text); font-family: inherit; font-size: 13.5px; font-weight: 700; text-align: left; cursor: pointer; touch-action: manipulation; }
.sf-new-project:hover { filter: brightness(1.12); }
.sf-new-project:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.sf-side-label { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 4px; font-size: 10px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-4); }
.sf-count { font-size: 11px; font-weight: 700; letter-spacing: 0; color: var(--text-3); background: var(--bg-raise); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.sf-foot .btn-secondary { flex: 1 1 auto; justify-content: center; }
.sf-foot .btn-secondary:disabled { opacity: .5; cursor: not-allowed; }
/* ---- Pro showcase rows (hosted build: no server, so the list shows what Pro
   does and loads a real prompt for the visitor instead of pretending to hold
   project folders). ---------------------------------------------------- */
.sf-demo { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 44px; font-family: inherit; color: var(--text); cursor: pointer; touch-action: manipulation; }
.sf-demo:hover { border-color: var(--accent-line); background: var(--bg-hover); }
.sf-demo:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.sf-demo-name { font-size: 13.5px; font-weight: 650; }
.sf-demo-desc { font-size: 11px; color: var(--text-4); }
.sf-demo-chip { align-self: flex-start; margin-top: 5px; font-size: 9.5px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; color: var(--accent-hi); }
.sf-project { background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sf-project.is-open { border-color: var(--accent-line); }
.sf-project-head { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; color: var(--text); font-family: inherit; font-size: 13.5px; font-weight: 600; padding: 10px 10px; cursor: pointer; min-height: 44px; touch-action: manipulation; }
.sf-project-head:hover { background: var(--bg-hover); }
.sf-caret { flex: 0 0 auto; width: 14px; color: var(--text-4); font-size: 11px; }
.sf-project-icon { flex: 0 0 auto; font-size: 15px; }
.sf-project-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sf-project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-project-desc { color: var(--text-4); font-size: 11px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-open-chip { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--accent-hi); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 8px; padding: 4px 9px; }
.sf-open-chip:hover { filter: brightness(1.15); }
.sf-project-body { border-top: 1px solid var(--line); background: var(--bg-inset); padding: 4px 0 8px; }
.sf-tree { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.sf-file { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); padding: 4px 0; min-height: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-file-ico { flex: 0 0 auto; font-size: 13px; opacity: .85; }
.sf-sub { display: flex; flex-direction: column; }
.sf-sub-head { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: none; color: var(--text-2); font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 0; min-height: 36px; cursor: pointer; touch-action: manipulation; }
.sf-sub-head:hover { color: var(--text); }
.sf-sub-head .sf-caret { width: 12px; font-size: 10px; }

/* PROJECT STATUS STRIP — the conversation's project, at the top of the left bar.
   Four states, and the WORD in .sf-status-text carries the state: it is what a
   screen reader announces and what a reader who cannot see colour reads. The
   outline is the second cue, and only `ready` gets one. Unknown is deliberately
   NOT the dormant look (dashed border, --warn dot) because a failed read drawn
   as "no files yet" is a false negative; one_touch.py:159-207 is the same rule
   one layer down. The ready outline is STATIC so it survives the global
   prefers-reduced-motion rule at line 961, which zeroes every animation; the
   one-shot bloom is the only motion, it runs once, and losing it costs nothing. */
.sf-status { display: flex; align-items: flex-start; gap: 8px; margin: 0 16px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--bg-inset); min-width: 0; }
.sf-status[hidden] { display: none; }
.sf-status-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--text-4); }
.sf-status-text { flex: 1 1 auto; min-width: 0; font-size: 12px; line-height: 1.45; color: var(--text-2); }
.sf-status-action { flex: 0 0 auto; font-family: inherit; font-size: 11.5px; font-weight: 700; line-height: 1; color: var(--accent-hi); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 6px 10px; min-height: 26px; cursor: pointer; touch-action: manipulation; }
.sf-status-action:hover { filter: brightness(1.15); }
.sf-status-action[hidden] { display: none; }
.sf-status[data-state="unknown"] { border-style: dashed; border-color: var(--line-strong); }
.sf-status[data-state="unknown"] .sf-status-dot { background: var(--warn); }
.sf-status[data-state="ready"] { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok-soft), 0 0 12px rgba(63, 185, 80, 0.28); }
.sf-status[data-state="ready"] .sf-status-dot { background: var(--ok); box-shadow: 0 0 8px rgba(63, 185, 80, 0.6); }
.sf-status[data-state="ready"] .sf-status-text { color: var(--text); }
@keyframes sfStatusBloom {
    0% { box-shadow: 0 0 0 1px var(--ok), 0 0 20px rgba(63, 185, 80, 0.65); }
    100% { box-shadow: 0 0 0 1px var(--ok-soft), 0 0 12px rgba(63, 185, 80, 0.28); }
}
.sf-status.is-bloom { animation: sfStatusBloom 0.6s ease-out 1; }

/* ============================================================
   GROUP CHAT (right drawer) — rooms, messages, gentle moderation
   ============================================================ */
.drawer-tabs-row { flex-shrink: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.drawer-tabs-row::-webkit-scrollbar { display: none; }
.gc-tab { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-raise); color: var(--text-2); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s; touch-action: manipulation; white-space: nowrap; }
.gc-tab:hover { border-color: var(--accent-line); color: var(--text); }
.gc-tab.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hi); }
.gc-tab.is-active::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.gc-tab-add { border-style: dashed; color: var(--text-3); }
.drawer-body-chat { display: flex; overflow: hidden; }
.gc-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.gc-empty { margin: auto; text-align: center; color: var(--text-4); font-size: 13px; line-height: 1.5; padding: 24px 8px; }
.gc-msg.sys { align-self: center; max-width: 94%; display: flex; justify-content: center; }
.gc-msg.sys .gc-bubble { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--text-2); border-radius: 999px; padding: 5px 13px; font-size: 11.5px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.gc-msg.msg { display: flex; gap: 8px; max-width: 88%; align-items: flex-start; }
.gc-msg.msg.own { align-self: flex-end; flex-direction: row-reverse; }
.gc-ava { width: 28px; height: 28px; min-width: 28px; border-radius: 50%; background: var(--bg-active); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-2); overflow: hidden; }
.gc-msg.msg.own .gc-ava { background: linear-gradient(135deg, var(--accent-lo), var(--accent)); color: #fff; border-color: transparent; }
.gc-msg-inner { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.gc-msg.msg.own .gc-msg-inner { align-items: flex-end; }
.gc-meta-line { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-4); padding: 0 4px; }
.gc-msg.msg.own .gc-meta-line { flex-direction: row-reverse; }
.gc-author { font-weight: 700; color: var(--text-3); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-msg.msg .gc-bubble { background: var(--bg-raise); border: 1px solid var(--line); padding: 8px 12px; border-radius: 15px; border-top-left-radius: 4px; color: var(--text); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; word-break: break-word; }
.gc-msg.msg.own .gc-bubble { background: linear-gradient(135deg, var(--accent-lo), var(--accent)); border-color: transparent; color: #fff; border-radius: 15px; border-top-right-radius: 4px; }
.gc-composer { flex-direction: column; align-items: stretch; gap: 8px; }
.gc-composer-row { display: flex; align-items: center; gap: 8px; }
.gc-add-member { align-self: flex-start; background: var(--bg-active); border: 1px dashed var(--line-strong); color: var(--text-3); font-family: inherit; font-size: 11.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: border-color .15s, color .15s; touch-action: manipulation; }
.gc-add-member:hover { border-color: var(--accent-line); color: var(--text); }
.gc-input { flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-inset); color: var(--text); font-family: inherit; font-size: 15px; outline: none; -webkit-appearance: none; appearance: none; transition: border-color .2s, box-shadow .2s; }
.gc-input::placeholder { color: var(--text-4); }
.gc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gc-composer .send-btn { width: 46px; height: 46px; min-width: 46px; font-size: 19px; }

/* ============================================================
   LEGAL LINKS — Terms of Service + Privacy Policy.
   The full legal documents are standalone pages (tos.html /
   privacy.html). These styles dress the in-app entry points:
   the consent line in the first-launch Terms modal and the
   Legal group in Settings. Links always open in a new tab so
   the reader never loses an unsaved chat.
   ============================================================ */
.tos-legal-link { font-size: 12px; color: var(--text-3); margin: 10px 0 4px; line-height: 1.5; }
.tos-legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 14px; font-size: 13px; }
.tos-legal-links a {
    color: var(--accent); font-weight: 600; text-decoration: none;
    border-bottom: 1px solid transparent; transition: border-color .15s, color .15s;
}
.tos-legal-links a:hover { color: var(--accent-hi); border-bottom-color: var(--accent-line); }
.tos-legal-links span { color: var(--text-4); }
.setting-group .tos-legal-links { margin: 0; }


/* ---- Notebook (orbit-int shell v11) ---------------------------------------------------
   A Word-style document surface. The editor is a real contenteditable page
   sized to the modal, with a wrapping toolbar above it so formatting stays
   reachable on narrow phones. */
.notebook-content { max-width: 820px; }
.notebook-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px;
  margin-bottom: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
}
.nb-tool {
  min-width: 34px;
  min-height: 32px;
  padding: 4px 9px;
  background: var(--bg-active);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .15s, color .15s, border-color .15s;
}
.nb-tool:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.nb-tool:active { transform: scale(.96); }
.nb-tool.nb-underline u { text-underline-offset: 2px; }
.nb-sep { width: 1px; align-self: stretch; margin: 2px 4px; background: var(--line-strong); }
.notebook-content {
  min-height: 42vh;
  max-height: 48vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 20px;
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.75;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.notebook-content:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.notebook-content h1 { font-size: 25px; line-height: 1.3; margin: 0 0 12px; }
.notebook-content h2 { font-size: 20px; line-height: 1.3; margin: 18px 0 10px; }
.notebook-content p { margin: 0 0 12px; }
.notebook-content ul, .notebook-content ol { margin: 0 0 12px; padding-left: 26px; }
.notebook-content li { margin-bottom: 5px; }
.notebook-content blockquote {
  margin: 12px 0;
  padding: 4px 14px;
  border-left: 3px solid var(--accent-line);
  color: var(--text-2);
}
.notebook-content code {
  background: var(--bg-active);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: Consolas, Menlo, monospace;
  font-size: 13.5px;
}
.notebook-content:empty::before {
  content: 'Start writing…';
  color: var(--text-4);
}
.notebook-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
}
.notebook-actions .notebook-save { width: auto; padding: 12px 22px; margin: 0 4px 0 0; }
.notebook-list { display: flex; flex-direction: column; gap: 8px; }
.notebook-item {
  display: flex;
  align-items: stretch;
  gap: 6px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 4px;
}
.notebook-open {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-s);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.notebook-open:hover { background: var(--bg-hover); }
.notebook-item-name { font-size: 14.5px; font-weight: 600; }
.notebook-item-meta { font-size: 12px; color: var(--text-3); }
.notebook-del { margin: 0; align-self: center; }

/* ---- Ideas document actions (orbit-int shell v12) ----------------------
   The Notebook/Spreadsheet buttons own the top row of the Ideas panel so
   they are always visible, even before any idea row exists. */
.ideas-actions .action-btn { flex: 0 1 auto; }

/* ---- My Desktop (orbit-int shell v21) ---------------------------------
   ONE toggle nests the two device libraries (My Notebooks + My Spreadsheets)
   in the Ideas action row, so the row keeps its width instead of growing a
   button wider every release. The menu is position:fixed and placed from the
   toggle's own rect (openDesktopNest), so a modal or a scrollable row can
   never clip it; it closes on pick, outside click, Escape or resize. */
.md-nest { display: inline-flex; flex: 0 0 auto; }
.md-nest-toggle { position: relative; }
.md-nest-caret { font-size: 9px; line-height: 1; margin-left: 2px; transition: transform .15s; }
.md-nest-toggle[aria-expanded="true"] .md-nest-caret { transform: rotate(180deg); }
.md-nest-menu {
  position: fixed; z-index: 9800; display: flex; flex-direction: column; gap: 6px;
  min-width: 190px; padding: 8px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-m); background: var(--bg-raise);
  box-shadow: var(--shadow-pop);
}
.md-nest-menu[hidden] { display: none; }
.md-nest-item {
  display: flex; align-items: center; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--text); font-family: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap; touch-action: manipulation;
  transition: background .15s, border-color .15s, color .15s;
}
.md-nest-item:hover, .md-nest-item:focus-visible {
  background: var(--bg-hover); border-color: var(--accent-line); color: var(--text); outline: none;
}

/* ---- Spreadsheet (orbit-int shell v12) ---------------------------------
   A real <table> grid with sticky row/column headers. Cells are
   contenteditable and use the same tokens as the Notebook surface so every
   skin themes the grid automatically. */
.spreadsheet-content { max-width: 900px; }
.spreadsheet-grid {
  max-height: 46vh;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--bg-inset);
}
.ss-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.ss-table th, .ss-table td { border: 1px solid var(--line); padding: 0; }
.ss-colhead, .ss-rowhead, .ss-corner {
  background: var(--bg-active);
  color: var(--text-3);
  font-weight: 600;
  font-size: 12px;
  text-align: center;
  min-width: 74px;
  padding: 4px 6px;
}
.ss-colhead, .ss-corner { position: sticky; top: 0; z-index: 1; }
.ss-rowhead { position: sticky; left: 0; z-index: 1; min-width: 38px; }
.ss-corner { left: 0; z-index: 2; }
.ss-cell {
  min-width: 74px;
  height: 30px;
  padding: 5px 8px;
  color: var(--text);
  vertical-align: top;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
  transition: background .12s, box-shadow .12s;
}
.ss-cell:hover { background: var(--bg-hover); }
.ss-cell:focus, .ss-cell.ss-sel {
  background: var(--bg-hover);
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* ============================================================
   Device Vault (orbit-int shell v20)
   Device storage is the promise; cloud backup is optional.
   ============================================================ */
/* v83: the banner is fixed at top:0, so with no layout offset it covered the app
   header — the logo and the Settings / Clear / Feedback buttons — and on a narrow
   screen its wrapped copy could cover the whole header. device-vault.js publishes
   the height it actually needs as --vault-banner-h; the shell reserves exactly that
   much instead of overlapping, and #app is border-box so nothing overflows. */
body.vault-banner-open #app { padding-top: var(--vault-banner-h, 0px); }
#orbitVaultBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Must outrank .vault-overlay (9700). A banner carries its own dismiss/action
     buttons, and the overlay is full-viewport and swallows every click — so a
     banner shown while a vault modal is open (exporting a backup from the Vault
     panel does exactly that) had dead buttons until this was raised. */
  z-index: 9850;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  font: 13px/1.4 'Segoe UI', system-ui, sans-serif;
  color: #e6edf3;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.vault-banner-warn { background: #3a2a12; }
.vault-banner-risk { background: #3a1518; }
.vault-banner-ok { background: #12301f; }
.vault-banner-text { max-width: 820px; text-align: center; }
.vault-banner-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .08);
  color: #e6edf3;
  font: 600 12px 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
}
.vault-banner-btn:hover { background: rgba(255, 255, 255, .18); }

.vault-overlay {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 12, .72);
  backdrop-filter: blur(3px);
}
.vault-modal {
  width: min(620px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  background: #161b22;
  color: #e6edf3;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  font: 14px/1.55 'Segoe UI', system-ui, sans-serif;
}
.vault-modal-title { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.vault-muted { color: #9aa4b2; font-size: 13px; margin: 8px 0; }
.vault-error { color: #f85149; font-size: 13px; margin: 8px 0 0; min-height: 16px; }
.vault-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.vault-word-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 10px;
  margin: 12px 0;
  padding: 12px;
  list-style: none;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: 13px;
}
.vault-word { counter-increment: vaultword; }
.vault-word::before { content: counter(vaultword) '. '; color: #6b7482; }
.vault-word-grid { counter-reset: vaultword; }
.vault-code {
  display: block;
  word-break: break-all;
  padding: 10px 12px;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  font-size: 12px;
  color: #89b4fa;
}
.vault-phrase-input {
  width: 100%;
  box-sizing: border-box;
  background: #0d1117;
  color: #e6edf3;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  padding: 10px;
  font: 13px/1.5 'Segoe UI', system-ui, sans-serif;
  resize: vertical;
}
.vault-rows { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 14px; }
.vault-row { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.vault-row-label { color: #9aa4b2; }
.vault-row-value { font-weight: 600; text-align: right; }
.vault-warn { color: #e3b341; }
.vault-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.vault-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 9800;
  max-width: 90vw;
  padding: 10px 16px;
  background: #1f6feb;
  color: #fff;
  border-radius: 10px;
  font: 13px 'Segoe UI', system-ui, sans-serif;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}

/* Stop-processing control beside the composer's Send button. Visible only
   while a reply streams: Send queues what you typed, this cancels it. */
.stop-stream-btn {
  width: 40px; height: 40px; flex: 0 0 auto; margin-left: 8px;
  border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1;
  color: #ffd9d9; background: rgba(248, 81, 73, .16);
  border: 1px solid rgba(248, 81, 73, .55);
}
.stop-stream-btn:hover { background: rgba(248, 81, 73, .28); }
.stop-stream-btn:focus-visible { outline: 2px solid rgba(248, 81, 73, .7); outline-offset: 2px; }

/* 🧠 Remember chip (v61) — the answer actions all share one shape, so this is the
   same rule set as the Simplify chip rather than a second look for the same row. */
.msg-remember-btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; flex-shrink:0; min-height:28px; background:none; border:1px solid transparent; color:var(--text-3); font-family:inherit; font-size:11px; font-weight:600; line-height:1; padding:0 9px; border-radius:8px; cursor:pointer; opacity:0.85; transition:background .15s, color .15s, border-color .15s, opacity .15s, transform .1s; touch-action:manipulation; }
.msg-remember-btn .msg-remember-ico { font-size:12.5px; line-height:1; }
.msg-remember-btn:hover { opacity:1; color:var(--accent-hi); background:var(--bg-active); border-color:var(--line); }
.msg-remember-btn:active { transform:scale(0.94); }
.msg-remember-btn:focus-visible { outline:2px solid var(--accent-hi); outline-offset:1px; }
#myMemoryBody input[type="text"], #myMemoryBody textarea { width:100%; box-sizing:border-box; margin:2px 0 6px; padding:8px 10px; background:var(--bg-inset); color:var(--text); border:1px solid var(--line); border-radius:8px; font-family:inherit; font-size:13px; }

/* 💻 Code editor (v62). A monospace textarea on purpose: it behaves on a phone, needs
   no CDN, and keeps the shell offline-capable. Syntax highlighting would mean either a
   bundled parser or a third-party script in a page whose CSP allows almost nothing -
   a trade to make deliberately, not by accident. */
#codeText { width:100%; box-sizing:border-box; background:var(--bg-inset); color:var(--text); border:1px solid var(--line); border-radius:8px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:13px; line-height:1.55; padding:10px 12px; resize:vertical; tab-size:2; }
#codeName { width:100%; box-sizing:border-box; margin:2px 0 6px; padding:8px 10px; background:var(--bg-inset); color:var(--text); border:1px solid var(--line); border-radius:8px; font-family:inherit; font-size:13px; }
#codeLang { width:100%; box-sizing:border-box; margin:0 0 6px; padding:8px 10px; background:var(--bg-inset); color:var(--text); border:1px solid var(--line); border-radius:8px; font-family:inherit; font-size:13px; }
.code-file-list { display:flex; flex-wrap:wrap; gap:6px; margin:4px 0 8px; }
.code-ask-note { font-size:12px; color:var(--text-3); margin:6px 0 0; }
.code-diag { display:flex; align-items:flex-start; gap:8px; width:100%; text-align:left; background:none; border:1px solid transparent; border-radius:8px; padding:5px 8px; margin:2px 0; color:var(--text-2); font-family:inherit; font-size:12.5px; cursor:pointer; }
.code-diag:hover { background:var(--bg-hover); border-color:var(--line); }
.code-diag-line { flex:0 0 auto; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; opacity:.75; }
.code-diag-error .code-diag-line { color:var(--danger); }
.code-diag-warn .code-diag-line { color:var(--warn); }
.code-apply-btn { display:block; margin:6px 0 0 auto; background:var(--bg-active); color:var(--text-2); border:1px solid var(--line); border-radius:8px; padding:4px 10px; font-family:inherit; font-size:11.5px; font-weight:600; cursor:pointer; }
.code-apply-btn:hover { color:var(--accent-hi); border-color:var(--accent-line); }

/* --- Trust surface (v63): the receipt line on answers, and the panel ---------- */
/* Theme-safe on purpose: no palette variables, so it reads on every one of the
   legacy skins as well as the current ones. */
.msg-receipt {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 3px 9px;
    font-size: 11px;
    line-height: 1.5;
    font-family: inherit;
    color: inherit;
    opacity: .68;
    background: transparent;
    border: 1px solid rgba(128, 128, 128, .35);
    border-radius: 999px;
    cursor: pointer;
}
.msg-receipt:hover, .msg-receipt:focus-visible { opacity: 1; border-color: rgba(128, 128, 128, .7); }
.trust-head { margin-top: 14px; }
.trust-list { margin: 6px 0 0; padding-left: 18px; }
.trust-list li { font-size: 13px; line-height: 1.6; opacity: .8; margin-bottom: 2px; }
.trust-note { font-size: 12px; line-height: 1.6; opacity: .72; margin-top: 6px; }
.trust-warn { opacity: .95; font-weight: 600; }

/* --- Synthesis audit (v64): the evidence behind one answer -------------------- */
.synth-audit { display: block; margin-top: 6px; }
.synth-audit .synth-receipt { margin-top: 0; }
.synth-body { margin-top: 6px; padding: 8px 10px; border-left: 2px solid rgba(128, 128, 128, .35); }
.synth-list { margin: 0 0 6px; padding-left: 16px; }
.synth-item { font-size: 12px; line-height: 1.6; opacity: .85; margin-bottom: 3px; }
.synth-item-flagged { opacity: 1; font-style: italic; }
.synth-field {
    display: inline-block;
    padding: 0 6px;
    margin-right: 4px;
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
    border: 1px solid rgba(128, 128, 128, .4);
    border-radius: 999px;
    opacity: .85;
}
.synth-caveat { font-size: 11px; line-height: 1.6; opacity: .7; margin-top: 4px; }
.synth-warn { opacity: .95; font-weight: 600; }
.synth-copy { margin-top: 6px; font-size: 12px; }

/* --- The learning loop (v65): kept takeaways, and the reminder on the answer ------- */
.msg-recall { margin-left: 6px; }
.recall-pitch { margin-bottom: 8px; }
.recall-card {
    margin: 8px 0;
    padding: 8px 10px;
    border: 1px solid rgba(128, 128, 128, .3);
    border-radius: 8px;
}
.recall-card-due { border-color: rgba(128, 128, 128, .7); }
.recall-thesis { font-size: 13px; line-height: 1.6; font-weight: 600; }
.recall-meta { font-size: 11px; line-height: 1.6; opacity: .7; margin-top: 2px; }
.recall-facts { margin: 8px 0 4px; }
.recall-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.synth-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* --- The mentor algorithm (v66): the session block in the learner panel ----------- */
.mentor-block { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(128, 128, 128, .25); }
.mentor-topics li { opacity: .8; }
.mentor-brief { font-style: italic; }

/* --- Re-readability (v68): kept facts are readable, and a topic shows what was kept --- */
.recall-facts { margin: 8px 0 4px; }
.mentor-topic-what { font-size: 12px; line-height: 1.5; opacity: .72; margin-top: 2px; }

/* --- Ease of use (v72): the answer footer can carry four chips now (receipt, reminder,
   evidence audit, keep/distil). Without wrapping they crowded the timestamp on a narrow
   screen. */
.msg-foot { flex-wrap: wrap; }

/* --- 🧰 Templates / checklist builder (v110). NESTED inside the Marketplace panel:
   one native <details>, closed by default, so the builder holds no standing row on a
   phone. Same native-disclosure language as .setting-nest and .uplevel-nest: the
   browser opens the box, so it still opens with scripts blocked. --- */
.tpl-nest { margin-top:12px; border-top:1px solid var(--line); padding-top:12px; }
.tpl-nest-summary { display:flex; align-items:center; gap:6px; list-style:none; cursor:pointer; background:var(--bg-active); border:1px solid var(--line); border-radius:var(--radius-m); padding:10px 12px; font-size:13px; font-weight:600; color:var(--text-2); transition:border-color .15s, color .15s; }
.tpl-nest-summary::-webkit-details-marker { display:none; }
.tpl-nest-summary:hover { color:var(--text); border-color:var(--line-strong); }
.tpl-nest-summary:focus-visible { outline:none; box-shadow:0 0 0 2px var(--accent-soft); border-color:var(--accent-line); }
.tpl-nest-summary::before { content:'\25B8'; font-size:10px; line-height:1; opacity:.75; }
.tpl-nest[open] > .tpl-nest-summary { margin-bottom:8px; color:var(--text); border-color:var(--accent-line); }
.tpl-nest[open] > .tpl-nest-summary::before { content:'\25BE'; }
.tpl-nest-count { color:var(--text-4); font-weight:600; }
.tpl-body { padding:0 1px; }
/* A NATIVE <select> HAS TWO SURFACES and both are painted here: the control keeps the
   .buff-field colour, and every option carries its own, because the popup is painted by
   the BROWSER from the option rule and nothing else. That was v107's whole defect. */
#templatesSelect { width:100%; margin-bottom:8px; }
#templatesSelect option { background:var(--bg-inset); color:var(--text); }
.tpl-steps { display:flex; flex-direction:column; gap:2px; margin:6px 0 2px; }
.tpl-step { display:flex; align-items:flex-start; gap:8px; padding:6px 8px; border-radius:var(--radius-s); background:var(--bg-inset); border:1px solid var(--line); font-size:13px; line-height:1.5; color:var(--text-2); cursor:pointer; }
.tpl-step:hover { border-color:var(--line-strong); }
.tpl-step.is-done { opacity:.62; }
.tpl-step.is-done .tpl-step-text { text-decoration:line-through; }
.tpl-step-box { flex:0 0 auto; margin-top:3px; width:16px; height:16px; accent-color:var(--accent); cursor:pointer; }
.tpl-step-text { flex:1 1 auto; min-width:0; overflow-wrap:anywhere; }
.tpl-step-del { flex:0 0 auto; background:transparent; border:none; color:var(--text-4); font-size:12px; cursor:pointer; padding:0 2px; line-height:1.2; touch-action:manipulation; }
.tpl-step-del:hover, .tpl-step-del:focus-visible { color:var(--danger); }
.tpl-agent-btn { font-weight:700; }

/* --- 📖 Helper (the words) and 🏗️ Builder (the frames), 2026-09-26.
   TWO CLOSED MODALS behind one header icon each, so neither costs a standing row anywhere — the
   NEST rule is about the mobile screen area budget and this is what obeying it looks like when the
   operator asks for a button "at the top": the button goes in the row that already exists, and
   everything it opens is inside a modal that costs nothing until it is pressed.
   The checklist rows reuse .tpl-step / .tpl-step-box / .tpl-step-del on purpose: one checklist
   idiom in the product, one place its touch rules are written, and the ticked-step look cannot
   drift between the Marketplace builder and this one. --- */
.helper-content, .builder-content { width:min(720px, 96vw); max-width:720px; max-height:86vh; display:flex; flex-direction:column; }
.helper-content .modal-body, .builder-content .modal-body { flex:1; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
.helper-hint { margin-top:0; }
/* The search field and the count STAY PUT while the results scroll under them: the reader typing a
   word should not have to scroll back up to change it. */
.helper-pin { position:sticky; top:0; z-index:2; background:var(--bg-raise); padding:6px 0 8px; }
.helper-pin .buff-field { width:100%; }
.helper-group { font-size:13px; font-weight:700; color:var(--text-2); margin:14px 0 6px; }
.helper-term { background:var(--bg-inset); border:1px solid var(--line); border-radius:var(--radius-m); padding:10px 12px; margin-bottom:8px; }
.helper-word { font-size:14px; font-weight:700; color:var(--text); }
.helper-also { font-size:11.5px; color:var(--text-4); margin-top:2px; overflow-wrap:anywhere; }
.helper-plain { font-size:13px; line-height:1.5; color:var(--text-2); margin-top:5px; overflow-wrap:anywhere; }
.helper-eg { font-size:12.5px; line-height:1.5; color:var(--text-3); font-style:italic; margin-top:5px; overflow-wrap:anywhere; }
.helper-ask { margin-top:8px; padding-top:8px; border-top:1px dashed var(--line-strong); }
.helper-ask-lbl { display:block; font-size:11.5px; font-weight:700; color:var(--text-4); }
.helper-ask-line { display:block; font-size:12.5px; line-height:1.5; color:var(--text-2); margin:3px 0 7px; overflow-wrap:anywhere; }
/* A BOILERPLATE FRAME IS TEXT, NEVER MARKUP — that is the whole property, and it is why this box
   scrolls sideways rather than wrapping: a frame is code the reader copies, and re-wrapping it would
   change what they copy. The pane clips, so nothing here can drag the document sideways. */
.bd-frame { font-family:ui-monospace, SFMono-Regular, Consolas, 'Courier New', monospace; font-size:12px; line-height:1.5; color:var(--text-2); background:var(--bg); border:1px solid var(--line); border-radius:var(--radius-s); padding:10px; margin:6px 0 0; max-height:260px; overflow:auto; white-space:pre; tab-size:2; }
.builder-goal { font-size:12.5px; color:var(--text-2); margin-top:6px; overflow-wrap:anywhere; }
.builder-title { font-size:14px; font-weight:700; color:var(--text); margin:2px 0 4px; overflow-wrap:anywhere; }
.builder-warn { background:var(--bg-inset); border:1px solid var(--line-strong); border-left:3px solid #d29922; border-radius:var(--radius-s); padding:9px 11px; margin:9px 0 4px; }
.builder-warn-head { font-size:12.5px; font-weight:700; color:var(--text); }
.builder-warn-line { font-size:12.5px; line-height:1.5; color:var(--text-2); margin-top:5px; overflow-wrap:anywhere; }
.builder-frame { margin-top:10px; }
.builder-frame-head { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.builder-frame-path { font-size:12.5px; font-weight:700; color:var(--text); overflow-wrap:anywhere; }
.builder-frame-note { font-size:12px; line-height:1.45; color:var(--text-3); margin-top:3px; overflow-wrap:anywhere; }
.builder-progress { margin-top:6px; }
/* The SECOND surface of the picker (v107's lesson, applied before shipping this time): the popup is
   painted by the browser from the option rule and by nothing else. */
#builderSelect { width:100%; margin-bottom:8px; background:var(--bg-active); }
#builderSelect option { background:var(--bg-inset); color:var(--text); }

/* --- 🗺️ The cross-project idea graph (v110). NESTED inside the highlights index: one
   native <details>, closed by default, never a new screen. Same native-disclosure language
   as .setting-nest / .uplevel-nest / .tpl-nest. --- */
.hl-graph-nest { margin:10px 0 12px; }
.hl-graph-summary { display:flex; align-items:center; gap:6px; list-style:none; cursor:pointer; background:var(--bg-active); border:1px solid var(--line); border-radius:var(--radius-m); padding:10px 12px; font-size:13px; font-weight:600; color:var(--text-2); transition:border-color .15s, color .15s; }
.hl-graph-summary::-webkit-details-marker { display:none; }
.hl-graph-summary:hover { color:var(--text); border-color:var(--line-strong); }
.hl-graph-summary:focus-visible { outline:none; box-shadow:0 0 0 2px var(--accent-soft); border-color:var(--accent-line); }
.hl-graph-summary::before { content:'\25B8'; font-size:10px; line-height:1; opacity:.75; }
.hl-graph-nest[open] > .hl-graph-summary { margin-bottom:8px; color:var(--text); border-color:var(--accent-line); }
.hl-graph-nest[open] > .hl-graph-summary::before { content:'\25BE'; }
.hl-graph-pane { padding:0 2px; }
.hl-graph-nodes { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.hl-graph-node { background:var(--bg-inset); border:1px solid var(--line); border-radius:999px; color:var(--text-2); font-family:inherit; font-size:12px; font-weight:600; padding:5px 10px; cursor:pointer; touch-action:manipulation; }
.hl-graph-node:hover, .hl-graph-node:focus-visible { color:var(--text); border-color:var(--accent-line); }
.hl-graph-node.is-on { background:var(--accent-soft); border-color:var(--accent-line); color:var(--text); }
.hl-graph-edge { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:6px 8px; border:1px solid var(--line); border-radius:var(--radius-s); background:var(--bg-inset); margin-bottom:4px; }
.hl-graph-link { background:transparent; border:none; color:var(--text); font-family:inherit; font-size:12.5px; font-weight:600; padding:0; cursor:pointer; text-align:left; touch-action:manipulation; }
.hl-graph-link:hover, .hl-graph-link:focus-visible { color:var(--accent-hi); text-decoration:underline; }
.hl-graph-why { color:var(--text-4); font-size:11.5px; overflow-wrap:anywhere; }

/* --- ⚙️ More, nested inside the highlight actions panel (v110). The panel already sits on
   top of a chat on a phone; two more checkbox rows would have doubled it, so they go in a
   box inside the box. --- */
.msg-hl-more { margin-top:8px; border-top:1px solid var(--line); padding-top:8px; }
.msg-hl-more-summary { list-style:none; cursor:pointer; color:var(--text-3); font-size:12px; font-weight:600; padding:2px 0; }
.msg-hl-more-summary::-webkit-details-marker { display:none; }
.msg-hl-more-summary:hover, .msg-hl-more-summary:focus-visible { color:var(--text); }
.msg-hl-more-summary::before { content:'\25B8'; font-size:10px; margin-right:5px; opacity:.75; }
.msg-hl-more[open] > .msg-hl-more-summary::before { content:'\25BE'; }
.msg-hl-more-body { padding-top:2px; }
.msg-hl-auto { border-top:1px dashed var(--line); margin-top:6px; padding-top:6px; }

/* --- 🕵️ Secrets: "what are you sealing?" (v110). One collapsed picker replaces a standing
   carrier row and two always-visible cards, so the panel that held the most screen area now
   holds one summary line until it is wanted. --- */
.sec-nest { margin:10px 0 4px; }
.sec-nest-summary { display:flex; align-items:center; gap:6px; list-style:none; cursor:pointer; background:var(--bg-active); border:1px solid var(--line); border-radius:var(--radius-m); padding:10px 12px; font-size:13px; font-weight:600; color:var(--text-2); transition:border-color .15s, color .15s; }
.sec-nest-summary::-webkit-details-marker { display:none; }
.sec-nest-summary:hover { color:var(--text); border-color:var(--line-strong); }
.sec-nest-summary:focus-visible { outline:none; box-shadow:0 0 0 2px var(--accent-soft); border-color:var(--accent-line); }
.sec-nest-summary::before { content:'\25B8'; font-size:10px; line-height:1; opacity:.75; }
.sec-nest[open] > .sec-nest-summary { margin-bottom:8px; color:var(--text); border-color:var(--accent-line); }
.sec-nest[open] > .sec-nest-summary::before { content:'\25BE'; }
.sec-nest-body { padding:2px 1px 0; }
/* Both surfaces of this select, painted: the control keeps .buff-field's colour and every
   option carries its own, because the popup is painted by the BROWSER from the option rule
   and nothing else (v107's whole defect). */
#secretsKind { width:100%; }
#secretsKind option { background:var(--bg-inset); color:var(--text); }

/* ---- 🔎 Search your memory (v114) ----------------------------------------
   The nested search box inside the Highlights index. Same chrome as the idea graph's box above it
   (.hl-graph-summary / .hl-graph-nest), so the two disclosures read as a family rather than as two
   designs. Every result row is drawn by script.js with textContent; the <mark> it writes is styled
   here rather than left to the browser, because Chrome's own yellow would ignore this theme. */
.hl-find-nest { margin:10px 0 12px; }
.hl-find-summary { display:flex; align-items:center; gap:6px; list-style:none; cursor:pointer; background:var(--bg-active); border:1px solid var(--line); border-radius:var(--radius-m); padding:10px 12px; font-size:13px; font-weight:600; color:var(--text-2); transition:border-color .15s, color .15s; }
.hl-find-summary::-webkit-details-marker { display:none; }
.hl-find-summary:hover { color:var(--text); border-color:var(--line-strong); }
.hl-find-summary:focus-visible { outline:none; box-shadow:0 0 0 2px var(--accent-soft); border-color:var(--accent-line); }
.hl-find-summary::before { content:'\25B8'; font-size:10px; line-height:1; opacity:.75; }
.hl-find-nest[open] > .hl-find-summary { margin-bottom:8px; color:var(--text); border-color:var(--accent-line); }
.hl-find-nest[open] > .hl-find-summary::before { content:'\25BE'; }
.hl-find-body { display:flex; flex-direction:column; gap:8px; }
.hl-find-body .hint { margin:0; }
.hl-find-row-input { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.hl-find-row-input input { flex:1 1 180px; min-width:0; }
/* The results pane scrolls DOWN and never sideways: a row whose text wrapped into the right edge must
   not be able to drag the whole box, and a pane that can scroll horizontally is how a reader loses the
   end of a word they cannot see is there. */
.hl-find-results { display:flex; flex-direction:column; gap:6px; max-height:44vh; overflow-y:auto; overflow-x:hidden; }
.hl-find-row { display:flex; flex-direction:column; gap:2px; border:1px solid var(--line); border-radius:var(--radius-m); padding:7px 9px; background:var(--bg-inset); }
.hl-find-kind { font-size:11px; color:var(--text-3); letter-spacing:.02em; }
.hl-find-title { text-align:left; background:none; border:1px solid transparent; border-radius:8px; color:var(--text); font-family:inherit; font-size:13px; line-height:1.4; padding:2px 0; cursor:pointer; overflow-wrap:anywhere; }
.hl-find-title:hover { color:var(--accent); }
.hl-find-title:focus-visible { outline:none; box-shadow:0 0 0 2px var(--accent-soft); }
/* A SEARCH RESULT CARRIES ANY TEXT THE READER EVER STORED, so it must be able to break a word that has
   no spaces in it: a URL, a hashed anchor, a document id. Measured on 2026-09-24 at 360x800 with a
   passage containing `…/setup#step-2-which-is-a-long-unbroken-token`: the `<mark>` ran 21px past the
   right edge (right=381 on a 360px screen), which pushed the document's own scroll width out by 2px.
   The window did not visibly scroll — the pane clips — so the reader simply lost the end of the word
   with no way to reach it. `overflow-wrap:anywhere` fixes it WITHOUT breaking ordinary prose (a normal
   sentence still wraps at its spaces; this only applies when there is no space to wrap at). */
.hl-find-snippet { color:var(--text-2); font-size:12.5px; line-height:1.45; overflow-wrap:anywhere; }
.hl-find-meta { font-size:11px; color:var(--text-3); overflow-wrap:anywhere; }
/* The same pair the app already uses for a mark on a passage (.highlight-mark, line 329): the
   search hit IS a mark, so it wears the mark's colour rather than a second yellow of its own. */
.hl-find-hit { background:#ffd166; color:#0d1117; border-radius:3px; padding:0 1px; }

/* ---- Phone fit: the controls a thumb has to hit (v111) --------------------
   Measured at 12 real phone viewports by pytmp/probe_mobile_cdp.py, which sets the viewport through
   Emulation.setDeviceMetricsOverride over the DevTools protocol — `--window-size` CANNOT go below a
   500px minimum in headless Chrome, and a first version of that probe therefore took every "phone"
   measurement at 500px while printing 360. What this block fixes is the list that measurement
   produced: controls that were never given a 44px rule at all, and the smallest text. It is scoped to
   COARSE POINTERS so desktop geometry — and the browser suites that measure it — is untouched.
   IT LIVES AT THE END OF THE FILE ON PURPOSE: at equal specificity the later rule wins, so a
   media query about phones does NOT beat a plain `.buff-btn { min-height:36px }` defined further
   down. That is how the first version of this block fixed .buff-btn and changed nothing. */
@media (pointer:coarse) {
    /* The two smallest standing controls in the app: the Level Up pill and the 🖍️ Actions button
       were 26px tall, and the ⚙️ More summary 20px. */
    .msg-lu-toggle, .msg-hl-actions-toggle { min-height:44px; padding:0 14px; }
    /* A disclosure summary is a control; the browser draws the little marker, not the target. */
    .msg-hl-more-summary, .setting-summary, .hl-graph-summary, .tpl-nest-summary,
    .sec-nest-summary, .uplevel-summary, .hl-find-summary, .hl-find-title { min-height:44px; display:flex; align-items:center; }
    .md-nest-toggle { min-height:44px; display:inline-flex; align-items:center; }
    .md-nest-item { min-height:44px; display:flex; align-items:center; }
    .msg-hl-apply { min-height:44px; }
    .buff-btn { min-height:44px; display:inline-flex; align-items:center; }
    .buff-head-btn { min-height:44px; }
    .vault-banner-btn { min-height:44px; display:inline-flex; align-items:center; }
    .gc-add-member { min-height:44px; }
    .idea-new-btn, .idea-switcher-select { min-height:44px; }
    /* A checklist row IS the target for its own tick box. */
    .tpl-step { min-height:44px; }
    /* THE FOOTER FAMILY — every button that sits under an answer, raised on touch (v118). These are
       `min-height:28px` in the base stylesheet and most were in NO coarse-pointer rule: the v111
       phone-fit round raised `.msg-lu-toggle` and `.msg-hl-actions-toggle` and stopped there, because
       that round fixed the list its measurement produced and the measurement had no rendered message to
       look at. Measured on 2026-09-24 at 360x800 and 320x568: `msg-copy-btn` 28x68 and
       `msg-highlight-btn` 28x89 on EVERY screen, and a stylesheet walk then found five more in the same
       family (simplify, speak, clear, remember, the in-box mentor chip) plus the panel controls below.
       16px short of Apple's floor, on the buttons a reader touches after every single answer.
       `test_mobile_fit.js` now DERIVES this inventory from the stylesheet, which is why the next one of
       these cannot hide by being left out of a hand-written list. */
    .msg-copy-btn, .msg-highlight-btn, .msg-simplify-btn, .msg-speak-btn, .msg-clear-btn,
    .msg-remember-btn, .msg-lu-mentor-btn { min-height:44px; padding:0 12px; }
    /* The other controls the same walk turned up: panel head buttons and small actions, the notebook
       toolbar, the group-chat avatar (which opens the member list) and its tabs, the mentor pills, the
       idea like button, and the search field inside a panel. */
    .buff-head-btn, .buff-action-sm, .buff-buy, .nb-tool, .gc-ava, .gc-tab, .mentor-pill,
    .idea-like-btn { min-height:44px; }
    /* A modal's close button gets HEADROOM on touch: 46px, not 44. Measured 2026-09-24, twice, at
       320x568: its `offsetHeight` and `clientHeight` are both 44 while its painted RECT reads 42.66 —
       exactly 44 x 0.97, i.e. the modal's `modalIn` entrance animation (scale 0.985 at its start, and a
       press's active state is 0.97). A frame-stable sampler did not clear it at that one viewport, so
       the honest move is to stop sitting on the boundary: at 46px the painted rect clears 44 with
       room to spare whatever the compositor is doing. The floor is the floor, and a close button is
       the one control a reader reaches for when the screen in front of them is the problem. */
    .close-btn { min-height:46px; }
    /* A checkbox IS its row: `.tpl-step` and `.msg-hl-act` are the labels a thumb actually hits, and
       they carry the 44px rule. Sizing the input itself would grow the row for no gain. */
    .tpl-step-box, .msg-hl-act input { min-height:auto; }
    /* Panel fields and actions: .buff-field is 40px and .buff-action 40px, which is right for a
       mouse and 4px short of a thumb. */
    .buff-field, .buff-action, .buff-run-input { min-height:44px; }
    /* THE DELIBERATE COMPROMISE, and it is measured rather than assumed. The Actions panel is
       thirteen rows (seven actions, four formats, the switch, the Apply button); at Apple's 44px
       that is 572px — taller than a 568px phone — so the rows sit at 36px instead: comfortably above
       WCAG 2.5.8's 24px floor, above the app's own previous 23px, and short of 44 by choice.
       Everything the reader has to hit to OPEN the panel is at 44. */
    .msg-hl-act { min-height:36px; }
    .privacy-toggle-row { min-height:44px; }
    /* THE LEVEL UP STACK (v123). Both surfaces of the one switch, plus every chip in an answer's
       menu. `.msg-lu-btn` carried NO height rule at all in the base stylesheet, which is exactly
       the blind spot the v118 round wrote down: the derived inventory can only see a control the
       stylesheet gives a height to, so a chip sized by padding alone was a tap target nobody was
       measuring. The chips were ~26px, on the one menu a reader opens to reshape an answer.
       They are 44px here, and the menu is a CLOSED disclosure by default, so the extra height is
       paid only while it is open (the drawer is what the reader asked to see). */
    .msg-lu-always, .lu-always, .msg-lu-btn { min-height:44px; padding:0 12px; }
    .uplevel-always-hint { font-size:12.5px; }
    /* The floor for the smallest text: 11–11.5px labels read as "zoomed out" on a phone. */
    .msg-hl-act, .msg-hl-act-lbl, .msg-lu-toggle, .msg-hl-actions-toggle, .msg-hl-more-summary,
    .hl-graph-why, .buff-meta, .plan-text, .gc-add-member, .msg-hl-actions-word,
    .composer-legal, .timestamp { font-size:12.5px; }
    /* 📖 Helper and 🏗️ Builder (2026-09-26). The frames' copy buttons wear .buff-action-sm and the
       picker wears .buff-field, both already raised above — this block names them anyway so the NEXT
       person cannot change either class and quietly take these two with it. */
    .buff-action-sm, .helper-copy, .buff-field, #builderSelect { min-height:44px; }
    /* The ✕ that deletes a step the reader added. It had NO height rule at all — sized by a 12px
       glyph and 2px of padding — which is the blind spot this project wrote down at v118: the derived
       inventory can only see a control the stylesheet gives a height to, so a control sized by
       padding alone is a tap target nobody is measuring. Found by reading this round's own markup
       against that rule, not by a measurement, and stated as such. The row it sits in is already
       44px, so this grows only the part a thumb actually hits. */
    .tpl-step-del { min-height:44px; padding:0 10px; }
    /* The frames are code: 12px inside a modal is the smallest text here and it is monospaced, so it
       keeps its own size deliberately rather than joining the label floor above. */
    .bd-frame { font-size:12.5px; }
}

/* ============================================================
   📱 THE ONE REMAINING PHONE LEVER (NEXT_STEPS item 1) — the header's eighth icon.
   A phone header is 92px in the ordinary case and 137px while a browser is OFFERING an install,
   because the conditional ⬇️ `#installAppBtn` is the eighth icon and eight do not fit one 336px row
   at 360px (seven do), so the row wraps and the brand is pushed onto a second line.

   SCOPED TO WIDTH, NOT TO `pointer:coarse`, and the difference is the whole point: the constraint is
   the ROW'S WIDTH, so a tablet or a touch laptop — coarse pointer, room for all eight icons — must
   keep its install button. A `pointer:coarse` rule here would remove a real affordance from a device
   that has no problem to fix.

   NOTHING IS HIDDEN THAT IS ONLY HERE, and both halves were read out of the code rather than taken
   from the item's own prose, because a rule resting on a stale sentence is the defect this repo
   records more than any other: Settings carries its own install entry — it calls `promptOrbitInstall()`
   (`script.js:16673`), the same function this button calls — and the iOS path still explains the
   gesture in words, "tap Share … then choose Add to Home Screen" (`script.js:16557`). What is lost on
   a NARROW screen is therefore the second route to install, not the only one. */
@media (max-width:480px) {
    #installAppBtn { display:none; }
}

/* ============================================================
   BUILDER CARD (v160, builder.js)
   The answer to "build me X" is a thing you can run, so it gets
   a card: a header, three actions and a sandboxed preview. The
   palette is token-driven, so every skin themes it; the frame is
   sandboxed with an opaque origin (builder.js), which is why the
   card never needs to trust the generated code.
   ============================================================ */
.obc {
    margin: 14px 0 10px;
    border: 1px solid var(--line, #21262d);
    border-radius: 12px;
    background: rgba(255,255,255,0.035);
    background: color-mix(in srgb, var(--bg, #0d1117) 82%, #ffffff 8%);
    overflow: hidden;
}
.obc-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--line, #21262d);
}
.obc-title { font-weight: 650; font-size: 13.5px; }
.obc-kind { font-size: 11.5px; opacity: .62; }
.obc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
}
.obc-btn {
    appearance: none;
    border: 1px solid var(--line, #21262d);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 12.5px;
    line-height: 1;
    padding: 8px 11px;
    border-radius: 999px;
    cursor: pointer;
}
.obc-btn:hover { border-color: var(--accent, #58a6ff); }
.obc-btn:focus-visible { outline: 2px solid var(--accent, #58a6ff); outline-offset: 2px; }
.obc-btn-primary {
    border-color: var(--accent, #58a6ff);
    color: var(--accent, #58a6ff);
    font-weight: 600;
}
.obc-stage { border-top: 1px solid var(--line, #21262d); background: #ffffff; }
.obc-frame { display: block; width: 100%; height: 420px; border: 0; background: #ffffff; }
.obc-note { margin: 0; padding: 8px 12px 12px; font-size: 12px; opacity: .75; }
@media (max-width: 520px) {
    .obc-frame { height: 340px; }
    .obc-head { flex-direction: column; gap: 2px; }
}
