/* ════════════════════════════════════════════════════════════════
   Impeto V3 Halo-Design — Shared CSS
   2026-05-18

   Quelle der Wahrheit für alle V3-Templates. Wird via <link rel="stylesheet">
   im _v3_head.html-Include eingebunden. Vor diesem Refactor waren ~300
   Zeilen CSS in jedem V3-Template dupliziert.

   Reihenfolge: CSS Variables → Reset → Components → Layout → A11y → Motion
   ════════════════════════════════════════════════════════════════ */

:root {
  --v3-bg: #0a0a0a;
  --v3-surface: rgba(255,255,255,0.04);
  --v3-surface-hover: rgba(255,255,255,0.06);
  --v3-border: rgba(255,255,255,0.08);
  --v3-text: #fafafa;
  --v3-text-muted: #a1a1aa;
  --v3-text-dim: #52525b;
  --v3-accent: #06b6d4;
  --v3-accent-glow: rgba(6,182,212,0.25);
  --v3-success: #10b981;
  --v3-warn: #f59e0b;
  --v3-danger: #ef4444;
  --v3-purple: #a855f7;
  --v3-focus-ring: 0 0 0 3px rgba(6,182,212,0.5);
}

/* ── Root + Reset ────────────────────────────────────────── */
.v3-root {
  background: var(--v3-bg);
  background-image:
    radial-gradient(at 20% 0%, rgba(6,182,212,0.06), transparent 50%),
    radial-gradient(at 80% 100%, rgba(168,85,247,0.04), transparent 50%);
  color: var(--v3-text);
  font-family: 'Inter Variable', 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  font-feature-settings: 'cv11', 'ss03';
  letter-spacing: -0.011em;
}
.v3-root * { box-sizing: border-box; }
.v3-root[data-gradient="events"] {
  background-image:
    radial-gradient(at 20% 0%, rgba(168,85,247,0.07), transparent 50%),
    radial-gradient(at 80% 100%, rgba(6,182,212,0.04), transparent 50%);
}
.v3-root[data-gradient="bikes"] {
  background-image:
    radial-gradient(at 20% 0%, rgba(6,182,212,0.06), transparent 50%),
    radial-gradient(at 80% 100%, rgba(16,185,129,0.04), transparent 50%);
}
.v3-root[data-gradient="settings"] {
  background-image:
    radial-gradient(at 20% 0%, rgba(168,85,247,0.05), transparent 50%),
    radial-gradient(at 80% 100%, rgba(6,182,212,0.04), transparent 50%);
}

