/* ORION — near-black, frosted light glass, gold / cream / white light.
   Phone: the network is the header, the conversation is the page.
   Desktop (≥900px): the network fills the screen; glass panels float over it. */

@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  color-scheme: dark;
  --bg0: #0b0b0c;
  --text: #f4f0e8;
  --text-2: #b4ac9f;
  --text-3: #7a7469;
  --ink: #151310;            /* text on off-white fills */
  --paper: #f6f1e7;          /* the off-white "selected" fill */
  --pale: #f6ecd6;
  --cream: #efe2c4;
  --gold: #d6b46a;
  --gold-l: #e7c983;
  --gold-2: #b08a3e;
  --gold-3: #8a6524;
  --coral: #e0806f;          /* bad / needs you */
  --amber: #f0c36d;
  /* legacy names, now in the gold family */
  --mint: var(--gold-l);
  --mint-2: var(--gold-2);
  --rose: var(--coral);
  --red: var(--coral);
  --edge: rgba(255, 255, 255, 0.09);
  --edge-2: rgba(255, 255, 255, 0.15);
  --fill: rgba(255, 255, 255, 0.045);
  --fill-2: rgba(255, 255, 255, 0.08);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  --glass-heavy: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.03)), rgba(18, 17, 16, 0.6);
  --glass-edge: rgba(255, 255, 255, 0.12);
  --blur: blur(28px) saturate(150%);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --panel: "Oxanium", "Eurostile", "Geist", sans-serif;   /* squared 80s instrument-panel lettering */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --top-h: calc(72px + var(--sat));
  --rw: 0px;          /* width the detail panel takes on the right */
  --dock-h: 190px;    /* measured by app.js */
  --map-h: 38svh;
  --dock-w: min(640px, max(460px, calc(100vw - var(--rw) - 420px)));
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1);
  /* the motion curves: a strong ease-out for things arriving, ease-in-out for things moving on
     screen, and the iOS drawer curve. Everything else uses these, not hand-typed beziers. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --chat-l: 300px;    /* the column of tools on the left while chatting */
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 400 0.9375rem/1.45 var(--font);
  color: var(--text);
  background: var(--bg0);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--gold-l); outline-offset: 2px; }
svg { display: block; }
h2 { margin: 0; font-weight: 500; }
/* accounts that can't act on the PC: no bell, no business page, no approvals card */
body.guest [data-owner], body.guest .stat[data-stat="waiting"], body.no-admin [data-admin] { display: none !important; }
body.guest .stats { grid-template-columns: repeat(3, 1fr); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* near-black with a faint dot grid and a warm centre */
.bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(55% 45% at 50% 46%, rgba(120, 88, 36, 0.16), transparent 70%),
    radial-gradient(90% 80% at 50% 45%, #121110 0%, #0b0b0c 60%, #070707 100%);
}
.bg::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1.3px) 0 0 / 22px 22px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 45%, #000 30%, transparent 85%);
  mask-image: radial-gradient(80% 70% at 50% 45%, #000 30%, transparent 85%);
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.6));
}

/* ---------- shared pieces ---------- */

.glass, .glass-pill {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--hi), var(--shadow);
  border-radius: 22px;
}
.glass-pill { border-radius: 999px; box-shadow: var(--hi), 0 12px 30px rgba(0, 0, 0, 0.35); }

.tile {
  position: relative;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--hi);
  color: var(--text-2);
  transition: background 0.15s, color 0.15s, transform 0.16s var(--ease-out);
}
.tile.round { width: 44px; height: 44px; border-radius: 50%; }
.tile svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile:hover { color: var(--text); background: rgba(255, 255, 255, 0.12); }
.tile:active { transform: scale(0.96); transition-duration: 0.1s; }
.tile.on { color: var(--ink); background: var(--paper); border-color: transparent; }
.tile.ghost { background: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.tile.ghost:hover { background: var(--fill-2); }
.tile.sm { width: 28px; height: 28px; border-radius: 50%; }
.tile.sm svg { width: 15px; height: 15px; }
.tdot {
  position: absolute; top: 7px; right: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff4d6, var(--amber) 55%, #9b6c1e);
  box-shadow: 0 0 0 2px #1a1815, 0 0 10px rgba(240, 195, 109, 0.85);
}
.tdot.bump { animation: bump 0.4s var(--spring); }
@keyframes bump { 40% { transform: scale(1.6); } }

.chip {
  height: 32px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge-2);
  font-size: 0.8125rem; font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.15s, transform 0.16s var(--ease-out);
}
.chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--text-2); }
.chip .chev { width: 13px; height: 13px; }
.chip:hover { background: var(--fill-2); }
.chip:active { transform: scale(0.96); transition-duration: 0.1s; }
.chip-sm { font: 500 0.6875rem/1 var(--mono); padding: 5px 8px; border-radius: 999px; background: var(--fill-2); color: var(--text-2); }

.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 999px; font-size: 0.6875rem; font-weight: 500;
  background: rgba(214, 180, 106, 0.14); color: var(--gold-l); border: 1px solid rgba(214, 180, 106, 0.32);
}
.badge.idle { background: var(--fill); color: var(--text-2); border-color: var(--edge-2); }
.badge.warn { background: rgba(240, 195, 109, 0.12); color: var(--amber); border-color: rgba(240, 195, 109, 0.3); }
.badge.alert { background: rgba(224, 128, 111, 0.13); color: var(--coral); border-color: rgba(224, 128, 111, 0.32); }
.badge.outline { background: rgba(0, 0, 0, 0.25); color: var(--text-2); border-color: var(--edge-2); }

.mpill {
  display: inline-flex; align-items: center; gap: 5px; height: 18px; padding: 0 7px;
  border-radius: 999px; background: rgba(10, 10, 10, 0.6); border: 1px solid var(--edge-2);
  font: 500 0.625rem/1 var(--mono); color: var(--text);
}
.mpill b { font-weight: 600; color: var(--text-2); }

