/* =========================================================
   Gym-Tracker UI-Kit · v1.1 · Stand 12.10.2026
   Namenskonvention: .pfx-block, .pfx-block__element, .pfx-block--modifier
   Zustände über ARIA: aria-pressed, aria-checked, aria-selected, aria-current, aria-busy
   Regel: Farben, Schriftgrößen, Abstände, Radien, Dauern und Ebenen nur über Tokens (var(--…)).
   Feste px-Werte gibt es nur noch für Komponenten-Maße (Höhe, Breite, Rahmenstärke).
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* Schrift: DM Sans als variable Schrift mit optischer Größe (opsz 9–40), selbst gehostet */
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Nur Google-Button: Roboto Medium, wie es die Branding-Richtlinien von Google verlangen */
  --font-google: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Flächen */
  --color-bg: #EEEFEE;              /* Grund, Screen-Hintergrund */
  --color-surface: #FFFFFF;         /* Fläche primär: Karten, Felder, Listen, Sheet, Dialog */
  --color-surface-2: #F3F3F1;       /* Fläche sekundär: Stepper, Kennzahlen, Nummernkreis, ausgegraute Zeilen */
  --color-line: #E3E3E1;            /* Trenner, Umschalter-Spur, Balken, Sheet-Griff, Nav-Linie */
  --color-border: #CFCFCC;          /* Rahmen: Felder, Secondary; deaktivierte Tage */
  --color-border-strong: #9A9A96;   /* Leerer Punkt im Durchlauf, beendeter Pausen-Timer */

  /* Text */
  --color-text: #2E3338;            /* Anthrazit: Text, Fließtext, Primary */
  --color-text-muted: #666666;      /* Beschriftungen, Placeholder, ausgegraut (5,7:1 auf Weiß) */
  --color-text-on-dark: #FFFFFF;    /* Text und Icons auf Anthrazit, Warnfarbe, Link-Fläche */
  --color-text-on-dark-muted: #BDBDBA;

  /* Theme / Splits: Grundfarbe, kräftig */
  --split-bs: #BCDDE9;  --split-bs-selected: #7DB0C6;  --split-bs-ink: #3F5C66; /* Aqua: Beine & Schultern */
  --split-bb: #F2C4AE;  --split-bb-selected: #E8977A;                          /* Peach: Brust & Bizeps */
  --split-rt: #D3E8AE;  --split-rt-selected: #A6C97A;                          /* Meadow: Rücken & Trizeps */
  /* Weitere Split-Farben für eigene Splits (Spec 025). Die App vergibt die erste freie in der Reihenfolge bb, rt, bs, lv, sd, ro */
  --split-lv: #D9D0EE;  --split-lv-selected: #A895D6;                          /* Lavender: Split-Farbe 4 */
  --split-sd: #EFE0A8;  --split-sd-selected: #D6BC5C;                          /* Sand: Split-Farbe 5 */
  --split-ro: #EEC5D8;  --split-ro-selected: #D98DB0;                          /* Rose: Split-Farbe 6 */
  --split-cu: #E6E6E3;  --split-cu-selected: #C9C9C6;                          /* Limestone: Nachholer, neutral */

  /* Signalfarben */
  --color-link: #2E6A80;
  --color-salmon: #E8977A;          /* Fokus-Ring, ausgewählter Tag, Progressions-Badge */
  --color-success: #A6C97A;         /* Fläche, Text #2E3338 */
  --color-warning: #B04A2E;         /* Fläche, Text weiß */
  --color-success-text: #4B7A1C;    /* Text auf Weiß, 5,2:1 */
  --color-warning-text: #8A3A22;    /* Text auf Weiß, 7,9:1 */

  /* Weitere Werte aus dem Design */
  --color-avatar-bg: #DCEEF4;
  --color-chart-fill: #E3F1F6;
  --color-scrim-dialog: rgba(46, 51, 56, 0.45);
  --color-stripe: rgba(255, 255, 255, 0.16);   /* Schraffur auf laufenden Balken */

  /* Fremdmarke: Google-Button, helle Variante nach den Branding-Richtlinien von Google */
  --color-google-surface: #FFFFFF;
  --color-google-border: #747775;
  --color-google-text: #1F1F1F;

  /* Schriftgrößen (12 Stufen) */
  --font-size-2xs: 11px;   /* Zähler, Tages-Kürzel, Segment-Kürzel */
  --font-size-xs: 12px;    /* Hinweise unter Feldern, Badges, Kennzahl-Label, Bottom-Nav */
  --font-size-sm: 13px;    /* Beschriftung, Meta-Zeilen, Chips */
  --font-size-md: 14px;    /* Klein, Labels, Eyebrow */
  --font-size-base: 15px;  /* Kartentext, Sheet-/Dialogtext, Textlinks, Umschalter */
  --font-size-lg: 16px;    /* Fließtext, Listen, Übungsname */
  --font-size-xl: 17px;    /* Abschnitt, Eingabe, Buttons, Kopfzeilen-Titel */
  --font-size-2xl: 20px;   /* Kartentitel, Stepper-Zeichen */
  --font-size-3xl: 24px;   /* Sheet- und Dialogtitel */
  --font-size-4xl: 27px;   /* Seitentitel, Vorschlagskarte */
  --font-size-5xl: 44px;   /* Zahl mittel, Kennzahl */
  --font-size-6xl: 72px;   /* Zahl groß */

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --letter-spacing-tight: -0.02em;
  --letter-spacing-tighter: -0.03em;

  /* Radien */
  --radius-pill: 999px;   /* Buttons, Chips, Eingabefelder, Badges, Switch */
  --radius: 16px;         /* Einheitlicher Radius aller Flächen: Karten, Zeilen, Kacheln, Tage, Sheet, Dialog */
  --radius-bar: 5px;      /* Fortschrittsbalken */
  --radius-seg: 3px;      /* Segmente, Legendenpunkte */

  /* Abstände (4er-Raster) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;

  /* Innenabstand aller Flächen (Karten, Listen, Gruppen): links und rechts immer gleich */
  --pad-surface: var(--space-4);
  /* Seitenrand eines Screens: Kopfzeile, Inhalt und Aktionsleiste */
  --pad-screen: var(--space-2);
  /* Größte Breite eines Screens. Breitere Fenster zeigen ihn mittig */
  --screen-max: 390px;
  /* Unterer Abschluss fixer Leisten (Bottom-Nav, Aktionsleiste): mindestens 16 px, sonst Home-Indikator-Bereich */
  --pad-bottom-bar: max(var(--space-4), env(safe-area-inset-bottom, 0px));

  /* Bewegung */
  --duration-fast: .12s;    /* Druck-Feedback, Schalter */
  --duration-base: .2s;     /* Ein-/Ausblenden, Balken, Chevron */
  --duration-exit: .25s;    /* Sheet und Scrim schließen, Hinweis einblenden */
  --duration-slow: .3s;     /* Sheet und Banner gleiten herein, angehängte Zeile */
  --ease-standard: ease;
  --ease-out: cubic-bezier(.2, .8, .2, 1);   /* hereinkommen */
  --ease-in: cubic-bezier(.4, 0, 1, 1);      /* hinausgehen */

  /* Ebenen */
  --z-sticky: 1;      /* Aktionsleiste, Bottom-Nav */
  --z-overlay: 10;    /* Scrim mit Sheet oder Dialog */
  --z-banner: 11;     /* Overlay-Banner über allem */

  /* Schatten */
  --shadow-overlay: 0 8px 24px rgba(46, 51, 56, 0.18);

  /* Fokus */
  --focus-ring: 0 0 0 3px var(--color-salmon);
}

