@font-face {
  font-family: Inter;
  src: url('/assets/inter-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --base-rgb: 0 0 0;
  --surface-rgb: 255 255 255;
  --positive-rgb: 53 145 25;
  --negative-rgb: 185 42 42;
  --color-ink: rgb(var(--base-rgb));
  --color-label: rgb(var(--base-rgb) / .8);
  --color-muted: rgb(var(--base-rgb) / .56);
  --color-surface: rgb(var(--surface-rgb));
  --border-control: 1px solid rgb(var(--base-rgb) / .27);
  --border-card: 1px solid rgb(var(--base-rgb) / .16);
  --shadow-control: 0 2px 4px rgb(var(--base-rgb) / .06);
  --radius: 8px;
  --radius-pill: 999px;
  --control-height: 40px;
  --control-height-large: 56px;
  --header-height: 50px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-11: 44px;
  --transition: 140ms ease;
}

* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
html { min-width: 280px; background: var(--color-surface); }
body { margin: 0; color: var(--color-ink); font: 400 16px/1.5 var(--font-family); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible,
.select-control:focus-within { outline: 2px solid rgb(var(--base-rgb) / .72); outline-offset: 3px; }
.header { height: var(--header-height); padding-inline: var(--space-4); display: flex; align-items: center; background: var(--color-ink); }
.brand {
  --brand-scale: 1;
  display: inline-grid;
  grid-auto-flow: column;
  grid-template-rows: calc(12px * var(--brand-scale));
  align-content: center;
  align-items: start;
  gap: calc(7px * var(--brand-scale));
  min-height: var(--control-height);
  text-decoration: none;
}
/* Align the SVG tops; the wordmark's descenders extend below the symbol. */
.brand img { display: block; }
.brand-symbol { width: calc(12px * var(--brand-scale)); height: calc(12px * var(--brand-scale)); }
.brand-wordmark { width: calc(84px * var(--brand-scale)); height: auto; }
.brand:focus-visible { outline-color: var(--color-surface); }
.header { justify-content: space-between; }
.logout { background: transparent; border: 0; padding: 0 var(--space-2); height: var(--control-height); color: rgb(var(--surface-rgb) / .65); font-size: .8125rem; border-radius: var(--radius); }
.logout:hover { color: var(--color-surface); }
.logout:focus-visible { outline-color: var(--color-surface); }
.dashboard { width: calc(100% - 48px); max-width: 1492px; margin-inline: auto; padding-block: var(--space-11); }
.toolbar { display: flex; align-items: flex-start; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-7); }

/* Shared control primitive: buttons, selects, and date inputs. */
.control {
  height: var(--control-height);
  border: var(--border-control);
  border-radius: var(--radius);
  box-shadow: var(--shadow-control);
  background: var(--color-surface);
  padding-inline: var(--space-3);
  font-size: .875rem;
  font-weight: 550;
  line-height: 1.2;
  transition: background var(--transition), border-color var(--transition);
}
.control:hover { border-color: rgb(var(--base-rgb) / .42); }
.select-control { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); min-width: 91px; }
.select-control select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.select-control .chevron { margin-left: auto; pointer-events: none; flex-shrink: 0; }
.button { display: inline-flex; justify-content: center; align-items: center; }
.button:hover { background: rgb(var(--base-rgb) / .035); }
.button-primary { background: var(--color-ink); color: var(--color-surface); }
.button-primary:hover { background: rgb(var(--base-rgb) / .85); }
.button:disabled { opacity: .6; cursor: wait; }
.date-form { display: flex; gap: var(--space-2); align-items: flex-end; flex-wrap: wrap; }
.date-field { display: grid; gap: var(--space-1); margin-top: -25px; }
.date-field > span { font-size: .875rem; color: var(--color-muted); }
.date-field input { width: 160px; min-width: 0; }
.metric-group { margin-top: var(--space-7); }
.group-title { margin: 0 0 var(--space-3); color: var(--color-muted); font-size: 15px; line-height: 20px; font-weight: 500; }
.metrics { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.metric-card { width: 272px; min-height: 122px; padding: 16px 20px 20px; border: var(--border-card); border-radius: var(--radius); }
.metric-title { margin: 0; color: var(--color-label); font-size: .875rem; font-weight: 600; line-height: 24px; }
.metric-value { min-height: 38px; font-size: 1.6rem; font-weight: 650; line-height: 38px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.metric-value.is-unavailable { color: var(--color-muted); }
.metric-change { min-height: 21px; margin: 0; font-size: .875rem; font-weight: 600; line-height: 21px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.metric-change.is-positive { color: rgb(var(--positive-rgb)); }
.metric-change.is-negative { color: rgb(var(--negative-rgb)); }
.metric-details { margin-top: var(--space-3); max-width: 420px; font-size: .8125rem; color: var(--color-muted); }
.metric-details p { margin: 0; }
.data-status { margin-top: var(--space-1) !important; }
.data-status.is-error { color: rgb(var(--negative-rgb)); }
.retry { margin-top: var(--space-3); }
.data-status:empty { display: none; }
.skeleton { display: inline-block; border-radius: var(--radius); background: rgb(var(--base-rgb) / .07); animation: pulse 1.5s ease-in-out infinite; }
.skeleton-value { width: 92px; height: 28px; vertical-align: middle; }
.skeleton-change { width: 120px; height: 14px; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: var(--space-4); z-index: 10; padding: var(--space-2); color: var(--color-ink); background: var(--color-surface); border-radius: var(--radius); }
.skip-link:focus { top: var(--space-2); }
.auth-header { position: absolute; inset: 24px auto auto 34px; }
.brand-large { --brand-scale: 1.5; }
.brand-large img { filter: invert(1); }
.brand-large:focus-visible { outline-color: var(--color-ink); }
.auth-main { min-height: 100svh; display: grid; place-items: center; padding: 110px var(--space-5) 70px; }
.auth-panel { width: 378px; max-width: 100%; transform: translateY(-24px); }
.auth-panel h1 { margin: 0 0 54px; color: rgb(var(--base-rgb) / .8); text-align: center; font-size: 1.5rem; line-height: 29px; font-weight: 600; letter-spacing: 0; }
.login-form { display: flex; flex-direction: column; gap: var(--space-5); }
.control-large { height: var(--control-height-large); border-radius: var(--radius-pill); padding-inline: var(--space-5); width: 100%; flex-shrink: 0; box-shadow: none; font-weight: 450; }
.control-large::placeholder { color: rgb(var(--base-rgb) / .8); opacity: 1; }
.login-form .button { margin-top: 10px; font-weight: 550; }
.login-error { color: rgb(var(--negative-rgb)); font-size: .875rem; text-align: center; margin: 0; min-height: 21px; }
@keyframes pulse { 50% { opacity: .45; } }
@media (max-width: 600px) {
  .dashboard { width: calc(100% - var(--space-4) - var(--space-4)); padding-top: var(--space-7); }
  .toolbar { row-gap: var(--space-6); }
  .date-form { width: 100%; }
  .date-field { margin-top: 0; flex: 1 1 125px; }
  .date-field input { width: 100%; }
  .date-form .button { flex-basis: 100%; }
  .login-form input.control-large { font-size: 16px; }
  .metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
  .metric-card { width: auto; min-width: 0; padding: var(--space-3); }
  .metric-title { min-height: 40px; font-size: .8125rem; line-height: 20px; overflow-wrap: anywhere; }
  .metric-value, .metric-change { overflow-wrap: anywhere; }
  .metric-change { font-size: .8125rem; }
  .metric-card .skeleton { max-width: 100%; }
  .auth-header { top: var(--space-4); left: var(--space-5); }
  .auth-panel { transform: none; }
  .auth-panel h1 { margin-bottom: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.sources-table { width: 100%; max-width: 848px; border-collapse: collapse; font-size: .875rem; }
.sources-table th, .sources-table td { padding: var(--space-3) 0; border-bottom: var(--border-card); text-align: right; font-variant-numeric: tabular-nums; }
.sources-table th { color: var(--color-label); font-weight: 500; }
.sources-table th:first-child, .sources-table td:first-child { text-align: left; overflow-wrap: anywhere; }
