/* ============================================================================
   Glutes & Legs Coach — Design System
   ----------------------------------------------------------------------------
   Dark-first. Die Basis-Tokens auf :root sind das dunkle Theme; das helle
   Theme überschreibt nur die Farb-Tokens (System "hell" oder Einstellung
   "Hell"). Komponenten verwenden ausschließlich semantische Tokens
   (--bg, --surface-*, --text-*, --accent …), nie feste Farben.

   Skalen
     Abstand   --space-1…10   4 · 8 · 12 · 16 · 20 · 24 · 32 · 40
     Radius    --radius-xs…xl 8 · 12 · 16 · 20 · 28  (+ --radius-pill)
     Schrift   --fs-*         Display 30 · Title 24 · Headline 17 · Body 15
                              · Callout 14 · Caption 12.5 · Overline 11.5
     Flächen   --bg < --surface-1 (Karten) < --surface-2 (Controls/Chips)
               < --surface-3 (gedrückt/erhöht)
   ============================================================================ */
:root {
  color-scheme: dark;

  --bg: #0D0C0D;
  --surface-1: #171516;
  --surface-2: #211E20;
  --surface-3: #2C292B;
  --media-bg: #1A1819;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);

  --text-1: #F5F1EF;
  --text-2: #B9B0AE;
  --text-3: #8F8785;

  --accent: #EFA3B0;
  --accent-press: #E48E9D;
  --accent-strong: #E27B8E;          /* Muskel-Highlights, Diagramm-Punkte */
  --accent-text: #F3B4BF;            /* Akzent als Textfarbe auf dunklem Grund */
  --on-accent: #2B0F16;              /* Text auf Akzentfläche (≈ 9:1) */
  --accent-soft: rgba(239, 163, 176, 0.14);
  --accent-line: rgba(239, 163, 176, 0.5);

  --success: #7DCB9B;
  --success-soft: rgba(125, 203, 155, 0.14);
  --warning: #EDB161;
  --danger: #FF8A7E;
  --on-danger: #2A0B08;
  --danger-soft: rgba(255, 138, 126, 0.12);
  --gold: #EBC56B;
  --gold-soft: rgba(235, 197, 107, 0.16);

  --overlay: rgba(0, 0, 0, 0.62);
  --header-bg: rgba(13, 12, 13, 0.82);
  --nav-bg: rgba(20, 18, 19, 0.88);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 18px 48px rgba(0, 0, 0, 0.55);
  --hero-glow: radial-gradient(120% 90% at 100% 0%, rgba(239, 163, 176, 0.20) 0%, rgba(239, 163, 176, 0) 60%);

  /* Feste dunkle Flächen, unabhängig vom Theme (Pausentimer) */
  --ink: #0B0A0B;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --gutter: 16px;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --fs-display: 30px;
  --fs-title: 24px;
  --fs-headline: 17px;
  --fs-body: 15px;
  --fs-callout: 14px;
  --fs-caption: 12.5px;
  --fs-overline: 11.5px;

  --tap: 44px;              /* Mindestgröße für Touch-Ziele */
  --control-h: 48px;        /* Eingabefelder, Standard-Buttons */
  --nav-height: 60px;
  --header-height: 52px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* --------------------------------------------------------------------
     Legacy-Aliasse: ältere Inline-Styles/Hilfsfunktionen (Diagramm,
     Körpergrafik, Celebration-Card) referenzieren noch diese Namen.
     -------------------------------------------------------------------- */
  --color-bg: var(--bg);
  --color-surface: var(--surface-1);
  --color-surface-alt: var(--surface-2);
  --color-line: var(--line-strong);
  --color-anthracite: var(--text-1);
  --color-anthracite-soft: var(--text-2);
  --color-dusty-rose: var(--accent);
  --color-dusty-rose-dark: var(--accent-strong);
  --color-mauve: var(--accent-strong);
  --color-mauve-dark: var(--accent-text);
  --color-success: var(--success);
  --color-warning: var(--warning);
  --color-danger: var(--danger);
  --color-gold: var(--gold);
  --color-ink: var(--ink);
  --gradient-accent: var(--accent);
  --gradient-hero: linear-gradient(150deg, #E9A1AE 0%, #B97A9A 100%);
  --gradient-card-tint: var(--surface-1);
}

/* Helles Theme: System "hell" (solange nicht explizit "Dunkel" gewählt) oder
   Einstellung "Hell". Beide Blöcke müssen identisch bleiben. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F5F1EE;
    --surface-1: #FFFFFF;
    --surface-2: #F1EBE7;
    --surface-3: #E6DDD8;
    --media-bg: #ECE5E1;
    --line: rgba(40, 28, 32, 0.08);
    --line-strong: rgba(40, 28, 32, 0.15);
    --text-1: #1C1719;
    --text-2: #5E5457;
    --text-3: #665C5F;
    --accent: #B5566B;
    --accent-press: #9F4A5E;
    --accent-strong: #C0627A;
    --accent-text: #A1465B;
    --on-accent: #FFFFFF;
    --accent-soft: rgba(181, 86, 107, 0.10);
    --accent-line: rgba(181, 86, 107, 0.45);
    --success: #2E8754;
    --success-soft: rgba(46, 135, 84, 0.12);
    --warning: #8F5410;
    --danger: #C2413A;
    --on-danger: #FFFFFF;
    --danger-soft: rgba(194, 65, 58, 0.09);
    --gold: #7A5A0B;
    --gold-soft: rgba(201, 152, 40, 0.16);
    --overlay: rgba(28, 20, 24, 0.45);
    --header-bg: rgba(245, 241, 238, 0.86);
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow-1: 0 1px 2px rgba(60, 30, 40, 0.06), 0 2px 10px rgba(60, 30, 40, 0.05);
    --shadow-2: 0 18px 48px rgba(60, 30, 40, 0.18);
    --hero-glow: radial-gradient(120% 90% at 100% 0%, rgba(181, 86, 107, 0.12) 0%, rgba(181, 86, 107, 0) 60%);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F1EE;
  --surface-1: #FFFFFF;
  --surface-2: #F1EBE7;
  --surface-3: #E6DDD8;
  --media-bg: #ECE5E1;
  --line: rgba(40, 28, 32, 0.08);
  --line-strong: rgba(40, 28, 32, 0.15);
  --text-1: #1C1719;
  --text-2: #5E5457;
  --text-3: #665C5F;
  --accent: #B5566B;
  --accent-press: #9F4A5E;
  --accent-strong: #C0627A;
  --accent-text: #A1465B;
  --on-accent: #FFFFFF;
  --accent-soft: rgba(181, 86, 107, 0.10);
  --accent-line: rgba(181, 86, 107, 0.45);
  --success: #2E8754;
  --success-soft: rgba(46, 135, 84, 0.12);
  --warning: #8F5410;
  --danger: #C2413A;
  --on-danger: #FFFFFF;
  --danger-soft: rgba(194, 65, 58, 0.09);
  --gold: #7A5A0B;
  --gold-soft: rgba(201, 152, 40, 0.16);
  --overlay: rgba(28, 20, 24, 0.45);
  --header-bg: rgba(245, 241, 238, 0.86);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --shadow-1: 0 1px 2px rgba(60, 30, 40, 0.06), 0 2px 10px rgba(60, 30, 40, 0.05);
  --shadow-2: 0 18px 48px rgba(60, 30, 40, 0.18);
  --hero-glow: radial-gradient(120% 90% at 100% 0%, rgba(181, 86, 107, 0.12) 0%, rgba(181, 86, 107, 0) 60%);
}

/* ============================================================================
   Basis
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--on-accent); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.icon--fill { fill: currentColor; stroke: none; }

/* ============================================================================
   App-Shell: Kopfzeile, Inhalt, Tab-Leiste
   ============================================================================ */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  padding-top: var(--safe-top);
}
.app-header__inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
}
.app-header__title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-1);
}

