/* ─────────────────────────────────────────────────────────────
   AION — Longevity & Fitness Tracker
   Design Tokens v34 (Claude Design Handoff · clean)
   ───────────────────────────────────────────────────────────── */
:root {
  --bg:           #0a0a0a;
  --surface:      #141414;
  --surface-2:    #1c1c1c;
  --surface-3:    #262626;
  --border:       #262626;
  --border-soft:  #1e1e1e;
  --text:         #fafafa;
  --text-dim:     #a1a1a1;
  --muted:        #737373;
  --muted-dim:    #525252;
  --accent:       #c4f04c;
  --accent-deep:  #9bd61a;
  --accent-soft:  rgba(196,240,76,0.12);
  --accent-glow:  rgba(196,240,76,0.4);
  --warn:         #fbbf24;
  --danger:       #f87171;
  --danger-soft:  rgba(248,113,113,0.12);
  --blue:         #7dd3fc;
  --violet:       #c4b5fd;
  --pink:         #fda4af;
  --radius:       22px;
  --radius-sm:    14px;
  --radius-xs:    10px;
  --font:         -apple-system, "SF Pro Text", "Inter", BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, "SF Pro Display", "Inter", BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    "SF Mono", "JetBrains Mono", ui-monospace, monospace;
}

/* ─── Light theme — warm minimal, same Claude card-pattern ──── */
[data-theme="light"] {
  --bg:           #fafaf7;
  --surface:      #ffffff;
  --surface-2:    #f4f4ef;
  --surface-3:    #ebebe5;
  --border:       #e2e2da;
  --border-soft:  #ededed;
  --text:         #121212;
  --text-dim:     #404040;
  --muted:        #6b6b6b;
  --muted-dim:    #999999;
  --accent:       #4a7c00;
  --accent-deep:  #3a6200;
  --accent-soft:  rgba(74,124,0,0.08);
  --accent-glow:  rgba(74,124,0,0.30);
  --warn:         #b87100;
  --danger:       #b3261e;
  --danger-soft:  rgba(179,38,30,0.08);
  --blue:         #0369a1;
  --violet:       #6d28d9;
  --pink:         #be185d;
}
[data-theme="light"] body { background: var(--bg); color: var(--text); }
[data-theme="light"] ::selection { background: var(--accent); color: #fff; }

/* Light-theme overrides for places where the dark-mode hardcoded white/black tints clash */
[data-theme="light"] .tr-friends-avatar,
[data-theme="light"] .friend-avatar,
[data-theme="light"] .prof-avatar { color: #fff; }
[data-theme="light"] .tr-friends-badge { border-color: #fff; }
[data-theme="light"] .prof-avatar-edit { background: #fff; }
[data-theme="light"] .tr-hero-v2 {
  background: linear-gradient(155deg, var(--surface) 0%, rgba(74,124,0,0.06) 100%);
}
[data-theme="light"] .tr-hero-exercises .tr-exercise {
  background: rgba(0,0,0,0.025);
  border-color: var(--border);
}
[data-theme="light"] .tr-hero-exercises .tr-exercise.done {
  background: rgba(74,124,0,0.06);
  border-color: rgba(74,124,0,0.30);
}
[data-theme="light"] .tr-hero-cta { color: #fff; }
[data-theme="light"] .tr-hero-cta svg { color: #fff; }
[data-theme="light"] .btn-primary,
[data-theme="light"] .sheet-actions .btn-primary,
[data-theme="light"] .prof-section .btn-primary { color: #fff; }
[data-theme="light"] .prof-avatar { box-shadow: 0 6px 18px -6px rgba(74,124,0,0.4), inset 0 1px 0 rgba(255,255,255,0.4); }
[data-theme="light"] .tr-friends-avatar { box-shadow: 0 4px 12px -4px rgba(74,124,0,0.4); }
[data-theme="light"] .splash { background: var(--bg); }
[data-theme="light"] .splash-mark { color: var(--text); }
[data-theme="light"] .modal { background: rgba(0,0,0,0.4); }
[data-theme="light"] .sheet { box-shadow: 0 -30px 60px rgba(0,0,0,0.18); }
[data-theme="light"] .seg-control { background: var(--surface-2); }
[data-theme="light"] .seg-btn.active { color: #fff; }
[data-theme="light"] .ios-card { background: var(--surface); }
[data-theme="light"] .ios-card.success { background: linear-gradient(155deg, rgba(74,124,0,0.06), var(--surface)); }
[data-theme="light"] .ios-card-num.check { color: var(--accent); border-color: var(--accent); }
[data-theme="light"] .ios-card-num { color: #fff; }
[data-theme="light"] .ios-mock { background: var(--surface-2); }
[data-theme="light"] .ios-filter { background: var(--surface); }
[data-theme="light"] .ios-pill-on { color: #fff; }
[data-theme="light"] .tr-vs-btn.active { color: #fff; }
[data-theme="light"] .tr-week-cell.done .tr-week-dow,
[data-theme="light"] .tr-week-cell.done .tr-week-dot,
[data-theme="light"] .tr-week-cell.done .tr-week-num { color: #fff; }
[data-theme="light"] .tr-week-cell.done .tr-week-dot { background: rgba(255,255,255,0.25); color: #fff; }
[data-theme="light"] .friend-btn-accept { color: #fff; }
[data-theme="light"] .prof-pill-btn { color: var(--accent); }
[data-theme="light"] .prof-pill-btn:hover { color: #fff; }
[data-theme="light"] .prof-set-username { color: var(--accent); }
[data-theme="light"] .prof-set-username:hover { color: #fff; }
[data-theme="light"] .tr-hero-cta.done { color: var(--accent); background: rgba(74,124,0,0.10); }
[data-theme="light"] .tr-action-icon { color: var(--accent); }
[data-theme="light"] .contrib-fill { box-shadow: 0 0 6px rgba(74,124,0,0.35); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
*::-webkit-scrollbar { width: 0; height: 0; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
}
body { min-height: 100vh; min-height: 100dvh; }
::selection { background: var(--accent); color: #000; }

/* ─── App container + Header ──────────────────────────────── */
.app {
  max-width: 640px; margin: 0 auto;
  padding: 0 20px calc(140px + env(safe-area-inset-bottom));
}

/* App top bar ONLY. Scope to the app's own header — a bare `header {}` rule
   also matches the workout day-card's <header class="tr-dc-head">, which then
   inherited this sticky black-gradient bar (z-index:10 + negative margins),
   showing up as a broken black rectangle over the top of every card. */
.app > header {
  position: sticky; top: 0; z-index: 10;
  margin: 0 -20px 14px;
  padding: max(20px, calc(env(safe-area-inset-top) + 12px)) 20px 14px;
  background: linear-gradient(180deg, var(--bg) 80%, rgba(10,10,10,0.85));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 6px;
}
.brand-strip {
  font-family: var(--font-display);
  font-size: 10px; font-weight: 600;
  color: var(--muted); letter-spacing: 0.32em;
  display: flex; align-items: center;
}
.brand-dot { color: var(--accent); margin-left: 4px; font-weight: 700; }
.header-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
header h1 {
  flex: 1; margin: 0;
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  letter-spacing: -0.8px; line-height: 1.1;
}

/* ─── Date Nav ────────────────────────────────────────────── */
.date-nav {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; padding: 3px; height: 34px;
  flex: 0 0 auto;
}
.date-nav button {
  width: 26px; height: 26px; border: none; cursor: pointer;
  background: var(--surface-2); border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 14px; padding: 0;
  font-family: inherit;
}
.date-nav button:last-of-type { background: transparent; color: var(--muted-dim); }
.date-label {
  font-size: 12px; font-weight: 500; padding: 0 10px; color: var(--text);
  min-width: 56px; text-align: center;
}

/* ─── Summary Card ────────────────────────────────────────── */
.summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.summary-row {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 12px;
  align-items: end;
}
.stat {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0; text-align: left;
}
.stat-lbl {
  font-size: 9px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.stat-val {
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  letter-spacing: -0.4px; color: var(--text); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-val.kcal { font-size: 24px; color: var(--accent); }

/* ─── Meals List ──────────────────────────────────────────── */
.meals-list { display: flex; flex-direction: column; gap: 10px; }
.meal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.meal-head { display: flex; align-items: flex-start; gap: 12px; }
.meal-head > div { flex: 1; min-width: 0; }
.meal-type-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.meal-type-chip {
  font-size: 10px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.4px; text-transform: uppercase;
}
.meal-time { font-size: 10px; color: var(--muted); font-weight: 500; }
.meal-name {
  font-size: 15px; font-weight: 600; color: var(--text);
  letter-spacing: -0.2px; line-height: 1.3; margin-bottom: 4px;
}
.meal-source { font-size: 10px; color: var(--muted); font-weight: 500; }
.meal-source.ai { color: var(--warn); }
.meal-source.barcode { color: var(--accent); }
.meal-source.template { color: var(--blue); }
.meal-macros {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 12px;
}
.meal-macros span {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: 99px;
  font-size: 11px; color: var(--muted); font-weight: 500;
  font-family: var(--font-mono); letter-spacing: -0.2px;
}
.meal-macros span strong {
  color: var(--text); font-weight: 600;
  font-family: var(--font);
}
.meal-actions { display: flex; gap: 8px; margin-top: 12px; }
.meal-actions button {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border-soft);
  color: var(--text); padding: 9px 12px; border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: border-color 0.15s, color 0.15s;
}
.meal-actions button:hover { border-color: var(--text-dim); }
.meal-actions .edit-meal:hover { color: var(--accent); border-color: rgba(196,240,76,0.5); }

/* Photo food recognition button (in add-meal → Beschreiben) */
.meal-photo-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin-top: 10px; padding: 13px 16px;
  background: var(--surface-2); border: 1px dashed rgba(196,240,76,0.45);
  border-radius: 14px; color: var(--accent);
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: all 0.15s;
}
.meal-photo-btn:hover { background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.08)); border-color: var(--accent); }
.meal-photo-btn:active { transform: scale(0.98); }
.meal-photo-btn:disabled { opacity: 0.5; cursor: default; }
.meal-actions .delete:hover { color: var(--danger); border-color: var(--danger); }

/* Detail edit: portion scaler */
.detail-scale-row { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-scale-row button {
  flex: 1; min-width: 56px;
  padding: 10px 8px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  cursor: pointer; transition: all 0.13s;
}
.detail-scale-row button:hover { border-color: var(--accent); color: var(--accent); }
.detail-scale-row button:active { transform: scale(0.94); }
.empty {
  text-align: center; color: var(--muted); padding: 60px 20px;
  font-size: 14px; line-height: 1.5;
}
.empty strong { color: var(--accent); font-weight: 700; }

/* ─── FAB ─────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: calc(92px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #000; border: none;
  height: 52px; padding: 0 24px; border-radius: 99px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.2px; cursor: pointer;
  box-shadow: 0 10px 30px var(--accent-glow), 0 0 0 4px var(--bg);
  z-index: 45; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.fab:active { transform: translateX(-50%) scale(0.97); }

/* ─── Modals & Sheets ─────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 100; display: none;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal.open { display: flex; }
#clarify-modal, #manual-fallback-modal, #confirm-modal, #prompt-modal { z-index: 250; }
#pw-modal, #foods-modal, #ctx-modal { z-index: 220; }
.sheet {
  background: var(--surface);
  width: 100%; max-width: 640px;
  border-radius: 32px 32px 0 0;
  border: 1px solid var(--border); border-bottom: none;
  padding: 14px 22px max(34px, env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: 0 -30px 60px rgba(0,0,0,0.6);
  animation: slideUp 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex; flex-direction: column;
}
.sheet::before {
  content: ''; display: block;
  width: 40px; height: 4px; border-radius: 99px;
  background: var(--surface-3); margin: 0 auto 18px;
  flex: 0 0 auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet h2 {
  margin: 0 0 6px; font-family: var(--font-display);
  font-size: 22px; font-weight: 700; letter-spacing: -0.5px;
}
.sheet > p.muted, .sheet .muted {
  font-size: 12px; color: var(--muted); margin: 4px 0 14px; line-height: 1.5;
}
.sheet label {
  display: block; font-size: 10px; color: var(--muted);
  margin: 14px 0 6px; text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 700;
}
.sheet input, .sheet textarea, .sheet select {
  width: 100%; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text);
  padding: 13px 14px; border-radius: var(--radius-sm);
  font-size: 16px; font-family: inherit; resize: vertical;
  transition: border-color 0.15s;
}
.sheet input:focus, .sheet textarea:focus, .sheet select:focus {
  outline: none; border-color: var(--accent);
}
.sheet textarea { min-height: 100px; line-height: 1.5; }
.sheet select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'><path d='M7 10l5 5 5-5' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
}
.sheet-actions {
  display: flex; gap: 10px; margin-top: 18px;
}
.sheet-actions button {
  flex: 1; padding: 16px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; cursor: pointer; border: none;
  letter-spacing: -0.2px; font-family: inherit;
  transition: transform 0.1s, opacity 0.15s;
}
.sheet-actions button:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border) !important;
}
.btn-danger { background: var(--danger); color: #000; }

/* ─── Loader ──────────────────────────────────────────────── */
.loader {
  display: none; flex-direction: column; align-items: center;
  gap: 12px; padding: 22px; color: var(--muted); font-size: 13px;
}
.loader.active { display: flex; }
.spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--surface-3); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Detail Modal Body ───────────────────────────────────── */
.detail-section { margin-top: 18px; }
.detail-section h3 {
  font-size: 11px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.8px; margin: 0 0 8px 4px; font-weight: 600;
}
.nutrient-grid {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); overflow: hidden;
}
.nutrient-grid > div {
  border-bottom: 1px solid var(--border-soft);
}
.nutrient-grid > div:last-child { border-bottom: none; }

/* Modern nutrient row with daily-target contribution bar */
.nutrient-row {
  display: flex; flex-direction: column; gap: 7px;
  padding: 12px 16px 13px;
}
.nutrient-row-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14px; color: var(--text); font-weight: 500;
}
.nutrient-label { flex: 1; min-width: 0; }
.nutrient-val {
  color: var(--text); font-weight: 600; font-family: var(--font-mono);
  letter-spacing: -0.2px; flex: 0 0 auto;
}

.contrib-bar {
  display: flex; align-items: center; gap: 9px;
}
.contrib-track {
  flex: 1; height: 4px; background: var(--surface-2);
  border-radius: 99px; overflow: hidden;
  position: relative;
}
.contrib-fill {
  height: 100%; background: var(--accent);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 8px -2px rgba(196,240,76,0.5);
}
.contrib-fill.high { background: #fbbf24; box-shadow: 0 0 8px -2px rgba(251,191,36,0.5); }
.contrib-fill.over { background: var(--danger); box-shadow: 0 0 8px -2px rgba(239,68,68,0.5); }
.contrib-fill.tiny { background: var(--muted); box-shadow: none; }
.contrib-pct {
  flex: 0 0 auto; min-width: 38px; text-align: right;
  font-size: 10.5px; font-weight: 700;
  color: var(--accent); font-family: var(--font-mono);
  letter-spacing: -0.2px;
}
.contrib-pct.high { color: #fbbf24; }
.contrib-pct.over { color: var(--danger); }
.contrib-pct.tiny { color: var(--muted); }
.longevity-notes {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 14px; font-size: 13px; line-height: 1.5; color: var(--text-dim);
}
.longevity-notes ul { margin: 0; padding-left: 18px; }
.longevity-notes li { margin-bottom: 4px; }

/* ─── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; top: max(20px, calc(env(safe-area-inset-top) + 12px));
  left: 50%; transform: translateX(-50%) translateY(-6px);
  background: var(--surface); border: 1px solid var(--border);
  padding: 12px 20px; border-radius: var(--radius-sm); font-size: 14px;
  z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ─── Tabs (segmented control) ────────────────────────────── */
.tabs {
  display: flex; gap: 0; margin-bottom: 16px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px; border-radius: var(--radius-sm);
}
.tabs button {
  flex: 1; background: transparent; border: none; color: var(--muted);
  padding: 9px 6px; border-radius: 10px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  letter-spacing: -0.1px; font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.tabs button.active { background: var(--accent); color: #000; }
.auth-tabs button.active { background: var(--surface-3); color: var(--text); }

/* ─── Bottom Nav (glass pill) ─────────────────────────────── */
.nav#bottom-nav {
  position: fixed; left: 16px; right: 16px;
  bottom: max(20px, env(safe-area-inset-bottom));
  background: rgba(20,20,20,0.85);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border); border-radius: 26px;
  padding: 6px; display: flex; z-index: 50;
}
.nav#bottom-nav button {
  flex: 1; background: transparent; border: none; cursor: pointer;
  padding: 10px 4px 8px; border-radius: 20px;
  color: var(--muted); font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.4px;
  text-transform: uppercase;
  transition: color 0.15s, background 0.15s;
}
.nav#bottom-nav button.active {
  background: var(--surface-3); color: var(--accent);
}
.nav#bottom-nav svg { width: 22px; height: 22px; }

/* ─── Views ───────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.18s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── Bars (Ziele) ────────────────────────────────────────── */
.bars { display: flex; flex-direction: column; }
.bar-row {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-top: none; padding: 14px 16px;
}
.bar-row:first-child {
  border-top: 1px solid var(--border-soft);
  border-top-left-radius: var(--radius); border-top-right-radius: var(--radius);
}
.bar-row:last-child {
  border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius);
}
.bar-row + .bar-row { border-top: 1px solid var(--border-soft); }
.bar-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.bar-head .name { font-size: 14px; font-weight: 500; color: var(--text); }
.bar-head .pct {
  font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--accent);
  font-family: var(--font);
}
.bar-head .pct.high { color: var(--warn); }
.bar-head .pct.over { color: var(--danger); }
.bar-track { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.bar-fill.high { background: var(--warn); }
.bar-fill.over { background: var(--danger); }
.bar-foot {
  font-size: 11px; margin-top: 6px;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text);
}
.bar-foot .muted { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.bar-foot .edit-target {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  font-size: 12px;
}
.bar-foot .edit-target:hover { color: var(--accent); }
.bar-head .ov { color: var(--accent); font-size: 11px; }
.bar-section {
  font-size: 11px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.8px; margin: 20px 4px 10px; font-weight: 600;
}

/* ─── Splash screen (covers brief auth-check flash) ──────── */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  opacity: 1;
  transition: opacity 0.22s ease-out;
}
.splash.hidden { opacity: 0; pointer-events: none; }
.splash-mark {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text);
  display: inline-flex; align-items: center;
  padding-left: 0.22em;
  animation: splashPulse 1.4s ease-in-out infinite;
}
.splash-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  margin-left: 6px; margin-bottom: 2px;
  box-shadow: 0 0 16px var(--accent);
}
@keyframes splashPulse {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* ─── Auth Screen ─────────────────────────────────────────── */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
}
.auth::before {
  content: ''; position: absolute; top: -100px; right: -120px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(196,240,76,0.18), transparent 60%);
  filter: blur(40px); pointer-events: none;
}
.auth::after {
  content: ''; position: absolute; bottom: -150px; left: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(196,240,76,0.10), transparent 65%);
  filter: blur(40px); pointer-events: none;
}
.auth-box {
  width: 100%; max-width: 400px; position: relative;
  background: transparent; border: none; padding: 0;
}
.brand-strip.auth-brand {
  text-align: center; margin-bottom: 24px;
  justify-content: center; font-size: 11px;
}
.auth-box h1 {
  margin: 0 0 32px; text-align: center;
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  letter-spacing: -0.8px; line-height: 1.05;
}
.auth-tabs {
  margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px;
}
.auth-tabs button {
  background: transparent; color: var(--muted);
  height: 38px; border-radius: 10px; font-size: 14px;
}
.auth-box form { display: flex; flex-direction: column; gap: 10px; }
.auth-box label {
  display: block; font-size: 10px; color: var(--muted);
  margin: 0 0 4px 16px; text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 700;
}
.auth-box form > label:not(:first-of-type) { margin-top: 8px; }
.auth-box input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 16px; transition: border-color 0.15s;
}
.auth-box input:focus { outline: none; border-color: var(--accent); }
.auth-box button[type="submit"] {
  width: 100%; padding: 17px; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700; letter-spacing: -0.2px;
  cursor: pointer; border: none;
  margin-top: 18px;
  background: var(--accent); color: #000;
  font-family: inherit;
  transition: transform 0.1s;
}
.auth-box button[type="submit"]:active { transform: scale(0.98); }
.auth-error {
  color: var(--danger); font-size: 13px;
  margin-top: 14px; min-height: 18px; text-align: center;
}
.link-btn {
  background: none; border: none; color: var(--muted);
  font-size: 13px; cursor: pointer; padding: 6px 2px;
  width: 100%; text-align: center; margin-top: 8px;
  text-decoration: underline;
}
.link-btn:hover { color: var(--accent); }
.auth-hint {
  color: var(--muted); font-size: 13px; line-height: 1.5;
  margin: 0 0 14px; text-align: center;
}
.reset-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.reset-row .meta { color: var(--muted); font-size: 11px; }
.reset-link-box {
  background: var(--surface-2, var(--surface)); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px; margin: 8px 0; font-size: 12px;
  word-break: break-all; user-select: all;
}

/* ─── Cards (Profil etc.) ─────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.card h3 {
  margin: 0 0 10px; font-family: var(--font-display);
  font-size: 17px; font-weight: 700; letter-spacing: -0.3px;
}
.card label {
  display: block; font-size: 10px; color: var(--muted);
  margin: 14px 0 6px; text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 700;
}
.card input, .card select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 13px 14px; border-radius: var(--radius-sm);
  font-size: 16px; font-family: inherit;
  transition: border-color 0.15s;
}
.card input:focus, .card select:focus { outline: none; border-color: var(--accent); }
.card select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'><path d='M7 10l5 5 5-5' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
}
.card hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.card button {
  padding: 14px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; cursor: pointer; border: none;
  width: 100%; margin-top: 12px; font-family: inherit;
  letter-spacing: -0.2px;
  transition: transform 0.1s;
}
.card button:active { transform: scale(0.98); }
.card .btn-primary { background: var(--accent); color: #000; }
.card .btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

.hint { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.muted { color: var(--muted); font-size: 13px; }

/* ─── Barcode Scanner ─────────────────────────────────────── */
#scanner-wrap {
  position: relative; background: #000; border-radius: var(--radius-sm);
  overflow: hidden; aspect-ratio: 4 / 3; margin-bottom: 8px; display: none;
}
#scanner-wrap.active { display: block; aspect-ratio: 16 / 12; }
#scanner-video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame {
  position: absolute; top: 25%; left: 10%; right: 10%; bottom: 25%;
  border: 2px solid var(--accent); border-radius: var(--radius-xs);
  pointer-events: none;
  box-shadow: 0 0 0 1000px rgba(0,0,0,0.5);
}
#scanner-start {
  width: 100%; padding: 16px; font-size: 15px; font-weight: 700;
  background: var(--accent); color: #000;
  border-radius: var(--radius-sm); border: none;
  margin-top: 8px; cursor: pointer; font-family: inherit;
}
#scanner-start.stop {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}

/* ─── Mic Button ──────────────────────────────────────────── */
#mic-btn {
  position: absolute; right: 8px; bottom: 8px;
  background: var(--accent); border: none; color: #000;
  width: 40px; height: 40px; border-radius: 12px;
  font-size: 18px; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
#mic-btn.recording {
  background: var(--danger); color: #fff;
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ─── Onboarding ──────────────────────────────────────────── */
.onb-progress {
  height: 4px; background: var(--surface-3); border-radius: 2px;
  margin-bottom: 18px; overflow: hidden;
}
.onb-progress > div {
  height: 100%; background: var(--accent);
  transition: width 0.25s ease; width: 20%;
}
.onb-step { display: none; }
.onb-step.active { display: block; }
.onb-step h2 {
  font-family: var(--font-display); font-size: 26px;
  font-weight: 700; letter-spacing: -0.6px; margin: 0 0 6px;
}

/* ─── Goal Pills ──────────────────────────────────────────── */
.goal-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 4px;
}
.goal-pill {
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 14px; cursor: pointer; text-align: left;
  font-size: 13px; transition: all 0.15s;
  box-shadow: inset 0 0 0 1px var(--border);
  border: none; font-family: inherit; color: var(--text);
}
.goal-pill:active { transform: scale(0.97); }
.goal-pill.active {
  background: var(--accent); color: #000;
  box-shadow: 0 0 0 1px var(--accent), 0 8px 20px rgba(196,240,76,0.18);
}
.goal-pill .lbl { font-weight: 700; font-size: 14px; }
.goal-pill .desc {
  font-size: 11px; color: var(--muted); margin-top: 2px;
}
.goal-pill.active .desc { color: #000; opacity: 0.7; }

/* ─── Detail Edit Rows ────────────────────────────────────── */
.edit-grid { display: flex; flex-direction: column; gap: 6px; }
.edit-row {
  display: grid; grid-template-columns: 1fr 100px 30px; gap: 8px;
  align-items: center;
}
.edit-row label {
  font-size: 13px; text-transform: none; letter-spacing: 0;
  color: var(--text); margin: 0; font-weight: 500;
}
.edit-row input { padding: 10px 12px; font-size: 14px; }
.edit-row .unit { font-size: 11px; color: var(--muted); }

/* ─── Items List (Meal Builder) ───────────────────────────── */
.items-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.item-row {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 14px; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.item-name { font-weight: 600; font-size: 14px; color: var(--text); }
.item-macros { font-size: 11px; color: var(--muted); margin-top: 3px; font-family: var(--font-mono); }
.item-del {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.item-del:hover { color: var(--danger); border-color: var(--danger); }
.items-total {
  background: linear-gradient(150deg, var(--surface), rgba(196,240,76,0.06));
  border: 1px solid rgba(196,240,76,0.35);
  border-radius: 14px; padding: 14px;
  margin-bottom: 12px; font-size: 13px;
}
.items-total .total-head {
  font-weight: 700; color: var(--accent); margin-bottom: 6px;
  font-size: 11px; letter-spacing: 0.4px; text-transform: uppercase;
}

/* ─── Consistency Chart ───────────────────────────────────── */
.consistency-chart {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
.cc-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; cursor: pointer; user-select: none;
}
.cc-head-left { display: flex; align-items: baseline; gap: 10px; }
.cc-head-right { display: flex; align-items: center; gap: 8px; }
.cc-title {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.8px; font-weight: 600;
}
.cc-stats { font-size: 10px; color: var(--muted); text-align: right; line-height: 1.4; }
.cc-stats br { line-height: 1; }
.cc-avg {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--accent); letter-spacing: -0.6px; line-height: 1;
}
.cc-avg.high { color: var(--warn); }
.cc-avg.low { color: var(--danger); }

/* Collapsible body */
.cc-body { max-height: 200px; overflow: hidden; transition: max-height 0.32s cubic-bezier(0.32, 0.72, 0, 1); }
.consistency-chart.collapsed .cc-body { max-height: 0; padding-top: 0; }
.consistency-chart .ch-toggle {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; transition: transform 0.2s; padding: 0;
  font-family: inherit; cursor: pointer; flex: 0 0 26px;
}
.consistency-chart.collapsed .ch-toggle { transform: rotate(-90deg); }

.cc-svg { width: 100%; height: 50px; display: block; margin-top: 10px; }
.cc-ranges { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.cc-custom {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 8px; padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cc-range-row {
  display: flex; align-items: stretch; gap: 6px;
  min-width: 0;
}
.cc-range-field {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.cc-range-lbl {
  font-size: 9px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.1px;
  margin: 0;
}
.cc-range-input {
  width: 100%; min-width: 0; padding: 7px 9px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px;
  font-size: 12px; font-family: var(--font-mono); letter-spacing: -0.2px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cc-range-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.cc-range-input::-webkit-calendar-picker-indicator {
  filter: invert(0.6) sepia(1) saturate(5) hue-rotate(40deg) brightness(1.1);
  opacity: 0.7;
  cursor: pointer;
}
.cc-range-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.cc-range-sep {
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); opacity: 0.4;
  align-self: flex-end;
  height: 32px;
}
.cc-range-apply {
  width: 100%;
  padding: 8px 12px;
  background: var(--accent); color: #000;
  border: none; border-radius: 8px;
  font-family: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: -0.1px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.cc-range-apply:hover { opacity: 0.9; }
.cc-range-apply:active { transform: scale(0.98); }
[data-theme="light"] .cc-range-apply { color: #fff; }
[data-theme="light"] .cc-range-input::-webkit-calendar-picker-indicator {
  filter: invert(0.35) sepia(1) saturate(4) hue-rotate(50deg);
}
.cc-ranges button {
  flex: 1; height: 28px; min-width: 38px;
  background: var(--surface-2); border: none;
  color: var(--text-dim); border-radius: 7px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  letter-spacing: -0.1px; font-family: inherit;
  padding: 0 6px;
  transition: background 0.15s, color 0.15s;
}
.cc-ranges button.active { background: var(--accent); color: #000; }

/* ─── Ideas (KI-Vorschläge) ───────────────────────────────── */
.ideas-block { margin-bottom: 18px; }
.ideas-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--accent); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 0 4px 10px; gap: 10px;
}
.ideas-header span { flex: 1; min-width: 0; }
.ideas-header select {
  background: var(--surface) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: 10px !important;
  padding: 6px 28px 6px 12px !important; font-size: 12px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'><path d='M7 10l5 5 5-5' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  background-repeat: no-repeat !important; background-position: right 10px center !important;
}
.ideas-list {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  margin: 0; padding: 4px 4px 8px;
}
.ideas-list::-webkit-scrollbar { display: none; }
.idea-card {
  flex: 0 0 280px;
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.06));
  border: 1px solid rgba(196,240,76,0.35);
  border-radius: var(--radius); padding: 16px;
  scroll-snap-align: start;
}
.idea-card .iname {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: -0.3px; color: var(--text); line-height: 1.2;
  margin-bottom: 6px;
}
.idea-card .iitems {
  font-size: 11px; color: var(--muted); margin-bottom: 12px; line-height: 1.5;
}
.idea-card .imacros {
  font-size: 11px; color: var(--text-dim); margin-bottom: 12px;
  font-family: var(--font-mono); letter-spacing: -0.2px;
}
.idea-card .imacros strong { color: var(--text); }
.idea-card .ifills {
  font-size: 10px;
  display: flex; flex-wrap: wrap; gap: 5px;
}
.idea-card .ifill {
  background: var(--accent-soft); padding: 4px 8px;
  border-radius: 6px; color: var(--accent);
  font-weight: 600;
}
.idea-card .iuse {
  width: 100%; margin-top: 14px; padding: 12px;
  background: var(--accent); color: #000; border: none;
  border-radius: 12px; font-weight: 700; font-size: 13px;
  cursor: pointer; font-family: inherit;
  transition: transform 0.1s;
}
.idea-card .iuse:active { transform: scale(0.98); }

/* ─── New Template Card ───────────────────────────────────── */
.new-tpl-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px dashed var(--accent); border-radius: var(--radius-sm);
  margin-bottom: 12px; cursor: pointer; transition: all 0.15s;
}
.new-tpl-card:active { transform: scale(0.98); }
.new-tpl-card:hover { background: var(--surface); border-style: solid; }
.new-tpl-title { font-weight: 700; font-size: 15px; color: var(--text); }
.new-tpl-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.new-tpl-plus {
  background: var(--accent); color: #000; width: 36px; height: 36px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}

/* ─── Template Rows ───────────────────────────────────────── */
.template-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px; background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 14px; margin-top: 8px; gap: 10px;
}
.tpl-name { font-weight: 600; font-size: 14px; color: var(--text); }
.tpl-meta { font-size: 11px; color: var(--muted); margin-top: 3px; font-family: var(--font-mono); }
.tpl-actions { display: flex; gap: 6px; }
.tpl-actions button {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); width: 36px; height: 36px;
  border-radius: 10px; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit; padding: 0;
}
.tpl-actions .tpl-use {
  background: var(--accent); color: #000;
  border-color: var(--accent); font-weight: 700;
}

/* ─── History Days ────────────────────────────────────────── */
.hist-day {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; cursor: pointer;
  transition: border-color 0.15s;
}
.hist-day:hover { border-color: var(--accent); }
.hd-date { font-weight: 600; font-size: 14px; }
.hd-count { font-size: 11px; color: var(--muted); margin-top: 3px; }
.hd-kcal { font-weight: 700; color: var(--accent); font-family: var(--font-display); font-size: 16px; }

/* ─── Recommendations ─────────────────────────────────────── */
.recommendations { margin-bottom: 18px; }
.rec-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}
.rec-card h3 {
  margin: 0 0 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent);
}
.rec-card.avoid h3 { color: var(--danger); }
.rec-food {
  padding: 10px 12px; background: var(--surface-2);
  border-radius: var(--radius-xs); margin-top: 8px;
}
.rec-food .name { font-size: 13px; font-weight: 600; color: var(--text); }
.rec-food .fills { font-size: 11px; color: var(--muted); margin-top: 4px; }
.rec-food .fill-chip {
  display: inline-block; background: var(--accent-soft);
  padding: 4px 8px; border-radius: 6px; margin: 4px 4px 0 0;
  font-size: 10px; color: var(--accent); font-weight: 600;
}
.rec-food .fc-amount { color: var(--accent); opacity: 0.7; font-size: 10px; }
.rec-avoid-items { font-size: 13px; color: var(--text); }
.rec-avoid-items .chip {
  display: inline-block; background: var(--surface-2);
  border: 1px solid var(--border); padding: 5px 12px;
  border-radius: 999px; margin: 4px 4px 0 0; font-size: 11px;
  color: var(--text-dim);
}

/* ─── Foods Modal Rows ────────────────────────────────────── */
.foods-row {
  padding: 13px 14px; background: var(--surface-2);
  border-radius: 14px; border: 1px solid var(--border-soft);
  margin-top: 8px; display: flex;
  justify-content: space-between; align-items: baseline; gap: 8px;
  flex-wrap: wrap;
}
.foods-row .fname { font-size: 14px; font-weight: 600; flex: 1; color: var(--text); }
.foods-row .fval {
  font-size: 15px; color: var(--accent); font-weight: 700;
  font-family: var(--font-display); letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}
.foods-row .fnote {
  font-size: 11px; color: var(--muted);
  flex-basis: 100%; margin-top: 4px; line-height: 1.4;
}

/* ─── Bar Help Bubble ─────────────────────────────────────── */
.bar-help {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); width: 22px; height: 22px;
  border-radius: 50%; cursor: pointer; font-size: 11px;
  padding: 0; margin-left: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.bar-help:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Invite Codes ────────────────────────────────────────── */
.invite-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xs); margin-top: 8px;
  font-size: 13px; gap: 8px; flex-wrap: wrap;
}
.invite-row .code {
  font-family: var(--font-mono); font-weight: 600;
  letter-spacing: 0.6px; color: var(--text); font-size: 14px;
}
.invite-row .meta { color: var(--muted); font-size: 11px; }
.invite-row .used { color: var(--accent); }
.invite-row button {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); padding: 6px 12px; border-radius: 6px;
  font-size: 11px; cursor: pointer; font-weight: 600;
  font-family: inherit;
}

