:root {
  --ink: #16140F;
  --ink-2: #211E17;
  --timber: #5E4A30;
  --timber-line: #3A3026;
  --decal: #E9E4D4;
  --decal-2: #DAD3BE;
  --rule: #B2302A;
  --signal: #F0B90B;
  --muted: #8C8272;
  --done: #2E6B3E;
}

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

html, body {
  margin: 0;
  background: var(--ink);
  min-height: 100%;
  overscroll-behavior-y: none;
}

.tp-app {
  font-family: 'Barlow', system-ui, sans-serif;
  background: var(--ink);
  color: var(--decal);
  max-width: 560px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 12px calc(40px + env(safe-area-inset-bottom));
  line-height: 1.45;
  user-select: none;
}

.tp-app h1, .tp-app h2, .tp-app h3, .tp-app .cond {
  font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  letter-spacing: 0.01em;
  margin: 0;
}

/* ---- Kopf ---- */
.tp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--timber-line);
}
.tp-head h1 { font-size: 26px; font-weight: 700; }
.tp-when { display: flex; align-items: baseline; gap: 8px; }
.tp-date { color: var(--muted); font-size: 14px; font-weight: 500; }

/* Zeichen für eine neue Fassung, links neben dem Datum. */
.upd-dot {
  flex: 0 0 auto; cursor: pointer;
  font-family: 'Barlow Condensed'; font-size: 15px; font-weight: 700; line-height: 1;
  padding: 5px 9px; border-radius: 999px; border: 0;
  background: var(--signal); color: var(--ink);
}

