:root {
  /* Fallback (Dark) bis das Settings-Theme per JS geladen ist — vermeidet einen Farbblitz beim Start. */
  --bg: #08090a;
  --surface: #151613;
  --surface-2: #1e201c;
  --border: #2c2e28;
  --text: #f3f2ea;
  --text-dim: #a3a599;
  --text-faint: #63655c;
  --accent: #c6ff00;
  --accent-text: #14150d;
  --danger: #ff5c5c;
  --success: #6adf8a;
  --rec-low: #ff4757;
  --rec-mid: #ffc933;
  --rec-high: #3ff08a;
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 48px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --kb-inset: 0px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-glide: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-0: 80ms;
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --dur-4: 420ms;
  --press: 0.97;
  --press-deep: 0.94;

  /* Material */
  --blur-material: blur(20px) saturate(180%);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 40%, transparent);
  /* Aus --accent abgeleitet statt fix dunkel — sonst im hellen Theme ein
     fast schwarzer Fleck (frueher: hartkodiertes dunkles accentDim aus theme.ts). */
  --accent-dim: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
  --tabbar-h: 68px;

  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme='dark'] {
  --bg: #08090a;
  --surface: #151613;
  --surface-2: #1e201c;
  --border: #2c2e28;
  --text: #f3f2ea;
  --text-dim: #a3a599;
  --text-faint: #63655c;
  --danger: #ff5c5c;
  --success: #6adf8a;
  --rec-low: #ff4757;
  --rec-mid: #ffc933;
  --rec-high: #3ff08a;
  color-scheme: dark;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.45), 0 10px 28px rgba(0, 0, 0, 0.36);
  --shadow-3: 0 8px 16px rgba(0, 0, 0, 0.5), 0 24px 56px rgba(0, 0, 0, 0.45);
}

[data-theme='light'] {
  --bg: #f7f6f0;
  --surface: #ffffff;
  --surface-2: #eeece2;
  --border: #dcdacd;
  --text: #14150d;
  --text-dim: #55564c;
  --text-faint: #8b8c80;
  --danger: #d43d3d;
  --success: #1f8a4c;
  --rec-low: #e01b32;
  --rec-mid: #d68a00;
  --rec-high: #00a352;
  color-scheme: light;

  /* Deutlich schwaecher als dunkel, sonst wirkt es auf hellem Grund schmutzig. */
  --shadow-1: 0 1px 2px rgba(20, 21, 13, 0.06), 0 3px 10px rgba(20, 21, 13, 0.06);
  --shadow-2: 0 2px 5px rgba(20, 21, 13, 0.07), 0 8px 20px rgba(20, 21, 13, 0.08);
  --shadow-3: 0 6px 14px rgba(20, 21, 13, 0.09), 0 20px 44px rgba(20, 21, 13, 0.12);
}

/* Rot als Akzent wuerde sonst neben dem strukturell aehnlichen Loeschen-Rot
   (--danger) verschwimmen — beim roten Akzent auf einen erkennbar anderen,
   tieferen Ton ausweichen. data-accent wird bereits von applyTheme gesetzt,
   war bisher aber ungenutzt. */
[data-accent='red'] {
  --danger: #b3261e;
}
[data-theme='light'][data-accent='red'] {
  --danger: #8c1d17;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body,
#root {
  height: 100%;
  height: 100dvh;
}

body {
  background: var(--bg);
  color: var(--text);
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3 {
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
}

.screen {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(var(--safe-top) + 20px) 20px calc(24px + var(--tabbar-h) + var(--safe-bottom));
}

/* Tab-Wechsel: einmaliger Slide beim Mount (key={tab} erzwingt Remount).
   --tab-dir (1 = vorwaerts/rechts, -1 = zurueck/links) wird von App.tsx
   anhand der Tab-Reihenfolge gesetzt, Default 1 falls mal nicht gesetzt. */
.tab-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: tab-in var(--dur-3) var(--ease-glide);
}
@keyframes tab-in {
  from {
    opacity: 0;
    transform: translateX(calc(var(--tab-dir, 1) * 18px));
  }
}

/* Karten faden beim Screen-Eintritt gestaffelt ein, nicht bei jedem Re-Render.
   fill-mode "backwards" statt "both": verhindert das Aufblitzen vor dem
   verzögerten Start, lässt den transform danach aber auf "none" zurückfallen —
   sonst bliebe die Karte dauerhaft containing block für position:fixed-Kinder
   (z.B. Sheets), die dann in der Karte statt im Viewport verankern. */
.tab-view .card {
  animation: card-in var(--dur-3) var(--ease-out) backwards;
}
.tab-view .card:nth-of-type(1) {
  animation-delay: 0ms;
}
.tab-view .card:nth-of-type(2) {
  animation-delay: 40ms;
}
.tab-view .card:nth-of-type(3) {
  animation-delay: 80ms;
}
.tab-view .card:nth-of-type(n + 4) {
  animation-delay: 120ms;
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.screen__title {
  font-size: 28px;
  margin-bottom: 20px;
}

/* Karten */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-1);
}

.card + .card {
  margin-top: 14px;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* Tab-Bar unten — Milchglas-Overlay, Inhalt scrollt sichtbar darunter durch.
   .app hat dafuer position:relative bekommen; .screen hat unten genug
   Platz (--tabbar-h) eingerechnet, damit nichts verdeckt wird. */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  min-height: var(--tabbar-h);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: var(--blur-material);
  -webkit-backdrop-filter: var(--blur-material);
  padding-bottom: var(--safe-bottom);
  z-index: 10;
}

