/* "terminal" theme for the journal / terminal pages (Grok, terminal theme r1, preview for Claude's refinement).
 *
 * Brief (Gabriel 2026-11-22): the haj / Lighter / Exocharts / Bloomberg look. Near-black and graphite, a faint fine
 * grid, hairline borders, dense panels, one accent (mono since r3: near-white and greys), muted green / red for PnL, a crisp mono for every number and table,
 * a thin geometric sans for the few big headings, tiny outlined buttons, small muted nav text. Behind the UI: slow
 * "fish" made of TPO letters / footprint cells (jr_fish.js), dim grey with a few tinted cells.
 *
 * Loaded after ct.css, jr.css and jr_glass.css. Every rule is scoped to :root[data-theme="terminal"] (the token block)
 * or [data-theme="terminal"] (everything else), so the other five themes are untouched. The copy-trade page never loads
 * this file. Colour tokens the charts read (--muted, --line, --faint, --accent, --pos, --neg, --warn, --pos-soft,
 * --neg-soft, --bg, --ink, --surface) are plain hex / rgba (lightweight-charts cannot parse var() or color-mix()).
 *
 * Readability: text tokens meet WCAG AA (>= 4.5:1) on every layer they sit on, worst case with the fish behind a
 * panel (tests/test_theme_terminal.py computes it from these tokens). Panels are >= 90 % opaque and the chart cards are
 * fully opaque, so the fish never show through a plot; jr_fish.js also clips the chart rectangles out of its canvas.
 *
 * r2 (against the haj reference): a 10px page grid that the fish cells sit on, sans nav, a static footprint / TPO texture
 * along the top of every card (term_tex.svg), and the /hello hero (.term-hero).
 *
 * Fonts: Geist and Geist Mono (Vercel / basement.studio), SIL OFL 1.1, bundled in static/fonts/ with their licence
 * (same-origin, no CDN, the CSP is unchanged).
 */
