/* JARVIS // business terminal. Black and ice blue. Glass modules floating over a turning
   point-sphere, HUD corner brackets, monospace numbers. Motion is slow and continuous, never a
   flash; colour for state is always paired with an icon and a word. */
:root {
  color-scheme: dark;
  --bg: #03060a;
  --glass: rgba(8, 20, 32, .58);
  --glass-2: rgba(14, 32, 50, .62);
  --edge: rgba(125, 211, 252, .16);
  --edge-hot: rgba(125, 211, 252, .55);
  --ice: #7dd3fc;
  --blue: #38bdf8;
  --deep: #0ea5e9;
  --text: #e6f6ff;
  --text-2: #a9c7dc;
  --muted: #5f7f97;
  --good: #34d399;
  --warn: #fbbf24;
  --crit: #fb7185;
  --radius: 14px;
  --gap: 14px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
button { font: inherit; color: inherit; }
#space { position: fixed; inset: 0; z-index: 0; }
.vignette { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(1200px 700px at 30% 10%, rgba(14,165,233,.10), transparent 60%),
              radial-gradient(900px 600px at 80% 90%, rgba(56,189,248,.06), transparent 60%),
              linear-gradient(180deg, rgba(3,6,10,0) 0%, rgba(3,6,10,.55) 100%); }
.app { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px 40px;
  perspective: 1400px; }

/* ── Boot sequence ─────────────────────────────────────────── */
.boot { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; align-content: center; gap: 22px;
  background: rgba(3,6,10,.92); transition: opacity .7s ease, visibility .7s; }
.boot.done { opacity: 0; visibility: hidden; }
.boot pre { margin: 0; font: 13px/1.7 var(--mono); color: var(--ice); min-width: min(520px, 90vw); white-space: pre-wrap; }
.boot pre .ok { color: var(--good); } .boot pre .warn { color: var(--warn); } .boot pre .dim { color: var(--muted); }
.boot-core { position: relative; width: 84px; height: 84px; }
.boot-core span { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--edge-hot); animation: spin 6s linear infinite; }
.boot-core span:nth-child(2) { inset: 12px; border-style: dashed; animation-duration: 9s; animation-direction: reverse; }
.boot-core span:nth-child(3) { inset: 30px; background: radial-gradient(circle, var(--ice), var(--deep)); border: 0;
  box-shadow: 0 0 30px rgba(56,189,248,.6); animation: none; }

/* ── Header ────────────────────────────────────────────────── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 14px; }
.reactor { position: relative; width: 46px; height: 46px; transform-style: preserve-3d; }
.reactor i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(125,211,252,.55); }
.reactor i:nth-child(1) { animation: tumble 14s linear infinite; }
.reactor i:nth-child(2) { inset: 5px; border-style: dashed; border-color: rgba(56,189,248,.5); animation: tumble2 20s linear infinite; }
.reactor i:nth-child(3) { inset: 11px; border-color: rgba(125,211,252,.35); animation: spin 11s linear infinite reverse; }
.reactor b { position: absolute; inset: 16px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #e0f7ff, var(--blue) 55%, #075985);
  box-shadow: 0 0 18px rgba(56,189,248,.75), 0 0 46px rgba(14,165,233,.35); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tumble { to { transform: rotateX(65deg) rotateZ(360deg); } }
@keyframes tumble2 { from { transform: rotateY(60deg) rotateZ(0); } to { transform: rotateY(60deg) rotateZ(-360deg); } }
.name { font: 600 12px/1 var(--mono); letter-spacing: .28em; color: var(--ice); }
.name .ver { color: var(--muted); letter-spacing: .14em; }
.hello { font-size: 22px; font-weight: 650; letter-spacing: -.01em; margin-top: 4px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.cmd { border: 1px solid var(--edge); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 10px; padding: 8px 12px; color: var(--text-2); cursor: pointer; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.cmd span { font: 600 11px var(--mono); color: var(--ice); border: 1px solid var(--edge); border-radius: 6px; padding: 2px 6px; }
.cmd:hover { border-color: var(--edge-hot); }
.live { display: flex; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--text-2); letter-spacing: .06em; white-space: nowrap; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: breathe 3.2s ease-in-out infinite; }
.live.stale .pulse { background: var(--warn); animation: none; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,.5); } 50% { box-shadow: 0 0 0 7px rgba(52,211,153,0); } }

/* ── Live tape ─────────────────────────────────────────────── */
.tape { overflow: hidden; border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); margin: 0 -16px 14px;
  background: linear-gradient(90deg, var(--bg), rgba(8,20,32,.6) 8%, rgba(8,20,32,.6) 92%, var(--bg)); }
