/* ARROW Scanner — broadsheet terminal.
 *
 * The visual language is the financial broadsheet: a sharp, high-contrast news
 * serif for anything that speaks, a neutral grotesque for the furniture,
 * tabular mono for every figure, and hairline rules as the ONLY separator
 * device. Nothing is rounded, nothing glows, nothing floats on a shadow —
 * every edge is a cut. The data is the only thing allowed to carry colour.
 *
 * Two grounds, one system. Every surface, rule and semantic colour below is a
 * token; setting `data-theme="light"` on <html> swaps the whole ladder and no
 * other rule in this file needs to know:
 *   dark (default) — matte black, flat, low-glare, built for overnight sessions
 *   light          — white paper, sharp black text, warm-grey rules
 */
:root {
  color-scheme: dark;

  /* Type roles. Newsreader is the display cut — a high-contrast news serif
     with sharp wedge serifs; it speaks (mastheads, headlines, section titles).
     Inter is the furniture: neutral, quiet, never competing. JetBrains Mono
     stays on every figure — tabular by default, which a price grid requires. */
  --font-display: "Newsreader", "Times New Roman", Times, Georgia, serif;
  --font-ui:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                  Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
                  Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Foundation — MATTE BLACK. Flat and slightly warm: a true matte ground
     rather than the near-#000 that makes light text halate, and warm enough
     that it reads as ink-on-press rather than dead screen grey. Each surface
     steps up by a hair; the ladder is tight so the page reads as one field. */
  --bg:        #0d0d0d;             /* page ground — matte black */
  --panel:     #131313;             /* primary panel surface */
  --panel-2:   #191919;             /* elevated card surface */
  --panel-3:   #212121;             /* hover / active row */
  --border:    #2c2926;             /* hairline — warm, like a printed rule */
  --border-2:  #3d3936;             /* emphasis rule */

  /* Text — warm off-white. Eased well off pure white for night comfort. */
  --text:      #e8e6e3;
  --text-dim:  #a39f9a;
  --muted:     #8a847d;

  /* Paper accent — the broadsheet's own tint. Used sparingly, as a fill for
     the one element that must read as "home" rather than as another tile. */
  --paper:     #1c1712;
  --paper-ink: #e8d9c6;

  /* Semantic — softened so up/down still reads instantly but never glares. */
  --green:      #4ec08a;
  --green-soft: #7fdcac;
  --green-dim:  #14503a;
  --red:        #e8636f;
  --red-soft:   #ff9aa2;
  --red-dim:    #66242b;
  --yellow:     #d9b45c;
  --orange:     #d98450;
  --cyan:       #6fb0cf;            /* desaturated steel — links/RSI accent */
  --cyan-soft:  #a3cfe0;
  --blue:       #6fb0cf;            /* alias for back-compat */
  --gold:       #c9a961;
  --flash:      var(--yellow);

  /* Brand — monochrome. The mark and wordmark carry no hue in either theme. */
  --brand:       #f5f3f0;
  --brand-light: #cfccc7;
  --brand-mid:   #97938e;
  --brand-dark:  #332f2b;

  /* Glow tokens are retained as names only. A broadsheet has no bloom, so they
     all resolve to `none` and every call site that still asks for one switches
     off from here rather than having to be edited individually. */
  --glow-cyan:  none;
  --glow-green: none;
  --glow-red:   none;
  --glow-gold:  none;
  --glow-brand: none;

  /* ICONS — the manufactured 14×14 stroke set (icons.js) speaks in one steel
     voice. The halo is gone: these are drawn lines, and a drawn line is sharp. */
  --icon:      #7fb8d4;
  --icon-dim:  #4d8aa6;
  --icon-glow: none;

  /* Day / night — the world clocks tint each dial by whether the sun is
     actually above that city's horizon right now. Warm amber for daylight,
     cool silver-blue for night. */
  --sun:  #e0a94e;
  --moon: #8fa8c4;

  /* Newswire source tiers — one colour per credibility tier, learned by the
     eye. Tokenised because the wire is coloured by tier in JS, and those hues
     have to be re-cut for a white ground like every other semantic. */
  --tier-wire:   #c9a961;   /* international press */
  --tier-macro:  #6fb0cf;   /* business desks */
  --tier-au:     #4ec08a;   /* Australian */
  --tier-crypto: #9b86d9;   /* crypto press */

  /* Every corner in the app. A broadsheet has no rounded edges. */
  --radius: 0px;
}

/* ---- LIGHT: white paper, sharp black text ------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:        #ffffff;             /* page ground — plain white */
  --panel:     #ffffff;
  --panel-2:   #faf8f5;
  --panel-3:   #f1ede8;
  --border:    #d6cec5;             /* warm-grey rule — the printed hairline */
  --border-2:  #b3a89c;

  --text:      #080706;             /* sharp black */
  --text-dim:  #45403b;
  --muted:     #6b645c;

  --paper:     #fff1e5;             /* the broadsheet tint, on white */
  --paper-ink: #33291f;

  /* Semantics re-cut for a white ground — same hues, driven dark enough to
     hold contrast against paper instead of glowing off it. */
  --green:      #04724d;
  --green-soft: #05966a;
  --green-dim:  #c6e8d8;
  --red:        #b31237;
  --red-soft:   #d0294c;
  --red-dim:    #f5d0d8;
  --yellow:     #8a6a12;
  --orange:     #a8511d;
  --cyan:       #175d7d;
  --cyan-soft:  #10475f;
  --blue:       #175d7d;
  --gold:       #7d5f16;
  --flash:      #8a6a12;

  --brand:       #080706;
  --brand-light: #45403b;
  --brand-mid:   #78716a;
  --brand-dark:  #d6cec5;

  --icon:      #175d7d;
  --icon-dim:  #4a7d92;

  --tier-wire:   #8a6a12;
  --tier-macro:  #175d7d;
  --tier-au:     #04724d;
  --tier-crypto: #5b3fa8;

  --sun:  #b8781a;
  --moon: #4a6b8a;
}

/* Every manufactured icon, wherever it renders. `.icn` is the default class
   from icons.js; the rest are the custom classes its call sites pass in. */
.icn, .nw-ticn, .nx-ticn, .sdd-icon, .fs-icon, .anom-bolt,
.anom-chev, .ts-search-icn, .soc-icn {
  color: var(--icon);
}
svg.icn, svg.nw-ticn, svg.nx-ticn, .sdd-icon svg, .fs-icon svg,
.anom-bolt svg, .ts-search-icn svg, svg.soc-icn {
  filter: var(--icon-glow);
}
/* Outbound link glyphs sit on the text baseline next to their label. */
svg.soc-icn { vertical-align: -2px; margin-right: 2px; }

/* Mono font stack for numerics — JetBrains Mono first, then system mono */
.mono, .rsi, .rs-num, .rs-denom, .kpi-value, .fund-big, .cascade-score,
.tfc-rsi-big, table.tf-table td, table.grid td, .ls-bar, .br-price,
.proj-big, .soc-big, .macro-chip .mc-value {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "zero" 1, "ss19" 1;  /* JBM dotted zero alt */
  letter-spacing: -0.01em;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0;
  /* Completely flat ground — no motes, no haze, no gradients — in both themes.
   * Uniform and low-glare over a long session; the dark ground is eased off
   * pure black to stop text halating against it. */
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Anything that speaks is set in the display cut, tight and sharp. Anything
   that merely labels stays in the UI grotesque. */
h1, h2, h3, .brand-name, .headline .sym, .nw-title, .sec-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
}
a { color: var(--cyan); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--cyan-soft); text-decoration: underline; }

/* Focus rings — subtle cyan glow */
input:focus, select:focus, button:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--cyan);
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar::after { content: none; }
.topbar h1 {
  font-size: 15px;
  margin: 0;
  letter-spacing: 1.2px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
}

/* ============== Brand mark (the logo) ============== */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 4px 8px 4px 4px;
  border-radius: 0;
  transition: background 0.18s;
  position: relative;
}
.brand:hover { text-decoration: none; background: color-mix(in srgb, var(--text) 6%, transparent); }

/* ---- TEMP: logo + wordmark hidden ----------------------------------------
 * Hides the arrow mark + "ARROW" title in the header (index + detail pages).
 * The markup is untouched — to bring the brand back, DELETE this whole block. */
.brand { display: none; }
/* -------------------------------------------------------------------------- */

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* +10% — was 36px, now 40px per brand pass */
  width: 40px; height: 40px;
  flex-shrink: 0;
}
.brand-svg {
  display: block;
  /* No rotation — Southern Cross has a natural up-orientation that doubles
   * as the arrow direction. */
  transform-origin: center;
}

/* The masthead. Set in the display serif at a newspaper's nameplate weight —
 * the sharp wedge serifs do the work the old chamfered techno face was doing,
 * and it reads as a title rather than as a logotype. Tracking is nearly closed
 * up: a nameplate is set tight, not spaced out. */
.brand-name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--brand);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  /* Cancel the trailing letter-space so the optical right edge sits true. */
  margin-right: -0.5px;
}