/* ---------- 2. Basis (Klasse .pfx-app auf <body> oder App-Root) ---------- */
.pfx-app {
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
/* Ohne den Standardrand des Browsers, sonst ist der Screen 16 px schmaler und höher als das Fenster */
body.pfx-app { margin: 0; }
/* App-Seite: Höhe aus dem Fenster (100 %) statt 100vh/100dvh. Die sind auf dem iPhone, vor allem installiert, teils
   höher als der sichtbare Bereich, die Seite ließ sich dann ohne Inhalt scrollen. Kein Nachziehen über den Rand (Bounce) */
html:has(> body.pfx-app) { height: 100%; overscroll-behavior-y: none; }
/* Offenes Sheet oder offener Dialog: Die Seite dahinter scrollt nicht mit, nur das Sheet selbst */
html:has(> body.pfx-app .pfx-scrim:not([hidden])) { overflow: hidden; }
body.pfx-app { height: 100%; }
/* :where() hält die Spezifität bei 0, damit Komponenten-Klassen immer gewinnen */
:where(.pfx-app) *, :where(.pfx-app) *::before, :where(.pfx-app) *::after { box-sizing: border-box; }
:where(.pfx-app) button { font: inherit; color: inherit; cursor: pointer; }
:where(.pfx-app) a { color: inherit; }
:where(.pfx-app) button:focus-visible,
:where(.pfx-app) a:focus-visible { outline: 3px solid var(--color-salmon); outline-offset: 2px; }
:where(.pfx-app) input:focus,
:where(.pfx-app) select:focus,
:where(.pfx-app) textarea:focus { outline: none; border-color: var(--color-surface) !important; box-shadow: var(--focus-ring); }
:where(.pfx-app) input::placeholder { color: var(--color-text-muted); opacity: 1; }
:where(.pfx-app) [hidden] { display: none !important; }
/* Hervorhebung im Fließtext: 600 wie Buttons und Überschriften */
:where(.pfx-app) strong { font-weight: var(--font-weight-semibold); }
/* Icons (Material Symbols Outlined aus dem Sprite, <svg><use href="#i-name"/></svg>): Farbe folgt dem Text */
:where(.pfx-app) svg:has(> use) { fill: currentColor; flex-shrink: 0; }

/* ---------- 3. Typografie ---------- */
.pfx-text-number  { font-size: var(--font-size-6xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tighter); line-height: 1; }
.pfx-text-display { font-size: var(--font-size-5xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tight); line-height: 1; }
.pfx-text-title   { font-size: var(--font-size-4xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tight); }
.pfx-text-card    { font-size: var(--font-size-2xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tight); }
.pfx-text-section { font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }
.pfx-text-input   { font-size: var(--font-size-xl); font-weight: var(--font-weight-regular); }
.pfx-text-body    { font-size: var(--font-size-lg); font-weight: var(--font-weight-regular); color: var(--color-text); }
.pfx-text-small   { font-size: var(--font-size-md); font-weight: var(--font-weight-regular); color: var(--color-text); }
.pfx-text-caption { font-size: var(--font-size-sm); font-weight: var(--font-weight-regular); color: var(--color-text-muted); }
/* Typo-Klassen bringen keine Außenabstände mit; Abstände kommen aus dem Layout */
:where(.pfx-text-number, .pfx-text-display, .pfx-text-title, .pfx-text-card, .pfx-text-section, .pfx-text-input, .pfx-text-body, .pfx-text-small, .pfx-text-caption) { margin: 0; }

/* ---------- 4. Buttons ---------- */
.pfx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  border: none; border-radius: var(--radius-pill); padding: 0;
  background: transparent; text-decoration: none; white-space: nowrap;
  transition: filter var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.pfx-btn:active:not(:disabled) { filter: brightness(0.94); transform: scale(0.98); }
.pfx-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pfx-btn svg { flex-shrink: 0; }

/* Primär: 48 px (wie Felder und Stepper), 17/600, Anthrazit */
.pfx-btn--primary   { height: 48px; padding: 0 var(--space-7); background: var(--color-text); color: var(--color-text-on-dark); font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }
/* Hauptaktion im Satz: Peach (kräftig), Text Anthrazit 6:1 */
.pfx-btn--set       { height: 48px; padding: 0 var(--space-7); background: var(--split-bb-selected); color: var(--color-text); font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }
/* Destruktiv */
.pfx-btn--danger    { height: 48px; padding: 0 var(--space-7); background: var(--color-warning); color: var(--color-text-on-dark); font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }
/* Laden / Speichern: aria-busy="true" blendet den Text aus (Breite bleibt) und zeigt einen Spinner in der Textfarbe der Variante */
.pfx-btn { --spinner: var(--color-text-on-dark); }
.pfx-btn--set, .pfx-btn--secondary, .pfx-btn--inverse, .pfx-btn--add, .pfx-btn--outline { --spinner: var(--color-text); }
.pfx-btn--google { --spinner: var(--color-google-text); }
.pfx-btn--danger.pfx-btn--outline { --spinner: var(--color-warning-text); }
.pfx-btn--set.pfx-btn--outline { --spinner: var(--split-bb-selected); }
.pfx-btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.pfx-btn[aria-busy="true"] > * { visibility: hidden; }
.pfx-btn[aria-busy="true"]::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border: 2.5px solid var(--spinner); border-right-color: transparent; border-radius: 50%;
  animation: pfx-spin .7s linear infinite;
}
.pfx-btn--sm[aria-busy="true"]::after { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-width: 2px; }
@keyframes pfx-spin { to { transform: rotate(360deg); } }

/* Outline: Kombination mit einer Variante, transparent mit 2 px Rahmen in der Variantenfarbe */
.pfx-btn--outline { background: transparent; border: 2px solid currentColor; }
.pfx-btn--primary.pfx-btn--outline { color: var(--color-text); }
.pfx-btn--set.pfx-btn--outline     { color: var(--split-bb-selected); border-color: var(--split-bb-selected); }
.pfx-btn--danger.pfx-btn--outline  { color: var(--color-warning-text); border-color: var(--color-warning); }
/* Sekundär: weiß, 1,5 px Rahmen */
.pfx-btn--secondary { height: 48px; padding: 0 var(--space-7); background: var(--color-surface); border: 1.5px solid var(--color-border); color: var(--color-text); font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }
/* Umkehr auf dunklen/farbigen Flächen, immer mit Größe kombinieren (--sm oder --md) */
.pfx-btn--inverse   { background: var(--color-surface); color: var(--color-text); font-weight: var(--font-weight-semibold); }

/* Größen */
.pfx-btn--sm  { height: 38px; padding: 0 var(--space-4); font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); }  /* klein: 38 px (wie .pfx-chip, 24.10.2026); runde Icon-Buttons --sm bleiben 40 px */
.pfx-btn--md  { height: 48px; padding: 0 var(--space-5); font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }  /* mittel: 48 px, 16/600, z. B. in dunkler Karte und im Dialog (ersetzt --h48 und --h52) */
.pfx-btn--block { width: 100%; }

/* Textlinks */
.pfx-btn--text        { height: 44px; padding: 0 var(--space-1); color: var(--color-link); font-size: var(--font-size-base); font-weight: var(--font-weight-semibold); }
/* Kompakt (28 px): Textlink, der zum Feld darüber gehört. Rückt an das Feld heran und bündig mit dem Feldtext ein (16 px) */
.pfx-btn--text.pfx-btn--compact { height: 28px; margin: calc(var(--space-1) * -1) 0 0 var(--space-4); }
.pfx-btn--text-danger { height: 44px; padding: 0 var(--space-1); color: var(--color-warning-text); font-size: var(--font-size-base); font-weight: var(--font-weight-semibold); }

/* Icon-Buttons */
.pfx-btn--icon   { width: 48px; height: 48px; border-radius: 50%; background: var(--color-surface); }
.pfx-btn--step   { width: 48px; height: 48px; border-radius: 50%; background: var(--color-surface-2); font-size: var(--font-size-3xl); font-weight: var(--font-weight-semibold); }
.pfx-btn--action { width: 48px; height: 48px; border-radius: 50%; background: var(--color-text); color: var(--color-text-on-dark); }
/* Runde Buttons nie stauchen, auch neben breiten Feldern in einer Flex-Zeile */
.pfx-btn--icon, .pfx-btn--step, .pfx-btn--action { flex-shrink: 0; }
/* Destruktiv als Icon-Button: weißer Kreis, Icon in Warnfarbe (Material Symbol „cancel“) */
.pfx-btn--icon.pfx-btn--danger-icon { color: var(--color-warning); }
/* Klein: runde Buttons mit 40 px, z. B. in der Kopfzeile */
.pfx-btn--icon.pfx-btn--sm, .pfx-btn--action.pfx-btn--sm { width: 40px; height: 40px; padding: 0; }
.pfx-btn--icon.pfx-btn--sm svg, .pfx-btn--action.pfx-btn--sm svg { width: 20px; height: 20px; }
/* Zähler auf einem runden Icon-Button (z. B. offene Hinweise an der Glocke): rot, oben rechts, Rand in Grundfarbe trennt ihn vom Button */
.pfx-btn:has(> .pfx-btn__count) { position: relative; }
.pfx-btn__count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 var(--space-1);
  border-radius: var(--radius-pill); border: 2px solid var(--color-bg); background: var(--color-warning); color: var(--color-text-on-dark);
  font-size: var(--font-size-2xs); font-weight: var(--font-weight-bold); line-height: 1; display: flex; align-items: center; justify-content: center;
}
.pfx-btn--fab    { height: 48px; padding: 0 var(--space-5) 0 var(--space-4); background: var(--color-text); color: var(--color-text-on-dark); font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }
.pfx-btn--add    { height: 48px; padding: 0 var(--space-5) 0 var(--space-4); background: var(--color-surface); border: 1.5px solid var(--color-border); color: var(--color-text); font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }

/* Anmelden mit Google: 48 px wie Primary, Logo „G“ als <img> 20 px links (Datei aus dem Branding-Paket von Google), Roboto 14/500 */
.pfx-btn--google { height: 48px; padding: 0 var(--space-5) 0 var(--space-4); gap: var(--space-3); background: var(--color-google-surface); border: 1px solid var(--color-google-border); color: var(--color-google-text); font-family: var(--font-google); font-size: var(--font-size-md); font-weight: var(--font-weight-medium); }
.pfx-btn--google img { display: block; flex-shrink: 0; }

/* ---------- 5. Formular ---------- */
.pfx-field        { display: flex; flex-direction: column; gap: var(--space-2); }
.pfx-field__label { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); color: var(--color-text-muted); }
.pfx-field__hint  { font-size: var(--font-size-xs); color: var(--color-text-muted); }
/* Feld-Fehler: Rahmen in Warnfarbe am Feld mit aria-invalid, Fehlertext darunter (über aria-describedby verknüpft) */
.pfx-field__error { font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold); color: var(--color-warning-text); }

.pfx-input {
  width: 100%; height: 48px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border); padding: 0 var(--space-4); background: var(--color-surface);
  font: inherit; font-size: var(--font-size-xl); font-weight: var(--font-weight-regular); color: var(--color-text);
}
.pfx-input--center { text-align: center; }
/* Mehrzeilig (textarea): Flächenradius, wächst mit, min. 96 px */
.pfx-input--multiline { height: auto; min-height: 96px; padding: var(--space-3) var(--space-4); border-radius: var(--radius); line-height: 1.4; resize: vertical; }
/* Klein: 40 px, 15/400, z. B. in Listenzeilen */
.pfx-input--sm { height: 40px; padding: 0 var(--space-3); font-size: var(--font-size-base); }
.pfx-input[aria-invalid="true"], .pfx-select__control[aria-invalid="true"] { border-color: var(--color-warning); }
/* Eingabe mit festem Präfix: ein Feld im Look von .pfx-input, links ein nicht editierbarer Text (z. B. die Kette
   vor dem Studio-Namen), ohne eigene Fläche. Als <label>, damit ein Tipp auf den Präfix ins Feld führt. Fokus und Fehler am Ganzen. */
