/* Event Trader dashboard. Light theme by default; dark via data-theme="dark". Fira Sans/Fira Code */
:root {
  --bg: #020617;
  --surface: #0e1223;
  --surface-2: #151a2e;
  --muted: #1a1e2f;
  --border: #283447;
  --border-strong: #334155;
  --fg: #f8fafc;
  --fg-2: #cbd5e1;
  --fg-muted: #94a3b8;
  --accent: #22c55e;
  --on-accent: #0f172a;
  --long: #22c55e;
  --long-bg: rgba(34, 197, 94, 0.12);
  --short: #f87171;
  --short-bg: rgba(248, 113, 113, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.12);
  --sector: #c084fc;
  --sector-bg: rgba(192, 132, 252, 0.12);
  --ring: #ffffff;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --radius: 10px;
  --radius-sm: 6px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --up: #0fa898;     /* dark-mode chart tokens, CVD-validated vs #0e1223 */
  --down: #ef4444;
  --vwap: #8b5cf6;
  --font: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Fira Code", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
:root:not([data-theme="dark"]) {
  --up: #0d9488;     /* light-mode chart tokens, CVD-validated vs #ffffff */
  --down: #dc2626;
  --vwap: #7c3aed;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --muted: #e2e8f0;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --fg: #0f172a;
  --fg-2: #334155;
  --fg-muted: #475569;
  --accent: #15803d;
  --on-accent: #ffffff;
  --long: #15803d;
  --long-bg: rgba(21, 128, 61, 0.1);
  --short: #b91c1c;
  --short-bg: rgba(185, 28, 28, 0.08);
  --warn: #a16207;
  --warn-bg: rgba(202, 138, 4, 0.12);
  --info: #1d4ed8;
  --info-bg: rgba(29, 78, 216, 0.08);
  --sector: #7e22ce;
  --sector-bg: rgba(126, 34, 206, 0.08);
  --ring: #0f172a;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--info); text-underline-offset: 2px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s3) var(--s5);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: var(--s2); font-weight: 600; font-size: 16px; white-space: nowrap; }
.brand .logo { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.pills { display: flex; gap: var(--s2); flex-wrap: wrap; flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--fg-2); white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-muted); flex: none; }
.dot.ok { background: var(--long); box-shadow: 0 0 0 3px var(--long-bg); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--short); }
.top-actions { display: flex; gap: var(--s2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--fg);
  font: 500 14px var(--font); cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--muted); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon { width: 36px; padding: 0; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: var(--s1); padding: 0 var(--s5); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 14px; border: 0; background: none; cursor: pointer;
  color: var(--fg-muted); font: 500 14px var(--font);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--muted); font: 600 11.5px/18px var(--mono); text-align: center; color: var(--fg-2); }

main { padding: var(--s5); max-width: 1440px; margin: 0 auto; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.side { display: flex; flex-direction: column; gap: var(--s4); position: sticky; top: 76px; }
@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .topbar { flex-wrap: wrap; padding: var(--s3) var(--s4); }
  main { padding: var(--s4); }
  .tabs { padding: 0 var(--s4); }
}

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.panel > header h2 { margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); }
.panel .body { padding: var(--s3) var(--s4); }

/* ---------- feed ---------- */
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.feed-head h1 { margin: 0; font-size: 20px; font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--fg-2);
  font: 500 13px var(--font); cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.feed { display: flex; flex-direction: column; gap: var(--s3); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius); padding: var(--s4);
  animation: in .25s ease-out;
}
.card.k-trade.d-short { border-left-color: var(--short); }
.card.k-trade.d-long { border-left-color: var(--long); }
.card.k-sector { border-left-color: var(--sector); }
.card.k-news { border-left-color: var(--info); }
.card.k-unexplained_move { border-left-color: var(--warn); }
.card.done { opacity: .62; }
@keyframes in { from { opacity: 0; transform: translateY(-4px); } }

