/* ============================================
   NAVTRACK - PHP Native GPS Tracking App
   Theme: Dark Futuristic with Cyan Accent
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* CSS Variables */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.5);
  --accent-dim: rgba(6, 182, 212, 0.15);
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --orange: #f97316;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.5);
  --border: rgba(6, 182, 212, 0.2);
  --glass-bg: rgba(18, 18, 26, 0.92);
  --glass-border: rgba(6, 182, 212, 0.15);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.3);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --fast: 0.15s ease;
  --normal: 0.3s ease;
  --slow: 0.5s ease;
}

/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* App Container */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

.app::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* ============= HEADER ============= */
.header {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.5rem 1rem;
  z-index: 100;
  position: relative;
  flex-shrink: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1920px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #0891b2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-glow);
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.logo .t1 {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

.logo .t2 {
  color: var(--text-primary);
}

.header-btns {
  display: flex;
  gap: 0.5rem;
}

.hdr-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(6, 182, 212, 0.1);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fast);
}

.hdr-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  color: var(--text-primary);
  border-color: var(--accent);
}

.hdr-btn.active {
  background: rgba(6, 182, 212, 0.3);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.hdr-btn svg {
  width: 18px;
  height: 18px;
}

/* ============= MAIN CONTENT ============= */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 1;
  gap: 0.5rem;
  padding: 0.5rem;
}

.dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Panel Section */
.panel {
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 0.75rem;
  flex-shrink: 0;
  animation: fadeIn 0.3s ease-out;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  /* FIX #14: was 0.7rem */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.section-title svg {
  color: var(--accent);
  width: 16px;
  height: 16px;
}

/* ============= VEHICLE SELECTOR ============= */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.vehicle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-secondary);
  transition: all var(--fast);
}

.vehicle-btn:hover:not(:disabled) {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent);
  color: var(--text-primary);
}

.vehicle-btn.active {
  background: rgba(6, 182, 212, 0.25);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.vehicle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vehicle-btn svg {
  width: 24px;
  height: 24px;
}

.vehicle-btn span {
  font-size: 0.7rem;
  font-weight: 500;
}

/* ============= LARGE SPEED DISPLAY ============= */
.speed-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.05));
  border-radius: 20px;
  border: 2px solid rgba(6, 182, 212, 0.3);
  position: relative;
}

.speed-main {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.speed-val {
  font-size: 5rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}

.speed-unit {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-muted);
}

.heading-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

.heading-info svg {
  width: 20px;
  height: 20px;
}

/* ============= DIRECTION INDICATOR ============= */
.direction-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.direction-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, 0.15);
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--accent-glow);
  transition: all var(--normal);
}

.direction-icon svg {
  width: 40px;
  height: 40px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.direction-icon.turn-left {
  border-color: var(--amber);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.direction-icon.turn-left svg {
  color: var(--amber);
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.4));
}

.direction-icon.turn-right {
  border-color: var(--amber);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.direction-icon.turn-right svg {
  color: var(--amber);
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.4));
}

.direction-icon.u-turn {
  border-color: var(--rose);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

.direction-icon.u-turn svg {
  color: var(--rose);
  filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.4));
}

.direction-icon.roundabout {
  border-color: var(--orange);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}

.direction-icon.roundabout svg {
  color: var(--orange);
  filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.4));
}

.direction-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.direction-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============= STATS GRID ============= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

.stat-item svg {
  color: var(--accent);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-label {
  font-size: 0.72rem;
  /* FIX #14: was 0.65rem, too small for driving */
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'JetBrains Mono', monospace;
}

.stat-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============= COORDINATES SECTION ============= */
.coords-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.coord-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  text-align: center;
}

.coord-item svg {
  color: var(--accent);
  width: 16px;
  height: 16px;
}

.coord-label {
  font-size: 0.7rem;
  /* FIX #14: was 0.6rem */
  color: var(--text-muted);
  text-transform: uppercase;
}

.coord-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

/* ============= EXTRA INFO ============= */
.extra-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.extra-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 10px;
}

