/* ====================================================================================
   LESE-SKRIPT, LERNANSICHT, MITNEHMEN-LISTE (v254). Alles unter der Wurzelklasse .dl, Namensraum dl-.
   ------------------------------------------------------------------------------------
   Gebaut für das Handy (360 px) zuerst: Tippziele mindestens 44 px, die wichtigen Knöpfe 52 px, Eingabefelder 16 px
   (kleinere zoomt iOS-Safari hinein). Keine harte Themenfarbe: Flächen und Texte nehmen die Variablen aus
   styles.css (--weiss, --soft, --lilat, --text, --gruen, …), die html.nacht dort selbst umstellt. Die einzige feste Farbe
   ist Weiß auf den vollen Flächen --lila und --gruen, genau wie bei .btn.
   Zwei eigene Variablen, beide von dreh-lernen.js gesetzt oder mit Rückfall:
     --dl-fs     Schriftgröße im Lesemodus (Regler)
     --dl-unten  Höhe der unteren Leiste am Handy, damit die Knopfleiste der Lernansicht direkt darüber sitzt
   ==================================================================================== */

.dl {
  --dl-fs: 22px;
  --dl-unten: 0px;
  max-width: 820px;
  margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px;
  -webkit-tap-highlight-color: transparent;
}
.dl > * { margin-top: 0 !important; }
.dl [hidden] { display: none !important; }
.dl a { text-decoration: none; }
.dl p { overflow-wrap: anywhere; }
.dl button,
.dl .btn { touch-action: manipulation; }
.dl button:focus-visible,
.dl a:focus-visible,
.dl input:focus-visible,
.dl select:focus-visible,
.dl summary:focus-visible {
  outline: 3px solid var(--lilat); outline-offset: 2px;
}

/* ---------- Bausteine ---------- */

.dl .dl-h2 { font-size: var(--fs-karte); font-weight: 700; margin: 6px 2px 0; display: flex; align-items: center; gap: 8px; }
.dl .dl-zahl {
  font-size: var(--fs-fein); font-weight: 700; color: var(--lilat); background: var(--soft);
  border-radius: var(--r-pille); padding: 1px 9px;
}
.dl .dl-fein { color: var(--tsoft); font-size: var(--fs-fein); }
.dl .dl-leer { text-align: center; padding: 26px 18px; }
.dl .dl-leer h2 { font-size: var(--fs-karte); margin-bottom: 6px; }
.dl .dl-leer p { color: var(--tsoft); line-height: 1.5; }
.dl .dl-leer-t { color: var(--tsoft); text-align: center; padding: 18px 0; }
.dl .dl-intro p { line-height: 1.55; font-size: var(--fs-text); }

.dl .dl-gross { min-height: 52px; font-size: 16px; font-weight: 600; border-radius: 14px; padding: 0 18px; }
.dl .dl-gross.dl-aus { opacity: .45; pointer-events: none; background: var(--soft); color: var(--tsoft); }
.dl .dl-breit { flex: 1 1 auto; }

