/* Mobile-first styling. Phone and tablet are the primary targets; the layout
   simply gains a wider centred column on larger screens. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-alt: #eef1f8;
  --text: #1b1f2a;
  --text-muted: #666e80;
  --border: #dfe3ed;
  --accent: #4f7cff;
  --accent-contrast: #ffffff;
  --success: #2f9e5d;
  --warning: #c98014;
  --danger: #d2453d;
  --radius: 14px;
  --tap: 48px;
  --shadow: 0 1px 2px rgba(20, 26, 44, 0.06), 0 6px 20px rgba(20, 26, 44, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171f;
    --surface: #1d212b;
    --surface-alt: #262b38;
    --text: #eef1f7;
    --text-muted: #9aa3b5;
    --border: #2f3542;
    --accent: #6d92ff;
    --success: #4cbd7b;
    --warning: #e0a044;
    --danger: #ef6a62;
    --shadow: none;
  }
}

/*
 * Die Testumgebung trägt Orange. Nur der Akzent wechselt, sonst nichts: UAT soll
 * aussehen wie die App und bloss erkennbar sein - eine zweite Gestaltung wäre
 * eine zweite App, und dann prüft man nicht mehr, was später live geht.
 *
 * Gesetzt wird `data-env` von env.js, aus dem Gastgebernamen. Die höhere
 * Genauigkeit sticht `:root` in beiden Blöcken, die Reihenfolge spielt also
 * keine Rolle.
 */
:root[data-env="uat"] { --accent: #c06a12; --accent-contrast: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root[data-env="uat"] { --accent: #e9922f; }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  /* Room for the fixed tab bar plus the iOS home indicator. */
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.app { max-width: 720px; margin: 0 auto; }

.loading, .empty {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 1rem;
}

/* --- header --- */

.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem 0.5rem;
}
.header-main { min-width: 0; }
.header h1 { font-size: 1.4rem; margin: 0; white-space: nowrap; }

/*
 * Der Weg zurück aus einem Kind. Über dem Titel statt daneben, damit der Name
 * des Kindes die Zeile behält - er ist die Auskunft, wo man ist.
 */
.crumb {
  display: block;
  min-height: 0;
  padding: 0 0 0.15rem;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.header .date {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: right;
  white-space: nowrap;
}

main { padding: 0 1rem 1rem; }

/* --- cards --- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.card h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.card h3 { font-size: 0.95rem; margin: 0 0 0.5rem; }

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem;
}

/* --- progress --- */

.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  width: var(--value, 0%);
  transition: width 0.25s ease;
}
.progress.is-complete > span { background: var(--success); }

.muted { color: var(--text-muted); font-size: 0.9rem; }

/* --- study blocks --- */

.block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-left: 5px solid var(--subject-color, var(--accent));
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.block:active { transform: scale(0.99); }

/*
 * Die Hauptfläche ist ein eigener Knopf neben dem Häkchen, damit ein Block in
 * der Wochenansicht beides kann: abhaken und verschieben. Beide erben deshalb
 * das Aussehen der Zeile, statt wie ein Knopf auszusehen.
 */
.block-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}
.block.is-done { opacity: 0.55; }
.block.is-done .block-title { text-decoration: line-through; }
/* Ausgelassen (#68): gedämpft, aber nicht durchgestrichen - es wurde nicht erledigt. */
.block.is-skipped { opacity: 0.5; border-left-style: dashed; }