.extra-item svg {
  color: var(--emerald);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.extra-label {
  font-size: 0.7rem;
  /* FIX #14: was 0.6rem */
  color: var(--text-muted);
  text-transform: uppercase;
}

.extra-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--emerald);
  font-family: 'JetBrains Mono', monospace;
}

/* ============= CONTROLS ============= */
.controls {
  display: flex;
  gap: 0.5rem;
}

.ctrl-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  transition: all var(--fast);
}

.ctrl-btn svg {
  width: 16px;
  height: 16px;
}

.btn-start {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: white;
}

.btn-start:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-stop {
  background: linear-gradient(135deg, var(--rose), #e11d48);
  color: white;
}

.btn-stop:hover {
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
  transform: translateY(-1px);
}

.btn-reset {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-reset:hover:not(:disabled) {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--accent);
  color: var(--text-primary);
}

.ctrl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============= ERROR MESSAGE ============= */
.error-msg {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 12px;
  padding: 1rem;
  color: var(--rose);
}

.error-msg svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.error-msg p {
  font-size: 0.875rem;
}

/* ============= SIDE PANELS ============= */
.side-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: right var(--normal);
}

.side-panel.open {
  right: 0;
}

.side-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
}

.side-panel-overlay.open {
  display: block;
}

.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(6, 182, 212, 0.05);
}

.sp-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.sp-header h3 svg {
  color: var(--accent);
  width: 18px;
  height: 18px;
}

.sp-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fast);
}

.sp-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.sp-close svg {
  width: 18px;
  height: 18px;
}

.sp-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Settings Items */
.setting-item {
  margin-bottom: 1.5rem;
}

.setting-item label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.setting-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setting-input input {
  flex: 1;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.75rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.setting-input input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.setting-unit {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.setting-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Import/Export Section */
.data-section {
  margin-top: 1rem;
}

.data-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 2px solid var(--glass-border);
  background: rgba(6, 182, 212, 0.08);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  transition: all var(--fast);
}

.data-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(6, 182, 212, 0.15);
}

.data-btn svg {
  width: 18px;
  height: 18px;
}

.data-btn.export-btn {
  border-color: var(--emerald);
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.08);
}

.data-btn.export-btn:hover {
  background: rgba(16, 185, 129, 0.15);
}

.data-btn.import-btn {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(245, 158, 11, 0.08);
}

.data-btn.import-btn:hover {
  background: rgba(245, 158, 11, 0.15);
}

#importFile {
  display: none;
}

/* History Items */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.trip-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trip-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  transition: all var(--fast);
}

.trip-item:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--accent);
}

.trip-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, 0.1);
  border-radius: 10px;
  color: var(--accent);
  flex-shrink: 0;
}

.trip-icon svg {
  width: 20px;
  height: 20px;
}

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

.trip-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.trip-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.trip-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.trip-stat svg {
  color: var(--accent);
  width: 12px;
  height: 12px;
}

.trip-del {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fast);
}

.trip-del:hover {
  color: var(--rose);
  background: rgba(244, 63, 94, 0.1);
}

.trip-del svg {
  width: 16px;
  height: 16px;
}

.history-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.clear-all {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.08);
  color: var(--rose);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--fast);
}

.clear-all:hover {
  background: rgba(244, 63, 94, 0.2);
}

.clear-all svg {
  width: 14px;
  height: 14px;
}

/* ============= FLOATING MAP MODAL ============= */
.map-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0891b2);
  border: none;
  color: white;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--accent-glow), 0 0 30px var(--accent-glow);
  transition: all var(--fast);
  animation: fabPulse 3s ease-in-out infinite;
}

.map-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px var(--accent-glow);
}

.map-fab svg {
  width: 24px;
  height: 24px;
}

.map-fab .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--rose);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fabPulse {

  0%,
  100% {
    box-shadow: 0 4px 20px var(--accent-glow);
  }

  50% {
    box-shadow: 0 4px 20px var(--accent-glow), 0 0 40px rgba(6, 182, 212, 0.3);
  }
}