/* Meta items in topbar — small caps, dot separators */
.meta-item {
  font-size: 11px;
  letter-spacing: 0.6px;
  font-weight: 500;
}
.topbar .meta {
  display: flex; gap: 18px; align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 6px; vertical-align: middle;
}
.dot.live { background: var(--green); box-shadow: none; animation: pulse 2s infinite; }
.dot.dead { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.55; } }

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 18px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.toolbar input, .toolbar select, .toolbar button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 0;
  font-size: 12px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.toolbar input { min-width: 180px; }
.toolbar button { cursor: pointer; }
.toolbar input:hover, .toolbar select:hover, .toolbar button:hover {
  border-color: var(--cyan);
  background: var(--panel-3);
}
.toolbar input:focus, .toolbar select:focus {
  box-shadow: 0 0 0 1px var(--cyan);
}
.toolbar .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; margin-right: 2px; }
.toolbar .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 0; overflow: hidden; }
.toolbar .seg button { border: none; border-radius: 0; padding: 5px 10px; background: var(--panel); }
.toolbar .seg button.active { background: var(--blue); color: var(--bg); }

/* Grid */
.grid-wrap { padding: 0 12px 60px; }
table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 8px;
}
table.grid thead th {
  position: sticky; top: 92px;
  background: var(--panel);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 10px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--cyan) 18%, transparent);
  text-align: right;
  cursor: pointer;
  user-select: none;
}
table.grid thead th:first-child,
table.grid thead th:nth-child(2) { text-align: left; }
table.grid tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.grid tbody td:first-child,
table.grid tbody td:nth-child(2) { text-align: left; }
table.grid tbody tr {
  transition: background 0.18s;
}
table.grid tbody tr:hover {
  background: var(--panel-2);
}
.symbol {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--cyan);
}
table.grid tbody tr.new { animation: flash 1.6s ease-out 3; }
@keyframes flash {
  0% { background: color-mix(in srgb, var(--yellow) 50%, transparent); }
  100% { background: transparent; }
}

/* RSI cells — glow on extremes */
.rsi {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 0;
  min-width: 34px;
  font-weight: 700;
  transition: box-shadow 0.2s;
}
.rsi.os    { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); }
.rsi.os2   { background: var(--green); color: var(--bg); box-shadow: none; }
.rsi.ob    { background: color-mix(in srgb, var(--red) 18%, transparent);  color: var(--red-soft);  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); }
.rsi.ob2   { background: var(--red); color: var(--bg); box-shadow: none; animation: rsi-pulse 2.4s ease-in-out infinite; }
.rsi.neutral { color: var(--muted); }
@keyframes rsi-pulse {
  50% { box-shadow: none; }
}

/* Tags */
/* Every pill is the same height regardless of what's in it: inline-flex with
   line-height 1 means the box is driven by padding alone, not by the inherited
   1.45 line-height, which is what made these ragged next to each other. */
.tag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 3px 5px;
  border-radius: var(--radius);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}
.tag.new      { background: var(--flash); color: var(--bg); }
.tag.long     { background: var(--green); color: var(--bg); }
.tag.short    { background: var(--red); color: var(--bg); }
.tag.muted    { background: var(--panel); color: var(--muted); border: 1px solid var(--border); }
.tag.stock    {
  background: color-mix(in srgb, var(--text) 12%, transparent);
  color: var(--text-dim);
  border: 1px solid color-mix(in srgb, var(--text) 45%, transparent);
  letter-spacing: 0.6px;
}

.score {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 0;
}
.score.long { background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green); }
.score.short { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.score.hot { box-shadow: 0 0 0 1px currentColor inset; }

.symbol { font-weight: 700; }
.muted { color: var(--muted); }
.right { text-align: right; }

.pct.up   { color: var(--green); }
.pct.down { color: var(--red); }

/* Detail page */
.detail-wrap {
  padding: 16px 22px 60px;
  max-width: 1280px;
  margin: 0 auto;
}
/* SECTION CARDS — asymmetric "leaning diamond" radius.
 * Top-left + bottom-right corners get 14px rounding; top-right +
 * bottom-left stay almost sharp (2px). The shape leans diagonally —
 * feels deliberately designed, not stock rounded-rectangle. No stitch,
 * no Roman numerals. Border picks up a faint leather tint on the
 * rounded edges to reinforce the diagonal flow. */
.section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top-color: color-mix(in srgb, var(--text) 32%, transparent);
  border-left-color: color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: 0;
  padding: 16px 20px;
  margin-bottom: 14px;
  position: relative;
}
.section::before {
  /* (flattened for pitch-black theme — no bright top hairline) */
  content: none;
  position: absolute;
  top: 0; left: 22px; right: 14px;
  height: 1px;
  background: transparent;
  pointer-events: none;
}

/* ============== Custom leather scrollbar ============== */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-mid) transparent;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--panel-3); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-light), var(--brand-mid));
  border-radius: 0;
  border: 1px solid var(--panel-3);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--brand-light), var(--brand-dark));
}
.section h2 {
  margin: 0 0 14px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 2.2px;
  font-weight: 700;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-feature-settings: "ss01" 1;
  width: 100%;
}
.section h2::before {
  /* Small leather bracket before headings — no cyan/Solana hue */
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--brand-mid);
  box-shadow: none;
}
.section h2::after {
  /* Trailing hairline — gives every header a small architectural frame */
  content: "";
  flex: 1;
  margin-left: 8px;
  height: 1px;
  background: var(--panel-2);
  min-width: 40px;
}
.tf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.tf-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 12px;
}
.tf-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.tf-card .row {
  display: flex; justify-content: space-between;
  font-size: 12px; padding: 2px 0;
}
.tf-card .row .k { color: var(--muted); }
.tf-card .signals {
  margin-top: 6px;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.headline {
  display: flex; align-items: baseline; gap: 14px;
  flex-wrap: wrap;
}
.headline .price {
  font-size: 24px; font-weight: 700;
}
/* Stays inline (not inline-flex): an inline-flex box takes its baseline from
 * its first item, and an <img> has no baseline — so the whole ticker would
 * ride off the baseline that price / 24h% / listed-age share. */
.headline .sym {
  font-size: 22px; font-weight: 800; letter-spacing: 0.5px;
}
/* Scale the shared .tok-logo up to match the 22px ticker. vertical-align
 * seats it on the text baseline the same way the grid does. */
.headline .sym .tok-logo {
  width: 24px; height: 24px;
  margin-right: 9px;
  vertical-align: -5px;
}
.news-item {
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
  display: flex; gap: 10px; align-items: baseline;
}
.news-item:last-child { border-bottom: none; }
.news-item .src { color: var(--muted); font-size: 11px; min-width: 110px; }
.news-item .ttl { flex: 1; }
.news-item.positive .ttl { color: var(--green-soft); }
.news-item.negative .ttl { color: var(--red-soft); }

.back {
  color: var(--muted);
  font-size: 12px;
}

/* Headline stats row */
.head-stats {
  margin-top: 10px;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 13px;
}
.head-stats > div { display: flex; gap: 6px; align-items: baseline; }

/* Two-column section layout */
.section.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}
.section.two-col > div h2 { margin-top: 0; }
@media (max-width: 900px) { .section.two-col { grid-template-columns: 1fr; } }

/* ---------- Short Cascade Checklist ---------- */
.cascade-section {
  border-color: var(--border-2);
  transition: box-shadow .2s, border-color .2s;
}
.cascade-section.state-OFF    { border-color: var(--border); }
.cascade-section.state-WATCH  { border-color: var(--yellow); box-shadow: 0 0 0 1px color-mix(in srgb, var(--yellow) 18%, transparent) inset; }
.cascade-section.state-ARMED  { border-color: var(--orange); box-shadow: 0 0 0 1px color-mix(in srgb, var(--orange) 30%, transparent) inset; }
.cascade-section.state-FIRE   {
  border-color: var(--red);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 45%, transparent) inset;
  animation: fire-pulse 1.6s ease-in-out infinite;
}
@keyframes fire-pulse {
  50% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 65%, transparent) inset; }
}

.cascade-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.cascade-pill {
  font-weight: 800;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 0;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border);
  letter-spacing: 0.5px;
}
.cascade-section.state-WATCH .cascade-pill { background: color-mix(in srgb, var(--yellow) 16%, transparent); color: var(--yellow); border-color: var(--yellow); }
.cascade-section.state-ARMED .cascade-pill { background: color-mix(in srgb, var(--orange) 22%, transparent); color: var(--orange); border-color: var(--orange); }
.cascade-section.state-FIRE  .cascade-pill { background: var(--red); color: var(--bg); border-color: var(--red); }

.cascade-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6px;
}
.cas-row {
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 12px;
}
.cas-row.pass {
  border-color: color-mix(in srgb, var(--red) 65%, transparent);
  background: color-mix(in srgb, var(--red) 8%, transparent);
}
.cas-row.fail { opacity: 0.85; }
.cas-icon { font-weight: 800; }
.cas-row.pass .cas-icon { color: var(--red); }
.cas-row.fail .cas-icon { color: var(--muted); }
.cas-label { color: var(--text); }
.cas-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.cas-thr { font-size: 11px; }
.cascade-hint { margin-top: 10px; font-size: 11px; }