.v3-numeric {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
/* Einheiten-Suffix neben Großzahlen ("230 W", "52 ms"): klein, muted, leicht
   abgesetzt — vereinheitlicht das Zahl+Einheit-Pattern (UI-Review P3 2026-06-10).
   Verwendung: <span class="v3-unit">W</span> direkt hinter der Zahl. */
.v3-unit {
  font-size: 0.6em;
  font-weight: 500;
  color: var(--v3-text-muted);
  margin-left: 0.1em;
}

/* ── Cards ──────────────────────────────────────────────── */
.v3-card {
  background: var(--v3-surface);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--v3-border);
  border-radius: 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.v3-card:hover {
  background: var(--v3-surface-hover);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
  transform: translateY(-1px);
}
.v3-card-hero {
  background: linear-gradient(135deg, rgba(6,182,212,0.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(6,182,212,0.2);
}
.v3-card-warn {
  background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(255,255,255,0.02));
  border-color: rgba(245,158,11,0.3);
}
.v3-card-danger {
  background: linear-gradient(135deg, rgba(239,68,68,0.06), rgba(255,255,255,0.02));
  border-color: rgba(239,68,68,0.3);
}

/* ── Glass-Header ───────────────────────────────────────── */
/* iOS PWA Safe-Area-Fix: padding-top damit Header nicht unter Dynamic
   Island / Notch verschwindet. Plus safe-area links/rechts für Landscape. */
.v3-glass-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10,10,10,0.7);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-bottom: 1px solid var(--v3-border);
  padding-top: env(safe-area-inset-top, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

/* Mobile-Polish: enge Glass-Header → kleinere Pills, kürzere Labels, 44px Tap-Targets */
@media (max-width: 540px) {
  /* Logo-Text klein halten — Logo-Icon reicht */
  .v3-glass-header .v3-brand-text { font-size: 0.95rem; }
  /* v2-Pill (Beta-Toggle) auf Mobile ausblenden — Beta-Tester wechseln eh via Settings */
  .v3-glass-header .v3-pill-hide-mobile { display: none; }
  /* Pill-Padding + Text-Größe kompakter */
  .v3-glass-header .v3-pill { padding: 0.4rem 0.65rem; font-size: 0.72rem; min-height: 36px; }
  .v3-glass-header .v3-btn-secondary { padding: 0.45rem 0.7rem; font-size: 0.78rem; min-height: 36px; }
  .v3-glass-header .v3-btn-primary { padding: 0.5rem 0.85rem; font-size: 0.82rem; min-height: 36px; }
  /* Labels mit .v3-label-mobile-hide verstecken — bleibt nur das Icon */
  .v3-label-mobile-hide { display: none; }
  /* Header-Inner: kein Wrap, kompakter Gap */
  .v3-glass-header > div { gap: 0.4rem !important; }
}
/* Tap-Targets generell groß genug für iOS HIG (44pt) */
.v3-bottom-tab { min-height: 44px; }
.v3-pill, .v3-btn-secondary, .v3-btn-primary { min-height: 36px; }

/* ── Verbindungs-Banner (Garmin/Strava getrennt) ──────────────────
   Sitzt direkt unter dem Glass-Header, full-width, auffällig bernstein.
   Erscheint nur bei state == 'expired' und ist nicht wegklickbar. */
.v3-conn-banner {
  background: linear-gradient(90deg, rgba(245,158,11,0.16), rgba(239,68,68,0.14));
  border-bottom: 1px solid rgba(245,158,11,0.5);
  color: #fde68a;
  font-size: 0.84rem;
  line-height: 1.35;
}
.v3-conn-banner-icon { font-size: 1rem; flex-shrink: 0; }
.v3-conn-banner-text { min-width: 0; }
.v3-conn-banner-btn {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  background: #f59e0b;
  color: #1a1205;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  border-radius: 0.55rem;
  text-decoration: none;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.v3-conn-banner-btn:hover { background: #fbbf24; }

/* ── Pills ──────────────────────────────────────────────── */
.v3-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.15s;
  text-decoration: none;
  color: var(--v3-text);
}
.v3-pill:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }
.v3-pill-accent { background: var(--v3-accent-glow); border-color: rgba(6,182,212,0.35); color: var(--v3-accent); }
.v3-pill-success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.35); color: var(--v3-success); }
.v3-pill-warn { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.35); color: var(--v3-warn); }
.v3-pill-danger { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.35); color: var(--v3-danger); }
.v3-pill-purple { background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.4); color: var(--v3-purple); }
/* Aktiv-Variante für Filter-Pills (z.B. Activities-Manage-Page) */
.v3-pill-active {
  background: var(--v3-accent-glow);
  border-color: rgba(6,182,212,0.5);
  color: var(--v3-accent);
  font-weight: 600;
}

/* ── Buttons ────────────────────────────────────────────── */
.v3-btn-primary {
  background: linear-gradient(135deg, var(--v3-accent), #0891b2);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(6,182,212,0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}
.v3-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(6,182,212,0.4); }
.v3-btn-primary:active { transform: translateY(0); }
.v3-btn-secondary {
  background: var(--v3-surface);
  color: var(--v3-text);
  border: 1px solid var(--v3-border);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
}
.v3-btn-secondary:hover { background: var(--v3-surface-hover); border-color: rgba(255,255,255,0.15); }
.v3-btn-danger { color: var(--v3-danger); }
.v3-btn-danger:hover { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.3); }
/* Größen-Modifier für kompakte Buttons in Listen/Karten (UI-Review P2 2026-06-10):
   ersetzt den 16× kopierten Inline-Hack padding:0.35rem 0.7rem — Radius, Hover
   und min-height kommen weiter aus der Basis-Klasse. */
.v3-btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.v3-btn-primary.v3-btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
/* Icon-only-Buttons (Lösch-✕, Refresh etc.): 44×44px Tap-Target nach iOS HIG,
   ersetzt Inline-Padding + onmouseover-Handler (UI-Review P2 2026-06-10).
   Button-Reset nach .v3-bottom-tab-Muster, damit <a> und <button> gleich aussehen. */
.v3-icon-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  border-radius: 8px;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.v3-icon-btn:hover { background: var(--v3-surface-hover); }
.v3-icon-btn:focus-visible { outline: none; box-shadow: var(--v3-focus-ring); }