.map-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  animation: fadeIn 0.2s ease;
}

.map-modal-overlay.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-modal {
  width: 94vw;
  height: 80vh;
  max-width: 900px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--accent-glow);
}

.map-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(6, 182, 212, 0.05);
}

.map-modal-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.map-modal-header h3 svg {
  color: var(--accent);
  width: 18px;
  height: 18px;
}

.map-modal-body {
  flex: 1;
  position: relative;
}

#navMap {
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  transform-origin: center center;
  transition: transform 0.05s linear;
  will-change: transform;
}

/* When heading-up is active, scale map to 142% (√2) to cover corners during rotation */
#navMap.heading-up-active {
  width: 142%;
  height: 142%;
  position: absolute;
  top: -21%;
  left: -21%;
}

/* Map rotation: clip overflow when map is rotated */
.map-modal-body {
  overflow: hidden;
}

/* Heading-up toggle button */
.map-heading-btn {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 450;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--fast);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.map-heading-btn svg {
  width: 22px;
  height: 22px;
}

.map-heading-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}

.map-heading-btn.active {
  background: rgba(6, 182, 212, 0.3);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow), 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Compass north indicator */
.map-compass-indicator {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 450;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(244, 63, 94, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease-out;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.map-compass-indicator .compass-n {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--rose);
  line-height: 1;
  margin-top: 2px;
}

.map-compass-indicator svg {
  color: var(--rose);
  width: 14px;
  height: 14px;
}

.map-gps-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  z-index: 400;
}

.gps-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gps-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.gps-dot.off {
  background: var(--rose);
  box-shadow: 0 0 8px var(--rose);
}

.gps-indicator span {
  font-size: 0.75rem;
  font-weight: 600;
}

.gps-acc {
  font-size: 0.65rem;
  color: var(--text-muted);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============= SPEED WARNING FULLSCREEN FLASH ============= */
.speed-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(244, 63, 94, 0.25);
  animation: flashOverlay 0.5s ease-in-out infinite;
  pointer-events: none;
}

.speed-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

@keyframes flashOverlay {

  0%,
  100% {
    background: rgba(244, 63, 94, 0.15);
  }

  50% {
    background: rgba(244, 63, 94, 0.35);
  }
}

.speed-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 3rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(244, 63, 94, 0.6);
  border-radius: 24px;
  animation: warningBounce 1s ease-in-out infinite;
}

@keyframes warningBounce {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 30px rgba(244, 63, 94, 0.4);
  }

  50% {
    transform: scale(1.03);
    box-shadow: 0 0 50px rgba(244, 63, 94, 0.6);
  }
}

.speed-overlay-icon {
  color: var(--rose);
  animation: spin 1s ease-in-out infinite alternate;
}

.speed-overlay-icon svg {
  width: 48px;
  height: 48px;
}

@keyframes spin {
  0% {
    transform: rotate(-10deg);
  }

  100% {
    transform: rotate(10deg);
  }
}

.speed-overlay-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rose);
}

.speed-overlay-speed {
  font-size: 4rem;
  font-weight: 900;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  text-shadow: 0 0 20px rgba(244, 63, 94, 0.5);
}

