/* ============================================================================
   PRECHTSTUDIO FITNESS - GRUNDGERÜST
   3 Schichten: Header (fixed top) | Content (scroll) | Nav (fixed bottom)
   ============================================================================ */

:root {
  --bg: #0d0d0f;
  --card: #141417;
  --card2: #1c1c1f;
  --border: #2a2a2e;
  --text: #ffffff;
  --text3: rgba(235, 235, 245, 0.6);
  --accent: #1E88E5;
  --orange: #ff9f0a;
  --green: #30d158;
  --purple: #bf5af2;
  --radius: 16px;

  --header-height: 64px;
  --week-slider-height: 74px;
  --nav-height: 90px;
}

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

/* ── Splash Screen ── */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s ease;
}

#splash-screen.splash-hide {
  opacity: 0;
  pointer-events: none;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.splash-icon {
  width: 56px;
  height: 56px;
  background: var(--orange);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  margin-bottom: 4px;
}

.splash-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}

.splash-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html, body {
  width: 100%;
  /* 100vh statt 100dvh: dvh liefert beim iOS-PWA-Kaltstart bis zur ersten Rotation eine zu kurze Höhe */
  height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  touch-action: manipulation;
}

/* ===== HEADER: fixed ganz oben, volle Breite ===== */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(20, 20, 23, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 0 0 22px 22px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  padding-top: env(safe-area-inset-top);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.header-title {
  font-size: 26px;
  font-weight: 800;
}

.header-gear {
  background: none;
  border: none;
  cursor: pointer;
  width: 26px;
  height: 26px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-gear svg {
  width: 100%;
  height: 100%;
}

.header-gear .png-icon {
  width: 100%;
  height: 100%;
}

/* ===== CONTENT: scrollbar, zwischen Header und Nav ===== */
#app-content {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(var(--header-height) + env(safe-area-inset-top));
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.body-locked {
  position: fixed;
  left: 0;
  right: 0;
  overflow: hidden;
}

body.has-week-slider #app-content {
  padding-top: calc(var(--header-height) + var(--week-slider-height) + env(safe-area-inset-top));
}

#app-content::-webkit-scrollbar {
  display: none;
}

.page {
  display: none;
}

.page.active {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  justify-content: flex-start;
  gap: 12px;
  padding-bottom: 12px;
}

/* ===== Wochenslider: im Header von Training & Ernährung, per Wischen ===== */
.week-slider {
  padding: 0 16px 12px;
  touch-action: pan-y;
}

.week-slider-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.week-day-name {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text3);
}

.week-day-num {
  font-size: 15px;
  font-weight: 700;
}

.week-day.is-today .week-day-num {
  color: var(--accent);
}

.week-day.active {
  background: var(--accent);
  border-color: var(--accent);
}

.week-day.active .week-day-name,
.week-day.active .week-day-num {
  color: #fff;
}

.week-day-dots {
  display: flex;
  align-items: center;
  height: 6px;
}

.week-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 0;
}

.week-day-dot:first-child {
  border-radius: 3px 0 0 3px;
}

.week-day-dot:last-child {
  border-radius: 0 3px 3px 0;
}

.week-day-dot:only-child {
  border-radius: 3px;
}

.week-day-dot.orange { background: var(--orange); }
.week-day-dot.green { background: var(--green); }
.week-day-dot.purple { background: var(--purple); }

.header-streak {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--orange);
  font-size: 15px;
  font-weight: 800;
}

.header-streak svg {
  width: 20px;
  height: 20px;
}

.placeholder {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 16px;
  margin: 0 16px 12px;
  font-size: 16px;
  font-weight: 600;
}

/* Gewichts-Kachel (Ernährung) */
.weight-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 16px;
  padding: 24px 16px;
}

.weight-tile-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  text-align: center;
  margin-bottom: 18px;
}

.weight-tile-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.weight-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.weight-btn:active {
  background: var(--orange);
}

.weight-tile-val {
  min-width: 140px;
  text-align: center;
}

.weight-tile-val #weight-tile-num {
  font-size: 44px;
  font-weight: 800;
}

.weight-tile-unit {
  font-size: 16px;
  color: var(--text3);
  margin-left: 6px;
}

/* ===== NAVIGATION: fixed ganz unten ===== */
#app-nav {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 0 16px;
  pointer-events: none;
}

.nav-inner {
  display: flex;
  background: rgba(20, 20, 23, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 28px;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  min-height: 52px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 22px;
  transition: all 0.2s;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.nav-item.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active svg {
  opacity: 1;
}

/* Einfarbige PNG-Icons (vom Nutzer bereitgestellt): per CSS-Maske eingefärbt,
   damit sie wie die SVG-Icons currentColor annehmen */
.png-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  vertical-align: -0.15em;
}

.nav-item .png-icon {
  width: 22px;
  height: 22px;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.nav-item.active .png-icon {
  opacity: 1;
}

/* ============================================================================
   DASHBOARD CONTENT
   ============================================================================ */

/* Greeting */
.dash-greeting-wrap {
  padding: 16px 16px 4px;
}

.dash-greeting {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.dash-date {
  font-size: 15px;
  color: var(--text3);
  margin-top: 4px;
}

/* Stat Tiles */
.dash-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 16px;
}

.dash-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
}

.dash-tile-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.dash-tile-sub {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 10px;
}

/* Kachel-Grid: 10 pro Reihe, quadratisch */
.dash-tile-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  margin-bottom: auto;
}

.dash-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.dash-cell.green { background: var(--green); }
.dash-cell.orange { background: var(--orange); }
.dash-cell.purple { background: var(--purple); }

/* Progress Bar */
.dash-tile-prog {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.dash-tile-prog-fill {
  height: 100%;
  border-radius: 2px;
}

.dash-tile-stat {
  font-size: 13px;
  color: var(--text3);
}

.dash-tile-stat span {
  color: var(--text);
  font-weight: 700;
}

/* Training Tile */
.training-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 16px 12px;
  position: relative;
  overflow: hidden;
  min-height: 110px;
}

.training-tile-bg {
  position: absolute;
  right: -10px;
  bottom: -10px;
  font-size: 90px;
  opacity: 0.07;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.training-tile-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.tt-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 19px;
}

.training-tile-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  margin-bottom: 2px;
}

.training-tile-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.training-tile-meta {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 4px;
}

.training-tile-muscles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.muscle-tag {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(30, 136, 229, 0.18);
  color: var(--accent);
}

.training-tile-empty .training-tile-bg {
  opacity: 0.04;
}

.training-tile-empty .training-tile-name {
  color: var(--text3);
  font-weight: 700;
  font-size: 16px;
}

/* Zentrierte Tiles (Kalorien, Cardio) */
.dash-tile-center {
  display: flex;
  flex-direction: column;
}

.kcal-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.kcal-ring-wrap svg {
  width: 100%;
  height: 100%;
  max-width: 100px;
  max-height: 100px;
}

.kcal-ring-center {
  position: absolute;
  text-align: center;
}

.kcal-ring-val {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.kcal-ring-divider {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

/* Section Header */
.section-hdr {
  padding: 20px 16px 10px;
}

.section-lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Today Workout Rows */
.tw-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 16px 8px;
}

.twi {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.tw-info {
  flex: 1;
}

.tw-name {
  font-size: 15px;
  font-weight: 600;
}

.tw-sub {
  font-size: 13px;
  color: var(--text3);
  margin-top: 1px;
}

.tw-arrow {
  color: rgba(255, 255, 255, 0.3);
  font-size: 20px;
}

/* ============================================================================
   SETTINGS OVERLAY
   ============================================================================ */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.overlay.active {
  display: flex;
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 14px;
  border-bottom: 0.5px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
}

.overlay-back,
.overlay-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  visibility: hidden;
}

.overlay-back.visible,
#add-food-overlay .overlay-back,
#quick-entry-overlay .overlay-back {
  visibility: visible;
}

