/* AREtrend. Farben, Typografie und Abstände als Tokens. Keine externen Ressourcen. */
:root {
  --paper: #eef3f4;
  --surface: #ffffff;
  --ink: #12272f;
  --muted: #4d6169;
  --line: #c9d7db;
  --water: #136f8a;

  --low: #2f9e6e;
  --mid: #e0a21b;
  --high: #d1453b;
  --low-ink: #1b6a47;
  --mid-ink: #7d5600;
  --high-ink: #a22a21;
  --tone-0: #14663f;
  --tone-1: #4a6a12;
  --tone-2: #7d5600;
  --tone-3: #a3470f;
  --tone-4: #a22a21;

  --serif: "Iowan Old Style", "Charter", "Sitka Text", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1b20;
    --surface: #142830;
    --ink: #e6eef0;
    --muted: #9fb2b9;
    --line: #2b434c;
    --water: #5cc0dd;
    --low-ink: #6fd1a1;
    --mid-ink: #f0c25a;
    --high-ink: #ff8f84;
    --tone-0: #6fd1a1;
    --tone-1: #b3d46a;
    --tone-2: #f0c25a;
    --tone-3: #f59a5c;
    --tone-4: #ff8f84;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; }

a { color: var(--water); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; border-radius: 3px; }
code { font: 0.9em ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; display: flex; align-items: center; gap: 0.65rem; }
.logo { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; }
h2 { font-size: 1.35rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
p { margin: 0 0 0.9rem; max-width: 40rem; }
section { margin-top: 2.5rem; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; }
.stand { margin: 0; color: var(--muted); }

.lead { color: var(--muted); }

/* Gesamtskala */
.hero {
  margin-top: 1.25rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.status { margin: 0; font-family: var(--serif); font-size: 1.15rem; display: flex; align-items: center; gap: 0.4rem; }
.status.big { font-size: clamp(2.5rem, 9vw, 3.75rem); line-height: 1.05; letter-spacing: -0.01em; }
.cat-tone-0 { color: var(--tone-0); }
.cat-tone-1 { color: var(--tone-1); }
.cat-tone-2 { color: var(--tone-2); }
.cat-tone-3 { color: var(--tone-3); }
.cat-tone-4 { color: var(--tone-4); }
.cat-unbekannt { color: var(--muted); }

/* Skala */
.scale { position: relative; margin: 1.1rem 0 0.35rem; }
.track {
  height: 0.9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--low), var(--mid) 50%, var(--high));
}
.scale.big .track { height: 1.6rem; }
.tick {
  position: absolute; top: 0; bottom: 0;
  left: var(--pos, 50%);
  width: 2px; margin-left: -1px;
  background: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}
.marker {
  position: absolute;
  left: clamp(0.3rem, var(--pos, 0%), calc(100% - 0.3rem));
  top: -0.35rem;
  bottom: -0.35rem;
  width: 0.4rem;
  margin-left: -0.2rem;
  background: var(--ink);
  border: 2px solid var(--surface);
  border-radius: 0.3rem;
  animation: arrive 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes arrive { from { left: 0%; } }
.scale-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.9rem; }
.detail { color: var(--ink); }

/* Viren */
.viren { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.virus {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1.5rem;
  padding: 1.1rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
}
.virus-head h3 { margin: 0 0 0.15rem; }
.virus-scale .scale { margin-top: 0.8rem; }
.virus-foot { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.92rem; max-width: none; }
.history { grid-column: 1 / -1; }
@media (min-width: 40rem) {
  .virus { grid-template-columns: 13rem 1fr; }
}
.trend { flex: none; }
.trend-steigend { transform: rotate(-45deg); }
.trend-fallend  { transform: rotate(45deg); }

.verlauf { font-weight: 600; white-space: nowrap; }

/* Verlauf */
.history {
  margin-top: 0.9rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative;
}
.hero .history { background: var(--paper); }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 0.5rem; padding: 0; list-style: none; font-size: 0.88rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 0.4rem; }
.legend .sw { width: 1.3rem; height: 0; border-top: 3px solid; }
.legend .sw.dash { border-top-style: dashed; border-top-width: 2px; }
.legend .sw.thin { border-top-width: 1.5px; }
.legend .sw.dotted { border-top-style: dotted; border-top-width: 3px; }
.chart-box { position: relative; }
.chart { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart text { font: 12px var(--sans); fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; }
.chart .s-main { fill: none; stroke: var(--water); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .s-second { fill: none; stroke: var(--mid-ink); stroke-width: 1.75; stroke-linejoin: round; }
.chart .s-raw { fill: none; stroke: var(--muted); stroke-width: 1; opacity: 0.55; }
.chart .dot { fill: var(--muted); opacity: 0.8; }
.chart .s-median { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .ref-low  { stroke: var(--low); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .ref-high { stroke: var(--high); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .guide { stroke: var(--ink); stroke-width: 1; opacity: 0.5; }
.chart .hit { fill: var(--water); stroke: var(--surface); stroke-width: 2; }
.tip {
  position: absolute; top: 0; left: 0;
  min-width: 10rem; max-width: 16rem;
  padding: 0.5rem 0.65rem;
  background: var(--ink); color: var(--paper);
  border-radius: 8px; font-size: 0.85rem; line-height: 1.4;
  pointer-events: none;
}
.tip[hidden] { display: none; }
.tip strong { display: block; }
.unit { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--muted); }
details.table { margin-top: 0.6rem; font-size: 0.9rem; }
details.table summary { cursor: pointer; color: var(--water); font-weight: 600; }
.table-scroll { max-height: 22rem; overflow: auto; margin-top: 0.5rem; border: 1px solid var(--line); border-radius: 8px; }
details.table table { border-collapse: collapse; width: 100%; }
details.table th, details.table td { text-align: right; padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
details.table th:first-child, details.table td:first-child { text-align: left; }
details.table thead th { position: sticky; top: 0; background: var(--surface); border-bottom: 2px solid var(--line); z-index: 1; }
.hero details.table thead th { background: var(--paper); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.err { color: var(--high-ink); margin: 0; }

/* Datenstand */
.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.facts dt { font-weight: 600; margin-top: 0.7rem; }
.facts dd { margin: 0; color: var(--muted); }
@media (min-width: 40rem) {
  .facts { grid-template-columns: 14rem 1fr; }
  .facts dt, .facts dd { padding: 0.5rem 0; border-top: 1px solid var(--line); margin: 0; }
}

/* Fuß und Rechtliches */
.foot { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.foot nav { display: flex; gap: 1.25rem; }
.legal { color: var(--muted); font-size: 0.92rem; }
.legal h2 { font-size: 1.1rem; color: var(--ink); }
.warn { padding: 0.6rem 0.8rem; border: 1px solid var(--high-ink); border-radius: 8px; color: var(--high-ink); }
address { font-style: normal; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marker { animation: none; }
}

/* Hinweis zur Datenlage */
.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  margin-top: 1.1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--mid);
  border-radius: 12px;
}
.notice svg { width: 1.6rem; height: 1.6rem; margin-top: 0.1rem; color: var(--mid-ink); }
.notice h2 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.notice p { margin: 0; max-width: none; }
.notice p + p { margin-top: 0.7rem; }

/* Dunkelziffer */
.dz-stats { display: grid; grid-template-columns: 1fr; gap: 0.9rem; margin: 1rem 0; }
@media (min-width: 40rem) { .dz-stats { grid-template-columns: 1fr 1fr; } }
.dz-stat { display: flex; flex-direction: column; gap: 0.15rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.dz-stat strong { font: 600 1.7rem/1.25 var(--serif); }
.dz-est strong { color: var(--water); }
.dz-label, .dz-sub { color: var(--muted); font-size: 0.9rem; }
.dz-control { margin: 1rem 0; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.dz-control[hidden] { display: none; }
.dz-control label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.dz-row { display: flex; gap: 1rem; align-items: center; }
.dz-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--water); }
.dz-row input[type="number"] { width: 5.5rem; font: inherit; padding: 0.35rem 0.5rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.dz-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.dz-presets button { font: inherit; font-size: 0.92rem; padding: 0.4rem 0.85rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.dz-presets button[aria-pressed="true"] { background: var(--water); border-color: var(--water); color: var(--surface); font-weight: 600; }
.dz-own { max-width: 40rem; }
.steps { max-width: 40rem; padding-left: 1.25rem; margin: 0 0 0.9rem; }
.steps li { margin-bottom: 0.55rem; }

/* Karteireiter: Registerkarten auf einem Rahmen, der aktive Reiter ist mit dem Inhalt verbunden */
:root { --tab-off: #dfe9ec; }
@media (prefers-color-scheme: dark) { :root { --tab-off: #0a1519; } }
.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: flex-end; gap: 0.3rem;
  margin: 1.25rem 0 0; padding: 0.5rem 0 0;
  background: var(--paper);
}
.tabs::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
.tabs[hidden] { display: none; }
.tabs [role="tab"] {
  position: relative; z-index: 1;
  flex: 0 1 auto; min-width: 0;
  font: inherit; font-weight: 600; line-height: 1.25;
  padding: 0.75rem 1.3rem;
  color: var(--muted); background: var(--tab-off);
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  cursor: pointer;
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] {
  color: var(--ink); background: var(--paper);
  border-bottom-color: var(--paper);
  box-shadow: inset 0 3px 0 var(--water);
}
.tabpanels {
  padding: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 14px 14px;
}
.tabs[hidden] + .tabpanels, .tabpanels.alone { border-top: 1px solid var(--line); border-radius: 14px; margin-top: 1.25rem; }
.tabpanel > :first-child { margin-top: 0; }
.tabpanel { scroll-margin-top: 4.5rem; }
.tabpanel [id] { scroll-margin-top: 4.5rem; }
.tabpanel .notice { margin-top: 0; }
.tabpanel .hero { margin-top: 2.5rem; }
.panel-meta { margin: 0 0 0.9rem; max-width: none; text-align: right; font-size: 0.9rem; color: var(--muted); }
.panel-meta a { color: inherit; }
.notice.info { border-color: var(--water); }
.notice.info svg { color: var(--water); }
.notice + section, .notice + .viren { margin-top: 2rem; }
@media (max-width: 40rem) {
  .tabs [role="tab"] { flex: 1 1 0; padding: 0.7rem 0.5rem; }
  .tabpanels { padding: 0.9rem; }
  .notice { grid-template-columns: 1fr; padding: 0.85rem 1rem; }
  .notice svg { display: none; }
}
.virus-conv { grid-column: 1 / -1; margin: 0.35rem 0 0; color: var(--muted); font-size: 0.92rem; max-width: none; }

/* Eingeklappter Hinweis */
.notice-points { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.notice-points li { margin: 0; padding: 0.15rem 0; }
.notice-more { margin-top: 0.55rem; }
.notice-more > summary {
  display: inline-block; cursor: pointer; padding: 0.3rem 0;
  font-weight: 600; color: var(--water); list-style: none;
}
.notice-more > summary::-webkit-details-marker { display: none; }
.notice-more > summary::before {
  content: ""; display: inline-block; margin-right: 0.55rem; vertical-align: 0.05em;
  border-left: 0.45rem solid currentColor; border-top: 0.3rem solid transparent; border-bottom: 0.3rem solid transparent;
  transition: transform 0.15s;
}
.notice-more[open] > summary::before { transform: rotate(90deg); }
.notice-more:not([open]) .less { display: none; }
.notice-more[open] .more { display: none; }
.notice-more h3 { font-size: 1rem; margin: 1rem 0 0.25rem; }
.notice-more p { margin: 0 0 0.5rem; }
.history.inline { margin-top: 0.5rem; }
@media (prefers-reduced-motion: reduce) { .notice-more > summary::before { transition: none; } }

.dz-result { margin: 0.7rem 0 0.8rem; font-weight: 600; color: var(--water); max-width: none; }
