:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --text: #16181b;
  --muted: #62666d;
  --line: #e2e2de;
  --accent: #d6232a;          /* brand red */
  --accent-ink: #ffffff;
  --ok: #138a4a;
  --ok-bg: #e3f4ea;
  --warn: #9a5b00;
  --warn-bg: #fdf0d9;
  --off: #5b6068;
  --off-bg: #eceded;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1113;
    --surface: #181b1e;
    --text: #eceef0;
    --muted: #9aa0a6;
    --line: #2a2e33;
    --accent: #ef3b42;
    --ok: #4cd08a;
    --ok-bg: #12301f;
    --warn: #f3b44b;
    --warn-bg: #36280e;
    --off: #a3a8ae;
    --off-bg: #25282c;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.1rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 20px; height: 20px; }

.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .8rem; border-radius: 999px; font-weight: 700; font-size: .95rem;
}
.pill::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.st-available { color: var(--ok); background: var(--ok-bg); }
.st-available::before { animation: pulse 1.8s ease-out infinite; }
.st-busy { color: var(--warn); background: var(--warn-bg); }
.st-off { color: var(--off); background: var(--off-bg); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 .5rem transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.demo-banner {
  background: var(--warn-bg); color: var(--warn); text-align: center;
  padding: .45rem 1rem; font-size: .85rem; font-weight: 600;
}

/* Car marker */
.car-pin { position: relative; width: 44px; height: 44px; }
.car-pin .dot {
  position: absolute; inset: 6px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35);
  display: grid; place-items: center;
}
.car-pin .dot svg { width: 18px; height: 18px; fill: #fff; }
.car-pin.available::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--accent); animation: ring 2s ease-out infinite;
}
.car-pin.off .dot { background: #7a7f86; }
.car-pin.busy .dot { background: #d48a00; }
@keyframes ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }

.leaflet-container { font: inherit; background: var(--bg); }
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: brightness(.8) contrast(1.1); }
}
