/* =========================================================
   Mentum · Core Design System
   Modern glass-morphism dark UI
   ========================================================= */

/* Reserviert Platz für Scrollbar, damit sich Inhalt beim Wechsel nicht horizontal verschiebt */
html { scrollbar-gutter: stable; }

/* ─── 1. Design Tokens ─── */
:root {
  /* Palette */
  --bg: #030712;
  --surface: #0a0f1e;
  --surface-elevated: #111827;
  /* Hover-Zwischenstufe (Sidebar-Footer, Chips); gleiche Idee wie Light #f1f5f9 am Body */
  --surface-2: #0d1324;
  /* „Ring“ um Badges/UI auf Shell-Fläche (Sidebar); an Surface gekoppelt */
  --bg-card: var(--surface);
  --surface-glass: rgba(10, 15, 30, 0.6);
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --border-active: rgba(59,130,246,0.5);

  --text-primary: #f1f5f9;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: rgba(59,130,246,0.12);
  --secondary: #10b981;
  --secondary-soft: rgba(16,185,129,0.12);
  --accent: #8b5cf6;
  --danger: #ef4444;
  --warning: #f59e0b;
  --danger-soft: color-mix(in oklab, var(--danger) 12%, transparent);
  --warning-soft: color-mix(in oklab, var(--warning) 12%, transparent);
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  /* Text auf Brand-Gradient / voller Primary-Fläche */
  --on-primary: #ffffff;

  /* Brand-Gradient (Logo: Marineblau → Warmgold) */
  --brand-blue: #3b82f6;
  --brand-teal: #1da8b8;
  --brand-gold: #d4a830;
  --brand-gradient: linear-gradient(135deg, #2563db 0%, #1e8a9e 50%, #d4a830 100%);
  --brand-gradient-btn: linear-gradient(135deg, #3b82f6 0%, #1da8b8 45%, #d4a830 100%);
  --shadow-glow-brand: 0 4px 20px rgba(212,168,48,0.18), 0 2px 12px rgba(59,130,246,0.22);

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  /* Fließtext = --font (enthält bereits Emoji-Fallback); Alias für Abwärtskompatibilität */
  --font-emoji: var(--font);
  /* Reine Emoji-Spans: Emoji-Fonts zuerst, damit WKWebView (Capacitor/iOS) korrekt rendert */
  --font-emoji-only: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
  --text-xs: 0.73rem;
  --text-sm: 0.78rem;
  --text-base: 0.9rem;
  --text-md: 0.95rem;
  --text-lg: 1.1rem;
  --text-xl: 1.3rem;
  --text-2xl: 1.85rem;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --pill: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.6);
  --shadow-glow-sm: 0 0 20px rgba(59,130,246,0.08);
  --shadow-glow: 0 0 40px rgba(59,130,246,0.12);
  --shadow-glow-lg: 0 0 60px rgba(59,130,246,0.18);

  /* Glass */
  --glass-bg: rgba(10, 15, 30, 0.55);
  --glass-border: rgba(255,255,255,0.07);
  --glass-blur: 24px;

  /* Layout */
  --sb-w: 256px;
  --sb-w-sm: 72px;
  --gap: 16px;

  /* Animation */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 350ms;

  /* Layering (Orientierung an bestehenden festen z-index in dieser Datei) */
  --z-dock: 100;
  --z-mobile-backdrop: 199;
  --z-sidebar-mobile: 200;
  --z-toast: 3500;
  --z-route-progress: 4000;
  --z-toast-root: 4000;
  --z-cookie-modal: 10000;
  /* Coach-Portal: unter Toasts, über mobiler Sidebar/Backdrop */
  --z-coach-sticky: 55;
  --z-coach-drawer-backdrop: 210;
  --z-coach-drawer: 211;
  --z-coach-modal: 3400;

  /* Native App Shell – Single-Owner Safe Areas */
  --app-tab-bar-h: 56px;
  --app-tab-bar-float-offset: var(--space-2);
  --app-tab-bar-log-protrusion: 14px;
  --app-top-inset: env(safe-area-inset-top, 0px);
  --app-bottom-inset: env(safe-area-inset-bottom, 0px);
  --app-side-inset-left: env(safe-area-inset-left, 0px);
  --app-side-inset-right: env(safe-area-inset-right, 0px);
  /* Bar + float gap + Log-Button-Überstand + Home-Indicator */
  --app-tab-bar-total-h: calc(
    var(--app-tab-bar-h)
    + var(--app-tab-bar-float-offset)
    + var(--app-tab-bar-log-protrusion)
    + var(--app-bottom-inset)
  );
  --app-dock-clearance: var(--app-tab-bar-total-h);
  --app-shell-header-content-h: 48px;
  --app-shell-header-total-h: calc(var(--app-shell-header-content-h) + var(--app-top-inset));
  --app-keyboard-inset: 0px;
  --app-fixed-bottom: var(--app-dock-clearance);
  --z-app-header: calc(var(--z-dock) - 1);
  --z-app-tab-bar: var(--z-dock);
  --z-app-fab: calc(var(--z-dock) + 10);
  --z-app-drawer: calc(var(--z-sidebar-mobile) + 5);
  --z-app-sheet: calc(var(--z-sidebar-mobile) + 10);
  --z-app-modal: 3200;

  /* Trainingsplan-Event-Semantik (4 Farben) – siehe TRAINING_EVENT_ICONS in icon_registry.py */
  --tp-ev-primary: var(--primary);
  --tp-ev-secondary: var(--secondary);
  --tp-ev-warning: var(--warning);
  --tp-ev-danger: var(--danger);
}

/* ─── 1b. Light Mode ─── */
/* Basis: Weiß. Schwarze Schrift auf Weiß. Graue Flächen (Inputs, Karten) mit weißer Schrift. */
[data-theme="light"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-elevated: #f8fafc;
  --surface-2: #f1f5f9;
  --bg-card: var(--surface);
  --surface-glass: rgba(255, 255, 255, 0.95);

  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-active: #2563eb;

  --text-primary: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.08);
  --secondary: #059669;
  --secondary-soft: rgba(5, 150, 105, 0.08);
  --accent: #7c3aed;
  --danger: #dc2626;
  --warning: #d97706;
  --danger-soft: color-mix(in oklab, var(--danger) 10%, transparent);
  --warning-soft: color-mix(in oklab, var(--warning) 10%, transparent);
  --accent-soft: color-mix(in oklab, var(--accent) 10%, transparent);
  --on-primary: #ffffff;

  /* Brand-Gradient Light */
  --brand-blue: #2563eb;
  --brand-teal: #0d8fab;
  --brand-gold: #b8860b;
  --brand-gradient: linear-gradient(135deg, #1d4ed8 0%, #0f7a94 50%, #b8860b 100%);
  --brand-gradient-btn: linear-gradient(135deg, #2563eb 0%, #0d8fab 45%, #c49a0a 100%);
  --shadow-glow-brand: 0 4px 20px rgba(184,134,11,0.18), 0 2px 12px rgba(37,99,235,0.20);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-glow-sm: none;
  --shadow-glow: none;
  --shadow-glow-lg: none;

  --glass-bg: #ffffff;
  --glass-border: #e2e8f0;
  --glass-blur: 0px;

  --tp-ev-primary: var(--primary);
  --tp-ev-secondary: var(--secondary);
  --tp-ev-warning: var(--warning);
  --tp-ev-danger: var(--danger);
}

/* Body & Shell: weiß */
[data-theme="light"] body { background: #f1f5f9; }
[data-theme="light"] .card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .card::before,
[data-theme="light"] .card::after { display: none; }

/* Sidebar: weiß, schwarze Schrift */
[data-theme="light"] .sidebar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="light"] .sb__link { color: #334155; }
[data-theme="light"] .sb__link:hover { color: #0f172a; }
[data-theme="light"] .sb__link.is-active { color: #2563eb; }
[data-theme="light"] .sb__link.danger { color: #dc2626; }
[data-theme="light"] .sb__indicator {
  background: #eff6ff;
  border: 1px solid #dbeafe;
}
[data-theme="light"] .sb__toggle {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #64748b;
}
[data-theme="light"] .sb__toggle:hover {
  background: #f8fafc;
  color: #334155;
}
[data-theme="light"] .brand { color: #0f172a; }
[data-theme="light"] .b-1 { color: #0f172a; }
[data-theme="light"] .brand__name { color: #0f172a; }

/* Content: weißer Hintergrund, dunkle Schrift */
[data-theme="light"] .content {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: #e2e8f0;
  color: #1e293b;
}
[data-theme="light"] .brandline { color: #2563eb; }
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 { color: #0f172a; }
[data-theme="light"] label { color: #1e293b; }
[data-theme="light"] p { color: #334155; }
[data-theme="light"] .page-top { border-color: #e2e8f0; }
[data-theme="light"] .hint { color: #64748b; }
[data-theme="light"] .subtle { color: #64748b; }
[data-theme="light"] .section-label { color: #2563eb; }
[data-theme="light"] .content a:not(.btn):not(.lp-btn):not(.sb__link):not([class*="lp-"]) { color: #2563eb; }
[data-theme="light"] .content a:not(.btn):not(.lp-btn):not(.sb__link):not([class*="lp-"]):hover { color: #1d4ed8; }

/* Inputs: heller Hintergrund, dunkle Schrift (Light-Mode-konform) */
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  border-radius: var(--radius);
}
[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #64748b;
}
[data-theme="light"] select option {
  background: #ffffff;
  color: #0f172a;
}

/* Range sliders: grauer Track, blauer Thumb */
[data-theme="light"] input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 6px;
  border: none;
}
[data-theme="light"] input[type="range"]::-webkit-slider-runnable-track {
  background: #cbd5e1;
  border-radius: 999px;
  height: 6px;
}
[data-theme="light"] input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  margin-top: -7px;
  cursor: pointer;
}
[data-theme="light"] input[type="range"]::-moz-range-track {
  background: #cbd5e1;
  border-radius: 999px;
  height: 6px;
}
[data-theme="light"] input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
}

/* Buttons */
[data-theme="light"] .btn,
[data-theme="light"] button[type="submit"] {
  color: #ffffff;
}

/* Sport pills / Chips: GRAU, weiße Schrift */
[data-theme="light"] .pill,
[data-theme="light"] .chip,
[data-theme="light"] .seg-btn {
  background: #334155;
  border-color: #475569;
  color: #ffffff;
}
[data-theme="light"] .pill:hover,
[data-theme="light"] .chip:hover,
[data-theme="light"] .seg-btn:hover {
  border-color: #64748b;
  background: #475569;
  color: #ffffff;
}
[data-theme="light"] .pill.active,
[data-theme="light"] .chip.active,
[data-theme="light"] .seg-btn.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

/* Toast: grau */
[data-theme="light"] .toast {
  background: #334155;
  border: 1px solid #475569;
  box-shadow: var(--shadow-lg);
  color: #ffffff;
}
[data-theme="light"] .toast__body,
[data-theme="light"] .toast__close {
  color: color-mix(in oklab, #ffffff 72%, transparent);
}

/* Footer: Muted */
[data-theme="light"] .footer-row { color: #94a3b8; }

/* Empty states */
[data-theme="light"] .empty-state--inviting { color: #64748b; }

/* Hero-Gradient */
[data-theme="light"] .hero-gradient {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ─── 2. Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; }

*:focus-visible {
  outline: 2px solid rgba(59,130,246,0.6);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  margin: 0;
  padding: var(--space-4);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Twemoji fallback images (injected when native emoji font missing, e.g. iOS Simulator) */
img.tw-emoji {
  height: 1.2em;
  width: 1.2em;
  margin: 0 0.05em 0 0.1em;
  vertical-align: -0.2em;
  display: inline-block;
  pointer-events: none;
}

/* ─── 3. Shell Layout ─── */
.card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-4);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  min-height: calc(100vh - var(--space-8));
}

/* Ambient glow – deaktiviert (Clean-First, weniger Vibe-Code) */
.card::before,
.card::after {
  content: none;
  display: none;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  gap: var(--gap);
  min-height: calc(100vh - var(--space-8) - var(--space-8));
}
.shell.is-collapsed {
  grid-template-columns: var(--sb-w-sm) 1fr;
}

/* ─── 4. Sidebar ─── */
.sidebar {
  position: sticky;
  top: var(--space-4);          /* Kleiner Abstand vom oberen Viewport-Rand */
  height: calc(100dvh - var(--space-4) * 2);   /* Definite Höhe = Scroll funktioniert */
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow: hidden;             /* Fallback für ältere Browser */
  overflow: clip;               /* Kein Scroll-Container → Touch-Scroll der Kinder ungehindert */
  transition: width var(--dur-slow) var(--ease);
  align-self: start;            /* Grid: Sidebar dehnt sich nicht auf Content-Höhe */
}

/* Theme Icon */
.theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

/* Sidebar Footer (Theme + Sprache) */
.sb__footer {
  flex-shrink: 0;      /* Bleibt immer sichtbar am unteren Rand */
  padding-top: var(--space-2);
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.sb__footer-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  transition: background var(--dur), color var(--dur);
  white-space: nowrap;
  overflow: hidden;
}
.sb__footer-btn .ic {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb__footer-btn .tx {
  opacity: 1;
  transition: opacity var(--dur-slow);
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb__footer-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
/* Collapsed: Text ausblenden */
.shell.is-collapsed .sb__footer-btn .tx { opacity: 0; width: 0; }
[data-theme="light"] .sb__footer { border-top-color: #e2e8f0; }
[data-theme="light"] .sb__footer-btn { color: #64748b; }
[data-theme="light"] .sb__footer-btn:hover { background: #f1f5f9; color: #0f172a; }

/* Toggle */
.sb__toggle {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  border: 1px solid var(--glass-border);
  background: rgba(15,23,42,0.8);
  color: var(--text-muted);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  z-index: 2;
}
.sb__toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(30,41,59,0.9);
}
.sb__toggle svg {
  width: 15px;
  height: 15px;
  transition: transform var(--dur) var(--ease);
}
.sidebar[data-collapsed="true"] .sb__toggle svg {
  transform: rotate(180deg);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  margin-right: 40px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  transition: background var(--dur) var(--ease);
}
.brand:hover { background: rgba(255,255,255,0.05); }
.brand img {
  height: 36px;
  width: 36px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow-sm);
}
.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.brand__name {
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text-primary);
  white-space: nowrap;
}
.brand__name strong {
  font-weight: 700;
  font-style: normal;
}
.brand__name em {
  font-style: italic;
  font-weight: 400;
}

/* Badges unterhalb des Namens (PRO, Coach, …) */
.brand__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
}

/* Pro-Patch */
.pro-patch {
  display: inline-block;
  padding: 1px 7px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-primary);
  background: var(--brand-gradient-btn);
  border-radius: var(--pill);
  box-shadow: 0 1px 4px rgba(59,130,246,0.3);
}

a.brand, a.brand:link, a.brand:visited,
a.brand:hover, a.brand:active {
  color: var(--text-primary);
  text-decoration: none;
}

/* Nav */
nav.sb {
  position: relative;
  margin-top: var(--space-2);
  flex: 1 1 0;         /* flex-basis: 0 → definite size for overflow to work */
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,120,180,.25) transparent;
}
nav.sb::-webkit-scrollbar { width: 3px; }
nav.sb::-webkit-scrollbar-thumb { background: rgba(99,120,180,.25); border-radius: 2px; }
nav.sb::-webkit-scrollbar-track { background: transparent; }

.sb__list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-1);
  margin: 0;
  list-style: none;
}

/* Sidebar-Trennlinie (wie Coach-Portal: oberhalb Profil / Account-Bereich) */
.sb__sep {
  list-style: none;
  margin: 0.45rem 0.6rem;
  height: 1px;
  background: rgba(148, 163, 184, 0.14);
  pointer-events: none;
}
[data-theme="light"] .sb__sep {
  background: var(--border);
}

.sb__indicator {
  position: absolute;
  left: var(--space-1);
  top: 0;
  width: calc(100% - var(--space-2));
  height: 42px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  border: 1px solid rgba(59,130,246,0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), var(--shadow-glow-sm);
  transition: transform 180ms var(--ease), height 180ms var(--ease), opacity 180ms var(--ease);
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.sb__link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px var(--space-3);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid transparent;
  font-size: 0.88rem;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.sb__link .ic {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  transition: all var(--dur-fast) var(--ease);
}
.sb__link .ic svg { width: 17px; height: 17px; }
.sb__link .tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb__link:hover { color: var(--text-primary); }
.sb__link:hover .ic { border-color: var(--border-hover); background: rgba(255,255,255,0.06); }
.sb__link.is-active { color: var(--primary-hover); font-weight: 600; }
.sb__link.is-active .ic {
  border-color: rgba(59,130,246,0.3);
  background: var(--primary-soft);
  box-shadow: var(--shadow-glow-sm);
}

.sb__link.danger { color: #fca5a5; }
.sb__link.danger .ic { border-color: rgba(248,113,113,0.2); background: rgba(239,68,68,0.06); }

.sb__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--on-primary);
  background: var(--primary);
  border-radius: 999px;
  vertical-align: middle;
  box-shadow: 0 0 0 2px var(--bg-card);
  line-height: 1;
}
.sb__link.danger:hover { color: var(--on-primary); background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); }
.sb__link--pro .ic { border-color: rgba(34,197,94,0.25); }
.sb__link--pro:hover .ic { border-color: rgba(34,197,94,0.4); }

/* Mobile Header (nur auf kleinen Bildschirmen sichtbar) */
.mobile-header {
  display: none;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: nowrap;
  min-width: 0;
}
.mobile-header__brand {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  text-decoration: none;
  min-width: 0;
  flex: 1 1 auto;
}
.mobile-header__brand strong { font-weight: 700; font-style: normal; }
.mobile-header__brand em { font-style: italic; font-weight: 400; }

/* Collapsed state */
.sidebar[data-collapsed="true"] { width: var(--sb-w-sm); }
.sidebar[data-collapsed="true"] .brand { justify-content: center; padding: var(--space-2); margin-right: 0; }
.sidebar[data-collapsed="true"] nav.sb { margin-top: var(--space-4); }
.sidebar[data-collapsed="true"] .sb__list { gap: var(--space-2); padding-inline: var(--space-1); }
.sidebar[data-collapsed="true"] .sb__link { justify-content: center; padding: var(--space-2); }
.sidebar[data-collapsed="true"] .brand__name,
.sidebar[data-collapsed="true"] .brand__badges .pro-patch,
.sidebar[data-collapsed="true"] .brand .b-1,
.sidebar[data-collapsed="true"] .brand .b-2,
.sidebar[data-collapsed="true"] .sb__link .tx { display: none; }
.sidebar[data-collapsed="true"] .sb__indicator { opacity: 0; pointer-events: none; }

/* ─── 5. Content Area ─── */
.content {
  background: linear-gradient(180deg, rgba(10,15,30,0.7), rgba(10,15,30,0.5));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}

.brandline {
  font-size: 0.73rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

/* Toolbox & Analyse: volle Breite des Content-Bereichs nutzen */
.toolbox-page-head,
.analyse-page-head {
  width: 100%;
  box-sizing: border-box;
}
.toolbox-page-head__title,
.analyse-page-head__title {
  margin-top: var(--space-4);
  color: var(--text-primary);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
[data-theme="light"] .toolbox-page-head__title,
[data-theme="light"] .analyse-page-head__title {
  color: #0f172a;
}
.analyse-page-head__intro {
  margin: var(--space-2) 0 0;
  max-width: 42rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-muted);
}
[data-theme="light"] .analyse-page-head__intro {
  color: #64748b;
}
.toolbox-page-head__lead {
  display: block;
  margin-top: var(--space-2);
  font-size: 0.92em;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
  line-height: 1.35;
}
[data-theme="light"] .toolbox-page-head__lead {
  color: #64748b;
}
h1 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
  max-width: 560px;
  line-height: 1.65;
}
.main-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  flex: 1;
  min-width: 0;
}

/* ─── 6. Forms & Inputs ─── */
form { margin-top: var(--space-3); }

.section {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.section-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary-hover);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.section-label .log-confidential-badge {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0.7;
}

label {
  display: block;
  margin-top: var(--space-3);
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-main);
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  margin-top: var(--space-1);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.9rem;
  font-family: var(--font);
  background: rgba(255,255,255,0.03);
  color: var(--text-main);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
/* Native Datums-/Zeitfelder: hohe intrinsische Mindestbreite (v. a. iOS) → sonst Überlauf trotz width:100% */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-hover); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(59,130,246,0.45);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08), var(--shadow-glow-sm);
  background: rgba(255,255,255,0.04);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
select option {
  background: #1e293b;
  color: #f1f5f9;
}

/* iOS-Zoom verhindern: Formularfelder auf Touch-/Mobilbreiten >=16px halten.
   !important, weil zahlreiche Seiten-CSS Inputs spezifischer auf <16px setzen. */
@media (max-width: 980px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-5); }
.hint { font-size: 0.78rem; color: var(--text-dim); margin-top: var(--space-1); }

.checkbox-row { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; }
.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  font-size: 0.82rem;
  transition: border-color var(--dur-fast) var(--ease);
}
.checkbox-pill:hover { border-color: var(--border-hover); }
.checkbox-pill input { width: auto; margin: 0; }

.sport-section { display: none; margin-top: var(--space-3); padding: var(--space-3); border-radius: var(--radius); background: rgba(59,130,246,0.04); border: 1px solid rgba(59,130,246,0.15); }
.sport-section.active { display: block; }
.sport-section-title { font-size: 0.84rem; font-weight: 600; margin-bottom: var(--space-2); color: var(--primary-hover); }

/* Primary button */
button[type="submit"] {
  margin-top: var(--space-6);
  padding: 12px 24px;
  border-radius: var(--pill);
  border: none;
  background: var(--brand-gradient-btn);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(59,130,246,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
  transition: all var(--dur) var(--ease);
}
button[type="submit"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent 50%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-brand), inset 0 1px 0 rgba(255,255,255,0.2);
}
button[type="submit"]:hover::before { opacity: 1; }
button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(59,130,246,0.15);
}
button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Sidebar-Logout: globaler Submit-Gradient gilt nicht (.sb__link wie andere Nav-Einträge) */
button[type="submit"].sb__link {
  margin-top: 0;
  padding: 8px var(--space-3);
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: inherit;
  font-size: 0.88rem;
  box-shadow: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  overflow: visible;
  text-align: left;
}
button[type="submit"].sb__link::before {
  display: none;
}
button[type="submit"].sb__link:hover {
  transform: none;
  box-shadow: none;
}
button[type="submit"].sb__link:active {
  transform: none;
  box-shadow: none;
}
button[type="submit"].sb__link.danger {
  color: #fca5a5;
}
button[type="submit"].sb__link.danger:hover {
  color: var(--on-primary);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}
[data-theme="light"] button[type="submit"].sb__link {
  color: #334155;
}
[data-theme="light"] button[type="submit"].sb__link:hover {
  color: #0f172a;
}
[data-theme="light"] button[type="submit"].sb__link.danger {
  color: #dc2626;
}

/* ─── Unified .btn System (player + coach portal) ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: var(--pill);
  border: 1px solid transparent;
  padding: .6rem 1.25rem;
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: all .18s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn--primary {
  color: var(--on-primary);
  background: var(--brand-gradient-btn);
  box-shadow: 0 6px 20px color-mix(in oklab, var(--primary) 30%, transparent), inset 0 1px 0 color-mix(in oklab, var(--on-primary) 15%, transparent);
}
.btn--primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px color-mix(in oklab, var(--primary) 42%, transparent), inset 0 1px 0 color-mix(in oklab, var(--on-primary) 20%, transparent);
  color: var(--on-primary);
}
.btn--primary:active { transform: translateY(0); }
.btn--ghost {
  color: var(--text-main);
  border-color: var(--surface-border, rgba(148,163,184,.25));
  background: var(--surface-raised, rgba(30,41,59,.6));
}
.btn--ghost:hover {
  border-color: var(--surface-border-hover, color-mix(in oklab, var(--text-muted) 45%, transparent));
  background: color-mix(in oklab, var(--text-muted) 12%, transparent);
}
.btn--danger {
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 25%, transparent);
  background: var(--danger-soft);
}
.btn--danger:hover { background: color-mix(in oklab, var(--danger) 15%, var(--surface)); }
.btn--sm { padding: .4rem .85rem; font-size: .82rem; }
.btn--lg { padding: .75rem 1.6rem; font-size: 1rem; }
.btn--full { width: 100%; }
.btn:disabled,
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; filter: none !important; }

/* ─── 7. Components ─── */
.analysis-box {
  margin-top: var(--space-6);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 5%, transparent), color-mix(in oklab, var(--secondary) 3%, transparent));
  border: 1px solid color-mix(in oklab, var(--primary) 18%, transparent);
  box-shadow: var(--shadow-md), var(--shadow-glow-sm);
}
.analysis-box h2 { margin: 0 0 var(--space-2); font-size: 1.05rem; }
.analysis-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: var(--space-2); }
.analysis-body { font-size: 0.9rem; color: var(--text-main); line-height: 1.55; }
.analysis-body p { margin: var(--space-3) 0 var(--space-1); }
.analysis-body p strong { font-size: 0.84rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-hover); }
.analysis-body ul { margin: var(--space-1) 0 var(--space-2) 1.1rem; padding: 0; }
.analysis-body li { margin-bottom: var(--space-1); }

.error-box {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--danger-soft);
  border: 1px solid color-mix(in oklab, var(--danger) 25%, transparent);
  color: color-mix(in oklab, var(--danger) 78%, var(--text-main));
  border-radius: var(--radius);
  font-size: 0.85rem;
}

/* ─── Consent-Needed Card ─── */
.consent-needed-card {
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(59,130,246,0.06), rgba(212,168,48,0.04));
  border: 1px solid rgba(59,130,246,0.18);
  box-shadow: var(--shadow-md), var(--shadow-glow-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.consent-needed-card--compact {
  padding: var(--space-5) var(--space-4);
  gap: var(--space-2);
}
.consent-needed-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: var(--space-1);
}
.consent-needed-card--compact .consent-needed-card__icon {
  width: 44px;
  height: 44px;
}
.consent-needed-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.consent-needed-card__text {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.5;
  margin: 0;
}
.consent-needed-card__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 28px;
  border-radius: var(--pill);
  border: none;
  background: var(--brand-gradient-btn);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(59,130,246,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
  margin-top: var(--space-2);
}
.consent-needed-card__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent 50%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.consent-needed-card__btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-brand), inset 0 1px 0 rgba(255,255,255,0.2);
}
.consent-needed-card__btn:hover::before { opacity: 1; }
.consent-needed-card__btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(59,130,246,0.15);
}
.consent-needed-card__hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0;
}
[data-theme="light"] .consent-needed-card {
  background: linear-gradient(135deg, rgba(59,130,246,0.04), rgba(212,168,48,0.03));
  border-color: rgba(59,130,246,0.15);
}
[data-theme="light"] .consent-needed-card__btn {
  color: var(--on-primary);
}