#add-food-overlay .overlay-header,
#quick-entry-overlay .overlay-header {
  justify-content: space-between;
}

.overlay-close {
  visibility: visible;
  font-size: 18px;
}

.overlay-title {
  font-size: 17px;
  font-weight: 700;
}
.session-preview-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 1; text-align: center;
}

.overlay-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
  transition: max-height 0.25s ease;
}

.settings-view {
  display: none;
  max-width: 100%;
  box-sizing: border-box;
}
/* Prevent overflow on settings view content without creating new containing block */
.settings-view.active {
  overflow-x: clip;
}

.settings-view.active {
  display: block;
}

.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 4px;
}

.settings-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 16px;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.1s ease;
}

.settings-menu-item:active {
  opacity: 0.7;
}

.settings-menu-item:last-child {
  border-bottom: none;
}

.settings-menu-item-danger {
  color: var(--red, #e5484d);
}

.settings-menu-arrow {
  margin-left: auto;
  color: var(--text3);
}

.settings-menu-hdr {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin: 22px 0 10px;
}

.settings-menu-hdr:first-child {
  margin-top: 0;
}

.settings-logout-btn {
  color: var(--red, #e5484d);
}

.smi-badge {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.smi-badge .png-icon {
  width: 18px;
  height: 18px;
}

.smi-badge-gray { background: rgba(255, 255, 255, 0.08); }
.smi-badge-orange { background: var(--orange); }
.smi-badge-purple { background: #8b5cf6; }
.smi-badge-gold { background: #d4a93a; }
.smi-badge-blue { background: #3b82f6; }
.smi-badge-green { background: var(--green); }

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--border);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  overflow: hidden;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-list-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-list-item-name {
  font-size: 15px;
  font-weight: 700;
}

.user-list-item-role {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.user-list-item-delete {
  background: none;
  border: none;
  color: var(--red, #e5484d);
  font-size: 18px;
  cursor: pointer;
}

.measurement-list-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.measurement-list-item-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
}

.measurement-list-item-vals {
  font-size: 13px;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.measurement-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.goal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.goal-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  color: var(--text3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.goal-chip.selected {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.goal-result {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-top: 18px;
}

.goal-result-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--orange);
}

.goal-result-lbl {
  font-size: 13px;
  color: var(--text3);
  margin-top: 4px;
}

.login-wrap {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: 80px 24px 24px;
}

.login-logo {
  font-size: 48px;
  text-align: center;
  margin-bottom: 8px;
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 36px;
}

.login-error {
  color: var(--red, #e5484d);
  font-size: 13px;
  margin-top: 10px;
  min-height: 16px;
}

.login-btn {
  margin-top: 20px;
}

/* Workout list */
.workout-list-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  cursor: pointer;
}

.workout-list-item:last-child {
  margin-bottom: 0;
}

.workout-list-item-name {
  font-size: 15px;
  font-weight: 700;
}

.workout-list-item-days {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}

.workout-list-empty {
  text-align: center;
  color: var(--text3);
  font-size: 14px;
  padding: 30px 0;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

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

.profile-row-label {
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.profile-row-value {
  flex: 1;
  text-align: right;
  color: var(--text3);
  font-size: 15px;
}

.profile-row-input {
  flex: 1;
  text-align: right;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.profile-row-edit {
  color: var(--text3);
  font-size: 13px;
  flex-shrink: 0;
}

.profile-gender-chip-row {
  padding: 0 16px 14px;
}

/* Editor */
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin: 18px 0 8px;
}

.field-label:first-child {
  margin-top: 0;
}

.text-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
}

.day-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-pick {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 0;
  color: var(--text3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.day-pick.selected {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.exercise-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.exercise-row input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  font-size: 14px;
  width: 100%;
  text-align: center;
}

.exercise-row input.exercise-name {
  text-align: left;
}

.exercise-row-remove {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
}

.exercise-pick-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  font-size: 14px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.muscle-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.muscle-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  color: var(--text3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.muscle-chip.selected {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.muscle-map-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.musclemap-views {
  display: flex;
  gap: 8px;
}

.musclemap-svg {
  width: 50%;
  height: auto;
}

.musclemap-label {
  fill: var(--text3);
  font-size: 12px;
  font-weight: 600;
}

.mm-silhouette {
  fill: rgba(255, 255, 255, 0.03);
  stroke: var(--border);
  stroke-width: 1.5;
  pointer-events: none;
}

.mm-base {
  fill: rgba(255, 255, 255, 0.08);
  stroke: var(--border);
  stroke-width: 1;
  stroke-linejoin: round;
  transition: fill 0.2s;
}

.mm-secondary {
  fill: rgba(255, 159, 10, 0.35);
}

.mm-primary {
  fill: var(--orange);
}

.training-tile-start {
  width: 100%;
  background: var(--orange);
  border: none;
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}

/* ── Session Preview Overlay ─────────────────────────── */
/* ── Training tile clickable ─────────────────────────── */
.training-tile-clickable {
  cursor: pointer;
  transition: transform 0.12s;
}
.training-tile-clickable:active { transform: scale(0.98); }

/* ── Session Preview Overlay ─────────────────────────── */
.session-preview-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  border-top: 0.5px solid var(--border);
  background: var(--bg);
}
.session-preview-add-btn {
  flex: 0 0 calc(33% - 5px);
  height: 56px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.1s;
}
.session-preview-add-btn:active { opacity: 0.7; }
.session-preview-start-btn {
  flex: 1;
  height: 56px;
  background: #fff;
  border: none;
  border-radius: 16px;
  color: #000;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: opacity 0.1s;
}
.session-preview-start-btn:active { opacity: 0.85; }
.session-start-play {
  font-size: 14px;
}
.session-preview-open-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: rgba(255,159,10,0.12);
  border: 1px solid rgba(255,159,10,0.3);
  border-radius: 10px;
  color: var(--orange);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.session-preview-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: stretch;
  min-height: 100px;
  transition: opacity 0.1s;
}
.session-preview-card:active { opacity: 0.75; }
.session-preview-card.done { opacity: 0.45; }

/* image area ~28% width */
.session-preview-card-img {
  flex: 0 0 28%;
  position: relative;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.session-preview-card-img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center bottom;
}
.session-preview-card-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.session-preview-card-img-placeholder .png-icon {
  width: 36px; height: 36px;
  background-color: #fff;
  opacity: 0.55;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}

/* text body */
.session-preview-card-body {
  flex: 1; min-width: 0;
  padding: 12px 10px 12px 14px;
  display: flex; flex-direction: column; justify-content: center;
  gap: 4px;
}
.session-preview-card-muscle {
  font-size: 11px; font-weight: 700;
  color: var(--orange);
  text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-preview-card-name {
  font-size: 18px; font-weight: 800;
  line-height: 1.15; letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* info chips row (same style as sheet header chips) */
.session-preview-card-chips {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 2px;
}
.session-preview-card-chips .session-info-chip {
  font-size: 10px;
}

/* right column: only check or dot, no swap arrow */
.session-preview-card-badge {
  flex: 0 0 36px;
  display: flex; align-items: center; justify-content: center;
}
.session-preview-done-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #000;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.session-preview-active-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 6px var(--orange);
}
.session-preview-detail {
  padding: 0 16px 10px 20px;
}
.session-preview-set-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 24px;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 600;
  border-top: 0.5px solid var(--separator);
  color: var(--text);
}
.session-preview-set-row.done { opacity: 0.45; }
.session-preview-set-check { color: var(--orange); text-align: center; }

/* ── Session Bottom Sheet ────────────────────────────── */
.session-backdrop {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(0,0,0,0.6);
  display: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.session-backdrop.active { display: block; }

.session-sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 215;
  height: 90vh;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
}
.session-sheet.active { transform: translateY(0); }

.session-drag-handle-wrap {
  flex-shrink: 0;
  display: flex; justify-content: center;
  padding: 8px 0 6px; cursor: grab;
}
.session-drag-handle {
  width: 40px; height: 4px;
  border-radius: 2px; background: var(--border);
}

/* Exercise header */
.session-ex-header {
  flex-shrink: 0;
  display: flex; flex-direction: column;
  padding: 0 16px 12px;
  border-bottom: 0.5px solid var(--border);
}
.session-ex-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0 8px;
}
.session-sheet-counter {
  font-size: 11px; font-weight: 700;
  color: var(--text3);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 9px;
}
.session-sheet-close-btn {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 50%; color: var(--text3);
  font-size: 12px; width: 28px; height: 28px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* Image + text row */
.session-ex-main {
  display: flex; align-items: flex-end; gap: 12px;
  min-height: 120px;
}
.session-ex-img {
  flex: 0 0 38%;
  height: 130px;
  background: var(--card);
  border-radius: 14px;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.session-ex-img img { width: 100%; height: 100%; object-fit: cover; object-position: bottom; }
.session-ex-img-placeholder {
  font-size: 52px; opacity: 0.25; padding-bottom: 8px;
}
.session-ex-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: 2px; gap: 4px;
}
.session-ex-muscles {
  font-size: 12px; font-weight: 600;
  color: var(--text3);
}
.session-ex-name {
  font-size: 28px; font-weight: 900;
  line-height: 1.0; letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* Info chips row */
.session-ex-chips {
  display: flex; gap: 8px;
  margin-top: 12px; flex-wrap: nowrap; overflow-x: auto;
}
.session-info-chip {
  font-size: 13px; font-weight: 700;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 22px; padding: 5px 14px;
  color: var(--text); white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.session-info-chip span { color: var(--orange); }
.session-info-chip-sets {
  border-color: var(--orange);
  color: var(--orange);
}
.session-info-chip-sets span { color: var(--orange); }

/* Set table */
.session-table-wrap {
  flex: 1; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 14px;
}
.session-table-head {
  display: grid; grid-template-columns: 56px 1fr 1fr 1fr;
  padding: 10px 4px 8px;
  font-size: 13px; font-weight: 700; color: var(--text3);
  letter-spacing: 0.07em; text-transform: uppercase;
  border-bottom: 0.5px solid var(--border);
}
.session-table-head span { text-align: center; }
.session-table-row {
  display: grid; grid-template-columns: 56px 1fr 1fr 1fr 48px;
  align-items: center; padding: 14px 4px;
  border-bottom: 0.5px solid var(--separator);
  cursor: pointer; border-radius: 10px;
  position: relative; transition: background 0.1s;
}
.session-table-row:last-child { border-bottom: none; }
.session-table-row.active { background: var(--card); }
.session-table-row.active::before {
  content: ''; position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 3px; background: var(--orange); border-radius: 2px;
}
.session-table-row.done { opacity: 0.35; }
.session-table-row.warmup .session-table-cell-set { color: var(--orange); }
.session-table-cell {
  text-align: center; font-size: 18px; font-weight: 700;
}
.session-table-cell-set {
  font-size: 13px; font-weight: 600; color: var(--text3);
  display: flex; align-items: center; justify-content: center;
}
.session-table-warmup-icon {
  font-size: 18px; line-height: 1;
  color: var(--orange);
}
.session-table-warmup-icon svg { vertical-align: middle; }
.session-table-cell-rir { color: var(--text3); font-size: 13px; font-weight: 600; }
.session-pr-badge {
  font-size: 11px; font-weight: 700;
  color: #FFD700; text-align: center;
  letter-spacing: .01em;
}
.session-table-row.is-pr { opacity: 1 !important; }
.session-table-row.is-pr .session-table-cell { color: #FFD700; }

/* Summary PR */
.summary-pr { background: rgba(255,215,0,.06); border-radius: 10px; padding: 2px 6px; }
.summary-pr-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px; font-weight: 700;
  color: #FFD700;
  vertical-align: middle;
}

/* Steppers — flat layout */
.session-steppers {
  flex-shrink: 0;
  display: flex; gap: 0;
  padding: 6px 16px 10px;
  border-top: 0.5px solid var(--border);
  background: var(--card);
  border-radius: 16px 16px 0 0;
}
.session-stepper-group {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 0;
}
.session-stepper-label {
  font-size: 11px; font-weight: 700; color: var(--text3);
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 0 2px;
}
.session-stepper {
  display: flex; align-items: center;
  width: 100%; height: 52px;
}
.session-stepper-btn {
  background: none; border: none; color: var(--text3);
  font-size: 32px; font-weight: 300;
  width: 52px; height: 52px;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.1s;
}
.session-stepper-btn:active { color: var(--orange); }
.session-stepper-val {
  flex: 1; text-align: center;
  font-size: 30px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.02em;
}

/* Config panel */
.session-config-panel {
  padding: 10px 14px 0;
  border-top: 0.5px solid var(--border);
}
.session-config-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 7px 14px; align-items: center;
}
.session-config-label {
  font-size: 12px; color: var(--text3); font-weight: 600;
}
.session-config-input {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-size: 14px; padding: 7px 10px;
  width: 100%; box-sizing: border-box;
}

/* Action bar: gear (1/6) + Weiter (5/6) */
/* ── Rest Timer ─────────────────────────────────────────── */
.rest-timer-wrap {
  padding: 10px 14px 6px;
  border-bottom: 0.5px solid var(--border);
}
.rest-timer-track {
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.rest-timer-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  transition: width 1s linear;
}
.rest-timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rest-timer-time {
  font-size: 22px;
  font-weight: 700;
  color: var(--text1);
  min-width: 48px;
  text-align: center;
}
.rest-timer-options {
  display: flex;
  gap: 4px;
}
.rest-timer-opt {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text3);
  cursor: pointer;
}
.rest-timer-opt.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.rest-timer-skip {
  font-size: 12px;
  color: var(--text3);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

#session-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,40,0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
  white-space: nowrap;
  max-width: calc(100vw - 48px);
  text-align: center;
}
#session-toast.session-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
#session-toast.session-toast-hide { opacity: 0; transform: translateX(-50%) translateY(20px); }

@keyframes rest-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.rest-timer-shake { animation: rest-shake 0.5s ease; }

.session-action-bar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px calc(env(safe-area-inset-bottom) + 10px);
  border-top: 0.5px solid var(--border);
}
.session-gear-btn {
  flex: 0 0 calc(100% / 6 - 8px);
  height: 54px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text3); font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 0.15s;
}
.session-gear-btn .png-icon {
  width: 22px; height: 22px;
  background-color: var(--text3);
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  transition: background-color 0.15s;
}
.session-gear-btn:active { border-color: var(--orange); }
.session-gear-btn:active .png-icon { background-color: var(--orange); }
.session-gear-btn.active { border-color: var(--orange); }
.session-gear-btn.active .png-icon { background-color: var(--orange); }
.session-weiter-btn {
  flex: 1; height: 54px;
  background: #ffffff; border: none; border-radius: 14px;
  color: #000; font-size: 16px; font-weight: 800;
  cursor: pointer; letter-spacing: 0.01em;
  transition: opacity 0.1s;
}
.session-weiter-btn:active { opacity: 0.85; }
.session-finish-btn { background: var(--green); color: #000; }
.session-next-btn   { background: var(--card); color: var(--text); border: 1px solid var(--border); }

/* ── Drum Picker ─────────────────────────────────────── */
.drum-picker {
  position: relative;
  overflow: hidden;
  cursor: ns-resize;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 10px;
  background: var(--card2);
  border: 1px solid var(--border);
}

.drum-picker-list {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.drum-picker-item {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

/* ── Workout editor exercise row ──────────────────────── */
.exercise-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}

.exercise-row-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.exercise-row-config {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.exercise-config-label {
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
}

.exercise-config-input {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  color: var(--text);
  font-size: 14px;
  width: 56px;
  text-align: center;
}

.exercise-weight-config {
  margin-top: 8px;
}

.exercise-weight-summary {
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
.exercise-weight-summary::-webkit-details-marker { display: none; }
.exercise-weight-summary::before { content: '▶ '; font-size: 10px; }
details[open] .exercise-weight-summary::before { content: '▼ '; }

.summary-progress-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.summary-progress-item.summary-pr {
  border-color: rgba(255,215,0,.4);
  background: rgba(255,215,0,.05);
}

.summary-progress-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.summary-progress-values {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.summary-progress-old {
  color: var(--text3);
}

.summary-progress-arrow {
  color: var(--text3);
}

.summary-progress-new {
  color: var(--orange);
  font-weight: 700;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}

.btn-secondary {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}

.btn-danger {
  flex: 1;
  background: rgba(255, 69, 58, 0.12);
  border: 1px solid rgba(255, 69, 58, 0.4);
  border-radius: 12px;
  padding: 14px;
  color: #ff453a;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.editor-actions .btn-primary {
  margin-top: 0;
  flex: 1;
}

.training-tile-completed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 0;
  padding: 16px 18px;
  opacity: 0.85;
}

.training-tile-done-info {
  min-width: 0;
}

.training-tile-check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.training-tile-check svg {
  width: 16px;
  height: 16px;
}

.cardio-quick-btn {
  margin: 0 16px 12px;
  width: calc(100% - 32px);
}

#cardio-day-list {
  padding: 0 16px;
}

#cardio-day-list .workout-list-item {
  margin-bottom: 12px;
}

.cardio-activity-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  color: var(--text3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cardio-activity-chip.selected {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.cardio-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
}

.cardio-list-item-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.cardio-list-item-info {
  flex: 1;
}

.cardio-list-item-delete {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
}

.stat-exercise-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 14px;
}

/* ── Stats page gradient header ── */
#page-stats {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  padding-top: calc(var(--header-height) + env(safe-area-inset-top));
}
#page-stats.active {
  display: flex;
  min-height: unset;
  gap: 0;
}

#page-stats::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 34vh;
  background: linear-gradient(to bottom, var(--stats-gc, rgba(255, 122, 0, 0.38)) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  transition: background 0.35s ease;
}

#page-stats[data-tab="training"] { --stats-gc: rgba(255, 122, 0, 0.38); }
#page-stats[data-tab="nutrition"] { --stats-gc: rgba(48, 209, 88, 0.30); }
#page-stats[data-tab="cardio"]    { --stats-gc: rgba(191, 90, 242, 0.35); }

body.stats-open #app-header {
  background: transparent;
  box-shadow: none;
}

.stats-tabs-bar {
  position: relative;
  z-index: 1;
  padding: 4px 0 0;
}

.stats-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.stats-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 15px;
  font-weight: 700;
  padding: 8px 0 11px;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  text-align: center;
  letter-spacing: 0.01em;
}

#page-stats[data-tab="training"] .stats-tab[data-tab="training"].active,
.stats-tab[data-tab="training"].active {
  color: var(--text);
  border-bottom-color: var(--orange);
}

#page-stats[data-tab="nutrition"] .stats-tab[data-tab="nutrition"].active,
.stats-tab[data-tab="nutrition"].active {
  color: var(--text);
  border-bottom-color: var(--green);
}

#page-stats[data-tab="cardio"] .stats-tab[data-tab="cardio"].active,
.stats-tab[data-tab="cardio"].active {
  color: var(--text);
  border-bottom-color: #bf5af2;
}

.stats-tab-content {
  display: none;
  position: relative;
  z-index: 1;
}

.stats-tab-content.active {
  display: block;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: 16px;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
}

.stats-tab-content.active::-webkit-scrollbar {
  display: none;
}

/* ── Activity Detail Panel ───────────────────────────────── */
.stats-detail-panel {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  background: var(--bg);
  flex-direction: column;
  /* Same top padding as #app-content so content starts right below header */
  padding-top: calc(var(--header-height) + env(safe-area-inset-top));
  --detail-color: #bf5af2;
}
.stats-detail-panel.active {
  display: flex;
}

/* Gradient header overlay — mirrors #page-stats::before */
.stats-detail-panel::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 34vh;
  background: linear-gradient(to bottom, var(--detail-gc, rgba(191,90,242,0.35)) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.stats-detail-header {
  display: none;
}
.stats-detail-panel .stats-tabs-bar {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Scrollable content area — fills remaining space, hides scrollbar */
.stats-detail-panel .stats-tab-content {
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
  flex: 1;
  /* Pad bottom so content clears the nav bar */
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.stats-detail-panel .stats-tab-content::-webkit-scrollbar {
  display: none;
}
.stats-detail-panel .stats-tab-content.active {
  display: block;
}

/* Active tab uses activity color */
.stats-detail-panel .stats-tab.active {
  color: var(--text);
  border-bottom-color: var(--detail-color);
}

/* Back button shown in app header when detail is open */
.header-back {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}
.header-back svg {
  width: 22px;
  height: 22px;
}

/* Section title used in activity detail */
.stats-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin: 20px 0 10px;
}

/* Clickable wc-tile */
.wc-tile-clickable {
  cursor: pointer;
  transition: opacity 0.15s;
}
.wc-tile-clickable:active {
  opacity: 0.7;
}

/* Session list item */
.session-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.session-list-item:active {
  background: var(--card2);
}
.session-list-item:last-child {
  border-bottom: none;
}
.session-list-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.session-list-info {
  flex: 1;
  min-width: 0;
}
.session-list-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.session-list-sub {
  font-size: 13px;
  color: var(--text3);
  margin-top: 2px;
}
.session-list-right {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

/* Cardio entry card in Einheiten tab */
.cardio-entry-card {
  margin-bottom: 12px;
}
.cardio-entry-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.cardio-entry-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.cardio-entry-meta {
  flex: 1;
  min-width: 0;
}
.cardio-entry-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.cardio-entry-date {
  font-size: 13px;
  color: var(--text3);
  margin-top: 2px;
}
.cardio-entry-delete {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
  opacity: 0.6;
}
.cardio-entry-delete:active { opacity: 1; }
.cardio-entry-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text3);
  padding: 3px 0;
  border-top: 1px solid var(--border);
}
.cardio-entry-row span:last-child {
  color: var(--text);
  font-weight: 500;
}

/* Session detail inside Einheiten */
.session-detail-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
}
.session-detail-overlay.active {
  display: flex;
}

.stat-exercise-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-exercise-delta {
  font-size: 14px;
  font-weight: 700;
}

.stat-delta-up { color: var(--green); }
.stat-delta-down { color: var(--red, #e5484d); }

.stat-sparkline-xaxis {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text3);
  padding: 0 12px;
  margin-top: 2px;
}

.stats-muscle-group-hdr {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 16px 16px 6px;
}
.stats-muscle-group-hdr:first-child { padding-top: 8px; }

.stat-exercise-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.stat-exercise-meta {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
}

.stat-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stat-dot-orange { background: var(--orange); }
.stat-dot-blue { background: var(--accent); }

.stat-sparkline {
  width: 100%;
  height: 100px;
}

.stat-exercise-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  margin-top: 8px;
}

/* ── Weight chart tile ── */
.wc-tile { padding: 14px 16px 10px; }

.wc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.wc-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.wc-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.wc-current-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.wc-current-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.wc-delta {
  font-size: 12px;
  font-weight: 600;
}

.wc-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  display: block;
}

.wc-xaxis {
  display: flex;
  justify-content: space-between;
  padding: 4px 2px 0;
  margin-top: 4px;
}

.wc-xlabel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex: 1;
}

.wc-xlabel-day {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
}

.wc-xlabel-date {
  font-size: 10px;
  color: var(--text3);
  opacity: 0.6;
}

/* ══════════════════════════════════════════════════════════════════════════════
   CARDIO STATS
   ══════════════════════════════════════════════════════════════════════════════ */

.cardio-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 0 4px;
}

.cardio-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cardio-summary-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.cardio-summary-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cardio-summary-divider {
  width: 1px;
  height: 32px;
  background: var(--separator);
}

.cardio-record-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--separator);
}
.cardio-record-row:last-child { border-bottom: none; }

.cardio-record-activity {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.cardio-record-vals {
  display: flex;
  gap: 20px;
}

.cardio-record-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cardio-record-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cardio-record-num {
  font-size: 15px;
  font-weight: 600;
  color: #bf5af2;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ERNÄHRUNG — Redesign
   ══════════════════════════════════════════════════════════════════════════════ */

/* Section headers */
.nutr-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}
.nutr-section-lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text3);
}
.nutr-goal-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 2px 8px;
}

