:root {
  --bg: #0E1113;
  --karte: #171C1F;
  --karte2: #1E2427;
  --linie: #2A2F33;
  --tx: #F2F4F5;
  --tg: #8A949A;
  --ak: #22A3B5;
  --ak-dim: #154E57;
  --ak-tx: #06262B;
  --r: 2px;
  --abstand: 16px;
  --tab-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--tx); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }

#app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12px) var(--abstand) calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); }

/* ── Kopf ─────────────────────────────── */
.kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.kopf .zeile { font-size: 13px; font-weight: 800; letter-spacing: .08em; color: var(--tg); text-transform: uppercase; }
.kopf .zeile b { color: var(--ak); font-weight: 800; }
.kopf h1 { font-size: 44px; line-height: 1; margin: 6px 0 0; font-weight: 900; letter-spacing: -.01em; text-transform: uppercase; }
.kopf h1.klein { font-size: 32px; }
.ikonknopf { background: none; border: 1px solid var(--linie); border-radius: var(--r); width: 44px; height: 44px; display: grid; place-items: center; color: var(--tg); flex: none; }
.ikonknopf svg { width: 22px; height: 22px; }
.zurueck { background: none; border: 0; color: var(--tg); font-weight: 800; letter-spacing: .08em; font-size: 13px; padding: 8px 0; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }

.sync { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--tg); text-transform: uppercase; margin-top: 6px; }

/* ── Karten ───────────────────────────── */
.karte { background: var(--karte); border-radius: var(--r); padding: 16px; margin-bottom: 12px; position: relative; }
.karte.akzent { border-left: 4px solid var(--ak); }
.karte.leise { background: transparent; border: 1px solid var(--linie); }
.karte h2, .titel { font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--tg); margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.karte h3 { font-size: 22px; font-weight: 900; text-transform: uppercase; margin: 0 0 4px; line-height: 1.1; }
.karte p { margin: 6px 0; color: var(--tx); }
.gedaempft { color: var(--tg); }
.klein { font-size: 13px; }
.sektion { font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--tg); margin: 26px 0 10px; }
.reihe { display: flex; gap: 12px; }
.reihe > * { flex: 1; min-width: 0; }
.zwischen { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.gross { font-size: 64px; font-weight: 900; line-height: .95; letter-spacing: -.02em; }
.gross small { font-size: 15px; font-weight: 900; letter-spacing: .06em; color: var(--tg); margin-left: 6px; }
.mittel { font-size: 32px; font-weight: 900; line-height: 1; }
.mittel small { font-size: 12px; font-weight: 900; letter-spacing: .06em; color: var(--tg); margin-left: 4px; }

/* ── Knöpfe ───────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--linie); background: var(--karte2); font-weight: 900; letter-spacing: .06em; text-transform: uppercase; font-size: 15px; }
.btn.haupt { background: var(--ak); color: var(--ak-tx); border-color: var(--ak); }
.btn.breit { width: 100%; }
.btn.riesig { min-height: 64px; font-size: 20px; }
.btn.flach { background: none; }
.btn.klein { min-height: 36px; padding: 0 12px; font-size: 12px; }
.btn:disabled { opacity: .4; }
.btn:active { transform: translateY(1px); }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.knopfreihe .btn { flex: 1; }
.link { background: none; border: 0; color: var(--ak); font-weight: 800; padding: 4px 0; font-size: 14px; text-decoration: none; }
.warum { background: none; border: 1px solid var(--linie); color: var(--tg); border-radius: var(--r); font-size: 11px; font-weight: 900; letter-spacing: .08em; padding: 3px 7px; }

/* ── Balken ───────────────────────────── */
.balken { height: 8px; background: var(--linie); border-radius: 1px; overflow: hidden; margin: 10px 0 6px; }
.balken > i { display: block; height: 100%; background: var(--ak); transition: width .4s ease; }
.segmente { display: flex; gap: 3px; margin: 10px 0 6px; }
.segmente i { flex: 1; height: 10px; background: var(--linie); }
.segmente i.an { background: var(--ak); }

/* ── Listen ───────────────────────────── */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linie); }
.liste li:first-child { border-top: 0; }
.liste .text { flex: 1; min-width: 0; }
.liste .text b { display: block; font-weight: 800; }
.liste .text span { color: var(--tg); font-size: 13px; }

.haken { width: 32px; height: 32px; flex: none; border: 2px solid var(--linie); border-radius: var(--r); background: none; display: grid; place-items: center; padding: 0; }
.haken svg { width: 20px; height: 20px; opacity: 0; transform: scale(.4); transition: transform .25s cubic-bezier(.2,1.6,.4,1), opacity .15s; }
.haken.an { background: var(--ak); border-color: var(--ak); color: var(--ak-tx); }
.haken.an svg { opacity: 1; transform: scale(1); }
.haken.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--linie); background: none; border-radius: var(--r); padding: 8px 12px; font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--tg); }
.chip.an { background: var(--ak); color: var(--ak-tx); border-color: var(--ak); }
.chip.weich.an { background: var(--ak-dim); color: var(--tx); border-color: var(--ak-dim); }

