/* @import must be first: a browser discards any @import after a rule block. */
/* t124: IBM Plex Mono is served from this origin (static/fonts/ibm-plex-mono.css). */
@import url('/static/fonts/ibm-plex-mono.css?v=d33628942f32');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   ctx-studio-kit.css — ONE dictionary and ONE component kit for the nine
   Studio surfaces (2026-09-02, the Studio sweep).

   Loaded AFTER each page's own <style>, so these :root values win. It exists
   because the nine pages had grown three visual families: the hub family on
   the house tokens, the lab family (advanced builder, backtest, replay) on an
   older dictionary that ctx_studio_shim.css overwrote at runtime, and the
   swing builder and curated shelf on dictionaries of their own. The screen
   and the source disagreed, and every page stacked its own header chrome.

   What this file does:
     1. Declares the house tokens PLUS every alias name the nine pages use
        (--line, --txt, --grn, --pos, --err, --warn, --purple, --card ...), so
        no page renders a foreign colour and no var() is silently dropped.
     2. Loads Inter and IBM Plex Mono once, for all of them.
     3. One title treatment (Inter 800, the page's gradient span kept), one
        primary button (the cyan→violet gradient), one secondary (glass), one
        radius for cards (16px), one input treatment.
     4. Hides each page's private back link and duplicate mode chrome, because
        ctx-lane-band.js now renders the one Studio bar with those controls.

   Page-specific selectors are grouped by page below. Everything that touches
   a page's own class is marked with the page name so it can be found.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* house */
  --cyan: #00eaff; --violet: #7b5cff; --green: #00e676; --amber: #ffab00; --red: #ff5252;
  --bg0: #070b14; --glass: rgba(255,255,255,.045); --brd: rgba(255,255,255,.09);
  --grad: linear-gradient(135deg, #00eaff, #7b5cff);
  /* --dim2 was #5d6f8f until 2026-11-08: 3.2-3.9:1 at the 10-12px it is used at, under the 4.5:1 floor */
  --text: #eaf1fb; --dim: #8ea3c0; --dim2: #7a8aa8;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* aliases the nine pages use for the same things */
  --bg: #070b14; --bg2: #0a101d;
  --panel: rgba(255,255,255,.045); --panel2: rgba(255,255,255,.07);
  --surface: rgba(255,255,255,.045); --card: rgba(255,255,255,.045);
  --glass-2: rgba(255,255,255,.022); --glass-brd: rgba(255,255,255,.10);
  --border: rgba(255,255,255,.09); --border-h: rgba(0,234,255,.35);
  --line: rgba(255,255,255,.09); --line2: rgba(255,255,255,.14);
  --chip: rgba(255,255,255,.045);
  --cyan-g: rgba(0,234,255,.25); --green-g: rgba(0,230,118,.20);
  --purple: #7b5cff; --accent: #00eaff;
  --grn: #00e676; --amb: #ffab00; --pos: #00e676; --err: #ff5252; --warn: #ffab00;
  --txt: #eaf1fb; --ink: #eaf1fb; --bright: #eaf1fb; --dim-2: #7a8aa8;
  --font-h: var(--font); --font-m: var(--mono); --display: var(--font);
}

body {
  font-family: var(--font) !important;
  background-color: var(--bg0) !important;
  color: var(--text);
  letter-spacing: 0 !important;
}

/* the signature gradient text, one class for every page */
.grad, .g, .sb-grad, .ctx-grad {
  background: var(--grad) !important;
  -webkit-background-clip: text !important; background-clip: text !important;
  -webkit-text-fill-color: transparent !important; color: transparent !important;
}

/* ── the title row ──────────────────────────────────────────────────────── */
.ctx-title, .title-h, .sb-header-top h1, .bt-header-top h1, .rp-header h1,
.optimizer-title, main.wrap > .head h1, .hero-title {
  font-family: var(--font) !important; font-size: 22px !important; font-weight: 800 !important;
  letter-spacing: -.3px !important; line-height: 1.15 !important; text-transform: none !important;
  color: var(--text);
}
.title-sub, .sb-header-sub, .bt-header-sub, .rp-header-sub, main.wrap > .head .sub {
  font-size: 13px !important; color: var(--dim) !important; line-height: 1.5; margin-top: 4px;
}
.ctx-h1ico { display: none !important; }

/* ── buttons ────────────────────────────────────────────────────────────── */
.ctx-btn-p,
#btn-nl, .btn-nl, #btn-bt, .btn-live:not(.await-evidence), .btn-nudge,
.wt-go, .wt-arm,
.runbtn, #runBtn, #runBtnTop,
#btn-run, .rp-go,
.arm[data-id], .upsell .cta,
#swing-arm, button.primary,
.sb-btn-next, .sb-btn-save, .sb-action-arm,
.pbtn, .armbtn {
  background: var(--grad) !important; color: #041018 !important;
  border: 0 !important; border-radius: 11px !important;
  font-family: var(--font) !important; font-weight: 800 !important; letter-spacing: .1px !important;
  text-transform: none !important; box-shadow: 0 8px 24px rgba(0,234,255,.16) !important;
  transition: filter .15s ease, transform .15s ease !important;
}
.ctx-btn-p:hover, #btn-nl:hover, .btn-nl:hover, #btn-run:hover, .runbtn:hover, #runBtn:hover, #runBtnTop:hover,
.rp-go:hover, .arm[data-id]:hover, .upsell .cta:hover, .wt-go:hover, .sb-btn-next:hover, .sb-btn-save:hover,
.sb-action-arm:hover, .pbtn:hover, .armbtn:hover { filter: brightness(1.08); transform: translateY(-1px); }
button.primary:disabled, #swing-arm:disabled { filter: saturate(.25) brightness(.7) !important; box-shadow: none !important; }

.ctx-btn-s,
.bt-run.mc, .bt-run.cmp, .rp-mode-btn, .btn-saved, .btn-expand, .wt-quiet, .cancelbtn,
.btn.ghost, .sb-action-secondary, .mini, .btn-chart, .tset-btn, #cbd-templates,
.seg button, .rp-mode-btn.active {
  background: rgba(255,255,255,.045) !important; color: var(--text) !important;
  border: 1px solid rgba(255,255,255,.12) !important; border-radius: 10px !important;
  font-family: var(--font) !important; font-weight: 600 !important; letter-spacing: 0 !important;
  text-transform: none !important; box-shadow: none !important;
}
.rp-mode-btn.active, .seg button.on {
  color: var(--cyan) !important; border-color: rgba(0,234,255,.35) !important;
  background: rgba(0,234,255,.08) !important;
}
.ctx-btn-s:hover, .bt-run.mc:hover, .bt-run.cmp:hover, .btn-saved:hover, .sb-action-secondary:hover, .mini:hover {
  border-color: rgba(0,234,255,.35) !important; color: var(--text) !important;
}

/* ── cards, inputs, tabs, chips ─────────────────────────────────────────── */
.card, .tpl, .sec, .wt-card, .cag-rail, .bt-card, .bt-empty, .mc-shell, .rc-box, .nl-box,
.lab-card, .sb-tmpl-card, .sb-step-card, .sb-review, .def, .engine, .ldo, .wt-fact, .wt-route {
  border-radius: 16px !important;
}
.bt-field select, .bt-field input, .rp-field select, .rp-field input,
.fld input, .fld select, .inp, .sb-input, .sb-select, input[type="text"], input[type="number"], input[type="date"], select {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  background: #0b1322; color: var(--text); border: 1px solid rgba(255,255,255,.12); border-radius: 9px;
}
.bt-field select:focus, .bt-field input:focus, .rp-field input:focus, .fld input:focus, .fld select:focus,
.inp:focus, .sb-input:focus, .sb-select:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--cyan) !important; outline: none;
  box-shadow: 0 0 0 3px rgba(0,234,255,.14);
}
.bt-tab, .tab, .src-tab {
  font-family: var(--font) !important; font-weight: 600 !important; letter-spacing: 0 !important;
  text-transform: none !important; border-radius: 9px !important;
}
.bt-tab.active, .tab.on, .src-tab.on {
  color: var(--text) !important; background: rgba(0,234,255,.10) !important;
  border-color: rgba(0,234,255,.3) !important;
}