/* Overview card */
.nutr-overview-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  padding: 12px 16px 14px;
}
.nutr-overview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nutr-overview-side {
  flex: 1;
  text-align: center;
}
.nutr-arc-wrap {
  position: relative;
  width: 140px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}
.nutr-arc-svg {
  width: 140px;
  height: 80px;
  display: block;
}
.nutr-arc-center {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}
.nutr-arc-val {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.nutr-arc-lbl {
  font-size: 10px;
  color: var(--text3);
  margin-top: 1px;
}
.nutr-col-val {
  font-size: 20px;
  font-weight: 700;
}
.nutr-col-lbl {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}

/* Macro bars — 3 columns side by side */
.nutr-macro-bars {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 12px;
}
.nutr-macro-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nutr-macro-col-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.nutr-macro-track {
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.nutr-macro-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.nutr-macro-col-nums {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  white-space: nowrap;
}
.nutr-optimize-btn {
  width: 100%;
  margin-top: 14px;
  background: rgba(255,255,255,0.9);
  color: #000;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* Meal rows */
.nutr-meals-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  overflow: hidden;
}
.nutr-meal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.nutr-meal-divider {
  height: 1px;
  background: var(--border);
  margin: 0 16px;
}
.nutr-meal-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text3);
}
.nutr-meal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nutr-meal-name {
  font-size: 15px;
  font-weight: 600;
}
.nutr-meal-kcal {
  font-size: 12px;
  color: var(--text3);
}
.nutr-meal-plus {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text3);
  flex-shrink: 0;
}

