/* Fitness Tracker — mobile-first, dunkel, große Trefferflächen.
   Farbwelt aus dem Vorgänger übernommen. */

:root {
  --bg: #16181B;
  --bg-raised: #1F2327;
  --bg-sunken: #101215;
  --line: #2C3136;
  --line-soft: #23272B;
  --steel: #8B949B;
  --steel-dim: #5B6167;
  --signal: #E8442E;
  --signal-soft: rgba(232, 68, 46, 0.14);
  --signal-dim: #6B2018;
  --paper: #ECEAE4;
  --good: #5FA86A;
  --good-soft: rgba(95, 168, 106, 0.14);
  --warn: #D9A441;
  --warn-soft: rgba(217, 164, 65, 0.14);

  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --r: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 58px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Das Browser-Stylesheet blendet [hidden] über display:none aus — jede eigene
   display-Regel schlägt das aber. Genau daran hing #overlay: als flex deklariert
   und damit trotz hidden sichtbar, samt abgefangener Klicks. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--signal); }

/* Die Höhe ist bewusst etwas größer als der Bildschirm, damit jede Seite
   scrollbar bleibt — auch der leere Verlauf und die leere Auswertung.
   Mobile Browser behandeln nicht scrollbare Seiten anders: Werkzeugleisten
   bleiben ausgefahren, und das Fenster, an dem sich `position: fixed`
   orientiert, ist dann niedriger als der Bildschirm. Die untere Navigation
   rutschte dadurch genau auf den beiden kurzen Seiten nach oben. */
.app {
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  min-height: calc(100vh + 1px);
}
.boot { padding: 40px; text-align: center; color: var(--steel-dim); font-family: var(--mono); }

/* --- Kopfbereich --- */
.topbar {
  padding: calc(var(--safe-t) + 18px) 16px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-row { display: flex; align-items: center; gap: 12px; }
.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-transform: uppercase;
  flex: 1;
  min-width: 0;
}
.topbar .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--steel-dim);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--steel);
  border: 1px solid var(--line);
  flex: none;
  font-size: 18px;
}
.icon-btn:active { background: var(--bg-raised); }

main { padding: 16px; }
.stack > * + * { margin-top: 12px; }

/* --- Karten --- */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}
.card-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--steel-dim);
  margin-bottom: 10px;
}
.card.accent { border-color: var(--signal); }

/* --- Buttons --- */
.btn {
  display: block;
  width: 100%;
  padding: 15px 16px;
  border-radius: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--paper);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.btn-ghost { background: none; color: var(--steel); }
.btn-danger { background: none; border-color: var(--signal-dim); color: var(--signal); }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.btn-sm { padding: 9px 12px; font-size: 13px; width: auto; display: inline-block; }

/* --- Untere Navigation --- */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: var(--bg-sunken);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--steel-dim);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.nav a .ico { font-size: 17px; line-height: 1; }
.nav a.active { color: var(--signal); }

/* Fünf Reiter: die Beschriftung muss auf schmalen Geräten noch passen. */
.nav a { min-width: 0; padding: 0 2px; }
.nav a span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Körper --- */
/* Der Befund bekommt seine Farbe von der Aussage, nicht von der Zahl. */
.card.befund.rekomposition { border-color: var(--good); }
.card.befund.zu-scharf,
.card.befund.zu-viel-ueberschuss { border-color: var(--warn); }
.card.taille.deutlich { border-color: var(--warn); }
.card.taille.ok { border-color: var(--good); }
/* Beim Schlaf ist nur „zu wenig" eine Meldung wert. „Zu spät ins Bett" und
   „unruhig" sind dasselbe Ergebnis auf zwei Wegen und bekommen dieselbe Farbe;
   schwankende Nächte bleiben unmarkiert, weil der Schnitt ja reicht. */
.card.schlaf.gut { border-color: var(--good); }
.card.schlaf.zu-spaet,
.card.schlaf.unruhig { border-color: var(--warn); }