.block-check {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  color: transparent;
  cursor: pointer;
}
.block.is-done .block-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.block-body { flex: 1 1 auto; min-width: 0; }
.block-title {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.block-meta {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.block-minutes {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  margin-left: 0.35rem;
}

/* Das Abzeichen der Testumgebung - farbig, damit es nicht wie eine Fussnote wirkt. */
.tag.env {
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

/* --- week view --- */

.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.day-group { margin-bottom: 1rem; }
.day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.day-head.is-today { color: var(--accent); }
.day-head .load { font-weight: 400; color: var(--text-muted); font-size: 0.85rem; }

/* --- exams --- */

.exam-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border-left: 5px solid var(--subject-color, var(--accent));
  padding-left: 0.75rem;
}
/*
 * Der Text neben dem Countdown darf schrumpfen (#125, #127). Flex-Kinder sind
 * sonst mindestens so breit wie ihr Inhalt - und ein langer Prüfungstitel mit
 * white-space: nowrap schob die ganze Seite über den Bildschirmrand. Dann
 * verrutschte sie seitlich, und mit ihr die feste Tab-Leiste.
 */
.exam-row > :not(.countdown) { flex: 1 1 auto; min-width: 0; }
.exam-row + .exam-row { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.countdown {
  flex: 0 0 auto;
  text-align: center;
  min-width: 56px;
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 0.35rem 0.5rem;
}
.countdown strong { display: block; font-size: 1.25rem; line-height: 1.1; }
.countdown span { font-size: 0.7rem; color: var(--text-muted); }

/* --- forms --- */

label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0.85rem 0 0.25rem; }
input, select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.choice-group { display: flex; gap: 0.5rem; }
.choice-group label {
  flex: 1;
  margin: 0;
  text-align: center;
  padding: 0.7rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  min-height: var(--tap);
  display: grid;
  place-items: center;
}
.choice-group input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-group input:checked + span { color: var(--accent-contrast); }
.choice-group label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

button {
  min-height: var(--tap);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
button.danger { color: var(--danger); }
button.ghost { background: transparent; border-color: transparent; color: var(--accent); }
button[disabled] { opacity: 0.6; cursor: default; }
.button-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.button-row button { flex: 1 1 auto; }

/*
 * Weiterempfehlen auf Heute: nur das Zeichen, rechts unter der Liste. Rund und
 * randlos, damit es neben den Blöcken nicht wie ein weiterer Schritt im Plan
 * aussieht - es ist ein Angebot, keine Aufgabe.
 */
.share-row { display: flex; justify-content: flex-end; margin-top: 1rem; }
.icon-button {
  display: grid;
  place-items: center;
  width: var(--tap);
  min-width: var(--tap);
  padding: 0;
  border-radius: 50%;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}
.icon-button .icon { display: block; width: 22px; height: 22px; }
.icon-button .icon svg { width: 100%; height: 100%; display: block; }
.icon-button:hover, .icon-button:focus-visible { color: var(--accent); background: var(--surface-alt); }

/* --- invite codes --- */

/*
 * The code is read off one screen and typed on another, so it gets the room and
 * the letter spacing of something meant to be copied by hand.
 */
.invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-align: center;
  margin: 0.75rem 0 0.25rem;
  user-select: all;
}
/*
 * Gross genug, um aus Armlänge gescannt zu werden, und auf weissem Grund - ein
 * QR-Code auf dunklem Untergrund liest sich schlechter, und der dunkle Modus
 * würde ihn sonst umkehren.
 */
.invite-qr {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0.5rem auto 0;
  padding: 8px;
  background: #fff;
  border-radius: 10px;
}

ul.plain { list-style: none; padding: 0; margin: 0.35rem 0 0; }
ul.plain li { padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
ul.plain li:last-child { border-bottom: none; }

/*
 * Die Felder bleiben im Layout, nur unsichtbar. display:none wäre einfacher,
 * aber ein Dateifeld, das nicht da ist, lässt sich auf dem Telefon auch nicht
 * über sein Label öffnen.
 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Kamera oder Galerie: zwei gleich grosse Flächen, kein Rätselraten. */
.photo-choice { display: flex; gap: 0.5rem; margin: 1rem 0; }
.photo-pick {
  flex: 1;
  margin: 0;
  min-height: calc(var(--tap) * 1.4);
  display: grid;
  place-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.photo-pick:active { transform: scale(0.99); }
/*
 * Das Feld selbst ist unsichtbar, bekommt über die Tastatur aber den Fokus.
 * Ohne das hier tastet sich jemand blind durch das Overlay.
 */
.sheet:has(#photo-camera-input:focus-visible) .photo-pick[for="photo-camera-input"],
.sheet:has(#photo-gallery-input:focus-visible) .photo-pick[for="photo-gallery-input"] {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Die aufgenommenen Seiten: klein, nebeneinander, jede einzeln wegwerfbar. */
.photo-pages {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0;
  -webkit-overflow-scrolling: touch;
}
.photo-page {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  min-height: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-alt);
  cursor: pointer;
}
.photo-page img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-page span {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.7rem;
  line-height: 18px;
  text-align: center;
}

/* Aus einem Foto übernommen und ungeprüft: fällt auf, ohne zu schreien. */
.needs-check {
  border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
}

/* Ein Schalter, der aussieht wie eine Zeile, nicht wie ein Formularfeld. */
.switch {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 1rem 0 0.25rem;
  font-weight: 500;
  cursor: pointer;
}
/*
 * min-height und Polsterung kommen von der allgemeinen Regel für Formularfelder
 * und machten aus dem Häkchen einen 48 Pixel hohen, schmalen Kasten - er sah
 * aus wie ein leeres Eingabefeld und gehörte sichtbar zu nichts.
 */
.switch input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  padding: 0;
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
}
/* Der Hinweis rückt unter die Beschriftung, nicht unter das Häkchen. */
.switch-hint { margin: 0 0 0 calc(1.15rem + 0.6rem); }

/* --- Üben --- */

.quiz-prompt .tag { margin-left: 0.4rem; vertical-align: middle; }
.quiz-prompt {
  font-size: 1.1rem;
  line-height: 1.45;
  margin: 1rem 0;
}
.quiz-options { display: grid; gap: 0.5rem; }
/*
 * Grosse Flächen: geübt wird mit dem Daumen, oft im Sitzen unterwegs. Und die
 * Antwort bleibt nach dem Antippen stehen, damit sichtbar ist, was man gewählt
 * hat - eine Rückmeldung ohne die eigene Wahl daneben sagt wenig.
 */
.quiz-option {
  width: 100%;
  min-height: var(--tap);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 500;
}
.quiz-option.is-right {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  font-weight: 700;
}
.quiz-option.is-wrong {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}
.quiz-option[disabled] { opacity: 1; }
#quiz-typed { font-size: 1.05rem; }
.quiz-review { margin-bottom: 0.5rem; }
/*
 * Die Auswertung leiht sich die Zeilen des Plans - dort steht eine Zeile, hier
 * eine Frage und ihre Antwort. Ohne das hier endet beides nach einer Zeile im
 * Auslassungszeichen, und gerade die lange Antwort ist die, die man lesen will.
 */
.quiz-review .block-title,
.quiz-review .block-meta {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* Geteilte Quizze (#151): teilen im Dialog, Highscore am Ende einer Runde. */
.quiz-share { margin: 0.5rem 0; }
.quiz-board h3 { margin: 0 0 0.35rem; }
.quiz-board li {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.quiz-board li:last-child { border-bottom: none; }
.quiz-board .board-rank { min-width: 1.8rem; color: var(--text-muted); }
.quiz-board .board-name { flex: 1; overflow-wrap: anywhere; }
.quiz-board .board-score { font-variant-numeric: tabular-nums; }
.quiz-board li.is-me { font-weight: 700; }
ol.plain { list-style: none; padding: 0; margin: 0; }

/* --- Elternansicht: der heutige Plan aller Kinder --- */

/* Die Antwort auf die eigentliche Frage, bevor die Einzelheiten kommen. */
.verdict {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  line-height: 1.45;
}

.child-day { padding-bottom: 0.75rem; }
.child-day.is-quiet { opacity: 0.65; }
/* Die Kopfzeile ist der Weg in das Kind - die Blöcke darunter sind es nicht. */
.child-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 0;
  padding: 0 0 0.5rem;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.child-day-head strong { font-size: 1.05rem; }
.child-day-blocks { margin-top: 0.5rem; }
.child-day-blocks .block { margin-bottom: 0.4rem; }
.child-day-blocks .block:last-child { margin-bottom: 0; }

/*
 * In der Sicht über alle Kinder wird nicht abgehakt: ein Fehltipp setzt sonst
 * die Arbeit des falschen Kindes auf erledigt. Deshalb kein Zeiger und kein
 * Knopf - der Kreis zeigt nur den Stand.
 */
.block.is-readonly { cursor: default; }
.block.is-readonly .block-check { cursor: default; }

/* --- Elternübersicht über mehrere Kinder --- */

/*
 * Eine Karte pro Kind, und die ganze Karte ist der Knopf ins Detail. Wer nichts
 * anstehen hat, wird leiser gezeichnet statt weggelassen - da zu sein und ruhig
 * zu sein ist die Aussage.
 */
.child-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-height: 0;
}
.child-card.is-quiet { opacity: 0.65; }
.child-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.child-head strong { font-size: 1.05rem; }
.child-exam { display: flex; align-items: center; gap: 0.75rem; }
.child-card .block-meta { white-space: normal; }

/* --- Verwaltung --- */

.admin-user {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.admin-user:last-of-type { border-bottom: none; }
.admin-user.is-blocked { opacity: 0.6; }
.admin-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.admin-meta { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.15rem; }
.admin-user .button-row { margin-top: 0.5rem; }
.admin-user .button-row button { font-size: 0.85rem; padding: 0.45rem 0.7rem; }

.build-stamp { text-align: center; font-size: 0.78rem; margin-top: 1.5rem; }

/*
 * Ein zu voller Tag sagt es dort, wo er steht - nicht als Meldung, die beim
 * nächsten Neuzeichnen verschwindet.
 */
.over-capacity {
  margin: 0 0 0.5rem;
  color: var(--warning);
  font-size: 0.85rem;
  font-weight: 600;
}
.day-head .load.is-over { color: var(--warning); font-weight: 700; }

/* Bewusst unauffällig: eine Übungsrunde ist keine Note. */
.quiz-trend {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* --- notices --- */

.notice {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}
.notice.warn { border-color: var(--warning); color: var(--warning); }
.notice.error { border-color: var(--danger); color: var(--danger); }
.notice.ok { border-color: var(--success); color: var(--success); }

/* --- traffic light --- */

.light { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; }
.light::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success);
}
.light.amber::before { background: var(--warning); }
.light.red::before { background: var(--danger); }

/* --- tab bar --- */

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.tabs button {
  flex: 1 1 0;
  /* Five tabs have to share a narrow phone screen without clipping a label. */
  min-width: 0;
  border: none;
  border-radius: 0;
  background: none;
  min-height: 64px;
  padding: 0 0.15rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}
.tabs .label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tabs button.is-active { color: var(--accent); }
.tabs .icon { display: block; width: 22px; height: 22px; }
.tabs .icon svg { width: 100%; height: 100%; display: block; }

/* --- dialog --- */

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 20, 0.5);
  display: grid;
  place-items: end center;
  z-index: 20;
}
.sheet-inner {
  background: var(--surface);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
}

/* Vierzehn Tage nebeneinander - kein Diagramm, nur Höhe. */
.verlauf {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 46px;
  margin: 0.75rem 0 0.35rem;
}
.verlauf-tag {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
/* Ein Tag ohne Plan ist kein schlechter Tag - er sieht deshalb anders aus als
   einer, an dem etwas offen blieb. */
.verlauf-tag.is-leer { opacity: 0.35; }
.verlauf-balken {
  width: 100%;
  height: var(--anteil);
  min-height: 2px;
  background: var(--accent);
}

/* Sechs Farbflächen, gross genug für einen Daumen. */
.color-choice { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.25rem 0 0.5rem; }
.color-swatch { display: inline-flex; margin: 0; cursor: pointer; }
.color-swatch input { position: absolute; opacity: 0; width: 0; height: 0; min-height: 0; }
.color-swatch span[aria-hidden] {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--swatch);
  border: 3px solid transparent;
  box-shadow: 0 0 0 1px var(--border) inset;
}
.color-swatch input:checked + span[aria-hidden] { border-color: var(--text); }
.color-swatch input:focus-visible + span[aria-hidden] { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Vorbei heisst: noch da, aber nicht mehr dringend. */
.card.is-past { opacity: 0.72; }
.card.is-past .countdown { font-size: 0.8rem; }

/* --- Einführung --- */

.onboarding {
  padding: 1.5rem 1rem calc(2rem + env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
}
.onboarding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.onboarding-head button { min-height: 0; padding: 0.35rem 0.6rem; }
.onboarding h1 { font-size: 1.35rem; margin: 0 0 0.5rem; }
/* Die Überschrift bekommt den Fokus je Schritt; ein Rahmen darum wäre hier
   Lärm, der Fokus ist trotzdem gesetzt und wird vorgelesen. */
.onboarding h1:focus { outline: none; }
.onboarding h1:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* --- login --- */

/*
 * Weniger Luft oben als frueher: darunter steht jetzt der Ueberblick, und das
 * Anmeldeformular soll trotzdem ohne Scrollen erreichbar bleiben. Wer ein Konto
 * hat - die Mehrzahl hier - will sich anmelden, nicht lesen.
 */
.login { padding: 1.5rem 1rem; }
.login .card { margin-top: 1rem; }

/* Der Ueberblick fuer den, der ueber einen geteilten Link hier landet. */
.pitch ul { margin: 0; padding-left: 1.2rem; }
.pitch li { margin-bottom: 0.45rem; line-height: 1.45; }
.pitch li:last-child { margin-bottom: 0; }
.pitch p { margin: 0.75rem 0 0; }

/* --- settings --- */

.capacity-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.capacity-row span { flex: 0 0 3rem; font-weight: 600; }
.capacity-row input { flex: 1; }

.subject-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--tap);
  border-bottom: 1px solid var(--border);
}
.subject-row .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--subject-color); flex: 0 0 auto; }
.subject-row .name { flex: 1; }

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

/*
 * Die Wahl der Fragenzahl: drei grosse Flächen nebeneinander, keine kleinen
 * Radioknöpfe. Angetippt wird das mit dem Daumen, auf einem Telefon.
 */
.quiz-sizes {
  border: none;
  margin: 1rem 0 0.5rem;
  padding: 0;
}

.quiz-size-row {
  display: flex;
  gap: 0.5rem;
}

.quiz-sizes legend {
  padding: 0;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.quiz-size {
  flex: 1;
  display: block;
  text-align: center;
  min-height: var(--tap);
  padding: 0.7rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.quiz-size input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quiz-size:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-alt);
  font-weight: 600;
}

/* ---------- Hilfe ---------- */

/*
 * Beide Anleitungen stehen da, aufgeklappt ist die passende. <details> traegt
 * das von selbst - kein JavaScript, kein Zustand, und der zugeklappte Teil
 * bleibt fuer den erreichbar, bei dem die Erkennung danebenlag.
 */
.help-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  margin-top: 0.6rem;
}

.help-section > summary {
  cursor: pointer;
  font-weight: 600;
  /* Ein Ziel, das sich mit dem Daumen treffen laesst. */
  padding: 0.25rem 0;
}

.help-section[open] > summary { margin-bottom: 0.4rem; }
.help-section[open] { background: var(--surface-alt); }

.steps, .help-notes { margin: 0; padding-left: 1.3rem; }
.steps li, .help-notes li { margin-bottom: 0.45rem; line-height: 1.45; }
.steps li:last-child, .help-notes li:last-child { margin-bottom: 0; }
.help-notes { color: var(--text-muted); }

/* Üben am Block (#106): klein und neben der Hauptfläche, damit der Tap auf den
   Block weiterhin abhakt. */
.block-practice {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

/* Meldungen in der Verwaltung (#60). */
.feedback-message { margin: 0.35rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-user.is-unread { border-left: 3px solid var(--accent); padding-left: 0.6rem; }