.pfx-input-group {
  display: flex; align-items: center; gap: var(--space-1); width: 100%; height: 48px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border); padding: 0 var(--space-4); background: var(--color-surface); cursor: text;
  font-size: var(--font-size-xl); font-weight: var(--font-weight-regular); color: var(--color-text);
}
.pfx-input-group__prefix  { flex-shrink: 0; white-space: nowrap; }
/* Icon vorn (z. B. Suche): Maße wie .pfx-select__icon--lead, Text beginnt bei 44 px. */
.pfx-input-group__icon    { flex-shrink: 0; display: block; width: 20px; height: 20px; margin-right: var(--space-1); }
.pfx-input-group__control { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; padding: 0; background: none; font: inherit; color: inherit; }
.pfx-input-group__control:focus { box-shadow: none; }
.pfx-input-group:focus-within { border-color: var(--color-surface); box-shadow: var(--focus-ring); }
.pfx-input-group:has([aria-invalid="true"]) { border-color: var(--color-warning); }

.pfx-select { position: relative; display: block; }
.pfx-select__control {
  appearance: none; -webkit-appearance: none; display: block;
  width: 100%; height: 48px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border); background: var(--color-surface); padding: 0 44px 0 var(--space-4);
  font: inherit; font-size: var(--font-size-xl); font-weight: var(--font-weight-regular); color: var(--color-text);
}
.pfx-select--icon .pfx-select__control { padding-left: 44px; }
.pfx-select__icon { position: absolute; top: 50%; margin-top: -10px; width: 20px; height: 20px; pointer-events: none; z-index: 1; }
.pfx-select__icon--lead    { left: var(--space-4); }
.pfx-select__icon--chevron { right: var(--space-4); }
/* Klein: 40 px, 15/400, Icons 18 px */
.pfx-select--sm .pfx-select__control { height: 40px; padding: 0 36px 0 var(--space-3); font-size: var(--font-size-base); }
.pfx-select--sm.pfx-select--icon .pfx-select__control { padding-left: 36px; }
.pfx-select--sm .pfx-select__icon { width: 18px; height: 18px; margin-top: -9px; }
.pfx-select--sm .pfx-select__icon--lead    { left: var(--space-3); }
.pfx-select--sm .pfx-select__icon--chevron { right: var(--space-3); }

.pfx-stepper {
  height: 48px; border-radius: var(--radius-pill); border: 1px solid var(--color-border);
  background: var(--color-surface); display: flex; align-items: center; padding: 0 var(--space-1);
}
.pfx-stepper__btn {
  width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--color-surface-2);
  font-size: var(--font-size-2xl); font-weight: var(--font-weight-semibold); flex-shrink: 0; padding: 0;
}
.pfx-stepper__input {
  flex-grow: 1; min-width: 0; width: 100%; height: 44px; border: none; background: transparent;
  text-align: center; padding: 0; font: inherit; font-size: var(--font-size-xl); font-weight: var(--font-weight-regular); color: var(--color-text);
}
.pfx-stepper__input:focus { box-shadow: none; }
.pfx-stepper:focus-within { border-color: var(--color-surface); box-shadow: var(--focus-ring); }
/* Unter Vorgabe: mit data-target am Stepper setzt das Script data-below, Wert in Destruktiv-Farbe */
.pfx-stepper[data-below="true"] .pfx-stepper__input { color: var(--color-warning); font-weight: var(--font-weight-semibold); }

/* Schalter: 52 × 32, Knopf 24 px, 4 px Innenabstand */
.pfx-switch {
  width: 52px; height: 32px; border-radius: var(--radius-pill); border: none;
  background: var(--color-border); padding: var(--space-1); display: flex; justify-content: flex-start;
  transition: background var(--duration-fast) var(--ease-standard);
}
.pfx-switch[aria-checked="true"] { background: var(--color-text); justify-content: flex-end; }
.pfx-switch__knob { width: 24px; height: 24px; border-radius: 50%; background: var(--color-surface); }

.pfx-segmented { display: inline-flex; background: var(--color-line); border-radius: var(--radius-pill); padding: var(--space-1); gap: var(--space-1); }
.pfx-segmented__item {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);  /* Platz für .pfx-count */
  height: 40px; padding: 0 var(--space-4); border: none; border-radius: var(--radius-pill);
  background: transparent; font-size: var(--font-size-base); font-weight: var(--font-weight-medium); white-space: nowrap;
}
/* Gleiches Gewicht in beiden Zuständen, damit beim Wechsel nichts springt */
.pfx-segmented__item[aria-selected="true"] { background: var(--color-surface); }
/* Volle Breite: Optionen teilen sich die Breite gleichmäßig */
.pfx-segmented--block { display: flex; width: 100%; }
.pfx-segmented--block .pfx-segmented__item { flex: 1 1 0; min-width: 0; }
.pfx-segmented__item:disabled { cursor: default; pointer-events: none; }
.pfx-segmented:has(.pfx-segmented__item:disabled) { opacity: 0.6; }
/* Klein: 40 px gesamt (32 px Optionen + 4 px Rand), 14 px, z. B. als Auswahl in Listenzeilen */
.pfx-segmented--sm { padding: var(--space-1); gap: var(--space-1); }
.pfx-segmented--sm .pfx-segmented__item { height: 32px; padding: 0 var(--space-3); font-size: var(--font-size-md); }
/* Volle Breite + klein: Breite nach Inhalt statt gleich breit, damit längere Optionen („Später angeben“) passen */
.pfx-segmented--sm.pfx-segmented--block .pfx-segmented__item { flex: 1 1 auto; padding: 0 var(--space-2); }
/* Scrollt waagerecht (Spec 040, Nachhol-Workout mit bis zu 6 Gruppen): Optionen nach Inhalt, bei genug Platz füllen sie die Breite.
   Sonst scrollt die Leiste wie die Tagesleiste, der Anschnitt rechts zeigt, dass es weitergeht. Die gewählte Option scrollt ins Bild */
.pfx-segmented--scroll { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: none; }
.pfx-segmented--scroll::-webkit-scrollbar { display: none; }
.pfx-segmented--scroll .pfx-segmented__item { flex: 1 0 auto; scroll-snap-align: start; }

/* Auswahl-Chips: gleiches Gewicht (600) in allen Zuständen, damit bei Auswahl nichts springt */
.pfx-chip {
  height: 38px; padding: 0 var(--space-4); border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border); background: var(--color-surface); color: var(--color-text);
  font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold);
}
.pfx-chip[aria-pressed="true"]        { border-color: var(--color-text); background: var(--color-text); color: var(--color-text-on-dark); }
.pfx-chip[data-level="focus"]         { border-color: var(--color-warning); background: var(--color-warning); color: var(--color-text-on-dark); }
.pfx-chip[data-level="keep"]          { border-color: var(--color-text-muted); background: var(--color-text-muted); color: var(--color-text-on-dark); }
.pfx-chip[data-level="secondary"]     { border-color: var(--color-border); background: var(--color-border); color: var(--color-text); }
/* Gesperrt: Auswahl sichtbar, aber nicht änderbar (z. B. eigene Gruppen eines Splits, Spec 025) */
.pfx-chip:disabled { opacity: 0.6; cursor: default; pointer-events: none; }

/* ---------- 6. Karten & Listen ---------- */
.pfx-card { background: var(--color-surface); border-radius: var(--radius); padding: var(--pad-surface); display: flex; flex-direction: column; gap: var(--space-2); }
.pfx-card__title { font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); margin: 0; }
.pfx-card__text  { font-size: var(--font-size-base); color: var(--color-text); margin: 0; }

.pfx-card--dark { background: var(--color-text); color: var(--color-text-on-dark); padding: var(--space-4) var(--pad-surface); gap: var(--space-3); }
.pfx-card--dark .pfx-card__title { font-size: var(--font-size-2xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tight); }
.pfx-card--dark .pfx-card__text  { font-size: var(--font-size-md); color: var(--color-text-on-dark-muted); }

.pfx-card--split { background: var(--split-bs); padding: var(--space-4) var(--pad-surface); gap: var(--space-1); }
.pfx-card__date     { font-size: var(--font-size-md); color: var(--split-bs-ink); }
.pfx-card__headline { font-size: var(--font-size-4xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tight); margin: 0; }

/* Vorschlagskarte: Hero auf der Startseite, Fläche in der hellen Split-Farbe */
.pfx-suggest { --split: var(--split-bb); background: var(--split); color: var(--color-text); border-radius: var(--radius); padding: var(--pad-surface); display: flex; flex-direction: column; align-items: center; gap: var(--space-1); text-align: center; }  /* alles mittig (05.11.2026) */
.pfx-suggest--bb { --split: var(--split-bb); }
.pfx-suggest--rt { --split: var(--split-rt); }
.pfx-suggest--bs { --split: var(--split-bs); }
.pfx-suggest--lv { --split: var(--split-lv); }
.pfx-suggest--sd { --split: var(--split-sd); }
.pfx-suggest--ro { --split: var(--split-ro); }
.pfx-suggest--cu { --split: var(--split-cu); }  /* Nachhol-Workout (Spec 040), Limestone */
.pfx-suggest__eyebrow { font-size: var(--font-size-md); font-weight: var(--font-weight-regular); line-height: 1.4; }  /* Fließtext */
.pfx-suggest__title   { margin: 0; font-size: var(--font-size-4xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tight); line-height: 1.15; }
.pfx-suggest__text    { margin: 0; font-size: var(--font-size-md); }
.pfx-suggest .pfx-btn { margin-top: var(--space-1); }  /* kleiner Button mittig, 8 px unter dem Text (Gap 4 + 4) */

