:root {
  --hg: #FAF7F2;
  --flaeche: #FFFFFF;
  --text: #1F1B16;
  --text-leise: #6B635A;
  --linie: #E6DFD4;
  --balken-hg: #EEE8DF;
  --balken: #8C8276;
  --akzent: #B9532A;
  --akzent-text: #FFFFFF;
  --akzent-zart: rgba(185, 83, 42, 0.16);
  --warn: #9A3412;
  --radius: 14px;
  --sicher-oben: env(safe-area-inset-top, 0px);
  --sicher-unten: env(safe-area-inset-bottom, 0px);
  --sicher-links: env(safe-area-inset-left, 0px);
  --sicher-rechts: env(safe-area-inset-right, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --hg: #161412;
    --flaeche: #211E1B;
    --text: #F2EEE8;
    --text-leise: #A79E93;
    --linie: #34302B;
    --balken-hg: #2C2824;
    --balken: #A79E93;
    --akzent: #E08452;
    --akzent-text: #1A120D;
    --akzent-zart: rgba(224, 132, 82, 0.2);
    --warn: #F0A27A;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--hg); color: var(--text); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
[hidden] { display: none !important; }

.app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(8px + var(--sicher-oben)) calc(20px + var(--sicher-rechts)) calc(88px + var(--sicher-unten)) calc(20px + var(--sicher-links));
}

.kopf { display: flex; align-items: center; justify-content: center; min-height: 44px; }
.titel { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; color: var(--text-leise); }

.ansicht { padding-top: 8px; }

/* Zuhören */
.buehne {
  position: relative;
  width: min(64vw, 240px);
  aspect-ratio: 1;
  margin: clamp(16px, 6vh, 48px) auto 0;
  display: grid;
  place-items: center;
}
.pegel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--akzent-zart);
  transform: scale(1);
  transition: transform 80ms linear, opacity 200ms;
  opacity: 0;
}
.aufnahme .pegel { opacity: 1; }
.fortschritt {
  position: absolute;
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  transform: rotate(-90deg);
  pointer-events: none;
  opacity: 0;
}
.aufnahme .fortschritt { opacity: 1; }
.fortschritt circle {
  fill: none;
  stroke: var(--akzent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.hauptknopf {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 0;
  background: var(--akzent);
  color: var(--akzent-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(120, 50, 20, 0.18);
  transition: transform 150ms ease;
  touch-action: manipulation;
}
.hauptknopf:active { transform: scale(0.97); }
.hauptknopf:disabled { cursor: default; }
.mikro { width: 22%; height: auto; }
.knopf-rest { font-size: 15px; font-weight: 500; opacity: 0.9; }

.status {
  text-align: center;
  margin: 28px auto 0;
  max-width: 320px;
  min-height: 48px;
  color: var(--text-leise);
}
.status.warnung { color: var(--warn); font-weight: 500; }
.abbrechen-platz { display: flex; justify-content: center; min-height: 48px; }

.text-knopf {
  min-height: 44px;
  padding: 10px 18px;
  background: none;
  border: 0;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.schnell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.schnell-knopf {
  min-height: 64px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--linie);
  background: var(--flaeche);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
}
.schnell-titel { font-weight: 600; font-size: 15px; }
.schnell-zeit { font-size: 14px; color: var(--text-leise); }
.schnell-knopf.bestaetigt { border-color: var(--akzent); }
.hinweis { font-size: 13px; color: var(--text-leise); text-align: center; margin-top: 20px; }

/* Ergebnis */
.etikett { font-size: 14px; color: var(--text-leise); margin: 16px 0 4px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 20px; font-weight: 650; overflow-wrap: anywhere; }
h2 { font-size: 18px; margin: 32px 0 12px; font-weight: 600; }
.balken { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.balken li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.balken .name { font-weight: 500; }
.balken .wert { font-variant-numeric: tabular-nums; color: var(--text-leise); }
.balken .spur { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--balken-hg); overflow: hidden; }
.balken .fuellung { height: 100%; border-radius: 4px; background: var(--balken); }
.balken li.vorne .fuellung { background: var(--akzent); }
.balken li.vorne .wert { color: var(--text); font-weight: 600; }
.knapp { margin: -8px 0 20px; color: var(--text-leise); }
.grundlage { margin: 22px 0 0; font-weight: 500; }
.ehrlich { margin: 8px 0 0; color: var(--text-leise); font-size: 15px; }

.auswahl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auswahl button {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  text-align: left;
  font-size: 15px;
  line-height: 1.3;
}
.auswahl button.breit { grid-column: 1 / -1; }
.auswahl button[aria-pressed="true"] {
  border-color: var(--akzent);
  box-shadow: inset 0 0 0 1px var(--akzent);
  font-weight: 600;
}
.danke { min-height: 24px; margin: 12px 0 0; color: var(--text-leise); }
.zweit-knopf {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  border-radius: 999px;
  border: 1px solid var(--text);
  background: transparent;
  font-weight: 600;
}

/* Verlauf */
.zaehler { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.zaehler li { padding: 6px 12px; border-radius: 999px; background: var(--balken-hg); font-size: 14px; }
.eintraege { list-style: none; padding: 0; margin: 16px 0 0; }
.eintrag { border-top: 1px solid var(--linie); padding: 16px 0; }
.eintrag:last-child { border-bottom: 1px solid var(--linie); }
.eintrag .zeit { font-size: 14px; color: var(--text-leise); }
.eintrag .zeile { margin: 2px 0; overflow-wrap: anywhere; }
.eintrag .aktionen { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 4px 0 0 -18px; }
.eintrag .auswahl { margin-top: 10px; }
.nachfrage { margin-top: 8px; padding: 12px; border-radius: 12px; background: var(--balken-hg); }
.nachfrage p { margin: 0 0 4px; }
.leer { color: var(--text-leise); }

/* Info */
.info p, .info li { color: var(--text); }
.info ul { padding-left: 20px; }
.info .klein { font-size: 14px; color: var(--text-leise); }
.kennzahlen { width: 100%; border-collapse: collapse; font-size: 15px; }
.kennzahlen td { padding: 8px 0; border-top: 1px solid var(--linie); vertical-align: top; }
.kennzahlen td:last-child { text-align: right; font-variant-numeric: tabular-nums; padding-left: 12px; white-space: nowrap; }
.wichtig { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--linie); background: var(--flaeche); }

/* Navigation */
.reiter {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 460px;
  margin: 0 auto;
  padding: 0 calc(8px + var(--sicher-rechts)) var(--sicher-unten) calc(8px + var(--sicher-links));
  background: var(--hg);
  border-top: 1px solid var(--linie);
  z-index: 10;
}
.reiter button {
  min-height: 56px;
  border: 0;
  background: none;
  font-size: 15px;
  color: var(--text-leise);
  position: relative;
}
.reiter button.aktiv { color: var(--text); font-weight: 600; }
.reiter button.aktiv::after {
  content: "";
  position: absolute;
  left: 30%;
  right: 30%;
  top: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--akzent);
}
@media (min-width: 461px) {
  .reiter { border-left: 1px solid var(--linie); border-right: 1px solid var(--linie); }
}
@media (prefers-reduced-motion: reduce) {
  .pegel, .hauptknopf { transition: none; }
}
