/* ============================================================
   PostRoute — Design System
   BiteForce Visual Language
   Dark Theme · Cyan/Teal Accents · Orbitron/Rajdhani
   ============================================================ */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  /* --- Colors: Background --- */
  --bg-void:        #050709;   /* deepest background */
  --bg-base:        #0a0e14;   /* app background */
  --bg-elevated:    #0f141c;   /* cards, panels */
  --bg-surface:     #141b26;   /* inputs, hover states */
  --bg-surface-2:   #1a2230;   /* secondary surfaces */
  --bg-overlay:     rgba(10, 14, 20, 0.92);

  /* --- Colors: Cyan (Primary) --- */
  --cyan-50:   #e0fbff;
  --cyan-100:  #b3f3ff;
  --cyan-200:  #80ebff;
  --cyan-300:  #4de3ff;
  --cyan-400:  #1adbff;
  --cyan-500:  #00d4ff;   /* primary accent */
  --cyan-600:  #00a8cc;
  --cyan-700:  #007d99;
  --cyan-800:  #005266;
  --cyan-900:  #002933;

  /* --- Colors: Teal (Secondary) --- */
  --teal-50:   #e0fff7;
  --teal-100:  #b3ffe6;
  --teal-200:  #80ffd4;
  --teal-300:  #4dffc3;
  --teal-400:  #1affb2;
  --teal-500:  #00ffaa;   /* secondary accent */
  --teal-600:  #00cc88;
  --teal-700:  #009966;
  --teal-800:  #006644;
  --teal-900:  #003322;

  /* --- Colors: Semantic --- */
  --success:    #00ffaa;
  --warning:    #ffb000;
  --error:      #ff3860;
  --info:       #00d4ff;
  --success-bg: rgba(0, 255, 170, 0.12);
  --warning-bg: rgba(255, 176, 0, 0.12);
  --error-bg:   rgba(255, 56, 96, 0.12);
  --info-bg:    rgba(0, 212, 255, 0.12);

  /* --- Colors: Text --- */
  --text-primary:    #e8f0fa;
  --text-secondary:  #a0b0c4;
  --text-muted:      #5a6b80;
  --text-disabled:   #3a4858;

  /* --- Colors: Borders --- */
  --border-subtle:   rgba(0, 212, 255, 0.08);
  --border-default:  rgba(0, 212, 255, 0.15);
  --border-strong:   rgba(0, 212, 255, 0.30);
  --border-focus:    rgba(0, 212, 255, 0.60);

  /* --- Typography --- */
  --font-display:  'Orbitron', sans-serif;
  --font-body:     'Rajdhani', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --fs-xs:    0.75rem;     /* 12px */
  --fs-sm:    0.875rem;    /* 14px */
  --fs-base:  1rem;        /* 16px */
  --fs-lg:    1.125rem;    /* 18px */
  --fs-xl:    1.375rem;    /* 22px */
  --fs-2xl:   1.75rem;     /* 28px */
  --fs-3xl:   2.25rem;     /* 36px */
  --fs-4xl:   3rem;        /* 48px */
  --fs-5xl:   4rem;        /* 64px */

  --fw-light:    300;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  --lh-tight:    1.1;
  --lh-snug:     1.3;
  --lh-normal:   1.5;
  --lh-relaxed:  1.7;

  --ls-display:  0.08em;    /* letter-spacing for Orbitron */
  --ls-wide:     0.04em;

  /* --- Spacing (8px base) --- */
  --space-0:   0;
  --space-1:   2px;
  --space-2:   4px;
  --space-3:   8px;
  --space-4:   12px;
  --space-5:   16px;
  --space-6:   20px;
  --space-7:   24px;
  --space-8:   32px;
  --space-9:   40px;
  --space-10:  48px;
  --space-11:  64px;
  --space-12:  80px;

  /* --- Radius --- */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-glow-cyan:    0 0 20px rgba(0, 212, 255, 0.25);
  --shadow-glow-teal:    0 0 20px rgba(0, 255, 170, 0.25);
  --shadow-sm:           0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md:           0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg:           0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-panel:        0 4px 24px rgba(0, 0, 0, 0.5), 0 0 1px rgba(0, 212, 255, 0.15);

  /* --- Transitions --- */
  --t-fast:    120ms ease;
  --t-normal:  250ms ease;
  --t-slow:    400ms ease;
  --t-glow:    300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* --- Z-Index --- */
  --z-base:      1;
  --z-map:       10;
  --z-overlay:   1000;
  --z-sidebar:   2000;
  --z-nav:       3000;
  --z-header:    4000;
  --z-modal:     5000;
  --z-toast:     6000;

  /* --- Layout --- */
  --header-height:    56px;
  --sidebar-width:    380px;
  --nav-panel-height: 200px;
}