.sphere { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.sphere.hub { background: radial-gradient(circle at 35% 32%, #fffbf1, #f3e4c0 30%, #c9a467 72%, #5c431c); box-shadow: 0 0 10px rgba(236, 217, 174, 0.5); }
.sphere.tool { background: radial-gradient(circle at 35% 32%, #fff6dc, #f2d896 30%, #b98a3a 72%, #3d2a0c); }
.sphere.skill { background: radial-gradient(circle at 35% 32%, #ffffff, #ece7dc 35%, #a8a29a 75%, #3a3732); }
.sphere.call { width: 8px; height: 8px; background: radial-gradient(circle at 35% 32%, #fffaf0, #e9dcc2 40%, #9c8f78 82%, #2c271f); }
.sphere.fresh { width: 8px; height: 8px; background: radial-gradient(circle at 35% 32%, #fff4d6, #f3c870 40%, #b07b25 82%, #3e2a0c); }

.btn {
  height: 36px; padding: 0 16px; border-radius: 999px;
  font-size: 0.875rem; font-weight: 500;
  transition: transform 0.16s var(--ease-out), background 0.15s;
}
.btn:active { transform: scale(0.96); transition-duration: 0.1s; }
.btn.primary { background: var(--paper); color: var(--ink); }
.btn.secondary { background: var(--fill-2); color: var(--text); border: 1px solid var(--edge-2); }
.text-btn { color: var(--gold-l); font-weight: 500; font-size: 0.875rem; }

/* ---------- stage ---------- */

.stage { position: fixed; inset: 0; z-index: 1; transition: opacity 0.4s; }
body.dash .stage { opacity: 0; pointer-events: none; }

/* ---------- top bar ---------- */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: var(--top-h); padding: var(--sat) 16px 0;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
#btn-menu { display: none; }
.welcome { display: flex; align-items: center; gap: 10px; height: 48px; padding: 5px 18px 5px 5px; min-width: 0; }
.welcome .brand + .welcome-text { padding-left: 10px; border-left: 1px solid var(--edge); }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 28%, #fff6dc, #e8c987 42%, #a97c34 80%, #5e4113);
  color: #2a1d08;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 18px rgba(214, 180, 106, 0.35);
}
.avatar svg { width: 22px; height: 22px; }
.welcome-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
/* the ORION wordmark in the top bar; tap it to replay the intro */
.brand { display: block; flex: none; height: 20px; margin: 0 6px 0 14px; padding: 0; border-radius: 6px; filter: drop-shadow(0 0 5px rgba(214, 170, 90, 0.35)); transition: opacity 0.3s; }
.brand svg { display: block; height: 100%; width: auto; overflow: visible; }
.brand path { vector-effect: non-scaling-stroke; stroke-width: 1; }
.intro-run .brand { opacity: 0; transition: none; }
.orion-mark.draw path { stroke-dasharray: 1; stroke-dashoffset: 1; }
@keyframes thread { to { stroke-dashoffset: 0; } }

/* ---------- the opening ---------- */
.intro { position: fixed; inset: 0; z-index: 200; display: grid; grid-template: 100% / 100%; place-items: center; overflow: hidden; cursor: default; }
.intro-bg { position: absolute; inset: 0; background: #0b0b0c; }
.intro-glow {
  position: absolute; left: 50%; top: 50%; width: min(1100px, 140vw); aspect-ratio: 2.4; translate: -50% -50%; opacity: 0;
  background: radial-gradient(closest-side, rgba(214, 170, 90, 0.16), rgba(214, 170, 90, 0.05) 55%, transparent);
  pointer-events: none;
}
.intro-words {
  position: relative; display: flex; align-items: baseline; white-space: nowrap; visibility: hidden;
  font: 200 120px/1.1 var(--font); letter-spacing: -0.01em; transform-origin: 50% 50%; will-change: transform;
}
.intro-words .iw { display: inline-flex; align-items: baseline; }
.intro-words .cap { position: relative; display: inline-block; white-space: pre; }
.intro-words .cap svg { position: absolute; left: 0; overflow: visible; filter: drop-shadow(0 0 10px rgba(214, 170, 90, 0.45)); }
.intro-words .cap path { vector-effect: non-scaling-stroke; stroke-width: 1.5; }
/* the sphere's slot opens on the left of the name; the sphere sits on the letters' cap height */
.intro-words .intro-orb { position: relative; flex: none; align-self: stretch; }
.intro-words .intro-orb i { position: absolute; left: 0; display: block; filter: drop-shadow(0 0 14px rgba(214, 170, 90, 0.35)); }
.intro-orb canvas, .intro-orbfly canvas { pointer-events: none; display: block; }
.intro-orbfly { position: fixed; transform-origin: 0 0; pointer-events: none; will-change: transform, opacity; }
.intro-orbfly i { position: absolute; inset: 0; display: block; }
/* the ring of light when the opening's sphere locks into its home seat */
.orb-lock {
  position: fixed; z-index: 201; pointer-events: none; border-radius: 50%;
  border: 1.5px solid rgba(240, 205, 130, 0.75);
  box-shadow: 0 0 24px rgba(240, 195, 109, 0.35), inset 0 0 18px rgba(240, 195, 109, 0.18);
}
.intro.on .intro-words .orion-mark.draw path { animation: thread 1.3s cubic-bezier(0.45, 0, 0.2, 1) var(--d, 0s) forwards; }
/* the login's backdrop: near black, with a warm light pooled round the sphere */
.intro-bg::before, .intro-bg::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s var(--ease-out); pointer-events: none; }
.intro-bg::before {
  background:
    radial-gradient(42% 34% at 50% 34%, rgba(214, 160, 80, 0.14), transparent 70%),
    radial-gradient(120% 80% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(180deg, #0d0d0e 0%, #0b0a09 60%, #080808 100%);
}
.intro.gated .intro-bg::before { opacity: 1; }

/* the login: ORION as a title at the top; the sphere, a welcome, then one glass card and the button */
.intro.gated { cursor: auto; }
.gate-wrap {
  position: absolute; left: 50%; top: 50%; translate: -50% -47%; z-index: 1;
  width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; text-align: center;
}
.gate-orb { position: relative; width: 156px; height: 156px; margin-bottom: 14px; }
.gate-orb > i { position: absolute; inset: 0; display: block; }
.gate-hi { margin: 0; font: 300 32px/1.1 var(--font); letter-spacing: -0.02em; color: #f6efe2; }
.gate-sub { margin: 8px 0 26px; max-width: 32ch; text-wrap: balance; font: 400 14px/1.45 var(--font); color: rgba(246, 236, 214, 0.52); }
.gate { position: relative; width: 100%; display: grid; gap: 14px; }
.gate svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gate-card {
  border-radius: 20px; overflow: hidden; text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px -24px rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.gate-card:focus-within { border-color: rgba(255, 255, 255, 0.32); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 4px rgba(255, 255, 255, 0.05), 0 24px 60px -24px rgba(0, 0, 0, 0.9); }
.gate.bad .gate-card { border-color: rgba(224, 128, 111, 0.5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 4px rgba(224, 128, 111, 0.08); }
.gf { position: relative; display: flex; align-items: center; gap: 6px; height: 62px; padding: 0 12px 0 50px; cursor: text; }
.gf + .gf { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.gf-ic { position: absolute; left: 17px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: rgba(255, 255, 255, 0.4); transition: color 0.2s; }
.gf:focus-within .gf-ic { color: #fff; }
.gf-in {
  flex: 1; min-width: 0; height: 100%; padding: 22px 0 6px; background: none; border: 0; outline: none; border-radius: 0;
  color: #fff; font: 400 16px/1.2 var(--font); caret-color: #fff;
}
.gf-in:-webkit-autofill { -webkit-text-fill-color: #fff; transition: background-color 9999s; }
.gf-lb {
  position: absolute; left: 50px; top: 31px; translate: 0 -50%; transform-origin: 0 50%; pointer-events: none;
  font: 400 15.5px/1 var(--font); color: rgba(255, 255, 255, 0.5);
  transition: top 0.22s var(--ease-out), transform 0.22s var(--ease-out), color 0.2s;
}
.gf-in:focus + .gf-lb, .gf-in:not(:placeholder-shown) + .gf-lb, .gf-in:-webkit-autofill + .gf-lb { top: 19px; transform: scale(0.76); color: rgba(255, 255, 255, 0.6); }
.gf-in:focus + .gf-lb { color: rgba(255, 255, 255, 0.85); }
.gf-caps { flex: none; padding: 5px 8px; border-radius: 999px; font: 500 11px/1 var(--font); color: #fff; background: rgba(255, 255, 255, 0.12); }
.gf-caps[hidden] { display: none; }
.gf-eye { flex: none; width: 38px; height: 38px; padding: 9px; border: 0; border-radius: 11px; background: none; color: rgba(255, 255, 255, 0.45); cursor: pointer; transition: color 0.15s, background 0.15s; }
.gf-eye:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.gf-eye:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: -2px; }
.gate-go {
  position: relative; height: 54px; border-radius: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font: 500 15.5px/1 var(--font); letter-spacing: 0.005em; color: #0b0b0c;
  background: #fff; border: 1px solid #fff;
  transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s, transform 0.12s;
}
.gg-i { display: grid; place-items: center; width: 18px; height: 18px; transition: transform 0.25s var(--ease-out); }
.gg-i svg { stroke-width: 1.9; }
@media (hover: hover) and (pointer: fine) {
  .gate-go:not(:disabled):hover { background: #ececec; }
  .gate-go:not(:disabled):hover .gg-i { transform: translateX(3px); }
}
.gate-go:not(:disabled):active { transform: scale(0.985); }
.gate-go:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 3px; }
.gate-go:disabled { cursor: default; color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); }
.gate-go[data-state="busy"], .gate-go[data-state="ok"] { color: #0b0b0c; background: #fff; border-color: #fff; }
.gate-go[data-state="busy"] { opacity: 0.85; }
.gg-spin { display: block; width: 15px; height: 15px; border-radius: 50%; border: 1.6px solid rgba(11, 11, 12, 0.2); border-top-color: #0b0b0c; animation: gspin 0.8s linear infinite; }
@keyframes gspin { to { rotate: 360deg; } }
/* only a failed login says anything */
.gate-err { position: absolute; left: 0; right: 0; top: calc(100% + 16px); margin: 0; text-align: center; font: 400 13.5px/1.45 var(--font); color: var(--coral); }
.gate-err span { display: block; margin-top: 3px; color: rgba(246, 236, 214, 0.5); }
.gate-err:empty { display: none; }
@media (max-width: 560px) {
  .gate-orb { width: 128px; height: 128px; margin-bottom: 10px; }
  .gate-hi { font-size: 28px; }
  .gate-sub { margin-bottom: 22px; }
}
@media (max-height: 640px) {
  .gate-orb { width: 96px; height: 96px; margin-bottom: 6px; }
  .gate-sub { margin-bottom: 16px; }
}

/* a capital in flight to the top bar: solid letter fading into its thread twin */
.intro-flyer { position: fixed; z-index: 2; transform-origin: 0 0; will-change: transform; pointer-events: none; }
.intro-flyer svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 5px rgba(214, 170, 90, 0.35)); }
.intro-flyer path { vector-effect: non-scaling-stroke; stroke-width: 1; }
/* the app settles in behind the logo */
.intro-out .topbar, .intro-out .dock, .intro-out .rail, .intro-out .summary { animation: settle 0.9s var(--ease-out) both; }
@keyframes settle { from { opacity: 0; translate: 0 10px; } }
@media (max-width: 599px) { .intro-words { font-size: 64px; font-weight: 300; } }
.welcome-text b { font-weight: 500; font-size: 0.9375rem; letter-spacing: -0.005em; white-space: nowrap; }
.welcome-text span { font-size: 0.75rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tb-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.pill-btn {
  height: 44px; padding: 0 18px 0 14px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.875rem; font-weight: 500;
  transition: background 0.15s, transform 0.16s var(--ease-out);
}
.pill-btn svg { width: 16px; height: 16px; fill: none; stroke: var(--gold-l); stroke-width: 1.8; stroke-linecap: round; }
.pill-btn:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05)); }
.pill-btn:active { transform: scale(0.96); transition-duration: 0.1s; }
.bell.on { color: var(--ink); background: var(--paper); }
.conn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: var(--glass-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge); box-shadow: var(--hi);
}
.conn svg { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 1.6; }
.conn .conn-arc { fill: var(--text-3); stroke: none; opacity: 0.6; }
.conn.online svg { stroke: var(--gold-l); }
.conn.online .conn-arc { fill: var(--gold-l); opacity: 0.45; }
.conn.connecting svg { animation: spin 1.4s linear infinite; }
.conn.offline svg { stroke: var(--coral); }
@keyframes spin { to { transform: rotate(360deg); } }

.crumb {
  position: fixed; z-index: 15; top: calc(var(--top-h) + 4px); right: 16px;
  max-width: 372px; height: 26px; padding: 0 12px;
  display: flex; align-items: center;
  border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--edge);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  font-size: 0.75rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.25s, transform 0.35s var(--spring);
}
.detail-open .crumb { opacity: 1; transform: none; }

/* ---------- rail (left) ---------- */

.rail {
  position: fixed; z-index: 16; left: 16px; top: calc(var(--top-h) + 14px);
  width: 56px; padding: 7px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border-radius: 28px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--hi), var(--shadow);
}
.rb {
  text-decoration: none;
  position: relative; width: 42px; height: 42px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-2);
  transition: background 0.18s, color 0.18s, transform 0.16s var(--ease-out), box-shadow 0.25s;
}
.rb svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rb:hover { color: var(--text); background: rgba(255, 255, 255, 0.09); }
.rb:active { transform: scale(0.96); transition-duration: 0.1s; }
.rb.on { background: var(--paper); color: var(--ink); box-shadow: 0 0 22px rgba(246, 236, 214, 0.25); }
.rb:disabled { opacity: 0.35; cursor: default; }
.rb:disabled:hover { background: none; color: var(--text-2); }
.rb[data-tip]::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%;
  transform: translate(-4px, -50%); opacity: 0; pointer-events: none;
  height: 28px; padding: 0 12px; display: flex; align-items: center; white-space: nowrap;
  border-radius: 999px; background: rgba(24, 22, 20, 0.92); border: 1px solid var(--edge-2);
  font-size: 0.75rem; font-weight: 500; color: var(--text);
  transition: opacity 0.15s, transform 0.25s var(--spring);
}
.rb:focus-visible::after { opacity: 1; transform: translate(0, -50%); transition-delay: 0.25s; }
@media (hover: hover) and (pointer: fine) { .rb:hover::after { opacity: 1; transform: translate(0, -50%); transition-delay: 0.25s; } }
.rail-sep { width: 20px; height: 1px; margin: 4px 0; background: var(--edge-2); flex: none; }

/* ---------- detail panel (right) ---------- */

.detail {
  position: fixed; z-index: 14;
  top: calc(var(--top-h) + 38px); right: 16px; bottom: 16px; width: 372px;
  border-radius: 26px;
  background:
    radial-gradient(120% 50% at 30% 0%, rgba(214, 180, 106, 0.12), transparent 60%),
    var(--glass-heavy);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--hi), 0 30px 70px rgba(0, 0, 0, 0.5);
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.5s var(--spring), opacity 0.3s;
  display: flex; flex-direction: column;
}
.detail-open .detail { transform: none; opacity: 1; }
.grab-zone { display: none; }
.close-detail { position: absolute; top: 12px; right: 12px; z-index: 2; border-radius: 50%; }
.detail-body { overflow-y: auto; padding: 20px; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }

.d-kicker { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 0.8125rem; margin-bottom: 12px; padding-right: 36px; }
.d-kicker svg { width: 24px; height: 24px; fill: none; stroke: var(--gold-l); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.d-title { font-size: 1.5rem; font-weight: 500; line-height: 1.18; letter-spacing: -0.015em; margin: 0; }
.d-sub { font-size: 1.0625rem; font-weight: 300; color: var(--text); opacity: 0.86; margin: 2px 0 0; line-height: 1.3; letter-spacing: -0.005em; }

.d-status {
  margin-top: 16px; padding: 10px 10px 10px 14px;
  display: flex; align-items: center; gap: 12px;
  border-radius: 18px; border: 1px solid var(--edge-2); background: rgba(255, 255, 255, 0.04);
}
.d-status .st-text { flex: 1; min-width: 0; font-size: 0.75rem; color: var(--text-2); line-height: 1.35; }
.d-status .st-text b { color: var(--text); font-weight: 500; }
.d-status .badge { margin-bottom: 4px; }
.explore {
  height: 34px; padding: 0 12px 0 14px; display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; background: var(--paper); color: var(--ink);
  font-size: 0.8125rem; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, transform 0.16s var(--ease-out);
}
.explore svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.explore:hover { background: #fffaf0; }
.explore:active { transform: scale(0.96); transition-duration: 0.1s; }

.metric {
  margin-top: 12px; padding: 14px 14px 12px;
  border-radius: 20px; border: 1px solid var(--edge);
  background:
    radial-gradient(90% 120% at 0% 100%, rgba(214, 170, 90, 0.2), transparent 60%),
    rgba(255, 255, 255, 0.035);
}
.metric.cool { background: radial-gradient(90% 120% at 100% 0%, rgba(246, 236, 214, 0.1), transparent 60%), rgba(255, 255, 255, 0.035); }
.metric-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.8125rem; font-weight: 500; }
.metric-body { display: flex; align-items: flex-end; gap: 10px; margin-top: 8px; }
.metric-val { font-size: 2.5rem; font-weight: 300; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.metric-val small { font-size: 1.25rem; letter-spacing: 0; }
.delta { display: flex; flex-direction: column; gap: 2px; font-size: 0.6875rem; color: var(--text-3); padding-bottom: 3px; }
.delta b { font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 3px; }
.delta b svg { width: 14px; height: 10px; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.delta .up svg { stroke: var(--cream); } .delta .down svg { stroke: var(--coral); }
.histo { margin-left: auto; width: 150px; height: 46px; }
.histo circle { fill: rgba(236, 220, 180, 0.28); }
.histo circle.hot { fill: rgba(250, 238, 210, 0.95); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cell { padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge); text-align: left; }
button.cell:hover { background: rgba(255, 255, 255, 0.07); }
.cell-top { display: flex; align-items: center; gap: 8px; }
.cell svg { width: 26px; height: 26px; fill: none; stroke: var(--text-2); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.cell-val { font-size: 1.375rem; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cell-val small { font-size: 0.8125rem; color: var(--text-2); margin-left: 2px; }
.cell-label { margin-top: 6px; font-size: 0.75rem; color: var(--text-2); line-height: 1.3; }

.notes-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 0.875rem; font-weight: 500; }
.notes-head svg { width: 18px; height: 18px; fill: none; stroke: var(--gold-l); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.note { padding: 11px 13px; border-radius: 16px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--edge); margin-bottom: 6px; }
.note-t { font-size: 0.8125rem; font-weight: 500; display: flex; justify-content: space-between; gap: 10px; }
.note-t span { color: var(--text-3); font: 400 0.6875rem var(--mono); white-space: nowrap; }
.note-d { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }
.note.empty { color: var(--text-3); font-size: 0.8125rem; }

/* ---------- conversation ---------- */

.convo {
  position: fixed; z-index: 12;
  left: calc((100vw - var(--rw)) / 2); transform: translateX(-50%);
  bottom: calc(var(--dock-h) + 26px);
  width: var(--dock-w);
  max-height: min(30vh, 300px);
  display: flex; flex-direction: column;
  border-radius: 22px;
  transition: opacity 0.25s, transform 0.4s var(--spring), left 0.5s var(--spring), width 0.5s var(--spring);
}
.peek-line { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.convo-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px 18px; }
.convo-head h2 { font-size: 0.8125rem; color: var(--text-2); flex: 1; }
.convo-head .tile, .convo-head .chip-sm { display: none; }
.chat-back {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px 0 6px;
  border-radius: 999px; color: var(--text-2); text-decoration: none; font-size: 0.8125rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.chat-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-back:hover { color: var(--text); background: var(--fill-2); }

/* page states: the conversation only exists as its own page */
body:not(.chat) .convo { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s, visibility 0s 0.25s; }
body.chat .convo {
  left: var(--chat-l); right: calc(var(--rw) + 16px); width: auto;
  top: calc(var(--top-h) + 2px); bottom: calc(var(--dock-h) + 30px); max-height: none;
  transform: none; border-radius: 0; border: 0; box-shadow: none; background: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: opacity 0.45s 0.18s, visibility 0s, right 0.5s var(--spring);
}
body.chat .convo-head { width: 100%; max-width: 808px; margin: 0 auto; padding: 4px 24px 0; }
body.chat .convo-head h2 { display: none; }
body.chat .feed { padding: 18px 24px 36px; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 26px), transparent); }
body.chat .feed-inner { max-width: 760px; margin: 0 auto; gap: 26px; }
@media (min-width: 900px) { body.chat .feed-inner.entering > * { animation: rise 0.6s var(--spring) both; animation-delay: calc(0.22s + var(--i, 0) * 0.05s); } }
/* on a phone the history is just there when you open the conversation; only a new reply rises in */
.convo .msg.fresh, .convo .working.fresh { animation: rise 0.24s var(--ease-out) both; }
/* Claude-style: ORION speaks as plain text, you speak in a bubble */
.convo .msg.leo { background: none; border: 0; padding: 0; border-radius: 0; overflow: visible; }
.convo .msg.leo.live { background: none; }
.convo .msg.leo.live::after { display: none; }
.convo .msg .body { font-size: 1rem; line-height: 1.7; color: #ece6da; }
.convo .msg.user { font-size: 0.9375rem; padding: 11px 16px; border-radius: 20px; max-width: 75%; line-height: 1.55; }
.convo .msg-head { margin-bottom: 6px; }
.convo .suggest { display: none; }
.fly { position: fixed; z-index: 50; margin: 0; pointer-events: none; }
.feed { overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12px); mask-image: linear-gradient(180deg, transparent 0, #000 12px); }
.feed-inner { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }

.msg.leo {
  position: relative; overflow: hidden;
  padding: 12px 14px 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--edge);
}
.msg.leo.live {
  background:
    radial-gradient(80% 140% at 50% 125%, rgba(214, 170, 90, 0.26), transparent 70%),
    rgba(255, 255, 255, 0.05);
  border-color: rgba(236, 210, 160, 0.24);
}
.msg.leo.live::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(246, 222, 170, 0.85), transparent); }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bracket { width: 6px; height: 16px; border: 1.5px solid var(--gold); border-right: 0; border-radius: 2px 0 0 2px; }
.msg-head .who { font-size: 0.875rem; font-weight: 500; }
.msg-head .meta { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--text-2); }
.msg-head .meta svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--spring); }
.msg-head button.meta:hover { color: var(--text); }
.msg.open .msg-head .meta svg { transform: rotate(90deg); }
.msg .body { font-size: 0.875rem; line-height: 1.5; color: #e8e2d6; white-space: pre-wrap; }
.msg.streaming .body::after { content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; background: var(--cream); border-radius: 1px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.msg.interrupted .body { color: var(--text-2); }
.steps-list { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--edge); display: none; font-size: 0.75rem; color: var(--text-2); }
.steps-list li { display: flex; gap: 8px; align-items: center; padding: 2px 0; }
.steps-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-2); flex: none; }
.msg.open .steps-list { display: block; }
.working { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-2); padding: 2px 4px; }
.working .spin { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(236, 220, 180, 0.25); border-top-color: var(--cream); animation: spin 0.8s linear infinite; flex: none; }

.msg.user {
  align-self: flex-end; max-width: 82%;
  padding: 9px 14px; border-radius: 18px 18px 6px 18px;
  background: rgba(239, 226, 196, 0.12); border: 1px solid rgba(239, 226, 196, 0.2);
  font-size: 0.875rem;
}
.voice-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.6875rem; color: var(--cream); margin-bottom: 2px; }
.voice-tag svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.suggest .chip { height: 30px; font-weight: 400; color: var(--text-2); }
.suggest .chip:hover { color: var(--text); }

/* ---------- dock: stat cards + the glowing composer ---------- */

.dock {
  position: fixed; z-index: 13;
  left: calc((100vw - var(--rw)) / 2); transform: translateX(-50%);
  bottom: 18px; width: var(--dock-w);
  transition: left 0.5s var(--spring), width 0.5s var(--spring);
}

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; max-height: 90px;
  transition: max-height 0.45s var(--spring), margin 0.45s var(--spring), opacity 0.25s, transform 0.45s var(--spring);
}
body:not(.home) .stats { max-height: 0; margin-bottom: 0; opacity: 0; transform: translateY(14px); pointer-events: none; }
body.chat .dock {
  left: calc(var(--chat-l) + (100vw - var(--chat-l) - var(--rw)) / 2);
  width: min(760px, calc(100vw - var(--chat-l) - var(--rw) - 48px));
}
body.dash .dock { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(30px); }
.dock { transition: left 0.6s var(--spring), width 0.6s var(--spring), opacity 0.3s, transform 0.45s var(--spring); }
.stat {
  position: relative; text-align: left; padding: 10px 12px 9px; border-radius: 18px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge); box-shadow: var(--hi), 0 10px 26px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, border-color 0.2s, transform 0.16s var(--ease-out);
}
.stat:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)); }
.stat:active { transform: scale(0.97); transition-duration: 0.1s; }
.stat.on { border-color: rgba(239, 226, 196, 0.34); }
.stat.on::before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--pale), transparent); }
.s-label { display: block; font-size: 0.6875rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-row { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; }
.s-row svg { width: 13px; height: 13px; align-self: center; fill: none; stroke: var(--gold-l); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.s-val { font-size: 1.125rem; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.s-unit { font-size: 0.6875rem; color: var(--text-3); }
.s-val.flash { animation: flash 1s ease-out; }
@keyframes flash { 0% { color: var(--pale); text-shadow: 0 0 14px rgba(246, 222, 170, 0.75); } }

/* the composer: a dark well with light running round its edge */
.composer {
  position: relative;
  padding: 14px 10px 10px;
  border-radius: 28px;
  background: rgba(14, 13, 12, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px rgba(0, 0, 0, 0.55);
  --spin: 9s;
}
.composer::before, .composer::after {
  content: ""; position: absolute; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--a),
    rgba(138, 101, 36, 0.25) 0deg, rgba(176, 138, 62, 0.9) 40deg, #f6ecd6 70deg, #d6b46a 100deg,
    rgba(138, 101, 36, 0.2) 150deg, rgba(138, 101, 36, 0.12) 200deg,
    rgba(176, 138, 62, 0.7) 240deg, #efe2c4 268deg, rgba(176, 138, 62, 0.6) 300deg, rgba(138, 101, 36, 0.25) 360deg);
  animation: around var(--spin) linear infinite;
}
/* the ring */
.composer::before {
  inset: 0; padding: 1.25px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* its glow, behind the well */
.composer::after { inset: -3px; z-index: -1; filter: blur(16px); opacity: 0.45; transition: opacity 0.4s; }
.composer.focus { --spin: 5s; }
.composer.focus::after { opacity: 0.7; }
.composer.busy { --spin: 2.8s; }
.composer.busy::after { opacity: 0.85; }
@keyframes around { to { --a: 360deg; } }

.ask { display: block; padding: 0 8px 0 8px; }
.ask-field { display: flex; }
/* the box is a contenteditable, not a textarea: iOS Safari puts its passwords / cards / location
   bar over the keyboard for any textarea or input, but not for this */
.ask-box {
  position: relative; flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: 400 0.9688rem/1.45 var(--font); color: var(--text);
  padding: 2px 0 6px; min-height: 48px; max-height: 132px; overflow-y: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; -webkit-user-select: text; user-select: text;
}
.ask-box.is-empty::before { content: attr(data-placeholder); position: absolute; left: 0; top: 2px; color: #8a8479; pointer-events: none; }
.ask-box:focus-visible { outline: none; }

.dock-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.dock-row .spacer { flex: 1; }
@keyframes lamp-blink { 50% { opacity: 0.2; } }
/* Local / Local+: a circle split down the middle (left lit = Local, right lit = Local+);
   hover or focus opens it into the two positions */
.cloud { position: relative; display: grid; align-items: center; margin-left: 2px; }
.cloud[hidden] { display: none; }
.cloud > * { grid-area: 1 / 1; }
/* the folded state: a round button like its neighbours, with a small split circle inside */
.cloud-dot {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--edge-2);
}
.cloud-ic {
  width: 14px; height: 14px; border-radius: 50%; overflow: hidden; display: flex;
  box-shadow: inset 0 0 0 1px rgba(246, 236, 214, 0.35);
  transition: rotate 0.6s var(--ease-drawer);
}
.cloud-ic span { flex: 1; transition: background 0.4s; }
.cloud:not(.want-plus) .cloud-ic .l { background: rgba(246, 236, 214, 0.75); }
.cloud.want-plus .cloud-ic .r { background: #e7b45a; }
.cloud.pending .cloud-ic span { animation: pulse 0.9s ease-in-out infinite; }
/* opening spins the circle half a turn as it hands over to the slider; closing spins it back */
.cloud:focus-within .cloud-ic, .cloud.open .cloud-ic { rotate: 180deg; }
/* hover-to-open only with a real mouse: on a phone a tap would only fake the hover (and iOS then eats the tap) */
@media (hover: hover) and (pointer: fine) { .cloud:hover .cloud-ic { rotate: 180deg; } }
.cloud-sw {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; height: 36px; align-items: center;
  background: rgba(0, 0, 0, 0.32); border: 1px solid var(--edge-2); cursor: pointer;
  max-width: 36px; overflow: hidden; opacity: 0; pointer-events: none;
  transition: max-width 0.5s var(--ease-drawer), opacity 0.3s var(--ease-drawer);
}
.cloud:focus-within .cloud-sw, .cloud.open .cloud-sw { max-width: 170px; opacity: 1; pointer-events: auto; }
@media (hover: hover) and (pointer: fine) { .cloud:hover .cloud-sw { max-width: 170px; opacity: 1; pointer-events: auto; } }
.cloud-dot { transition: opacity 0.5s var(--ease-drawer), scale 0.6s var(--ease-drawer); }
.cloud:focus-within .cloud-dot, .cloud.open .cloud-dot { opacity: 0; scale: 0.7; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .cloud:hover .cloud-dot { opacity: 0; scale: 0.7; } }
/* the thumb slides between the two halves */
.cloud-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px;
  background: rgba(246, 236, 214, 0.13);
  transition: translate 0.45s var(--ease-drawer), background 0.45s var(--ease-drawer);
}
.cloud.want-plus .cloud-thumb { translate: 100% 0; background: rgba(231, 180, 90, 0.24); }
.cloud-sw button {
  position: relative; height: 28px; padding: 0 12px; border-radius: 999px; white-space: nowrap; background: none;
  font: 500 0.8125rem/1 var(--font); color: var(--text-3); transition: color 0.45s var(--ease-drawer);
}
.cloud-sw button[aria-checked="true"] { color: var(--text); }
.cloud-sw button[data-cloud="1"][aria-checked="true"] { color: var(--gold-l); }
.cloud-sw button:disabled { cursor: not-allowed; opacity: 0.4; }
.cloud.pending .cloud-thumb { animation: pulse 0.9s ease-in-out infinite; }
/* which brain answered a reply */
.msg-head .route { font: 500 10px/1 var(--panel); letter-spacing: 0.05em; padding: 3px 6px; border-radius: 5px; color: var(--text-3); border: 1px solid var(--edge); }
.msg-head .route[data-tier="haiku"], .msg-head .route[data-tier="sonnet"] { color: var(--gold-l); border-color: rgba(231, 180, 90, 0.35); }
.msg-head .route[hidden] { display: none; }
.round-btn {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-2);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--edge-2);
  transition: background 0.15s, color 0.15s, transform 0.16s var(--ease-out), box-shadow 0.25s;
}
.round-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.round-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.round-btn:active { transform: scale(0.96); transition-duration: 0.1s; }
.voice-btn.on { color: #241806; border-color: transparent; background: radial-gradient(circle at 38% 30%, #fff3d4, #e2c07a 55%, #a87a30); box-shadow: 0 0 22px rgba(214, 180, 106, 0.5); }
.round-btn.end { color: var(--coral); }
.dock-row .chip { height: 34px; }

.send {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 0 18px rgba(246, 236, 214, 0.28);
  transition: transform 0.16s var(--ease-out), background 0.2s, color 0.2s, box-shadow 0.25s;
}
.send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.send:active { transform: scale(0.96); transition-duration: 0.1s; }
.send:disabled, .send[aria-disabled="true"] { background: rgba(255, 255, 255, 0.07); color: var(--text-3); box-shadow: none; cursor: default; }

.state-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05); }
.state-dot.active { background: var(--gold-l); box-shadow: 0 0 10px rgba(231, 201, 131, 0.8); animation: pulse 1.6s ease-in-out infinite; }
.state-dot.alert { background: var(--coral); box-shadow: 0 0 10px rgba(224, 128, 111, 0.7); }
@keyframes pulse { 50% { opacity: 0.5; } }

.voice-bar { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 8px 6px; }
.wave { width: 72px; height: 32px; flex: none; }
.voice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.voice-state { font-size: 0.6875rem; color: var(--gold-l); }
.voice-transcript { font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-transcript.placeholder { color: var(--text-2); }

/* ---------- approvals ---------- */

.pop-catcher { position: fixed; inset: 0; z-index: 29; display: none; }
.pop-catcher.on { display: block; }
.approvals-pop {
  position: fixed; z-index: 30;
  top: calc(var(--top-h) + 2px); right: 70px;
  width: min(380px, calc(100vw - 16px)); max-height: min(70vh, 560px);
  display: flex; flex-direction: column;
  border-radius: 24px;
  background: var(--glass-heavy);
  transform-origin: calc(100% - 22px) -8px;
  transform: scale(0.6); opacity: 0; pointer-events: none;
  transition: transform 0.4s var(--spring), opacity 0.2s;
}
.approvals-pop.open { transform: none; opacity: 1; pointer-events: auto; }
.pop-head { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 18px 8px; }
.pop-head h2 { font-size: 0.9375rem; }
.pop-count { font-size: 0.75rem; color: var(--text-2); }
.pop-body { overflow-y: auto; padding: 0 8px 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }
.ap { border-radius: 18px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge); margin-bottom: 8px; overflow: hidden; }
.ap-main { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; text-align: left; padding: 12px 14px 10px; }
.ap-title { font-weight: 500; font-size: 0.875rem; }
.ap-chev svg { width: 16px; height: 16px; fill: none; stroke: var(--text-3); stroke-width: 1.8; transition: transform 0.3s var(--spring); }
.ap.open .ap-chev svg { transform: rotate(90deg); }
.ap-sum { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--text-2); }
.ap-meta { grid-column: 1 / -1; font-size: 0.6875rem; color: var(--text-3); margin-top: 2px; }
.ap-preview { display: none; margin: 0 12px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(239, 226, 196, 0.07); border-left: 2px solid var(--gold); font-size: 0.8125rem; color: var(--text); }
.ap.open .ap-preview { display: block; }
.ap-actions, .t-actions { display: flex; gap: 8px; padding: 0 12px 12px; justify-content: flex-end; }
.t-actions { padding: 8px 0 0; }
.ap-undo { position: relative; display: flex; align-items: center; justify-content: space-between; margin: 0 12px 12px; padding: 8px 12px; border-radius: 12px; background: rgba(214, 180, 106, 0.12); color: var(--gold-l); font-size: 0.8125rem; overflow: hidden; }
.task .ap-undo { margin: 8px 0 0; }
.ap-undo.rejected { background: rgba(224, 128, 111, 0.1); color: var(--coral); }
.ap-undo .timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: currentColor; opacity: 0.5; transform-origin: left; animation: drain linear forwards; }
@keyframes drain { to { transform: scaleX(0); } }
.pop-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 0 18px; color: var(--text-2); font-size: 0.875rem; }
.pop-empty svg { width: 30px; height: 30px; fill: none; stroke: var(--gold-l); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pop-sub { font-size: 0.75rem; color: var(--text-3); padding: 8px 6px 6px; }
.ap-recent { display: flex; align-items: center; gap: 8px; padding: 7px 8px; font-size: 0.8125rem; color: var(--text-2); }
.ap-recent svg { width: 14px; height: 14px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ap-recent.approved svg { stroke: var(--gold-l); } .ap-recent.rejected svg { stroke: var(--coral); }
.ap-recent .when { margin-left: auto; font: 0.6875rem var(--mono); color: var(--text-3); }

/* ---------- dashboards drawer ---------- */

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 41; top: 12px; bottom: 12px; left: 12px;
  width: min(440px, calc(100vw - 24px));
  padding-top: var(--sat);
  display: flex; flex-direction: column;
  border-radius: 28px;
  background: var(--glass-heavy);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--hi), 30px 0 80px rgba(0, 0, 0, 0.5);
  transform: translateX(calc(-100% - 24px));
  visibility: hidden;
  transition: transform 0.5s var(--spring), visibility 0s 0.5s;
}
.drawer.open { transform: none; visibility: visible; transition: transform 0.5s var(--spring); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 14px 8px 22px; }
.drawer-head h2 { font-size: 1.25rem; letter-spacing: -0.01em; }
.drawer-pages { display: none; }
.segmented { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 4px 16px 12px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--edge); }
.segmented button { position: relative; z-index: 1; height: 32px; font-size: 0.8125rem; font-weight: 500; color: var(--text-2); transition: color 0.2s; }
.segmented button[aria-selected="true"] { color: var(--ink); }
.seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 4); border-radius: 999px; background: var(--paper); box-shadow: 0 0 18px rgba(246, 236, 214, 0.2); transition: transform 0.4s var(--spring); }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 16px calc(24px + var(--sab)); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }

.now-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--edge); margin-bottom: 12px; }
.now-card .sphere.hub { width: 22px; height: 22px; }
.now-card .t1 { font-weight: 500; }
.now-card .t2 { font-size: 0.8125rem; color: var(--text-2); }
.group { border-radius: 20px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--edge); overflow: hidden; margin-bottom: 12px; }
.tl-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--edge); align-items: start; }
.tl-item:first-child { border-top: 0; }
.tl-icon svg { width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: var(--text-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tl-item.k-done .tl-icon svg { stroke: var(--gold-l); }
.tl-item.k-approval .tl-icon svg { stroke: var(--amber); }
.tl-item.k-rejected .tl-icon svg { stroke: var(--coral); }
.tl-item.now .tl-title { color: var(--pale); }
.tl-title { font-size: 0.875rem; }
.tl-detail { font-size: 0.75rem; color: var(--text-2); }
.tl-time { font: 0.6875rem var(--mono); color: var(--text-3); }

/* Watching */
.watch-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.watch-add input {
  min-width: 0; height: 44px; padding: 0 14px; border-radius: 14px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--edge-2); color: var(--text); font: inherit; font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.watch-add input::placeholder { color: var(--text-3); }
.watch-add input:focus { outline: none; border-color: rgba(231, 180, 90, 0.55); box-shadow: 0 0 0 3px rgba(231, 180, 90, 0.12); }
.watch-add .btn { height: 44px; padding: 0 18px; }
.watch-result { margin: 0 2px 12px; font-size: 0.8125rem; color: var(--gold-l); animation: rise 0.4s var(--spring) both; }
.watch-item { display: grid; grid-template-columns: 26px 1fr 28px; gap: 8px; align-items: start; padding: 11px 8px 11px 14px; border-top: 1px solid var(--edge); transition: opacity 0.25s; }
.watch-item:first-child { border-top: 0; }
.watch-item.going { opacity: 0.35; pointer-events: none; }
.watch-n { font: 400 0.75rem/1.6 var(--mono); color: var(--gold); }
.watch-t { font-size: 0.9375rem; line-height: 1.4; }
.watch-x { width: 28px; height: 28px; margin-top: -4px; display: grid; place-items: center; border-radius: 8px; color: var(--text-3); opacity: 0.6; transition: opacity 0.15s, color 0.15s, background 0.15s; }
.watch-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.watch-x:focus-visible { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .watch-item:hover .watch-x { opacity: 1; } }
.watch-x:hover { color: var(--coral); background: rgba(255, 255, 255, 0.05); }
.watch-empty { padding: 14px; }
.watch-meta { margin: -4px 4px 16px; font: 400 0.6875rem/1.5 var(--mono); color: var(--text-3); }
.watch-h { margin: 0 4px 8px; font-size: 0.8125rem; font-weight: 500; color: var(--text-2); }
.board { display: grid; gap: 14px; }
.col-head { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 500; margin-bottom: 6px; }
.col-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.col.needs-you .dot { background: var(--coral); } .col.running .dot { background: var(--amber); } .col.done .dot { background: var(--cream); }
.col-head .count { margin-left: auto; font: 0.6875rem var(--mono); color: var(--text-3); }
.col-cards { display: grid; gap: 6px; }
.task { padding: 11px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge); }
.task.needs-you { border-color: rgba(224, 128, 111, 0.32); }
.t-title { font-size: 0.875rem; }
.t-meta { font-size: 0.6875rem; color: var(--text-3); margin-top: 2px; }
.task .bar { height: 3px; border-radius: 2px; background: var(--fill-2); margin-top: 8px; overflow: hidden; }
.task .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--pale)); transition: width 0.5s var(--spring); }
.empty { font-size: 0.8125rem; color: var(--text-3); padding: 8px 2px; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.kpi { padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge); }
.k-label { font-size: 0.75rem; color: var(--text-2); }
.k-value { font-size: 1.5rem; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.k-sub { font-size: 0.6875rem; color: var(--text-3); }
.spark { width: 100%; height: 30px; margin-top: 4px; }
.chart-card { padding: 14px 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge); margin-bottom: 12px; }
.c-title { font-weight: 500; }
.c-sub { font-size: 0.75rem; color: var(--text-2); margin-bottom: 10px; }
.c-foot { font-size: 0.6875rem; color: var(--text-3); margin-top: 8px; }
.bars { width: 100%; height: auto; overflow: visible; }
.bars text { font: 9px var(--mono); fill: var(--text-3); }
.bars .grid { stroke: rgba(255, 255, 255, 0.06); }
.bars .bar { fill: var(--gold); opacity: 0.85; transition: opacity 0.15s; }
.bars .bar.zero { fill: var(--text-3); opacity: 0.4; }
.bars .bar-hit { fill: transparent; }
.bars g:hover .bar, .bars g:focus .bar { opacity: 1; fill: var(--pale); }
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.gauge { padding: 10px 6px; border-radius: 18px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge); text-align: center; }
.gauge svg { width: 76px; height: 76px; margin: 0 auto; }
.g-track { stroke: rgba(255, 255, 255, 0.08); stroke-width: 6; }
.g-fill { stroke: var(--gold-l); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.8s var(--spring); }
.g-val { font: 500 15px var(--font); fill: var(--text); }
.g-label { font-size: 0.8125rem; font-weight: 500; }
.g-sub { font-size: 0.6875rem; color: var(--text-3); }
.rows .row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--edge); font-size: 0.8125rem; }
.rows .row:first-child { border-top: 0; }
.rows .tool-row { width: 100%; text-align: left; transition: background 0.2s; }
.rows .tool-row:hover { background: rgba(255, 255, 255, 0.03); }
.rows .tool-row > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.rows .tool-row svg { width: 16px; height: 16px; fill: none; stroke: var(--gold-l); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rows .v { color: var(--text-2); text-align: right; }

/* ---------- banners & tooltip ---------- */

.banner-layer { position: fixed; z-index: 60; top: calc(var(--sat) + 10px); right: 16px; width: min(380px, calc(100vw - 16px)); display: grid; gap: 8px; pointer-events: none; }
.banner {
  pointer-events: auto; touch-action: none; cursor: pointer;
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  padding: 12px 16px 12px 12px; border-radius: 22px;
  background: var(--glass-heavy);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge); box-shadow: var(--hi), 0 18px 50px rgba(0, 0, 0, 0.5);
}
.app-icon { width: 34px; height: 34px; border-radius: 10px; background: url(../icons/icon.svg) center / cover; }
.b-title { font-size: 0.8125rem; font-weight: 600; }
.b-body { font-size: 0.8125rem; color: var(--text-2); }
.b-time { font-size: 0.6875rem; color: var(--text-3); align-self: start; }
.tooltip { position: fixed; z-index: 70; transform: translate(-50%, calc(-100% - 8px)); padding: 6px 12px; border-radius: 12px; background: rgba(22, 20, 18, 0.94); border: 1px solid var(--edge-2); font-size: 0.75rem; pointer-events: none; display: flex; flex-direction: column; white-space: nowrap; }
.tooltip span { color: var(--text-2); }