.tabbar__btn {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 9px 2px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  transition: color var(--dur-2);
  white-space: nowrap;
}

.tabbar__btn:active .tabbar__icon {
  transform: scale(var(--press));
  transition: transform var(--dur-0) var(--ease-out);
}

.tabbar__btn--active {
  color: var(--accent);
}

.tabbar__icon {
  position: relative;
  display: flex;
  line-height: 1;
  transition: transform var(--dur-4) var(--ease-spring);
}

.tabbar__btn--active .tabbar__icon {
  transform: translateY(-2px) scale(1.08);
}

/* Weicher Schimmer hinter dem aktiven Tab-Icon */
.tabbar__btn--active .tabbar__icon::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: var(--accent-glow);
  filter: blur(6px);
  z-index: -1;
  animation: glow-in var(--dur-3) var(--ease-out);
}
@keyframes glow-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

/* Utility */
.muted {
  color: var(--text-dim);
}
.faint {
  color: var(--text-faint);
}
.center {
  text-align: center;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.grow {
  flex: 1;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.spin {
  animation: spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Button — Druck asymmetrisch wie iOS: schnell rein, mit Feder zurueck.
   Die Basisregel setzt die langsame Feder-Ruecktransition; :active
   ueberschreibt sie mit der kurzen linearen Eingangstransition. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  transition: transform var(--dur-4) var(--ease-spring), background var(--dur-2), opacity var(--dur-2);
  user-select: none;
}
.btn:active {
  transform: scale(var(--press));
  transition: transform var(--dur-0) var(--ease-out);
}
.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn--secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost {
  background: transparent;
  color: var(--accent);
  min-height: var(--tap);
  padding: 0 12px;
}
.btn--danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
}
.btn--block {
  display: flex;
  width: 100%;
}
.btn--lg {
  min-height: 56px;
  font-size: 17px;
}

/* NumberInput (Stepper) */
.numinput {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.numinput__btn {
  width: var(--tap);
  min-height: var(--tap);
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-4) var(--ease-spring), background var(--dur-2);
}
.numinput__btn:active {
  background: var(--accent-dim);
  transform: scale(var(--press));
  transition: transform var(--dur-0) var(--ease-out), background var(--dur-1);
}
.numinput__field {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 20px;
  font-weight: 650;
  -moz-appearance: textfield;
}
.numinput__field::-webkit-outer-spin-button,
.numinput__field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.numinput__field:focus {
  outline: none;
}
.numinput__unit {
  align-self: center;
  padding-right: 14px;
  color: var(--text-faint);
  font-size: 14px;
  font-weight: 600;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 7px;
}

/* Text input */
.textinput {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 16px;
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
.textinput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Sheet / Modal — Milchglas statt reiner Abdunklung, der Blur uebernimmt
   die optische Trennung von der Abdunklung. */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  animation: fade var(--dur-2) ease;
}
.sheet-backdrop--closing {
  animation: fade var(--dur-2) ease reverse forwards;
  pointer-events: none;
}
.sheet-backdrop--stacked {
  visibility: hidden;
  pointer-events: none;
}
.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--border);
  padding: 10px 20px calc(20px + max(var(--safe-bottom), var(--kb-inset, 0px)));
  max-height: 85vh;
  max-height: calc(85dvh - var(--kb-inset, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-3);
  animation: slideup var(--dur-3) var(--ease-out);
  /* Federt zurueck, wenn ein Wegwisch-Zug losgelassen wird ohne zu schliessen
     (Sheet.tsx setzt dragY zurueck auf 0). Waehrend des aktiven Ziehens
     uebernimmt .sheet--dragging und schaltet diese Transition ab, damit
     transform 1:1 dem Finger folgt statt hinterherzuhinken. */
  transition: transform var(--dur-4) var(--ease-spring);
}
.sheet--closing {
  animation: slideup var(--dur-3) var(--ease-out) reverse forwards;
}
/* Waehrend des Wegwisch-Ziehens steuert Sheet.tsx transform per Inline-Style —
   die Mount-/Exit-Keyframes duerfen dabei nicht gegenlaufen. */
.sheet--dragging {
  animation: none;
  transition: none;
}
.sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 6px auto 14px;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes slideup {
  from {
    transform: translateY(100%);
  }
}

/* Range Toggle — gleitende Pille statt Farbueberblendung pro Button.
   Kein gap: die Pillenbreite ist genau 1/--seg-count der Innenflaeche,
   ein gap wuerde die translateX-Rechnung gegenueber den Button-Breiten
   verschieben. Die Trennung zwischen den Segmenten uebernimmt die Pille. */
.range-toggle {
  position: relative;
  display: flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.range-toggle__pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / var(--seg-count, 1));
  border-radius: 8px;
  background: var(--accent);
  box-shadow: var(--shadow-1);
  transform: translateX(calc(var(--seg-index, 0) * 100%));
  transition: transform var(--dur-4) var(--ease-glide);
}
.range-toggle__btn {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 36px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color var(--dur-2), transform var(--dur-4) var(--ease-spring);
}
.range-toggle__btn:active {
  transform: scale(var(--press));
  transition: transform var(--dur-0) var(--ease-out);
}
.range-toggle__btn--active {
  color: var(--accent-text);
}