/* ─── A11y ────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Overall Completion Meter (Today) ────────────────────── */
.overall-meter {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  margin-bottom: 14px;
}
.om-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.om-title {
  font-size: 10px; color: var(--muted); font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
}
.om-actions { display: flex; align-items: center; gap: 10px; }
.om-pct {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  letter-spacing: -0.4px; color: var(--accent); line-height: 1;
}
.om-pct.high { color: var(--warn); }
.om-pct.low  { color: var(--danger); }
.om-help {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); width: 26px; height: 26px;
  border-radius: 50%; cursor: pointer; font-size: 13px; font-weight: 700;
  padding: 0; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.om-help:hover { color: var(--accent); border-color: var(--accent); }
.overall-meter .bar-track { height: 6px; }
.overall-meter .bar-fill { height: 100%; background: var(--accent); transition: width 0.6s cubic-bezier(0.4,0,0.2,1); border-radius: 3px; }
.om-sub { margin-top: 8px; font-size: 11px; color: var(--muted); }

.missing-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.missing-row {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-xs); padding: 12px 14px;
}
.missing-row .mh {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px;
}
.missing-row .mn { font-size: 13px; font-weight: 600; color: var(--text); }
.missing-row .mp {
  font-size: 12px; color: var(--accent); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.missing-row .mp.low { color: var(--danger); }
.missing-row .mt {
  height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden;
}
.missing-row .mf { height: 100%; background: var(--accent); border-radius: 2px; }
.missing-row .mvr { font-size: 10px; color: var(--muted); margin-top: 4px; font-family: var(--font-mono); }

/* ─── Activity Card (Today) ───────────────────────────────── */
.activity-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
}
.ac-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.ac-title {
  font-size: 10px; color: var(--muted); font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
}
.ac-edit {
  background: var(--accent-soft); color: var(--accent);
  border: none; width: 28px; height: 28px; border-radius: 8px;
  cursor: pointer; font-size: 18px; font-weight: 700; padding: 0;
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.ac-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
}
.ac-stat { text-align: left; }
.ac-val {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  letter-spacing: -0.4px; color: var(--text); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ac-lbl {
  font-size: 9px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px; margin-top: 4px;
}
.ac-hint { font-size: 10px; color: var(--muted); margin-top: 10px; }

/* ─── Training Tab ────────────────────────────────────────── */
.tr-plans-list { display: flex; flex-direction: column; gap: 12px; }
.tr-plan-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.tr-plan-card:active { transform: scale(0.98); }
.tr-plan-card:hover { border-color: var(--accent); }
.tr-plan-card .tp-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.tr-plan-card .tp-name {
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  letter-spacing: -0.3px; color: var(--text); line-height: 1.2;
  flex: 1; min-width: 0;
}
.tr-plan-card .tp-source {
  font-size: 9px; font-weight: 700; padding: 4px 8px;
  border-radius: 6px; text-transform: uppercase; letter-spacing: 0.4px;
}
.tr-plan-card .tp-source.ai     { background: var(--accent-soft); color: var(--accent); }
.tr-plan-card .tp-source.manual { background: var(--surface-2); color: var(--muted); }
.tr-plan-card .tp-source.import { background: rgba(125,211,252,0.12); color: var(--blue); }
.tr-plan-card .tp-desc {
  font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5;
}
.tr-plan-card .tp-meta {
  display: flex; gap: 10px; margin-top: 10px;
  font-size: 11px; color: var(--text-dim); font-family: var(--font-mono);
}
.tr-plan-card .tp-meta span strong { color: var(--text); }

/* Training plan-create modes */
.tr-modes { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.tr-mode {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  cursor: pointer; display: flex; align-items: center; gap: 14px;
  font-family: inherit; color: var(--text); text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.tr-mode:active { transform: scale(0.98); }
.tr-mode:hover, .tr-mode.active {
  border-color: var(--accent);
  background: linear-gradient(150deg, var(--surface-2), rgba(196,240,76,0.06));
}
.tr-mode-icon {
  font-size: 24px; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 44px;
}
.tr-mode-body { flex: 1; min-width: 0; }
.tr-mode-title { font-weight: 700; font-size: 14px; color: var(--text); }
.tr-mode-sub { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* Plan detail */
.tr-progress {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 14px;
  margin-bottom: 16px;
}
.tr-progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px; font-size: 12px; color: var(--text-dim); font-weight: 500;
}
.tr-progress-head span:last-child {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  color: var(--accent); letter-spacing: -0.3px;
}
.tr-progress .bar-track { height: 6px; }
.tr-progress-foot { font-size: 11px; color: var(--muted); margin-top: 6px; font-family: var(--font-mono); }

.tr-session {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px;
}
.tr-session-head {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.tr-session-name { font-weight: 700; font-size: 14px; color: var(--text); }
.tr-session-meta { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.tr-exercises { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.tr-exercise {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: var(--radius-xs);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.tr-exercise:hover { border-color: var(--text-dim); }
.tr-exercise.done {
  background: linear-gradient(135deg, var(--surface), rgba(196,240,76,0.08));
  border-color: rgba(196,240,76,0.4);
}
.tr-exercise.done .tr-ex-name { color: var(--muted); text-decoration: line-through; }
.tr-checkbox {
  width: 22px; height: 22px; border-radius: 7px;
  border: 1.5px solid var(--border); flex: 0 0 22px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.tr-exercise.done .tr-checkbox {
  background: var(--accent); border-color: var(--accent); color: #000;
}
.tr-checkbox svg { width: 14px; height: 14px; display: none; }
.tr-exercise.done .tr-checkbox svg { display: block; }
.tr-ex-body { flex: 1; min-width: 0; }
.tr-ex-name { font-size: 14px; font-weight: 600; color: var(--text); }
.tr-ex-meta { font-size: 11px; color: var(--muted); margin-top: 3px; font-family: var(--font-mono); letter-spacing: -0.2px; }

/* Manual edit */
.tr-me-session {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; margin-top: 10px;
}
.tr-me-session-head {
  display: flex; gap: 8px; align-items: center; margin-bottom: 10px;
}
.tr-me-session-head input { flex: 1; padding: 10px; font-size: 14px; }
.tr-me-session-del { background: transparent; border: 1px solid var(--border); color: var(--muted); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.tr-me-exercises { display: flex; flex-direction: column; gap: 8px; }
.tr-me-ex {
  background: var(--surface-2); border-radius: var(--radius-xs);
  padding: 8px; display: grid;
  grid-template-columns: 2fr 56px 76px 28px; gap: 6px; align-items: center;
}
.tr-me-ex input { padding: 8px; font-size: 13px; }
.tr-me-ex-del { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; cursor: pointer; height: 36px; padding: 0; font-family: inherit; }
.tr-me-add-ex {
  margin-top: 8px; background: var(--surface-2); border: 1px dashed var(--border);
  color: var(--text-dim); padding: 10px; border-radius: var(--radius-xs);
  cursor: pointer; font-size: 12px; font-family: inherit; width: 100%;
}

/* ─── Install Banner & Help ───────────────────────────────── */
.install-banner {
  background: linear-gradient(135deg, var(--surface), rgba(196,240,76,0.10));
  border: 1px solid rgba(196,240,76,0.40);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px;
}
.install-banner .ib-icon {
  font-size: 24px; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.install-banner .ib-body { flex: 1; min-width: 0; }
.install-banner .ib-title {
  font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2;
}
.install-banner .ib-sub {
  font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4;
}
.install-banner .ib-btn {
  background: var(--accent); color: #000; border: none; cursor: pointer;
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 700; font-family: inherit;
  flex: 0 0 auto;
}
.install-banner .ib-btn:active { transform: scale(0.96); }
.install-banner .ib-close {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; padding: 6px; font-size: 14px; flex: 0 0 auto;
  font-family: inherit;
}

.install-steps { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 4px; }
.install-step {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.install-step .is-num {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.install-step .is-body { flex: 1; }
.install-step .is-body strong {
  display: block; font-size: 13px; color: var(--text); margin-bottom: 3px;
}
.install-step .is-body span {
  display: block; font-size: 12px; color: var(--muted); line-height: 1.4;
}

/* ─── Install Banner — floating popup (bottom) ────────────── */
.install-banner-pop {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 80; max-width: 612px; margin: 0 auto;
  background: rgba(20,20,20,0.96);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(196,240,76,0.40);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(196,240,76,0.10);
  animation: installPop 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes installPop {
  from { transform: translateY(140%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.install-banner-pop .ib-icon {
  font-size: 22px; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.install-banner-pop .ib-body { flex: 1; min-width: 0; }
.install-banner-pop .ib-title { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; }
.install-banner-pop .ib-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.install-banner-pop .ib-btn  {
  background: var(--accent); color: #000; border: none; cursor: pointer;
  padding: 9px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 700; font-family: inherit; flex: 0 0 auto;
}
.install-banner-pop .ib-btn:active { transform: scale(0.96); }
.install-banner-pop .ib-close {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; padding: 6px; font-size: 14px; flex: 0 0 auto;
  font-family: inherit;
}
/* hide the old inline variant entirely if any version lingers */
.install-banner { display: none !important; }

/* ─── Combined Summary + Overall Meter ────────────────────── */
.summary.summary-combined {
  padding: 0; overflow: hidden;
}
.summary.summary-combined .summary-row {
  padding: 18px 18px 16px;
}
.summary.summary-combined .summary-divider {
  height: 1px; background: var(--border-soft); margin: 0;
}
.summary.summary-combined .overall-meter {
  background: transparent; border: none;
  border-radius: 0; margin-bottom: 0; padding: 14px 18px 16px;
}
.summary.summary-combined .overall-meter .om-sub { margin-top: 8px; }

/* ─── vs-Yesterday Delta Chip ─────────────────────────────── */
.om-delta {
  font-size: 11px; font-weight: 700;
  padding: 4px 8px; border-radius: 6px;
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 3px;
}
.om-delta.up   { background: var(--accent-soft); color: var(--accent); }
.om-delta.down { background: var(--danger-soft); color: var(--danger); }
.om-delta.same { background: var(--surface-2); color: var(--muted); }

/* ─── Sticky Close-X on sheets ────────────────────────────── */
.sheet-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 700;
  cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; z-index: 5;
}
.sheet-close:active { transform: scale(0.92); }
.sheet { position: relative; }

/* ─── Training Landing — Hero + Quick Actions ─────────────── */
.tr-hero {
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px 18px;
  margin-bottom: 16px;
}
.tr-hero-eyebrow {
  font-size: 10px; font-weight: 700; color: var(--accent);
  letter-spacing: 1px; text-transform: uppercase;
}
.tr-hero-title {
  margin: 8px 0 4px; font-family: var(--font-display);
  font-size: 26px; font-weight: 700; letter-spacing: -0.6px;
  color: var(--text); line-height: 1.1;
}
.tr-hero-sub { margin: 0 0 18px; font-size: 13px; color: var(--muted); line-height: 1.5; }

.tr-quick-grid {
  display: flex; flex-direction: column; gap: 10px;
}
.tr-quick {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; color: var(--text); text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.tr-quick:active { transform: scale(0.98); }
.tr-quick:hover { border-color: var(--accent); background: linear-gradient(135deg, var(--surface-2), rgba(196,240,76,0.05)); }
.tr-quick-icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.tr-quick-body { flex: 1; min-width: 0; }
.tr-quick-title { font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.2; }
.tr-quick-sub { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.tr-quick-arrow {
  flex: 0 0 auto; font-size: 18px; color: var(--muted-dim);
  transition: color 0.15s, transform 0.15s;
}
.tr-quick:hover .tr-quick-arrow { color: var(--accent); transform: translateX(2px); }

/* List header when plans exist */
.tr-list-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 4px 4px 12px;
}
.tr-list-title {
  font-size: 11px; color: var(--text-dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.tr-list-add {
  background: var(--accent); color: #000; border: none;
  padding: 9px 14px; border-radius: 10px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  letter-spacing: -0.1px; font-family: inherit;
}
.tr-list-add:active { transform: scale(0.96); }

/* ─── Training: "+ Neuer Plan" card (replaces small button) ───── */
.tr-list-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 4px 4px 12px;
}
.tr-list-head .tr-list-title {
  font-size: 11px; color: var(--text-dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.tr-new-card {
  width: 100%; margin-top: 14px;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1.5px dashed rgba(196,240,76,0.55);
  border-radius: var(--radius);
  cursor: pointer; font-family: inherit; color: var(--text); text-align: left;
  transition: all 0.18s;
}
.tr-new-card:hover {
  border-style: solid;
  background: linear-gradient(135deg, var(--surface-2), rgba(196,240,76,0.08));
  border-color: var(--accent);
}
.tr-new-card:active { transform: scale(0.985); }
.tr-new-icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #000;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(196,240,76,0.35);
}
.tr-new-body { flex: 1; min-width: 0; }
.tr-new-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 16px; color: var(--text);
  letter-spacing: -0.2px; line-height: 1.2;
}
.tr-new-sub {
  font-size: 11px; color: var(--muted); margin-top: 4px;
  font-family: var(--font-mono); letter-spacing: -0.1px;
}

/* drop old small button if any remnant */
.tr-list-add { display: none !important; }

/* Polish plan-card */
.tr-plan-card {
  position: relative;
}
.tr-plan-card::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 3px;
  background: var(--accent);
  border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius);
  opacity: 0.6;
}
.tr-plan-card.has-progress::after {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  opacity: 1;
}

/* ─── Custom file picker (training PDF/image import) ──────── */
.tr-file-pick {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin-top: 8px;
  background: var(--surface-2); border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s;
}
.tr-file-pick:hover { border-color: var(--accent); background: linear-gradient(135deg, var(--surface-2), rgba(196,240,76,0.05)); }
.tr-file-pick:active { transform: scale(0.985); }
.tr-file-icon {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.tr-file-body { flex: 1; min-width: 0; }
.tr-file-title { font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.2; }
.tr-file-sub { font-size: 11px; color: var(--muted); margin-top: 3px; font-family: var(--font-mono); letter-spacing: -0.1px; }
.tr-file-pick.has-file { border-style: solid; border-color: var(--accent); }
.tr-file-pick.has-file .tr-file-title { color: var(--accent); }

/* ─── Manual edit polish ──────────────────────────────────── */
.tr-me-session {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px; margin-top: 12px;
}
.tr-me-session-head {
  display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
}
.tr-me-session-head input {
  flex: 1; padding: 11px 12px; font-size: 14px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border-soft);
}
.tr-me-session-del {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); width: 36px; height: 36px; border-radius: 8px;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.tr-me-session-del:hover { color: var(--danger); border-color: var(--danger); }
.tr-me-ex {
  background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: var(--radius-xs);
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 60px 80px 32px;
  gap: 6px; align-items: center;
}
.tr-me-ex input { padding: 9px 10px; font-size: 13px; }
.tr-me-ex input.me-ex-name { font-weight: 500; }
.tr-me-ex-del {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 6px; cursor: pointer;
  height: 36px; padding: 0; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.tr-me-ex-del:hover { color: var(--danger); border-color: var(--danger); }
.tr-me-add-ex {
  margin-top: 8px; background: transparent;
  border: 1px dashed var(--border);
  color: var(--accent); padding: 10px; border-radius: var(--radius-xs);
  cursor: pointer; font-size: 12px; font-weight: 600; font-family: inherit; width: 100%;
}
.tr-me-add-ex:hover { border-color: var(--accent); background: var(--accent-soft); }
/* Column headers for manual exercise grid */
.tr-me-ex-header {
  display: grid; grid-template-columns: 1fr 60px 80px 32px;
  gap: 6px; padding: 0 10px 4px;
  font-size: 9px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
}

/* ─── AI mode sub-switch ──────────────────────────────────── */
.tr-mode-switch {
  display: flex; gap: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px; border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.tr-mode-switch button {
  flex: 1; background: transparent; border: none; color: var(--muted);
  padding: 10px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; letter-spacing: -0.1px;
  transition: background 0.15s, color 0.15s;
}
.tr-mode-switch button.active { background: var(--accent); color: #000; }

/* ─── "+ Neue Session" card (manual editor) ────────────────── */
.tr-add-session-card {
  width: 100%; margin-top: 14px;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1.5px dashed rgba(196,240,76,0.5);
  border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; color: var(--text); text-align: left;
  transition: all 0.18s;
}
.tr-add-session-card:hover {
  border-style: solid; border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface), rgba(196,240,76,0.06));
}
.tr-add-session-card:active { transform: scale(0.985); }
.tr-add-session-card .tr-add-icon {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #000;
  display: flex; align-items: center; justify-content: center;
}
.tr-add-session-card .tr-add-body { flex: 1; min-width: 0; }
.tr-add-session-card .tr-add-title { font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.2; }
.tr-add-session-card .tr-add-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ─── Sport-Abzug Visualisierung ──────────────────────────── */
.stat-burn {
  font-size: 11px; color: var(--danger); font-weight: 600;
  margin-top: 4px; display: flex; align-items: center; gap: 3px;
  font-variant-numeric: tabular-nums;
}
.stat-burn::before { content: "−"; font-weight: 700; }

/* Kcal stat row with burn overlay */
.summary.summary-combined .stat.has-burn .stat-val.kcal {
  position: relative;
}
.summary.summary-combined .stat.has-burn .stat-val.kcal::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--danger); opacity: 0.7;
}

/* ─── Fill chip color variants (recommendations + ideas) ──── */
.ifill.ideal {
  background: var(--accent); color: #0a0a0a; font-weight: 700;
}
.ifill.ideal::before { content: "✓ "; }
.ifill.over {
  background: var(--danger-soft); color: var(--danger);
}
.ifill.over::before { content: "▲ "; }

/* ─── Training Streak Card (in plan-detail) ───────────────── */
.tr-streak-card {
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px;
}
.tr-streak-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.tr-streak-label {
  font-size: 10px; color: var(--muted); font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
}
.tr-streak-val {
  font-family: var(--font-display); font-size: 36px; font-weight: 700;
  color: var(--accent); letter-spacing: -1.5px; line-height: 1;
  margin-top: 4px; display: inline-flex; align-items: baseline; gap: 5px;
}
.tr-streak-val .tr-streak-unit {
  font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0;
}
.tr-streak-pct {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--text); letter-spacing: -0.5px; line-height: 1; margin-top: 4px;
}
.tr-spark { width: 100%; height: 70px; display: block; margin: 6px 0 10px; }
.tr-progress-bar { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.tr-progress-bar .bar-fill { background: var(--accent); height: 100%; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.tr-progress-foot { font-size: 11px; color: var(--muted); margin-top: 8px; font-family: var(--font-mono); letter-spacing: -0.1px; }

/* ─── Session "komplett abhaken" button ───────────────────── */
.tr-session-actions {
  display: flex; gap: 8px; align-items: center; margin-top: 4px;
}
.tr-session-complete {
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(196,240,76,0.4);
  padding: 6px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 700; cursor: pointer;
  font-family: inherit; letter-spacing: -0.1px;
  display: inline-flex; align-items: center; gap: 5px;
}
.tr-session-complete:active { transform: scale(0.96); }
.tr-session-complete.done {
  background: var(--accent); color: #000;
  border-color: var(--accent);
}
.tr-session-progress-row {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 4px;
}
.tr-session-progress-row .bar-track { flex: 1; height: 4px; }
.tr-session-progress-row .pct {
  font-size: 11px; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; min-width: 36px; text-align: right;
}
.tr-session-progress-row .pct.full { color: var(--accent); }

/* ─── Portion-based recommendation rows ───────────────────── */
.ifills-stack { display: flex; flex-direction: column; gap: 6px; }
.ifill-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; background: var(--surface-2);
  border-radius: 8px; border: 1px solid var(--border-soft);
}
.ifill-portion {
  font-family: var(--font-mono); font-size: 11px; color: var(--text);
  font-weight: 600; letter-spacing: -0.2px;
  white-space: nowrap;
}
.ifill-row .ifill.ideal {
  margin-left: auto; font-size: 10px; padding: 3px 7px;
}

/* ─── Collapsible blocks (Vorschläge ein-/ausblenden) ────── */
.collapse-head {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; user-select: none;
  padding: 4px 4px 10px;
}
.collapse-head .ch-title {
  font-size: 11px; color: var(--text-dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.collapse-head .ch-toggle {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; transition: transform 0.2s;
  font-family: inherit; cursor: pointer; padding: 0;
}
.collapse-block.open .collapse-head .ch-toggle { transform: rotate(180deg); }
.collapse-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.collapse-block.open .collapse-body { max-height: 4000px; }

/* ─── Today's Workout — Hero Card ─────────────────────────── */
.tr-today-hero {
  background: linear-gradient(155deg, rgba(196,240,76,0.15), var(--surface));
  border: 1.5px solid var(--accent);
  border-radius: var(--radius); padding: 18px 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 12px 32px rgba(196,240,76,0.10);
  position: relative; overflow: hidden;
}
.tr-today-hero::before {
  content: ""; position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(196,240,76,0.22), transparent 60%);
  pointer-events: none;
}
.tr-today-eyebrow {
  font-size: 10px; font-weight: 700; color: var(--accent);
  letter-spacing: 1.4px; text-transform: uppercase;
  position: relative; z-index: 1;
}
.tr-today-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px; color: var(--text); line-height: 1.15;
  margin: 6px 0 2px; position: relative; z-index: 1;
}
.tr-today-sub {
  font-size: 12px; color: var(--muted); margin-bottom: 14px;
  position: relative; z-index: 1;
}
.tr-today-hero .tr-session-progress-row { margin: 4px 0 10px; position: relative; z-index: 1; }
.tr-today-hero .tr-exercises { position: relative; z-index: 1; }
.tr-today-hero .tr-session-complete {
  width: 100%; justify-content: center; padding: 12px;
  font-size: 13px; margin-top: 12px;
  position: relative; z-index: 1;
}
.tr-today-empty {
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 24px;
  text-align: center; color: var(--muted);
  margin-bottom: 14px;
}

/* ─── Tomorrow Preview Card ───────────────────────────────── */
.tr-tomorrow-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px;
}
.tr-tomorrow-icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.tr-tomorrow-body { flex: 1; min-width: 0; }
.tr-tomorrow-eyebrow {
  font-size: 9px; font-weight: 700; color: var(--muted);
  letter-spacing: 1px; text-transform: uppercase;
}
.tr-tomorrow-title {
  font-weight: 700; font-size: 14px; color: var(--text);
  margin-top: 3px; line-height: 1.2;
}
.tr-tomorrow-meta {
  font-size: 11px; color: var(--text-dim); margin-top: 2px;
  font-family: var(--font-mono); letter-spacing: -0.1px;
}

/* ─── Shortcut Modal — Premium Setup Flow ────────────────── */
#shortcut-modal h2 {
  font-size: 22px; margin-bottom: 8px;
}

.sc-token-box {
  margin-top: 18px; padding: 14px;
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.sc-token-label {
  font-size: 9px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px;
}
.sc-token-row {
  display: flex; gap: 8px; align-items: stretch;
}
.sc-token-row input {
  flex: 1; background: var(--bg) !important;
  font-family: var(--font-mono);
  font-size: 13px !important;
  letter-spacing: -0.3px;
  border: 1px solid var(--border-soft) !important;
  border-radius: 10px !important;
  padding: 11px 12px !important;
  color: var(--text); font-weight: 500;
}
.sc-copy-btn {
  flex: 0 0 46px; width: 46px;
  background: var(--accent); color: #000;
  border: none; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit; transition: transform 0.1s;
}
.sc-copy-btn:active { transform: scale(0.92); }
.sc-copy-btn.copied {
  background: var(--accent-deep);
}

.sc-url-box {
  margin-top: 12px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.sc-url-label {
  font-size: 9px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px;
}
.sc-url-val {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); letter-spacing: -0.2px;
  word-break: break-all;
}

.sc-steps {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 18px;
}
.sc-step {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.sc-num {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #000;
  font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.sc-body {
  flex: 1; font-size: 13px; color: var(--text); line-height: 1.5;
}
.sc-body strong { color: var(--text); font-weight: 600; }
.sc-code {
  margin-top: 6px; padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: 8px; font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); letter-spacing: -0.2px;
  word-break: break-all; white-space: pre-wrap;
}

.sc-rotate-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 20px auto 0; padding: 9px 16px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  color: var(--muted); font-family: inherit;
  font-size: 11px; font-weight: 600; letter-spacing: -0.1px;
  cursor: pointer; border-radius: 99px;
  width: max-content;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.sc-rotate-link::before {
  content: ""; display: inline-block; width: 12px; height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12a9 9 0 0115-6.7L21 8M21 3v5h-5M21 12a9 9 0 01-15 6.7L3 16M3 21v-5h5'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12a9 9 0 0115-6.7L21 8M21 3v5h-5M21 12a9 9 0 01-15 6.7L3 16M3 21v-5h5'/></svg>") center/contain no-repeat;
}
.sc-rotate-link:hover {
  color: var(--danger); border-color: var(--danger);
  background: var(--danger-soft);
}

/* ─── Smartwatch Wizard ───────────────────────────────────── */
.wiz-progress {
  height: 4px; background: var(--surface-3); border-radius: 2px;
  margin-bottom: 18px; overflow: hidden;
}
.wiz-progress-fill {
  height: 100%; background: var(--accent);
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1); width: 0%;
}
.wiz-slide { display: none; animation: wizFadeIn 0.25s ease-out; }
.wiz-slide.active { display: block; }
@keyframes wizFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.wiz-eyebrow {
  font-size: 10px; font-weight: 700; color: var(--accent);
  letter-spacing: 1.4px; text-transform: uppercase;
  margin-bottom: 6px;
}

/* Friendly hero block on slide 0 */
.wiz-hero {
  text-align: center;
  margin-bottom: 22px;
}
.wiz-hero-icon {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(155deg, var(--accent-soft), rgba(196,240,76,0.04));
  border: 1px solid rgba(196,240,76,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  box-shadow: 0 8px 28px -8px rgba(196,240,76,0.35);
}
.wiz-hero h2 { margin: 0 0 6px; }
.wiz-hero p { margin: 0; }

/* Trust footer under device picker */
.wiz-trust {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 18px; padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 11px; color: var(--muted); line-height: 1.45;
}
.wiz-trust svg { color: var(--accent); flex: 0 0 14px; margin-top: 1px; }

/* Slide 1 visual flow + checklist */
.wiz-flow-visual {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center;
  margin-top: 18px; padding: 16px;
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.04));
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}
.wiz-checklist {
  margin-top: 16px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.wiz-checklist-title {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.9px;
  margin-bottom: 10px;
}
.wiz-check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  font-size: 13px; color: var(--text-dim); line-height: 1.4;
}
.wiz-check-row strong { color: var(--text); font-weight: 600; }
.wiz-check {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* Slide 2 tip row + details */
.wiz-tip-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 14px; padding: 12px 14px;
  background: rgba(125,211,252,0.08);
  border: 1px solid rgba(125,211,252,0.22);
  border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-dim); line-height: 1.55;
}
.wiz-tip-row svg { color: var(--blue); }
.wiz-tip-row strong { color: var(--blue); }

.wiz-details {
  margin-top: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.wiz-details summary {
  list-style: none; cursor: pointer;
  padding: 10px 14px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  letter-spacing: -0.1px;
  display: flex; align-items: center; gap: 6px;
}
.wiz-details summary::-webkit-details-marker { display: none; }
.wiz-details summary::before {
  content: ""; width: 8px; height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  margin-right: 2px;
}
.wiz-details[open] summary::before { transform: rotate(45deg); }
.wiz-details[open] summary { color: var(--text); border-bottom: 1px solid var(--border-soft); }
.wiz-details .sc-url-box { margin: 12px; }

.wiz-devices { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.wiz-device {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; color: var(--text); text-align: left;
  transition: all 0.15s;
}
.wiz-device:hover { border-color: var(--accent); background: linear-gradient(135deg, var(--surface-2), rgba(196,240,76,0.05)); }
.wiz-device:active { transform: scale(0.98); }
.wiz-device-icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.wiz-device-body { flex: 1; min-width: 0; }
.wiz-device-title { font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.2; }
.wiz-device-sub { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.wiz-device-arrow {
  flex: 0 0 auto; font-size: 18px; color: var(--muted-dim);
  transition: transform 0.15s, color 0.15s;
}
.wiz-device:hover .wiz-device-arrow { color: var(--accent); transform: translateX(3px); }

.wiz-flow {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-top: 18px; padding: 14px; background: var(--surface-2);
  border-radius: var(--radius-sm); border: 1px solid var(--border-soft);
  justify-content: center;
}
.wiz-flow-pill {
  font-size: 11px; font-weight: 600; padding: 6px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; color: var(--text);
}
.wiz-flow-pill.accent { background: var(--accent); color: #000; border-color: var(--accent); }
.wiz-flow-arrow { color: var(--muted); font-size: 13px; }

.wiz-done-icon {
  width: 80px; height: 80px; margin: 8px auto 16px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}

.wiz-actions {
  display: flex; gap: 10px; margin-top: 22px;
}
.wiz-actions button {
  flex: 1; padding: 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; cursor: pointer; border: none;
  font-family: inherit; letter-spacing: -0.2px;
  transition: transform 0.1s;
}
.wiz-actions button:active { transform: scale(0.97); }

/* ─── Single-Food Recommendation Cards (Claude Design style) ─ */
.rec-card {
  flex: 0 0 280px;
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.06));
  border: 1px solid rgba(196,240,76,0.35);
  border-radius: var(--radius);
  padding: 14px 16px;
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 8px;
}
.rec-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.rec-head > .rec-portion { flex: 1; min-width: 0; }
.rec-portion {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: -0.3px; color: var(--text); line-height: 1.2;
}
.rec-items { font-size: 11px; color: var(--muted); line-height: 1.4; margin-top: -4px; }
.rec-macros { padding-bottom: 0; border-bottom: none; }
.rec-card .rec-pills { margin-top: 2px; }
.rec-tag {
  display: inline-block; margin-top: 6px;
  background: var(--accent); color: #000;
  padding: 3px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.2px;
}
.rec-fills {
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
  display: flex; flex-direction: column; gap: 5px;
}
.rec-fill-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
}
.rec-fill-row > span:first-child { color: var(--text-dim); }
.rec-fill-pct {
  color: var(--accent); font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono); letter-spacing: -0.2px;
}
.rec-quick-add {
  flex: 0 0 32px; width: 32px; height: 32px;
  background: var(--surface-2); color: var(--accent);
  border: 1px solid rgba(196,240,76,0.5); border-radius: 10px;
  cursor: pointer; padding: 0; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.rec-quick-add:hover {
  background: var(--accent); color: #000; border-color: var(--accent);
}
.rec-quick-add:active { transform: scale(0.92); }

/* ─── Recommendation Pills (multi-nutrient) ───────────────── */
.rec-pills {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 4px;
}
.rec-pill {
  font-size: 10px; font-weight: 600;
  background: var(--surface-2);
  color: var(--text-dim);
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--border-soft);
}
.rec-pill strong { color: var(--text); font-weight: 700; font-family: var(--font-mono); letter-spacing: -0.2px; }
.rec-pill.ideal {
  background: var(--accent-soft); color: var(--accent);
  border-color: rgba(196,240,76,0.35);
}
.rec-pill.ideal strong { color: var(--accent); }
.rec-pill.over {
  background: var(--danger-soft); color: var(--danger);
  border-color: rgba(248,113,113,0.35);
}
.rec-pill.over strong { color: var(--danger); }

/* unify card sizing — single-food + meal-idea cards same width AND height.
   Avoid-card is excluded: it can grow to fit all warnings. */
.rec-card:not(.avoid) { min-height: 200px; max-height: 220px; overflow: hidden; }
.rec-card:not(.avoid) .rec-items {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-card:not(.avoid) .rec-pills { max-height: 56px; overflow: hidden; }

/* ─── Activity Card — empty state (collapsible) ───────────── */
.activity-card.ac-empty {
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.06));
  border: 1px dashed rgba(196,240,76,0.4);
  padding: 0;
  overflow: hidden;
}
.ac-empty-head {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; color: inherit; text-align: left;
}
.ac-empty-icon {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.ac-empty-body-text { flex: 1; min-width: 0; text-align: left; }
.ac-empty-title { font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.25; }
.ac-empty-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.ac-empty-chevron {
  flex: 0 0 22px;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
.ac-empty:not(.ac-collapsed) .ac-empty-chevron { transform: rotate(180deg); color: var(--accent); }
.ac-empty-expand {
  max-height: 200px; overflow: hidden;
  padding: 0 14px 14px;
  transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}
.ac-collapsed .ac-empty-expand {
  max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0;
}
.ac-empty-actions {
  display: flex; gap: 8px; width: 100%;
}
.ac-empty-actions button {
  flex: 1; padding: 11px; border-radius: 10px;
  font-size: 13px; font-weight: 700; font-family: inherit; border: none; cursor: pointer;
  letter-spacing: -0.1px;
}
.ac-empty-actions .btn-primary { background: var(--accent); color: #000; }
.ac-empty-actions .btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border) !important; }

/* ═══ Profile redesign (Claude design) ════════════════════ */

/* Hero — avatar + email */
.prof-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 18px;
  background: linear-gradient(155deg, var(--surface) 0%, rgba(196,240,76,0.06) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.prof-hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,240,76,0.5), transparent);
}
.prof-avatar-wrap {
  position: relative;
  flex: 0 0 54px; width: 54px; height: 54px;
  background: transparent; border: none; padding: 0;
  cursor: pointer; font-family: inherit;
}
.prof-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 26px -6px rgba(196,240,76,0.45),
              inset 0 1px 0 rgba(255,255,255,0.3);
  background-size: cover; background-position: center;
  transition: filter 0.15s;
}
.prof-avatar-wrap:hover .prof-avatar { filter: brightness(0.85); }
.prof-avatar-edit {
  position: absolute; bottom: -2px; right: -2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg); color: var(--accent);
  border: 2px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(196,240,76,0.4);
}
.prof-hero-text { flex: 1; min-width: 0; }
.prof-hero-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 19px; color: var(--text); letter-spacing: -0.4px;
  line-height: 1.1; margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.prof-hero-email {
  font-size: 12px; color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: -0.2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Section cards */
.prof-section {
  padding: 16px 18px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.prof-section-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.prof-section-eyebrow {
  font-size: 9.5px; font-weight: 700;
  color: var(--accent);
  letter-spacing: 1.4px; text-transform: uppercase;
  margin-bottom: 3px;
}
.prof-section-title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700; color: var(--text);
  letter-spacing: -0.3px; line-height: 1.2;
}

/* Pill button (Bearbeiten etc.) */
.prof-pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  background: var(--accent-soft);
  border: 1px solid rgba(196,240,76,0.35);
  border-radius: 99px;
  color: var(--accent);
  font-size: 11.5px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  letter-spacing: -0.1px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.prof-pill-btn:hover {
  background: var(--accent); color: #000;
  border-color: var(--accent);
}
.prof-pill-btn:active { transform: scale(0.96); }

/* Summary chips */
.prof-summary-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
}
.prof-chip {
  display: inline-flex; align-items: center;
  padding: 7px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 99px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}
.prof-chip strong {
  color: var(--accent); font-weight: 700;
  margin-right: 4px;
}
.prof-chip.accent {
  background: var(--accent-soft);
  border-color: rgba(196,240,76,0.3);
  color: var(--accent);
}
.prof-summary-empty {
  font-size: 12.5px; color: var(--muted); line-height: 1.45;
  padding: 4px 0;
}

/* Action rows (tap targets) */
.prof-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit; text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 8px;
}
.prof-row:last-child { margin-bottom: 0; }
.prof-row:hover {
  border-color: rgba(196,240,76,0.35);
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.04));
}
.prof-row:active { transform: scale(0.98); }
.prof-row-icon {
  flex: 0 0 38px; width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.prof-row-body { flex: 1; min-width: 0; }
.prof-row-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  letter-spacing: -0.2px; line-height: 1.25;
}
.prof-row-sub {
  font-size: 11.5px; color: var(--muted);
  margin-top: 2px; line-height: 1.35;
}
.prof-row-arrow {
  flex: 0 0 auto;
  color: var(--muted-dim);
  font-size: 18px;
  transition: transform 0.15s, color 0.15s;
}
.prof-row:hover .prof-row-arrow { color: var(--accent); transform: translateX(3px); }
.prof-row-danger .prof-row-icon { background: rgba(239,68,68,0.1); color: var(--danger); }
.prof-row-danger:hover {
  border-color: rgba(239,68,68,0.35);
  background: linear-gradient(155deg, var(--surface-2), rgba(239,68,68,0.04));
}
.prof-row-danger:hover .prof-row-arrow { color: var(--danger); }

/* Toggle switch (iOS-style) */
.prof-toggle {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  cursor: pointer; user-select: none;
  text-transform: none; letter-spacing: 0;
}
.prof-toggle + .prof-toggle { border-top: 1px solid var(--border-soft); }
.prof-toggle-compact { padding: 11px 0; }
.prof-toggle input { display: none; }
.prof-toggle-track {
  flex: 0 0 40px; position: relative;
  width: 40px; height: 24px;
  background: #2a2a2a;
  border-radius: 99px;
  transition: background 0.2s;
  margin-top: 1px;
  border: 1px solid var(--border);
}
.prof-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  transition: left 0.2s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.prof-toggle input:checked + .prof-toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.prof-toggle input:checked + .prof-toggle-track .prof-toggle-thumb {
  left: 20px;
  background: #000;
}
.prof-toggle-label {
  flex: 1;
  font-size: 13px; line-height: 1.4;
  color: var(--text-dim);
  font-weight: 400;
}
.prof-toggle-label strong {
  display: block; color: var(--text); font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.prof-toggle-label span {
  font-size: 11.5px; color: var(--muted);
}

/* Footer brand */
.prof-footer {
  text-align: center;
  padding: 22px 0 30px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted-dim, #555);
}

/* Form-mode tweaks inside profile — only target plain form labels, NOT toggles */
.prof-section label:not(.prof-toggle) {
  display: block;
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin: 12px 0 6px;
}
.prof-section input:not([type="checkbox"]):not([type="radio"]),
.prof-section select {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.prof-section input:focus,
.prof-section select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196,240,76,0.12);
}
/* Toggle text — explicitly NOT uppercase */
.prof-toggle,
.prof-toggle-label,
.prof-toggle-label strong,
.prof-toggle-label span {
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin: 0 !important;
  display: flex;
  font-weight: 400;
  color: var(--text-dim);
  font-size: 13px;
}
.prof-toggle-label { display: flex; flex-direction: column; }
.prof-toggle-label strong { font-size: 13.5px !important; color: var(--text) !important; font-weight: 600 !important; margin-bottom: 2px !important; }
.prof-toggle-label span { font-size: 11.5px !important; color: var(--muted) !important; }
/* Toggle checkbox must stay hidden; track is the visible element */
.prof-toggle input[type="checkbox"] {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important;
  border: 0 !important;
}

/* Save / Cancel buttons in profile form — proper styling */
.prof-section .btn-primary,
.prof-section .btn-secondary {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.prof-section .btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 6px 18px -6px rgba(196,240,76,0.45);
}
.prof-section .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -6px rgba(196,240,76,0.55);
}
.prof-section .btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border) !important;
}
.prof-section .btn-secondary:hover {
  border-color: rgba(196,240,76,0.35) !important;
  color: var(--accent);
}
.prof-section .btn-primary:active,
.prof-section .btn-secondary:active { transform: scale(0.97); }

/* View switch (Sessions / Excel-Table) */
.tr-view-switch {
  display: flex; gap: 4px;
  margin: 14px 0;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 99px;
}
.tr-vs-btn {
  flex: 1;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-radius: 99px;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px; font-weight: 600;
  letter-spacing: -0.1px;
  cursor: pointer;
  transition: all 0.15s;
}
.tr-vs-btn.active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 12px -4px rgba(196,240,76,0.45);
}
.tr-vs-btn:not(.active):hover { color: var(--text); }

/* Excel-style exercise table — let the outer sheet handle scroll
   so nested scrolling doesn't trap on iOS */
.tr-excel-wrap {
  margin: 14px 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tr-excel {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-family: var(--font-mono);
  letter-spacing: -0.2px;
}
.tr-excel thead {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2);
}
.tr-excel th {
  text-align: left;
  padding: 10px 10px;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
}
.tr-excel td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
  vertical-align: top;
}
.tr-excel tbody tr:last-child td { border-bottom: none; }
.tr-ex-session td {
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.05));
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--accent) !important;
  padding: 9px 10px !important;
  border-top: 1px solid var(--border);
}
.tr-ex-session td .muted {
  text-transform: none; letter-spacing: 0;
  font-weight: 400; color: var(--muted) !important;
  font-family: var(--font-display);
}
.tr-ex-no {
  font-weight: 700; color: var(--muted);
  text-align: right;
  width: 32px;
}
.tr-ex-name {
  font-family: var(--font-display);
  color: var(--text) !important;
  font-weight: 600;
  letter-spacing: -0.2px;
  font-size: 13px;
}
.tr-ex-note {
  font-size: 10.5px; color: var(--muted);
  font-weight: 400; margin-top: 3px;
  font-family: var(--font-display);
}
.tr-ex-row.done {
  background: rgba(196,240,76,0.04);
}
.tr-ex-row.done .tr-ex-name {
  text-decoration: line-through;
  text-decoration-color: rgba(196,240,76,0.5);
  color: var(--muted) !important;
}
@media (max-width: 380px) {
  .tr-excel th, .tr-excel td { padding: 8px 6px; font-size: 11.5px; }
  .tr-ex-name { font-size: 12px; }
}