.speed-overlay-limit {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.speed-overlay-info {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.speed-overlay-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.speed-overlay-info-item .label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.speed-overlay-info-item .value {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  font-family: 'JetBrains Mono', monospace;
}

.speed-overlay-dismiss {
  margin-top: 0.5rem;
  padding: 0.6rem 2rem;
  background: rgba(244, 63, 94, 0.3);
  border: 1px solid rgba(244, 63, 94, 0.5);
  border-radius: 10px;
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all var(--fast);
}

.speed-overlay-dismiss:hover {
  background: rgba(244, 63, 94, 0.5);
}

/* ============= HUD MODE ============= */
.hud-mode .app {
  background: #000;
}

.hud-container {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 600;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.hud-container.active {
  display: flex;
}

.hud-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  transition: transform var(--normal);
}

/* FIX #13: Windshield HUD reflection = horizontal flip (scaleX), NOT vertical (scaleY)
   A reflection on a car windshield mirrors left-right, not up-down. */
.hud-container.mirror .hud-inner {
  transform: scaleX(-1);
}


.hud-speed-val {
  font-size: 10rem;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow);
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}

.hud-speed-unit {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

.hud-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.hud-heading svg {
  width: 24px;
  height: 24px;
}

.hud-direction {
  margin-top: 1.5rem;
}

.hud-direction .direction-icon {
  width: 80px;
  height: 80px;
}

.hud-direction .direction-icon svg {
  width: 48px;
  height: 48px;
}

.hud-controls {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.hud-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  transition: all var(--fast);
}

.hud-btn span,
.hud-btn svg {
  transition: transform var(--normal);
}

.hud-btn svg {
  width: 20px;
  height: 20px;
}

.hud-exit {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.hud-exit:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hud-start {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: white;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.hud-stop {
  background: linear-gradient(135deg, var(--rose), #e11d48);
  color: white;
  box-shadow: 0 0 30px rgba(244, 63, 94, 0.5);
}

.hud-gps {
  position: absolute;
  top: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform var(--normal);
}

/* FIX #13: GPS badge also flips horizontally in mirror mode */
.hud-container.mirror .hud-gps {
  transform: scaleX(-1);
}

.hud-container.flipped .hud-gps {
  transform: scaleY(-1) scaleX(-1);
}


.hud-gps.on {
  border-color: var(--emerald);
  color: var(--emerald);
}

.hud-gps.off {
  border-color: var(--rose);
  color: var(--rose);
}

.hud-gps .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

/* ============= PWA INSTALL ============= */
.pwa-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--accent);
  padding: 1rem;
  z-index: 250;
  animation: slideUp 0.3s ease;
}

.pwa-banner.show {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.pwa-banner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pwa-install-btn {
  padding: 0.6rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), #0891b2);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  transition: all var(--fast);
}

.pwa-install-btn:hover {
  box-shadow: 0 0 20px var(--accent-glow);
}

.pwa-apk-btn {
  padding: 0.6rem 1.5rem;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  transition: all var(--fast);
}

.pwa-apk-btn:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.pwa-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.pwa-dismiss:hover {
  color: white;
}

/* ============= LEAFLET OVERRIDES ============= */
.leaflet-container {
  background: var(--bg-secondary);
  font-family: inherit;
}

.leaflet-control-attribution {
  background: var(--glass-bg) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
  padding: 4px 8px !important;
  border-radius: 4px 0 0 0;
}

.leaflet-control-attribution a {
  color: var(--accent) !important;
}

.custom-marker {
  position: relative;
}

.marker-dot {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent);
  z-index: 2;
}

.marker-pulse {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.3;
  animation: pulse 2s ease-out infinite;
  z-index: 1;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.5;
  }

  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* ============= AUTO-STOP COUNTDOWN BANNER ============= */
.auto-stop-banner {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4), 0 0 0 1px rgba(255,255,255,0.1) inset;
  animation: autoStopSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes autoStopSlideIn {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.auto-stop-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auto-stop-icon {
  font-size: 2rem;
  line-height: 1;
}

.auto-stop-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: white;
}

.auto-stop-text strong {
  font-size: 1rem;
  font-weight: 700;
}

.auto-stop-text span {
  font-size: 0.8rem;
  opacity: 0.9;
}

.auto-stop-text b {
  font-size: 1.1em;
  color: #fef08a;
  font-weight: 800;
}

.auto-stop-actions {
  display: flex;
  gap: 0.5rem;
}

.auto-stop-now {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--fast);
}

.auto-stop-now:hover {
  background: rgba(255, 255, 255, 0.4);
}

.auto-stop-cancel {
  padding: 0.55rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: transparent;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--fast);
}

.auto-stop-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ============= TOAST (FIX #15: queued system needs proper transition) ============= */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  padding: 0.75rem 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
}

