:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172332;
  background: #f4f6f8;
  --muted: #566679;
  --line: #dce3e9;
  --paper: #fff;
  --navy: #14212b;
  --teal: #167366;
  --teal-strong: #0a5c50;
  --blue: #4e69a1;
  --warning: #8c4d12;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
h1, h2, h3, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; }
button:not(:disabled), summary { cursor: pointer; }
button:disabled { opacity: .65; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #0b7768;
  outline-offset: 3px;
}
.skip { position: absolute; top: -100px; left: 16px; z-index: 3; }
.skip:focus { top: 10px; padding: 10px; background: var(--paper); }

.topbar { color: #f7faff; background: var(--navy); }
.topbar-inner {
  max-width: 1440px;
  min-height: 68px;
  margin: auto;
  padding: 0 36px;
  display: flex;
  align-items: center;
  gap: 38px;
}
.topbar a, .topbar button { outline-color: #8fe4d2; }
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  align-items: end;
  justify-content: center;
  gap: 3px;
  width: 31px;
  height: 31px;
  padding-bottom: 7px;
  border-radius: 8px;
  background: #284b47;
}
.brand-mark i { border-radius: 1px; background: #9ee7d6; }
.brand-mark i:nth-child(1) { height: 7px; }
.brand-mark i:nth-child(2) { height: 12px; }
.brand-mark i:nth-child(3) { height: 17px; }
.topbar nav {
  display: flex;
  gap: 24px;
  margin-right: auto;
  align-items: center;
}
.topbar nav a {
  color: #d1dce7;
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
}
.topbar nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.topbar form { margin-left: auto; }
.sign-out {
  padding: 8px 13px;
  color: #f5f9fb;
  background: transparent;
  border: 1px solid #536474;
  border-radius: 7px;
  font-size: 13px;
  white-space: nowrap;
}
.sign-out:hover { background: #283946; }

main { max-width: 1440px; margin: 0 auto; padding: 33px 36px 56px; }
section { scroll-margin-top: 20px; }
.overview-head, .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.overview-head { margin-bottom: 19px; }
h1 { font-size: clamp(29px, 3vw, 39px); letter-spacing: -.04em; line-height: 1.12; }
h2 { font-size: 22px; letter-spacing: -.025em; line-height: 1.2; }
h3 { font-size: 16px; letter-spacing: -.015em; line-height: 1.3; }
.timestamp, .meta, .metric-meta, .chart-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.timestamp, .section-head .meta { margin-top: 5px; }
.secondary {
  color: #314459;
  background: var(--paper);
  border: 1px solid #cad5df;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.secondary:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-strong); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metric, .panel {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}
.metric { padding: 17px 18px 15px; }
.metric h2 {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  color: #475970;
}
.metric-value {
  margin-top: 6px;
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.metric-value.missing { font-size: clamp(21px, 2.4vw, 30px); color: #765328; margin-top: 11px; }
.metric-meta { margin-top: 7px; min-height: 1.5em; font-size: 12px; }
.metric.understated { background: #fafbfc; }

.section { margin-top: 31px; }
.section-head { margin-bottom: 13px; }
.segments {
  display: flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  background: #e9eef1;
  border: 1px solid #dce4e9;
  border-radius: 9px;
}
.segments button {
  padding: 6px 11px;
  min-width: 56px;
  color: #52647a;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.segments button:hover:not(:disabled), .segments button[aria-pressed="true"] { color: #123e39; }
.segments button[aria-pressed="true"] { border-color: #d4dee3; background: #fff; }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}
.panel { padding: 18px 20px; min-width: 0; }
.plot { min-height: 171px; margin-top: 15px; }
.plot-board {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-rows: 144px 16px;
  column-gap: 9px;
  row-gap: 7px;
  margin-right: 2px;
}
.plot-scale { position: relative; min-width: 25px; grid-row: 1; grid-column: 1; }
.plot-scale span, .plot-grid i { position: absolute; inset-block-end: var(--position); }
.plot-scale span {
  right: 0;
  transform: translateY(50%);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.plot-surface { grid-row: 1; grid-column: 2; position: relative; border-bottom: 1px solid #b8c6d3; }
.plot-grid { position: absolute; inset: 0; pointer-events: none; }
.plot-grid i { width: 100%; border-top: 1px solid #e6edf3; }
.plot-columns {
  height: 100%;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--slots), minmax(0, 1fr));
}
.plot-column { display: flex; align-items: end; justify-content: center; min-width: 0; }
.plot-column:hover { background: #f0f6f5; }
.plot-bar {
  display: block;
  height: var(--height);
  width: 67%;
  max-width: 65px;
  border-radius: 4px 4px 0 0;
  background: var(--teal);
}
.historical-panel .plot-bar { background: var(--blue); }
.plot-bar.zero { height: 2px; border-radius: 3px 3px 0 0; opacity: .6; }
.plot-bar.gap { min-height: 6px; border: 1px dashed #a4b2bf; background: transparent; }
.plot-days { position: relative; grid-column: 2; grid-row: 2; }
.plot-days span {
  position: absolute;
  left: var(--position);
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.plot-days span:first-child { transform: none; }
.plot-days span:last-child { transform: translateX(-100%); }
.chart-note { margin-top: 9px; font-size: 12px; }
.notice {
  display: block;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  color: var(--muted);
  background: #fafcfe;
  font-size: 13px;
  line-height: 1.4;
}
.panel .notice { margin: 0; align-content: center; min-height: 77px; }
.notice.warning { border-color: #ebd6bb; color: #764917; background: #fffaf4; }

.breakdown { display: grid; gap: 12px; margin-top: 15px; }
.breakdown-item .breakdown-label { display: flex; justify-content: space-between; gap: 8px; }
.breakdown-label span { font-size: 13px; line-height: 1.35; }
.breakdown-label .breakdown-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.breakdown-track { background: #edf2f6; margin-top: 5px; height: 6px; border-radius: 4px; overflow: hidden; }
.breakdown-track span { display: block; width: var(--share); height: 100%; border-radius: 4px; background: var(--teal); }
.catalogue-panel { display: grid; grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1.3fr); gap: 26px; }
.department-breakdown { margin-top: 0; }
.coverage-description { margin-top: 8px; }
.count-table { width: 100%; margin-top: 6px; border-collapse: collapse; text-align: left; font-size: 12px; }
.count-table th, .count-table td { padding: 6px 2px; border-bottom: 1px solid #e9eef2; }
.count-table th:last-child, .count-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
details { margin-top: 10px; }
summary { font-size: 12px; color: var(--teal-strong); font-weight: 650; }

.source-panel { padding: 2px 18px; }
.source-panel dl > div {
  display: grid;
  grid-template-columns: minmax(170px, .85fr) minmax(0, 2fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid #e7edf2;
}
.source-panel dl > div:last-child { border-bottom: 0; }
.source-panel dt { font-size: 13px; font-weight: 650; }
.source-panel dd { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.source-state {
  flex: 0 0 auto;
  color: #586679;
  font-weight: 700;
}
.source-state[data-state="available"] { color: var(--teal-strong); }
.source-state[data-state="warning"] { color: var(--warning); }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 18px; }
.auth-panel {
  width: min(100%, 450px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.auth-panel h1 { margin: 13px 0 9px; font-size: 30px; }
.auth-panel p:not(.auth-mark) { color: var(--muted); line-height: 1.5; }
.auth-panel .auth-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 9px;
  color: #a5ebd8;
  background: #254943;
  font-size: 19px;
  font-weight: 750;
}
.primary-button {
  display: inline-block;
  margin-top: 19px;
  padding: 10px 14px;
  border-radius: 7px;
  color: white;
  background: var(--teal-strong);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.primary-button:hover { background: #084e44; }

@media (max-width: 1000px) {
  .topbar-inner { gap: 24px; }
  .topbar nav { gap: 15px; }
  .metric-value.missing { font-size: 22px; }
}
@media (max-width: 790px) {
  .topbar-inner { padding: 0 22px; flex-wrap: wrap; gap: 0; min-height: 0; }
  .topbar .brand, .topbar form { margin-top: 12px; }
  .topbar nav { order: 3; width: 100%; padding: 12px 0; gap: 20px; overflow-x: auto; }
  main { padding: 23px 22px 42px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .catalogue-panel { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .source-panel dd { flex-wrap: wrap; gap: 3px 10px; }
}
@media (max-width: 475px) {
  main { padding: 19px 13px 32px; }
  .topbar-inner { padding: 0 13px; }
  .topbar nav { gap: 16px; }
  .overview-head { margin-bottom: 14px; }
  .overview-head, .section-head { gap: 9px; }
  .section-head h2 { font-size: 19px; }
  .segments { padding: 2px; }
  .segments button { min-width: 47px; padding: 5px 7px; }
  .metrics { gap: 8px; }
  .metric { padding: 12px 10px; }
  .panel { padding: 14px 12px; }
  .source-panel { padding: 1px 12px; }
  .source-panel dl > div { grid-template-columns: 1fr; gap: 5px; }
  .plot-board { grid-template-rows: 127px 16px; }
  .plot { min-height: 151px; }
  .auth-panel { padding: 23px; }
}