/* ── Inputs ─────────────────────────────────────────────── */
.v3-input {
  background: rgba(0,0,0,0.3);
  color: var(--v3-text);
  border: 1px solid var(--v3-border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.15s;
  width: 100%;
}
.v3-input:focus {
  outline: none;
  border-color: var(--v3-accent);
  box-shadow: var(--v3-focus-ring);
}
.v3-input.v3-numeric { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── Info-Tooltip (Metriken-Erklärung) ─────────────────────
   Verwendung: <span class="v3-info-tip" data-tip="Erklärung">ⓘ</span>
   Hover/Focus zeigt Tooltip. Touch: kleines JS-Helper-Snippet
   (siehe v3-toast.js) macht es auch mobilfreundlich. */
.v3-info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 0.3em;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--v3-text-muted);
  font-size: 9px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.v3-info-tip:hover, .v3-info-tip:focus, .v3-info-tip.is-open {
  background: rgba(6,182,212,0.2);
  color: var(--v3-accent);
}
.v3-info-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,15,15,0.97);
  color: var(--v3-text);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: normal;
  line-height: 1.45;
  letter-spacing: 0;
  width: max-content;
  max-width: 280px;
  white-space: normal;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 1000;
}
.v3-info-tip:hover::after,
.v3-info-tip:focus::after,
.v3-info-tip.is-open::after {
  opacity: 1;
}
/* Tooltip-Arrow */
.v3-info-tip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(15,15,15,0.97);
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 1001;
  pointer-events: none;
}
.v3-info-tip:hover::before,
.v3-info-tip:focus::before,
.v3-info-tip.is-open::before { opacity: 1; }
/* Mobile-friendly: bei sehr schmalen Screens links/rechts begrenzen */
@media (max-width: 480px) {
  .v3-info-tip::after { max-width: 240px; }
}

/* ── Navigation ─────────────────────────────────────────── */
.v3-nav-link {
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--v3-text-muted);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.v3-nav-link:hover { background: rgba(255,255,255,0.05); color: var(--v3-text); }
.v3-nav-link.active {
  color: var(--v3-text);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
}
/* Mobile: Desktop-Nav AUS — !important weil Tailwind Play-CDN seine
   `flex`-Klasse erst nach unserer CSS injiziert und sonst die display-Regel
   überschreibt. Beobachtet auf iPhone 17 Pro: Nav-Links überlappten den Logo-Text. */
@media (max-width: 767px) {
  .v3-desktop-nav { display: none !important; }
}

/* ── Bottom-Tab-Bar (Mobile) ───────────────────────────── */
.v3-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-top: 1px solid var(--v3-border);
  padding: 0.4rem 0.3rem;
  padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0));
  justify-content: space-around;
  align-items: stretch;
}
.v3-bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.4rem 0.15rem;
  border-radius: 12px;
  color: var(--v3-text-muted);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  transition: all 0.15s;
  min-width: 0;
  max-width: 80px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.v3-more-trigger { /* sieht aus wie Link, ist aber Button */ }
.v3-bottom-tab:hover, .v3-bottom-tab:active { background: rgba(255,255,255,0.05); }
.v3-bottom-tab.active { color: var(--v3-accent); }
.v3-bottom-tab.active .v3-bottom-tab-icon {
  transform: translateY(-1px);
  filter: drop-shadow(0 2px 4px rgba(6,182,212,0.4));
}
.v3-bottom-tab-icon { font-size: 1.4rem; line-height: 1; transition: transform 0.15s; }
.v3-bottom-tab-label {
  font-size: 0.62rem;
  letter-spacing: 0.005em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Mehr-Sheet (Bottom-Sheet auf Mobile / Center-Modal auf Desktop) ─ */
.v3-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.v3-more-sheet[hidden] { display: none; }
.v3-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s;
}
.v3-more-sheet.show .v3-more-backdrop { opacity: 1; }
.v3-more-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: rgba(15, 15, 17, 0.98);
  border: 1px solid var(--v3-border);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 0.6rem 1.2rem 1.4rem;
  padding-bottom: calc(1.4rem + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
}
.v3-more-sheet.show .v3-more-panel { transform: translateY(0); }
@media (min-width: 768px) {
  /* Desktop: center modal, kein Bottom-Sheet */
  .v3-more-sheet { align-items: center; }
  .v3-more-panel {
    border-radius: 20px;
    border-bottom: 1px solid var(--v3-border);
    padding-bottom: 1.4rem;
    transform: translateY(20px);
  }
  .v3-more-sheet.show .v3-more-panel { transform: translateY(0); }
}
.v3-more-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 0.6rem;
}
@media (min-width: 768px) { .v3-more-handle { display: none; } }
.v3-more-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--v3-text);
}
/* Sichtbarer Schließen-Button oben rechts im Panel (UI-Review P2 2026-06-10):
   Backdrop-Tap + Esc sind für Screenreader-/Tastatur-User nicht auffindbar. */
.v3-more-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--v3-border);
  border-radius: 12px;
  color: var(--v3-text-muted);
  font-size: 1.05rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.v3-more-close:hover { background: rgba(255,255,255,0.1); color: var(--v3-text); }