.dl .dl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dl .dl-chip {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-pille);
  background: var(--soft); color: var(--lilat); font-size: var(--fs-fein); font-weight: 600; line-height: 1.4;
}
.dl .dl-chip.zweig-neu { background: var(--gruen-soft); color: var(--gruent); }
.dl .dl-chip.zweig-abwerbe { background: var(--blau-soft); color: var(--blaut); }
.dl .dl-chip.status-idee { background: var(--amber-soft); color: var(--ambert); }
.dl .dl-chip.status-skript { background: var(--intern-neben); color: var(--lilat); }
.dl .dl-chip.text { background: var(--lila); color: #fff; }
.dl .dl-chip.leise { background: transparent; color: var(--tsoft); padding-left: 0; }

.dl .dl-balken { display: block; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.dl .dl-balken i { display: block; height: 100%; background: var(--gruen); border-radius: inherit; transition: width .25s; }
.dl .dl-balken.gross { height: 12px; }
.dl .dl-balken.klein { height: 5px; border-radius: 0; }

.dl .dl-schalter-zeile { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dl .dl-schalter {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--r-pille);
  border: 1.5px solid var(--feldrand); background: var(--weiss); color: var(--text); font-weight: 600; font-size: var(--fs-text);
}
.dl .dl-schalter.an { background: var(--lila); border-color: var(--lila); color: #fff; }
.dl .dl-schalter.gefahr { color: var(--rott); border-color: var(--rott); }
.dl .dl-schalter:disabled { opacity: .45; pointer-events: none; }

.dl .dl-leise {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--lilat); font-weight: 600; font-size: var(--fs-text);
}
.dl .dl-leise:hover { background: var(--soft); }

.dl .dl-wer {
  display: block; font-size: .56em; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--tsoft); margin-bottom: 2px;
}
.dl .dl-wer.ich { color: var(--lilat); font-size: var(--fs-mikro); letter-spacing: .08em; margin: 0; }

/* ---------- Personenwahl (nur Admins) ---------- */

.dl .dl-wahl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dl .dl-wahl-t { font-size: var(--fs-fein); font-weight: 700; color: var(--tsoft); margin-right: 2px; }
.dl .dl-chipknopf {
  min-height: 44px; padding: 0 16px; border-radius: var(--r-pille); border: 1.5px solid var(--feldrand);
  background: var(--weiss); color: var(--text); font-weight: 600; font-size: var(--fs-text);
}
.dl .dl-chipknopf.an { background: var(--lila); border-color: var(--lila); color: #fff; }

/* ---------- Übersicht ---------- */

.dl .dl-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.dl .dl-skript {
  background: var(--weiss); border: 1px solid var(--linie-fein); border-radius: var(--r4); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.dl .dl-skript.gelernt { box-shadow: inset 5px 0 0 var(--gruen), var(--shadow); }
.dl .dl-skript-kopf {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; color: var(--text);
  font-size: var(--fs-karte); line-height: 1.3; font-weight: 700; overflow-wrap: anywhere;
}
.dl .dl-gelernt {
  flex: none; display: inline-flex; align-items: center; gap: 4px; background: var(--gruen-soft); color: var(--gruent);
  border-radius: var(--r-pille); padding: 3px 10px; font-size: var(--fs-fein); font-weight: 700;
}
.dl .dl-fort-klein { display: grid; gap: 4px; }
.dl .dl-fort-klein small { color: var(--tsoft); font-size: var(--fs-fein); }
.dl .dl-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 4px; }
.dl .dl-mehr summary {
  cursor: pointer; font-weight: 700; color: var(--lilat); min-height: 44px; display: flex; align-items: center; gap: 8px;
  list-style: none;
}
.dl .dl-mehr summary::-webkit-details-marker { display: none; }
.dl .dl-mehr .dl-liste { margin-top: 8px; }

/* ---------- Lesen ---------- */

.dl .dl-leiste { display: grid; gap: 12px; }
.dl .dl-regler { display: flex; align-items: center; gap: 10px; }
.dl .dl-regler input[type="range"] { flex: 1; min-width: 0; height: 44px; accent-color: var(--lila); padding: 0; border: 0; background: none; }
.dl .dl-rund {
  flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--soft); color: var(--lilat);
  font-weight: 700; font-size: 16px;
}
.dl .dl-navzeile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dl .dl-navzeile .btn { min-height: 44px; padding: 0 14px; border-radius: var(--r-pille); font-size: var(--fs-text); }
.dl .dl-navzeile .dl-schalter { padding: 0 12px; }
.dl .dl-navzeile.unten { justify-content: center; margin-top: 4px; }
.dl .dl-anzeige { display: flex; flex-wrap: wrap; gap: 8px; }

.dl .dl-blatt { padding: 14px 12px; font-size: var(--dl-fs); line-height: 1.5; }
.dl .dl-z { margin: 0 0 .6em; padding: 8px 12px; border-radius: 12px; }
.dl .dl-z:last-child { margin-bottom: 0; }
.dl .dl-satz { white-space: pre-wrap; }
.dl .dl-eigen {
  background: var(--intern-hell); box-shadow: inset 5px 0 0 var(--intern-rand); color: var(--text); font-weight: 600;
}
.dl .dl-eigen .dl-wer { color: var(--lilat); }
.dl .dl-fremd { color: var(--tsoft); }
.dl .dl-neutral { color: var(--text); box-shadow: inset 3px 0 0 var(--line); }
.dl .dl-regie {
  font-style: italic; color: var(--tsoft); font-size: .76em; line-height: 1.45; padding-top: 2px; padding-bottom: 2px;
  border-left: 3px dotted var(--line); border-radius: 0 8px 8px 0;
}
.dl .dl-regie .dl-wer { display: inline; margin-right: 4px; }
.dl .dl-tag { font-style: italic; color: var(--tsoft); font-size: .8em; font-weight: 400; }
.dl.ohne-regie .dl-regie,
.dl.ohne-regie .dl-tag { display: none; }
.dl.ohne-hervor .dl-eigen { background: none; box-shadow: none; font-weight: 400; }
.dl.ohne-hervor .dl-fremd { color: var(--text); }
.dl.ohne-hervor .dl-eigen .dl-wer { color: var(--tsoft); }

.dl .dl-notiz summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; }
.dl .dl-notiz summary::-webkit-details-marker { display: none; }
.dl .dl-notiz p { white-space: pre-wrap; line-height: 1.5; margin-top: 6px; }