.view {
  flex: 1;
  min-width: 0;
  padding: var(--space-2) var(--gutter) calc(var(--nav-height) + var(--safe-bottom) + var(--space-8));
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding: 0 var(--space-1) var(--safe-bottom);
  display: flex;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.nav-btn {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 0 4px;
  transition: color .15s ease;
}
.nav-btn span { white-space: nowrap; }
.nav-icon {
  width: 52px;
  height: 30px;
  padding: 3px 14px;
  border-radius: var(--radius-pill);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: background-color .2s ease;
}
.nav-btn.active { color: var(--accent-text); }
.nav-btn.active .nav-icon { stroke-width: 2.2; }
.nav-btn.active .nav-icon { background: var(--accent-soft); }
.app.workout-active .bottom-nav,
.app.workout-active .app-header { display: none; }
.app.workout-active .view { padding-top: 0; padding-bottom: calc(var(--space-8) + var(--safe-bottom)); }

/* ============================================================================
   Layout-Bausteine
   ============================================================================ */
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stack--lg { gap: var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.row--between { justify-content: space-between; }
.row--tight { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

/* Abschnittsüberschrift ("Overline") — optional mit Aktion rechts */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin: var(--space-8) 0 var(--space-3);
  padding: 0 2px;
  font-size: var(--fs-overline);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.section-title:first-child { margin-top: var(--space-2); }
.section-title__aside { font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-3); }

/* Bildschirm-Titel für Unterseiten (Detail, Plan-Tag …) */
.page-title { font-size: var(--fs-title); font-weight: 800; letter-spacing: -0.02em; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.page-sub { color: var(--text-2); font-size: var(--fs-callout); margin-top: 4px; }

/* Zurück-Zeile über Unterseiten */
.back-bar, .exercise-detail-top {
  position: sticky; top: 0; z-index: 12;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  min-height: calc(var(--tap) + var(--space-2));
  margin: 0 calc(-1 * var(--gutter)) var(--space-2);
  padding: calc(var(--safe-top) + 4px) var(--gutter) 4px calc(var(--gutter) - 6px);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
}
/* Unterseiten: die große Kopfzeile weicht der Zurück-Leiste */
.app.is-subpage .app-header { display: none; }
.app.is-subpage .view { padding-top: 0; }
.back-link {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: var(--tap); padding: 0 10px 0 4px;
  border: none; background: none; border-radius: var(--radius-sm);
  color: var(--accent-text); font-size: var(--fs-body); font-weight: 600;
}
.back-link .icon { width: 22px; height: 22px; }

/* Karten */
.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-1);
  min-width: 0;
}
.card + .card { margin-top: var(--space-3); }
.card--flush { padding: 0; overflow: hidden; }
.card--muted { background: var(--surface-2); box-shadow: none; }
.card--interactive { cursor: pointer; transition: background-color .15s ease, transform .1s ease; }
.card--interactive:active { background: var(--surface-2); transform: scale(0.99); }
.card__title { font-size: var(--fs-headline); font-weight: 700; letter-spacing: -0.01em; }
.card__sub { font-size: var(--fs-callout); color: var(--text-2); margin-top: 2px; }
.card__sub--block { margin: 0 0 var(--space-3); }

/* Hinweis-/Tipp-Karte mit Icon */
.callout { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); background: var(--surface-2); border-radius: var(--radius-md); font-size: var(--fs-callout); line-height: 1.5; color: var(--text-1); }
.callout + .callout { margin-top: var(--space-2); }
.callout__icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex-shrink: 0; }
.callout__title { font-weight: 700; font-size: var(--fs-callout); margin-bottom: 2px; }
.callout__body { color: var(--text-2); }
.callout--plain { background: transparent; padding: 0; }
.callout__body--strong { color: var(--text-1); }