/* Friend-progress strip at the very top of the training tab */
.tr-friends-card {
  margin-top: 14px;
  padding: 14px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tr-friends-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.tr-friends-title {
  font-size: 9.5px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.4px;
}
.tr-friends-add {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(196,240,76,0.3);
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.tr-friends-add:hover { background: var(--accent); color: #000; transform: scale(1.05); }
.tr-friends-row {
  display: flex; gap: 14px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Top/bottom room so the badge (top:-4px) + "you" ring aren't clipped by
     the scroll container's implicit overflow-y. */
  padding: 8px 2px 6px;
  scrollbar-width: none;
}
.tr-friends-row::-webkit-scrollbar { display: none; }
.tr-friends-cell.done .tr-friends-avatar {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(196,240,76,0.55), 0 6px 18px -4px rgba(196,240,76,0.5);
}
.tr-friends-card.all-done {
  border-color: rgba(196,240,76,0.45);
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.07));
}
.tr-friends-cell {
  flex: 0 0 56px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: relative;
}
.tr-friends-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent) center/cover;
  color: #000;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px -4px rgba(196,240,76,0.4);
}
.tr-friends-cell.you .tr-friends-avatar {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent), 0 6px 18px -4px rgba(196,240,76,0.6);
}
.tr-friends-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px;
  background: var(--accent); color: #000;
  border: 2px solid var(--bg);
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tr-friends-badge.partial {
  background: #fbbf24; color: #000;
}
.tr-friends-label {
  font-size: 11px; color: var(--text-dim);
  font-weight: 600; letter-spacing: -0.1px;
  max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-friends-cell.you .tr-friends-label { color: var(--accent); }

/* Invite-friend single card (when no group yet) */
.tr-friends-invite {
  width: 100%; margin-top: 14px;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit; color: var(--text); text-align: left;
  cursor: pointer; transition: all 0.15s;
}
.tr-friends-invite:hover {
  border-color: rgba(196,240,76,0.4);
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.04));
}
.tr-friends-invite-icon {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.tr-friends-invite-body { flex: 1; min-width: 0; }
.tr-friends-invite-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  letter-spacing: -0.2px;
}
.tr-friends-invite-sub {
  font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.3;
}
.tr-friends-invite-arrow {
  color: var(--muted); font-size: 18px;
  transition: color 0.15s, transform 0.15s;
}
.tr-friends-invite:hover .tr-friends-invite-arrow {
  color: var(--accent); transform: translateX(3px);
}