/* Weight card */
.nutr-weight-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}
.nutr-weight-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nutr-weight-val {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.nutr-weight-val #weight-tile-num {
  font-size: 42px;
  font-weight: 700;
}
.nutr-weight-unit {
  font-size: 18px;
  color: var(--text3);
}

/* ── Meal Detail Overlay ── */
.meal-detail-back { visibility: visible !important; }

.meal-detail-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 0;
}
.meal-detail-ring-svg {
  width: 130px;
  height: 130px;
}
.meal-detail-ring-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.meal-detail-kcal {
  font-size: 28px;
  font-weight: 700;
}
.meal-detail-kcal-lbl {
  font-size: 11px;
  color: var(--text3);
}
.meal-detail-macros-side {
  position: absolute;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.meal-detail-macro {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.meal-detail-macro-val {
  font-size: 14px;
  font-weight: 600;
}
.meal-detail-macro-lbl {
  font-size: 10px;
  color: var(--text3);
}
.meal-detail-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.meal-detail-item-info { flex: 1; }
.meal-detail-item-name {
  font-size: 14px;
  font-weight: 600;
}
.meal-detail-item-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}
.meal-detail-item-del {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px;
  padding: 4px 8px;
  cursor: pointer;
}
.meal-detail-empty {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 16px;
  color: var(--text3);
}
.meal-detail-empty-text {
  font-size: 14px;
  color: var(--text3);
}
.meal-detail-footer {
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.meal-detail-add-btn {
  width: 100%;
  background: rgba(255,255,255,0.9);
  color: #000;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Food Search Overlay (neue Version) ── */
.food-header-kcal {
  font-size: 12px;
  color: var(--text3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
}
.food-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.food-tab {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px 10px 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.food-tab.active {
  color: var(--text);
  border-bottom-color: var(--green);
}
.food-photo-wrap {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.food-photo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 32px 16px;
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: 16px;
  color: var(--text2);
  font-size: 15px;
  cursor: pointer;
}
.food-photo-analyze-btn {
  width: 100%;
  padding: 14px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}
.food-photo-analyze-btn:disabled { opacity: 0.5; }
#food-photo-status { color: var(--red); font-size: 14px; text-align: center; }
.food-photo-dish { font-size: 17px; font-weight: 700; color: var(--text); margin-top: 16px; }
.food-photo-confidence { font-size: 13px; color: var(--orange); margin-top: 4px; }
.food-photo-ing-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.food-photo-ing-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--card); border-radius: 12px; cursor: pointer;
}
.food-photo-ing-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); flex-shrink: 0; }
.food-photo-ing-info { flex: 1; min-width: 0; }
.food-photo-ing-name { font-size: 15px; font-weight: 600; color: var(--text); }
.food-photo-ing-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.food-photo-total { font-size: 14px; color: var(--text2); margin-top: 10px; text-align: right; }
.food-photo-add-all-btn {
  width: 100%; padding: 14px; margin-top: 10px;
  background: var(--green); color: #fff; border: none;
  border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.food-photo-add-all-btn:disabled { opacity: 0.5; }

#food-overlay-content {
  padding: 0 0 80px !important;
  position: relative;
}
.food-recent-date {
  font-size: 11px;
  color: var(--text3);
  padding: 12px 16px 4px;
  font-weight: 600;
}
.food-recent-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.food-recent-info { flex: 1; }
.food-recent-name {
  font-size: 14px;
  font-weight: 600;
}
.food-recent-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}
.food-recent-add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: none;
  color: var(--text);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.food-search-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px);
  background: rgba(20,20,26,0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.food-search-bottom-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0 14px;
  gap: 8px;
}
.food-search-icon { color: var(--text3); flex-shrink: 0; }
.food-search-bottom-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  padding: 12px 0;
  outline: none;
}
.food-search-bottom-input-wrap input::placeholder { color: var(--text3); }
.food-bottom-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
#food-search-results { padding: 0; }