/* Gruppierte Liste (iOS "inset grouped") */
.list-group { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.list-group > .list-row, .list-group > .link-row { padding-left: var(--space-4); padding-right: var(--space-3); }
.list-group > .list-row + .list-row, .list-group > .link-row + .link-row { border-top: 1px solid var(--line); }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-3) 0;
  min-width: 0;
}
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row[data-action] { cursor: pointer; }
.list-group > .list-row[data-action]:active { background: var(--surface-2); }
.list-row__main { display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0; }
.list-row__text { min-width: 0; flex: 1; }
.list-row__title { font-weight: 600; font-size: var(--fs-body); line-height: 1.3; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.list-row__sub { font-size: var(--fs-caption); color: var(--text-2); margin-top: 2px; line-height: 1.35; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.list-row__meta { font-size: var(--fs-caption); color: var(--text-3); margin-top: 1px; }
.list-row__value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.chevron { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.link-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 52px; padding: var(--space-2) 0; }
.link-row[data-action] { cursor: pointer; }
.link-row__label { display: flex; align-items: center; gap: var(--space-3); font-weight: 500; min-width: 0; }
.link-row__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-1); flex-shrink: 0; }
.link-row__icon .icon { width: 17px; height: 17px; }
.link-row__hint { display: block; font-size: var(--fs-caption); color: var(--text-3); margin-top: 1px; font-weight: 400; }
.card > .link-row + .link-row { border-top: 1px solid var(--line); }

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s ease, transform .1s ease, opacity .15s ease, border-color .15s ease;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn .icon { width: 19px; height: 19px; }
.btn-primary, .btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-primary:active, .btn-accent:active { background: var(--accent-press); }
.btn-secondary { background: var(--surface-2); color: var(--text-1); }
.btn-secondary:active { background: var(--surface-3); }
.btn-outline { background: transparent; color: var(--text-1); border-color: var(--line-strong); }
.btn-outline:active { background: var(--surface-2); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: auto; min-height: var(--tap); padding: 8px 14px;
  border: none; border-radius: var(--radius-sm); background: transparent;
  color: var(--accent-text); font-size: var(--fs-callout); font-weight: 700;
}
.btn-ghost:active { background: var(--accent-soft); }
.btn-ghost--danger { color: var(--danger); }
.btn-ghost--danger:active { background: var(--danger-soft); }
.btn-ghost.btn--block { width: 100%; margin-left: auto; margin-right: auto; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--line-strong); }
.btn-danger:active { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); color: var(--on-danger); }
.btn-dashed { background: transparent; color: var(--text-2); border: 1.5px dashed var(--line-strong); font-weight: 600; }
.btn-dashed:active { background: var(--surface-2); }
.btn-sm { width: auto; min-height: 40px; padding: 8px 16px; font-size: var(--fs-callout); border-radius: var(--radius-sm); }
.btn-lg { min-height: 58px; font-size: 17px; border-radius: 18px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: var(--space-3); }
.btn-row .btn { flex: 1; min-width: 0; }
.btn-stack { display: flex; flex-direction: column; gap: var(--space-2); }

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 18px;
  font-weight: 700;
  transition: background-color .15s ease, transform .1s ease;
}
.icon-btn:active { background: var(--surface-3); transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn--ghost { background: transparent; color: var(--text-2); }
.icon-btn--sm { width: 36px; height: 36px; }
.icon-btn:disabled { opacity: .3; }

/* ============================================================================
   Chips, Tags, Badges
   ----------------------------------------------------------------------------
   .pill    — Basis (Tag oder, als <button>, auswählbarer Chip)
   .pill--active / [aria-pressed=true] — ausgewählt
   .tag     — kleiner, rein informativer Marker
   ============================================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.pill .icon { width: 15px; height: 15px; }
button.pill { min-height: 38px; padding: 8px 14px; color: var(--text-1); transition: background-color .15s, color .15s, border-color .15s; }
button.pill:active { background: var(--surface-3); }
.pill--active, button.pill[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
button.pill:disabled { opacity: .38; cursor: default; }
.pill-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.pill--xs { min-height: 22px; padding: 2px 8px; font-size: 11.5px; gap: 4px; }
.pill-count { font-variant-numeric: tabular-nums; opacity: .75; font-weight: 600; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.5;
  white-space: nowrap;
}
.tag--accent { background: var(--accent-soft); color: var(--accent-text); }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.badge-pr { background: var(--gold-soft) !important; color: var(--gold) !important; border-color: transparent !important; }
.badge-new { background: var(--accent-soft); color: var(--accent-text); }
.muscle-tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill--weak { background: transparent; border-color: var(--line-strong); }

/* ============================================================================
   Formulare
   ============================================================================ */
.field { margin-bottom: var(--space-4); min-width: 0; }
.field label, .field__label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea, .input {
  width: 100%;
  min-height: var(--control-h);
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 16px; /* ≥16px: kein Auto-Zoom in iOS Safari */
  transition: border-color .15s ease, background-color .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: var(--text-3); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.field__hint { font-size: var(--fs-caption); color: var(--text-3); margin-top: 6px; line-height: 1.45; }
.field__hint--note { margin-top: var(--space-2); padding: 0 4px; }
.field-row { display: flex; gap: var(--space-3); }
.field-row > .field { flex: 1; }
.error-text { color: var(--danger); font-size: 13px; margin-top: var(--space-2); }

/* Schalter (role="switch") */
.switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  transition: background-color .2s ease;
}
.switch[data-on="true"] { background: var(--accent); }
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform .2s var(--ease);
}
.switch[data-on="true"]::after { transform: translateX(20px); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 52px; padding: var(--space-2) 0; }
.setting-row + .setting-row, .setting-row + .field, .field + .setting-row { border-top: 1px solid var(--line); }
.setting-row__text { min-width: 0; }
.setting-row__label { font-weight: 500; }
.setting-row__hint { font-size: var(--fs-caption); color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.card > .field:last-child { margin-bottom: 0; }
.card > .setting-row + .field { padding-top: var(--space-3); }

/* Segmentierte Auswahl (Tabs der Detailseite) */
.tab-row {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.tab {
  flex: 1;
  min-height: 38px;
  padding: 6px 8px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-callout);
  font-weight: 600;
  transition: background-color .15s ease, color .15s ease;
}
.tab--active { background: var(--surface-3); color: var(--text-1); box-shadow: var(--shadow-1); }

/* Zahleneingabe mit −/+ (Gewicht / Wiederholungen) */
.stepper-field + .stepper-field { margin-top: var(--space-3); }
.stepper-field__head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 6px; }
.stepper-field__label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.stepper-field__hint { font-size: var(--fs-caption); color: var(--text-3); font-variant-numeric: tabular-nums; }
.stepper {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  gap: var(--space-2);
  padding: 6px;
  border-radius: 18px;
  background: var(--surface-2);
}
.stepper__btn {
  width: 60px;
  height: 56px;
  border: none;
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--text-1);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform .08s ease, background-color .15s ease;
  touch-action: manipulation;
}
.stepper__btn:active { transform: scale(0.94); background: var(--accent-soft); color: var(--accent-text); }
.stepper__value-wrap { min-width: 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.stepper__input {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: transparent;
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
  padding: 0;
  line-height: 1.15;
}
.stepper__input::placeholder { color: var(--text-3); font-weight: 600; font-size: 22px; }
.stepper__input:focus { outline: none; background: var(--accent-soft); }
.stepper__unit { font-size: 12px; color: var(--text-3); font-weight: 600; margin-top: -1px; }

/* Auswahlkarten (Onboarding, Tagesform, Trainingsbewertung) */
.mood-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.mood-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-list { display: flex; flex-direction: column; gap: var(--space-2); }
.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: var(--space-3);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--text-1);
  font-size: var(--fs-callout);
  font-weight: 600;
  text-align: center;
  transition: border-color .15s ease, background-color .15s ease;
}
.mood-btn:active { background: var(--surface-2); }
.mood-btn.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--text-1); }
.mood-btn .mood-emoji { display: block; font-size: 26px; line-height: 1.1; }
.mood-btn--row { flex-direction: row; justify-content: flex-start; text-align: left; gap: var(--space-3); min-height: 58px; padding: var(--space-3) var(--space-4); font-size: var(--fs-body); }
.mood-btn--row::after {
  content: ""; margin-left: auto; width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%; border: 2px solid var(--line-strong);
  transition: border-color .15s ease, background .15s ease;
}
.mood-btn--row.selected::after {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-opacity='.75' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* ============================================================================
   Feedback: Leer-/Ladezustände, Toast, Sheets, Dialoge
   ============================================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-6);
  color: var(--text-2);
  font-size: var(--fs-callout);
}
.empty-state h3 { color: var(--text-1); font-size: var(--fs-headline); font-weight: 700; }
.empty-state p { max-width: 32ch; }
.empty-state .btn { margin-top: var(--space-2); width: auto; min-width: 200px; }
.empty-state__icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); margin-bottom: var(--space-1); }
.empty-state__icon .icon { width: 24px; height: 24px; }
.empty-state--compact { padding: var(--space-4) var(--space-2); }
.empty-state--card { background: var(--surface-1); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }

.loader { display: flex; justify-content: center; padding: var(--space-10) 0; }
.loader::after {
  content: ""; width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.toast-root {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  max-width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--text-1);
  color: var(--bg);
  font-size: var(--fs-callout);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--shadow-2);
  animation: toast-in .22s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.sheet-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 90; animation: fade-in .2s ease; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 91;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-5) calc(var(--space-6) + var(--safe-bottom));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--surface-1);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  animation: sheet-in .28s var(--ease);
}
.sheet:focus { outline: none; }
@keyframes sheet-in { from { transform: translate(-50%, 24px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet__handle { width: 36px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto var(--space-4); }
.sheet__title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--space-4); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.sheet__text { font-size: var(--fs-body); color: var(--text-2); line-height: 1.5; margin: calc(-1 * var(--space-2)) 0 var(--space-5); }
.sheet .section-title:first-of-type { margin-top: var(--space-4); }
.sheet .btn + .btn { margin-top: var(--space-2); }
.sheet .btn-row .btn + .btn { margin-top: 0; }
.sheet-list { max-height: 50vh; max-height: 50dvh; overflow-y: auto; margin: 0 calc(-1 * var(--space-5)); padding: 0 var(--space-5); }

.resume-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-4) var(--space-3) calc(var(--space-4) + var(--safe-bottom));
  background: var(--overlay);
  animation: fade-in .2s ease;
}
.resume-card {
  width: 100%;
  max-width: 440px;
  padding: var(--space-6) var(--space-5) var(--space-5);
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  animation: sheet-in-plain .28s var(--ease);
}
@keyframes sheet-in-plain { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.resume-card__icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: var(--space-4); }
.resume-card__title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.resume-card__day { font-size: var(--fs-body); font-weight: 600; margin-top: var(--space-2); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.resume-card__meta { font-size: var(--fs-callout); color: var(--text-2); margin-top: 2px; }
.resume-card .btn-stack { margin-top: var(--space-5); }

/* Celebration-Card (Zemra Mode) */
.zemra-card-root { position: fixed; top: calc(var(--safe-top) + 64px); left: 50%; transform: translateX(-50%); z-index: 210; width: min(92vw, 400px); pointer-events: none; }
.zemra-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--gradient-hero);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-2);
  animation: zemra-in .38s cubic-bezier(.2, .8, .3, 1.3) forwards, zemra-out .38s cubic-bezier(.4, 0, 1, 1) forwards 2.55s;
}
.zemra-card__icon { font-size: 26px; line-height: 1; }
.zemra-card__text { font-size: 17px; font-weight: 800; line-height: 1.35; text-shadow: 0 1px 2px rgba(60, 20, 40, 0.25); }
@keyframes zemra-in { from { opacity: 0; transform: translateY(-16px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes zemra-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ============================================================================
   Kennzahlen
   ============================================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.stat-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-tile {
  min-width: 0;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.stat-tile__value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
  overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto;
}
.stat-tile__value--accent { color: var(--accent-text); }
.stat-tile__value--positive { color: var(--success); }
.stat-tile__label { font-size: var(--fs-caption); color: var(--text-2); font-weight: 500; margin-top: 4px; line-height: 1.3; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.stat-grid--3 .stat-tile { padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); }
.stat-grid--3 .stat-tile__value { font-size: 22px; }

/* Wochenring */
.progress-ring { position: relative; width: 76px; height: 76px; flex-shrink: 0; }
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring__track { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.progress-ring__bar { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.progress-ring__value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.progress-ring__value strong { font-size: 18px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.progress-ring__value span { font-size: 9.5px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

.chart-wrap { padding: var(--space-4) var(--space-3) var(--space-3); border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }

/* ============================================================================
   Heute (Dashboard)
   ============================================================================ */
.greeting { font-size: var(--fs-callout); color: var(--text-2); font-weight: 500; margin: 0 2px var(--space-3); }

.hero-card {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background: var(--hero-glow), var(--surface-1);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  isolation: isolate;
  color: var(--text-1);
}
.hero-card[data-action] { cursor: pointer; }
.hero-card__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-overline); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-text);
}
.hero-card__title { font-size: 28px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; margin-top: 6px; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.hero-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-2); font-size: var(--fs-callout); color: var(--text-2); font-weight: 500; }
.hero-card__meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-card__meta .icon { width: 16px; height: 16px; color: var(--text-3); }
.hero-card__strip { display: flex; gap: 6px; margin: var(--space-4) 0 0; }
.hero-card__strip .exercise-thumb { width: 44px; height: 44px; border-radius: 11px; }
.hero-card .btn { margin-top: var(--space-5); }
.hero-card__progress { margin-top: var(--space-4); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.6s ease-in-out infinite; }

.progress-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress-bar__fill { height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s var(--ease); }
.progress-caption { display: flex; justify-content: space-between; font-size: var(--fs-caption); color: var(--text-2); margin-top: 6px; font-variant-numeric: tabular-nums; }

.week-card__top { display: flex; align-items: center; gap: var(--space-4); }
.week-card__title { font-size: var(--fs-headline); font-weight: 700; font-variant-numeric: tabular-nums; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); font-weight: 600; }
.week-day__dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--on-accent); }
.week-day__dot .icon { width: 15px; height: 15px; stroke-width: 3; }
.week-day--done .week-day__dot { background: var(--accent); }
.week-day--today { color: var(--text-1); }
.week-day--today .week-day__dot { box-shadow: inset 0 0 0 1.5px var(--accent-line); }

/* ============================================================================
   Plan
   ============================================================================ */
.day-card { padding: var(--space-4); }
.day-card .list-row { min-height: 0; padding: 0; }
.day-avatar { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); font-size: 22px; flex-shrink: 0; }
.reorder { display: flex; gap: 6px; flex-shrink: 0; }
.reorder .icon-btn { width: 44px; height: 44px; background: transparent; color: var(--text-3); }
.reorder .icon-btn:active { background: var(--surface-2); color: var(--text-1); }
.reorder__spacer { width: 44px; height: 44px; }

.day-preview-strip { display: flex; gap: 6px; margin-top: var(--space-3); overflow-x: auto; scrollbar-width: none; cursor: pointer; }
.day-preview-strip::-webkit-scrollbar { display: none; }
.day-preview-strip .exercise-thumb { width: 44px; height: 44px; border-radius: 11px; }
.exercise-thumb--more { display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-2); background: var(--surface-2); box-shadow: none; }

.plan-day-head { display: flex; align-items: center; gap: var(--space-3); }
.plan-day-head .day-avatar { width: 52px; height: 52px; font-size: 26px; }
.plan-day-stats { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-4); }