/* ---------- Per-TF raw data table ---------- */
.tf-table-wrap { overflow-x: auto; }
table.tf-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
table.tf-table th {
  text-align: right;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  white-space: nowrap;
}
table.tf-table th:first-child { text-align: left; }
table.tf-table td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  white-space: nowrap;
}
table.tf-table td:first-child {
  text-align: left;
  font-weight: 700;
  color: var(--blue);
}
table.tf-table tbody tr:hover { background: color-mix(in srgb, var(--cyan) 5%, transparent); }
table.tf-table .up { color: var(--green); }
table.tf-table .down { color: var(--red); }
table.tf-table .short { color: var(--red); font-weight: 700; }
table.tf-table .long  { color: var(--green); font-weight: 700; }

/* ---------- Pattern grid ---------- */
table.pat-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
table.pat-table th, table.pat-table td {
  padding: 6px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
table.pat-table th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}
table.pat-table .pat-label {
  text-align: left;
  font-weight: 600;
}
table.pat-table .pat-label.long  { color: var(--green); }
table.pat-table .pat-label.short { color: var(--red); }
table.pat-table .pat-cell { color: var(--muted); }
table.pat-table .tag { padding: 0 4px; border-radius: 0; }

/* ---------- Live RSI panel — 5 big cards ---------- */
.rsi-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.rsi-card {
  position: relative;
  padding: 14px 14px 12px;
  border-radius: 0;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}
.rsi-card.rsi-bg-os    { border-color: color-mix(in srgb, var(--green) 45%, transparent); background: var(--panel-2); }
.rsi-card.rsi-bg-os2   { border-color: var(--green);          background: var(--panel-2); }
.rsi-card.rsi-bg-ob    { border-color: color-mix(in srgb, var(--red) 45%, transparent);  background: var(--panel-2); }
.rsi-card.rsi-bg-ob2   { border-color: var(--red);            background: var(--panel-2); animation: ob2-pulse 2s ease-in-out infinite; }
@keyframes ob2-pulse {
  50% { box-shadow: none; }
}

.rsi-card-tf {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 700;
}
.rsi-card-value {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.rsi-card-value.rsi-os    { color: var(--green-soft); }
.rsi-card-value.rsi-os2   { color: var(--green); text-shadow: none; }
.rsi-card-value.rsi-ob    { color: var(--red-soft); }
.rsi-card-value.rsi-ob2   { color: var(--red); text-shadow: none; }
.rsi-card-value.rsi-neutral { color: var(--text); }
.rsi-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.rsi-card-slope {
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.rsi-card-slope.up    { color: var(--green); }
.rsi-card-slope.down  { color: var(--red); }
.rsi-card-slope.muted { color: var(--muted); }
.rsi-card-sub {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 12px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.rsi-card-sub b { color: var(--text); }
.rsi-card-cross { margin-top: 2px; }
.cross-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 600;
  background: var(--panel);
  border: 1px solid var(--border);
}
.cross-pill.long  { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); border-color: var(--green-dim); }
.cross-pill.short { background: color-mix(in srgb, var(--red) 20%, transparent);  color: var(--red);   border-color: var(--red-dim); }
.cross-pill.up    { color: var(--green-soft); }
.cross-pill.down  { color: var(--red-soft); }
.cross-pill.muted { color: var(--muted); }

/* ---------- Moon & Solar panel ---------- */
.moon-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.moon-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
}
.moon-emoji { font-size: 34px; line-height: 1; }
.moon-info { display: flex; flex-direction: column; gap: 2px; }
.moon-name { font-weight: 700; }
.moon-illum { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- News sentiment badge ---------- */
.sent-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-left: 6px;
  vertical-align: 1px;
}
.sent-badge.positive { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); border: 1px solid var(--green-dim); }
.sent-badge.negative { background: color-mix(in srgb, var(--red) 20%, transparent);  color: var(--red);   border: 1px solid var(--red-dim); }
.sent-badge.neutral  { background: var(--panel);          color: var(--muted); border: 1px solid var(--border); }

