/* Operator Desk design system
   Tokens first; every component below reads only tokens so light/dark swap in one place. */

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px; --radius-xl: 18px;
  --rail-w: 68px; --top-h: 56px; --ticker-h: 38px; --drawer-w: 340px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 120ms; --t: 200ms; --t-slow: 420ms;
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs: 14px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 22px; --fs-2xl: 26px; --fs-3xl: 32px;
}

/* ---------- dark (default) ---------- */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b11;
  --bg-glow: radial-gradient(1200px 600px at 10% -10%, rgba(91, 140, 255, .10), transparent 60%),
             radial-gradient(900px 500px at 100% 0%, rgba(139, 92, 246, .07), transparent 60%);
  --surface: #0f141d;
  --surface-2: #141a25;
  --surface-3: #1a2130;
  --surface-hover: #1b2232;
  --overlay: rgba(4, 6, 10, .62);
  --border: #1f2737;
  --border-strong: #2b3548;
  --divider: rgba(255, 255, 255, .05);
  --text: #e8ecf4;
  --text-2: #a2acbe;
  --text-3: #8b96aa;  /* 6:1 on the surface (was 3.9:1, under the 4.5:1 minimum) */
  --accent: #5b8cff;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(91, 140, 255, .14);
  --accent-ring: rgba(91, 140, 255, .45);
  --up: #1fc77e;
  --up-strong: #12a866;
  --up-soft: rgba(31, 199, 126, .13);
  --down: #f4525b;
  --down-strong: #d83740;
  --down-soft: rgba(244, 82, 91, .13);
  --flat: #8a93a6;
  --flat-soft: rgba(138, 147, 166, .14);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, .14);
  --info: #4b9bff;
  --info-soft: rgba(75, 155, 255, .14);
  --q-leading: #1fc77e; --q-improving: #4b9bff; --q-weakening: #f5a524; --q-lagging: #f4525b;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --grid: rgba(255, 255, 255, .045);
  --axis: #394357;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-pop: 0 24px 64px rgba(0, 0, 0, .55), 0 0 0 1px var(--border-strong);
  --card-sheen: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%);
}

/* ---------- light ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f9;
  --bg-glow: radial-gradient(1200px 600px at 10% -10%, rgba(47, 107, 255, .06), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --surface-hover: #f1f5fb;
  --overlay: rgba(15, 23, 42, .32);
  --border: #e3e8f0;
  --border-strong: #d2d9e4;
  --divider: rgba(15, 23, 42, .06);
  --text: #0d1424;
  --text-2: #4b5567;
  --text-3: #5f6a7d;  /* light theme: 5.5:1 (was 3.3:1) */
  --accent: #2f6bff;
  --accent-2: #7c4dff;
  --accent-soft: rgba(47, 107, 255, .09);
  --accent-ring: rgba(47, 107, 255, .35);
  --up: #0c9a5f;
  --up-strong: #087e4d;
  --up-soft: rgba(12, 154, 95, .10);
  --down: #df3a42;
  --down-strong: #c22830;
  --down-soft: rgba(223, 58, 66, .09);
  --flat: #6f7a8e;
  --flat-soft: rgba(111, 122, 142, .11);
  --warn: #c77d00;
  --warn-soft: rgba(199, 125, 0, .10);
  --info: #2a78d6;
  --info-soft: rgba(42, 120, 214, .10);
  --q-leading: #0c9a5f; --q-improving: #2a78d6; --q-weakening: #c77d00; --q-lagging: #df3a42;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --grid: rgba(15, 23, 42, .055);
  --axis: #c3cad6;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-pop: 0 24px 64px rgba(15, 23, 42, .18), 0 0 0 1px var(--border);
  --card-sheen: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: var(--fs); line-height: 1.45; color: var(--text);
  background: var(--bg); background-image: var(--bg-glow); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
.num, .tnum, table { font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; border-radius: 6px; }

