/* Trainanker — Kontaktabzug: Papier, Filmschwarz, Fettstift. 01.11.2026 */
:root {
  --papier: #eeefec;
  --papier-hoch: #f7f8f5;
  --tinte: #141516;
  --tinte-2: #4a4d4f;
  --tinte-3: #5f6263;
  --linie: #d2d4cf;
  --film: #121314;
  --film-rand: #121314;
  --film-text: #e9eae6;
  --fett: #d72b25;
  --kante: #f2a93b;
  --kante-text: #8a4f00;
  --gruen: #2f7a4b;
  --gelb: #a5620a;
  --fokus-ring: #1f5fbf;
  --radius: 14px;
  --abstand: 16px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier: #0f1011;
    --papier-hoch: #1a1c1d;
    --tinte: #e8e9e5;
    --tinte-2: #b1b4b0;
    --tinte-3: #8d908c;
    --linie: #2b2e2f;
    --film: #000000;
    --film-rand: #2b2e2f;
    --fett: #ff5a4c;
    --kante-text: #f2a93b;
    --gruen: #58b97e;
    --gelb: #e3a248;
    --fokus-ring: #7fb0ff;
  }
}
:root[data-theme="dark"] {
  --papier: #0f1011; --papier-hoch: #1a1c1d; --tinte: #e8e9e5; --tinte-2: #b1b4b0; --tinte-3: #8d908c;
  --linie: #2b2e2f; --film: #000; --film-rand: #2b2e2f; --fett: #ff5a4c; --kante-text: #f2a93b;
  --gruen: #58b97e; --gelb: #e3a248; --fokus-ring: #7fb0ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font: 400 1rem/1.45 var(--schrift);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
::selection { background: var(--kante); color: #141516; }
:focus-visible { outline: 2.5px solid var(--fokus-ring); outline-offset: 2px; border-radius: 6px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; }

main { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) var(--abstand) 24px; }

/* Kopf */
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.kopf h1 { font-size: 2rem; line-height: 1.05; letter-spacing: -0.02em; font-weight: 750; margin: 0; }
.kopf .datum { color: var(--tinte-2); font-size: 0.95rem; margin-top: 4px; }
.stufe-marke {
  flex: none; font-size: 0.85rem; font-weight: 650; padding: 6px 10px; border-radius: 999px;
  background: var(--tinte); color: var(--papier); text-decoration: none; white-space: nowrap;
}

h2 { font-size: 1.06rem; font-weight: 700; margin: 30px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2 .neben { font-size: 0.9rem; font-weight: 500; color: var(--tinte-2); }

/* Morgen-Check */
.check { background: var(--papier-hoch); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; }
.check h2 { margin-top: 0; }
.frage { font-size: 0.92rem; color: var(--tinte-2); margin: 12px 0 8px; }
.wahl { display: flex; flex-wrap: wrap; gap: 6px; }
.wahl button {
  min-width: 46px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--linie); background: var(--papier); font-weight: 600;
}
.wahl button[aria-pressed="true"] { background: var(--tinte); color: var(--papier); border-color: var(--tinte); }
.check .knopf { margin-top: 16px; width: 100%; }

/* Ampel */
.ampel { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0 2px; }
.ampel .punkt { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; background: var(--gruen); }
.ampel.gelb .punkt { background: var(--gelb); }
.ampel.rot .punkt { background: var(--tinte); box-shadow: 0 0 0 3px var(--papier), 0 0 0 4.5px var(--tinte); }
.ampel p { margin: 0; }
.ampel .klein { font-size: 0.88rem; color: var(--tinte-2); }
.textknopf { background: none; border: 0; padding: 8px 0; color: var(--tinte-2); text-decoration: underline; text-underline-offset: 3px; font-size: 0.92rem; min-height: 44px; }

.stopp {
  display: flex; gap: 12px; align-items: flex-start; background: var(--film); color: var(--film-text);
  border: 1px solid var(--film-rand); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0;
}
.stopp svg { flex: none; width: 24px; height: 24px; color: var(--kante); }
.stopp p { margin: 0; }
.stopp strong { display: block; margin-bottom: 2px; }

/* Bildstreifen: eine Zeile je Übung */
.streifen { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linie); }
.streifen li { border-bottom: 1px solid var(--linie); }
.zeile {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 48px; gap: 14px; align-items: center;
  width: 100%; padding: 10px 0; background: none; border: 0; text-align: left; min-height: 72px;
}
.bildchen { width: 84px; aspect-ratio: 5 / 3; background: var(--film); border-radius: 6px; overflow: hidden; display: block; border: 1px solid var(--film-rand); }
.bildchen svg { width: 100%; height: 100%; display: block; }
.zeile .name { font-weight: 650; display: block; overflow-wrap: anywhere; }
.zeile .dosis { color: var(--tinte-2); font-size: 0.9rem; display: block; }
.marke-neu { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; border: 1.5px solid var(--kante-text); color: var(--kante-text); }
.status { width: 48px; height: 46px; position: relative; display: grid; place-items: center; font-size: 0.85rem; color: var(--tinte-2); font-weight: 600; }
.zeile.fertig .name, .zeile.fertig .dosis { color: var(--tinte-3); }