@font-face { font-family: "Geist"; src: url("fonts/Geist.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

.term-bg { display: none; }
.sw-tm { background: #08090a; box-shadow: inset -6px 0 0 #d4d5d9; }
.fish-opt { display: none; }

/* ------------------------------------------------------------------ tokens */
:root[data-theme="terminal"] {
  --bg: #08090a;
  --opaque: #111214;                       /* fully opaque: banners, tags, tooltips, popovers */
  --surface: rgba(12, 13, 15, .84);        /* a panel: the fish behind it are a whisper; data sits on --inner (opaque) */
  --sunk: #15161a;                         /* inputs, hovered rows */
  --inner: #0c0d0f;                        /* under tables and figures */
  --glass-strong: rgba(8, 9, 10, .94);     /* top bar */
  --edge: rgba(255, 255, 255, .07);
  --ink: #e7e7e4;
  --muted: #a0a1a6;
  --faint: #96979d;
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .14);      /* a stronger hairline: hovered controls, the active tab rule */
  --accent: #ecebe7;                       /* r3: mono. The accent is a near-white: selection, the active page, focus, entry lines. Never PnL */
  --accent-ink: #0b0b0b;
  --gold: #d4d5d9;
  --pos: #4cc38a;                          /* muted green */
  --neg: #f26e75;                          /* muted red */
  --warn: #d8c47e;                         /* r3: a pale straw, not orange: still reads as caution next to the greys */
  --on-pos: #04140c;
  --on-neg: #1a0507;
  --on-warn: #171103;
  --pos-soft: rgba(76, 195, 138, .12);
  --neg-soft: rgba(242, 110, 117, .12);
  --hover: rgba(255, 255, 255, .045);
  --glow: none;
  --font: "Geist Mono", ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --font-head: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --radius: 3px;
  --radius-card: 4px;
  --grid: rgba(255, 255, 255, .03);        /* the fine page grid: 10px squares, the cell grid the fish move on (jr_fish.js CELL) */
  color-scheme: dark;
}

/* ------------------------------------------------------------------ r4: indicator palette (Gabriel's TradingView charts)
   Sampled pixel-exact from his TV screenshots (BTC 27m "basics", BTC 30m "flow"; agent-reports terminal_theme_r4/).
   jr_term_ind.js copies --ind-<study>-<line> onto the W350 indicator registry (JR_IND.REG) as the line's default colour
   when jr_ind.js loads, terminal theme only (these tokens exist only here). A token that is absent keeps jr_ind.js's own
   colour; a colour the user picked in the indicator panel still wins over both. Values are #rrggbb (jr_app IND_HEX). */
:root[data-theme="terminal"] {
  --ind-ema100-v: #80deea;                 /* TV: light cyan EMA (label 59,945.85) */
  --ind-ema200-v: #faa1a4;                 /* TV: salmon-pink EMA 200 (label 60,811.46) */
  --ind-keltner-up2: #5d6b7d;              /* 2x outer band, solid cool steel-slate */
  --ind-keltner-lo2: #5d6b7d;
  --ind-keltner-up1: #4e7078;              /* 1x inner band, dashed slate-teal */
  --ind-keltner-lo1: #4e7078;
  --ind-keltner-basis: #7a7d8a;            /* basis midline, dotted neutral silver */
  --ind-ichimoku-kijun: #311b92;           /* TV: deep indigo base line (label 60,192.5, stepped) */
  --ind-ichimoku-tenkan: #ffffff;          /* TV: thin white stepped conversion line */
  --ind-ichimoku-a: #3f5452;               /* TV lead A edge #00332a, cloud ~ #2e3332 on #191919: the cloud tone (jr_app fills */
  --ind-ichimoku-b: #6b2a30;               /*   with the lead colours); TV lead B edge #801922 */
  --ind-ichimoku-fill-up: #3f5452;
  --ind-ichimoku-fill-dn: #6b2a30;
  --ind-ichimoku-fill-alpha: .3;
  --ind-vwap-vw: #2962ff;                  /* TV: VWAP (label 60,071.08) */
  --ind-vwap-u1: #4caf50;                  /* TV: +-1 sigma (60,766.77 / 59,375.40) */
  --ind-vwap-l1: #4caf50;
  --ind-vwap-u2: #808000;                  /* TV: +-2 sigma, olive (61,462.46 / 58,679.71) */
  --ind-vwap-l2: #808000;
  --ind-nwe-up: #b8b8b8;                   /* TV: grey dashed envelope (61,563.77 / 59,208.82) */
  --ind-nwe-lo: #b8b8b8;
  --ind-stoch_slow-k: #0c3299;             /* TV: Stoch RSI slow K / D */
  --ind-stoch_slow-d: #e65100;
  --ind-stoch_fast-k: #0c3299;             /* TV: Stoch RSI fast K / D (pale yellow) */
  --ind-stoch_fast-d: #fff59d;
  --ind-rsi-rsi: #512da8;                  /* TV: RSI / its SMA */
  --ind-rsi-ma: #fdd835;
  /* reserved for the patch-3 flow studies (30m flow layout); applied by the same rule once a study with this id / line key
     exists in JR_IND.REG. Ids are provisional: rename to P3's ids when it lands */
  --ind-tpo-poc: #fa9b09;                  /* TV: TPO POC, orange */
  --ind-tpo-val: #3d9141;                  /* TV: VAL, green (value-area fill ~ #18241e) */
  --ind-tpo-npoc: #9c9c9c;                 /* TV: naked POC, light grey */
  --ind-linreg-v: #208ee5;                 /* TV: linear regression channel, blue (antialiased peak; thin lines) */
  --ind-cvd-up: #07ab5b;                   /* TV: CVD line above zero, green */
  --ind-cvd-dn: #a734bb;                   /* TV: CVD line below zero, magenta */
  --ind-oid-up: #00332a;                   /* TV: OI delta bars, dark teal / dark red */
  --ind-oid-dn: #7c1922;
  --ind-levels-ph: #b22833;                /* TV: previous-high lines, red */
  --ind-nlns-nl: #4cc38a;                  /* NL / NS pane: net longs = the theme's side green (--pos), net shorts = its red (--neg) */
  --ind-nlns-ns: #f26e75;
  /* candles (TV: up hollow-ish #303030 body + #ffffff border and wick, down #cb3e49 body + #b2b5be border). Not read yet:
     jr_app.js candleTheme() reads only --pos / --neg; the one-function hook is proposed for Claude (r4 README) */
  --candle-up: #303030;
  --candle-up-line: #ffffff;
  --candle-dn: #cb3e49;
  --candle-dn-line: #b2b5be;
}

/* ------------------------------------------------------------------ page: near-black, a fine grid, the fish canvas */
/* the page colour and the grid are on <html> (the canvas background); <body> is transparent, or it would paint over the
   fish canvas (z-index -1 sits above the root background but below an in-flow block's own background) */
[data-theme="terminal"] { background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 10px 10px; background-attachment: fixed; }
[data-theme="terminal"] body {
  background: transparent; font-size: 12.5px; line-height: 1.45; letter-spacing: 0; font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum", "zero"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
[data-theme="terminal"] .term-bg { display: block; position: fixed; inset: 0; z-index: -1; width: 100vw; height: 100vh; pointer-events: none;
  overflow: hidden; contain: strict; }   /* each fish inside is its own small composited canvas (jr_fish.js): a frame repaints nothing here */
[data-theme="terminal"] .bg-swirl, [data-theme="terminal"] .crt { display: none; }
[data-theme="terminal"] ::selection { background: #d4d5d9; color: var(--accent-ink); }
[data-theme="terminal"] * { scrollbar-width: thin; scrollbar-color: #2a2b30 transparent; }
[data-theme="terminal"] :focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
[data-theme="terminal"] input:focus, [data-theme="terminal"] select:focus, [data-theme="terminal"] textarea:focus { outline: 1px solid var(--accent); outline-offset: -1px; }

/* ------------------------------------------------------------------ top bar: small muted nav, tiny outlined controls */
[data-theme="terminal"] .bar { background: var(--glass-strong); border-bottom: 1px solid var(--line); padding: 8px 20px; min-height: 44px; }
[data-theme="terminal"] .brand { font-family: var(--font-head); font-size: 14px; font-weight: 450; letter-spacing: -.005em; color: var(--ink); }
[data-theme="terminal"] .brand-logo { width: 16px; height: 16px; filter: grayscale(1) brightness(1.6); opacity: .9; }
[data-theme="terminal"] .brand-sub { font-family: var(--font); font-size: 10px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-2); border-radius: 2px; padding: 1px 6px; background: transparent; }
[data-theme="terminal"] .books { background: transparent; border: 0; padding: 0; gap: 2px; }
[data-theme="terminal"] .books.pages a { font-family: var(--font-head); font-size: 12.5px; font-weight: 400; letter-spacing: .005em; text-transform: lowercase; color: var(--muted); padding: 4px 10px;
  border-radius: 2px; background: transparent; position: relative; }
[data-theme="terminal"] .books.pages a:hover { color: var(--ink); background: var(--hover); }
[data-theme="terminal"] .books.pages a.on { color: var(--ink); background: transparent; box-shadow: none; }
[data-theme="terminal"] .books.pages a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -9px; height: 1px; background: var(--accent); }
[data-theme="terminal"] .updated { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
[data-theme="terminal"] .gear { color: var(--muted); border: 1px solid var(--line); border-radius: 2px; padding: 3px; }
[data-theme="terminal"] .gear:hover { color: var(--ink); border-color: var(--line-2); }
[data-theme="terminal"] .settings { background: var(--opaque); border: 1px solid var(--line-2); border-radius: var(--radius-card); box-shadow: none; padding: 8px; }
[data-theme="terminal"] .settings-h { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
[data-theme="terminal"] .theme-opt { border-radius: 2px; }
[data-theme="terminal"] .theme-opt:hover { background: var(--hover); }
[data-theme="terminal"] .theme-opt.on { outline: 0; background: var(--hover); box-shadow: inset 2px 0 0 var(--accent); }
[data-theme="terminal"] .fish-opt { display: flex; }

/* ------------------------------------------------------------------ panels: hairlines, square-ish, dense, zero shadows */
[data-theme="terminal"] .glance, [data-theme="terminal"] .chartcard, [data-theme="terminal"] .panel, [data-theme="terminal"] .mini,
[data-theme="terminal"] .flow, [data-theme="terminal"] .jr-tk-panel, [data-theme="terminal"] .jr-wl {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: none; }
[data-theme="terminal"] .chartcard, [data-theme="terminal"] .mini, [data-theme="terminal"] .ind-pane, [data-theme="terminal"] .jr-wl { background: #0a0b0c; }   /* opaque: no fish under a plot */
[data-theme="terminal"] .glance { padding: 16px; }
[data-theme="terminal"] .chartcard { padding: 12px 12px 8px; }
[data-theme="terminal"] .panel { margin-top: 8px; padding: 16px; }
[data-theme="terminal"] .mini { margin-bottom: 8px; }
[data-theme="terminal"] .mini.lost { border-color: var(--neg); }
[data-theme="terminal"] .flow { padding: 12px; }
[data-theme="terminal"] .jr-tk-panel { padding: 12px; box-shadow: none; }
[data-theme="terminal"] .jr-tk.docked .jr-tk-panel { box-shadow: none; }
[data-theme="terminal"] .jr-modal, [data-theme="terminal"] .jr-tip, [data-theme="terminal"] .jr-ctx, [data-theme="terminal"] .ind-panel,
[data-theme="terminal"] .dr-insp, [data-theme="terminal"] .jr-ld { background: var(--opaque); border: 1px solid var(--line-2); border-radius: var(--radius-card); box-shadow: none; }
[data-theme="terminal"] .jr-modal-bg { background: rgba(0, 0, 0, .66); }
/* the panel corner ticks: a Bloomberg-ish registration mark on the top-left of every card, drawn with two hairlines */
[data-theme="terminal"] .glance, [data-theme="terminal"] .panel, [data-theme="terminal"] .flow { position: relative; }
[data-theme="terminal"] .glance::before, [data-theme="terminal"] .panel::before, [data-theme="terminal"] .flow::before, [data-theme="terminal"] .chartcard::before {
  content: ""; position: absolute; left: -1px; top: -1px; width: 7px; height: 7px; pointer-events: none;
  border-left: 1px solid var(--faint); border-top: 1px solid var(--faint); }
[data-theme="terminal"] .chartcard { position: relative; }
/* r2: a static footprint / TPO texture along the top of every card (term_tex.svg: "bid x ask" cells over a run of TPO
   letters, faded in from the left, at most 13 % ink), a second background layer under the header: no element, no
   paint after load. */
[data-theme="terminal"] .glance, [data-theme="terminal"] .panel, [data-theme="terminal"] .flow, [data-theme="terminal"] .chartcard {
  background-image: url("term_tex.svg"); background-repeat: no-repeat; background-position: right 6px top 2px; background-size: 640px 24px; }

/* ------------------------------------------------------------------ type: thin sans for labels, tabular mono for numbers */
[data-theme="terminal"] .big-l, [data-theme="terminal"] .hz-l, [data-theme="terminal"] .chart-t, [data-theme="terminal"] .sub-h, [data-theme="terminal"] .mini-h,
[data-theme="terminal"] .jr-tk-h, [data-theme="terminal"] .calhead, [data-theme="terminal"] th, [data-theme="terminal"] .fact-l,
[data-theme="terminal"] .ind-g, [data-theme="terminal"] .jr-wl-h b {
  font-family: var(--font-head); font-size: 11px; font-weight: 400; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
[data-theme="terminal"] .chart-t::before, [data-theme="terminal"] .sub-h::before, [data-theme="terminal"] .big-l::before {
  content: "\25A0"; display: inline-block; margin-right: 7px; font-size: 7px; vertical-align: 2px; color: var(--faint); }
[data-theme="terminal"] .big { font-family: var(--font-head); font-size: clamp(40px, 4.6vw, 68px); font-weight: 250; letter-spacing: -.035em; line-height: 1.05;
  color: var(--ink); text-shadow: none; font-feature-settings: "tnum"; }
[data-theme="terminal"] .big.pos { color: var(--pos); } [data-theme="terminal"] .big.neg { color: var(--neg); }
[data-theme="terminal"] .big-sub { font-size: 12px; color: var(--muted); }
[data-theme="terminal"] .facts { border: 1px solid var(--line); border-radius: 2px; background: var(--inner); margin-top: 0; }
[data-theme="terminal"] .facts + .facts { margin-top: 8px; }
[data-theme="terminal"] .fact { padding: 8px 12px; }
[data-theme="terminal"] .fact + .fact { border-left-color: var(--line); }
[data-theme="terminal"] .fact-v { font-family: var(--font); font-size: 17px; font-weight: 450; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
[data-theme="terminal"] .hz-v { font-weight: 450; font-variant-numeric: tabular-nums; }
[data-theme="terminal"] td.r, [data-theme="terminal"] th.r, [data-theme="terminal"] .jr-wl-px { text-align: right; font-variant-numeric: tabular-nums; }
[data-theme="terminal"] .pos, [data-theme="terminal"] .neg, [data-theme="terminal"] .warn { font-weight: 450; }
[data-theme="terminal"] .state .led, [data-theme="terminal"] .chip i, [data-theme="terminal"] .book-dot { box-shadow: none; }
[data-theme="terminal"] .meter { height: 3px; border-radius: 0; background: var(--line); }

/* ------------------------------------------------------------------ banners: opaque, a left rule, no rounded pills */
[data-theme="terminal"] .alert { background: linear-gradient(var(--neg-soft), var(--neg-soft)), var(--opaque); border: 1px solid rgba(242, 110, 117, .35);
  border-left: 2px solid var(--neg); border-radius: 2px; color: var(--ink); box-shadow: none; font-size: 11.5px; }
[data-theme="terminal"] .alert b { color: var(--neg); font-weight: 600; letter-spacing: .06em; }
[data-theme="terminal"] .note { background: var(--opaque); border: 1px solid var(--line); border-left: 2px solid var(--warn); border-radius: 2px; }
[data-theme="terminal"] .fl-alert { background: linear-gradient(var(--neg-soft), var(--neg-soft)), var(--opaque); border-radius: 2px; }

/* ------------------------------------------------------------------ tabs, tables (Exocharts / Bloomberg density) */
[data-theme="terminal"] .tabs { background: var(--glass-strong); border-bottom: 1px solid var(--line); gap: 22px; }
[data-theme="terminal"] .tab { font-size: 11.5px; letter-spacing: .04em; color: var(--muted); padding: 9px 0 8px; }
[data-theme="terminal"] .tab.on { color: var(--ink); font-weight: 500; }
[data-theme="terminal"] .tab-ind { background: var(--accent); height: 1px; border-radius: 0; }
[data-theme="terminal"] .tbl-wrap { background: var(--inner); border: 1px solid var(--line); border-radius: 2px; }
[data-theme="terminal"] table { font-size: 12px; }
[data-theme="terminal"] th { padding: 7px 10px 6px; border-bottom: 1px solid var(--line-2); background: #0e0f11; position: sticky; top: 0; }
[data-theme="terminal"] td { padding: 5px 10px; border-bottom: 1px solid var(--line); }
[data-theme="terminal"] tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .012); }
[data-theme="terminal"] tbody tr:hover td, [data-theme="terminal"] .w-row:hover, [data-theme="terminal"] .mini-top:hover { background: var(--hover); }
[data-theme="terminal"] tbody tr:last-child td { border-bottom: 0; }
[data-theme="terminal"] td a, [data-theme="terminal"] .sub-h a { color: var(--ink); border-bottom: 1px dotted var(--faint); }
[data-theme="terminal"] td a:hover, [data-theme="terminal"] .sub-h a:hover { color: var(--accent); border-bottom-color: var(--accent); }
[data-theme="terminal"] .kvrow { font-size: 12px; }
[data-theme="terminal"] .calcell { border-radius: 2px; background: var(--inner); }
[data-theme="terminal"] .calcell.wk { background: var(--sunk); }
[data-theme="terminal"] .calcell.up1 { background: rgba(76, 195, 138, .09); } [data-theme="terminal"] .calcell.up2 { background: rgba(76, 195, 138, .16); }
[data-theme="terminal"] .calcell.up3 { background: rgba(76, 195, 138, .22); }
[data-theme="terminal"] .calcell.dn1 { background: rgba(242, 110, 117, .09); } [data-theme="terminal"] .calcell.dn2 { background: rgba(242, 110, 117, .16); }
[data-theme="terminal"] .calcell.dn3 { background: rgba(242, 110, 117, .22); }
[data-theme="terminal"] .calcell .n { font-weight: 500; }

/* ------------------------------------------------------------------ controls: tiny outlined buttons */
[data-theme="terminal"] input, [data-theme="terminal"] select, [data-theme="terminal"] textarea { font-family: var(--font); font-size: 12px; background: var(--sunk);
  border: 1px solid var(--line); border-radius: 2px; padding: 4px 7px; color: var(--ink); transition: border-color .12s ease; }
[data-theme="terminal"] input:hover, [data-theme="terminal"] select:hover, [data-theme="terminal"] textarea:hover { border-color: var(--line-2); }
[data-theme="terminal"] input::placeholder { color: var(--faint); opacity: 1; }
[data-theme="terminal"] input[type="range"] { accent-color: var(--accent); background: transparent; border: 0; padding: 0; }
[data-theme="terminal"] input[type="checkbox"] { accent-color: var(--accent); }
[data-theme="terminal"] .btn, [data-theme="terminal"] .jr-tk-sm, [data-theme="terminal"] .jr-tk-fab, [data-theme="terminal"] .jr-split button, [data-theme="terminal"] .jr-cl-go,
[data-theme="terminal"] .mini-ivs button, [data-theme="terminal"] .jr-tpsl-mode, [data-theme="terminal"] .rng {
  background: transparent; border: 1px solid var(--line-2); border-radius: 2px; color: var(--ink); font-size: 11px; font-weight: 400; letter-spacing: .03em;
  box-shadow: none; transition: border-color .12s ease, background-color .12s ease, color .12s ease; }
[data-theme="terminal"] .rng { padding: 2px 8px; color: var(--muted); border-color: transparent; }
[data-theme="terminal"] .btn:hover, [data-theme="terminal"] .jr-tk-sm:hover:not(:disabled), [data-theme="terminal"] .jr-split button:hover,
[data-theme="terminal"] .mini-ivs button:hover, [data-theme="terminal"] .jr-tk-fab:hover, [data-theme="terminal"] .rng:hover { border-color: var(--faint); color: var(--ink); background: var(--hover); }
[data-theme="terminal"] .rng.on, [data-theme="terminal"] .mini-ivs button.on, [data-theme="terminal"] .jr-tpsl-mode.on {
  background: rgba(255, 255, 255, .07); color: var(--accent); border-color: rgba(255, 255, 255, .5); box-shadow: none; }   /* mono: white on a lifted cell */
[data-theme="terminal"] .mini-ivs { gap: 2px; }
[data-theme="terminal"] .mini-ivs button { padding: 1px 6px; }
[data-theme="terminal"] .jr-split .jr-split-a, [data-theme="terminal"] .jr-parts .jr-part { color: var(--neg); border-color: rgba(242, 110, 117, .5); }
[data-theme="terminal"] .jr-parts .jr-part:disabled { opacity: .4; }

/* ------------------------------------------------------------------ order ticket: restyled only, same nodes, same behaviour */
[data-theme="terminal"] .jr-tk { font-size: 12px; }
[data-theme="terminal"] .jr-tk-fab { background: var(--opaque); padding: 6px 12px; }
[data-theme="terminal"] .jr-tk-head b { font-family: var(--font-head); font-size: 14px; font-weight: 400; letter-spacing: .01em; }
[data-theme="terminal"] .jr-tk-f { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
[data-theme="terminal"] .jr-tk-f input, [data-theme="terminal"] .jr-tk-f select { text-transform: none; letter-spacing: 0; }
[data-theme="terminal"] .jr-tk-side, [data-theme="terminal"] .jr-tk-go { border: 1px solid var(--line-2); border-radius: 2px; background: transparent; font-weight: 500;
  letter-spacing: .04em; transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
[data-theme="terminal"] .jr-tk-side.buy { color: var(--pos); } [data-theme="terminal"] .jr-tk-side.sell { color: var(--neg); }
[data-theme="terminal"] .jr-tk-side.buy.on { background: var(--pos-soft); border-color: var(--pos); color: var(--pos); }
[data-theme="terminal"] .jr-tk-side.sell.on { background: var(--neg-soft); border-color: var(--neg); color: var(--neg); }
[data-theme="terminal"] .jr-tk-go.buy, [data-theme="terminal"] .jr-cl-go.buy { background: var(--pos); border-color: var(--pos); color: var(--on-pos); }
[data-theme="terminal"] .jr-tk-go.sell, [data-theme="terminal"] .jr-cl-go.sell { background: var(--neg); border-color: var(--neg); color: var(--on-neg); }
[data-theme="terminal"] .jr-tk-go { padding: 8px; font-size: 12px; }
[data-theme="terminal"] .jr-tk-go:disabled, [data-theme="terminal"] .jr-tk-sm:disabled { opacity: .5; }
/* the network tag stays the loudest thing in the ticket: a solid fill */
[data-theme="terminal"] .jr-tk-net, [data-theme="terminal"] .jr-tk-net-big { border-radius: 2px; padding: 1px 7px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 10px; }
[data-theme="terminal"] .jr-tk-net-big { padding: 5px; font-size: 11px; }
[data-theme="terminal"] .jr-tk-net.real, [data-theme="terminal"] .jr-tk-net-big.real { background: var(--neg); border-color: var(--neg); color: var(--on-neg); }
[data-theme="terminal"] .jr-tk-net.test, [data-theme="terminal"] .jr-tk-net-big.test { background: var(--warn); border-color: var(--warn); color: var(--on-warn); }
[data-theme="terminal"] .jr-tk-msg { background: var(--opaque); border-radius: 2px; }
[data-theme="terminal"] .jr-tk-msg.neg { background: linear-gradient(var(--neg-soft), var(--neg-soft)), var(--opaque); }
[data-theme="terminal"] .jr-tk-msg.pos { background: linear-gradient(var(--pos-soft), var(--pos-soft)), var(--opaque); }
[data-theme="terminal"] .jr-tk-sec { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
[data-theme="terminal"] .jr-tk-ro { background: var(--inner); border-radius: 2px; }
[data-theme="terminal"] .jr-tpsl-loud { background: linear-gradient(var(--neg-soft), var(--neg-soft)), var(--opaque); border-radius: 2px; }
[data-theme="terminal"] .mini-tag { background: var(--opaque); border-radius: 1px; font-weight: 500; }
[data-theme="terminal"] .jr-acct, [data-theme="terminal"] .jr-mchip { border-radius: 2px; }

/* ------------------------------------------------------------------ chart chrome, studies panel (W350), Lighter view */
[data-theme="terminal"] .chart-t { font-size: 10.5px; }
[data-theme="terminal"] .ind-panel, [data-theme="terminal"] .lt-info { background: var(--opaque); border: 1px solid var(--line-2); border-radius: var(--radius-card); }
[data-theme="terminal"] .jr-type { background: var(--opaque); border-radius: var(--radius-card); border-color: var(--accent); box-shadow: none; }
[data-theme="terminal"] .jr-type-buf { font-family: var(--font-head); font-weight: 250; letter-spacing: .04em; }
[data-theme="terminal"] .fl-bar { height: 4px; border-radius: 0; }
[data-theme="terminal"] .fl-tag { border-radius: 1px; }
[data-theme="terminal"] .jr-ico { filter: saturate(.88); }
[data-theme="terminal"] .jr-ctx-it:hover, [data-theme="terminal"] .jr-ctx-seg:hover, [data-theme="terminal"] .jr-wl-row:hover { background: var(--hover); }
[data-theme="terminal"] .jr-wl-row.on { background: var(--sunk); outline: 1px solid var(--line-2); }
[data-theme="terminal"] .jr-ctx-seg.on, [data-theme="terminal"] .jr-wl-tab.on { border-color: var(--accent); color: var(--accent); background: rgba(255, 255, 255, .06); }
[data-theme="terminal"] .ind-sep::after { background: var(--line); }
[data-theme="terminal"] .ind-sep:hover::after, [data-theme="terminal"] .ind-sep.dragging::after { background: var(--accent); }
[data-theme="terminal"] .ind-col { background: rgba(10, 11, 12, .9); border: 1px solid var(--line); }

/* ------------------------------------------------------------------ /hello: the haj-style hero (r2)
   A thin lowercase headline centred on the open grid, two outlined buttons, small links; the fish fully visible behind
   it (jr_fish.js draws a stronger scene and cuts nothing out when .term-hero is on the page). */
.term-hero { display: grid; place-content: center; justify-items: center; gap: 18px; min-height: calc(100vh - 140px); text-align: center; padding: 40px 16px; }
.term-hero-go { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.term-hero-links { display: flex; gap: 14px; justify-content: center; }
[data-theme="terminal"] .wrap:has(.term-hero) { max-width: none; }
body:has(.term-hero) .updated { visibility: hidden; }        /* /hello loads no data script: no "loading…" in any theme */
[data-theme="terminal"] .term-hero { min-height: calc(100vh - 46px); padding: 0 16px 6vh; }
[data-theme="terminal"] .term-hero-h { margin: 0; font-family: var(--font-head); font-weight: 200; font-size: clamp(34px, 4.4vw, 72px); line-height: 1.04;
  letter-spacing: -.028em; text-transform: lowercase; color: var(--ink); }
/* small text on the hero sits on a dark plate: the fish behind it are stronger here (the contrast test models it) */
[data-theme="terminal"] .term-hero-sub, [data-theme="terminal"] .term-hero-links a { background: rgba(8, 9, 10, .78); padding: 2px 6px; }
[data-theme="terminal"] .term-hero-sub { margin: -4px 0 6px; font-size: 11.5px; letter-spacing: .04em; color: var(--muted); }
[data-theme="terminal"] .term-hero-go a { font-family: var(--font-head); font-size: 13px; font-weight: 400; letter-spacing: .005em; color: var(--ink); text-decoration: none;
  padding: 9px 18px; border: 1px solid rgba(255, 255, 255, .26); border-radius: 0; background: rgba(8, 9, 10, .55);
  transition: border-color .12s ease, background-color .12s ease; }
[data-theme="terminal"] .term-hero-go a:hover { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .06); }
[data-theme="terminal"] .term-hero-links a { font-size: 11px; letter-spacing: .06em; color: var(--muted); text-decoration: none; }
[data-theme="terminal"] .term-hero-links a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ motion (Fable's micro-interactions, toned down): composited only */
@media (prefers-reduced-motion: no-preference) {
  [data-theme="terminal"] .brand-logo { animation: none; }
  [data-theme="terminal"] .glance, [data-theme="terminal"] .panel, [data-theme="terminal"] .chartcard, [data-theme="terminal"] .flow { animation: term-in .32s cubic-bezier(.2, .7, .2, 1) both; }
  [data-theme="terminal"] .term-hero > * { animation: term-in .5s cubic-bezier(.2, .7, .2, 1) both; }
  [data-theme="terminal"] .term-hero > :nth-child(2) { animation-delay: .06s; } [data-theme="terminal"] .term-hero > :nth-child(3) { animation-delay: .12s; }
  [data-theme="terminal"] .term-hero > :nth-child(4) { animation-delay: .18s; }
  [data-theme="terminal"] .books.pages a.on::after { animation: term-rule .28s cubic-bezier(.2, .7, .2, 1) both; transform-origin: left center; }
  @keyframes term-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
  @keyframes term-rule { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ------------------------------------------------------------------ small screens */
@media (max-width: 1000px) { [data-theme="terminal"] .updated { display: none; } [data-theme="terminal"] .books.pages { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } }
@media (max-width: 640px) {
  [data-theme="terminal"] { --surface: rgba(12, 13, 15, .95); }             /* phones: panels nearly opaque, the fish stay in the gaps */
  [data-theme="terminal"] .bar { padding: 6px 10px; gap: 6px; }
  [data-theme="terminal"] .bar-l { flex-wrap: wrap; gap: 6px; width: 100%; min-width: 0; }
  [data-theme="terminal"] .bar-r { position: absolute; top: 6px; right: 8px; }   /* the gear beside the brand, not on a row of its own */
  [data-theme="terminal"] .books.pages { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  [data-theme="terminal"] .books.pages a { padding: 4px 8px; }
  [data-theme="terminal"] .settings { top: 44px; }
  [data-theme="terminal"] .glance { padding: 12px; }
  [data-theme="terminal"] .panel { padding: 10px; }
  [data-theme="terminal"] .books.pages a.on::after { bottom: -2px; }
}

/* ------------------------------------------------------------------ status ribbon (jr_ribbon.js; base rules in jr.css) */
[data-theme="terminal"] .rb { font-size: 11px; color: var(--muted); }
[data-theme="terminal"] .rb-p:hover { background: var(--hover); }
[data-theme="terminal"] .rb-l { font-size: 10px; letter-spacing: .06em; }
[data-theme="terminal"] .rb-pop { background: var(--opaque); border-color: var(--line-2); border-radius: 2px; box-shadow: none; }