/* ---------- boot ---------- */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; }
.boot img { animation: breathe 1.6s var(--ease) infinite; border-radius: 16px; box-shadow: 0 12px 40px rgba(91, 140, 255, .35); }
.boot-name { font-weight: 700; letter-spacing: -.01em; font-size: var(--fs-lg); }
.boot-bar { width: 160px; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.boot-bar span { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: slide 1.1s var(--ease) infinite; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .8; } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr) auto; height: 100vh; overflow: hidden; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.content { flex: 1; overflow: auto; padding: 20px 24px 40px; scroll-behavior: smooth; }
.page { max-width: 1680px; margin: 0 auto; animation: pageIn var(--t-slow) var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* rail */
.rail {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0;
  background: var(--surface); border-right: 1px solid var(--border); z-index: 30;
}
.rail-logo { width: 38px; height: 38px; border-radius: 11px; margin-bottom: 14px; box-shadow: 0 6px 20px rgba(91, 140, 255, .35); transition: transform var(--t) var(--ease); }
.rail-logo:hover { transform: rotate(-6deg) scale(1.05); }
.rail-item {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  color: var(--text-3); cursor: pointer; transition: all var(--t) var(--ease); border: 0; background: none;
}
.rail-item:hover { color: var(--text); background: var(--surface-3); }
.rail-item.active { color: var(--accent); background: var(--accent-soft); }
.rail-item.active::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--accent), var(--accent-2)); box-shadow: 0 0 12px var(--accent);
}
.rail-item .tip {
  position: absolute; left: 56px; white-space: nowrap; background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border-strong); padding: 5px 9px; border-radius: 8px; font-size: var(--fs-sm); font-weight: 500;
  opacity: 0; transform: translateX(-4px); pointer-events: none; transition: all var(--t-fast) var(--ease); box-shadow: var(--shadow);
}
.rail-item .tip kbd { margin-left: 8px; }
.rail-item:hover .tip { opacity: 1; transform: none; }
.rail-item .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--down); box-shadow: 0 0 0 2px var(--surface); }
.rail-spacer { flex: 1; }
.rail { overflow-y: auto; scrollbar-width: none; }  /* 14 pages + tools must fit a 768 px-high laptop */
.rail::-webkit-scrollbar { display: none; }
.rail-item { flex: 0 0 auto; }
.rail-sep { width: 22px; height: 1px; background: var(--border-strong); margin: 5px 0; flex: 0 0 auto; }
.rail-label, .rail-more { display: none; }
.rail-sheet { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; }
.rail-sheet-in { width: 100%; max-height: 78vh; overflow-y: auto; background: var(--surface); border-top: 1px solid var(--border-strong);
  border-radius: 16px 16px 0 0; padding: 8px 12px 76px; box-shadow: var(--shadow); }
.sheet-item { display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 10px; color: var(--text); }
.sheet-item.active { background: var(--accent-soft); color: var(--accent); }

/* topbar */
.topbar {
  height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); position: relative; z-index: 20;
}
.page-title { display: flex; flex-direction: column; min-width: 0; }
.page-title h1 { margin: 0; font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.015em; white-space: nowrap; }
.page-title span { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px 0 12px; min-width: 300px; margin: 0 auto;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); cursor: text;
  transition: all var(--t) var(--ease);
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-trigger .grow { flex: 1; text-align: left; }
.top-actions { display: flex; align-items: center; gap: 8px; }

kbd {
  font-family: var(--font); font-size: 10.5px; font-weight: 600; color: var(--text-3); background: var(--surface-3);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; min-width: 18px;
  display: inline-block; text-align: center; line-height: 1.4;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.status-pill .clock { color: var(--text-3); font-weight: 500; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--flat); position: relative; }
.live-dot.on { background: var(--up); }
.live-dot.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--up); animation: ping 1.8s var(--ease) infinite; }
@keyframes ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }

/* ticker strip */
.ticker { height: var(--ticker-h); border-bottom: 1px solid var(--border); background: var(--surface); overflow: hidden; position: relative; }
.ticker::before, .ticker::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40px; z-index: 2; pointer-events: none; }
.ticker::before { left: 0; background: linear-gradient(90deg, var(--surface), transparent); }
.ticker::after { right: 0; background: linear-gradient(-90deg, var(--surface), transparent); }
.ticker-track { display: flex; width: max-content; height: 100%; animation: marquee 60s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.tick { display: flex; align-items: center; gap: 10px; padding: 0 22px; height: 100%; border-right: 1px solid var(--divider); cursor: pointer; white-space: nowrap; }
.tick:hover { background: var(--surface-hover); }
.tick .n { font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
.tick .v { font-weight: 600; }
.tick .c { font-size: var(--fs-sm); font-weight: 600; }

/* ---------- primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: var(--fs-sm);
  cursor: pointer; transition: all var(--t-fast) var(--ease); white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -6px var(--accent); }
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: var(--fs-xs); border-radius: 8px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; position: relative; transition: all var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn .badge-count {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px;
  font-weight: 700; background: var(--down); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface);
  animation: pop var(--t-slow) var(--ease);
}
@keyframes pop { from { transform: scale(0); } 60% { transform: scale(1.2); } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button {
  height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-weight: 600;
  font-size: var(--fs-sm); cursor: pointer; transition: all var(--t-fast) var(--ease); white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 1px var(--border-strong); }
:root[data-theme="light"] .seg button.on { box-shadow: 0 1px 3px rgba(15, 23, 42, .1), 0 0 0 1px var(--border); }
.seg.sm button { height: 24px; padding: 0 9px; font-size: var(--fs-xs); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: all var(--t-fast) var(--ease); white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent); }
.chip .count { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }
.chip.on .count { color: inherit; opacity: .8; }

.input {
  height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 11px; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast); min-width: 0;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-wrap { position: relative; display: inline-flex; align-items: center; }
.input-wrap svg { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.input-wrap .input { padding-left: 32px; }
select.input { padding-right: 28px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238590a3' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; user-select: none; }
.switch input { display: none; }
.switch .track { width: 30px; height: 18px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: all var(--t) var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: all var(--t) var(--ease); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { left: 14px; background: #fff; }

input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: var(--surface-3); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); cursor: pointer; }

/* cards */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-hero { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.1fr); }
.g-main-side { grid-template-columns: minmax(0, 1fr) 380px; }
.g-side-main { grid-template-columns: 360px minmax(0, 1fr); }
.mt { margin-top: 16px; }
.card {
  background: var(--surface); background-image: var(--card-sheen); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); min-width: 0; position: relative; transition: border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.card.hover:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; min-height: 44px; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: var(--fs-md); font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-h .sub { color: var(--text-3); font-size: var(--fs-xs); font-weight: 500; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 14px 16px 16px; }
.card-b.flush { padding: 8px 0 0; }
.eyebrow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--text-3); }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.up { color: var(--up); }
.down { color: var(--down); }
.warn { color: var(--warn); }
/* Guided / Expert, everywhere: <html data-mode>. x-only = technical detail (hidden in Guided);
   g-only = plain-English "how to read this" (hidden in Expert) */
