/* ==========================================================================
   ORDVEX — Unified Monochrome Institutional Design System
   One palette · one type system · one component vocabulary for every page.
   ========================================================================== */
:root {
  --bg: #060709;
  --surface: rgba(13, 15, 20, 0.78);
  --surface-solid: #0C0E13;
  --surface-2: #12151E;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ink: #F4F5F7;
  --muted: #9AA0AA;
  --dim: #5E6573;
  --cta-bg: #F4F5F7;
  --cta-ink: #060709;
  --pos: #2EE59D;
  --neg: #FF5A5F;
  --warn: #F5B841;

  --f-mark: "Michroma", "Inter", sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --pill: 999px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--f-ui);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(244, 245, 247, .9); color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.mono { font-family: var(--f-mono); }
.serif { font-family: var(--f-serif); font-weight: 400; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.pos { color: var(--pos) !important; }
.neg { color: var(--neg) !important; }
.warn { color: var(--warn) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #262a33 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #262a33; border-radius: 8px; }

/* Film grain overlay */
.grain {
  pointer-events: none; position: fixed; inset: -50%; z-index: 90; opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { width: 34px; height: auto; }
.wordmark { font-family: var(--f-mark); letter-spacing: .22em; font-size: 15px; line-height: 1; }
.brand .slash { color: var(--dim); font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: var(--pill); border: 1px solid transparent;
  font: 500 14px/1 var(--f-ui); letter-spacing: .01em; white-space: nowrap;
  transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--cta-bg); color: var(--cta-ink); }
.btn-primary:hover { background: #fff; }
.btn-ghost { background: rgba(255,255,255,.03); border-color: var(--border-strong); color: var(--ink); backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.06); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-sharp { border-radius: var(--r-sm); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--pill);
  font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.ok { background: var(--pos); box-shadow: 0 0 0 3px rgba(46,229,157,.14); }
.dot.bad { background: var(--neg); box-shadow: 0 0 0 3px rgba(255,90,95,.14); }
.dot.wait { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,184,65,.14); }
.dot.live { animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.eyebrow { font: 500 12px/1.4 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.kicker { font: 500 12px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }

.glass {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  backdrop-filter: blur(18px) saturate(120%); -webkit-backdrop-filter: blur(18px) saturate(120%);
}

/* ==========================================================================
   SITE (landing / micro replay / field notes)
   ========================================================================== */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }
.gl-fallback {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 70% 35%, rgba(154,160,170,.18), transparent 60%),
    radial-gradient(40% 40% at 20% 80%, rgba(154,160,170,.08), transparent 70%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 22px), var(--bg);
}
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(6,7,9,.85) 100%); }
.site { position: relative; z-index: 2; }

.nav {
  position: sticky; top: 14px; z-index: 50; margin: 14px auto 0; width: min(1200px, calc(100% - 28px));
  height: var(--nav-h); padding: 0 12px 0 20px; display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--pill); border: 1px solid var(--border);
  background: rgba(10, 11, 15, .55); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: var(--pill); color: var(--muted); font-size: 14px; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: rgba(255,255,255,.05); }