/* Chip select (Trainingsart, Metrik-Auswahl, …) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  transition: background var(--dur-2), color var(--dur-2), border-color var(--dur-2),
    transform var(--dur-4) var(--ease-spring);
}
.chip:active {
  transform: scale(var(--press));
  transition: transform var(--dur-0) var(--ease-out);
}
.chip--active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.textarea {
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 16px;
  line-height: 1.4;
  resize: vertical;
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Charts: zeichnen sich beim Mount, nicht bei jedem Datenwechsel. React
   aktualisiert bei neuen Werten nur die d-/cx-/cy-Attribute desselben Knotens
   (kein Re-Mount) — eine CSS-Animation feuert dann nicht erneut. Sie laeuft
   also nur, wenn der Chart wirklich neu in den DOM kommt (z.B. Tab-Eintritt). */
.line-chart__line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: line-draw var(--dur-4) var(--ease-out) forwards;
}
@keyframes line-draw {
  to {
    stroke-dashoffset: 0;
  }
}
.line-chart__area {
  opacity: 0;
  animation: chart-fade-in var(--dur-3) var(--ease-out) 200ms forwards;
}
.line-chart__dot {
  opacity: 0;
  animation: chart-fade-in var(--dur-2) var(--ease-out) 380ms forwards;
}
@keyframes chart-fade-in {
  to {
    opacity: 1;
  }
}

.bar-chart__bar {
  transform-box: fill-box;
  transform-origin: bottom;
  transform: scaleY(0);
  animation: bar-grow var(--dur-4) var(--ease-spring) forwards;
}
@keyframes bar-grow {
  to {
    transform: scaleY(1);
  }
}
/* Datums-Navigation */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.date-nav__btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--accent);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.date-nav__btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}
.date-nav__label {
  font-weight: 650;
  font-size: 15px;
}

/* Makro-Fortschritt */
.macro-row + .macro-row {
  margin-top: 16px;
}
.macro-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}
.macro-row__label {
  font-weight: 650;
  font-size: 14px;
}
.macro-row__value {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.macro-row__percent {
  font-weight: 650;
}
.macro-row__track {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.macro-row__fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--dur-3) var(--ease-out), background-color var(--dur-2);
}