/* ============= SCROLLBAR ============= */
.dashboard::-webkit-scrollbar,
.sp-body::-webkit-scrollbar {
  width: 4px;
}

.dashboard::-webkit-scrollbar-track,
.sp-body::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard::-webkit-scrollbar-thumb,
.sp-body::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 2px;
}

.dashboard::-webkit-scrollbar-thumb:hover,
.sp-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ============= ANIMATIONS ============= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Selection */
::selection {
  background: rgba(6, 182, 212, 0.3);
  color: white;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button,
.no-select {
  user-select: none;
  -webkit-user-select: none;
}

/* ============= TRACK PLANNING PANEL ============= */
.track-info {
  margin-bottom: 0.75rem;
}

.track-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.track-empty svg {
  width: 32px;
  height: 32px;
  opacity: 0.4;
}

.track-empty p {
  font-size: 0.75rem;
}

.track-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.track-waypoints-count,
.track-distance-est,
.track-next-wp {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.track-waypoints-count svg,
.track-distance-est svg,
.track-next-wp svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.track-waypoints-count span,
.track-distance-est span {
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
}

.track-next-wp {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.track-next-wp svg {
  color: var(--amber);
}

.track-next-wp strong {
  color: var(--amber);
  font-family: 'JetBrains Mono', monospace;
}

.track-btns {
  display: flex;
  gap: 0.5rem;
}

.track-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.8rem;
  border: 2px solid var(--glass-border);
  background: rgba(6, 182, 212, 0.08);
  color: var(--text-secondary);
  transition: all var(--fast);
}

.track-btn svg {
  width: 16px;
  height: 16px;
}

.track-btn-plan {
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
  background: rgba(99, 102, 241, 0.08);
}

.track-btn-plan:hover {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
}

.track-btn-clear {
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--rose);
  background: rgba(244, 63, 94, 0.08);
  flex: 0 0 auto;
}

.track-btn-clear:hover {
  border-color: var(--rose);
  background: rgba(244, 63, 94, 0.15);
}

/* ============= TRACK PLANNER MODAL ============= */
.track-planner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 400;
  animation: fadeIn 0.2s ease;
}

.track-planner-overlay.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-planner-modal {
  width: 96vw;
  height: 85vh;
  max-width: 900px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.2);
}

.track-planner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(99, 102, 241, 0.08);
  flex-shrink: 0;
}

.track-planner-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #a5b4fc;
}

.track-planner-header h3 svg {
  color: #818cf8;
  width: 18px;
  height: 18px;
}

.track-planner-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tp-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fast);
}

.tp-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.tp-action-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tp-action-btn svg {
  width: 16px;
  height: 16px;
}

.track-planner-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#trackPlannerMap {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: var(--bg-secondary);
}

.track-planner-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
  font-size: 0.75rem;
  color: #a5b4fc;
  flex-shrink: 0;
}

.track-planner-hint svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #818cf8;
}

.track-planner-wp-list {
  max-height: 150px;
  overflow-y: auto;
  padding: 0.25rem 0.5rem;
  flex-shrink: 0;
}

.tp-wp-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--fast);
}

.tp-wp-item:hover {
  background: rgba(99, 102, 241, 0.08);
}

.tp-wp-num {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

.tp-wp-info {
  flex: 1;
  min-width: 0;
}

.tp-wp-label {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0;
  outline: none;
  font-family: inherit;
}

.tp-wp-label:focus {
  border-bottom: 1px solid var(--accent);
}

.tp-wp-coords {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.tp-wp-del {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fast);
  cursor: pointer;
}

.tp-wp-del:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--rose);
}

.tp-wp-del svg {
  width: 14px;
  height: 14px;
}

.track-planner-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(99, 102, 241, 0.05);
  flex-shrink: 0;
}