/* Fettstift-Kreis, das Zeichen für erledigt */
.fettkreis { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fettkreis path { stroke: var(--fett); stroke-width: 3.4; fill: none; }
.status .haken { width: 20px; height: 20px; color: var(--fett); stroke-width: 2.6; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 12px; border: 0;
  background: var(--tinte); color: var(--papier); font-weight: 700; font-size: 1.02rem; text-decoration: none;
}
.knopf.zart { background: transparent; color: var(--tinte); border: 1.5px solid var(--tinte); }
.knopf:disabled { opacity: 0.35; cursor: default; }
.knopf svg { width: 20px; height: 20px; }
.knopf.klein { min-height: 40px; padding: 0 14px; font-size: 0.92rem; }

/* Übung */
.uebung { padding-top: calc(env(safe-area-inset-top) + 8px); }
.oben { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 8px; }
.oben a, .oben button { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; background: none; border: 0; padding: 8px 8px 8px 0; color: var(--tinte); font-weight: 600; min-height: 44px; }
.oben svg { width: 22px; height: 22px; }
.oben .zaehler { color: var(--tinte-2); font-size: 0.92rem; }

.buehne { position: relative; background: var(--film); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--film-rand); margin: 0 calc(var(--abstand) * -0.25); }
.buehne svg.figur { display: block; width: 100%; aspect-ratio: 5 / 3; }
.bildleiste { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px 14px; border-top: 1px solid #26292b; min-height: 60px; }
.buehne .text { flex: 1; margin: 0; color: var(--film-text); font-weight: 650; font-size: 1.15rem; line-height: 1.3; }
.buehne .text .nr { color: var(--kante); margin-right: 8px; }
.buehne .steuer { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.12); color: var(--film-text); display: grid; place-items: center; }
.legende { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-weight: 600; color: var(--kante-text); }
.legende i { flex: none; width: 28px; border-top: 3px dashed var(--kante); }
.buehne .steuer svg { width: 20px; height: 20px; }