/* Plan-action-sheet danger row + stats tiles */
.tr-sp-row.danger {
  background: rgba(248,113,113,0.06);
  border-color: rgba(248,113,113,0.25);
}
.tr-sp-row.danger:hover {
  border-color: rgba(248,113,113,0.5);
  background: rgba(248,113,113,0.10);
}
.tr-sp-row.danger .tr-sp-name { color: var(--danger); }
.tr-stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin: 14px 0;
}
.tr-stat-tile {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  text-align: center;
}
.tr-stat-tile-num {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1;
}
.tr-stat-tile-lbl {
  font-size: 10.5px; color: var(--muted);
  font-weight: 600; letter-spacing: 0.3px;
  margin-top: 6px; text-transform: uppercase;
}
.tr-stats-spark {
  width: 100%; height: 80px;
  margin-top: 8px;
}

/* Session picker modal rows */
.tr-sp-list { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.tr-sp-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; color: var(--text);
  text-align: left;
  transition: all 0.15s;
}
.tr-sp-row:hover { border-color: rgba(196,240,76,0.4); }
.tr-sp-row.current {
  border-color: rgba(196,240,76,0.5);
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.06));
}
.tr-sp-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-display); font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.tr-sp-name {
  flex: 1; min-width: 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: 14px; color: var(--text); letter-spacing: -0.2px;
}
.tr-sp-tag {
  padding: 3px 8px; border-radius: 99px;
  background: var(--accent); color: #000;
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.4px; text-transform: uppercase;
}
.tr-sp-arrow { color: var(--muted); font-size: 18px; }
.tr-invite-friend-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; color: var(--text);
  text-align: left; margin-bottom: 6px;
  transition: border-color 0.15s;
}
.tr-invite-friend-row:hover { border-color: rgba(196,240,76,0.4); }
.tr-invite-friend-row .friend-body { flex: 1; min-width: 0; }
.tr-inv-act { flex-shrink: 0; padding: 8px 14px; border-radius: 99px; font-size: 12px; font-weight: 700; border: none; cursor: pointer; font-family: inherit; }