/* ---------- 2. RESET & BASE ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--bg-base);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}

/* ---------- 3. SCROLLBAR ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb {
  background: var(--cyan-800);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--cyan-700); }

/* ============================================================
   3.5 APP SHELL LAYOUT
   ============================================================ */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* dynamic viewport for mobile */
  overflow: hidden;
}

.app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* ============================================================
   4. COMPONENTS
   ============================================================ */

/* ---------- 4.1 HEADER / TOP BAR ---------- */
.app-header {
  height: var(--header-height);
  background: var(--bg-void);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: relative;
  z-index: var(--z-header);
  backdrop-filter: blur(20px);
}

/* Scanline accent under header */
.app-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--cyan-500) 30%,
    var(--teal-500) 50%,
    var(--cyan-500) 70%,
    transparent 100%);
  opacity: 0.4;
}

.app-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.app-header__logo-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cyan-500), var(--teal-500));
  border-radius: var(--radius-sm);
  font-size: var(--fs-lg);
  box-shadow: var(--shadow-glow-cyan);
}

.app-header__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-display);
  color: var(--text-primary);
}

.app-header__title span {
  color: var(--cyan-500);
}

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

/* ---------- 4.2 SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: transform var(--t-normal);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.sidebar__section {
  padding: var(--space-7);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar__section-title {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--cyan-400);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar__section-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--cyan-500);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* ---------- 4.3 ADDRESS LIST ---------- */
.address-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.address-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  transition: all var(--t-normal);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.address-list__item:hover {
  background: var(--bg-surface);
  border-left-color: var(--cyan-700);
}

.address-list__item.is-active {
  background: var(--info-bg);
  border-left-color: var(--cyan-500);
}

.address-list__item.is-visited {
  opacity: 0.5;
}

.address-list__item.is-visited .address-list__number {
  background: var(--teal-700);
  color: var(--teal-50);
}

.address-list__item.is-visited .address-list__address {
  text-decoration: line-through;
  color: var(--text-muted);
}

.address-list__number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--cyan-400);
}

.address-list__item.is-active .address-list__number {
  background: var(--cyan-500);
  color: var(--bg-void);
  border-color: var(--cyan-400);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.address-list__address {
  flex: 1;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  line-height: var(--lh-snug);
}

.address-list__distance {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- 4.4 BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-lg); /* 12px — runder */
  cursor: pointer;
  transition: all var(--t-normal); /* weichere Übergänge */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: var(--space-5) var(--space-6);
  min-height: 48px; /* größere Touch-Targets */
}

.btn:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — Cyan filled, weicher Schatten */
.btn--primary {
  background: linear-gradient(135deg, var(--cyan-600), var(--cyan-500));
  color: var(--bg-void);
  box-shadow: 0 4px 14px rgba(0, 212, 255, 0.22),
              0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--cyan-500), var(--cyan-400));
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3),
              0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.2);
}

/* Secondary — Ghost outline */
.btn--secondary {
  background: var(--bg-surface);
  color: var(--cyan-400);
  border: 1px solid var(--border-default);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--bg-surface-2);
  border-color: var(--border-strong);
  color: var(--cyan-300);
}