.v3-more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1rem;
}
@media (min-width: 480px) {
  .v3-more-grid { grid-template-columns: repeat(4, 1fr); }
}
.v3-more-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--v3-text-muted);
  margin: 0.8rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--v3-border);
}
.v3-more-group-label:first-of-type { margin-top: 0; }

/* ── Cycle Tagebuch: Emoji-Picker + Heatmap ──────────────────── */
.v3-emoji-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.v3-emoji-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--v3-border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 1.05rem;
  color: var(--v3-text);
  transition: all 0.15s;
  line-height: 1;
}
.v3-emoji-btn.v3-emoji-text {
  font-size: 0.72rem;
  padding: 0.45rem 0.55rem;
  font-weight: 500;
}
.v3-emoji-btn:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.4);
}
.v3-emoji-btn.v3-emoji-on {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--v3-accent);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.3);
}
.v3-heatmap-cell {
  position: relative;
}
.v3-heatmap-cell:hover {
  transform: scale(1.15);
  z-index: 2;
}
.v3-more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--v3-border);
  border-radius: 14px;
  color: var(--v3-text);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  min-height: 80px;
  transition: all 0.15s;
}
.v3-more-item:hover, .v3-more-item:active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}
.v3-more-item-danger { color: var(--v3-danger); }
.v3-more-item-danger:hover { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); }
.v3-more-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.v3-more-label {
  line-height: 1.15;
}
@media (max-width: 767px) {
  .v3-bottom-nav { display: flex; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0)); }
}

/* ── Day-Tile (Plan-V3 8-Tage-Strip) ────────────────────── */
.v3-day-tile {
  flex: 1;
  min-width: 88px;
  padding: 0.7rem 0.4rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--v3-border);
  text-align: center;
  transition: all 0.2s;
  scroll-snap-align: start;
}
.v3-day-tile.today {
  background: var(--v3-accent-glow);
  border-color: var(--v3-accent);
  transform: scale(1.04);
}
.v3-day-tile.done {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.3);
}
.v3-day-tile.past-rest { opacity: 0.45; }
.v3-day-tile.overridden { border-color: var(--v3-accent); }

/* ── Animations ─────────────────────────────────────────── */
@keyframes v3-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.v3-animate { animation: v3-fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.v3-animate-1 { animation-delay: 0.05s; }
.v3-animate-2 { animation-delay: 0.10s; }
.v3-animate-3 { animation-delay: 0.15s; }
.v3-animate-4 { animation-delay: 0.20s; }
.v3-animate-5 { animation-delay: 0.25s; }
.v3-animate-6 { animation-delay: 0.30s; }

@keyframes v3-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(168,85,247,0); }
}
.v3-pulse { animation: v3-pulse-glow 2s ease-in-out infinite; }

@keyframes v3-spin {
  to { transform: rotate(360deg); }
}
.v3-spin { animation: v3-spin 1s linear infinite; }

/* ── Loading Skeleton ───────────────────────────────────── */
@keyframes v3-skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.v3-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 100%
  );
  background-size: 200% 100%;
  animation: v3-skeleton-shimmer 1.4s infinite;
  border-radius: 8px;
}

/* ── Toast ──────────────────────────────────────────────── */
.v3-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,10,0.95);
  color: white;
  padding: 0.8rem 1.4rem;
  border-radius: 12px;
  border: 1px solid var(--v3-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  font-weight: 500;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100vw - 2rem);
}
.v3-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}
.v3-toast-success { border-color: rgba(16,185,129,0.4); }
.v3-toast-error { border-color: rgba(239,68,68,0.4); }
.v3-toast-info { border-color: rgba(6,182,212,0.4); }
@media (min-width: 768px) {
  .v3-toast { bottom: 24px; }
}

/* ── Global / Reset ─────────────────────────────────────── */
html, body {
  margin: 0;
  padding: 0;
  background: var(--v3-bg);
  min-height: 100vh;
  scroll-behavior: smooth;
}
::selection {
  background: var(--v3-accent-glow);
  color: var(--v3-text);
}
.v3-root ::-webkit-scrollbar { width: 8px; height: 8px; }
.v3-root ::-webkit-scrollbar-track { background: transparent; }
.v3-root ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.v3-root ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* ── A11y: Focus-Rings für Tastatur-Navigation ──────────── */
.v3-root a:focus-visible,
.v3-root button:focus-visible,
.v3-root input:focus-visible,
.v3-root select:focus-visible,
.v3-root textarea:focus-visible,
.v3-root summary:focus-visible {
  outline: none;
  box-shadow: var(--v3-focus-ring);
  border-radius: 8px;
}
/* Skip-Link für Screen-Reader: erste Tab-Stop überspringt Nav, springt zu main */
.v3-skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--v3-accent);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  z-index: 1000;
  transition: top 0.15s;
}
.v3-skip-link:focus { top: 0.5rem; }