.plan-day-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  cursor: pointer;
}
.plan-day-card + .plan-day-card { margin-top: var(--space-2); }
.plan-day-card:active { background: var(--surface-2); }
.plan-day-card__index { width: 22px; text-align: center; font-size: var(--fs-caption); font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.plan-day-card .list-row__title { font-size: var(--fs-body); }
.plan-day-card .reorder { flex-direction: column; gap: 6px; }
.plan-day-card .reorder .icon-btn { width: 44px; height: 44px; border-radius: 12px; }
.plan-day-card .reorder__spacer { width: 44px; height: 44px; }

/* ============================================================================
   Übungen: Bibliothek
   ============================================================================ */
.library-head { position: sticky; top: calc(var(--safe-top) + var(--header-height)); z-index: 10; margin: 0 calc(-1 * var(--gutter)); padding: var(--space-1) var(--gutter) var(--space-3); background: var(--header-bg); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px); }
.search-field { position: relative; }
.search-field .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.ex-search {
  width: 100%;
  min-height: var(--control-h);
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ex-search::placeholder { color: var(--text-3); }
.ex-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ex-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.ex-toolbar { display: flex; gap: var(--space-2); margin-top: var(--space-3); overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.ex-toolbar::-webkit-scrollbar { display: none; }
.ex-toolbar .pill { flex-shrink: 0; }
.ex-count { font-variant-numeric: tabular-nums; }

.filter-panel { margin-top: var(--space-1); padding: var(--space-3); border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--line); }
.filter-panel__title { font-size: var(--fs-overline); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 2px 2px var(--space-2); }
.equipment-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.equipment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 600;
  transition: background-color .15s, border-color .15s, color .15s;
}
.equipment-chip--active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.equipment-chip__icon { display: none; }
.equipment-chip__count { font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.equipment-chip--active .equipment-chip__count { color: inherit; opacity: .8; }

/* Muskelgruppen: zweizeilige, horizontal wischbare Kachelreihe */
.muscle-rail { position: relative; margin: 0 calc(-1 * var(--gutter)); }
.muscle-grid {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: 82px;
  gap: var(--space-2);
  overflow-x: auto;
  padding: 2px var(--gutter) var(--space-1);
  scroll-padding: 0 var(--gutter);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.muscle-grid::-webkit-scrollbar { display: none; }
.muscle-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 0;
  padding: 8px 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--text-1);
  scroll-snap-align: start;
  transition: background-color .15s, border-color .15s;
}
.muscle-tile:active { background: var(--surface-2); }
.muscle-tile--active { border-color: var(--accent-line); background: var(--accent-soft); }
.muscle-tile__icon { width: 26px; height: 44px; display: flex; align-items: center; justify-content: center; }
.muscle-tile__icon svg { width: 100%; height: 100%; }
.muscle-tile__icon .body-map__view { gap: 0; }
.muscle-tile__label { max-width: 100%; font-size: 11.5px; font-weight: 600; text-align: center; line-height: 1.2; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muscle-tile--active .muscle-tile__label { color: var(--accent-text); }
.muscle-tile__count { font-size: 11px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; line-height: 1; }
/* Kategorie ohne passende Übung: sichtbar (mit "0"), aber nicht auswählbar */
.muscle-tile:disabled, .equipment-chip:disabled { opacity: .38; cursor: default; }
.muscle-tile:disabled .body-map__svg { filter: grayscale(1); }

.result-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--tap); margin: var(--space-4) 2px var(--space-1); }
.result-head__reset { margin-right: -10px; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
.result-head__title { font-size: var(--fs-overline); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 var(--space-3); }
.filter-token {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 32px; padding: 4px 6px 4px 12px;
  border: 1px solid var(--accent-line); border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 12.5px; font-weight: 600;
}
.filter-token .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.filter-token__x { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }

.ex-row .exercise-thumb { width: 60px; height: 60px; border-radius: 14px; }
.ex-row .list-row__title { font-size: var(--fs-body); }

.favorite-btn {
  width: var(--tap);
  height: var(--tap);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-3);
  transition: color .15s ease, transform .12s ease;
}
.favorite-btn:active { transform: scale(0.88); }
.favorite-btn .icon { width: 22px; height: 22px; }
.favorite-btn--active { color: var(--accent); }
.favorite-btn--active .icon { fill: currentColor; }
.favorite-btn--lg { background: var(--surface-2); }
.favorite-btn--lg .icon { width: 22px; height: 22px; }

/* Formular "Eigene Übung" (components/customExerciseForm.js) */
.cx-group { margin-bottom: var(--space-5); }
.cx-label { font-size: 13px; font-weight: 700; margin-bottom: var(--space-2); color: var(--text-1); }
.cx-optional { font-weight: 500; color: var(--text-3); font-size: 12px; margin-left: 4px; }
.cx-hint { font-size: 13px; color: var(--warning); margin: calc(-1 * var(--space-2)) 0 var(--space-4); }
.cx-error { color: var(--danger); font-size: var(--fs-callout); font-weight: 600; margin-bottom: var(--space-3); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); }
.cx-pill { font-size: 13px; }

/* ============================================================================
   Übungsdetail
   ============================================================================ */
.exercise-detail-top__actions { display: flex; align-items: center; gap: var(--space-2); }
.detail-head { margin-bottom: var(--space-4); }
.detail-head .pill-row { margin-top: var(--space-2); gap: 6px; }

/* Medienfläche der Übung. Bewusst als eigener Slot gebaut
   ([data-media-slot="exercise"]): eine spätere 3D-Ansicht kann hier anstelle
   bzw. neben der 2D-Darstellung montiert werden, ohne das Seitenlayout zu
   ändern. Höhe wird begrenzt, damit die Seite darunter erreichbar bleibt. */
.media-stage { position: relative; border-radius: var(--radius-lg); }
.media-stage + .tab-row, .tab-row + .media-stage { margin-top: var(--space-4); }

.lead { font-size: var(--fs-body); line-height: 1.55; color: var(--text-1); }

.ex-meta { display: flex; flex-direction: column; gap: 0; padding-top: var(--space-1); padding-bottom: var(--space-1); }
.ex-meta__row { display: flex; flex-direction: column; gap: 8px; padding: var(--space-3) 0; }
.ex-meta__row + .ex-meta__row { border-top: 1px solid var(--line); }
.ex-meta__label { font-size: 12px; font-weight: 600; color: var(--text-3); }
.ex-meta__note { font-size: var(--fs-callout); color: var(--text-2); line-height: 1.45; }
.ex-meta > .ex-meta__note { padding: var(--space-3) 0; }
.ex-meta__row + .ex-meta__note { border-top: 1px solid var(--line); }

.muscle-map-card { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.muscle-legend { display: flex; gap: var(--space-4); font-size: 12px; color: var(--text-2); }
.muscle-legend span { display: inline-flex; align-items: center; gap: 6px; }
.muscle-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--accent-strong); }
.muscle-legend i.is-secondary { background: var(--accent); opacity: .5; }

.guide-section + .guide-section { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.guide-section__title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-callout); font-weight: 700; margin-bottom: var(--space-2); }
.guide-section__title .icon { width: 16px; height: 16px; color: var(--text-3); }
.guide-text { font-size: var(--fs-body); line-height: 1.55; color: var(--text-1); }
.guide-text--muted { color: var(--text-2); font-size: var(--fs-callout); }