/* --- Startseite --- */
.next-session .plan-id {
  font-size: 46px;
  font-weight: 900;
  line-height: 1;
  color: var(--signal);
  letter-spacing: -2px;
}
.next-session .plan-name { font-size: 19px; font-weight: 700; margin-top: 2px; }
.next-session .plan-meta { font-family: var(--mono); font-size: 12px; color: var(--steel); margin-top: 6px; }
.rotation { display: flex; gap: 6px; margin: 14px 0; }
.rotation button {
  flex: 1;
  padding: 10px 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--steel);
  background: var(--bg-sunken);
}
.rotation button.on { background: var(--signal); border-color: var(--signal); color: #fff; font-weight: 700; }

.preview-list { margin-top: 4px; }
.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.preview-row:last-child { border-bottom: none; }
.preview-row .t { font-family: var(--mono); font-size: 12px; color: var(--steel-dim); flex: none; }

/* --- Kennzahlen --- */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric { background: var(--bg-sunken); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px 10px; text-align: center; }
.metric .v { font-family: var(--mono); font-size: 19px; font-weight: 700; }
.metric .l { font-family: var(--mono); font-size: 10px; color: var(--steel-dim); text-transform: uppercase; margin-top: 4px; letter-spacing: 0.4px; }

/* --- Workout --- */
.wo-head {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: calc(var(--safe-t) + 12px) 16px 0;
}
.wo-head-row { display: flex; align-items: center; gap: 12px; }
.wo-title { flex: 1; min-width: 0; }
.wo-title .h { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: -0.2px; }
.wo-title .s { font-family: var(--mono); font-size: 11px; color: var(--steel-dim); }
.wo-clock { font-family: var(--mono); font-size: 14px; color: var(--steel); flex: none; }

.dots { display: flex; gap: 5px; padding: 12px 0 10px; }
.dots button {
  flex: 1; height: 5px; border-radius: 3px; background: var(--line);
}
.dots button.done { background: var(--good); }
.dots button.current { background: var(--signal); }

.ex-card { }
.ex-name { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.15; }
.ex-sub { font-family: var(--mono); font-size: 11.5px; color: var(--steel-dim); margin-top: 5px; text-transform: uppercase; letter-spacing: 0.4px; }

.prescribe {
  margin: 14px 0;
  border-left: 3px solid var(--signal);
  background: var(--signal-soft);
  border-radius: 0 8px 8px 0;
  padding: 11px 13px;
}
.prescribe .h { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--signal); }
.prescribe .v { font-size: 18px; font-weight: 800; margin-top: 3px; }
/* Einseitige Übungen: eine Zeile je Körperseite. */
.prescribe .v.zweiseitig { display: flex; flex-direction: column; gap: 2px; font-size: 17px; }
.prescribe .v.zweiseitig .s {
  font-family: var(--mono); font-size: 10px; font-weight: 400;
  color: var(--signal); text-transform: uppercase;
  display: inline-block; width: 22px;
}
/* Die Begründung nennt beide Seiten, getrennt durch eine Leerzeile. */
.prescribe .d { font-size: 13px; color: var(--steel); line-height: 1.45; margin-top: 5px; white-space: pre-line; }
.prescribe .d.collapsed { display: none; }
.prescribe .more { font-family: var(--mono); font-size: 11px; color: var(--steel-dim); margin-top: 6px; text-decoration: underline; }

/* Satzzeile */
.sets { margin-top: 6px; }
.set-head {
  display: grid;
  grid-template-columns: 30px 1fr 1fr 52px;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--steel-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 2px 6px;
}
.set {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  background: var(--bg-sunken);
}
.set.done { border-color: var(--good); background: var(--good-soft); }
.set-main {
  display: grid;
  grid-template-columns: 30px 1fr 1fr 52px;
  gap: 8px;
  align-items: center;
}
.set-idx {
  font-family: var(--mono); font-size: 13px; color: var(--steel-dim);
  display: flex; flex-direction: column; align-items: center;
  line-height: 1.15;
}
.set-idx .side {
  font-size: 9px; letter-spacing: 0.5px;
  color: var(--signal); text-transform: uppercase;
}

/* Links und rechts gehören zusammen: das Paar rückt eng zusammen, der Abstand
   kommt erst nach der rechten Seite. Ohne das liest sich die Liste wie sechs
   unabhängige Sätze statt wie drei Durchgänge. */
.set[data-side="L"] { margin-bottom: 4px; }
.set[data-side="R"] { margin-bottom: 16px; }

