/* repricing-impact dashboard — Modern Dark theme.
   Contemporary analytics dark UI: slate/near-black surfaces, soft off-white
   text, vibrant categorical accents, Inter sans-serif. No CRT scanlines/glow. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; }

:root {
  --bg: #0f1117; --bg-raised: #141821; --bg-card: #171a21;
  --bg-hover: #1e222c; --bg-inset: #12141b;
  --border: #262b36; --border-light: #333a48;
  --text: #e6e8ec; --text-secondary: #b4bac6; --text-muted: #8b93a1; --text-dim: #5b6472;
  --accent: #818cf8; --accent-strong: #6366f1;
  --glow: none; --glow-strong: none;
  /* categorical group palette — No change · Succeeds with changes · Fixable ·
     Potentially broken · Already failing · Unknown:
     slate · cyan · amber · rose · violet · gray */
  --g1: #64748b; --g2: #22d3ee; --g3: #fbbf24; --g4: #fb7185; --af: #a78bfa; --g5: #94a3b8;
  --red: #fb7185; --red-bg: rgba(251,113,133,0.10); --red-border: rgba(251,113,133,0.28);
  --orange: #fbbf24; --orange-bg: rgba(251,191,36,0.08); --orange-border: rgba(251,191,36,0.28);
  --green: #34d399; --green-bg: rgba(52,211,153,0.08);
  --blue: #fbbf24; --purple: #a78bfa;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 3px rgba(0,0,0,0.35);
}

body {
  font-family: var(--font); max-width: 1280px; margin: 0 auto; padding: 0 32px 40px;
  color: var(--text); background: var(--bg); line-height: 1.6; font-size: 15px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* ── Nav ─────────────────────────────────────────────────────────── */
nav {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 16px 0; margin-bottom: 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50; background: rgba(15,17,23,0.85);
  backdrop-filter: saturate(140%) blur(8px);
}
.nav-brand {
  font-size: 1.08em; font-weight: 700; color: var(--text); text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  color: var(--text-muted); text-decoration: none; padding: 6px 12px;
  border-radius: var(--radius-sm); font-weight: 500; font-size: 12px;
  letter-spacing: 0.01em; transition: all 0.12s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-hover); }
.nav-links a.active { color: #fff; background: var(--accent); }

/* schedule picker pill group (right-aligned) */
.schedule-picker { display: flex; gap: 5px; align-items: center; margin-left: auto; }
.schedule-picker .lbl { font-size: 0.7em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-right: 4px; }
.schedule-picker a {
  padding: 5px 13px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-muted); text-decoration: none; font-size: 0.78em; font-weight: 600;
  letter-spacing: 0.02em; transition: all 0.12s;
}
.schedule-picker a:hover { border-color: var(--border-light); color: var(--text); }
.schedule-picker a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Typography ──────────────────────────────────────────────────── */
h1 { font-size: 1.6em; font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin-bottom: 6px; }
h2 {
  font-size: 0.82em; font-weight: 600; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.1em; margin-top: 40px; margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
h3 { color: var(--text-secondary); font-weight: 600; font-size: 0.95em; }
p { margin: 6px 0; color: var(--text-secondary); }
strong { color: var(--text); font-weight: 600; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; background: var(--bg-hover); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border); color: var(--accent); font-size: 0.9em; }
.subtitle { color: var(--text-muted); font-size: 0.85em; margin: 0 0 8px; }
.note { color: var(--text-dim); font-size: 0.78em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }

/* ── Cards ───────────────────────────────────────────────────────── */
.poster-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.poster-card { background: var(--bg-card); padding: 18px 16px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color 0.12s, transform 0.12s; }
.poster-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.poster-card .number { font-size: 1.9em; font-weight: 700; color: var(--text); line-height: 1.2; letter-spacing: -0.02em; }
.poster-card .label { font-size: 0.7em; color: var(--text-muted); margin-top: 6px; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Layout grid for charts ──────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 4px; }
.panel .note { margin-bottom: 8px; }
.with-side { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }

/* Group-definition cards (landing page) — colored per group via --gc. */
.group-defs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.group-def { background: var(--bg-inset); border: 1px solid var(--border); border-left: 3px solid var(--gc, var(--text-dim)); border-radius: var(--radius-sm); padding: 12px 14px; }
.group-def h4 { font-size: 0.92em; margin: 0 0 4px; color: var(--text); display: flex; align-items: baseline; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.group-def h4 .gkey { font-size: 0.62em; font-weight: 700; color: var(--gc, var(--text-dim)); text-transform: uppercase; letter-spacing: 0.06em; }
.group-def p { font-size: 0.8em; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.group-def p code { font-size: 0.9em; }

/* ── Toggle (counts / %) ─────────────────────────────────────────── */
.toggle-row { display: flex; gap: 6px; align-items: center; margin: 8px 0; }
.toggle-btn {
  padding: 5px 13px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; color: var(--text-muted); font-family: var(--font);
  font-size: 0.72em; font-weight: 600; cursor: pointer; letter-spacing: 0.03em; transition: all 0.12s;
}
.toggle-btn:hover { border-color: var(--border-light); color: var(--text); }
.toggle-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Banners ─────────────────────────────────────────────────────── */
.banner { padding: 12px 15px; margin: 14px 0; font-size: 0.85em; line-height: 1.6; border: 1px solid var(--orange-border); background: var(--orange-bg); color: var(--text-secondary); border-radius: var(--radius); }
.banner strong { color: var(--text); }
.banner-config { background: var(--bg-card); border-color: var(--border); color: var(--text-muted); }

/* ── Sidebar metric ──────────────────────────────────────────────── */
.sidecard { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.sidecard .big { font-size: 2.1em; font-weight: 700; color: var(--green); letter-spacing: -0.02em; }
.sidecard .lbl { font-size: 0.72em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Tables ──────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; margin: 10px 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th { background: var(--bg-inset); color: var(--text-muted); padding: 9px 12px; text-align: left; font-weight: 600; font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; user-select: none; white-space: nowrap; border-bottom: 1px solid var(--border); }
th:hover { color: var(--text-secondary); }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 0.85em; color: var(--text-secondary); }
tr:hover td { background: var(--bg-hover); }
tr:last-child td { border-bottom: none; }
td strong { color: var(--text); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.addr { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.8em; color: var(--text-dim); }
a.addr { color: var(--accent); text-decoration: none; }
a.addr:hover { color: var(--accent-strong); text-decoration: underline; }

/* ── Tags ────────────────────────────────────────────────────────── */
.tag { display: inline-block; padding: 2px 8px; font-size: 0.7em; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; border: 1px solid; border-radius: 999px; }
.tag-g3 { border-color: var(--g3); color: var(--g3); background: rgba(251,191,36,0.10); }
.tag-g4 { border-color: var(--g4); color: var(--g4); background: var(--red-bg); }
.tag-upgradable { border-color: var(--accent); color: var(--accent); background: rgba(129,140,248,0.10); }
.tag-immutable { border-color: var(--text-dim); color: var(--text-muted); background: transparent; }

/* ── Loading ─────────────────────────────────────────────────────── */
.loading { color: var(--text-muted); font-style: normal; font-size: 0.82em; }
.chart { min-height: 60px; }

/* ── Hero (landing) ──────────────────────────────────────────────── */
.hero { text-align: center; padding: 40px 0 22px; max-width: 780px; margin: 0 auto; }
.hero h1 { font-size: 2em; line-height: 1.25; margin-bottom: 14px; letter-spacing: -0.03em; }
.hero .lead { font-size: 0.95em; color: var(--text-secondary); line-height: 1.7; margin-bottom: 20px; }
.hero-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.cta-btn { display: inline-block; padding: 11px 26px; background: var(--accent); color: #fff; font-weight: 600; font-size: 0.85em; text-decoration: none; font-family: var(--font); letter-spacing: 0.01em; border: 1px solid var(--accent); border-radius: var(--radius-sm); transition: all 0.12s; }
.cta-btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-secondary { display: inline-block; padding: 11px 26px; background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 600; font-size: 0.85em; text-decoration: none; font-family: var(--font); letter-spacing: 0.01em; transition: all 0.12s; }
.btn-secondary:hover { border-color: var(--border-light); color: var(--text); }

footer hr { border: none; border-top: 1px solid var(--border); margin: 40px 0 10px; }

/* ── Report (entity-report.html: rendered markdown) ──────────────── */
.report { max-width: 960px; }
.report h1 { font-size: 1.7em; margin: 8px 0 10px; }
.report h2 { font-size: 1.15em; margin: 30px 0 10px; padding-bottom: 6px; }
.report h3 { font-size: 1em; color: var(--text); margin: 24px 0 6px; text-transform: none; letter-spacing: 0; }
.report h4 { font-size: 0.9em; color: var(--text-secondary); margin: 16px 0 4px; }
.report p { color: var(--text-secondary); line-height: 1.65; font-size: 0.9em; margin: 8px 0; }
.report ul, .report ol { color: var(--text-secondary); line-height: 1.6; font-size: 0.9em; margin: 8px 0; padding-left: 22px; }
.report li { margin: 4px 0; }
.report li strong, .report p strong { color: var(--text); }
.report a { color: var(--accent); text-decoration: none; }
.report a:hover { text-decoration: underline; }
.report hr { border: none; border-top: 1px solid var(--border); margin: 26px 0; }
.report th { cursor: default; white-space: normal; }
.report th:hover { color: var(--text-muted); }
.report td { vertical-align: top; }
.report table { font-size: 0.95em; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 860px) {
  body { padding: 0 16px 32px; font-size: 13.5px; }
  .poster-grid, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .with-side { grid-template-columns: 1fr; }
  nav { gap: 10px; }
  .schedule-picker { margin-left: 0; }
}