/* Mahlzeiten-Liste */
.meal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
}
.meal-row + .meal-row {
  border-top: 1px solid var(--border);
}
.meal-row__name {
  font-weight: 650;
  font-size: 15px;
  margin-bottom: 3px;
}
.meal-row__macros {
  font-size: 13px;
  color: var(--text-faint);
}
.meal-row__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.meal-row__action {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.meal-row__action--danger {
  color: var(--danger);
}

.goals-gear {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.meal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.meal-form > div {
  min-width: 0;
}
.meal-form__full {
  grid-column: 1 / -1;
}

/* Mahlzeit-Kategorie-Picker */
.meal-category-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.meal-category-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
}
.meal-category-chip--active {
  border-color: var(--accent);
  color: var(--accent);
}

/* Mahlzeit-Kategorie-Sektionen */
.meal-category-section + .meal-category-section {
  margin-top: 22px;
}
.meal-category-section__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text-dim);
}
.meal-category-section__label {
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Supplement-Checkliste */
.supplement-count {
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.supplement-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 14px;
}
.supplement-progress__fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width var(--dur-3) var(--ease-out);
}
.supplement-slot + .supplement-slot {
  margin-top: 14px;
}
.supplement-slot__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: var(--text-dim);
  padding: 2px 0;
}
.supplement-slot__head:disabled {
  opacity: 1;
}
.supplement-slot__label {
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.supplement-slot__time {
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.supplement-slot__done {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.supplement-slot__rows {
  margin-top: 8px;
}
.supplement-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.supplement-row + .supplement-row {
  border-top: 1px solid var(--border);
}
.supplement-row__check {
  display: flex;
  flex-shrink: 0;
}
.supplement-row__name {
  font-weight: 650;
  font-size: 15px;
  margin-bottom: 2px;
}
.supplement-row__dose {
  font-size: 13px;
  color: var(--text-faint);
}
.supplement-row--done .supplement-row__name {
  color: var(--text-faint);
  text-decoration: line-through;
}
.supplement-manage {
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
  padding: 4px 2px;
}
.supplement-row__optional {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  color: var(--text-faint);
}
.supplement-row__delete {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Supplement-Sheet: Zeitpunkt-Picker (6 feste Slots) */
.supplement-slot-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.supplement-slot-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
}
.supplement-slot-chip--active {
  border-color: var(--accent);
  color: var(--accent);
}
.supplement-slot-chip__time {
  font-size: 10px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* Wasser-Tracker */
.water-stand {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.water-stand__liters {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-faint);
}
.water-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 16px;
}
.water-actions .btn--ghost {
  flex: 0 0 auto;
  width: 44px;
  font-size: 20px;
}

/* Barcode-Scan-Sheet */
.scan-recent {
  margin-bottom: 14px;
}
.scan-recent__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}
.scan-recent__item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  text-align: left;
}
.scan-recent__item:active {
  background: var(--surface-2);
}
.scan-recent__name {
  font-weight: 600;
  font-size: 14px;
}
.scan-recent__brand {
  font-size: 12px;
  color: var(--text-faint);
}
.scan-recent__kcal {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.scan-video-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.scan-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-frame {
  position: absolute;
  inset: 18% 10%;
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  opacity: 0.85;
  pointer-events: none;
}
.scan-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  background: #000;
}
.scan-video-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  background: color-mix(in srgb, #000 70%, transparent);
  transition: transform var(--dur-0) var(--ease-out);
}
.scan-video-start:active {
  transform: scale(var(--press));
}

.scan-hit {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 8px;
}
.scan-hit__name {
  font-size: 17px;
  font-weight: 700;
  margin-top: 10px;
}
.scan-hit__brand {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
.scan-hit__macro {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 8px;
}

.scan-manual {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.scan-manual .textinput {
  flex: 1;
}
/* Plan-Liste */
.plan-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.plan-card__name {
  font-size: 17px;
  font-weight: 650;
}
.plan-card__desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
.plan-card__meta {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 8px;
}
.plan-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.plan-card__actions .btn {
  flex: 1;
  min-height: 40px;
  padding: 0 10px;
  font-size: 14px;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: var(--accent);
  color: var(--accent-text);
}

/* Wochenansicht */
.plan-week__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.plan-day {
  width: 100%;
  text-align: left;
  display: block;
}
.plan-day--rest {
  opacity: 0.55;
}
.plan-day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.plan-day__title {
  font-size: 15px;
  font-weight: 650;
}
.plan-day__focus {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}
.plan-day__chevron {
  color: var(--text-faint);
  font-size: 13px;
  flex-shrink: 0;
}
.plan-day__exercises {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.plan-day__ex {
  font-size: 14px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.plan-day__ex b {
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.plan-day__more {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 8px;
}

/* Tag-Editor: Übungszeilen */
.plan-ex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
}
.plan-ex-row + .plan-ex-row {
  border-top: 1px solid var(--border);
}
.plan-ex-row__idx {
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 650;
  width: 18px;
  flex-shrink: 0;
}
.plan-ex-row__name {
  font-weight: 650;
  font-size: 15px;
}
.plan-ex-row__meta {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 2px;
}
.plan-ex-row__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.plan-ex-row__action {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.plan-ex-row__action--danger {
  color: var(--danger);
}

.plan-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.plan-form-grid > div {
  min-width: 0;
}
.plan-form-grid__full {
  grid-column: 1 / -1;
}

.plan-picker-btn {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 16px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.plan-picker-btn--empty {
  color: var(--text-faint);
}

/* Plan-Hinweis in der Heute-Ansicht */
.plan-today-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dim);
}
.plan-today-hint b {
  color: var(--text);
  font-weight: 650;
}
/* Idle */
.workout-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  padding: 48px 0 20px;
}
.workout-idle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
}
.workout-idle__hint {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
  max-width: 260px;
}

/* Timer-Kopf */
.timer {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.timer__value {
  font-size: 40px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.timer__label {
  font-size: 13px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

/* Übungs-Karte */
.exercise-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.exercise-card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  min-width: 0;
  text-align: left;
}
.exercise-card__name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.exercise-card__name {
  font-size: 17px;
  font-weight: 650;
}
.exercise-card__planned,
.exercise-card__last,
.exercise-card__target {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
  margin-top: 3px;
}

/* Übung komplett: alle Ziel-Sätze erledigt — dezenter Farbstich, kein neues
   Grün, nutzt das bestehende --success-Token (wie bei positiven Deltas). */
.exercise-card--complete {
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
}

/* Satz-Zeilen: erledigt (Statistik-relevant), aktiv (editierbar), Geist (Ziel, noch offen) */
.set-row {
  display: grid;
  grid-template-columns: 24px 1fr 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.set-row + .set-row {
  border-top: 1px solid var(--border);
}
.set-row__idx {
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.set-row__val {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.set-row__val b {
  font-weight: 650;
}
.set-row__del {
  color: var(--text-faint);
  font-size: 18px;
  width: 32px;
  height: 32px;
}

.set-row--done {
  grid-template-columns: 24px 2fr auto auto;
}
.set-row__vals {
  display: flex;
  gap: 10px;
  text-align: left;
  min-width: 0;
}
.set-row__delta {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.set-row__delta--up {
  color: var(--success);
}
.set-row__delta--down {
  color: var(--danger);
}

.set-row--active {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 2px 0;
}
.set-row--active.set-row + .set-row--active {
  border-top: none;
}
.set-active__head {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.set-row__confirm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--dur-4) var(--ease-spring);
}
.set-row__confirm:active {
  transform: scale(var(--press));
  transition: transform var(--dur-0) var(--ease-out);
}
.set-row__confirm--wide {
  width: 100%;
  height: var(--tap);
  border-radius: var(--radius-sm);
  font-size: 16px;
  gap: 8px;
}

.set-row--editing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 2px 0;
}
.set-row__edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.set-row--prompt {
  display: block;
  padding: 14px 0;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

.set-row--ghost {
  opacity: 0.45;
}
.set-row--ghost .set-row__idx,
.set-row--ghost .set-row__val {
  color: var(--text-faint);
}

.exercise-card__volume {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.exercise-card__volume--up {
  color: var(--success);
}
.exercise-card__volume--down {
  color: var(--danger);
}

.numinput {
  min-width: 0;
}

/* Autocomplete */
.autocomplete {
  position: relative;
}
.autocomplete__list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.autocomplete__item {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  text-align: left;
}
.autocomplete__item:active {
  background: var(--surface-2);
}
.autocomplete__item--create {
  color: var(--accent);
  font-weight: 600;
}

/* Zusammenfassung */
.summary-hero {
  text-align: center;
  padding: 10px 0 6px;
}
.summary-hero__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.summary-hero__title {
  font-size: 24px;
  margin-top: 6px;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.stat--wide {
  grid-column: 1 / -1;
}
.stat__label {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat__value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat__sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
.intensity--up {
  color: var(--success);
}
.intensity--down {
  color: var(--danger);
}

/* Pause-Timer */
.rest-timer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: celebration-modal-backdrop-in var(--dur-2) ease;
}
.rest-timer {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px 24px;
  animation: celebration-modal-in var(--dur-3) var(--ease-spring);
}
.rest-timer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rest-timer__title {
  font-size: 16px;
  font-weight: 650;
}
.rest-timer__sound-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
}
.rest-timer__ring {
  width: 180px;
  height: 180px;
  margin: 20px auto;
  display: block;
}
.rest-timer__ring circle {
  transition: stroke-dashoffset var(--dur-1) linear;
}
.rest-timer__countdown {
  font-size: 44px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  fill: var(--text);
}
.rest-timer__adjust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}
.rest-timer__adjust-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-0) var(--ease-out);
}
.rest-timer__adjust-btn:active {
  transform: scale(var(--press));
}
.rest-timer__adjust-val {
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: center;
}
.rest-timer__skip {
  width: 100%;
  height: var(--tap);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 600;
}

/* Übungs-Verlauf-Sheet */
.exercise-history__badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.exercise-history__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.exercise-history__row-date {
  color: var(--text-dim);
  font-weight: 600;
}
.exercise-history__row-val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Readiness-Banner: Volumen heute reduziert */
.workout-banner {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-dim);
}
.workout-banner--amber {
  background: color-mix(in srgb, #f5a623 14%, var(--surface-2));
  border-color: color-mix(in srgb, #f5a623 40%, var(--border));
  color: var(--text);
}
.month-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  margin: 22px 0 10px;
}
.month-header:first-child {
  margin-top: 0;
}

.history-item {
  display: block;
  width: 100%;
  text-align: left;
}
.history-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.history-item__date {
  font-size: 15px;
  font-weight: 650;
}
.history-item__duration {
  font-size: 13px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.history-item__note {
  font-size: 14px;
  color: var(--text-dim);
  margin: 8px 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.history-item__meta {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-faint);
}

.detail-set-row {
  display: grid;
  grid-template-columns: 24px 1fr 1fr;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
}
.detail-set-row + .detail-set-row {
  border-top: 1px solid var(--border);
}
.detail-exercise + .detail-exercise {
  margin-top: 18px;
}
.detail-exercise__name {
  font-weight: 650;
  margin-bottom: 6px;
}
.training-overview__date {
  font-size: 15px;
  font-weight: 650;
}

.training-exercise-line {
  font-size: 14px;
  color: var(--text-dim);
}
.training-exercise-line + .training-exercise-line {
  margin-top: 4px;
}

.training-chart-label {
  margin-top: 18px;
  margin-bottom: 8px;
}
.training-chart-label:first-of-type {
  margin-top: 4px;
}
/* Aufgaben-Zeile (geteilt zwischen Coach-Tab und Kalender-Tab) */
.todo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.todo-row + .todo-row {
  margin-top: 8px;
}
.todo-row__check {
  display: flex;
  flex-shrink: 0;
}
/* Icon wechselt Circle<->CheckCircle2 als eigene Komponenteninstanz (kein
   gemeinsames SVG zum Transitionieren) — TodoRow.tsx gibt dem Wrapper einen
   auf `done` gekeyten key, damit dieser Pop bei jedem Umschalten neu feuert. */
.todo-row__check-icon {
  display: flex;
  animation: check-pop var(--dur-2) var(--ease-spring);
}
@keyframes check-pop {
  from {
    transform: scale(0.6);
  }
}
.todo-row__title {
  position: relative;
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transition: color var(--dur-2);
}
/* Durchstreichen als gezeichnete Linie statt hartem text-decoration-Umschalten. */
.todo-row__title::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-3) var(--ease-out);
}
.todo-row__time {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
  transition: color var(--dur-2);
}
.todo-row--done .todo-row__title {
  color: var(--text-faint);
}
.todo-row--done .todo-row__title::after {
  transform: scaleX(1);
}
.todo-row--done .todo-row__time {
  color: var(--text-faint);
}

.todo-day-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-dim);
  margin: 14px 0 8px;
}
.todo-day-label:first-child {
  margin-top: 0;
}
/* Coach-Tab: Garmin-Dashboard + Wochenplan */

.coach-hello {
  margin-bottom: 20px;
}
.coach-hello__kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 2px;
}
.coach-hello__title {
  margin-bottom: 0;
}

.coach-banner {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-dim);
}
.coach-banner--amber {
  background: color-mix(in srgb, #f5a623 14%, var(--surface-2));
  border-color: color-mix(in srgb, #f5a623 40%, var(--border));
  color: var(--text);
}
.coach-banner__link {
  color: #f5a623;
  font-weight: 700;
  text-decoration: underline;
}

.coach-today__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.coach-today__head .section-label {
  margin-bottom: 10px;
}
.coach-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  padding: 2px 4px 12px;
  min-height: var(--tap);
}
.coach-refresh:disabled {
  color: var(--text-faint);
}
.coach-refresh__stand {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.coach-warn {
  color: var(--danger);
  font-size: 14px;
  padding: 8px 0;
}
.coach-warn code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 13px;
}

/* Stat-Kacheln (Heute) */
.coach-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.coach-stat {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
}
/* Anklickbare Kachel (Schlaf, Schritte, Kalorien) */
.coach-stat--tap {
  position: relative;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  transition: transform var(--dur-4) var(--ease-spring), border-color var(--dur-2);
}
.coach-stat--tap:active {
  transform: scale(var(--press-deep));
  transition: transform var(--dur-0) var(--ease-out);
}
.coach-stat--tap::after {
  content: '›';
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--text-faint);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.coach-stat__label {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.coach-stat__value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.coach-stat__sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
}

/* Wochenplan */
.coach-plan__summary {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.coach-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.coach-plan__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
}
.coach-plan__row--today {
  border-color: var(--accent);
}
.coach-plan__day {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  width: 28px;
  text-transform: uppercase;
}
.coach-plan__body {
  flex: 1;
  min-width: 0;
}
.coach-plan__title {
  font-size: 15px;
  font-weight: 600;
}
.coach-plan__meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}
.coach-plan__mark {
  color: var(--success);
  font-weight: 700;
  font-size: 18px;
  width: 20px;
  text-align: center;
}
.coach-plan__notes {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Metrik-Detail-Sheet (Schlaf / Schritte / Kalorien) */
.metric-sheet__head {
  margin-bottom: 14px;
}
.metric-sheet__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.metric-sheet__big {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.metric-sheet__sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
.metric-sheet__chart {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  margin-top: 14px;
}

/* Schlafphasen-Farben — hell/dunkel via Theme-Variablen */
[data-theme='dark'] {
  --sleep-deep: #4d5bd0;
  --sleep-light: #6ea8f0;
  --sleep-rem: #9d7bf0;
  --sleep-awake: #e8a24a;
}
[data-theme='light'] {
  --sleep-deep: #3f4bb8;
  --sleep-light: #4f8fe0;
  --sleep-rem: #7d5bd8;
  --sleep-awake: #c47f28;
}
:root {
  --sleep-deep: #4d5bd0;
  --sleep-light: #6ea8f0;
  --sleep-rem: #9d7bf0;
  --sleep-awake: #e8a24a;
}

.hypno-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 14px;
}
.hypno-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hypno-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.hypno-legend__label {
  font-size: 13px;
  color: var(--text-dim);
}
.hypno-legend__val {
  margin-left: auto;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* Kalorien-Aufschlüsselung */
.cal-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.cal-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cal-row__label {
  font-size: 14px;
  color: var(--text-dim);
  width: 110px;
  flex-shrink: 0;
}
.cal-row__bar {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: var(--surface-2);
  overflow: hidden;
}
.cal-row__fill {
  height: 100%;
  border-radius: 5px;
}
.cal-row__val {
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  width: 74px;
  text-align: right;
  flex-shrink: 0;
}

/* Schritte-Ring */
.step-ring-card__tap {
  display: block;
  width: 100%;
  text-align: center;
  border-radius: var(--radius-sm);
  transition: transform var(--dur-0) var(--ease-out);
}
.step-ring-card__tap:active {
  transform: scale(var(--press));
}
.step-ring {
  width: 180px;
  height: 180px;
  margin: 4px auto 0;
  display: block;
}
.step-ring circle {
  transition: stroke-dashoffset var(--dur-3) var(--ease-out);
}
.step-ring__pct {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  fill: var(--text);
}
.step-ring__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  fill: var(--text-faint);
}
.step-ring__sub {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Kalorienbilanz (Verbrauch vs. Intake) */
.cal-balance {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cal-balance__result {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.cal-balance__net {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cal-balance__net--good {
  color: var(--success);
}
.cal-balance__net--low {
  color: #f5a623;
}
.cal-balance__net--bad {
  color: var(--danger);
}
.cal-balance__hint {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
.cal-balance__target {
  margin-top: 14px;
}
.cal-balance__target-label {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 6px;
}

/* Session-Detail-Sheet */
.coach-sheet h3 {
  font-size: 20px;
  margin-bottom: 4px;
}
.coach-sheet__list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.coach-sheet__list li {
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.coach-sheet__badge {
  margin-top: 14px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* Wochen-Rückblick */
.weekly-review-card {
  display: block;
  width: 100%;
  text-align: left;
}
.weekly-review-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.weekly-review-card__range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 6px;
}
.badge--amber {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #f5a623 22%, var(--surface));
  color: #f5a623;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.weekly-review-card__preview {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.weekly-review-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  padding: 0 4px;
  width: 100%;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}
.weekly-review-list__item + .weekly-review-list__item {
  border-top: 1px solid var(--border);
}

/* Erholung (Recovery Battery) */
.recovery-overall {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.recovery-overall__pct {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.recovery-overall__label {
  font-size: 13px;
  font-weight: 650;
  margin-top: 2px;
}
.recovery-overall__label--low {
  color: var(--rec-low);
}
.recovery-overall__label--mid {
  color: var(--rec-mid);
}
.recovery-overall__label--high {
  color: var(--rec-high);
}
.recovery-overall__source {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 4px;
}

.recovery-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recovery-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.recovery-row__name {
  font-size: 14px;
  font-weight: 600;
  width: 74px;
  flex-shrink: 0;
}
.recovery-row__pct {
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}
.recovery-row__pct--low {
  color: var(--rec-low);
}
.recovery-row__pct--mid {
  color: var(--rec-mid);
}
.recovery-row__pct--high {
  color: var(--rec-high);
}

/* CSS-gezeichnete Batterie: Huelle + Segmente + Pol */
.recovery-battery {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.recovery-battery--low {
  --rec-color: var(--rec-low);
}
.recovery-battery--mid {
  --rec-color: var(--rec-mid);
}
.recovery-battery--high {
  --rec-color: var(--rec-high);
}
.recovery-battery__body {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
}
.recovery-battery__nub {
  width: 3px;
  height: 10px;
  background: var(--text-faint);
  border-radius: 0 2px 2px 0;
  margin-left: 1px;
}
.recovery-battery__seg {
  flex: 1;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text-faint) 22%, transparent);
  transition: background var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}
.recovery-battery__seg--on {
  background: var(--rec-color);
  box-shadow: 0 0 6px color-mix(in srgb, var(--rec-color) 55%, transparent);
}

.recovery-battery--lg .recovery-battery__body {
  width: 64px;
  height: 30px;
}
.recovery-battery--lg .recovery-battery__nub {
  height: 14px;
}
.recovery-battery--sm {
  flex: 1;
  min-width: 0;
}
.recovery-battery--sm .recovery-battery__body {
  flex: 1;
  min-width: 0;
  height: 10px;
}
.recovery-battery--sm .recovery-battery__nub {
  height: 5px;
}

/* Volumen pro Muskelgruppe (MEV/MAV/MRV) */
.vol-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vol-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vol-row__name {
  font-size: 14px;
  font-weight: 600;
  width: 74px;
  flex-shrink: 0;
}
.vol-row__bar {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: var(--surface-2);
  overflow: hidden;
}
.vol-row__fill {
  height: 100%;
  border-radius: 5px;
  transition: width var(--dur-3) var(--ease-out);
}
.vol-row__fill--under {
  background: var(--text-faint);
}
.vol-row__fill--optimal {
  background: var(--success);
}
.vol-row__fill--high {
  background: #f5a623;
}
.vol-row__fill--over {
  background: var(--danger);
}
.vol-row__marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--surface);
  opacity: 0.7;
}
.vol-row__val {
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  width: 62px;
  text-align: right;
  flex-shrink: 0;
}
.vol-row__val--under {
  color: var(--text-faint);
}
.vol-row__val--optimal {
  color: var(--success);
}
.vol-row__val--high {
  color: #f5a623;
}
.vol-row__val--over {
  color: var(--danger);
}
.kalender-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kalender-nav {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-4) var(--ease-spring);
}
.kalender-nav:active {
  transform: scale(var(--press));
  transition: transform var(--dur-0) var(--ease-out);
}
.kalender-title {
  font-size: 16px;
  font-weight: 650;
}

.kalender-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.kalender-grid--header {
  margin-bottom: 6px;
}
.kalender-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-faint);
  text-transform: uppercase;
  padding-bottom: 4px;
}

.kalender-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background var(--dur-2), color var(--dur-2), transform var(--dur-4) var(--ease-spring);
}
.kalender-cell:active {
  transform: scale(var(--press));
  transition: transform var(--dur-0) var(--ease-out);
}
.kalender-cell--out {
  color: var(--text-faint);
  opacity: 0.5;
}
.kalender-cell--today {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.kalender-cell--selected {
  background: var(--accent);
  color: var(--accent-text);
}
.kalender-cell--selected.kalender-cell--out {
  opacity: 1;
}

.kalender-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.kalender-cell--selected .kalender-dot {
  background: var(--accent-text);
}

/* Wochen-Zeitraster */
.week-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  max-height: 62vh;
  max-height: 62dvh;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.week-grid {
  display: grid;
  grid-template-columns: 48px repeat(7, 92px);
  grid-template-rows: auto auto repeat(24, var(--hour-px, 56px));
  width: max-content;
}

.week-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.week-dayhead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  gap: 2px;
}
.week-dayhead__name {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  color: var(--text-faint);
}
.week-dayhead__num {
  font-size: 14px;
  font-weight: 650;
}
.week-dayhead--today .week-dayhead__num {
  color: var(--accent-text);
  background: var(--accent);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-allday-label,
.week-hour-label {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  border-right: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-faint);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4px 6px 0 0;
  white-space: nowrap;
}
.week-allday-label {
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.week-allday-cell {
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  padding: 4px;
  min-height: 32px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.week-cell {
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  padding: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.week-col--today {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.week-chip {
  width: 100%;
  text-align: left;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.week-chip--done {
  background: var(--surface-2);
  color: var(--text-faint);
  text-decoration: line-through;
}
/* Chat-Tab v1 */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  max-height: 60vh;
  overflow-y: auto;
}
.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.chat-bubble--user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-text);
}
.chat-bubble--assistant {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
}
.chat-bubble--system {
  align-self: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
}
.chat-bubble--pending {
  color: var(--text-faint);
}

.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.chat-input .textinput {
  flex: 1;
}

.chat-preview-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.chat-preview-card__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.chat-preview-card__item:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}
.chat-preview-card__name {
  font-size: 14px;
  color: var(--text);
}
.chat-preview-card__meta {
  font-size: 12px;
  color: var(--text-dim);
}
.chat-preview-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  animation: splash-exit 0.5s ease 1.3s forwards;
  cursor: pointer;
}

.splash__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 360px;
  height: 360px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: 0;
  filter: blur(4px);
  animation: splash-glow 2.6s ease-in-out infinite;
}

.splash__logo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash__logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  opacity: 0;
  transform: scale(0.6);
  filter: drop-shadow(0 0 0 transparent);
  animation: splash-logo-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1.3) 0.1s forwards;
}