.cue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cue-list li { display: flex; gap: 10px; font-size: var(--fs-body); line-height: 1.5; }
.cue-list li::before {
  content: ""; flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%;
  background: var(--success-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237DCB9B' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.mistake-list li::before {
  background: var(--danger-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F07A6E' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.step-list { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.step-list li { counter-increment: step; display: flex; gap: 12px; font-size: var(--fs-body); line-height: 1.5; }
.step-list li::before {
  content: counter(step); flex-shrink: 0; width: 24px; height: 24px; margin-top: -1px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text);
  font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}

.alt-scroll {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) var(--space-1);
  scroll-padding: 0 var(--gutter);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.alt-scroll::-webkit-scrollbar { display: none; }
.alt-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  cursor: pointer;
  padding: var(--space-2) var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 1px solid var(--line);
  transition: transform .1s ease;
}
.alt-card:active { transform: scale(0.98); }
.alt-card__thumb { width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--media-bg); }
.alt-card__thumb img, .alt-card__thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.alt-card__name { font-size: 13px; font-weight: 600; margin-top: 8px; padding: 0 2px; line-height: 1.3; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.alt-card__muscle { font-size: 11.5px; color: var(--text-3); margin-top: 2px; padding: 0 2px; }

.history-list .list-row { min-height: 52px; }
.list-row__value .muted { font-weight: 500; }

/* ============================================================================
   Übungsmedien (components/exerciseMedia.js)
   ============================================================================ */
.exercise-thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); background: var(--media-bg); flex-shrink: 0; overflow: hidden; }
.exercise-thumb svg, .exercise-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.exercise-thumb--lg { width: 64px; height: 64px; border-radius: 14px; }

.exercise-media { border-radius: var(--radius-lg); overflow: hidden; background: var(--media-bg); border: 1px solid var(--line); }
.exercise-media img, .exercise-media svg { display: block; width: 100%; height: auto; max-height: 220px; }
.exercise-media__caption { display: flex; justify-content: space-between; padding: var(--space-3) var(--space-4); font-size: 12px; font-weight: 700; color: var(--text-2); }

.exercise-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--media-bg);
  border: 1px solid var(--line);
}
.exercise-hero [data-hero-body] { position: relative; }
.exercise-hero__frame-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 48vh; }
.exercise-hero__frame-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .22s ease; }
.exercise-hero__frame-wrap img.is-active { opacity: 1; }
/* Start/Ende-Umschalter schwebt als kompakte Segmentsteuerung über dem Bild */
.exercise-hero__tabs {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: rgba(12, 11, 12, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.exercise-hero__tab {
  min-height: 34px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12.5px;
  font-weight: 700;
  transition: background-color .15s, color .15s;
}
.exercise-hero__tab.active { background: rgba(255, 255, 255, 0.94); color: #161415; }
.exercise-hero__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) var(--space-4) 0; }
.exercise-hero__footer:last-child { padding-bottom: var(--space-3); }
.exercise-hero__phase { font-size: var(--fs-overline); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.exercise-hero__playstate { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.exercise-hero[data-hero-mode="manual"] .exercise-hero__playstate { display: none; }
.exercise-hero__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; }
.exercise-hero__muscle-legend { display: flex; gap: 6px; flex-wrap: wrap; padding: var(--space-2) var(--space-4) var(--space-3); }
.exercise-hero__muscle-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 4px 10px; border-radius: var(--radius-pill); }
.exercise-hero__muscle-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Manueller Zwei-Bild-Modus (Start/Ende) */
.exercise-hero__frame-wrap--auto { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 48vh; background: var(--media-bg); }
.exercise-hero__frame-wrap--auto.is-sized { aspect-ratio: auto; }
.exercise-hero__manual-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.exercise-hero__frame-wrap--auto.is-sized .exercise-hero__manual-img { height: 100%; }
.exercise-hero__manual-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; color: var(--text-3); background: var(--media-bg); animation: pulse 1.4s infinite; }
.exercise-hero__manual-loading[hidden] { display: none; }

/* Medienumschalter "3D | Bilder" + 3D-Ansicht (nur Übungen mit freigegebener
   3D-Demonstration, siehe js/components/exerciseMediaSwitch.js) */
.media-switch {
  display: inline-flex; gap: 2px; padding: 3px; margin-bottom: var(--space-2);
  border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--line);
}
.media-switch__btn {
  min-height: var(--tap); min-width: 64px; padding: 6px 16px; border: none; border-radius: var(--radius-pill);
  background: transparent; color: var(--text-2); font-size: var(--fs-caption); font-weight: 700;
  transition: background-color .15s, color .15s;
}
.media-switch__btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.media-switch__btn:focus-visible, .viewer3d__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.media-switch__note { margin: var(--space-2) 0 0; font-size: var(--fs-caption); color: var(--text-3); }
.media-switch__note:empty { margin: 0; }

.viewer3d { border-radius: var(--radius-lg); overflow: hidden; background: var(--media-bg); border: 1px solid var(--line); }
.viewer3d__frame { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 48vh; background: #161415; }
.viewer3d__stage { position: absolute; inset: 0; }
.viewer3d__loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3);
  font-size: var(--fs-caption); font-weight: 600; color: rgba(255, 255, 255, 0.72); background: #161415;
}
.viewer3d__loading[hidden] { display: none; }
.viewer3d__spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.16); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.viewer3d__controls { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4) 0; }
.viewer3d__controls[hidden] { display: none; }
.viewer3d__btn {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--surface-2); color: var(--text-1);
}
.viewer3d__btn .icon { width: 20px; height: 20px; }
.viewer3d__btn--text { width: auto; min-width: var(--tap); padding: 0 12px; border-radius: var(--radius-pill); font-size: var(--fs-caption); font-weight: 700; }
.viewer3d__btn--text[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.viewer3d__scrub { flex: 1; min-width: 0; height: var(--tap); accent-color: var(--accent); }
.viewer3d__footer { padding-bottom: var(--space-3); }

/* Anatomische Körpergrafik */
.body-map { display: flex; gap: var(--space-6); justify-content: center; width: 100%; }
.body-map__view { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; max-width: 118px; }
.body-map__svg { width: 100%; height: auto; }
.body-map__view-label { font-size: 11px; font-weight: 600; color: var(--text-3); }

/* ============================================================================
   Training (Workout-Modus)
   ============================================================================ */
.workout-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 calc(-1 * var(--gutter));
  padding: calc(var(--safe-top) + var(--space-2)) var(--gutter) var(--space-2);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
}
.workout-header__center { flex: 1; min-width: 0; }
.workout-header__label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.workout-header__label strong { color: var(--text-1); font-weight: 700; }
.workout-header__progress { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.workout-header__progress-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s var(--ease); }
.workout-header .icon-btn { background: var(--surface-2); }

.workout-title { margin: var(--space-3) 0 var(--space-4); }
.workout-title__eyebrow { font-size: var(--fs-overline); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.workout-title h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.025em; margin-top: 4px; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }

/* Kompakte Übungszeile über der Satzeingabe */
.exercise-strip { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); }
.exercise-strip .exercise-thumb { width: 56px; height: 56px; }
.exercise-strip__name { font-size: var(--fs-headline); font-weight: 800; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.exercise-strip__targets { font-size: var(--fs-caption); color: var(--text-2); margin-top: 3px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.exercise-strip__targets span { white-space: nowrap; }
.exercise-strip__targets span:not(:last-child)::after { content: " · "; color: var(--text-3); white-space: pre; }

.target-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-3); }
.target { padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-1); border: 1px solid var(--line); text-align: center; min-width: 0; }
.target__value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.target__label { font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; }

.last-time {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: var(--fs-callout);
  color: var(--text-2);
}
.last-time > span:first-child { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.last-time .icon { width: 16px; height: 16px; }
.last-time strong { color: var(--text-1); text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Satzliste: erledigt / aktuell / ausstehend */
.set-list { padding: var(--space-1) var(--space-3); }
.set-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.set-row:last-child { border-bottom: none; }
.set-row__index {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}
.set-row__index .icon { width: 15px; height: 15px; stroke-width: 3; }
.set-row__values { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--fs-body); }
.set-row__label { font-weight: 500; }
.set-row__result { color: var(--text-1); font-weight: 700; }
.set-row__status { font-size: 12px; font-weight: 700; }
.set-row.done { color: var(--text-2); }
.set-row.done .set-row__index { background: var(--success); color: #0F2418; }
.set-row--current { color: var(--text-1); }
.set-row--current .set-row__index { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.set-row--current .set-row__label { font-weight: 700; }
.set-row--current .set-row__status { color: var(--accent-text); }

.entry-card { padding: var(--space-4); border-color: var(--accent-line); }
.entry-card__title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-3); }
.entry-card__title h3 { font-size: var(--fs-headline); font-weight: 800; letter-spacing: -0.01em; }
.entry-card__title span { font-size: var(--fs-caption); color: var(--text-3); font-variant-numeric: tabular-nums; }
.rir-block { margin-top: var(--space-4); }
.rir-block .pill-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.rir-block .pill { justify-content: center; min-height: var(--tap); font-size: var(--fs-body); font-weight: 700; padding: 6px 0; }

.done-card { text-align: center; padding: var(--space-6) var(--space-4); }
.done-card__icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto var(--space-3); background: var(--success-soft); color: var(--success); }
.done-card__icon .icon { width: 26px; height: 26px; stroke-width: 2.6; }
.done-card__title { font-size: var(--fs-headline); font-weight: 800; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.done-card__sub { font-size: var(--fs-callout); color: var(--text-2); margin-top: 4px; }

/* Satzeingabe-Screen: Reihenfolge der Blöcke. Bei begrenzter sichtbarer
   Höhe rückt die aktuelle Eingabe direkt unter die Übungszeile, damit
   Gewicht/Wdh. sichtbar sind, sobald die fixierte Hauptaktion sichtbar ist.
   860px statt der Gerätehöhe kleiner Phones, weil die nutzbare Höhe
   (Statusleiste, Safari-Leisten) deutlich kleiner ist: ein 390×844-iPhone hat
   als Homescreen-App ~797px, im Safari-Tab ~660px. Satzliste und Anfänger-Hinweis enthalten keine
   fokussierbaren Elemente, die Tab-Reihenfolge bleibt daher stimmig. */
.set-screen { display: flex; flex-direction: column; }
.set-screen__sets > .section-title { margin-top: var(--space-6); }
@media (max-height: 860px) {
  .set-screen__entry { order: 1; }
  .set-screen__hint { order: 2; }
  .set-screen__sets { order: 3; }
  .set-screen .last-time { padding-top: 10px; padding-bottom: 10px; }
}

/* Primäraktion unten im Daumenbereich, über dem Inhalt fixiert */
.action-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 25;
  width: 100%;
  max-width: 560px;
  transform: translateX(-50%);
  padding: var(--space-5) var(--gutter) calc(var(--space-3) + var(--safe-bottom));
  background: linear-gradient(to bottom, transparent 0, var(--bg) 22px);
}
.action-bar .btn + .btn { margin-top: var(--space-2); }
.action-bar-spacer { height: calc(84px + var(--safe-bottom)); }
.action-bar-spacer--2 { height: calc(144px + var(--safe-bottom)); }

/* Pausentimer — immer dunkel, unabhängig vom Theme */
.timer-overlay {
  --accent: #EFA3B0;
  --accent-press: #E48E9D;
  --on-accent: #2B0F16;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--safe-top) + var(--space-10)) var(--space-6) calc(var(--space-5) + var(--safe-bottom));
  background: radial-gradient(90% 60% at 50% 38%, rgba(239, 163, 176, 0.10), rgba(239, 163, 176, 0) 70%), var(--ink);
  color: #fff;
  text-align: center;
  animation: fade-in .2s ease;
}
.timer-overlay__main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }
.timer-overlay__label { font-size: var(--fs-overline); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
.timer-ring { position: relative; width: min(72vw, 280px); aspect-ratio: 1; margin: var(--space-5) 0; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring__track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 6; }
.timer-ring__bar { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer-ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-overlay__time { font-size: clamp(56px, 18vw, 76px); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.timer-overlay__next { font-size: var(--fs-callout); color: rgba(255, 255, 255, 0.62); max-width: 30ch; line-height: 1.45; }
.timer-overlay__next strong { display: block; color: #fff; font-size: var(--fs-body); font-weight: 700; margin-top: 2px; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.timer-overlay__actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-3); width: 100%; max-width: 420px; }
.timer-overlay .btn-secondary { background: rgba(255, 255, 255, 0.1); color: #fff; }
.timer-overlay .btn-secondary:active { background: rgba(255, 255, 255, 0.16); }

/* Zentrierte Fokus-Screens (Tagesform, Einführung, Abschluss, Onboarding) */
.focus-screen { min-height: calc(100vh - 120px); min-height: calc(100dvh - 120px); display: flex; flex-direction: column; justify-content: center; padding: var(--space-6) 0; }
.focus-screen__head { text-align: center; margin-bottom: var(--space-6); }
.focus-screen__icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto var(--space-4); background: var(--accent-soft); color: var(--accent-text); font-size: 30px; }
.focus-screen__icon .icon { width: 30px; height: 30px; }
.focus-screen__icon--success { background: var(--success-soft); color: var(--success); }
.focus-screen__eyebrow { font-size: var(--fs-overline); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin-bottom: var(--space-2); }
.focus-screen__title { font-size: 26px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.focus-screen__sub { font-size: var(--fs-body); color: var(--text-2); margin-top: var(--space-2); line-height: 1.5; }
.focus-screen__actions { margin-top: var(--space-6); display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); }
.focus-screen__actions .btn-ghost { align-self: center; }
.focus-screen__actions--tight { margin-top: var(--space-2); }
.header-spacer { width: var(--tap); height: var(--tap); flex-shrink: 0; }

.onboarding-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: var(--space-8); }
.onboarding-dots span { width: 8px; height: 8px; border-radius: 4px; background: var(--surface-3); transition: width .25s var(--ease), background-color .25s; }
.onboarding-dots span.is-done { background: var(--accent-line); }
.onboarding-dots span.is-current { width: 24px; background: var(--accent); }

/* ============================================================================
   Fortschritt, Profil, Einstellungen
   ============================================================================ */
.trend-card { cursor: pointer; }
.trend-card:active { background: var(--surface-2); }
.trend-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.trend-card__value { font-weight: 800; font-size: var(--fs-headline); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend-card__chart { margin: 0 -4px; }

.metric-chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; margin-bottom: var(--space-3); }
.metric-chips::-webkit-scrollbar { display: none; }
.metric-chip { flex-shrink: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--surface-2); }
.metric-chip__date { font-size: 11px; color: var(--text-3); font-weight: 600; }
.metric-chip__value { font-size: var(--fs-callout); font-weight: 700; font-variant-numeric: tabular-nums; }

.profile-card { display: flex; align-items: center; gap: var(--space-4); }
.avatar { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent-text); font-size: 24px; font-weight: 800; border: 1px solid var(--accent-line); }
.profile-card__name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.profile-card__sub { font-size: var(--fs-callout); color: var(--text-2); margin-top: 2px; }

.sticky-save { position: sticky; bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--space-3)); z-index: 5; margin-top: var(--space-6); }
.sticky-save .btn { box-shadow: var(--shadow-2); }