/* Legal (Datenschutz, Impressum, AGB) */
.page-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}
.legal-content {
  max-width: 640px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-main);
}
.legal-intro {
  margin-bottom: var(--space-8);
  color: var(--text-muted);
}
.legal-section {
  margin-bottom: var(--space-8);
}
.legal-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
}
.legal-section p { margin: 0 0 var(--space-3); }
.legal-section ul {
  margin: var(--space-2) 0;
  padding-left: var(--space-6);
}
.legal-section li { margin-bottom: var(--space-1); }
.legal-section a { color: var(--primary); text-decoration: none; }
.legal-section a:hover { text-decoration: underline; }
.legal-updated {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: var(--space-8);
}

/* Error pages (404, 500) */
.error-page-content {
  max-width: 480px;
  padding: var(--space-6);
}
.error-page-text {
  margin-bottom: var(--space-5);
  color: var(--text-muted);
  line-height: 1.6;
}
.error-page-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.error-page-actions .lp-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: filter 0.2s, transform 0.15s;
}
.error-page-actions .lp-btn--primary {
  background: var(--brand-gradient-btn);
  color: white;
  border: none;
}
.error-page-actions .lp-btn--primary:hover {
  filter: brightness(1.1);
}
.error-page-actions .lp-btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.error-page-actions .lp-btn--ghost:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ─── Cookie-Consent Modal (GDPR, professional) ─── */
#cookieModal.cm {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: var(--z-cookie-modal);
  padding: 0 var(--space-4) var(--space-4);
  animation: cm-in 0.25s ease both;
}
@keyframes cm-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#cookieModal .cm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#cookieModal .cm__card {
  position: relative;
  width: 100%;
  max-width: 960px;
  background: var(--surface-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px 32px 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
  animation: cm-slide 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes cm-slide {
  from { transform: translateY(32px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Header */
.cm__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.cm__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(16,185,129,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(59,130,246,0.2);
}
.cm__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
  line-height: 1.3;
}
.cm__subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}
.cm__text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 16px;
}
.cm__text strong { color: var(--text-primary); font-weight: 600; }

/* Trust row */
.cm__trust {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.cm__trust-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 4px 10px;
}
.cm__trust-item svg { opacity: 0.7; flex-shrink: 0; }

/* Buttons */
/* Auf breitem Banner: Header/Text links, Buttons rechts */
#cookieBannerLayer1 {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
#cookieBannerLayer1 .cm__header { margin-bottom: 6px; flex-shrink: 0; }
#cookieBannerLayer1 .cm__text { margin-bottom: 8px; }
.cm__banner-left {
  flex: 1;
  min-width: 260px;
}
.cm__banner-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
  flex-shrink: 0;
}
.cm__banner-right .cm__btn { margin-bottom: 0; width: 100%; }
.cm__banner-right .cm__row { margin-bottom: 0; }
.cm__banner-right .cm__footer-note { text-align: center; }

