:root {
  --color-page: #f6f8f5;
  --color-surface: #ffffff;
  --color-sunken: #eef3ef;
  --color-raised: #ffffff;
  --color-header: rgb(255 255 255 / 0.88);
  --color-text: #0e1f1a;
  --color-text-muted: #4b5e57;
  --color-border: #dce5e0;
  --color-border-control: #7a8c85;
  --color-brand: #128c7e;
  --color-on-brand: #ffffff;
  --color-signal: #25d366;
  --color-action: #0b6b60;
  --color-action-hover: #08564d;
  --color-on-action: #ffffff;
  --color-success-surface: #ddf7e7;
  --color-info-surface: #e8f3ef;
  --color-danger: #a32d2d;
  --color-on-danger: #ffffff;
  --color-danger-surface: #fdecec;
  --color-warning: #7a4e00;
  --color-warning-surface: #fff4d6;
  --color-focus: #1a56db;
  --font-sans: system-ui, -apple-system, 'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-eyebrow: 0.75rem;
  --text-small: 0.875rem;
  --text-body: 1rem;
  --text-heading-3: 1.125rem;
  --text-heading-2: 1.375rem;
  --text-heading-1: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
  --text-figure: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
  --text-display: clamp(4rem, 3rem + 4vw, 6rem);
  --tracking-tight: -0.025em;
  --tracking-eyebrow: 0.08em;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --radius-control: 0.625rem;
  --radius-card: 1.25rem;
  --radius-tail: 0.375rem;
  --radius-pill: 999px;
  --size-tap: 2.75rem;
  --size-focus-ring: 3px;
  --size-focus-offset: 2px;
  --measure-page: 72rem;
  --measure-form: 32rem;
  --measure-code: 11rem;
  --shadow-card: 0 1px 2px rgb(14 31 26 / 0.05), 0 8px 24px -12px rgb(14 31 26 / 0.12);
  --shadow-raised: 0 2px 4px rgb(14 31 26 / 0.06), 0 32px 64px -24px rgb(14 31 26 / 0.28);
  --shadow-highlight: inset 0 1px 0 rgb(255 255 255 / 0.16);
  --glow-signal: 0 0 0 4px rgb(37 211 102 / 0.18);
  --glow-signal-faded: 0 0 0 7px rgb(37 211 102 / 0);
  --gradient-page: radial-gradient(64rem 28rem at 50% -12rem, rgb(37 211 102 / 0.22), transparent 70%);
  --gradient-hero-border: linear-gradient(135deg, var(--color-signal), var(--color-brand));
  --elevation-hero: 0 2px 4px rgb(14 31 26 / 0.06), 0 24px 48px -20px rgb(37 211 102 / 0.38);
  --pattern-dots: radial-gradient(rgb(14 31 26 / 0.07) 1px, transparent 1.5px);
  --duration-quick: 120ms;
  --duration-base: 220ms;
  --duration-arrive: 420ms;
  --duration-chart: 640ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --radius-bubble: var(--radius-tail) var(--radius-card) var(--radius-card) var(--radius-card);
  --mark-bubble:
    radial-gradient(circle at 30% 50%, var(--color-on-brand) 0.07em, transparent 0.09em),
    radial-gradient(circle at 50% 50%, var(--color-on-brand) 0.07em, transparent 0.09em),
    radial-gradient(circle at 70% 50%, var(--color-on-brand) 0.07em, transparent 0.09em), var(--color-brand);
  --duration-pulse: 2s;
  --duration-breathe: 1.6s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-page: #07120f;
    --color-surface: #0d1b17;
    --color-sunken: #0a1613;
    --color-raised: #15261f;
    --color-header: rgb(13 27 23 / 0.88);
    --color-text: #e8f1ed;
    --color-text-muted: #9db2aa;
    --color-border: #1f332d;
    --color-border-control: #5f7a71;
    --color-brand: #25d366;
    --color-on-brand: #04140c;
    --color-action: #5be39a;
    --color-action-hover: #7deab0;
    --color-on-action: #04140c;
    --color-success-surface: #0f2a21;
    --color-info-surface: #0f2a21;
    --color-danger: #ff9c9c;
    --color-on-danger: #0d1b17;
    --color-danger-surface: #3a1e1e;
    --color-warning: #f2c46d;
    --color-warning-surface: #3a2e12;
    --color-focus: #8ab4ff;
    --shadow-card: 0 0 0 1px rgb(232 241 237 / 0.02), 0 12px 32px -16px rgb(0 0 0 / 0.7);
    --shadow-raised: 0 0 0 1px rgb(232 241 237 / 0.04), 0 40px 80px -24px rgb(0 0 0 / 0.8);
    --shadow-highlight: inset 0 1px 0 rgb(255 255 255 / 0.22);
    --gradient-page: radial-gradient(64rem 28rem at 50% -12rem, rgb(37 211 102 / 0.28), transparent 70%);
    --elevation-hero: 0 0 0 1px rgb(232 241 237 / 0.04), 0 32px 64px -20px rgb(37 211 102 / 0.32);
    --pattern-dots: radial-gradient(rgb(232 241 237 / 0.06) 1px, transparent 1.5px);
  }
}