.figur .boden { stroke: #34373a; stroke-width: 2; }
.figur .fern line { stroke: #85888a; }
.figur.ansicht-vorn .fern line { stroke: #cfd0cb; }
.figur .rumpf line, .figur .rumpf circle { stroke: #ecece8; fill: #ecece8; }
.figur .nah line { stroke: #f7f7f3; }
.figur .requisit rect, .figur .requisit line { stroke: #6f7274; fill: none; stroke-width: 3; }
.figur .requisit .warm { fill: #c8552b; stroke: none; }
.figur .band { stroke: var(--kante); stroke-width: 4; }
.figur .last { fill: #7a7d80; stroke: none; }
.figur .akzent ellipse, .figur .akzent circle { fill: none; stroke: var(--kante); stroke-width: 2.5; opacity: 0.6; }
.figur .hilfslinie { opacity: 0.32; transition: opacity 0.3s; }
.figur .hilfslinie.an { opacity: 1; }
.figur .hilfslinie line { stroke: var(--kante); stroke-width: 2.2; stroke-dasharray: 5 5; }
.figur .hilfslinie text { fill: var(--kante); stroke: none; font: 600 11px var(--schrift); }

.titel { margin: 18px 0 2px; font-size: 1.6rem; line-height: 1.1; letter-spacing: -0.015em; font-weight: 750; }
.unter { margin: 0; color: var(--tinte-2); }
.dosis-gross { font-size: 1.25rem; font-weight: 700; margin: 12px 0 0; }

/* Sätze, Halten, Messen */
.saetze { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 14px; }
.satz {
  position: relative; min-height: 64px; border-radius: 12px; border: 1.5px solid var(--linie);
  background: var(--papier-hoch); font-weight: 650; display: grid; place-items: center; padding: 6px;
}
.satz small { display: block; font-weight: 500; color: var(--tinte-2); font-size: 0.78rem; }
.satz[aria-pressed="true"] { border-color: var(--fett); }
.satz .fettkreis { inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); }

.uhr { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; background: var(--papier-hoch); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; }
.uhr .zeit { font-size: 2.6rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1; }
.uhr .seite { color: var(--tinte-2); font-size: 0.9rem; margin-top: 4px; }
.uhr.laeuft .zeit { color: var(--fett); }

.messen { display: grid; gap: 8px; margin-top: 14px; }
.mess { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 10px; background: var(--papier-hoch); border: 1px solid var(--linie); border-radius: 12px; padding: 10px 12px; }
.mess .wert { font-size: 1.6rem; font-weight: 750; }
.mess .wert small { font-size: 0.9rem; color: var(--tinte-2); font-weight: 500; }
.unterschied { margin: 6px 0 0; font-weight: 650; }

.fokus { margin-top: 26px; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--film); color: var(--film-text); border: 1px solid var(--film-rand); }
.fokus svg { width: 24px; height: 24px; color: var(--kante); }
.fokus strong { display: block; color: var(--kante); font-size: 0.85rem; margin-bottom: 2px; }
.fokus p { margin: 0; font-size: 1.02rem; line-height: 1.4; }

.ablauf { margin: 8px 0 0; padding: 0; list-style: none; counter-reset: s; }
.ablauf li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.ablauf li::before { content: counter(s); font-weight: 750; color: var(--tinte-2); }
.abbruch { color: var(--tinte-2); margin: 10px 0 0; }
.abbruch strong { color: var(--tinte); }

.unten-fest {
  position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); margin-top: 26px; padding: 12px 0;
  background: linear-gradient(to top, var(--papier) 70%, transparent);
  display: grid; gap: 8px;
}
.unten-fest .knopf { width: 100%; }

/* Schmerz */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--linie); background: var(--papier-hoch); font-weight: 600; }
.chips button[aria-pressed="true"] { background: var(--tinte); color: var(--papier); border-color: var(--tinte); }
.warn-zeile { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--tinte); background: transparent; width: 100%; text-align: left; min-height: 56px; }
.warn-zeile svg { width: 24px; height: 24px; flex: none; }
.warn-zeile[aria-pressed="true"] { background: var(--film); color: var(--film-text); border-color: var(--film); }
.hinweise { margin: 0; padding: 0 0 0 18px; }
.hinweise li { margin: 6px 0; }
.lassen { color: var(--tinte-2); }
.leer { color: var(--tinte-2); padding: 12px 0; }

/* Verlauf */
.verlauf-zeile { display: grid; grid-template-columns: 76px 64px 48px minmax(0, 1fr); gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linie); font-size: 0.95rem; }
.verlauf-zeile .tag { font-weight: 650; }
.verlauf-zeile .leiste-punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--gruen); }
.verlauf-zeile .leiste-punkt.ja { background: var(--tinte); box-shadow: 0 0 0 2px var(--papier), 0 0 0 3.5px var(--tinte); }
.verlauf-zeile .leiste-punkt.leer { background: none; border: 1.5px solid var(--linie); }
.verlauf-zeile .mehr { color: var(--tinte-2); overflow-wrap: anywhere; }
.verlauf-kopf { font-size: 0.8rem; color: var(--tinte-2); border-bottom: 1px solid var(--linie); }
.freigabe { background: var(--papier-hoch); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; }
.freigabe p { margin: 4px 0; }
.balken { height: 6px; border-radius: 3px; background: var(--linie); overflow: hidden; margin: 6px 0 10px; }
.balken i { display: block; height: 100%; background: var(--tinte); }
.freigabe .knoepfe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.gesperrt { margin: 0; padding-left: 18px; color: var(--tinte-2); }
.gesperrt li { margin: 4px 0; }
.fuss { margin-top: 30px; color: var(--tinte-3); font-size: 0.85rem; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* Anmeldung */
.anmeldung { min-height: 80vh; display: grid; align-content: center; gap: 14px; }
.anmeldung h1 { font-size: 2.2rem; margin: 0; letter-spacing: -0.02em; }
.anmeldung input { min-height: 54px; border-radius: 12px; border: 1.5px solid var(--linie); background: var(--papier-hoch); padding: 0 14px; font-size: 1.3rem; letter-spacing: 0.12em; text-transform: uppercase; }
.fehler { color: var(--fett); min-height: 1.4em; margin: 0; }

/* Leiste unten */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: color-mix(in srgb, var(--papier) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom);
}
.leiste a { display: grid; justify-items: center; gap: 2px; padding: 9px 0 8px; text-decoration: none; color: var(--tinte-3); font-size: 0.74rem; font-weight: 650; min-height: 56px; }
.leiste a svg { width: 25px; height: 25px; }
.leiste a[aria-current="page"] { color: var(--tinte); }

