/* Barr Trader — dark trading palette. Green is up and gains, red is down and losses (always beside a word or sign),
   blue is interactive. Trader lines use a validated categorical trio (blue, yellow, magenta) that never reads as gain/loss. */
:root {
  --bg: #0d1117; --surface: #161c24; --raised: #1d2530; --sunk: #0f141b;
  --ink: #e6edf3; --ink-2: #a3afbd; --ink-3: #8b97a5; --disabled: #56606c;
  --accent: #5aa2ff; --accent-hover: #8cbcff; --accent-tint: rgba(90,162,255,.14);
  --up: #2fbf71; --up-tint: rgba(47,191,113,.13); --down: #f05a63; --down-tint: rgba(240,90,99,.13);
  --done: var(--up); --done-tint: var(--up-tint);
  --error: var(--down); --error-tint: var(--down-tint); --error-ink: #ffc2c6;
  --warning: #e8a33d; --warning-tint: rgba(232,163,61,.13); --warning-ink: #f6d39c;
  --hairline: rgba(230,237,243,.07); --divider: rgba(230,237,243,.07); --outline: rgba(230,237,243,.14);
  --hero-top: #1b2331; --hero-mid: #171e28; --hero-bottom: #131920; --on-hero: #e6edf3; --on-hero-2: #a3afbd;
  --lift-card: inset 0 0 0 1px rgba(230,237,243,.06);
  --lift-hero: inset 0 0 0 1px rgba(230,237,243,.08);
  --display: "Inter", system-ui, sans-serif; --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  font-family: var(--sans); font-size: 13.5px; line-height: 20px; color: var(--ink);
  background: var(--bg); min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ms { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap;
  font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; font-size: 20px; }
.ms.fill { font-variation-settings: "FILL" 1; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Layout: top bar + centered content */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  padding: 12px max(16px, 2.5vw); background: var(--sunk); border-bottom: 1px solid var(--divider); position: sticky; top: 0; z-index: 5; }
.topbar-left { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wordmark { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); }
.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.nav a:hover { background: rgba(230,237,243,.05); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--raised); color: var(--ink); font-weight: 600; }
.tag-paper { font-size: 12px; color: var(--ink-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--outline);
  padding: 5px 10px; border-radius: 6px; cursor: help; }
.countdown { font-size: 12.5px; color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px rgba(90,162,255,.4);
  padding: 5px 10px; border-radius: 6px; white-space: nowrap; }
.countdown b { color: var(--accent); font-weight: 600; }
.main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px max(16px, 2.5vw) 48px; box-sizing: border-box; }
.wrap { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 640px) { .topbar { position: static; } .topbar-left { gap: 10px; } .main { padding-top: 16px; } }