@keyframes notice-arrive {
  from {
    opacity: 0;
    transform: translateY(0.5rem) scale(0.98);
  }
}

@keyframes bar-grow {
  from {
    transform: scaleY(0);
  }
}

@keyframes signal-pulse {
  from {
    box-shadow: var(--glow-signal);
  }

  to {
    box-shadow: var(--glow-signal-faded);
  }
}

@keyframes bubble-breathe {
  50% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background-color: var(--color-page);
  background-image: var(--gradient-page);
  background-repeat: no-repeat;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.5;
}

h1 {
  font-family: var(--font-display);
  font-size: var(--text-heading-1);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-4);
}

h2 {
  font-size: var(--text-heading-2);
  font-weight: 600;
  margin: 0 0 var(--space-3);
}

h3 {
  font-size: var(--text-heading-3);
  font-weight: 600;
}

a {
  color: var(--color-action);
}

:focus-visible {
  outline: var(--size-focus-ring) solid var(--color-focus);
  outline-offset: var(--size-focus-offset);
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -10rem;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-control);
}

.skip-link:focus {
  top: var(--space-2);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  padding: var(--space-3) var(--space-5);
  background: var(--color-header);
  border-bottom: 1px solid var(--color-border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

.brand::before {
  content: '';
  width: 1em;
  height: 1em;
  font-size: 1.75rem;
  border-radius: var(--radius-card) var(--radius-card) var(--radius-card) var(--radius-tail);
  background: var(--mark-bubble);
  box-shadow: var(--glow-signal);
}

.environment-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  color: var(--color-warning);
  background: var(--color-warning-surface);
  font-size: var(--text-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
}

nav,
.locale-switch {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--color-sunken);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-tap);
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background-color var(--duration-quick) var(--ease-out);
}

.nav-link:hover {
  color: var(--color-text);
}

.nav-link[aria-current='page'] {
  background: var(--color-raised);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
  font-weight: 650;
}

.header-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

.locale-switch .button {
  min-height: var(--size-tap);
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  box-shadow: none;
}

.locale-switch .button[aria-pressed='true'] {
  background: var(--color-raised);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
  font-weight: 650;
}

main {
  max-width: var(--measure-page);
  margin: 0 auto;
  padding: var(--space-7) var(--space-5) var(--space-8);
}

main > * + * {
  margin-top: var(--space-5);
}

.site-footer {
  padding: var(--space-4) var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-small);
}

.shell-signed-out {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-image: var(--pattern-dots), var(--gradient-page);
  background-size:
    1.25rem 1.25rem,
    auto;
}

.shell-signed-out main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: var(--measure-form);
}

.shell-signed-out .card {
  box-shadow: var(--shadow-raised);
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-action);
  font-size: var(--text-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
}

.lead {
  margin: 0 0 var(--space-5);
  color: var(--color-text-muted);
}

.page-head,
.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
}

.title-row {
  justify-content: flex-start;
}