.cm__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 12px;
  font-size: 0.97rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 0.15s ease, filter 0.15s ease;
  margin-bottom: 8px;
}
.cm__btn:active { transform: scale(0.98); }

.cm__btn--primary {
  background: var(--brand-gradient-btn);
  color: var(--on-primary);
  box-shadow: 0 4px 18px rgba(59,130,246,0.35);
}
.cm__btn--primary:hover {
  box-shadow: 0 6px 24px rgba(59,130,246,0.5);
  filter: brightness(1.06);
}

.cm__btn--ghost {
  flex: 1;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--glass-border);
  font-size: 0.88rem;
  padding: 10px 14px;
  margin-bottom: 0;
}
.cm__btn--ghost:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.cm__row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.cm__footer-note {
  text-align: center;
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.cm__footer-note a { color: var(--primary); text-decoration: none; }
.cm__footer-note a:hover { text-decoration: underline; }

/* Back button */
.cm__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font);
  padding: 0;
  margin-bottom: 4px;
  transition: color 0.15s;
}
.cm__back:hover { color: var(--primary); }

/* Toggle list */
.cm__toggle-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 16px 0 20px;
}
.cm__toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cm__toggle-item:hover { background: var(--primary-soft); border-color: rgba(59,130,246,0.2); }
.cm__toggle-item--locked {
  cursor: default;
  opacity: 0.8;
}
.cm__toggle-item--locked:hover { background: var(--glass-bg); border-color: var(--glass-border); }
.cm__toggle-info { flex: 1; min-width: 0; }
.cm__toggle-name { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.cm__toggle-desc { display: block; font-size: 0.8rem; color: var(--text-dim); margin-top: 1px; }

.cm__always-on {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary);
  background: var(--secondary-soft);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* Toggle switch */
.cm__switch { flex-shrink: 0; display: flex; align-items: center; }
.cm__switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.cm__switch-track {
  display: block;
  width: 46px;
  height: 26px;
  flex: 0 0 46px;
  background: var(--glass-border);
  border-radius: var(--pill);
  position: relative;
  overflow: hidden;
  transition: background var(--dur) var(--ease);
}
.cm__switch-track::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: var(--on-primary);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: transform 0.22s var(--ease-spring);
}
.cm__switch-input:checked + .cm__switch-track {
  background: var(--brand-gradient-btn);
}
.cm__switch-input:checked + .cm__switch-track::after {
  transform: translateX(20px);
}