/* ---------- Inline sparkline on RSI cards ---------- */
.rsi-card-spark {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.spark-cap {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
svg.spark {
  width: 100%;
  height: 42px;
  display: block;
  background: var(--panel-3);
  border-radius: 0;
}
.spark-band { fill: color-mix(in srgb, var(--green) 8%, transparent); }
.spark-os   { stroke: color-mix(in srgb, var(--green) 45%, transparent); stroke-width: 0.6; stroke-dasharray: 2 3; }
.spark-ob   { stroke: color-mix(in srgb, var(--red) 55%, transparent); stroke-width: 0.6; stroke-dasharray: 2 3; }
.spark-line { fill: none; stroke-width: 1.4; }
.spark-rsi-neutral { stroke: var(--muted); }
.spark-rsi-os      { stroke: var(--green-soft); }
.spark-rsi-os2     { stroke: var(--green); }
.spark-rsi-ob      { stroke: var(--red-soft); }
.spark-rsi-ob2     { stroke: var(--red); }
.spark-stoch       { stroke: var(--cyan); }
.spark-line-d      { stroke: color-mix(in srgb, var(--tier-crypto) 65%, transparent); stroke-width: 1; stroke-dasharray: 3 2; fill: none; }
.spark-empty       { fill: var(--muted); font-size: 11px; }

/* ---------- Refresh button (detail header) ---------- */
.refresh-btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}
.refresh-btn:hover  { border-color: var(--blue); background: color-mix(in srgb, var(--cyan) 8%, transparent); }
.refresh-btn:active { transform: scale(0.97); }
.refresh-btn:disabled { opacity: 0.6; cursor: wait; }

/* ============== MAIN PAGE: KPI strip + leaderboards ============== */
.market-wrap {
  padding: 10px 18px 0;
  background: var(--bg);
}
.market-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 1px;
}
.kpi-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; }
.kpi-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-sub   { font-size: 11px; }
.kpi-up    .kpi-value { color: var(--green); }
.kpi-down  .kpi-value { color: var(--red); }
.kpi-ob    { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.kpi-ob    .kpi-value { color: var(--red-soft); }
.kpi-os    { border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.kpi-os    .kpi-value { color: var(--green-soft); }

.market-boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.board {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 0 4px;
  display: flex; flex-direction: column;
}
.board h3 {
  margin: 0 12px 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 700;
}
.board-list { display: flex; flex-direction: column; }
.board-row {
  display: grid;
  grid-template-columns: 60px 1fr 56px 38px 60px;
  gap: 6px;
  padding: 5px 12px;
  align-items: center;
  font-size: 12px;
  text-decoration: none;
  color: var(--text);
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.board-row:hover { background: color-mix(in srgb, var(--cyan) 7%, transparent); text-decoration: none; }
.board-row.state-FIRE     { background: color-mix(in srgb, var(--red) 10%, transparent); }
.board-row.state-ARMED    { background: color-mix(in srgb, var(--orange) 7%, transparent); }
.board-row.state-BUILDING { background: color-mix(in srgb, var(--yellow) 5%, transparent); }
.br-sym    { font-weight: 700; }
.br-price  { text-align: right; }
.br-ch     { text-align: right; font-weight: 600; }
.br-ch.up   { color: var(--green); }
.br-ch.down { color: var(--red); }
.br-metric { text-align: right; font-weight: 700; }
.br-metric.short { color: var(--red); }
.br-metric.long  { color: var(--green); }

/* ============== DETAIL PAGE: cascade redesign ============== */
.cascade-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cascade-score-wrap { display: flex; gap: 12px; align-items: center; }
.cascade-score {
  font-size: 36px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  color: var(--muted);
}
.cascade-section.state-WATCH    .cascade-score { color: var(--yellow); }
.cascade-section.state-BUILDING .cascade-score { color: var(--orange); }
.cascade-section.state-ARMED    .cascade-score { color: var(--orange); }
.cascade-section.state-FIRE     .cascade-score { color: var(--red); text-shadow: none; }

.cascade-bars { display: flex; flex-direction: column; gap: 5px; }
.bar-row {
  display: grid;
  grid-template-columns: 18px 1fr 70px 80px 1fr 46px;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 12px;
}
.bar-row.pass { border-color: color-mix(in srgb, var(--red) 60%, transparent); background: color-mix(in srgb, var(--red) 8%, transparent); }
.bar-row.near { border-color: color-mix(in srgb, var(--orange) 45%, transparent); background: color-mix(in srgb, var(--orange) 5%, transparent); }
.bar-icon { font-weight: 800; text-align: center; }
.bar-row.pass .bar-icon { color: var(--red); }
.bar-row.near .bar-icon { color: var(--orange); }
.bar-row.fail .bar-icon { color: var(--muted); }
.bar-label { color: var(--text); }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.bar-thr { font-size: 11px; text-align: right; }
.bar-track {
  background: color-mix(in srgb, var(--text) 5%, transparent);
  height: 8px;
  border-radius: 0;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow) 0%, var(--orange) 60%, var(--red) 100%);
  border-radius: 0;
  transition: width 0.4s;
}
.bar-row.pass .bar-fill { background: linear-gradient(90deg, var(--orange) 0%, var(--red) 60%, var(--red) 100%); box-shadow: none; }
.bar-pct { font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Cascade trade plan */
.cascade-plan { margin-top: 10px; }
.plan-card {
  background: var(--panel-2);
  border: 1px solid color-mix(in srgb, var(--red) 50%, transparent);
  border-radius: 0;
  padding: 10px 14px;
}
.plan-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.plan-side {
  font-weight: 800;
  font-size: 14px;
  padding: 3px 10px;
  border-radius: 0;
  letter-spacing: 1px;
}
.plan-side.short { background: var(--red); color: var(--bg); }
.plan-note { font-size: 11px; }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.plan-grid > div { display: flex; flex-direction: column; gap: 1px; }
.plan-k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.plan-grid b { font-size: 16px; font-variant-numeric: tabular-nums; }
.plan-grid .long  { color: var(--green); }
.plan-grid .short { color: var(--red); }

/* ============== DETAIL PAGE: rich per-TF cards ============== */
.tf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 12px;
}
.tfc {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tfc-os    { border-color: color-mix(in srgb, var(--green) 40%, transparent); background: var(--panel-2); }
.tfc-os2   { border-color: var(--green);          background: var(--panel-2); }
.tfc-ob    { border-color: color-mix(in srgb, var(--red) 40%, transparent);  background: var(--panel-2); }
.tfc-ob2   { border-color: var(--red);            background: var(--panel-2); box-shadow: none; }

.tfc.empty { padding: 20px; align-items: center; justify-content: center; min-height: 80px; }

.tfc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tfc-tf {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 3px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
}
.tfc-verdict {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 700;
}
.vd-ob2 { color: var(--red); text-shadow: none; }
.vd-ob  { color: var(--red-soft); }
.vd-mid-h { color: var(--yellow); }
.vd-mid-l { color: var(--green-soft); }
.vd-os  { color: var(--green); }
.vd-os2 { color: var(--green); text-shadow: none; }

.tfc-stale {
  font-size: 10px;
  color: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 15%, transparent);
  padding: 1px 5px;
  border-radius: 0;
  border: 1px solid color-mix(in srgb, var(--yellow) 40%, transparent);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.tfc-rsi-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.tfc-rsi-big {
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.5px;
}
.tfc-rsi-big.rsi-os    { color: var(--green-soft); }
.tfc-rsi-big.rsi-os2   { color: var(--green); text-shadow: none; }
.tfc-rsi-big.rsi-ob    { color: var(--red-soft); }
.tfc-rsi-big.rsi-ob2   { color: var(--red); text-shadow: none; }
.tfc-rsi-big.rsi-neutral { color: var(--text); }
.tfc-rsi-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.tfc-rsi-meta b { color: var(--text); font-weight: 700; }
.tfc-rsi-spark svg.spark { width: 100%; min-width: 160px; max-width: 240px; height: 46px; }

.tfc-stoch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.tfc-stoch-vals { display: flex; gap: 14px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.tfc-stoch-vals b { font-weight: 700; font-variant-numeric: tabular-nums; }
.tfc-stoch-spark svg.spark { width: 100%; min-width: 160px; max-width: 240px; height: 40px; }

.tfc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tfc-grid > div { display: flex; flex-direction: column; gap: 0; padding: 0 4px; }
.kv-k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.kv-v { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv-v.up   { color: var(--green); }
.kv-v.down { color: var(--red); }
.kv-v.short { color: var(--red); }
.kv-v.long  { color: var(--green); }
.kv-v.muted { color: var(--muted); font-weight: 500; }

.tfc-flags { display: flex; flex-wrap: wrap; gap: 5px; }

/* ============== Cascade chip (header) ============== */
.cascade-chip {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 3px 10px;
  border-radius: 0;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.cascade-chip.state-WATCH    { color: var(--yellow); border-color: var(--yellow); background: color-mix(in srgb, var(--yellow) 10%, transparent); }
.cascade-chip.state-BUILDING { color: var(--orange);       border-color: var(--orange);       background: color-mix(in srgb, var(--orange) 10%, transparent); }
.cascade-chip.state-ARMED    { color: var(--orange);       border-color: var(--orange);       background: color-mix(in srgb, var(--orange) 20%, transparent); }
.cascade-chip.state-FIRE     { color: var(--bg);          border-color: var(--red);    background: var(--red); animation: chip-pulse 1.4s ease-in-out infinite; }
@keyframes chip-pulse { 50% { box-shadow: none; } }

/* ============== RSI strip — clean horizontal gauges per TF ============== */
.rsi-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rs-row {
  display: grid;
  grid-template-columns: 56px 1fr 110px 110px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
}
.rs-bg-os    { border-color: color-mix(in srgb, var(--green) 35%, transparent); background: var(--panel-2); }
.rs-bg-os2   { border-color: var(--green);          background: var(--panel-2); }
.rs-bg-ob    { border-color: color-mix(in srgb, var(--red) 40%, transparent);  background: var(--panel-2); }
.rs-bg-ob2   { border-color: var(--red);            background: var(--panel-2); box-shadow: none; }

.rs-tf {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.6px;
  padding: 6px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
}

.rs-gauge { display: flex; flex-direction: column; gap: 2px; }
.rs-track {
  position: relative;
  height: 18px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.rs-zone-os {
  position: absolute; left: 0; top: 0; bottom: 0; width: 30%;
  background: var(--panel-2);
}
.rs-zone-ob {
  position: absolute; right: 0; top: 0; bottom: 0; width: 30%;
  background: var(--panel-2);
}
.rs-mark {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: color-mix(in srgb, var(--text) 18%, transparent);
}
.rs-mark-30 { left: 30%; }
.rs-mark-50 { left: 50%; background: color-mix(in srgb, var(--text) 28%, transparent); }
.rs-mark-70 { left: 70%; }
.rs-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--panel-2);
  transition: width 0.4s;
}
.rs-fill-os    { background: linear-gradient(90deg, var(--green), var(--green-soft)); }
.rs-fill-os2   { background: var(--green); box-shadow: none; }
.rs-fill-ob    { background: var(--red-soft); }
.rs-fill-ob2   { background: var(--red); box-shadow: none; }
.rs-fill-neutral { background: var(--panel-2); }

.rs-needle {
  position: absolute; top: -2px; bottom: -2px; width: 3px;
  margin-left: -1.5px;
  background: var(--text);
  border-radius: 0;
  transition: left 0.4s;
}
.rs-needle-ob2 { background: var(--red);   box-shadow: none; }
.rs-needle-ob  { background: var(--red-soft); }
.rs-needle-os  { background: var(--green-soft); }
.rs-needle-os2 { background: var(--green); box-shadow: none; }

.rs-axis {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  padding: 0 1px;
}

.rs-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.rs-num   { font-size: 30px; line-height: 1; letter-spacing: -1px; }
.rs-denom { font-size: 13px; color: var(--muted); margin-left: 3px; font-weight: 600; }
.rs-value.rs-os    { color: var(--green-soft); }
.rs-value.rs-os2   { color: var(--green); text-shadow: none; }
.rs-value.rs-ob    { color: var(--red-soft); }
.rs-value.rs-ob2   { color: var(--red); text-shadow: none; }
.rs-value.rs-neutral { color: var(--text); }

.rs-badge-wrap {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
}
.rs-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 0;
  text-transform: uppercase;
}
.rs-badge.rs-ob2 { background: var(--red); color: var(--bg); }
.rs-badge.rs-ob  { background: color-mix(in srgb, var(--red) 25%, transparent); color: var(--red-soft); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); }
.rs-badge.rs-os  { background: color-mix(in srgb, var(--green) 25%, transparent); color: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 40%, transparent); }
.rs-badge.rs-os2 { background: var(--green); color: var(--bg); }
.rs-stale { font-size: 10px; color: var(--yellow); background: color-mix(in srgb, var(--yellow) 15%, transparent); padding: 1px 6px; border: 1px solid color-mix(in srgb, var(--yellow) 40%, transparent); border-radius: 0; font-weight: 700; }

.rsi-strip-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 11px;
  align-items: center;
  flex-wrap: wrap;
}
.rsi-strip-legend span span {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 0;
  margin-right: 5px;
  vertical-align: -1px;
}
.rsi-strip-legend .zone-os  { background: color-mix(in srgb, var(--green) 40%, transparent); }
.rsi-strip-legend .zone-mid { background: color-mix(in srgb, var(--text) 15%, transparent); }
.rsi-strip-legend .zone-ob  { background: color-mix(in srgb, var(--red) 40%, transparent); }
.rsi-strip-legend .zone-ob2 { background: var(--red); }

/* Stoch RSI strip — distinguished from RSI strip with a purple-tinted needle
 * + slightly different track gradient. Same OB/OS semantics. */