/* Karussell: eine Karte in voller Breite, weitere per Wischen oder Punkt-Navigation */
.pfx-suggest-carousel {
  display: flex; align-items: flex-start; gap: var(--pad-screen); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; border-radius: var(--radius);
}
.pfx-suggest-carousel::-webkit-scrollbar { display: none; }
.pfx-suggest-carousel > .pfx-suggest { flex: 0 0 100%; scroll-snap-align: center; }
/* Endlosschleife: per JS werden die Karten links und rechts geklont (data-clone) */

/* Karussell + Punkt-Navigation als Einheit: Abstand liegt im Wrapper, nicht in den Komponenten */
.pfx-suggest-slider { width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 0; }  /* sichtbarer Abstand Karte → Punkt 8 px (Rest der 24-px-Trefferfläche) */

/* Punkt-Navigation unter einem Karussell: 24 px Trefferfläche, sichtbarer Punkt 8 px, aktiv 20 px breit */
.pfx-dots { display: flex; justify-content: center; gap: var(--space-1); }
.pfx-dots__dot { width: 24px; height: 24px; padding: 0; border: none; background: none; display: flex; align-items: center; justify-content: center; }
.pfx-dots__dot::after { content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--color-border); transition: width var(--duration-base) var(--ease-standard), background var(--duration-base) var(--ease-standard); }
.pfx-dots__dot[aria-current="true"]::after { width: 20px; background: var(--color-text); }

.pfx-stats { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pfx-stat  { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3); border-radius: var(--radius); background: var(--color-surface-2); min-width: 110px; }
.pfx-stat__label { font-size: var(--font-size-xs); color: var(--color-text-muted); }
.pfx-stat__value { font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); }
/* Volle Breite: Kennzahlen gleich breit ohne Umbruch, weiße Fläche (auf Grundfarbe statt in einer Karte) */
.pfx-stats--block { flex-wrap: nowrap; }
.pfx-stats--block > .pfx-stat { flex: 1 1 0; min-width: 0; background: var(--color-surface); }

/* Übungszeile */
/* Rahmenbreite als Variable: das Padding zieht sie ab, damit alle Varianten exakt gleich hoch sind */
.pfx-exercise {
  --exercise-border: 0px;
  width: 100%; display: flex; gap: var(--space-3); align-items: center;
  background: var(--color-surface); border: var(--exercise-border) solid transparent; border-radius: var(--radius);
  padding: calc(var(--space-3) - var(--exercise-border)) calc(var(--pad-surface) - var(--exercise-border));
  color: var(--color-text); text-align: left; text-decoration: none;
}
.pfx-exercise__num {
  width: 52px; height: 52px; border-radius: 50%; background: var(--color-surface-2);
  display: flex; align-items: center; justify-content: center; font-size: var(--font-size-base); font-weight: var(--font-weight-semibold); flex-shrink: 0;
}
/* Foto der Übung im Kreis des Kennzeichens (Spec 030), füllt den Kreis */
.pfx-exercise__num { overflow: hidden; }
.pfx-exercise__num img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pfx-exercise--muted .pfx-exercise__num img { opacity: 0.6; }
.pfx-exercise__body   { display: flex; flex-direction: column; gap: var(--space-1); flex-grow: 1; min-width: 0; overflow-wrap: break-word; }
/* Herkunft im Body (Spec 022, „Wie {Name}“): eigene Zeile unter den Bereichen, nie breiter als der Body, lange Namen mit „…“ */
.pfx-exercise__body > .pfx-badge { display: block; align-self: flex-start; max-width: 100%; line-height: 26px; overflow: hidden; text-overflow: ellipsis; }
.pfx-exercise__name   { font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); }
.pfx-exercise__target { font-size: var(--font-size-md); color: var(--color-text); }
.pfx-exercise__meta   { font-size: var(--font-size-sm); color: var(--color-text-muted); }
.pfx-exercise__chevron { color: var(--color-text-muted); flex-shrink: 0; }
.pfx-exercise__action {
  height: 48px; padding: 0; border: none; background: transparent; flex-shrink: 0;
  font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); color: var(--color-link);
}
.pfx-exercise--done { --exercise-border: 2px; border-color: var(--color-success); }
.pfx-exercise--done .pfx-exercise__num  { background: var(--color-success); }
.pfx-exercise--done .pfx-exercise__meta { font-weight: var(--font-weight-semibold); color: var(--color-success-text); }
.pfx-exercise--muted { --exercise-border: 1.5px; background: var(--color-surface-2); border-style: dashed; border-color: var(--color-border); }
.pfx-exercise--muted .pfx-exercise__num { background: var(--color-line); color: var(--color-text-muted); }

/* Liste */
.pfx-list { width: 100%; background: var(--color-surface); border-radius: var(--radius); padding: var(--space-1) var(--pad-surface); }
.pfx-list__item {
  display: flex; align-items: center; gap: var(--space-3); min-height: 56px; width: 100%; padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-line); color: var(--color-text); text-decoration: none;
}
/* Keine Linie unter dem letzten sichtbaren Eintrag (auch wenn danach ausgeblendete [hidden] folgen) */
.pfx-list__item:last-child,
.pfx-list__item:not(:has(~ .pfx-list__item:not([hidden]))) { border-bottom: none; }
/* Angehängte Zeile (z. B. Zusatzeingabe): gehört zur Zeile davor, daher keine Trennlinie dazwischen */
.pfx-list__item:has(+ .pfx-list__item--attached:not([hidden])) { border-bottom: none; padding-bottom: var(--space-1); }
.pfx-list__item--attached { min-height: 0; padding-top: var(--space-2); }
.pfx-list__label   { flex-grow: 1; font-size: var(--font-size-lg); }
.pfx-list__value   { font-size: var(--font-size-md); color: var(--color-text-muted); white-space: nowrap; flex-shrink: 0; }  /* Wert bleibt einzeilig, z. B. „3 Übungen“ bei 320 px */
/* Aktueller Satz: für ihn gelten Gewicht und Wdh. unten. Roter Rahmen über die ganze Breite der Liste, Text bleibt an seinem Platz */
.pfx-list__item[aria-current="step"] {
  width: auto; margin: 0 calc(-1 * var(--pad-surface)); padding: calc(var(--space-3) - 2px) calc(var(--pad-surface) - 2px) calc(var(--space-3) - 1px);
  border: 2px solid var(--color-warning); border-radius: var(--radius);
}
/* Erste bzw. letzte Zeile: Rahmen schließt auch oben bzw. unten mit der Liste ab */
.pfx-list__item[aria-current="step"]:first-child { margin-top: calc(-1 * var(--space-1)); padding-top: calc(var(--space-3) + var(--space-1) - 2px); }
.pfx-list__item[aria-current="step"]:last-child,
.pfx-list__item[aria-current="step"]:not(:has(~ .pfx-list__item:not([hidden]))) { margin-bottom: calc(-1 * var(--space-1)); padding-bottom: calc(var(--space-3) + var(--space-1) - 2px); border-bottom: 2px solid var(--color-warning); }  /* Rahmen unten gegen „keine Linie unter dem letzten Eintrag“ halten */
/* Pause als Hintergrund des aktuellen Satzes (Script setzt --rest und data-rest-state): läuft hell schraffiert, überzogen rot getönt, beendet ohne Muster */
.pfx-list__item[data-rest-state] { position: relative; isolation: isolate; overflow: hidden; }
.pfx-list__item[data-rest-state]::before {
  content: ""; position: absolute; inset: 0 auto 0 0; z-index: -1; width: var(--rest, 0%);
  background: var(--color-line); transition: width var(--duration-base) var(--ease-standard);
}
.pfx-list__item[data-rest-state="running"]::before,
.pfx-list__item[data-rest-state="over"]::before {
  background-image: repeating-linear-gradient(-45deg, var(--color-stripe) 0 6px, transparent 6px 12px);
  background-size: 16.97px 16.97px; animation: pfx-stripes 1s linear infinite;
}
.pfx-list__item[data-rest-state="over"]::before { background-color: color-mix(in srgb, var(--color-warning) 16%, var(--color-surface)); }
.pfx-list__item[data-rest-state="running"] .pfx-list__value,
.pfx-list__item[data-rest-state="over"] .pfx-list__value { font-variant-numeric: tabular-nums; }  /* „1:20 / 1:30“ springt nicht */
.pfx-list__item[data-rest-state="over"] .pfx-list__value { color: var(--color-warning-text); }  /* überzogene Zeit rot, wie früher in der Pausen-Karte */
.pfx-list__item[aria-current="step"] .pfx-list__label { font-weight: var(--font-weight-semibold); }
.pfx-list__chevron { color: var(--color-text-muted); flex-shrink: 0; }
.pfx-list__icon    { color: var(--color-text-muted); flex-shrink: 0; }  /* Icon rechts in der Zeile, z. B. Bewertung im Verlauf (Spec 017) */
/* Zeile mit Link und eigener Aktion rechts (z. B. Hinweis im Sheet mit Haken „Erledigt“, Spec 013): Link füllt die Zeile, die Aktion steht daneben */
.pfx-list__link    { flex-grow: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: var(--space-3); color: inherit; text-decoration: none; }
/* Auswahlliste: Einfachauswahl als Liste (role="radiogroup", Zeilen als Button mit role="radio"), Häkchen an der gewählten Zeile */
.pfx-list--choice .pfx-list__item { background: none; border-width: 0 0 1px; text-align: left; }
.pfx-list__check { flex-shrink: 0; color: var(--color-text); visibility: hidden; }
.pfx-list__item[aria-checked="true"] .pfx-list__check { visibility: visible; }
.pfx-list--people .pfx-list__item { min-height: 72px; }
/* Zeile als Button (z. B. Gruppe auf- und zuklappen mit aria-expanded): ohne Button-Fläche und -Rahmen, linksbündig */
.pfx-list__item--toggle { background: none; border-width: 0 0 1px; text-align: left; }
/* Ausgegraute Zeile: noch nicht verfügbar (z. B. „Bauch · Kommt später.“) */
.pfx-list__item--muted { color: var(--color-text-muted); }
/* Ohne Trennlinie darunter: Zeilen, die zusammengehören (z. B. Bereiche einer aufgeklappten Gruppe) */
.pfx-list__item--flush { border-bottom: none; }
/* Angehängte Zeile ein-/ausblenden: Script setzt data-entering (beim Erscheinen) bzw. data-leaving (vor dem Entfernen) */
.pfx-list__item--attached[data-entering] { animation: pfx-attached-in var(--duration-slow) var(--ease-out); }
.pfx-list__item--attached[data-leaving]  { animation: pfx-attached-out var(--duration-base) var(--ease-standard) forwards; }
@keyframes pfx-attached-in  { from { opacity: 0; transform: translateY(-8px); } }
@keyframes pfx-attached-out { to   { opacity: 0; transform: translateY(-8px); } }
/* Einklappbare Liste: Zeilen mit data-collapsible sind eingeklappt [hidden] und blenden beim Aufklappen ein; Chevron im Auslöser dreht sich */
.pfx-list__item[data-collapsible]:not([hidden]) { animation: pfx-fade-in var(--duration-exit) var(--ease-standard); }
.pfx-btn__chevron { transition: transform var(--duration-base) var(--ease-standard); }
[aria-expanded="true"] > .pfx-btn__chevron { transform: rotate(180deg); }
/* Verlauf: kompakte Zeilen, Datum links (13/600), Trend + Satz-Badges rechts in einer Zeile ohne Umbruch */
.pfx-list--history .pfx-list__item { min-height: 52px; padding: var(--space-3) 0; gap: var(--space-2); }
.pfx-list--history .pfx-list__label { flex: 0 0 auto; white-space: nowrap; font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); }
.pfx-list--history .pfx-badge-group { flex: 0 1 auto; min-width: 0; justify-content: flex-end; flex-wrap: nowrap; gap: var(--space-1); }
.pfx-list--history .pfx-badge { padding: 0 var(--space-2); }

