/* Komponenten-Styles (Karten, Buttons, Formulare, Tabellen, Charts, Modals) */

  /* filter bar */
  .filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--surface-1);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
  }

  .filter-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

  .filter-label { font-size: 11.5px; color: var(--text-muted); margin-right: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }

  /* Freier Von/Bis-Zeitraum in der Filterleiste, ergänzt die Zeitraum-Chips. */
  .range-custom-group .range-date-input { width: 132px; padding: 5px 8px; font-size: 12.5px; }

  .range-sep { color: var(--text-muted); font-size: 12px; }

  .chip {
    border: none;
    background: var(--page);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s ease, color 0.12s ease;
  }

  .chip:hover { background: var(--grid); }

  .chip.active { background: var(--text-primary); color: var(--surface-1); }

  .chip.sport-chip.active[data-sport="Rad"] { background: var(--c-rad); color:#fff; }

  .chip.sport-chip.active[data-sport="Laufen"] { background: var(--c-laufen); color:#fff; }

  .chip.sport-chip.active[data-sport="Schwimmen"] { background: var(--c-schwimmen); color:#fff; }

  .chip.sport-chip.active[data-sport="Sonstiges"] { background: var(--c-sonstiges); color:#fff; }

  .update-group { display: flex; align-items: center; gap: 8px; margin-left: auto; }

  .reset-link {
    border: none; background: none; padding: 0;
    font-size: 11.5px; color: var(--text-muted);
    text-decoration: underline; text-underline-offset: 2px;
    cursor: pointer; font-family: inherit;
  }

  .reset-link:hover { color: var(--text-secondary); }

  .update-btn {
    border: none;
    background: var(--accent-fill);
    color: #fff;
    font-size: 12.5px;
    font-weight: 650;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
  }

  .update-btn:hover { filter: brightness(1.08); }

  .update-btn:disabled { opacity: 0.6; cursor: default; }

  .update-btn .spin {
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    display: none;
  }

  .update-btn.loading .spin { display: inline-block; }

  .update-btn.loading .btn-icon { display: none; }

  .update-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: -14px;
    margin-bottom: 18px;
    text-align: right;
  }

  .update-status.err { color: var(--c-crit-text); }

  /* Aktualisieren-Dropdown-Menü (Ordner-Scan vs. Drag & Drop) */
  .update-menu-wrap { position: relative; }

  .update-menu-trigger .menu-caret { font-size: 9px; margin-left: 1px; opacity: 0.85; }

  .update-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--surface-1); border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    padding: 6px; min-width: 232px;
    display: flex; flex-direction: column; gap: 2px;
    visibility: hidden; opacity: 0; transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
    z-index: 60;
  }

  .update-menu.open { visibility: visible; opacity: 1; transform: translateY(0); transition: opacity 0.15s ease, transform 0.15s ease; }

  .update-menu-item {
    border: none; background: none; text-align: left;
    font-family: inherit; font-size: 13px; font-weight: 570; color: var(--text-primary);
    padding: 10px 12px; border-radius: 9px; cursor: pointer;
    display: flex; align-items: center; gap: 9px; width: 100%;
  }

  .update-menu-item:hover { background: var(--page); }

  .update-menu-item .menu-item-icon { font-size: 14px; flex: none; }

  /* Stand-Anzeige oben im Aktualisieren-Menü (früher immer sichtbar im
     Topnav, jetzt kompakt im Dropdown versteckt, siehe update-group). */
  .update-menu-meta { font-size: 11px; color: var(--text-muted); padding: 6px 12px 8px; }

  .update-menu-divider { height: 1px; background: var(--grid); margin: 4px 6px; }

  .update-menu-item-muted { color: var(--text-muted); font-weight: 550; }
  .update-menu-item-muted:hover { color: var(--text-primary); }

  /* Info-Symbol (ⓘ) an Karten-Überschriften: versteckt längere Erklär-/
     Methodik-Texte hinter einem einheitlichen Popover, statt sie fest unter
     dem Titel stehen zu haben. Kurze Bedienhinweise bleiben direkt sichtbar. */
  .info-wrap { position: relative; display: inline-flex; vertical-align: middle; margin-left: 2px; }

  .info-btn {
    border: none; background: none; cursor: pointer; padding: 0;
    width: 18px; height: 18px; border-radius: 50%;
    font-size: 13px; line-height: 1; color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    transition: color 0.12s ease, background 0.12s ease;
  }

  .info-btn:hover, .info-btn.open { color: var(--text-primary); background: var(--page); }

  .info-popover {
    position: absolute; top: calc(100% + 8px); left: 0;
    background: var(--surface-1); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    padding: 12px 14px; width: 280px; max-width: 70vw;
    font-size: 12px; font-weight: 500; line-height: 1.5; color: var(--text-secondary);
    text-align: left; white-space: normal;
    visibility: hidden; opacity: 0; transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
    z-index: 60;
  }

  .info-popover b { color: var(--text-primary); }

  .info-popover.open { visibility: visible; opacity: 1; transform: translateY(0); transition: opacity 0.15s ease, transform 0.15s ease; }

  .workouts-columns-popover { width: 200px; }
  .workouts-columns-title { margin: 0 0 8px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
  .workouts-col-toggle { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; font-weight: 500; color: var(--text-primary); cursor: pointer; }
  .workouts-col-toggle input { margin: 0; cursor: pointer; }

  /* Terminwünsche im ⚙-Menü der Trainingsplan-Kachel (js/components/training-plan.js) */
  .trainingplan-settings-popover { width: 320px; }
  .card .card-sub.plan-wish-sub { margin: 0 0 8px; }
  .plan-wish-title { margin-top: 16px; }
  .plan-wish-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; margin-bottom: 4px; }
  .plan-wish-form .update-btn { grid-column: 1 / -1; justify-content: center; }
  .plan-wish-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
  .plan-wish-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 10px; background: var(--page); border-radius: 10px; }
  .plan-wish-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .plan-wish-what { font-size: 12px; font-weight: 600; color: var(--text-primary); }
  .plan-wish-note { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .plan-wish-state { font-size: 10.5px; font-weight: 650; padding: 2px 7px; border-radius: 6px; background: var(--grid); color: var(--text-secondary); }
  .plan-wish-state.planned { background: color-mix(in srgb, var(--c-good) 18%, transparent); color: var(--c-good-text); }
  .plan-wish-empty { margin: 0; font-size: 12px; color: var(--text-muted); }

  /* Vollbild-Overlays (Dialoge, Onboarding, Coach-Sperre): Abstand zum Rand,
     aber nie unter Notch/Home-Indikator (--gap wird auf dem Handy kleiner). */
  .modal-overlay, .dnd-overlay, .onb-overlay, .coach-gate {
    --gap: 24px;
    padding: max(var(--gap), var(--safe-top)) max(var(--gap), var(--safe-right)) max(var(--gap), var(--safe-bottom)) max(var(--gap), var(--safe-left));
  }

  /* Drag & Drop Upload-Overlay */
  .dnd-overlay {
    position: fixed; inset: 0;
    background: rgba(11,11,11,0.4);
    display: flex; visibility: hidden; opacity: 0;
    align-items: center; justify-content: center;
    z-index: 100;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
  }

  .dnd-overlay.open { visibility: visible; opacity: 1; transition: opacity 0.22s ease, visibility 0s linear 0s; }

  .dnd-card {
    background: var(--surface-1); border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto;
    padding: 30px 32px; position: relative;
    transform: translateY(10px) scale(0.97);
    transition: transform 0.28s cubic-bezier(.16,1,.3,1);
  }

  .dnd-overlay.open .dnd-card { transform: translateY(0) scale(1); }

  .dnd-close {
    position: absolute; top: 18px; right: 18px;
    border: none; background: var(--page);
    width: 30px; height: 30px; border-radius: 50%;
    font-size: 14px; color: var(--text-secondary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
  }

  .dnd-close:hover { background: var(--grid); }

  .dnd-title { font-size: 17px; font-weight: 680; letter-spacing: -0.01em; margin: 0 30px 6px 0; }

  .dnd-sub-title { font-size: 12.5px; color: var(--text-secondary); margin: 0 0 20px; line-height: 1.5; }

  .dnd-zone {
    border: 2px dashed var(--border); border-radius: 16px;
    padding: 34px 20px; text-align: center; cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  .dnd-zone:hover { background: var(--page); }

  .dnd-zone.drag-over { background: var(--accent-wash); border-color: var(--accent); }

  .dnd-zone-icon { font-size: 26px; margin-bottom: 10px; }

  .dnd-zone-text { font-size: 13.5px; font-weight: 620; color: var(--text-primary); }

  .dnd-zone-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

  .dnd-filelist { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; max-height: 120px; overflow-y: auto; }

  .dnd-file-row { font-size: 11.5px; color: var(--text-secondary); display: flex; justify-content: space-between; gap: 8px; }

  .dnd-status { font-size: 12.5px; color: var(--text-secondary); margin-top: 16px; text-align: center; min-height: 16px; }

  .dnd-status.err { color: var(--c-crit-text); }

  /* Kalender: Monatsansicht, Zeilen = Wochen, Spalten = Wochentage + Zusammenfassung */
  .cal-monthbar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px 16px; margin: 4px 0 16px;
  }

  .cal-month-title { font-size: 18px; font-weight: 680; letter-spacing: -0.01em; }

  .cal-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

  .cal-view-toggle {
    display: flex; align-items: center; background: var(--page);
    border: 1px solid var(--border); border-radius: 10px; padding: 2px; gap: 2px;
  }

  .cal-view-btn {
    font-family: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary);
    background: none; border: none; border-radius: 8px; padding: 6px 11px; cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .cal-view-btn:hover { color: var(--text-primary); }

  .cal-view-btn.active { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

  .cal-select {
    font-family: inherit; font-size: 12.5px; font-weight: 560; color: var(--text-primary);
    background: var(--page); border: 1px solid var(--border); border-radius: 10px;
    padding: 7px 10px; cursor: pointer;
  }

  .cal-nav-btn {
    width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border);
    background: var(--surface-1); color: var(--text-primary); font-size: 15px;
    font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
  }

  .cal-nav-btn:hover { background: var(--page); }

  .cal-nav-btn:active { transform: scale(0.92); }

  .cal-today-btn {
    font-family: inherit; font-size: 12.5px; font-weight: 620; color: var(--text-primary);
    background: var(--page); border: 1px solid var(--border); border-radius: 10px;
    padding: 7px 12px; cursor: pointer; transition: background 0.15s ease;
  }

  .cal-today-btn:hover { background: var(--grid); }

  /* Immer dieselbe Spalten-Regel auf allen Bildschirmgrößen (kein Sprung an
     einem Breakpoint): jede Tagesspalte ist mind. 96px breit, wächst aber
     gleichmäßig (1fr) wenn mehr Platz da ist - dadurch sind alle 7 Spalten
     IMMER gleich breit (keine krumme Verteilung), nichts wird abgeschnitten,
     und reicht der Platz nicht, scrollt .cal-grid-scroll (s.u.) statt Inhalte
     zu quetschen. Funktioniert so identisch von Handy bis Desktop. */
  .cal-grid-month {
    display: grid;
    grid-template-columns: repeat(7, minmax(96px, 1fr)) 148px;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
  }

  .cal-grid-scroll { overflow-x: auto; overscroll-behavior-x: contain; }

  .cal-dow-header {
    font-size: 11px; font-weight: 650; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.03em;
    padding: 8px 10px; background: var(--page);
    border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  }

  .cal-cell {
    min-height: 84px; padding: 8px 9px;
    border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 6px;
  }

  .cal-cell.muted { background: var(--page); }

  .cal-cell.muted .cal-daynum { color: var(--text-muted); opacity: 0.75; }

  .cal-cell.today { background: var(--accent-wash); }

  .cal-daynum { font-size: 12.5px; font-weight: 620; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

  .cal-cell.today .cal-daynum { color: color-mix(in srgb, var(--accent) 75%, var(--text-primary)); font-weight: 750; }

  .cal-dots { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }

  .cal-dot { width: 7px; height: 7px; border-radius: 50%; cursor: pointer; flex: none; }

  .cal-dot:hover { transform: scale(1.35); }

  .cal-day-min { font-size: 10px; color: var(--text-muted); margin-top: auto; }

  .cal-summary-cell {
    padding: 10px 12px; background: var(--surface-1);
    border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; justify-content: center; gap: 3px;
  }

  .cal-summary-time { font-size: 15px; font-weight: 700; line-height: 1.15; }

  .cal-summary-load { font-size: 11px; color: var(--text-secondary); }

  .cal-summary-load b { color: var(--text-primary); font-weight: 650; }

  .cal-summary-sport { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-secondary); }

  .cal-summary-sport .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }

  .cal-summary-empty { font-size: 10.5px; color: var(--text-muted); }

  /* Kalender: Wochenansicht */
  .cal-grid-week { display: flex; flex-direction: column; gap: 14px; }

  .cal-week-days {
    display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr));
    border-top: 1px solid var(--border); border-left: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
  }

  .cal-week-day-col { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; min-height: 150px; }

  .cal-week-day-col.today { background: var(--accent-wash); }

  .cal-week-day-head {
    font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 6px; background: var(--page); border: none; border-bottom: 1px solid var(--border);
    cursor: pointer; width: 100%;
  }

  .cal-week-day-col.today .cal-week-day-head { background: transparent; }

  .cal-week-day-name { font-size: 10.5px; font-weight: 650; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

  .cal-week-day-num { font-size: 15px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }

  .cal-week-day-list { display: flex; flex-direction: column; gap: 5px; padding: 8px 7px; flex: 1; }

  .cal-week-item {
    display: flex; flex-direction: column; gap: 2px; padding: 6px 7px;
    background: var(--page); border-radius: 8px; cursor: pointer; transition: background 0.12s ease;
  }

  .cal-week-item:hover { background: var(--grid); }

  .cal-week-item .sport-dot { width: 7px; height: 7px; }

  .cal-week-item-sport { font-size: 11px; font-weight: 620; }

  .cal-week-item-dur { font-size: 10px; color: var(--text-muted); }

  .cal-week-empty { font-size: 10.5px; color: var(--text-muted); text-align: center; padding: 6px 0; }

  .cal-week-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }

  .cal-week-summary .cal-summary-time { font-size: 16px; }

  /* Kalender: Tagesansicht */
  .cal-grid-day { display: flex; flex-direction: column; gap: 16px; }

  .cal-day-summary {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px;
  }

  .cal-day-summary-empty { color: var(--text-muted); font-size: 13px; justify-content: flex-start; }

  .cal-day-summary-time { font-size: 20px; font-weight: 720; }

  .cal-day-summary-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 12px; color: var(--text-secondary); }

  .cal-day-summary-meta b { color: var(--text-primary); font-weight: 650; }

  .cal-day-list { display: flex; flex-direction: column; gap: 8px; }

  .cal-day-item { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

  .cal-day-item-head {
    font-family: inherit; width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: var(--surface-1); border: none; cursor: pointer;
    text-align: left; transition: background 0.12s ease;
  }

  .cal-day-item-head:hover { background: var(--page); }

  .cal-day-item-sport { font-size: 13.5px; font-weight: 650; flex: none; }

  .cal-day-item-stat { font-size: 12px; color: var(--text-secondary); flex: 1; text-align: right; min-width: 60px; }

  .cal-day-item-caret { font-size: 16px; color: var(--text-muted); transition: transform 0.15s ease; flex: none; }

  .cal-day-item.open .cal-day-item-caret { transform: rotate(90deg); }

  .cal-day-item-body { display: none; padding: 18px 16px; background: var(--page); }

  .cal-day-item.open .cal-day-item-body { display: block; }

  .cal-day-item-body .modal-charts { margin-top: 16px; }

  /* Rekorde */
  /* auto-fit statt fester 2 Spalten: 2 bis 4 Rekord-Gruppen nebeneinander, je
     nach Breite. min(...,100%) verhindert Überlauf in schmalen Containern. */
  .records-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 18px; }

  /* Micro-Animation: Karten fliegen beim Rendern gestaffelt (animation-delay
     per Karte, siehe renderRecords() in js/components/records.js) sanft ein,
     statt abrupt zu erscheinen - macht den Tab hochwertiger/lebendiger. */
  .record-card {
    background: var(--page); border-radius: 16px; padding: 18px 20px;
    animation: fadeSlideUp 0.45s cubic-bezier(.16,1,.3,1) both;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .record-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.10); }

  .record-card h3 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 640; margin: 0 0 12px; }

  .record-card h3 .dot {
    width: 10px; height: 10px; border-radius: 3px;
    transition: transform 0.2s ease;
  }

  .record-card:hover h3 .dot { transform: scale(1.25) rotate(8deg); }

  .record-row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: padding-left 0.15s ease, background 0.15s ease;
    border-radius: 6px;
  }

  .record-row:last-child { border-bottom: none; }

  .record-row:hover { padding-left: 6px; background: var(--surface-1); }

  .record-row:hover .record-label { color: var(--text-primary); }

  .record-row:hover .record-value { transform: scale(1.05); }

  .record-label { font-size: 12.5px; color: var(--text-secondary); transition: color 0.15s ease; }

  .record-value-wrap { text-align: right; flex: none; }

  .record-value {
    font-size: 14.5px; font-weight: 640; font-variant-numeric: tabular-nums;
    display: inline-block; transition: transform 0.15s ease;
  }

  .record-date { font-size: 10.5px; color: var(--text-muted); }

  .record-empty { font-size: 12px; color: var(--text-muted); padding: 6px 0; }

  /* Kurzes Aufleuchten der ganzen Karte, wenn man z.B. per Klick auf den
     Erfolge-Toast direkt zur Karte springt (siehe scrollToAndPulse() in
     js/components/achievements.js). */
  @keyframes cardPulseHighlight {
    0% { box-shadow: 0 0 0 0 var(--accent, var(--text-primary)), var(--card-shadow); }
    60% { box-shadow: 0 0 0 4px var(--accent, var(--text-primary)), var(--card-shadow); }
    100% { box-shadow: var(--card-shadow); }
  }

  .card-pulse-highlight { animation: cardPulseHighlight 1.1s ease; }

  /* Globale Einstellungen (⚙️ in der Topnav) - eigene volle Seite
     (#view-settings, wie die übrigen Tabs), keine eigenen Tab-Buttons in
     der Topnav. Ollama-Verbindung und Athletenprofil (vormals fest im
     Coach-Tab bzw. als Modal-Fenster) sind hier in mehrere schlanke
     Kacheln aufgeteilt statt einem langen Formular. */
  .settings-page-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

  .settings-back-btn { font-size: 12.5px; }

  .settings-page-head h2 { margin: 2px 0 0; }

  /* Coach */
  .coach-subheading { font-size: 14.5px; font-weight: 640; margin: 22px 0 12px; }

  /* Coach-Zusammenfassung ganz oben in der Erholungs-Check-Karte: kompakte
     Kennzahlen-Chips statt der großen .stat-tile-Kacheln der Übersicht -
     bewusst kleiner/dichter, da hier nur ein kurzer Kontext-Überblick nötig
     ist (siehe renderCoachSummary() in js/components/coach.js). */
  .coach-summary {
    display: flex; flex-wrap: wrap; gap: 10px;
  }

  .coach-summary-chip {
    flex: 1; min-width: 130px;
    background: var(--page); border-radius: 12px; padding: 10px 14px;
  }

  .coach-summary-chip .csc-label {
    font-size: 10.5px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 3px;
  }

  .coach-summary-chip .csc-value { font-size: 14.5px; font-weight: 650; }

  .coach-summary-chip .csc-sub { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }

  .coach-summary-empty { font-size: 12.5px; color: var(--text-muted); }

  .coach-summary-divider { height: 1px; background: var(--border); margin: 18px 0 14px; }

  /* Wettkampf-Countdown (renderRaceCountdown, js/components/race-countdown.js):
     dieselben Kacheln wie die Coach-Zusammenfassung, im Raster statt in einer
     Zeile, damit die Wochenumfang-Kachel mit Balken genug Breite hat. */
  .race-countdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
  .race-countdown .csc-sub { line-height: 1.45; }
  .rc-hero { font-size: 48px; font-weight: 650; line-height: 1.05; letter-spacing: -0.02em; color: var(--text-primary); }
  .rc-meter { display: block; width: 100%; height: 10px; border-radius: 5px; margin: 8px 0 6px; overflow: hidden; }
  .rc-meter-track { fill: var(--accent-wash); }
  .rc-meter-done { fill: var(--accent); }
  .rc-meter-planned { fill: var(--accent); opacity: 0.5; }
  .rc-meter-gap { stroke: var(--page); stroke-width: 2px; }
  .rc-meter-target { stroke: var(--text-primary); stroke-width: 2px; }
  .legend.rc-legend { gap: 2px 12px; margin: 0 0 4px; font-size: 11px; }
  .rc-swatch-done { background: var(--accent); }
  .rc-swatch-planned { background: var(--accent); opacity: 0.5; }
  .rc-swatch-target { background: var(--text-primary); }
  .rc-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; background: var(--page); border-radius: 12px; padding: 12px 14px; }
  .rc-hint p { margin: 0; flex: 1 1 260px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }

  /* Banner der automatischen Risiko-Kontrolle (ACWR/TSB/Monotonie), siehe
     js/components/risk-adjust.js - bewusst wie eine Warn-Kachel gestaltet
     (Farbe an .plan-intensity-hart/.stat-tile.at-risk angelehnt), damit sie
     zwischen den neutralen Zusammenfassungs-Chips sofort auffällt. */
  /* [hidden] hat dieselbe CSS-Spezifität wie .risk-adjust-banner, aber eine
     eigene Regel schlägt die Browser-Standardregel "[hidden]{display:none}"
     trotzdem IMMER (Autor- vor User-Agent-Stylesheet) - ohne diese Zeile
     blieb der Banner als leere rote Box sichtbar, auch mit hidden-Attribut. */
  .risk-adjust-banner[hidden] { display: none; }

  .risk-adjust-banner {
    display: flex; gap: 12px; align-items: flex-start;
    background: color-mix(in srgb, var(--c-crit) 10%, var(--page));
    border: 1px solid color-mix(in srgb, var(--c-crit) 35%, transparent);
    border-radius: 12px; padding: 12px 14px; margin-top: 10px;
  }

  .risk-adjust-banner .rab-icon { font-size: 18px; line-height: 1.3; }

  .risk-adjust-banner .rab-body { flex: 1; min-width: 0; }

  .risk-adjust-banner .rab-title { font-weight: 650; font-size: 13.5px; color: var(--c-crit-text); margin-bottom: 2px; }

  .risk-adjust-banner .rab-reasons { font-size: 12px; color: var(--text-secondary); }

  .risk-adjust-banner .rab-loading { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }

  .risk-adjust-banner .rab-suggestion { font-size: 12.5px; margin: 6px 0 0; }

  .risk-adjust-banner .rab-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

  /* Empfehlungen Heute / Diese Woche / Nächste Woche (renderOutlook, coach.js) */
  .outlook-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
  .outlook-item { background: var(--page); border-radius: 12px; padding: 12px 14px; }
  .outlook-title { margin: 0 0 6px; font-size: 13.5px; font-weight: 650; color: var(--text-primary); }
  .outlook-text { margin: 0 0 6px; font-size: 13px; line-height: 1.5; color: var(--text-primary); }
  .outlook-reason { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
  .outlook-reason b { font-weight: 650; color: var(--text-primary); }
  .outlook-facts-title { margin: 10px 0 4px; }
  .outlook-facts { margin: 0; padding-left: 16px; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); }

  /* Ergebnis der Regelprüfung nach einer KI-Planung (renderTrainingPlanCard) */
  .plan-check-notes { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--accent-wash); font-size: 12.5px; color: var(--text-secondary); }
  .plan-check-notes p { margin: 0 0 2px; font-weight: 650; color: var(--text-primary); }
  .plan-check-notes ul { margin: 0 0 6px; padding-left: 18px; }
  .plan-check-notes ul:last-child { margin-bottom: 0; }

  .coach-recovery-heading { font-size: 15px; font-weight: 640; margin: 0; display: flex; align-items: center; gap: 6px; }

  /* "Deine Ziele"-Kopfzeile + "+ Neues Ziel/Event"-Umschalter: das
     Anlage-Formular ist per default versteckt ([hidden] im Markup) und wird
     nur bei Klick eingeblendet, statt dauerhaft eine ganze Kachel zu belegen. */
  .goals-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; padding-right: 40px; }

  .goals-card-head h2 { margin: 0; }

  .goals-card-head-actions { display: flex; align-items: center; gap: 8px; }

  .goals-collapse-btn { min-width: 32px; padding: 4px 8px; }

  /* Eingeklappter Zustand der Ziele-Karte: nur ein kompakter Block mit
     Hauptevent-Name, Countdown und Readiness statt der vollen Zielliste. */
  .goals-mini-summary { padding: 8px 2px 2px; }

  .goals-mini-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

  .goals-mini-sub { color: var(--muted, #888); font-size: 13px; }

  .coach-header { margin-bottom: 4px; }

  .coach-header-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

  .coach-header-top h2 { font-size: 20px; font-weight: 660; margin: 0; }

  .coach-header-actions { display: flex; align-items: center; gap: 8px; }

  .onb-start-btn { margin-top: 0; }

  .onb-start-hint { margin-top: 4px; }

  .coach-settings-menu { min-width: 280px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

  .coach-settings-title { font-size: 12.5px; font-weight: 650; margin: 0; color: var(--text-primary); }

  .coach-settings-row { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }

  .coach-settings-row[hidden] { display: none; }

  .coach-settings-row:has(#coach-test-btn) { flex-direction: row; align-items: center; gap: 10px; }

  .coach-settings-row label { font-size: 11.5px; color: var(--text-secondary); font-weight: 560; }

  .coach-setup-hint { margin-top: 0; font-size: 11px; line-height: 1.5; }

  .coach-setup-hint code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
    background: var(--page); border-radius: 4px; padding: 1px 5px;
  }

  .coach-input {
    font-family: inherit; font-size: 12.5px; color: var(--text-primary);
    background: var(--surface-1); border: 1px solid var(--border); border-radius: 9px;
    padding: 7px 10px; min-width: 0; width: 100%; box-sizing: border-box;
  }

  .coach-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

  .coach-test-status { font-size: 12px; color: var(--text-secondary); }

  .coach-test-status.ok { color: var(--c-good-text); }

  .coach-test-status.warn { color: var(--c-warn-text); }

  .coach-test-status.err { color: var(--c-crit-text); }

  .goal-form {
    /* minmax(0, 1fr) statt 1fr: sonst zwingt z.B. das native Datumsfeld oder
       das <select> seine Spalte auf mehr als 1/3 Breite (Inhalts-Mindestbreite
       gewinnt gegen die Bruchteils-Aufteilung) und die Zeilen darunter/darüber
       laufen sichtbar auseinander. */
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px;
    margin-top: 8px; align-items: end;
  }

  .goal-form-row { display: flex; flex-direction: column; gap: 5px; }

  .goal-form-row label { font-size: 11.5px; color: var(--text-secondary); font-weight: 560; }

  .goal-form-row-wide { grid-column: span 3; }

  .goal-subdisciplines {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 14px; border-radius: 12px; background: var(--page);
  }

  .goal-subdisciplines > label { font-size: 11.5px; color: var(--text-secondary); font-weight: 560; }

  .goal-subdiscipline-row {
    display: grid; grid-template-columns: 108px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center;
  }

  .goal-subdiscipline-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--text-primary);
  }

  .goal-submit-btn { grid-column: span 3; justify-self: start; }

  .goal-card {
    background: var(--page); border-radius: 16px; padding: 16px 20px; margin-bottom: 14px;
  }

  .goal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

  .goal-head .sport-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 8px; }

  .goal-name { font-size: 15px; font-weight: 650; }

  .goal-delete {
    border: none; background: none; color: var(--text-muted); font-size: 13px;
    cursor: pointer; padding: 4px 6px; border-radius: 6px; line-height: 1;
  }

  .goal-expand-btn { border: none; background: none; color: var(--text-secondary); border-radius: 8px; cursor: pointer; font-family: inherit; }

  .goal-delete:hover { background: var(--grid); color: var(--text-primary); }

  .goal-meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

  .goal-subdiscipline-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

  .goal-subdiscipline-tag {
    font-size: 11px; font-weight: 560; color: var(--text-secondary);
    background: var(--surface-1); border: 1px solid var(--border);
    border-radius: 8px; padding: 3px 9px;
  }

  .goal-notes { font-size: 12px; color: var(--text-secondary); margin-top: 6px; font-style: italic; }

  .goal-readiness { margin-top: 12px; padding: 12px 14px; background: var(--page); border-radius: 12px; }

  .goal-readiness-head { display: flex; align-items: baseline; gap: 10px; }

  .goal-readiness-score { font-size: 22px; font-weight: 750; line-height: 1; }

  .goal-readiness-max { font-size: 12px; font-weight: 600; color: var(--text-muted); }

  .goal-readiness-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }

  .goal-readiness-factors { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }

  .goal-readiness-factors li { font-size: 11.5px; color: var(--text-secondary); }

  .goal-readiness-factors b { color: var(--text-primary); font-weight: 620; }

  .goal-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

  /* Prioritäts-Badge (A/B/C) + "Erweiterte Einstellungen" je Ziel
     (buildGoalAdvancedHtml, js/components/coach.js) */
  .goal-priority-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 5px; font-size: 11px; font-weight: 700;
    background: var(--page); color: var(--text-secondary); margin-left: 2px;
  }

  .goal-priority-A { background: var(--c-crit); color: #fff; }
  .goal-priority-B { background: color-mix(in srgb, var(--c-warn) 24%, var(--surface-1)); color: var(--c-warn-text); }
  .goal-priority-C { background: var(--border); color: var(--text-secondary); }

  .goal-adv { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }

  .goal-adv-body { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }

  .goal-adv-body.collapsed { display: none; }

  .goal-adv-elevation-row { display: flex; align-items: center; gap: 8px; }

  .goal-adv-elevation-row .goal-adv-elevation { max-width: 120px; }

  /* "Rennplan" je Ziel (js/components/race-plan.js) - aufklappbar wie .goal-adv */
  .race-plan { gap: 18px; max-width: 760px; }

  .race-plan-section { display: flex; flex-direction: column; gap: 6px; }

  .race-plan-section h4 { font-size: 12px; font-weight: 650; color: var(--text-secondary); margin: 0 0 2px; }

  .race-plan-pace-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 12.5px; }

  .race-plan-pace-row .sport-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; align-self: center; }

  .race-plan-pace-label { font-weight: 620; min-width: 76px; }

  .race-plan-pace-value { font-weight: 700; min-width: 92px; font-variant-numeric: tabular-nums; }

  .race-plan-pace-basis { color: var(--text-secondary); }

  .race-plan-missing { color: var(--c-warn-text); }

  .race-plan-note, .race-plan-empty { font-size: 11.5px; color: var(--text-muted); margin: 0; }

  .race-plan-item { display: flex; align-items: center; gap: 8px; }

  .race-plan-item input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }

  .race-plan-text {
    flex: 1 1 auto; min-width: 0; padding: 5px 8px; border-radius: 8px;
    font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; hyphens: auto; cursor: text;
  }

  .race-plan-text:hover, .race-plan-text:focus { background: var(--surface-1); }

  .race-plan-text:focus { outline: 2px solid var(--accent); outline-offset: 0; }

  .race-week-day .race-plan-text:hover, .race-week-day .race-plan-text:focus { background: var(--page); }

  .race-plan-item.done .race-plan-text { text-decoration: line-through; color: var(--text-muted); }

  .race-plan-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }

  .race-plan-add .race-plan-add-text { flex: 1 1 160px; width: auto; }

  .race-plan-add .race-plan-add-day { flex: 0 1 200px; width: auto; }

  .race-week-day {
    display: flex; flex-direction: column; gap: 5px; padding: 8px 10px;
    background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  }

  .race-week-raceday { border-color: var(--accent); }

  .race-week-day-head { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }

  .race-week-day-head span { font-size: 11.5px; color: var(--text-muted); }

  .race-week-raceday .race-week-day-head span { color: var(--accent); font-weight: 650; }

  .goal-rec-date { font-size: 11px; color: var(--text-muted); }

  .goal-error { font-size: 12px; color: var(--c-crit-text); margin-top: 10px; }

  .goal-recommendation {
    margin-top: 12px; padding: 14px 16px; background: var(--surface-1);
    border: 1px solid var(--border); border-radius: 12px;
    font-size: 13px; line-height: 1.6; color: var(--text-primary);
  }

  /* "Hauptevent"-Markierung (Trainingsplan bezieht sich immer auf dieses Ziel) */
  .goal-primary-star {
    border: none; background: none; cursor: pointer; font-size: 16px; line-height: 1;
    color: var(--text-muted); padding: 2px 4px; margin-right: 2px; vertical-align: middle;
    transition: color 0.15s ease, transform 0.15s ease;
  }

  .goal-primary-star:hover { transform: scale(1.15); }

  .goal-primary-star.active { color: #e0a827; }

  .goal-card-primary { box-shadow: inset 0 0 0 1.5px #e0a827; }

  /* Checkbox-Zeile (Onboarding + Athletenprofil, z.B. Kraft/Mobility-Toggle) */
  .onb-checkbox-row { display: flex !important; align-items: center; gap: 8px; cursor: pointer; font-weight: 560 !important; }

  .onb-checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

  /* Trainingsplan-Kachel (Coach-Tab, js/components/training-plan.js) */
  .plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

  .plan-head-info { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

  .plan-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

  .plan-phase-label { font-size: 12px; color: var(--text-muted); }

  .plan-status-badge {
    display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
    padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c-good) 14%, transparent);
    color: var(--c-good-text); white-space: nowrap;
  }
  .plan-status-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-good); animation: btnPulse 2.4s ease-in-out infinite; }
  .plan-status-badge.plan-status-none { background: var(--page); color: var(--text-muted); font-weight: 500; }
  .plan-status-badge.plan-status-none .dot { display: none; }

  .plan-timeline { margin: 14px 0 6px; }
  .plan-timeline-empty { margin: 0 0 10px; }
  .plan-timeline-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
  .plan-timeline-current { color: var(--text-primary); }
  .plan-timeline-countdown { color: var(--text-muted); font-size: 12px; }
  .plan-timeline-bar {
    position: relative; display: flex; height: 14px; border-radius: 999px; overflow: hidden;
    background: var(--page); gap: 2px;
  }
  .plan-timeline-seg {
    position: relative; height: 100%; flex-grow: 1; flex-shrink: 1; opacity: 0.45;
    transition: opacity 0.15s ease, transform 0.15s ease; cursor: default;
  }
  .plan-timeline-seg.active { opacity: 1; }
  .plan-timeline-seg:hover { opacity: 0.8; }
  .plan-timeline-plan-dot { position: absolute; top: -6px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-primary); box-shadow: 0 0 0 2px var(--surface-1); transform: translateX(-50%); z-index: 3; }
  .plan-timeline-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
  .plan-timeline-legend { display: flex; gap: 12px; flex-wrap: wrap; }
  .plan-timeline-legend-item { display: inline-flex; align-items: center; gap: 5px; opacity: 0.65; transition: opacity 0.15s ease; }
  .plan-timeline-legend-item.active { opacity: 1; font-weight: 600; color: var(--text-secondary); }
  .plan-timeline-legend-item .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }

  .plan-item-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

  .plan-item {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 12px;
    background: var(--page); border-radius: 12px;
  }

  .plan-item-clickable { cursor: pointer; transition: background 0.15s ease; }
  .plan-item-clickable:hover, .plan-item-clickable:focus-visible { background: var(--accent-wash); }
  .plan-item-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

  .plan-item-date {
    font-size: 11px; font-weight: 650; text-align: center; color: var(--text-secondary);
    line-height: 1.3; min-width: 30px;
  }

  .plan-item-main { flex: 1; min-width: 0; }

  .plan-item-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

  .plan-item-sport { font-size: 11px; font-weight: 650; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.02em; }

  .plan-item-title { font-size: 13.5px; font-weight: 600; }

  .plan-item-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

  .plan-intensity { font-size: 10.5px; font-weight: 650; padding: 2px 7px; border-radius: 6px; }

  .plan-intensity-leicht { background: color-mix(in srgb, var(--c-good) 18%, transparent); color: var(--c-good-text); }

  .plan-intensity-mittel { background: color-mix(in srgb, var(--c-warn) 18%, transparent); color: var(--c-warn-text); }

  .plan-intensity-hart { background: color-mix(in srgb, var(--c-crit) 18%, transparent); color: var(--c-crit-text); }

  .plan-item-erledigt { opacity: 0.6; }

  .plan-item-uebersprungen { opacity: 0.5; text-decoration: line-through; }

  .plan-item-edit {
    border: none; background: none; color: var(--text-muted); cursor: pointer;
    font-size: 14px; padding: 4px 8px; border-radius: 8px; line-height: 1; flex-shrink: 0;
  }

  .plan-item-edit:hover { background: var(--grid); color: var(--text-primary); }

  .plan-item-export {
    border: none; background: none; color: var(--text-muted); cursor: pointer;
    font-size: 14px; padding: 4px 8px; border-radius: 8px; line-height: 1; flex-shrink: 0;
  }

  .plan-item-export:hover { background: var(--grid); color: var(--text-primary); }

  /* "An Garmin senden" (Liste + Bearbeiten-Overlay); Fehler mit .fit-Download als eigene Zeile */
  .plan-item-garmin { flex-shrink: 0; }
  .plan-item-garmin :disabled, .plan-edit-actions-right :disabled { opacity: 0.5; cursor: default; }
  .plan-garmin-sent { font-size: 12px; font-weight: 600; color: var(--c-good-text); }
  .plan-item-garmin .plan-garmin-sent { white-space: nowrap; }
  .plan-garmin-error { flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
  .plan-garmin-error .goal-error { margin: 0; flex: 1 1 220px; }
  .pe-garmin-note { margin-top: 12px; }
  .pe-garmin-note:empty { display: none; }
  .pe-garmin-note .plan-garmin-sent { margin: 0; font-weight: 500; line-height: 1.5; }

  /* Bearbeiten-Overlay für eine einzelne geplante Einheit */
  .plan-edit-card { max-width: 640px; }

  .plan-edit-textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }

  .plan-exercise-row { display: flex; gap: 6px; margin-bottom: 6px; }

  .plan-exercise-row .plan-ex-name { flex: 1; }

  .plan-ex-remove {
    border: none; background: none; color: var(--text-muted); cursor: pointer;
    font-size: 13px; padding: 0 6px; border-radius: 6px;
  }

  .plan-ex-remove:hover { background: var(--grid); color: var(--text-primary); }

  /* "Schritte für die Uhr" im Bearbeiten-Overlay (Garmin-Workout / .fit) */
  .pe-steps-preview { margin: 0; padding-left: 20px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
  .pe-steps-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
  .pe-steps-actions .wd-analysis-hint { margin-left: 0; }
  .pe-steps-list { display: flex; flex-direction: column; gap: 6px; }
  .pe-step-row, .pe-repeat-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
  .onb-field .pe-step-row .pe-step-type { width: 132px; }
  .onb-field .pe-step-row .pe-step-value { width: 76px; }
  .onb-field .pe-step-row .pe-step-unit { width: 66px; }
  .onb-field .pe-step-row .pe-step-target { width: 140px; }
  .onb-field .pe-step-row .pe-step-zone { width: 90px; }
  .onb-field .pe-repeat-head .pe-repeat-count { width: 64px; }
  /* Zone ohne Ziel unsichtbar, aber mit Platz - so bleiben die Zeilen bündig */
  .pe-step-zone[hidden] { display: inline-block; visibility: hidden; }
  .pe-step-repeat { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px; border: 1px dashed var(--border); border-radius: 10px; }
  .pe-repeat-head { font-size: 12.5px; color: var(--text-secondary); }
  .pe-repeat-steps { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }

  .plan-edit-nutrition {
    margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-soft, var(--grid));
  }
  .plan-edit-nutrition h4 { margin: 0 0 4px; font-size: 12.5px; font-weight: 650; color: var(--text-secondary); }
  .plan-edit-nutrition .nutrition-timing-table { margin-top: 6px; }

  .plan-edit-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

  /* KI-Schnellaktion "Alternativer Vorschlag" im Bearbeiten-Dialog - unten,
     mittig, dezent (kein eigener Kartenrahmen), siehe CHANGE_REQUESTS.md. */
  .pe-regen { display: flex; flex-direction: column; align-items: center; margin-top: 18px; text-align: center; }
  .pe-regen .goal-error { margin: 8px 0 0; }

  .plan-edit-actions-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

  /* Der Löschen-Knopf trägt die Farbe fest im HTML (style=...), die im Dunkelmodus
     zu blass ist - nur !important schlägt eine solche Inline-Angabe. */
  .plan-edit-delete { color: var(--c-crit-text) !important; }

  /* Geplante Einheiten im Kalender (Monats-/Wochen-/Tagesansicht) - optisch
     als "Absicht" statt "Ist-Wert" erkennbar (gestrichelter Rahmen). */
  .cal-planned-list { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }

  .cal-planned-chip {
    font-size: 10px; font-weight: 560; padding: 2px 6px; border-radius: 6px;
    border: 1px dashed var(--sport-color, var(--border)); color: var(--text-secondary);
    display: flex; align-items: center; gap: 4px; cursor: grab;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  .cal-planned-chip .sport-dot { width: 6px; height: 6px; border-radius: 2px; flex-shrink: 0; }

  .cal-planned-chip:hover { background: var(--page); }

  .cal-planned-chip.dragging { opacity: 0.4; }

  .cal-planned-erledigt { opacity: 0.55; }

  .cal-planned-uebersprungen { opacity: 0.4; text-decoration: line-through; }

  .cal-drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }

  .cal-day-planned { margin: 14px 0; }

  .cal-day-planned h4 { font-size: 12px; font-weight: 650; color: var(--text-secondary); margin: 0 0 6px; }

  .cal-planned-list-day .cal-planned-chip { font-size: 12px; padding: 6px 10px; }

  /* Wetter an Outdoor-Einheiten (calWeatherHtml, js/components/calendar.js) */
  .cal-weather {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1px 5px;
    font-size: 10.5px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums;
  }

  .cal-weather-sub { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0 6px; font-weight: 500; color: var(--text-muted); }

  .cal-weather-sub > span { white-space: nowrap; }

  .cal-weather-day { font-size: 12.5px; margin-bottom: 8px; }

  .cal-weather-day .cal-weather-sub { font-size: 11px; }

  .card .card-sub.cal-weather-note { margin: -4px 0 12px; }

  /* "Wetter im Kalender"-Karte in den Einstellungen (js/components/weather.js) */
  .weather-search-row { display: flex; align-items: center; gap: 8px; }

  .weather-search-row .cal-today-btn { flex: none; }

  .weather-status { margin: 10px 0 0; }

  .weather-place-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

  .weather-clear-btn { margin-top: 10px; }

  .weather-place-list:empty { display: none; }

  .weather-place-region { color: var(--text-muted); font-weight: 500; }

  .weather-clear-btn[hidden] { display: none; }

  .goal-recommendation p { margin: 0 0 10px; }

  .goal-recommendation p:last-child { margin-bottom: 0; }

  .onb-start-btn { margin-top: 4px; }

  .onb-start-hint { margin-top: 8px; }

  /* Onboarding-Wizard: EIN vereinheitlichter, "edler" erster Eindruck -
     kombiniert Persönliches + Coach-Profil in einem Flow (Overlay wie
     modal-overlay, aber deutlich hochwertiger gestaltet: verschwommener
     Hintergrund + dezente Marken-Glow-Orbs, siehe DESIGN_GUIDE.md #6/#7). */
  .onb-overlay {
    position: fixed; inset: 0;
    background: rgba(8,9,10,0.62);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    display: flex; visibility: hidden; opacity: 0;
    align-items: center; justify-content: center;
    z-index: 100;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
    overflow: hidden;
  }

  .onb-overlay.open { visibility: visible; opacity: 1; transition: opacity 0.28s ease, visibility 0s linear 0s; }

  /* Drei sehr sanfte, unscharfe Farbflecken in den Markenfarben (Schwimmen/
     Rad/Laufen) hinter der Karte - rein dekorativ, nie textlesend im Weg,
     "pointer-events:none" damit Klicks ungestört durchgehen. */
  .onb-overlay::before, .onb-overlay::after {
    content: ""; position: absolute; border-radius: 50%;
    filter: blur(70px); pointer-events: none; z-index: 0;
  }

  .onb-overlay::before {
    width: 520px; height: 520px; top: -160px; left: -140px;
    background: radial-gradient(circle, var(--c-rad) 0%, transparent 70%);
    opacity: 0.16;
  }

  .onb-overlay::after {
    width: 460px; height: 460px; bottom: -160px; right: -120px;
    background: radial-gradient(circle, var(--c-schwimmen) 0%, transparent 70%);
    opacity: 0.14;
  }

  .onb-card {
    background: var(--surface-1);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 140px);
    border-radius: 26px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 70px rgba(0,0,0,0.38), 0 2px 8px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.05);
    max-width: 600px; width: 100%; max-height: 88vh; overflow-y: auto;
    padding: 34px 36px 32px; position: relative; z-index: 1;
    transform: translateY(14px) scale(0.965);
    transition: transform 0.32s cubic-bezier(.16,1,.3,1);
  }

  /* Feiner Verlaufs-Akzentstrich oben an der Karte - dezenter Marken-Moment,
     kein voller Gradient-Rahmen (bleibt ruhig statt aufdringlich). */
  .onb-card::before {
    content: ""; position: absolute; top: 0; left: 26px; right: 26px; height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--c-schwimmen), var(--c-rad), var(--c-laufen));
    opacity: 0.85;
  }

  .onb-overlay.open .onb-card { transform: translateY(0) scale(1); }

  .onb-brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 650; letter-spacing: 0.03em;
    color: var(--text-muted); text-transform: uppercase; margin-bottom: 14px;
  }

  .onb-brand .gradient-text { font-size: 13px; text-transform: none; letter-spacing: -0.01em; font-weight: 700; }

  .onb-close {
    position: absolute; top: 18px; right: 18px; z-index: 2;
    border: none; background: var(--page);
    width: 30px; height: 30px; border-radius: 50%;
    font-size: 14px; color: var(--text-secondary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .onb-close:hover { background: var(--grid); transform: scale(1.06); }

  .onb-progress { font-size: 11px; font-weight: 640; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 4px 0 8px; padding-right: 30px; }

  .onb-progress-bar { display: flex; gap: 4px; margin-bottom: 22px; }

  .onb-progress-seg { height: 4px; flex: 1; border-radius: 2px; background: var(--grid); transition: background 0.2s ease; }

  .onb-progress-seg.done { background: var(--accent); }

  .onb-step h3 { font-size: 18px; font-weight: 680; margin: 0 0 6px; }

  /* Nur innerhalb des (größeren) Trainings-Bearbeiten-Overlays sticky, NICHT
     im Onboarding-Wizard (nutzt dieselbe .onb-step-Klasse, aber eigene
     Card ohne separat scrollenden Body). */
  #plan-edit-body .onb-step h3 {
    position: sticky; top: -1px; z-index: 3; background: var(--surface-1);
    padding-top: 1px; padding-right: 34px;
  }

  .onb-step .onb-sub { font-size: 13px; color: var(--text-secondary); margin: 0 0 22px; }

  .onb-field { margin-bottom: 16px; }

  .onb-field label { display: block; font-size: 12px; font-weight: 560; color: var(--text-secondary); margin-bottom: 6px; }

  .onb-field .coach-input { width: 100%; box-sizing: border-box; }

  .onb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

  .onb-row-3 { display: grid; grid-template-columns: 0.7fr 1fr 1fr; gap: 14px; }

  .onb-radio-group { display: flex; gap: 8px; flex-wrap: wrap; }

  .onb-radio-chip {
    border: 1px solid var(--border); background: var(--page); color: var(--text-primary);
    font-family: inherit; font-size: 12.5px; font-weight: 560; padding: 8px 14px;
    border-radius: 20px; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }

  .onb-radio-chip.selected { background: var(--text-primary); color: var(--surface-1); border-color: var(--text-primary); }

  .onb-hint { font-size: 11px; color: var(--text-muted); margin: 6px 0 0; }

  .onb-weekday-group { display: flex; gap: 6px; flex-wrap: wrap; }

  .onb-weekday-chip {
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--page); color: var(--text-primary);
    font-family: inherit; font-size: 12px; font-weight: 620; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
  }

  .onb-weekday-chip.selected { background: var(--text-primary); color: var(--surface-1); border-color: var(--text-primary); }

  .onb-weekday-chip.selected-swim { background: var(--c-schwimmen); border-color: var(--c-schwimmen); color: #fff; }

  .onb-weekday-chip.selected-long { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }

  .onb-weekday-chip:disabled { opacity: 0.32; cursor: not-allowed; }

  .onb-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; gap: 10px; }

  .onb-actions .chip:disabled { opacity: 0.4; cursor: default; }

  .onb-summary { font-size: 13px; line-height: 1.8; color: var(--text-primary); }

  .onb-summary b { font-weight: 640; }

  .onb-summary .onb-summary-empty { color: var(--text-muted); }

  /* Coach-Gate: Coach-Bereich bleibt unscharf/gesperrt, bis das Onboarding
     erledigt ist - minimalistischer erster Eindruck statt vollem Formular. */
  .coach-content { position: relative; }

  .coach-content.gated { filter: blur(10px); pointer-events: none; user-select: none; transition: filter 0.3s ease; }

  /* z-index bewusst UNTER der Topnav (40): kein echtes Modal - man soll per
     Tab-Wechsel jederzeit rausnavigieren können, ohne erst "Onboarding
     starten"/"Ohne Onboarding fortfahren" anklicken zu müssen. */
  .coach-gate { display: none; position: fixed; inset: 0; z-index: 35; align-items: center; justify-content: center; }

  .coach-gate.active { display: flex; }

  .coach-gate-card {
    background: var(--surface-1); border-radius: 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: 38px 34px; max-width: 380px; width: 100%; text-align: center;
  }

  .coach-gate-title { font-size: 19px; font-weight: 680; margin: 0 0 8px; }

  .coach-gate-sub { font-size: 13px; color: var(--text-secondary); margin: 0 0 24px; line-height: 1.5; }

  .coach-gate-btn { font-size: 14px; padding: 12px 30px; }

  .coach-gate-skip {
    display: block; margin: 16px auto 0; border: none; background: none;
    font-family: inherit; font-size: 11.5px; color: var(--text-muted);
    text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
  }

  .coach-gate-skip:hover { color: var(--text-secondary); }

  /* Erholungs-Check (eigene Kachel oben in der Übersicht) */
  .recovery-card h2 { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

  .recovery-check { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

  .recovery-row {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 10px 14px; border-radius: 14px; background: var(--page);
  }

  .recovery-label { font-size: 12.5px; font-weight: 620; color: var(--text-secondary); min-width: 90px; flex: none; }

  .recovery-group { gap: 6px; }

  .recovery-chip { padding: 7px 13px; }

  /* gewählter Zustand getönt statt voll gefüllt: Schrift bleibt in Hell und Dunkel lesbar */
  #recovery-soreness-group .recovery-chip[data-value="light"].selected,
  #recovery-energy-group .recovery-chip[data-value="high"].selected {
    background: color-mix(in srgb, var(--c-good) 22%, var(--surface-1)); border-color: var(--c-good); color: var(--c-good-text);
  }

  #recovery-soreness-group .recovery-chip[data-value="moderate"].selected,
  #recovery-energy-group .recovery-chip[data-value="reduced"].selected {
    background: color-mix(in srgb, var(--c-warn) 24%, var(--surface-1)); border-color: var(--c-warn); color: var(--c-warn-text);
  }

  #recovery-soreness-group .recovery-chip[data-value="severe"].selected,
  #recovery-energy-group .recovery-chip[data-value="low"].selected,
  #recovery-injury-group .recovery-chip[data-value="yes"].selected {
    background: color-mix(in srgb, var(--c-crit) 18%, var(--surface-1)); border-color: var(--c-crit); color: var(--c-crit-text);
  }

  .load-status.muted { background: var(--grid); color: var(--text-muted); }

  /* stat tiles */
  /* Kleine Kennzahl-Kacheln: je nach Breite 4 pro Reihe (Maximum, damit 8
     Kacheln als 4+4 statt als 6+2 umbrechen), mindestens 200px breit. */
  .stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(max(200px, calc((100% - 3 * 16px) / 4)), 1fr));
    gap: 16px;
    margin-bottom: 24px;
    perspective: 1000px;
  }

  .stat-tile {
    background: var(--surface-1);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    padding: 20px 22px;
    min-width: 0; /* erlaubt der Grid-Spalte, unter die Inhaltsbreite zu schrumpfen (z.B. lange VO2max-Einheit/Trend-Texte), statt zu überlaufen */
  }

  .stat-tile .label {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
  }

  .stat-tile .value {
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -0.01em;
    font-variant-numeric: proportional-nums;
    overflow-wrap: break-word;
  }

  .stat-tile .sub {
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--text-muted);
    overflow-wrap: break-word;
  }

  /* Streak-Kachel, wenn der heutige Tag noch offen ist (Trainingstag, noch
     nichts importiert) - dezenter Hinweis, ohne aufdringlich zu wirken. */
  .stat-tile.at-risk { box-shadow: 0 0 0 1.5px var(--c-warn), var(--card-shadow); }

  .stat-tile.at-risk .sub { color: var(--c-warn-text); }

  /* Erfolge-Karte */
  .achievement-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 4px;
    border-top: 1px solid var(--grid);
  }

  .achievement-row:first-child { border-top: none; }

  .achievement-badge { font-size: 18px; flex: none; }

  .achievement-label { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; }

  .achievement-date { font-size: 11.5px; color: var(--text-muted); flex: none; }

  /* Klickbar: springt zur Erfolge-Karte im Rekorde-Tab (siehe
     showAchievementToast() in js/components/achievements.js). Solange
     ausgeblendet (opacity:0/visibility:hidden) trotzdem nicht klickbar, ganz
     ohne pointer-events:none - visibility:hidden reicht dafür bereits aus
     und lässt sich hier zusätzlich für den Hover-Zustand nutzen. */
  .achievement-toast {
    position: fixed; top: calc(18px + var(--safe-top)); left: 50%; transform: translateX(-50%);
    width: max-content; max-width: calc(100vw - 32px);
    z-index: 200; display: flex; align-items: center; gap: 10px;
    background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: var(--card-shadow); padding: 12px 18px; font-size: 13.5px; font-weight: 600;
    opacity: 0; visibility: hidden;
    cursor: pointer; transition: opacity 0.2s ease, visibility 0s linear 0.2s, transform 0.2s ease;
  }

  .achievement-toast.show { opacity: 1; visibility: visible; animation: fadeSlideUp 0.4s cubic-bezier(.16,1,.3,1) both; }

  .achievement-toast.show:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 14px 32px rgba(0,0,0,0.16); }

  .achievement-toast-hint { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-left: 2px; }

  /* card grid: auto-fit statt fester 2 Spalten - auf breiten Bildschirmen
     passen 3 (ab ca. 2000px 4) Karten nebeneinander. min(420px,100%) statt
     nur 420px, damit die Spalte in schmalen Containern nie überläuft. */
  .grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
    gap: 18px;
    margin-bottom: 18px;
  }

  .card {
    background: var(--surface-1);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 20px 22px;
    position: relative;
  }

  .card.full { margin-bottom: 18px; }

  /* Kachel-Suche: Treffer dezent hervorheben, Nicht-Treffer ausblenden -
     Layout bleibt stabil (kein display:none), damit nichts hin- und
     herspringt, während man tippt. */
  .card-search-match {
    box-shadow: 0 0 0 2px var(--accent, var(--text-primary)), var(--card-shadow);
  }

  .card-search-dim {
    opacity: 0.35;
    filter: saturate(0.6);
  }

  /* Übersicht-Karten: per Drag & Drop umsortierbar (Griff oben rechts) */
  .dash-grid-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px 18px; margin: 0 0 12px;
  }

  .dash-grid-hint { font-size: 11.5px; color: var(--text-muted); }

  .dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
    gap: 18px;
    margin-bottom: 18px;
  }

  .dash-grid .card.full { grid-column: 1 / -1; margin-bottom: 0; }

  .dash-grid .card { min-width: 0; }

  .card-drag-handle {
    position: absolute; top: 18px; right: 18px;
    width: 26px; height: 26px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: var(--text-muted); cursor: grab;
    user-select: none; transition: background 0.15s ease, color 0.15s ease;
  }

  .card-drag-handle:hover { background: var(--page); color: var(--text-secondary); }

  .card.dragging { opacity: 0.4; }

  .card-drag-handle:active { cursor: grabbing; }

  .card.drag-target { outline: 2px dashed var(--accent); outline-offset: 2px; }

  .table-expand-wrap { display: flex; justify-content: center; margin-top: 14px; }

  .card h2 {
    font-size: 15.5px;
    font-weight: 620;
    margin: 0 0 2px;
    letter-spacing: -0.005em;
  }

  .card .card-sub {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 0 0 16px;
  }

  .legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 12.5px;
    color: var(--text-secondary);
  }

  .legend .item { display: flex; align-items: center; gap: 6px; }

  .legend .swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

  .legend .swatch.line { width: 12px; height: 2px; border-radius: 1px; }

  svg { display: block; overflow: visible; }

  /* Diagramme füllen die volle Kartenbreite: die width/height-Attribute der
     SVGs (js/components/chart.js, dashboard.js, ...) setzen nur eine feste
     Höhe, bei der "meet" das Diagramm klein und mittig zentriert (leere
     Ränder links/rechts). Mit height:auto folgt die Höhe stattdessen dem
     viewBox-Seitenverhältnis - nichts wird verzerrt, Tooltips (Mauskoordinaten
     relativ zu .chart-wrap) bleiben exakt. */
  .chart-wrap > svg { width: 100%; height: auto; }

  /* Runde Diagramme (Tacho, Radar) bewusst nicht auf die volle Breite
     aufziehen, sonst werden sie riesig - begrenzt und zentriert. */
  .gauge-wrap > svg { max-width: 420px; }

  .wd-radar-chart > svg { max-width: 380px; margin: 0 auto; }

  /* Im Modal schneidet der scrollende Body (overflow) alles ab, was über den
     Rand hinausragt - z.B. die letzte X-Achsen-Beschriftung, die jetzt bis an
     den rechten Rand reicht. Kleiner Innenabstand rechts verhindert das. */
  .modal-card .chart-wrap { padding-right: 16px; }

  .axis-label { fill: var(--text-muted); font-size: 11px; }

  .grid-line { stroke: var(--grid); stroke-width: 1; }

  .baseline { stroke: var(--baseline); stroke-width: 1; }

  .tooltip {
    position: absolute;
    pointer-events: none;
    /* Bewusst fest dunkel (nicht --text-primary): das wird im Dark Mode
       weiß, was zusammen mit der weißen Schrift eine unsichtbare, leere
       weiße Box ergeben würde. */
    background: rgba(20, 19, 17, 0.94);
    color: #fff;
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 9px;
    line-height: 1.45;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translate(-50%, -100%);
    transition: opacity 0.08s ease;
    z-index: 20;
    white-space: nowrap;
  }

  .tooltip b { font-weight: 650; }

  .chart-wrap { position: relative; }

  .empty-note { font-size: 12.5px; color: var(--text-muted); padding: 24px 0; text-align: center; }

  /* Ernährungs-Tab: kompakte Zwei-Spalten-Tabellen (Gewichtsverlauf, Pre-Workout-Timing) */
  .nutrition-weight-table, .nutrition-timing-table {
    width: 100%; margin-top: 12px; font-size: 12.5px; border-collapse: collapse;
  }

  .nutrition-weight-table td, .nutrition-timing-table td {
    padding: 6px 4px; border-top: 1px solid var(--border-soft, var(--grid));
  }

  .nutrition-weight-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

  .nutrition-timing-when { color: var(--text-secondary); font-weight: 600; white-space: nowrap; padding-right: 12px; }

  .nutrition-preworkout-switcher { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
  .nutrition-preworkout-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
  .nutrition-preworkout-chip .sport-dot { width: 7px; height: 7px; }

  /* Wettkampf-Verpflegung: bis zur Taper-Phase (14 Tage vor Event) bewusst
     klein/unauffällig gehalten (siehe RACE_FUELING_TAPER_DAYS, nutrition.js)
     - noch keine verlässlichen Verpflegungsangaben nötig/sinnvoll. */
  .racefueling-card.racefueling-minimal { padding-bottom: 6px; opacity: 0.72; }
  .racefueling-card.racefueling-minimal h2 { font-size: 14px; }
  .racefueling-waiting { padding: 10px 0; text-align: left; }

  .small-multiples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 18px;
  }

  .small-multiples .mini h3 {
    font-size: 13px;
    font-weight: 620;
    margin: 0 0 2px;
  }

  .small-multiples .mini .mini-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0 0 10px;
  }

  .pmc-substats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 12px;
    margin-top: 16px;
  }

  .pmc-substats .sub-tile {
    background: var(--page);
    border-radius: 12px;
    padding: 12px 14px;
  }

  .pmc-substats .sub-tile .l { font-size: 11px; color: var(--text-secondary); margin-bottom:3px; }

  .pmc-substats .sub-tile .v { font-size: 17px; font-weight: 640; }

  .pmc-substats .sub-tile .v small { font-size: 11px; font-weight: 500; color: var(--text-muted); }

  .pmc-substats .sub-tile .v small.delta-good { color: var(--c-good-text); }
  /* Erholungs-Kacheln nutzen dieselbe Farbkonvention (js/components/recovery.js) */
  #recovery-tiles .stat-tile .sub small.delta-good { color: var(--c-good-text); font-weight: 700; }
  #recovery-tiles .stat-tile .sub small.delta-warn { color: var(--c-warn-text); font-weight: 700; }
  #recovery-tiles .stat-tile .label small { color: var(--text-secondary); font-weight: 500; }

  /* Garmin-Sync-Status im Update-Menue (js/components/dashboard.js) */
  .update-menu-sync { padding: 2px 12px 8px; font-size: 11px; color: var(--text-secondary); }
  .update-menu-sync.stale { color: var(--c-warn-text); font-weight: 600; }
  #menu-item-garmin { text-decoration: none; }
  .update-menu-sync .sync-hint { display: block; margin-top: 4px; line-height: 1.45; opacity: 0.85; }
  .update-menu-sync .sync-hint code { font-size: 10px; padding: 1px 4px; border-radius: 4px;
    background: var(--bg-subtle, rgba(127,127,127,0.15)); }

  .pmc-substats .sub-tile .v small.delta-warn { color: var(--c-warn-text); }

  .load-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    margin-left: 8px;
  }

  .load-status .dot { width: 7px; height: 7px; border-radius: 50%; }

  .load-status.ok    { background: rgba(12,163,12,0.10); color: var(--c-good-text); }

  .load-status.watch { background: rgba(250,178,25,0.16); color: var(--c-warn-text); }

  .load-status.risk  { background: rgba(208,59,59,0.10); color: var(--c-crit-text); }

  /* Trainingsstatus als erste Stat-Kachel im Übersicht-Tab (Garmin-Connect-
     artig, siehe renderStats() in js/components/dashboard.js) - gleiches
     Muster wie .stat-tile.at-risk beim Streak: farbiger Rahmen je nach
     Einordnung (good/recovery=freundlich, watch=Amber, risk=Rot, muted=
     neutral für "noch keine Einordnung"), Text bleibt normal groß wie bei
     den anderen Stat-Kacheln. */
  .stat-tile.training-tile-good     { box-shadow: 0 0 0 1.5px var(--c-good), var(--card-shadow); }
  .stat-tile.training-tile-good .sub     { color: var(--c-good-text); }

  .stat-tile.training-tile-recovery { box-shadow: 0 0 0 1.5px var(--accent), var(--card-shadow); }
  .stat-tile.training-tile-recovery .sub { color: var(--accent); }

  .stat-tile.training-tile-watch    { box-shadow: 0 0 0 1.5px var(--c-warn), var(--card-shadow); }
  .stat-tile.training-tile-watch .sub    { color: var(--c-warn-text); }

  .stat-tile.training-tile-risk     { box-shadow: 0 0 0 1.5px var(--c-crit), var(--card-shadow); }
  .stat-tile.training-tile-risk .sub     { color: var(--c-crit-text); }

  .stat-tile.training-tile-muted    { }

  table.workouts {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  table.workouts th {
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0 10px 10px;
    border-bottom: 1px solid var(--grid);
  }

  table.workouts td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--grid);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  table.workouts tr:last-child td { border-bottom: none; }

  table.workouts tbody tr { cursor: pointer; }

  table.workouts tbody tr:hover td { background: var(--page); }

  /* Indoor-/Virtuell-Kennzeichnung bei Radeinheiten (rideEnvBadgeHtml() in
     js/data/workouts.js). Bewusst nur für Indoor - Outdoor ist der Normalfall.
     Farbe bleibt die Rad-Farbe, unterschieden wird über den Text. */
  .env-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 2px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--c-rad) 16%, transparent);
    color: color-mix(in srgb, var(--c-rad) 70%, var(--text-primary));
    border: 1px solid color-mix(in srgb, var(--c-rad) 32%, transparent);
    flex: none;
    white-space: nowrap;
  }

  .modal-head .env-badge { margin-left: 8px; }

  table.workouts td.sport-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: normal; }

  table.workouts .sport-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }

  table.workouts td.num { text-align: right; }

  .table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }

  /* Kompakte Variante der Workout-Tabelle (Coach-Tab) - gleiche Optik,
     etwas kleinere Schrift/Abstände, damit die Karte insgesamt kleiner
     wirkt als das große Pendant in der Übersicht (siehe CHANGE_REQUESTS.md). */
  table.workouts.workouts-compact { font-size: 12px; }
  table.workouts.workouts-compact th { font-size: 10.5px; padding: 0 8px 8px; }
  table.workouts.workouts-compact td { padding: 8px 8px; }

  /* detail modal */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(11,11,11,0.4);
    display: flex;
    visibility: hidden;
    opacity: 0;
    align-items: center; justify-content: center;
    z-index: 100;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
  }

  .modal-overlay.open {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.22s ease, visibility 0s linear 0s;
  }

  .modal-card {
    background: var(--surface-1);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    /* Karte selbst scrollt NICHT mehr - nur noch #modal-body/#plan-edit-body
       (s.u.) - so bleiben Titel (.modal-head, sticky) und die per Absolute-
       Position verankerte Schließen-X-Taste immer sichtbar, auch tief
       gescrollt (siehe CHANGE_REQUESTS.md). */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 28px 30px;
    position: relative;
    transform: translateY(10px) scale(0.97);
    transition: transform 0.28s cubic-bezier(.16,1,.3,1);
  }

  #modal-body, #plan-edit-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }

  .modal-overlay.open .modal-card { transform: translateY(0) scale(1); }

  .modal-close {
    position: absolute; top: 18px; right: 18px; z-index: 10;
    border: none; background: var(--page);
    width: 30px; height: 30px; border-radius: 50%;
    font-size: 14px; color: var(--text-secondary);
    cursor: pointer; display:flex; align-items:center; justify-content:center;
  }

  .modal-close:hover { background: var(--grid); }

  .confirm-card { max-width: 380px; padding: 26px 26px 20px; text-align: center; }
  .confirm-message { font-size: 15px; color: var(--text-primary); margin: 6px 0 20px; line-height: 1.45; white-space: pre-line; }
  .confirm-actions { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
  /* Lange Beschriftungen (Vorschlag des Plan-Regelwerks als Knopf) umbrechen statt überlaufen. */
  .confirm-actions .update-btn { white-space: normal; justify-content: center; text-align: center; border-radius: 14px; }
  .confirm-danger-btn { background: var(--c-crit); }
  .confirm-danger-btn:hover { filter: brightness(1.08); }

  /* Workout-Vergleich (js/components/compare.js) - Auswahl-Dialog +
     Vergleichsansicht, reuse von .modal-overlay/.modal-card/.legend. */
  .compare-picker-card { max-width: 560px; }
  .compare-picker-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 4px 0 10px; }
  .compare-picker-item { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; font-size: 13px; }
  .compare-picker-item:hover { background: var(--page); }
  .compare-picker-item input[type="checkbox"] { flex: none; }
  .compare-picker-item input:disabled { opacity: 0.4; }
  .compare-picker-item-main { font-weight: 600; white-space: nowrap; }
  .compare-picker-item-sub { color: var(--text-secondary); font-size: 12px; }
  .compare-picker-hint { font-size: 12px; color: var(--text-secondary); min-height: 16px; margin: 0 0 4px; }

  .compare-card { max-width: 980px; }
  .compare-legend { margin: 2px 0 14px; }
  .compare-summary { margin: -6px 0 14px; padding: 10px 12px; background: var(--page); border-radius: 12px; font-size: 12.5px; row-gap: 6px; }
  .compare-summary .item b { font-weight: 640; color: var(--text-primary); }
  .compare-mode-toggle { margin-bottom: 16px; }
  .compare-stats-table { margin-bottom: 22px; }
  .compare-stats-table td.compare-best { color: var(--c-good-text); font-weight: 650; }
  .compare-columns { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 4px; }
  .compare-column { flex: 0 0 320px; background: var(--page); border-radius: 14px; padding: 14px; }
  .compare-column-head { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 10px; }
  .compare-column .swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; }

  .modal-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
    position: sticky; top: -1px; z-index: 3; background: var(--surface-1);
    padding-top: 1px;
  }

  .modal-head .sport-dot { width: 11px; height: 11px; border-radius: 4px; }

  .modal-head h3 { font-size: 19px; font-weight: 650; margin: 0; }

  .modal-sub { font-size: 13px; color: var(--text-secondary); margin: 0 0 18px; }

  .modal-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 10px; margin-bottom: 22px;
  }

  .modal-stats .st { background: var(--page); border-radius: 12px; padding: 10px 12px; }

  .modal-stats .st .l { font-size: 10.5px; color: var(--text-muted); margin-bottom: 2px; }

  .modal-stats .st .v { font-size: 15px; font-weight: 640; }

  .modal-charts { display: grid; gap: 18px; }

  .modal-charts h4 { font-size: 12.5px; font-weight: 620; margin: 0 0 8px; color: var(--text-secondary); }

  /* "Trainingsbelastung"-Kachel (TRIMP/Stress-Score, buildWorkoutLoadStatsHtml) */
  .wd-loadstats { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }

  .wd-loadstats h4 { font-size: 13px; font-weight: 650; margin: 0 0 10px; }

  /* KI-Auswertung je Trainingseinheit (buildWorkoutAnalysisHtml) */
  .wd-analysis { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }

  .wd-analysis-head h4 { font-size: 13px; font-weight: 650; margin: 0 0 3px; }

  .wd-analysis-hint { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-left: 6px; }

  .wd-analysis-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

  /* Eigene Bewertung + Notiz je Einheit (buildWorkoutRatingHtml,
     js/components/workout-card.js) - eigener Abschnitt VOR der
     KI-Auswertung, dieselbe Trennlinien-Optik wie .wd-analysis/.wd-loadstats. */
  .wd-rating, .wd-equipment { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }

  .wd-rating h4, .wd-equipment h4 { font-size: 13px; font-weight: 650; margin: 0 0 8px; }

  .wd-rating-stars { display: flex; gap: 4px; margin-bottom: 10px; }

  .wd-rating-star {
    background: none; border: none; padding: 0; cursor: pointer;
    font-size: 22px; line-height: 1; color: var(--text-muted);
    transition: color 0.15s ease, transform 0.1s ease;
  }

  .wd-rating-star:hover { transform: scale(1.15); }

  .wd-rating-star.filled { color: #f0a63a; }

  .wd-rating-note { width: 100%; min-height: 60px; resize: vertical; font-family: inherit; }

  .wd-rating-elevation-row { margin-top: 14px; }

  .wd-rating-elevation-row label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }

  .wd-rating-elevation-inputs { display: flex; align-items: center; gap: 8px; }

  .wd-rating-elevation-inputs .wd-rating-elevation { max-width: 100px; }

  .stat-tile { animation: fadeSlideUp 0.5s cubic-bezier(.16,1,.3,1) both; }

  .stat-tile:nth-child(1) { animation-delay: 0ms; }

  .stat-tile:nth-child(2) { animation-delay: 45ms; }

  .stat-tile:nth-child(3) { animation-delay: 90ms; }

  .stat-tile:nth-child(4) { animation-delay: 135ms; }

  .stat-tile:nth-child(5) { animation-delay: 180ms; }

  .chart-enter { animation: fadeScaleIn 0.5s cubic-bezier(.16,1,.3,1) both; animation-delay: 60ms; }

  .donut-arc { animation: wedgeIn 0.5s cubic-bezier(.16,1,.3,1) both; }

  .bar-grow-y { transform-box: fill-box; transform-origin: bottom; animation: barGrowY 0.55s cubic-bezier(.16,1,.3,1) both; }

  .bar-grow-x { transform-box: fill-box; transform-origin: left; animation: barGrowX 0.55s cubic-bezier(.16,1,.3,1) both; }

  /* Hover-Hervorhebung für Chart-Elemente (Balken, Kreissegmente, Gauge-
     Bänder, Linien) - ergänzt die Tooltips, die schon den genauen Wert
     zeigen, mit einem sichtbaren "das hier gerade" beim Hovern. */
  .chart-bar, .gauge-band { transition: filter 0.12s ease; cursor: pointer; }

  .chart-bar:hover, .gauge-band:hover { filter: brightness(1.18); }

  .donut-arc { transition: filter 0.15s ease, transform 0.15s ease; cursor: pointer; }

  .donut-arc:hover { filter: brightness(1.15); transform: scale(1.035); }

  /* Linien: die Karte übergibt die eigentliche Strichstärke als CSS-Variable
     --sw (z.B. style="--sw:2.5"), damit "aktiv" relativ dazu dicker wird,
     statt bei jeder Linie im Dashboard gleich dick zu werden. */
  .chart-line { transition: stroke-width 0.15s ease, opacity 0.15s ease; }

  .chart-line.chart-line-active { stroke-width: calc(var(--sw, 2) * 1.7); }

  .chart-line.chart-line-dim { opacity: 0.28; }

  /* Flächen (Ridgeline-Zeilen, Herzfrequenzprofil, Belastungsprofil-Radar) -
     dieselbe "das hier gerade"-Hervorhebung wie bei Balken/Linien/Segmenten. */
  .chart-area { transition: filter 0.12s ease, opacity 0.12s ease; cursor: pointer; }

  .chart-area:hover { filter: brightness(1.12); }

  .row-enter { animation: fadeSlideUp 0.35s cubic-bezier(.16,1,.3,1) both; }

  .row-added { animation: rowHighlight 2.4s ease; }

  .row-enter.row-added { animation: fadeSlideUp 0.35s cubic-bezier(.16,1,.3,1) both, rowHighlight 2.4s ease; }

  /* Card- und Kachel-Hover: dezenter, jederzeit spürbarer "Premium"-Effekt,
     unabhängig vom Seiten-Ladezeitpunkt (im Gegensatz zu den Entrance-Animationen). */
  .card { transition: box-shadow 0.2s ease, transform 0.2s ease; }

  .card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }

  /* 3D-Tilt (wie auf der Landingpage): Rotation wird per JS aus der
     Mausposition berechnet und direkt als transform gesetzt; hier nur die
     Transition für ein weiches Zurückfedern beim Verlassen sowie die
     nötige 3D-Bühne (perspective auf dem Container, preserve-3d auf der Kachel). */
  .stat-tile { transition: box-shadow 0.2s ease, transform 0.15s cubic-bezier(0.1, 1, 0.1, 1); transform-style: preserve-3d; }

  .stat-tile:hover { box-shadow: var(--card-shadow-hover); }

  .chip { transform: scale(1); transition: background 0.12s ease, color 0.12s ease, transform 0.1s ease; }

  .chip:active { transform: scale(0.94); }

  .update-btn { transition: filter 0.12s ease, transform 0.1s ease; }

  .update-btn:active { transform: scale(0.96); }

  .update-btn.success { animation: btnPulse 0.4s ease; }

  table.workouts tbody tr { transition: background 0.12s ease; }

  .gauge-wrap { display: flex; flex-direction: column; align-items: center; }

  .gauge-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin-top: 4px; font-size: 11.5px; color: var(--text-secondary); }

  .gauge-legend .item { display: flex; align-items: center; gap: 5px; }

  .gauge-legend .swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

  .gauge-foot { font-size: 11.5px; color: var(--text-muted); text-align: center; margin-top: 8px; line-height: 1.5; }

  /* ---------- Equipment-Tracking (Einstellungen + Kalender-/Dashboard-Banner) ---------- */

  .equipment-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
  .equipment-item:last-child { border-bottom: none; }
  .equipment-item-indented { padding-left: 24px; }
  .equipment-item-retired { opacity: 0.55; }
  .equipment-item-main { display: flex; align-items: center; gap: 8px; font-weight: 620; flex: 1 1 220px; min-width: 0; }
  .equipment-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .equipment-item-sub { font-size: 12px; color: var(--text-secondary); flex: 2 1 260px; }
  .equipment-item-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 0 0 auto; margin-left: auto; }
  .equipment-delete { border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
  .equipment-delete:hover { color: var(--c-crit-text); background: var(--page); }

  .equipment-badge { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 650; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.02em; }
  .equipment-badge-ok { background: var(--accent-wash); color: var(--accent); }
  .equipment-badge-active { background: var(--accent-wash); color: var(--accent); }
  .equipment-badge-nolimit { background: var(--page); color: var(--text-muted); }
  .equipment-badge-soon { background: rgba(250,178,25,0.16); color: var(--c-warn-text); }
  .equipment-badge-due { background: rgba(208,59,59,0.14); color: var(--c-crit-text); }
  .equipment-badge-retired { background: var(--page); color: var(--text-muted); }

  .equipment-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 14px 0; padding: 10px 14px; border-radius: 12px; background: rgba(250,178,25,0.12); border: 1px solid rgba(250,178,25,0.35); font-size: 12.5px; }
  .equipment-banner-icon { font-size: 15px; flex: none; }
  .equipment-banner-text { flex: 1 1 auto; color: var(--text-primary); }
  .equipment-banner-item { margin-right: 8px; color: var(--text-secondary); }
  .equipment-banner-item.due { color: var(--c-crit-text); font-weight: 620; }
  .equipment-banner-link { border: none; background: transparent; color: var(--accent); font-weight: 620; cursor: pointer; font-size: 12.5px; padding: 2px 4px; flex: none; }
  .equipment-banner-link:hover { text-decoration: underline; }

  /* Login-Seite (login.html): eine schmale Karte in der Bildschirmmitte. */
  .login-page {
    min-height: 100vh; min-height: 100dvh; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
  }

  .login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }

  .login-card .card-sub { margin-bottom: 4px; }

  .login-card .update-btn { justify-content: center; padding: 10px 16px; font-size: 13.5px; }

  .login-card .update-btn:disabled { opacity: 0.6; cursor: default; }

  .login-error { margin: 0; font-size: 12.5px; color: var(--c-crit-text); }

  /* Hinweis oben im Dashboard, wenn Laden/Speichern beim Server scheitert
     (showApiError, js/data/api-client.js). */
  .api-error-banner {
    margin: 0 0 16px; padding: 10px 14px; border-radius: 12px;
    border: 1px solid var(--c-crit); background: var(--surface-1);
    color: var(--text-primary); font-size: 12.5px;
  }

  /* Hinweis "Neue Version verfügbar" (nur für den Betreiber, js/components/update.js) */
  .app-update-banner {
    margin: 0 0 16px; padding: 10px 14px; border-radius: 12px;
    border: 1px solid var(--accent); background: var(--accent-wash);
    color: var(--text-primary); font-size: 12.5px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  }
  .app-update-banner[hidden] { display: none; }
  .app-update-banner .app-update-banner-text { flex: 1 1 260px; }
  .app-update-notes {
    margin: 8px 0 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface-1); font-size: 12.5px; white-space: pre-wrap; max-height: 260px; overflow: auto;
  }
  .app-update-notes[hidden] { display: none; }
  .coach-settings-row.app-update-actions { flex-direction: row; flex-wrap: wrap; gap: 10px; }

  /* ---------- Analyse-Tab (js/components/analysis.js) ---------- */

  /* Höchstens zwei Karten nebeneinander (Schwimmen | Rad), darunter einspaltig */
  .dash-grid.ana-grid { grid-template-columns: repeat(auto-fit, minmax(min(560px, 100%), 1fr)); }

  .ana-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 8px 14px; margin-bottom: 14px;
  }

  /* Sportfarben für Legenden-Kästchen (background) und SVG-Flächen (fill) */
  .ana-swim { background: var(--c-schwimmen); fill: var(--c-schwimmen); }
  .ana-bike { background: var(--c-rad); fill: var(--c-rad); }
  .ana-run  { background: var(--c-laufen); fill: var(--c-laufen); }

  .ana-bal-rows { display: flex; flex-direction: column; gap: 10px; }

  .ana-bal-row {
    display: grid; grid-template-columns: 72px minmax(0, 1fr) 52px;
    align-items: center; gap: 3px 12px; font-size: 12px;
  }

  .ana-bal-label { color: var(--text-secondary); white-space: nowrap; }

  .ana-bal-label small { color: var(--text-muted); font-size: 10.5px; }

  .ana-bal-total { text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

  .ana-bal-short { grid-column: 2 / 4; font-size: 11.5px; color: var(--text-secondary); }

  .ana-warn-icon { color: var(--c-warn-text); }

  .ana-bal-empty { fill: var(--grid); }

  .ana-seg { stroke: var(--surface-1); stroke-width: 1.5; }

  .ana-target-mark { stroke: var(--text-primary); stroke-width: 2; }

  .ana-target-swatch { width: 2px; height: 12px; border-radius: 1px; background: var(--text-primary); display: inline-block; }

  .ana-hint {
    margin: 16px 0 0; padding: 10px 14px; border-radius: 12px;
    background: var(--page); color: var(--text-secondary); font-size: 12.5px; line-height: 1.55;
  }

  .ana-hint.warn { background: color-mix(in srgb, var(--c-warn) 16%, transparent); color: var(--text-primary); }

  .ana-hint b { color: var(--text-primary); }

  .ana-settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }

  .ana-subhead { font-size: 13px; font-weight: 620; margin: 20px 0 2px; }

  .ana-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; margin: 10px 0 14px; }

  .ana-form-btn { justify-content: center; }

  .ana-status { display: block; margin: 8px 0 0; min-height: 1em; }

  .pmc-substats.ana-tiles { margin-top: 0; }

  .ana-zone-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }

  .ana-zone-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; font-size: 12.5px; }

  .ana-zone-name { font-weight: 600; }

  .ana-zone-name small { font-weight: 500; color: var(--text-secondary); margin-left: 4px; }

  .ana-zone-share { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

  .ana-zone-bar { grid-column: 1 / -1; display: block; }

  .ana-z1 { fill: var(--c-z1); }
  .ana-z2 { fill: var(--c-z2); }
  .ana-z3 { fill: var(--c-z3); }
  .ana-z4 { fill: var(--c-z4); }
  .ana-z5 { fill: var(--c-z5); }

  .ana-brick-table { margin-top: 14px; }

  .ana-brick-table td small { color: var(--text-muted); font-size: 11px; margin-left: 2px; }

  .ana-brick-ride .env-badge { margin-left: 6px; }

/* ======================================================================
   Mobility, Trainingsprofil, KI-Coach-Karte
   Ruhig und klar: große Titel, wenige Farben (nur die Akzentfarbe),
   weiche Flächen statt Rahmen, Segmente und Chips wie auf dem iPhone.
   Gemeinsame Bausteine: .mob-btn, .mob-segmented, .mob-chip, .switch.
   ====================================================================== */
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  /* --- Knöpfe --- */
  .mob-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 20px; border-radius: 999px; border: none;
    font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
    cursor: pointer; text-decoration: none;
    transition: transform 0.12s ease, background-color 0.2s ease, opacity 0.2s ease;
  }
  .mob-btn:active { transform: scale(0.97); }
  .mob-btn:disabled { opacity: 0.4; cursor: default; transform: none; }
  .mob-btn:focus-visible, .mob-chip:focus-visible, .mob-segmented button:focus-visible,
  .mob-icon-btn:focus-visible, .mob-tile:focus-visible, .mob-item-main:focus-visible,
  .mob-profile-link:focus-visible, .mob-swap:focus-visible { outline: 3px solid var(--accent-wash); outline-offset: 2px; box-shadow: 0 0 0 1.5px var(--accent); }
  .mob-btn-primary { background: var(--accent-fill); color: #fff; }
  .mob-btn-secondary { background: var(--accent-wash); color: var(--accent); }
  .mob-btn-tinted { background: var(--accent-wash); color: var(--accent); min-height: 36px; font-size: 14px; padding: 0 16px; }
  .mob-btn.is-busy { position: relative; color: transparent; }
  .mob-btn.is-busy::after {
    content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--accent); border-right-color: transparent; animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .mob-icon-btn {
    width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-wash); color: var(--text-primary);
  }
  .mob-icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .mob-icon-btn svg .fill { fill: currentColor; stroke: none; }

  /* --- Segmente (Dauer, Bewertung) --- */
  .mob-segmented {
    display: inline-flex; padding: 2px; border-radius: 10px;
    background: color-mix(in srgb, var(--text-primary) 7%, transparent);
  }
  .mob-segmented button {
    border: none; background: transparent; color: var(--text-primary);
    font: inherit; font-size: 13.5px; font-weight: 500; padding: 7px 14px; min-height: 32px;
    border-radius: 8px; cursor: pointer; transition: background-color 0.2s ease, box-shadow 0.2s ease;
  }
  .mob-segmented button.is-on { background: var(--surface-1); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.04); }
  :root[data-theme="dark"] .mob-segmented button.is-on { background: #3a3a3c; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mob-segmented button.is-on { background: #3a3a3c; } }
  .mob-segmented-lg { display: flex; width: 100%; }
  .mob-segmented-lg button { flex: 1; min-height: 40px; font-size: 14.5px; }

  /* --- Chips --- */
  .mob-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .mob-chip {
    border: none; border-radius: 999px; padding: 8px 14px; min-height: 36px;
    font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
    background: color-mix(in srgb, var(--text-primary) 6%, transparent); color: var(--text-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  .mob-chip.is-on { background: var(--accent-fill); color: #fff; }
  .mob-chip.is-static { cursor: default; min-height: 0; padding: 5px 11px; font-size: 12.5px; }

  /* --- Schalter (wie iOS) --- */
  input.switch {
    appearance: none; -webkit-appearance: none; flex: none;
    width: 51px; height: 31px; border-radius: 999px; margin: 0; cursor: pointer; position: relative;
    background: color-mix(in srgb, var(--text-primary) 16%, transparent); transition: background-color 0.25s ease;
  }
  input.switch::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
    background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 1px 1px rgba(0,0,0,0.16);
    transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1);
  }
  input.switch:checked { background: #34c759; }
  input.switch:checked::after { transform: translateX(20px); }
  input.switch:disabled { opacity: 0.4; cursor: default; }
  input.switch:focus-visible { outline: 3px solid var(--accent-wash); outline-offset: 2px; }

  /* --- Strichfigur --- */
  .mob-fig { display: block; width: 100%; height: 100%; color: var(--text-primary); overflow: visible; }
  .mob-fig-limb, .mob-fig-trunk { fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
  .mob-fig-foot { stroke-width: 3.2; }
  .mob-fig-head { fill: currentColor; }
  .mob-fig-far { opacity: 0.3; }
  .mob-fig-floor { stroke: var(--grid); stroke-width: 0.8; }
  .mob-fig-shadow { fill: color-mix(in srgb, var(--text-primary) 6%, transparent); }
  .mob-fig-prop { stroke: var(--baseline); stroke-width: 2.2; stroke-linecap: round; }
  .mob-fig-prop-fill { fill: var(--baseline); }
  .mob-fig-band { stroke: var(--accent); stroke-width: 1.4; fill: none; stroke-linecap: round; }
  .mob-fig-focus { fill: var(--accent); opacity: 0.22; transform-box: fill-box; transform-origin: center; animation: mob-pulse 2.4s ease-in-out infinite; }
  @keyframes mob-pulse { 0%, 100% { transform: scale(0.85); opacity: 0.16; } 50% { transform: scale(1.15); opacity: 0.3; } }
  @media (prefers-reduced-motion: reduce) { .mob-fig-focus { animation: none; } }

  /* --- Mobility-Tab --- */
  .mob-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 300px); gap: 24px; align-items: center; padding: 28px 30px; }
  .mob-eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
  .mob-hero-title { margin: 0; font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; }
  .mob-hero-sub { margin: 10px 0 0; font-size: 15.5px; line-height: 1.45; color: var(--text-secondary); max-width: 46ch; }
  .mob-hero-meta { margin: 10px 0 0; font-size: 14px; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
  .mob-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
  .mob-hero-actions .mob-btn-primary { min-width: 140px; }
  .mob-hero-fig { aspect-ratio: 6 / 5; width: 100%; border-radius: 18px; background: color-mix(in srgb, var(--text-primary) 3.5%, transparent); padding: 8px 10px 4px; }
  .mob-status { margin: 12px 0 0; font-size: 13.5px; color: var(--text-secondary); min-height: 1em; }
  .mob-status:empty { margin: 0; min-height: 0; }
  .mob-status.ok { color: var(--c-good-text); }
  .mob-status.warn { color: var(--c-warn-text); }
  .mob-status.err { color: var(--c-crit-text); }

  .mob-options { display: flex; flex-direction: column; gap: 14px; }
  .mob-option-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: center; }
  .mob-option-label, .tp-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
  .mob-profile-link {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
    margin-top: 2px; padding: 12px 14px; border: none; border-radius: 14px; cursor: pointer; text-align: left;
    background: color-mix(in srgb, var(--text-primary) 4%, transparent); color: var(--text-primary); font: inherit;
  }
  .mob-profile-link-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .mob-profile-link-title { font-size: 14.5px; font-weight: 600; }
  .mob-profile-link-sub { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mob-chevron { font-size: 22px; line-height: 1; color: var(--text-muted); flex: none; }

  .mob-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
  .mob-section-head h2 { margin: 0; }
  .mob-count { font-size: 13px; color: var(--text-muted); }
  .mob-plan-wrap { display: flex; gap: 8px; align-items: center; }
  .mob-plan-date { width: auto; min-height: 36px; }

  .mob-list { list-style: none; margin: 0; padding: 0; }
  .mob-item { display: flex; align-items: center; gap: 4px; border-top: 0.5px solid var(--border); }
  .mob-item:first-child { border-top: none; }
  .mob-item-main {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 10px 4px;
    border: none; background: none; cursor: pointer; text-align: left; color: inherit; font: inherit; border-radius: 12px;
  }
  .mob-item-fig { flex: none; width: 72px; height: 60px; border-radius: 12px; background: color-mix(in srgb, var(--text-primary) 3.5%, transparent); padding: 3px; }
  .mob-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  .mob-item-name { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
  .mob-item-meta { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
  .mob-item-note { font-size: 13px; color: var(--text-secondary); }
  .mob-swap {
    flex: none; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
    background: none; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center;
  }
  .mob-swap:hover { background: var(--accent-wash); color: var(--accent); }
  .mob-swap svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  .mob-lib-filter { margin-bottom: 14px; }
  .mob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .mob-tile {
    display: flex; flex-direction: column; gap: 3px; padding: 10px 10px 12px; text-align: left;
    border: none; border-radius: 16px; cursor: pointer; font: inherit; color: inherit;
    background: color-mix(in srgb, var(--text-primary) 3.5%, transparent);
    transition: transform 0.15s ease, background-color 0.2s ease;
  }
  .mob-tile:hover { background: color-mix(in srgb, var(--text-primary) 6%, transparent); }
  .mob-tile:active { transform: scale(0.98); }
  .mob-tile-fig { display: block; aspect-ratio: 6 / 5; margin-bottom: 4px; }
  .mob-tile-name { font-size: 14px; font-weight: 600; line-height: 1.25; }
  .mob-tile-meta { font-size: 12px; color: var(--text-muted); }
  .mob-tile-badge { font-size: 11.5px; color: var(--c-warn-text); margin-top: 2px; }
  .mob-tile.is-muted .mob-tile-fig { opacity: 0.45; }

  .mob-history { list-style: none; margin: 0; padding: 0; }
  .mob-history-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 12px; padding: 10px 0; border-top: 0.5px solid var(--border); }
  .mob-history-item:first-child { border-top: none; }
  .mob-history-date { grid-row: span 2; font-size: 13px; color: var(--text-muted); padding-top: 1px; }
  .mob-history-title { font-size: 14.5px; font-weight: 600; }
  .mob-history-meta { font-size: 13px; color: var(--text-muted); }
  .mob-disclaimer { margin: 6px 4px 24px; font-size: 12.5px; color: var(--text-muted); text-align: center; }

  /* --- Anleitung (Bottom-Sheet) --- */
  .mob-sheet-overlay {
    position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(0,0,0,0); transition: background-color 0.25s ease;
  }
  .mob-sheet-overlay.is-open { background: rgba(0,0,0,0.38); }
  .mob-sheet {
    position: relative; width: min(560px, 100%); max-height: min(92vh, 900px); overflow-y: auto;
    background: var(--surface-1); border-radius: 22px 22px 0 0; padding: 10px 24px calc(24px + var(--safe-bottom));
    transform: translateY(100%); transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
  }
  .mob-sheet-overlay.is-open .mob-sheet { transform: none; }
  @media (min-width: 700px) {
    .mob-sheet-overlay { align-items: center; }
    .mob-sheet { border-radius: 22px; transform: translateY(24px) scale(0.98); opacity: 0; transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease; }
    .mob-sheet-overlay.is-open .mob-sheet { opacity: 1; }
  }
  .mob-sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--baseline); margin: 0 auto 6px; }
  .mob-sheet-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; }
  .mob-sheet-close svg { width: 15px; height: 15px; }
  .mob-sheet-fig { aspect-ratio: 6 / 5; max-width: 340px; margin: 6px auto 4px; }
  .mob-sheet-title { margin: 4px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; text-align: center; }
  .mob-sheet-meta { margin: 4px 0 10px; text-align: center; font-size: 13.5px; color: var(--text-muted); }
  .mob-sheet-areas { justify-content: center; margin-bottom: 8px; }
  .mob-sheet h3 { margin: 18px 0 6px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
  .mob-sheet p { margin: 0; font-size: 15px; line-height: 1.5; }
  .mob-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
  .mob-steps li { counter-increment: step; position: relative; padding: 6px 0 6px 36px; font-size: 15px; line-height: 1.45; }
  .mob-steps li::before {
    content: counter(step); position: absolute; left: 0; top: 5px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--accent-wash); color: var(--accent); font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }
  .mob-mistakes { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.5; }
  .mob-variants { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
  .mob-variant { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
  .mob-variant-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 3px; }
  .mob-variant p { font-size: 14px; }
  .mob-sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
  .mob-sheet-actions .mob-btn { width: 100%; }

  /* --- Mitmach-Modus (Vollbild) --- */
  body.mob-player-open { overflow: hidden; }
  body.mob-player-open #confirm-overlay { z-index: 260; }
  .mob-player {
    position: fixed; inset: 0; z-index: 250; display: flex; flex-direction: column;
    background: var(--surface-1); color: var(--text-primary);
    padding: calc(12px + var(--safe-top)) max(16px, var(--safe-right)) calc(16px + var(--safe-bottom)) max(16px, var(--safe-left));
    opacity: 0; transform: scale(1.02); transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .mob-player.is-open { opacity: 1; transform: none; }
  .mob-player-top { display: flex; align-items: center; gap: 14px; }
  .mob-progress { flex: 1; display: flex; gap: 4px; }
  .mob-progress-seg { flex: 1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text-primary) 12%, transparent); overflow: hidden; }
  .mob-progress-fill { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 0.25s linear; }
  .mob-player-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: 28px; align-items: center; max-width: 1100px; width: 100%; margin: 0 auto; }
  .mob-player-stage { position: relative; aspect-ratio: 6 / 5; width: 100%; max-height: 70vh; border-radius: 28px; background: color-mix(in srgb, var(--text-primary) 3.5%, transparent); padding: 4% 5% 2%; }
  .mob-player-fig { width: 100%; height: 100%; }
  .mob-player-badge {
    position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
    padding: 7px 14px; border-radius: 999px; background: var(--accent-fill); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap;
  }
  .mob-player-info { display: flex; flex-direction: column; align-items: center; text-align: center; }
  .mob-player-kicker { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
  .mob-player-name { margin: 6px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; }
  .mob-player-note { margin: 8px 0 0; font-size: 15px; color: var(--text-secondary); max-width: 34ch; }
  .mob-timer { position: relative; width: 168px; height: 168px; margin: 22px 0 6px; }
  .mob-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
  .mob-timer circle { fill: none; stroke-width: 8; }
  .mob-timer-track { stroke: color-mix(in srgb, var(--text-primary) 9%, transparent); }
  .mob-timer-bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.22s linear; }
  .mob-player[data-phase="prep"] .mob-timer-bar, .mob-player[data-phase="switch"] .mob-timer-bar { stroke: #ff9f0a; }
  .mob-timer-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 46px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
  .mob-player.is-paused .mob-timer-num { opacity: 0.45; }
  .mob-player-sub { margin: 4px 0 0; min-height: 1.4em; font-size: 15px; color: var(--text-secondary); }
  .mob-player-controls { display: flex; align-items: center; gap: 22px; margin-top: 18px; }
  .mob-ctrl { width: 52px; height: 52px; background: color-mix(in srgb, var(--text-primary) 6%, transparent); }
  .mob-ctrl-main { width: 72px; height: 72px; background: var(--accent-fill); color: #fff; }
  .mob-ctrl-main svg { width: 28px; height: 28px; }
  .mob-player-howto { margin-top: 20px; width: 100%; max-width: 380px; text-align: left; }
  .mob-player-howto summary { cursor: pointer; text-align: center; font-size: 14.5px; font-weight: 600; color: var(--accent); list-style: none; padding: 8px; }
  .mob-player-howto summary::-webkit-details-marker { display: none; }
  .mob-player-howto ol { margin: 6px 0 0; padding-left: 22px; font-size: 14.5px; line-height: 1.5; }
  .mob-player-feel { margin: 8px 0 0; font-size: 14px; color: var(--text-secondary); }

  .mob-done { grid-column: 1 / -1; max-width: 480px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
  .mob-done-check svg { width: 76px; height: 76px; }
  .mob-done-check circle { fill: #34c759; }
  .mob-done-check path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: mob-check 0.45s 0.15s ease forwards; }
  @keyframes mob-check { to { stroke-dashoffset: 0; } }
  .mob-done-title { margin: 14px 0 0; font-size: 32px; font-weight: 700; letter-spacing: -0.025em; }
  .mob-done-sub { margin: 4px 0 18px; color: var(--text-muted); font-size: 15px; }
  .mob-done-group { border: none; padding: 0; margin: 14px 0 0; width: 100%; }
  .mob-done-group legend { font-size: 15px; font-weight: 600; margin: 0 auto 10px; padding: 0; }
  .mob-done-group .mob-chips { justify-content: center; }
  .mob-done-btn { margin-top: 26px; width: 100%; }

  /* --- Trainingsprofil-Karte --- */
  .tp-section { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
  .tp-group { border: none; padding: 0; margin: 18px 0 0; }
  .tp-group legend { padding: 0; margin-bottom: 10px; }
  .tp-hint { font-weight: 400; color: var(--text-muted); font-size: 13px; }
  .tp-textarea { width: 100%; resize: vertical; min-height: 60px; }
  .tp-mobility { padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--text-primary) 3.5%, transparent); gap: 12px; }
  .tp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .tp-saved { margin: 14px 0 0; font-size: 13px; color: var(--c-good-text); opacity: 0; transition: opacity 0.3s ease; min-height: 1em; }
  .tp-saved.is-visible { opacity: 1; }

  /* --- KI-Coach-Karte --- */
  .ai-status-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; font-size: 15px; font-weight: 500; }
  .ai-status-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--baseline); }
  .ai-status-dot.on { background: #34c759; box-shadow: 0 0 0 4px rgba(52,199,89,0.16); }
  .ai-status-dot.warn { background: #ff9f0a; }
  .settings-list { margin-top: 14px; border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--text-primary) 3.5%, transparent); }
  .settings-list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; min-height: 50px; border-top: 0.5px solid var(--border); }
  .settings-list-row:first-child { border-top: none; }
  .settings-list-row label { font-size: 14.5px; font-weight: 500; flex: none; }
  .settings-list-row .coach-input { max-width: 300px; flex: 1; }
  .settings-list-foot { margin-top: 8px; }
  .settings-disclosure { margin-top: 18px; border-top: 0.5px solid var(--border); padding-top: 10px; }
  .settings-disclosure summary { cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--accent); padding: 6px 0; }

  /* --- Mobility im Plan-Dialog --- */
  .plan-mob-start { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 4px 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--accent-wash); }
  .plan-mob-start-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
  .plan-mob-start-text span { color: var(--text-secondary); font-size: 13px; }

  @media (max-width: 760px) {
    .mob-hero { grid-template-columns: 1fr; padding: 20px; gap: 14px; }
    .mob-hero-fig { order: -1; max-width: 360px; justify-self: center; }
    .mob-hero-title { font-size: 26px; }
    .mob-hero-actions .mob-btn { flex: 1; }
    .mob-option-row { grid-template-columns: 1fr; gap: 8px; }
    .mob-segmented:not(.mob-segmented-lg) { display: flex; }
    .mob-segmented:not(.mob-segmented-lg) button { flex: 1; padding: 7px 6px; }
    .mob-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .mob-variants { grid-template-columns: 1fr; }
    .mob-player-body { grid-template-columns: 1fr; grid-template-rows: auto auto; gap: 10px; align-content: start; overflow-y: auto; padding-top: 12px; }
    .mob-player-stage { max-height: 38vh; margin: 0 auto; width: auto; height: 38vh; }
    .mob-player-name { font-size: 24px; }
    .mob-timer { width: 132px; height: 132px; margin-top: 12px; }
    .mob-timer-num { font-size: 36px; }
    .mob-section-head { align-items: flex-start; }
    .settings-list-row { flex-wrap: wrap; }
    .settings-list-row .coach-input { max-width: none; }
  }
  #training-profile-card, #ai-settings-card, #app-update-card, #garmin-settings-card { scroll-margin-top: 96px; }
  #ai-settings-card .coach-settings-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
  #ai-settings-card .coach-settings-row .update-btn { width: auto; flex: none; min-height: 40px; padding: 0 18px; font-size: 14px; }
  .mob-chips[data-group="painAreas"] .mob-chip.is-on { background: #ff9f0a; color: #1d1d1f; }
  .mob-hero .mob-hero-title { margin: 0; font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; }
  @media (max-width: 760px) { .mob-hero .mob-hero-title { font-size: 26px; } }

  /* --- Login / Konto erstellen --- */
  .login-card { max-width: 400px; gap: 16px; padding: 30px 28px 26px; }
  .login-card h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; text-align: center; }
  .login-card > .card-sub { text-align: center; margin: -6px 0 2px; font-size: 14px; line-height: 1.45; }
  .login-brand { display: flex; justify-content: center; margin-bottom: 2px; }
  .login-brand span { width: 22px; height: 22px; border-radius: 50%; margin: 0 -4px; opacity: 0.92; }
  .login-brand span:nth-child(1) { background: var(--c-schwimmen); }
  .login-brand span:nth-child(2) { background: var(--c-rad); }
  .login-brand span:nth-child(3) { background: var(--c-laufen); }
  .login-mode { display: flex; }
  .login-mode button { flex: 1; }
  .login-fields { display: flex; flex-direction: column; gap: 12px; }
  .login-field { display: flex; flex-direction: column; gap: 6px; }
  .login-field > span { font-size: 13.5px; font-weight: 600; }
  .login-field .coach-input { min-height: 44px; font-size: 16px; } /* 16px: iPhone zoomt sonst beim Tippen */
  .login-hint { font-size: 12.5px; color: var(--text-muted); }
  .login-code { letter-spacing: 0.12em; font-variant-numeric: tabular-nums; text-transform: uppercase; }
  .login-remember { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--text-primary) 4%, transparent); cursor: pointer; }
  .login-remember > span { display: flex; flex-direction: column; font-size: 14.5px; font-weight: 500; }
  .login-remember small { font-size: 12.5px; color: var(--text-muted); font-weight: 400; }
  .login-submit { width: 100%; }
  .login-error { text-align: center; font-size: 13.5px; }

  /* --- Freunde einladen (Einstellungen) --- */
  .invite-code-box { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 14px 0 6px; padding: 18px; border-radius: 16px; background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
  .invite-code-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
  .invite-code { font-size: 30px; font-weight: 700; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; user-select: all; }
  .invite-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
  .invite-accounts { list-style: none; margin: 8px 0 0; padding: 0; }
  .invite-accounts li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; border-top: 0.5px solid var(--border); font-size: 14.5px; }
  .invite-accounts li:first-child { border-top: none; }
  .invite-accounts small { color: var(--text-muted); font-size: 13px; }
  .invite-accounts-title { margin: 18px 0 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
  #invite-card { scroll-margin-top: 96px; }
  /* "hidden" muss auch bei Elementen mit display:flex gewinnen */
  .login-card [hidden], .mob-player [hidden], #view-mobility [hidden], #invite-card [hidden] { display: none !important; }

  /* Mobility: ganze Seitenbreite wie die anderen Tabs - Ablauf auf breiten
     Bildschirmen zweispaltig, Zeichnung im Kopf groesser. */
  .mob-hero { grid-template-columns: minmax(0, 1fr) minmax(220px, 420px); }
  @media (min-width: 1100px) {
    .mob-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
    .mob-item:nth-child(2) { border-top: none; }
    .mob-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  }

  /* Einstellungen: Unterzeile in Listen-Zeilen */
  .settings-list-row label small, .garmin-import-text small { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
  .app-update-auto { margin: 4px 0 12px; }

  /* Aus Garmin übernehmen */
  .garmin-import-btn { margin: 0 0 12px; }
  .garmin-import-row { cursor: pointer; }
  .garmin-import-text { display: flex; flex-direction: column; font-size: 14.5px; font-weight: 500; }
  .garmin-import-info { margin: 12px 2px 0 !important; font-size: 13px !important; color: var(--text-muted); }
  .garmin-import-sheet [hidden] { display: none !important; }

  /* Onboarding: Garmin verbinden */
  .onb-garmin { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--accent-wash); display: flex; flex-direction: column; gap: 10px; }
  .onb-garmin-text { display: flex; flex-direction: column; gap: 3px; font-size: 14.5px; }
  .onb-garmin-text span { color: var(--text-secondary); font-size: 13.5px; }
  .onb-garmin-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .onb-garmin-form .coach-input { flex: 1 1 220px; min-height: 40px; }
  .onb-garmin-form a { flex-basis: 100%; font-size: 13px; }
  .onb-garmin [hidden] { display: none !important; }

  .update-menu-sync.ok { color: var(--c-good-text); }
  .update-menu-sync.err { color: var(--c-crit-text); }
  .update-menu-sync a.sync-hint { color: var(--accent); }
  /* Kraft im Mitmach-Modus: Gewicht anpassen, Satz-Knopf mit Haken */
  .mob-weight { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
  .mob-weight .mob-icon-btn { width: 40px; height: 40px; font-size: 22px; font-weight: 600; }
  .mob-weight-val { min-width: 84px; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .mob-player.is-manual .mob-timer-num { font-size: 56px; }
  .mob-player.is-manual .mob-ctrl-main { background: #34c759; }
  .mob-player[data-phase="rest"] .mob-timer-bar { stroke: #34c759; }