.page-head h1,
.title-row h1 {
  margin: 0;
}

.crumb {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-tap);
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: none;
}

.crumb::before {
  content: '\2190' / '';
  margin-right: var(--space-2);
}

.crumb:hover {
  text-decoration: underline;
}

.card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-bubble);
  box-shadow: var(--shadow-card);
}

.hero-card {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
    var(--gradient-hero-border) border-box;
  box-shadow: var(--elevation-hero);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-5);
}

.card-grid > .card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  min-width: 0;
}

.card-grid > .card > * {
  margin: 0;
}

.card-grid > .card > .sparkline {
  align-self: stretch;
  margin-top: auto;
}

.card-grid > .card > .button {
  margin-bottom: var(--space-3);
}

fieldset {
  min-width: 0;
  margin: 0 0 var(--space-6);
  padding: 0;
  border: 0;
}

fieldset + fieldset {
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

legend {
  margin-bottom: var(--space-3);
  padding: 0;
  font-size: var(--text-heading-3);
  font-weight: 600;
}

.form-card fieldset {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0 var(--space-5);
}

.form-card .field {
  display: flex;
  flex-direction: column;
}

.form-card .field > input,
.form-card .field > select {
  margin-top: auto;
}

.form-card fieldset > .field-help {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.detail-grid {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}

.detail-grid > * {
  min-width: 0;
}

.detail-actions {
  display: grid;
  gap: var(--space-5);
}

.tile-figure {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-figure);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tile-unit {
  margin-left: var(--space-2);
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0;
}

.state-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.state-counts li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: var(--text-small);
  font-weight: 600;
}

.state-active {
  background: var(--color-success-surface);
  color: var(--color-action);
}

.state-pending {
  background: var(--color-warning-surface);
  color: var(--color-warning);
}

.state-closed {
  background: var(--color-sunken);
  color: var(--color-text-muted);
}

.state-disabled {
  background: var(--color-danger-surface);
  color: var(--color-danger);
}

.live-dot {
  display: inline-block;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--color-signal);
  box-shadow: var(--glow-signal);
  animation: signal-pulse var(--duration-pulse) ease-out 2;
}

.sparkline {
  display: block;
  width: 100%;
  height: auto;
}

.sparkline-area {
  stroke: none;
}

.sparkline-stop-start {
  stop-color: var(--color-brand);
  stop-opacity: 0.38;
}

.sparkline-stop-end {
  stop-color: var(--color-brand);
  stop-opacity: 0;
}

.sparkline-label {
  fill: var(--color-text);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sparkline-line {
  fill: none;
  stroke: var(--color-brand);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-baseline {
  stroke: var(--color-border-control);
  stroke-width: 1;
}

.sparkline-dot {
  fill: var(--color-brand);
  stroke: var(--color-surface);
  stroke-width: 2;
}

.sparkline-summary {
  margin: var(--space-2) 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-small);
}

.key-value {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-4);
}

.key-value dt {
  color: var(--color-text-muted);
  font-size: var(--text-small);
}

.key-value dd {
  margin: 0;
  overflow-wrap: break-word;
}

.key-value dd.mono {
  overflow-wrap: anywhere;
}

.choice {
  display: block;
  min-height: var(--size-tap);
  padding: var(--space-2) 0;
}

.field {
  margin-bottom: var(--space-5);
}

.field label {
  display: block;
  font-weight: 600;
}

.field-help {
  margin: 0 0 var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-small);
}

.field-error {
  color: var(--color-danger);
  font-weight: 600;
}

input[type='text'],
input[type='password'],
select {
  width: 100%;
  min-height: var(--size-tap);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-control);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

input[aria-invalid='true'],
select[aria-invalid='true'] {
  border: 2px solid var(--color-danger);
}

.code-input,
.mono {
  font-family: var(--font-mono);
}

.code-input {
  max-width: var(--measure-code);
  font-size: 1.25rem;
  letter-spacing: 0.35em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--size-tap);
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--color-action);
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-quick) var(--ease-out),
    transform var(--duration-quick) var(--ease-out);
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--color-action);
  color: var(--color-on-action);
  box-shadow:
    var(--shadow-highlight),
    0 8px 16px -8px color-mix(in srgb, var(--color-action) 45%, transparent);
}