/* Profile settings row (label + segmented control) */
.prof-setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
  text-transform: none; letter-spacing: 0;
  font-size: 14px;
  margin: 0 !important;
}
.prof-setting-row:first-of-type { border-top: none; }
.prof-setting-label {
  font-weight: 500; color: var(--text-dim);
  font-size: 13px;
}
.seg-control {
  display: inline-flex; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 99px;
}
.seg-btn {
  padding: 6px 14px;
  background: transparent; border: none;
  border-radius: 99px;
  font-family: inherit; font-size: 12px; font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: all 0.15s;
}
.seg-btn.active {
  background: var(--accent); color: #000;
  box-shadow: 0 2px 8px -2px rgba(196,240,76,0.5);
}

/* Username pill in profile hero */
.prof-username {
  color: var(--accent); font-weight: 700;
}
.prof-set-username {
  margin-left: 6px; padding: 2px 10px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(196,240,76,0.3);
  font-family: inherit; font-size: 10px; font-weight: 700;
  cursor: pointer; letter-spacing: -0.1px;
  transition: all 0.15s;
}
.prof-set-username:hover { background: var(--accent); color: #000; }

/* Andere-Session-Picker link in today-hero eyebrow */
.tr-hero-change-session {
  background: transparent; border: none; padding: 0;
  color: var(--accent); font-family: inherit;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase;
  cursor: pointer; opacity: 0.85;
  transition: opacity 0.15s;
}
.tr-hero-change-session:hover { opacity: 1; }

/* Collapsible avoid card */
.avoid-head {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; padding: 0;
  font-family: inherit; cursor: pointer;
  color: var(--danger);
  text-align: left;
}
.avoid-head h3 {
  flex: 1; margin: 0;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--danger);
}
.avoid-head svg { color: var(--danger); }
.avoid-count {
  padding: 2px 8px; border-radius: 99px;
  background: rgba(239,68,68,0.18); color: var(--danger);
  font-size: 11px; font-weight: 800;
  font-family: var(--font-mono);
}
.avoid-chev {
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
.rec-card.avoid.collapsed .avoid-chev { transform: rotate(-90deg); }
.avoid-body {
  max-height: 1000px; opacity: 1;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.2s ease;
  overflow: hidden;
  margin-top: 10px;
}
.rec-card.avoid.collapsed .avoid-body {
  max-height: 0; opacity: 0; margin-top: 0;
}

/* Meal warning pills (red tint on bad meals) */
.meal.has-warning {
  border-color: rgba(248,113,113,0.30) !important;
  background: linear-gradient(155deg, var(--surface), rgba(248,113,113,0.04)) !important;
}
.meal-bad-pills {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 5px;
}
.meal-bad-pill {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 99px;
  background: rgba(248,113,113,0.12); color: var(--danger);
  border: 1px solid rgba(248,113,113,0.30);
  letter-spacing: -0.1px;
  font-family: var(--font-mono);
}
[data-theme="light"] .meal.has-warning {
  background: linear-gradient(155deg, var(--surface), rgba(179,38,30,0.04)) !important;
}

/* Avoid card — bad nutrients with current value + ? info button */
.avoid-row {
  margin-top: 10px; padding: 10px 0;
  border-top: 1px solid rgba(248,113,113,0.18);
}
.avoid-row:first-of-type { border-top: none; padding-top: 4px; }
.avoid-row-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.avoid-row-title {
  flex: 1; font-size: 13.5px; font-weight: 700; color: var(--text);
  letter-spacing: -0.2px;
}
.avoid-row-pct {
  font-size: 11px; font-weight: 700; color: var(--danger);
  font-family: var(--font-mono); letter-spacing: -0.2px;
}
.avoid-help {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(239,68,68,0.1); color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
  font-family: inherit; font-weight: 700; font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.avoid-help:hover { background: var(--danger); color: #fff; }
.avoid-row-meter {
  height: 4px; background: rgba(239,68,68,0.1); border-radius: 99px;
  margin-bottom: 8px; overflow: hidden;
}
.avoid-row-meter-fill {
  height: 100%; background: var(--danger);
  border-radius: 99px; transition: width 0.5s ease;
  box-shadow: 0 0 6px rgba(239,68,68,0.5);
}

/* Plan-invite banner at top of training tab */
#tr-invites-banner { margin: 14px 0 0; }
.tr-invite-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.08));
  border: 1.5px dashed rgba(196,240,76,0.45);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.tr-invite-icon {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.tr-invite-body { flex: 1; min-width: 0; }
.tr-invite-title { font-size: 13px; color: var(--text-dim); line-height: 1.3; }
.tr-invite-title strong { color: var(--text); font-weight: 700; }
.tr-invite-sub {
  font-size: 11.5px; color: var(--accent); margin-top: 2px;
  font-weight: 600;
}
.tr-invite-acts { display: flex; gap: 6px; flex-shrink: 0; }

/* Active plan tag */
.tp-active-tag {
  display: inline-block; margin-left: 8px;
  padding: 2px 8px; border-radius: 99px;
  background: var(--accent); color: #000;
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.4px; text-transform: uppercase;
}
.tr-plan-card.active {
  border-color: rgba(196,240,76,0.5);
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.05));
}

/* ═══ Workout-Done Celebration ═══════════════════════════════ */
.celebration-overlay { overflow: hidden; }

.celebration-sparkle {
  position: absolute;
  width: 10px; height: 10px;
  background: radial-gradient(circle, #e6ff66 0%, var(--accent) 55%, transparent 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 0 6px var(--accent));
  animation: celebSparkle 0.85s cubic-bezier(0.22, 0.7, 0.3, 1) forwards;
}
@keyframes celebSparkle {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  20%  { opacity: 1; }
  60%  { opacity: 1; }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.6);
    opacity: 0;
  }
}

.celebration-badge {
  position: absolute;
  transform: translate(-50%, -50%) scale(0.6);
  padding: 12px 20px;
  background: var(--accent); color: #000;
  border-radius: 99px;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 900;
  letter-spacing: -0.3px;
  box-shadow: 0 12px 32px -6px rgba(196,240,76,0.7), 0 0 50px 10px rgba(196,240,76,0.4);
  pointer-events: none;
  animation: celebBadge 1.1s cubic-bezier(0.22, 0.7, 0.3, 1.4) forwards;
}
@keyframes celebBadge {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  20%  { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  35%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  85%  {
    transform: translate(calc(-50% + var(--target-dx) * 0.95), calc(-50% + var(--target-dy) * 0.95)) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--target-dx)), calc(-50% + var(--target-dy))) scale(0.2);
    opacity: 0;
  }
}

.tr-hero-v2.celebrating {
  animation: heroCelebrate 0.7s cubic-bezier(0.22, 0.7, 0.3, 1);
}
@keyframes heroCelebrate {
  0%   { box-shadow: 0 0 0 0 rgba(196,240,76,0.4); }
  30%  { box-shadow: 0 0 0 24px rgba(196,240,76,0); transform: scale(1.015); }
  100% { box-shadow: 0 0 0 0 rgba(196,240,76,0); transform: scale(1); }
}

.tr-streak-big > span:first-child.streak-pop,
#tr-ov-streak-num.streak-pop {
  display: inline-block;
  animation: streakPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes streakPop {
  0%   { transform: scale(1); text-shadow: 0 0 0 var(--accent); }
  30%  { transform: scale(1.5); text-shadow: 0 0 22px var(--accent); }
  100% { transform: scale(1); text-shadow: 0 0 0 var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  .celebration-sparkle, .celebration-badge, .tr-hero-v2.celebrating { animation: none; }
}

/* ═══ Training Overview redesign (Claude design) ═════════════ */

/* ZONE 1: Streak + Mini-Spark + 30T-Quote (compact) */
.tr-streak-strip {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  margin: 14px 0 0;
  background: linear-gradient(155deg, var(--surface) 0%, rgba(196,240,76,0.06) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative; overflow: hidden;
}
.tr-streak-strip::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,240,76,0.5), transparent);
}
.tr-streak-left, .tr-streak-right {
  flex: 0 0 auto; min-width: 56px;
}
.tr-streak-right { text-align: right; }
.tr-streak-eyebrow {
  font-size: 9px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.2px;
}
.tr-streak-big {
  display: flex; align-items: baseline; gap: 4px;
  font-family: var(--font-display);
  margin-top: 4px;
}
.tr-streak-big > span:first-child {
  font-size: 28px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.6px; line-height: 1;
}
.tr-streak-unit {
  font-size: 11px; color: var(--muted); font-weight: 600;
}
.tr-streak-spark {
  flex: 1; min-width: 0; height: 50px;
  align-self: stretch;
}
.tr-streak-pct {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  color: var(--text); letter-spacing: -0.4px;
  margin-top: 4px;
  line-height: 1;
}

/* Plan-progress bar (replaces the old sparkline) */
.tr-streak-prog {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
  align-self: center;
}
.tr-streak-prog-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.tr-streak-prog-lbl {
  font-size: 9px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.2px;
}
.tr-streak-prog-pct {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.4px; line-height: 1;
}
.tr-streak-prog-bar {
  height: 8px; border-radius: 99px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.tr-streak-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #d6ff66);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.22, 0.7, 0.3, 1);
  box-shadow: 0 0 12px rgba(196,240,76,0.4);
}
.tr-streak-prog-sub {
  font-size: 10.5px; color: var(--muted);
  font-family: var(--font-mono); letter-spacing: -0.1px;
}

/* ZONE 3: Plan strip (compact, info + menu) */
.tr-plan-strip {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  margin: 10px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit; color: inherit; text-align: left;
  transition: all 0.15s;
}
.tr-plan-strip:hover { border-color: rgba(196,240,76,0.4); }
.tr-plan-strip-body { flex: 1; min-width: 0; }
.tr-plan-strip-eyebrow {
  font-size: 9px; font-weight: 700; color: var(--accent);
  letter-spacing: 1.2px; text-transform: uppercase;
  margin-bottom: 3px;
}
.tr-plan-strip-name {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-plan-strip-arrow {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  transition: all 0.15s;
}
.tr-plan-strip:hover .tr-plan-strip-arrow {
  background: var(--accent); color: #000; border-color: var(--accent);
}

/* Legacy class — kept for back-compat with renderTodayHero etc.,
   but reduced visual weight so it doesn't duplicate the new streak-strip. */
.tr-plan-header { display: none; }

/* This-week strip card */
.tr-week-card {
  margin-top: 14px; padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tr-week-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.tr-week-title {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.tr-week-streak {
  font-size: 11.5px; font-weight: 700; color: var(--accent);
  letter-spacing: -0.2px;
}
.tr-week-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.tr-week-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit; color: var(--text);
  transition: all 0.15s;
  min-height: 70px;
}
.tr-week-cell:hover { border-color: rgba(196,240,76,0.3); }
.tr-week-cell:active { transform: scale(0.94); }
.tr-week-cell.today {
  border-color: rgba(196,240,76,0.5);
  background: linear-gradient(155deg, rgba(196,240,76,0.08), var(--surface-2));
  box-shadow: 0 4px 14px -4px rgba(196,240,76,0.25);
}
.tr-week-cell.future {
  opacity: 0.45;
  border-style: dashed;
}
.tr-week-cell.future:hover { border-color: var(--border-soft); }
.tr-week-cell.past {
  opacity: 0.7;
}
.tr-week-cell.done {
  background: linear-gradient(155deg, var(--accent), rgba(196,240,76,0.5));
  border-color: var(--accent);
  opacity: 1;
}
.tr-week-cell.done .tr-week-dow,
.tr-week-cell.done .tr-week-dot,
.tr-week-cell.done .tr-week-num { color: #000; }
.tr-week-cell.partial {
  border-color: rgba(251,191,36,0.5);
  background: linear-gradient(155deg, var(--surface-2), rgba(251,191,36,0.08));
}
.tr-week-cell.partial .tr-week-dot { color: #fbbf24; }
.tr-week-dow {
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.tr-week-cell.today .tr-week-dow { color: var(--accent); }
.tr-week-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 11px; font-weight: 700;
  font-family: var(--font-mono);
}
.tr-week-cell.done .tr-week-dot {
  background: #000; color: var(--accent);
}
.tr-week-num {
  font-size: 11px; font-weight: 600;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* 2x2 action tiles */
.tr-actions-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 14px;
}
.tr-action-tile {
  padding: 14px 14px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; text-align: left;
  font-family: inherit; color: var(--text);
  transition: all 0.18s;
  display: flex; flex-direction: column; gap: 4px;
  min-height: 92px;
}
.tr-action-tile:hover {
  border-color: rgba(196,240,76,0.4);
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.06));
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(0,0,0,0.4);
}
.tr-action-tile:active { transform: scale(0.97); }
.tr-action-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.tr-action-title {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.tr-action-sub {
  font-size: 11px; color: var(--muted);
  font-family: var(--font-mono); letter-spacing: -0.1px;
  line-height: 1.3;
}

/* ═══ Plan-Detail Hero v2 (Claude design) ═════════════════════ */
.tr-hero-v2 {
  position: relative;
  margin: 16px 0;
  padding: 18px 18px 16px;
  background: linear-gradient(155deg, var(--surface) 0%, rgba(196,240,76,0.08) 100%);
  border: 1px solid rgba(196,240,76,0.3);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, background 0.3s;
}
.tr-hero-v2::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,240,76,0.6), transparent);
}
.tr-hero-v2.hero-done {
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.18));
  border-color: rgba(196,240,76,0.5);
}
.tr-hero-top {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 16px;
}
.tr-hero-text { flex: 1; min-width: 0; }
.tr-hero-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.15;
  margin: 4px 0 6px;
}
.tr-hero-sub {
  font-size: 12.5px; color: var(--muted); line-height: 1.4;
}
.tr-hero-ring {
  flex: 0 0 72px; width: 72px; height: 72px;
  filter: drop-shadow(0 4px 14px rgba(196,240,76,0.25));
}
.tr-hero-exercises {
  display: flex; flex-direction: column; gap: 8px;
  margin: 8px 0 14px;
}

/* Collapsible exercise list within the today-hero */
.tr-hero-exs-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: none; padding: 4px 0;
  font-family: inherit; font-size: 12.5px; color: var(--muted);
  cursor: pointer; letter-spacing: -0.1px;
}
.tr-hero-exs-toggle strong { color: var(--text); font-weight: 700; font-size: 13px; }
.tr-hero-exs-done { color: var(--accent); font-weight: 700; }
.tr-hero-exs-chev {
  transition: transform 0.2s ease;
  color: var(--muted);
}
.tr-hero-exs-list.collapsed ~ * .tr-hero-exs-chev,
.tr-hero-exs-toggle[aria-expanded="false"] .tr-hero-exs-chev {
  transform: rotate(-90deg);
}
.tr-hero-exs-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 1200px; opacity: 1; overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.2s ease;
  margin-top: 6px;
}
.tr-hero-exs-list.collapsed {
  max-height: 0; opacity: 0; margin-top: 0;
}
/* Bigger, more tactile exercise rows inside the hero */
.tr-hero-exercises .tr-exercise {
  padding: 10px 12px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.tr-hero-exercises .tr-exercise:hover {
  border-color: rgba(196,240,76,0.4);
  background: rgba(196,240,76,0.05);
}
.tr-hero-exercises .tr-exercise.done {
  background: rgba(196,240,76,0.06);
  border-color: rgba(196,240,76,0.25);
}

/* Big CTA button */
.tr-hero-cta {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 18px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.3px;
  cursor: pointer;
  box-shadow: 0 8px 22px -6px rgba(196,240,76,0.55);
  transition: transform 0.1s, box-shadow 0.2s;
  flex-direction: column;
  text-align: center;
}
.tr-hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -6px rgba(196,240,76,0.65);
}
.tr-hero-cta:active { transform: scale(0.98); }
.tr-hero-cta svg { color: currentColor; }
.tr-hero-cta .cta-main {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 800;
}
.tr-hero-cta .cta-sub {
  font-size: 10.5px; font-weight: 700; opacity: 0.7;
  letter-spacing: 0.3px; text-transform: uppercase;
  margin-top: -2px;
}
.tr-hero-cta.done {
  background: rgba(196,240,76,0.15);
  color: var(--accent);
  border: 1.5px solid rgba(196,240,76,0.5);
  box-shadow: none;
}
.tr-hero-cta.done:hover {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border-color: rgba(239,68,68,0.4);
  box-shadow: none;
}

/* Group ping button on plan-detail */
.tr-group-ping {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px; font-weight: 700;
  letter-spacing: -0.1px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  box-shadow: 0 6px 18px -6px rgba(196,240,76,0.45);
}
.tr-group-ping:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(196,240,76,0.55); }
.tr-group-ping:active { transform: scale(0.97); }
.tr-group-ping svg { color: currentColor; }

/* ─── Friends list (profile) ──────────────────────────────── */
.friend-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.friend-row:hover { border-color: rgba(196,240,76,0.3); }
.friend-avatar {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 12px -4px rgba(196,240,76,0.4);
}
.friend-body { flex: 1; min-width: 0; }
.friend-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  line-height: 1.2;
}
.friend-email {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  font-family: var(--font-mono); letter-spacing: -0.2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.friend-acts { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.friend-btn-accept, .friend-btn-decline {
  padding: 7px 13px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  font-family: inherit; cursor: pointer; border: none;
  letter-spacing: -0.1px;
  transition: all 0.15s;
}
.friend-btn-accept { background: var(--accent); color: #000; }
.friend-btn-accept:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -2px rgba(196,240,76,0.5); }
.friend-btn-decline { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.friend-btn-decline:hover { color: var(--danger); border-color: rgba(239,68,68,0.4); }
.friend-btn-remove {
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; color: var(--muted-dim);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.friend-btn-remove:hover { color: var(--danger); border-color: var(--danger); }
.friend-status-pill {
  padding: 5px 10px; border-radius: 99px;
  background: var(--surface); border: 1px dashed var(--border);
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  letter-spacing: -0.1px;
}

/* Plan invites at top of friends section */
.friend-invites {
  margin-bottom: 12px; padding: 14px;
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.08));
  border: 1px dashed rgba(196,240,76,0.35);
  border-radius: var(--radius-sm);
}
.friend-invites-title {
  font-size: 9.5px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.4px;
  margin-bottom: 10px;
}
.friend-invite-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}
.friend-invite-row:first-of-type { border-top: none; padding-top: 0; }
.friend-invite-body { flex: 1; min-width: 0; }
.friend-invite-from {
  font-size: 13px; font-weight: 700; color: var(--text);
  letter-spacing: -0.2px;
}
.friend-invite-plan {
  font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4;
}
.friend-invite-plan strong { color: var(--accent); font-weight: 600; }
.friend-invite-acts { display: flex; gap: 6px; flex-shrink: 0; }

/* ─── Plan share / community ─────────────────────────────── */
.tr-share-row {
  display: flex; gap: 10px; margin-top: 14px;
}
.tr-share-row button { flex: 1; padding: 12px; }

.tr-group-card {
  background: linear-gradient(155deg, var(--surface), rgba(125,211,252,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.tr-group-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.tr-group-title {
  font-size: 11px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.tr-group-count { font-size: 11px; color: var(--text-dim); }
.tr-member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border-soft);
}
.tr-member-row:last-child { border-bottom: none; }
.tr-member-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  border: 1px solid var(--border-soft);
}
.tr-member-row.you .tr-member-avatar {
  background: var(--accent); color: #000;
  border-color: var(--accent);
}
.tr-member-name { flex: 1; font-size: 13px; color: var(--text); font-weight: 600; }
.tr-member-pct {
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono); letter-spacing: -0.2px;
}
.tr-member-pct.full { color: var(--accent); }
.tr-member-pct.partial { color: var(--text-dim); }
.tr-member-pct.zero { color: var(--muted); }

/* ─── Macro line in rec-card ──────────────────────────────── */
.rec-macros {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-dim);
  font-family: var(--font-mono); letter-spacing: -0.2px;
  padding-bottom: 4px; border-bottom: 1px solid var(--border-soft);
}
.rec-macros strong { color: var(--text); font-weight: 600; font-family: var(--font); }