.nav-burger { display: none; background: none; border: 1px solid var(--border-strong); border-radius: var(--pill); height: 38px; width: 44px; }
@media (max-width: 880px) {
  .nav-links { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column;
    padding: 10px; border-radius: var(--r-lg); background: rgba(10,11,15,.95); border: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-burger { display: inline-block; }
  .nav .btn-primary { display: none; }
}

.wrap { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }

/* Hero */
.hero { min-height: calc(100vh - 92px); display: flex; flex-direction: column; justify-content: center; padding: 80px 0 40px; }
.hero-inner { max-width: 760px; }
.hero h1 {
  margin: 22px 0 22px; font: 500 clamp(48px, 8.4vw, 116px)/.95 var(--f-ui); letter-spacing: -.045em;
}
.hero h1 em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; color: var(--muted); padding-right: .04em; }
.hero .lead { max-width: 560px; font-size: 18px; line-height: 1.6; color: #C4C8D0; margin: 0 0 34px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta { margin-top: 56px; display: flex; gap: 28px; flex-wrap: wrap; }
.hero-meta div { font: 500 12px/1.5 var(--f-mono); letter-spacing: .08em; color: var(--dim); text-transform: uppercase; }
.hero-meta b { display: block; color: var(--ink); font-size: 13px; font-weight: 500; }

/* Ticker strip */
.ticker { position: relative; overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: rgba(6,7,9,.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick { display: flex; align-items: baseline; gap: 12px; padding: 16px 34px; font: 500 14px/1 var(--f-mono); border-right: 1px solid var(--border); white-space: nowrap; }
.tick .sym { color: var(--muted); letter-spacing: .1em; font-size: 12px; }
.tick .chg { font-size: 12px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sections */
.section { padding: 140px 0 40px; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 56px; }
.section-head h2 { margin: 14px 0 0; font: 500 clamp(36px, 5vw, 64px)/1 var(--f-ui); letter-spacing: -.035em; }
.section-head h2 em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--muted); }
.section-head p { margin: 0; color: var(--muted); font-size: 17px; max-width: 480px; justify-self: end; }
@media (max-width: 880px) { .section-head { grid-template-columns: 1fr; } .section-head p { justify-self: start; } }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 980px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }

.card { padding: 28px; position: relative; overflow: hidden; transition: border-color .3s, transform .4s var(--ease); }
.card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(300px 160px at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.06), transparent 70%); opacity: 0; transition: opacity .3s; }
.card:hover::after { opacity: 1; }
.card .idx { font: 500 12px/1 var(--f-mono); color: var(--dim); letter-spacing: .12em; }
.card h3 { margin: 44px 0 10px; font: 600 20px/1.25 var(--f-ui); letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.card .tags span { font: 500 11px/1 var(--f-mono); color: var(--muted); border: 1px solid var(--border); border-radius: var(--pill); padding: 6px 9px; }
.card .ico { position: absolute; top: 24px; right: 24px; width: 34px; height: 34px; color: var(--muted); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track, .grain { animation: none; }
  html { scroll-behavior: auto; }
}

/* Workspace switcher */
.switcher { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
@media (max-width: 980px) { .switcher { grid-template-columns: 1fr; } }
.sw-tabs { display: flex; flex-direction: column; gap: 10px; }
.sw-tab { text-align: left; padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--border); background: rgba(13,15,20,.5);
  backdrop-filter: blur(14px); transition: all .3s var(--ease); }
.sw-tab:hover { border-color: var(--border-strong); }
.sw-tab.active { background: rgba(244,245,247,.06); border-color: rgba(255,255,255,.28); }
.sw-tab .k { font: 500 11px/1 var(--f-mono); letter-spacing: .14em; color: var(--dim); }
.sw-tab h4 { margin: 10px 0 6px; font: 600 18px/1.2 var(--f-ui); }
.sw-tab p { margin: 0; font-size: 14px; color: var(--muted); }
.sw-stage { padding: 0; min-height: 440px; display: flex; flex-direction: column; }
.sw-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); font: 500 12px/1 var(--f-mono); color: var(--dim); }
.sw-bar i { width: 9px; height: 9px; border-radius: 50%; background: #20242c; }
.sw-bar span { margin-left: 10px; }
.sw-panel { display: none; flex: 1; padding: 22px; gap: 14px; }
.sw-panel.active { display: grid; animation: fadeUp .5s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.sw-foot { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-top: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.mini { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; background: rgba(6,7,9,.5); min-height: 0; }
.mini .t { font: 500 11px/1 var(--f-mono); letter-spacing: .12em; color: var(--dim); text-transform: uppercase; margin-bottom: 10px; }
.mini .v { font: 500 26px/1 var(--f-mono); }
.mini canvas { width: 100%; height: 100%; display: block; }
.p-term { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr auto; }
.p-neural { grid-template-columns: 1fr 1fr; }
.p-exec { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: auto 1fr; }
@media (max-width: 640px) { .p-term, .p-neural, .p-exec { grid-template-columns: 1fr; } }
.bars-row { display: flex; align-items: end; gap: 8px; height: 120px; }
.bars-row div { flex: 1; background: linear-gradient(var(--ink), rgba(244,245,247,.25)); border-radius: 3px 3px 0 0; }
.comp { display: grid; grid-template-columns: 90px 1fr 44px; gap: 10px; align-items: center; font: 500 12px/1 var(--f-mono); color: var(--muted); margin: 8px 0; }
.comp .track { height: 6px; background: rgba(255,255,255,.06); border-radius: 6px; position: relative; overflow: hidden; }
.comp .track::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.comp .fill { position: absolute; top: 0; bottom: 0; border-radius: 6px; }

/* Specs */
.specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 980px) { .specs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .specs { grid-template-columns: 1fr; } }
.spec { padding: 24px; }
.spec .k { font: 500 11px/1 var(--f-mono); letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.spec .v { font: 500 30px/1.1 var(--f-mono); margin: 18px 0 8px; letter-spacing: -.02em; }
.spec p { margin: 0; color: var(--muted); font-size: 14px; }
.token { margin-top: 16px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
@media (max-width: 880px) { .token { grid-template-columns: 1fr; } }
.token .glass { padding: 30px; }
.kv { display: grid; grid-template-columns: 1fr auto; border-top: 1px solid var(--border); }
.kv > * { padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--f-mono); text-align: right; }
.split-bar { display: flex; height: 10px; border-radius: 10px; overflow: hidden; margin: 22px 0 14px; gap: 2px; }
.split-bar span { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font: 500 12px/1 var(--f-mono); color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }
.note { font-size: 13px; color: var(--dim); margin-top: 18px; line-height: 1.6; }

/* CTA band + footer */
.cta-band { margin: 140px auto 0; padding: 72px 40px; text-align: center; }
.cta-band h2 { margin: 0 0 16px; font: 500 clamp(36px, 5.4vw, 72px)/1 var(--f-ui); letter-spacing: -.04em; }
.cta-band h2 em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--muted); }
.cta-band p { color: var(--muted); margin: 0 auto 30px; max-width: 520px; }
.footer { margin-top: 100px; border-top: 1px solid var(--border); background: rgba(6,7,9,.7); backdrop-filter: blur(12px); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 32px 0; flex-wrap: wrap; }
.footer small { font: 500 12px/1.4 var(--f-mono); letter-spacing: .12em; color: var(--dim); }
.footer .motto { font-family: var(--f-serif); font-style: italic; font-size: 22px; color: var(--muted); }
.footer-links { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* ==========================================================================
   TERMINAL
   ========================================================================== */
body.term { font-size: 14px; background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: rgba(6,7,9,.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); flex-wrap: wrap; }
.topbar .brand img { width: 28px; }
.topbar .wordmark { font-size: 13px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: var(--pill); background: var(--surface-solid); }
.seg button { height: 30px; padding: 0 14px; border: 0; border-radius: var(--pill); background: transparent; color: var(--muted);
  font: 500 12px/1 var(--f-mono); letter-spacing: .1em; transition: all .2s; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--ink); color: var(--bg); }
.topbar .spacer { flex: 1; }
@media (max-width: 1640px) { #venuePill { display: none; } }
@media (max-width: 1480px) { .topbar .slash { display: none; } .topbar { gap: 10px; } .seg button { padding: 0 11px; } }
@media (max-width: 1280px) { #latPill { display: none; } }
.topbar .meta { display: flex; align-items: center; gap: 10px; font: 500 12px/1 var(--f-mono); color: var(--muted); flex-wrap: wrap; }
.clock { font: 500 12px/1.3 var(--f-mono); color: var(--muted); text-align: right; }
.clock b { color: var(--ink); font-weight: 500; }

.tape { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--surface-solid); }
.tape div { display: flex; gap: 10px; align-items: baseline; padding: 10px 18px; border-right: 1px solid var(--border); white-space: nowrap; font: 500 13px/1 var(--f-mono); }
.tape span { color: var(--dim); font-size: 11px; letter-spacing: .1em; }

.main { flex: 1; padding: 14px; }
.view { display: none; }
.view.active { display: block; animation: fadeUp .35s var(--ease); }

.bento { display: grid; gap: 12px; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr) minmax(0, 1fr); }
.bento .span-2 { grid-column: span 2; }
.bento .span-3 { grid-column: 1 / -1; }
.bento .row-2 { grid-row: span 2; }
@media (max-width: 1280px) { .bento { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .bento .span-2 { grid-column: 1 / -1; } .bento .row-2 { grid-row: auto; } }
@media (max-width: 760px) { .bento { grid-template-columns: 1fr; } }

.panel { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--r-md); display: flex; flex-direction: column; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panel-h h3 { margin: 0; font: 600 12px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.panel-h .src { font: 500 11px/1 var(--f-mono); color: var(--dim); letter-spacing: .06em; }
.panel-b { padding: 14px; flex: 1; min-height: 0; }

.price-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px 22px; margin-bottom: 12px; }
.price-big { font: 500 34px/1 var(--f-mono); letter-spacing: -.02em; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; margin-top: 12px; }
.stat { background: var(--surface-solid); padding: 10px 12px; }
.stat .k { font: 500 10.5px/1 var(--f-mono); letter-spacing: .12em; color: var(--dim); text-transform: uppercase; }
.stat .v { font: 500 15px/1 var(--f-mono); margin-top: 8px; }
.chart-wrap { position: relative; height: 360px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-tip { position: absolute; pointer-events: none; font: 500 11.5px/1.5 var(--f-mono); background: rgba(6,7,9,.92); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 8px 10px; display: none; white-space: nowrap; z-index: 3; }
.flow { display: flex; height: 8px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.06); margin-top: 8px; }
.flow i { display: block; height: 100%; transition: width .5s var(--ease); }

.big-num { font: 500 30px/1 var(--f-mono); letter-spacing: -.02em; }
.sub { font: 500 12px/1.5 var(--f-mono); color: var(--muted); margin-top: 6px; }
.kv-list { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin-top: 14px; font: 500 12.5px/1.3 var(--f-mono); }
.kv-list dt { color: var(--dim); }
.kv-list dd { margin: 0; text-align: right; }
canvas.spark { width: 100%; height: 54px; display: block; margin-top: 12px; }

.depth-bar { display: flex; height: 26px; border-radius: var(--r-sm); overflow: hidden; margin: 12px 0 8px; }
.depth-bar i { display: flex; align-items: center; font: 600 11px/1 var(--f-mono); color: var(--bg); padding: 0 8px; transition: width .6s var(--ease); white-space: nowrap; overflow: hidden; }
.depth-bar .b { background: var(--pos); }
.depth-bar .a { background: var(--neg); justify-content: flex-end; }
.ladder { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; font: 500 12px/1.75 var(--f-mono); }
.ladder .row { display: flex; justify-content: space-between; position: relative; padding: 0 6px; }
.ladder .row em { position: absolute; top: 2px; bottom: 2px; right: 0; opacity: .14; border-radius: 2px; }
.ladder .bids em { background: var(--pos); }
.ladder .asks em { background: var(--neg); left: 0; right: auto; }
.ladder .row span { position: relative; }

.radar-wrap { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: center; }
@media (max-width: 1500px) { .radar-wrap { grid-template-columns: 1fr; } }
.radar-wrap canvas { width: 200px; height: 200px; margin: 0 auto; }
.rules { list-style: none; margin: 0; padding: 0; font: 500 12.5px/1.3 var(--f-mono); }
.rules li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.rules li:last-child { border-bottom: 0; }
.rules .val { color: var(--muted); }
.rules li.hit .name { color: var(--warn); }
.counts { display: flex; gap: 8px; }

.feed { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; }
.feed li { padding: 10px 2px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13.5px; line-height: 1.45; }
.feed time { font: 500 11.5px/1.6 var(--f-mono); color: var(--dim); }
.feed .sev { grid-column: 2; font: 600 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.feed .msg { grid-column: 2; color: #D5D8DE; word-break: break-word; }
.feed .empty { display: block; color: var(--dim); font-family: var(--f-mono); font-size: 12.5px; }

.watch { list-style: none; margin: 0; padding: 0; }
.watch li { display: grid; grid-template-columns: 54px 1fr 90px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font: 500 13px/1 var(--f-mono); }
.watch li:last-child { border-bottom: 0; }
.watch .p { text-align: right; }
.watch .bar { height: 6px; background: rgba(255,255,255,.06); border-radius: 6px; position: relative; overflow: hidden; }
.watch .bar::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.watch .bar i { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.watch .c { font-size: 11.5px; display: block; text-align: right; margin-top: 4px; }

/* Neural */
.neural { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .neural { grid-template-columns: 1fr; } }
.score-card { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.score-num { font: 500 72px/1 var(--f-mono); letter-spacing: -.04em; }
.regime { display: inline-flex; padding: 6px 12px; border-radius: var(--pill); font: 600 12px/1 var(--f-mono); letter-spacing: .14em; border: 1px solid currentColor; }
.score-scale { position: relative; height: 8px; margin-top: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--neg), #3a3d45 50%, var(--pos)); }
.score-scale i { position: absolute; top: -5px; width: 3px; height: 18px; background: var(--ink); border-radius: 2px; transition: left .6s var(--ease); }
.narr { display: grid; grid-template-columns: 34px 1fr 130px; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.narr:last-child { border-bottom: 0; }
.narr .n { font: 500 12px/1 var(--f-mono); color: var(--dim); }
.narr h4 { margin: 0 0 4px; font: 600 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.narr p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.narr canvas { width: 130px; height: 44px; }
@media (max-width: 560px) { .narr { grid-template-columns: 28px 1fr; } .narr canvas { display: none; } }
.learn-list { list-style: none; padding: 0; margin: 0; font-size: 13.5px; max-height: 210px; overflow-y: auto; }
.learn-list li { padding: 8px 0; border-bottom: 1px dashed var(--border); display: grid; grid-template-columns: 54px 1fr; gap: 10px; }
.learn-list time { font: 500 11.5px/1.5 var(--f-mono); color: var(--dim); }

.console { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 560px; }
@media (max-width: 1100px) { .console { height: 560px; } }
.console-out { flex: 1; overflow-y: auto; padding: 14px; font: 400 12.5px/1.65 var(--f-mono); background: #050607; }
.console-out div { white-space: pre-wrap; word-break: break-word; }
.console-out .tag { display: inline-block; min-width: 62px; font-weight: 600; }
.t-BOOT { color: var(--ink); } .t-SRC { color: var(--muted); } .t-LEARN { color: var(--warn); }
.t-TICK { color: var(--dim); } .t-CMD { color: var(--ink); } .t-OUT { color: #C9CDD4; } .t-ERR { color: var(--neg); } .t-SIG { color: var(--pos); }
.console-in { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding: 10px 14px; font-family: var(--f-mono); }
.console-in span { color: var(--muted); }
.console-in input { flex: 1; background: transparent; border: 0; outline: 0; font: 400 13px/1 var(--f-mono); color: var(--ink); }

/* Exec */
.exec { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .exec { grid-template-columns: 1fr; } }
.perf-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.perf-bars { display: flex; align-items: flex-end; gap: 14px; height: 220px; margin-top: 22px; padding: 0 4px; border-bottom: 1px solid var(--border); }
.perf-bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; }
.perf-bars .bar { width: 100%; max-width: 64px; height: 0; border-radius: 4px 4px 0 0; background: linear-gradient(var(--ink), rgba(244,245,247,.2)); transition: height 1.1s var(--ease); }
.perf-bars .bar.neg { background: linear-gradient(rgba(255,90,95,.3), var(--neg)); }
.perf-bars small { font: 500 11.5px/1 var(--f-mono); color: var(--muted); }
.perf-x { display: flex; gap: 14px; padding: 8px 4px 0; }
.perf-x span { flex: 1; text-align: center; font: 500 11px/1 var(--f-mono); color: var(--dim); }
.disclaimer { margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); font-size: 13px; color: var(--muted); line-height: 1.55; }
.lock { display: flex; gap: 16px; align-items: center; }
.lock svg { width: 46px; height: 46px; flex: none; color: var(--ink); }
.lock .state { font: 600 13px/1.5 var(--f-mono); letter-spacing: .12em; }
.checklist { list-style: none; padding: 0; margin: 16px 0 0; font-size: 13.5px; }
.checklist li { display: flex; gap: 10px; padding: 7px 0; color: #D5D8DE; }
.checklist li::before { content: "—"; color: var(--dim); font-family: var(--f-mono); }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field label { font: 500 11px/1 var(--f-mono); letter-spacing: .12em; color: var(--dim); text-transform: uppercase; }
.field input { height: 40px; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); font-family: var(--f-mono); outline: 0; }
.field input:focus { border-color: var(--border-strong); }
input[type=range] { accent-color: var(--ink); width: 100%; }

/* Status bar */
.statusbar { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border);
  background: rgba(6,7,9,.92); backdrop-filter: blur(12px); font: 500 11.5px/1 var(--f-mono); color: var(--muted); flex-wrap: wrap; }
.statusbar .src-h { display: inline-flex; align-items: center; gap: 6px; }
.statusbar .right { margin-left: auto; color: var(--ink); letter-spacing: .08em; }

/* AI drawer */
.ai-fab { position: fixed; right: 20px; bottom: 54px; z-index: 60; height: 52px; width: 52px; padding: 0; display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden; white-space: nowrap;
  border-radius: var(--pill); border: 1px solid var(--border-strong); background: rgba(12,14,19,.92); backdrop-filter: blur(14px);
  font: 500 13px/1 var(--f-ui); box-shadow: 0 20px 40px rgba(0,0,0,.45); transition: transform .25s var(--ease); }
.ai-fab:hover { transform: translateY(-2px); width: auto; padding: 0 18px 0 7px; justify-content: flex-start; }
.ai-fab .lbl { display: none; }
.ai-fab:hover .lbl { display: inline; }
.console-in { padding-right: 84px !important; }
.ai-fab .av { width: 36px; height: 36px; border-radius: 50%; background: #000; border: 1px solid var(--border-strong); display: grid; place-items: center; }
.ai-fab .av img { width: 22px; }
.ai-drawer { position: fixed; right: 20px; bottom: 54px; z-index: 70; width: min(400px, calc(100vw - 24px)); height: min(600px, calc(100vh - 110px));
  display: flex; flex-direction: column; border-radius: var(--r-lg); border: 1px solid var(--border-strong); background: rgba(10,11,15,.97);
  backdrop-filter: blur(20px); box-shadow: 0 30px 80px rgba(0,0,0,.6); transform: translateY(16px) scale(.98); opacity: 0; pointer-events: none; transition: all .3s var(--ease); }
.ai-drawer.open { transform: none; opacity: 1; pointer-events: auto; }
.ai-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ai-head img { width: 26px; }
.ai-head b { display: block; font: 600 14px/1.2 var(--f-ui); }
.ai-head small { font: 500 11px/1 var(--f-mono); color: var(--muted); }
.ai-head button { margin-left: auto; background: none; border: 1px solid var(--border); border-radius: var(--pill); width: 32px; height: 32px; color: var(--muted); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.msg.bot { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 10px; }
.ai-chips button { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: var(--pill); padding: 6px 10px; font: 500 11.5px/1 var(--f-mono); }
.ai-chips button:hover { color: var(--ink); border-color: var(--border-strong); }
.ai-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.ai-form input { flex: 1; height: 40px; padding: 0 14px; border-radius: var(--pill); background: var(--surface-2); border: 1px solid var(--border); outline: 0; }
.ai-form button { height: 40px; width: 40px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: 60px; transform: translate(-50%, 20px); z-index: 99; padding: 10px 16px; border-radius: var(--pill);
  background: var(--ink); color: var(--bg); font: 500 13px/1 var(--f-ui); opacity: 0; transition: all .3s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   MICRO REPLAY
   ========================================================================== */
.page-head { padding: 70px 0 30px; }
.page-head h1 { margin: 16px 0 12px; font: 500 clamp(40px, 6vw, 76px)/1 var(--f-ui); letter-spacing: -.04em; }
.page-head h1 em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--muted); }
.page-head p { color: var(--muted); max-width: 620px; font-size: 17px; margin: 0; }
.replay { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
@media (max-width: 980px) { .replay { grid-template-columns: 1fr; } }
.replay .chart-wrap { height: 460px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px; border-top: 1px solid var(--border); }
.ctrl { height: 36px; min-width: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface-2); font: 500 12px/1 var(--f-mono); color: var(--ink); }
.ctrl:hover { border-color: rgba(255,255,255,.35); }
.ctrl.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.scrub { padding: 0 14px 14px; display: flex; gap: 12px; align-items: center; font: 500 12px/1 var(--f-mono); color: var(--muted); }
.notes { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow-y: auto; }
.notes li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.notes time { font: 500 11px/1.4 var(--f-mono); color: var(--dim); grid-column: 1; }
.notes button { grid-row: 1 / span 2; grid-column: 2; background: none; border: 0; color: var(--dim); font-size: 16px; }
.notes button:hover { color: var(--neg); }
textarea.note-in { width: 100%; min-height: 70px; resize: vertical; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px; outline: 0; font-size: 13.5px; }
select.sel { height: 36px; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-sm); font: 500 12px/1 var(--f-mono); }

/* ==========================================================================
   FIELD NOTES
   ========================================================================== */
.library { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .library { grid-template-columns: 1fr; } }
.paper-card { padding: 36px; }
.paper-card h2 { font: 400 clamp(32px, 4vw, 48px)/1.05 var(--f-serif); margin: 18px 0 14px; letter-spacing: -.01em; }
.paper-card p { color: var(--muted); }
.toc { list-style: none; padding: 0; margin: 0; counter-reset: t; }
.toc li { counter-increment: t; border-bottom: 1px solid var(--border); }
.toc a { display: grid; grid-template-columns: 34px 1fr; padding: 13px 0; font-size: 14.5px; color: #D5D8DE; }
.toc a::before { content: counter(t, decimal-leading-zero); font: 500 12px/1.7 var(--f-mono); color: var(--dim); }
.toc a:hover { color: var(--ink); }
.reader { max-width: 760px; margin: 0 auto; padding: 60px 0 40px; }
.reader.collapsed .article { max-height: 720px; overflow: hidden; mask-image: linear-gradient(#000 70%, transparent); }
.article { font-size: 18px; line-height: 1.78; color: #D9DCE2; }
.article h2 { font: 400 36px/1.15 var(--f-serif); color: var(--ink); margin: 64px 0 18px; letter-spacing: -.005em; scroll-margin-top: 100px; }
.article h3 { font: 600 14px/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 36px 0 10px; }
.article p { margin: 0 0 22px; }
.article blockquote { margin: 34px 0; padding: 4px 0 4px 24px; border-left: 2px solid var(--ink); font: italic 400 26px/1.35 var(--f-serif); color: var(--ink); }
.article ul { padding-left: 22px; margin: 0 0 22px; }
.article li { margin: 8px 0; }
.article .fig { margin: 30px 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-solid); font: 500 13px/1.7 var(--f-mono); color: var(--muted); }
.article .fig b { color: var(--ink); font-weight: 500; }
.article strong { color: var(--ink); font-weight: 600; }
.paper-meta { display: flex; gap: 22px; flex-wrap: wrap; font: 500 12px/1.4 var(--f-mono); color: var(--dim); letter-spacing: .08em; text-transform: uppercase; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 14px 0; margin: 26px 0 40px; }
.paper-meta b { color: var(--ink); font-weight: 500; }
.progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--ink); z-index: 100; width: 0; }
.reader-actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