html[data-mode="beginner"] .x-only { display: none !important; }
html[data-mode="expert"] .g-only { display: none !important; }
html[data-mode="beginner"] .card-h .sub.tech { display: none; }
.g-only.hint { display: block; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; padding: 8px 14px; border-top: 1px dashed var(--border); }
html[data-mode="expert"] .page-intro { padding: 7px 12px; font-size: var(--fs-sm); margin-bottom: 12px; }
.read-hint { margin: -8px 0 16px; font-size: var(--fs-sm); color: var(--text-2); }
.read-hint summary { cursor: pointer; color: var(--accent); font-weight: 600; width: max-content; }
.read-hint div { margin-top: 6px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); line-height: 1.55; max-width: 900px; }
html[data-mode="expert"] .page-intro > svg { display: none; }
/* answer first: the page's one-sentence "so what" */
.page-intro { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); font-size: var(--fs-md); line-height: 1.5; color: var(--text); }
.page-intro.t-up { border-left-color: var(--up); } .page-intro.t-down { border-left-color: var(--down); } .page-intro.t-warn { border-left-color: var(--warn); }
.page-intro > svg { flex: 0 0 auto; color: var(--text-3); }
.page-intro .btn { flex: 0 0 auto; }
@media (max-width: 760px) {
  .page-intro { flex-wrap: wrap; font-size: var(--fs); }
  .page-intro > svg { display: none; }
  .page-intro .btn { width: 100%; justify-content: center; height: 40px; }
  .top-actions .mode-seg { display: none; }  /* the Guided / Expert switch moves into the More sheet */
}
.sheet-mode { display: flex; gap: 8px; align-items: center; padding: 10px 8px 4px; }
/* collapsible section (progressive disclosure) */
.section-h { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; cursor: pointer; user-select: none; }
.section-h h2 { margin: 0; font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; }
.section-h .sub { color: var(--text-3); font-size: var(--fs-sm); }
.section-h .chev { transition: transform var(--t-fast); color: var(--text-3); }
.section-h.closed .chev { transform: rotate(-90deg); }
/* plain-English story (explain.py) */
.story { display: flex; flex-direction: column; gap: 8px; }
.story-l ul { margin: 2px 0 0; padding-left: 18px; }
.story-l li { font-size: var(--fs-sm); line-height: 1.45; color: var(--text-2); }
.lifecycle { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.lifecycle a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-right: 1px solid var(--border); color: var(--text); position: relative; }
.lifecycle a:last-child { border-right: 0; }
.lifecycle a:hover { background: var(--surface-3); }
.lifecycle .n { font-size: 20px; font-weight: 750; }
.lifecycle .k { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
@media (max-width: 760px) { .lifecycle { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lifecycle a:nth-child(3) { border-right: 0; } }
.rr-bar { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--down-soft), var(--surface-3) 33%, var(--up-soft)); }
.rr-bar i { position: absolute; top: -3px; width: 3px; height: 14px; border-radius: 2px; background: var(--text); }
.flat { color: var(--flat); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.bold { font-weight: 650; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
.hr { height: 1px; background: var(--divider); margin: 12px 0; }

/* verdict badge */
.vbadge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.vbadge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.v-sbull { background: var(--up-strong); color: #fff; box-shadow: 0 4px 12px -4px var(--up); }
.v-bull { background: var(--up-soft); color: var(--up); }
.v-neutral { background: var(--flat-soft); color: var(--flat); }
.v-bear { background: var(--down-soft); color: var(--down); }
.v-sbear { background: var(--down-strong); color: #fff; box-shadow: 0 4px 12px -4px var(--down); }
.v-none { background: var(--flat-soft); color: var(--text-3); }
.vbadge.mini { height: 18px; padding: 0 6px; font-size: 11px; }
.vbadge.mini::before { display: none; }

.qchip { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: var(--fs-sm); }
.qchip i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

/* score pill: number + centred diverging bar */
.score { display: inline-flex; align-items: center; gap: 8px; min-width: 92px; }
.score .val { width: 40px; text-align: right; font-weight: 650; font-size: var(--fs-sm); }
.score .bar { position: relative; flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); min-width: 44px; overflow: hidden; }
.score .bar::after { content: ""; position: absolute; left: 50%; top: -1px; bottom: -1px; width: 1px; background: var(--border-strong); }
.score .bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; transition: all var(--t-slow) var(--ease); }

/* layer bars (score breakdown) */
.layers { display: flex; flex-direction: column; gap: 9px; }
.layer { display: grid; grid-template-columns: 160px 1fr 46px; align-items: center; gap: 10px; font-size: var(--fs-sm); }
.layer .lbl { color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.layer .lbl small { color: var(--text-3); font-weight: 500; margin-left: 4px; font-size: 11px; }
.layer .v { text-align: right; font-weight: 650; }
.dbar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); }
.dbar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-strong); }
.dbar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; animation: grow var(--t-slow) var(--ease); }
@keyframes grow { from { transform: scaleX(0); } }
.dbar i.pos { left: 50%; transform-origin: left; background: linear-gradient(90deg, color-mix(in srgb, var(--up) 60%, transparent), var(--up)); }
.dbar i.neg { right: 50%; transform-origin: right; background: linear-gradient(-90deg, color-mix(in srgb, var(--down) 60%, transparent), var(--down)); }

/* hero pulse cards */
.hero { padding: 16px 18px 18px; overflow: hidden; }
.hero .glow { position: absolute; inset: 0; pointer-events: none; opacity: .55; border-radius: inherit; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hero-verdict { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.025em; line-height: 1.1; margin-top: 6px; }
.hero-score { color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); margin-top: 2px; }
.gauge { display: block; }
.gauge .needle { transition: transform 1.1s cubic-bezier(.34, 1.4, .5, 1); transform-origin: 60px 60px; }

/* stat tiles */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .k { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }
.stat .v { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; }