/* ---------- while you were gone (ORION page, right side, just text) ---------- */

.summary {
  position: fixed; z-index: 11; right: 56px; top: var(--sum-top, 22vh); width: min(360px, 28vw);
  transition: opacity 0.4s, transform 0.55s var(--spring), top 0.5s var(--spring);
}
/* a soft shadow under the words so the light behind never fights them; no box */
.summary::before {
  content: ""; position: absolute; inset: -70px -90px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(11, 11, 12, 0.78), rgba(11, 11, 12, 0.5) 55%, rgba(11, 11, 12, 0));
}
body:not(.home) .summary, .detail-open .summary { opacity: 0; transform: translateX(28px); pointer-events: none; }
.summary.gone { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.sum-hi { margin: 0; font-size: 1.875rem; font-weight: 300; line-height: 1.12; letter-spacing: -0.025em; }
.sum-lead { margin: 6px 0 18px; font-size: 0.9375rem; color: var(--text-2); }
/* the brief: ORION's own words, set a little larger than the list under it */
.sum-brief { margin: 10px 0 20px; animation: rise 0.6s var(--spring) both; animation-delay: 0.08s; }
.sum-brief p { margin: 0 0 8px; font-size: 0.9375rem; line-height: 1.5; color: var(--text); text-wrap: pretty; }
.sum-brief p:nth-child(n + 2) { color: var(--text-2); }
.sum-brief time { display: block; margin-top: 2px; font: 400 0.6875rem/1.6 var(--mono); color: var(--text-3); }
.sum-wait::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; vertical-align: 2px; background: var(--gold); animation: sum-blink 1s steps(1) infinite; }
@keyframes sum-blink { 50% { opacity: 0.15; } }
@media (prefers-reduced-motion: reduce) { .sum-wait::after { animation: none; } }
.sum-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.sum-list li { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; animation: rise 0.6s var(--spring) both; animation-delay: calc(0.15s + var(--i, 0) * 0.07s); }
.sum-list .t { font-size: 0.9375rem; line-height: 1.35; }
.sum-list .d { grid-column: 1; font-size: 0.8125rem; color: var(--text-2); line-height: 1.4; }
.sum-list time { grid-row: 1; grid-column: 2; font: 400 0.6875rem/1.9 var(--mono); color: var(--text-3); }
.sum-flag { margin-top: 18px; font-size: 0.9375rem; }
.sum-flag button, .sum-ask button { color: var(--gold-l); font-weight: 500; text-align: left; }
.sum-flag button:hover, .sum-ask button:hover { color: var(--pale); }
.sum-ask { margin-top: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.sum-ask span { font-size: 0.75rem; color: var(--text-3); }
.sum-ask button { font-size: 0.875rem; font-weight: 400; color: var(--text-2); display: inline-flex; gap: 8px; align-items: center; }
.sum-ask button::before { content: "→"; color: var(--gold); }
.sum-ask button:hover { color: var(--text); }

/* ---------- dashboard pages (business, admin): transparent over the shader ---------- */

/* the ShaderGradient canvas sits in .bg; it fades in on the dashboard pages only */
.shader { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; }
.shader canvas { display: block; }
.shader.live { opacity: 1; }
body:not(.dash) .shader { transition-duration: 0.5s; }
/* a warm-black wash over it, heavier at the edges, so hairlines and thin numerals stay readable */
.bg::after {
  content: ""; display: block !important; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 60% 30%, rgba(10, 9, 9, 0.28), rgba(8, 7, 7, 0.72));
  opacity: 0; transition: opacity 0.9s ease;
}
body.dash .bg::after { opacity: 1; }

.biz {
  position: fixed; z-index: 9; top: var(--top-h); right: 0; bottom: 0; left: 88px;
  overflow-y: auto; padding: 6px 40px 64px 24px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  opacity: 0; visibility: hidden; transform: translateY(18px);
  transition: opacity 0.3s, transform 0.5s var(--spring), visibility 0s 0.3s;
  --hair: rgba(255, 255, 255, 0.16);
  --hair-2: rgba(255, 255, 255, 0.07);
  --cu: #e9b57c;
}
body.business #biz, body.admin #adm, body.profile #prof { opacity: 1; visibility: visible; transform: none; transition: opacity 0.4s 0.1s, transform 0.6s 0.1s var(--spring), visibility 0s; }
.biz-in { max-width: 1320px; margin: 0 auto; }

/* page head: a large light title, a muted line, KPIs to the right */
.dh, .biz-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px 40px; margin: 18px 0 34px; }
.dh h1, .biz-head h1 { margin: 0; font: 200 clamp(2.5rem, 4.4vw, 3.75rem)/1 var(--font); letter-spacing: -0.035em; }
.dh p, .biz-head p { margin: 12px 0 0; max-width: 56ch; font-size: 0.8125rem; line-height: 1.55; color: var(--text-2); }
.dh-kpis { display: flex; gap: 36px; flex-wrap: wrap; }
.dk { display: grid; gap: 4px; }
.dk-l { font-size: 0.6875rem; letter-spacing: 0.02em; color: var(--text-3); }

/* the numerals: thin, big, with a small unit */
.num { font: 200 2.25rem/1 var(--font); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.num small { font-size: 0.42em; font-weight: 300; letter-spacing: 0; color: var(--text-2); margin: 0 0.18em; vertical-align: 0.95em; }
.num.word { font-size: 1.75rem; }
.num.warn { color: var(--coral); }
/* a value with a small vertical tick in front of it */
.tick { display: inline-block; padding-left: 8px; border-left: 1px solid var(--hair); font: 400 0.75rem/1.25 var(--mono); color: var(--text-2); white-space: nowrap; }
.tick.good { color: var(--cream); border-color: rgba(239, 226, 196, 0.5); }
.tick.warn { color: var(--amber); border-color: rgba(240, 195, 109, 0.6); }
.tick.bad { color: var(--coral); border-color: rgba(224, 128, 111, 0.6); }
/* delta chips, "|+3%" */
.dchip { display: inline-block; padding-left: 7px; border-left: 2px solid currentColor; font: 500 0.75rem/1.2 var(--mono); }
.dchip.good { color: var(--cream); } .dchip.bad { color: var(--coral); } .dchip.flat { color: var(--text-2); }
/* numbered squares */
.nchip { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 3px; background: var(--cu); color: var(--ink); font: 500 0.6875rem/1 var(--mono); }

/* a section: light title, hairline, muted description. No box. */
.dsec { min-width: 0; }
.dsec > h2, .card-h h2 { margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--hair); font: 300 1.1875rem/1.2 var(--font); letter-spacing: -0.01em; }
.dsec > .dd { margin: 12px 0 20px; max-width: 46ch; font-size: 0.78rem; line-height: 1.55; color: var(--text-3); }
.mute { color: var(--text-3); }

.dtable { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.dtable th { text-align: left; font-weight: 400; font-size: 0.6875rem; color: var(--text-3); padding: 0 8px 10px 0; border-bottom: 1px solid var(--hair-2); }
.dtable td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--hair-2); vertical-align: top; font-variant-numeric: tabular-nums; }
.dtable td small { display: block; margin-top: 2px; font-size: 0.6875rem; color: var(--text-3); }
.dtable .r { text-align: right; padding-right: 0; }
.dtable.kv { margin-top: 14px; }

/* small buttons, fields and two-way switches */
.dbtn { height: 34px; padding: 0 16px; border-radius: 4px; background: var(--paper); color: var(--ink); font: 500 0.8125rem/1 var(--font); transition: opacity 0.2s, background 0.2s; }
.dbtn:hover { opacity: 0.88; }
.dbtn[aria-busy="true"] { opacity: 0.55; pointer-events: none; }
.dbtn.ghost { background: none; color: var(--text-2); border: 1px solid var(--hair); }
.dbtn.danger { background: none; color: var(--coral); border: 1px solid rgba(224, 128, 111, 0.4); }
.dbtn.danger.armed { background: var(--coral); color: var(--ink); }
.dform { display: grid; gap: 12px; }
.dform label { display: grid; gap: 6px; }
.dform label span { font-size: 0.6875rem; color: var(--text-3); }
.dform input {
  height: 38px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; background: none;
  color: var(--text); font: 300 0.9375rem var(--font); outline: none; transition: border-color 0.2s;
}
.dform input::placeholder { color: rgba(255, 255, 255, 0.24); }
.dform input:focus { border-color: var(--cu); }
.dform-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.dform > .dbtn { justify-self: start; margin-top: 6px; }
.derr { margin: 0; min-height: 1em; font-size: 0.75rem; color: var(--coral); }
.dswitch { display: inline-flex; border: 1px solid var(--hair); border-radius: 4px; padding: 2px; margin-right: auto; }
.dswitch button { height: 28px; padding: 0 12px; border-radius: 3px; font: 400 0.75rem/1 var(--font); color: var(--text-3); transition: background 0.2s, color 0.2s; }
.dswitch button[aria-pressed="true"] { background: rgba(233, 181, 124, 0.18); color: var(--cu); }
.dswitch button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- business page in the same language ---------- */
.range { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 56px; padding: 2px; border-radius: 4px; border: 1px solid var(--hair); }
.range button { position: relative; z-index: 1; height: 30px; font: 400 0.75rem/1 var(--mono); color: var(--text-3); transition: color 0.2s; }
.range button[aria-pressed="true"] { color: var(--cu); }
.range i { position: absolute; top: 2px; bottom: 2px; left: 2px; width: 56px; border-radius: 3px; background: rgba(233, 181, 124, 0.16); transition: transform 0.4s var(--spring); }