.splash__ring {
  position: absolute;
  inset: -14px;
  border-radius: 30px;
  border: 1.5px solid var(--accent);
  opacity: 0;
  transform: scale(0.85);
  animation: splash-ring 1.4s ease-out 0.35s forwards;
}

.splash__title {
  display: flex;
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.03em;
  opacity: 0;
  transform: translateY(10px);
  animation: splash-text-in 0.6s ease 0.5s forwards;
}

.splash__title-accent {
  color: var(--accent);
  text-shadow: 0 0 22px var(--accent-glow);
}

.splash__byline {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  opacity: 0;
  animation: splash-text-in 0.6s ease 0.75s forwards;
}

.splash__progress {
  position: absolute;
  bottom: calc(52px + var(--safe-bottom));
  width: 120px;
  height: 3px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
  opacity: 0;
  animation: splash-text-in 0.4s ease 0.9s forwards;
}

.splash__progress-bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  animation: splash-progress 0.9s linear 0.9s forwards;
}

@keyframes splash-logo-in {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  60% {
    opacity: 1;
    transform: scale(1.06);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 26px var(--accent-glow));
  }
}

@keyframes splash-ring {
  0% {
    opacity: 0.9;
    transform: scale(0.85);
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes splash-glow {
  0%,
  100% {
    opacity: 0.18;
  }
  50% {
    opacity: 0.34;
  }
}

@keyframes splash-text-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splash-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes splash-exit {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash,
  .splash__glow,
  .splash__logo,
  .splash__ring,
  .splash__title,
  .splash__byline,
  .splash__progress,
  .splash__progress-bar {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .splash__ring {
    display: none;
  }
}
/* Toast (klein/mittel) */
@keyframes celebration-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.celebration-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 76px);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--accent);
  font-weight: 650;
  font-size: 14px;
  animation: celebration-toast-in var(--dur-2) var(--ease-out);
}
.celebration-toast--out {
  animation: celebration-toast-in var(--dur-2) var(--ease-out) reverse forwards;
}