/* Success — Teal, weicher Schatten */
.btn--success {
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  color: var(--bg-void);
  box-shadow: 0 4px 14px rgba(0, 255, 170, 0.22),
              0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn--success:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(0, 255, 170, 0.3),
              0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.btn--success:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 255, 170, 0.2);
}

/* Danger */
.btn--danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(255, 56, 96, 0.25);
  box-shadow: 0 2px 8px rgba(255, 56, 96, 0.1);
}

.btn--danger:hover:not(:disabled) {
  background: rgba(255, 56, 96, 0.18);
  border-color: rgba(255, 56, 96, 0.45);
  box-shadow: 0 4px 12px rgba(255, 56, 96, 0.15);
}

/* Icon button — größere Touch-Targets, weicher */
.btn--icon {
  padding: var(--space-4);
  min-width: 48px;
  min-height: 48px;
  background: var(--bg-overlay);
  backdrop-filter: blur(16px);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.btn--icon:hover:not(:disabled) {
  color: var(--cyan-400);
  border-color: var(--border-default);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(0, 212, 255, 0.1);
}

/* Full width */
.btn--block {
  width: 100%;
}

/* Large (navigation) */
.btn--lg {
  padding: var(--space-6) var(--space-8);
  font-size: var(--fs-lg);
  min-height: 56px;
}

/* ---------- 4.5 INPUTS / TEXTAREA ---------- */
.input {
  width: 100%;
  padding: var(--space-5) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  color: var(--text-primary);
  transition: all var(--t-normal);
  min-height: 48px;
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-surface-2);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.08);
}

.input--textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}

/* ---------- 4.6 MAP CONTAINER ---------- */
.map-container {
  flex: 1;
  position: relative;
  background: var(--bg-void);
  z-index: var(--z-map);
}

.map-container .leaflet-container {
  background: var(--bg-void);
  font-family: var(--font-body);
}

/* Subtle dark map tiles filter — elegant, not inverted */
.map-container .leaflet-tile {
  filter: brightness(0.85) saturate(0.9);
}

/* Custom markers */
.map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-void);
  border: 2px solid var(--cyan-500);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--cyan-400);
  box-shadow: var(--shadow-glow-cyan);
  transition: all var(--t-normal);
}

.map-marker.is-active {
  border-color: var(--teal-500);
  color: var(--teal-400);
  box-shadow: var(--shadow-glow-teal);
  transform: scale(1.15);
}

.map-marker.is-visited {
  border-color: var(--text-muted);
  color: var(--text-muted);
  box-shadow: none;
  opacity: 0.6;
}

/* Route line */
.route-line {
  color: var(--cyan-500);
  weight: 4;
  opacity: 0.9;
}

.route-line--completed {
  color: var(--teal-500);
  opacity: 0.6;
}

/* Map controls overlay */
.map-overlay {
  position: absolute;
  z-index: var(--z-overlay);
  pointer-events: none;
}

.map-overlay > * {
  pointer-events: auto;
}

/* ---------- 4.7 NAVIGATION PANEL ---------- */
.nav-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-default);
  padding: var(--space-6);
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-panel::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    var(--teal-500),
    var(--cyan-500),
    transparent);
  opacity: 0.5;
}

.nav-panel__step {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cyan-600), var(--teal-600));
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--bg-void);
  box-shadow: 0 4px 14px rgba(0, 212, 255, 0.2),
              0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-panel__info {
  flex: 1;
  min-width: 0;
}

