/* Handy-Seite im iOS-Stil (Impeccable-Kritik und Entwurf vom 15.11.2026, IMPECCABLE-KRITIK-2026-11-15.md).
   iOS-Grautöne und Systemfarben für Bedienung und Ampel, Sportfarben wie in der App am Rechner.
   Schrift in rem über -apple-system-body: auf dem iPhone folgt sie der eingestellten Textgröße. */
:root {
  --grund: #f2f2f7; --zelle: #ffffff; --zelle-druck: #e5e5ea; --trenner: rgba(60, 60, 67, .22);
  --text: #000000; --text-2: #5f5f64; --text-3: #6c6c70;
  --blau: #007aff; --blau-text: #0062cc; --auf-blau: #ffffff;
  --gruen: #34c759; --gruen-text: #1f7a35; --gruen-flaeche: #e3f6e8;
  --orange: #ff9500; --orange-text: #9a4a00; --orange-flaeche: #fff1dc;
  --rot: #ff3b30; --rot-text: #c41c12; --rot-flaeche: #ffe5e3;
  --segment: #e9e9eb; --segment-an: #ffffff;
  --leiste: rgba(249, 249, 249, .86);
  --sp-locker: #2563eb; --sp-lang: #1e3a8a; --sp-qual: #ea580c; --sp-hyrox: #8b5cf6; --sp-rennen: #d97706; --sp-frei: #c7c7cc; --renn-text: #b45309;
  --t-klein: .75rem; --t-neben: .8125rem; --t-text: 1rem; --t-kopf: 1.0625rem; --t-titel: 1.375rem; --t-zahl: 1.75rem; --t-gross: 2.125rem;
  --r-zelle: 12px; --r-knopf: 10px; --r-segment: 9px;
  --schrift: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --schnell: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #000000; --zelle: #1c1c1e; --zelle-druck: #2c2c2e; --trenner: rgba(84, 84, 88, .65);
    --text: #ffffff; --text-2: #aeaeb2; --text-3: #98989f;
    --blau: #0a84ff; --blau-text: #409cff; --auf-blau: #ffffff;
    --gruen: #30d158; --gruen-text: #30d158; --gruen-flaeche: #0f2e18;
    --orange: #ff9f0a; --orange-text: #ffb340; --orange-flaeche: #33230a;
    --rot: #ff453a; --rot-text: #ff6961; --rot-flaeche: #3a1412;
    --segment: #2c2c2e; --segment-an: #636366;
    --leiste: rgba(22, 22, 24, .86);
    --sp-locker: #3b82f6; --sp-lang: #6d8fe0; --sp-qual: #fb923c; --sp-hyrox: #c084fc; --sp-rennen: #fbbf24; --sp-frei: #48484a; --renn-text: #fbbf24;
  }
}