/* Modal (groß) */
@keyframes celebration-modal-backdrop-in {
  from {
    opacity: 0;
  }
}
@keyframes celebration-modal-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}
.celebration-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: celebration-modal-backdrop-in var(--dur-2) ease;
}
.celebration-modal {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px 24px;
  text-align: center;
  animation: celebration-modal-in var(--dur-3) var(--ease-spring);
}
.celebration-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
}
.celebration-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.celebration-modal__title {
  font-size: 20px;
  margin-bottom: 6px;
}
.celebration-modal__stats {
  color: var(--text-dim);
  font-size: 14px;
}

/* Minimal-Effekt (GlowPulse) */
@keyframes glow-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
  }
  70% {
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
  }
}
.glow-pulse {
  border-radius: var(--radius-sm);
  animation: glow-pulse 1.2s ease-out;
}
.swatch-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.swatch {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform var(--dur-4) var(--ease-spring), border-color var(--dur-2);
}

.swatch:active {
  transform: scale(var(--press));
  transition: transform var(--dur-0) var(--ease-out);
}

.swatch--active {
  border-color: var(--text);
}

/* Weiß-Akku ist im hellen Theme sonst ein weißer Kreis auf weißem Grund. */
.swatch[data-accent-key='white']:not(.swatch--active) {
  border-color: var(--border);
}