/* ── Motion-Reduced ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .v3-animate, .v3-pulse, .v3-spin, .v3-skeleton {
    animation: none !important;
  }
  *, *::before, *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .v3-card:hover { transform: none; }
  .v3-pill:hover { transform: none; }
  .v3-btn-primary:hover { transform: none; }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  .v3-bottom-nav, .v3-glass-header, .v3-subnav { display: none !important; }
  .v3-root { background: white; color: black; }
  .v3-card { border: 1px solid #ccc; background: white; box-shadow: none; }
}

/* ── V3 Desktop-Nav Hover-Dropdowns (Training, Garage) ──── */
.v3-nav-item {
  position: relative;
  display: inline-block;
}
.v3-nav-item > .v3-nav-link {
  /* kleines Caret-Icon nach dem Label */
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.v3-nav-item > .v3-nav-link::after {
  content: "▾";
  font-size: 0.65rem;
  opacity: 0.55;
  transition: transform 0.15s;
}
.v3-nav-item:hover > .v3-nav-link::after,
.v3-nav-item:focus-within > .v3-nav-link::after {
  transform: rotate(180deg);
  opacity: 1;
}
.v3-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.4rem;
  min-width: 220px;
  background: rgba(15, 15, 17, 0.97);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--v3-border);
  border-radius: 14px;
  padding: 0.4rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.v3-nav-item:hover > .v3-dropdown,
.v3-nav-item:focus-within > .v3-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.v3-dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--v3-text);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.12s;
}
.v3-dropdown-link:hover,
.v3-dropdown-link:focus {
  background: var(--v3-accent-glow);
  color: var(--v3-accent);
}
.v3-dropdown-link.active {
  background: rgba(255, 255, 255, 0.04);
  color: var(--v3-accent);
}
.v3-dropdown-link .v3-dropdown-icon {
  font-size: 1rem;
  width: 1.2rem;
  text-align: center;
}
/* Mobile: Hover-Dropdown ausschalten — Sub-Tab-Bar übernimmt */
@media (max-width: 767px) {
  .v3-dropdown { display: none !important; }
  .v3-nav-item > .v3-nav-link::after { display: none; }
}

/* ── V3 Sub-Nav (kontextuell unter Header) ──────────────── */
.v3-subnav {
  position: sticky;
  top: 56px;
  z-index: 30;
  display: flex;
  gap: 0.3rem;
  padding: 0.6rem 1rem;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--v3-border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.v3-subnav::-webkit-scrollbar { display: none; }
.v3-subnav-link {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--v3-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.v3-subnav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--v3-text);
}
.v3-subnav-link.active {
  background: var(--v3-accent-glow);
  border-color: rgba(6, 182, 212, 0.35);
  color: var(--v3-accent);
}
@media (max-width: 540px) {
  .v3-subnav { top: 52px; padding: 0.5rem 0.7rem; }
  .v3-subnav-link { font-size: 0.78rem; padding: 0.35rem 0.7rem; }
}

/* ─────────────────────────────────────────────────────────────
   V3 Route-Editor (Strava/Komoot-Level)
   Vollbild-Map auf Mobile mit Floating Bottom-Sheet.
   Desktop: 2-Spalten-Layout (Sidebar links + Map rechts).
   ───────────────────────────────────────────────────────────── */
.v3-route-editor {
  position: fixed;
  inset: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  z-index: 50;
}
.v3-route-map {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #1a1a1a;
  /* WICHTIG: isoliert Leaflets internes z-index-Stack (Panes bis 800+)
     vom Parent. Sonst überdecken die Tiles unsere Topbar/Sheet/FABs. */
  position: relative;
  z-index: 0;
  isolation: isolate;
}
.v3-route-map .leaflet-control-attribution {
  background: rgba(10, 10, 10, 0.7);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.65rem;
}
.v3-route-map .leaflet-control-attribution a { color: var(--v3-accent); }