* { box-sizing: border-box; }
html { font-size: 16px; font: -apple-system-body; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--grund); color: var(--text); }
body { font-family: var(--schrift); font-size: var(--t-text); line-height: 1.38; padding-bottom: calc(76px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
::selection { background: color-mix(in srgb, var(--blau) 28%, transparent); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blau) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
textarea { caret-color: var(--blau); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ic { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }

/* Kopf: schmale Leiste oben, großer Titel im Fluss (iOS Large Title) */
.oben { position: sticky; top: 0; z-index: 4; height: calc(44px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: transparent; transition: background .2s, box-shadow .2s; }
.oben.fest { background: var(--leiste); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 .5px 0 var(--trenner); }
.oben-titel { grid-column: 2; font-size: var(--t-kopf); font-weight: 600; opacity: 0; transition: opacity .2s; }
.oben.fest .oben-titel { opacity: 1; }
.oben-stand { grid-column: 3; justify-self: end; font-size: var(--t-klein); color: var(--text-3); white-space: nowrap; }
.oben-stand.alt { color: var(--orange-text); font-weight: 600; }

main { padding: 0 16px; }
.ansicht { padding-bottom: 8px; }
.titel { padding: 2px 4px 14px; }
.titel h1 { font-size: var(--t-gross); font-weight: 700; letter-spacing: .01em; line-height: 1.12; }
.titel p { color: var(--text-2); font-size: var(--t-neben); margin-top: 3px; }

/* Gruppierte Listen */
.kopfzeile { font-size: var(--t-neben); font-weight: 400; color: var(--text-3); padding: 22px 16px 7px; display: flex; justify-content: space-between; gap: 8px; }
.gruppe { background: var(--zelle); border-radius: var(--r-zelle); overflow: hidden; }
.gruppe + .gruppe { margin-top: 12px; }
.zeile { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 10px 16px; position: relative; width: 100%; text-align: left; }
.zeile + .zeile::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--trenner); }
button.zeile:active { background: var(--zelle-druck); }
.zeile .haupt { flex: 1; min-width: 0; }
.zeile .haupt b { font-weight: 400; display: block; overflow-wrap: anywhere; }
.zeile .haupt small { display: block; font-size: var(--t-neben); color: var(--text-2); margin-top: 1px; }
.zeile .wert { color: var(--text-2); font-size: var(--t-text); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.zeile .wert.aktion { color: var(--blau-text); }
.pfeil { width: 8px; height: 13px; flex: none; stroke: var(--text-3); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .6; }

/* Rennkarte (bis 3 Tage nach einem Rennen) */
.renn { padding: 16px; }
.renn .was { font-size: var(--t-neben); color: var(--text-2); }
.renn .name { font-size: var(--t-kopf); font-weight: 600; margin-top: 2px; }
.renn .zeit { font-size: var(--t-zahl); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; margin-top: 6px; color: var(--renn-text); }
.renn .zeit span { font-size: var(--t-neben); font-weight: 400; color: var(--text-2); margin-left: 6px; letter-spacing: 0; }
.renn .platz { font-size: var(--t-neben); color: var(--text-2); margin-top: 2px; }

/* Einheit des Tages */
.einheit { padding: 16px 16px 14px; }
.einheit h2 { font-size: var(--t-titel); font-weight: 700; letter-spacing: .005em; line-height: 1.2; }
.status { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: var(--t-neben); font-weight: 600; }
.status i { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: .32em; }
.status small { display: block; font-weight: 400; color: var(--text-2); margin-top: 1px; }
.status.gruen { color: var(--gruen-text); } .status.gruen i { background: var(--gruen); }
.status.gelb { color: var(--orange-text); } .status.gelb i { background: var(--orange); }
.status.rot { color: var(--rot-text); } .status.rot i { background: var(--rot); }
.beschreibung { color: var(--text-2); font-size: var(--t-neben); margin-top: 8px; }
.ziele { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: .5px solid var(--trenner); }
.ziele div { font-size: var(--t-klein); color: var(--text-3); }
.ziele b { display: block; font-size: var(--t-text); color: var(--text); font-weight: 600; margin-top: 1px; font-variant-numeric: tabular-nums; }
.ablauf-text { padding: 0 16px 14px; color: var(--text-2); font-size: var(--t-neben); }

/* Check: Segmente mit Wörtern statt Ziffern, links immer „gut“ */
.check { padding: 14px 16px 6px; }
.frage + .frage { margin-top: 14px; }
.frage-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: var(--t-text); }
.frage-kopf span { color: var(--text-2); font-size: var(--t-neben); }
.segmente { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--segment); border-radius: var(--r-segment); padding: 2px; margin-top: 8px; gap: 2px; }
.segmente button { min-height: 40px; border-radius: 7px; font-size: var(--t-klein); color: var(--text); padding: 0 2px; line-height: 1.15; transition: background .15s, box-shadow .15s; }
.segmente button[aria-checked=true] { background: var(--segment-an); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04); }
.uhr { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--t-neben); color: var(--text-2); padding: 0 0 12px; }
.uhr .lage { color: var(--orange-text); }
.uhr b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.zusammen { overflow: hidden; transition: height .45s var(--schnell), opacity .3s; }

/* Schalter (iOS Switch) */
.schalter { width: 51px; height: 31px; border-radius: 16px; background: var(--segment); position: relative; flex: none; transition: background .2s; }
.schalter::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .25s var(--schnell); }
[aria-checked=true] > .schalter { background: var(--rot); }
[aria-checked=true] > .schalter::after { transform: translateX(20px); }

.gut { color: var(--gruen-text); }
.hinweis-text { font-size: var(--t-neben); color: var(--text-3); padding: 7px 16px 0; }