.segment { display: flex; border: 1px solid var(--linie); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.segment button { flex: 1; background: none; border: 0; padding: 11px 4px; font-weight: 900; font-size: 12px; letter-spacing: .08em; color: var(--tg); text-transform: uppercase; }
.segment button.an { background: var(--ak); color: var(--ak-tx); }

.tag { display: inline-block; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: var(--r); background: var(--linie); color: var(--tx); }
.tag.ak { background: var(--ak); color: var(--ak-tx); }
.tag.rand { background: none; border: 1px solid var(--ak); color: var(--ak); }

/* ── Formulare ────────────────────────── */
label.feld { display: block; margin: 12px 0; }
label.feld > span { display: block; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--tg); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--linie); border-radius: var(--r); padding: 12px; font-size: 16px; color: var(--tx);
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--ak); outline-offset: 1px; }
textarea { min-height: 84px; resize: vertical; }
input[type=time] { min-width: 0; }

/* ── Tab-Leiste ───────────────────────── */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(14,17,19,.96); border-top: 1px solid var(--linie); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 20; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
nav.tabs .innen { display: flex; width: 100%; max-width: 560px; }
nav.tabs button { flex: 1; background: none; border: 0; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--tg); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
nav.tabs button svg { width: 24px; height: 24px; }
nav.tabs button.an { color: var(--ak); }