.food-search-loading,
.food-search-empty {
  text-align: center;
  color: var(--text3);
  font-size: 13px;
  padding: 24px 16px;
}

/* ── Food Detail Panel (full-page over overlay-content) ── */
#food-detail-panel {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 10;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 80px;
}
.fd-header {
  padding: 16px 16px 8px;
}
.fd-name {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}
.fd-brand {
  font-size: 13px;
  color: var(--text3);
  margin-top: 2px;
}
.fd-nutrients-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 0;
  font-size: 15px;
  font-weight: 700;
}
#fd-per-amount {
  font-size: 12px;
  color: var(--text3);
  font-weight: 400;
}
.fd-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0 12px;
}
.fd-ring-svg {
  width: 140px;
  height: 140px;
}
.fd-ring-center {
  position: absolute;
  text-align: center;
  pointer-events: none;
}
.fd-ring-kcal {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}
.fd-ring-lbl {
  font-size: 12px;
  color: var(--text3);
}
.fd-macros-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 0 16px 16px;
}
.fd-macro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.fd-macro-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.fd-macro-val {
  font-size: 17px;
  font-weight: 700;
}
.fd-macro-lbl {
  font-size: 10px;
  color: var(--text3);
}
.fd-bottom-card {
  margin: 8px 16px 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.fd-amount-label {
  font-size: 12px;
  color: var(--text3);
  font-weight: 600;
}
.fd-amount-input {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  padding: 12px;
  text-align: center;
  outline: none;
}
.fd-actions {
  width: 100%;
}
.fd-confirm-btn {
  width: 100%;
  background: rgba(255,255,255,0.9);
  color: #000;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Kalorienberechnung (Settings View) ── */
.kc-weight-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}
.kc-weight-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  outline: none;
  min-width: 0;
}
.kc-weight-input::placeholder { color: var(--text3); }
.kc-weight-unit {
  font-size: 16px;
  color: var(--text3);
  font-weight: 600;
}
.kc-activity-hint {
  font-size: 12px;
  color: var(--text3);
  padding: 0 0 10px;
  line-height: 1.5;
}
#kc-result {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 20px;
  padding: 20px 16px 16px;
  text-align: center;
}
.kc-result-kcal {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}
.kc-result-label {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
  margin-bottom: 16px;
}
.kc-macros-row {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.kc-macro-col {
  flex: 1;
  text-align: center;
  border-right: 1px solid var(--border);
}
.kc-macro-col:last-child { border-right: none; }
.kc-macro-val {
  font-size: 18px;
  font-weight: 700;
}
.kc-macro-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

/* ── Quick Entry ── */
.quick-entry-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}
.quick-entry-input {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 10px 14px;
  width: 100%;
  box-sizing: border-box;
}
.quick-entry-macros {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.nutrition-kcal-row {
  text-align: center;
  margin-bottom: 14px;
}

.nutrition-kcal-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.nutrition-kcal-num {
  font-size: 40px;
  font-weight: 800;
}

.nutrition-kcal-unit {
  font-size: 14px;
  color: var(--text3);
}

.nutrition-kcal-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.nutrition-kcal-prog {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  margin: 8px 0 0;
  overflow: hidden;
}

.nutrition-kcal-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.nutrition-macros {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.macro-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.macro-bar-label {
  font-size: 11px;
  color: var(--text3);
  width: 100px;
  flex-shrink: 0;
}

.macro-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.macro-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.macro-bar-val {
  font-size: 11px;
  font-weight: 600;
  min-width: 58px;
  text-align: right;
}

.macro-bar-unit {
  font-weight: 400;
  color: var(--text3);
}

/* ── Mahlzeit-Tiles ── */
.meal-tiles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
  margin-bottom: 12px;
}

.meal-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.meal-tile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
}