/* ============================================================================
   KI-Coach (Chat)
   ============================================================================ */
.coach { display: flex; flex-direction: column; min-height: calc(100dvh - var(--header-height) - var(--nav-height) - var(--safe-top) - var(--safe-bottom) - 96px); padding-bottom: 84px; }
.coach__toolbar { display: flex; justify-content: flex-end; min-height: 8px; margin: 0 calc(-1 * var(--space-2)) 0 0; }
.coach__new[hidden] { display: none; }
.coach__new .icon { width: 17px; height: 17px; }
.coach__log { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }

.coach-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-6) 0 var(--space-2); }
.coach-empty__icon { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; background: var(--hero-glow), var(--accent-soft); color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-line) inset; }
.coach-empty__icon .icon { width: 30px; height: 30px; stroke-width: 1.8; }
.coach-empty__title { font-size: var(--fs-title); font-weight: 800; margin-top: var(--space-4); }
.coach-empty__text { color: var(--text-2); font-size: var(--fs-body); line-height: 1.5; margin: var(--space-2) 0 var(--space-5); max-width: 34ch; }
.coach-suggestions { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; }
.coach-chip {
  width: 100%; min-height: var(--tap); padding: 11px 14px; text-align: left;
  border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-1);
  color: var(--text-1); font: inherit; font-size: var(--fs-callout); font-weight: 600; line-height: 1.35;
  transition: background-color .15s ease, border-color .15s ease;
}
.coach-chip:active { background: var(--accent-soft); border-color: var(--accent-line); }
.coach-privacy { display: flex; gap: var(--space-2); align-items: flex-start; text-align: left; margin: var(--space-5) 0 0; font-size: var(--fs-caption); line-height: 1.45; color: var(--text-3); }
.coach-privacy .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

.coach-msg { display: flex; gap: var(--space-2); align-items: flex-end; min-width: 0; }
.coach-msg--user { justify-content: flex-end; }
.coach-msg--coach { align-items: flex-start; }
.coach-msg__body { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; max-width: calc(100% - 40px); }
.coach-avatar { width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.coach-avatar .icon { width: 17px; height: 17px; }
.coach-bubble { padding: 10px 14px; border-radius: 18px; font-size: var(--fs-body); line-height: 1.5; overflow-wrap: anywhere; }
.coach-msg--user .coach-bubble { max-width: 85%; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; font-weight: 500; }
.coach-msg--coach .coach-bubble { background: var(--surface-1); border: 1px solid var(--line); color: var(--text-1); border-top-left-radius: 6px; }
.coach-text p { margin: 0; }
.coach-text p + p, .coach-text p + ul, .coach-text p + ol, .coach-text ul + p, .coach-text ol + p { margin-top: var(--space-2); }
.coach-text ul, .coach-text ol { margin: 0; padding-left: 1.2em; }
.coach-text li + li { margin-top: 3px; }
.coach-text strong { font-weight: 700; }

.coach-typing { display: inline-flex; gap: 5px; align-items: center; min-height: 44px; }
.coach-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: coach-dot 1.2s infinite ease-in-out; }
.coach-typing span:nth-child(2) { animation-delay: .15s; }
.coach-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes coach-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.coach-rule { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--accent-line); }
.coach-rule__eyebrow { display: flex; align-items: center; gap: 6px; font-size: var(--fs-overline); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-text); }
.coach-rule__eyebrow .icon { width: 15px; height: 15px; }
.coach-rule__title { font-size: var(--fs-headline); font-weight: 800; margin-top: 4px; }
.coach-rule__body { margin: 4px 0 0; font-size: var(--fs-callout); line-height: 1.45; color: var(--text-2); }
.coach-rule__note { margin-top: var(--space-2); font-size: var(--fs-caption); color: var(--text-3); }

.coach-error { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--danger-soft); color: var(--text-1); }
.coach-error__icon { color: var(--danger); flex-shrink: 0; padding-top: 1px; }
.coach-error__main p { margin: 0 0 var(--space-2); font-size: var(--fs-callout); line-height: 1.45; }

.coach-composer {
  position: fixed; z-index: 25; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  width: 100%; max-width: 560px; padding: var(--space-2) var(--gutter);
  display: flex; gap: var(--space-2); align-items: flex-end;
  background: var(--nav-bg); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid var(--line);
}
.coach-composer__input {
  flex: 1; min-width: 0; min-height: var(--tap); max-height: 132px; resize: none;
  padding: 11px 16px; border: 1px solid var(--line-strong); border-radius: 22px;
  background: var(--surface-1); color: var(--text-1); font: inherit; font-size: 16px; line-height: 1.35;
}
.coach-composer__input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.coach-composer__input::placeholder { color: var(--text-3); }
.coach-composer__send {
  width: var(--tap); height: var(--tap); flex-shrink: 0; border: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  transition: opacity .15s ease, transform .1s ease;
}
.coach-composer__send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.coach-composer__send:active { transform: scale(.94); }
.coach-composer__send:disabled { opacity: .35; transform: none; }

/* Schmale Telefone (iPhone SE/mini) */
@media (max-width: 380px) {
  .plan-day-card__index { display: none; }
  .plan-day-card { gap: 10px; }
  .stepper { grid-template-columns: 52px 1fr 52px; }
  .stepper__btn { width: 52px; }
}

/* ============================================================================
   Größere Bildschirme
   ============================================================================ */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ============================================================================
   Reduzierte Bewegung
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .zemra-card { animation: none; opacity: 1; }
  .live-dot, .exercise-hero__dot { animation: none; }
  .coach-typing span { animation: none; opacity: .7; }
}