/* Floating Topbar (Geocode + Back) */
.v3-route-topbar {
  position: absolute;
  top: env(safe-area-inset-top, 0);
  left: 0;
  right: 0;
  z-index: 60;
  padding: 0.6rem;
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  pointer-events: none;
}
.v3-route-topbar > * { pointer-events: auto; }
.v3-route-back {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(15, 15, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--v3-border);
  color: var(--v3-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s, background 0.15s;
}
.v3-route-back:hover, .v3-route-back:active { background: rgba(6, 182, 212, 0.15); transform: scale(0.95); }
.v3-route-geocode {
  flex: 1;
  position: relative;
  min-width: 0;
}
.v3-route-geocode input {
  width: 100%;
  height: 44px;
  padding: 0 0.9rem;
  border-radius: 14px;
  background: rgba(15, 15, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--v3-border);
  color: var(--v3-text);
  font-size: 0.95rem;
  outline: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.v3-route-geocode input:focus { border-color: var(--v3-accent); box-shadow: 0 0 0 3px var(--v3-accent-glow), 0 4px 16px rgba(0, 0, 0, 0.4); }
.v3-route-geocode-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(15, 15, 17, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--v3-border);
  border-radius: 14px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.v3-route-geocode-results:empty,
.v3-route-geocode-results[hidden] { display: none; }
.v3-geo-item {
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}
.v3-geo-item:hover, .v3-geo-item:focus { background: rgba(6, 182, 212, 0.12); }
.v3-geo-item:last-child { border-bottom: none; }
.v3-geo-item-locality { font-size: 0.75rem; color: var(--v3-text-muted); margin-top: 2px; }

/* Floating Action Buttons (Layer-Switch, Home, Locate, Undo) */
.v3-route-fabs {
  position: absolute;
  right: 0.6rem;
  bottom: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  /* shifted up by sheet height (set inline via JS) */
}
.v3-route-fabs > * { pointer-events: auto; }
.v3-fab {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(15, 15, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--v3-border);
  color: var(--v3-text);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s, background 0.15s;
}
.v3-fab:hover, .v3-fab:focus { background: rgba(6, 182, 212, 0.15); }
.v3-fab:active { transform: scale(0.92); }
.v3-fab.active { background: var(--v3-accent); color: #0a0a0a; }

/* Layer-Popover */
.v3-layer-popover {
  position: absolute;
  right: 60px;
  bottom: 0;
  background: rgba(15, 15, 17, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--v3-border);
  border-radius: 14px;
  padding: 0.4rem;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.v3-layer-popover[hidden] { display: none; }
.v3-layer-popover button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--v3-text);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
}
.v3-layer-popover button:hover { background: rgba(255, 255, 255, 0.05); }
.v3-layer-popover button.active { background: var(--v3-accent-glow); color: var(--v3-accent); font-weight: 600; }

/* Bottom Sheet */
.v3-route-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 70;
  background: rgba(15, 15, 17, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--v3-border);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.v3-route-sheet.collapsed { max-height: 168px; }
.v3-route-sheet.expanded { max-height: 80vh; }
.v3-sheet-handle-row {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 0.3rem;
  cursor: pointer;
  touch-action: none;
}
.v3-sheet-handle {
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}
.v3-sheet-tabs {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  padding: 0 0.6rem 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.v3-sheet-tabs::-webkit-scrollbar { display: none; }
.v3-sheet-tab {
  flex: 1;
  min-width: 100px;
  padding: 0.55rem 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: var(--v3-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 0.15s;
}
.v3-sheet-tab.active {
  background: var(--v3-accent-glow);
  border-color: var(--v3-accent);
  color: var(--v3-accent);
}
.v3-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem 1rem 0.6rem;
  -webkit-overflow-scrolling: touch;
}
.v3-sheet-actions {
  flex-shrink: 0;
  padding: 0.6rem 1rem 0.8rem;
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(10, 10, 12, 0.6);
}
.v3-sheet-actions > * { flex: 1; justify-content: center; }

/* Sheet-Form-Helpers */
.v3-sheet-field { margin-bottom: 0.7rem; }
.v3-sheet-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--v3-text-muted);
  margin-bottom: 0.3rem;
}
.v3-sheet-row { display: flex; gap: 0.4rem; }
.v3-sheet-row > * { flex: 1; }

/* Waypoint-Liste */
.v3-wp-list { list-style: none; padding: 0; margin: 0; }
.v3-wp-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}
.v3-wp-badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--v3-accent);
  color: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
}
.v3-wp-badge.start { background: var(--v3-accent); }
.v3-wp-badge.end { background: #22c55e; color: #fff; }
.v3-wp-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--v3-text-muted); }
.v3-wp-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--v3-danger);
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.v3-wp-remove:hover { background: rgba(239, 68, 68, 0.2); }