/* Light mode adjustments */
[data-theme="light"] .cm__card {
  background: #ffffff;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

/* Mobile: full-width, sits at bottom */
@media (max-width: 540px) {
  #cookieModal.cm { padding: 0 0 0; align-items: flex-end; }
  #cookieModal .cm__card {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

/* ─── 8. Toast & Progress ─── */
.toast-wrap {
  position: fixed;
  top: calc(var(--space-4) + env(safe-area-inset-top, 0px));
  right: calc(var(--space-4) + env(safe-area-inset-right, 0px));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: min(92vw, 380px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: 0.88rem;
  line-height: 1.5;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  pointer-events: auto;
  animation: toast-in var(--dur-slow) var(--ease) both;
}
.toast--js { cursor: default; }
.toast.is-leaving { opacity: 0; transform: translateY(-4px); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.toast.info    { border-color: color-mix(in oklab, var(--primary) 35%, transparent); }
.toast.success { border-color: color-mix(in oklab, var(--secondary) 35%, transparent); }
.toast.error   { border-color: color-mix(in oklab, var(--danger) 35%, transparent); }
.toast.warning { border-color: color-mix(in oklab, var(--warning) 35%, transparent); }
.toast__content { flex: 1; min-width: 0; }
.toast__content--link { cursor: pointer; }
.toast__title { font-weight: 600; font-size: var(--text-md); }
.toast__body { font-size: var(--text-sm); color: var(--text-muted); }
.toast--flash .toast__body { color: inherit; font-size: 0.88rem; }
.toast__actions { margin-top: var(--space-2); }
.toast__action { min-height: 44px; }
.toast__close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: calc(var(--space-2) * -1) calc(var(--space-2) * -1) calc(var(--space-2) * -1) 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
}

.route-progress {
  position: fixed;
  top: var(--app-top-inset);
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--brand-gradient-btn);
  box-shadow: var(--shadow-glow-brand);
  z-index: var(--z-route-progress);
  transition: width 0.25s var(--ease), opacity 0.3s var(--ease);
  opacity: 0;
  pointer-events: none;
}

.route-pending {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-route-progress) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  background: color-mix(in oklab, var(--bg) 94%, transparent);
  padding: var(--app-top-inset) var(--app-side-inset-right) var(--app-tab-bar-total-h) var(--app-side-inset-left);
}

html.is-route-pending .route-pending {
  visibility: visible;
  opacity: 1;
}

.route-pending__mark {
  width: 80px;
  height: 80px;
  transform: scale(0.86);
  transition: transform var(--dur) var(--ease);
}

html.is-route-pending .route-pending__mark {
  transform: scale(1);
}

.route-pending__logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22%;
  object-fit: cover;
  box-shadow: var(--shadow-glow-brand);
}

html.is-route-pending .route-pending__logo {
  animation: routePendingBreathe 900ms var(--ease-in-out, ease-in-out) infinite alternate;
}

@keyframes routePendingBreathe {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .route-pending__mark {
    transform: none;
    transition-delay: 0ms;
  }
  html.is-route-pending .route-pending__mark {
    transform: none;
  }
  html.is-route-pending .route-pending__logo {
    animation: none;
  }
}

.toast-root {
  position: fixed;
  top: calc(var(--space-5) + env(safe-area-inset-top, 0px));
  right: var(--space-5);
  bottom: auto;
  left: auto;
  z-index: var(--z-toast-root);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}
.toast-root > .toast { pointer-events: auto; }

/* ─── 9. Accessibility ─── */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus {
  left: var(--space-4); top: var(--space-4); width: auto; height: auto;
  padding: var(--space-2) var(--space-4); z-index: var(--z-toast-root);
  background: var(--surface-elevated); color: var(--text-primary);
  border: 1px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* ─── 10. Footer ─── */
.footer-row { display: none; } /* ersetzt durch site-footer */


/* ─── Icon system (mm-icon) ───
   Ionicons enthält Outline- und Solid-SVGs. Fill/Stroke wird direkt
   vom jeweiligen SVG-Body gesetzt; CSS steuert nur Größe und Farbe. */
.mm-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  color: inherit;
}
.mm-icon--xs { width: 12px; height: 12px; }
.mm-icon--sm { width: 14px; height: 14px; }
.mm-icon--md { width: 17px; height: 17px; }
.mm-icon--lg { width: 24px; height: 24px; }
.mm-icon--xl { width: 32px; height: 32px; opacity: 0.5; }

.mm-icon--missing {
  color: var(--warning);
  opacity: 0.85;
}

.mm-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.mm-icon-wrap--soft {
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.mm-icon-wrap--sm { width: 28px; height: 28px; }
.mm-icon-wrap--md { width: 36px; height: 36px; }
.mm-icon-wrap--lg { width: 48px; height: 48px; border-radius: var(--radius); }

/* ─── 10b. Empty States ─── */
.empty-state--inviting {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-6);
  color: var(--text-muted);
}
.empty-state--inviting p { margin: 0; line-height: 1.6; }
.empty-state--inviting strong { color: var(--text-primary); }
.empty-state__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
  color: var(--text-dim);
}
.empty-state__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--brand-gradient-btn);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--pill);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(59,130,246,0.2);
}
.empty-state__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(59,130,246,0.3);
}

/* ─── Mobile Navigation ─── */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mobile-menu-btn:hover,
.mobile-menu-btn:focus {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--border-active);
  outline: none;
}
.mobile-header {
  flex-shrink: 0;
}
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: var(--z-mobile-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.mobile-backdrop.is-visible {
  opacity: 1;
  pointer-events: all;
}

/* ─── 11. Responsive ─── */

/* Tablet + Mobile: Sidebar als Slide-in Overlay ab 980px */
@media (max-width: 980px) {
  .shell, .shell.is-collapsed { grid-template-columns: 1fr; z-index: auto; }

  .sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100dvh;
    z-index: var(--z-sidebar-mobile);
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    transition: left 0.3s var(--ease), box-shadow 0.3s var(--ease);
    overflow: hidden;
  }
  .sidebar nav.sb {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }
  .sidebar.is-mobile-open {
    left: 0;
    box-shadow: var(--shadow-xl);
  }
  /* Collapsed-State auf Tablet/Mobile ignorieren – immer voll anzeigen */
  .sidebar[data-collapsed="true"] { width: 280px; }
  .sidebar[data-collapsed="true"] .brand { justify-content: flex-start; padding: var(--space-2) var(--space-3); margin-right: 40px; }
  .sidebar[data-collapsed="true"] nav.sb { margin-top: 0; }
  .sidebar[data-collapsed="true"] .sb__list { gap: var(--space-1); padding-inline: 0; }
  .sidebar[data-collapsed="true"] .sb__link { justify-content: flex-start; padding: var(--space-2) var(--space-3); }
  .sidebar[data-collapsed="true"] .brand__name,
  .sidebar[data-collapsed="true"] .brand__badges,
  .sidebar[data-collapsed="true"] .brand .b-1,
  .sidebar[data-collapsed="true"] .brand .b-2,
  .sidebar[data-collapsed="true"] .sb__link .tx { display: unset; opacity: 1; width: auto; }
  .sidebar[data-collapsed="true"] .sb__indicator { opacity: 0.85; pointer-events: all; }
  .sb__toggle { display: none; }

  .mobile-menu-btn { display: flex; }
  .mobile-header { display: flex; padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
  .mobile-backdrop { display: block; }

  /* iOS Safe-Area (Capacitor/PWA mit viewport-fit=cover): Inhalt nicht unter Notch/Home-Indicator */
  body {
    padding-top: calc(var(--space-4) + env(safe-area-inset-top, 0px));
    padding-right: calc(var(--space-4) + env(safe-area-inset-right, 0px));
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
    padding-left: calc(var(--space-4) + env(safe-area-inset-left, 0px));
  }
  .sidebar { padding-top: env(safe-area-inset-top, 0px); }
}
@media (max-width: 768px) {
  .content { padding: var(--space-4); }
  body {
    padding: calc(var(--space-2) + env(safe-area-inset-top, 0px))
             calc(var(--space-2) + env(safe-area-inset-right, 0px))
             calc(var(--space-2) + env(safe-area-inset-bottom, 0px))
             calc(var(--space-2) + env(safe-area-inset-left, 0px));
  }
  .card { padding: var(--space-2); border-radius: var(--radius-lg); }
  h1 { font-size: 1.4rem; }
  .page-top { padding-bottom: var(--space-3); }
}
@media (max-width: 640px) {
  body {
    padding: calc(var(--space-1) + env(safe-area-inset-top, 0px))
             calc(var(--space-1) + env(safe-area-inset-right, 0px))
             calc(var(--space-1) + env(safe-area-inset-bottom, 0px))
             calc(var(--space-1) + env(safe-area-inset-left, 0px));
  }
  .card { padding: var(--space-1); border-radius: var(--radius); }
  .content { padding: var(--space-3); gap: var(--space-3); }
  h1 { font-size: 1.25rem; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .footer-row { flex-direction: column; text-align: center; gap: var(--space-1); }
}

/* Zusätzlicher Team-Badge-Stil in der Coach-Section */
.cp__team-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font-size: .68rem; font-weight: 800;
  background: var(--danger); color: var(--on-primary); border-radius: 999px;
  margin-left: 8px;
}
/* Team-Info-Card */
.cp__team-info-card {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-xl);
  border: 1px solid color-mix(in oklab, var(--primary) 25%, transparent);
  background: color-mix(in oklab, var(--primary) 6%, var(--surface));
}
.cp__team-info-icon {
  width: 44px; height: 44px; border-radius: var(--radius-lg); flex-shrink: 0;
  background: color-mix(in oklab, var(--primary) 15%, transparent);
  color: var(--primary); display: grid; place-items: center;
}
.cp__team-info-name { font-size: 1rem; font-weight: 700; }
.cp__team-info-meta { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.cp__checkin-card--past { opacity: .7; }
.cp__checkin-my-score { font-size: .8rem; color: var(--primary); font-weight: 600; }
/* ── Site Footer ─────────────────────────── */
.site-footer {
  margin-top: var(--space-8, 40px);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px;
  padding: 32px 24px 28px;
  max-width: 960px;
}
.site-footer__brand {
  flex: 0 0 200px;
}
.site-footer__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 400;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.site-footer__logo strong { font-weight: 700; font-style: normal; }
.site-footer__logo em { font-style: italic; font-weight: 400; }
.site-footer__logo img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.site-footer__tagline {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}
.site-footer__cols {
  display: flex;
  gap: 36px;
  flex: 1;
}
.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 90px;
}
.site-footer__col-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.site-footer__col a {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--dur-fast, 0.15s);
}
.site-footer__col a:hover { color: var(--primary-hover); }

