:root {
  color-scheme: light;
  --ink: #1c2530;
  --muted: #657181;
  --line: #d8e0e8;
  --paper: #f7f8fb;
  --panel: #ffffff;
  --accent: #d1454b;
  --shadow: 0 18px 45px rgba(25, 36, 52, 0.12);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #e8edf3; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, rgba(47, 120, 196, 0.12), rgba(209, 69, 75, 0.08)), radial-gradient(circle at top left, rgba(217, 164, 65, 0.18), transparent 32rem), var(--paper);
}
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 48px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; }
.updated-at { margin: 10px 0 0; color: var(--muted); font-size: 0.98rem; font-weight: 650; }
h2 { font-size: 1.25rem; }
.back-link { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; color: #fff; background: #263241; border-radius: 6px; text-decoration: none; font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card, .panel { background: rgba(255, 255, 255, 0.88); border: 1px solid rgba(216, 224, 232, 0.9); border-radius: 8px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.summary-card { padding: 18px; }
.summary-card .label { color: var(--muted); font-size: 0.82rem; font-weight: 700; text-transform: uppercase; }
.summary-card .value { margin-top: 8px; font-size: 1.65rem; font-weight: 850; }
.summary-card .note { margin-top: 4px; color: var(--muted); font-size: 0.86rem; }
.panel { margin-top: 18px; overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; color: var(--muted); font-size: 0.88rem; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; }
.chart { padding: 12px 20px 22px; }
.chart-row { display: grid; grid-template-columns: minmax(170px, 270px) 1fr 72px; align-items: center; gap: 12px; min-height: 42px; }
.chart-title { overflow: hidden; color: #2a3543; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { width: 100%; background: #edf1f5; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(28, 37, 48, 0.08); }
.bar { display: flex; height: 24px; overflow: hidden; border-radius: 5px; }
.segment { min-width: 3px; height: 100%; }
.chart-total { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.table-heading { align-items: end; }
.filters { display: flex; gap: 10px; }
input, select { height: 40px; min-width: 210px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid #c6d1dc; border-radius: 6px; font: inherit; }
.table-wrap { max-height: 72vh; overflow: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px 14px; border-bottom: 1px solid #edf1f5; text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; color: #435063; background: #f6f8fb; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; user-select: none; }
th.numeric, td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #fff8eb; }
.platform-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; color: #fff; border-radius: 999px; font-size: 0.78rem; font-weight: 800; }
.empty { padding: 30px; color: var(--muted); text-align: center; }
@media (max-width: 820px) {
  .page-shell { width: min(100% - 20px, 1180px); padding-top: 20px; }
  .hero, .panel-heading, .filters { align-items: stretch; flex-direction: column; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-row { grid-template-columns: 1fr; gap: 6px; padding: 8px 0; }
  .chart-total { text-align: left; }
  input, select { width: 100%; min-width: 0; }
}


.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px 0;
}

.chart-tab {
  min-height: 36px;
  padding: 0 14px;
  color: #435063;
  background: #eef3f8;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.chart-tab.active {
  color: #fff;
  background: #263241;
  border-color: #263241;
}

.chart[hidden] {
  display: none;
}