.stepper { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.stepper button {
  width: 40px; height: 46px; flex: none;
  color: var(--steel); font-size: 21px; font-weight: 600;
  display: grid; place-items: center;
}
.stepper button:active { background: var(--line); color: var(--paper); }
.stepper input {
  flex: 1; min-width: 0; width: 100%;
  height: 46px;
  border: none; background: none;
  text-align: center;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  padding: 0;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input::placeholder { color: var(--steel-dim); font-weight: 400; }
.stepper.na { opacity: 0.35; pointer-events: none; }

.check {
  height: 46px; width: 52px;
  border-radius: 7px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 20px;
  color: var(--steel-dim);
  background: var(--bg);
}
.set.done .check { background: var(--good); border-color: var(--good); color: #10240f; }

.rpe-row { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.rpe-row .lbl {
  font-family: var(--mono); font-size: 10px; color: var(--steel-dim);
  text-transform: uppercase; flex: none;
}
/* Der Titel ist zugleich der Zugang zur Erklärung. */
.rpe-row button.lbl {
  border: none; background: none; padding: 8px 2px;
  text-decoration: underline; text-underline-offset: 2px;
}
.rpe-row button {
  flex: 1; padding: 8px 0;
  border: 1px solid var(--line); border-radius: 6px;
  font-family: var(--mono); font-size: 13px; color: var(--steel);
  background: var(--bg);
}
.rpe-row button.on { background: var(--signal); border-color: var(--signal); color: #fff; font-weight: 700; }

.set-actions { display: flex; justify-content: space-between; margin-top: 8px; }
.link-btn { font-family: var(--mono); font-size: 11.5px; color: var(--steel-dim); text-decoration: underline; padding: 4px 0; }

.last-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--steel);
  background: var(--bg-sunken);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.last-time b { color: var(--paper); font-weight: 700; }

.wo-footer { display: flex; gap: 10px; margin-top: 18px; }
.wo-footer .btn { flex: 1; }

/* Pausentimer */
.rest-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-b));
  background: var(--bg-sunken);
  border-top: 2px solid var(--signal);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 25;
}
.rest-bar .t { font-family: var(--mono); font-size: 24px; font-weight: 700; min-width: 74px; }
.rest-bar .lbl { font-family: var(--mono); font-size: 10.5px; color: var(--steel-dim); text-transform: uppercase; letter-spacing: 0.5px; flex: 1; }
.rest-bar button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: 12px; color: var(--steel); }
.rest-progress { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--signal); transition: width 1s linear; }

/* --- Befunde / Hinweise --- */
.finding {
  display: flex; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  background: var(--bg-sunken);
  border-left: 3px solid var(--steel-dim);
  margin-bottom: 8px;
  color: var(--steel);
}
.finding .ico { flex: none; font-size: 13px; }
.finding.good { border-left-color: var(--good); background: var(--good-soft); }
.finding.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.finding.info { border-left-color: var(--steel-dim); }
.finding b { color: var(--paper); }

/* --- Verlauf --- */
.hist-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 14px;
  margin-bottom: 10px;
}
.hist-item .r1 { display: flex; align-items: baseline; gap: 10px; }
.hist-item .pid { font-weight: 900; color: var(--signal); font-size: 17px; }
.hist-item .nm { font-weight: 700; font-size: 14.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item .dt { font-family: var(--mono); font-size: 11.5px; color: var(--steel-dim); flex: none; }
.hist-item .r2 { font-family: var(--mono); font-size: 11.5px; color: var(--steel); margin-top: 6px; }
/* Ein Cardio-Tag trägt keinen Plan-Buchstaben. Die Tilde steht an derselben
   Stelle, nimmt sich aber die Farbe zurück — er ist kein Trainingstag. */
.hist-item .pid.cardio { color: var(--steel-dim); font-weight: 700; }

/* --- Änderungen je Version --- */
.aenderung { padding: 12px 0; border-bottom: 1px solid var(--line); }
.aenderung:last-child { border-bottom: none; }
.aenderung .kopf { display: flex; align-items: baseline; gap: 8px; }
.aenderung .nr {
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--paper);
}
.aenderung .wann {
  font-family: var(--mono); font-size: 11px; color: var(--steel-dim); margin-left: auto;
}
.aenderung .jetzt {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--signal); border: 1px solid var(--signal); border-radius: 4px; padding: 1px 5px;
}
.aenderung.aktuell .nr { color: var(--signal); }
.aenderung ul {
  margin: 8px 0 0; padding-left: 16px;
  font-size: 13px; line-height: 1.55; color: var(--steel);
}
.aenderung li { margin-bottom: 4px; }
.aenderung li:last-child { margin-bottom: 0; }

/* Trennlinie zwischen den Trainingsphasen. Zurückhaltend gehalten: Sie ordnet
   den Verlauf ein, sie ist kein Ereignis für sich. */
.phasengrenze {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--steel-dim);
}
.phasengrenze::before,
.phasengrenze::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* --- Auswertung --- */
.ex-row {
  display: block; width: 100%; text-align: left;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.ex-row .top { display: flex; align-items: center; gap: 10px; }
.ex-row .nm { flex: 1; font-weight: 700; font-size: 14.5px; }
.badge {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 7px; border-radius: 4px; flex: none;
  background: var(--line); color: var(--steel);
}
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--line); color: var(--steel); }
.ex-row .sub { font-family: var(--mono); font-size: 11.5px; color: var(--steel-dim); margin-top: 5px; }