.site-footer__disclaimer {
  flex: 0 0 100%;
  width: 100%;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.site-footer__disclaimer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer__disclaimer a:hover {
  color: var(--text-muted);
}

[data-theme="light"] .site-footer__disclaimer {
  border-color: #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .site-footer {
  background: #f8fafc;
  border-color: #e2e8f0;
}

@media (max-width: 680px) {
  .site-footer__inner {
    flex-direction: column;
    gap: 24px;
    padding: 24px 18px 20px;
  }
  .site-footer__brand { flex: none; }
  .site-footer__cols { gap: 24px; }
}

/* ─── Hub-Nav (Analyse, Toolbox) – Karten-Navigation ─── */
.hub-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.hub-nav__card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.25s var(--ease);
  cursor: pointer;
}
.hub-nav__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 0%, rgba(59,130,246,0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}
.hub-nav__card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: var(--brand-gradient-btn);
  opacity: 0;
  transition: opacity 0.25s;
}
.hub-nav__card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm), var(--shadow-glow-sm);
}
.hub-nav__card:hover::before { opacity: 1; }
.hub-nav__card.is-active {
  border-color: rgba(59,130,246,0.4);
  background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(16,185,129,0.05) 100%);
  box-shadow: var(--shadow-md), 0 0 24px rgba(59,130,246,0.12);
}
.hub-nav__card.is-active::before { opacity: 1; }
.hub-nav__card.is-active::after { opacity: 1; }

.hub-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  flex-shrink: 0;
  transition: all 0.25s var(--ease);
}
.hub-nav__icon svg {
  width: 20px;
  height: 20px;
}
.hub-nav__card:hover .hub-nav__icon {
  color: var(--primary);
  border-color: rgba(59,130,246,0.3);
  background: var(--primary-soft);
}
.hub-nav__card.is-active .hub-nav__icon {
  background: var(--brand-gradient-btn);
  border-color: transparent;
  color: var(--on-primary);
  box-shadow: 0 2px 12px rgba(59,130,246,0.35);
}

.hub-nav__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.hub-nav__label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.2s;
}
.hub-nav__card.is-active .hub-nav__label {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hub-nav__desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Light Mode */
[data-theme="light"] .hub-nav__card {
  background: #fff;
  border-color: #e2e8f0;
  backdrop-filter: none;
}
[data-theme="light"] .hub-nav__card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
[data-theme="light"] .hub-nav__card.is-active {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, rgba(37,99,235,0.06) 0%, rgba(16,185,129,0.03) 100%);
  box-shadow: 0 4px 20px rgba(37,99,235,0.1);
}
[data-theme="light"] .hub-nav__icon {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}
[data-theme="light"] .hub-nav__card:hover .hub-nav__icon {
  background: rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.2);
  color: #2563eb;
}
[data-theme="light"] .hub-nav__card.is-active .hub-nav__icon {
  background: linear-gradient(135deg, #2563eb, #059669);
  border-color: transparent;
  color: var(--on-primary);
}
[data-theme="light"] .hub-nav__label { color: #0f172a; }
[data-theme="light"] .hub-nav__desc { color: #64748b; }

/* Responsive */
@media (max-width: 540px) {
  .hub-nav {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .hub-nav__card {
    padding: var(--space-3) var(--space-4);
  }
  .hub-nav__icon {
    width: 36px;
    height: 36px;
  }
  .hub-nav__icon svg { width: 18px; height: 18px; }
}

/* ─── Portal-Tabs: einheitliche horizontale Navigation (Spieler + Coach)
     Aktivzustand: Logo-Farben (Blau → Teal → Gold, --brand-gradient-btn) ─── */
.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
/* Kompakte Zeile (z. B. Coach-Section-Nav) */
.portal-tabs--compact {
  margin-bottom: var(--space-4);
}
.portal-tabs--compact .portal-tabs__tab {
  padding: var(--space-2) var(--space-4);
  font-size: 0.82rem;
}
.portal-tabs--compact .portal-tabs__icon {
  width: 32px;
  height: 32px;
}
.portal-tabs--compact .portal-tabs__icon svg {
  width: 15px;
  height: 15px;
}

a.portal-tabs__tab,
button.portal-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font);
  text-decoration: none !important;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
  margin-bottom: -1px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  cursor: pointer;
  box-sizing: border-box;
}
button.portal-tabs__tab {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  text-align: left;
}
a.portal-tabs__tab:visited {
  color: var(--text-muted);
}
a.portal-tabs__tab:hover,
button.portal-tabs__tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}
a.portal-tabs__tab.is-active,
a.portal-tabs__tab.is-active:visited,
button.portal-tabs__tab.is-active {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  color: var(--text-primary) !important;
  box-shadow: 0 0 0 1px rgba(212, 168, 48, 0.12);
}
/* Logo-Streifen oben am aktiven Tab */
a.portal-tabs__tab.is-active::before,
button.portal-tabs__tab.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--brand-gradient-btn);
  pointer-events: none;
}

.portal-tabs__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.portal-tabs__icon svg {
  width: 18px;
  height: 18px;
}
a.portal-tabs__tab:hover .portal-tabs__icon,
button.portal-tabs__tab:hover .portal-tabs__icon {
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--primary);
  background: var(--primary-soft);
}
a.portal-tabs__tab.is-active .portal-tabs__icon,
button.portal-tabs__tab.is-active .portal-tabs__icon {
  background: var(--brand-gradient-btn);
  border-color: transparent;
  color: var(--on-primary);
  box-shadow: 0 2px 14px rgba(59, 130, 246, 0.3), 0 1px 0 rgba(212, 168, 48, 0.25);
}

.portal-tabs__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.portal-tabs__label {
  display: block;
  line-height: 1.25;
}
.portal-tabs__brief { display: none; }
.portal-tabs__hint {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.2;
}
a.portal-tabs__tab.is-active .portal-tabs__hint,
button.portal-tabs__tab.is-active .portal-tabs__hint {
  color: var(--text-muted);
}

/* Gleichgewichtete Tab-Zeilen: volle Breite (Toolbox Übungen/Routinen, Übungen-Hauptreiter, …) */
.portal-tabs--balanced > a.portal-tabs__tab,
.portal-tabs--balanced > button.portal-tabs__tab {
  flex: 1 1 0;
  min-width: 0;
}

/* Sekundäre Tab-Zeile: weniger Reize, keine Logo-Gradient-Leiste (Hierarchie unter Hub-Tabs) */
.portal-tabs--secondary {
  margin-top: var(--space-5);
  margin-bottom: 0;
  gap: var(--space-1);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.portal-tabs--secondary > a.portal-tabs__tab,
.portal-tabs--secondary > button.portal-tabs__tab {
  flex: 0 1 auto;
  padding: var(--space-2) var(--space-4);
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  gap: var(--space-2);
}
.portal-tabs--secondary > a.portal-tabs__tab.is-active::before,
.portal-tabs--secondary > button.portal-tabs__tab.is-active::before {
  display: none;
}
.portal-tabs--secondary > a.portal-tabs__tab.is-active,
.portal-tabs--secondary > button.portal-tabs__tab.is-active {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  border-bottom-color: transparent;
  color: var(--text-primary) !important;
  box-shadow: inset 0 -2px 0 0 var(--primary);
}
.portal-tabs--secondary > a.portal-tabs__tab.is-active .portal-tabs__icon,
.portal-tabs--secondary > button.portal-tabs__tab.is-active .portal-tabs__icon {
  background: var(--surface-elevated);
  border-color: var(--border);
  color: var(--primary);
  box-shadow: none;
}

/* Badge in Tabs (Zähler) */
.portal-tabs__count,
.ct__tab-count,
.rb__tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--pill);
  margin-left: 4px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(212, 168, 48, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--brand-gold);
}

[data-theme="light"] a.portal-tabs__tab.is-active,
[data-theme="light"] a.portal-tabs__tab.is-active:visited,
[data-theme="light"] button.portal-tabs__tab.is-active {
  background: #ffffff;
  border-color: #e2e8f0;
  border-bottom-color: #ffffff;
  color: #0f172a !important;
  box-shadow: 0 0 0 1px rgba(212, 168, 48, 0.2);
}
[data-theme="light"] .portal-tabs {
  border-bottom-color: #e2e8f0;
}
[data-theme="light"] a.portal-tabs__tab:hover,
[data-theme="light"] button.portal-tabs__tab:hover {
  background: #f8fafc;
}

/* Nach den allgemeinen Light-Tab-Regeln: Sekundärzeile behält dezente Unterstreichung */
[data-theme="light"] .portal-tabs--secondary > a.portal-tabs__tab.is-active,
[data-theme="light"] .portal-tabs--secondary > a.portal-tabs__tab.is-active:visited,
[data-theme="light"] .portal-tabs--secondary > button.portal-tabs__tab.is-active {
  background: #f1f5f9;
  border-color: #e2e8f0;
  border-bottom-color: transparent;
  color: #0f172a !important;
  box-shadow: inset 0 -2px 0 0 #2563eb;
}

@media (max-width: 540px) {
  .portal-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: var(--space-1);
    scrollbar-width: thin;
  }
  a.portal-tabs__tab,
  button.portal-tabs__tab {
    flex: 1 0 auto;
    min-width: min(260px, 88vw);
    padding: var(--space-3) var(--space-4);
  }
  .portal-tabs--balanced a.portal-tabs__tab,
  .portal-tabs--balanced button.portal-tabs__tab {
    flex: 1 1 auto;
    min-width: min(200px, 75vw);
  }
  .portal-tabs--secondary a.portal-tabs__tab,
  .portal-tabs--secondary button.portal-tabs__tab {
    flex: 1 1 0;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
  }
}

/* ========== Pro Paywall Teaser (Blur + Overlay) ========== */
.paywall-shell--locked {
  position: relative;
  isolation: isolate;
  border-radius: inherit;
}
.paywall-shell--locked .paywall-body.is-paywalled {
  filter: blur(7px);
  -webkit-filter: blur(7px);
  pointer-events: none;
  user-select: none;
  opacity: 0.88;
}

.pro-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(0.75rem, 3vh) var(--space-4) var(--space-6);
  pointer-events: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(3, 7, 18, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
[data-theme="light"] .pro-overlay {
  background: rgba(255, 255, 255, 0.5);
}
.pro-overlay__card {
  width: min(100%, 360px);
  margin-inline: auto;
  padding: var(--space-5) var(--space-5);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  text-align: left;
}
.pro-overlay__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-3);
  border-radius: var(--radius);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.pro-overlay__lead {
  margin: 0 0 var(--space-2);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-main);
}
.pro-overlay__lead strong {
  font-weight: 700;
  color: var(--text-primary);
}
.pro-overlay__title {
  margin: 0 0 var(--space-3);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-muted);
}
.pro-overlay__list {
  margin: 0 0 var(--space-4);
  padding: 0 0 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
.pro-overlay__list li {
  margin-bottom: 0.35rem;
}
.pro-overlay__list li:last-child {
  margin-bottom: 0;
}
.pro-overlay__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #fff !important;
  text-decoration: none !important;
  background: var(--brand-gradient-btn);
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.25);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s var(--ease);
}
.pro-overlay__cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.32);
}
.pro-overlay__cta-arrow {
  flex-shrink: 0;
  opacity: 0.95;
}
.pro-overlay__hint {
  margin: var(--space-3) 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-dim);
  text-align: left;
}