/* ---- Wochenleiste ---- */
.tp-week { display: flex; gap: 5px; margin: 14px 0 4px; }
.tp-day {
  flex: 1;
  border: 1px solid var(--timber-line);
  border-radius: 3px;
  padding: 7px 2px 6px;
  text-align: center;
  background: var(--ink-2);
}
.tp-day.today { border-color: var(--signal); }
.tp-day.filled { background: var(--done); border-color: var(--done); }
.tp-day .d { font-family: 'Barlow Condensed'; font-size: 12px; color: var(--muted); }
.tp-day.filled .d { color: #CFE3D4; }
.tp-day .m { font-family: 'Barlow Condensed'; font-size: 17px; font-weight: 700; line-height: 1.1; }
.tp-day .m.empty { color: var(--timber-line); }

.tp-count { font-size: 13px; color: var(--muted); margin: 8px 2px 16px; }
.tp-count b { color: var(--decal); font-weight: 600; }

/* ---- Nachtschicht ---- */
.tp-shift {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--ink-2);
  border: 1px solid var(--timber-line);
  border-left: 4px solid var(--timber);
  border-radius: 3px;
  padding: 11px 13px;
  margin-bottom: 16px;
}
.tp-shift.on { border-left-color: var(--signal); }
.tp-shift .lbl { font-size: 14px; }
.tp-shift .sub { font-size: 12px; color: var(--muted); }
.tp-toggle {
  flex: 0 0 auto;
  width: 52px; height: 30px;
  border-radius: 15px;
  border: 1px solid var(--timber-line);
  background: #0E0D0A;
  position: relative;
  cursor: pointer;
  padding: 0;
}
.tp-toggle span {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--muted);
  transition: transform .18s ease, background .18s ease;
}
.tp-shift.on .tp-toggle { background: #3A2F0A; border-color: var(--signal); }
.tp-shift.on .tp-toggle span { transform: translateX(22px); background: var(--signal); }

/* ---- Einheiten-Wahl ---- */
.tp-pick { display: flex; gap: 7px; margin-bottom: 14px; }
.tp-pick button {
  flex: 1;
  font-family: 'Barlow Condensed';
  font-size: 15px; font-weight: 600;
  padding: 9px 4px 8px;
  background: var(--ink-2);
  color: var(--muted);
  border: 1px solid var(--timber-line);
  border-radius: 3px;
  cursor: pointer;
}
.tp-pick button .k { display: block; font-size: 20px; font-weight: 700; color: var(--decal-2); line-height: 1; }
.tp-pick button.sel { background: var(--decal); border-color: var(--decal); color: #4A4335; }
.tp-pick button.sel .k { color: var(--ink); }
.tp-pick button.sug { border-color: var(--signal); }

/* ---- Decal-Karte ---- */
.tp-card {
  background: var(--decal);
  color: var(--ink);
  border-radius: 3px;
  padding: 5px;
  box-shadow: 0 1px 0 #0B0A07;
}
.tp-card-in { border: 2px solid var(--rule); border-radius: 2px; padding: 14px 13px 16px; }
.tp-title {
  display: flex; align-items: baseline; gap: 9px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(178,48,42,.35);
  margin-bottom: 4px;
}
.tp-title .big {
  font-family: 'Barlow Condensed';
  font-size: 40px; font-weight: 700; font-style: italic;
  line-height: .85; color: var(--rule);
}
.tp-title .nm { font-family: 'Barlow Condensed'; font-size: 22px; font-weight: 700; }
.tp-title .fo { font-size: 12.5px; color: #6B6353; line-height: 1.25; }

/* ---- Übungen ---- */
.tp-ex {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(0,0,0,.09);
  cursor: pointer;
}
.tp-ex:last-of-type { border-bottom: 0; }
.tp-box {
  width: 34px; height: 34px;
  border: 2px solid #9A9383;
  border-radius: 2px;
  background: #F3F0E4;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed'; font-size: 15px; font-weight: 700; color: #9A9383;
}
.tp-ex.ok .tp-box { background: var(--done); border-color: var(--done); color: #fff; }
.tp-ex.part .tp-box { border-color: var(--signal); color: #4A4335; background: #FBF3D6; }
.tp-box em { font-style: normal; font-size: 11px; font-weight: 500; color: #A29A88; }
.tp-ex.part .tp-box em { color: #8A7C4E; }
.tp-ex.ok .nm { text-decoration: line-through; color: #8C8474; }
.tp-ex .nm { font-family: 'Barlow Condensed'; font-size: 18px; font-weight: 600; line-height: 1.15; }
.tp-ex .rp { font-size: 12.5px; color: #6B6353; }
.tp-ex .hint { font-size: 12px; color: var(--rule); margin-top: 2px; }

.tp-kg { display: flex; align-items: center; gap: 4px; }
.tp-kg button {
  width: 27px; height: 27px;
  border: 1px solid #A69E8C; background: #F3F0E4; color: #4A4335;
  border-radius: 2px; font-size: 15px; line-height: 1; cursor: pointer; padding: 0;
}
.tp-kg .val {
  font-family: 'Barlow Condensed'; font-weight: 700; font-size: 16px;
  min-width: 42px; text-align: center; color: var(--ink);
}
.tp-kg .val small { font-weight: 500; font-size: 11px; color: #6B6353; }
.tp-kg .val .sub { font-family: 'Barlow'; font-weight: 500; font-size: 11px; color: #6B6353; line-height: 1.1; margin-top: 1px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: baseline; }
.dot.g { background: #3E8B4E; }
.dot.y { background: #D9A00B; }
.dot.r { background: var(--rule); }
.dot.n { background: transparent; border: 1px solid #B6AE9B; }

.tp-key {
  display: flex; gap: 14px;
  padding-top: 11px; margin-top: 3px;
  border-top: 1px solid rgba(0,0,0,.09);
  font-size: 12px; color: #6B6353;
}

.tp-pw { display: flex; align-items: center; gap: 7px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.tp-pw span { flex: 1; }
.tp-pw button {
  font-family: 'Barlow Condensed'; font-size: 14px; font-weight: 600;
  padding: 6px 12px; border-radius: 3px; cursor: pointer;
  background: var(--ink-2); color: var(--muted); border: 1px solid var(--timber-line);
}
.tp-pw button.sel { background: var(--decal); color: var(--ink); border-color: var(--decal); }
.tp-bw { font-size: 11.5px; color: #6B6353; font-style: italic; white-space: nowrap; }

/* ---- Abschluss ---- */
.tp-finish {
  width: 100%;
  margin-top: 16px;
  font-family: 'Barlow Condensed';
  font-size: 19px; font-weight: 700;
  padding: 15px;
  border: 0; border-radius: 3px;
  background: var(--signal); color: #241D02;
  cursor: pointer;
}
.tp-finish:disabled { background: var(--ink-2); color: var(--muted); border: 1px solid var(--timber-line); }
.tp-finish.undo { background: var(--ink-2); color: var(--decal); border: 1px solid var(--done); }

.tp-nav { display: flex; gap: 7px; margin: 12px 0 4px; }
.tp-nav button {
  flex: 1; font-family: 'Barlow Condensed'; font-size: 16px; font-weight: 600;
  padding: 9px 4px; cursor: pointer; border-radius: 3px;
  background: var(--ink-2); color: var(--muted); border: 1px solid var(--timber-line);
}
.tp-nav button.sel { background: var(--decal); color: var(--ink); border-color: var(--decal); }

.cal-bar { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; }
.cal-bar button {
  width: 36px; height: 36px; font-size: 20px; line-height: 1; cursor: pointer;
  background: var(--ink-2); color: var(--decal); border: 1px solid var(--timber-line); border-radius: 3px;
}
.cal-t { flex: 1; text-align: center; font-family: 'Barlow Condensed'; font-size: 20px; font-weight: 700; }
.cal-sum { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.cal-sum b { color: var(--signal); font-weight: 600; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 18px; }
.cal-h { font-family: 'Barlow Condensed'; font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-c {
  aspect-ratio: 1; position: relative; padding: 0; cursor: pointer;
  background: var(--ink-2); border: 1px solid var(--timber-line); border-radius: 3px;
  color: var(--decal-2); font-family: 'Barlow Condensed';
}
.cal-c.void { background: transparent; border: 0; }
.cal-c:disabled { cursor: default; color: #4A4335; }
.cal-c .n { font-size: 13px; position: absolute; top: 3px; left: 5px; }
.cal-c .k { font-size: 17px; font-weight: 700; position: absolute; bottom: 2px; right: 5px; }
.cal-c.done { background: var(--done); border-color: var(--done); color: #EAF3EC; }
.cal-c.part { border-color: var(--signal); }
.cal-c.now .n { color: var(--signal); font-weight: 700; }
.cal-c.sel { outline: 2px solid var(--decal); outline-offset: 1px; }

.tp-hint { font-size: 13px; color: var(--muted); padding: 14px 2px; }

.dt-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid rgba(0,0,0,.09);
}
.dt-row:last-child { border-bottom: 0; }
.dt-m { font-family: 'Barlow Condensed'; font-size: 14px; font-weight: 700; color: var(--done); }
.dt-row.skip .dt-m { color: #B6AE9B; }
.dt-row.skip .dt-n { color: #9A9383; }
.dt-n { font-family: 'Barlow Condensed'; font-size: 16px; font-weight: 600; color: var(--ink); }
.dt-w { font-size: 12px; color: #6B6353; white-space: nowrap; }

/* Empfohlene Erholung: im Training unter dem Abschluss, auf der Startseite
   als eigene Zeile. */
/* Stufenknopf im Trainingskopf: sitzt rechts neben Namen und Schwerpunkt. */
.tp-title { align-items: center; }
.mini.int {
  margin-left: auto; flex: 0 0 auto;
  background: transparent; color: #6B6353; border-color: #C3BBA8;
}

.tp-rec { font-size: 13px; color: #6B6353; margin: 10px 0 0; }
.rec {
  font-size: 13px; color: var(--decal-2); margin: 8px 0 0;
  border-left: 3px solid var(--rule); padding-left: 9px;
}
.rec.ok { border-left-color: var(--done); }

.tp-note { font-size: 12.5px; color: var(--muted); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--timber-line); }
.tp-err { font-size: 12.5px; color: var(--rule); margin-top: 10px; }

/* ---- Einstellungen ---- */
.set-sec { margin-top: 18px; }
.set-sec h2 { font-size: 18px; font-weight: 700; color: var(--decal); margin-bottom: 8px; }
.set-sec p { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.set-btn {
  width: 100%; margin-bottom: 8px;
  font-family: 'Barlow Condensed'; font-size: 16px; font-weight: 600;
  padding: 12px; border-radius: 3px; cursor: pointer; text-align: left;
  background: var(--ink-2); color: var(--decal); border: 1px solid var(--timber-line);
}
.set-btn.warn { border-color: var(--rule); color: #E7A9A6; }
.set-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.set-list button {
  font-family: 'Barlow'; font-size: 13px; text-align: left; padding: 9px 11px;
  background: var(--ink-2); color: var(--decal-2); border: 1px solid var(--timber-line);
  border-radius: 3px; cursor: pointer;
}
.set-stat { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.set-stat b { display: block; font-family: 'Barlow Condensed'; font-size: 22px; color: var(--signal); font-weight: 700; }

/* ---- Meldung ---- */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: 90vw;
  background: var(--decal); color: var(--ink);
  font-size: 13.5px; padding: 11px 16px; border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
  z-index: 50;
}
.toast.bad { background: var(--rule); color: #fff; }

button:focus-visible, .tp-ex:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Optionen: Navigation in Unterseiten ---- */
.nav-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--ink-2); color: var(--decal);
  border: 1px solid var(--timber-line); border-radius: 3px;
  padding: 13px 14px; margin-bottom: 8px;
  font-family: 'Barlow', system-ui, sans-serif;
}
.nav-n {
  font-family: 'Barlow Condensed'; font-size: 18px; font-weight: 600;
  grid-column: 1; line-height: 1.1;
}
.nav-s { grid-column: 1; font-size: 12.5px; color: var(--muted); }
.nav-c { grid-column: 2; grid-row: 1 / span 2; font-size: 22px; color: var(--muted); padding-left: 10px; }

.sub-bar { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.sub-bar h2 { font-family: 'Barlow Condensed'; font-size: 22px; font-weight: 700; margin: 0; }

.intro { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
h3.sec {
  font-family: 'Barlow Condensed'; font-size: 18px; font-weight: 700;
  margin: 22px 0 8px; padding-top: 12px; border-top: 1px solid var(--timber-line);
}
ul.plain { list-style: none; margin: 0 0 12px; padding: 0; font-size: 14px; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--timber-line); }
ul.plain li:last-child { border-bottom: 0; }

/* ---- Listen mit Bearbeiten/Löschen ---- */
.lst {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--ink-2); border: 1px solid var(--timber-line); border-radius: 3px;
  padding: 10px 12px; margin-bottom: 7px;
}
.lst-m { min-width: 0; }
.lst-n { font-family: 'Barlow Condensed'; font-size: 17px; font-weight: 600; line-height: 1.15; }
.lst-s { font-size: 12px; color: var(--muted); }
.row-act { display: flex; gap: 6px; flex: 0 0 auto; }
.mini {
  font-family: 'Barlow Condensed'; font-size: 14px; font-weight: 600;
  padding: 7px 11px; border-radius: 3px; cursor: pointer;
  background: var(--ink); color: var(--decal-2); border: 1px solid var(--timber-line);
}
.mini.warn { color: #E7A9A6; border-color: #5E2B28; }
.mini:disabled { opacity: .55; cursor: default; }
.tag {
  display: inline-block; min-width: 22px; text-align: center;
  background: var(--decal); color: var(--ink); border-radius: 2px;
  font-family: 'Barlow Condensed'; font-weight: 700; font-size: 13px; padding: 1px 5px;
}

/* ---- Formularfelder ---- */
.fld { display: block; margin-bottom: 14px; }
.fld-l { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.fld-h { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.in {
  width: 100%; font-family: 'Barlow', system-ui, sans-serif; font-size: 15px;
  padding: 11px 12px; border-radius: 3px;
  background: var(--ink-2); color: var(--decal); border: 1px solid var(--timber-line);
}
.in:focus { outline: 2px solid var(--signal); outline-offset: 1px; }
select.in { appearance: none; background-image: none; }
.two { display: flex; gap: 8px; }
.two > * { flex: 1; min-width: 0; }
.chk { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-bottom: 6px; }

/* Mehrfachauswahl in der Übungsliste: Kästchen links, Text daneben. */
.lst.pick { justify-content: flex-start; gap: 12px; cursor: pointer; }
.lst.pick input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--signal); }
.lst.pick .lst-m { flex: 1; }
.pick-bar { flex-wrap: wrap; margin-bottom: 10px; }
.chk input { width: 20px; height: 20px; accent-color: var(--signal); }

/* ---- Übungen innerhalb eines Plans ---- */
.pi {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center;
  background: var(--ink-2); border: 1px solid var(--timber-line); border-radius: 3px;
  padding: 10px 12px; margin-bottom: 7px;
}
.pi-n { font-family: 'Barlow Condensed'; font-size: 16px; font-weight: 600; }
.pi-f { display: flex; gap: 6px; grid-column: 1; }
.pi .row-act { grid-column: 2; grid-row: 1 / span 2; }
.in.tiny { font-size: 13px; padding: 7px 9px; }
.in.tiny.num { width: 58px; flex: 0 0 auto; }
.add-row { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; }
.add-row .in { flex: 1; }

.set-btn.go { background: var(--signal); color: #241D02; border-color: var(--signal); }
.set-btn:disabled { opacity: .6; cursor: default; }

/* ---- Fortschritt beim Herunterladen ---- */
.bar {
  height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 10px;
  background: var(--ink-2); border: 1px solid var(--timber-line);
}
.bar-in { height: 100%; background: var(--signal); transition: width .2s linear; }

/* ---- Verbindung zum KI-Anbieter ---- */
.conn {
  background: var(--ink-2); border: 1px solid var(--timber-line); border-radius: 3px;
  padding: 12px 13px; margin-bottom: 16px;
}
.conn-s { font-family: 'Barlow Condensed'; font-size: 16px; font-weight: 600; color: var(--muted); }
.conn-s.ok { color: #6FB37E; }
.conn-s.bad { color: #B9A98C; }
.conn-k {
  font-family: ui-monospace, 'Courier New', monospace; font-size: 12.5px;
  color: var(--muted); margin: 2px 0 10px; word-break: break-all;
}
.conn .intro { margin-bottom: 12px; }
.conn .set-btn { margin-bottom: 0; }
.steps { margin: 14px 0 12px; padding-left: 20px; font-size: 14px; color: #C9C2B1; }
.steps li { margin-bottom: 6px; }

/* ---- Ausklappbare Erklärung ---- */
.help {
  margin-top: 12px;
  border-top: 1px solid var(--timber-line);
  padding-top: 10px;
}
.help summary {
  cursor: pointer;
  list-style: none;
  font-family: 'Barlow Condensed'; font-size: 15px; font-weight: 600;
  color: var(--signal);
  padding: 4px 0;
}
.help summary::-webkit-details-marker { display: none; }
.help summary::before { content: '▸ '; display: inline-block; width: 14px; }
.help[open] summary::before { content: '▾ '; }
.help h4 {
  font-family: 'Barlow Condensed'; font-size: 15px; font-weight: 700;
  color: var(--decal); margin: 14px 0 2px;
}
.help p { font-size: 13.5px; color: #C9C2B1; margin: 0; line-height: 1.5; }

/* Kurze Gegenüberstellung in einem Hinweis: links wofür, rechts wie lange. */
.help .tip {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 13.5px; color: #C9C2B1;
  padding: 7px 0; border-bottom: 1px solid var(--timber-line);
}
.help .tip:last-of-type { border-bottom: 0; }
.help .tip b { color: var(--signal); white-space: nowrap; }

/* ---- Geräte-Katalog ---- */
#f-search { margin-bottom: 10px; }
.cat { margin-bottom: 16px; }
.cat-h {
  font-family: 'Barlow Condensed'; font-size: 15px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  margin: 0 0 6px; padding-bottom: 4px;
  border-bottom: 1px solid var(--timber-line);
}
.cat-i {
  display: block; width: 100%; text-align: left; cursor: pointer;
  font-family: 'Barlow', system-ui, sans-serif; font-size: 15px;
  padding: 11px 12px; margin-bottom: 5px; border-radius: 3px;
  background: var(--ink-2); color: var(--decal); border: 1px solid var(--timber-line);
}
.cat-i:active { background: var(--decal); color: var(--ink); }

/* ---- Schnellauswahl der Kombigeräte ---- */
h3.sec.first { margin-top: 8px; padding-top: 0; border-top: 0; }
.bundle-i {
  background: var(--ink-2); border: 1px solid var(--timber-line); border-radius: 3px;
  padding: 11px 12px; margin-bottom: 6px; gap: 11px;
}
.bundle-i span { line-height: 1.3; }

/* ---- Menüknopf ---- */
.tp-nav .burger {
  flex: 0 0 auto; width: 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 9px 0;
}
.tp-nav .burger span {
  display: block; width: 20px; height: 2px; border-radius: 1px;
  background: var(--muted);
}
.tp-nav .burger.sel span { background: var(--ink); }

/* ---- Startseite ---- */
.stat-row { display: flex; gap: 10px; margin-bottom: 12px; }
.stat {
  flex: 1; background: var(--ink-2); border: 1px solid var(--timber-line);
  border-radius: 3px; padding: 10px 8px; text-align: center;
  font-size: 11.5px; color: var(--muted); line-height: 1.25;
}
.stat b {
  display: block; font-family: 'Barlow Condensed'; font-size: 24px;
  font-weight: 700; color: var(--signal);
}
.bars {
  display: flex; align-items: flex-end; gap: 5px; height: 56px;
  padding: 0 2px; margin-bottom: 8px;
}
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-v {
  width: 100%; min-height: 3px; border-radius: 2px 2px 0 0;
  background: var(--timber);
}
.bar-v.full { background: var(--done); }
.nav-row.due { border-color: var(--signal); }
.ai-mark { color: var(--signal); font-size: 13px; }

/* ---- Trainer-Chat ---- */
.chat {
  max-height: 300px; overflow-y: auto; margin-bottom: 10px;
  padding: 2px; display: flex; flex-direction: column; gap: 8px;
}
.msg { max-width: 88%; border-radius: 3px; padding: 9px 11px; }
.msg-w {
  font-family: 'Barlow Condensed'; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px;
}
.msg-t { font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.from-me { align-self: flex-end; background: var(--decal); color: var(--ink); }
.from-me .msg-w { color: #6B6353; }
.from-coach {
  align-self: flex-start; background: var(--ink-2);
  border: 1px solid var(--timber-line); color: var(--decal);
}
.from-coach .msg-w { color: var(--signal); }

/* Gerät hinter dem Übungsnamen im Katalog */
.cat-eq { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---- Eigenes Fenster für Entscheidungen ---- */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.62);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.dlg {
  background: var(--ink-2); color: var(--decal);
  border: 1px solid var(--timber-line); border-left: 4px solid var(--signal);
  border-radius: 3px; padding: 18px 17px 15px;
  max-width: 420px; width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
}
.dlg h3 {
  font-family: 'Barlow Condensed'; font-size: 21px; font-weight: 700;
  margin: 0 0 8px;
}
.dlg p { font-size: 14px; line-height: 1.5; color: #C9C2B1; margin: 0 0 16px; }
.dlg-a { display: flex; flex-direction: column-reverse; gap: 8px; }
.dlg-a .set-btn { margin: 0; }

/* ---- Trainingszeile: antippbare Bereiche ---- */
.tp-ex { align-items: start; }
.tp-box {
  cursor: pointer; padding: 0;
  font-family: 'Barlow Condensed'; font-size: 15px; font-weight: 700;
}
.tp-mid { cursor: pointer; min-width: 0; }
.tp-ex .last { font-size: 11.5px; color: #8A8270; margin-top: 2px; }
.tp-ex.ok .last { color: #9A9383; }

/* ---- Pausen-Uhr ---- */
.rest {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 150; display: flex; align-items: center; gap: 10px;
  background: var(--ink-2); border: 1px solid var(--signal);
  border-radius: 4px; padding: 9px 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.rest-t {
  font-family: 'Barlow Condensed'; font-size: 24px; font-weight: 700;
  color: var(--signal); line-height: 1; min-width: 52px; text-align: center;
}
.rest-l { font-size: 12px; color: var(--muted); }

/* ---- Sätze im Fenster ---- */
.set-row { display: flex; align-items: center; gap: 10px; }
.set-row > span:first-child { flex: 1; font-size: 14px; }
.dlg h4 {
  font-family: 'Barlow Condensed'; font-size: 15px; font-weight: 700;
  color: var(--decal); margin: 16px 0 4px;
}
.dlg .bars { height: 44px; }

/* ---- Muskelverteilung ---- */
.mus { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; font-size: 13px; }
.mus-n { flex: 0 0 38%; color: var(--decal-2); }
.mus-b { flex: 1; height: 8px; background: var(--ink-2); border-radius: 4px; overflow: hidden; }
.mus-b i { display: block; height: 100%; background: var(--timber); }
.mus-c { flex: 0 0 auto; color: var(--muted); font-family: 'Barlow Condensed'; font-weight: 700; }

/* ---- Wochentage bei den Erinnerungen ---- */
.days { display: flex; gap: 5px; flex-wrap: wrap; }
.days .mini { flex: 1; min-width: 38px; text-align: center; padding: 9px 2px; }
.days .mini.on { background: var(--signal); color: #241D02; border-color: var(--signal); }

/* ---- Rückgängig in der Meldung ---- */
.toast { display: flex; align-items: center; gap: 12px; }
.toast-a {
  flex: 0 0 auto; cursor: pointer;
  font-family: 'Barlow Condensed'; font-size: 14px; font-weight: 700;
  background: transparent; border: 0; border-left: 1px solid rgba(0,0,0,.2);
  padding: 2px 0 2px 12px; color: var(--rule);
}
textarea.in { resize: vertical; min-height: 56px; font-family: 'Barlow', system-ui, sans-serif; }

/* Auftrag und Antwort zum Kopieren: enger gesetzt, damit mehr davon zu sehen ist. */
textarea.in.mono {
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 12px; line-height: 1.45;
}

/* Solange die Pausen-Uhr läuft, bekommt die Seite unten Platz - sonst
   liegt die Leiste über den Übungen und fängt deren Tipps ab. */
body.resting .tp-app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