/* Federnder Ring statt starrem Rahmen-Umschalten — pusht bei jeder neuen
   Auswahl frisch rein, weil die Pseudo-Element-Animation beim Anlegen von
   .swatch--active neu startet. */
.swatch--active::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid var(--text);
  animation: swatch-ring-in var(--dur-4) var(--ease-spring);
}
@keyframes swatch-ring-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

.gear-btn {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  right: 16px;
  z-index: 40;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-4) var(--ease-spring);
}

.gear-btn:active {
  transform: scale(var(--press));
  transition: transform var(--dur-0) var(--ease-out);
}

.profile-btn {
  right: 64px;
}

.cal-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  color: var(--text-dim);
}

.cal-status--ok {
  color: var(--success);
}

.cal-log-item__week {
  font-weight: 650;
  font-size: 14px;
}

.settings-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  padding: 0 4px;
  width: 100%;
  color: var(--text);
  font-weight: 600;
}

.settings-link-btn__chevron {
  color: var(--text-faint);
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.photo-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  border: 2px solid transparent;
}
.photo-tile--selected {
  border-color: var(--accent);
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-tile__check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(11, 15, 20, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
}
.photo-tile--selected .photo-tile__check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.photo-upload-btn {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
}
.photo-upload-btn__icon {
  font-size: 22px;
}

.selection-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
}