.nav-panel__direction {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  letter-spacing: var(--ls-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-panel__distance {
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  color: var(--cyan-400);
  margin-top: var(--space-1);
}

.nav-panel__actions {
  display: flex;
  gap: var(--space-3);
}

/* ---------- 4.8 STATS BAR ---------- */
.stats-bar {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.stat {
  flex: 1;
  text-align: center;
  padding: var(--space-3);
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--cyan-400);
  line-height: var(--lh-tight);
}

.stat__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ---------- 4.9 BADGE / CHIP ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

.badge--cyan {
  background: var(--info-bg);
  color: var(--cyan-400);
  border: 1px solid var(--border-default);
}

.badge--teal {
  background: var(--success-bg);
  color: var(--teal-400);
  border: 1px solid rgba(0, 255, 170, 0.2);
}

.badge--warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(255, 176, 0, 0.2);
}

/* ---------- 4.10 TOGGLE / TAB SWITCH ---------- */
.tab-switch {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  gap: var(--space-1);
}

.tab-switch__btn {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}

.tab-switch__btn.is-active {
  background: var(--cyan-900);
  color: var(--cyan-400);
  box-shadow: inset 0 0 0 1px var(--border-default);
}

.tab-switch__btn:hover:not(.is-active) {
  color: var(--text-secondary);
}

/* ---------- 4.11 SPLASH SCREEN ---------- */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg-void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  transition: opacity 400ms ease;
}

.splash::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 360px;
  height: 360px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.splash__logo {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 40px rgba(0, 212, 255, 0.30),
              0 0 24px rgba(0, 212, 255, 0.18),
              0 2px 12px rgba(0, 0, 0, 0.4);
  animation: splash-logo-pulse 2s ease-in-out infinite;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.splash__logo img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-xl);
  display: block;
}

.splash__title {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-display);
  color: var(--text-primary);
  margin-top: var(--space-7);
  position: relative;
  z-index: 1;
}

.splash__title span { color: var(--cyan-400); }

.splash__subtitle {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  margin-top: var(--space-3);
  position: relative;
  z-index: 1;
}

.splash__loader {
  width: 180px;
  height: 2px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  margin-top: var(--space-8);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.splash__loader::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--cyan-400), transparent);
  animation: splash-loader 1.5s ease infinite;
}

@keyframes splash-logo-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 40px rgba(0, 212, 255, 0.30), 0 0 24px rgba(0, 212, 255, 0.18), 0 2px 12px rgba(0, 0, 0, 0.4); }
  50% { transform: scale(1.06); box-shadow: 0 8px 50px rgba(0, 212, 255, 0.45), 0 0 36px rgba(0, 212, 255, 0.28), 0 2px 12px rgba(0, 0, 0, 0.4); }
}

@keyframes splash-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes splash-loader {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ---------- 4.12 UTILITIES ---------- */
.u-text-center { text-align: center; }
.u-text-right  { text-align: right; }
.u-mt-4 { margin-top: var(--space-4); }
.u-mt-6 { margin-top: var(--space-6); }
.u-mt-8 { margin-top: var(--space-8); }
.u-mb-4 { margin-bottom: var(--space-4); }
.u-mb-6 { margin-bottom: var(--space-6); }
.u-hidden { display: none !important; }
.u-flex-1 { flex: 1; }

/* ---------- 5. RESPONSIVE ---------- */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
    --header-height: 52px;
  }

  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: 85%;
    max-width: 360px;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .nav-panel {
    padding: var(--space-4) var(--space-5);
  }

  .nav-panel__direction {
    font-size: var(--fs-lg);
  }

  .splash__logo { width: 72px; height: 72px; }
  .splash__title { font-size: var(--fs-2xl); }
}

@media (max-width: 400px) {
  .nav-panel__step { width: 40px; height: 40px; font-size: var(--fs-base); }
  .stat__value { font-size: var(--fs-base); }
}

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

@media (prefers-color-scheme: dark) {
  /* Already dark-first */
}

/* ============================================================
   7. NEW FEATURE STYLES — Click-to-Add · GPS · Navigation
   ============================================================ */

/* --- Click-to-Add Toggle Button active state --- */
.btn--icon.is-active {
  background: var(--info-bg);
  color: var(--cyan-300);
  border-color: var(--cyan-500);
  box-shadow: var(--shadow-glow-cyan);
}