/* Type */
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-3); margin: 0; line-height: 1.2; }
.page-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.caption { font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.big { font-family: var(--mono); font-weight: 600; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lede { margin: 0; max-width: 64ch; color: var(--ink-2); }

/* Page head */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head-left { display: flex; flex-direction: column; gap: 6px; }
.head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 100%; }

/* Grid of primary + rail */
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.primary { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.rail { flex: 1 1 300px; max-width: 376px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 820px) { .rail { max-width: none; } }

/* Sheets */
.sheet { border-radius: 12px; background: var(--surface); box-shadow: var(--lift-card); min-width: 0; }
.sheet-head { padding: 18px 20px 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sheet-body { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 20px; border-top: 1px solid var(--divider); }
.row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.row.highlight { background: var(--raised); }
.money-up { color: var(--done); font-weight: 700; }
.money-down { color: var(--error); font-weight: 700; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; line-height: 16px; padding: 0 7px; margin-right: 6px; border-radius: 999px; vertical-align: 1px; }
.tag-cron { background: rgba(57,135,229,.18); color: #8fbaf0; }
.tag-realtime { background: rgba(255,138,31,.18); color: #ffb36b; }
.tag-selective { background: rgba(255,92,138,.18); color: #ff9cb9; }
.tag-v2 { background: rgba(237,125,49,.18); color: #f4a46e; }
.tag-v3 { background: rgba(160,122,82,.22); color: #cfae8c; }
.tag-v6 { background: rgba(232,212,77,.18); color: #efe08a; }
.tag-v7 { background: rgba(242,242,242,.16); color: #ffffff; }
.tag-v8 { background: rgba(155,225,93,.18); color: #bdeb94; }
.tag-v9 { background: rgba(201,162,39,.20); color: #e3c565; }
.tag-fairvalue { background: rgba(31,162,184,.18); color: #6fcbdb; }
.chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); white-space: nowrap; }
.chip-strong { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--raised);
  color: var(--ink); font-size: 12px; font-weight: 700; box-shadow: inset 0 0 0 1px var(--outline); white-space: nowrap; }
.chip-strong.side-up { color: var(--up); background: var(--up-tint); box-shadow: inset 0 0 0 1px rgba(47,191,113,.4); }
.chip-strong.side-down { color: var(--down); background: var(--down-tint); box-shadow: inset 0 0 0 1px rgba(240,90,99,.4); }
.up-word { color: var(--up); }
.down-word { color: var(--down); }
.chip-strong .ms { font-size: 16px; }

/* Ink hero */
.hero { border-radius: 12px; padding: 26px 28px; color: var(--on-hero);
  background: linear-gradient(158deg, var(--hero-top) 0%, var(--hero-mid) 56%, var(--hero-bottom) 100%);
  box-shadow: var(--lift-hero); display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between; }
.hero .eyebrow { color: var(--on-hero-2); }
.hero-sub { color: var(--on-hero-2); }
.tip-time { display: block; font-size: 11px; color: var(--ink-2); margin-bottom: 2px; }
.tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tip-row i { height: 8px; width: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
@media (max-width: 520px) { .hero { padding: 20px; } }

/* Stat strip */

/* Definition grid (rules) */
.deflist { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; font-size: 13px; line-height: 18px; margin: 0; }
.deflist dt { color: var(--ink-3); }
.deflist dd { margin: 0; }
.btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--raised); box-shadow: inset 0 0 0 1px var(--outline); border: 0; cursor: pointer; font-family: var(--sans); }
.btn:hover { color: var(--accent-hover); box-shadow: inset 0 0 0 1px rgba(230,237,243,.24); }
.btn-primary { background: var(--accent); color: var(--bg); box-shadow: none; min-height: 44px; padding: 0 18px; font-size: 14px; }
.btn-primary:hover { background: var(--accent-hover); color: var(--bg); }

/* Research charts (HTML bars) */
.months { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.month { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.month .up { height: 150px; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.month .down { height: 50px; width: 100%; border-top: 1px solid rgba(230,237,243,.16); }
.bar-up { border-radius: 6px 6px 0 0; background: var(--up); opacity: .8; }
.bar-up.peak { opacity: 1; }
.bar-down { border-radius: 0 0 6px 6px; background: var(--down); opacity: .85; }
.calib { display: flex; flex-direction: column; gap: 8px; }
.calib-row { display: grid; grid-template-columns: 76px 1fr 64px; gap: 12px; align-items: center; font-size: 12.5px; }
.calib-track { position: relative; height: 12px; }
.calib-track .zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: rgba(230,237,243,.16); }
.calib-bar { position: absolute; top: 0; height: 12px; }
.calib-bar.neg { right: 50%; background: var(--down); opacity: .85; border-radius: 4px 0 0 4px; }
.calib-bar.pos { left: 50%; background: var(--up); border-radius: 0 4px 4px 0; }
.calib-row .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Bets table */
.table-wrap { overflow-x: auto; }
table.bets { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.bets th { text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-3); padding: 10px 20px; }
table.bets td { padding: 12px 20px; border-top: 1px solid var(--divider); white-space: nowrap; }
table.bets td.r, table.bets th.r { text-align: right; }

/* States */
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; font-size: 13px; }
.banner.warn { background: var(--warning-tint); color: var(--warning-ink); }
.banner.warn .ms { color: var(--warning); }
.banner.err { background: var(--error-tint); color: var(--error-ink); }
.banner.err .ms { color: var(--error); }
.empty { padding: 18px 20px; font-style: italic; color: var(--ink-3); border-top: 1px solid var(--divider); }
.skel { background: linear-gradient(90deg, var(--surface) 0%, var(--raised) 50%, var(--surface) 100%); background-size: 200% 100%;
  border-radius: 8px; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* Passcode gate */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate form { width: min(380px, 100%); background: var(--surface); border-radius: 20px; box-shadow: var(--lift-card); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.gate label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.gate input { width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--outline); background: var(--sunk); font: inherit; font-size: 15px; color: var(--ink); }
.gate input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gate .err { color: var(--error); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }

/* Tooltip */
.tip { position: absolute; pointer-events: none; background: var(--raised); color: var(--ink); border-radius: 10px; padding: 6px 10px;
  font-size: 11.5px; line-height: 16px; box-shadow: inset 0 0 0 1px var(--outline), 0 10px 28px rgba(0,0,0,.5); white-space: nowrap; z-index: 2; }
.tip b { font-weight: 700; }
[hidden] { display: none !important; }

/* trader toggle and comparison */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunk); gap: 2px; box-shadow: inset 0 0 0 1px var(--hairline); }
.seg-btn { border: 0; background: transparent; font: 600 12.5px/1 var(--sans); color: var(--ink-2); padding: 8px 12px;
  border-radius: 999px; cursor: pointer; min-height: 32px; }
.seg-btn[aria-selected="true"], .seg-btn[aria-pressed="true"], .seg-btn[aria-current="page"] { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--outline); }
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.compare td, table.compare th { padding: 8px 0 8px 8px; white-space: nowrap; }
table.compare td:first-child, table.compare th:first-child { padding-left: 0; }
table.compare th { text-transform: none; letter-spacing: 0; font-size: 11.5px; }
table.compare td:first-child { color: var(--ink-2); }

/* price charts (one per market) */
.pc-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.pc-block { border-top: 1px solid var(--divider); box-shadow: inset 1px 0 0 var(--divider); min-width: 0; padding-bottom: 14px; }
.pc-head { display: flex; flex-direction: column; gap: 2px; padding: 12px 20px 6px; }
.pc-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.pc-head.highlight { background: var(--raised); }
.pc-readout { font-size: 13.5px; }
.pc-readout.hovering { color: var(--ink) !important; font-weight: 600; }
.pchart { position: relative; height: 96px; margin: 6px 52px 4px 20px; touch-action: pan-y; cursor: crosshair; }
.pchart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pc-band.up { fill: var(--up-tint); }
.pc-band.down { fill: var(--down-tint); }
.pc-grid { stroke: var(--hairline); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pc-mid { stroke: rgba(230,237,243,.2); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.pc-decide { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 4 4; }
.pc-spread { fill: var(--accent); opacity: .22; }
.pc-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.pc-guide { stroke: var(--ink-2); stroke-width: 1; }
.pc-tick { position: absolute; left: calc(100% + 8px); transform: translateY(-50%); font-size: 10.5px; line-height: 1; color: var(--ink-3);
  font-variant-numeric: tabular-nums; pointer-events: none; }
.pc-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.pc-time { position: absolute; top: -16px; transform: translateX(-50%); font-size: 10.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); padding: 0 4px; border-radius: 4px; pointer-events: none; }
.pc-foot { border-top: 1px solid var(--divider); padding: 12px 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.pc-axis { position: relative; height: 16px; margin: 0 52px 0 20px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pc-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.pc-axis span.start { transform: none; }
.pc-axis span.end { transform: translateX(-100%); font-weight: 600; color: var(--ink-2); }
.pc-axis span.decide { font-weight: 600; color: var(--ink-2); }
.pc-dot.live { background: var(--accent); }
.pc-foot .caption { margin: 0; max-width: 80ch; }
@media (max-width: 520px) { .pchart { margin-right: 40px; } .pc-axis { margin-right: 40px; } .pc-cols { grid-template-columns: 1fr; } .pc-tick { left: calc(100% + 6px); } }

/* overview: equity, edge, numbers, blotter */
.ov-top { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.ov-top > .sheet { display: flex; flex-direction: column; }
.ov-equity { flex: 999 1 560px; min-width: 0; }
.ov-edge { flex: 1 1 320px; min-width: 0; }
.eq-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 0 20px; }
.eq-card { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--sunk); }
button.eq-card { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: opacity .15s; }
button.eq-card:hover { background: var(--raised); }
button.eq-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.eq-card[aria-pressed="false"] { opacity: .4; }
button.eq-card[aria-pressed="false"] .val { text-decoration: line-through; text-decoration-thickness: 1px; }
.eq-lwc { position: absolute; inset: 0; }
.eq-chart.lw { padding-right: 12px; }
.eq-chart.lw .eq-plot { min-height: 240px; touch-action: pan-y; }
.eq-hint { margin: 0; padding: 0 20px 16px; }
.eq-card .name { font-size: 12px; color: var(--ink-2); }
.eq-card .lineage { font-size: 11px; line-height: 1.3; color: var(--ink-3); }
.eq-card .val { font-size: 22px; font-weight: 600; }
.eq-card .chg { font-size: 12px; }
.eq-chart { flex: 1; display: flex; flex-direction: column; padding: 18px 64px 18px 20px; }
.eq-plot { position: relative; flex: 1; min-height: 160px; }
.eq-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.eq-plot .tip { top: -8px; }
.eq-ylab { position: absolute; left: calc(100% + 10px); transform: translateY(-50%); font-size: 11px; color: var(--ink-3); }
.seg.scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg.scroll .seg-btn { white-space: nowrap; }
.seg.small .seg-btn { padding: 6px 10px; min-height: 30px; font-size: 12px; }
.edge-body { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.edge-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.edge-big .num { font-size: 36px; font-weight: 600; line-height: 1.1; }
.edge-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 12.5px; }
.edge-rows span:nth-child(odd) { color: var(--ink-2); font-family: var(--sans); }
.edge-rows span:nth-child(even) { text-align: right; }
.edge-bar { position: relative; height: 40px; margin-bottom: 12px; }
.edge-bar .track { position: absolute; left: 0; right: 0; top: 19px; height: 2px; background: var(--raised); }
.edge-bar .zero { position: absolute; left: 50%; top: 6px; width: 1px; height: 28px; background: rgba(230,237,243,.4); }
.edge-bar .band { position: absolute; top: 13px; height: 14px; border-radius: 4px; background: rgba(90,162,255,.22); box-shadow: inset 0 0 0 1px rgba(90,162,255,.5); }
.edge-bar .mark { position: absolute; top: 12px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; }
.edge-bar .lab { position: absolute; bottom: -14px; font-size: 10.5px; color: var(--ink-3); }
.edge-note { margin: 0; font-size: 12.5px; line-height: 18px; color: var(--ink-2); }
.meter { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.meter > div { height: 6px; border-radius: 3px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border-radius: 12px; box-shadow: var(--lift-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 12px; color: var(--ink-2); }
.kpi .val { font-size: 24px; font-weight: 600; }
.kpi .sub { font-size: 12px; color: var(--ink-3); }
.money-up, .up-word { color: var(--up); }
.money-down, .down-word { color: var(--down); }
table.blotter { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.blotter th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 16px; white-space: nowrap; }
table.blotter td { padding: 11px 16px; border-top: 1px solid var(--divider); white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.blotter .r { text-align: right; }
table.blotter .tag { font-family: var(--sans); margin: 0; border-radius: 4px; }
.st-open { color: var(--accent); }
.st-stop { color: var(--warning); }
.pc-entry { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.pc-entry.up { background: var(--up); }
.pc-entry.down { background: var(--down); }
.pc-stop { stroke: var(--down); stroke-width: 1; stroke-dasharray: 2 3; opacity: .75; }
.pc-stop-lab { position: absolute; right: 4px; transform: translateY(-120%); font-size: 10px; color: var(--down); pointer-events: none; }
.chip-strong.side-up .ms, .chip-strong.side-down .ms { color: inherit; }

a.seg-btn { display: inline-flex; align-items: center; text-decoration: none; }
a.seg-btn:hover { color: var(--ink); }

/* research: what we learned */
.pm-hero { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 20px; }
.pm-title { display: flex; flex-direction: column; gap: 8px; max-width: 72ch; }
.pm-h { margin: 0; font-family: var(--display); font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.pm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.pm-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; background: rgba(13,17,23,.55); }
.pm-stat .label { font-size: 12px; color: var(--on-hero-2); }
.pm-stat .val { font-size: 19px; font-weight: 600; }
.reasons { margin: 0; padding: 0 20px 18px 40px; display: flex; flex-direction: column; gap: 12px; color: var(--ink-2); max-width: 80ch; }
.reasons b { color: var(--ink); font-weight: 600; }
.reasons.tight { padding: 0 0 0 20px; gap: 8px; }
.points { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); font-size: 13px; line-height: 19px; }
.section-title { margin: 12px 0 0; font-family: var(--display); font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.findings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 20px; }
.finding .sheet-head { padding-bottom: 8px; }
.finding .lede { font-size: 13px; line-height: 19px; }
table.ftable { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 17px; }
table.ftable th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 6px 10px 6px 0; vertical-align: bottom; }
table.ftable td { padding: 8px 10px 8px 0; border-top: 1px solid var(--divider); color: var(--ink-2); vertical-align: top; }
table.ftable td:first-child { color: var(--ink); }
table.ftable .r { text-align: right; white-space: nowrap; }
table.ftable th:last-child, table.ftable td:last-child { padding-right: 0; }
table.ftable tr.strong td { color: var(--ink); font-weight: 600; background: var(--raised); }
.sheet > .table-wrap > table.ftable { margin: 0 20px 14px; width: calc(100% - 40px); }
@media (max-width: 520px) { .reasons { padding-left: 36px; padding-right: 16px; } .pm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tag-real { background: rgba(143,122,229,.18); color: #b7a9f0; }

/* compare: the bot against holding SPY and the coins */
.cmp-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px; }
.cmp-key { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 0; border-radius: 999px;
  background: var(--sunk); color: var(--ink); font: 500 12.5px/1 var(--sans); cursor: pointer; box-shadow: inset 0 0 0 1px var(--hairline); }
.cmp-key i, .cmp-name i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.cmp-key b { font-weight: 600; font-size: 12px; }
.cmp-key[aria-pressed="false"] { opacity: .45; }
.cmp-key[aria-pressed="false"] b { visibility: hidden; }
.cmp-chart .eq-plot { min-height: 220px; }
.cmp-axis { display: flex; justify-content: space-between; margin-top: 8px; }
.cmp-name { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
@media (max-width: 520px) { .cmp-axis span:nth-child(2):not(:last-child) { display: none; } }
table.board .tag { white-space: nowrap; }

/* Real money at a glance (Overview) */
.rm-card.on { box-shadow: var(--lift-card), inset 3px 0 0 var(--down); }
.rm-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px; padding: 0 20px; }
.rm-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--sunk); min-width: 0; }
.rm-stat .label, .tc-cell .label { font-size: 11.5px; color: var(--ink-2); }
.rm-stat .val { font-size: 22px; font-weight: 600; line-height: 1.25; }
.rm-stat .sub, .tc-cell .sub { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.rm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px 16px; }
.rm-foot .btn { align-self: center; }

/* Daily P&L bars */
.dp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 20px 10px; font-size: 12px; color: var(--ink-2); }
.dp-legend b { margin-left: 4px; font-weight: 600; }
.dp-chart { position: relative; display: flex; gap: 8px; padding: 6px 20px 12px; }
.dp-axis { position: relative; width: 52px; flex: none; font-size: 10.5px; color: var(--ink-3); }
.dp-axis span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.dp-axis span:first-child { top: 0; }
.dp-days { flex: 1; min-width: 0; display: flex; gap: 4px; }
.dp-day { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 6px; border-radius: 6px; padding: 0 2px; outline-offset: 0; }
.dp-day:hover, .dp-day:focus-visible { background: rgba(230,237,243,.04); }
.dp-bars { position: relative; display: flex; justify-content: center; gap: 2px; }
.dp-zero { position: absolute; left: 0; right: 0; height: 1px; background: rgba(230,237,243,.25); }
.dp-slot { position: relative; flex: 1 1 0; max-width: 12px; }
.dp-bar { position: absolute; left: 0; right: 0; display: block; border-radius: 2px; }
.dp-lab { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: clip; font-size: 10.5px; }
.dp-chart .tip { top: 0; }

/* Traders page */
.tc-grid-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; }
.tc { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 14px; }
.tc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tc-title { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tc-title .tag { font-size: 12px; line-height: 20px; padding: 0 9px; }
.tc-rule { margin: 0; font-size: 12.5px; line-height: 18px; color: var(--ink-2); }
.tc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tc-cell { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; background: var(--sunk); min-width: 0; }
.tc-cell .val { font-size: 17px; font-weight: 600; line-height: 1.3; }
.tc-why { margin: 0; font-size: 12.5px; line-height: 18px; color: var(--ink-2); }
.tc-foot { display: flex; justify-content: flex-end; font-size: 12.5px; }
.chip-mute { background: var(--raised); color: var(--ink-3); }
.retired-box { border-radius: 12px; background: var(--surface); box-shadow: var(--lift-card); padding: 0 16px; }
.retired-box > summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 52px; cursor: pointer; list-style: none; padding: 0 4px; }
.retired-box > summary::-webkit-details-marker { display: none; }
.retired-box > summary::before { content: "chevron_right"; font-family: "Material Symbols Rounded"; font-size: 20px; color: var(--ink-3); transition: transform .15s; }
.retired-box[open] > summary::before { transform: rotate(90deg); }
.retired-box[open] { padding-bottom: 16px; }
.retired-box .tc { background: var(--sunk); }
.retired-box .tc-cell { background: var(--surface); }

/* Bets picker */
.bets-pick { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.seg-lab { align-self: center; padding: 0 8px 0 10px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

/* Research home and crumbs */
.crumb { display: flex; flex-direction: column; gap: 8px; margin-bottom: -6px; }
.crumb-top { display: flex; align-items: center; gap: 6px; }
.crumb-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.crumb-back .ms { font-size: 18px; }
.crumb .seg { align-self: flex-start; }
.rg { display: flex; flex-direction: column; gap: 12px; }
.rg-head { display: flex; flex-direction: column; gap: 2px; }
.rg-head .caption { margin: 0; font-size: 12.5px; }
.rg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.rg-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; background: var(--surface); box-shadow: var(--lift-card);
  color: var(--ink); font-weight: 400; }
a.rg-card:hover { background: var(--raised); color: var(--ink); }
.rg-card p { margin: 0; font-size: 12.5px; line-height: 18px; color: var(--ink-2); }
.rg-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rg-card.soon { background: transparent; box-shadow: inset 0 0 0 1px var(--outline); box-shadow: inset 0 0 0 1px var(--hairline); border: 1px dashed var(--outline); }
@media (max-width: 520px) { .dp-lab { overflow: visible; } .dp-day:nth-child(even):not(:last-child) .dp-lab, .dp-day:nth-last-child(2) .dp-lab { visibility: hidden; } .dp-axis { width: 44px; } .dp-chart { padding-left: 12px; padding-right: 12px; } }

/* "How to read this" notes: open on wide screens (no toggle), folded on phones */
.explain > summary { display: none; }
.sheet-foot { padding: 0 20px 16px; }
.pc-foot .explain-body, .sheet-foot .explain-body { display: flex; flex-direction: column; gap: 10px; }
.edge-body .explain-body { display: flex; flex-direction: column; gap: 14px; }

/* Phones: one compact column. Secondary details fold away, tables fit the screen. */
@media (max-width: 640px) {
  body { font-size: 13px; }
  .main { padding: 12px 12px 32px; }
  .wrap { gap: 14px; }
  .page-title { font-size: 24px; }
  .lede { font-size: 13px; line-height: 19px; }

  /* top bar: wordmark and the round clock on one line, tabs full width below */
  .topbar { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 10px 12px 8px; }
  .topbar-left { display: contents; }
  .topbar-right { grid-column: 2; grid-row: 1; flex-wrap: nowrap; gap: 6px; }
  .topbar .nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
  .nav a { justify-content: center; min-height: 34px; padding: 0 4px; font-size: 13.5px; }
  .tag-paper { display: none; }
  .tag-paper[style*="--down"] { display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .countdown { font-size: 11.5px; padding: 4px 8px; }

  /* sheets */
  .sheet-head { padding: 14px 14px 8px; gap: 8px; }
  .sheet-body { padding: 0 14px 14px; }
  .sheet-foot { padding: 0 14px 12px; }
  .sheet-head .seg { max-width: 100%; }
  .seg.scroll, .sheet-head .seg { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .seg.scroll::-webkit-scrollbar, .sheet-head .seg::-webkit-scrollbar { display: none; }
  .seg-btn { white-space: nowrap; flex: none; }
  .explain > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; list-style: none;
    font-size: 12px; font-weight: 600; color: var(--ink-3); }
  .explain > summary::-webkit-details-marker { display: none; }
  .explain > summary .ms { font-size: 16px; }
  .explain[open] > summary { margin-bottom: 4px; }

  /* real money card: four small tiles */
  .rm-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 14px; }
  .rm-stat { padding: 8px 10px; }
  .rm-stat .label, .rm-stat .sub { font-size: 11px; line-height: 1.3; }
  .rm-stat .val { font-size: 18px; }
  .rm-foot { padding: 10px 14px 12px; }

  /* equity: two cards a row, the one-line rule dropped (it's on Traders) */
  .eq-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 14px; }
  .eq-card { padding: 8px 10px; }
  .eq-card .lineage { display: none; }
  .eq-card .name { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .eq-card .val { font-size: 17px; }
  .eq-card .chg { font-size: 11px; }
  .eq-chart { padding: 14px 52px 14px 14px; }
  .eq-plot { min-height: 130px; }
  .eq-chart.lw { padding-right: 8px; }
  .eq-chart.lw .eq-plot { min-height: 210px; }
  .eq-hint { padding: 0 14px 12px; }

  /* is the edge real? */
  .edge-body { padding: 0 14px 14px; gap: 12px; }
  .edge-big .num { font-size: 30px; }

  /* leaderboard: the ranked column only */
  .sheet > .table-wrap > table.ftable { margin: 0 14px 10px; width: calc(100% - 28px); }
  table.board .c-opt { display: none; }
  table.board.sort-profit_factor .c-pf, table.board.sort-max_drawdown .c-dd { display: table-cell; }
  table.board.sort-profit_factor .c-bets, table.board.sort-max_drawdown .c-bets { display: none; }
  table.board td, table.board th { padding-right: 6px; }

  /* this round: charts only where something's in range or bought */
  .pc-head { padding: 10px 14px 4px; }
  .pc-block { padding-bottom: 10px; }
  .pc-block.quiet { padding-bottom: 0; }
  .pc-block.quiet .pc-head { padding-bottom: 10px; }
  .pc-block.quiet .pchart, .pc-block.quiet .pc-axis { display: none; }
  .pchart { height: 72px; margin-left: 14px; }
  .pc-axis { margin-left: 14px; }
  .pc-foot { padding: 8px 14px 10px; }
  .pc-title .chip-strong { height: 26px; font-size: 11.5px; padding: 0 8px; }

  /* bets: each bet on two lines instead of a nine-column table */
  table.blotter.stack, table.blotter.stack tbody { display: block; }
  table.blotter.stack thead { display: none; }
  table.blotter.stack tr { display: grid; grid-template-columns: 56px 62px minmax(0, 1fr) auto;
    grid-template-areas: "mkt side px pnl" "time trader st st"; gap: 2px 8px; align-items: center;
    padding: 8px 14px; border-top: 1px solid var(--divider); }
  table.blotter.stack .b-mkt { overflow: hidden; text-overflow: ellipsis; }
  table.blotter.stack .b-time { grid-column: 1 / 3; }
  table.blotter.stack:not(.one-trader) tr { grid-template-areas: "mkt side px pnl" "time time trader st"; }
  table.blotter.stack.one-trader tr { grid-template-areas: "mkt side px pnl" "time time st st"; }
  table.blotter.stack td { padding: 0; border: 0; min-width: 0; }
  table.blotter.stack .b-mkt { grid-area: mkt; font-family: var(--sans); font-weight: 600; font-size: 13px; }
  table.blotter.stack .b-side { grid-area: side; }
  table.blotter.stack .b-px { grid-area: px; text-align: left; color: var(--ink-2); }
  table.blotter.stack .b-pnl { grid-area: pnl; font-weight: 600; }
  table.blotter.stack .b-time { grid-area: time; white-space: nowrap; font-size: 11.5px; color: var(--ink-3); }
  table.blotter.stack .b-trader { grid-area: trader; }
  table.blotter.stack.one-trader .b-trader, table.blotter.stack .b-qty, table.blotter.stack .b-cost { display: none; }
  table.blotter.stack .b-st { grid-area: st; justify-self: end; font-family: var(--sans); font-size: 11.5px; color: var(--ink-3);
    overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  table.blotter.stack .b-st.st-open { color: var(--accent); }
  table.blotter.stack .b-st.st-stop { color: var(--warning); }
  table.blotter.stack .tag { font-size: 10px; line-height: 15px; padding: 0 6px; }

  /* real-money orders: time, market, side, signal, fill, slip, status */
  table.blotter.orders th, table.blotter.orders td { padding: 9px 8px; }
  table.blotter.orders th:first-child, table.blotter.orders td:first-child { padding-left: 14px; }
  table.blotter.orders tr > :nth-child(6), table.blotter.orders tr > :nth-child(8), table.blotter.orders tr > :nth-child(9) { display: none; }

  /* trader cards: three small cells a row, rule clipped to two lines */
  .tc-grid-wrap { gap: 12px; }
  .tc { padding: 12px 14px 10px; gap: 8px; }
  .tc-rule { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 17px; }
  .tc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .tc-cell { padding: 6px 8px; }
  .tc-cell .label { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tc-cell .val { font-size: 15px; }
  .tc-cell .sub { font-size: 10.5px; line-height: 1.3; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .label, .kpi .sub { font-size: 11px; }
  .kpi .val { font-size: 18px; }

  /* research home */
  .rg-cards { gap: 8px; }
  .rg-card { padding: 12px 14px; }
}