/* Vergleichsansicht */
.compare-grid {
  display: grid;
  gap: 8px;
}
.compare-grid img {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
}
.compare-caption {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 4px;
  text-align: center;
}

.compare-slider {
  --pos: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.compare-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.compare-slider__after {
  clip-path: inset(0 0 0 var(--pos));
  will-change: clip-path;
}
.compare-slider__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 3px;
  background: var(--accent);
  transform: translateX(-50%);
  will-change: left;
}
.compare-slider__grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.compare-slider__label {
  position: absolute;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(11, 15, 20, 0.65);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}
.compare-slider__label--left {
  left: 10px;
}
.compare-slider__label--right {
  right: 10px;
}
.metric-list {
  display: flex;
  flex-direction: column;
}
.metric-card {
  padding: 14px 0;
}
.metric-card + .metric-card {
  border-top: 1px solid var(--border);
}
.metric-card__label {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.metric-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.metric-card__value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.metric-card__value--empty {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 15px;
}
.metric-card__edit {
  display: flex;
  align-items: center;
  gap: 10px;
}
.metric-card__edit .numinput {
  flex: 1;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.profile-back-btn {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 16px;
  right: auto;
}

/* Der fixe Zurück-Kreis sitzt links über dem Content — Titel aller Profil-
   Unteransichten (inkl. der unveränderten PhotosTab) brauchen Platz dafür. */
.tab-view:has(.profile-back-btn) .screen__title {
  padding-left: 48px;
}
