:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --gap-fill: rgba(11, 11, 11, 0.05);
  --accent: #2a78d6;
  --good-text: #006300;
  --bad-text: #b42323;
  --brand-text: #005437;

  --ok: #0ca30c;
  --late: #fab219;
  --cancel: #d03b3b;
  --series-1: #2a78d6;
  --series-2: #eb6834;

  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --gap-fill: rgba(255, 255, 255, 0.06);
    --accent: #3987e5;
    --good-text: #0ca30c;
    --bad-text: #e66767;
    --brand-text: #ffffff;
    --series-1: #3987e5;
    --series-2: #d95926;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --text: #ffffff;
  --text-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --gap-fill: rgba(255, 255, 255, 0.06);
  --accent: #3987e5;
  --good-text: #0ca30c;
  --bad-text: #e66767;
  --brand-text: #ffffff;
  --series-1: #3987e5;
  --series-2: #d95926;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 16px 64px;
}

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

.masthead { margin-bottom: 32px; }

/* Logo: gelbe Sonnenblume auf "Tanne"-Grün wie im Erscheinungsbild der Grünen */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--brand-text);
  text-decoration: none;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #005437;
  flex: none;
}
.brand-mark img { display: block; width: 30px; height: 30px; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.brand:hover .brand-name { text-decoration: underline; text-underline-offset: 3px; }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}
h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.lede { margin: 0 0 8px; color: var(--text-2); max-width: 62ch; }
.stand { margin: 0; color: var(--muted); font-size: 14px; }

.notice {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.notice::before { content: "⚠︎ "; color: var(--cancel); font-weight: 700; }

.section-title { font-size: 20px; margin: 0 0 4px; }
.section-sub { margin: 0 0 16px; color: var(--text-2); font-size: 14px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label { font-size: 14px; color: var(--text-2); }
.kpi-value { font-size: 34px; font-weight: 600; line-height: 1.1; }
.kpi-value small { font-size: 18px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.kpi-delta { font-size: 13px; color: var(--text-2); }
.kpi-delta.good { color: var(--good-text); }
.kpi-delta.bad { color: var(--bad-text); }
.kpi-hint { font-size: 12px; color: var(--muted); margin-top: auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.card h2 { font-size: 18px; margin: 0 0 4px; }
.card-sub { margin: 0 0 16px; color: var(--text-2); font-size: 14px; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 12px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  background: var(--page);
}
.seg button {
  font: inherit;
  font-size: 14px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  min-height: 32px;
  white-space: nowrap;
}
.seg button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--border);
}
.seg button:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.select { min-width: 0; max-width: 100%; }
.select select {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  min-height: 36px;
  max-width: 100%;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 4px;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-ok { background: var(--ok); }
.sw-late { background: var(--late); }
.sw-cancel { background: var(--cancel); }

.chart { width: 100%; height: 340px; }
.chart-tall { height: 360px; }

.table-view { margin-top: 8px; font-size: 14px; }
.table-view summary { cursor: pointer; color: var(--text-2); padding: 4px 0; }
.table-wrap { overflow-x: auto; max-height: 360px; overflow-y: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { position: sticky; top: 0; background: var(--surface); color: var(--text-2); font-weight: 600; }

.recent-strip {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 16px;
}
.tick { height: 28px; border-radius: 4px; }
.tick-ok { background: var(--ok); }
.tick-late { background: var(--late); }
.tick-cancel { background: var(--cancel); }
.tick-unknown { background: var(--grid); }

.table-recent { max-height: none; }
.table-recent td:last-child, .table-recent th:last-child { text-align: left; }
.table-recent .dest { color: var(--muted); font-size: 13px; }
.delay-late, .delay-cancel { color: var(--bad-text); font-weight: 600; }
.delay-unknown { color: var(--muted); }
.result { display: inline-flex; align-items: center; gap: 6px; }
.result::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--grid); }
.result-ok::before { background: var(--ok); }
.result-late::before { background: var(--late); }
.result-cancel::before { background: var(--cancel); }

.method dl { margin: 0; display: grid; grid-template-columns: 200px 1fr; gap: 10px 20px; font-size: 15px; }
.method dt { font-weight: 600; }
.method dd { margin: 0; color: var(--text-2); }

.footer { margin-top: 32px; color: var(--muted); font-size: 13px; text-align: center; }
.footer p { margin: 4px 0; }

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

.legal { max-width: 70ch; }
.legal h1 { font-size: 28px; margin-bottom: 16px; }
.legal h2 { font-size: 18px; margin-top: 28px; }
.legal .todo { background: var(--gap-fill); padding: 2px 6px; border-radius: 4px; }

@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .page { padding-top: 24px; }
  .card { padding: 16px; }
  .kpi-value { font-size: 28px; }
  .chart { height: 300px; }
  .chart-tall { height: 520px; }
  .method dl { grid-template-columns: 1fr; gap: 2px; }
  .controls { flex-direction: column; align-items: stretch; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 6px 4px; }
  .select select { width: 100%; }
  .method dd { margin-bottom: 10px; }
  .recent-strip { gap: 2px; }
  .tick { height: 22px; border-radius: 3px; }
  .table-recent th, .table-recent td { padding: 6px 6px; }
}