.dl .dl-fuss { display: grid; gap: 10px; }
.dl .dl-vorzurueck { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Lernen ---------- */

.dl .dl-fortkarte { padding: 12px 14px; }
.dl .dl-fort-zeile { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.dl .dl-fort-zeile b { font-size: var(--fs-stark); }
.dl .dl-fortkarte.kompakt { padding: 10px 12px; }
.dl .dl-fortkarte.kompakt .dl-fort-zeile { align-items: center; margin-bottom: 8px; }
.dl .dl-fort-text { display: grid; gap: 1px; min-width: 0; }
.dl .dl-fortkarte.kompakt .dl-schalter { flex: none; padding: 0 12px; }
.dl .dl-buehne { display: flex; flex-direction: column; gap: 14px; }

.dl .dl-start h2,
.dl .dl-fertig h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-karte); margin-bottom: 8px; }
.dl .dl-start p,
.dl .dl-fertig p { line-height: 1.5; margin-bottom: 6px; }
.dl .dl-schritte { margin: 8px 0 12px 22px; line-height: 1.6; font-size: var(--fs-text); }
.dl .dl-fertig-knoepfe { display: grid; gap: 10px; margin-top: 14px; }

.dl .dl-karte { display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.dl .dl-stich { background: var(--soft); border-radius: var(--r3); padding: 12px 14px; }
.dl .dl-etikett-zeile { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -8px -6px 2px 0; min-height: 44px; }
.dl .dl-etikett-zeile .dl-etikett { margin-bottom: 0; }
.dl .dl-etikett {
  font-size: var(--fs-mikro); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tsoft);
  margin-bottom: 6px;
}
.dl .dl-ctx { margin: 0 0 6px; font-size: 17px; line-height: 1.45; color: var(--tsoft); }
.dl .dl-ctx:last-child { margin-bottom: 0; }
.dl .dl-ctx .dl-wer { display: inline; margin-right: 6px; font-size: .7em; }
.dl .dl-ctx-letzte { color: var(--text); font-weight: 600; font-size: 20px; }
.dl .dl-ctx-regie { font-style: italic; font-size: 15px; }

.dl .dl-dran { scroll-margin-bottom: 170px; border: 2px solid var(--intern-rand); background: var(--intern-hell); border-radius: var(--r3); padding: 10px 12px 12px; }
.dl .dl-dran-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.dl .dl-maske {
  display: block; width: 100%; text-align: center; padding: 20px 12px; min-height: 124px; border-radius: 14px;
  border: 2px dashed var(--feldrand); background: var(--weiss); color: var(--text); margin-top: 4px;
}
.dl .dl-maske-t { display: block; font-size: 22px; font-weight: 700; color: var(--lilat); overflow-wrap: anywhere; line-height: 1.35; }
.dl .dl-maske-t.platz { letter-spacing: .3em; }
.dl .dl-maske small { display: block; color: var(--tsoft); margin-top: 8px; font-size: var(--fs-fein); }
.dl .dl-antwort { background: var(--weiss); border-radius: 14px; padding: 14px; margin-top: 4px; }
.dl .dl-antwort p { font-size: 22px; line-height: 1.45; font-weight: 600; white-space: pre-wrap; }
.dl .dl-tasten { display: none; color: var(--tsoft); font-size: var(--fs-fein); }
@media (hover: hover) and (pointer: fine) { .dl .dl-tasten { display: block; } }