.pfx-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--color-avatar-bg);
  display: flex; align-items: center; justify-content: center; font-size: var(--font-size-xl); font-weight: var(--font-weight-bold); flex-shrink: 0;
}
.pfx-avatar { overflow: hidden; }
.pfx-avatar img { width: 100%; height: 100%; object-fit: cover; }  /* Profilbild statt Initiale (Spec 021) */
.pfx-avatar--lg { width: 88px; height: 88px; font-size: var(--font-size-5xl); }  /* Profilbild im Sheet „Profilbild“ (Spec 019) */
.pfx-list__item > .pfx-switch { flex-shrink: 0; }  /* Schalter in der Zeile bleibt 52 px breit, z. B. Freigaben (Spec 021) */
.pfx-person        { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; gap: var(--space-1); overflow-wrap: break-word; }
.pfx-person__name  { font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); }
.pfx-person__meta  { font-size: var(--font-size-sm); color: var(--color-text-muted); }
.pfx-person__score { display: flex; flex-direction: column; align-items: flex-end; }
.pfx-person__value { font-size: var(--font-size-2xl); font-weight: var(--font-weight-semibold); }
.pfx-person__unit  { font-size: var(--font-size-xs); color: var(--color-text-muted); }

/* Foto einer Übung (Spec 027): quadratische Vorschau, Tap zeigt es groß. --sm im Satz-Screen neben der Notiz */
.pfx-photo { display: block; flex-shrink: 0; width: 96px; aspect-ratio: 1; padding: 0; border: none; border-radius: var(--radius); overflow: hidden; background: var(--color-surface-2); cursor: pointer; }
.pfx-photo--sm { width: 56px; }
.pfx-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Vorschau links, Inhalt rechts (Buttons im Formular, Notiz im Satz-Screen) */
.pfx-media       { display: flex; align-items: center; gap: var(--space-3); }
.pfx-media__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
/* Kleiner Button direkt im Feld (z. B. „Foto“): so breit wie sein Text, nicht über die ganze Zeile */
.pfx-field > .pfx-btn--sm { align-self: flex-start; }
/* Foto groß: im .pfx-scrim, Kreuz oben rechts, Bild ganz sichtbar */
.pfx-photo-view      { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-3); max-width: 100%; }
.pfx-photo-view__img { display: block; max-width: 100%; max-height: calc(100dvh - 2 * var(--space-6) - 52px); border-radius: var(--radius); object-fit: contain; }
/* Fortschrittsfotos (Spec 018): Posen nebeneinander im Hochformat, Platzhalter ohne Foto */
.pfx-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.pfx-photos--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pfx-photos__item { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.pfx-photos .pfx-photo { width: 100%; aspect-ratio: 3 / 4; }
.pfx-photos__cap { font-size: var(--font-size-sm); color: var(--color-text-muted); text-align: center; }
.pfx-photo--empty { display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); }

/* ---------- 7. Status & Feedback ---------- */
.pfx-badge {
  display: inline-flex; align-items: center; height: 26px; padding: 0 var(--space-3);
  border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text);
  font-size: var(--font-size-xs); font-weight: var(--font-weight-bold); white-space: nowrap;
}
.pfx-badge--salmon  { background: var(--color-salmon); }
.pfx-badge--success { background: var(--color-success); }
.pfx-badge--warning { background: var(--color-warning); color: var(--color-text-on-dark); }
.pfx-badge--link    { background: var(--color-link); color: var(--color-text-on-dark); }
.pfx-badge--white   { background: var(--color-surface); }
.pfx-badge--bs { background: var(--split-bs); }
.pfx-badge--bb { background: var(--split-bb); }
.pfx-badge--rt { background: var(--split-rt); }
.pfx-badge--lv { background: var(--split-lv); }
.pfx-badge--sd { background: var(--split-sd); }
.pfx-badge--ro { background: var(--split-ro); }
.pfx-badge--cu { background: var(--split-cu); }
/* Offen / noch nicht erledigt: ausgegraut, gestrichelt (Innenabstand minus Rahmen, damit die Breite gleich bleibt) */
.pfx-badge--open { background: var(--color-surface-2); border: 1.5px dashed var(--color-border); padding: 0 calc(var(--space-3) - 1.5px); color: var(--color-text-muted); }

/* Gruppe von Badges/Chips: umbrechend, 8 px Abstand */
.pfx-badge-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* Badges ohne Farbvariante auf weißen Flächen (Liste, helle Karte, Sheet, Dialog): Fläche sekundär, damit sie sichtbar bleiben */
:is(.pfx-list, .pfx-card:not(.pfx-card--dark), .pfx-sheet, .pfx-dialog) .pfx-badge:not([class*="pfx-badge--"]) { background: var(--color-surface-2); }

/* Trend gegenüber dem Workout davor (nach Gewicht): Material Symbols „trending_up / _flat / _down“, 18 px, rechtsbündig vor den Badges */
.pfx-trend { flex-shrink: 0; margin-left: auto; }
.pfx-trend--up   { color: var(--color-success-text); }
.pfx-trend--flat { color: var(--color-text-muted); }
.pfx-trend--down { color: var(--color-warning-text); }

/* Bewertung (Smileys): Einfachauswahl aus drei Optionen, z. B. „Wie war dein Training?“ beim Abschließen eines vollständigen Workouts */
.pfx-rating { display: flex; gap: var(--space-2); }
.pfx-rating__option {
  flex: 1 1 0; min-width: 0; height: 80px; padding: 0 var(--space-1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1);
  border: 1.5px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); color: var(--color-text);
  font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold);
}
.pfx-rating__option svg { width: 32px; height: 32px; }
.pfx-rating__option[aria-checked="true"] { border-color: var(--color-text); background: var(--color-text); color: var(--color-text-on-dark); }

/* Gepufferte Sätze: kleiner Status, nur sichtbar, solange etwas noch nicht beim Server ist (Netz weg) */
.pfx-pending {
  display: inline-flex; align-items: center; gap: var(--space-1); height: 28px; padding: 0 var(--space-3) 0 var(--space-2);
  border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text-muted);
  font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); white-space: nowrap;
}
.pfx-pending svg { width: 18px; height: 18px; }
/* Kleiner Spinner in Textfarbe, z. B. in .pfx-pending „speichert“ am aktuellen Satz */
.pfx-spinner { flex-shrink: 0; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pfx-spin .7s linear infinite; }

/* Stand im Durchlauf pro Muskelbereich */
.pfx-muscle { width: 220px; max-width: 100%; display: flex; justify-content: space-between; align-items: center; padding: var(--space-2) var(--space-3); background: var(--color-surface); border-radius: var(--radius); }
.pfx-muscle__name { font-size: var(--font-size-sm); font-weight: var(--font-weight-regular); color: var(--color-text); }
.pfx-muscle--open .pfx-muscle__name { font-weight: var(--font-weight-regular); color: var(--color-text); }
.pfx-muscle__dots { display: flex; gap: var(--space-1); }
.pfx-muscle__dot  { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--color-border-strong); }
.pfx-muscle__dot--done { border: none; background: var(--color-text); }

