/* Sage Capital Research — chrome tokens (light + dark) */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #4b3a97;          /* SAGE purple */
  --up: #006300;
  --down: #d03b3b;
  --chart-up: #006300;        /* validated pair, light surface */
  --chart-down: #e66767;
  --chart-line: #4b3a97;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #9085e9;        /* SAGE purple, dark step */
    --up: #0ca30c;
    --down: #e66767;
    --chart-up: #0ca30c;      /* validated pair, dark surface */
    --chart-down: #e66767;
    --chart-line: #9085e9;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--grid);
  padding: 14px 24px;
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
}
header.site .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.04em; }
header.site .brand img { height: 34px; display: block; }
header.site .brand span { color: var(--muted); font-weight: 400; }
@media (prefers-color-scheme: dark) {
  header.site .brand img, .login-wrap .logo img { background: #fff; padding: 4px 8px; border-radius: 8px; }
}

/* charts */
.charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px 10px; }
.chart-card h3 { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.chart-wrap { position: relative; height: 220px; }
.chart-wrap.tall { height: 340px; }
.chart-card details { margin-top: 6px; }
.chart-card summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.chart-card details table { margin-top: 6px; font-size: 12.5px; }
header.site nav { display: flex; gap: 16px; flex-wrap: wrap; }
header.site nav a { color: var(--ink-2); padding: 2px 2px; }
header.site nav a.active { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); }
header.site .spacer { flex: 1; }
header.site .logout { color: var(--muted); font-size: 13px; }

main { max-width: 1040px; margin: 0 auto; padding: 24px 24px 64px; }
h1 { font-size: 22px; margin: 8px 0 2px; }
h2 { font-size: 16px; margin: 28px 0 10px; color: var(--ink); }
.asof { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.prose { max-width: 74ch; color: var(--ink); }
.prose p { margin: 0 0 10px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tile .label { color: var(--ink-2); font-size: 13px; }
.tile .value { font-size: 22px; font-weight: 650; margin-top: 2px; }
.tile .delta { font-size: 13px; margin-top: 2px; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--baseline); }
td { padding: 10px 12px; border-bottom: 1px solid var(--grid); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sym { font-weight: 650; }
td .co { color: var(--ink-2); font-size: 13px; }

/* confidence chips: icon + label, never color alone */
.chip { display: inline-block; font-size: 12px; border: 1px solid var(--baseline); border-radius: 999px; padding: 1px 9px; color: var(--ink-2); white-space: nowrap; }
.chip::before { margin-right: 4px; }
.chip.high::before { content: "\25CF"; }   /* ● */
.chip.med::before  { content: "\25D0"; }   /* ◐ */
.chip.low::before  { content: "\25CB"; }   /* ○ */

/* link cards on splash */
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.links .card h3 { margin: 0 0 6px; font-size: 15px; }
.links .card p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

/* login */
.login-wrap { max-width: 360px; margin: 12vh auto 0; }
.login-wrap input[type="password"] { width: 100%; padding: 10px 12px; font-size: 15px; border: 1px solid var(--baseline); border-radius: 8px; background: var(--surface); color: var(--ink); }
.login-wrap button { margin-top: 12px; width: 100%; padding: 10px; font-size: 15px; font-weight: 600; color: #fff; background: var(--accent); border: none; border-radius: 8px; cursor: pointer; }
.error { color: var(--down); font-size: 13.5px; margin-top: 8px; }
.note { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 28px; text-align: center; background: var(--surface); border: 1px dashed var(--baseline); border-radius: 10px; }
