/* Zaehler - Auswertung. Ein Arbeitswerkzeug: dichte Tabellen, ruhige Farben,
   lesbar auch auf dem Telefon. */

:root {
  --papier: #fbfbf9;
  --karte: #ffffff;
  --linie: #e3e1dc;
  --text: #22201d;
  --leise: #6d6a64;
  --ton: #2f6f5e;
  --ton-hell: #e6f0ec;
  --warn: #9a4a2f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier: #17191a; --karte: #1f2223; --linie: #34383a;
    --text: #e8e6e2; --leise: #9a9790; --ton: #6fb9a2; --ton-hell: #23332f;
    --warn: #d8896a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

.huelle { max-width: 72rem; margin: 0 auto; padding: 1rem 1rem 4rem; }

/* ---- Kopf ---- */

.kopf {
  display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center;
  padding: .9rem 1rem; margin-bottom: 1.25rem;
  background: var(--karte); border: 1px solid var(--linie); border-radius: .6rem;
}
.kopf h1 { margin: 0; font-size: 1.05rem; letter-spacing: .01em; }
.kopf .rechts { margin-left: auto; display: flex; gap: .75rem; align-items: center; }
.kopf select { font: inherit; padding: .35rem .5rem; border-radius: .35rem;
  border: 1px solid var(--linie); background: var(--papier); color: var(--text); }
.kopf .wer { color: var(--leise); font-size: .85rem; }

.spanne { display: flex; flex-wrap: wrap; gap: .3rem; }
.spanne a {
  padding: .3rem .7rem; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--linie); color: var(--leise); font-size: .85rem;
}
.spanne a.an { background: var(--ton); border-color: var(--ton); color: #fff; }

.reiter { display: flex; gap: .25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.reiter a {
  padding: .45rem .9rem; text-decoration: none; color: var(--leise);
  border-bottom: 2px solid transparent; font-size: .92rem;
}
.reiter a.an { color: var(--text); border-bottom-color: var(--ton); font-weight: 600; }

/* ---- Kennzahlen ---- */

.zahlen { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); margin-bottom: 1.25rem; }
.zahl { background: var(--karte); border: 1px solid var(--linie); border-radius: .6rem; padding: .85rem 1rem; }
.zahl b { display: block; font-size: 1.7rem; font-weight: 650; line-height: 1.1; letter-spacing: -.02em; }
.zahl span { display: block; color: var(--leise); font-size: .82rem; margin-top: .2rem; }
.zahl small { display: block; color: var(--leise); font-size: .74rem; margin-top: .35rem; }

/* ---- Karten und Tabellen ---- */

.karte {
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: .6rem; padding: 1rem; margin-bottom: 1.25rem;
}
.karte > h2 { margin: 0 0 .2rem; font-size: 1rem; }
.karte > p.unter { margin: 0 0 .9rem; color: var(--leise); font-size: .84rem; }

.huelle-tabelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
/* Auf dem Telefon lieber seitlich schieben als eine URL in Fuenferhaeppchen
   zerlegen - eine zerbrochene Adresse ist nicht mehr lesbar. */
.huelle-tabelle table { min-width: 31rem; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--linie); }
th { color: var(--leise); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; }
.pfad { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; overflow-wrap: anywhere; }

/* Balken hinter der Zahl - zeigt das Verhaeltnis ohne eigene Spalte. */
.anteil { position: relative; }
.anteil i {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: 1.35rem; background: var(--ton-hell); border-radius: .2rem; z-index: 0;
}
.anteil span { position: relative; z-index: 1; }
/* Breite in Fuenferschritten als Klasse - ein style="..."-Attribut waere
   durch die Content-Security-Policy blockiert. */
.anteil i.w5 { width: 5%; }
.anteil i.w10 { width: 10%; }
.anteil i.w15 { width: 15%; }
.anteil i.w20 { width: 20%; }
.anteil i.w25 { width: 25%; }
.anteil i.w30 { width: 30%; }
.anteil i.w35 { width: 35%; }
.anteil i.w40 { width: 40%; }
.anteil i.w45 { width: 45%; }
.anteil i.w50 { width: 50%; }
.anteil i.w55 { width: 55%; }
.anteil i.w60 { width: 60%; }
.anteil i.w65 { width: 65%; }
.anteil i.w70 { width: 70%; }
.anteil i.w75 { width: 75%; }
.anteil i.w80 { width: 80%; }
.anteil i.w85 { width: 85%; }
.anteil i.w90 { width: 90%; }
.anteil i.w95 { width: 95%; }
.anteil i.w100 { width: 100%; }

/* ---- Verlauf ---- */

.verlauf { display: block; width: 100%; height: 9rem; }
.verlauf rect { fill: var(--ton); opacity: .85; }
.verlauf rect:hover { opacity: 1; }
.verlauf rect.leer { fill: var(--linie); opacity: .5; }
.verlauf-achse { display: flex; justify-content: space-between; color: var(--leise); font-size: .75rem; margin-top: .4rem; }

/* ---- Hinweise ---- */

.leer { color: var(--leise); padding: 1.5rem 0; text-align: center; }
.merke { background: var(--ton-hell); border-radius: .4rem; padding: .7rem .9rem; font-size: .86rem; margin: 0 0 1rem; }
.warnung { color: var(--warn); }

/* ---- Formulare ---- */

form.reihe { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
label.feld { display: block; font-size: .82rem; color: var(--leise); }
label.feld input {
  display: block; font: inherit; margin-top: .2rem; padding: .45rem .55rem;
  border: 1px solid var(--linie); border-radius: .35rem;
  background: var(--papier); color: var(--text); min-width: 14rem;
}
button {
  font: inherit; padding: .5rem 1.1rem; border: none; border-radius: .35rem;
  background: var(--ton); color: #fff; cursor: pointer;
}
button:hover { filter: brightness(1.08); }

.einbau-kopf { margin: .9rem 0 0; }

code.einbau {
  display: block; padding: .6rem .7rem; background: var(--papier);
  border: 1px solid var(--linie); border-radius: .35rem;
  font-size: .8rem; word-break: break-all; margin-top: .4rem;
}

/* ---- Anmeldung ---- */

.anmeldung { max-width: 20rem; margin: 15vh auto; padding: 0 1rem; }
.anmeldung h1 { font-size: 1.15rem; margin: 0 0 1.25rem; }
.anmeldung label.feld { margin-bottom: .75rem; }
.anmeldung label.feld input { width: 100%; min-width: 0; }
.anmeldung button { width: 100%; }
.anmeldung .fehler { color: var(--warn); font-size: .86rem; margin: 0 0 .75rem; }

@media (max-width: 40rem) {
  .kopf .rechts { margin-left: 0; width: 100%; }
  .zahl b { font-size: 1.4rem; }
}