.stoch-strip { display: flex; flex-direction: column; gap: 6px; }
.stoch-row {
  display: grid;
  grid-template-columns: 56px 1fr 90px 90px;
  gap: 14px;
  align-items: center;
  padding: 8px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
}
.stoch-row.s-ob   { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.stoch-row.s-ob2  { border-color: var(--red); box-shadow: none; }
.stoch-row.s-os   { border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.stoch-row.s-os2  { border-color: var(--green); box-shadow: none; }

.stoch-tf {
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.6px;
  padding: 5px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
}
.stoch-track {
  position: relative;
  height: 14px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
/* TradingView-default Stoch RSI colors */
:root {
  --tv-k: var(--cyan);   /* TV %K — steel */
  --tv-d: var(--orange);     /* TV %D — orange */
}

.stoch-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--tv-k);
  transition: width 0.4s;
}
/* OB/OS states override the default blue with red/green so the bar
 * itself screams the regime — but the K *number* keeps its blue tone
 * outside extremes so K/D colours match TV's lines. */
.stoch-fill.s-os2  { background: linear-gradient(90deg, var(--green), var(--green-soft)); }
.stoch-fill.s-os   { background: var(--green-soft); }
.stoch-fill.s-ob   { background: var(--red-soft); }
.stoch-fill.s-ob2  { background: var(--red-soft); box-shadow: none; }

.stoch-zone-os { position: absolute; left: 0; top: 0; bottom: 0; width: 20%; background: var(--panel-2); }
.stoch-zone-ob { position: absolute; right: 0; top: 0; bottom: 0; width: 20%; background: var(--panel-2); }

/* %D position marker — TV orange */
.stoch-d-line {
  position: absolute; top: -2px; bottom: -2px; width: 2px;
  background: var(--tv-d);
  margin-left: -1px;
  opacity: 0.95;
  box-shadow: none;
}

.stoch-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 18px;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 2px;
}
.stoch-sep { color: var(--muted); font-weight: 500; margin: 0 2px; }
/* %K = TV blue (default). State classes only kick in at extremes. */
.stoch-k     { color: var(--tv-k); }
.stoch-k.s-os2 { color: var(--green); text-shadow: none; }
.stoch-k.s-os  { color: var(--green-soft); }
.stoch-k.s-ob  { color: var(--red-soft); }
.stoch-k.s-ob2 { color: var(--red); text-shadow: none; }
/* %D = TV orange (always — independent of K's state) */
.stoch-d {
  color: var(--tv-d);
  font-size: 14px;
  font-weight: 700;
}

.stoch-cross-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
}
.stoch-cross-pill.golden { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green-soft); border-color: color-mix(in srgb, var(--green) 50%, transparent); }
.stoch-cross-pill.dead   { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red-soft); border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.stoch-cross-pill.up     { color: var(--green-soft); }
.stoch-cross-pill.down   { color: var(--red-soft); }

/* Fibonacci panel */
.fib-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.fib-meta {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
  position: relative;
}
.fib-meta::before {
  content: "Φ";
  position: absolute; top: 8px; right: 12px;
  font-size: 28px;
  color: color-mix(in srgb, var(--yellow) 25%, transparent);
  font-weight: 800;
}
.fib-row { display: flex; justify-content: space-between; font-size: 12px; }
.fib-row .k { color: var(--muted); }
.fib-row .v { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }

.fib-levels {
  position: relative;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 14px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.fib-level {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  padding: 3px 0;
  border-top: 1px dashed color-mix(in srgb, var(--text) 5%, transparent);
}
.fib-level:first-child { border-top: none; }
.fib-level .label {
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fib-level .line {
  height: 1px;
  background: var(--panel-2);
}
.fib-level .price {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  color: var(--text);
}
.fib-level.golden {
  background: var(--panel-2);
  border-radius: 0;
}
.fib-level.golden .label { color: var(--gold); text-shadow: none; }
.fib-level.golden .price { color: var(--gold); }
.fib-level.golden .line  { background: var(--gold); }
.fib-level.current {
  background: color-mix(in srgb, var(--cyan) 12%, transparent);
  border-radius: 0;
}
.fib-level.current .label, .fib-level.current .price { color: var(--cyan); }
.fib-current-marker {
  font-size: 10px;
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* OI delta strip */
.oi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.oi-cell {
  padding: 8px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
  text-align: center;
}
.oi-cell .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; }
.oi-cell .value {
  font-size: 16px;
  font-weight: 800;
  font-family: ui-monospace, monospace;
  margin-top: 2px;
}
.oi-cell.up   .value { color: var(--green); }
.oi-cell.down .value { color: var(--red); }
.oi-cell.up.strong   { box-shadow: none; border-color: var(--green); }
.oi-cell.down.strong { box-shadow: none;   border-color: var(--red); }
.oi-cell.dim .value  { color: var(--muted); font-weight: 600; font-size: 13px; }

/* (Liquidations panel CSS removed — UI section dropped per user feedback.
 * Engine class BinanceLiqWS stays in core/mexc.py for future re-enable.) */

/* ============== Fundamentals strip ============== */
.fund-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.fund-card {
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.fund-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  font-weight: 700;
}
.fund-big {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  line-height: 1.15;
}
.fund-sub { font-size: 11px; }
.fund-card.fund-pos .fund-big { color: var(--green); }
.fund-card.fund-neg .fund-big { color: var(--red); }
.fund-card.fund-pos { border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.fund-card.fund-neg { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.fund-card.fund-oi  .fund-big { color: var(--blue); }

/* Fear & Greed card variants */
.fund-card.fund-fng-fear2  { border-color: color-mix(in srgb, var(--green) 55%, transparent); background: var(--panel-2); }
.fund-card.fund-fng-fear2  .fund-big { color: var(--green); }
.fund-card.fund-fng-fear   { border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.fund-card.fund-fng-fear   .fund-big { color: var(--green-soft); }
.fund-card.fund-fng-greed  { border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
.fund-card.fund-fng-greed  .fund-big { color: var(--orange); }
.fund-card.fund-fng-greed2 { border-color: var(--red); background: var(--panel-2); }
.fund-card.fund-fng-greed2 .fund-big { color: var(--red); text-shadow: none; }

/* Long/Short ratio card */
.fund-card.fund-ls-hot { border-color: var(--red); background: var(--panel-2); }
.fund-card .ls-bar {
  display: flex;
  height: 6px;
  border-radius: 0;
  overflow: hidden;
  margin-top: 4px;
  background: var(--panel);
}
.ls-bar-long  { background: var(--green); }
.ls-bar-short { background: var(--red); }

/* Topstrip macro chips (F&G, BTC.D, ETH.D) */
/* Compact one-line macro chip: [LABEL] VALUE · sub */
.macro-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 10px;
  background: var(--panel);                  /* warm matte black, matches --panel */
  border: 1px solid var(--border);      /* hairline */
  border-radius: 0;
  line-height: 1;
}
.macro-chip .mc-label { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
.macro-chip .mc-value { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.macro-chip .mc-sub   { font-size: 9.5px; color: var(--muted); letter-spacing: 0.3px; }
.macro-chip.fng-fear2   { border-color: color-mix(in srgb, var(--green) 55%, transparent); background: var(--panel); }
.macro-chip.fng-fear2 .mc-value { color: var(--green); }
.macro-chip.fng-fear    { border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.macro-chip.fng-fear .mc-value  { color: var(--green-soft); }
.macro-chip.fng-neutral .mc-value { color: var(--text); }
.macro-chip.fng-greed   { border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
.macro-chip.fng-greed .mc-value { color: var(--orange); }
.macro-chip.fng-greed2  { border-color: var(--red); background: var(--panel); }
.macro-chip.fng-greed2 .mc-value { color: var(--red); text-shadow: none; }
.macro-chip.btcd-hot    { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.macro-chip.btcd-hot   .mc-value { color: var(--red); }
.macro-chip.btcd-cool   { border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.macro-chip.btcd-cool  .mc-value { color: var(--green); }
.macro-chip.btcd-neutral .mc-value { color: var(--text); }
.macro-chip.macro-eth .mc-value { color: var(--tier-crypto); }

/* Listing-age badge in grid */
/* 24h range position bar — low ── ▮ ── high, marker at the live price. */
.rng { display: flex; flex-direction: column; gap: 5px; width: 100%; padding-top: 3px; }
.rng-track {
  position: relative; height: 4px; width: 100%;
  background: var(--panel-3); border: 1px solid var(--border);
}
.rng-fill { position: absolute; inset: 0 auto 0 0; background: var(--border-2); }
.rng-mark {
  position: absolute; top: -4px; width: 2px; height: 10px;
  background: var(--text); transform: translateX(-1px);
}
.rng-ends {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted);
  letter-spacing: -0.01em;
}

/* Funding cadence, printed small beside the rate. */
.fund-iv {
  margin-left: 3px; font-size: 9px; color: var(--muted);
  letter-spacing: 0.2px; vertical-align: 1px;
}

.tag.age-badge {
  background: var(--panel-2);
  color: var(--blue);
  border: 1px solid color-mix(in srgb, var(--cyan) 40%, transparent);
  font-weight: 700;
}

/* Detail page header — listing age line */
.h-age {
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
}

/* Volume Δ column colours */
.vd-extreme { color: var(--green); font-weight: 800; text-shadow: none; }
.vd-strong  { color: var(--green); font-weight: 700; }
.vd-mild    { color: var(--green-soft); }

/* Compact KPI strip variant for the main page */
.market-kpis.compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}
.market-kpis.compact .kpi {
  padding: 5px 10px;
}
.market-kpis.compact .kpi-label { font-size: 9px; }
.market-kpis.compact .kpi-value { font-size: 16px; }
.market-kpis.compact .kpi-sub   { font-size: 10px; }

.market-wrap.below {
  background: var(--bg);
  margin-top: 18px;
}

/* ============== Toolbar — commercial-grade ============== */
.toolbar {
  padding: 12px 18px;
  gap: 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.toolbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--panel-2);
}

/* Group: small uppercase label + the input/control */
.tb-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tb-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--muted);
  font-weight: 700;
}
.tb-toggles { gap: 6px; }

/* Input with suffix */
.tb-input-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tb-input-wrap:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan);
}
.tb-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 0;
  width: 90px;
}
.tb-input-wrap input::-webkit-outer-spin-button,
.tb-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tb-input-suffix {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  padding-left: 4px;
}

/* ============== Custom Sort dropdown ============== */
.sort-dd {
  position: relative;
}
.sdd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-width: 260px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.sdd-trigger:hover {
  border-color: var(--cyan);
  background: var(--panel-3);
}
.sort-dd.open .sdd-trigger {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan);
}
.sdd-icon {
  color: var(--icon);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.sdd-text {
  flex: 1;
  text-align: left;
  letter-spacing: 0.3px;
}
.sdd-sub { font-weight: 500; font-size: 11px; }
.sdd-caret {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s;
}
.sort-dd.open .sdd-caret { transform: rotate(180deg); color: var(--cyan); }

.sdd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 320px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 0;
  padding: 5px;
  z-index: 60;
  box-shadow: 0 0 0 1px var(--cyan) inset;
  backdrop-filter: blur(10px);
}
.sdd-menu::before {
  content: "";
  position: absolute; top: -1px; left: 12px; right: 12px;
  height: 1px;
  background: var(--panel-2);
}
.sdd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.sdd-item:hover, .sdd-item.focus {
  background: color-mix(in srgb, var(--cyan) 8%, transparent);
  border-color: color-mix(in srgb, var(--cyan) 25%, transparent);
}
.sdd-item.active {
  background: var(--panel-2);
  border-color: color-mix(in srgb, var(--cyan) 50%, transparent);
}
.sdd-item.active .sdd-icon { color: var(--icon); }

/* ============== Toggle pills (replace checkboxes) ============== */
.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 9px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  user-select: none;
  transition: all 0.15s;
}
.toggle-pill:hover { border-color: color-mix(in srgb, var(--cyan) 40%, transparent); color: var(--text); }
.toggle-pill input { display: none; }
.tp-ind {
  position: relative;
  display: inline-block;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: transparent;
  transition: all 0.15s;
}
.tp-ind::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: none;
  transition: transform 0.15s;
}
.toggle-pill:has(input:checked) {
  background: var(--panel-2);
  border-color: var(--cyan);
  color: var(--text);
}
.toggle-pill:has(input:checked) .tp-ind {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 10%, transparent);
}
.toggle-pill:has(input:checked) .tp-ind::after {
  transform: translate(-50%, -50%) scale(1);
}