.dl .dl-aktionen { display: flex; gap: 10px; }
.dl .dl-aktionen:empty { display: none; }
.dl .dl-aktionen .btn { min-width: 0; }
.dl .dl-schmal { flex: none; width: 56px; padding: 0; }
.dl .dl-kann { flex: 1.4 1 0; background: var(--gruen); color: #fff; }
.dl .dl-kann:hover { background: var(--gruen); filter: brightness(1.1); }
.dl .dl-nochmal { flex: 1 1 0; background: var(--amber-soft); color: var(--ambert); }
.dl .dl-nochmal:hover { background: var(--amber-soft); box-shadow: none; filter: brightness(.96); }

/* Handy und kleines Fenster: die Knopfleiste klebt unten, direkt über der unteren Leiste der App, für den Daumen. */
@media (max-width: 900px) {
  .dl.dl-lernen .dl-aktionen {
    position: fixed; left: 0; right: 0; bottom: var(--dl-unten); z-index: 30; margin: 0;
    padding: 10px 14px;
    background: var(--bg); border-top: 1px solid var(--line);
    box-shadow: 0 -12px 16px -4px var(--bg);
  }
  .dl.dl-lernen.dl-hat-leiste { padding-bottom: 92px; }
}
@media (min-width: 901px) {
  .dl.dl-lernen .dl-aktionen { max-width: 560px; }
}

/* ---------- Mitnehmen ---------- */

.dl .dl-m-kopf { padding: 14px 16px; }
.dl .dl-neu { padding: 0 16px; }
.dl .dl-neu summary {
  cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; min-height: 52px; list-style: none;
  color: var(--lilat);
}
.dl .dl-neu summary::-webkit-details-marker { display: none; }
.dl .dl-neu[open] { padding-bottom: 16px; }
.dl .dl-form { display: grid; gap: 12px; margin-top: 4px; }
.dl .dl-form label { display: grid; gap: 4px; font-size: var(--fs-fein); font-weight: 600; color: var(--tsoft); }
.dl input:not([type="range"]),
.dl select {
  width: 100%; min-height: 48px; font-size: 16px; padding: 10px 12px; border: 1.5px solid var(--feldrand);
  border-radius: var(--r2); background: var(--weiss); color: var(--text);
}

.dl .dl-gruppe { padding: 0; overflow: hidden; }
.dl .dl-g-kopf { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 16px; text-align: left; }
.dl .dl-g-name { flex: 1; min-width: 0; font-weight: 700; font-size: var(--fs-karte); overflow-wrap: anywhere; }
.dl .dl-g-zahl { display: inline-flex; align-items: center; gap: 4px; color: var(--tsoft); font-weight: 600; font-size: var(--fs-text); flex: none; }
.dl .dl-gruppe.komplett .dl-g-zahl { color: var(--gruent); }
.dl .dl-g-pfeil { display: inline-flex; color: var(--tsoft); flex: none; }
.dl .dl-m-liste { list-style: none; margin: 0; padding: 0; }
.dl .dl-m-zeile { display: flex; align-items: stretch; border-top: 1px solid var(--linie-fein); }
.dl .dl-m-haken { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 16px; min-height: 60px; }
.dl .dl-haken {
  flex: none; width: 32px; height: 32px; border-radius: 10px; border: 2.5px solid var(--feldrand); background: var(--weiss);
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.dl .dl-m-zeile.erledigt .dl-haken { background: var(--gruen); border-color: var(--gruen); }
.dl .dl-m-text { display: grid; gap: 2px; min-width: 0; }
.dl .dl-m-text b { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; line-height: 1.35; }
.dl .dl-m-text small { color: var(--tsoft); font-size: var(--fs-text); line-height: 1.4; overflow-wrap: anywhere; }
.dl .dl-m-von { font-style: normal; font-size: var(--fs-fein); color: var(--gruent); font-weight: 600; }
.dl .dl-m-zeile.erledigt .dl-m-text b { text-decoration: line-through; color: var(--tsoft); }
.dl .dl-m-weg { flex: none; width: 56px; display: inline-flex; align-items: center; justify-content: center; color: var(--tsoft); }
.dl .dl-m-weg:hover { color: var(--rott); }

@media (prefers-reduced-motion: reduce) {
  .dl .dl-balken i { transition: none; }
}
@media (max-width: 380px) {
  .dl .dl-aktionen .btn { padding: 0 8px; }
  .dl .dl-aktionen .dl-nochmal svg,
  .dl .dl-aktionen .dl-kann svg { display: none; }
  .dl .dl-schmal { width: 48px; }
}
@media (max-width: 400px) {
  .dl .dl-blatt { padding: 12px 6px; }
  .dl .dl-z { padding: 8px 10px; }
  .dl .dl-knoepfe,
  .dl .dl-vorzurueck { grid-template-columns: 1fr; }
}

/* v255: Skripte von Claude */
.dl .dl-chip.dl-claude { background: var(--soft); color: var(--lilat); box-shadow: inset 0 0 0 1px currentColor; }