/* touch-action: pan-y — waagrechtes Wischen fährt die Reihe entlang, senkrecht
   scrollt weiterhin die Seite. Ohne die Angabe verschluckt das Diagramm den
   Scrollversuch, sobald der Finger auf ihm aufsetzt. */
.chart { width: 100%; height: 140px; display: block; touch-action: pan-y; cursor: crosshair; }
.chart-readout {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: 11.5px; color: var(--steel-dim);
  margin-bottom: 6px; min-height: 15px;
}
.chart-readout .v { color: var(--steel); font-weight: 700; }
.chart-readout.aktiv { color: var(--steel); }
.chart-readout.aktiv .v { color: var(--paper); }
/* Bis zur ersten Berührung gibt es nichts hervorzuheben. */
.chart-marke { opacity: 0; }
.chart-marke.an { opacity: 1; }
.chart-empty { color: var(--steel-dim); font-family: var(--mono); font-size: 12px; text-align: center; padding: 30px 0; }

.vol-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.vol-row .nm { font-size: 13px; width: 96px; flex: none; }
.vol-bar { flex: 1; height: 18px; background: var(--bg-sunken); border-radius: 4px; position: relative; overflow: hidden; border: 1px solid var(--line-soft); }
.vol-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--steel-dim); }
.vol-bar .fill.ok { background: var(--good); }
.vol-bar .fill.low { background: var(--warn); }
/* Die Minimumlinie liegt auf dem Balken und muss sich deshalb gegen beide
   Untergründe behaupten: gegen den dunklen leeren Teil und gegen die gefüllte
   Fläche. Eine graue Linie verschwand auf Grün fast vollständig. Hell
   gestrichelt mit dunklem Saum wird auf jedem Untergrund gelesen — der Saum
   trägt auf Grün, die helle Strichelung auf dem dunklen Rest. */