/* Woche */
.balken-zeile { padding: 14px 16px; }
.balken-zeile .zahlen { display: flex; justify-content: space-between; font-size: var(--t-neben); color: var(--text-2); }
.balken-zeile .zahlen b { color: var(--text); font-size: var(--t-kopf); font-weight: 600; font-variant-numeric: tabular-nums; }
.balken { height: 6px; background: var(--segment); border-radius: var(--r-segment); margin-top: 8px; overflow: hidden; }
.balken i { display: block; height: 100%; background: var(--blau); border-radius: var(--r-segment); }
.tag .farbe { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.tag .datum { width: 3.4em; flex: none; font-size: var(--t-neben); color: var(--text-3); font-variant-numeric: tabular-nums; }
.tag.heute .datum, .tag.heute .haupt b { color: var(--blau-text); font-weight: 600; }
.tag.vorbei .haupt b { color: var(--text-2); }
.farbe.locker { background: var(--sp-locker); } .farbe.lang { background: var(--sp-lang); } .farbe.qualitaet { background: var(--sp-qual); }
.farbe.hyrox { background: var(--sp-hyrox); } .farbe.wettkampf { background: var(--sp-rennen); } .farbe.frei { background: var(--sp-frei); }
.st-erledigt { color: var(--gruen-text); } .st-teilweise { color: var(--orange-text); } .st-aus { color: var(--text-3); }

/* Coach */
.coach-text { padding: 14px 16px; font-size: var(--t-text); }
.coach-text h2 { font-size: var(--t-kopf); font-weight: 600; margin-bottom: 6px; }
.coach-text p + p, .coach-text ul + p { margin-top: 8px; }
.coach-text ul { margin: 8px 0 0; padding-left: 1.1em; }
.coach-text li { margin: 4px 0; color: var(--text); }
.coach-text li::marker { color: var(--text-3); }
.coach-text strong { font-weight: 600; }

/* Blatt von unten (Anstrengung, Notiz) */
.blatt-grund { position: fixed; inset: 0; z-index: 8; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .25s; }
.blatt-grund.auf { opacity: 1; }
.blatt { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--grund); border-radius: 14px 14px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; transform: translateY(100%); transition: transform .38s var(--schnell); }
.blatt.auf { transform: none; }
.blatt-griff { width: 36px; height: 5px; border-radius: 3px; background: var(--trenner); margin: 0 auto 10px; }
.blatt-kopf { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; }
.blatt-kopf h2 { grid-column: 2; font-size: var(--t-kopf); font-weight: 600; text-align: center; }
.blatt-kopf .links { grid-column: 1; justify-self: start; color: var(--blau-text); min-height: 44px; padding-right: 12px; }
.blatt-kopf .rechts { grid-column: 3; justify-self: end; color: var(--blau-text); font-weight: 600; min-height: 44px; padding-left: 12px; }
.blatt-unter { text-align: center; color: var(--text-2); font-size: var(--t-neben); margin: -4px 0 12px; }
.rpe .nr { width: 1.6em; font-weight: 600; font-variant-numeric: tabular-nums; }
.rpe .haken { color: var(--blau-text); }
.blatt textarea { width: 100%; min-height: 140px; border: 0; border-radius: var(--r-zelle); background: var(--zelle); color: var(--text); font: inherit; padding: 12px 16px; resize: vertical; }

/* Leiste unten */
.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: var(--leiste); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 -.5px 0 var(--trenner); padding: 4px 8px env(safe-area-inset-bottom); }
.leiste button { flex: 1; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .625rem; font-weight: 500; color: var(--text-3); position: relative; }
.leiste svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.leiste button[aria-current=page] { color: var(--blau-text); }  /* Systemblau erreicht auf der hellen Leiste nur 3,8:1 */
.leiste .punkt { position: absolute; top: 6px; left: calc(50% + 9px); min-width: 8px; height: 8px; border-radius: 4px; background: var(--rot); }

.meldung { position: fixed; left: 50%; bottom: calc(70px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 7; background: var(--zelle); color: var(--text); padding: 10px 16px; border-radius: 22px; font-size: var(--t-neben); font-weight: 500; box-shadow: 0 6px 24px rgba(0, 0, 0, .16); white-space: nowrap; }
.leer { color: var(--text-3); font-size: var(--t-neben); text-align: center; padding: 40px 0; }

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

/* Anmeldung (Paket 3) */
.feld { gap: 12px; }
.feld span { width: 5.5em; flex: none; }
.feld input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; padding: 0; min-height: 24px; caret-color: var(--blau); }
.feld input:focus { outline: none; }
.feld:focus-within { background: var(--zelle-druck); }
.knopf-mitte { justify-content: center; color: var(--blau-text); font-weight: 600; }