/* ─── Avoid card override (NOT lime — danger tinted) ────── */
.rec-card.avoid {
  flex: none;
  background: linear-gradient(155deg, var(--surface), var(--danger-soft));
  border: 1px solid rgba(248,113,113,0.35);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.rec-card.avoid h3 {
  margin: 0 0 6px;
  font-size: 11px; color: var(--danger);
  text-transform: uppercase; letter-spacing: 0.8px;
  font-weight: 700;
  display: inline-flex; align-items: center;
}
.rec-card.avoid strong {
  color: var(--text); font-weight: 600; font-size: 13px;
}
.rec-card.avoid .rec-avoid-items {
  margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px;
}
.rec-card.avoid .chip {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-dim);
  margin: 0;
}

/* ─── Section titles in wizard ────────────────────────────── */
.wiz-section-title {
  font-size: 11px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin: 18px 0 10px;
  padding: 8px 12px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 6px;
}
.wiz-section-title:first-child { margin-top: 8px; }

/* ─── Plan-Share Card (replaces ugly Plan teilen button) ──── */
.tr-share-card {
  width: 100%; margin-top: 16px;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--surface), rgba(125,211,252,0.07));
  border: 1px dashed rgba(125,211,252,0.45);
  border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; color: var(--text); text-align: left;
  transition: all 0.18s;
}
.tr-share-card:hover {
  border-style: solid; border-color: var(--blue);
  background: linear-gradient(135deg, var(--surface-2), rgba(125,211,252,0.10));
}
.tr-share-card:active { transform: scale(0.985); }
.tr-share-icon {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px;
  background: rgba(125,211,252,0.15); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.tr-share-body { flex: 1; min-width: 0; }
.tr-share-title { font-weight: 700; font-size: 14px; color: var(--text); line-height: 1.2; }
.tr-share-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.tr-share-arrow { color: var(--muted-dim); font-size: 18px; transition: transform 0.15s; }
.tr-share-card:hover .tr-share-arrow { color: var(--blue); transform: translateX(3px); }

/* old row container — hide if any remnant lingers */
.tr-share-row { display: none !important; }

/* ─── Training Landing — Stat Strip ───────────────────────── */
.tr-stat-strip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 14px; margin-bottom: 12px;
  display: grid; grid-template-columns: 1fr 1px 1fr 1px 1fr; gap: 8px;
  align-items: center;
}
.tr-stat-cell { text-align: center; min-width: 0; }
.tr-stat-num {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  letter-spacing: -0.8px; color: var(--accent); line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tr-stat-num span { color: var(--accent); }
.tr-stat-cell:nth-child(3) .tr-stat-num { color: var(--text); }
.tr-stat-cell:nth-child(5) .tr-stat-num {
  font-size: 14px; color: var(--text); letter-spacing: -0.2px;
  font-family: var(--font);
}
.tr-stat-lbl {
  font-size: 9px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px; margin-top: 6px;
}
.tr-stat-divider {
  height: 32px; width: 1px; background: var(--border-soft);
}

.tr-progress-strip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
.tr-progress-strip .bar-track { height: 4px; }
.tr-progress-strip .bar-fill { background: var(--accent); height: 100%; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); border-radius: 2px; }
.tr-progress-strip .tr-spark { width: 100%; height: 50px; display: block; margin-top: 6px; }

/* ─── Day Carousel (horizontal scroll, 3D-stack effect) ──── */
.tr-day-stack {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  margin: 0 -20px 14px; padding: 8px 20px 14px;
  scroll-padding-left: 20px;
}
.tr-day-stack::-webkit-scrollbar { display: none; }
.tr-day-stack .tr-day-card {
  flex: 0 0 calc(100% - 60px);
  max-width: 480px;
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  scroll-snap-align: start;
  transition: transform 0.25s, opacity 0.25s, box-shadow 0.25s;
  position: relative;
  min-height: 110px;
}
.tr-day-stack .tr-day-card.today {
  border-color: rgba(196,240,76,0.55);
  background: linear-gradient(155deg, rgba(196,240,76,0.10), var(--surface));
  box-shadow: 0 12px 28px rgba(196,240,76,0.12);
}
/* Sequential dim — far-off days less prominent */
.tr-day-stack .tr-day-card.tomorrow { opacity: 0.7; transform: scale(0.97); }
.tr-day-stack .tr-day-card.dayafter { opacity: 0.5;  transform: scale(0.94); }
.tr-day-stack .tr-day-card.future   { opacity: 0.32; transform: scale(0.92); }

/* Past days — checkable but visually dimmed (different tint from future) */
.tr-day-stack .tr-day-card.past {
  opacity: 0.55;
  transform: scale(0.96);
  background: linear-gradient(155deg, var(--surface), rgba(255,255,255,0.02));
  border-style: dashed;
}
.tr-day-stack .tr-day-card.past.yesterday { opacity: 0.7; transform: scale(0.97); }
.tr-day-stack .tr-day-card.past.done {
  opacity: 0.85;
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.04));
  border-style: solid;
  border-color: rgba(196,240,76,0.25);
}
.tr-day-stack .tr-day-card.past.partial {
  border-color: rgba(251,191,36,0.35);
  opacity: 0.78;
}
.tr-day-stack .tr-day-card.past .tr-day-check {
  border-color: rgba(196,240,76,0.4);
  color: rgba(196,240,76,0.6);
  background: rgba(196,240,76,0.04);
}
.tr-day-stack .tr-day-card.past .tr-day-check:hover {
  background: var(--accent); color: #000;
  border-color: var(--accent);
  transform: scale(1.05);
}
.tr-day-stack .tr-day-card.past.done .tr-day-check {
  background: var(--accent); color: #000;
}

.tr-day-eyebrow {
  font-size: 9px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted);
}
.tr-day-stack .tr-day-card.today .tr-day-eyebrow { color: var(--accent); }
.tr-day-name {
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  letter-spacing: -0.3px; color: var(--text); line-height: 1.2;
  margin-top: 3px;
}
.tr-day-meta {
  font-size: 11px; color: var(--muted); margin-top: 3px;
  font-family: var(--font-mono); letter-spacing: -0.1px;
}
.tr-day-body { flex: 1; min-width: 0; }

.tr-day-check {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 14px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  cursor: pointer; padding: 0; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-dim); transition: all 0.18s;
}
.tr-day-stack .tr-day-card.today .tr-day-check {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-soft);
}
.tr-day-stack .tr-day-card.today .tr-day-check:hover {
  background: var(--accent); color: #000;
}
.tr-day-stack .tr-day-card.today.done .tr-day-check {
  background: var(--accent); color: #000;
}
.tr-day-stack .tr-day-card.done .tr-day-name { text-decoration: line-through; opacity: 0.6; }
/* Future days (tomorrow+) are NOT checkable, past + today ARE */
.tr-day-stack .tr-day-card.tomorrow .tr-day-check,
.tr-day-stack .tr-day-card.dayafter .tr-day-check,
.tr-day-stack .tr-day-card.future .tr-day-check { cursor: not-allowed; pointer-events: none; }

.tr-expand-btn {
  width: 100%; padding: 12px;
  background: transparent; border: 1px dashed var(--border);
  color: var(--muted); font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.tr-expand-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Full Plan Table Modal ───────────────────────────────── */
.tr-plan-table {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); overflow: hidden;
  margin: 10px 0 6px;
}
.tr-pt-row {
  display: grid; grid-template-columns: 28px 1fr 60px 80px;
  gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
}
.tr-pt-row:last-child { border-bottom: none; }
.tr-pt-row.head {
  background: var(--surface-2);
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted);
}
.tr-pt-idx {
  font-family: var(--font-mono); color: var(--muted);
  font-size: 11px; font-weight: 600;
}
.tr-pt-name { font-weight: 600; font-size: 13px; color: var(--text); }
.tr-pt-name-meta { font-size: 10px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }
.tr-pt-count {
  font-size: 12px; color: var(--text-dim);
  font-family: var(--font-mono); text-align: right;
  font-variant-numeric: tabular-nums;
}
.tr-pt-status {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 4px 8px; border-radius: 6px;
  text-align: center;
}
.tr-pt-status.done {
  background: var(--accent); color: #000;
}
.tr-pt-status.today {
  background: var(--accent-soft); color: var(--accent);
}
.tr-pt-status.upcoming {
  background: var(--surface-2); color: var(--muted-dim);
}

/* ─── Idea items line inside rec-card (meal-ideas) ────────── */
.rec-items {
  font-size: 11px; color: var(--muted); line-height: 1.5;
  padding-bottom: 4px;
}

/* ─── Simplified shortcut tutorial ────────────────────────── */
.sc-action-list {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px;
}
.sc-action {
  background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: 8px; padding: 8px 10px;
}
.sc-action-name {
  font-weight: 700; font-size: 12px; color: var(--accent);
  letter-spacing: -0.1px;
}
.sc-action-cfg {
  font-size: 11px; color: var(--text-dim); margin-top: 3px;
  font-family: var(--font-mono); letter-spacing: -0.2px;
}
.sc-action-cfg b { color: var(--text); }
.sc-url-mono {
  font-family: var(--font-mono); color: var(--accent);
  word-break: break-all; font-size: 11px;
}

.sc-tip {
  margin-top: 14px; padding: 12px 14px;
  background: rgba(125,211,252,0.08); border: 1px solid rgba(125,211,252,0.22);
  border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-dim); line-height: 1.55;
}
.sc-tip strong { color: var(--blue); }

/* ─── Phone-Mockup Tutorial Cards (Claude Design) ──────────── */
.ios-card {
  position: relative;
  margin-top: 14px;
  padding: 16px 18px 18px;
  background: linear-gradient(155deg, var(--surface) 0%, rgba(196,240,76,0.035) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ios-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,240,76,0.35), transparent);
}
.ios-card.success {
  background: linear-gradient(155deg, rgba(196,240,76,0.08) 0%, rgba(196,240,76,0.02) 100%);
  border-color: rgba(196,240,76,0.3);
  border-style: dashed;
}
.ios-card-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.ios-card-num {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #000;
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.3px;
  box-shadow: 0 4px 14px -2px rgba(196,240,76,0.4);
}
.ios-card-num.check { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); font-size: 14px; box-shadow: none; }
.ios-card-title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--text); letter-spacing: -0.3px; line-height: 1.25;
}
.ios-card-body {
  font-size: 13px; color: var(--text-dim); line-height: 1.55;
  padding-left: 40px;
}
.ios-card-body strong { color: var(--text); font-weight: 600; }
.ios-card-body em { font-style: normal; color: var(--accent); font-weight: 500; }
.ios-card-note {
  margin: 12px 0 0 40px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.025);
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 11.5px; color: var(--muted); line-height: 1.5;
}
.ios-card-note strong { color: var(--accent); font-weight: 600; }
.ios-card-note em { font-style: italic; color: var(--text-dim); }

/* iOS keyboard-key chip (z.B. + / Aktion hinzufügen / Fertig) */
.ios-kbd {
  display: inline-block;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: var(--font-display); font-weight: 600;
  font-size: 11.5px; color: var(--text);
  letter-spacing: -0.1px;
  vertical-align: 1px;
}

/* Visual mock of an iOS Shortcuts action panel */
.ios-mock {
  margin: 12px 0 0 40px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 8px;
}
.ios-mock-title {
  font-size: 11.5px; color: var(--text-dim); line-height: 1.45;
  padding-bottom: 6px; border-bottom: 1px dashed var(--border-soft);
  margin-bottom: 2px;
}
.ios-mock-blue { color: var(--blue); font-weight: 600; }
.ios-mock-divider {
  height: 1px; background: var(--border-soft); margin: 4px -4px;
}
.ios-mock-sub {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.9px;
  margin-top: 2px;
}
.ios-mock-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px;
}
.ios-mock-row-k { color: var(--muted); font-weight: 500; }
.ios-mock-row-v { color: var(--text); font-weight: 600; font-size: 12.5px; }
.ios-mock-muted { color: var(--muted) !important; font-weight: 500 !important; }
.ios-mock-accent { color: var(--accent) !important; font-family: var(--font-mono); font-size: 12px !important; }
.ios-mock-mono {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  word-break: break-all; text-align: right; max-width: 60%; line-height: 1.4;
}

/* Filter row — looks like a tappable iOS filter cell */
.ios-filter {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-size: 12.5px;
}
.ios-filter-label {
  font-weight: 600; color: var(--text);
  padding: 2px 7px;
  background: rgba(255,255,255,0.04);
  border-radius: 5px;
}
.ios-filter-op {
  color: var(--muted); font-size: 11.5px;
}
.ios-filter-val {
  font-family: var(--font-mono); font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  padding: 2px 8px;
  background: rgba(196,240,76,0.08);
  border: 1px solid rgba(196,240,76,0.25);
  border-radius: 5px;
  margin-left: auto;
}

/* On/Off pill */
.ios-pill-on, .ios-pill-off {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
  text-transform: uppercase;
}
.ios-pill-on  { background: var(--accent); color: #000; }
.ios-pill-off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* JSON rows */
.ios-json-row {
  display: grid; grid-template-columns: 100px 44px 1fr; gap: 8px;
  align-items: center;
  padding: 6px 8px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 11.5px;
}
.ios-json-k {
  font-family: var(--font-mono);
  color: var(--accent); font-weight: 600;
  letter-spacing: -0.2px;
}
.ios-json-t {
  font-size: 9.5px; font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
  text-align: center;
}
.ios-json-v {
  font-size: 11.5px; color: var(--text-dim); line-height: 1.4;
}
.ios-json-v em { color: var(--accent); font-style: italic; font-size: 11px; }

/* Tighter spacing on the very first card after intro */
.wiz-slide[data-wiz="3"] .ios-card:first-of-type,
.wiz-slide[data-wiz="3-garmin"] .ios-card:first-of-type,
.wiz-slide[data-wiz="3-fitbit"] .ios-card:first-of-type {
  margin-top: 18px;
}

/* Narrow phones: shrink mockups */
@media (max-width: 380px) {
  .ios-card-body, .ios-mock, .ios-card-note { margin-left: 0; padding-left: 14px; }
  .ios-card-body { padding-left: 0; }
  .ios-mock { margin-left: 0; }
  .ios-card-note { margin-left: 0; }
  .ios-json-row { grid-template-columns: 80px 38px 1fr; }
}

/* ─── Full Plan Table — polish ────────────────────────────── */
#tr-plan-table-modal .sheet { padding-top: 20px; }
.tr-plan-table {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin: 14px 0 8px;
}
.tr-pt-row { display: grid; grid-template-columns: 26px 1fr 50px 78px; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-soft); align-items: center; }
.tr-pt-row:last-child { border-bottom: none; }
.tr-pt-row.head {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--muted); padding: 10px 16px;
}
.tr-pt-row:not(.head):hover { background: rgba(196,240,76,0.04); }

/* ═══════════════════════════════════════════════════════════════════════
   WORKOUT PAGE REDESIGN v107 — Day-Card Carousel + Streak Hero + Inbox
   ════════════════════════════════════════════════════════════════════════
   - Streak hero combines streak number, sparkline, 30T quote and the plan
     name into one calm header. An inbox button (top-right) surfaces pending
     friend requests + plan invites with a lime badge.
   - Day-card carousel is the centerpiece: stacked, overlapping cards. Today
     is the active center card; neighbors peek behind with reduced opacity
     and scale. Swipe / scroll to navigate. Tap a side card to center it.
   - Reward CTA on the active card triggers haptic + sparkle burst centered
     on that card.
   - Two bottom buttons: "Ganzer Plan" (full overview) and "Plan-Menü"
     (action sheet for stats, share, switch session, new plan, delete). No
     duplication with the carousel.
   - All icons SVG, no emojis. Dark/light mode aware via tokens. */

/* ─── Streak Hero ── enhanced wrapper with inbox button + plan-name row ── */
.tr-streak-strip {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 12px 16px 16px;
}
.tr-streak-toprow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.tr-streak-toprow-label {
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-display);
}
.tr-streak-row {
  display: flex; align-items: center; gap: 14px;
  min-height: 50px;
}

/* Inbox button (sits in the streak-strip top row, no longer absolute) */
.tr-inbox-btn {
  position: relative;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 0; font-family: inherit;
  transition: transform 0.15s ease, border-color 0.15s, background 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.tr-inbox-btn:hover {
  border-color: rgba(196,240,76,0.45);
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.06));
  color: var(--accent);
}
.tr-inbox-btn:active { transform: scale(0.94); }
.tr-inbox-btn svg { display: block; }
.tr-inbox-dot {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.2px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2.5px var(--bg), 0 4px 12px rgba(196,240,76,0.45);
  animation: trInboxPulse 1.8s ease-in-out infinite;
}
@keyframes trInboxPulse {
  0%, 100% { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 0 rgba(196,240,76,0.5); }
  50%      { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 8px rgba(196,240,76,0); }
}

/* Plan-name button (clickable, opens the plan menu sheet) */
.tr-plan-name-btn {
  margin-top: 14px;
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  cursor: pointer; font-family: inherit;
  color: var(--text); text-align: left;
  transition: all 0.15s;
  min-height: 44px;
}
.tr-plan-name-btn:hover {
  border-color: rgba(196,240,76,0.4);
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.05));
}
.tr-plan-name-btn:active { transform: scale(0.99); }
.tr-plan-name-eyebrow {
  font-size: 9px; font-weight: 800; color: var(--accent);
  letter-spacing: 1.2px; text-transform: uppercase;
  flex: 0 0 auto;
}
.tr-plan-name-text {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.25px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-plan-name-arrow {
  flex: 0 0 auto; color: var(--muted);
  transition: transform 0.15s, color 0.15s;
}
.tr-plan-name-btn:hover .tr-plan-name-arrow {
  transform: translateX(2px); color: var(--accent);
}

/* ─── Day-Card Carousel ───────────────────────────────────────────────── */
.tr-carousel-wrap {
  position: relative;
  margin: 20px -20px 6px;
}
.tr-day-carousel {
  display: flex;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-padding-inline: 8%;
  padding: 32px max(8%, 28px) 28px;
  gap: 14px;
  perspective: 1400px;
  will-change: scroll-position;
}
.tr-day-carousel::-webkit-scrollbar { display: none; }

/* Each card. Override the legacy .tr-day-card rules with carousel scoping. */
.tr-day-carousel .tr-day-card {
  flex: 0 0 88%;
  max-width: 500px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  margin: 0;
  padding: 25px 24px 23px;
  /* Richer surface with depth — soft lime glow at the top that melts into a
     smooth dark gradient (no hard edges), so it reads as a premium glass card. */
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(196,240,76,0.07), rgba(196,240,76,0) 55%),
    linear-gradient(168deg, var(--surface-2) 0%, var(--surface) 62%, #101010 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  position: relative;
  display: flex; flex-direction: column;
  min-height: 270px;
  align-items: stretch;
  color: var(--text);
  /* Visible by default (never a black flash). JS dims the NEIGHBOURS via
     in-view-adjacent/far; the centre stays full. Dimming uses opacity only —
     `filter` is reserved for the grayscale "done" look so they never clash. */
  opacity: 1;
  transform: scale(0.94);
  z-index: 1;
  transition:
    transform 0.4s cubic-bezier(0.22, 0.7, 0.3, 1),
    opacity 0.35s ease,
    box-shadow 0.4s ease,
    border-color 0.3s ease,
    background 0.4s ease,
    filter 0.35s ease;
  box-shadow: 0 18px 36px -22px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.05);
}
.tr-day-carousel .tr-day-card.in-view-active {
  opacity: 1;
  transform: scale(1);
  z-index: 10;
  box-shadow:
    0 24px 64px -24px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 0 1px rgba(196,240,76,0.16);
}
.tr-day-carousel .tr-day-card.in-view-adjacent {
  opacity: 0.6;
  transform: scale(0.9);
  z-index: 5;
}
.tr-day-carousel .tr-day-card.in-view-far {
  opacity: 0.42;
  transform: scale(0.86);
  z-index: 1;
}