/* Stand im Durchlauf nach Muskelgruppe: kompaktes Raster, mehrere Bereiche je Gruppe */
.pfx-muscle-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.pfx-muscle-group { background: var(--color-surface); border-radius: var(--radius); padding: var(--space-3) var(--pad-surface) var(--space-2); display: flex; flex-direction: column; gap: var(--space-1); }
:is(.pfx-sheet, .pfx-dialog) .pfx-muscle-group { border: 1px solid var(--color-border); }  /* auf weißem Grund mit Rand, z. B. Sheet „Durchlauf 14 fertig“ (Spec 039) */
.pfx-muscle-group--wide { grid-column: 1 / -1; }
.pfx-muscle-group__title { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); margin: 0 0 var(--space-1); font-size: var(--font-size-md); font-weight: var(--font-weight-bold); }
.pfx-muscle-group__note  { font-size: var(--font-size-xs); font-weight: var(--font-weight-medium); color: var(--color-text-muted); }
.pfx-muscle-group__part  { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); min-height: 26px; padding: var(--space-1) 0; }
.pfx-muscle-group__name  { min-width: 0; overflow-wrap: break-word; hyphens: auto; font-size: var(--font-size-sm); line-height: 1.25; color: var(--color-text); }
.pfx-muscle-group__part--open .pfx-muscle-group__name { font-weight: var(--font-weight-regular); color: var(--color-text); }
/* Fokus: Name des Bereichs fett, Punkte wie alle anderen; aria-label nennt „Fokus“ */
.pfx-muscle-group__part--focus .pfx-muscle-group__name { font-weight: var(--font-weight-bold); }
.pfx-muscle-group__count { flex-shrink: 0; font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--color-text-muted); }
/* Bereich ohne eigene Übung (Spec 041): Zeile als Button, Warnzeichen vor den Punkten, Tap öffnet das Sheet „Keine Übung für …“ */
.pfx-muscle-group__part--missing { width: 100%; margin: 0; border: 0; background: none; text-align: left; -webkit-tap-highlight-color: transparent; }
.pfx-muscle-group__part--missing .pfx-muscle-group__name { flex-grow: 1; }
.pfx-muscle-group__warn { flex-shrink: 0; color: var(--color-warning-text); }

/* Fortschritt */
.pfx-progress { width: 100%; display: flex; flex-direction: column; gap: var(--space-2); }
.pfx-progress__head  { display: flex; justify-content: space-between; font-size: var(--font-size-md); }
.pfx-progress__value { font-weight: var(--font-weight-semibold); }
.pfx-progress__track { height: 10px; border-radius: var(--radius-bar); background: var(--color-line); overflow: hidden; }
.pfx-progress__fill  { width: var(--value, 0%); height: 100%; background: var(--split-bs); transition: width var(--duration-base) var(--ease-standard); }
.pfx-progress__fill--warning { background: var(--color-warning); }
/* Pause-Timer: läuft = Anthrazit, überzogen = Destruktiv (Balken + laufende Zeit, Sollzeit bleibt schwarz), beendet = Rahmen-Grau */
.pfx-progress__fill--dark  { background: var(--color-text); }
.pfx-progress__value--warning { color: var(--color-warning); }
.pfx-progress__fill--muted { background: var(--color-border-strong); }
.pfx-progress__note { font-weight: var(--font-weight-semibold); color: var(--color-warning-text); }
.pfx-progress__note--muted { color: var(--color-text-muted); }
/* Schraffiert: schräge Streifen laufen langsam nach rechts (läuft, z. B. Durchlauf offen, Pause läuft); --muted ohne Muster */
.pfx-progress__fill--striped {
  background-image: repeating-linear-gradient(-45deg, var(--color-stripe) 0 6px, transparent 6px 12px);
  background-size: 16.97px 16.97px;  /* eine Periode der 45°-Schraffur (12 px · √2), damit die Schleife nahtlos ist */
  animation: pfx-stripes 1s linear infinite;
}
@keyframes pfx-stripes { to { background-position: 16.97px 0; } }
.pfx-progress__fill--muted.pfx-progress__fill--striped { background-image: none; animation: none; }

/* Hinweis-Banner: weiß, 1 px Rahmen, Schrift und Kreuz in Anthrazit; Text links, Kreuz rechts (ohne Punkt).
   Auf dem Startscreen ist er die „Karte“ aus dem Hinweis-Katalog (ADR-0012): immer nur der wichtigste offene Hinweis. */
.pfx-banner {
  width: 100%; display: flex; align-items: center; gap: var(--space-3); min-height: 52px;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-radius: var(--radius); background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-text);
}
/* Klickbarer Hinweis: der Link füllt die Fläche links vom Kreuz, das Kreuz bleibt ein eigener Button daneben */
.pfx-banner__link { flex-grow: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: var(--space-3); color: inherit; text-decoration: none; }
.pfx-banner__text  { flex-grow: 1; font-size: var(--font-size-base); font-weight: var(--font-weight-semibold); color: var(--color-text); }
/* Dunkel: z. B. Bilanz eines Durchlaufs */
.pfx-banner--dark { background: var(--color-text); color: var(--color-text-on-dark); border-color: transparent; }
.pfx-banner--dark .pfx-banner__text  { color: var(--color-text-on-dark); }
.pfx-banner--dark .pfx-banner__close { color: var(--color-text-on-dark); }
/* Overlay: flüchtiger Hinweis oben über dem Screen, gleitet von oben ein (z. B. „Pause vorbei“), verschiebt das Layout nicht */
.pfx-banner--overlay {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + var(--space-3)); left: max(var(--space-3), calc(50% - var(--screen-max) / 2 + var(--space-3))); right: max(var(--space-3), calc(50% - var(--screen-max) / 2 + var(--space-3))); width: auto; z-index: var(--z-banner);
  box-shadow: var(--shadow-overlay); animation: pfx-banner-in var(--duration-slow) var(--ease-out);
}
@keyframes pfx-banner-in { from { transform: translateY(calc(-100% - var(--space-3))); opacity: 0; } }
/* Rot: Warnung, z. B. „Pause überzogen“, „Nicht gespeichert“ */
.pfx-banner--danger { background: var(--color-warning); color: var(--color-text-on-dark); border-color: transparent; }
.pfx-banner--danger .pfx-banner__text  { color: var(--color-text-on-dark); }
.pfx-banner--danger .pfx-banner__close { color: var(--color-text-on-dark); }
/* Wechsel zum nächsten Hinweis: Script setzt data-leaving (ausblenden), tauscht den Inhalt und setzt data-entering (einblenden) */
.pfx-banner[data-leaving]  { animation: pfx-fade-out var(--duration-base) var(--ease-standard) forwards; }
.pfx-banner[data-entering] { animation: pfx-fade-in var(--duration-exit) var(--ease-standard); }
/* Zweizeiliger Text: Titel + Zusatz (13/400) */
.pfx-banner__text > .pfx-banner__sub { display: block; font-size: var(--font-size-sm); font-weight: var(--font-weight-regular); }
.pfx-banner__close { width: 40px; height: 40px; border: none; background: transparent; color: var(--color-text); padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Warnung mit Aktion */
.pfx-alert { width: 100%; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--color-warning); color: var(--color-text-on-dark); }
.pfx-alert__title { font-size: var(--font-size-base); font-weight: var(--font-weight-bold); }
.pfx-alert__row   { display: flex; align-items: center; gap: var(--space-3); }
.pfx-alert__text  { flex-grow: 1; font-size: var(--font-size-md); }

/* Privat-Hinweis */
.pfx-note { margin: 0; display: flex; gap: var(--space-2); align-items: center; font-size: var(--font-size-md); color: var(--color-text-muted); }
.pfx-note svg { flex-shrink: 0; }
/* Text über mehrere Zeilen: Icon oben, mittig zur ersten Zeile */
.pfx-note--top { align-items: flex-start; }
.pfx-note--top svg { height: 1lh; }
/* Notiz als Button im Satz-Screen (Spec 037): Tap öffnet das Sheet „Notiz“, Zielfläche 44 px */
.pfx-note--action { min-height: 44px; padding: 0; border: 0; background: none; text-align: left; }

/* ---------- 8. Daten & Kalender ---------- */
.pfx-day {
  width: 50px; height: 58px; padding: var(--space-1); border-radius: var(--radius);
  border: 1px solid var(--color-line); background: var(--color-surface); color: var(--color-text);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: space-between;
}
.pfx-day__num { font-size: var(--font-size-md); font-weight: var(--font-weight-bold); }
.pfx-day__tag {
  width: 100%; height: 22px; border-radius: var(--radius-pill); background: var(--split-cu);
  font-size: var(--font-size-2xs); font-weight: var(--font-weight-bold); display: flex; align-items: center; justify-content: center;
}
.pfx-day__tag--bs { background: var(--split-bs); }
.pfx-day__tag--bb { background: var(--split-bb); }
.pfx-day__tag--rt { background: var(--split-rt); }
.pfx-day__tag--lv { background: var(--split-lv); }
.pfx-day__tag--sd { background: var(--split-sd); }
.pfx-day__tag--ro { background: var(--split-ro); }
/* Ohne Training: Ruhetag, heute, Zukunft */
.pfx-day--empty { background: transparent; justify-content: flex-start; padding: var(--space-2) 0 0; color: var(--color-text-muted); }
.pfx-day--empty .pfx-day__num { font-weight: var(--font-weight-regular); }
.pfx-day--future { color: var(--color-border); }
.pfx-day:disabled { cursor: default; pointer-events: none; }
/* Markierungen als Outline nach innen: Rahmen bleibt 1 px, der Inhalt springt nicht */
.pfx-day--today  { outline: 2px solid var(--color-text); outline-offset: -2px; }
.pfx-day[aria-pressed="true"] { outline: 2px solid var(--color-salmon); outline-offset: -2px; }

.pfx-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--font-size-sm); color: var(--color-text); }
.pfx-legend__item { display: flex; align-items: center; gap: var(--space-1); }
.pfx-legend__dot  { width: 10px; height: 10px; border-radius: var(--radius-seg); background: var(--split-cu); }
.pfx-legend__dot--bs { background: var(--split-bs); }
.pfx-legend__dot--bb { background: var(--split-bb); }
.pfx-legend__dot--rt { background: var(--split-rt); }
.pfx-legend__dot--lv { background: var(--split-lv); }
.pfx-legend__dot--sd { background: var(--split-sd); }
.pfx-legend__dot--ro { background: var(--split-ro); }
.pfx-legend__dot--point { border-radius: 50%; background: var(--color-link); }                                     /* Punkt im Liniendiagramm (Spec 024) */
.pfx-legend__dot--open  { border-radius: 50%; background: var(--color-surface); border: 2px solid var(--color-link); }  /* offener Punkt: vorzeitig beendet */
.pfx-legend__dot--very-good { background: var(--color-link); }
.pfx-legend__dot--good      { background: var(--split-bs-selected); }
.pfx-legend__dot--bad       { background: var(--color-warning); }