/* --- Address List Delete Button --- */
.address-list__delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  padding: 0;
}

.address-list__delete:hover {
  background: var(--error-bg);
  border-color: rgba(255, 56, 96, 0.3);
  color: var(--error);
}

/* --- Address List: div-basiert (war button, jetzt div) --- */
.address-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  transition: all var(--t-fast);
  width: 100%;
  text-align: left;
}

.address-list__item:hover {
  background: var(--bg-surface);
  border-left-color: var(--cyan-700);
}

.address-list__item.is-active {
  background: var(--info-bg);
  border-left-color: var(--cyan-500);
}

.address-list__item.is-visited {
  opacity: 0.5;
}

.address-list__item.is-visited .address-list__number {
  background: var(--teal-700);
  color: var(--teal-50);
}

.address-list__item.is-visited .address-list__address {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* --- Nav Panel Arrow / Richtungsanzeige --- */
.nav-panel__arrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--teal-400);
}

.nav-panel__arrow svg {
  transition: transform 0.3s ease;
  color: var(--teal-500);
  filter: drop-shadow(0 0 4px rgba(0, 255, 170, 0.4));
}

/* --- User Location Marker Animation (pulsierend) --- */
.user-location-marker {
  animation: gps-pulse 2s ease-in-out infinite;
}

@keyframes gps-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* --- Live Navigation Line (gestrichelt) --- */
.leaflet-overlay-pane path[stroke="#1adbff"] {
  filter: drop-shadow(0 0 3px rgba(26, 219, 255, 0.3));
}

/* --- Click Mode Cursor --- */
.map-container.is-click-mode .leaflet-container {
  cursor: crosshair !important;
}

/* ============================================================
   8. SETTINGS PANEL — Sound · Auto-Advance · GPS
   ============================================================ */
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 85%;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-subtle);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--t-slow);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.settings-panel.is-open {
  transform: translateX(0);
}

.settings-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-7);
  border-bottom: 1px solid var(--border-subtle);
}

.settings-panel__title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-display);
  color: var(--text-primary);
}

.settings-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-7);
  -webkit-overflow-scrolling: touch;
}

.settings-group {
  margin-bottom: var(--space-8);
}

.settings-group__label {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--cyan-400);
  margin-bottom: var(--space-4);
  display: block;
}

/* --- Select Dropdown --- */
.settings-select {
  width: 100%;
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--t-normal);
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234de3ff' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-5) center;
  padding-right: var(--space-8);
}

.settings-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.08);
}

/* --- Range Slider --- */
.settings-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-full);
  outline: none;
  margin: var(--space-4) 0;
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--cyan-500);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
  transition: all var(--t-fast);
}

.settings-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.settings-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--cyan-500);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.settings-slider__value {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--cyan-400);
  font-weight: var(--fw-semibold);
}

/* --- Settings Backdrop --- */
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 9, 0.5);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-modal) - 1);
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-normal);
}

.settings-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* --- GPS Marker ( BiteForce -Style) --- */
.gps-marker-wrapper {
  position: relative;
  width: 18px;
  height: 18px;
}

.gps-marker-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  background: var(--cyan-400);
  border: 3px solid #ffffff;
  border-radius: var(--radius-full);
  box-shadow: 0 0 12px rgba(26, 219, 255, 0.7),
              0 2px 4px rgba(0, 0, 0, 0.4);
}

.gps-marker-pulse {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 30px;
  height: 30px;
  border: 2px solid var(--cyan-400);
  border-radius: var(--radius-full);
  animation: gps-ring-pulse 2s ease-out infinite;
  opacity: 0;
}

@keyframes gps-ring-pulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  z-index: var(--z-toast);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-normal);
  max-width: 90%;
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast--error {
  border-color: rgba(255, 56, 96, 0.4);
  color: var(--error);
}

.toast--success {
  border-color: rgba(0, 255, 170, 0.4);
  color: var(--teal-400);
}