/* Sidebar / Tabs: Pro-Hinweis */
.sb__ic-lock {
  position: absolute;
  right: -4px;
  bottom: -3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--surface-elevated);
  border: 1px solid rgba(212, 168, 48, 0.45);
  color: var(--brand-gold);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.sb__ic-lock svg {
  width: 10px;
  height: 10px;
}
.sidebar[data-collapsed="true"] .sb__ic-lock {
  right: -2px;
  bottom: -2px;
}

.portal-tabs__tab--pro .portal-tabs__icon {
  position: relative;
}
.portal-tabs__lock {
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 2;
  display: flex;
  color: var(--brand-gold);
  opacity: 0.95;
  pointer-events: none;
}
.portal-tabs__lock svg {
  width: 11px;
  height: 11px;
}

/* ─── Chip-Scroll: Fade-Indikator für horizontal scrollbare Chip-/Tab-Reihen ───
   Wird durch chip-scroll.js gesteuert (setzt data-scroll-state). Ziel:
   Nutzer erkennen, dass eine Reihe scrollbar ist, statt "hart abgeschnitten"
   als Bug zu lesen (390px-Viewport). Nicht destruktiv – ohne Zustand kein
   Fade, ohne JS bleibt die Reihe scrollbar (page-CSS setzt overflow-x). */
[data-chip-scroll][data-scroll-state="start"] {
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
}
[data-chip-scroll][data-scroll-state="middle"] {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}
[data-chip-scroll][data-scroll-state="end"] {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 100%);
}

/* ── Native App (Capacitor / MentumApp UA) ───────────────── */
/* Edge-to-edge: Safe-Area nur einmal (Shell-Header oben, Tab-Bar unten) */
html.is-native-app {
  scrollbar-gutter: auto;
  /* Portrait: Seiten-Insets auf 0 – WKWebView liefert sonst oft ein
     falsches inset-left und schiebt die ganze Shell nach rechts. */
  --app-side-inset-left: 0px;
  --app-side-inset-right: 0px;
}

@media (orientation: landscape) {
  html.is-native-app {
    --app-side-inset-left: env(safe-area-inset-left, 0px);
    --app-side-inset-right: env(safe-area-inset-right, 0px);
  }
}

html.is-native-app,
body.is-native-app {
  margin: 0 !important;
  padding: 0 !important;
  background: var(--surface) !important;
  overscroll-behavior-y: none;
  min-height: 100dvh;
  min-height: 100svh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}


/* Auth/Onboarding ohne Shell: Safe-Area am Body */
body.is-native-app:not(.has-app-shell):not(.has-coach-app-shell) {
  padding-top: var(--app-top-inset) !important;
  padding-bottom: var(--app-bottom-inset) !important;
}

html.is-native-app body.is-native-app .card,
body.is-native-app .card {
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--surface) !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100dvh;
  min-height: 100svh;
  overflow-x: clip;
}

body.is-native-app .shell {
  gap: 0;
  min-height: inherit;
  width: 100%;
}

body.is-native-app .content {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: var(--space-4);
  gap: var(--space-5);
  flex: 1;
  min-width: 0;
  width: auto;
  max-width: 100%;
  overflow-x: clip;
}

body.is-native-app .page-top {
  padding-bottom: var(--space-4);
}

body.is-native-app .main-area {
  gap: var(--space-6);
}

body.is-native-app .mobile-header {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

body.is-native-app.is-auth .content {
  padding: var(--space-5) var(--space-4);
  justify-content: center;
}

@media (max-width: 640px) {
  body.is-native-app .content {
    padding: var(--space-4);
    gap: var(--space-5);
  }
  body.is-native-app h1 {
    font-size: var(--text-xl);
  }
}

[data-theme="light"] body.is-native-app,
[data-theme="light"] body.is-native-app .card,
[data-theme="light"] body.is-native-app .content {
  background: var(--surface);
}

/* ── Immersive player (Toolbox breathing setup/session) ─── */
body.immersive-player {
  padding: 0;
}

body.immersive-player .app-tab-bar,
body.immersive-player .app-shell-header,
body.immersive-player .sidebar,
body.immersive-player .mobile-header,
body.immersive-player .mobile-backdrop {
  display: none !important;
}

/* Sidebar aus = erste Grid-Spalte darf nicht als 256px-Rest stehen bleiben. */
body.immersive-player .shell,
body.immersive-player .shell.is-collapsed {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: 100dvh;
}

body.immersive-player.has-app-shell .content {
  padding-bottom: var(--space-4);
}

/* ── App Shell (Tab Bar + Header) ─────────────────────────── */
/* Mobile Viewport ODER echte Native-App: Sidebar weg, Tabs an */
@media (max-width: 980px) {
  body.has-app-shell .sidebar,
  body.has-app-shell .mobile-header,
  body.has-app-shell .mobile-backdrop,
  body.has-app-shell .sb__toggle,
  body.has-coach-app-shell .sidebar,
  body.has-coach-app-shell .mobile-header,
  body.has-coach-app-shell .mobile-backdrop,
  body.has-coach-app-shell .sb__toggle {
    display: none !important;
  }

  body.has-app-shell .shell,
  body.has-coach-app-shell .shell {
    grid-template-columns: 1fr;
  }

  body.has-app-shell .content,
  body.has-coach-app-shell .content {
    padding-top: 0;
    padding-bottom: calc(var(--app-fixed-bottom, var(--app-tab-bar-total-h)) + var(--space-4));
  }

  body.has-app-shell .page-top .brandline,
  body.has-app-shell .page-top > h1,
  body.has-app-shell .page-top .subtitle,
  body.has-app-shell .page-top .analyse-page-head__title,
  body.has-app-shell .page-top .analyse-page-head__intro,
  body.has-app-shell .page-top .toolbox-page-head__title,
  body.has-app-shell .mm-cal-top .mm-kicker,
  body.has-app-shell .mm-cal-top-inner > h1,
  body.has-app-shell .mm-cal-top-inner > p:not(.mm-kicker) {
    display: none;
  }
}

body.is-native-app.has-app-shell .sidebar,
body.is-native-app.has-app-shell .mobile-header,
body.is-native-app.has-app-shell .mobile-backdrop,
body.is-native-app.has-app-shell .sb__toggle,
body.is-native-app.has-coach-app-shell .sidebar,
body.is-native-app.has-coach-app-shell .mobile-header,
body.is-native-app.has-coach-app-shell .mobile-backdrop,
body.is-native-app.has-coach-app-shell .sb__toggle {
  display: none !important;
}

body.is-native-app.has-app-shell .shell,
body.is-native-app.has-app-shell .shell.is-collapsed,
body.is-native-app.has-coach-app-shell .shell,
body.is-native-app.has-coach-app-shell .shell.is-collapsed {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0;
  width: 100%;
  max-width: 100%;
}

body.is-native-app.has-app-shell .content,
body.is-native-app.has-coach-app-shell .content {
  padding-top: 0;
  padding-bottom: calc(var(--app-fixed-bottom, var(--app-tab-bar-total-h)) + var(--space-4));
}

body.is-native-app.has-app-shell.is-keyboard-open .content,
body.is-native-app.has-coach-app-shell.is-keyboard-open .content {
  padding-bottom: calc(var(--app-keyboard-inset) + var(--space-4));
}

body.is-native-app.has-app-shell.is-keyboard-open .app-tab-bar,
body.is-native-app.has-coach-app-shell.is-keyboard-open .app-tab-bar {
  transform: translateY(110%);
  pointer-events: none;
  opacity: 0;
}

body.is-native-app.has-app-shell .page-top .brandline,
body.is-native-app.has-app-shell .mm-cal-top .mm-kicker,
body.is-native-app.has-app-shell .tp-hero__brandline {
  display: none;
}

body.is-native-app.has-app-shell .page-top > h1,
body.is-native-app.has-app-shell .page-top .analyse-page-head__title,
body.is-native-app.has-app-shell .page-top .analyse-page-head__intro,
body.is-native-app.has-app-shell .page-top .toolbox-page-head__title,
body.is-native-app.has-app-shell .mm-cal-top-inner > h1,
body.is-native-app.has-app-shell .mm-cal-top-inner > p:not(.mm-kicker),
body.is-native-app.has-app-shell .tp-hero__text > h1,
body.is-native-app.has-app-shell .page-top .subtitle {
  display: none;
}

body.is-native-app.has-app-shell .page-top,
body.is-native-app.has-coach-app-shell .page-top {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: var(--space-1);
}

body.is-native-app.has-app-shell .toolbox-page-head,
body.is-native-app.has-app-shell .analyse-page-head {
  margin-top: 0;
  padding-top: 0;
}

body.is-native-app.has-app-shell .portal-tabs__hint {
  display: none;
}

body.is-native-app.has-app-shell .portal-tabs__full { display: none; }
body.is-native-app.has-app-shell .portal-tabs__brief { display: inline; }

body.is-native-app.has-app-shell .portal-tabs {
  flex-wrap: nowrap;
  align-items: stretch;
  overflow: hidden;
  gap: 3px;
  margin-bottom: var(--space-4);
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.04);
  mask-image: none;
}

body.is-native-app.has-app-shell .portal-tabs::-webkit-scrollbar {
  display: none;
}

body.is-native-app.has-app-shell .portal-tabs > a.portal-tabs__tab,
body.is-native-app.has-app-shell .portal-tabs > button.portal-tabs__tab,
body.is-native-app.has-app-shell .portal-tabs--balanced > a.portal-tabs__tab,
body.is-native-app.has-app-shell .portal-tabs--balanced > button.portal-tabs__tab {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  gap: var(--space-1);
  min-height: 44px;
  margin-bottom: 0;
  padding: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--pill);
  background: transparent;
  box-shadow: none;
  color: var(--text-dim);
  font-size: var(--text-sm);
}

body.is-native-app.has-app-shell .portal-tabs > a.portal-tabs__tab.is-active,
body.is-native-app.has-app-shell .portal-tabs > a.portal-tabs__tab.is-active:visited,
body.is-native-app.has-app-shell .portal-tabs > button.portal-tabs__tab.is-active {
  background: var(--primary-soft);
  border-color: color-mix(in oklab, var(--primary) 38%, var(--border));
  color: var(--text-primary) !important;
  box-shadow: none;
}

body.is-native-app.has-app-shell .portal-tabs > a.portal-tabs__tab.is-active::before,
body.is-native-app.has-app-shell .portal-tabs > button.portal-tabs__tab.is-active::before {
  display: none;
}