/* Today's card has its own lime identity even when not centered */
.tr-day-carousel .tr-day-card.is-today {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(196,240,76,0.16), rgba(196,240,76,0) 58%),
    linear-gradient(168deg, var(--surface-2) 0%, var(--surface) 62%, #101010 100%);
  border-color: rgba(196,240,76,0.45);
}
.tr-day-carousel .tr-day-card.is-today.in-view-active {
  background:
    radial-gradient(120% 82% at 50% -10%, rgba(196,240,76,0.22), rgba(196,240,76,0) 60%),
    linear-gradient(168deg, var(--surface-2) 0%, var(--surface) 62%, #101010 100%);
  border-color: rgba(196,240,76,0.6);
  box-shadow:
    0 26px 70px -24px rgba(196,240,76,0.3),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 0 1px rgba(196,240,76,0.35);
}
.tr-day-carousel .tr-day-card.past { border-style: dashed; }
.tr-day-carousel .tr-day-card.past.done { border-style: solid; border-color: rgba(196,240,76,0.35); }
.tr-day-carousel .tr-day-card.future { border-style: dashed; opacity: 0.45; }
.tr-day-carousel .tr-day-card.future.in-view-active {
  opacity: 1; border-style: dashed;
}
/* Completed workout — same card, just lightly grayed + transparent, title
   struck through. No extra elements, no layout change — clean + stylish. */
.tr-day-carousel .tr-day-card.done {
  filter: grayscale(0.9);
}
.tr-day-carousel .tr-day-card.done .tr-dc-head,
.tr-day-carousel .tr-day-card.done .tr-dc-progress,
.tr-day-carousel .tr-day-card.done .tr-dc-exs { opacity: 0.6; }
.tr-day-carousel .tr-day-card.done .tr-dc-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--muted);
}
.tr-dc-spacer { flex: 1; min-height: 14px; }

/* Card header (eyebrow + title + ring) */
.tr-dc-head {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 16px;
}
.tr-dc-head-text { flex: 1; min-width: 0; }
.tr-dc-eyebrow {
  font-size: 10px; font-weight: 800; color: var(--muted);
  letter-spacing: 1.4px; text-transform: uppercase;
  line-height: 1;
}
.tr-day-card.is-today .tr-dc-eyebrow { color: var(--accent); }
.tr-day-card.past .tr-dc-eyebrow      { color: var(--muted-dim); }
.tr-dc-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800; line-height: 1.12;
  letter-spacing: -0.55px;
  margin: 8px 0 6px;
  color: var(--text);
}
.tr-day-card.done .tr-dc-title {
  text-decoration: line-through;
  text-decoration-color: rgba(196,240,76,0.5);
  text-decoration-thickness: 2px;
}
.tr-dc-meta {
  font-size: 12px; color: var(--muted);
  line-height: 1.35;
  font-family: var(--font-mono); letter-spacing: -0.1px;
}
.tr-dc-ring {
  flex: 0 0 60px; width: 60px; height: 60px;
  color: var(--accent);
  filter: drop-shadow(0 4px 14px rgba(196,240,76,0.25));
}
.tr-day-card.past .tr-dc-ring      { color: var(--muted); filter: none; }
.tr-day-card.future .tr-dc-ring    { color: var(--muted-dim); filter: none; }
.tr-day-card.done .tr-dc-ring      { color: var(--accent); }

/* Progress bar (compact, replaces lengthy text) */
.tr-dc-progress {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.tr-dc-progress-text {
  font-size: 11px; color: var(--muted);
  font-family: var(--font-mono); letter-spacing: -0.1px;
}
.tr-dc-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.tr-dc-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #d6ff66);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.22, 0.7, 0.3, 1);
}

/* Exercise list — visible on active card; hidden on side cards (saves space) */
.tr-dc-exs {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 16px;
  max-height: 0; overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.3s ease, margin 0.3s ease;
}
.tr-day-carousel .tr-day-card.in-view-active .tr-dc-exs {
  max-height: 800px; opacity: 1;
}
.tr-dc-ex {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 11px 13px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  font-family: inherit; color: var(--text);
  cursor: pointer; text-align: left;
  transition: all 0.15s;
}
.tr-dc-ex:hover {
  border-color: rgba(196,240,76,0.35);
  background: rgba(196,240,76,0.05);
}
.tr-dc-ex:disabled { cursor: not-allowed; opacity: 0.55; }
.tr-dc-ex:active:not(:disabled) { transform: scale(0.99); }
.tr-dc-ex-check {
  flex: 0 0 22px; width: 22px; height: 22px;
  border-radius: 7px;
  border: 1.7px solid var(--border);
  background: var(--surface-2);
  color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.tr-dc-ex-check svg { width: 14px; height: 14px; }
.tr-dc-ex.done .tr-dc-ex-check {
  background: var(--accent); border-color: var(--accent);
  color: #000;
}
.tr-dc-ex-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.tr-dc-ex-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  letter-spacing: -0.2px; line-height: 1.25;
}
.tr-dc-ex.done .tr-dc-ex-name {
  text-decoration: line-through; opacity: 0.6;
}
.tr-dc-ex-meta {
  font-size: 11px; color: var(--muted);
  font-family: var(--font-mono); letter-spacing: -0.1px;
}

/* Big complete-CTA */
.tr-dc-cta {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex-direction: column;
  padding: 15px 18px;
  /* Glossy lime fill — top sheen, soft glow, deeper bottom for a pressable feel. */
  background: linear-gradient(180deg, #d6f570 0%, var(--accent) 52%, #9bd838 100%);
  color: #0a0a0a;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.3px;
  cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(196,240,76,0.6), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.12s ease, box-shadow 0.25s ease, background 0.2s ease, color 0.2s ease, filter 0.2s ease;
  min-height: 58px;
}
.tr-dc-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px -10px rgba(196,240,76,0.72), inset 0 1px 0 rgba(255,255,255,0.45);
  filter: brightness(1.04);
}
.tr-dc-cta:active:not(:disabled) { transform: scale(0.985); }
.tr-dc-cta:disabled {
  background: var(--surface-2);
  color: var(--muted-dim);
  border: 1px dashed var(--border);
  box-shadow: none;
  cursor: not-allowed;
}
.tr-dc-cta.done {
  background: rgba(196,240,76,0.14);
  color: var(--accent);
  border: 1.5px solid rgba(196,240,76,0.5);
  box-shadow: none;
}
.tr-dc-cta.done:hover:not(:disabled) {
  background: rgba(239,68,68,0.10);
  color: var(--danger);
  border-color: rgba(239,68,68,0.4);
}
.tr-dc-cta svg { color: currentColor; }
.tr-dc-cta-main { display: inline-flex; align-items: center; gap: 8px; line-height: 1; }
.tr-dc-cta-sub {
  font-size: 10.5px; font-weight: 700; opacity: 0.75;
  letter-spacing: 0.4px; text-transform: uppercase;
}

/* Past, non-active cards show a hint of dim CTA so the user can still
   read the action without it being visually loud */
.tr-day-carousel .tr-day-card:not(.in-view-active) .tr-dc-cta {
  pointer-events: none;
}
.tr-day-carousel .tr-day-card:not(.in-view-active) .tr-dc-ex {
  pointer-events: none;
}

/* Position dots (one per card, with active emphasis + today marker) */
.tr-pos-dots {
  display: flex; justify-content: center; gap: 6px;
  padding: 4px 0 10px;
  flex-wrap: wrap;
}
.tr-pos-dot {
  width: 6px; height: 6px;
  border-radius: 99px;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.tr-pos-dot:hover { background: var(--muted); }
.tr-pos-dot.is-today {
  background: rgba(196,240,76,0.35);
  width: 6px; height: 6px;
  box-shadow: 0 0 0 2px rgba(196,240,76,0.15);
}
.tr-pos-dot.active {
  background: var(--accent);
  width: 22px;
  box-shadow: 0 0 12px rgba(196,240,76,0.55);
}

/* ─── Bottom Actions (2 buttons: Ganzer Plan + Plan-Menü) ─────────────── */
.tr-bottom-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 8px;
}
.tr-bottom-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px; font-weight: 700;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: all 0.18s;
  min-height: 48px;
}
.tr-bottom-btn:hover {
  border-color: rgba(196,240,76,0.4);
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.06));
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -8px rgba(0,0,0,0.4);
}
.tr-bottom-btn:active { transform: scale(0.97); }
.tr-bottom-btn svg { color: var(--accent); }

/* ─── Inbox Modal ────────────────────────────────────────────────────── */
.tr-inbox-sec {
  margin-top: 16px;
}
.tr-inbox-sec:first-of-type { margin-top: 4px; }
.tr-inbox-eyebrow {
  font-size: 9.5px; font-weight: 800; color: var(--accent);
  letter-spacing: 1.4px; text-transform: uppercase;
  margin-bottom: 10px;
}
.tr-inbox-list {
  display: flex; flex-direction: column; gap: 8px;
}
.tr-inbox-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.tr-inbox-row:hover {
  border-color: rgba(196,240,76,0.35);
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.04));
}
.tr-inbox-icon {
  flex: 0 0 36px; width: 36px; height: 36px;
  border-radius: 11px;
  background: rgba(196,240,76,0.10);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.tr-inbox-body { flex: 1; min-width: 0; }
.tr-inbox-row-title {
  font-size: 13.5px; font-weight: 700; color: var(--text);
  letter-spacing: -0.2px; line-height: 1.25;
}
.tr-inbox-row-title strong { color: var(--accent); font-weight: 800; }
.tr-inbox-row-sub {
  font-size: 11px; color: var(--muted);
  margin-top: 3px;
  font-family: var(--font-mono); letter-spacing: -0.1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-inbox-acts {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.tr-inbox-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.tr-inbox-addfriend {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  margin: 4px 0 6px;
  padding: 13px 14px;
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.06));
  border: 1px dashed rgba(196,240,76,0.4);
  border-radius: 12px;
  cursor: pointer; font-family: inherit; color: var(--text); text-align: left;
  transition: all 0.15s;
}
.tr-inbox-addfriend:hover { border-color: var(--accent); transform: translateY(-1px); }
.tr-inbox-addfriend:active { transform: scale(0.99); }
.tr-inbox-addfriend-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.tr-inbox-addfriend-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-inbox-addfriend-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: -0.2px; }
.tr-inbox-addfriend-sub { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.tr-inbox-addfriend-arrow {
  flex: 0 0 auto; font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--accent); line-height: 1;
}
.tr-inbox-empty-state {
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 28px 16px 12px;
  text-align: center;
}
.tr-inbox-empty-state svg { color: var(--muted-dim); }
.tr-inbox-empty-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -0.3px;
}
.tr-inbox-empty-sub {
  font-size: 12px; color: var(--muted);
}

/* Standalone inbox banner shown ONLY when the user has no plans (empty-state). */
.tr-inbox-banner {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  margin: 14px 0 4px;
  padding: 13px 16px;
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.10));
  border: 1px solid rgba(196,240,76,0.35);
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit; color: var(--text); text-align: left;
  transition: all 0.15s;
}
.tr-inbox-banner:hover {
  border-color: rgba(196,240,76,0.55);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px rgba(196,240,76,0.30);
}
.tr-inbox-banner:active { transform: scale(0.99); }
.tr-inbox-banner-icon {
  width: 36px; height: 36px; border-radius: 11px;
  background: rgba(196,240,76,0.15);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tr-inbox-banner-body { flex: 1; min-width: 0; }
.tr-inbox-banner-title {
  display: block;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700; color: var(--text);
  letter-spacing: -0.2px;
}
.tr-inbox-banner-sub {
  display: block; margin-top: 2px;
  font-size: 11px; color: var(--accent);
  font-weight: 600;
}
.tr-inbox-banner-arrow {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--accent);
  transition: transform 0.15s;
}
.tr-inbox-banner:hover .tr-inbox-banner-arrow { transform: translateX(3px); }

/* Carousel celebration tweaks — keep streak-pop tied to the active card */
.tr-day-carousel .tr-day-card.in-view-active.celebrating {
  animation: heroCelebrate 0.7s cubic-bezier(0.22, 0.7, 0.3, 1);
}

/* Narrow phones: tighten the carousel padding so the side cards still peek */
@media (max-width: 380px) {
  .tr-day-carousel { scroll-padding-inline: 5%; padding-inline: max(5%, 18px); }
  .tr-day-carousel .tr-day-card { flex-basis: 91%; }
  .tr-dc-title { font-size: 20px; }
  .tr-streak-strip { padding: 14px 14px; }
  .tr-inbox-btn { width: 36px; height: 36px; top: 8px; right: 8px; }
}

/* Wider screens (tablets+): cap card width so the carousel still feels deck-like */
@media (min-width: 720px) {
  .tr-day-carousel .tr-day-card { flex-basis: 72%; max-width: 580px; }
}

/* Light mode tweaks for new surfaces */
[data-theme="light"] .tr-day-carousel .tr-day-card {
  background: linear-gradient(160deg, var(--surface) 0%, rgba(74,124,0,0.04) 100%);
  box-shadow: 0 16px 32px -22px rgba(0,0,0,0.25);
}
[data-theme="light"] .tr-day-carousel .tr-day-card.is-today {
  background: linear-gradient(160deg, var(--surface) 0%, rgba(74,124,0,0.10) 100%);
}
[data-theme="light"] .tr-day-carousel .tr-day-card.in-view-active {
  box-shadow:
    0 22px 50px -22px rgba(0,0,0,0.35),
    0 0 0 1px rgba(74,124,0,0.15);
}
[data-theme="light"] .tr-dc-cta { color: #fff; }
[data-theme="light"] .tr-dc-cta svg { color: #fff; }
[data-theme="light"] .tr-dc-cta.done { background: rgba(74,124,0,0.10); color: var(--accent); }
[data-theme="light"] .tr-dc-cta.done svg { color: var(--accent); }
[data-theme="light"] .tr-pos-dot.is-today { box-shadow: 0 0 0 2px rgba(74,124,0,0.15); }
[data-theme="light"] .tr-inbox-dot { color: #fff; }

/* Reduced motion: drop the heaviest transitions */
@media (prefers-reduced-motion: reduce) {
  .tr-day-carousel .tr-day-card { transition: none; }
  .tr-dc-bar-fill { transition: none; }
  .tr-inbox-dot { animation: none; }
}

/* ═══ Pending-requests banner (workout overview) ═════════════════════ */
.tr-req-card {
  margin: 14px 0 0;
  padding: 14px 16px;
  background: linear-gradient(155deg, var(--surface), rgba(196,240,76,0.10));
  border: 1px solid rgba(196,240,76,0.4);
  border-radius: 16px;
}
.tr-req-head {
  font-size: 9.5px; font-weight: 800; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 10px;
}
.tr-req-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}
.tr-req-row:first-of-type { border-top: none; padding-top: 2px; }
.tr-req-icon {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px;
  background: rgba(196,240,76,0.12); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.tr-req-body { flex: 1; min-width: 0; }
.tr-req-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; line-height: 1.25; }
.tr-req-title strong { color: var(--accent); }
.tr-req-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tr-req-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ═══ Workout Timer ═══════════════════════════════════════════════════ */
#tr-timer-modal { z-index: 300; } /* above plan-table / inbox sheets */
.tr-dc-timer-btn,
.tr-pd-timer {
  font-family: inherit; cursor: pointer; border: none;
  display: inline-flex; align-items: center; justify-content: center;
}
/* Card-level button (carousel) */
.tr-dc-timer-btn {
  width: 100%; gap: 9px; margin-bottom: 12px;
  padding: 13px 16px; min-height: 48px;
  /* Lime-tinted glass pill — never a flat black bar. */
  background: linear-gradient(180deg, rgba(196,240,76,0.11), rgba(196,240,76,0.02));
  border: 1px solid rgba(196,240,76,0.30);
  border-radius: 14px;
  color: var(--accent);
  font-size: 13.5px; font-weight: 700; letter-spacing: -0.2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}
.tr-dc-timer-btn:hover {
  background: linear-gradient(180deg, rgba(196,240,76,0.18), rgba(196,240,76,0.05));
  border-color: rgba(196,240,76,0.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 6px 18px -10px rgba(196,240,76,0.4);
}
.tr-dc-timer-btn:active { transform: scale(0.98); }
.tr-dc-timer-btn svg { color: currentColor; }
/* Row-level icon (details) */
.tr-pd-timer {
  flex: 0 0 30px; width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--accent);
  transition: all 0.15s;
}
.tr-pd-timer:hover { border-color: var(--accent); background: var(--accent-soft); }
.tr-pd-timer:active { transform: scale(0.92); }

/* Timer sheet */
.tr-timer-sheet { text-align: center; }
.tr-timer-eyebrow {
  font-size: 11px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.2px; margin-top: 4px;
}
.tr-timer-name {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 800; letter-spacing: -0.4px;
  color: var(--text); margin: 6px 0 10px; line-height: 1.2;
}
.tr-timer-ring-wrap {
  position: relative; width: 240px; max-width: 70vw; aspect-ratio: 1/1;
  margin: 8px auto 6px;
}
.tr-timer-ring { width: 100%; height: 100%; display: block; }
#tr-timer-ring-fg { transition: stroke-dashoffset 0.25s linear, stroke 0.3s; }
.tr-timer-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tr-timer-phase {
  font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2px;
}
.tr-timer-display {
  font-family: var(--font-mono);
  font-size: 52px; font-weight: 800; letter-spacing: -1px;
  color: var(--text); line-height: 1; font-variant-numeric: tabular-nums;
}
.tr-timer-sub { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 16px; }
/* Phase tints */
.tr-timer-sheet[data-phase="work"] #tr-timer-ring-fg { stroke: var(--accent); }
.tr-timer-sheet[data-phase="work"] .tr-timer-phase { color: var(--accent); }
.tr-timer-sheet[data-phase="rest"] #tr-timer-ring-fg { stroke: #7dd3fc; }
.tr-timer-sheet[data-phase="rest"] .tr-timer-phase { color: #7dd3fc; }

.tr-timer-rounds {
  display: flex; justify-content: center; gap: 6px; flex-wrap: wrap;
  min-height: 10px; margin: 10px 0 2px;
}
.tr-timer-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
}
.tr-timer-dot.active { background: var(--accent); box-shadow: 0 0 8px rgba(196,240,76,0.6); }
.tr-timer-dot.done { background: rgba(196,240,76,0.45); }

.tr-timer-adjust {
  display: flex; gap: 8px; justify-content: center; margin: 14px 0 6px;
}
.tr-timer-adj-btn {
  flex: 1; max-width: 90px;
  padding: 9px 6px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); font-family: var(--font-mono);
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 0.13s;
}
.tr-timer-adj-btn:hover { border-color: rgba(196,240,76,0.4); color: var(--text); }
.tr-timer-adj-btn:active { transform: scale(0.94); }

.tr-timer-controls {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 14px 0 4px;
}
.tr-timer-ctl {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.tr-timer-ctl:hover { border-color: rgba(196,240,76,0.4); }
.tr-timer-ctl:active { transform: scale(0.92); }
.tr-timer-ctl.primary {
  width: 78px; height: 78px;
  background: var(--accent); color: #000; border: none;
  box-shadow: 0 10px 28px -8px rgba(196,240,76,0.55);
}
.tr-timer-ctl.primary:hover { transform: translateY(-1px); }
.tr-timer-ctl.primary svg { margin-left: 1px; }

/* Finished state — celebratory pulse on the ring + green glow */
.tr-timer-sheet.timer-finished .tr-timer-phase { color: var(--accent); }
.tr-timer-sheet.timer-finished #tr-timer-ring-fg { stroke: var(--accent); }
.tr-timer-sheet.timer-finished .tr-timer-ring-wrap { animation: timerFinishPulse 0.7s cubic-bezier(0.22,0.7,0.3,1) 2; }
.tr-timer-sheet.timer-finished .tr-timer-display { color: var(--accent); }
@keyframes timerFinishPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

[data-theme="light"] .tr-timer-ctl.primary { color: #fff; }
[data-theme="light"] .tr-timer-ctl.primary svg { color: #fff; }
[data-theme="light"] .tr-dc-timer-btn { background: var(--surface); }
[data-theme="light"] .tr-timer-sheet[data-phase="rest"] #tr-timer-ring-fg { stroke: #0284c7; }
[data-theme="light"] .tr-timer-sheet[data-phase="rest"] .tr-timer-phase { color: #0284c7; }

/* ═══ Plan Calendar / Heatmap inside the "Ganzer Plan" modal ════════════
   - Each row = 1 calendar week, label on the left.
   - 7 cells per row (Mon → Sun). Each cell = ONE workout day.
   - Green cell = completed. Tap any cell to toggle (no past-day limit). */
.tr-pt-cal {
  display: flex; flex-direction: column;
  margin: 14px 0 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px 16px;
}
.tr-cal-summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 8px 4px 14px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 12px;
}
.tr-cal-summary-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tr-cal-summary-num {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1;
}
.tr-cal-summary-num.tr-cal-summary-pct { color: var(--accent); }
.tr-cal-summary-lbl {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--muted);
}

.tr-cal-headrow,
.tr-cal-grid {
  display: grid;
  grid-template-columns: 44px repeat(7, 1fr);
  gap: 4px;
}
.tr-cal-headrow { margin-bottom: 6px; }
.tr-cal-dow {
  font-size: 9.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  text-align: center; padding: 2px 0;
}
.tr-cal-week-lbl {
  display: flex; align-items: center; justify-content: flex-start;
  font-size: 9.5px; font-weight: 700; color: var(--muted-dim);
  letter-spacing: 0.4px; text-transform: uppercase;
  padding-right: 4px;
  font-family: var(--font-mono);
  line-height: 1;
}

.tr-cal-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 38px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.tr-cal-cell:hover:not(:disabled):not(.tr-cal-cell-empty) {
  border-color: rgba(196,240,76,0.45);
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.05));
  transform: translateY(-1px);
}
.tr-cal-cell:active:not(:disabled) { transform: scale(0.94); }
.tr-cal-cell-empty,
.tr-cal-cell.before-plan {
  background: transparent;
  border-color: transparent;
  cursor: default;
  opacity: 0.4;
}
.tr-cal-cell.before-plan { border-style: dashed; border-color: var(--border-soft); }
.tr-cal-cell.future {
  border-style: dashed;
  opacity: 0.7;
}
.tr-cal-cell.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 6px 14px -6px rgba(196,240,76,0.45);
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.08));
}
.tr-cal-cell.partial {
  border-color: rgba(251,191,36,0.55);
  background: linear-gradient(155deg, var(--surface-2), rgba(251,191,36,0.10));
}
.tr-cal-cell.done {
  background: linear-gradient(155deg, var(--accent), #d6ff66);
  border-color: var(--accent);
  color: #000;
  box-shadow: 0 6px 16px -6px rgba(196,240,76,0.45);
}
.tr-cal-cell.done.today {
  box-shadow: 0 0 0 1.5px var(--accent), 0 8px 18px -6px rgba(196,240,76,0.65);
}
.tr-cal-cell.just-popped {
  animation: trCalPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes trCalPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); }
  70%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.tr-cal-cell-dom {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: -0.2px;
  color: inherit; opacity: 0.85;
  line-height: 1;
}
.tr-cal-cell.done .tr-cal-cell-dom { opacity: 1; }
.tr-cal-cell-name {
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: inherit;
  font-family: var(--font-display);
  line-height: 1;
}
.tr-cal-cell.done .tr-cal-cell-name { color: #000; opacity: 0.7; }
.tr-cal-cell-check {
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  transform: translate(-50%, -50%);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.16);
  border-radius: 50%;
  z-index: 2;
}
.tr-cal-cell-check svg { width: 16px; height: 16px; }
.tr-cal-cell.done .tr-cal-cell-dom,
.tr-cal-cell.done .tr-cal-cell-name { opacity: 0; }

