:root {
  color-scheme: dark;
  font: 16px/1.45 'Segoe UI', system-ui, sans-serif;
  color: #f2f7fc;
  background: #07101b;
  --brand-blue: #003f72;
  --sky: #6ec1e4;
  --canvas: #0b1625;
  --panel: #101e2e;
  --raised: #15273a;
  --line: #2a3e53;
  --muted: #aabbd0;
  --white: #f2f7fc;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 72% 0%, #102740 0%, #07101b 55%); }
[hidden] { display: none !important; }
.container { width: min(100% - 48px, 1310px); margin-inline: auto; padding: 0 0 30px; }
h1, h2, p, dl, dd { margin: 0; }
a { color: var(--sky); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; min-height: 69px; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; gap: 10px; align-items: center; font-size: .94rem; white-space: nowrap; }
.wordmark strong span { color: var(--muted); font-size: .82rem; font-weight: 550; }
.brand-mark { position: relative; width: 26px; height: 26px; flex: none; border: 1px solid #81cce7; border-radius: 9px 9px 12px 12px; background: linear-gradient(148deg, #6ec1e4, #1971a3 74%); box-shadow: 0 0 17px #6ec1e438; }
.brand-mark::after { content: ''; position: absolute; inset: 8px 4px; border-block: 1px solid #e8faff; border-radius: 45%; transform: rotate(-20deg); }
.topbar nav { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 32px); font-size: .84rem; }
.topbar a { padding: 9px 2px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.topbar a:hover { color: var(--sky); }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 28px 0 21px; }
.eyebrow { font-size: .71rem; color: var(--sky); font-weight: 690; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin-top: 7px; font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1.04; letter-spacing: -.045em; }
.subtitle { margin-top: 8px; color: var(--muted); font-size: .93rem; }
#status { align-self: end; display: inline-flex; align-items: center; gap: 7px; flex: 0 1 auto; max-width: 35ch; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #102438; color: #c6e4f4; font-size: .76rem; }
#status::before { content: ''; display: block; flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--sky); }
#status[data-state="error"] { color: #ffc5bb; }
#status[data-state="error"]::before { background: #ff9987; }
#status[data-state="connected"]::before { background: #61ce70; }
.controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 15px; padding: 13px 16px; margin-bottom: 15px; background: #0f1c2c; border: 1px solid var(--line); border-radius: 13px; }
.controls label { display: grid; gap: 5px; color: #c0d0e1; font-size: .78rem; font-weight: 650; }
.controls p { align-self: center; color: var(--muted); white-space: nowrap; font-size: .8rem; }
select, button { font: inherit; }
select { width: 100%; padding: 8px 11px; }
.controls select { min-height: 40px; border: 1px solid #406481; border-radius: 8px; color: var(--white); background: #142b41; font-weight: 600; }
.controls select:hover, .secondary-controls select:hover { border-color: var(--sky); }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }
.metrics { display: grid; grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric, .panel { background: linear-gradient(145deg, #142337 0%, var(--panel) 80%); border: 1px solid var(--line); border-radius: 13px; min-width: 0; }
.metric { min-height: 122px; display: flex; flex-direction: column; padding: 13px 15px; }
.metric:first-child { border-color: #3b749b; background: linear-gradient(138deg, #075088, var(--brand-blue) 53%, #0e2c4a); box-shadow: 0 6px 23px #003f723c; }
.metric dt { color: #d6e2f0; font-weight: 650; font-size: .84rem; }
.metric dd:first-of-type { font-size: clamp(1.8rem, 4vw, 2.45rem); margin: 8px 0 11px; line-height: 1; font-weight: 660; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric:first-child dd:first-of-type { color: white; }
.metric-caption { margin-top: auto; font-size: .73rem; color: var(--muted); }
.metric:first-child .metric-caption { color: #d2eafb; }
.grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 13px; margin-top: 13px; }
.panel { padding: 17px; }
h2 { font-size: 1.12rem; letter-spacing: -.015em; line-height: 1.3; }
.section-description { margin-top: 4px; font-size: .8rem; color: var(--muted); }
.chart-frame { --chart-label: 130px; --count-width: 40px; margin-top: 13px; border: 1px solid #2c4156; border-radius: 10px; background: #0d1928; padding: 11px 9px 10px; }
.chart-axis { margin: 0 var(--count-width) 0 var(--chart-label); display: flex; justify-content: space-between; border-bottom: 1px solid #3b536c; padding-bottom: 6px; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart { list-style: none; padding: 0; margin: 0; }
.bar-button { display: grid; grid-template-columns: var(--chart-label) minmax(0, 1fr) var(--count-width); align-items: center; width: 100%; border: 0; border-radius: 5px; background: transparent; color: inherit; padding: 0; font-size: .8rem; text-align: left; cursor: pointer; }
.bar-button:hover, .bar-button[aria-pressed="true"] { background: #172e47; }
.bar-name { padding: 0 10px 0 2px; text-align: right; overflow-wrap: anywhere; }
.track { display: flex; align-items: center; height: 36px; border-left: 1px solid #3b536c; position: relative; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), #23374b calc(25% - 1px) 25%); }
.bar { display: block; height: 18px; border-radius: 0 5px 5px 0; background: linear-gradient(90deg, #1976ab, var(--sky)); }
.bar-count { position: absolute; left: min(calc(var(--position) + 7px), calc(100% + 5px)); white-space: nowrap; color: #e0f4ff; font-weight: 650; font-variant-numeric: tabular-nums; }
.months-summary { list-style: none; padding: 0; margin: 13px 0 0; display: grid; gap: 8px; }
.months-summary li { min-width: 0; padding: 9px 11px; border: 1px solid #2c4156; border-radius: 9px; background: #0d1928; }
.months-summary .active-month { border-color: #4a7fa1; background: #132943; }
.month-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .89rem; }
.month-label strong { color: #d5f4ff; font-variant-numeric: tabular-nums; }
.month-track { height: 7px; margin-top: 5px; border-radius: 4px; overflow: hidden; background: #253b53; }
.month-bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #1d7eb8, var(--sky)); }
.month-caption { margin-top: 5px; font-size: .73rem; color: var(--muted); }
.month-note { margin-top: 10px; padding: 7px 10px; border-left: 2px solid var(--sky); border-radius: 2px 6px 6px 2px; background: #14263b; font-size: .75rem; color: #c0d2e4; }
.designer-details { margin-top: 13px; }
.table-scroll { margin-top: 13px; overflow-x: auto; border: 1px solid #2c4156; border-radius: 9px; }
table { width: 100%; border-spacing: 0; background: #0d1928; text-align: center; font-size: .82rem; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; border-bottom: 1px solid #2a3c50; }
thead, tfoot { background: #192e43; }
thead th:first-child, th[scope="row"], th:nth-child(2), td:nth-child(2) { text-align: left; }
th[scope="row"] { min-width: 155px; }
td:nth-child(2) { min-width: 210px; color: #c4d2e3; }
td:nth-child(n+3), th:nth-child(n+3) { white-space: nowrap; }
td.count { color: #b4e9fd; background: #11243a; font-weight: 650; }
td.missing { color: var(--muted); font-size: .76rem; font-style: italic; }
td.quarter-total, tfoot td:nth-child(n+3) { color: #e0f5ff; font-weight: 750; }
tfoot th, tfoot td { border-bottom: 0; }
.footnote { margin: 11px 1px 0; font-size: .75rem; color: var(--muted); }
.secondary-controls { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 9px 15px; font-size: .8rem; color: var(--muted); }
.secondary-controls label { display: inline-flex; align-items: center; gap: 7px; }
.secondary-controls select, #refresh { border: 1px solid #38546d; background: #14263a; color: var(--white); border-radius: 7px; }
#refresh { padding: 7px 11px; cursor: pointer; font-weight: 600; }
#refresh:hover { border-color: var(--sky); }
#refresh:disabled { opacity: .55; cursor: wait; }
@media (max-width: 900px) {
  .chart-frame { --chart-label: 96px; --count-width: 29px; }
}
@media (max-width: 710px) {
  .container { width: calc(100% - 26px); }
  .hero { align-items: flex-start; flex-direction: column; padding-top: 23px; gap: 10px; }
  #status { align-self: start; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 11px; }
  .controls p { grid-column: 1 / -1; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { min-height: 103px; padding: 12px; }
  .metric:first-child { grid-column: 1 / -1; }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 13px; }
  .topbar { min-height: 61px; align-items: center; }
  .wordmark strong span { display: block; }
  th:first-child { position: sticky; left: 0; background: #0d1928; box-shadow: 1px 0 #2a3c50; }
  thead th:first-child, tfoot th:first-child { background: #192e43; }
}
@media (max-width: 380px) {
  .topbar { flex-wrap: wrap; gap: 4px 14px; padding: 9px 0; }
  .topbar nav a { padding-block: 4px; }
}
