/* Edwin HUD — workshop hologram. One bold element (the reactor); everything else stays quiet. */
:root {
  --void: #03080F;
  --void-2: #06111C;
  --glass: rgba(16, 38, 56, 0.42);
  --glass-hi: rgba(26, 58, 84, 0.55);
  --line: rgba(143, 227, 255, 0.16);
  --line-hi: rgba(143, 227, 255, 0.42);
  --ice: #8FE3FF;
  --arc: #E8FBFF;
  --text: #CFE9F5;
  --haze: #5E7D8F;
  --gold: #FFB547;
  --alert: #FF5A4E;
  --ok: #6BF0B4;
  --r-s: 6px;
  --r-m: 10px;
  --font: "Saira", "Segoe UI", system-ui, sans-serif;
  --gap: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--void); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.5; font-variation-settings: "wdth" 100;
  background-image:
    radial-gradient(1200px 700px at 50% 38%, rgba(54, 140, 190, 0.10), transparent 70%),
    linear-gradient(rgba(143, 227, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 227, 255, 0.025) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--ice); }
code, pre { font-family: ui-monospace, "Cascadia Code", Menlo, monospace; font-size: 0.88em; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── layout ─────────────────────────────────────────────────────── */
.app {
  height: 100dvh; display: grid; gap: var(--gap); padding: 14px var(--gap) 12px;
  grid-template-columns: 250px minmax(0, 1fr) minmax(340px, 420px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top top" "rail center thread" "dock dock dock";
}
.topbar { grid-area: top; display: flex; align-items: center; gap: 18px; }
.rail { grid-area: rail; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-height: 0; }
.center { grid-area: center; display: flex; flex-direction: column; align-items: center; min-height: 0; overflow-y: auto; }
.thread { grid-area: thread; display: flex; flex-direction: column; min-height: 0; }
.dock { grid-area: dock; display: flex; align-items: flex-end; gap: 12px; }
.mobile-tabs { display: none; }

/* ── top bar ────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; letter-spacing: 0.06em;
  font-variation-settings: "wdth" 120; color: var(--arc); }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 10px var(--alert); }
.brand-dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip { font-size: 12.5px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--haze); }
.chip.known { color: var(--arc); border-color: var(--line-hi); }
.chip.guest { color: var(--gold); border-color: rgba(255, 181, 71, .45); }
.chip.warn { color: var(--alert); border-color: rgba(255, 90, 78, .5); }
.top-right { display: flex; align-items: center; gap: 10px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; margin-right: 6px; }
#clock-time { font-size: 22px; font-weight: 500; font-variation-settings: "wdth" 80; color: var(--arc); font-variant-numeric: tabular-nums; }
#clock-date { font-size: 12px; color: var(--haze); }
.icon-btn { background: transparent; border: 1px solid var(--line); border-radius: var(--r-s); width: 36px; height: 36px;
  display: grid; place-items: center; color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-hi); color: var(--arc); }
.icon-btn.small { width: 24px; height: 24px; font-size: 16px; line-height: 1; }

/* ── panels (HUD brackets instead of boxes) ─────────────────────── */
.panel { position: relative; padding: 12px 14px 14px; background: var(--glass); border-radius: var(--r-s); }
.panel::before, .panel::after { content: ""; position: absolute; width: 12px; height: 12px; border: 1px solid var(--line-hi); pointer-events: none; }
.panel::before { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: var(--r-s); }
.panel::after { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: var(--r-s); }
.panel h2, .thread h2 { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--ice); display: flex; align-items: center; gap: 8px; }
.sub { font-weight: 400; color: var(--haze); font-size: 12.5px; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.empty { color: var(--haze); font-size: 13px; margin: 0; }
.tiny { font-size: 12px; color: var(--haze); margin: 6px 0 0; }

.presence-mini .dev { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.presence-mini .dev:first-child { border-top: 0; }
.dev-name { color: var(--arc); font-size: 14px; }
.dev-zone { font-size: 12.5px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--haze); align-self: center; }
.dev-zone.z-desk, .dev-zone.z-room, .dev-zone.z-home { color: var(--ok); border-color: rgba(107, 240, 180, .4); }
.dev-zone.z-nearby { color: var(--gold); border-color: rgba(255, 181, 71, .4); }
.dev-dist { grid-column: 1 / -1; font-size: 12px; color: var(--haze); }

.power { height: 6px; border-radius: 3px; background: rgba(143, 227, 255, .1); overflow: hidden; }
.power-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--ice), var(--arc)); transition: width .6s ease; }
.power-fill.low { background: linear-gradient(90deg, var(--alert), var(--gold)); }