.pfx-kpi { display: flex; flex-direction: column; }
.pfx-kpi__label { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); color: var(--color-text-muted); }
.pfx-kpi__value { font-size: var(--font-size-5xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tight); line-height: 1; }
.pfx-kpi__delta { font-size: var(--font-size-base); font-weight: var(--font-weight-semibold); color: var(--color-success-text); }
.pfx-kpi__delta--down { color: var(--color-text-muted); }  /* Rückgang, z. B. „−5 kg in 6 Wochen“ (Spec 017) */
.pfx-kpi__delta--neutral { color: var(--color-text-muted); }  /* ohne Wertung, Zu- und Abnahme gleich, z. B. Körpergewicht (Spec 018) */

.pfx-chart { width: 100%; background: var(--color-surface); border-radius: var(--radius); padding: var(--space-4); }
.pfx-chart svg { display: block; width: 100%; height: auto; }
.pfx-chart__grid { stroke: var(--color-line); }
.pfx-chart__area { fill: var(--color-chart-fill); }
.pfx-chart__line { fill: none; stroke: var(--color-link); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.pfx-chart__point { fill: var(--color-link); }
/* Statistik (Spec 024): offener Punkt = vorzeitig beendeter Durchlauf, Balken als <rect> im selben SVG, Achse als Zeile unter dem SVG */
.pfx-chart__point--open { fill: var(--color-surface); stroke: var(--color-link); stroke-width: 2.5; }
.pfx-chart__bar { fill: var(--color-link); stroke: var(--color-surface); stroke-width: 1; }  /* Rand trennt gestapelte Teile */
.pfx-chart__bar--very-good { fill: var(--color-link); }          /* Bewertung „sehr gut“ */
.pfx-chart__bar--good      { fill: var(--split-bs-selected); }   /* „gut“ */
.pfx-chart__bar--bad       { fill: var(--color-warning); }       /* „nicht gut“ */
.pfx-chart__axis { display: flex; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--font-size-xs); color: var(--color-text-muted); }

/* ---------- 9. Navigation & Overlays ---------- */
/* Kopfzeile: einheitlich für alle Screens, immer auf Grundfarbe */
.pfx-header { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--pad-screen) var(--space-2); background: var(--color-bg); color: var(--color-text); }
.pfx-header__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 40px; }
.pfx-header__center  { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.pfx-header__heading { margin: 0; font-size: var(--font-size-xl); font-weight: var(--font-weight-bold); }
.pfx-header__sub     { font-size: var(--font-size-sm); color: var(--color-text-muted); }
.pfx-header__spacer  { width: 40px; height: 40px; flex-shrink: 0; }
.pfx-header__bar .pfx-btn--icon { width: 40px; height: 40px; }  /* alle Icon-Buttons im Kopf gleich groß wie --sm (Zurück, Schließen, Profil, Studios, Neu) */
.pfx-header__bar .pfx-btn--icon svg { width: 20px; height: 20px; }
/* Status unter der Kopfzeile, zentriert (z. B. gepufferte Sätze) */
.pfx-header__status  { display: flex; justify-content: center; }
/* Logo links in der Kopfzeile der Hauptseite: 26 px hoch, Schrift in currentColor (Anthrazit), Mark in den Split-Farben */
.pfx-header__logo { display: block; height: 26px; width: auto; flex-shrink: 0; }
/* Aktionen rechts in der Kopfzeile (z. B. Hinweise + Profil), 8 px Abstand */
.pfx-header__actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; margin-left: auto; }  /* bleibt rechts, auch ohne Element links */
.pfx-header__titlerow { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.pfx-header__title   { margin: 0; font-size: var(--font-size-4xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tight); }
.pfx-header__meta    { font-size: var(--font-size-base); font-weight: var(--font-weight-semibold); color: var(--color-text-muted); }

.pfx-steps { width: 100%; display: flex; flex-direction: column; gap: var(--space-2); }
.pfx-steps__label { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); color: var(--color-text-muted); }
.pfx-steps__track { display: grid; grid-template-columns: repeat(var(--steps, 3), minmax(0, 1fr)); gap: var(--space-1); }
.pfx-steps__seg   { height: 6px; border-radius: var(--radius-seg); background: var(--color-line); }
.pfx-steps__seg--done { background: var(--color-text); }

/* Tagesleiste (Mini-Kalender): ein Segment pro Tag, die letzten 10 Tage; Anzahl über --days.
   Die Tage hängen nicht am Durchlauf, die Länge schon: mindestens 10 Tage, bei längerem Durchlauf bis zu dessen Start. */
.pfx-weekbar { width: 100%; display: grid; grid-template-columns: repeat(var(--days, 10), minmax(0, 1fr)); gap: var(--space-1); }
/* Segment: Fläche in der hellen Split-Farbe, 1 px Rahmen in der kräftigen; leer (Ruhetag) grau mit Feld-Rahmen */
.pfx-weekbar__seg { height: 10px; border-radius: var(--radius-pill); background: var(--color-line); border: 1px solid var(--color-border); }
.pfx-weekbar__seg--bs { background: var(--split-bs); border-color: var(--split-bs-selected); }
.pfx-weekbar__seg--bb { background: var(--split-bb); border-color: var(--split-bb-selected); }
.pfx-weekbar__seg--rt { background: var(--split-rt); border-color: var(--split-rt-selected); }
.pfx-weekbar__seg--lv { background: var(--split-lv); border-color: var(--split-lv-selected); }
.pfx-weekbar__seg--sd { background: var(--split-sd); border-color: var(--split-sd-selected); }
.pfx-weekbar__seg--ro { background: var(--split-ro); border-color: var(--split-ro-selected); }
/* Nachhol-Workout (Spec 040): Limestone, gehört zu keinem Split, Kürzel „NH“ */
.pfx-weekbar__seg--cu { background: var(--split-cu); border-color: var(--split-cu-selected); }
/* Heute: letztes Segment, Outline nach innen wie .pfx-day--today, Rahmen bleibt 1 px */
.pfx-weekbar__seg--today { outline: 2px solid var(--color-text); outline-offset: -2px; }
/* Mit Kürzel im Segment (B&S, B&B, R&T): 20 px hoch, 11 px Schrift. Die Leiste bleibt role="img" mit aria-label, die Kürzel sind nur visuell */
.pfx-weekbar--labeled .pfx-weekbar__seg {
  height: 20px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: var(--font-size-2xs); font-weight: var(--font-weight-bold); line-height: 1; letter-spacing: -0.01em; color: var(--color-text); white-space: nowrap;
}
/* Mit Wochentag (--dow): jedes Segment steckt in .pfx-weekbar__day, darunter der Wochentag (Mo bis So), heute fett. Die Wochentage sind nur visuell, die Leiste bleibt role="img" mit aria-label.
   Die Leiste scrollt waagerecht (tabindex="0" für die Tastatur): ein Tag ist so breit, dass 6,5 Tage sichtbar sind, der angeschnittene Tag rechts zeigt, dass es weitergeht.
   Auf der Startseite (direkt in .pfx-section) läuft sie bis an den Bildschirmrand, damit der Anschnitt dort endet */
.pfx-weekbar--dow {
  --dow-w: calc((100% - 6 * var(--space-1)) / 6.5);
  display: flex; align-items: flex-start; gap: var(--space-1); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: none;
}
.pfx-weekbar--dow::-webkit-scrollbar { display: none; }
.pfx-section > .pfx-weekbar--dow {
  --dow-w: calc((100% + var(--pad-screen) - 6 * var(--space-1)) / 6.5);
  width: auto; margin-inline: calc(-1 * var(--pad-screen)); padding-inline: var(--pad-screen); scroll-padding-inline: var(--pad-screen);
}
.pfx-weekbar__day { flex: 0 0 var(--dow-w); display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; scroll-snap-align: start; }
.pfx-weekbar__dow { text-align: center; font-size: var(--font-size-2xs); line-height: 13px; color: var(--color-text-muted); overflow: hidden; }
.pfx-weekbar__day--today .pfx-weekbar__dow { color: var(--color-text); font-weight: var(--font-weight-bold); }
/* Heute: so breit wie die anderen Tage, Segment 33 px hoch (28 + 5 px, außerhalb des 4er-Rasters, Wunsch 05.11.2026) mit 13 px Schrift, Wochentag 12 px.
   Die anderen Segmente (20 px) haben oben und unten 6,5 px Abstand,
   so steht heute mittig zu ihnen und alle Wochentage auf einer Linie.
   Heute rastet mittig ein, das Modul weekbar scrollt beim Laden dorthin (Spec 006, AK-4) */
.pfx-weekbar__day--today { scroll-snap-align: center; }
.pfx-weekbar--dow { --today-h: calc(var(--space-7) + 5px); }
.pfx-weekbar--labeled .pfx-weekbar__day .pfx-weekbar__seg { margin-block: calc((var(--today-h) - 20px) / 2); }
.pfx-weekbar--labeled .pfx-weekbar__day--today .pfx-weekbar__seg { height: var(--today-h); margin-block: 0; font-size: var(--font-size-sm); }
.pfx-weekbar__day--today .pfx-weekbar__dow { font-size: var(--font-size-xs); }
/* Ruhetag mit Datum im leeren Segment (9.11.): leiser als das Kürzel, Regular; heute fett und in Textfarbe */
.pfx-weekbar--labeled .pfx-weekbar__seg--date { font-weight: var(--font-weight-regular); color: var(--color-text-muted); }
.pfx-weekbar--labeled .pfx-weekbar__seg--date.pfx-weekbar__seg--today { font-weight: var(--font-weight-bold); color: var(--color-text); }