.tp-footer-info {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tp-footer-info span {
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
}

.tp-footer-btns {
  display: flex;
  gap: 0.5rem;
}

.tp-btn {
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.8rem;
  border: none;
  transition: all var(--fast);
}

.tp-cancel {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.tp-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.tp-save {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.tp-save:hover:not(:disabled) {
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.tp-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Track Waypoint marker on map */
.track-wp-marker {
  background: transparent !important;
  border: none !important;
}

/* Track planner scrollbar */
.track-planner-wp-list::-webkit-scrollbar {
  width: 4px;
}

.track-planner-wp-list::-webkit-scrollbar-track {
  background: transparent;
}

.track-planner-wp-list::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 2px;
}

.track-planner-wp-list::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* ============= RESPONSIVE ============= */
@media (max-width: 1024px) {
  .main {
    flex-direction: column;
  }

  .side-panel {
    width: 100%;
    right: -100%;
  }

  .coords-grid {
    grid-template-columns: 1fr;
  }

  .speed-val {
    font-size: 3.5rem;
  }

  .hud-speed-val {
    font-size: 6rem;
  }

  .track-planner-modal {
    width: 96vw;
    height: 85vh;
    border-radius: 20px 20px 0 0;
  }
}

@media (max-width: 640px) {
  .header {
    padding: 0.5rem;
  }

  .logo h1 {
    font-size: 1rem;
  }

  .vehicle-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .extra-grid {
    grid-template-columns: 1fr;
  }

  .speed-val {
    font-size: 3rem;
  }

  .hud-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .hud-controls {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
    gap: 0.5rem;
  }

  .map-modal {
    width: 90vw;
    height: 85vh;
    border-radius: 20px 20px 0 0;
  }

  .speed-overlay-speed {
    font-size: 3rem;
  }

  .speed-overlay-content {
    padding: 1.5rem 2rem;
  }

  .track-planner-modal {
    width: 96vw;
    height: 85vh;
    border-radius: 0;
  }

  .track-planner-wp-list {
    max-height: 120px;
  }

  .tp-footer-info {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ============= SUMMARY MODAL ============= */
.summary-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.summary-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  width: 100%;
  max-width: 450px;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
}

.summary-body {
  padding: 1.5rem;
}

.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.st-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1px solid transparent;
  transition: all var(--fast);
}

.st-item:hover {
  border-color: var(--accent);
  background: rgba(6, 182, 212, 0.05);
}

.st-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.st-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  font-family: 'JetBrains Mono', monospace;
}

.summary-playback-btn {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all var(--fast);
}

.summary-playback-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

/* ============= PLAYBACK CONTROLS ============= */
.playback-controls {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease-out;
}

.pb-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.pb-info button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
}

.pb-stop {
  background: var(--rose);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
}

/* ============= PERSISTENT TURN-BY-TURN BANNER (FIX #11) ============= */
.turn-banner {
  position: fixed;
  bottom: 5.5rem;
  /* above toast */
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 690;
  background: rgba(10, 10, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 0.6rem 1rem 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 200px;
  max-width: 90vw;
}

.turn-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.turn-banner-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, 0.15);
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.turn-banner-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  transition: color 0.3s;
}

/* Reuse direction classes for colour coding */
.turn-banner-icon.turn-left,
.turn-banner-icon.turn-right {
  border-color: var(--amber);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.turn-banner-icon.turn-left svg,
.turn-banner-icon.turn-right svg {
  color: var(--amber);
}

.turn-banner-icon.u-turn {
  border-color: var(--rose);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.4);
}

.turn-banner-icon.u-turn svg {
  color: var(--rose);
}

.turn-banner-icon.roundabout {
  border-color: var(--orange);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

.turn-banner-icon.roundabout svg {
  color: var(--orange);
}

.turn-banner-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.turn-banner-main {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.turn-banner-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.turn-banner-road {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.turn-banner-dist {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 0 10px var(--accent-glow);
  white-space: nowrap;
}

/* ============= STOP CONFIRM DIALOG ============= */
.stop-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.stop-dialog-overlay.open {
  display: flex;
}

.stop-dialog {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem 1.5rem 1.5rem;
  width: min(90vw, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(244, 63, 94, 0.2);
  animation: slideUp 0.3s ease;
}

.stop-dialog-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.15);
  border: 2px solid rgba(244, 63, 94, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rose);
}

.stop-dialog-icon svg {
  width: 28px;
  height: 28px;
}

.stop-dialog h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin: 0;
}

.stop-dialog p {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.stop-dialog-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.stop-dlg-save {
  padding: 0.875rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--fast);
}

.stop-dlg-save:hover {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.stop-dlg-discard {
  padding: 0.875rem;
  border-radius: 12px;
  border: 1px solid rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.08);
  color: var(--rose);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--fast);
}