body.is-native-app.has-app-shell .portal-tabs__icon:not(:has(.portal-tabs__lock)) {
  display: none;
}

body.is-native-app.has-app-shell .portal-tabs__icon {
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  box-shadow: none;
}

body.is-native-app.has-app-shell .portal-tabs__icon > svg {
  display: none;
}

body.is-native-app.has-app-shell .portal-tabs > a.portal-tabs__tab.is-active .portal-tabs__icon,
body.is-native-app.has-app-shell .portal-tabs > button.portal-tabs__tab.is-active .portal-tabs__icon {
  background: transparent;
  box-shadow: none;
  color: var(--text-dim);
}

body.is-native-app.has-app-shell .portal-tabs__body {
  align-items: center;
  text-align: center;
}

body.is-native-app.has-app-shell .portal-tabs__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="light"] body.is-native-app.has-app-shell .portal-tabs {
  background: var(--surface-elevated);
  border-color: var(--border);
}

[data-theme="light"] body.is-native-app.has-app-shell .portal-tabs > a.portal-tabs__tab.is-active,
[data-theme="light"] body.is-native-app.has-app-shell .portal-tabs > a.portal-tabs__tab.is-active:visited,
[data-theme="light"] body.is-native-app.has-app-shell .portal-tabs > button.portal-tabs__tab.is-active {
  background: var(--primary-soft);
  border-color: color-mix(in oklab, var(--primary) 38%, var(--border));
  color: var(--text-primary) !important;
  box-shadow: none;
}

/* Coach native: gleiche Segment-Pills wie Spieler-Shell */
body.is-native-app.has-coach-app-shell .portal-tabs__hint {
  display: none;
}

body.is-native-app.has-coach-app-shell .portal-tabs {
  flex-wrap: nowrap;
  align-items: stretch;
  overflow: hidden;
  gap: 3px;
  margin-bottom: var(--space-4);
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.04);
  mask-image: none;
}

body.is-native-app.has-coach-app-shell .portal-tabs::-webkit-scrollbar {
  display: none;
}

body.is-native-app.has-coach-app-shell .portal-tabs > a.portal-tabs__tab,
body.is-native-app.has-coach-app-shell .portal-tabs > button.portal-tabs__tab,
body.is-native-app.has-coach-app-shell .portal-tabs--balanced > a.portal-tabs__tab,
body.is-native-app.has-coach-app-shell .portal-tabs--balanced > button.portal-tabs__tab {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  gap: var(--space-1);
  min-height: 44px;
  margin-bottom: 0;
  padding: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--pill);
  background: transparent;
  box-shadow: none;
  color: var(--text-dim);
  font-size: var(--text-sm);
}

body.is-native-app.has-coach-app-shell .portal-tabs > a.portal-tabs__tab.is-active,
body.is-native-app.has-coach-app-shell .portal-tabs > a.portal-tabs__tab.is-active:visited,
body.is-native-app.has-coach-app-shell .portal-tabs > button.portal-tabs__tab.is-active {
  background: var(--primary-soft);
  border-color: color-mix(in oklab, var(--primary) 38%, var(--border));
  color: var(--text-primary) !important;
  box-shadow: none;
}

body.is-native-app.has-coach-app-shell .portal-tabs > a.portal-tabs__tab.is-active::before,
body.is-native-app.has-coach-app-shell .portal-tabs > button.portal-tabs__tab.is-active::before {
  display: none;
}

body.is-native-app.has-coach-app-shell .portal-tabs__icon:not(:has(.portal-tabs__lock)) {
  display: none;
}

body.is-native-app.has-coach-app-shell .portal-tabs__icon {
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  box-shadow: none;
}

body.is-native-app.has-coach-app-shell .portal-tabs__icon > svg {
  display: none;
}

body.is-native-app.has-coach-app-shell .portal-tabs > a.portal-tabs__tab.is-active .portal-tabs__icon,
body.is-native-app.has-coach-app-shell .portal-tabs > button.portal-tabs__tab.is-active .portal-tabs__icon {
  background: transparent;
  box-shadow: none;
  color: var(--text-dim);
}

body.is-native-app.has-coach-app-shell .portal-tabs__body {
  align-items: center;
  text-align: center;
}

body.is-native-app.has-coach-app-shell .portal-tabs__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="light"] body.is-native-app.has-coach-app-shell .portal-tabs {
  background: var(--surface-elevated);
  border-color: var(--border);
}

[data-theme="light"] body.is-native-app.has-coach-app-shell .portal-tabs > a.portal-tabs__tab.is-active,
[data-theme="light"] body.is-native-app.has-coach-app-shell .portal-tabs > a.portal-tabs__tab.is-active:visited,
[data-theme="light"] body.is-native-app.has-coach-app-shell .portal-tabs > button.portal-tabs__tab.is-active {
  background: var(--primary-soft);
  border-color: color-mix(in oklab, var(--primary) 38%, var(--border));
  color: var(--text-primary) !important;
  box-shadow: none;
}

body.is-native-app.has-app-shell .toast-wrap,
body.is-native-app.has-coach-app-shell .toast-wrap {
  top: calc(var(--app-top-inset) + var(--space-2));
}

body.is-native-app.has-app-shell .toast-root,
body.is-native-app.has-coach-app-shell .toast-root {
  top: calc(var(--app-top-inset) + var(--space-2));
}

body.is-native-app.has-app-shell.is-modal-open .content,
body.is-native-app.has-coach-app-shell.is-modal-open .content {
  overflow: hidden;
}

/* Kompakter Screen-Header – Safe-Area genau 1× (nur oben), kein Extra-Luftpolster.
   Kein Fixband: der Body-Hintergrund (var(--surface)) füllt die Notch-Fläche
   selbst schon konsistent; ein zusätzliches Fixband würde eine dunklere
   Farbschicht darüberlegen und den Header optisch nach unten drücken. */
.app-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 0;
  padding: calc(var(--app-top-inset) + var(--space-1)) 0 var(--space-2);
  margin: 0 0 var(--space-2);
  border-bottom: 1px solid var(--border);
  background: transparent;
  position: relative;
  top: auto;
  z-index: auto;
}

.app-shell-header__main {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  flex: 1;
}

.app-shell-header__back {
  flex-shrink: 0;
}

.app-shell-header__title {
  margin: 0;
  padding: 0;
  font-size: var(--text-md);
  font-weight: 650;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.app-shell-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.app-shell-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.app-shell-header__btn:hover,
.app-shell-header__btn:focus-visible {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--border-active);
  outline: none;
}

.app-shell-header__btn.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--border-active);
}

.app-shell-header__btn--badge {
  position: relative;
}

.app-shell-header__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--pill);
  background: var(--danger);
  color: var(--on-primary);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Floating Glass Dock – inspiriert von kompakter nativer Pill-Navigation */
.app-tab-bar {
  position: fixed;
  left: calc(var(--space-4) + var(--app-side-inset-left));
  right: calc(var(--space-4) + var(--app-side-inset-right));
  bottom: calc(var(--space-2) + var(--app-bottom-inset));
  z-index: var(--z-app-tab-bar);
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 390px;
  min-height: var(--app-tab-bar-h);
  margin-inline: auto;
  padding: var(--space-1);
  overflow: visible;
  border: 1px solid var(--border-hover);
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-xl);
  transition: transform var(--dur) var(--ease), opacity var(--dur-fast) var(--ease);
}

.app-tab-bar__item {
  flex: 0 0 48px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
  min-height: 44px;
  padding: var(--space-2);
  overflow: hidden;
  border-radius: var(--pill);
  color: var(--text-muted);
  text-decoration: none;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    flex-basis var(--dur) var(--ease),
    gap var(--dur) var(--ease),
    color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.app-tab-bar__item:focus-visible {
  outline: 2px solid var(--border-active);
  outline-offset: -2px;
}

.app-tab-bar__icon {
  display: flex;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.app-tab-bar__label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.1;
  transform: translateX(-4px);
  transition:
    max-width var(--dur) var(--ease),
    opacity var(--dur-fast) var(--ease),
    transform var(--dur) var(--ease);
}

.app-tab-bar__item.is-active,
.app-tab-bar__more-trigger[aria-expanded="true"] {
  flex-basis: 112px;
  gap: var(--space-2);
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--border-active);
}

.app-tab-bar__item.is-active .app-tab-bar__icon,
.app-tab-bar__more-trigger[aria-expanded="true"] .app-tab-bar__icon {
  background: transparent;
  box-shadow: none;
}

.app-tab-bar__item.is-active .app-tab-bar__label,
.app-tab-bar__more-trigger[aria-expanded="true"] .app-tab-bar__label {
  max-width: 76px;
  opacity: 1;
  transform: translateX(0);
}

/* Primäre Aktion (Konzept A verstärkt): großer Kreis klar über der Dock.
   Bewusst volle Primary statt Brand-Gradient – pro Viewport nur ein Gradient-CTA. */
.app-tab-bar__item--log {
  position: relative;
  z-index: 1;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  min-height: 58px;
  margin-inline: var(--space-2);
  padding: 0;
  overflow: visible;
  border-radius: 50%;
  color: var(--on-primary);
  background: var(--primary);
  box-shadow:
    0 10px 28px color-mix(in srgb, var(--primary) 42%, transparent),
    0 0 0 3px color-mix(in srgb, var(--surface) 88%, transparent),
    var(--shadow-glow-lg);
  transform: translateY(calc(-1 * var(--app-tab-bar-log-protrusion)));
}

.app-tab-bar__item--log:hover,
.app-tab-bar__item--log:focus-visible {
  color: var(--on-primary);
  background: var(--primary-hover);
  box-shadow:
    0 12px 32px color-mix(in srgb, var(--primary) 48%, transparent),
    0 0 0 3px color-mix(in srgb, var(--surface) 88%, transparent),
    var(--shadow-glow-lg);
}

.app-tab-bar__item--log .app-tab-bar__icon {
  flex-basis: 26px;
  width: 26px;
  height: 26px;
}

.app-tab-bar__item--log.is-active {
  flex-basis: 58px;
  gap: 0;
  color: var(--on-primary);
  background: var(--primary);
  box-shadow:
    0 10px 28px color-mix(in srgb, var(--primary) 42%, transparent),
    0 0 0 3px color-mix(in srgb, var(--surface) 88%, transparent),
    var(--shadow-glow-lg);
}

.app-tab-bar__item--log.is-active .app-tab-bar__label {
  max-width: 0;
  opacity: 0;
  transform: translateX(-4px);
}

.app-tab-bar.is-more-open .app-tab-bar__item.is-active:not(.app-tab-bar__more-trigger) {
  flex-basis: 48px;
  gap: 0;
  color: var(--text-muted);
  background: transparent;
  box-shadow: none;
}

.app-tab-bar.is-more-open .app-tab-bar__item.is-active:not(.app-tab-bar__more-trigger) .app-tab-bar__label {
  max-width: 0;
  opacity: 0;
  transform: translateX(-4px);
}