/* Result-Summary */
.v3-route-result {
  padding: 0.7rem 0.8rem;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 12px;
  margin-bottom: 0.6rem;
}
.v3-route-stats {
  display: flex;
  gap: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.v3-route-stat-label { font-size: 0.65rem; color: var(--v3-text-muted); text-transform: uppercase; display: block; font-weight: 500; font-family: 'Inter', sans-serif; }

/* Elevation-Profile-Container */
.v3-route-elev {
  margin-top: 0.5rem;
  border-radius: 8px;
  background: rgba(10, 10, 12, 0.5);
  overflow: hidden;
}
.v3-route-elev svg { display: block; width: 100%; }
.v3-route-elev-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--v3-text-muted);
  padding: 0.3rem 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}
.v3-route-elev-grades { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.v3-route-elev-grades span { display: inline-flex; align-items: center; gap: 2px; }
.v3-route-elev-grades i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; font-style: normal; }

/* Adjust Bar */
.v3-adjust-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin-bottom: 0.6rem; }
.v3-adjust-btn {
  padding: 0.45rem 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--v3-text);
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 500;
}
.v3-adjust-btn:hover { background: var(--v3-accent-glow); border-color: var(--v3-accent); color: var(--v3-accent); }

/* Candidate-Karte */
.v3-cand-card {
  padding: 0.6rem 0.7rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.v3-cand-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--v3-accent);
}
.v3-cand-card.selected {
  border-color: var(--v3-accent);
  background: var(--v3-accent-glow);
  box-shadow: 0 0 0 2px var(--v3-accent-glow);
}
.v3-cand-card.warning::before { background: var(--v3-warn); }
.v3-cand-head { display: flex; justify-content: space-between; align-items: baseline; }
.v3-cand-score { font-weight: 700; font-size: 0.9rem; }
.v3-cand-seed { font-size: 0.7rem; color: var(--v3-text-muted); font-family: 'JetBrains Mono', monospace; }
.v3-cand-stats { font-size: 0.85rem; margin-top: 0.3rem; font-family: 'JetBrains Mono', monospace; }
.v3-cand-grad { font-size: 0.7rem; color: var(--v3-text-muted); margin-top: 0.2rem; }
.v3-cand-climb {
  margin-top: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: rgba(6, 182, 212, 0.08);
  border-radius: 6px;
  font-size: 0.75rem;
}
.v3-cand-diff-good { color: #22c55e; font-weight: 600; }
.v3-cand-diff-warn { color: var(--v3-warn); font-weight: 600; }
.v3-cand-diff-bad { color: var(--v3-danger); font-weight: 600; }

/* Workout-Banner */
.v3-workout-banner {
  padding: 0.55rem 0.7rem;
  background: var(--v3-accent-glow);
  border-left: 3px solid var(--v3-accent);
  border-radius: 10px;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
}
.v3-workout-banner strong { color: var(--v3-accent); }

/* Error-Toast (inline) */
.v3-route-error {
  padding: 0.5rem 0.7rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--v3-danger);
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Stats-Hint (kleiner Info-Footer im Sheet) */
.v3-route-stats-hint {
  padding: 0.4rem 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 0.68rem;
  color: var(--v3-text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.5rem;
}

/* Desktop: ändere Layout zu Sidebar links + Map rechts */
@media (min-width: 1024px) {
  .v3-route-sheet {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0) + 60px);
    bottom: 16px;
    left: 16px;
    right: auto;
    width: 380px;
    max-height: none;
    border-radius: 20px;
    border: 1px solid var(--v3-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  }
  .v3-route-sheet.collapsed { max-height: none; }
  .v3-sheet-handle-row { display: none; }
  .v3-route-topbar { left: 412px; }
  .v3-route-fabs { right: 16px; bottom: 16px; }
}

/* Discovery: Höhenprofil-Bias-Buttons (3 Spalten) */
.v3-bias-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
}
/* Wegpunkt-Bias: 4 Optionen (Direkt/Flach/Mit-hm/Ruhig) in 2x2 */
.v3-bias-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}
.v3-bias-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.5rem 0.3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--v3-text);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 64px;
}
.v3-bias-btn:hover { background: rgba(255, 255, 255, 0.06); }
.v3-bias-btn.active {
  background: var(--v3-accent-glow);
  border-color: var(--v3-accent);
  color: var(--v3-accent);
}
.v3-bias-emoji { font-size: 1.1rem; line-height: 1; }
.v3-bias-label { font-size: 0.78rem; font-weight: 600; }
.v3-bias-sub { font-size: 0.62rem; opacity: 0.7; font-family: 'JetBrains Mono', monospace; }

/* Discovery: Varianten-Buttons (3 Spalten) */
.v3-variants-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
}
.v3-variant-btn {
  padding: 0.45rem 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--v3-text);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.v3-variant-btn:hover { background: rgba(255, 255, 255, 0.06); }