/* Legend below the grid */
.tr-cal-legend {
  display: flex; flex-wrap: wrap; gap: 12px 14px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  justify-content: center;
}
.tr-cal-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  letter-spacing: -0.1px;
}
.tr-cal-legend-swatch {
  width: 12px; height: 12px; border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}
.tr-cal-legend-swatch.done {
  background: var(--accent); border-color: var(--accent);
}
.tr-cal-legend-swatch.today {
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.10));
  border-color: var(--accent);
}
.tr-cal-legend-swatch.future {
  border-style: dashed;
}

/* Sparkle override for the smaller per-cell celebration */
.tr-cal-sparkle {
  width: 7px; height: 7px;
}

/* Narrow phones: tighter calendar cells */
@media (max-width: 380px) {
  .tr-pt-cal { padding: 12px 8px 12px; }
  .tr-cal-headrow,
  .tr-cal-grid { grid-template-columns: 32px repeat(7, 1fr); gap: 3px; }
  .tr-cal-cell { min-height: 34px; padding: 3px 1px; }
  .tr-cal-cell-dom { font-size: 10px; }
  .tr-cal-cell-name { font-size: 8.5px; }
  .tr-cal-cell-check { width: 18px; height: 18px; }
  .tr-cal-cell-check svg { width: 14px; height: 14px; }
}

/* Light mode tuning */
[data-theme="light"] .tr-cal-cell.done { color: #fff; }
[data-theme="light"] .tr-cal-cell.done .tr-cal-cell-check { color: #fff; background: rgba(255,255,255,0.18); }
[data-theme="light"] .tr-cal-cell.done .tr-cal-cell-name { color: #fff; }

/* ── Calendar week-label tweaks ─── */
.tr-cal-week-lbl.current { color: var(--accent); font-weight: 800; }
.tr-cal-week-lbl-head {
  font-size: 9px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
  padding-right: 4px;
  display: flex; align-items: center;
}

/* ═══ Plan Details (merged Sessions + Excel) ═══════════════════════════
   Each session is a collapsible card. Inside: every exercise with sets /
   reps / weight / pause / notes, tappable to toggle done. The active
   session/week opens by default. */
.tr-pt-details {
  display: flex; flex-direction: column;
  gap: 8px;
  margin: 14px 0 4px;
}
.tr-pd-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.tr-pd-card[open] { background: linear-gradient(160deg, var(--surface), rgba(196,240,76,0.03)); }
.tr-pd-card.current {
  border-color: rgba(196,240,76,0.5);
  box-shadow: 0 8px 22px -10px rgba(196,240,76,0.30);
}
.tr-pd-card.done {
  background: linear-gradient(160deg, var(--surface), rgba(196,240,76,0.10));
  border-color: rgba(196,240,76,0.4);
}
.tr-pd-card.partial { border-color: rgba(251,191,36,0.4); }

.tr-pd-summary {
  position: relative;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 16px;
  cursor: pointer;
  user-select: none;
}
.tr-pd-summary::-webkit-details-marker { display: none; }
.tr-pd-summary::marker { content: ""; }
.tr-pd-sum-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tr-pd-sum-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-pd-card.done .tr-pd-sum-title {
  text-decoration: line-through;
  text-decoration-color: rgba(196,240,76,0.6);
  text-decoration-thickness: 2px;
  opacity: 0.85;
}
.tr-pd-sum-meta {
  font-size: 11.5px; color: var(--muted);
  font-family: var(--font-mono); letter-spacing: -0.1px;
}
.tr-pd-sum-right {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  color: var(--muted);
}
.tr-pd-sum-pct.full    { color: var(--accent); }
.tr-pd-sum-pct.partial { color: #fbbf24; }
.tr-pd-sum-chev {
  color: var(--muted);
  transition: transform 0.25s ease;
}
.tr-pd-card[open] .tr-pd-sum-chev { transform: rotate(180deg); }
.tr-pd-sum-bar {
  position: absolute;
  left: 16px; right: 16px; bottom: 6px;
  height: 3px; border-radius: 99px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}
.tr-pd-sum-fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), #d6ff66);
  border-radius: 99px;
  transition: width 0.45s cubic-bezier(0.22, 0.7, 0.3, 1);
}

.tr-pd-ex-list {
  display: flex; flex-direction: column;
  gap: 6px;
  padding: 6px 12px 14px;
  border-top: 1px solid var(--border-soft);
}
.tr-pd-ex {
  display: flex;
  align-items: center; gap: 10px;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer; text-align: left;
  transition: all 0.15s;
}
.tr-pd-ex > .tr-pd-day, .tr-pd-ex > .tr-pd-no { flex: 0 0 40px; }
.tr-pd-ex > .tr-pd-ex-body { flex: 1 1 auto; min-width: 0; }
.tr-pd-ex > .tr-pd-timer { flex: 0 0 auto; margin-left: auto; }
/* check is always the last child → always rightmost */
.tr-pd-ex > .tr-pd-ex-check { flex: 0 0 auto; order: 99; }
.tr-pd-ex:hover {
  border-color: rgba(196,240,76,0.35);
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.04));
}
.tr-pd-ex:active { transform: scale(0.99); }
.tr-pd-ex.today {
  border-color: rgba(196,240,76,0.55);
  box-shadow: 0 0 0 1px rgba(196,240,76,0.25);
}
.tr-pd-ex.done {
  background: linear-gradient(155deg, rgba(196,240,76,0.10), rgba(196,240,76,0.05));
  border-color: rgba(196,240,76,0.5);
}
.tr-pd-ex.done .tr-pd-ex-name {
  text-decoration: line-through;
  text-decoration-color: rgba(196,240,76,0.7);
  text-decoration-thickness: 1.5px;
  opacity: 0.75;
}
.tr-pd-day, .tr-pd-no {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 6px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.tr-pd-ex.today .tr-pd-day {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.tr-pd-ex-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-pd-ex-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  letter-spacing: -0.2px; line-height: 1.3;
}
.tr-pd-ex-meta {
  font-size: 11px; color: var(--muted);
  font-family: var(--font-mono); letter-spacing: -0.1px;
}
.tr-pd-ex-note {
  font-size: 11px; color: var(--text-dim);
  margin-top: 2px;
  font-style: italic; line-height: 1.4;
}
.tr-pd-ex-check {
  width: 24px; height: 24px;
  border-radius: 7px;
  border: 1.7px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: all 0.15s;
}
.tr-pd-ex-check svg { width: 14px; height: 14px; }
.tr-pd-ex.done .tr-pd-ex-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

@media (max-width: 380px) {
  .tr-pd-ex { grid-template-columns: 34px 1fr 24px; padding: 10px 10px; }
  .tr-pd-ex-check { width: 22px; height: 22px; }
}

/* Light mode tuning */
[data-theme="light"] .tr-pd-ex.done .tr-pd-ex-check { color: #fff; }

/* ── Carousel "rest / out of range" card (weekly plans, fixed timeline) ── */
.tr-day-carousel .tr-day-card.is-rest {
  background: linear-gradient(160deg, var(--surface), rgba(255,255,255,0.02));
  border-style: dashed;
}
.tr-dc-ring-rest { color: var(--muted-dim); filter: none; }
.tr-dc-rest-spacer { flex: 1; min-height: 40px; }

/* ── Weekly session-picker grid (rows = weeks, cells = days) ── */
.tr-spw-grid { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.tr-spw-headrow, .tr-spw-row {
  display: grid; grid-template-columns: 34px repeat(7, 1fr); gap: 5px; align-items: center;
}
.tr-spw-dow {
  font-size: 9px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px; text-align: center;
}
.tr-spw-week {
  font-size: 10px; font-weight: 800; color: var(--muted-dim);
  font-family: var(--font-mono);
  display: flex; align-items: center;
}
.tr-spw-cell {
  aspect-ratio: 1 / 1; min-height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text);
  cursor: pointer; padding: 2px;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: all 0.13s;
}
.tr-spw-cell:hover:not(:disabled) {
  border-color: rgba(196,240,76,0.5);
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.06));
}
.tr-spw-cell:active:not(:disabled) { transform: scale(0.92); }
.tr-spw-cell:disabled { opacity: 0.3; cursor: default; }
.tr-spw-cell.current {
  background: var(--accent); border-color: var(--accent); color: #000;
  box-shadow: 0 4px 12px -4px rgba(196,240,76,0.5);
}
.tr-spw-cell-name {
  font-size: 8.5px; font-weight: 800; letter-spacing: 0.2px;
  text-transform: uppercase; line-height: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Manual editor: plan-kind selector ── */
.tr-me-kind {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 8px 0 6px;
}
.tr-me-kind-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 13px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer; text-align: left;
  font-family: inherit; color: var(--text);
  transition: all 0.15s;
}
.tr-me-kind-opt:active { transform: scale(0.98); }
.tr-me-kind-opt.active {
  border-color: var(--accent);
  background: linear-gradient(155deg, var(--surface-2), rgba(196,240,76,0.08));
  box-shadow: 0 0 0 1px rgba(196,240,76,0.3);
}
.tr-me-kind-icon {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.tr-me-kind-opt.active .tr-me-kind-icon { background: var(--accent-soft); color: var(--accent); }
.tr-me-kind-title {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700; letter-spacing: -0.2px;
}
.tr-me-kind-sub { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
[data-theme="light"] .tr-spw-cell.current { color: #fff; }

@media (max-width: 380px) {
  .tr-spw-headrow, .tr-spw-row { grid-template-columns: 28px repeat(7, 1fr); gap: 4px; }
  .tr-spw-cell { min-height: 30px; }
  .tr-me-kind { grid-template-columns: 1fr; }
}

/* ── Light-mode polish for v107-v109 components ──
   In light mode --accent is a darker, readable green (#4a7c00). Override the
   hardcoded bright-lime gradients/glows so nothing looks neon on white. */
[data-theme="light"] .tr-streak-prog-fill,
[data-theme="light"] .tr-dc-bar-fill,
[data-theme="light"] .tr-cal-cell.done,
[data-theme="light"] .tr-cal-summary-pct,
[data-theme="light"] .tr-pd-sum-fill {
  background: var(--accent);
}
[data-theme="light"] .tr-cal-summary-pct { background: none; color: var(--accent); }
[data-theme="light"] .tr-streak-prog-fill { box-shadow: none; }
[data-theme="light"] .tr-cal-cell.done { color: #fff; }
[data-theme="light"] .tr-cal-cell.done .tr-cal-cell-name,
[data-theme="light"] .tr-cal-cell.done .tr-cal-cell-dom { color: #fff; }
[data-theme="light"] .tr-cal-cell.today {
  box-shadow: 0 0 0 1px var(--accent), 0 4px 10px -5px rgba(74,124,0,0.4);
}
[data-theme="light"] .tr-day-carousel .tr-day-card.is-today.in-view-active {
  box-shadow: 0 20px 44px -22px rgba(74,124,0,0.30), 0 0 0 1px rgba(74,124,0,0.30);
}
[data-theme="light"] .tr-dc-cta {
  box-shadow: 0 10px 24px -10px rgba(74,124,0,0.5);
}
[data-theme="light"] .tr-inbox-dot { box-shadow: 0 0 0 2.5px var(--bg); }
[data-theme="light"] .tr-streak-prog-pct { color: var(--accent); }

/* ═══ Big full-screen workout celebration ════════════════════════════════ */
.aion-celebrate {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; cursor: pointer;   /* tap anywhere to skip */
  opacity: 1; transition: opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Quick, smooth exit — fade + gentle lift so it doesn't "snap" but clears fast. */
.aion-celebrate.out { opacity: 0; }
.aion-celebrate.out .aion-celebrate-core {
  transform: scale(0.95) translateY(-6px);
  opacity: 0;
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.34s ease;
}
.aion-celebrate.out .aion-celebrate-glow { transition: opacity 0.38s ease; opacity: 0; }
.aion-celebrate-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(196,240,76,0.22), rgba(10,10,10,0.55) 60%, rgba(10,10,10,0.82));
  animation: aionGlowIn 0.5s ease both;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
@keyframes aionGlowIn { from { opacity: 0; } to { opacity: 1; } }
.aion-celebrate-core {
  position: relative; text-align: center; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: aionCoreIn 0.6s cubic-bezier(0.22,0.7,0.3,1.3) both;
}
@keyframes aionCoreIn {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.aion-celebrate-ring { width: 130px; height: 130px; filter: drop-shadow(0 0 24px rgba(196,240,76,0.55)); }
.aion-celebrate-ring svg { width: 100%; height: 100%; }
.aion-celebrate-check {
  stroke-dasharray: 90; stroke-dashoffset: 90;
  animation: aionCheck 0.5s 0.25s cubic-bezier(0.6,0,0.3,1) forwards;
}
@keyframes aionCheck { to { stroke-dashoffset: 0; } }
.aion-celebrate-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 8vw, 46px); font-weight: 900;
  letter-spacing: 1px; color: var(--accent);
  text-shadow: 0 4px 30px rgba(196,240,76,0.45);
  line-height: 1;
}
.aion-celebrate-sub {
  font-size: 14px; font-weight: 600; color: var(--text);
  letter-spacing: 0.2px; opacity: 0.85;
}
.aion-celebrate.is-group .aion-celebrate-title { font-size: clamp(24px, 7.5vw, 44px); }
.aion-celebrate-sparks { position: absolute; inset: 0; z-index: 1; }
.aion-celebrate-spark {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, #e6ff66 0%, var(--accent) 55%, transparent 100%);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px var(--accent));
  animation: aionSpark 1.4s cubic-bezier(0.15,0.7,0.3,1) forwards;
}
@keyframes aionSpark {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.5); opacity: 0; }
}
[data-theme="light"] .aion-celebrate-glow {
  background: radial-gradient(circle at 50% 50%, rgba(74,124,0,0.18), rgba(250,250,247,0.6) 60%, rgba(250,250,247,0.85));
}
[data-theme="light"] .aion-celebrate-sub { color: #1a1a1a; }
@media (prefers-reduced-motion: reduce) {
  .aion-celebrate-spark, .aion-celebrate-core { animation: none; }
  .aion-celebrate-check { stroke-dashoffset: 0; animation: none; }
}

/* ═══ Group chat ═════════════════════════════════════════════════════════ */
.tr-friends-head-acts { display: inline-flex; align-items: center; gap: 6px; }
.tr-friends-chat {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); color: var(--accent);
  border: 1px solid var(--border); cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.tr-friends-chat:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.tr-chat-sheet { display: flex; flex-direction: column; max-height: 86vh; }
.tr-chat-msgs {
  flex: 1; min-height: 220px; max-height: 56vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 6px 2px 12px; margin: 8px 0;
}
.tr-chat-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 10px; }
.tr-chat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 80%; }
.tr-chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.tr-chat-name { font-size: 10.5px; font-weight: 700; color: var(--accent); margin: 0 0 2px 8px; }
.tr-chat-bubble {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  padding: 9px 13px; border-radius: 16px 16px 16px 4px;
  font-size: 14px; line-height: 1.35; color: var(--text); word-break: break-word;
}
.tr-chat-msg.mine .tr-chat-bubble {
  background: var(--accent); color: #000; border: none; border-radius: 16px 16px 4px 16px;
}
.tr-chat-time { font-size: 9.5px; color: var(--muted-dim); margin: 2px 8px 0; font-family: var(--font-mono); }
.tr-chat-bubble { position: relative; }
.tr-chat-del {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; padding: 0;
  display: none; align-items: center; justify-content: center;
}
.tr-chat-msg.mine .tr-chat-bubble:hover .tr-chat-del,
.tr-chat-del:focus { display: inline-flex; }
.tr-chat-del:hover { color: var(--danger); border-color: var(--danger); }
/* On touch devices (no hover) always show the delete affordance on own msgs. */
@media (hover: none) {
  .tr-chat-msg.mine .tr-chat-del { display: inline-flex; }
}
.tr-chat-form { display: flex; gap: 8px; align-items: center; padding-top: 4px; }
.tr-chat-form input {
  flex: 1; padding: 12px 14px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 15px;
}
.tr-chat-form input:focus { border-color: var(--accent); outline: none; }
.tr-chat-send {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  background: var(--accent); color: #000; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: transform 0.12s;
}
.tr-chat-send:hover { transform: scale(1.05); }
.tr-chat-send:active { transform: scale(0.92); }
[data-theme="light"] .tr-chat-msg.mine .tr-chat-bubble { color: #fff; }
[data-theme="light"] .tr-chat-send { color: #fff; }


/* KI-Transparenz (Art. 50 KI-VO): sichtbare Kennzeichnung an jeder KI-Funktion. */
.ai-tag {
  display: inline-block; vertical-align: middle; margin-left: 5px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .08em;
  padding: 1px 5px; border-radius: 5px; cursor: help;
  color: var(--accent, #c8f442);
  background: color-mix(in srgb, var(--accent, #c8f442) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #c8f442) 34%, transparent);
}
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
  .ai-tag { background: rgba(200,244,66,.12); border-color: rgba(200,244,66,.34); }
}
.ai-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin: 8px 2px 0; }