/* ============================================================
   9. NEUE FEATURE STYLES — Sound Import · Entwickler-Footer · Pin Popup
   ============================================================ */

/* --- Importierte Sound-Einträge in Settings --- */
.imported-sound-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  transition: all var(--t-fast);
}

.imported-sound-item:hover {
  border-color: var(--border-default);
  background: var(--bg-surface-2);
}

.imported-sound-item__name {
  flex: 1;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imported-sound-item__delete {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  padding: 0;
}

.imported-sound-item__delete:hover {
  background: var(--error-bg);
  border-color: rgba(255, 56, 96, 0.3);
  color: var(--error);
}

/* --- Entwickler-Card im Settings-Panel --- */
.dev-card {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.06), rgba(0, 255, 170, 0.03));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin-top: var(--space-5);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.dev-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--cyan-500), var(--teal-500));
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.dev-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--cyan-400);
  box-shadow: var(--shadow-glow-cyan);
}

.dev-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dev-card__name {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  color: var(--cyan-300);
}

.dev-card__role {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
}

/* --- Pin Popup (Leaflet Popup Anpassung) --- */
.pin-popup {
  min-width: 200px;
  text-align: center;
}

.pin-popup__title {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--cyan-400);
  margin-bottom: var(--space-2);
  letter-spacing: var(--ls-wide);
}

.pin-popup__address {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: var(--lh-snug);
  margin-bottom: var(--space-4);
  word-break: break-word;
}

.pin-popup__buttons {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.pin-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  cursor: pointer;
  transition: all var(--t-fast);
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}

.pin-popup__btn--delete {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(255, 56, 96, 0.25);
}

.pin-popup__btn--delete:hover {
  background: rgba(255, 56, 96, 0.18);
  border-color: rgba(255, 56, 96, 0.45);
}

.pin-popup__btn--close {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.pin-popup__btn--close:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* --- Leaflet Popup Dark Theme Anpassung --- */
.leaflet-popup-content-wrapper {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  margin: var(--space-5) var(--space-6);
  font-family: var(--font-body);
}

.leaflet-popup-tip {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
}

.leaflet-popup-close-button {
  color: var(--text-muted) !important;
  padding: var(--space-3) var(--space-4) 0 0 !important;
}

.leaflet-popup-close-button:hover {
  color: var(--cyan-400) !important;
}

/* ============================================================
   10. LOGIN / REGISTER SCREEN
   ============================================================ */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  overflow-y: auto;
  padding: var(--space-6);
}

.login-screen::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.login-screen__inner {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.login-screen__logo {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 40px rgba(0, 212, 255, 0.30),
              0 0 24px rgba(0, 212, 255, 0.18),
              0 2px 12px rgba(0, 0, 0, 0.4);
  animation: splash-logo-pulse 2s ease-in-out infinite;
  overflow: hidden;
  margin-bottom: var(--space-5);
}

.login-screen__logo img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-xl);
  display: block;
}

.login-screen__title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-display);
  color: var(--text-primary);
}

.login-screen__title span {
  color: var(--cyan-400);
}

.login-screen__subtitle {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  margin-top: var(--space-2);
  margin-bottom: var(--space-7);
}

.login-screen__tabs {
  display: flex;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  gap: var(--space-1);
  margin-bottom: var(--space-6);
}

.login-tab {
  flex: 1;
  padding: var(--space-4) var(--space-5);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  min-height: 44px;
}

.login-tab.is-active {
  background: var(--cyan-900);
  color: var(--cyan-400);
  box-shadow: inset 0 0 0 1px var(--border-default);
}

.login-tab:hover:not(.is-active) {
  color: var(--text-secondary);
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-form .input {
  min-height: 48px;
}

.login-form .btn {
  margin-top: var(--space-3);
}

@media (max-width: 400px) {
  .login-screen__title { font-size: var(--fs-xl); }
  .login-screen__logo { width: 64px; height: 64px; }
  .login-screen__logo img { width: 64px; height: 64px; }
}