.stop-dlg-discard:hover {
  background: rgba(244, 63, 94, 0.18);
}

.stop-dlg-cancel {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all var(--fast);
}

.stop-dlg-cancel:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ============= FAVORITE ROUTE FEATURE ============= */
.trip-fav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fast);
}

.trip-fav-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
}

.trip-fav-btn.active {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.12);
}

.trip-fav-btn svg {
  width: 16px;
  height: 16px;
}

.trip-item.favorite {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}

.trip-item.favorite:hover {
  border-color: var(--amber);
  background: rgba(245, 158, 11, 0.12);
}

.trip-fav-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* History tabs */
.history-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.history-tab {
  flex: 1;
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--fast);
}

.history-tab.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.history-tab:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
}

/* ============= LIGHT MODE ============= */
[data-theme="light"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #e2eaf2;
  --bg-tertiary: #d5e0ea;
  --accent: #0891b2;
  --accent-glow: rgba(8, 145, 178, 0.25);
  --accent-dim: rgba(8, 145, 178, 0.1);
  --emerald: #059669;
  --amber: #d97706;
  --rose: #e11d48;
  --orange: #ea580c;
  --text-primary: #0c1220;
  --text-secondary: rgba(12, 18, 32, 0.8);
  --text-muted: rgba(12, 18, 32, 0.5);
  --border: rgba(8, 145, 178, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.94);
  --glass-border: rgba(8, 145, 178, 0.18);
  --shadow-glow: 0 0 20px rgba(8, 145, 178, 0.15);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Light mode: body & app background */
[data-theme="light"] body {
  background: #f0f4f8;
}

[data-theme="light"] .app {
  background: linear-gradient(135deg, #f0f4f8 0%, #e2eaf2 100%);
}

[data-theme="light"] .app::before {
  background-image:
    linear-gradient(rgba(8, 145, 178, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 145, 178, 0.06) 1px, transparent 1px);
}

/* Light mode: panels & cards */
[data-theme="light"] .panel {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(8, 145, 178, 0.15);
}

[data-theme="light"] .speed-display {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.08), rgba(8, 145, 178, 0.03));
  border-color: rgba(8, 145, 178, 0.25);
}

[data-theme="light"] .speed-val {
  text-shadow: 0 0 15px rgba(8, 145, 178, 0.4);
}

[data-theme="light"] .direction-panel {
  background: rgba(8, 145, 178, 0.07);
}

[data-theme="light"] .direction-icon {
  background: rgba(8, 145, 178, 0.1);
}

[data-theme="light"] .stat-item {
  background: rgba(8, 145, 178, 0.05);
}

[data-theme="light"] .extra-item {
  background: rgba(5, 150, 105, 0.05);
  border-color: rgba(5, 150, 105, 0.12);
}

[data-theme="light"] .vehicle-btn {
  background: rgba(8, 145, 178, 0.05);
}

[data-theme="light"] .vehicle-btn.active {
  background: rgba(8, 145, 178, 0.18);
}

[data-theme="light"] .coord-item {
  background: rgba(8, 145, 178, 0.05);
}

[data-theme="light"] .hdr-btn {
  background: rgba(8, 145, 178, 0.08);
}

[data-theme="light"] .hdr-btn:hover {
  background: rgba(8, 145, 178, 0.18);
  border-color: var(--accent);
}

[data-theme="light"] .hdr-btn.active {
  background: rgba(8, 145, 178, 0.25);
}

[data-theme="light"] .ctrl-btn.btn-reset {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(12, 18, 32, 0.65);
}

