:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: 210 40% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 11%;
  --primary: 199 89% 34%;
  --primary-foreground: 0 0% 100%;
  --secondary: 212 32% 91%;
  --secondary-foreground: 222 47% 11%;
  --muted: 210 32% 93%;
  --muted-foreground: 215 16% 39%;
  --accent: 25 95% 53%;
  --accent-foreground: 222 47% 11%;
  --destructive: 0 72% 45%;
  --destructive-foreground: 0 0% 100%;
  --success: 158 64% 31%;
  --success-foreground: 0 0% 100%;
  --warning: 38 92% 44%;
  --warning-foreground: 222 47% 11%;
  --info: 221 83% 53%;
  --info-foreground: 0 0% 100%;
  --border: 214 32% 84%;
  --input: 214 32% 84%;
  --ring: 199 89% 34%;
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px hsl(var(--foreground) / 0.05);
  --shadow-md: 0 4px 12px hsl(var(--foreground) / 0.08);
  --shadow-lg: 0 12px 32px hsl(var(--foreground) / 0.12);
  --shadow-elegant: 0 20px 60px hsl(var(--primary) / 0.20);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --background: 222 47% 7%;
  --foreground: 210 40% 96%;
  --card: 222 44% 11%;
  --card-foreground: 210 40% 96%;
  --popover: 222 44% 11%;
  --popover-foreground: 210 40% 96%;
  --primary: 195 91% 48%;
  --primary-foreground: 222 47% 7%;
  --secondary: 217 33% 18%;
  --secondary-foreground: 210 40% 96%;
  --muted: 217 33% 16%;
  --muted-foreground: 215 20% 72%;
  --accent: 31 96% 56%;
  --accent-foreground: 222 47% 7%;
  --destructive: 0 72% 54%;
  --destructive-foreground: 0 0% 100%;
  --success: 158 64% 42%;
  --success-foreground: 222 47% 7%;
  --warning: 43 96% 56%;
  --warning-foreground: 222 47% 7%;
  --info: 217 91% 60%;
  --info-foreground: 222 47% 7%;
  --border: 217 33% 24%;
  --input: 217 33% 24%;
  --ring: 195 91% 48%;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 20% 0%, hsl(var(--primary) / 0.12), transparent 32rem),
    radial-gradient(circle at 90% 10%, hsl(var(--accent) / 0.12), transparent 28rem),
    hsl(var(--background));
  color: hsl(var(--foreground));
}
button, input { font: inherit; }
input { font-size: max(16px, 1rem); }

.signal-panel {
  background:
    linear-gradient(135deg, hsl(var(--card) / 0.96), hsl(var(--card) / 0.82)),
    repeating-linear-gradient(90deg, hsl(var(--primary) / 0.16) 0 1px, transparent 1px 4rem);
}

.road-grid {
  background-image:
    linear-gradient(hsl(var(--border) / 0.75) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.75) 1px, transparent 1px);
  background-size: 2rem 2rem;
}

.lift {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.lift:hover { transform: translateY(-0.125rem); box-shadow: var(--shadow-md); }
.lift:active { transform: translateY(0); }

.safe-bottom { padding-bottom: calc(env(safe-area-inset-bottom) + 0.5rem); }
.safe-top { padding-top: env(safe-area-inset-top); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}