.button-primary:hover {
  background: var(--color-action-hover);
  border-color: var(--color-action-hover);
}

.button-secondary {
  border-color: var(--color-border-control);
  background: var(--color-surface);
  color: var(--color-action);
}

.button-secondary:hover {
  background: var(--color-info-surface);
}

.button-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: var(--color-on-danger);
}

.button-arrow::after {
  content: '\2192' / '';
  margin-left: var(--space-2);
  transition: transform var(--duration-base) var(--ease-out);
}

.button-arrow:hover::after {
  transform: translateX(3px);
}

.notice {
  animation: notice-arrive var(--duration-arrive) var(--ease-spring) 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-control);
  border-radius: var(--radius-bubble);
  background: var(--color-info-surface);
  color: var(--color-text);
}

main > .notice {
  margin-bottom: 0;
}

.notice p {
  margin: 0;
}

.notice-glyph {
  font-weight: 700;
}

.notice-success {
  background: var(--color-success-surface);
  border-color: var(--color-action);
}

.notice-success strong {
  color: var(--color-action);
}

.notice-warning {
  background: var(--color-warning-surface);
  color: var(--color-warning);
  border-color: var(--color-warning);
}

.notice-error {
  background: var(--color-danger-surface);
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.data-table {
  width: 100%;
  border: 1px solid var(--color-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-bubble);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: var(--text-small);
}

.data-table tbody tr:last-child > * {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--color-info-surface);
}

.data-table td a {
  font-weight: 600;
}

.summary-table td {
  width: 8rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.summary-table th[scope='row'] {
  font-weight: 500;
}

.data-table .mono {
  overflow-wrap: anywhere;
}

.data-table .cell-nowrap {
  overflow-wrap: normal;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cell-truncate {
  display: block;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table thead th {
  background: var(--color-sunken);
  color: var(--color-text-muted);
  font-size: var(--text-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
}

.outcome-failed,
.outcome-locked {
  color: var(--color-danger);
  font-weight: 600;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.filter-form .field {
  flex: 1 1 12rem;
  margin-bottom: 0;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-4);
}

.figure {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-bubble);
  box-shadow: var(--shadow-card);
}

.card .figure {
  border-color: transparent;
  background: var(--color-sunken);
  box-shadow: none;
}

.figure p {
  margin: 0;
}

.figure-label {
  font-size: var(--text-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
}

.figure-label,
.figure-freshness {
  color: var(--color-text-muted);
}

.figure-freshness {
  font-size: var(--text-small);
}

.figure-value {
  font-family: var(--font-display);
  font-size: var(--text-figure);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-4);
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-bubble);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.kpi > p {
  margin: 0;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: var(--text-figure);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}

.kpi-delta {
  display: flex;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-small);
  font-weight: 600;
}

.kpi-delta-up,
.kpi-delta-down {
  color: var(--color-text);
}

.kpi-delta-flat {
  color: var(--color-text-muted);
}

.kpi .sparkline {
  margin-top: auto;
}

.kpi .sparkline-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}

.chart-grid > .card:has(.empty-inline) {
  align-self: start;
}

.freshness {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.freshness-live {
  font-weight: 600;
}

.freshness-hourly::before {
  content: '';
  width: 0.625rem;
  height: 0.625rem;
  border: 2px solid var(--color-text-muted);
  border-radius: var(--radius-pill);
}

.empty-inline {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-small);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-5);
  text-align: center;
}

.empty-state > * {
  margin: 0;
}

.empty-state::before {
  content: '';
  width: 1em;
  height: 1em;
  margin-bottom: var(--space-3);
  font-size: 6rem;
  border-radius: var(--radius-card) var(--radius-card) var(--radius-card) var(--radius-tail);
  background: var(--mark-bubble);
  animation: bubble-breathe var(--duration-breathe) ease-in-out 1;
}

.error-code {
  display: block;
  color: var(--color-brand);
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
}