/* ── Training ─────────────────────────── */
.einheitbuchstabe { font-size: 96px; font-weight: 900; line-height: .8; color: var(--ak); }
.uebung { background: var(--karte); border-radius: var(--r); margin-bottom: 8px; }
.uebung .kopfzeile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; background: none; border: 0; text-align: left; }
.uebung .kopfzeile .text { flex: 1; min-width: 0; }
.uebung .kopfzeile b { display: block; font-weight: 900; text-transform: uppercase; font-size: 15px; letter-spacing: .02em; }
.uebung .kopfzeile span { color: var(--tg); font-size: 13px; }
.uebung .koerper { padding: 0 16px 16px; }
.uebung.fertig .kopfzeile b { color: var(--tg); }
.uebung.aktiv { outline: 1px solid var(--ak); }
.satzliste { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.satzliste .satz { background: var(--bg); border: 1px solid var(--linie); padding: 6px 9px; font-weight: 800; font-size: 14px; border-radius: var(--r); }
.satzliste .satz.neu { border-color: var(--ak); color: var(--ak); }

.stepper { display: flex; align-items: stretch; gap: 0; border: 1px solid var(--linie); border-radius: var(--r); background: var(--bg); }
.stepper button { width: 52px; border: 0; background: none; font-size: 26px; font-weight: 900; color: var(--ak); }
.stepper input { flex: 1; min-width: 0; border: 0; background: none; text-align: center; font-weight: 900; font-size: 28px; padding: 8px 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-label { font-size: 11px; font-weight: 900; letter-spacing: .1em; color: var(--tg); text-transform: uppercase; margin: 10px 0 4px; }

.fokus { text-align: center; }
.fokus .uebname { font-size: clamp(19px, 6.2vw, 28px); font-weight: 900; text-transform: uppercase; line-height: 1.05; margin: 8px 0 4px; overflow-wrap: anywhere; hyphens: auto; }
.fokus .reihe { flex-direction: column; gap: 4px; }
.fokus .stepper input { font-size: 64px; padding: 2px 0; }
.fokus .stepper button { width: 76px; font-size: 40px; }
.fokus .einheit { font-size: 13px; font-weight: 900; letter-spacing: .1em; color: var(--tg); }
.punkte { display: flex; justify-content: center; gap: 6px; margin: 10px 0; }
.punkte i { width: 22px; height: 4px; background: var(--linie); }
.punkte i.an { background: var(--ak); }
.punkte i.jetzt { background: var(--tx); }

.figur { display: flex; gap: 6px; justify-content: center; }
.figur svg { width: 46px; height: 100px; }
.figur.klein svg { width: 28px; height: 60px; }

/* ── Pausentimer ──────────────────────── */
.timer { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 25; display: flex; justify-content: center; pointer-events: none; }
.timer .innen { pointer-events: auto; width: 100%; max-width: 560px; margin: 0 var(--abstand); background: var(--karte2); border-top: 3px solid var(--ak); padding: 10px 14px; display: flex; align-items: center; gap: 10px; box-shadow: 0 -10px 30px rgba(0,0,0,.4); }
.timer .zeit { font-size: 40px; font-weight: 900; flex: 1; font-variant-numeric: tabular-nums; }
.timer .zeit small { display: block; font-size: 11px; letter-spacing: .1em; color: var(--tg); }
body.mit-timer #app { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 110px); }
.timer.fertig .innen { background: var(--ak); color: var(--ak-tx); }
.timer.fertig .zeit small { color: var(--ak-tx); }

/* ── Diagramm ─────────────────────────── */
.diagramm { position: relative; }
.diagramm svg { width: 100%; height: auto; display: block; overflow: visible; }
.diagramm .tip { position: absolute; pointer-events: none; background: var(--bg); border: 1px solid var(--linie); padding: 6px 9px; font-size: 13px; font-weight: 800; white-space: nowrap; transform: translate(-50%, -110%); border-radius: var(--r); }
.diagramm .tip span { display: block; color: var(--tg); font-weight: 600; font-size: 11px; }

/* ── Blatt (Bottom Sheet) ─────────────── */
.blatt-hg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: einblenden .15s ease; }
.blatt { background: var(--karte); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 20px var(--abstand) calc(20px + env(safe-area-inset-bottom)); border-top: 3px solid var(--ak); animation: hoch .22s cubic-bezier(.2,.9,.3,1); }
.blatt h2 { font-size: 22px; font-weight: 900; text-transform: uppercase; margin: 0 0 10px; }
@keyframes hoch { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes einblenden { from { opacity: 0; } to { opacity: 1; } }

/* ── Abzeichen ────────────────────────── */
.abzeichen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.abz { background: var(--karte); border-radius: var(--r); padding: 12px 8px; text-align: center; min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.abz svg { width: 34px; height: 34px; color: var(--ak); }
.abz b { font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; line-height: 1.15; }
.abz span { font-size: 11px; color: var(--tg); }
.abz.aus { opacity: .35; }
.abz.aus svg { color: var(--tg); }

.wochen { display: flex; gap: 4px; align-items: flex-end; }
.wochen .w { flex: 1; text-align: center; }
.wochen .w i { display: block; height: 28px; background: var(--linie); margin-bottom: 4px; }
.wochen .w i.an { background: var(--ak); }
.wochen .w i.pause { background: repeating-linear-gradient(135deg, var(--linie) 0 3px, transparent 3px 7px); border: 1px solid var(--linie); }
.wochen .w span { font-size: 10px; color: var(--tg); font-weight: 700; }

.punktreihe { display: flex; gap: 5px; flex-wrap: wrap; }
.punktreihe i { width: 14px; height: 14px; border: 2px solid var(--linie); }
.punktreihe i.ja { background: var(--ak); border-color: var(--ak); }

/* ── Kalender (Dienste von Hand) ──────── */
.monat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.monat .kopf-wt { font-size: 10px; font-weight: 900; color: var(--tg); text-align: center; padding: 4px 0; letter-spacing: .08em; }
.monat button { aspect-ratio: 1; background: var(--karte); border: 1px solid transparent; border-radius: var(--r); padding: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.monat button small { font-size: 9px; font-weight: 900; color: var(--ak); letter-spacing: .02em; }
.monat button.manuell { border-color: var(--ak-dim); }
.monat button.heute { border-color: var(--ak); }
.monat button.leer { visibility: hidden; }

/* ── Effekte ──────────────────────────── */
#konfetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translateX(-50%); background: var(--ak); color: var(--ak-tx); padding: 12px 18px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; z-index: 70; border-radius: var(--r); max-width: calc(100% - 32px); text-align: center; animation: hoch .25s ease; font-size: 14px; }
.einblenden { animation: hoch .25s ease; }
.leer-hinweis { color: var(--tg); text-align: center; padding: 24px 8px; }

.anmeldung { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.fehler { color: var(--tx); background: #2A2F33; border-left: 3px solid var(--tg); padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.regel { padding: 10px 0; border-top: 1px solid var(--linie); }
.regel:first-child { border-top: 0; padding-top: 0; }
.regel b { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ak); font-weight: 900; }
table.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tab th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--tg); font-weight: 900; padding: 6px 6px 6px 0; border-bottom: 1px solid var(--linie); }
table.tab td { padding: 8px 6px 8px 0; border-bottom: 1px solid var(--linie); vertical-align: top; }
details.auf { background: var(--karte); border-radius: var(--r); margin-bottom: 8px; }
details.auf summary { list-style: none; padding: 14px 16px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; font-size: 14px; display: flex; justify-content: space-between; }
details.auf summary::-webkit-details-marker { display: none; }
details.auf summary::after { content: '+'; color: var(--ak); font-size: 20px; line-height: 1; }
details.auf[open] summary::after { content: '–'; }
details.auf > div { padding: 0 16px 16px; }
.versteckt { position: absolute; left: -9999px; }