.tape-track { display: inline-flex; gap: 38px; padding: 8px 0; white-space: nowrap; font: 12px var(--mono); color: var(--text-2);
  animation: tape 70s linear infinite; padding-left: 100%; }
.tape:hover .tape-track { animation-play-state: paused; }
.tape b { color: var(--ice); font-weight: 600; }
.tape .up { color: var(--good); } .tape .ok { color: var(--blue); }
@keyframes tape { to { transform: translateX(-100%); } }

/* ── Glass modules with HUD brackets ───────────────────────── */
.mod, .kpi, .needs, .calm { position: relative; background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04); }
.mod::before, .kpi::before, .needs::before, .calm::before, .mod::after, .kpi::after, .needs::after, .calm::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--edge-hot); pointer-events: none; opacity: .7; }
.mod::before, .kpi::before, .needs::before, .calm::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.mod::after, .kpi::after, .needs::after, .calm::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }
.tilt { transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .25s; will-change: transform; }
.tilt:hover { border-color: var(--edge-hot); }
.tag { font: 600 10px var(--mono); letter-spacing: .18em; color: var(--ice); border: 1px solid var(--edge); border-radius: 4px; padding: 2px 6px; margin-right: 8px; }

/* Needs you */
.needs { padding: 14px 16px; margin-bottom: 14px; }
.needs h2 { margin: 0 0 10px; font-size: 15px; font-weight: 650; display: flex; align-items: center; }
.needs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.needs-list li button { width: 100%; text-align: left; background: var(--glass-2); border: 1px solid var(--edge); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; display: grid; gap: 4px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.needs-list li button:hover { border-color: var(--edge-hot); box-shadow: 0 0 24px rgba(56,189,248,.12); transform: translateY(-1px); }
.n-title { font-weight: 600; }
.n-meta { color: var(--muted); font: 12px var(--mono); }
.n-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 6px; padding: 0 4px;
  background: rgba(56,189,248,.14); color: var(--ice); font: 700 11px var(--mono); margin-right: 8px; }
.needs-empty { color: var(--text-2); }

/* Tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--glass); border: 1px solid var(--edge); border-radius: 12px;
  margin-bottom: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; cursor: pointer; color: var(--text-2);
  font-weight: 600; transition: background .3s, color .3s, box-shadow .3s; }
.tabs button span { font: 600 10px var(--mono); color: var(--muted); margin-right: 6px; }
.tabs button[aria-selected="true"] { background: linear-gradient(180deg, rgba(56,189,248,.28), rgba(14,165,233,.14)); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--edge-hot), 0 0 20px rgba(56,189,248,.15); }
.tabs button[aria-selected="true"] span { color: var(--ice); }

/* KPI modules */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { padding: 16px; text-align: left; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px;
  min-width: 0; min-height: 132px; align-content: start; }
.kpi .label { grid-column: 1 / -1; font: 600 10px var(--mono); letter-spacing: .2em; color: var(--ice); text-transform: uppercase; }
.kpi .value { font: 600 34px/1.05 var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; transform: translateZ(28px);
  text-shadow: 0 0 22px rgba(56,189,248,.35); align-self: end; }