.error-title {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-heading-2);
}

.chart {
  margin: 0 0 var(--space-4);
}

.chart-plot {
  display: block;
  width: 100%;
  height: auto;
}

.bar-solid,
.bar-hatched {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: bar-grow var(--duration-chart) var(--ease-out) 1;
}

.bar-solid {
  fill: var(--color-brand);
}

.bar-hatched {
  stroke: var(--color-action);
  stroke-width: 1;
}

.hatch-line {
  stroke: var(--color-action);
  stroke-width: 2;
}

.chart-baseline {
  stroke: var(--color-border-control);
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.chart-reference {
  stroke: var(--color-warning);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.chart-reference-label {
  fill: var(--color-warning);
  paint-order: stroke;
  stroke: var(--color-surface);
  stroke-width: 4px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: var(--space-2) 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-small);
}

.legend-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-right: var(--space-2);
  border: 1px solid var(--color-action);
  border-radius: 0.125rem;
  vertical-align: middle;
}

.legend-swatch-solid {
  background: var(--color-brand);
}

.legend-swatch-hatched {
  background: repeating-linear-gradient(45deg, var(--color-action) 0 2px, transparent 2px 5px);
}

.chart details {
  margin-top: var(--space-2);
}

.chart summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--size-tap);
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-sunken);
  cursor: pointer;
  list-style: none;
}

.chart summary::-webkit-details-marker {
  display: none;
}

.chart summary::before {
  content: '\203A' / '';
  transition: transform var(--duration-base) var(--ease-out);
}

.chart details[open] > summary::before {
  transform: rotate(90deg);
}

.budget-warning {
  color: var(--color-warning);
  font-weight: 700;
}

@media (min-width: 40rem) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: saturate(1.6) blur(14px);
  }
}

@media (min-width: 40rem) {
  .form-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 64rem) {
  .kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-card-wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 56rem) {
  .detail-grid {
    grid-template-columns: 5fr 7fr;
  }

  .detail-grid > .card:first-child {
    position: sticky;
    top: 6rem;
  }
}

@media (max-width: 40rem) {
  .kpi-grid,
  .figure-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  main {
    padding: var(--space-5) var(--space-4) var(--space-7);
  }

  .site-header {
    padding: var(--space-3) var(--space-4);
  }

  nav,
  .header-end {
    width: 100%;
  }

  nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-link {
    flex: none;
    padding: 0 var(--space-2);
    white-space: nowrap;
  }

  .nav-link:focus-visible {
    outline-offset: -3px;
  }

  .header-end {
    margin-left: 0;
  }

  .locale-switch {
    flex: 1;
  }

  .locale-switch .button {
    flex: 1;
  }

  .card {
    padding: var(--space-5);
  }

  .filter-form {
    border-radius: var(--radius-bubble);
  }

  .page-head .button,
  .card .button,
  .filter-form .button {
    width: 100%;
  }

  .key-value {
    grid-template-columns: 1fr;
  }

  .data-table {
    display: block;
    border: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
  }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .data-table tbody {
    display: block;
  }

  .data-table tr {
    display: block;
    margin-top: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-bubble);
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    overflow: hidden;
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
  }

  .summary-table td::before {
    display: none;
  }

  .data-table td:empty {
    display: none;
  }

  .data-table td::before {
    content: attr(data-label);
    flex: none;
    color: var(--color-text-muted);
    font-family: var(--font-sans);
    font-weight: 600;
    text-align: left;
  }
}

@media (forced-colors: active) {
  .card,
  .figure {
    border-color: CanvasText;
  }

  .hero-card {
    border-color: CanvasText;
    background: Canvas;
    box-shadow: none;
  }

  .live-dot {
    background: CanvasText;
    box-shadow: none;
  }

  .sparkline-line,
  .sparkline-baseline,
  .bar-solid {
    stroke: CanvasText;
  }

  .sparkline-dot,
  .sparkline-label,
  .bar-solid {
    fill: CanvasText;
  }

  .sparkline-area {
    fill: Canvas;
  }
}