[data-theme="light"] .trip-item {
  background: rgba(8, 145, 178, 0.05);
}

[data-theme="light"] .trip-item:hover {
  background: rgba(8, 145, 178, 0.12);
}

[data-theme="light"] .trip-item.favorite {
  background: rgba(217, 119, 6, 0.07);
}

[data-theme="light"] .track-waypoints-count,
[data-theme="light"] .track-distance-est,
[data-theme="light"] .track-next-wp {
  background: rgba(8, 145, 178, 0.05);
}

[data-theme="light"] .setting-input input {
  background: rgba(8, 145, 178, 0.05);
  color: var(--text-primary);
}

[data-theme="light"] .data-btn {
  background: rgba(8, 145, 178, 0.07);
}

[data-theme="light"] .map-gps-badge {
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .stop-dialog {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 30px rgba(225, 29, 72, 0.1);
}

[data-theme="light"] .stats-mini-card {
  background: rgba(8, 145, 178, 0.07);
}

[data-theme="light"] .turn-banner {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(8, 145, 178, 0.2);
}

[data-theme="light"] .offRouteToast {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
}

[data-theme="light"] #toast {
  background: rgba(20, 20, 30, 0.85);
  color: #ffffff;
}

/* Light mode: history tab hover */
[data-theme="light"] .history-tab:hover:not(.active) {
  border-color: rgba(12, 18, 32, 0.2);
  color: var(--text-secondary);
}

/* ============= THEME BUTTON STATES ============= */
#themeCycleBtn[data-mode="light"] {
  background: rgba(217, 119, 6, 0.12);
  color: var(--amber);
  border-color: rgba(217, 119, 6, 0.3);
}

#themeCycleBtn[data-mode="dark"] {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}

#themeCycleBtn[data-mode="auto"] {
  background: rgba(8, 145, 178, 0.1);
  color: var(--accent);
  border-color: rgba(8, 145, 178, 0.25);
}

/* ============= STATISTICS PANEL COMPONENTS ============= */
.stats-mini-card {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.875rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--fast);
}

.stats-mini-card:hover {
  background: rgba(6, 182, 212, 0.14);
  border-color: var(--accent);
}

.stats-mini-card i,
.stats-mini-card svg {
  color: var(--accent);
  flex-shrink: 0;
}

.stats-mini-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.stats-mini-lbl {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stats-chart-section {
  margin-bottom: 1.75rem;
}

.stats-chart-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.stats-chart-title i,
.stats-chart-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.stats-chart-wrap {
  position: relative;
  height: 190px;
  background: rgba(6, 182, 212, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.5rem;
}

[data-theme="light"] .stats-chart-wrap {
  background: rgba(8, 145, 178, 0.03);
}

/* =========================================
   NOMINATIM SEARCH & ROUTING SPINNER
   ========================================= */

/* Nominatim Search */
.nominatim-search-container {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nominatim-input-group {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .nominatim-input-group {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nominatim-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
}

.nominatim-input-group button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0 20px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.nominatim-input-group button:active {
  background: var(--sapphire);
}

.nominatim-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  max-height: 200px;
  overflow-y: auto;
}

.nominatim-result-list li {
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}

.nominatim-result-list li:last-child {
  border-bottom: none;
}

.nominatim-result-list li:hover,
.nominatim-result-list li.nominatim-active {
  background: rgba(6, 182, 212, 0.1);
  color: var(--text-primary);
}

.nominatim-result-list li svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* Routing Loading Overlay */
.tp-route-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 26, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: white;
}

[data-theme="light"] .tp-route-loading {
  background: rgba(255, 255, 255, 0.6);
  color: var(--sapphire);
}

.tp-spinner {
  width: 48px;
  height: 48px;
  animation: tp-spin 2s linear infinite;
  color: var(--accent);
}

.tp-route-loading span {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .tp-route-loading span {
  text-shadow: none;
}

@keyframes tp-spin {
  100% {
    transform: rotate(360deg);
  }
}