.kts { display: grid; grid-template-columns: 1.6fr repeat(5, 1fr); gap: 0; margin-bottom: 48px; border-top: 1px solid var(--hair); }
.kt { padding: 16px 22px 4px 0; min-width: 0; display: flex; flex-direction: column; }
.kt + .kt { padding-left: 22px; border-left: 1px solid var(--hair-2); }
.kt-l { font-size: 0.6875rem; color: var(--text-3); }
.kt-v { margin-top: 10px; }
.kt-v .num { font-size: 2.25rem; }
.kt.hero .kt-v .num { font-size: 3.75rem; letter-spacing: -0.045em; }
.kt-d { margin-top: 10px; font-size: 0.6875rem; color: var(--text-3); display: flex; flex-wrap: wrap; column-gap: 8px; align-items: baseline; }
.kt svg.spk { margin-top: auto; padding-top: 14px; width: 100%; height: 44px; overflow: visible; }
.spk .cu { fill: url(#copper); }
.spk .cu.now { fill: var(--pale); }

.bgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 52px 44px; }
.card { grid-column: span 6; min-width: 0; }
.card.w8 { grid-column: span 8; } .card.w4 { grid-column: span 4; } .card.w12 { grid-column: span 12; }
.card-h { position: relative; margin-bottom: 18px; }
.card-h > div { display: contents; }
.card-h p { margin: 12px 0 0; max-width: 46ch; font-size: 0.78rem; line-height: 1.5; color: var(--text-3); }
.card-h .big { position: absolute; right: 0; top: -4px; }
.card-h .big .num { font-size: 1.625rem; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font: 10px var(--mono); fill: var(--text-3); }
.chart .grid { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base { stroke: rgba(255, 255, 255, 0.2); stroke-width: 1; shape-rendering: crispEdges; }
.chart .line { fill: none; stroke: var(--cu); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#bizArea); }
.chart .xh { stroke: rgba(255, 255, 255, 0.3); stroke-width: 1; shape-rendering: crispEdges; }
.chart .dot { fill: var(--pale); stroke: #141312; stroke-width: 2; }
.chart .col { fill: url(#copper); transition: opacity 0.15s; }
.chart .col.zero { fill: rgba(255, 255, 255, 0.12); }
.chart g.hit:hover .col, .chart g.hit:focus .col { fill: var(--pale); }
.chart g.hit { outline: none; cursor: default; }
.chart .hb { fill: url(#copper-h); transition: fill 0.15s; }
.chart g.hit:hover .hb, .chart g.hit:focus .hb { fill: var(--pale); }
.chart .lab { font: 400 12px var(--font); fill: var(--text); }
.chart .val { font: 400 11px var(--mono); fill: var(--text-2); }
.chart .track { fill: rgba(255, 255, 255, 0.05); }
.chart .tgt { stroke: var(--coral); stroke-width: 1; opacity: 0.7; shape-rendering: crispEdges; }
.chart .tgt-l { font: 10px var(--mono); fill: var(--text-3); }

.tview { margin-top: 12px; }
.tview summary { font-size: 0.6875rem; color: var(--text-3); cursor: pointer; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.tview summary::-webkit-details-marker { display: none; }
.tview summary::before { content: "▸"; transition: transform 0.2s; }
.tview[open] summary::before { transform: rotate(90deg); }
.tview summary:hover { color: var(--text-2); }
.btable { width: 100%; border-collapse: collapse; font-size: 0.8125rem; margin-top: 4px; }
.btable th { text-align: left; font-weight: 400; font-size: 0.6875rem; color: var(--text-3); padding: 0 8px 10px 0; border-bottom: 1px solid var(--hair-2); }
.btable td { padding: 11px 8px 11px 0; border-bottom: 1px solid var(--hair-2); font-variant-numeric: tabular-nums; }
.btable td.r:not(:first-child) { font-family: var(--mono); font-size: 0.75rem; }
.btable td.r:not(:first-child)::before { content: ""; display: inline-block; width: 1px; height: 0.9em; margin-right: 8px; vertical-align: -0.1em; background: var(--hair); }
.btable .r { text-align: right; padding-right: 0; }
.btable .mute { color: var(--text-3); }
.btable .pbar { display: block; width: 100%; height: 3px; margin-top: 8px; }
.pbar .trk { fill: rgba(255, 255, 255, 0.06); } .pbar .cu { fill: url(#copper-h); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 0.75rem; color: var(--text-2); white-space: nowrap; }
.status::before { content: ""; width: 2px; height: 11px; background: var(--text-3); }
.status.ok::before { background: var(--cu); } .status.warn::before { background: var(--amber); } .status.bad::before { background: var(--coral); }
.biz-foot { margin-top: 48px; padding-top: 12px; border-top: 1px solid var(--hair-2); font-size: 0.6875rem; color: var(--text-3); }

/* ---------- profile (2026-11-18): the person's own page ---------- */
.prof-grid { grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr); }
.prof-line { margin: 0 0 12px; font-size: 0.9375rem; line-height: 1.5; color: var(--text-2); }
.prof-line b { color: var(--text); font-weight: 500; }
.prof-line.mute { color: var(--text-3); }
.prof-facts { list-style: none; margin: 0; padding: 0; }
.prof-facts li { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair-2); transition: opacity 0.25s; }
.prof-facts li.going { opacity: 0.35; }
.prof-facts li > span { flex: 1; min-width: 0; font-size: 0.9375rem; line-height: 1.45; color: var(--text); }
.prof-facts li small { display: block; margin-top: 3px; font: 400 0.6875rem var(--mono); color: var(--text-3); }
.prof-x { flex: none; width: 32px; height: 32px; margin-top: -4px; display: grid; place-items: center; border-radius: 999px; color: var(--text-3); opacity: 0.6; transition: opacity 0.2s, background 0.2s, color 0.2s; }
.prof-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.prof-x:hover, .prof-x:focus-visible { opacity: 1; color: var(--coral); background: rgba(224, 128, 111, 0.1); }
.prof-x:disabled { opacity: 0.25; pointer-events: none; }
.prof-more { margin-top: 14px; }
.prof-about p { margin: 0 0 10px; font-size: 0.875rem; line-height: 1.55; color: var(--text-2); }
.derr.ok { color: var(--text-2); }
@media (max-width: 1180px) { .prof-grid { grid-template-columns: 1fr; gap: 44px; } }

/* a result ORION brings on his own (scheduled task, background job) gets a small label above the message */
.bg-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 6px; padding: 3px 10px 3px 7px; border-radius: 999px; background: rgba(233, 181, 124, 0.1); font: 400 0.6875rem/1.4 var(--mono); letter-spacing: 0.02em; color: var(--amber, #e9b57c); max-width: 100%; }
.bg-kicker svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bg-kicker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* scheduled tasks on the Tasks page: work ORION does, with its status and result */
.tk-item.tk-sched, .tk-item.has-detail { align-items: flex-start; }
.tk-item.tk-sched .tk-time, .tk-item.has-detail .tk-time { padding-top: 2px; }
.tk-item[data-st="running"] .tk-time { color: var(--amber); animation: tk-pulse 1.6s ease-in-out infinite; }
.tk-item[data-st="done"] .tk-t { color: var(--text-2); }
.tk-item[data-st="done"] .tk-time { color: var(--text-3); }
.tk-item[data-st="rejected"] .tk-time { color: var(--coral, #ec6f5e); }
.tk-item.open .bg-detail { -webkit-line-clamp: unset; display: block; color: var(--text); }

/* ---------- admin ---------- */
.adm-wait { color: var(--text-3); font-size: 0.875rem; }
.adm-grid { display: grid; grid-template-columns: minmax(250px, 0.85fr) minmax(0, 1.5fr) minmax(270px, 0.95fr); gap: 52px 48px; align-items: start; }
.adm-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 52px; }
.adm-col { display: grid; gap: 52px; min-width: 0; }
.dsec.wide { margin-top: 52px; }

.acc-list { list-style: none; margin: 0; padding: 0; }
.acc {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 0; text-align: left;
  border-bottom: 1px solid var(--hair-2); transition: background 0.2s;
}
.acc:hover { background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent); }
.acc .nchip { background: rgba(255, 255, 255, 0.08); color: var(--text-2); transition: background 0.2s, color 0.2s; }
.acc.on .nchip { background: var(--cu); color: var(--ink); }
.acc-n { flex: 1; min-width: 0; font: 300 0.9375rem/1.2 var(--font); }
.acc-n small { display: block; margin-top: 3px; font-size: 0.6875rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-r { display: flex; align-items: center; gap: 10px; }
.dot { flex: none; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.dot.on { background: var(--cu); box-shadow: 0 0 0 3px rgba(233, 181, 124, 0.16); }

.made { margin-bottom: 22px; padding: 14px 0 16px; border-top: 1px solid var(--cu); border-bottom: 1px solid var(--hair-2); }
.made p { margin: 0 0 10px; font-size: 0.8125rem; line-height: 1.5; color: var(--text-2); }
.made p b { font-weight: 500; color: var(--text); }
.made-t { display: block; padding: 8px 0; font: 0.6875rem/1.5 var(--mono); color: var(--cu); word-break: break-all; user-select: all; }
.made-b { display: flex; gap: 8px; margin-top: 8px; }

.room-h { padding-bottom: 14px; border-bottom: 1px solid var(--hair); }
.room-n { margin: 0; font: 200 clamp(2.5rem, 3.6vw, 3.5rem)/1 var(--font); letter-spacing: -0.04em; }
.room-s { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 0.78rem; color: var(--text-2); }
.rstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
.rstat { display: grid; gap: 8px; align-content: start; padding: 16px 16px 4px 0; min-width: 0; }
.rstat + .rstat { padding-left: 16px; border-left: 1px solid var(--hair-2); }
.rstat .num { font-size: 2rem; }
.rsub { font: 0.6875rem var(--mono); color: var(--text-3); }

.wall { list-style: none; margin: 0; padding: 0; max-height: 430px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  -webkit-mask-image: linear-gradient(#000 85%, transparent); mask-image: linear-gradient(#000 85%, transparent); }
.w { display: grid; grid-template-columns: 48px 60px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--hair-2); animation: wIn 0.5s var(--spring); }
.w-k { font: 400 0.6875rem var(--mono); color: var(--text-3); }
.w.said .w-k, .w.approval .w-k { color: var(--cu); }
.w.rejected .w-k { color: var(--coral); }
.w-t { font-size: 0.8125rem; line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.w-t small { display: block; margin-top: 2px; font-size: 0.6875rem; color: var(--text-3); }
.w-empty { padding: 12px 0; font-size: 0.8125rem; color: var(--text-3); }
@keyframes wIn { from { opacity: 0; transform: translateY(-6px); } }

.dgauge { position: relative; max-width: 260px; margin: 0 auto; }
.dgauge svg { width: 100%; overflow: visible; }
.g-ticks line { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; }
.g-trk { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 8; }
.dg-arc { fill: none; stroke: url(#copper-h); stroke-width: 8; }
.dgauge-n { position: absolute; left: 0; right: 0; bottom: 0; display: grid; justify-items: center; gap: 6px; }
.dgauge-n .num { font-size: 2.5rem; }
.dgauge-s { display: flex; justify-content: center; gap: 18px; margin: 16px 0 0; }
.dbars { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.dbars li { display: grid; grid-template-columns: 64px 1fr 52px; gap: 12px; align-items: center; font-size: 0.75rem; color: var(--text-2); }
.dbars svg { width: 100%; height: 6px; }
.dbars .trk { fill: rgba(255, 255, 255, 0.06); } .dbars .cu { fill: url(#copper-h); }
.dbars b { font: 400 0.6875rem var(--mono); text-align: right; color: var(--text); }
.master { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--hair-2); }
.master b { display: block; font: 400 0.8125rem var(--font); }
.master small { display: block; margin-top: 3px; font-size: 0.6875rem; line-height: 1.4; color: var(--text-3); }
.master .dswitch { margin: 0; flex: none; }
.risk { display: inline !important; margin-left: 6px; font-size: 0.625rem !important; }
.risk.high { color: var(--coral) !important; } .risk.medium { color: var(--amber) !important; }

.heat { overflow-x: auto; scrollbar-width: none; }
.heat svg { width: 100%; min-width: 560px; display: block; }
.heat text { font: 10px var(--mono); fill: var(--text-3); }
.heat .hl { font: 300 12px var(--font); fill: var(--text-2); }
.heat .hd { fill: var(--cu); }
.heat .h0 { fill: rgba(255, 255, 255, 0.14); }
.hb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hb .rstat:first-child { padding-left: 0; }
.dsec .dgauge-s:empty { display: none; }

@media (max-width: 1180px) {
  .kts { grid-template-columns: repeat(3, 1fr); }
  .kt:nth-child(4) { border-left: 0; padding-left: 0; }
  .kts .kt:nth-child(n + 4) { border-top: 1px solid var(--hair-2); }
  .card, .card.w8, .card.w4 { grid-column: span 12; }
  .adm-grid { grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.4fr); }
  .adm-grid > .adm-col:last-child { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .adm-grid.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 899px) {
  .biz { padding: 4px 16px calc(40px + var(--sab)); }
  .dh, .biz-head { margin: 10px 0 26px; }
  .dh-kpis { gap: 24px; }
  .kts { grid-template-columns: repeat(2, 1fr); }
  .kt.hero { grid-column: span 2; padding-right: 0; }
  .kt { border-left: 0 !important; padding-left: 0 !important; }
  .kts .kt:nth-child(n + 2) { border-top: 1px solid var(--hair-2); }
  .kts .kt:nth-child(odd):not(.hero) { padding-left: 16px !important; border-left: 1px solid var(--hair-2) !important; }
  .kt.hero .kt-v .num { font-size: 3rem; }
  .bgrid { gap: 44px; }
  .adm-grid, .adm-grid.three { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .adm-grid > .adm-col:last-child { grid-template-columns: minmax(0, 1fr); }
  .adm-col { gap: 44px; }
  .adm-grid .mid { order: -1; }
  .rstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rstat:nth-child(3) { padding-left: 0; border-left: 0; }
  .w { grid-template-columns: 52px minmax(0, 1fr); }
  .w-k { grid-column: 2; grid-row: 1; }
  .w-t { grid-column: 2; }
}

/* =========================================================== */
/* Desktop                                                      */
/* =========================================================== */

@media (min-width: 900px) {
  .detail-open { --rw: 388px; }
}
@media (min-width: 900px) and (max-width: 1180px) {
  .detail-open { --dock-w: min(580px, calc(100vw - var(--rw) - 110px)); }
  body:not(.detail-open) { --dock-w: min(580px, calc(100vw - 420px)); }
  .pill-btn span { display: none; }
  .pill-btn { width: 44px; padding: 0; justify-content: center; }
}

/* =========================================================== */
/* Phone                                                        */
/* =========================================================== */

@media (max-width: 899px) {
  :root { --top-h: calc(64px + var(--sat)); }
  .topbar { grid-template-columns: 1fr auto; padding: var(--sat) 12px 0; background: linear-gradient(180deg, rgba(8, 8, 8, 0.85), transparent); }
  #btn-menu { display: grid; }
  .pill-btn, .crumb, .rail { display: none; }
  .welcome { height: 44px; padding-right: 14px; }
  .welcome .welcome-text { display: none; }
  .welcome { padding-right: 10px; }
  .brand { height: 30px; margin: 0 4px; }
  .tb-right { gap: 8px; }
  .tile.round, .conn { width: 40px; height: 40px; }
  .stage { top: var(--top-h); bottom: auto; height: var(--map-h); }
  .stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 28px; background: linear-gradient(transparent, rgba(10, 10, 10, 0.9)); pointer-events: none; }

  .convo {
    left: 0; right: 0; width: auto; transform: none;
    top: calc(var(--top-h) + var(--map-h)); bottom: var(--dock-h); max-height: none;
    border-radius: 0; border: 0; box-shadow: none; background: transparent;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    transition: opacity 0.25s;
  }
  .convo-head { display: none; }
  .feed { padding: 10px 12px 12px; -webkit-mask-image: none; mask-image: none; }

  .dock {
    left: 0; right: 0; bottom: 0; width: auto; transform: none;
    padding: 6px 10px calc(10px + var(--sab));
    background: linear-gradient(180deg, transparent, rgba(8, 8, 8, 0.9) 30%);
  }
  .stats { display: none; }
  .composer { border-radius: 24px; padding: 12px 8px 8px; }
  body.dash .dock { transform: translateY(30px); }
  body.chat .dock { left: 0; width: auto; }
  body.chat { --map-h: 20svh; }
  body.chat .convo { left: 0; right: 0; top: calc(var(--top-h) + var(--map-h)); bottom: var(--dock-h); }
  body.chat .convo-head { display: flex; padding: 6px 10px 0; }
  body.chat .convo { top: calc(var(--top-h) + var(--map-h) - 6px); }
  .drawer-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 6px; margin: 2px 16px 12px; }
  .drawer-pages a {
    display: grid; place-items: center; height: 40px; border-radius: 14px; text-decoration: none;
    font-size: 0.875rem; font-weight: 500; color: var(--text-2); background: var(--fill-2); border: 1px solid var(--edge);
  }
  .drawer-pages a.on { color: var(--ink); background: var(--paper); border-color: transparent; }
  body.chat .feed { padding: 14px 16px 24px; }
  .summary {
    left: 20px; right: 20px; width: auto; top: calc(var(--top-h) + var(--map-h) + 12px) !important;
    bottom: calc(var(--dock-h) + 8px); overflow-y: auto;
  }
  .summary::before { display: none; }
  .biz { inset: var(--top-h) 0 0 0; padding: 4px 14px calc(32px + var(--sab)); }
  .ask-box { min-height: 40px; }

  .detail {
    z-index: 42;
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 82svh;
    border-radius: 28px 28px 0 0; border-bottom: 0;
    transform: translateY(105%); opacity: 1;
    padding-bottom: var(--sab);
    transition: transform 0.4s var(--ease-drawer);
  }
  .detail-open .detail { transform: none; }
  .detail.dragging { transition: none; }
  .grab-zone { display: flex; justify-content: center; padding: 8px 0 2px; cursor: grab; touch-action: none; }
  .grabber { width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); }
  .detail-body { padding-top: 8px; }
  .close-detail { top: 14px; }

  .approvals-pop { right: 8px; transform-origin: calc(100% - 70px) -8px; }
  .banner-layer { left: 8px; right: 8px; width: auto; }
  .drawer { top: 0; bottom: 0; left: 0; width: 100vw; border-radius: 0; border: 0; }
}

/* =========================================================== */
/* Accessibility                                                */
/* =========================================================== */

@media (prefers-reduced-motion: reduce) {
  /* gentler, not none: things still fade (short), but nothing moves, slides or loops */
  *, *::before, *::after {
    transition-property: opacity, color, background-color, border-color, box-shadow, visibility !important;
    transition-duration: 0.18s !important; transition-delay: 0s !important;
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
  }
  .composer::before, .composer::after { animation: none !important; --a: 30deg; }
  .detail, .drawer, .approvals-pop, .convo { transition: opacity 0.2s !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .glass-pill, .tile, .rail, .stat, .fchip, .conn, .detail, .drawer, .approvals-pop, .banner, .crumb { background: #1b1a18; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --edge: rgba(255, 255, 255, 0.3); --edge-2: rgba(255, 255, 255, 0.45); --glass-edge: rgba(255, 255, 255, 0.4); --text-2: #d6cfc2; --text-3: #aaa294; }
  .glass, .detail, .drawer, .rail, .stat { background: #141312; }
}

/* phone: while typing, give the conversation the room */
@media (max-width: 899px) {
  .typing { --map-h: 16svh; }
}

/* =========================================================== */
/* Minimal layer: flat, quiet, hairlines. No dot grid, no glow  */
/* =========================================================== */

:root {
  --glass-bg: rgba(19, 18, 17, 0.78);
  --glass-heavy: rgba(16, 15, 14, 0.95);
  --glass-edge: rgba(255, 255, 255, 0.08);
  --hi: 0 0 0 transparent;
  --shadow: 0 0 0 transparent;
  --blur: blur(18px) saturate(115%);
}
.bg { background: radial-gradient(80% 60% at 50% 42%, #121110 0%, #0b0b0c 72%); }
.bg::before, .bg::after { display: none; }

.glass { border-radius: 16px; }
.glass-pill { box-shadow: none; }
.tile { border-radius: 10px; }
.rail { width: 52px; padding: 5px; border-radius: 18px; }
.rb { width: 40px; height: 40px; border-radius: 12px; }
.rb.on { box-shadow: none; }
.stat { border-radius: 12px; box-shadow: none; }
.stat.on::before { display: none; }
.kt, .card { border-radius: 14px; box-shadow: none; }
.tdot { background: var(--amber); box-shadow: 0 0 0 2px var(--bg0); }
.voice-btn.on { box-shadow: none; }
.msg.leo.live::after { display: none; }

/* the wordmark stands on its own: small, no pill, no glow */
.brand { height: 14px; margin: 0 0 0 8px; filter: none; border-radius: 2px; }
.brand path { stroke-width: 0.9; }

/* the composer: a flat well with a hairline; the light only runs round it while ORION works */
.composer { border-radius: 20px; background: #121110; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.composer::after { display: none; }
.composer::before { opacity: 0; transition: opacity 0.4s; }
.composer.focus::before { opacity: 0.45; }
.composer.busy::before { opacity: 1; }

.m-state { display: none; }

/* =========================================================== */
/* Phone, simplified: logo, orbit + voice, a short note, ask    */
/* =========================================================== */

@media (max-width: 899px) {
  :root { --top-h: calc(52px + var(--sat)); --map-h: 36svh; }
  body.chat { --map-h: 13svh; }
  .typing { --map-h: 13svh; }

  .topbar { padding: var(--sat) 6px 0; background: none; }
  .brand { position: absolute; left: 50%; top: calc(var(--sat) + 26px); transform: translate(-50%, -50%); height: 13px; margin: 0; }
  #btn-menu, .bell { background: none; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  .conn { display: none; }

  .stage::after { display: none !important; }
  .stage { top: var(--top-h); height: var(--map-h); }
  .orbit { inset: 6px 0 30px; transition: inset 0.45s var(--spring); }
  .m-state {
    display: block; position: absolute; left: 20px; right: 20px; bottom: 6px; margin: 0;
    text-align: center; font: 400 0.75rem/1.4 var(--mono); color: var(--text-2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: opacity 0.25s;
  }
  body.chat .m-state, .typing .m-state { opacity: 0; }
  body.chat .orbit, .typing .orbit { inset: 2px 0 2px; }

  /* the note under the orbit: plain rows, hairline rules */
  .summary { left: 20px; right: 20px; top: calc(var(--top-h) + var(--map-h) + 18px) !important; }
  .sum-hi { font-size: 1.75rem; font-weight: 300; letter-spacing: -0.03em; }
  .sum-lead { margin: 4px 0 14px; font-size: 0.9375rem; }
  .sum-list { gap: 0; }
  .sum-list li { padding: 11px 0; border-top: 1px solid var(--edge); }
  .sum-list li:last-child { border-bottom: 1px solid var(--edge); }
  .sum-list .d { display: none; }
  .sum-brief { margin: 6px 0 16px; }
  .sum-brief p { font-size: 0.9375rem; }
  .sum-flag { margin-top: 14px; }
  .sum-ask { margin-top: 16px; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .sum-ask span { display: none; }
  .sum-ask button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--edge-2); font-size: 0.8125rem; color: var(--text); }
  .sum-ask button::before { display: none; }

  /* ask: just the field, voice and send */
  #chip-agent, #chip-queue { display: none; }
  .dock { background: linear-gradient(180deg, transparent, var(--bg0) 36%); }
  .composer { border-radius: 22px; }
}

/* ORION: a gold disc inside thick bands, one per tool (drawn by orbit.js) */
.orbit { position: absolute; transition: left 0.6s var(--spring), top 0.6s var(--spring), width 0.6s var(--spring), height 0.6s var(--spring), opacity 0.4s; }
.orbit canvas { display: block; touch-action: manipulation; }
@media (max-width: 899px) {
  .summary { scrollbar-width: none; }
  .summary::-webkit-scrollbar { display: none; }
  .sum-list li:nth-child(n + 4) { display: none; }
}

/* =========================================================== */
/* ORION + Conversation, tidied: centred orb, brief on demand,  */
/* a small instrument atop the chat, log-style replies          */
/* =========================================================== */

/* the four stat boxes are gone; the rail and drawer carry those numbers */
.stats { display: none !important; }

/* ---------- the brief: a pill under the top bar, a panel when opened ---------- */
.sum-pill {
  position: fixed; z-index: 19; right: 24px; top: calc(var(--top-h) + 4px);
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 15px;
  border: 1px solid rgba(239, 226, 196, 0.12); border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)), rgba(14, 13, 12, 0.7);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.3);
  font: 450 0.8125rem/1 var(--font); letter-spacing: 0; color: var(--text-2);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, opacity 0.3s, transform 0.45s var(--spring);
}
.sum-pill:hover, .sum-pill[aria-expanded="true"] { color: var(--text); border-color: rgba(231, 201, 131, 0.35); }
.sum-pill:active { transform: scale(0.97); }
.sum-pill time { font: 400 0.75rem/1 var(--font); font-variant-numeric: tabular-nums; color: var(--text-3); }
.sum-pill time:empty { display: none; }
.sum-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px rgba(240, 195, 109, 0.7); }
.sum-pill.lit .sum-dot { display: block; animation: lamp 2.4s ease-in-out infinite; }
.sum-pill.lit { color: var(--text); }
.sum-pill.busy .sum-dot { display: block; background: var(--gold); animation: sum-blink 1.1s steps(2) infinite; }
@keyframes lamp { 50% { opacity: 0.45; } }
body:not(.home) .sum-pill, .detail-open .sum-pill { opacity: 0; transform: translateY(-8px); pointer-events: none; }

.summary {
  position: fixed; z-index: 18; right: 24px; left: auto; bottom: auto;
  top: calc(var(--top-h) + 44px) !important; width: min(380px, calc(100vw - 48px));
  max-height: calc(100svh - var(--top-h) - 64px); overflow-y: auto; scrollbar-width: none;
  padding: 20px 22px 22px; border: 1px solid var(--edge-2); border-radius: 6px;
  background: rgba(13, 12, 11, 0.94); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transform-origin: top right;
  opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none;
  transition: opacity 0.2s, transform 0.35s var(--spring);
}
/* corner ticks: an instrument panel, not a card */
.summary::before {
  content: ""; position: absolute; inset: -1px; z-index: 0; pointer-events: none; display: block !important;
  background:
    linear-gradient(var(--gold), var(--gold)) top left / 10px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top left / 1px 10px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom right / 10px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom right / 1px 10px no-repeat;
  border-radius: 0;
}
.summary::-webkit-scrollbar { display: none; }
body.sum-open .summary { opacity: 1; transform: none; pointer-events: auto; }
body:not(.home) .summary, .detail-open .summary { opacity: 0 !important; pointer-events: none !important; }
.summary .sum-hi { font-size: 1.5rem; }
.summary .sum-list li:nth-child(n + 4) { display: grid; }

/* ---------- conversation: one centred column, a small ORION at its head ---------- */
:root { --chat-l: 88px; }
body.chat .convo { top: calc(var(--top-h) + 58px); bottom: calc(var(--dock-h) + 22px); }
body.chat .convo-head {
  position: fixed; top: calc(var(--top-h) + 2px); left: var(--chat-l); right: calc(var(--rw) + 16px);
  width: auto; max-width: none; height: 52px; padding: 0 24px; margin: 0;
}
body.chat .convo-head .chat-back { margin-left: max(0px, calc((100% - 760px) / 2 - 10px)); }
body.chat .feed { padding: 22px 24px 40px; }
body.chat .feed-inner { max-width: 720px; gap: 34px; }
@media (min-width: 900px) { body.chat .dock { width: min(720px, calc(100vw - var(--chat-l) - var(--rw) - 48px)); } }
/* ORION's state beside the little instrument */
@media (min-width: 900px) {
  body.chat .m-state {
    display: block; position: fixed; left: var(--ms-x); top: var(--ms-y); transform: translateY(-50%); margin: 0;
    font: 400 0.75rem/1 var(--panel); letter-spacing: 0.03em; color: var(--text-3); white-space: nowrap;
    animation: rise 0.5s 0.3s var(--spring) both;
  }
  /* in the gutter: the state sits centred under him */
  /* the corner sprite: the sphere alone, on scanlines, its status beneath */
  body.chat.orb-side .m-state {
    left: var(--ms-x); top: var(--ms-y); transform: translateX(-50%); box-sizing: border-box;
    width: max-content; min-width: var(--ms-w); max-width: var(--ms-max); text-align: center;
    padding: 6px 9px 5px;
    font: 400 1rem/1 "VT323", var(--mono); letter-spacing: 0.03em; color: #f6dfae;
    text-shadow: 0 0 6px rgba(240, 195, 109, 0.6);
    text-transform: capitalize; overflow: hidden; text-overflow: ellipsis;
    animation-name: ms-rise;
  }
  body.chat.orb-side .m-state::before { content: "O.R.I.O.N. : "; color: var(--amber); }
  @keyframes ms-rise { from { opacity: 0; transform: translate(-50%, 8px); } }
}

/* your words: a quiet, squared bubble on the right */
.convo .msg.user {
  max-width: 72%; padding: 10px 15px; border-radius: 10px 10px 2px 10px;
  background: rgba(239, 226, 196, 0.07); border: 1px solid rgba(239, 226, 196, 0.16);
  font-size: 0.9375rem; line-height: 1.55; color: var(--text);
}
/* a reply follows its question closely; the gap between turns stays wide */
.convo .msg.user + .msg.leo, .convo .msg.user + .working { margin-top: -16px; }

/* ORION's replies: a channel header (lamp, call sign, a hairline across, time), the words flush below */
.convo .msg.leo { position: relative; padding: 0; }
.convo .msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-height: 16px; }
.msg-head .bracket { display: none; }
.msg-head .who { font: 500 0.8125rem/1 var(--panel); letter-spacing: 0.02em; color: var(--cream); }
/* his readouts: tokens in phosphor green, seconds to answer in red */
.msg-head .tok, .msg-head .secs { flex: none; font: 400 0.6875rem/1 var(--mono); font-variant-numeric: tabular-nums; }
.msg-head .tok { color: #8fd18a; }
.msg-head .secs { color: #ec6f5e; }
.msg-head .tok[hidden], .msg-head .secs[hidden] { display: none; }
.msg-head .at { flex: none; margin-left: auto; font: 400 0.6875rem/1 var(--mono); color: var(--text-3); }
.msg-head .meta { margin-left: 0; font: 400 0.6875rem/1 var(--mono); color: var(--text-3); }
.convo .msg .body { font-size: 0.96875rem; line-height: 1.7; color: #ebe5d9; }
.convo .steps-list { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--edge); font: 400 0.75rem/1.6 var(--mono); }
.steps-list li::before { border-radius: 1px; width: 5px; height: 5px; }

/* working: three lamps firing in turn, like the rings */
.working { gap: 10px; padding: 0; font: 400 0.75rem/1 var(--panel); letter-spacing: 0.03em; color: var(--text-2); }
.working .lamps { display: inline-flex; gap: 3px; }
.working .lamps i { width: 6px; height: 6px; border-radius: 1px; background: rgba(214, 180, 106, 0.18); animation: lamps 1.2s steps(1) infinite; }
.working .lamps i:nth-child(2) { animation-delay: 0.2s; } .working .lamps i:nth-child(3) { animation-delay: 0.4s; }
@keyframes lamps { 0%, 30% { background: var(--amber); box-shadow: 0 0 6px rgba(240, 195, 109, 0.7); } 31%, 100% { background: rgba(214, 180, 106, 0.18); box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .working .lamps i { animation: none; background: var(--gold); } .sum-pill .sum-dot { animation: none !important; } }

/* ---------- phone ---------- */
@media (max-width: 899px) {
  /* ORION page: the orb alone, centred and smaller, between the bar and the composer */
  body.home { --map-h: calc(100svh - var(--top-h) - var(--dock-h)); }
  body.home .orbit { inset: 14% 14% 18%; }
  body.home .m-state { bottom: calc(18% - 34px); }
  .sum-pill { right: 12px; top: calc(var(--top-h) + 2px); height: 30px; font-size: 0.75rem; }
  .summary { left: 12px; right: 12px; width: auto; top: calc(var(--top-h) + 40px) !important; max-height: calc(100svh - var(--top-h) - var(--dock-h) - 56px); }
  /* conversation: a small ORION, the words get the room */
  body.chat { --map-h: 64px; }
  body.chat .orbit { inset: 4px 0 6px; }
  body.chat .convo-head { position: static; height: auto; padding: 4px 10px 0; }
  body.chat .convo { top: calc(var(--top-h) + var(--map-h)); }
  body.chat .feed { padding: 12px 18px 24px; }
  body.chat .feed-inner { gap: 28px; }
  .convo .msg.user { max-width: 84%; }
  .convo .msg.user + .msg.leo, .convo .msg.user + .working { margin-top: -12px; }
}

/* ================================================================ */
/* The detail panel, retro: the old readout-window shapes (square    */
/* frames, title bars, pixel lettering), without any CRT filter.     */
/* ================================================================ */
.detail {
  --rl: rgba(214, 180, 106, 0.5);          /* the frame line */
  --rl-2: rgba(214, 180, 106, 0.22);       /* inner rules */
  border-radius: 4px; border-color: var(--rl);
  background: rgba(12, 12, 11, 0.92);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}
.detail .close-detail {
  top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 0;
  border: 1px solid var(--rl); background: transparent; color: var(--gold-l);
}
.detail .close-detail svg { width: 14px; height: 14px; }
.detail-body { padding: 18px; }
.detail-body, .detail-body .badge, .detail-body .explore { font-family: "VT323", var(--mono); }
.detail .d-kicker { font: 400 1rem/1 "VT323", var(--mono); letter-spacing: 0.04em; color: var(--text-2); }
.detail .d-kicker svg { color: var(--gold-l); }
.detail .d-title {
  margin-top: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--rl);
  font: 400 2.5rem/0.9 "VT323", var(--mono); letter-spacing: 0.06em; color: var(--cream);
}
.detail .d-sub { font: 400 1.0625rem/1.2 "VT323", var(--mono); color: var(--text-2); }

/* boxes: square frames; each one's heading sits in a title bar */
.detail .d-status, .detail .metric, .detail .cell, .detail .note {
  border-radius: 0; border: 1px solid var(--rl); background: transparent;
}
.detail .d-status { padding: 10px 10px 10px 12px; }
.detail .d-status .st-text { font-size: 1.0625rem; line-height: 1.15; color: var(--text-2); }
.detail .d-status .st-text b { font-weight: 400; color: var(--cream); }
.detail .badge {
  height: 20px; padding: 0 7px; border-radius: 0; font-size: 1rem; font-weight: 400; letter-spacing: 0.03em;
  background: transparent; border: 1px solid var(--rl); color: var(--gold-l);
}
.detail .badge.idle { color: var(--text-2); border-color: var(--rl-2); }
.detail .badge.alert { color: var(--coral); border-color: rgba(224, 128, 111, 0.55); }
.detail .badge.outline { background: transparent; color: var(--text-2); border-color: var(--rl-2); }
.detail .explore {
  height: 32px; padding: 0 10px 0 12px; border-radius: 0;
  background: transparent; color: var(--cream); border: 1px solid var(--rl);
  font-size: 1.125rem; font-weight: 400; letter-spacing: 0.03em;
}
.detail .explore:hover { background: rgba(214, 180, 106, 0.12); }

.detail .metric { padding: 0 0 12px; }
.detail .metric-head {
  padding: 7px 12px 6px; border-bottom: 1px solid var(--rl);
  font: 400 1.125rem/1 "VT323", var(--mono); letter-spacing: 0.04em; color: var(--cream);
}
.detail .metric-body { padding: 0 12px; margin-top: 12px; }
.detail .metric-val { font: 400 3.25rem/0.8 "VT323", var(--mono); letter-spacing: 0; color: var(--cream); }
.detail .metric-val small { font-size: 1.5rem; color: var(--text-2); }
.detail .delta { font-size: 0.9375rem; line-height: 1; }
.detail .delta b { font-weight: 400; }
.detail .histo circle { fill: rgba(214, 180, 106, 0.3); }
.detail .histo circle.hot { fill: var(--amber); }

.detail .cell { padding: 10px 12px; }
.detail button.cell:hover { background: rgba(214, 180, 106, 0.08); }
.detail .cell svg { width: 22px; height: 22px; stroke: var(--gold-l); stroke-width: 1.2; stroke-linecap: square; stroke-linejoin: miter; }
.detail .cell-val { font: 400 2rem/1 "VT323", var(--mono); letter-spacing: 0; color: var(--cream); }
.detail .cell-val small { font-size: 1.0625rem; }
.detail .cell-label {
  margin: 8px -12px -10px; padding: 5px 12px 4px; border-top: 1px solid var(--rl-2);
  font-size: 1rem; line-height: 1; letter-spacing: 0.03em; color: var(--text-2);
}

.detail .notes-head {
  margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--rl);
  font: 400 1.25rem/1 "VT323", var(--mono); letter-spacing: 0.04em; color: var(--cream);
}
.detail .notes-head svg { width: 16px; height: 16px; }
.detail .note { padding: 8px 10px 7px; margin-bottom: 6px; }
.detail .note-t { font-size: 1.0625rem; font-weight: 400; line-height: 1.15; color: var(--text); }
.detail .note-t span { font: 400 1rem "VT323", var(--mono); }
.detail .note-d { font-size: 1rem; line-height: 1.2; }

/* ================================================================ */
/* Tasks: full screen, three tabs, quiet rows                       */
/* ================================================================ */
.drawer {
  top: 0; bottom: 0; left: 0; right: 0; width: 100vw;
  border-radius: 0; border: 0;
  background: rgba(14, 12, 10, 0.94);
  box-shadow: none;
  transform: translateY(16px) scale(0.985); opacity: 0;
  transition: transform 0.45s var(--spring), opacity 0.25s, visibility 0s 0.45s;
}
.drawer.open { transform: none; opacity: 1; transition: transform 0.45s var(--spring), opacity 0.25s; }
.drawer-head, .tk-tabs, .drawer-body > * { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }
.drawer-head { padding: 22px 16px 10px; }
.drawer-head h2 { font-size: 1.5rem; }
.drawer-body { padding: 8px 16px calc(40px + var(--sab)); }

.tk-tabs {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 4px; margin-top: 4px; margin-bottom: 18px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge);
  width: calc(100% - 32px);
}
.tk-tabs button { position: relative; z-index: 1; height: 38px; font-size: 0.9375rem; font-weight: 500; color: var(--text-2); transition: color 0.2s; }
.tk-tabs button[aria-selected="true"] { color: var(--ink); }
.tk-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 999px; background: var(--paper); box-shadow: 0 0 22px rgba(246, 223, 174, 0.18); transition: transform 0.4s var(--spring); }

.tk-wrap { display: flex; flex-direction: column; }
.tk-list { display: flex; flex-direction: column; }
.tk-item {
  display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: opacity 0.25s;
}
.tk-item.going { opacity: 0.35; }
.tk-item.quiet { min-height: 44px; color: var(--text-2); font-size: 0.875rem; }
.tk-t { flex: 1; min-width: 0; font-size: 1rem; line-height: 1.35; color: var(--text); }
.tk-item.quiet .tk-t { color: var(--text-2); font-size: 0.875rem; }
.tk-t small { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--text-3); }
.tk-item time { font: 400 0.8125rem var(--mono); color: var(--text-3); }
.tk-time { flex: 0 0 58px; font: 500 0.9375rem var(--mono); color: var(--amber); font-variant-numeric: tabular-nums; }
.tk-x { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px; color: var(--text-3); opacity: 0.55; transition: opacity 0.2s, background 0.2s, color 0.2s; }
.tk-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tk-x:focus-visible { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .tk-item:hover .tk-x { opacity: 1; } }
.tk-x:hover { background: rgba(236, 111, 94, 0.12); color: var(--coral, #ec6f5e); }
.tk-empty { padding: 22px 4px; color: var(--text-3); font-size: 0.9375rem; }
.tk-sub { margin: 30px 4px 2px; font-size: 0.8125rem; font-weight: 500; color: var(--text-3); letter-spacing: 0.01em; }

.tk-new {
  align-self: flex-start; margin-top: 16px; height: 44px; padding: 0 20px 0 16px;
  display: inline-flex; align-items: center; gap: 10px; border-radius: 999px;
  font-size: 0.9375rem; font-weight: 500; color: var(--ink); background: var(--paper);
  box-shadow: 0 0 24px rgba(246, 223, 174, 0.16);
  transition: transform 0.12s ease-out, box-shadow 0.2s;
}
.tk-new::before { content: ""; width: 14px; height: 14px; background: linear-gradient(currentColor, currentColor) center / 14px 1.8px no-repeat, linear-gradient(currentColor, currentColor) center / 1.8px 14px no-repeat; }
.tk-new:hover { box-shadow: 0 0 32px rgba(246, 223, 174, 0.28); }
.tk-new:active { transform: scale(0.97); }

.tk-now { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 16px; border-radius: 999px; background: rgba(255, 178, 92, 0.07); font-size: 0.875rem; color: var(--text-2); }
.tk-live { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: tk-pulse 1.6s ease-in-out infinite; }
.tk-now-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.tk-now-p, .tk-now-more { font: 500 0.8125rem var(--mono); color: var(--amber); }
@keyframes tk-pulse { 50% { opacity: 0.35; } }

/* Background: jobs and workflows */
.tk-item.tk-bg { align-items: flex-start; }
.bg-dot { flex: none; width: 8px; height: 8px; margin: 8px 2px 0 4px; border-radius: 50%; background: var(--text-3); }
.tk-bg[data-st="running"] .bg-dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: tk-pulse 1.6s ease-in-out infinite; }
.tk-bg[data-st="queued"] .bg-dot { background: transparent; border: 1.5px solid var(--text-3); }
.tk-bg[data-st="done"] .bg-dot { background: var(--gold, #e8c47c); }
.tk-bg[data-st="rejected"] .bg-dot { background: var(--coral, #ec6f5e); }
.bg-detail {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  margin-top: 6px; padding: 0; text-align: left; font-size: 0.875rem; line-height: 1.45; color: var(--text-2); cursor: pointer;
}
.tk-bg.open .bg-detail { -webkit-line-clamp: unset; display: block; color: var(--text); }
@media (prefers-reduced-motion: reduce) { .tk-bg[data-st="running"] .bg-dot { animation: none; } }

/* calendar */
.cal { padding: 4px 0 6px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-m { font-size: 1.0625rem; font-weight: 500; color: var(--text); }
.cal-nav { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; color: var(--text-2); transition: background 0.2s, color 0.2s; }
.cal-nav:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.cal-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cal-w, .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 4px; }
.cal-w span { text-align: center; font-size: 0.75rem; color: var(--text-3); padding-bottom: 6px; }
.cal-c {
  position: relative; width: 44px; height: 44px; justify-self: center; display: grid; place-items: center;
  border-radius: 999px; font: 400 0.9375rem var(--font); font-variant-numeric: tabular-nums; color: var(--text);
  transition: background 0.15s, color 0.15s;
}
.cal-c.pad { pointer-events: none; }
.cal-c.past { color: var(--text-3); }
.cal-c:hover { background: rgba(255, 255, 255, 0.06); }
.cal-c.today { box-shadow: inset 0 0 0 1px rgba(246, 223, 174, 0.55); }
.cal-c.sel { background: var(--paper); color: var(--ink); font-weight: 600; }
.cal-c i { position: absolute; bottom: 18%; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--amber); }
.cal-c.sel i { background: var(--ink); }

/* describe your task */
.tk-ask {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 7, 6, 0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.2s;
}
.tk-ask.on { opacity: 1; }
.tk-ask[hidden] { display: none; }
.tk-ask-card {
  width: min(560px, 100%); padding: 24px; border-radius: 28px;
  background: #1a1714; border: 1px solid var(--glass-edge); box-shadow: var(--hi), 0 30px 90px rgba(0, 0, 0, 0.6);
  transform: translateY(12px) scale(0.98); transition: transform 0.4s var(--spring);
}
.tk-ask.on .tk-ask-card { transform: none; }
.tk-ask-card h2 { font-size: 1.375rem; margin-bottom: 16px; }
.tk-ask-card textarea {
  width: 100%; resize: none; padding: 14px 16px; border-radius: 18px;
  font: 400 1rem/1.45 var(--font); color: var(--text);
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--edge); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tk-ask-card textarea:focus { border-color: rgba(246, 223, 174, 0.4); box-shadow: 0 0 0 4px rgba(246, 223, 174, 0.06); }
.tk-ask-card textarea::placeholder { color: var(--text-3); }
.tk-ask-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tk-ask-hint { flex: 1; font-size: 0.8125rem; color: var(--text-3); transition: color 0.2s; }
.tk-ask.sent .tk-ask-hint { color: #8fd18a; }
.tk-ask-foot .btn { height: 40px; padding: 0 18px; border-radius: 999px; }

@media (max-width: 640px) {
  .drawer-head { padding-top: 14px; }
  .tk-ask { place-items: end center; padding: 0; }
  .tk-ask-card { width: 100%; border-radius: 28px 28px 0 0; padding-bottom: calc(24px + var(--sab)); }
}
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer.open, .tk-ask-card { transform: none !important; }
}

/* the task sheet: icon header, one field with send inside; neutral glass, no tint */
#tk-ask .tk-sheet {
  padding: 22px 22px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)), #141414;
  border-color: rgba(255, 255, 255, 0.1);
}
.tk-grab { display: none; }
.tk-sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.tk-sheet-ic {
  flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: var(--hi);
}
.tk-sheet-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tk-sheet-tt { flex: 1; min-width: 0; }
#tk-ask .tk-sheet h2 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin: 0 0 3px; }
.tk-sheet-tt p { margin: 0; font-size: 0.875rem; line-height: 1.4; color: var(--text-2); }
.tk-sheet-x {
  flex: none; align-self: flex-start; width: 36px; height: 36px; margin: -2px -4px 0 0; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-2); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--edge);
  transition: transform 0.16s var(--ease-out), color 0.2s;
}
.tk-sheet-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tk-field {
  position: relative; border-radius: 20px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.09);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tk-field:focus-within { border-color: rgba(255, 255, 255, 0.22); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04); }
#tk-ask .tk-field textarea,
#tk-ask .tk-field textarea:focus {
  display: block; min-height: 112px; padding: 14px 62px 14px 16px;
  background: transparent; border: 0; border-radius: 20px; box-shadow: none;
}
.tk-go {
  position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink); background: var(--paper);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.16s var(--ease-out), opacity 0.2s;
}
.tk-go[aria-disabled="true"] { opacity: 0.28; box-shadow: none; }
.tk-go svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tk-go .ok, .tk-ask.sent .tk-go .up { display: none; }
.tk-ask.sent .tk-go .ok { display: block; }
.tk-ask.sent .tk-go { opacity: 1; }
.tk-go:active, .tk-sheet-x:active { transform: scale(0.94); transition-duration: 0.1s; }
#tk-ask .tk-ask-hint[hidden], #tk-ask .tk-ask-hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  .tk-sheet-x:hover { color: var(--text); }
}
@media (max-width: 640px) {
  #tk-ask { grid-template-columns: minmax(0, 1fr); }
  #tk-ask .tk-sheet { min-width: 0; padding: 10px 20px calc(18px + var(--sab)); border-width: 1px 0 0; }
  .tk-grab { display: block; width: 36px; height: 5px; margin: 0 auto 16px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
}

/* replies carry no model tag, and the "while you were gone" pill and panel are retired */
.msg-head .route { display: none !important; }
.sum-pill, .summary { display: none !important; }

/* a file ORION made, under the reply that made it */
.file-cards { display: grid; gap: 8px; margin-top: 12px; max-width: 420px; }
.fcard, .mf-row {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 10px 10px 10px 12px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.09); box-shadow: var(--hi);
}
.fcard { animation: rise 0.24s var(--ease-out) both; }
.fc-ic {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: var(--text-2); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07);
}
.fc-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fc-t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.fc-t b { font-size: 0.875rem; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-t small { font-size: 0.75rem; color: var(--text-3); }
.fc-dl {
  flex: none; position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink); background: var(--paper);
  transition: transform 0.16s var(--ease-out), opacity 0.2s;
}
.fc-dl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; transition: opacity 0.15s; }
.fc-dl:active { transform: scale(0.94); transition-duration: 0.1s; }
.fc-dl.busy svg { opacity: 0; }
.fc-dl.busy::after {
  content: ""; position: absolute; inset: 11px; border-radius: 50%;
  border: 2px solid rgba(21, 19, 16, 0.25); border-top-color: var(--ink); animation: fc-spin 0.7s linear infinite;
}
@keyframes fc-spin { to { transform: rotate(360deg); } }

/* wide screens: the files made this visit, in a small card beside the conversation */
.made-files { display: none; }
@media (min-width: 1240px) {
  .made-files:not([hidden]) {
    display: block; position: fixed; z-index: 13; top: calc(var(--top-h) + 14px); right: 20px;   /* above the conversation (12), which spans the full width */
    width: min(280px, calc((100vw - 760px) / 2 - 40px)); padding: 12px;
    border-radius: 20px; background: var(--glass-heavy); border: 1px solid var(--glass-edge); box-shadow: var(--hi), var(--shadow);
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    opacity: 0; transform: translateY(-8px) scale(0.98); transform-origin: top right;
    transition: opacity 0.25s var(--ease-out), transform 0.3s var(--ease-out);
  }
  .made-files.in { opacity: 1; transform: none; }
  body:not(.chat) .made-files, .detail-open .made-files { opacity: 0 !important; transform: translateY(-8px) scale(0.98) !important; pointer-events: none; }
}
.mf-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 10px; }
.mf-head span { font-size: 0.875rem; font-weight: 600; }
.mf-head small { font-size: 0.75rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mf-list { display: grid; gap: 6px; }
.mf-row { padding: 8px 8px 8px 10px; border-radius: 14px; gap: 10px; }
.mf-row .fc-ic { width: 32px; height: 32px; border-radius: 9px; }
.mf-row .fc-ic svg { width: 17px; height: 17px; }
.mf-row .fc-dl { width: 34px; height: 34px; }
.mf-row .fc-dl svg { width: 16px; height: 16px; }
.mf-row .fc-dl.busy::after { inset: 9px; }
.mf-all { width: 100%; height: 36px; margin-top: 8px; border-radius: 12px; font-size: 0.8125rem; color: var(--text-2); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge); }
@media (hover: hover) and (pointer: fine) {
  .fc-dl:hover { opacity: 0.88; }
  .mf-all:hover { color: var(--text); }
}
@media (prefers-reduced-motion: reduce) {
  .fcard { animation: none; }
  .made-files { transform: none !important; }
  .fc-dl.busy::after { animation-duration: 1.6s; }
}

/* vitals inside ORION's retro panel */
.gauge { position: relative; }
.g-num { position: absolute; left: 0; right: 0; top: 48px; transform: translateY(-50%); text-align: center; font: 500 15px/1 var(--font); color: var(--text); pointer-events: none; }
.detail .gauges { margin-top: 10px; gap: 6px; }
.detail .gauge, .detail .chart-card, .detail .rows { border-radius: 0; border: 1px solid var(--rl); background: transparent; }
.detail .g-track { stroke: rgba(214, 180, 106, 0.14); }
.detail .g-fill { stroke: var(--amber); stroke-linecap: butt; }
.detail .g-num { font: 400 1.5rem/1 "VT323", var(--mono); color: var(--cream); }
.detail .g-label { font: 400 1.0625rem/1.1 "VT323", var(--mono); color: var(--cream); }
.detail .g-sub { font: 400 0.9375rem/1.1 "VT323", var(--mono); color: var(--text-3); }
.detail .chart-card { margin-top: 6px; }
.detail .c-title { font: 400 1.375rem/1 "VT323", var(--mono); color: var(--cream); }
.detail .c-sub { font: 400 1rem/1.2 "VT323", var(--mono); color: var(--text-3); }
.detail .rows { margin-top: 6px; }
.detail .rows .row { font: 400 1.0625rem/1.1 "VT323", var(--mono); border-top-color: var(--rl-2); padding: 8px 12px; }
.detail .rows .row .v { color: var(--cream); }
.detail .rows .tool-row svg { width: 16px; height: 16px; stroke: var(--gold-l); }

/* replies: a restarted reply thinks in place; sources as small links */
.msg.leo.redo .body .working { padding: 2px 0; }
.msg .sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg .sources a {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px;
  font: 400 0.75rem var(--mono); color: var(--text-2); text-decoration: none;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.msg .sources a:hover { color: var(--cream, #f6dfae); border-color: rgba(246, 223, 174, 0.35); background: rgba(246, 223, 174, 0.06); }
.biz-empty { padding: 28px 0; font-size: 0.875rem; line-height: 1.5; }
.hb.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .hb.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hb.four .rstat:nth-child(3) { padding-left: 0; border-left: 0; } }
.tel-bar { display: flex; gap: 2px; height: 8px; margin: 18px 0 10px; border-radius: 999px; overflow: hidden; }
.tel-bar i { min-width: 4px; }
.tel-key { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.75rem; color: var(--text-2); }
.tel-key span { display: inline-flex; align-items: center; gap: 6px; }
.tel-key b { width: 8px; height: 8px; border-radius: 2px; }
.t-local { background: #f6dfae; } .t-haiku { background: #e9a25a; } .t-sonnet { background: #c8642e; }

/* ORION's panel: your rules and the files he made */
.detail .d-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.detail .d-list li { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 2px 6px 10px; border-bottom: 1px solid var(--rl-2); transition: opacity 0.2s; }
.detail .d-list li.going { opacity: 0.35; }
.detail .d-list li > span { flex: 1; min-width: 0; font-size: 1.0625rem; line-height: 1.2; color: var(--text); }
.detail .d-list.files b { display: block; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail .d-list small { display: block; font: 400 0.9375rem "VT323", var(--mono); color: var(--text-3); }
.detail .d-x { flex: none; width: 32px; height: 32px; display: grid; place-items: center; color: var(--text-3); transition: color 0.15s, background 0.15s; }
.detail .d-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.detail .d-x:hover { color: var(--cream, #f6dfae); background: rgba(246, 223, 174, 0.07); }
.detail .d-x:not(.dl):hover { color: var(--coral); background: rgba(224, 128, 111, 0.1); }
.detail .d-x.busy { animation: tk-pulse 1s ease-in-out infinite; color: var(--amber); }
.detail .d-add { display: flex; gap: 6px; margin-top: 8px; }
.detail .d-add input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; font: 400 1.0625rem "VT323", var(--mono); color: var(--text); background: rgba(0, 0, 0, 0.3); border: 1px solid var(--rl); outline: none; }
.detail .d-add input:focus { border-color: var(--rl-2); box-shadow: 0 0 0 1px rgba(246, 223, 174, 0.35); }
.detail .d-add button, .detail .d-more { height: 36px; padding: 0 14px; font: 400 1.0625rem "VT323", var(--mono); color: var(--cream, #f6dfae); border: 1px solid var(--rl); background: rgba(246, 223, 174, 0.05); }
.detail .d-add button:hover, .detail .d-more:hover { background: rgba(246, 223, 174, 0.12); }
.detail .d-more { margin-top: 8px; height: 30px; }

/* pictures in the composer and in your messages */
.pics { display: flex; gap: 8px; padding: 0 6px 10px; flex-wrap: wrap; }
.pics[hidden] { display: none; }
.pic { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--edge); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic.loading { animation: tk-pulse 1.2s ease-in-out infinite; }
.pic button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: rgba(10, 9, 8, 0.75); color: var(--text); }
.pic button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.composer.drop { box-shadow: inset 0 0 0 1.5px rgba(246, 223, 174, 0.5), 0 24px 60px rgba(0, 0, 0, 0.55); }
#btn-plus:disabled { opacity: 0.35; }
.msg-pics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.msg-pics img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; display: block; }
.msg-pics:only-child { margin-bottom: 0; }
/* a picture sent from another device: its name, since only that device has the preview */
.pic-name { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 6px 10px; border-radius: 10px; font-size: 0.8125rem; color: var(--text-2); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--edge); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pic-name svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* email alerts dialog (shares the Describe-your-task card) */
.em-ask .tk-ask-card h2 { margin-bottom: 8px; }
.em-p { font-size: 0.9375rem; line-height: 1.5; color: var(--text-2); margin-bottom: 16px; }
.em-in {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 16px;
  font: 400 1rem var(--font); color: var(--text);
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--edge); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.em-in:focus { border-color: rgba(246, 223, 174, 0.4); box-shadow: 0 0 0 4px rgba(246, 223, 174, 0.06); }
.em-in::placeholder { color: var(--text-3); }
.em-in[hidden] { display: none; }
.em-code { font: 500 1.375rem var(--mono); letter-spacing: 0.35em; text-align: center; }
.em-code::placeholder { font: 400 1rem var(--font); letter-spacing: 0; }
.em-msg { min-height: 1.25em; margin-top: 10px; font-size: 0.8125rem; color: var(--text-2); }
.em-msg.bad { color: var(--coral); }
.em-ask .tk-ask-foot .spacer { flex: 1; }
.em-link { font-size: 0.8125rem; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.25); }
.em-link:hover { color: var(--text); }
.em-ask.busy #em-go { opacity: 0.55; pointer-events: none; }
#btn-email { position: relative; }
#btn-email svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ================================================================ */
/* Phone polish (2026-11-17)                                         */
/* The app is sized to the *visible* screen (app.js sets --app-h and  */
/* --vv-top from visualViewport), so it never scrolls, nothing hides  */
/* under the browser's bars, and the keyboard pushes the page up as a */
/* whole: the top bar and ORION stay in view above the composer.      */
/* ================================================================ */
@media (max-width: 899px) {
  html { height: 100%; overflow: hidden; }
  body {
    position: fixed; left: 0; right: 0; top: 0;
    height: var(--app-h, 100%);
    transform: translateY(var(--vv-top, 0px));
  }
  body.home { --map-h: calc(var(--app-h, 100svh) - var(--top-h) - var(--dock-h)); }
  .summary { max-height: calc(var(--app-h, 100svh) - var(--top-h) - var(--dock-h) - 56px); }
  .detail { max-height: calc(var(--app-h, 100svh) * 0.82); }

  /* no "While you were gone" pill and no status line under ORION, for now */
  .sum-pill, body.sum-open .summary, .m-state { display: none !important; }
  /* the envelope sits bare like the bell, not in a circle */
  #btn-email { background: none; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }

  /* ORION's sphere keeps its ORION-page size and is only moved and scaled as one layer
     (app.js sets its transform), so the glide into the conversation never re-lays out or redraws
     the canvas at a new size */
  body.chat { --map-h: 60px; }
  body.chat.typing { --map-h: 44px; }
  body[class] .orbit {
    inset: auto; margin: 0; transform-origin: 50% 50%; will-change: transform;
    transition: transform 0.3s var(--ease-out), opacity 0.4s;
  }
  /* in the conversation the little sphere is the way back: it gives under the finger */
  body.chat .orbit canvas { transition: transform 0.16s var(--ease-out); }
  body.chat .orbit:active canvas { transform: scale(0.95); transition-duration: 0.1s; }
  .stage::after { display: none; }

  /* asked from the ORION page: your words wait in a bubble at the lower right while he thinks */
  .home-q {
    position: fixed; z-index: 14; right: 16px; bottom: calc(var(--dock-h) + 14px);
    max-width: min(78%, 320px); max-height: 7.75em; overflow: hidden;
    padding: 10px 15px; border-radius: 16px 16px 4px 16px; text-align: left;
    background: rgba(239, 226, 196, 0.07); border: 1px solid rgba(239, 226, 196, 0.16);
    font: 400 0.9375rem/1.55 var(--font); color: var(--text);
    -webkit-line-clamp: 5; display: -webkit-box; -webkit-box-orient: vertical; white-space: pre-line;
  }
  .home-q[hidden], body:not(.home) .home-q { display: none; }

  /* the conversation: the back link shares the row with the sphere, the words get the rest */
  body.chat .convo { top: calc(var(--top-h) + var(--map-h)); bottom: var(--dock-h); }
  /* the conversation settles in from just below and sinks back as you leave, with the sphere */
  .convo { transition: opacity 0.22s var(--ease-out), transform 0.3s var(--ease-out); }
  body:not(.chat) .convo { transform: translateY(18px); transition: opacity 0.2s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s 0.3s; }
  body.chat .convo-head {
    position: fixed; z-index: 3; top: var(--top-h); left: 6px; right: auto; width: auto;
    height: var(--map-h); padding: 0; margin: 0; display: flex; align-items: center;
    transition: height 0.45s var(--spring);
  }
  body.chat .convo-head h2 { display: none; }
  body.chat .convo-head .chat-back { margin: 0; height: 36px; padding: 0 12px 0 8px; font-size: 0.875rem; color: var(--text-2); }
  body.chat .feed {
    padding: 14px 20px 18px; overscroll-behavior: contain;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16px); mask-image: linear-gradient(180deg, transparent 0, #000 16px);
  }
  body.chat .feed-inner { gap: 24px; padding-top: 0; }
  .convo .msg.user { max-width: 82%; border-radius: 16px 16px 4px 16px; padding: 10px 15px; }
  .convo .msg.user + .msg.leo, .convo .msg.user + .working { margin-top: -6px; }
  .convo .msg-head { gap: 8px; margin-bottom: 7px; min-width: 0; }
  .convo .msg-head .tok { display: none; }
  .convo .msg-head .meta { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; }
  .convo .msg-head .meta svg { display: none; }
  .convo .msg .body { font-size: 1rem; line-height: 1.62; }
  .convo .working { padding: 2px 0; }
  body.typing .ask-box { min-height: 24px; }
  body.typing .composer { padding-top: 10px; }

  /* the menu: an opaque full screen (no blur over a moving sphere) */
  .drawer { background: #0d0c0b; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .scrim { background: transparent; }
  .dt-wide { display: none; }

  /* pages: four tiles in their own card, like the rail on a wide screen */
  .drawer-pages {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    margin: 4px 16px 0; padding: 8px; border-radius: 22px;
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--edge);
  }
  .drawer-pages a {
    display: flex; align-items: center; justify-content: flex-start; gap: 12px;
    height: 56px; padding: 0 12px; border-radius: 15px; text-decoration: none;
    font: 500 0.9375rem/1 var(--font); color: var(--text-2);
    background: none; border: 1px solid transparent;
    transition: background 0.15s, color 0.15s;
  }
  .drawer-pages a:active { background: rgba(255, 255, 255, 0.06); }
  .drawer-pages a i { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; background: rgba(255, 255, 255, 0.05); }
  .drawer-pages a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .drawer-pages a.on { color: var(--ink); background: var(--paper); }
  .drawer-pages a.on i { background: rgba(0, 0, 0, 0.08); }

  /* then Tasks as its own section, under a rule */
  .drawer-sec { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 16px 10px; padding-top: 18px; border-top: 1px solid var(--edge); }
  .drawer-sec h3 { margin: 0; font: 500 1.25rem/1.1 var(--font); letter-spacing: -0.01em; color: var(--text); }

  /* Business and Admin: a still warm gradient instead of the 3D shader, which is too heavy for a phone */
  .shader { background: radial-gradient(120% 55% at 15% 0%, rgba(214, 150, 70, 0.16), transparent 62%), radial-gradient(90% 45% at 100% 100%, rgba(224, 128, 111, 0.07), transparent 60%); }
  body.dash .shader { opacity: 1; }
  /* no Local / Local+ switch in the conversation on a phone */
  body.chat .cloud { display: none; }
  /* buttons sized for a thumb: 44 px targets (Apple's minimum), larger icons */
  .tile.round, .conn { width: 44px; height: 44px; }
  .tile svg { width: 21px; height: 21px; }
  .round-btn, .send { width: 44px; height: 44px; }
  .round-btn svg, .send svg { width: 20px; height: 20px; }
  .dock-row { gap: 8px; }
  .cloud-dot { width: 44px; height: 44px; }
  .cloud-sw { height: 44px; }
  .tk-x, .watch-x { width: 40px; height: 40px; }
  /* the composer's gold ring only turns while you type; at rest it's still (no repaint every frame) */
  .composer::before, .composer::after { animation-play-state: paused; }
  .composer.focus::before, .composer.focus::after { animation-play-state: running; }
  body.business #biz, body.admin #adm { transition: opacity 0.25s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s; }
}
@media (min-width: 900px) { .dt-phone, .drawer-sec { display: none; } }
@media (min-width: 900px) { .home-q { display: none; } }
body:not(.settled) .orbit { transition: none !important; }
/* no back link on the conversation page: the menu and the top-bar logo lead back to ORION */
.convo-head .chat-back { display: none; }
@media (max-width: 899px) { body.chat .convo-head { display: none; } }
.convo .msg.user { white-space: pre-line; }

/* the status line under the sphere ("O.R.I.O.N. : Standing by") is off screen: it still tells a screen reader what ORION is doing */
.m-state, body.chat .m-state, body.chat.orb-side .m-state, body.home .m-state {
  display: block !important; position: fixed !important; width: 1px !important; height: 1px !important; overflow: hidden !important;
  clip-path: inset(50%) !important; white-space: nowrap !important; opacity: 1 !important; margin: 0 !important; padding: 0 !important; border: 0 !important;
}
.m-state::before, body.chat.orb-side .m-state::before { content: none !important; }

/* the connection light: hidden while ORION is connected; a small label only when he isn't */
.conn {
  width: auto !important; height: 34px !important; padding: 0 14px 0 12px; display: inline-flex !important; align-items: center; gap: 8px;
  border-radius: 999px; font-size: 0.8125rem; color: var(--text-2); pointer-events: none;
  transition: opacity 0.2s var(--ease-out);
}
.conn.online { display: none !important; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.conn.connecting .conn-dot { animation: lamp 1.2s ease-in-out infinite; background: var(--gold-l); }
.conn.offline .conn-dot { background: var(--coral); }
.conn.offline { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .conn.connecting .conn-dot { animation: none; } }
@media (max-width: 899px) { .conn { display: none !important; } }