.v3-variant-btn.active {
  background: var(--v3-accent-glow);
  border-color: var(--v3-accent);
  color: var(--v3-accent);
  font-weight: 600;
}

/* Touch-optimized Leaflet markers (größer auf Mobile) */
.v3-route-marker {
  width: 32px;
  height: 32px;
  background: var(--v3-accent);
  color: #fff;
  border-radius: 50%;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}
.v3-route-marker.start { background: var(--v3-accent); }
.v3-route-marker.end { background: #22c55e; }
.v3-route-marker.via { background: #8b5cf6; }
.v3-route-marker.home { background: rgba(15, 15, 17, 0.9); border-color: var(--v3-accent); }


/* ── Aus den Template-Inline-Blöcken zentralisiert (UI-Review P1 2026-06-10):
   diese zwei Komponenten existierten NUR inline (dashboard_v3/v4 bzw.
   bikes_v3) — Voraussetzung für das Löschen der stalen <style>-Kopien. ── */
.v3-day-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1; border-radius: 12px;
  font-size: 0.7rem; font-weight: 600; color: var(--v3-text-muted);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--v3-border);
  transition: all 0.2s;
}
.v3-day-dot.done { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.3); color: var(--v3-success); }
.v3-day-dot.today { background: var(--v3-accent-glow); border-color: var(--v3-accent); color: var(--v3-accent); font-weight: 700; transform: scale(1.05); }
.v3-day-dot.rest { background: rgba(148,163,184,0.05); color: var(--v3-text-dim); }
.v3-card-primary {
  background: linear-gradient(135deg, rgba(6,182,212,0.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(6,182,212,0.25);
}

/* Optik-Sprint 12.06.: Live-Dot (pulsierend) fuer Daten-Frische an Health-Tiles */
.v3-live-dot{width:6px;height:6px;border-radius:9999px;background:#10b981;display:inline-block;flex-shrink:0;animation:v3pulse 2s ease-in-out infinite}
@keyframes v3pulse{0%,100%{opacity:1}50%{opacity:.25}}
@media (prefers-reduced-motion: reduce){.v3-live-dot{animation:none}}

/* Kraft-Tagging 12.06.: gewaehlte Pill deutlich markieren — die kleinen
   Radio-Dots sind auf Mobile kaum erkennbar (Simon-Report). :has() ist
   Progressive Enhancement, Fallback bleibt der native Dot. */
.v3-pill:has(input:checked){border-color:var(--v3-accent,#06b6d4);background:rgba(6,182,212,0.16);color:#fafafa}

/* ── Auswahl-Chips mit verstecktem nativen Input (Kraft-Tagging 15.06.) ──
   Tim-Report: RPE-Zahlen 1–10 nicht anklickbar. Ursache: native <input
   type=radio> in einer schmalen, zentrierten Flex-Pill wird auf Samsung-
   Internet/Android-WebView per flex-shrink auf ~0 px geschrumpft — unsichtbar
   UND tote Trefferflaeche (die breiten Fokus-Pills hatten genug Platz, darum
   gingen die). Loesung: Input visuell verstecken (bleibt fokussierbar, damit
   `required` weiter greift), die ganze .v3-choice-face ist die 44px-grosse
   Tap-Flaeche, Feedback ueber `:checked + face` — kein :has() noetig, laeuft
   auf jedem Browser. */
.v3-choice{position:relative;display:inline-flex;cursor:pointer;user-select:none}
.v3-choice-input{position:absolute;top:0;left:0;width:1px;height:1px;opacity:0;margin:0;pointer-events:none}
.v3-choice-face{
  display:inline-flex;align-items:center;justify-content:center;gap:0.4rem;
  min-height:44px;padding:0.3rem 0.95rem;border-radius:9999px;
  font-size:0.85rem;font-weight:600;color:var(--v3-text);
  background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.12);
  transition:background 0.15s,border-color 0.15s,color 0.15s;
}
.v3-choice-face:hover{background:rgba(255,255,255,0.09)}
/* Numerische Variante (RPE 1–10): kompakter Kreis, Mono-Ziffern */
.v3-choice-num .v3-choice-face{
  min-width:44px;padding:0.3rem;
  font-family:'JetBrains Mono',ui-monospace,monospace;font-variant-numeric:tabular-nums;
}
/* Gewaehlt — kraeftig gefuellt, auf jedem Browser sichtbar */
.v3-choice-input:checked + .v3-choice-face{
  background:var(--v3-accent,#06b6d4);border-color:var(--v3-accent,#06b6d4);
  color:#06222a;font-weight:700;
}
.v3-choice-input:focus-visible + .v3-choice-face{outline:2px solid var(--v3-accent,#06b6d4);outline-offset:2px}