/* ============== Force Scan — divine button ============== */
.force-scan-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--cyan) 50%, transparent);
  border-radius: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: none;
}
.force-scan-btn:hover {
  background: var(--panel-2);
  box-shadow: none;
  border-color: var(--cyan);
}
/* The refresh glyph is part of the manufactured icon set, so it wears the same
   luminous blue as every other icon in the app — not the duller steel --cyan
   it used to override to. */
.force-scan-btn .fs-icon {
  color: var(--icon);
  display: inline-flex; align-items: center;
  transition: transform 0.4s;
}
.force-scan-btn.spinning .fs-icon { animation: fs-spin 1.2s linear infinite; }
@keyframes fs-spin { to { transform: rotate(360deg); } }

/* Consistent SVG sizing inside toolbar controls */
.toolbar .icn,
.sdd-menu .icn { flex-shrink: 0; }

/* Cascade mini-chip in the grid (small badge per row) */
.cascade-chip-mini {
  display: inline-block;
  min-width: 28px;
  padding: 1px 7px;
  border-radius: 0;
  font-weight: 800;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.cascade-chip-mini.cc-build { background: color-mix(in srgb, var(--yellow) 16%, transparent);  color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 40%, transparent); }
.cascade-chip-mini.cc-armed { background: color-mix(in srgb, var(--orange) 18%, transparent);  color: var(--orange);       border-color: var(--orange); }
.cascade-chip-mini.cc-fire  { background: var(--red);             color: var(--bg);          border-color: var(--red); animation: chip-pulse 1.4s ease-in-out infinite; }

/* Extreme-mover emphasis (≥15% abs 24h change) */
.grid tbody td.pct.extreme {
  font-size: 14px;
  text-shadow: none;
}
.grid tbody td.pct.extreme.up   { background: color-mix(in srgb, var(--green) 10%, transparent); }
.grid tbody td.pct.extreme.down { background: color-mix(in srgb, var(--red) 10%, transparent); }

/* ============== Pump Exhaustion (plain English) ============== */
.exh-head { display: flex; justify-content: space-between; align-items: center; }
.exh-head h2 { margin: 0; }
.exh-verdict {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.exh-count {
  font-weight: 800;
  font-size: 18px;
}
.exh-label { font-weight: 800; letter-spacing: 0.5px; padding: 2px 10px; border-radius: 0; }
.exh-label.state-off   { color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); }
.exh-label.state-watch { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 10%, transparent); border: 1px solid var(--yellow); }
.exh-label.state-build { color: var(--orange); background: color-mix(in srgb, var(--orange) 8%, transparent); border: 1px solid var(--orange); }
.exh-label.state-armed { color: var(--orange); background: color-mix(in srgb, var(--orange) 18%, transparent); border: 1px solid var(--orange); }
.exh-label.state-fire  { color: var(--bg);    background: var(--red);            border: 1px solid var(--red); animation: chip-pulse 1.4s ease-in-out infinite; }

#exh-section.exh-state-fire   { border-color: var(--red);    box-shadow: none; }
#exh-section.exh-state-armed  { border-color: var(--orange); }
#exh-section.exh-state-build  { border-color: color-mix(in srgb, var(--orange) 45%, transparent); }

.exh-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.exh2 {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
}
.exh2.on {
  border-color: color-mix(in srgb, var(--red) 55%, transparent);
  background: color-mix(in srgb, var(--red) 7%, transparent);
}
.exh2.off { opacity: 0.65; }
.exh2-icon {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}
.exh2.on  .exh2-icon { color: var(--red); }
.exh2.off .exh2-icon { color: var(--muted); }
.exh2-body { display: flex; flex-direction: column; gap: 2px; }
.exh2-head { font-weight: 700; font-size: 13px; color: var(--text); }
.exh2.off .exh2-head { color: var(--muted); font-weight: 500; }
.exh2-sub  { font-size: 11px; }