.meal-tile-name {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
}

.meal-tile-kcal {
  font-size: 12px;
  color: var(--text3);
}

.meal-tile-actions {
  display: flex;
  gap: 6px;
}

.meal-add-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--orange);
  color: var(--orange);
  background: transparent;
  cursor: pointer;
}

.meal-add-quick {
  border-color: var(--text3);
  color: var(--text3);
}

.meal-tile-list {
  padding: 0 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meal-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

.meal-entry-name {
  flex: 1;
  font-size: 13px;
}

.meal-entry-detail {
  font-size: 11px;
  color: var(--text3);
}

.meal-entry-del {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 14px;
  padding: 0 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.food-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 16px;
}

.food-search-bar input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 10px 14px;
}

.barcode-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

#food-search-results {
  padding: 0 16px;
}

#food-detail-panel {
  padding: 0 16px 16px;
}

.food-search-loading,
.food-search-empty {
  text-align: center;
  color: var(--text3);
  font-size: 13px;
  padding: 20px 0;
}

.food-result-item {
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  color: var(--text);
}

.food-result-name {
  font-size: 14px;
  font-weight: 600;
}

.food-result-brand {
  font-weight: 400;
  color: var(--text3);
}

.food-result-macros {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.food-detail-name {
  font-size: 15px;
  font-weight: 700;
  margin: 14px 0 4px;
}

.food-detail-per100 {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 12px;
}

.food-amount-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.food-amount-label {
  font-size: 13px;
  color: var(--text3);
}

.food-amount-row input {
  width: 90px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  padding: 8px 10px;
  text-align: center;
}

.food-detail-calc {
  font-size: 13px;
  color: var(--orange);
  margin-bottom: 14px;
}

.food-confirm-btn {
  width: 100%;
}

/* ── Quick Entry ── */
.quick-entry-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.quick-entry-input {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 10px 14px;
  width: 100%;
  box-sizing: border-box;
}

.quick-entry-macros {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

/* ── Barcode Overlay ── */
.barcode-overlay-inner {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#barcode-video {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
}

.barcode-frame {
  position: absolute;
  width: 220px;
  height: 140px;
  border: 2px solid var(--orange);
  border-radius: 8px;
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.5);
}

.barcode-cancel {
  margin-top: 32px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 20px;
  padding: 10px 28px;
  font-size: 15px;
  cursor: pointer;
}

/* ── Reset data override for nutrition page ── */
.dash-tile.nutrition-macro-tile {
  margin: 0 16px 12px;
  padding: 16px;
}

/* ── Workout Editor (card style) ─────────────────────────── */
.we-name-input {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1.5px solid var(--border);
  padding: 12px 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}
.we-name-input:focus { outline: none; border-bottom-color: var(--orange); }
.we-name-input::placeholder { color: var(--text3); }

.we-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 16px;
}
.we-time-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
}
.we-time-input {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text1);
  color-scheme: dark light;
}
.we-time-input:focus { outline: none; border-color: var(--orange); }

.we-days { margin-bottom: 20px; }

.we-exercise-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.we-exercise-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}
.we-exercise-card:active { opacity: 0.75; }

.we-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.we-card-img {
  flex: 0 0 50px;
  height: 50px;
  background: rgba(255,90,0,0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--orange);
}

.we-card-info { flex: 1; min-width: 0; }

.we-card-muscles {
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.we-card-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}
.we-card-name.we-card-placeholder { color: var(--text3); }

.we-card-meta { font-size: 12px; color: var(--text3); }

.we-card-arrow {
  color: var(--text3);
  font-size: 20px;
  flex-shrink: 0;
}

.we-add-btn {
  width: 100%;
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 14px;
  color: var(--text3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}
.we-add-btn:active { opacity: 0.7; }

/* ── Exercise Config Sheet ───────────────────────────────── */
#exercise-config-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 203;
  display: none;
}

#exercise-config-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  z-index: 205;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(.32,.72,0,1);
  max-height: 92vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
#exercise-config-sheet.open { transform: translateY(0); }

.ec-body { padding: 0 16px; }

.ec-section {
  padding: 14px 0;
  border-bottom: 0.5px solid var(--border);
}
.ec-section:last-child { border-bottom: none; }

.ec-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.ec-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }

.ec-chip {
  flex: 1;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.ec-chip.selected {
  background: rgba(255,90,0,0.12);
  border-color: var(--orange);
  color: var(--orange);
}

.ec-sets-stepper {
  max-width: 200px;
  height: 48px;
}

.ec-weight-row { display: flex; gap: 10px; }

.ec-weight-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ec-field-label { font-size: 11px; color: var(--text3); font-weight: 600; }

.ec-field-input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  width: 100%;
}

.ec-name-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.0;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.ec-name-btn.placeholder { color: var(--text3); font-size: 20px; text-transform: none; }

.ec-action-bar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 0.5px solid var(--border);
}

