/* Lemnix HUD — original design: near-black field, one ion-aqua accent, amber for alerts. No third-party assets. */
:root {
  --bg: #04070a; --panel: #0c0c0f; --panel-2: #131317; --line: #24242b; --line-2: #3a3a44;
  --text: #ededf0; --muted: #9c9ca8; --white: #fff; --warn: #f0c674; --ok: #9fe0b5; --danger: #ff9b9b;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --accent: #45e6d4; --accent-rgb: 69,230,212; --accent-dim: rgba(69,230,212,.16); --alert: #ffb02e; --alert-rgb: 255,176,46;
  --level: 0;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.55 var(--sans); overflow-x: hidden; min-height: 100vh;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px; }
button, input, select { font: inherit; color: inherit; }
h1, h2 { margin: 0; font-weight: 500; }
p { margin: 0 0 .6rem; }
code, .mono { font-family: var(--mono); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--white); color: #000; padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .6rem 1rem;
  background: rgba(5,5,6,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-mark { width: 28px; height: 28px; color: var(--accent); filter: drop-shadow(0 0 6px rgba(var(--accent-rgb),.5)); }
.brand-name { display: block; font-family: var(--mono); letter-spacing: .32em; font-size: .95rem; }
.brand-sub { display: block; font-size: .78rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; flex: 1 1 auto; }
.chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line-2); border-radius: 999px; padding: .2rem .65rem; font-size: .82rem; }
.chip-v { color: var(--muted); font-family: var(--mono); font-size: .78rem; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.chip.ok .dot { background: var(--white); box-shadow: 0 0 8px rgba(255,255,255,.6); }
.top-tools { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-btn { background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px; padding: .3rem .75rem; min-height: 36px; font-size: .85rem; cursor: pointer; }
.chip-btn:hover { border-color: var(--muted); }
.chip-btn[aria-pressed="true"] { border-color: var(--white); }

/* ---------- layout ---------- */
.hud { display: grid; gap: 1rem; padding: 1rem; max-width: 1500px; margin: 0 auto; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .hud { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, .9fr); grid-template-areas: "conv core side"; align-items: start; padding: 1.5rem; }
  .conv { grid-area: conv; position: sticky; top: 76px; }
  .core { grid-area: core; }
  .side { grid-area: side; }
  .conv-list { max-height: calc(100vh - 170px); }
}
@media (min-width: 720px) and (max-width: 1099px) {
  .hud { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "core core" "conv side"; }
  .core { grid-area: core; } .conv { grid-area: conv; } .side { grid-area: side; }
}

.panel { background: rgba(12,12,15,.92); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; min-width: 0; }
.side { display: grid; gap: 1rem; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.panel-head h2, .settings summary h2 { font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.fine { font-size: .85rem; color: var(--muted); margin: .4rem 0 0; }
.warn-text { color: var(--warn); }
.empty { color: var(--muted); list-style: none; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .45rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.tag { font-family: var(--mono); font-size: .72rem; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 .4rem; color: var(--muted); }
.tag.ok { color: var(--ok); border-color: #3b5a46; } .tag.warn { color: var(--warn); border-color: #66542c; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .45rem 1rem; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; text-decoration: none; color: var(--text); font-weight: 500; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn.primary { background: var(--white); color: #050506; border-color: var(--white); }
.btn.primary:hover:not(:disabled) { background: #dadade; }
.btn.danger { color: var(--danger); border-color: #6b3434; background: #1a0e0f; }
.btn.small { min-height: 34px; padding: .25rem .7rem; font-size: .88rem; }
.btn.big { min-height: 54px; min-width: 180px; font-size: 1.05rem; letter-spacing: .04em; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: .3rem .4rem; min-height: 32px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- core / orb ---------- */
.core { position: relative; padding: 1.5rem 1rem 1.25rem; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.corner { position: absolute; width: 18px; height: 18px; border-color: var(--line-2); border-style: solid; }
.corner.tl { top: 0; left: 0; border-width: 1px 0 0 1px; } .corner.tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.corner.bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; } .corner.br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
.orb-wrap { width: min(300px, 70vw); aspect-ratio: 1; }
.orb { width: 100%; height: 100%; overflow: visible; }
.orb .ring { fill: none; stroke: var(--white); transform-origin: 100px 100px; }
.orb .r1 { stroke-opacity: .28; stroke-width: .8; stroke-dasharray: 2 6; animation: spin 60s linear infinite; }
.orb .r2 { stroke-opacity: .5; stroke-width: 1; stroke-dasharray: 60 14 4 14; animation: spin 40s linear infinite reverse; }
.orb .r3 { stroke-opacity: .7; stroke-width: 1.2; }
.orb .ticks line { stroke: var(--white); stroke-opacity: .5; stroke-width: 1; }
.orb .level { fill: none; stroke: var(--white); stroke-width: 1.5; stroke-opacity: calc(.25 + var(--level) * .75);
  transform-origin: 100px 100px; transform: scale(calc(1 + var(--level) * .3)); transition: transform 60ms linear; }
.orb .core-dot { fill: var(--white); fill-opacity: .9; transform-origin: 100px 100px; }
body.state-listening .orb .r3 { stroke-dasharray: 4 4; animation: spin 8s linear infinite; }
body.state-thinking .orb .r2 { animation-duration: 6s; }
body.state-thinking .orb .core-dot { animation: breathe 1.2s ease-in-out infinite; }
body.state-speaking .orb .core-dot { animation: breathe .6s ease-in-out infinite; }
body.state-standby .orb .core-dot { fill-opacity: .75; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(.86); fill-opacity: .6; } }

.state-line { display: flex; align-items: center; gap: .55rem; margin-top: .6rem; }
.state-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
body.state-listening .state-dot, body.state-speaking .state-dot, body.state-thinking .state-dot { background: var(--white); box-shadow: 0 0 10px var(--white); }
.state-label { font-family: var(--mono); font-size: 1.1rem; letter-spacing: .28em; text-transform: uppercase; }
.transcript { min-height: 1.6em; margin: .6rem 0 .4rem; font-size: 1.15rem; max-width: 36rem; overflow-wrap: anywhere; }
.controls { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.hint { color: var(--muted); font-size: .9rem; margin: .2rem 0 0; max-width: 32rem; }
.cmd { display: flex; gap: .5rem; width: 100%; max-width: 560px; margin-top: 1rem; }
.cmd input { flex: 1; min-width: 0; background: #08080a; border: 1px solid var(--line-2); border-radius: 8px; padding: .6rem .8rem; min-height: 46px; }
.cmd input:focus { border-color: var(--white); }

.pending { width: 100%; max-width: 560px; display: grid; gap: .6rem; margin-top: .8rem; }
.pending-card { text-align: left; border: 1px solid var(--white); border-radius: 10px; padding: .85rem 1rem; background: #0f0f12; box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.pending-h { font-family: var(--mono); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .35rem; }
.pending-what { font-size: 1.05rem; overflow-wrap: anywhere; }
.pending-card code, .cmdline { font-size: .8rem; overflow-wrap: anywhere; }
.cmdline { display: block; margin-top: .4rem; color: var(--muted); }

/* ---------- conversation ---------- */
.conv-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; display: grid; gap: .55rem; }
.msg { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .75rem; background: var(--panel-2); min-width: 0; }
.msg.user { border-color: var(--line-2); background: #0a0a0d; }
.msg.error { border-color: #5e4a2a; }
.msg-meta { display: flex; gap: .5rem; align-items: center; font-size: .78rem; color: var(--muted); font-family: var(--mono); margin-bottom: .2rem; }
.msg-meta time { margin-left: auto; }
.msg-text { margin: 0 0 .3rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.files { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .35rem; }
.files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .5rem; align-items: center; border-top: 1px solid var(--line); padding-top: .35rem; }
.f-name { overflow-wrap: anywhere; } .f-path { grid-column: 1; font-size: .78rem; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }
.files .btn { grid-row: 1 / span 2; grid-column: 2; }

/* ---------- side ---------- */
.sys { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .8rem; margin: 0; }
.sys dt { color: var(--muted); font-size: .85rem; }
.sys dd { margin: 0; overflow-wrap: anywhere; }
.big-time { font-size: 1.25rem; letter-spacing: .06em; }
.timer .t-left { font-size: 1.3rem; }
.timer .link-btn { margin-left: auto; }
.note span { flex: 1; overflow-wrap: anywhere; }
.settings summary { cursor: pointer; list-style: none; min-height: 32px; display: flex; align-items: center; }
.settings summary::before { content: "+"; font-family: var(--mono); margin-right: .5rem; color: var(--muted); }
.settings[open] summary::before { content: "−"; }
.field { margin: .7rem 0; }
.field label { display: block; margin-bottom: .3rem; font-size: .9rem; }
.field select, .field input[type=range] { width: 100%; }
select { background: #08080a; border: 1px solid var(--line-2); border-radius: 8px; padding: .45rem .6rem; min-height: 42px; }
.check { display: flex; gap: .5rem; align-items: center; margin: .6rem 0; }
.check input { width: 20px; height: 20px; accent-color: #fff; }

/* ---------- dialog ---------- */
.dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(0,0,0,.75); }
.dlg-form { padding: 1.2rem; } .dlg-form h2 { font-size: 1.15rem; margin-bottom: .5rem; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }

/* ---------- motion ---------- */
.motion-paused *, .motion-paused *::before, .motion-paused *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .orb .level { transform: none; }
}
.motion-paused .orb .level { transform: none; }

/* ---------- v2 components ---------- */
.examples { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; max-width: 560px; margin-top: .8rem; align-items: center; }
.ex-label { font-family: var(--mono); font-size: .75rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.ex { background: transparent; border: 1px dashed var(--line-2); border-radius: 999px; padding: .25rem .7rem; font-size: .85rem; color: var(--muted); cursor: pointer; min-height: 32px; }
.ex:hover { color: var(--text); border-color: var(--muted); border-style: solid; }
.attention { width: 100%; max-width: 560px; display: grid; gap: .5rem; margin-top: .8rem; }
.att-card { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; text-align: left; border: 1px solid var(--white); border-radius: 10px; padding: .6rem .8rem; background: #0f0f12; }
.att-card.missed { border-color: #66542c; }
.att-text { flex: 1 1 160px; font-weight: 500; overflow-wrap: anywhere; }
.rem { align-items: flex-start !important; }
.rem .t-left { font-size: 1.05rem; min-width: 5.2em; }
.rem-body { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.rem .fine { margin: 0; }
.routine { flex-direction: column; align-items: stretch !important; }
.rt-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; overflow-wrap: anywhere; }
.rt-form { border: 1px solid var(--line-2); border-radius: 8px; padding: .7rem; margin-bottom: .6rem; background: var(--panel-2); }
.rt-form input, .rt-form textarea, .inline input { width: 100%; background: #08080a; border: 1px solid var(--line-2); border-radius: 8px; padding: .5rem .65rem; min-height: 42px; color: var(--text); font: inherit; }
.rt-form textarea { font-family: var(--mono); font-size: .88rem; resize: vertical; }
.field-error { color: var(--warn); font-size: .88rem; margin-top: .35rem; }
.field-error:empty { display: none; }
.inline { display: flex; gap: .5rem; }
.inline input { flex: 1; min-width: 0; }
.set-block { border-top: 1px solid var(--line); padding-top: .7rem; margin-top: .7rem; }
.set-block:first-child { border-top: 0; margin-top: .3rem; padding-top: 0; }
.set-block h3 { font-size: .95rem; margin: 0 0 .4rem; font-weight: 600; }
.steps-list { padding-left: 1.2rem; margin: .3rem 0 .6rem; } .steps-list li { margin: .2rem 0; }
.msg-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.msg.system { border-color: var(--white); }

/* ---------- v3 ---------- */
.shop-form { margin-bottom: .5rem; }
.shop.done span { text-decoration: line-through; color: var(--muted); }
.shop .check { flex: 1; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.stopwatch { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; }
.ex.all { border-style: solid; color: var(--text); }
.cmd-group { margin: .8rem 0; }
.cmd-group h3 { font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .4rem; font-weight: 500; }
.dialog { max-height: calc(100vh - 32px); overflow: auto; }

/* ---------- v4 ---------- */
.conn-banner { position: sticky; top: 0; z-index: 15; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem 1rem; background: #2a1d0c; border-bottom: 1px solid #6b5730; color: #f6e2b8; }
.conn-banner[hidden] { display: none; }
.msg.ai-cmd { padding: .35rem .75rem; background: transparent; border-style: dashed; }
.msg.ai-cmd .msg-text { font-family: var(--mono); font-size: .88rem; color: var(--muted); }
.msg .ex { margin: .2rem .3rem 0 0; }

/* =====================================================================
   v0.5 — Immersive stage (default) and Dashboard layout
   ===================================================================== */
.orb-wrap { position: relative; }
#orb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.orb-wrap .orb { position: relative; }
.mic-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 48px; padding: 0 1.1rem 0 .9rem; border-radius: 999px; border: 0; background: var(--white); color: #050506; font-weight: 600; cursor: pointer; flex: none; }
.mic-btn svg { width: 18px; height: 18px; }
.mic-btn[aria-pressed="true"] { background: #ffdede; }
.mic-btn:disabled { opacity: .4; cursor: not-allowed; }
.cmd { align-items: center; }
.caption { width: 100%; max-width: 46rem; text-align: center; margin-top: .6rem; }
.caption:empty, .cap-you:empty, .cap-me:empty { display: none; }
.cap-you { color: var(--muted); font-size: .98rem; margin: 0 0 .35rem; overflow-wrap: anywhere; }
.cap-me { font-size: clamp(1.15rem, 2.4vw, 1.6rem); line-height: 1.45; margin: 0; overflow-wrap: anywhere; }
.cap-me .w { opacity: .32; transition: opacity .12s linear; }
.cap-me .w.on, .cap-me.done .w { opacity: 1; }
.cap-me.err { color: var(--warn); }
.answer-card { width: 100%; max-width: 30rem; margin-top: .9rem; border: 1px solid var(--line-2); border-radius: 16px; padding: 1rem 1.2rem; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); text-align: left; animation: rise .35s ease-out both; }
.answer-card[hidden] { display: none; }
.ac-big { font-size: clamp(2rem, 6vw, 3rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-family: var(--sans); overflow-wrap: anywhere; }
.ac-sub { color: var(--muted); margin-top: .3rem; }
.ac-row { display: flex; align-items: center; gap: 1rem; }
.ac-icon { width: 64px; height: 64px; flex: none; color: var(--white); }
.ac-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .6rem; color: var(--muted); font-size: .92rem; }
.ac-list { margin: .5rem 0 0; padding-left: 1.1rem; } .ac-list li { margin: .15rem 0; overflow-wrap: anywhere; }
.ac-title { font-family: var(--mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.glance { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1rem; }
.glance button { display: inline-flex; gap: .45rem; align-items: center; border: 1px solid var(--line-2); background: rgba(12,12,15,.8); border-radius: 999px; padding: .35rem .85rem; min-height: 38px; cursor: pointer; font-size: .9rem; color: var(--text); }
.glance button:hover { border-color: var(--muted); }
.glance .mono { font-family: var(--mono); }
.drawer-head { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 25; }
.scrim[hidden] { display: none; }

/* ---------- Immersive ---------- */
.view-immersive .hud { display: block; max-width: none; padding: 0; }
.view-immersive .core { min-height: calc(100vh - 66px); min-height: calc(100dvh - 66px); justify-content: center; padding: clamp(1rem, 4vh, 2.5rem) 1rem 1.5rem; }
.view-immersive .corner { width: 26px; height: 26px; margin: 14px; opacity: .6; }
.view-immersive .orb-wrap { width: min(44vh, 76vw, 440px); }
.view-immersive .orb-wrap .orb { opacity: .55; }
.view-immersive .cmd { max-width: 680px; background: rgba(16,16,20,.92); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px; margin-top: 1.2rem; }
.view-immersive .cmd input { border: 0; background: transparent; min-height: 48px; font-size: 1.05rem; }
.view-immersive .cmd input:focus { outline: none; }
.view-immersive .cmd:focus-within { border-color: var(--white); }
.view-immersive .send-btn { border-radius: 999px; }
.view-immersive .examples { margin-top: .9rem; }
.view-immersive .drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); z-index: 30; background: var(--bg); border-left: 1px solid var(--line-2);
  overflow: auto; padding: .8rem; display: grid; gap: .8rem; align-content: start; transform: translateX(105%); transition: transform .28s ease; visibility: hidden; }
.view-immersive.drawer-open .drawer { transform: none; visibility: visible; }
.view-immersive .drawer-head { display: flex; justify-content: flex-end; position: sticky; top: -0.8rem; background: var(--bg); padding: .2rem 0; z-index: 1; }
.view-immersive .conv-list { max-height: 50vh; }
.view-immersive .sidenote { display: none; }

/* ---------- Dashboard (the classic 3-column view) ---------- */
.view-dashboard .drawer { display: contents; }
.view-dashboard .glance { display: none; }
.view-dashboard .caption, .view-dashboard .answer-card { max-width: 560px; }

/* ---------- Welcome ---------- */
.welcome { background: radial-gradient(ellipse at 50% 30%, #17171c 0%, #050506 70%); color: var(--text); border: 1px solid var(--line-2); border-radius: 20px; padding: 0; width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
.welcome::backdrop { background: rgba(0,0,0,.82); }
.wl { padding: clamp(1.2rem, 4vw, 2.2rem); text-align: center; }
.wl h2 { font-size: clamp(1.6rem, 5vw, 2.3rem); letter-spacing: -.02em; margin: .6rem 0 .4rem; }
.wl p { color: #cfcfd6; }
.wl .wl-orb { width: 120px; height: 120px; margin: 0 auto; }
.wl .row { justify-content: center; margin-top: 1rem; }
.wl-try { display: grid; gap: .5rem; margin: 1rem auto 0; max-width: 420px; }
.wl-try button { text-align: left; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); border-radius: 12px; padding: .75rem 1rem; color: var(--text); cursor: pointer; min-height: 48px; font-size: 1rem; }
.wl-try button:hover { border-color: var(--white); }
.wl-step { font-family: var(--mono); font-size: .75rem; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.wl-note { font-size: .9rem; color: var(--muted) !important; margin-top: 1rem; }

@media (max-width: 600px) {
  .view-immersive .orb-wrap { width: min(38vh, 70vw); }
  .view-immersive .cmd { border-radius: 18px; flex-wrap: wrap; }
  .view-immersive .cmd input { flex-basis: 100%; order: -1; }
  .mic-btn { flex: 1; justify-content: center; }
  .top-tools { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .view-immersive .drawer { transition: none; } }

/* ---------- v0.5 fixes: docked input, shrinking orb, compact top bar, clean drawer ---------- */
.view-immersive .core { padding-bottom: 230px; }
.view-immersive .dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; padding: 2.2rem 1rem calc(.8rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(5,5,6,0) 0%, rgba(5,5,6,.92) 30%, #050506 100%); pointer-events: none; }
.view-immersive .dock > * { pointer-events: auto; }
.view-immersive .dock .cmd { margin-top: .6rem; width: 100%; }
.view-immersive .dock .examples { max-width: 820px; }
.view-immersive .dock .hint { margin-top: .4rem; font-size: .82rem; }
.view-immersive .dock .glance { margin-top: .5rem; }
.dock { width: 100%; display: flex; flex-direction: column; align-items: center; }
.view-immersive .orb-wrap { transition: width .35s ease; }
.view-immersive.has-answer .orb-wrap { width: min(24vh, 230px); }
.view-immersive.has-card .cap-me { font-size: clamp(1rem, 1.8vw, 1.2rem); color: #d6d6dc; }
/* drawer: undo the dashboard grid placement inside the sheet */
.view-immersive .drawer .conv, .view-immersive .drawer .side { grid-area: auto; position: static; }
.view-immersive .drawer .side { display: grid; gap: .8rem; }
.chip.mode { border-color: var(--line-2); }
@media (max-width: 900px) {
  .view-immersive #btn-view, .view-immersive #btn-speak, .view-immersive #btn-motion { display: none; }
  .view-immersive .top-tools { width: auto; margin-left: auto; }
  .view-immersive .topbar { flex-wrap: nowrap; }
  .view-immersive .chips { display: none; }
}
@media (max-width: 600px) {
  .view-immersive .core { padding-bottom: 270px; }
  .view-immersive .dock .examples { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100%; padding-bottom: .2rem; scrollbar-width: none; }
  .view-immersive .dock .examples .ex { flex: none; }
  .view-immersive .dock .hint { display: none; }
  .brand-sub { display: none; }
  .view-immersive.has-answer .orb-wrap { width: min(20vh, 150px); }
}
@media (max-height: 700px) { .view-immersive.has-answer .orb-wrap { width: min(18vh, 150px); } }

/* ---------- v0.7 HUD: accent, telemetry, start-up check, alerts, holographic panels ---------- */
body { background-image: radial-gradient(ellipse 60% 45% at 50% 38%, rgba(var(--accent-rgb), .07), transparent 70%),
  linear-gradient(rgba(var(--accent-rgb), .03) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--accent-rgb), .03) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px; }
.brand-name { color: var(--accent); text-shadow: 0 0 12px rgba(var(--accent-rgb), .45); }
.orb .ring, .orb .ticks line, .orb .level { stroke: var(--accent); }
.orb .core-dot { display: none; }
.view-immersive .orb-wrap .orb { opacity: .35; }
.state-dot { background: var(--accent) !important; box-shadow: 0 0 10px var(--accent) !important; }
.state-label { color: var(--accent); }
.corner { border-color: rgba(var(--accent-rgb), .55); }
.view-immersive .cmd:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.mic-btn[aria-pressed="true"] { background: var(--accent) !important; color: #031614 !important; }

/* Telemetry: four readouts framing the core (wide screens, immersive view) */
.tele { display: none; }
.view-immersive .tele { display: block; position: absolute; inset: 0; pointer-events: none; }
.tl-blk { position: absolute; display: grid; gap: .1rem; font-size: .78rem; color: var(--muted); max-width: 15rem; }
.tl-k { font-family: var(--mono); letter-spacing: .2em; text-transform: uppercase; font-size: .68rem; color: rgba(var(--accent-rgb), .8); }
.tl-v { font-size: 1.35rem; color: var(--text); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tl-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-a { top: 3.4rem; left: 3.4rem; } .tl-c { top: 8.6rem; left: 3.4rem; }
.tl-b { top: 3.4rem; right: 3.4rem; text-align: right; } .tl-d { top: 8.6rem; right: 3.4rem; text-align: right; }
.tl-blk::before { content: ""; position: absolute; top: .45rem; width: 2.2rem; height: 1px; background: rgba(var(--accent-rgb), .45); }
.tl-a::before, .tl-c::before { left: -2.8rem; } .tl-b::before, .tl-d::before { right: -2.8rem; }
.tele.low #tele-power { color: var(--alert); }
@media (max-width: 1000px) { .view-immersive .tele { display: none; } }

/* Start-up system check */
.boot { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background-color: #020406; background-image: radial-gradient(ellipse at 50% 40%, rgba(var(--accent-rgb), .12), rgba(2,4,6,0) 65%); cursor: pointer;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); transition: opacity .3s ease; }
.boot[hidden] { display: none; }
.boot.bt-out { opacity: 0; }
.bt-inner { width: min(560px, 100%); font-family: var(--mono); }
.bt-title { color: var(--accent); letter-spacing: .3em; font-size: .9rem; margin-bottom: 1.2rem; text-shadow: 0 0 14px rgba(var(--accent-rgb), .6); }
.bt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.bt-line { display: flex; gap: .6rem; align-items: baseline; opacity: 0; transform: translateX(-6px); transition: opacity .18s, transform .18s; font-size: .9rem; }
.bt-line.on { opacity: 1; transform: none; }
.bt-label { color: var(--muted); text-transform: uppercase; letter-spacing: .14em; white-space: nowrap; }
.bt-dots { flex: 1; border-bottom: 1px dotted rgba(var(--accent-rgb), .3); transform: translateY(-.25rem); min-width: 1rem; }
.bt-val { color: var(--text); text-align: right; }
.bt-line.ok .bt-val { color: var(--accent); } .bt-line.warn .bt-val { color: var(--alert); }
.bt-sum { margin-top: 1.3rem; color: var(--text); font-size: 1rem; opacity: 0; transition: opacity .25s; }
.boot.bt-sum-on .bt-sum { opacity: 1; }

/* Alert state: amber HUD */
body.alerting { --accent: var(--alert); --accent-rgb: var(--alert-rgb); }
body.alerting::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 40; box-shadow: inset 0 0 0 2px rgba(var(--alert-rgb), .9), inset 0 0 120px rgba(var(--alert-rgb), .25); animation: alertPulse 1s ease-in-out infinite; }
@keyframes alertPulse { 50% { box-shadow: inset 0 0 0 2px rgba(var(--alert-rgb), .4), inset 0 0 60px rgba(var(--alert-rgb), .1); } }
.att-card { border-color: var(--alert); box-shadow: 0 0 24px rgba(var(--alert-rgb), .18); }

/* Holographic answer panels */
.answer-card { position: relative; border-color: rgba(var(--accent-rgb), .45); background: linear-gradient(180deg, rgba(var(--accent-rgb), .08), rgba(var(--accent-rgb), .02)); box-shadow: 0 0 30px rgba(var(--accent-rgb), .08), inset 0 0 20px rgba(var(--accent-rgb), .04); border-radius: 6px; overflow: hidden; }
.answer-card::before, .answer-card::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--accent); }
.answer-card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; } .answer-card::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.answer-card.scan { animation: holoIn .45s ease-out both; }
@keyframes holoIn { from { clip-path: inset(0 0 100% 0); filter: brightness(1.8); } to { clip-path: inset(0 0 0 0); filter: none; } }
.ac-title { color: var(--accent); }
.ac-icon { color: var(--accent); }
.ac-status, .ac-proto { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; }
.ac-status li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgba(var(--accent-rgb), .12); padding-bottom: .3rem; font-size: .95rem; }
.st-k { font-family: var(--mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-top: .15rem; }
.st-v { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.ac-status li.ok .st-v { color: var(--accent); } .ac-status li.warn .st-v { color: var(--alert); }
.ac-proto li { display: grid; grid-template-columns: 1.1rem 1fr auto; gap: .6rem; align-items: center; font-size: .95rem; }
.ps-mark { width: .7rem; height: .7rem; border: 1px solid var(--line-2); border-radius: 2px; }
.ps-running .ps-mark { border-color: var(--accent); background: rgba(var(--accent-rgb), .4); animation: breathe 1s ease-in-out infinite; }
.ps-done .ps-mark { background: var(--accent); border-color: var(--accent); }
.ps-confirm .ps-mark, .ps-skipped .ps-mark { border-color: var(--alert); }
.ps-link .ps-mark { border-color: var(--accent); }
.ps-text { overflow-wrap: anywhere; min-width: 0; } .ps-state { font-family: var(--mono); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.ps-done .ps-state { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .answer-card.scan, body.alerting::after, .ps-running .ps-mark { animation: none; } .bt-line { transition: none; } }
.motion-paused .answer-card.scan, .motion-paused body.alerting::after { animation: none; }

/* status panel: two columns where there's room, so it fits above the docked input */
.answer-card[data-type="status"] { max-width: 40rem; }
@media (min-width: 700px) { .ac-status { grid-template-columns: 1fr 1fr; column-gap: 1.6rem; } }

/* =====================================================================
   v0.8 — Deep space. A silent field of stars, one black hole, and the warm light of its disk.
   The gold light is the only bright colour; everything else stays quiet.
   ===================================================================== */
@font-face { font-family: "Oxanium"; src: url("fonts/oxanium-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-300.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-ext-300.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Oxanium"; src: url("fonts/oxanium-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-ext-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Oxanium"; src: url("fonts/oxanium-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-ext-500.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Oxanium"; src: url("fonts/oxanium-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-ext-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root {
  --void: #000; --space: #01020a;
  --star: #e9ecf5; --star-rgb: 233,236,245; --dust: #8b91a8;
  --gold: #f5c77e; --gold-rgb: 245,199,126; --flare: #ff6e5a; --flare-rgb: 255,110,90;
  --glass: rgba(12,14,28,.52); --glass-strong: rgba(8,10,22,.82); --hair: rgba(233,236,245,.10); --hair-2: rgba(233,236,245,.18);
  --font-display: "Oxanium", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  /* older tokens, remapped so every earlier component joins the new palette */
  --bg: var(--space); --panel: var(--glass); --panel-2: rgba(18,20,38,.6); --line: var(--hair); --line-2: var(--hair-2);
  --text: var(--star); --muted: var(--dust); --white: #f2f3f8; --warn: var(--gold); --ok: #a9e3c2; --danger: var(--flare);
  --accent: var(--gold); --accent-rgb: var(--gold-rgb); --accent-dim: rgba(var(--gold-rgb), .16); --alert: var(--flare); --alert-rgb: var(--flare-rgb);
  --sans: var(--font-ui);
}
html { background: var(--void); }
body { background: transparent; background-image: none; font-family: var(--font-ui); font-weight: 400; letter-spacing: .005em; -webkit-font-smoothing: antialiased; }
.space { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
::selection { background: rgba(var(--gold-rgb), .35); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Top bar: a wordmark and quiet controls, floating on space */
.topbar { background: linear-gradient(180deg, rgba(0,0,0,.7), rgba(0,0,0,0)); border-bottom: 0; backdrop-filter: none; padding: 1rem max(1.2rem, env(safe-area-inset-right, 0px)) .6rem max(1.2rem, env(safe-area-inset-left, 0px)); }
.brand-mark { width: 30px; height: 30px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(var(--gold-rgb), .45)); }
.brand-name { font-family: var(--font-display); font-weight: 300; font-size: 1.02rem; letter-spacing: .22em; color: var(--star); text-shadow: none; }
.brand-sub { color: var(--dust); font-size: .78rem; letter-spacing: .02em; }
.chip-btn { background: rgba(255,255,255,.02); border: 1px solid var(--hair); color: var(--star); border-radius: 999px; font-size: .85rem; padding: .4rem .9rem; transition: border-color .2s, background .2s; }
.chip-btn:hover { border-color: var(--hair-2); background: rgba(255,255,255,.05); }
.chip-btn[aria-pressed="true"] { border-color: rgba(var(--gold-rgb), .5); color: var(--gold); }
.chip { background: transparent; border-color: var(--hair); color: var(--dust); }
.view-immersive .chips { display: none; }

/* The core */
.corner, .view-immersive .corner { display: none; }
.orb { visibility: hidden; }
.view-immersive .core { padding-top: 0; }
.view-immersive .orb-wrap { width: min(68vh, 94vw, 780px); margin-top: -2vh; transition: width .6s cubic-bezier(.2,.7,.2,1); }
.view-immersive.has-answer .orb-wrap { width: min(42vh, 82vw, 460px); }
.view-immersive .state-line { margin-top: -1rem; }
#orb-canvas { pointer-events: none; }
.state-line, .caption { position: relative; }
.state-dot { width: 6px; height: 6px; background: var(--gold) !important; box-shadow: 0 0 12px var(--gold) !important; }
.state-label { font-family: var(--font-display); font-weight: 300; font-size: .95rem; letter-spacing: .16em; text-transform: none; color: var(--star); }
body.state-standby .state-label { color: var(--dust); }
.cap-you { color: var(--dust); font-size: .95rem; }
.cap-me { font-family: var(--font-ui); font-weight: 300; font-size: clamp(1.2rem, 2.3vw, 1.7rem); letter-spacing: .005em; line-height: 1.5; max-width: 40rem; margin-inline: auto; }
.cap-me .w { opacity: .28; }
.cap-me.err { color: var(--gold); }
.view-immersive.has-card .cap-me { color: #c9ccd8; font-size: clamp(1rem, 1.7vw, 1.2rem); }

/* Readouts framing the core: quiet text, no boxes */
.tl-blk::before { display: none; }
.tl-k { font-family: var(--font-ui); font-size: .74rem; letter-spacing: .04em; text-transform: none; color: var(--dust); }
.tl-v { font-family: var(--font-display); font-weight: 300; font-size: 1.25rem; letter-spacing: .04em; color: var(--star); }
.tl-s { color: rgba(var(--star-rgb), .45); font-size: .78rem; }
.tl-a, .tl-c { left: max(2.2rem, env(safe-area-inset-left, 0px)); } .tl-b, .tl-d { right: max(2.2rem, env(safe-area-inset-right, 0px)); }
.tl-a, .tl-b { top: 1.6rem; } .tl-c, .tl-d { top: 6.4rem; }
.tele.low #tele-power { color: var(--flare); }

/* Panels: smoked glass with one warm hairline */
.answer-card { border-radius: 20px; border: 1px solid var(--hair); background: var(--glass); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0,0,0,.5); padding: 1.15rem 1.35rem; }
.answer-card::before { content: ""; position: absolute; inset: 0 18% auto; height: 1px; width: auto; border: 0; background: linear-gradient(90deg, transparent, rgba(var(--gold-rgb), .75), transparent); }
.answer-card::after { display: none; }
.answer-card.scan { animation: panelIn .55s cubic-bezier(.2,.7,.2,1) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px) scale(.985); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.ac-title { font-family: var(--font-ui); font-size: .8rem; letter-spacing: .02em; text-transform: none; color: var(--dust); }
.ac-big { font-family: var(--font-display); font-weight: 300; letter-spacing: -.01em; font-size: clamp(2rem, 5.5vw, 3rem); }
.ac-icon { color: var(--gold); }
.st-k { font-family: var(--font-ui); font-size: .82rem; letter-spacing: 0; text-transform: none; color: var(--dust); }
.ac-status li { border-bottom-color: var(--hair); }
.ac-status li.ok .st-v { color: var(--star); } .ac-status li.warn .st-v { color: var(--gold); }
.ps-state { font-family: var(--font-ui); text-transform: none; letter-spacing: 0; font-size: .78rem; }
.ps-done .ps-mark { background: var(--gold); border-color: var(--gold); border-radius: 50%; }
.ps-mark { border-radius: 50%; }

/* Command bar */
.view-immersive .dock { background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.75) 35%, #000 100%); }
.view-immersive .cmd { background: rgba(10,12,24,.6); border: 1px solid var(--hair-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.view-immersive .cmd:focus-within { border-color: rgba(var(--gold-rgb), .6); box-shadow: 0 0 0 4px rgba(var(--gold-rgb), .1), 0 20px 60px rgba(0,0,0,.6); }
.view-immersive .cmd input { font-family: var(--font-ui); font-weight: 400; }
.mic-btn { background: transparent !important; color: var(--gold) !important; border: 1px solid rgba(var(--gold-rgb), .55) !important; }
.mic-btn:hover { background: rgba(var(--gold-rgb), .08) !important; }
.mic-btn[aria-pressed="true"] { background: var(--gold) !important; color: #120c02 !important; box-shadow: 0 0 24px rgba(var(--gold-rgb), .5); }
.send-btn { background: transparent; border: 1px solid var(--hair-2); color: var(--star); }
.ex { border: 1px solid var(--hair); background: rgba(255,255,255,.015); color: #c3c7d4; border-style: solid; }
.ex:hover { border-color: rgba(var(--gold-rgb), .45); color: var(--star); }
.ex-label { font-family: var(--font-ui); text-transform: none; letter-spacing: 0; color: var(--dust); }
.glance button { background: rgba(10,12,24,.5); border-color: var(--hair); backdrop-filter: blur(10px); }
.hint { color: rgba(var(--star-rgb), .4); }

/* Drawer, dialogs, welcome */
.view-immersive .drawer { background: rgba(4,5,14,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-left: 1px solid var(--hair); }
.panel, .side > section, .conv { background: rgba(12,14,28,.45); border-color: var(--hair); }
.welcome { background: radial-gradient(ellipse at 50% 0%, rgba(var(--gold-rgb), .10), rgba(4,5,14,.96) 60%); border: 1px solid var(--hair); }
.welcome::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(6px); }
.wl h2 { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.35rem, 3.8vw, 1.9rem); letter-spacing: 0; line-height: 1.35; text-wrap: balance; }
.wl p { color: #c3c7d4; }
.wl-step { font-family: var(--font-ui); letter-spacing: .04em; text-transform: none; }
.wl-try button { border-color: var(--hair); background: rgba(255,255,255,.02); }
.wl-try button:hover { border-color: rgba(var(--gold-rgb), .5); }
.btn.primary, .btn-primary { background: var(--gold); color: #140d02; border-color: var(--gold); }
dialog#dlg { background: var(--glass-strong); border: 1px solid var(--hair); color: var(--star); backdrop-filter: blur(16px); }

/* Start-up check: a single quiet readout */
.boot { background-color: var(--void); background-image: radial-gradient(ellipse at 50% 45%, rgba(var(--gold-rgb), .08), rgba(0,0,0,0) 60%); }
.bt-inner { font-family: var(--font-ui); }
.bt-title { font-family: var(--font-display); font-weight: 300; letter-spacing: .24em; color: var(--gold); text-shadow: 0 0 18px rgba(var(--gold-rgb), .5); font-size: .95rem; }
.bt-label { text-transform: none; letter-spacing: .02em; color: var(--dust); }
.bt-dots { border-bottom-color: var(--hair); }
.bt-val { font-variant-numeric: tabular-nums; }
.bt-line.ok .bt-val { color: var(--star); } .bt-line.warn .bt-val { color: var(--gold); }
.bt-sum { font-family: var(--font-display); font-weight: 300; font-size: 1.05rem; line-height: 1.5; }

/* Alert: the disk flares */
body.alerting::after { box-shadow: inset 0 0 0 1px rgba(var(--flare-rgb), .8), inset 0 0 160px rgba(var(--flare-rgb), .22); }
.att-card { background: var(--glass-strong); border-color: rgba(var(--flare-rgb), .7); box-shadow: 0 0 40px rgba(var(--flare-rgb), .15); border-radius: 16px; backdrop-filter: blur(14px); }

/* Silence: the universe goes still */
.silence-bar { position: fixed; top: 4.6rem; left: 50%; transform: translateX(-50%); z-index: 15; display: flex; gap: .8rem; align-items: center; padding: .5rem .6rem .5rem 1rem;
  background: var(--glass); border: 1px solid var(--hair); border-radius: 999px; backdrop-filter: blur(14px); font-size: .88rem; color: #c3c7d4; white-space: nowrap; max-width: calc(100vw - 32px); }
.silence-bar[hidden] { display: none; }
.sl-dot { width: 7px; height: 7px; border-radius: 50%; background: #9aa6ff; box-shadow: 0 0 10px #9aa6ff; animation: breathe 3s ease-in-out infinite; }
body.silent .attention .att-card.held { display: none; }
body.silent .examples, body.silent .glance { opacity: .35; }
body.silent .cap-me { color: rgba(var(--star-rgb), .55); }
body.silent .state-dot { background: #9aa6ff !important; box-shadow: 0 0 12px #9aa6ff !important; }
@media (prefers-reduced-motion: reduce) { .answer-card.scan, .sl-dot { animation: none; } .view-immersive .orb-wrap { transition: none; } }
.motion-paused .answer-card.scan, .motion-paused .sl-dot { animation: none; }

@media (max-width: 600px) {
  .view-immersive .orb-wrap { width: min(52vh, 96vw); margin-top: 0; }
  .view-immersive.has-answer .orb-wrap { width: min(30vh, 70vw); }
  .silence-bar { top: 4rem; font-size: .8rem; }
  .brand-name { font-size: .92rem; }
}

/* the black hole's light spills past its box: the canvas is larger than the space it reserves */
#orb-canvas { position: absolute; inset: auto; left: 50%; top: 50%; width: 175%; height: 175%; transform: translate(-50%, -50%); }
.orb-wrap { position: relative; }
.view-immersive .orb-wrap { width: min(52vh, 70vw, 560px); margin-top: 3vh; }
.view-immersive.has-answer .orb-wrap { width: min(30vh, 60vw, 330px); margin-top: 1vh; }
.view-immersive .state-line { margin-top: 2vh; }
.tl-a, .tl-c { text-align: left; } .tl-b, .tl-d { text-align: right; }
@media (max-width: 600px) {
  .view-immersive .orb-wrap { width: min(40vh, 64vw); }
  .view-immersive.has-answer .orb-wrap { width: min(22vh, 46vw); }
}

.caption, .answer-card { transition: opacity .7s ease; }
body.resting .caption, body.resting .answer-card { opacity: 0; }

/* examples invite at rest; once you're working they step aside */
.view-immersive.has-answer .dock .examples { display: none; }
.answer-card[data-type="status"] { max-width: 46rem; }

/* the spilling canvas must never widen the page */
.core { overflow-x: clip; }
html { overflow-x: clip; }
body.alerting .state-dot { background: var(--flare) !important; box-shadow: 0 0 12px var(--flare) !important; }
.wl .wl-orb { width: 150px; height: 150px; }

/* ---------- v0.9: the WebGL universe ---------- */
.scene { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.scene[id="scene"] { background: #000; }
body:not(.webgl) .scene { display: none; }
body.webgl #space, body.webgl #orb-canvas { display: none; }
.webgl .caption, .webgl .state-line, .webgl .tele { text-shadow: 0 0 14px rgba(0,0,0,.95), 0 0 3px rgba(0,0,0,.9); }

/* ---------- v1.0: sentinels and logbook ---------- */
.ac-spark { display: block; width: 100%; height: 48px; margin-top: .7rem; }
.ac-spark polyline { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ac-spark .bars rect { fill: rgba(var(--gold-rgb), .75); }
.sen-item, .log-item { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--hair); }
.sen-item > div, .log-item > div { display: grid; gap: .1rem; min-width: 0; }
.sen-item strong, .log-item strong { font-weight: 500; overflow-wrap: anywhere; }
.answer-card[data-type="big"] .ac-big { overflow-wrap: anywhere; }
.ac-spark .base { stroke: var(--hair-2); stroke-width: 1; }
.ac-spark .dot { fill: rgba(var(--star-rgb), .25); }
.brand-mark { width: 28px; height: 11px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(var(--gold-rgb), .35)); }
.wl .wl-mark { width: 220px; height: 80px; object-fit: contain; filter: drop-shadow(0 0 24px rgba(var(--gold-rgb), .3)); }

/* ---------- v1.1 feature deck: every capability visible on the main screen ---------- */
.deck { display: flex; gap: .5rem; }
.deck .tile { display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: .65rem; row-gap: .1rem; align-items: center; text-align: left;
  min-height: 48px; padding: .42rem .8rem; border-radius: 14px; border: 1px solid var(--hair); background: rgba(10,12,24,.55); backdrop-filter: blur(12px); color: var(--text); cursor: pointer; font: inherit; }
.deck .tile:hover { border-color: rgba(var(--gold-rgb), .55); background: rgba(20,18,26,.7); }
.deck .tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.deck .tile-ic { grid-row: 1 / 3; width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.deck .tile-t { font-size: .9rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck .tile-s { font-size: .78rem; line-height: 1.25; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck .tile.live .tile-s { color: var(--gold); }
.deck .tile.live .tile-ic { opacity: 1; filter: drop-shadow(0 0 6px rgba(var(--gold-rgb), .6)); }
.deck .tile-s strong { font-weight: 600; color: var(--text); }
.deck .mono { font-family: var(--mono); }
.deck .tile-k { display: none; }
/* wide screens: a rail down the left side, always in view */
@media (min-width: 1100px) and (min-height: 700px) {
  .view-immersive .dock .deck { position: fixed; left: max(24px, env(safe-area-inset-left)); top: 258px; width: 236px; flex-direction: column; gap: .38rem; margin: 0; z-index: 12; }
  .view-immersive .dock .deck .tile { width: 100%; }
}
/* narrower screens: one swipeable row under the command box */
@media (max-width: 1099.98px), (max-height: 699.98px) {
  .view-immersive .dock .deck { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100%; max-width: 820px; padding-bottom: .2rem; scrollbar-width: none; }
  .view-immersive .dock .deck::-webkit-scrollbar { display: none; }
  .view-immersive .dock .deck .tile { flex: 0 0 auto; width: 176px; }
}
.view-dashboard .deck { display: none; }
body.silent .deck { opacity: .6; }
/* phones: a compact grid of icons above the examples, so every feature is visible without scrolling */
@media (max-width: 600px) {
  .view-immersive .dock .deck { order: -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; overflow: visible; width: 100%; margin: 0 0 .5rem; padding: 0; }
  .view-immersive .dock .deck .tile { width: auto; min-height: 58px; padding: .45rem .2rem .4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; text-align: center; border-radius: 4px; position: relative; }
  .view-immersive .dock .deck .tile-t, .view-immersive .dock .deck .tile-s { display: none; }
  .view-immersive .dock .deck .tile-k { display: block; font-size: .72rem; line-height: 1.1; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .view-immersive .dock .deck .tile.live::after { content: ""; position: absolute; top: 7px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
  .view-immersive.has-answer .dock .deck { display: none; }
}

/* ---------- v1.2 instrument layer: the interface reads as a ship's display ---------- */
:root { --ion: #8fd3ff; --ion-rgb: 143,211,255; }
/* corner brackets: two thin L-shapes on the opposite corners of a framed element */
.hud-frame, .deck .tile, .answer-card, .view-immersive .cmd { position: relative; }
.deck .tile::before, .deck .tile::after, .answer-card::before, .answer-card::after, .view-immersive .cmd::before, .view-immersive .cmd::after {
  content: ""; position: absolute; width: 9px; height: 9px; pointer-events: none; border: 0 solid rgba(var(--gold-rgb), .7); }
.deck .tile::before, .answer-card::before, .view-immersive .cmd::before { top: -1px; left: -1px; border-width: 1.5px 0 0 1.5px; }
.deck .tile::after, .answer-card::after, .view-immersive .cmd::after { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; }
/* tiles: squarer, with an ion edge that lights when the feature is active */
.deck .tile { border-radius: 4px; background: linear-gradient(90deg, rgba(var(--ion-rgb), .06), rgba(10,12,24,.55) 40%); border-color: rgba(var(--ion-rgb), .14); }
.deck .tile:hover { border-color: rgba(var(--ion-rgb), .45); box-shadow: 0 0 18px rgba(var(--ion-rgb), .12), inset 0 0 12px rgba(var(--ion-rgb), .06); }
.deck .tile.live { box-shadow: inset 2px 0 0 var(--gold); }
.deck .tile-ic { stroke: var(--ion); }
.deck .tile.live .tile-ic { stroke: var(--gold); }
@media (max-width: 600px) { .view-immersive .dock .deck .tile.live { box-shadow: inset 0 -2px 0 var(--gold); } }
/* answer panel: a faint measuring grid and a header rule */
.answer-card { border-radius: 4px; border-color: rgba(var(--ion-rgb), .22);
  background: linear-gradient(rgba(var(--ion-rgb), .035) 1px, transparent 1px) 0 0 / 100% 22px, linear-gradient(90deg, rgba(var(--ion-rgb), .035) 1px, transparent 1px) 0 0 / 22px 100%, linear-gradient(180deg, rgba(14,18,34,.82), rgba(6,8,18,.82)); }
.answer-card > :first-child { padding-bottom: .35rem; border-bottom: 1px solid rgba(var(--ion-rgb), .14); }
/* command line: an instrument slot rather than a pill */
.view-immersive .cmd { border-radius: 8px; border-color: rgba(var(--ion-rgb), .22); background: rgba(6,9,20,.86); box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 0 28px rgba(var(--ion-rgb), .06); overflow: visible; }
.view-immersive .cmd:focus-within { border-color: rgba(var(--ion-rgb), .55); box-shadow: 0 0 30px rgba(var(--ion-rgb), .16), inset 0 0 18px rgba(var(--ion-rgb), .06); }
.view-immersive .cmd .mic-btn, .view-immersive .cmd .send-btn { border-radius: 5px; }
.view-immersive .cmd:focus-within::before, .view-immersive .cmd:focus-within::after { border-color: var(--ion); }
/* top controls */
.chip-btn { border-radius: 5px; }
.chip-btn:hover { border-color: rgba(var(--ion-rgb), .45); }
/* telemetry: a level bar and signal bars, drawn from the real readings */
.tl-bar { position: absolute; top: 2.05rem; right: calc(100% + .9rem); width: 5.5rem; height: 4px; background: repeating-linear-gradient(90deg, rgba(var(--ion-rgb), .16) 0 6px, transparent 6px 8px); }
.tl-bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--v, 0) * 100%); background: repeating-linear-gradient(90deg, var(--ion) 0 6px, transparent 6px 8px); box-shadow: 0 0 8px rgba(var(--ion-rgb), .5); }
.tele.low .tl-bar i { background: repeating-linear-gradient(90deg, var(--flare) 0 6px, transparent 6px 8px); }
.tl-sig { position: absolute; top: 1.6rem; left: calc(100% + .9rem); display: inline-flex; gap: 3px; align-items: flex-end; height: 12px; }
.tl-sig i { width: 4px; background: rgba(var(--ion-rgb), .18); }
.tl-sig i:nth-child(1) { height: 4px; } .tl-sig i:nth-child(2) { height: 6.5px; } .tl-sig i:nth-child(3) { height: 9px; } .tl-sig i:nth-child(4) { height: 12px; }
.tl-sig[data-bars="1"] i:nth-child(-n+1), .tl-sig[data-bars="2"] i:nth-child(-n+2), .tl-sig[data-bars="3"] i:nth-child(-n+3), .tl-sig[data-bars="4"] i { background: var(--ion); box-shadow: 0 0 6px rgba(var(--ion-rgb), .5); }
.tl-k { color: rgba(var(--ion-rgb), .75); }
/* a thin rule under each telemetry block */
.tl-blk { padding-bottom: .5rem; }
.tl-a::after, .tl-c::after { content: ""; position: absolute; left: 0; bottom: 0; width: 3.2rem; height: 1px; background: linear-gradient(90deg, rgba(var(--ion-rgb), .5), transparent); }
.tl-b::after, .tl-d::after { content: ""; position: absolute; right: 0; bottom: 0; width: 3.2rem; height: 1px; background: linear-gradient(270deg, rgba(var(--ion-rgb), .5), transparent); }
/* state label: a small ion pip instead of a plain dot */
.state-dot { border-radius: 1px; transform: rotate(45deg); }
.ex, .glance button:not(.tile) { border-radius: 5px; }
.ex:hover { border-color: rgba(var(--ion-rgb), .45); }
.answer-card::before { inset: 0 auto auto 0; width: 11px; height: 11px; background: none; border-width: 1.5px 0 0 1.5px; }
.answer-card::after { display: block; inset: auto 0 0 auto; width: 11px; height: 11px; background: none; border-width: 0 1.5px 1.5px 0; }