/* ============== Socials & community ============== */
.soc-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.soc-card {
  padding: 9px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
}
.soc-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); font-weight: 700; }
.soc-big   { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.soc-sub   { font-size: 11px; }
.soc-links {
  margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.soc-link {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 0;
  font-size: 12px;
  text-decoration: none;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.soc-link:hover {
  background: color-mix(in srgb, var(--cyan) 10%, transparent);
  border-color: var(--blue);
  text-decoration: none;
}
.soc-link.prominent {
  background: color-mix(in srgb, var(--cyan) 10%, transparent);
  border-color: color-mix(in srgb, var(--cyan) 50%, transparent);
  color: var(--text);
  font-weight: 600;
}
.soc-link.prominent:hover {
  background: color-mix(in srgb, var(--cyan) 20%, transparent);
}

/* ============== Project context strip (vapourware / rug detection) ============== */
.proj-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.proj-card {
  padding: 9px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0;
}
.proj-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); font-weight: 700; }
.proj-big   { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.proj-sub   { font-size: 11px; }

.proj-flags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.proj-flag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.proj-flag-red {
  background: color-mix(in srgb, var(--red) 15%, transparent);
  color: var(--red-soft);
  border: 1px solid color-mix(in srgb, var(--red) 50%, transparent);
}
.proj-flag-amber {
  background: color-mix(in srgb, var(--yellow) 13%, transparent);
  color: var(--yellow);
  border: 1px solid color-mix(in srgb, var(--yellow) 40%, transparent);
}
.proj-flag .muted { color: color-mix(in srgb, var(--text) 55%, transparent); font-weight: 500; }

/* ============== Open Interest · Positioning panel ============== */
.oi-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.oi-top {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.oi-big-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 140px;
  padding: 6px 14px 6px 0;
  border-right: 1px solid var(--border);
}
.oi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  font-weight: 700;
}
.oi-big {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.05;
  margin-top: 2px;
}
.oi-sub { font-size: 11px; margin-top: 1px; }

/* Delta chips — one per TF, colour-coded by direction + magnitude */
.oi-deltas {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.oi-deltas-empty {
  padding: 10px 14px;
  background: var(--panel);
  border: 1px dashed var(--border);
  font-size: 11.5px;
  font-style: italic;
  align-self: center;
}
.oi-delta-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  min-width: 64px;
  line-height: 1.1;
}
.oi-delta-tf {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  font-weight: 700;
}
.oi-delta-val {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.oi-delta-chip.oi-up        { border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.oi-delta-chip.oi-up        .oi-delta-val { color: var(--green-soft); }
.oi-delta-chip.oi-up-strong { border-color: color-mix(in srgb, var(--green) 65%, transparent); background: color-mix(in srgb, var(--green) 6%, transparent); }
.oi-delta-chip.oi-up-strong .oi-delta-val { color: var(--green); }
.oi-delta-chip.oi-down      { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.oi-delta-chip.oi-down      .oi-delta-val { color: var(--red-soft); }
.oi-delta-chip.oi-down-strong { border-color: color-mix(in srgb, var(--red) 65%, transparent); background: color-mix(in srgb, var(--red) 6%, transparent); }
.oi-delta-chip.oi-down-strong .oi-delta-val { color: var(--red); }

/* State row — chip + plain-english interpretation */
.oi-state-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
}
.oi-state-chip {
  flex-shrink: 0;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--text) 14%, transparent);
  color: var(--text-dim);
  border: 1px solid color-mix(in srgb, var(--text) 45%, transparent);
}
.oi-state-note {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.oi-state-compressed      .oi-state-chip { background: color-mix(in srgb, var(--yellow) 14%, transparent); color: var(--gold); border-color: color-mix(in srgb, var(--yellow) 50%, transparent); }
.oi-state-building_long   .oi-state-chip { background: color-mix(in srgb, var(--green) 14%, transparent);  color: var(--green); border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.oi-state-building_short  .oi-state-chip { background: color-mix(in srgb, var(--red) 14%, transparent);   color: var(--red);   border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.oi-state-short_squeeze   .oi-state-chip { background: color-mix(in srgb, var(--green) 18%, transparent);  color: var(--green); border-color: var(--green); }
.oi-state-long_wash       .oi-state-chip { background: color-mix(in srgb, var(--red) 18%, transparent);   color: var(--red);   border-color: var(--red); }
.oi-state-unwind          .oi-state-chip { background: color-mix(in srgb, var(--text) 10%, transparent);  color: var(--muted); border-color: color-mix(in srgb, var(--text) 32%, transparent); }

/* Divergence × OI confluence — the high-conviction layer */
.oi-conf {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left-width: 3px;
}
.oi-conf-badge {
  flex-shrink: 0;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 8px;
}
.oi-conf-note { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; }
.oi-conf.conf-bear       { border-left-color: var(--red); }
.oi-conf.conf-bear       .oi-conf-badge { background: var(--red); color: var(--bg); }
.oi-conf.conf-bull       { border-left-color: var(--green); }
.oi-conf.conf-bull       .oi-conf-badge { background: var(--green); color: var(--bg); }
.oi-conf.conf-bear-soft  { border-left-color: color-mix(in srgb, var(--red) 55%, transparent); }
.oi-conf.conf-bear-soft  .oi-conf-badge { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); border: 1px solid var(--red); }
.oi-conf.conf-bull-soft  { border-left-color: color-mix(in srgb, var(--green) 55%, transparent); }
.oi-conf.conf-bull-soft  .oi-conf-badge { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); border: 1px solid var(--green); }
.oi-conf.conf-quiet      { border-left-color: var(--border); }

/* 24h OI sparkline */
.oi-spark-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
}
.oi-spark-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 700;
  flex-shrink: 0;
}
.oi-spark-wrap { flex: 1; display: flex; align-items: center; }
.oi-spark { display: block; width: 100%; max-width: 480px; height: 36px; }

/* ============== On-Chain · Contract — slim chip row ============== */
.chain-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}
.chain-pill {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-dim);
  background: color-mix(in srgb, var(--text) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 45%, transparent);
  padding: 4px 10px;
}
.chain-addr {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--text-dim);
  background: transparent;
  padding: 4px 0;
  letter-spacing: 0.2px;
}
.chain-copy {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chain-link {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--text) 45%, transparent);
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text-dim);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chain-copy:hover, .chain-link:hover {
  background: color-mix(in srgb, var(--text) 22%, transparent);
  color: var(--text);
  border-color: var(--border-2);
  text-decoration: none;
}
.chain-link.bm { margin-left: auto; }   /* push CTA buttons to the right */

.vol-spike {
  display: inline-flex;
  align-items: center;
  color: var(--gold);
  margin-left: 4px;
  vertical-align: middle;
}
.vol-spike svg { width: 13px; height: 13px; }

/* Token logo — circle thumbnail next to every ticker.
 * SVG from spothq/cryptocurrency-icons via jsDelivr (token logo helper in
 * icons.js). Falls back to a deterministic letter badge on 404. */
.tok-logo {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -4px;
  margin-right: 7px;
  background: var(--panel);                  /* warm matte black slot */
  object-fit: cover;
  flex-shrink: 0;
}
/* Symbol cell.
 *
 * The badges used to sit at inconsistent heights down the column, and the cause
 * was baseline arithmetic: the anchor is an inline-flex box (it carries a token
 * logo), and an inline-flex box takes its baseline from its FIRST flex item. So
 * a row whose coin has a logo baselined off the image, a row whose coin has no
 * logo baselined off the text — and the `vertical-align: middle` pills chased
 * two different baselines, landing at different heights row to row.
 *
 * Making the cell a flex row removes the arithmetic entirely: every child
 * centres on one shared cross-axis, logo or no logo. */
.sym-cell { text-align: left; }
.sym-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sym-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;          /* let a long ticker ellipsis instead of shoving the
                            badges out of the cell */
}
.sym-link .sym-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sym-link .tok-logo { margin-right: 7px; }
.sym-wrap .tag { flex: 0 0 auto; }

/* (The animated background has been removed — the page uses its original
   solid matte-black surfaces.) */

/* ==========================================================================
   Composite "Signal" verdict — grid chip + click-to-see-why breakdown popover
   ========================================================================== */
.sig-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 2px 7px; border-radius: 0;
  font-size: 11px; font-weight: 800; letter-spacing: 0.4px;
  border: 1px solid var(--border); cursor: pointer; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sig-chip .sig-score { font-size: 10px; font-weight: 700; opacity: 0.85; }
.sig-chip.neu   { color: var(--muted); border-color: var(--border); background: var(--panel); cursor: default; }
.sig-chip.buy   { color: var(--green-soft); background: color-mix(in srgb, var(--green) 12%, transparent); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.sig-chip.sbuy  { color: var(--bg); background: var(--green); border-color: var(--green); box-shadow: none; }
.sig-chip.sell  { color: var(--red-soft); background: color-mix(in srgb, var(--red) 12%, transparent); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.sig-chip.ssell { color: var(--bg); background: var(--red); border-color: var(--red); box-shadow: none; }
.sig-chip:not(.neu):hover { filter: brightness(1.12); }

/* Breakdown popover */
.sig-pop {
  position: absolute; z-index: 4000; width: 320px; max-width: 90vw;
  background: var(--panel-2); border: 1px solid var(--border-2);
  box-shadow: none; padding: 0; font-size: 12px;
}
.sig-pop .sp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 11px; font-weight: 800; letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}
.sig-pop .sp-head.buy   { color: var(--green-soft); }
.sig-pop .sp-head.sbuy  { color: var(--green); }
.sig-pop .sp-head.sell  { color: var(--red-soft); }
.sig-pop .sp-head.ssell { color: var(--red); }
.sig-pop .sp-head.neu   { color: var(--muted); }
.sig-pop .sp-head .sp-score { font-variant-numeric: tabular-nums; }
.sig-pop .sp-meta {
  padding: 6px 11px; color: var(--muted); font-size: 11px;
  border-bottom: 1px solid var(--border); letter-spacing: 0.3px;
}
.sig-pop .sp-rows { max-height: 320px; overflow-y: auto; }
.sig-pop .sp-row {
  display: grid; grid-template-columns: 14px 108px 1fr; gap: 6px;
  align-items: start; padding: 6px 11px; border-bottom: 1px solid color-mix(in srgb, var(--text) 4%, transparent);
}
.sig-pop .sp-row:last-child { border-bottom: none; }
.sig-pop .sp-arrow { font-size: 10px; line-height: 1.4; }
.sig-pop .sp-row.bull .sp-arrow, .sig-pop .sp-row.bull .sp-label { color: var(--green-soft); }
.sig-pop .sp-row.bear .sp-arrow, .sig-pop .sp-row.bear .sp-label { color: var(--red-soft); }
.sig-pop .sp-row.neu  .sp-arrow, .sig-pop .sp-row.neu  .sp-label { color: var(--muted); }
.sig-pop .sp-label { font-weight: 700; font-size: 11px; }
.sig-pop .sp-note  { color: var(--text); opacity: 0.8; font-size: 11px; line-height: 1.35; }
.sig-pop .sp-empty { padding: 12px; color: var(--muted); text-align: center; }

/* Composite verdict card — detail page */
#composite-panel .cmp-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--border); margin-bottom: 8px;
}
#composite-panel .cmp-rating { font-size: 16px; font-weight: 800; letter-spacing: 0.6px; }
#composite-panel .cmp-score  { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
#composite-panel .cmp-meta   { color: var(--muted); font-size: 12px; margin-left: auto; }
#composite-panel .cmp-head.cmp-buy   { border-color: color-mix(in srgb, var(--green) 40%, transparent); }
#composite-panel .cmp-head.cmp-buy   .cmp-rating, #composite-panel .cmp-head.cmp-buy   .cmp-score { color: var(--green-soft); }
#composite-panel .cmp-head.cmp-sbuy  { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
#composite-panel .cmp-head.cmp-sbuy  .cmp-rating, #composite-panel .cmp-head.cmp-sbuy  .cmp-score { color: var(--green); }
#composite-panel .cmp-head.cmp-sell  { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
#composite-panel .cmp-head.cmp-sell  .cmp-rating, #composite-panel .cmp-head.cmp-sell  .cmp-score { color: var(--red-soft); }
#composite-panel .cmp-head.cmp-ssell { border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
#composite-panel .cmp-head.cmp-ssell .cmp-rating, #composite-panel .cmp-head.cmp-ssell .cmp-score { color: var(--red); }
#composite-panel .cmp-head.cmp-neu   .cmp-rating { color: var(--muted); }
#composite-panel .cmp-rows { display: flex; flex-direction: column; gap: 1px; }
#composite-panel .cmp-row {
  display: grid; grid-template-columns: 16px 130px 1fr; gap: 8px; align-items: start;
  padding: 6px 12px; background: var(--panel); border: 1px solid var(--border);
}
#composite-panel .cmp-arrow { font-size: 11px; line-height: 1.4; }
#composite-panel .cmp-row.bull .cmp-arrow, #composite-panel .cmp-row.bull .cmp-label { color: var(--green-soft); }
#composite-panel .cmp-row.bear .cmp-arrow, #composite-panel .cmp-row.bear .cmp-label { color: var(--red-soft); }
#composite-panel .cmp-row.neu  .cmp-arrow, #composite-panel .cmp-row.neu  .cmp-label { color: var(--muted); }
#composite-panel .cmp-label { font-weight: 700; font-size: 12px; }
#composite-panel .cmp-note  { color: var(--text); opacity: 0.82; font-size: 12px; line-height: 1.4; }