.hinweis { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--tinte); color: var(--papier); padding: 10px 16px; border-radius: 999px; font-weight: 650; z-index: 9; max-width: calc(100% - 32px); }

.leiste[hidden], .hinweis[hidden] { display: none; }
.zeile, .zeile:visited { text-decoration: none; color: inherit; }
.bildchen .hilfslinie text { display: none; }
.code-karte { margin-top: 18px; background: var(--film); color: var(--film-text); border: 1px solid var(--film-rand); border-radius: var(--radius); padding: 16px; }
.code-karte .unter { color: #b1b4b0; }
.code-karte .code { font-size: 2.4rem; font-weight: 750; letter-spacing: 0.12em; margin: 4px 0; color: var(--kante); }
.code-karte .knoepfe, .liste .knoepfe { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code-karte .knopf { background: var(--film-text); color: var(--film); }
.code-karte .knopf.zart { background: transparent; color: var(--film-text); border-color: var(--film-text); }
.liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linie); }
.liste li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.liste strong { display: block; overflow-wrap: anywhere; }
.liste small { display: block; color: var(--tinte-2); font-size: 0.88rem; }
.anlegen { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; }
.anlegen input { min-height: 44px; border-radius: 10px; border: 1.5px solid var(--linie); background: var(--papier-hoch); padding: 0 12px; }
.klein-hinweis { font-size: 0.9rem; margin-top: 10px; }
.zeitfeld { min-height: 44px; border-radius: 10px; border: 1.5px solid var(--linie); background: var(--papier-hoch); padding: 0 8px; font-weight: 650; }
.zeitfeld:disabled { opacity: 0.4; }
.schalter { width: 52px; height: 32px; border-radius: 16px; border: 0; background: var(--linie); position: relative; padding: 0; flex: none; }
.schalter i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.schalter[aria-checked="true"] { background: var(--gruen); }
.schalter[aria-checked="true"] i { transform: translateX(20px); }
.tages-hinweise { margin: 10px 0 0; color: var(--tinte-2); }
.sitzen { padding: 12px 0; border-bottom: 1px solid var(--linie); }
.sitzen-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sitzen-kopf strong, .sitzen-kopf small { display: block; }
.sitzen-kopf small { color: var(--tinte-2); font-size: 0.88rem; }
.sitzen-felder { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.sitzen-felder[hidden] { display: none; }
.sitzen-felder label { display: flex; align-items: center; gap: 6px; color: var(--tinte-2); }
.sitzen-felder select { min-height: 44px; border-radius: 10px; border: 1.5px solid var(--linie); background: var(--papier-hoch); padding: 0 8px; font-weight: 650; }
.sitzen-felder .wahl button { min-width: 44px; padding: 0 8px; }
.tabelle-rahmen { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tabelle th, .tabelle td { text-align: left; padding: 7px 4px 7px 0; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle th { color: var(--tinte-2); font-weight: 600; }
@media print {
  .leiste, .nicht-drucken, .hinweis { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  main { max-width: none; padding: 0; }
  .tabelle th, .tabelle td { border-color: #bbb; }
}
.verborgen { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

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