.vol-bar .target {
  position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: repeating-linear-gradient(
    to bottom, var(--paper) 0 3px, transparent 3px 6px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
}
.vol-row .n { font-family: var(--mono); font-size: 12px; color: var(--steel); width: 34px; text-align: right; flex: none; }

.week-select { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.week-select button {
  flex: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--steel); white-space: nowrap; background: var(--bg-sunken);
}
.week-select button.on { background: var(--signal); border-color: var(--signal); color: #fff; }

/* --- Einstellungen --- */
.setting { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.setting:last-child { border-bottom: none; }
.setting .txt { flex: 1; }
.setting .txt .t { font-size: 14.5px; font-weight: 600; }
.setting .txt .d { font-size: 12.5px; color: var(--steel-dim); margin-top: 3px; line-height: 1.4; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--steel); transition: transform .15s, background .15s; }
.switch.on { background: var(--signal); }
.switch.on::after { transform: translateX(20px); background: #fff; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { flex: 1; padding: 10px 6px; font-family: var(--mono); font-size: 12px; color: var(--steel); background: var(--bg-sunken); }
.seg button.on { background: var(--signal); color: #fff; font-weight: 700; }

/* --- Aufklappbare Abschnitte --- */
.acc {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 10px;
  overflow: hidden;
}
.acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  text-align: left;
}
.acc-head .txt { flex: 1; min-width: 0; }
.acc-head .t { font-size: 15px; font-weight: 700; }
.acc-head .s {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--steel-dim);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-head .chev {
  flex: none;
  font-size: 17px;
  color: var(--steel-dim);
  transition: transform .15s ease, color .15s ease;
}
.acc.open .acc-head { border-bottom: 1px solid var(--line); }
.acc.open .acc-head .chev { transform: rotate(90deg); color: var(--signal); }
.acc-body { display: none; padding: 16px; }
.acc.open .acc-body { display: block; }
.acc-body > .setting:first-child { padding-top: 0; }

/* --- Glossar --- */
.gloss {
  border-left: 2px solid var(--line);
  padding-left: 12px;
  margin-bottom: 15px;
}
.gloss:last-child { margin-bottom: 0; }
.gloss .term { font-size: 14.5px; font-weight: 700; }
.gloss .term span {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--steel-dim);
  font-weight: 400;
  margin-left: 7px;
  text-transform: none;
}
.gloss .def {
  font-size: 13.5px;
  color: var(--steel);
  line-height: 1.55;
  margin-top: 4px;
}

/* --- Overlay / Bottom Sheet --- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: flex-end;
}
.sheet {
  width: 100%;
  background: var(--bg-raised);
  border-top: 2px solid var(--signal);
  border-radius: 14px 14px 0 0;
  padding: 18px 16px calc(18px + var(--safe-b));
  max-height: 85vh;
  overflow-y: auto;
}
.sheet h2 { margin: 0 0 4px; font-size: 17px; font-weight: 800; text-transform: uppercase; }
.sheet p { color: var(--steel); font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }
.sheet-list button {
  display: block; width: 100%; text-align: left;
  padding: 14px 12px; border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 8px; font-size: 14.5px; background: var(--bg-sunken);
}
.sheet-list button .sub { display: block; font-family: var(--mono); font-size: 11px; color: var(--steel-dim); margin-top: 3px; }
.sheet-list button.sel { border-color: var(--signal); background: var(--signal-soft); }
.sheet-list button .mark { float: right; color: var(--signal); font-weight: 700; }

.toast {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  background: var(--paper);
  color: var(--bg);
  padding: 13px 15px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 60;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
}

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--steel-dim);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

/* --- Übungslexikon --- */

/* Die Zeichnungen kommen als SVG aus js/exercise-guide.js und holen sich ihre
   Farben von hier, damit sie zum Rest der Oberfläche passen. */
/* Breite begrenzt, sonst wächst die Zeichnung mit dem Seitenverhältnis 3:2 in
   die Höhe und schiebt auf dem Telefon die Anleitung aus dem Sheet. */
.sketch {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px 10px;
  margin: 14px auto 0;
  max-width: 320px;
}
.sketch svg { display: block; width: 100%; height: auto; }
.sketch .eq { fill: none; stroke: var(--steel-dim); stroke-width: 1.6; stroke-linecap: round; }
.sketch .bd { fill: none; stroke: var(--paper); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.sketch .hd { fill: var(--paper); }
.sketch .ar { fill: none; stroke: var(--signal); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Vorschau in der Liste: kleiner, ohne Rahmen, Gerät zurückgenommen. */
.sketch-mini {
  width: 62px; max-width: none; flex: none;
  margin: 0; padding: 0;
  background: none; border: none;
}
.sketch-mini .bd { stroke-width: 4; }
.sketch-mini .eq { stroke-width: 2.2; }
.sketch-mini .ar { stroke-width: 3.4; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.chip {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.3px;
  color: var(--steel);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 9px;
}
/* Auswählbare Variante — im Formular für eigene Übungen. Die Trefferfläche
   liegt über den 10,5 px Schrift, damit sie am Gerät zu treffen ist. */
button.chip { padding: 7px 12px; font-size: 11.5px; }
button.chip.on { color: var(--signal); border-color: var(--signal); background: var(--bg-raised); }

.guide-text { font-size: 13.5px; color: var(--steel); line-height: 1.55; }
.guide-steps {
  margin: 0; padding-left: 20px;
  font-size: 13.5px; color: var(--steel); line-height: 1.55;
}
.guide-steps li { margin-bottom: 6px; }
.guide-steps li::marker { color: var(--signal); font-family: var(--mono); font-size: 12px; }

.lex-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.lex-row:last-child { border-bottom: none; }
.lex-row .t { font-size: 14.5px; }
.lex-row .d { font-family: var(--mono); font-size: 11px; color: var(--steel-dim); margin-top: 2px; }
.lex-row .chev { color: var(--steel-dim); font-size: 17px; }

/* --- Fußbereich mit Version --- */
.app-footer {
  text-align: center;
  padding: 26px 0 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--steel-dim);
  line-height: 1.7;
}
.app-footer .name { letter-spacing: 0.5px; text-transform: uppercase; }
.app-footer .version {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--steel);
  padding: 6px 12px;
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: 20px;
}
.app-footer .version:active { background: var(--bg-raised); color: var(--paper); }
.app-footer .note { font-size: 10.5px; }

.muted { color: var(--steel-dim); }
.mono { font-family: var(--mono); }
.small { font-size: 12.5px; }
hr.sep { border: none; border-top: 1px solid var(--line-soft); margin: 14px 0; }

@media (min-width: 620px) {
  .app { max-width: 620px; margin: 0 auto; }
  .nav { max-width: 620px; left: 50%; transform: translateX(-50%); }
  .rest-bar { max-width: 620px; left: 50%; transform: translateX(-50%); }
  .toast { max-width: 588px; left: 50%; transform: translateX(-50%); right: auto; width: calc(100% - 32px); }
}