.kpi .sub { grid-column: 1 / 2; color: var(--text-2); font-size: 13px; transform: translateZ(14px); }
.kpi .viz { grid-row: 2 / 4; grid-column: 2; align-self: center; transform: translateZ(22px); }
.gauge { width: 74px; height: 74px; }
.gauge .track { fill: none; stroke: rgba(125,211,252,.12); stroke-width: 7; }
.gauge .arc { fill: none; stroke: url(#g-ice); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.2,.7,.2,1); }
.gauge text { fill: var(--text); font: 600 13px var(--mono); }
.mini { width: 84px; height: 44px; }
.mini rect { fill: var(--blue); opacity: .85; }
.mini rect.z { fill: rgba(125,211,252,.18); }

/* Orbit: one node per system, turning slowly in 3D */
.orbit { width: 86px; height: 86px; position: relative; transform-style: preserve-3d; }
.orbit .ring { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(68deg); animation: orbit 26s linear infinite; }
.orbit .node { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; }
.orbit .node.good { background: var(--good); box-shadow: 0 0 10px rgba(52,211,153,.7); }
.orbit .node.watch { background: var(--warn); box-shadow: 0 0 10px rgba(251,191,36,.7); }
.orbit .node.needs { background: var(--crit); box-shadow: 0 0 12px rgba(251,113,133,.9); }
.orbit .hub { position: absolute; inset: 31px; border-radius: 50%; background: radial-gradient(circle, rgba(125,211,252,.9), rgba(14,165,233,.2));
  box-shadow: 0 0 16px rgba(56,189,248,.5); }
@keyframes orbit { to { transform: rotateX(68deg) rotateZ(360deg); } }

/* Module grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.mod { padding: 16px; min-width: 0; }
.mod.wide { grid-column: 1 / -1; }
.mod h3 { margin: 0 0 12px; font-size: 15px; font-weight: 650; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mod h3 .aside { color: var(--muted); font: 12px var(--mono); }
.mod h3 .lead { display: flex; align-items: center; }

/* Rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid rgba(125,211,252,.08); }
.row { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 6px;
  background: none; border: 0; text-align: left; cursor: pointer; border-radius: 8px; transition: background .2s; }
.row:hover { background: rgba(56,189,248,.07); }
.row .main { min-width: 0; }
.row .t, .row .s { display: block; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r { text-align: right; color: var(--text-2); font: 12px var(--mono); white-space: nowrap; }
.row .r b { display: block; color: var(--text); font: 600 16px var(--mono); }

/* Status chips: icon + word + colour */
.st { display: inline-flex; align-items: center; gap: 6px; font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase;
  white-space: nowrap; color: var(--text-2); }
.st i { width: 9px; height: 9px; display: inline-block; }
.st.good i { background: var(--good); border-radius: 50%; box-shadow: 0 0 8px rgba(52,211,153,.6); }
.st.watch i { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid var(--warn); }
.st.needs i { background: var(--crit); border-radius: 2px; box-shadow: 0 0 8px rgba(251,113,133,.7); }
.st.gone i { background: var(--muted); border-radius: 50%; opacity: .5; }

/* Customer matrix */
.matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.cell { text-align: left; background: var(--glass-2); border: 1px solid var(--edge); border-radius: 12px; padding: 12px; cursor: pointer;
  display: grid; gap: 6px; transition: border-color .25s, transform .3s, box-shadow .25s; min-width: 0; }
.cell:hover { border-color: var(--edge-hot); transform: translateY(-2px); box-shadow: 0 0 26px rgba(56,189,248,.12); }
.cell.gone { opacity: .45; }
.cell .t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .line { display: flex; justify-content: space-between; align-items: end; gap: 8px; }
.cell .big { font: 600 20px var(--mono); }
.cell .big small { color: var(--muted); font-size: 11px; margin-left: 4px; }
.spark { width: 92px; height: 26px; }
.spark path { fill: none; stroke: var(--ice); stroke-width: 1.6; }
.spark .area { fill: rgba(56,189,248,.14); stroke: none; }

/* Chart */
.chart { width: 100%; height: 210px; display: block; }
.chart .grid-line { stroke: rgba(125,211,252,.08); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 10px var(--mono); }
.chart .b { fill: url(#g-bar); }
.chart .sent { fill: none; stroke: var(--good); stroke-width: 1.6; stroke-dasharray: 3 3; opacity: .8; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover { fill: rgba(56,189,248,.06); }
.legend { display: flex; gap: 16px; font: 11px var(--mono); color: var(--text-2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--blue); margin-right: 6px; vertical-align: -1px; }
.legend i.l { height: 0; border-top: 2px dashed var(--good); background: none; border-radius: 0; vertical-align: 3px; }
.tip { position: fixed; pointer-events: none; background: rgba(8,20,32,.92); border: 1px solid var(--edge-hot); color: var(--text);
  border-radius: 10px; padding: 8px 10px; font: 12px var(--mono); box-shadow: 0 0 24px rgba(56,189,248,.2); z-index: 60; }

/* Jobs + changes */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cols h4 { margin: 0 0 6px; font: 600 10px var(--mono); letter-spacing: .2em; color: var(--ice); text-transform: uppercase; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--edge); }
.timeline li { position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 8px 0 8px 6px; }
.timeline li::before { content: ""; position: absolute; left: -19px; top: 14px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--blue); box-shadow: 0 0 8px rgba(56,189,248,.5); }
.timeline .when { color: var(--muted); font: 12px var(--mono); }
.timeline .what { color: var(--text-2); font-size: 13px; }

.calm { display: grid; gap: 12px; place-items: start; padding: 30px; }
.calm h3 { margin: 0; font-size: 22px; }
.calm p { margin: 0; color: var(--text-2); max-width: 64ch; }
.calm ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.note { color: var(--muted); font-size: 13px; }
.warn-note { color: var(--warn); font-size: 13px; }
.foot { text-align: center; color: var(--muted); font: 11px var(--mono); letter-spacing: .12em; margin-top: 24px; text-transform: uppercase; }

/* Drawer */
.scrim, .palette-scrim { position: fixed; inset: 0; background: rgba(1,4,8,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  z-index: 40; animation: fade .2s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: rgba(6,16,26,.94); z-index: 41;
  border-left: 1px solid var(--edge-hot); display: flex; flex-direction: column; animation: slide .3s cubic-bezier(.2,.7,.2,1);
  box-shadow: -20px 0 60px rgba(0,0,0,.5); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px; }
.drawer-head h3 { margin: 0; font-size: 18px; }
.close { border: 1px solid var(--edge); background: var(--glass-2); width: 34px; height: 34px; border-radius: 10px; font-size: 20px; cursor: pointer; }
.drawer-body { padding: 6px 18px 28px; overflow: auto; }
.drawer-body h4 { font: 600 10px var(--mono); letter-spacing: .2em; color: var(--ice); text-transform: uppercase; margin: 18px 0 6px; }
.drawer-body dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 16px; }
.drawer-body dt { color: var(--muted); }
.drawer-body dd { margin: 0; font-family: var(--mono); }
.drawer-body .how { white-space: pre-wrap; background: var(--glass-2); border: 1px solid var(--edge); border-radius: 12px; padding: 12px; margin: 8px 0; }
.copy { border: 1px solid var(--edge-hot); background: rgba(56,189,248,.12); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* Command palette */
.palette { position: fixed; left: 50%; top: 14vh; transform: translateX(-50%); width: min(620px, 92vw); z-index: 42;
  background: rgba(6,16,26,.96); border: 1px solid var(--edge-hot); border-radius: 16px; box-shadow: 0 0 60px rgba(56,189,248,.18);
  animation: fade .18s ease; overflow: hidden; }
.palette input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--edge); padding: 16px 18px; color: var(--text);
  font: 16px var(--sans); outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette li { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.palette li[aria-selected="true"], .palette li:hover { background: rgba(56,189,248,.12); }
.palette li .k { font: 10px var(--mono); letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.pal-foot { padding: 10px 16px; border-top: 1px solid var(--edge); color: var(--muted); font: 11px var(--mono); }

.skeleton { height: 54px; border-radius: 12px; background: var(--glass-2); animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .55; } }
.enter { animation: enter .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes enter { from { transform: translateY(14px) rotateX(8deg); } }

/* The gate: a fingerprint and a greeting (login.html) */
.gate { position: relative; z-index: 1; min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px;
  padding: 16px; text-align: center; }
.gate-name { font: 600 12px var(--mono); letter-spacing: .5em; color: var(--ice); opacity: .8; }
.gate h1 { margin: 0; font-weight: 300; font-size: clamp(26px, 5vw, 40px); letter-spacing: .01em; }
.gate p { margin: 0; color: var(--text-2); min-height: 1.4em; max-width: 320px; }
.gate p.bad { color: var(--warn); }
.print { position: relative; width: 132px; height: 132px; border-radius: 50%; border: 1px solid var(--edge-hot); cursor: pointer;
  display: grid; place-items: center; background: radial-gradient(circle, rgba(56,189,248,.16), rgba(3,6,10,.4) 70%);
  box-shadow: 0 0 40px rgba(56,189,248,.18); transition: transform .3s ease, box-shadow .3s ease; }
.print:hover { transform: scale(1.04); box-shadow: 0 0 60px rgba(56,189,248,.3); }
.print:disabled { opacity: .4; cursor: default; }
.print img { opacity: .9; }
.print .ring { position: absolute; inset: -8px; border-radius: 50%; border: 1px dashed rgba(125,211,252,.35); animation: spin 18s linear infinite; }
.reading .print .ring { border-style: solid; border-color: var(--ice); animation-duration: 1.6s; }
.welcome .print { box-shadow: 0 0 90px rgba(34,197,94,.45); border-color: rgba(134,239,172,.8); }
@media (prefers-reduced-motion: reduce) { .print .ring { animation: none; } }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .needs-list { grid-template-columns: 1fr; }
  .grid, .cols { grid-template-columns: 1fr; }
  .kpi .value { font-size: 28px; }
  .cmd { display: none; }
}
@media (max-width: 460px) {
  .kpis { grid-template-columns: 1fr; }
  .tabs { display: flex; width: 100%; }
  .tabs button { flex: 1; padding: 8px 4px; font-size: 13px; }
  .tabs button span { display: none; }
  .hello { font-size: 19px; }
  .name .ver { display: none; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .drawer { top: auto; height: 86vh; width: 100%; border-left: 0; border-top: 1px solid var(--edge-hot); border-radius: 20px 20px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .boot { display: none; }
}

/* ══ v2: one brain per section, each in its own colours ══════════════════════ */
body[data-theme="byrne"] { --ice: #7dd3fc; --blue: #38bdf8; --deep: #0ea5e9; --edge: rgba(125,211,252,.16); --edge-hot: rgba(125,211,252,.55);
  --glow: rgba(56,189,248,.35); --tint: rgba(14,165,233,.10); }
body[data-theme="investing"] { --ice: #a7f3d0; --blue: #10b981; --deep: #047857; --edge: rgba(167,243,208,.16); --edge-hot: rgba(167,243,208,.55);
  --glow: rgba(16,185,129,.35); --tint: rgba(4,120,87,.12); }
body[data-theme="trading"] { --ice: #fde68a; --blue: #f59e0b; --deep: #b45309; --edge: rgba(253,230,138,.16); --edge-hot: rgba(253,230,138,.55);
  --glow: rgba(245,158,11,.35); --tint: rgba(180,83,9,.12); }
body { background: radial-gradient(1400px 900px at 50% 30%, var(--tint), transparent 70%), #020407; transition: background .8s; }
.top { position: sticky; top: 0; z-index: 30; padding: max(12px, env(safe-area-inset-top)) 18px 10px; margin: 0;
  background: linear-gradient(180deg, rgba(2,4,7,.92), rgba(2,4,7,.55) 70%, transparent); }
.top .tabs { margin: 0; }
.name { font-size: 11px; }
.hello { font-size: 18px; margin-top: 3px; }
.reactor b { background: radial-gradient(circle at 40% 35%, #fff, var(--blue) 55%, var(--deep)); box-shadow: 0 0 18px var(--glow), 0 0 46px var(--glow); }
.reactor i { border-color: var(--edge-hot); }

.stage { position: relative; height: calc(100vh - 64px); min-height: 520px; overflow: hidden; }
#brain { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#brain:active { cursor: grabbing; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.node-label { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; display: grid; gap: 1px; text-align: left;
  background: rgba(2,6,10,.55); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); border-radius: 4px; padding: 3px 7px;
  font: 600 10px/1.25 var(--mono); letter-spacing: .1em; color: var(--text); white-space: nowrap; transition: opacity .4s;
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 30%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.node-label .nl-t { color: color-mix(in srgb, var(--c) 70%, white); text-transform: uppercase; }
.node-label .nl-s { color: var(--text-2); font-weight: 500; letter-spacing: .04em; }
.node-label:hover { border-color: var(--c); }
.node-label.dim .nl-t { color: var(--muted); }

.hud { position: absolute; z-index: 3; }
.hud-title { left: 22px; top: 18px; max-width: 46ch; }
.sect { font: 600 12px var(--mono); letter-spacing: .3em; color: var(--ice); text-transform: uppercase; }
.sect-sub { font-size: 28px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; text-shadow: 0 0 30px var(--glow); }
.hud-needs { right: 18px; top: 18px; width: min(340px, 34vw); background: rgba(4,10,16,.5); border: 1px solid var(--edge); border-radius: 14px;
  padding: 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hud-needs h2 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: center; }
.hud-needs .needs-list { grid-template-columns: 1fr; gap: 6px; }
.hud-needs .needs-list li button { padding: 8px 10px; background: rgba(10,22,34,.55); }
.hud-needs .n-title { font-size: 13px; }
.hud-stats { left: 22px; bottom: 92px; display: flex; gap: 10px; flex-wrap: wrap; max-width: 62vw; }
.stat { background: rgba(4,10,16,.5); border: 1px solid var(--edge); border-radius: 12px; padding: 10px 14px; min-width: 128px; text-align: left;
  cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: border-color .25s, transform .25s; }
.stat:hover { border-color: var(--edge-hot); transform: translateY(-2px); }
.stat .k { font: 600 9px var(--mono); letter-spacing: .22em; color: var(--ice); text-transform: uppercase; }
.stat .v { font: 600 26px/1.1 var(--mono); margin-top: 4px; text-shadow: 0 0 20px var(--glow); }
.stat .d { color: var(--text-2); font-size: 12px; margin-top: 2px; }

.ask { position: absolute; z-index: 4; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(720px, calc(100% - 32px));
  display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 16px; background: rgba(4,10,16,.7); border: 1px solid var(--edge-hot);
  box-shadow: 0 0 40px var(--glow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.ask input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font: 15px var(--sans); padding: 8px 6px; }
.ask input::placeholder { color: var(--muted); }
.mic { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--edge-hot); background: radial-gradient(circle, var(--tint), transparent);
  cursor: pointer; position: relative; flex: none; }
.mic i { position: absolute; inset: 13px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 14px var(--glow); }
.mic.on { animation: listen 1.6s ease-in-out infinite; }
@keyframes listen { 50% { box-shadow: 0 0 0 8px rgba(255,255,255,.04), 0 0 30px var(--glow); } }
.voice-toggle, .talk-mode { border: 1px solid var(--edge); background: rgba(10,22,34,.6); border-radius: 10px; padding: 8px 10px; cursor: pointer;
  color: var(--text-2); font: 600 12px var(--mono); flex: none; }
.voice-toggle[aria-pressed="false"] { opacity: .45; }
.talk-mode[aria-pressed="true"] { border-color: var(--edge-hot); color: var(--text); background: var(--tint); }
.talk-log { position: absolute; z-index: 4; left: 50%; bottom: 88px; transform: translateX(-50%); width: min(720px, calc(100% - 32px));
  display: grid; gap: 8px; max-height: 40vh; overflow: auto; pointer-events: auto; }
.talk-log .msg { padding: 10px 14px; border-radius: 12px; font-size: 15px; max-width: 85%; animation: fade .3s ease; }
.talk-log .msg.me { justify-self: end; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.talk-log .msg.j { justify-self: start; background: rgba(4,10,16,.7); border: 1px solid var(--edge-hot); box-shadow: 0 0 20px var(--glow); }
.talk-log .msg.j b { font: 600 10px var(--mono); letter-spacing: .2em; color: var(--ice); display: block; margin-bottom: 2px; }
.talk-log .msg.sys { justify-self: center; color: var(--warn); font-size: 13px; background: rgba(4,10,16,.7); border: 1px solid rgba(251,191,36,.3); }
.stage.talking .hud-needs, .stage.talking .hud-stats, .stage.talking .labels, .stage.talking .hud-title .sect-sub { opacity: 0; pointer-events: none; }
.stage .hud-needs, .stage .hud-stats, .stage .labels, .sect-sub { transition: opacity .6s; }
.down { position: absolute; z-index: 3; right: 22px; bottom: 30px; color: var(--muted); font: 600 11px var(--mono); letter-spacing: .14em;
  text-decoration: none; text-transform: uppercase; }
.tape { margin: 0; position: relative; z-index: 2; }
main.app { padding-top: 22px; }

@media (max-width: 900px) {
  .top { flex-wrap: wrap; }
  .top .tabs { order: 3; width: 100%; display: flex; }
  .top .tabs button { flex: 1; }
  .stage { height: calc(100vh - 110px); }
  .hud-needs { display: none; }
  .hud-stats { bottom: 86px; max-width: calc(100% - 32px); left: 16px; }
  .stat { min-width: 0; flex: 1 1 40%; padding: 8px 10px; }
  .stat .v { font-size: 20px; }
  .sect-sub { font-size: 22px; }
  .talk-mode { display: none; }
  .down { display: none; }
}

/* ── Desktop widget (widget.html) ─────────────────────────────
   Sits on real macOS glass (Jarvis Bar draws it), so no card colour of its own: warm neutral
   text that suits a dark wallpaper, one quiet accent per world, an even 2x2 grid. */
body.widget { background: transparent; overflow: hidden; margin: 0; color: #ece9e2;
  font: 13px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body.widget[data-theme="byrne"] { --acc: #9cc9e6; }
body.widget[data-theme="investing"] { --acc: #9fd8bd; }
body.widget[data-theme="trading"] { --acc: #e6c58f; }
.w-card { box-sizing: border-box; width: 100vw; height: 100vh; padding: 16px; cursor: pointer;
  display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 12px; }
.w-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: .14em; color: rgba(236,233,226,.5); }
.w-time { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.w-head { display: flex; align-items: baseline; gap: 8px; font-size: 17px; font-weight: 600; }
.w-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); align-self: center; box-shadow: 0 0 10px var(--acc); }
.w-role { font-size: 13px; font-weight: 400; color: rgba(236,233,226,.55); }
.w-stats { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; border-radius: 14px; overflow: hidden;
  background: rgba(255,255,255,.07); }
.w-stat { background: rgba(20,19,16,.35); padding: 10px 12px; display: grid; align-content: center; gap: 2px; }
.w-stat .k { font-size: 11px; color: rgba(236,233,226,.55); }
.w-stat .v { font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: #f5f3ee; }
.w-stat .d { font-size: 11px; color: var(--acc); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-need { font-size: 12px; color: rgba(236,233,226,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-need b { color: var(--acc); font-weight: 600; margin-right: 6px; }
.w-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 2px; border-radius: 9px; background: rgba(255,255,255,.07); }
.w-tabs button { border: 0; background: transparent; border-radius: 7px; padding: 5px 0; font: 500 12px -apple-system, system-ui, sans-serif;
  color: rgba(236,233,226,.6); cursor: pointer; }
.w-tabs button[aria-selected="true"] { background: rgba(255,255,255,.14); color: #f5f3ee; }
