:root {
  --bg: #020617;
  --card: #0b1220;
  --line: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent2: #818cf8;
  --ok: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;
}
* { box-sizing: border-box; }
html, body { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #0c4a6e55, transparent),
              radial-gradient(900px 500px at 100% 0%, #312e8155, transparent),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
.app { max-width: 560px; margin: 0 auto; padding: 16px; padding-bottom: 40px; }
.app.wide { max-width: 1100px; }
header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 14px; gap: 12px;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.brand.xl { font-size: 32px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pill {
  background: #0f172a; border: 1px solid var(--line); color: var(--accent);
  padding: 6px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap;
  display: inline-block;
}
.card {
  background: linear-gradient(180deg, #0f172acc, var(--card));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 10px 40px #0006;
}
.card h2 { margin: 0 0 12px; font-size: 16px; }
label { display:block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
input, select, button, textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #020617;
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px; /* mobile: avoid iOS zoom */
}
button {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #04111f; font-weight: 800; cursor: pointer;
  width: auto; padding: 12px 16px;
}
button.secondary { background: #0f172a; color: var(--text); border: 1px solid var(--line); font-weight: 700; }
button.danger { background: #7f1d1d; color: #fecaca; }
button:active { transform: scale(0.98); }
button.big {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
  border-radius: 14px;
}
.row { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display:flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions.stack { flex-direction: column; }
.item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px;
  background: #02061788; cursor: pointer;
}
.item:hover { border-color: #334155; }
.item.job { cursor: default; }
.muted { color: var(--muted); font-size: 13px; }
.price { color: var(--ok); font-weight: 800; }
.status {
  display:inline-block; padding: 2px 8px; border-radius: 999px;
  background: #172554; color: #93c5fd; font-size: 12px;
}
.ok { color: var(--ok); }
.err { color: var(--danger); }
.timeline { padding-left: 18px; margin: 8px 0; }
.timeline li { margin: 6px 0; font-size: 13px; }
footer { padding: 8px 2px 24px; font-size: 12px; }
pre {
  background: #020617; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; overflow:auto; font-size: 11px; color: #cbd5e1;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* chips — place picker */
.chips { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.chip {
  width: auto !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  font-weight: 600;
  background: #0f172a !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
}
.chip.on {
  background: linear-gradient(135deg, var(--accent), var(--accent2)) !important;
  color: #04111f !important;
  border: none !important;
}

/* home gates */
.home-hero { flex-direction: column; align-items: flex-start; margin: 24px 0 20px; }
.gate {
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(180deg, #0f172acc, var(--card));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px;
  margin-bottom: 12px;
  color: inherit;
  box-shadow: 0 10px 40px #0006;
}
.gate:active { transform: scale(0.99); }
.gate.driver { border-color: #065f46; }
.gate.admin { border-color: #1e3a8a; }
.gate-icon { font-size: 28px; width: 44px; text-align: center; }
.gate-title { font-size: 18px; font-weight: 800; }
.gate-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* driver badges */
.badge {
  display:inline-block; padding: 6px 12px; border-radius: 999px;
  font-weight: 800; font-size: 13px;
}
.badge.on { background: #064e3b; color: #6ee7b7; }
.badge.off { background: #1e293b; color: #94a3b8; }
.status-line { display:flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 420px) {
  .row { grid-template-columns: 1fr; }
  .app { padding: 12px; }
}