/* Zähler im Umschalter (24.10.2026, Übungswahl): offene Übungen als Pfirsich-Kreis, erledigt grüner Kreis mit Häkchen */
.pfx-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 var(--space-2);
  border-radius: var(--radius-pill); background: var(--color-salmon); color: var(--color-text);
  font-size: var(--font-size-xs); font-weight: var(--font-weight-bold);
}
.pfx-count--done { width: 22px; padding: 0; background: var(--color-success); }
.pfx-bottomnav {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  background: var(--color-surface); border-top: 1px solid var(--color-line); padding: 0;
  /* Fläche und Linie über die ganze Fensterbreite und bis zum unteren Fensterrand, die Einträge bleiben in der Screen-Breite.
     Schatten und Border-Image außerhalb der Box erzeugen keinen Scrollbereich */
  box-shadow: 0 0 0 100vmax var(--color-surface); clip-path: inset(0 -100vmax -100vmax);
  border-image: linear-gradient(var(--color-line) 0 0) 1 0 0 / 1px 0 0 / 0 100vmax;
}
.pfx-bottomnav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1);
  /* Abstände im Eintrag statt in der Leiste: die Markierung füllt die ganze Höhe bis zum unteren Rand und reicht außen bis an die Kante */
  padding: var(--space-2) var(--space-1) var(--pad-bottom-bar);
  min-height: 48px; font-size: var(--font-size-xs); font-weight: var(--font-weight-medium); color: var(--color-text-muted); text-decoration: none;
}
.pfx-bottomnav__item[aria-current="page"] { font-weight: var(--font-weight-bold); background: var(--color-text); color: var(--color-text-on-dark); }

/* ---------- 10. Screen-Layout ---------- */
/* Screen: Kopfzeile, Inhalt, optional Aktionsleiste oder Bottom-Nav */
/* Screen füllt das Fenster, damit Aktionsleiste und Bottom-Navigation auch bei wenig Inhalt unten stehen (Spec 005) */
.pfx-screen { display: flex; flex-direction: column; width: 100%; max-width: var(--screen-max); margin-inline: auto; min-height: 100vh; min-height: 100dvh; background: var(--color-bg); }
body.pfx-app > .pfx-screen { min-height: 100%; }
.pfx-screen__main { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-3) var(--pad-screen) var(--space-6); }

/* Login: Marke mittig im freien Raum, Anmeldung und Rechtliches unten. Auf .pfx-screen__main */
.pfx-login { justify-content: flex-end; padding-bottom: var(--pad-bottom-bar); }
.pfx-login__brand { margin-block: auto; display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; }
.pfx-login__title { margin: 0; }
.pfx-login__logo { display: block; width: auto; height: 40px; }
.pfx-login__legal { display: flex; justify-content: center; gap: var(--space-6); font-size: var(--font-size-sm); color: var(--color-text-muted); }
.pfx-login__legal a { display: inline-flex; align-items: center; min-height: 44px; }

/* Abschnitt: Kopf + Inhalt mit 8 px Abstand. Mehrere Abschnitte stapeln sich mit 16 px (Gap von __main bzw. .pfx-stack) */
.pfx-section { width: 100%; display: flex; flex-direction: column; gap: var(--space-2); }
.pfx-stack   { display: flex; flex-direction: column; gap: var(--space-4); }
/* Zeile: Felder nebeneinander, gleich breit (z. B. Wdh. von / bis, Gewicht / Wiederholungen) */
.pfx-row     { display: flex; align-items: flex-start; gap: var(--space-3); }
.pfx-row > .pfx-field { flex: 1 1 0; min-width: 0; }
/* Buttons nebeneinander, teilen sich die Breite nach Inhalt (z. B. „Verwerfen“ / „Speichern & Beenden“ im Sheet) */
.pfx-btn-row { display: flex; gap: var(--space-3); }
.pfx-btn-row--divided { padding-top: var(--space-4); border-top: 1px solid var(--color-line); }
.pfx-btn-row > .pfx-btn { flex: 1 1 auto; min-width: 0; }
/* Textlinks in Abschnitten/Stapeln linksbündig statt über die volle Breite */
.pfx-section > .pfx-btn--text, .pfx-stack > .pfx-btn--text { align-self: flex-start; padding: 0; }
/* Textlink im Abschnittskopf: ohne Innenabstand, bündig rechts und vertikal mittig in der Zeile.
   Höhe nach Inhalt, die Trefferfläche wird per ::before auf 44 px erweitert, ohne die Zeile zu vergrößern */
.pfx-section-head > .pfx-btn--text { padding: 0; height: auto; align-self: center; position: relative; }
.pfx-section-head > .pfx-btn--text::before { content: ""; position: absolute; inset: -12px -8px; }
/* Kleiner Button im Abschnittskopf (Startseite: Zahnrad bei „Muskelbereiche“, Icon bei „Durchlauf 14“): Überschrift und Button vertikal mittig statt an der Grundlinie */
.pfx-section-head:has(> .pfx-btn--sm) { align-items: center; }
.pfx-section-head > .pfx-btn--sm { flex-shrink: 0; }
/* Mehrere kleine Buttons rechts im Abschnittskopf (Startseite: „Durchlauf 14“ mit Abschließen und Zahnrad) */
.pfx-section-head:has(> .pfx-section-head__actions) { align-items: center; }
.pfx-section-head__actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* Abschnittskopf: Überschrift links, Zusatz rechts auf gleicher Grundlinie */
.pfx-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.pfx-section-head__title { margin: 0; font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }
.pfx-section-head__meta  { font-size: var(--font-size-sm); color: var(--color-text-muted); text-align: right; }

/* Aktionsleiste unten: fixiert, weiß, Linie oben */
.pfx-actionbar {
  position: sticky; bottom: 0; z-index: var(--z-sticky); width: 100%; display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-3) var(--pad-screen) var(--pad-bottom-bar);
  background: var(--color-surface); border-top: 1px solid var(--color-line);
}
.pfx-actionbar__row { display: flex; align-items: center; gap: var(--space-3); }

/* Overlays: Scrim deckt den ganzen Viewport ab (position: fixed); das Sheet sitzt unten im Scrim.
   --keyboard-inset (Script, Höhe der Bildschirmtastatur) hebt beides über die Tastatur */
.pfx-scrim { position: fixed; inset: 0 0 var(--keyboard-inset, 0px); z-index: var(--z-overlay); display: flex; align-items: center; justify-content: center; padding: var(--space-6); background: var(--color-scrim-dialog); }
.pfx-scrim--sheet { display: block; padding: 0; }  /* gleicher transparenter Scrim wie beim Dialog */
.pfx-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: var(--screen-max); margin-inline: auto; background: var(--color-surface);
  border-radius: var(--radius) var(--radius) 0 0; padding: var(--space-3) var(--space-5) max(var(--space-6), env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: var(--space-3);
  max-height: 100%; overflow-y: auto; overscroll-behavior: contain;  /* bei offener Tastatur bleibt wenig Höhe */
}
/* Einblenden: Scrim blendet ein, Sheet gleitet von unten herein (startet bei jedem Entfernen von [hidden]) */
.pfx-scrim { animation: pfx-fade-in var(--duration-base) var(--ease-standard); }
.pfx-sheet { animation: pfx-sheet-in var(--duration-slow) var(--ease-out); }
@keyframes pfx-fade-in  { from { opacity: 0; } }
@keyframes pfx-sheet-in { from { transform: translateY(100%); } }
/* Ausblenden: Script setzt data-closing, nach der Animation [hidden] */
.pfx-scrim[data-closing] { animation: pfx-fade-out var(--duration-exit) var(--ease-standard) forwards; }
.pfx-scrim[data-closing] .pfx-sheet { animation: pfx-sheet-out var(--duration-exit) var(--ease-in) forwards; }
@keyframes pfx-fade-out  { to { opacity: 0; } }
@keyframes pfx-sheet-out { to { transform: translateY(100%); } }
/* Liste im Sheet: Sheet ist schon weiß, daher ohne eigenen Seitenabstand, nutzt die volle Inhaltsbreite */
.pfx-sheet > .pfx-list { padding-left: 0; padding-right: 0; }
.pfx-sheet__handle { align-self: center; width: 40px; height: 5px; border-radius: var(--radius-seg); background: var(--color-line); }
.pfx-sheet__title  { margin: 0; font-size: var(--font-size-3xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tight); }
.pfx-sheet__text   { margin: 0; font-size: var(--font-size-base); color: var(--color-text); }
.pfx-dialog { width: 100%; max-width: calc(var(--screen-max) - 2 * var(--space-6)); background: var(--color-surface); border-radius: var(--radius); padding: var(--space-6) var(--space-5) var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.pfx-dialog__title { margin: 0; font-size: var(--font-size-3xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--letter-spacing-tight); }
.pfx-dialog__text  { margin: 0; font-size: var(--font-size-base); color: var(--color-text); }
.pfx-dialog .pfx-btn--text-danger { font-size: var(--font-size-lg); }

@media (prefers-reduced-motion: reduce) {
  .pfx-btn, .pfx-switch, .pfx-progress__fill { transition: none; }
  .pfx-scrim, .pfx-sheet, .pfx-scrim[data-closing], .pfx-scrim[data-closing] .pfx-sheet { animation: none; }
  .pfx-btn[aria-busy="true"]::after, .pfx-spinner { animation-duration: 2s; }
  .pfx-banner--overlay, .pfx-banner[data-leaving], .pfx-banner[data-entering] { animation: none; }
  .pfx-progress__fill--striped, .pfx-list__item[data-rest-state]::before, .pfx-list__item--attached[data-entering], .pfx-list__item--attached[data-leaving], .pfx-list__item[data-collapsible] { animation: none; }
  .pfx-btn__chevron { transition: none; }
  .pfx-btn:active:not(:disabled) { transform: none; }
}