.metrics-mini .metric { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; padding: 6px 0;
  border-top: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.metrics-mini .metric:first-child { border-top: 0; }
.metric-name { font-size: 13px; color: var(--text); }
.metric-val { font-size: 15px; color: var(--arc); font-variation-settings: "wdth" 85; font-variant-numeric: tabular-nums; }
.metric svg.spark { grid-column: 1 / -1; width: 100%; height: 22px; stroke: var(--ice); stroke-width: 1.3; }
.jobs-mini { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.jobs-mini li { padding: 5px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.jobs-mini li:first-child { border-top: 0; }
.jobs-mini .when { color: var(--haze); font-variation-settings: "wdth" 85; white-space: nowrap; }

/* ── the reactor ───────────────────────────────────────────────── */
.reactor-wrap { position: relative; width: min(46vh, 100%); aspect-ratio: 1; flex-shrink: 0; margin-top: 2vh; }
#reactor { width: 100%; height: 100%; display: block; cursor: pointer; }
.reactor-state { position: absolute; left: 0; right: 0; bottom: -18px; text-align: center; font-size: 13px; letter-spacing: 0.08em;
  color: var(--haze); font-variation-settings: "wdth" 115; pointer-events: none; }
.reactor-state.active { color: var(--arc); }
.reactor-state.thinking { color: var(--gold); }
.caption { min-height: 3em; margin-top: 26px !important; max-width: 62ch; text-align: center; color: var(--arc); font-size: 17px; margin: 6px 16px 10px; }
.caption .heard { color: var(--haze); font-style: italic; }

/* holographic display cards */
.holo { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.holo-card { animation: holo-in .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes holo-in { from { opacity: 0; transform: translateY(10px) scale(.985); filter: blur(3px); } }
.holo-card .holo-close { position: absolute; top: 8px; right: 8px; }
.holo-card img { max-width: 100%; border-radius: var(--r-s); display: block; margin: 6px 0; }
.chart { width: 100%; height: 220px; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--haze); font-size: 11px; stroke: none; font-family: var(--font); }
.chart .series-0 { stroke: var(--ice); } .chart .series-1 { stroke: var(--gold); } .chart .series-2 { stroke: var(--ok); }
.chart .bar-0 { fill: var(--ice); opacity: .75; }
.chart path.area { fill: url(#chart-grad); stroke: none; }

.browser-panel, .transcript-panel { width: 100%; max-width: 760px; margin-bottom: 12px; }
.transcript-panel h2 .btn:first-of-type { margin-left: auto; }
.transcript { max-height: 32vh; overflow-y: auto; font-size: 15px; }
.transcript p { margin: 0 0 6px; }
.transcript b { color: var(--ice); font-weight: 500; }
.msg .retry { margin-left: auto; background: none; border: 0; color: var(--haze); cursor: pointer; font-size: 12px; padding: 0; }
.msg .retry:hover { color: var(--ice); }
.browser-panel img { width: 100%; border-radius: var(--r-s); display: block; }

/* ── conversation ─────────────────────────────────────────────── */
.thread-head { display: flex; align-items: center; padding: 2px 4px 8px; }
.thread-head h2 { margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { background: none; border: 0; color: var(--ice); cursor: pointer; font-size: 13px; padding: 4px 6px; }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 12px; scroll-behavior: smooth; }
.msg { max-width: 100%; }
.msg .who { font-size: 12px; color: var(--haze); margin-bottom: 2px; display: flex; gap: 6px; }
.msg.user .body { background: var(--glass-hi); padding: 8px 12px; border-radius: var(--r-m) var(--r-m) 2px var(--r-m); margin-left: 12%; }
.msg.user .who { justify-content: flex-end; }
.msg.edwin .body { padding: 0 2px; color: var(--text); }
.msg.edwin .body.streaming::after { content: "▍"; color: var(--ice); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.body p { margin: 0 0 .6em; } .body p:last-child { margin-bottom: 0; }
.body ul, .body ol { margin: .3em 0 .7em; padding-left: 1.3em; }
.body h3, .body h4 { margin: .8em 0 .3em; color: var(--arc); font-size: 1em; }
.body pre { background: rgba(0, 0, 0, .35); padding: 10px 12px; border-radius: var(--r-s); overflow-x: auto; border: 1px solid var(--line); }
.body code { background: rgba(143, 227, 255, .08); padding: 0 4px; border-radius: 3px; }
.body pre code { background: none; padding: 0; }
.body table { border-collapse: collapse; margin: .4em 0; font-size: 13.5px; display: block; overflow-x: auto; }
.body th, .body td { border-bottom: 1px solid var(--line); padding: 4px 10px 4px 0; text-align: left; }
.body th { color: var(--ice); font-weight: 500; }
.body hr { border: 0; border-top: 1px dashed var(--line-hi); margin: .8em 0; }
.body blockquote { margin: .4em 0; padding-left: 10px; border-left: 2px solid var(--line-hi); color: var(--haze); }
.tools { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 6px; }
.tool { font-size: 12.5px; color: var(--haze); display: flex; gap: 8px; align-items: baseline; }
.tool .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex-shrink: 0; transform: translateY(-1px); animation: pulse 1s ease-in-out infinite; }
.tool.done .dot { background: var(--ice); animation: none; }
.tool.err .dot { background: var(--alert); animation: none; }
.tool .label { color: var(--text); }
.tool a { color: var(--haze); }
@keyframes pulse { 50% { opacity: .3; } }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sources a { font-size: 12px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--haze); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sources a:hover { color: var(--ice); border-color: var(--line-hi); }
.file-chip { display: inline-flex; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-hi); border-radius: var(--r-s); text-decoration: none; margin-top: 4px; }

/* ── dock ──────────────────────────────────────────────────────── */
.mic-modes { display: flex; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; align-self: center; }
.mic-modes button { background: transparent; border: 0; padding: 8px 11px; font-size: 13px; color: var(--haze); cursor: pointer; }
.mic-modes button[aria-checked="true"] { background: var(--glass-hi); color: var(--arc); }
.mic { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line-hi); background: var(--glass);
  display: grid; place-items: center; color: var(--ice); cursor: pointer; flex-shrink: 0; touch-action: none; overflow: hidden; }
.mic svg { width: 22px; height: 22px; position: relative; z-index: 1; }
.mic.live { border-color: var(--ice); color: var(--arc); box-shadow: 0 0 0 4px rgba(143, 227, 255, .12); }
.mic.recording { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 5px rgba(255, 181, 71, .16); }
.mic-level { position: absolute; inset: auto 0 0 0; height: 0; background: rgba(143, 227, 255, .22); transition: height .08s linear; }
.composer { flex: 1; display: flex; align-items: flex-end; gap: 8px; background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 6px 6px 6px 10px; min-width: 0; flex-wrap: wrap; }
.composer:focus-within { border-color: var(--line-hi); }
.composer textarea { flex: 1; min-width: 120px; background: transparent; border: 0; resize: none; outline: none; padding: 7px 4px;
  max-height: 160px; color: var(--arc); }
.composer textarea::placeholder { color: var(--haze); }
.attach { display: grid; place-items: center; width: 34px; height: 36px; cursor: pointer; color: var(--haze); }
.attach:hover { color: var(--ice); }
.attachments { display: flex; gap: 6px; flex-wrap: wrap; }
.attachments span { font-size: 12px; padding: 2px 8px; border: 1px solid var(--line-hi); border-radius: 99px; cursor: pointer; }
.toggle { background: transparent; border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 10px; font-size: 13px; color: var(--haze); cursor: pointer; }
.toggle[aria-pressed="true"] { color: var(--arc); border-color: var(--line-hi); background: var(--glass-hi); }
#btn-deep[aria-pressed="true"] { color: var(--gold); border-color: rgba(255, 181, 71, .5); }
.btn { border: 1px solid var(--line-hi); background: transparent; color: var(--arc); padding: 8px 16px; border-radius: var(--r-s); cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--glass-hi); }
.btn.primary { background: var(--ice); color: var(--void); border-color: var(--ice); font-weight: 600; }
.btn.primary:hover { background: var(--arc); }
.btn.danger { border-color: var(--alert); color: var(--alert); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ── overlays ─────────────────────────────────────────────────── */
.confirm, .sheet, .settings, .login { position: fixed; inset: 0; background: rgba(1, 4, 8, .72); backdrop-filter: blur(6px); z-index: 50;
  display: grid; place-items: center; padding: 16px; }
.confirm-card, .sheet-card, .login-card { background: var(--void-2); border: 1px solid var(--line-hi); border-radius: var(--r-m); padding: 20px;
  width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.confirm-card { border-color: rgba(255, 181, 71, .6); }
.confirm-card h3 { margin: 0 0 10px; color: var(--gold); font-weight: 600; }
.confirm-card pre { white-space: pre-wrap; background: rgba(0, 0, 0, .35); padding: 12px; border-radius: var(--r-s); max-height: 50vh; overflow: auto; margin: 0; color: var(--arc); }
.row { display: flex; align-items: center; gap: 10px; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.row h3 { flex: 1; margin: 0; }
.sessions-list { list-style: none; padding: 0; margin: 12px 0 0; }
.sessions-list button { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 4px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.sessions-list button:hover { color: var(--arc); }
.sessions-list .when { color: var(--haze); font-size: 12.5px; white-space: nowrap; }

.login-card { text-align: center; display: flex; flex-direction: column; gap: 12px; width: min(380px, 100%); }
.login-card h1 { margin: 0; font-size: 28px; font-variation-settings: "wdth" 120; letter-spacing: .08em; color: var(--arc); font-weight: 600; }
.login-card p { margin: 0; color: var(--haze); font-size: 14px; }
.login-mark { width: 64px; height: 64px; margin: 0 auto; stroke: var(--ice); stroke-width: 1.5; }
.login-err { color: var(--alert) !important; min-height: 1.2em; }
input[type=text], input[type=password], input[type=number], input[type=url], input:not([type]), select, textarea.field {
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; color: var(--arc); width: 100%; }
input:focus, select:focus, textarea.field:focus { border-color: var(--line-hi); outline: none; }

.toasts { position: fixed; top: 64px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--void-2); border: 1px solid var(--line-hi); border-radius: var(--r-m); padding: 10px 14px; animation: holo-in .35s ease; }
.toast b { color: var(--arc); display: block; font-weight: 600; }
.toast.high { border-color: var(--gold); } .toast.urgent { border-color: var(--alert); }
.toast p { margin: 2px 0 0; font-size: 13.5px; }

/* ── settings ─────────────────────────────────────────────────── */
.settings { place-items: stretch; padding: 3vh 3vw; }
.settings-shell { position: relative; display: grid; grid-template-columns: 210px minmax(0, 1fr); background: var(--void-2);
  border: 1px solid var(--line-hi); border-radius: var(--r-m); overflow: hidden; max-width: 1200px; width: 100%; margin: 0 auto; }
.settings-nav { border-right: 1px solid var(--line); padding: 18px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.settings-nav button { text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: var(--r-s); cursor: pointer; color: var(--haze); font-size: 14.5px; }
.settings-nav button.on { background: var(--glass-hi); color: var(--arc); }
.settings-body { overflow-y: auto; padding: 22px 28px 40px; }
.settings-body h2 { margin: 0 0 4px; font-size: 22px; color: var(--arc); font-weight: 500; font-variation-settings: "wdth" 110; }
.settings-body > p.lead { margin: 0 0 18px; color: var(--haze); max-width: 70ch; }
.settings-body h3 { font-size: 15px; color: var(--ice); margin: 26px 0 10px; font-weight: 600; }
.settings-close { position: absolute; top: 12px; right: 12px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 18px; }
.field label { display: block; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.field .help { font-size: 12px; color: var(--haze); margin-top: 3px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: rgba(143, 227, 255, .14); position: relative; cursor: pointer; flex-shrink: 0; margin: 0; border: 1px solid var(--line); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--haze); transition: transform .2s, background .2s; }
.switch input:checked { background: rgba(143, 227, 255, .35); border-color: var(--ice); }
.switch input:checked::after { transform: translateX(16px); background: var(--arc); }
.save-bar { position: sticky; bottom: -40px; padding: 14px 0 0; background: linear-gradient(transparent, var(--void-2) 30%); display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.save-bar .status { color: var(--haze); font-size: 13px; }

.integ-group { margin-top: 18px; }
.integ { border-top: 1px solid var(--line); padding: 14px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; }
.integ-name { font-size: 16px; color: var(--arc); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--haze); }
.pill.on { color: var(--ok); border-color: rgba(107, 240, 180, .45); }
.pill.needs { color: var(--gold); border-color: rgba(255, 181, 71, .5); }
.integ-desc { grid-column: 1; color: var(--text); font-size: 14px; max-width: 78ch; }
.integ-meta { grid-column: 1; font-size: 12.5px; color: var(--haze); }
.integ details { grid-column: 1 / -1; margin-top: 6px; }
.integ summary { cursor: pointer; color: var(--ice); font-size: 13.5px; }
.integ .fields { margin-top: 12px; }
.integ .setup { font-size: 13px; color: var(--haze); background: rgba(0, 0, 0, .25); padding: 10px 12px; border-radius: var(--r-s); margin-top: 10px; }

.cat-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.cat { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-hi); background: none; cursor: pointer; color: var(--arc); }
.cat.off { color: var(--haze); border-color: var(--line); text-decoration: line-through; }
.api-row { border-top: 1px solid var(--line); padding: 8px 0; font-size: 13.5px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
.api-row .n { color: var(--arc); }
.api-row .d { color: var(--haze); grid-column: 1; }
.tier { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); align-self: start; }
.tier.free, .tier.free_ua { color: var(--ok); border-color: rgba(107, 240, 180, .4); }
.tier.key { color: var(--gold); border-color: rgba(255, 181, 71, .4); }

.list-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.list-table td, .list-table th { padding: 8px 8px 8px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.list-table th { color: var(--haze); font-weight: 400; font-size: 12.5px; border-top: 0; }
.person-card { border-top: 1px solid var(--line); padding: 14px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; }
.person-card .n { font-size: 16px; color: var(--arc); }
.person-card .meta { font-size: 13px; color: var(--haze); }
.enroll { margin-top: 14px; padding: 16px; border: 1px solid var(--line-hi); border-radius: var(--r-m); background: rgba(0, 0, 0, .25); }
.enroll .phrase { font-size: 20px; color: var(--arc); margin: 8px 0 14px; max-width: 40ch; }
.enroll .progress { display: flex; gap: 6px; margin: 10px 0; }
.enroll .progress i { flex: 1; height: 4px; border-radius: 2px; background: rgba(143, 227, 255, .12); }
.enroll .progress i.done { background: var(--ice); }
.enroll .progress i.now { background: var(--gold); }
.zones-viz { width: 100%; height: auto; max-width: 380px; overflow: visible; aspect-ratio: 1; display: block; margin: 8px auto; }
.list-table td { white-space: nowrap; }
.list-table td:nth-child(n+4) input { min-width: 140px; }
.zones-viz circle.ring { fill: none; stroke: var(--line-hi); stroke-dasharray: 3 4; }
.zones-viz text { fill: var(--haze); font-size: 11px; stroke: none; font-family: var(--font); }
.zones-viz .you { fill: var(--arc); }
.zones-viz .dev { fill: var(--gold); }
.steps { margin: 6px 0 0; padding-left: 1.3em; font-size: 14px; }
.steps li { margin: 4px 0; }
.copy { display: flex; gap: 6px; align-items: center; }
.copy code { flex: 1; background: rgba(0, 0, 0, .35); padding: 7px 10px; border-radius: var(--r-s); overflow-x: auto; white-space: nowrap; }

/* ── responsive ──────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .app { grid-template-columns: 220px minmax(0, 1fr) minmax(300px, 360px); }
  .mic-modes button { padding: 8px 8px; font-size: 12.5px; }
}
@media (max-width: 900px) {
  body { font-size: 15.5px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: "top" "tabs" "pane" "dock"; padding: 10px 12px 10px; gap: 10px; }
  .mobile-tabs { grid-area: tabs; display: flex; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
  .mobile-tabs button { flex: 1; background: none; border: 0; padding: 8px; color: var(--haze); cursor: pointer; }
  .mobile-tabs button.on { background: var(--glass-hi); color: var(--arc); }
  .pane { grid-area: pane; display: none !important; }
  .pane.on { display: flex !important; }
  .chips, .clock span#clock-date { display: none; }
  .topbar { gap: 10px; } .brand { flex: 1; }
  .dock, .composer, .pane { min-width: 0; max-width: 100%; }
  .reactor-wrap { width: min(62vw, 34vh); }
  .dock { flex-wrap: wrap; gap: 8px; }
  .mic-modes { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .mic-modes button { flex: 1 0 auto; white-space: nowrap; }
  .composer { padding: 4px 4px 4px 6px; }
  .composer textarea { order: -1; flex-basis: calc(100% - 50px); }
  .composer .row, .composer #focus, #btn-research, #btn-deep { display: none !important; }
  .mic { width: 46px; height: 46px; }
  .reactor-wrap { margin-top: 1vh; }
  .settings { padding: 0; }
  .settings-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); border-radius: 0; }
  .settings-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 50px 10px 10px; }
  .settings-nav button { white-space: nowrap; }
  .settings-body { padding: 18px 16px 40px; }
  .msg.user .body { margin-left: 6%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.mini-select { width: auto; background: transparent; border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px 8px; font-size: 13px; color: var(--haze); }
.thread-head { gap: 4px; }
.thread-head .mini-select { padding: 3px 6px; font-size: 12.5px; max-width: 120px; }
.thread.temp .messages { border: 1px dashed rgba(255, 181, 71, .45); border-radius: var(--r-m); }
#btn-temp[aria-pressed="true"], #btn-research[aria-pressed="true"] { color: var(--gold); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggest button { background: none; border: 1px solid var(--line-hi); color: var(--ice); border-radius: 99px; padding: 3px 11px; font-size: 13px; cursor: pointer; }
.suggest button:hover { background: var(--glass-hi); }
.holo-card iframe { width: 100%; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; display: block; }
.holo-card audio { width: 100%; margin: 6px 0; }
.setup.guide { font-size: 14px; color: var(--text); max-width: 82ch; }
.setup.guide h2 { font-size: 16px; margin: 4px 0 8px; color: var(--arc); }
.setup.guide p { margin: 0 0 .6em; } .setup.guide ol, .setup.guide ul { margin: .2em 0 .8em; }

/* ── "Edwin is updating" screen ─────────────────────────────────── */
.updating {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(900px 600px at 50% 40%, rgba(54, 140, 190, 0.16), transparent 70%), rgba(3, 8, 15, 0.94);
  backdrop-filter: blur(6px); animation: upd-in 0.35s ease-out;
}
@keyframes upd-in { from { opacity: 0; } to { opacity: 1; } }
.upd-box {
  width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; text-align: center;
  background: var(--glass); border: 1px solid var(--line-hi); border-radius: var(--r-m); padding: 28px 26px 20px;
  box-shadow: 0 0 60px rgba(143, 227, 255, 0.10);
}
.upd-box h2 { margin: 14px 0 4px; font-size: 22px; letter-spacing: 0.06em; color: var(--arc); font-weight: 600; }
.upd-sub { margin: 0 0 16px; color: var(--haze); font-size: 14px; }
.upd-core { position: relative; width: 96px; height: 96px; margin: 0 auto; }
.upd-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--ice); border-right-color: rgba(143, 227, 255, 0.35); animation: upd-spin 1.4s linear infinite; }
.upd-ring.r2 { inset: 14px; border-top-color: transparent; border-bottom-color: var(--ice); border-left-color: rgba(143, 227, 255, 0.35);
  animation-duration: 2.2s; animation-direction: reverse; }
.upd-dot { position: absolute; inset: 34px; border-radius: 50%; background: radial-gradient(circle, var(--arc), var(--ice) 45%, transparent 72%);
  animation: upd-pulse 1.6s ease-in-out infinite; }
@keyframes upd-spin { to { transform: rotate(360deg); } }
@keyframes upd-pulse { 50% { opacity: 0.55; transform: scale(0.88); } }
.upd-bar { height: 6px; border-radius: 3px; background: rgba(143, 227, 255, 0.10); overflow: hidden; margin-bottom: 16px; }
.upd-fill { height: 100%; width: 4%; background: linear-gradient(90deg, var(--ice), var(--arc)); transition: width 0.6s ease;
  box-shadow: 0 0 12px var(--ice); }
.upd-steps { list-style: none; margin: 0 0 12px; padding: 0; text-align: left; display: grid; gap: 6px; }
.upd-steps li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--haze); transition: color 0.3s; }
.upd-steps .dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-hi); flex: none; position: relative; }
.upd-steps li.active { color: var(--arc); }
.upd-steps li.active .dot { border-color: var(--ice); box-shadow: 0 0 10px var(--ice); animation: upd-pulse 1s ease-in-out infinite; }
.upd-steps li.done { color: var(--text); }
.upd-steps li.done .dot { background: var(--ok); border-color: var(--ok); }
.upd-steps li.done .dot::after { content: ""; position: absolute; left: 4px; top: 1px; width: 3px; height: 7px;
  border: solid var(--void); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.upd-steps li.failed { color: var(--alert); }
.upd-steps li.failed .dot { background: var(--alert); border-color: var(--alert); }
.upd-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--haze); margin-bottom: 8px; }
.upd-clock { font-variant-numeric: tabular-nums; }
.upd-details { text-align: left; font-size: 12px; color: var(--haze); }
.upd-details summary { cursor: pointer; }
.upd-log { max-height: 160px; overflow: auto; white-space: pre-wrap; font-size: 11px; background: rgba(0, 0, 0, 0.3);
  padding: 8px; border-radius: var(--r-s); margin: 6px 0 0; }