/* the "how this page works" pill from ctx_hint.js, one look everywhere */
.cxhint-mini {
  font-family: var(--font); font-size: 12px; color: var(--dim);
  border: 1px solid rgba(255,255,255,.10); border-radius: 999px; padding: 5px 11px;
}

/* the swing evidence rungs: one amber, one red, one green */
.tag.live { color: var(--green) !important; border-color: rgba(0,230,118,.35) !important; background: rgba(0,230,118,.08) !important; box-shadow: none !important; }
.msg.err  { background: rgba(255,82,82,.08) !important; border-color: rgba(255,82,82,.35) !important; color: #ffc9c9 !important; }
.msg.warn { background: rgba(255,171,0,.08) !important; border-color: rgba(255,171,0,.35) !important; color: #ffe2a8 !important; }

/* ═══ PER PAGE ═══════════════════════════════════════════════════════════ */

/* studio.html — the Simple builder. The bar carries back + desk, so the
   page's own back link goes; the mode switch becomes a plain segmented
   control (no sub-captions, no emoji). */
.tool-back { display: none !important; }
.ctx-mode { padding: 3px !important; border-radius: 10px !important; gap: 2px !important; }
.ctx-mode-seg { padding: 6px 13px !important; border-radius: 8px !important; }
.ctx-mode-d { display: none !important; }
.ctx-mode-k { font-size: 12.5px !important; font-weight: 700 !important; }
#studio-tools { display: flex; align-items: center; gap: 10px; }
.topbar { padding-bottom: 14px !important; }
.card-label { font-family: var(--mono); font-weight: 600 !important; letter-spacing: 1.6px !important; }
/* The arm card renders on an empty page. Until a test exists it is a
   padlocked line in the run rail, not a full amber panel with an
   "arm untested anyway" escape hatch under it. ctx-arm-gate.js stamps the
   verdict head into #cag-verdict; the untested key is the only one hidden. */
body[data-ctx-armstate="untested"] #cag-band { display: none !important; }
#btn-live.await-evidence { opacity: .55; }

/* strategy-builder.html — the Advanced builder. Same treatment; its header
   row's own "← Studio" pill goes, the mode switch is shared with Simple. */
.sb-header > div:last-child > a[href="/studio"] { display: none !important; }
.sb-header-sub em { color: var(--cyan); font-style: normal; }
.sb-success-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sb-success-actions .sb-action-secondary:not(.sb-action-arm) { font-size: 12.5px !important; }

/* backtest.html — the Lab. The page scrolls (its own overflow rule is
   removed in the markup); the injected "Back to the Intraday Builder" link
   is redundant under the bar. */
#cbd-back { display: none !important; }
.bt-header { padding-top: 18px !important; }
.bt-header-top { justify-content: flex-start !important; }
.bt-config { border-bottom: 0 !important; margin: 14px 28px 0 !important; padding: 14px 16px !important;
  background: rgba(255,255,255,.045) !important; border: 1px solid rgba(255,255,255,.09) !important; border-radius: 16px !important; }
.bt-field label { font-family: var(--mono); letter-spacing: 1.4px !important; }
.bt-tabs { padding: 14px 28px 0 !important; border-bottom: 0 !important; }
#btn-opt { display: none !important; }
.bt-optlink { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); align-self: center; margin-left: 4px; }
.bt-optlink a { color: var(--cyan); text-decoration: none; font-weight: 600; }
.bt-optlink .pro { font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.2px; color: #c9b8ff;
  border: 1px solid rgba(123,92,255,.5); background: rgba(123,92,255,.12); border-radius: 5px; padding: 2px 6px; }
.bt-tab[data-tab="optimize"] { display: none !important; }

/* replay.html */
.rp-header { padding-top: 18px !important; }
.rp-mode-bar { border-bottom: 0 !important; }
.st-title { font-family: var(--font) !important; font-weight: 800 !important; letter-spacing: 0 !important; }

/* swing-builder.html — the essay and the crane sit behind a disclosure; the
   page's two nav chips give way to the bar's back control (the Swing Shadow
   link stays, it is a real destination). */
header a.chip[href="/studio"] { display: none !important; }
.blueprint { display: none !important; }
.hero { margin: 6px 0 4px !important; }
.hero h1 { font-size: 22px !important; letter-spacing: -.3px !important; }
.hero-more { margin-top: 10px; max-width: 720px; }
.hero-more summary { cursor: pointer; font-size: 12.5px; color: var(--cyan); font-weight: 600; list-style: none; }
.hero-more summary::-webkit-details-marker { display: none; }
.hero-more summary::before { content: '+ '; color: var(--dim2); }
.hero-more[open] summary::before { content: '– '; }
.hero-more p { font-size: 13px !important; }
.tag.mr { color: #7ec8ff !important; border-color: rgba(126,200,255,.35) !important; }
.tag.bo { color: #ffb37e !important; border-color: rgba(255,179,126,.35) !important; }
.tag.pb, .tag.opt { color: #c9b8ff !important; border-color: rgba(123,92,255,.45) !important; }

/* optimizer.html */
a.home { display: none !important; }
.topbar .brand { font-size: 22px !important; font-weight: 800 !important; letter-spacing: -.3px !important; }
.topbar .brand small { font-size: 12px; font-weight: 500; color: var(--dim); letter-spacing: 0; }
#howCard .ppill { font-family: var(--mono); }

/* options-lab.html — joins the bar; its own back link goes, the coloured
   historical P&L in the engine band reads as plain prose, not a result. */
main.wrap > .head a.back { display: none !important; }
main.wrap > .head { align-items: flex-end !important; }
.engine .t b[style] { color: var(--text) !important; }
#runBtnTop { width: 100%; height: 44px; margin-bottom: 14px; }

/* curated.html — the shelf. Its bespoke header is fully replaced by the
   global nav and the bar; the hero comes down to the shared title size. */
body > header { display: none !important; }
.hero h1 { font-size: 26px !important; letter-spacing: -.3px !important; margin-bottom: 8px !important; }
.hero p { font-size: 13.5px !important; }
.card .cname { font-size: 17px !important; }
.upsell .ic { display: none !important; }

/* studio-hub.html — the legal pill sat over the primary button at 1440×900. */
body.ctx-hub { padding-bottom: 52px; }
.wt-rtag.plan-free { color: var(--green) !important; border-color: rgba(0,230,118,.35) !important; background: rgba(0,230,118,.07) !important; }
.wt-rtag.plan-starter { color: var(--cyan) !important; border-color: rgba(0,234,255,.35) !important; background: rgba(0,234,255,.07) !important; }
.wt-rtag.plan-pro { color: #c9b8ff !important; border-color: rgba(123,92,255,.5) !important; background: rgba(123,92,255,.12) !important; }

/* ── phones ─────────────────────────────────────────────────────────────── */
@media (max-width: 740px) {
  .ctx-title, .title-h, .sb-header-top h1, .bt-header-top h1, .rp-header h1, main.wrap > .head h1, .hero h1 { font-size: 19px !important; }
  .bt-config { margin: 12px 14px 0 !important; }
  .bt-tabs { padding: 12px 14px 0 !important; overflow-x: auto; }
  .ctx-mode { display: flex; width: 100%; }
  .ctx-mode-seg { flex: 1; text-align: center; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ctx-btn-p, #btn-nl, .btn-nl, #btn-run, .runbtn, #runBtn, .rp-go, .arm[data-id], .upsell .cta, .wt-go { transition: none !important; }
}