/* split bar (A/D, verdict distribution) */
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--surface); }
.split i { display: block; height: 100%; transition: flex-grow var(--t-slow) var(--ease); min-width: 2px; cursor: pointer; }
.split i:first-child { border-radius: 5px 0 0 5px; }
.split i:last-child { border-radius: 0 5px 5px 0; }
.split i:hover { filter: brightness(1.15); }
.split.tall { height: 14px; border-radius: 7px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-xs); color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.legend b { color: var(--text); font-weight: 650; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* tables */
.table-wrap { overflow: auto; position: relative; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs); }
table.t th {
  position: sticky; top: 0; z-index: 2; background: var(--surface); text-align: left; font-size: var(--fs-xs); font-weight: 650;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; user-select: none;
}
table.t th.sortable { cursor: pointer; }
table.t th.sortable:hover { color: var(--text); }
table.t th.sorted { color: var(--accent); }
table.t th .arrow { display: inline-block; margin-left: 4px; font-size: 9px; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--divider); white-space: nowrap; vertical-align: middle; }
table.t tbody tr { transition: background var(--t-fast); }
table.t tbody tr:hover td { background: var(--surface-hover); }
table.t tbody tr.clickable { cursor: pointer; }
table.t tbody tr.sel td { background: var(--accent-soft); }
table.t tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.t .r { text-align: right; }
table.t .c { text-align: center; }
table.t td.sym { font-weight: 650; }
table.t td.sym small { display: block; color: var(--text-3); font-weight: 500; font-size: var(--fs-xs); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
table.t th.sticky-col, table.t td.sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); }
table.t th.sticky-col { z-index: 3; }
table.t tbody tr:hover td.sticky-col { background: var(--surface-hover); }
.dense table.t td { padding: 5px 10px; }
.dense table.t th { padding: 7px 10px; }
.star { color: var(--text-3); cursor: pointer; transition: all var(--t-fast); display: inline-grid; place-items: center; }
.star:hover { color: var(--warn); transform: scale(1.15); }
.star.on { color: var(--warn); }

/* sparkline */
.spark { display: block; overflow: visible; }

/* quadrant board */
.quads { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quad { border-radius: 12px; padding: 12px; border: 1px solid var(--border); background: var(--surface-2); min-height: 92px; position: relative; overflow: hidden; }
.quad::before { content: ""; position: absolute; inset: 0; opacity: .09; background: var(--qc); pointer-events: none; }
.quad h4 { margin: 0 0 8px; font-size: var(--fs-sm); display: flex; align-items: center; gap: 7px; color: var(--qc); }
.quad h4 i { width: 8px; height: 8px; border-radius: 50%; background: var(--qc); box-shadow: 0 0 10px var(--qc); }
.quad h4 .n { margin-left: auto; color: var(--text-3); font-size: var(--fs-xs); }
.quad .names { display: flex; flex-wrap: wrap; gap: 5px; }
.quad .nm { font-size: var(--fs-xs); font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; transition: all var(--t-fast); }
.quad .nm:hover { color: var(--text); border-color: var(--qc); }
.quad .nm .moved { color: var(--qc); margin-left: 3px; }

/* list rows (tops, feed) */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 9px 16px; cursor: pointer; transition: background var(--t-fast); border-bottom: 1px solid var(--divider); }
.li:last-child { border-bottom: 0; }
.li:hover { background: var(--surface-hover); }
.li .sym { font-weight: 650; }
.li .meta { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .sym { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 11px; flex-shrink: 0;
  background: var(--surface-3); color: var(--text-2); letter-spacing: -.02em;
}

/* feed */
.feed-day { position: sticky; top: 0; z-index: 2; padding: 8px 16px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; background: var(--surface); border-bottom: 1px solid var(--divider); }
.feed-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }

/* drawer (watchlist) */
.drawer {
  width: 0; overflow: hidden; background: var(--surface); border-left: 1px solid var(--border); transition: width var(--t-slow) var(--ease);
  display: flex; flex-direction: column; height: 100vh;
}
.drawer.open { width: var(--drawer-w); }
.drawer-inner { width: var(--drawer-w); display: flex; flex-direction: column; height: 100%; }
.drawer-h { height: var(--top-h); display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-h h3 { margin: 0; font-size: var(--fs-md); font-weight: 700; }
.wl-tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.wl-tab { padding: 7px 10px 9px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-3); cursor: pointer; border: 0; background: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.wl-tab:hover { color: var(--text); }
.wl-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.wl-tab .n { font-size: 10px; margin-left: 4px; opacity: .7; }
.wl-add { padding: 10px 12px; border-bottom: 1px solid var(--border); position: relative; flex-shrink: 0; }
.wl-add .input { width: 100%; }
.wl-list { flex: 1; overflow: auto; }
.wl-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 14px 10px 16px; border-bottom: 1px solid var(--divider); cursor: pointer; position: relative; transition: background var(--t-fast); }
.wl-row:hover { background: var(--surface-hover); }
.wl-row.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.wl-row .s { font-weight: 650; font-size: var(--fs); }
.wl-row .p { text-align: right; font-weight: 650; }
.wl-row .sub { font-size: var(--fs-xs); color: var(--text-3); display: flex; gap: 5px; align-items: center; }
.wl-row .ch { text-align: right; font-size: var(--fs-xs); font-weight: 600; }
.wl-row .acts { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; background: var(--surface-3); border-radius: 8px; padding: 2px; box-shadow: var(--shadow); }
.wl-row:hover .acts { display: flex; }
.wl-foot { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; gap: 6px; flex-shrink: 0; }