.ec-remove-btn {
  background: rgba(255,59,48,0.1);
  border: 1.5px solid rgba(255,59,48,0.3);
  border-radius: 12px;
  padding: 12px 16px;
  color: #ff3b30;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.ec-save-btn {
  flex: 1;
  background: var(--orange);
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

/* ── Cycle Tile ─────────────────────────────────────────── */
#dash-cycle-tile {
  margin: 0 16px;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
}
.cycle-tile-empty {
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.cycle-tile-empty-icon { font-size: 32px; opacity: .5; }
.cycle-tile-empty-title { font-size: 16px; font-weight: 700; color: var(--text1); }
.cycle-tile-empty-sub { font-size: 13px; color: var(--text3); max-width: 260px; }
.cycle-tile-start-btn {
  margin-top: 8px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cycle-tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px;
}
.cycle-tile-name { font-size: 15px; font-weight: 700; color: var(--text1); }
.cycle-tile-meta { display: flex; align-items: center; gap: 8px; }
.cycle-tile-week { font-size: 28px; font-weight: 800; color: var(--orange); }
.cycle-tile-week span { font-size: 15px; color: var(--text3); font-weight: 500; }

.cycle-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cycle-badge-deload   { background: rgba(90,200,250,.15);  color: #5ac8fa; }
.cycle-badge-done     { background: rgba(52,199,89,.15);   color: #34c759; }
.cycle-badge-aufbau   { background: rgba(255,159,10,.15);  color: #ff9f0a; }
.cycle-badge-overreach{ background: rgba(255,69,58,.15);   color: #ff453a; }
.cycle-badge-peak     { background: rgba(191,90,242,.15);  color: #bf5af2; }

.cycle-prog-wrap { padding: 0 18px 14px; }
.cycle-prog-bar {
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.cycle-prog-fill { height: 100%; background: var(--orange); border-radius: 3px; transition: width .4s; }
.cycle-prog-labels { display: flex; gap: 4px; }
.cycle-prog-dot {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.1);
  transition: background .2s;
}
.cycle-prog-dot.active    { background: var(--orange); }
.cycle-prog-dot.deload    { background: rgba(90,200,250,.4); }
.cycle-prog-dot.active.deload { background: #5ac8fa; }
.cycle-prog-dot.aufbau    { background: rgba(255,159,10,.4); }
.cycle-prog-dot.active.aufbau { background: #ff9f0a; }
.cycle-prog-dot.overreach { background: rgba(255,69,58,.4); }
.cycle-prog-dot.active.overreach { background: #ff453a; }
.cycle-prog-dot.peak      { background: rgba(191,90,242,.4); }
.cycle-prog-dot.active.peak { background: #bf5af2; }

.cycle-tile-info { padding: 0 18px 14px; }
.cycle-info-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text3); }

.cycle-tile-complete-btn {
  width: calc(100% - 36px);
  margin: 0 18px 18px;
  background: rgba(52,199,89,.15);
  color: #34c759;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Cycle Starter / Assessment overlays ───────────────── */
.cs-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 14px;
  margin-top: 20px;
}
.cs-info-icon { color: var(--text3); font-size: 16px; flex-shrink: 0; }
.cs-info-text { font-size: 13px; color: var(--text3); line-height: 1.5; }

.cs-phase-preview {
  margin-top: 16px;
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-phase-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
}
.cs-phase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cs-phase-aufbau    .cs-phase-dot { background: #ff9f0a; }
.cs-phase-overreach .cs-phase-dot { background: #ff453a; }
.cs-phase-peak      .cs-phase-dot { background: #bf5af2; }
.cs-phase-deload    .cs-phase-dot { background: #5ac8fa; }

/* ── Cycle Detail Overlay ───────────────────────────────── */
.cd-meta-row {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.cd-meta-item {
  flex: 1;
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}
.cd-meta-val { font-size: 14px; font-weight: 700; color: var(--text1); margin-bottom: 4px; }
.cd-meta-lbl { font-size: 11px; color: var(--text3); }

.cd-weeks { display: flex; flex-direction: column; gap: 8px; }
.cd-week-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 12px 14px;
  opacity: .6;
}
.cd-week-row.cd-week-past { opacity: .45; }
.cd-week-row.cd-week-current {
  opacity: 1;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
}
.cd-week-num {
  width: 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  padding-top: 2px;
  text-align: center;
  flex-shrink: 0;
}
.cd-week-current .cd-week-num { color: var(--orange); }
.cd-week-past .cd-week-num { color: #34c759; font-size: 12px; }
.cd-week-body { flex: 1; min-width: 0; }
.cd-week-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cd-week-label { font-size: 14px; font-weight: 600; color: var(--text1); }
.cd-week-date { font-size: 12px; color: var(--text3); margin-bottom: 3px; }
.cd-week-desc { font-size: 12px; color: var(--text3); }

.cd-footer {
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.07);
}
.cd-end-btn {
  width: 100%;
  background: rgba(255,69,58,.12);
  color: #ff453a;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.session-cycle-week { font-size: 13px; color: var(--text3); }
.session-cycle-deload,
.session-cycle-phase {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-left: 6px;
}
.session-cycle-deload              { background: rgba(90,200,250,.15);  color: #5ac8fa; }
.session-cycle-phase-aufbau        { background: rgba(255,159,10,.15);  color: #ff9f0a; }
.session-cycle-phase-overreach     { background: rgba(255,69,58,.15);   color: #ff453a; }
.session-cycle-phase-peak          { background: rgba(191,90,242,.15);  color: #bf5af2; }
.session-cycle-phase-deload        { background: rgba(90,200,250,.15);  color: #5ac8fa; }

.ca-intro { font-size: 14px; color: var(--text2); margin-bottom: 24px; line-height: 1.6; }
.ca-question { margin-bottom: 20px; }
.ca-question-label { font-size: 13px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.ca-options { display: flex; gap: 8px; }
.ca-option {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 10px 4px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.ca-option.selected {
  background: rgba(255,149,0,.15);
  border-color: var(--orange);
  color: var(--orange);
}

/* ── Cycle Result overlay ──────────────────────────────── */
.cycle-result-icon { font-size: 56px; margin-bottom: 16px; }
.cycle-result-title { font-size: 20px; font-weight: 800; color: var(--text1); margin-bottom: 12px; }
.cycle-result-sub { font-size: 14px; color: var(--text2); line-height: 1.6; max-width: 300px; margin: 0 auto; }

/* ── Training quick buttons ─────────────────────────────── */
.training-quick-btns {
  display: flex;
  gap: 10px;
  padding: 0 16px 16px;
}
.training-quick-btns .btn-secondary {
  flex: 1;
  font-size: 14px;
  padding: 12px 10px;
}

/* ── Swim Logger ─────────────────────────────────────────── */
.swim-lanes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  margin-bottom: 10px;
}
.swim-total-wrap {
  font-size: 13px;
  color: var(--text3);
}
.swim-total-wrap span {
  color: #5ac8fa;
  font-weight: 700;
}
.swim-lanes-empty {
  font-size: 13px;
  color: var(--text3);
  text-align: center;
  padding: 16px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
}
.swim-lane-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.swim-lane-num {
  width: 24px;
  height: 24px;
  background: rgba(90,200,250,.15);
  color: #5ac8fa;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.swim-lane-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.swim-lane-type-toggle { display: flex; gap: 6px; }
.swim-type-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.1);
  background: transparent;
  color: var(--text3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.swim-type-btn.active {
  background: rgba(90,200,250,.15);
  border-color: #5ac8fa;
  color: #5ac8fa;
}
.swim-lane-select {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: var(--text1);
  font-size: 13px;
  padding: 6px 10px;
  width: 100%;
}
.swim-lane-meters {
  font-size: 12px;
  color: var(--text3);
  flex-shrink: 0;
  width: 32px;
  text-align: right;
}
.swim-lane-remove {
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.swim-add-lane-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: rgba(90,200,250,.1);
  border: 1.5px dashed rgba(90,200,250,.3);
  border-radius: 12px;
  color: #5ac8fa;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Swim Dashboard Tile ─────────────────────────────────── */
.swim-tile-stat {
  font-size: 36px;
  font-weight: 800;
  color: #5ac8fa;
  margin: 8px 0 4px;
}
.swim-tile-stat span { font-size: 16px; font-weight: 500; color: var(--text3); }
.swim-tile-meta { font-size: 13px; color: var(--text3); }

/* ── Knie Modal ──────────────────────────────────────────── */
.knee-score-big {
  font-size: 72px;
  font-weight: 800;
  transition: color .2s;
  font-variant-numeric: tabular-nums;
}
.knee-score-label {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 24px;
  transition: color .2s;
}
.knee-slider {
  width: 100%;
  accent-color: var(--orange);
  height: 6px;
  margin-bottom: 8px;
}
.knee-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 8px;
}

/* ── Knie Warnung ────────────────────────────────────────── */
.knee-warning-box {
  background: rgba(255,59,48,.1);
  border: 1.5px solid rgba(255,59,48,.3);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.knee-warning-icon { font-size: 28px; flex-shrink: 0; }
.knee-warning-text { font-size: 15px; color: var(--text1); line-height: 1.6; }

/* ── Knie Status Dashboard ───────────────────────────────── */
#dash-knee-status { padding: 0 16px; }
.knee-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.05);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
}
.knee-status-score {
  font-size: 12px;
  opacity: .7;
}

/* ── 10%-Regel Warning Banner ────────────────────────────── */
.ten-percent-warning {
  position: fixed;
  bottom: calc(83px + env(safe-area-inset-bottom) + 12px);
  left: 16px;
  right: 16px;
  background: rgba(255,149,0,.15);
  border: 1.5px solid rgba(255,149,0,.4);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 300;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.ten-percent-warning.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.ten-percent-warning .ten-percent-icon { font-size: 20px; flex-shrink: 0; }
.ten-percent-warning .ten-percent-msg { flex: 1; font-size: 13px; color: #ff9500; line-height: 1.4; }
.ten-percent-warning button { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; flex-shrink: 0; }

/* ── Cardio Activity Chip Row ────────────────────────────── */
.cardio-activity-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
  max-width: 100%;
}
.cardio-activity-chip {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cardio-activity-chip.selected {
  background: rgba(255,90,0,0.12);
  border-color: var(--orange);
  color: var(--orange);
}

/* ── Run type chips (wrap-safe) ──────────────────────────── */
.cardio-run-type-chips {
  flex-wrap: wrap;
}
.cardio-run-type-chips .ec-chip {
  flex: 0 1 auto;
  min-width: 0;
}

/* ── Cardio Pace Preview ─────────────────────────────────── */
.cardio-pace-preview {
  font-size: 14px;
  color: #5ac8fa;
  font-weight: 600;
  min-height: 20px;
  margin: 4px 0 8px;
}

/* ── Cardio run type badge ───────────────────────────────── */
.cardio-run-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255,149,0,.15);
  color: var(--orange);
  vertical-align: middle;
  margin-left: 6px;
}

/* ── Cardio Detail View ──────────────────────────────────── */
.cardio-detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.cardio-detail-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg, #1c1c1e);
  border-radius: 12px;
  padding: 12px;
}
.cardio-detail-stat-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.cardio-detail-stat-val {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}
.cardio-detail-stat-lbl {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Run Dashboard Tile ──────────────────────────────────── */
#dash-run-tile .dash-tile-title { }

/* ── Activity stat chips (Laufen/Schwimmen card footer) ──── */
.wc-stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.wc-stat-chip {
  font-size: 12px;
  color: var(--text3);
  background: var(--card, #141417);
  border: 1px solid var(--border, #2a2a2e);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}
.wc-stat-chip-warn {
  color: var(--orange, #ff9f0a);
  border-color: rgba(255,159,10,0.3);
  background: rgba(255,159,10,0.08);
}

/* ── Run & Swim Statistics (legacy helpers, kept for safety) ─ */
.run-summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.run-summary-card {
  background: var(--card2, #1c1c1f);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.run-summary-card .rsc-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #fff);
}
.run-summary-card .rsc-lbl {
  font-size: 11px;
  color: var(--text3);
}
.run-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.run-stat-card {
  background: var(--card2, #1c1c1f);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.run-stat-card .rsc-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #fff);
}
.run-stat-card .rsc-lbl {
  font-size: 11px;
  color: var(--text3);
}
.run-stat-warn {
  grid-column: 1 / -1;
  background: rgba(255,159,10,0.12);
  border: 1px solid rgba(255,159,10,0.3);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--orange, #ff9f0a);
}
.run-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 90px;
  margin-bottom: 6px;
}
.run-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.run-bar-wrap {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1;
}
.run-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.3s;
}
.run-bar-lbl {
  font-size: 10px;
  color: var(--text3);
  text-align: center;
  white-space: nowrap;
}
.run-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #2a2a2e);
  font-size: 14px;
}
.run-type-row:last-child {
  border-bottom: none;
}
.run-types-list {
  background: var(--card2, #1c1c1f);
  border-radius: 14px;
  padding: 4px 14px;
  margin-bottom: 18px;
}
.swim-stroke-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.swim-stroke-bar-wrap {
  height: 8px;
  background: var(--border, #2a2a2e);
  border-radius: 4px;
  overflow: hidden;
}
.swim-stroke-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--accent, #1E88E5);
  transition: width 0.4s;
}
.swim-strokes {
  margin-bottom: 18px;
}

/* ── Wochenübersicht ─────────────────────────────────────── */
/* ── Week Strip (horizontaler Kalender oben auf Dashboard) ── */
#dash-week-strip {
  margin: 0 16px;
}

.wstrip-wrap {
  padding: 4px 0 0;
}

.wstrip-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 0 12px;
  scroll-snap-type: x mandatory;
}
.wstrip-scroll::-webkit-scrollbar { display: none; }

.wstrip-card {
  flex: none;
  width: calc((100% - 24px) / 3);
  min-height: 80px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 10px 8px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.wstrip-card:active { opacity: 0.75; }

.wstrip-card-today {
  border-color: var(--orange);
  background: rgba(255,159,10,0.06);
}

.wstrip-card-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2px;
}

.wstrip-card-day {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text3);
}
.wstrip-card-today .wstrip-card-day { color: var(--orange); }

.wstrip-card-date {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}

.wstrip-empty {
  font-size: 11px;
  color: var(--text3);
  font-style: italic;
}

.wstrip-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wstrip-group-label {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-bottom: 1px;
}

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

.wstrip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--orange);
}
.wstrip-item-cardio .wstrip-dot { background: #bf5af2; }
.wstrip-item-done .wstrip-dot { background: #30d158; }

.wstrip-item-name {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.wstrip-item-done .wstrip-item-name {
  color: var(--text3);
  text-decoration: line-through;
  text-decoration-color: #30d158;
}

.wstrip-check {
  font-size: 9px;
  font-weight: 800;
  color: #30d158;
  flex-shrink: 0;
}

/* ── Notification Settings ──────────────────────────────── */
.notif-section-hdr {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin: 4px 0 8px;
}
.notif-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.notif-item:last-of-type { border-bottom: none; }
.notif-item-text { flex: 1; }
.notif-item-title { font-size: 15px; font-weight: 600; color: var(--text1); }
.notif-item-sub { font-size: 12px; color: var(--text3); margin-top: 2px; line-height: 1.4; }
.notif-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  margin-bottom: 4px;
}
.notif-time-label { font-size: 14px; color: var(--text2); }
.notif-time-input {
  background: rgba(255,255,255,.08);
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text1);
  font-size: 15px;
  font-weight: 600;
  color-scheme: dark;
}
.notif-test-btn {
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,.06);
  border: none;
  border-radius: 10px;
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
}
.notif-blocked-hint {
  font-size: 13px;
  color: #f0a;
  background: rgba(255,0,170,.08);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.notif-unsupported { font-size: 13px; color: var(--text3); }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 51px; height: 31px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.15);
  border-radius: 31px;
  transition: background .2s;
  cursor: pointer;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 27px; height: 27px;
  left: 2px; top: 2px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: #34c759; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }
.toggle-switch input:disabled + .toggle-slider { opacity: .4; cursor: not-allowed; }