/* Composite v2 — factor summary chips (grid popover + detail card) */
.sig-pop .sp-factors, #composite-panel .cmp-factors {
  display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 11px;
  border-bottom: 1px solid var(--border);
}
.sp-factor, .cmp-factor {
  font-size: 10px; padding: 2px 6px; border: 1px solid var(--border);
  background: var(--panel); letter-spacing: 0.2px; white-space: nowrap;
}
.sp-factor.bull, .cmp-factor.bull { color: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.sp-factor.bear, .cmp-factor.bear { color: var(--red-soft);   border-color: color-mix(in srgb, var(--red) 30%, transparent); }
#composite-panel .cmp-factor b { font-variant-numeric: tabular-nums; }
#composite-panel .cmp-group-h {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--muted); padding: 8px 12px 3px; font-weight: 700;
}

/* Calibration nav link in the toolbar */
.cal-link {
  color: var(--muted); font-size: 12px; text-decoration: none;
  padding: 6px 10px; border: 1px solid var(--border); white-space: nowrap;
  letter-spacing: 0.3px; transition: color .15s, border-color .15s;
}
.cal-link:hover { color: var(--text); border-color: var(--border-2); }

/* --- Market Structure: Ichimoku table, liquidation map -------------------- */
.ich-panel { margin-top: 14px; }
.ich-title { font-size: 11px; margin-bottom: 6px; }
.ich-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ich-table th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 10px;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 8px 4px 0; border-bottom: 1px solid var(--border);
}
.ich-table td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--border); }
.ich-table td.ich-tf { color: var(--text); font-weight: 600; }

.liqmap-panel { margin-top: 16px; }
.liq-flow { font-size: 12px; margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.liq-title {
  font-size: 12px; color: var(--text); font-weight: 600;
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.liq-badge {
  font-size: 9px; font-weight: 600; letter-spacing: .05em;
  color: var(--yellow); border: 1px solid var(--yellow); background: color-mix(in srgb, var(--yellow) 12%, transparent);
  padding: 2px 6px; border-radius: var(--radius); text-transform: uppercase;
}
.liq-note { font-size: 10px; margin-bottom: 8px; line-height: 1.4; }
.liq-magnets { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; margin-bottom: 10px; }
.liq-map { display: flex; flex-direction: column; gap: 2px; }
.liq-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.liq-px   { width: 90px; text-align: right; color: var(--text-dim); flex: 0 0 auto; }
.liq-dist { width: 56px; text-align: right; flex: 0 0 auto; }
.liq-bar-wrap { flex: 1 1 auto; height: 10px; background: var(--panel-2); min-width: 40px; }
.liq-bar { display: block; height: 100%; }
.liq-bar.long  { background: var(--red-soft); }
.liq-bar.short { background: var(--green-soft); }
.liq-amt { width: 72px; text-align: right; flex: 0 0 auto; }

@media (max-width: 720px) {
  .ich-table { font-size: 11px; }
  .liq-px { width: 72px; } .liq-amt { width: 60px; }
}

/* --- Coin newswire (detail page) -----------------------------------------
 * Same language as the main-page wire: wholly greyscale, no tier rail, no
 * sentiment badge, headline in the display serif, attribution at the foot.
 * A per-token page needs no coin logo on each row — every story is about the
 * token you are already looking at. */
#news { display: flex; flex-direction: column; gap: 0; }
.nx-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 11px 14px 12px;
  text-decoration: none;
  border: 1px solid var(--border); border-top: none;
  background: var(--panel); transition: background .13s;
  /* An <a> would otherwise inherit the global link accent and colour any bare
     text inside it. Pinned in both states so the list stays greyscale. */
  color: var(--text-dim);
}
.nx-item:first-child { border-top: 1px solid var(--border); }
.nx-item:hover, .nx-item:focus { color: var(--text-dim); }
.nx-item:hover { background: var(--panel-2); text-decoration: none; }

.nx-ttl {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600; line-height: 1.26;
  letter-spacing: -0.01em; color: var(--text);
}
.nx-sum {
  font-size: 12.5px; line-height: 1.4; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nx-foot { display: flex; align-items: center; gap: 8px; }
.nx-src {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  font-family: var(--font-ui); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.1px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Publisher masthead, desaturated to hold the greyscale rule. */
.nx-srcmark {
  width: 14px; height: 14px; flex-shrink: 0; display: block;
  object-fit: contain; filter: grayscale(1) contrast(1.05); opacity: 0.9;
}
.nx-time {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--muted); margin-left: auto; flex-shrink: 0;
  letter-spacing: 0.3px; padding-left: 8px;
}


/* ==========================================================================
   Term-structure charts — RSI / Stoch RSI across all timeframes on one axis
   ========================================================================== */
.tc-wrap { width: 100%; }
.tc-svg {
  display: block; width: 100%; height: 190px;
  /* preserveAspectRatio="none" stretches the drawing to the panel width; the
     stroke widths below are set in the 760-unit viewBox space, so they stay
     visually even once stretched. */
}
.tc-band { opacity: 1; }
.tc-band-ob { fill: color-mix(in srgb, var(--red) 9%, transparent); }
.tc-band-os { fill: color-mix(in srgb, var(--green) 9%, transparent); }
.tc-grid { stroke: var(--border); stroke-width: 1; }
.tc-grid-mid { stroke: var(--border-2); }
.tc-ytick {
  font-family: var(--font-mono); font-size: 9px; fill: var(--muted);
  text-anchor: end;
}
.tc-xtick {
  font-family: var(--font-mono); font-size: 10px; fill: var(--text-dim);
  text-anchor: middle; font-weight: 600;
}
.tc-val {
  font-family: var(--font-mono); font-size: 10px; fill: var(--text);
  text-anchor: middle; font-weight: 700;
}
.tc-line { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tc-line-rsi    { stroke: var(--cyan); }
.tc-line-stochk { stroke: var(--cyan); }
.tc-line-stochd { stroke: var(--muted); stroke-dasharray: 4 3; stroke-width: 1.4; }
.tc-dot-rsi, .tc-dot-stochk { fill: var(--cyan); }
.tc-dot-stochd { fill: var(--muted); }

.tc-legend {
  display: flex; gap: 14px; align-items: center;
  margin-top: 2px; font-size: 10.5px; color: var(--muted);
  font-family: var(--font-ui);
}
.tc-key { display: inline-flex; align-items: center; gap: 5px; }
.tc-swatch { width: 12px; height: 2px; display: inline-block; }
.tc-swatch-stochk, .tc-swatch-rsi { background: var(--cyan); }
.tc-swatch-stochd { background: var(--muted); }

/* Only the timeframes actually in a band get called out, so the eye lands on
   what is extended instead of scanning every row. */
.tc-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tc-flag {
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.3px; padding: 3px 7px; line-height: 1;
  border: 1px solid var(--border);
}
.tc-flag.ob   { color: var(--red);   border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.tc-flag.ob2  { color: var(--bg);    background: var(--red);   border-color: var(--red); }
.tc-flag.os   { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.tc-flag.os2  { color: var(--bg);    background: var(--green); border-color: var(--green); }
.tc-flag.none { color: var(--muted); }
.tc-stale { margin-top: 6px; font-size: 10px; color: var(--muted); }

@media (max-width: 720px) { .tc-svg { height: 165px; } }