/* dropdown / popover */
.pop {
  position: absolute; z-index: 60; min-width: 220px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; animation: popIn var(--t) var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pop .mi { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.pop .mi:hover, .pop .mi.hl { background: var(--surface-3); color: var(--text); }
.pop .mi .hint { margin-left: auto; color: var(--text-3); font-size: var(--fs-xs); }
.pop .mi.danger:hover { color: var(--down); }
.pop .ph { padding: 8px 10px 4px; font-size: 10.5px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.pop .checks { max-height: 320px; overflow: auto; }
.pop label.mi input { accent-color: var(--accent); }

/* modal / palette */
.overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(4px); z-index: 80; display: grid; justify-items: center; align-items: start; padding-top: 12vh; animation: fadeIn var(--t) var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
.palette { width: min(640px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-pop); overflow: hidden; animation: scaleIn var(--t) var(--ease); }
@keyframes scaleIn { from { opacity: 0; transform: scale(.97) translateY(-6px); } }
.palette-in { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette-in input { flex: 1; height: 54px; border: 0; outline: none; background: transparent; font-size: var(--fs-lg); }
.palette-list { max-height: 420px; overflow: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font-size: 10.5px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.palette-item.hl { background: var(--accent-soft); }
.palette-item .t { font-weight: 600; }
.palette-item .d { color: var(--text-3); font-size: var(--fs-xs); }
.palette-item .end { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-3); }
.modal { width: min(720px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-pop); animation: scaleIn var(--t) var(--ease); max-height: 76vh; overflow: auto; }
.modal-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-h h3 { margin: 0; font-size: var(--fs-lg); }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 32px; padding: 16px 20px 20px; }
.keys .k { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--divider); font-size: var(--fs-sm); color: var(--text-2); }
.keys .k span:last-child { display: flex; gap: 4px; }
.keys h4 { grid-column: 1 / -1; margin: 10px 0 2px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  min-width: 300px; max-width: 400px; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); animation: toastIn var(--t-slow) var(--ease);
  cursor: pointer;
}
.toast.out { animation: toastOut var(--t) var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast .tt { font-weight: 650; }
.toast .td { color: var(--text-2); font-size: var(--fs-sm); }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* flash on value change */
.flash-up { animation: flashUp 1.2s var(--ease); }
.flash-down { animation: flashDown 1.2s var(--ease); }
@keyframes flashUp { from { background: var(--up-soft); } }
@keyframes flashDown { from { background: var(--down-soft); } }

/* symbol header */
.sym-head { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 18px 20px; }
.sym-head h2 { margin: 0; font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.025em; display: flex; align-items: center; gap: 10px; }
.sym-head .price { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.sym-head .chg { font-weight: 700; font-size: var(--fs-md); }
.range52 { width: 220px; }
.range52 .track { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--down-soft), var(--flat-soft), var(--up-soft)); margin: 8px 0 4px; }
.range52 .track i { position: absolute; top: -4px; width: 4px; height: 14px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 3px var(--surface); transform: translateX(-2px); transition: left var(--t-slow) var(--ease); }
.rets { display: flex; gap: 6px; flex-wrap: wrap; }
.ret { padding: 6px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; min-width: 62px; }
.ret .k { font-size: 10px; color: var(--text-3); font-weight: 700; }
.ret .v { font-weight: 700; font-size: var(--fs-sm); }

/* chart frame */
.chart-box { position: relative; }
.chart-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.chart-legend { position: absolute; left: 12px; top: 8px; z-index: 5; pointer-events: none; font-size: var(--fs-xs); display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-2); }
.chart-legend b { color: var(--text); font-weight: 650; }
.chart-legend .ema { display: inline-flex; align-items: center; gap: 4px; }
.chart-legend .ema i { width: 10px; height: 2px; border-radius: 1px; }
.fullscreen { position: fixed !important; inset: 10px; z-index: 70; display: flex; flex-direction: column; }
.fullscreen .chart-host { flex: 1; height: auto !important; }

