/* [psi-1] dashboard styles — self-contained, no external assets.
   note: shell files are scanned by the forbidden-ticker canary
   (case-sensitive, word-bounded, includes one-letter tickers), so this
   file and its comments deliberately avoid all-caps standalone words. */

:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #1c1c1c;
  --muted: #6b6b6b;
  --line: #e2e2de;
  --accent: #175fbf;
  --bull: #1a7f37;
  --bear: #b3261e;
  --warn-bg: #fff4d6;
  --warn-ink: #7a5a00;
  --bad-bg: #fdecea;
  --bad-ink: #8a1f14;
  --kept: #175fbf;
  --filtered: #b9b9b3;
  --band: rgba(23, 95, 191, 0.18);
  --box: rgba(23, 95, 191, 0.45);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --panel: #1c1f24;
    --ink: #e8e8e4;
    --muted: #9a9a94;
    --line: #2c3038;
    --accent: #6ea8ff;
    --bull: #4fbf6f;
    --bear: #ff7a6e;
    --warn-bg: #3a3210;
    --warn-ink: #ffd866;
    --bad-bg: #3a1713;
    --bad-ink: #ff9c8f;
    --kept: #6ea8ff;
    --filtered: #4a4e56;
    --band: rgba(110, 168, 255, 0.22);
    --box: rgba(110, 168, 255, 0.5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 system-ui, Roboto, "Helvetica Neue", sans-serif;
}
main { max-width: 1040px; margin: 0 auto; padding: 16px; }

a { color: var(--accent); }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.86em; }

/* ── header ─────────────────────────────────────────────────────────── */
header.top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; margin: 6px 0 4px; }
header.top h1 { font-size: 26px; margin: 0; font-weight: 650; letter-spacing: 0.2px; }
header.top h1 .psi-mark { color: var(--accent); font-weight: 700; }
header.top .sub { color: var(--muted); font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 999px; padding: 3px 11px; font-size: 13px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip.bull .dot { background: var(--bull); }
.chip.bear .dot { background: var(--bear); }
.chip b { font-weight: 600; }

/* ── banners ────────────────────────────────────────────────────────── */
.banner { border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-size: 14px; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); }
.banner.bad { background: var(--bad-bg); color: var(--bad-ink); }
.banner b { font-weight: 650; }

/* ── panels / sections ──────────────────────────────────────────────── */
section.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 18px; margin: 14px 0;
}
section.panel > h2 { margin: 0 0 2px; font-size: 18px; font-weight: 650; }
section.panel > .caliber { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.placeholder {
  border: 1px dashed var(--line); border-radius: 8px;
  color: var(--muted); padding: 22px 16px; text-align: center; font-size: 14px;
}

.viewgrid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.viewgrid .side { min-width: 0; }

figure { margin: 0; min-width: 0; }
figure figcaption { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.chartbox { overflow-x: auto; }
svg.chart { display: block; width: 100%; height: auto; }
svg.chart text { font: 11px system-ui, sans-serif; fill: var(--muted); }
svg.chart .axisline { stroke: var(--line); stroke-width: 1; }
svg.chart .zeroline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
svg.chart [tabindex="0"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* tabs (scheme switch) */
.tabs { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 7px; padding: 4px 12px; font-size: 13px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* stat line under charts */
.statline { font-size: 13px; color: var(--muted); margin-top: 8px; }
.statline b { color: var(--ink); font-weight: 600; }

/* series picker */
details.series { font-size: 13px; margin: 4px 0 10px; }
details.series summary { cursor: pointer; color: var(--muted); }
details.series .roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2px 14px; padding: 8px 2px; }
details.series label { display: flex; gap: 7px; align-items: baseline; cursor: pointer; }
details.series .swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; position: relative; top: 1px; }
details.series .rolechip { color: var(--muted); font-size: 11px; }

/* regime feed */
ul.feed { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
ul.feed li { padding: 3px 0; border-top: 1px solid var(--line); }
ul.feed li:first-child { border-top: 0; }

/* accessible data tables */
details.datatable { margin-top: 10px; font-size: 13px; }
details.datatable summary { cursor: pointer; color: var(--muted); }
details.datatable .scroll { overflow-x: auto; }
details.datatable table { border-collapse: collapse; margin-top: 6px; min-width: 480px; }
details.datatable th, details.datatable td {
  border: 1px solid var(--line); padding: 3px 8px; text-align: right;
  font-variant-numeric: tabular-nums;
}
details.datatable th:first-child, details.datatable td:first-child { text-align: left; }

/* footnotes + footer */
ul.notes { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
footer.meta {
  color: var(--muted); font-size: 12.5px; margin: 18px 0 30px;
  border-top: 1px solid var(--line); padding-top: 10px;
}
footer.meta .row { margin: 2px 0; overflow-wrap: anywhere; }

/* tooltip */
#tip {
  position: fixed; z-index: 30; max-width: 320px; pointer-events: none;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 7px; padding: 7px 10px; font-size: 12.5px; line-height: 1.45;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); display: none;
}
#tip .tiphead { font-weight: 650; margin-bottom: 2px; }

/* ── narrow screens (400px acceptance case) ─────────────────────────── */
@media (max-width: 760px) {
  main { padding: 10px; }
  .viewgrid { grid-template-columns: 1fr; }
  header.top h1 { font-size: 22px; }
  section.panel { padding: 12px; }
}