.card-top { display: flex; align-items: flex-start; gap: var(--s3); }
.card-title { flex: 1; min-width: 0; }
.card-title h3 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.meta { font-size: 12.5px; color: var(--fg-muted); display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: 2px; }
.sym { font-family: var(--mono); font-weight: 600; font-size: 17px; letter-spacing: .01em; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font: 600 11.5px/18px var(--font); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.tag svg.i { width: 13px; height: 13px; }
.tag.short { color: var(--short); background: var(--short-bg); }
.tag.long { color: var(--long); background: var(--long-bg); }
.tag.news { color: var(--info); background: var(--info-bg); }
.tag.sector { color: var(--sector); background: var(--sector-bg); }
.tag.warn { color: var(--warn); background: var(--warn-bg); }
.tag.neutral { color: var(--fg-2); background: var(--muted); }

.headline { margin: var(--s3) 0 0; color: var(--fg-2); font-size: 14.5px; }
.headline a { color: inherit; }
.reason { margin: 6px 0 0; font-size: 13.5px; color: var(--fg-muted); }

.plan { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; margin-top: var(--s3); background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.plan > div { background: var(--surface-2); padding: 8px 10px; min-width: 0; }
.plan dt { font-size: 11.5px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .05em; }
.plan dd { margin: 2px 0 0; font: 600 15px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan .sl dd { color: var(--short); }
.plan .tg dd { color: var(--long); }
@media (max-width: 640px) { .plan { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.facts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s3); font-size: 13px; color: var(--fg-2); }
.facts b { font-family: var(--mono); font-weight: 600; color: var(--fg); }
ul.notes { margin: var(--s2) 0 0; padding-left: 18px; font-size: 13px; color: var(--fg-muted); }
.banner { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s3); padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); font-size: 13.5px; font-weight: 500; }
.actions { display: flex; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; align-items: center; }
.status-note { font-size: 13px; color: var(--fg-muted); display: inline-flex; gap: 6px; align-items: center; }

.sev { display: inline-flex; gap: 3px; align-items: center; }
.sev i { width: 6px; height: 12px; border-radius: 2px; background: var(--muted); }
.sev i.on { background: var(--warn); }

table.rank { width: 100%; border-collapse: collapse; margin-top: var(--s3); font-size: 13.5px; }
table.rank th { text-align: left; font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.rank td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.rank td.n, table.rank th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.rank tr.top td { background: var(--sector-bg); }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--fg-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty svg.i { width: 28px; height: 28px; margin-bottom: var(--s2); }

/* ---------- side panels ---------- */
.watch { padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
.watch:last-child { border-bottom: 0; }
.watch .row { display: flex; align-items: center; gap: var(--s2); justify-content: space-between; }
.watch p { margin: 2px 0 0; font-size: 12.5px; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src { display: flex; align-items: center; gap: var(--s2); padding: 5px 0; font-size: 13px; }
.src .name { flex: 1; font-family: var(--mono); }
.src .when { color: var(--fg-muted); font-size: 12px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.stat span { display: block; font-size: 11.5px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat b { font: 600 18px var(--mono); }

/* ---------- forms ---------- */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--fg-2); }
input, select, textarea {
  width: 100%; min-height: 38px; padding: 8px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--fg); font: 14px var(--font);
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.hint { font-size: 12px; color: var(--fg-muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s3); }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.form-msg { font-size: 13px; }
.form-msg.err { color: var(--short); }
.form-msg.ok { color: var(--long); }

/* ---------- journal / news ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); }
.tile span { font-size: 12px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .05em; }
.tile b { display: block; font: 600 24px var(--mono); margin-top: 4px; font-variant-numeric: tabular-nums; }
.pos { color: var(--long); }
.neg { color: var(--short); }
.two { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: var(--s5); align-items: start; }
@media (max-width: 1023px) { .two { grid-template-columns: minmax(0, 1fr); } }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; position: sticky; top: 0; background: var(--surface); font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data td.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr:hover td { background: var(--surface-2); }
.news-title { color: var(--fg); text-decoration: none; }
.news-title:hover { text-decoration: underline; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: var(--s4); bottom: var(--s4); z-index: 50; display: flex; flex-direction: column; gap: var(--s2); width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: var(--s3); align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border-strong); border-left: 4px solid var(--info);
  border-radius: var(--radius); padding: var(--s3) var(--s4); box-shadow: var(--shadow);
  animation: toast-in .2s ease-out;
}
.toast.trade.short { border-left-color: var(--short); }
.toast.trade.long { border-left-color: var(--long); }
.toast.sector { border-left-color: var(--sector); }
.toast.unexplained_move { border-left-color: var(--warn); }
.toast .t-body { flex: 1; min-width: 0; }
.toast strong { display: block; font-size: 14px; }
.toast p { margin: 2px 0 0; font-size: 13px; color: var(--fg-muted); }
.toast.out { animation: toast-out .15s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
table.data td:first-child { white-space: nowrap; }

/* multi-source news cards */
div.sources { margin-top: var(--s3); border-top: 1px solid var(--border); padding-top: var(--s2); }
div.sources summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--fg-2); min-height: 28px; display: flex; align-items: center; }
div.sources ul { list-style: none; margin: var(--s1) 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
div.sources li { display: grid; grid-template-columns: 44px minmax(90px, 160px) auto minmax(0, 1fr); gap: var(--s2); align-items: baseline; font-size: 13px; }
div.sources .src-time { color: var(--fg-muted); }
div.sources .src-pub { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
div.sources .src-title { color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
div.sources .src-title a { color: inherit; }
div.sources li > .tag { grid-column: 3; }
div.sources li:not(:first-child) .src-title { grid-column: 3 / 5; }
@media (max-width: 640px) {
  div.sources li { grid-template-columns: 44px minmax(0, 1fr); }
  div.sources .src-title, div.sources li:not(:first-child) .src-title { grid-column: 1 / -1; white-space: normal; }
  div.sources li > .tag { grid-column: auto; }
}
.card.bumped { animation: bump 1.2s ease-out; }
@keyframes bump { 0% { box-shadow: 0 0 0 3px var(--info-bg); } 100% { box-shadow: 0 0 0 0 transparent; } }

div.sources .sources-head { margin: 0; font-size: 13px; font-weight: 500; color: var(--fg-2); }
div.sources details summary { cursor: pointer; font-size: 13px; color: var(--info); min-height: 28px; display: flex; align-items: center; margin-top: 4px; }
a.btn { text-decoration: none; }

table.rank .why { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }

/* ---------- trade chart ---------- */
.chart-wrap { margin-top: var(--s3); }
.chart-legend { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--fg-2); margin-bottom: 4px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 12px; border-radius: 2px; }
.sw-up { border: 1.5px solid var(--up); background: var(--surface); }
.sw-down { background: var(--down); }
.sw-vwap { width: 16px; height: 2px; background: var(--vwap); border-radius: 1px; }
.chart-host { position: relative; width: 100%; min-height: 120px; }
.chart-empty { margin: 0; padding: var(--s5) 0; text-align: center; font-size: 13px; color: var(--fg-muted); }
svg.tchart { display: block; overflow: visible; }
svg.tchart .grid { stroke: var(--border); stroke-width: 1; }
svg.tchart .axis { stroke: var(--border-strong); stroke-width: 1; }
svg.tchart .tick { font: 11px var(--mono); fill: var(--fg-muted); }
svg.tchart .news-label { fill: var(--fg-2); font-family: var(--font); font-weight: 500; }
svg.tchart .news-mark { stroke: var(--fg-muted); stroke-width: 1; stroke-dasharray: 3 3; }
svg.tchart .vol { fill: var(--fg-muted); opacity: .35; }
svg.tchart .c-up .wick, svg.tchart .c-up .body { stroke: var(--up); }
svg.tchart .c-up .body { fill: var(--surface); stroke-width: 1.5; }
svg.tchart .c-down .wick { stroke: var(--down); }
svg.tchart .c-down .body { fill: var(--down); stroke: var(--down); stroke-width: 1; }
svg.tchart .wick { stroke-width: 1; }
svg.tchart .vwap { fill: none; stroke: var(--vwap); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.tchart .lvl { stroke-width: 1.5; }
svg.tchart .lvl-entry { stroke: var(--fg-2); stroke-dasharray: none; stroke-width: 1; }
svg.tchart .lvl-sl { stroke: var(--down); stroke-dasharray: 5 4; }
svg.tchart .lvl-tg { stroke: var(--up); stroke-dasharray: 5 4; }
svg.tchart .lvl-label { font: 600 11.5px var(--mono); fill: var(--fg); }
svg.tchart .last-dot { fill: var(--fg); stroke: var(--surface); stroke-width: 2; }
svg.tchart .cross { stroke: var(--fg-muted); stroke-width: 1; }
svg.tchart .hit { fill: transparent; cursor: crosshair; outline: none; }
svg.tchart .hit:focus-visible { stroke: var(--ring); stroke-width: 1; }
.ctip { position: absolute; z-index: 5; width: 150px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 12px; pointer-events: none; }
.ctip div { display: flex; justify-content: space-between; gap: 8px; }
.ctip div:first-child b { font-family: var(--font); }
.ctip span { color: var(--fg-muted); }
.ctip b { font: 600 12px var(--mono); }
.chart-data summary { cursor: pointer; font-size: 12.5px; color: var(--fg-muted); margin-top: 4px; min-height: 28px; display: flex; align-items: center; }
@media (forced-colors: active) { svg.tchart .c-up .body { fill: Canvas; } }


.paper-line { display: flex; gap: 6px; align-items: flex-start; margin: var(--s2) 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; color: var(--fg-2); }
.paper-line svg.i { width: 15px; height: 15px; margin-top: 2px; color: var(--fg-muted); }

/* ---------- scanner ---------- */
.scan-bar { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--s2); }
.scan-bar .hint { margin: 0; }
.scan-search input { width: 240px; max-width: 100%; }
table.scan th .sort { all: unset; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
table.scan th .sort:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 3px; }
table.scan th[aria-sort="descending"] .sort::after { content: " ↓"; }
table.scan th[aria-sort="ascending"] .sort::after { content: " ↑"; }
table.scan th.n .sort { display: inline-block; text-align: right; }
table.scan tr.scan-row { cursor: pointer; }
table.scan tr.scan-row.hot td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.scan tr.scan-row[aria-expanded="true"] td { background: var(--surface-2); }
table.scan td svg.i { width: 13px; height: 13px; vertical-align: -2px; }
table.scan td .tag + .tag { margin-left: 4px; }
table.scan tr.scan-detail td { padding: 4px 12px 12px; background: var(--surface-2); }
table.scan tr.scan-detail:hover td { background: var(--surface-2); }

/* ---------- backtest ---------- */
.bt-stage { display: flex; justify-content: space-between; font-size: 13px; color: var(--fg-2); margin-bottom: 6px; }
.bt-bar { height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.bt-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
td.bt-note { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); }
table.bt-variants tr.bt-variant { cursor: pointer; }
table.bt-variants tr.bt-variant.current td { background: var(--info-bg); }
table.bt-variants tr.bt-variant.selected td { box-shadow: inset 0 -2px 0 var(--accent); }
table.bt-variants tr.bt-variant.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent), inset 0 -2px 0 var(--accent); }

/* ---------- why is it moving ---------- */
.why-box { display: flex; gap: 8px; align-items: flex-start; margin: var(--s3) 0 0; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; background: var(--surface-2); color: var(--fg-2); }
.why-box svg.i { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.why-box.fresh { background: var(--long-bg); } .why-box.fresh svg.i { color: var(--long); }
.why-box.stale { background: var(--warn-bg); } .why-box.stale svg.i { color: var(--warn); }
.why-box.none svg.i, .why-box.checking svg.i { color: var(--fg-muted); }
.why-cause { margin-top: 4px; }
.why-cause a { color: var(--fg); }

/* ---------- brief ---------- */
.section-h { margin: 0 0 var(--s2); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); }
.brief-bullets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.brief-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.brief-list li { line-height: 1.45; }
.brief-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1023px) { .brief-two { grid-template-columns: minmax(0, 1fr); } }

.replay-banner { position: sticky; top: 61px; z-index: 19; padding: 8px var(--s5); background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: 13.5px; border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }

/* ---------- performance over time ---------- */
.perf-title { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.perf-host { min-height: 0; }
svg.tchart .pbar-up { fill: var(--up); }
svg.tchart .pbar-down { fill: var(--down); }
svg.tchart .perf-val { fill: var(--fg-2); font-weight: 600; }
svg.tchart .perf-line { fill: none; stroke: var(--info); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.tchart .perf-area { fill: var(--info); opacity: .1; }
svg.tchart .perf-dot { fill: var(--info); stroke: var(--surface); stroke-width: 2; }
.panel > header .chips .chip { min-height: 28px; font-size: 12.5px; }
