:root {
  --bg:#f7f8fa; --panel:#ffffff; --ink:#1a1d21; --muted:#6b7280; --line:#e5e7eb;
  --accent:#2563eb; --good:#16a34a; --warn:#d97706; --bad:#dc2626; --chip:#eef2ff;
  /* section-category hues (validated for CVD + both surfaces; spatial order d-f-w) */
  --cat-d:#2a78d6; --cat-f:#1baf7a; --cat-w:#4a3aa7;
  --tint-d:rgba(42,120,214,.06); --tint-f:rgba(27,175,122,.07); --tint-w:rgba(74,58,167,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0e1116; --panel:#161b22; --ink:#e6edf3; --muted:#9198a1; --line:#2a313a;
          --accent:#4f8cff; --good:#3fb950; --warn:#d29922; --bad:#f85149; --chip:#1c2333;
          --cat-d:#3987e5; --cat-f:#199e70; --cat-w:#9085e9;
          --tint-d:rgba(57,135,229,.10); --tint-f:rgba(25,158,112,.11); --tint-w:rgba(144,133,233,.10); }
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink);
  font:16px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; }
a { color:var(--accent); text-decoration:none; } a:hover { text-decoration:underline; }
.muted { color:var(--muted); font-size:13px; }
.topbar { display:flex; align-items:baseline; gap:16px; flex-wrap:wrap;
  padding:16px 24px; border-bottom:1px solid var(--line); background:var(--panel); }
.topbar h1 { font-size:20px; margin:0; }
.back { font-size:13px; }
main { max-width:1600px; margin:0 auto; padding:24px 28px; }
.lead { color:var(--muted); margin-top:0; }
.table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
table { border-collapse:collapse; width:100%; min-width:760px; }
th, td { text-align:left; padding:13px 16px; border-bottom:1px solid var(--line); white-space:nowrap; vertical-align:middle; }
th { font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); font-weight:600; }
th .sub { text-transform:none; letter-spacing:0; font-weight:400; }
tbody tr:last-child td { border-bottom:none; }
tbody tr:hover { background:var(--chip); }
td.ticker a { font-weight:600; font-size:17px; }
.sub { font-size:13px; color:var(--muted); }
.status { font-size:12px; text-transform:capitalize; color:var(--muted); }
.status-analyzed { color:var(--good); } .status-analysis_failed,.status-scrape_failed { color:var(--bad); }
.report-details { margin-top:8px; }
.report-details > summary { cursor:pointer; user-select:none; padding:10px 14px; border:1px solid var(--line);
  border-radius:8px; background:var(--panel); font-weight:600; font-size:14px;
  display:flex; align-items:center; gap:12px; }
.report-details > summary::-webkit-details-marker { display:none; }
.report-details > summary::before { content:'▸'; color:var(--muted); }
.report-details[open] > summary::before { content:'▾'; }
.report-details[open] > summary { border-bottom-left-radius:0; border-bottom-right-radius:0; }
.report-link { margin-left:auto; font-weight:400; font-size:13px; }
.stars { color:var(--warn); letter-spacing:1px; }
.chip { display:inline-block; padding:2px 8px; border-radius:999px; background:var(--chip);
  font-size:12px; font-weight:600; }