.app-tab-bar.is-more-open .app-tab-bar__item--log.is-active {
  flex-basis: 58px;
  color: var(--on-primary);
  background: var(--primary);
  box-shadow:
    0 10px 28px color-mix(in srgb, var(--primary) 42%, transparent),
    0 0 0 3px color-mix(in srgb, var(--surface) 88%, transparent),
    var(--shadow-glow-lg);
}

.app-tab-bar--coach {
  max-width: 360px;
  justify-content: space-around;
  padding: var(--space-1) var(--space-2);
}

.app-tab-bar--coach .app-tab-bar__item:not(.app-tab-bar__item--log) {
  flex: 0 0 44px;
  flex-direction: row;
  gap: 0;
  min-height: 44px;
  padding: 0;
}

.app-tab-bar--coach .app-tab-bar__item.is-active:not(.app-tab-bar__item--log),
.app-tab-bar--coach .app-tab-bar__more-trigger[aria-expanded="true"],
.app-tab-bar--coach.is-more-open .app-tab-bar__item.is-active:not(.app-tab-bar__more-trigger) {
  flex: 0 0 44px;
  flex-basis: 44px;
  gap: 0;
  border-radius: 50%;
}

.app-tab-bar--coach .app-tab-bar__item--log {
  flex: 0 0 58px;
}

.app-tab-bar--coach .app-tab-bar__label,
.app-tab-bar--coach .app-tab-bar__item.is-active .app-tab-bar__label,
.app-tab-bar--coach .app-tab-bar__more-trigger[aria-expanded="true"] .app-tab-bar__label {
  max-width: 0;
  opacity: 0;
  transform: translateX(-4px);
}

/* Athleten-Dock: icon-only, Icons gleichmäßig verteilt, aktive Pill kompakt.
   Labels bleiben im Markup für Screenreader, stehen inhaltlich im Seitenkopf. */
.app-tab-bar:not(.app-tab-bar--coach) {
  justify-content: space-around;
  max-width: 360px;
  padding: var(--space-1) var(--space-2);
}

.app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__item:not(.app-tab-bar__item--log) {
  flex: 0 0 44px;
  min-height: 44px;
  padding: 0;
}

.app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__item.is-active:not(.app-tab-bar__item--log),
.app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__more-trigger[aria-expanded="true"],
.app-tab-bar:not(.app-tab-bar--coach).is-more-open .app-tab-bar__item.is-active:not(.app-tab-bar__more-trigger) {
  flex-basis: 44px;
  gap: 0;
  border-radius: 50%;
}

.app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__item--log {
  flex: 0 0 58px;
}

.app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__label,
.app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__item.is-active .app-tab-bar__label,
.app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__more-trigger[aria-expanded="true"] .app-tab-bar__label {
  max-width: 0;
  opacity: 0;
  transform: translateX(-4px);
}

@media (max-width: 360px) {
  .app-tab-bar__item {
    flex-basis: 44px;
  }

  .app-tab-bar__item.is-active,
  .app-tab-bar__more-trigger[aria-expanded="true"] {
    flex-basis: 104px;
  }

  .app-tab-bar.is-more-open .app-tab-bar__item.is-active:not(.app-tab-bar__more-trigger) {
    flex-basis: 44px;
  }

  .app-tab-bar__item--log,
  .app-tab-bar__item--log.is-active,
  .app-tab-bar.is-more-open .app-tab-bar__item--log.is-active {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    min-height: 52px;
    transform: translateY(-12px);
  }

  .app-tab-bar:not(.app-tab-bar--coach) {
    max-width: 320px;
  }

  .app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__item:not(.app-tab-bar__item--log),
  .app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__item.is-active:not(.app-tab-bar__item--log),
  .app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__more-trigger[aria-expanded="true"] {
    flex-basis: 44px;
  }

  .app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__item--log,
  .app-tab-bar:not(.app-tab-bar--coach) .app-tab-bar__item--log.is-active {
    flex: 0 0 52px;
  }

  .app-tab-bar--coach .app-tab-bar__item:not(.app-tab-bar__item--log),
  .app-tab-bar--coach .app-tab-bar__item.is-active:not(.app-tab-bar__item--log),
  .app-tab-bar--coach .app-tab-bar__more-trigger[aria-expanded="true"],
  .app-tab-bar--coach.is-more-open .app-tab-bar__item.is-active:not(.app-tab-bar__more-trigger) {
    flex: 0 0 44px;
    flex-basis: 44px;
  }

  .app-tab-bar--coach .app-tab-bar__item--log,
  .app-tab-bar--coach .app-tab-bar__item--log.is-active {
    flex: 0 0 52px;
  }
}

/* „Mehr“ – natives Bottom-Sheet für sekundäre Athleten-Bereiche */
.app-more-sheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-sidebar-mobile);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.app-more-sheet[hidden] {
  display: none;
}

.app-more-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(var(--space-1));
  -webkit-backdrop-filter: blur(var(--space-1));
}

.app-more-sheet__panel {
  position: relative;
  width: min(100%, 540px);
  max-height: calc(100dvh - var(--app-top-inset) - var(--space-6));
  overflow-y: auto;
  padding: var(--space-2) var(--space-5) calc(var(--space-6) + var(--app-bottom-inset));
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  animation: appMoreIn var(--dur-slow) var(--ease);
}

.app-more-sheet__handle {
  width: 36px;
  height: 4px;
  margin: 0 auto var(--space-4);
  border-radius: var(--pill);
  background: var(--border-hover);
}

.app-more-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.app-more-sheet__eyebrow {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--text-dim);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app-more-sheet__title {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-2xl);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.app-more-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
}

.app-more-sheet__close .mm-icon {
  transform: rotate(45deg);
}

.app-more-profile {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 76px;
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  background: var(--primary-soft);
  color: var(--text-main);
  text-decoration: none;
}

.app-more-list {
  display: grid;
  gap: var(--space-3);
}

.app-more-list .app-more-profile {
  min-height: 68px;
  margin-bottom: 0;
  border-color: var(--border);
  background: var(--surface-2);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.app-more-list .app-more-profile:active {
  transform: scale(0.99);
}

.app-more-profile__icon,
.app-more-card__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
}

.app-more-profile__copy {
  display: grid;
  flex: 1;
  gap: var(--space-1);
  min-width: 0;
}

.app-more-profile strong,
.app-more-card strong {
  color: var(--text-primary);
  font-size: var(--text-md);
  font-weight: 650;
}

.app-more-profile small,
.app-more-card small {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.app-more-profile__arrow {
  display: inline-flex;
  color: var(--text-dim);
}

.app-more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.app-more-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-height: 132px;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text-main);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.app-more-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  min-height: 88px;
}

.app-more-card:active {
  transform: scale(0.98);
}

.app-more-card:hover,
.app-more-card:focus-visible,
.app-more-profile:hover,
.app-more-profile:focus-visible {
  border-color: var(--border-active);
  outline: none;
}

.app-more-card__badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  border-radius: var(--pill);
  background: var(--danger);
  color: var(--on-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.app-more-logout {
  margin: var(--space-5) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

button[type="submit"].app-more-logout__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-main);
  font-weight: 600;
  font-size: var(--text-md);
  box-shadow: none;
}

button[type="submit"].app-more-logout__btn::before {
  display: none;
}

button[type="submit"].app-more-logout__btn:hover,
button[type="submit"].app-more-logout__btn:focus-visible {
  transform: none;
  box-shadow: none;
  border-color: var(--border-active);
  background: var(--primary-soft);
  outline: none;
}

button[type="submit"].app-more-logout__btn:active {
  transform: scale(0.98);
  box-shadow: none;
}

.app-more-logout__icon {
  display: inline-flex;
  color: var(--text-muted);
}

@keyframes appMoreIn {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .app-more-sheet__panel {
    animation: none;
  }
}

/* Netzwerk-Banner (native) */
.network-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-toast) - 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  padding-top: calc(var(--space-2) + var(--app-top-inset));
  background: var(--warning-soft);
  color: var(--text-main);
  font-size: var(--text-sm);
  font-weight: 500;
  border-bottom: 1px solid color-mix(in oklab, var(--warning) 35%, transparent);
}

.network-banner[hidden] {
  display: none !important;
}

.staging-env-banner {
  position: relative;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1) var(--space-4);
  background: var(--warning-soft);
  color: var(--text-main);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid color-mix(in oklab, var(--warning) 35%, transparent);
}

body.is-native-app.has-app-shell .network-banner,
body.is-native-app.has-coach-app-shell .network-banner {
  top: var(--app-top-inset);
  padding-top: var(--space-2);
}

/* Schlanker Legal-Footer statt Website-Footer (native) */
.app-shell-legal {
  margin-top: var(--space-6);
  padding: var(--space-4) 0 var(--space-2);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-dim);
  line-height: 1.5;
}

.app-shell-legal p {
  margin: 0 0 var(--space-2);
}

.app-shell-legal a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.is-native-app.has-app-shell.is-chat .app-shell-header {
  display: none;
}

body.is-native-app.has-app-shell.is-chat .content {
  padding-bottom: var(--app-fixed-bottom, var(--app-tab-bar-total-h)) !important;
}

body.is-native-app.has-app-shell.is-chat.is-keyboard-open .content {
  padding-bottom: var(--app-keyboard-inset) !important;
}

body.is-native-app.has-app-shell.is-chat .chat-main__header {
  padding-top: calc(var(--space-2) + var(--app-top-inset));
}

@media (hover: none) {
  .entry-card-actions,
  .chat-sidebar__delete {
    opacity: 1 !important;
  }
  .chat-sidebar__delete {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Fixed Bottom-UI über Tab-Bar (Home-Drawer, FAB, Toasts) */
body.is-native-app.has-app-shell .gz-toast,
body.is-native-app.has-app-shell .home-fab,
body.is-native-app.has-app-shell .dash-tour-root {
  bottom: calc(var(--app-fixed-bottom, var(--app-tab-bar-total-h)) + var(--space-3));
  z-index: var(--z-app-fab);
}

body.is-native-app.has-app-shell .gz-drawer,
body.is-native-app.has-app-shell .home-drawer-backdrop {
  z-index: var(--z-app-drawer);
}

body.is-native-app.has-app-shell .gz-drawer {
  max-height: calc(100dvh - var(--app-shell-header-total-h));
}

body.is-native-app.has-app-shell.is-keyboard-open .gz-toast,
body.is-native-app.has-app-shell.is-keyboard-open .home-fab {
  bottom: calc(var(--app-keyboard-inset) + var(--space-3));
}

/* Fallback: Client erkennt Native, Server hatte noch kein Cookie (1. Request) */
html.is-native-app body.is-native-app:not(.has-app-shell):not(.is-auth) {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
html.is-native-app body.is-native-app:not(.has-app-shell) .mobile-header {
  padding-top: calc(var(--space-3) + var(--app-top-inset));
}