.toggle-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tg { height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--border); background: transparent; color: var(--text-3); font-size: var(--fs-xs); font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all var(--t-fast); }
.tg i { width: 8px; height: 8px; border-radius: 2px; opacity: .4; }
.tg.on { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.tg.on i { opacity: 1; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tab { padding: 12px 12px 11px; font-weight: 600; color: var(--text-3); border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: var(--fs-sm); }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }

.q { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* sector leadership */
.q-mini { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
  color: var(--qc); background: color-mix(in srgb, var(--qc) 15%, transparent); white-space: nowrap; }
.q-mini i { font-style: normal; font-size: 7px; color: var(--accent); }
.meter { display: inline-flex; gap: 2px; }
.meter i { width: 9px; height: 9px; border-radius: 2px; display: block; }
.meter i.b { background: var(--up); }
.meter i.s { background: var(--down); }
.meter i.n { background: var(--flat); opacity: .55; }
.meter i.x { background: var(--surface-3); }
.badge-ev { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.badge-ev.up { background: var(--up-soft); color: var(--up); }
.badge-ev.down { background: var(--down-soft); color: var(--down); }
table.lead td { vertical-align: middle; }

/* note / callout */
.note { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--info-soft); color: var(--text-2); font-size: var(--fs-sm); }
.note svg { color: var(--info); flex-shrink: 0; margin-top: 1px; }
.note.warn { background: var(--warn-soft); }
.note.warn svg { color: var(--warn); }

.empty { padding: 40px 20px; text-align: center; color: var(--text-3); display: grid; justify-items: center; gap: 10px; }
.empty svg { opacity: .7; }
.empty b { color: var(--text-2); }

/* console */
.console { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; max-height: 260px; overflow: auto; color: var(--text-2); line-height: 1.6; }

.progress { height: 3px; position: absolute; left: 0; right: 0; bottom: -1px; overflow: hidden; }
.progress span { display: block; width: 30%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: slide 1.3s var(--ease) infinite; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: var(--fs-sm); }
.kv dt { color: var(--text-3); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; text-align: right; }

.pulse-ring { animation: ring 2s var(--ease) infinite; }
@keyframes ring { 50% { opacity: .55; } }

/* responsive: grids follow the content width (the watchlist drawer eats space), chrome follows the window */
.content { container-type: inline-size; }
@container (max-width: 1320px) {
  .g-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main-side { grid-template-columns: minmax(0, 1fr) 340px; }
}
@container (max-width: 1120px) {
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 980px) {
  .g-main-side, .g-side-main, .g-split { grid-template-columns: minmax(0, 1fr) !important; }
  .side-list { max-height: 340px !important; }
}
@container (max-width: 720px) {
  .g-2, .g-3, .g-4, .g-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1280px) {
  .search-trigger { min-width: 220px; }
  .status-pill .clock { display: none; }
}
@media (max-width: 1100px) {
  .page-title span { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar { padding: 0 12px; gap: 8px; }
  .status-pill { display: none; }
  .rail { position: fixed; bottom: 0; left: 0; right: 0; top: auto; flex-direction: row; height: 58px; padding: 0 8px; justify-content: space-around; border-right: 0; border-top: 1px solid var(--border); }
  .rail-logo, .rail-spacer, .rail .tip, .rail-item.desk, .rail-item.secondary, .rail-sep { display: none; }
  .rail-item.active::before { display: none; }
  .rail { overflow: visible; }
  .rail-item, .rail-more { display: flex; flex-direction: column; gap: 2px; width: 64px; height: 52px; place-items: center; justify-content: center; }
  .rail-label { display: block; font-size: 11px; font-weight: 600; line-height: 1; }
  .content { padding: 14px 16px 90px; }
  .g-2, .g-hero { grid-template-columns: minmax(0, 1fr); }
  .search-trigger { min-width: 0; flex: 1; }
  .search-trigger .grow, .search-trigger kbd, .page-title span, .top-actions .hide-sm { display: none; }
  .drawer.open { position: fixed; right: 0; top: 0; z-index: 75; width: 100vw; }
  .drawer-inner { width: 100vw; }
  .keys { grid-template-columns: 1fr; }
  .sym-head { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .ticker-track { animation: none; }
}

/* ---------- sign-in (cloud mode) ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .card-b { padding: 24px; }