.stance-bullish,.sent-Bullish,.sent-Constructive { color:var(--good); }
.stance-bearish,.sent-Bearish,.sent-Cautious { color:var(--bad); }
.stance-neutral,.sent-Neutral { color:var(--muted); }
.grid { display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.card { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px; }
.card h3 { margin:0 0 8px; font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.big { font-size:26px; font-weight:700; }
.section { margin-top:28px; }
.section h2 { font-size:16px; border-bottom:1px solid var(--line); padding-bottom:6px; }
.take { background:var(--chip); border-left:3px solid var(--accent); padding:10px 14px;
  border-radius:6px; margin:10px 0; }
.kv { display:flex; flex-wrap:wrap; gap:6px 20px; margin:8px 0; }
.kv div { font-size:13px; } .kv b { color:var(--muted); font-weight:600; }
ul.xposts { list-style:none; padding:4px 0 0 0; margin:0; }
ul.xposts li { font-size:13px; padding:4px 0; border-bottom:1px dashed var(--line); }
details > summary { cursor:pointer; }
iframe.report { width:100%; height:75vh; border:1px solid var(--line); background:#fff; display:block; }
.report-details iframe.report { border-top:none; border-radius:0 0 8px 8px; }
.dim { display:inline-block; margin:2px 10px 2px 0; font-size:13px; }
.dim .bar { color:var(--accent); letter-spacing:1px; }
.stancebig { font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
/* --- column-group category coding (identity carried by the labeled header + border, tint is reinforcement) --- */
table.grouped { min-width:1360px; width:100%; }
tr.grouprow th { border-bottom:none; padding-bottom:2px; }
th.gh { font-size:12px; letter-spacing:.06em; color:var(--ink); border-top:3px solid; border-radius:6px 6px 0 0; }
th.gh .sub { text-transform:none; letter-spacing:0; font-weight:400; }
th.gh .dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:baseline; }
th.gh-d { border-top-color:var(--cat-d); background:var(--tint-d); } th.gh-d .dot { background:var(--cat-d); }
th.gh-f { border-top-color:var(--cat-f); background:var(--tint-f); } th.gh-f .dot { background:var(--cat-f); }
th.gh-w { border-top-color:var(--cat-w); background:var(--tint-w); } th.gh-w .dot { background:var(--cat-w); }
td.g-d, th.g-d { background:var(--tint-d); }
td.g-f, th.g-f { background:var(--tint-f); }
td.g-w, th.g-w { background:var(--tint-w); }
tbody tr:hover td { background:var(--chip); }
.cat-key { font-weight:600; padding-left:14px; position:relative; }
.cat-key::before { content:''; position:absolute; left:2px; top:50%; transform:translateY(-50%);
  width:8px; height:8px; border-radius:50%; }
.cat-key-d::before { background:var(--cat-d); } .cat-key-f::before { background:var(--cat-f); }
.cat-key-w::before { background:var(--cat-w); }
.flagchip { display:inline-block; padding:2px 8px; margin-right:4px; border-radius:999px;
  font-size:13px; font-weight:700; background:var(--chip); }
.flagchip.pass { color:var(--good); } .flagchip.warn { color:var(--warn); }
.flagchip.fail { color:var(--bad); }
.drift { color:var(--warn); font-weight:600; }
ul.tight { margin:0; padding-left:18px; } ul.tight li { margin:2px 0; font-size:13px; }

/* ===== at-a-glance home: semantic color coding + two-row ticker blocks ===== */
main.wide { max-width:1720px; }
.legend { margin-left:auto; display:flex; gap:6px; align-items:center; }
.legend .lg { font-size:11px; font-weight:700; padding:1px 7px; border-radius:999px; }
.lg.pos,.pos { color:var(--good); } .lg.neg,.neg { color:var(--bad); }
.lg.neu,.neu { color:var(--warn); } .flat { color:var(--muted); }
.lg.pos { background:rgba(22,163,74,.12); } .lg.neg { background:rgba(220,38,38,.12); }
.lg.neu { background:rgba(217,119,6,.14); }
.livedot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--good);
  vertical-align:middle; box-shadow:0 0 0 3px rgba(22,163,74,.18); }

table.blocks { min-width:1180px; }
table.blocks th { padding:10px 12px; }
table.blocks td { padding:9px 12px; white-space:nowrap; vertical-align:middle; }
/* one <tbody> per ticker groups its two rows: row A (numbers) is borderless, row B (the
   context strip) closes the block; hovering anywhere in the block highlights the whole ticker */
table.blocks tbody { border-bottom:2px solid var(--line); }
tr.rowA td { border-bottom:none; padding-bottom:3px; }
tr.rowB td { padding-top:2px; padding-bottom:11px; border-bottom:none; }
table.blocks tbody:hover td { background:var(--chip); }
.num { font-variant-numeric:tabular-nums; font-weight:600; }
td.c-tk a { font-weight:700; font-size:17px; }
td.c-tk .ex { font-size:11px; }
.etf-badge { display:inline-block; margin-left:6px; padding:1px 5px; border-radius:4px;
  font-size:10px; font-weight:700; letter-spacing:.04em; vertical-align:middle;
  background:var(--chip); color:var(--muted); border:1px solid var(--line); }
/* Always-on broad-ETF cards (one compact card per fund, single row at the top). */
.etfrow { display:flex; gap:10px; flex-wrap:wrap; margin:0 0 18px; }
.etfcard { flex:1 1 0; min-width:150px; display:block; text-decoration:none; color:var(--ink);
  background:var(--panel); border:1px solid var(--line); border-radius:9px; padding:9px 11px 8px;
  transition:border-color .12s, box-shadow .12s; }
.etfcard:hover { border-color:var(--accent); box-shadow:0 1px 6px rgba(0,0,0,.08); }
.etfcard .ec-top { display:flex; align-items:center; gap:2px; margin-bottom:3px; }
.etfcard .ec-tk { font-weight:800; font-size:16px; letter-spacing:.01em; }
.etfcard .ec-top .etf-badge { margin-left:4px; }
.etfcard .livedot { margin-left:auto; }
.etfcard .ec-px { display:flex; align-items:baseline; gap:7px; }
.etfcard .ec-px .px { font-size:19px; }
.etfcard .ec-px .today { font-size:12px; }
.etfcard .ec-rets { display:grid; grid-template-columns:1fr 1fr; gap:2px 10px; font-size:11px;
  color:var(--muted); margin-top:5px; }
.etfcard .ec-rets .num { font-size:11px; }
.etfcard .ec-range { display:flex; align-items:center; gap:6px; margin-top:6px;
  font-size:10px; color:var(--muted); font-variant-numeric:tabular-nums; }
.etfcard .ec-range .rangebar { flex:1; margin-top:0; }
.etfcard .ec-foot { margin-top:6px; font-size:11px; }
.etfcard .ec-foot .num { font-size:12px; }
.px { font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; }
.today { font-size:12px; font-weight:700; margin-left:2px; }
.subpct { font-size:11px; color:var(--muted); font-weight:500; }
/* 52-week range mini-bar */
.range { min-width:120px; }
.rangebar { position:relative; height:5px; border-radius:3px; margin-top:4px;
  background:linear-gradient(90deg,var(--bad),var(--warn),var(--good)); opacity:.55; }
.rangebar .mark { position:absolute; top:-2px; width:2px; height:9px; background:var(--ink); border-radius:1px; }
.rangenums { font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums; }
/* context strip (row B): EMAs + financial flags */
.strip { display:flex; flex-wrap:wrap; gap:6px 16px; align-items:center; white-space:normal; }
.strip .grp { display:inline-flex; align-items:center; gap:5px; }
.strip .lbl { font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); font-weight:700; }
.ema { font-size:12px; font-variant-numeric:tabular-nums; font-weight:600; padding:0 1px; }
.ffchip { font-size:11px; font-weight:700; padding:1px 7px; border-radius:999px; background:var(--chip); }
.ffchip.pass { color:var(--good); } .ffchip.warn { color:var(--warn); } .ffchip.fail { color:var(--bad); }
.updtime { font-size:11px; color:var(--muted); margin-left:auto; }
.stars { color:var(--warn); letter-spacing:1px; white-space:nowrap; }