.upd-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.upd-actions:empty { display: none; }
.updating.failed .upd-ring, .updating.failed .upd-dot { animation: none; border-top-color: var(--alert); }
.updating.failed .upd-dot { background: radial-gradient(circle, #ffd2cc, var(--alert) 45%, transparent 72%); }
/* finished: the spinner collapses into a drawn check mark */
.upd-check { position: absolute; inset: 0; opacity: 0; transform: scale(0.6); pointer-events: none; }
.upd-check svg { width: 100%; height: 100%; }
.upd-check .c { fill: rgba(107, 240, 180, 0.10); stroke: var(--ok); stroke-width: 3; stroke-dasharray: 252; stroke-dashoffset: 252; }
.upd-check .k { fill: none; stroke: var(--ok); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60; filter: drop-shadow(0 0 6px rgba(107, 240, 180, 0.7)); }
.updating.finished .upd-ring, .updating.finished .upd-dot { animation: none; opacity: 0; transform: scale(0.4);
  transition: opacity 0.35s ease, transform 0.35s ease; }
.updating.finished .upd-check { opacity: 1; transform: scale(1); transition: opacity 0.3s ease 0.2s, transform 0.45s cubic-bezier(.2, 1.4, .4, 1) 0.2s; }
.updating.finished .upd-check .c { animation: upd-draw 0.6s ease-out 0.3s forwards; }
.updating.finished .upd-check .k { animation: upd-draw 0.45s ease-out 0.75s forwards; }
.updating.finished .upd-box { border-color: rgba(107, 240, 180, 0.55); box-shadow: 0 0 60px rgba(107, 240, 180, 0.14);
  transition: border-color 0.5s ease, box-shadow 0.5s ease; }
@keyframes upd-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .updating.finished .upd-check .c, .updating.finished .upd-check .k { animation: none; stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) { .upd-ring, .upd-dot, .upd-steps li.active .dot { animation: none; } }

/* ── standby ─────────────────────────────────────────────────────── */
.chip.standby { color: #9fc3dc; border-color: rgba(143, 227, 255, 0.35); background: rgba(70, 110, 150, 0.18); }
#btn-standby[aria-pressed="true"] { color: var(--ice); border-color: var(--line-hi); box-shadow: 0 0 12px rgba(143, 227, 255, 0.25); }
body.standby #reactor { filter: saturate(0.4) brightness(0.65); transition: filter 0.6s ease; }
body.standby .panel { opacity: 0.72; transition: opacity 0.6s ease; }
.clap-log { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; max-height: 220px; overflow: auto; }
.clap-log li { padding: 2px 0; color: var(--haze); }
.clap-log li.ok { color: var(--ok); }
.clap-log li.ok.big { font-weight: 600; }
.clap-log li.bad { color: #e8b4ad; }

/* ── phone call card ─────────────────────────────────────────────── */
#call-stack { position: fixed; right: 16px; bottom: 120px; z-index: 900; display: grid; gap: 10px; width: min(340px, calc(100vw - 32px)); }
.call-card { background: var(--glass-hi); border: 1px solid var(--line-hi); border-radius: var(--r-m); padding: 12px 14px;
  backdrop-filter: blur(8px); box-shadow: 0 0 30px rgba(143, 227, 255, 0.12); font-size: 13px; animation: upd-in 0.3s ease-out; }
.call-card.live { border-color: rgba(107, 240, 180, 0.6); }
.call-card.decide { border-color: var(--gold); }
.call-head { display: flex; justify-content: space-between; align-items: center; }
.call-state { font-size: 11px; letter-spacing: 0.12em; color: var(--ice); }
.call-card.live .call-state::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); margin-right: 6px; animation: upd-pulse 1.2s ease-in-out infinite; }
.call-x { background: none; border: 0; color: var(--haze); font-size: 14px; cursor: pointer; padding: 2px 6px; }
.call-card.live .call-x { color: var(--alert); }
.call-who { font-size: 15px; color: var(--arc); margin-top: 4px; }
.call-num { color: var(--haze); font-size: 12px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.call-line { color: var(--text); margin-top: 3px; }
.call-line b { color: var(--ice); font-weight: 500; }
.call-summary { margin-top: 6px; color: var(--text); }
.call-ask { margin-top: 6px; color: var(--gold); }

/* ── command center ──────────────────────────────────────────────── */
.sys-status { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--line-hi);
  border-radius: var(--r-s); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; background: var(--glass); }
.sys-status .k { color: var(--text); }
.sys-status .v { color: var(--ok); font-weight: 600; }
.sys-status .v::before { content: "●"; margin-right: 6px; }
.sys-status.attention { border-color: rgba(255, 181, 71, .55); }
.sys-status.attention .v { color: var(--gold); }
.chip.info { color: var(--text); }
.chip.bad { color: var(--alert); border-color: rgba(255, 90, 78, .5); }

.sys-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sys { display: grid; grid-template-columns: 26px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-s); background: rgba(3, 8, 15, .35); }
.sys-ico { grid-row: 1 / 3; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px;
  border: 1px solid var(--line); color: var(--ice); }
.sys-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sys-name { font-size: 13px; color: var(--arc); }
.sys-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.sys-detail { grid-column: 2 / 4; font-size: 11.5px; color: var(--ok); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sys.warn .sys-dot { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.sys.warn .sys-detail { color: var(--gold); }
.sys.off .sys-dot { background: var(--haze); box-shadow: none; }
.sys.off .sys-detail, .sys.off .sys-name { color: var(--haze); }

/* reactor shares the center with the deck */
.center .reactor-wrap { width: min(38vh, 100%); margin-top: 0.5vh; }
.center .caption { margin-top: 10px !important; min-height: 0; margin-bottom: 8px; }
.center .caption:empty { margin: 30px 0 8px !important; }
.deck { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 12px; width: 100%; max-width: 980px; margin: 2px 0 12px; }
.tile { min-height: 178px; }
.tile h2 .sub { margin-left: auto; }

.rings { display: flex; justify-content: space-around; align-items: center; height: calc(100% - 26px); gap: 6px; }
.ring { position: relative; width: 72px; height: 72px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .trk { stroke: rgba(143, 227, 255, .12); }
.ring .val { stroke: var(--ice); stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(143, 227, 255, .6)); transition: stroke-dasharray .6s ease; }
.ring.warm .val { stroke: var(--gold); }
.ring.hot .val { stroke: var(--alert); }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring-txt b { font-size: 14px; color: var(--arc); font-weight: 600; }
.ring-txt span { font-size: 10px; color: var(--haze); text-transform: uppercase; letter-spacing: .1em; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 128px; overflow-y: auto; }
.tl { display: grid; grid-template-columns: 62px 12px 1fr auto; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 0; }
.tl-time { color: var(--haze); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.tl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ice); box-shadow: 0 0 6px var(--ice); }
.tl-title { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-acct { color: var(--haze); }
.tl-when { color: var(--haze); font-size: 11px; }
.tl.now .tl-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.tl.now .tl-when { color: var(--gold); }
.tl.done .tl-title { color: var(--haze); text-decoration: line-through; text-decoration-color: rgba(94, 125, 143, .6); }
.tl.done .tl-dot { background: var(--haze); box-shadow: none; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.stat b { display: block; font-size: 19px; color: var(--arc); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--haze); }

.thread-tabs { display: flex; gap: 4px; padding: 0 4px 8px; }
.thread-tabs button { background: none; border: 1px solid transparent; border-radius: var(--r-s); color: var(--haze); padding: 4px 10px;
  font: inherit; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.thread-tabs button.on { color: var(--ice); border-color: var(--line-hi); background: var(--glass); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--ice);
  color: var(--void); font-size: 11px; font-weight: 700; text-align: center; }
.feed { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 6px; padding: 0 4px; }
.feed-item { border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; background: rgba(3, 8, 15, .35); }
.feed-top { display: flex; gap: 8px; align-items: baseline; }
.feed-title { flex: 1; color: var(--arc); font-size: 13px; }
.feed-tag { font-size: 10px; letter-spacing: .1em; color: var(--ice); }
.feed-tag.warn, .feed-item.warn .feed-title { color: var(--gold); }
.feed-body { color: var(--text); font-size: 12.5px; margin-top: 2px; }
.feed-when { color: var(--haze); font-size: 11px; margin-top: 3px; }

/* locations map */
.tile-map { grid-column: 1 / -1; min-height: 0; }
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 10px; height: 210px; }
.map { position: relative; z-index: 0; isolation: isolate; contain: paint; border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--line); }
.map.leaflet-container { background: #06101a; }
.map svg { width: auto; height: auto; stroke-width: initial; }
.map .leaflet-overlay-pane svg { stroke-linecap: round; }
.map.leaflet-container .leaflet-control-attribution { background: rgba(3, 8, 15, .75); color: var(--haze); font-size: 9px; }
.map.leaflet-container .leaflet-control-attribution a { color: var(--ice); }
.map .leaflet-popup-content-wrapper, .map .leaflet-popup-tip { background: var(--void-2); color: var(--text); border: 1px solid var(--line-hi); }
.map.leaflet-container .leaflet-bar a { background: var(--void-2); color: var(--ice); border-color: var(--line); }
.map-pin { width: 18px; height: 18px; border-radius: 50%; background: var(--void); border: 2px solid var(--haze); display: grid; place-content: center;
  font-size: 10px; font-weight: 700; color: var(--haze); }
.map-pin.on { border-color: var(--ice); color: var(--ice); box-shadow: 0 0 10px var(--ice); }
.map-people { display: grid; align-content: start; gap: 6px; overflow-y: auto; }
.map-dev { text-align: left; background: rgba(3, 8, 15, .35); border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px 8px;
  color: var(--text); font: inherit; font-size: 12px; cursor: pointer; display: grid; gap: 1px; }
.map-dev.on { border-color: var(--line-hi); background: var(--glass); }
.map-dev b { color: var(--arc); font-weight: 600; }
.map-dev .map-when { color: var(--haze); font-size: 11px; }
@media (max-width: 700px) { .map-wrap { grid-template-columns: 1fr; height: auto; } .map { height: 220px; } }

@media (max-width: 1400px) { .deck { grid-template-columns: 1fr 1fr; } #tile-timeline { grid-column: 1 / -1; order: -1; } }
@media (max-width: 900px) {
  .deck { grid-template-columns: 1fr; }
  .sys-status .k { display: none; }
}
@media (max-width: 600px) { .sys-status { display: none; } }
