:root {
  --bg: #f4f5f7; --card: #ffffff; --ink: #14181f; --muted: #5d6675; --line: #dfe3ea;
  --brand: #0a47a1; --brand-ink: #ffffff; --accent: #f5c400; --good: #12805c; --bad: #c0392b; --warn: #b26a00;
  --soft: #eef2fb; --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1218; --card: #181c25; --ink: #eef1f6; --muted: #9aa4b5; --line: #2a303c; --brand: #5b8def; --brand-ink: #0b1020; --soft: #1d2433; --good: #3ecf9a; --bad: #ff7a6b; --warn: #f0b24a; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 1.35rem; margin: 0; } h2 { font-size: 1.1rem; margin: 0 0 10px; } h3 { font-size: 1rem; margin: 0 0 6px; }
p { margin: 0 0 10px; } a { color: var(--brand); }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 60px; }
.wrap.wide { max-width: 1040px; }
.top { background: var(--brand); color: var(--brand-ink); padding: 14px 16px; }
.top .wrap { padding: 0 ; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top a { color: inherit; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .right { text-align: right; } .center { text-align: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .row > .grow { flex: 1 1 160px; min-width: 0; }
.stepno { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: .85rem; margin-right: 8px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
textarea { min-height: 76px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; flex: none; margin: 2px 0 0; accent-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .92rem; margin: 12px 0; }
button, .btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.good { background: var(--good); border-color: var(--good); color: #fff; }
button.danger { color: var(--bad); border-color: var(--bad); }
button.block { width: 100%; } button:disabled { opacity: .5; cursor: not-allowed; }
button.sm, .btn.sm { min-height: 36px; padding: 6px 10px; font-size: .85rem; }
.plate { background: var(--accent); color: #111; font: 700 1.7rem/1 "Arial Narrow", Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; text-align: center; border: 2px solid #111; border-radius: 8px; padding: 12px; }
.err { color: var(--bad); font-weight: 600; margin: 8px 0; } .ok { color: var(--good); font-weight: 600; }
.notice { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 10px 0; }
.notice.warn { background: color-mix(in srgb, var(--warn) 15%, var(--card)); }
.choice { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; cursor: pointer; font-weight: 400; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--soft); }
.choice b { display: block; }
.price { font-size: 1.6rem; font-weight: 800; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .95rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; }
.hidden { display: none !important; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--soft); color: var(--ink); white-space: nowrap; }
.badge.good { background: color-mix(in srgb, var(--good) 18%, var(--card)); color: var(--good); }
.badge.bad { background: color-mix(in srgb, var(--bad) 16%, var(--card)); color: var(--bad); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, var(--card)); color: var(--warn); }
.banner { background: var(--accent); color: #111; text-align: center; font-size: .85rem; font-weight: 600; padding: 6px 12px; }

/* tracking */
.big { font-size: 3.2rem; font-weight: 800; line-height: 1; }
.dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); } .dot.done { background: var(--good); } .dot.you { background: var(--brand); outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); }
#map, #routemap { height: 320px; border-radius: 12px; border: 1px solid var(--line); margin-top: 12px; z-index: 0; }
.van { font-size: 26px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.pin { background: var(--brand); color: #fff; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 13px system-ui; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.pin.done { background: #7b8494; }

/* admin */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.tabs button { flex: none; } .tabs button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.scroll { overflow-x: auto; }
td input, td select { padding: 7px 8px; min-width: 70px; }
.job { border-left: 5px solid var(--brand); }
.job.done { border-left-color: var(--good); opacity: .75; } .job.active { border-left-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.job .num { font-size: 1.3rem; font-weight: 800; min-width: 30px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .grid3 { grid-template-columns: 1fr 1fr; } }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); width: min(620px, 94vw); max-height: 90vh; padding: 18px; }
dialog::backdrop { background: rgba(0,0,0,.5); }
.stat { background: var(--soft); border-radius: 12px; padding: 12px; } .stat b { display: block; font-size: 1.3rem; }

/* ================= brand theme: matches www.mileageservice.com ================= */
.theme-dark { --bg: #060a14; --card: #0e1526; --ink: #e9eef8; --muted: #9aa7bd; --line: #26324f; --brand: #3d7bf0; --brand-ink: #fff; --soft: #141d33; --good: #3ecf9a; --bad: #ff7a6b; --warn: #f0b24a; --accent: #f8ce1b; color-scheme: dark; }
.theme-dark body { min-height: 100vh; background: radial-gradient(60% 420px at 85% 0, rgba(61,123,240,.24), transparent 70%), radial-gradient(50% 320px at 0 0, rgba(10,71,161,.38), transparent 70%), var(--bg); background-repeat: no-repeat; }
.theme-dark h1, .theme-dark h2, .theme-dark h3 { font-family: "Segoe UI Variable Display", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -.02em; }
.theme-dark .top { background: rgba(6,10,20,.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.08); padding: 12px 16px; color: #fff; }
.theme-dark .top .wrap { min-height: 46px; }
.logo { text-decoration: none; display: inline-block; }
.wm { --needle: #ff5d5d; display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; color: #fff; }
.wm-top { font: 700 1.5rem/1 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; letter-spacing: .035em; display: inline-flex; align-items: center; }
.wm-g { width: .86em; height: .86em; margin: 0 .03em 0 .05em; color: #3d7bf0; flex: none; }
.wm-sub { font: 700 .6rem/1 system-ui, sans-serif; letter-spacing: .44em; text-transform: uppercase; margin-top: 5px; color: #c9d4ea; padding-left: .12em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.top .tel { color: #fff; font-weight: 700; text-decoration: none; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; padding: 8px 12px; font-size: .9rem; }
.top .office { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 auto 0 14px; font-weight: 700; }
.intro { padding: 22px 2px 4px; } .intro h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); font-weight: 800; line-height: 1.1; margin-bottom: 6px; } .intro p { color: var(--muted); margin: 0; }
.theme-dark .card { border-radius: 18px; box-shadow: 0 24px 60px -40px rgba(0,0,0,.9); }
.theme-dark input, .theme-dark select, .theme-dark textarea { background: #0a1020; border-color: var(--line); }
.theme-dark .plate { background: var(--accent); color: #111; border-color: #0b0e16; box-shadow: 0 14px 40px -16px rgba(248,206,27,.5); }
.theme-dark .plate::placeholder { color: rgba(0,0,0,.3); }
.theme-dark button, .theme-dark .btn { border-radius: 12px; }
.theme-dark button.primary, .theme-dark .btn.primary, .theme-dark .tabs button.on { background: linear-gradient(180deg, #4b87f5, #2a66de); border-color: transparent; color: #fff; box-shadow: 0 10px 28px -12px rgba(61,123,240,.95), inset 0 1px 0 rgba(255,255,255,.22); }
.theme-dark button.good { background: #12805c; border-color: #12805c; }
.theme-dark .stepno { background: linear-gradient(180deg, #4b87f5, #0a47a1); }
.theme-dark .choice { background: #0a1020; }
.theme-dark .choice:has(input:checked) { border-color: var(--brand); background: rgba(61,123,240,.14); }
.theme-dark .notice { background: var(--soft); border: 1px solid var(--line); }
.theme-dark .notice.warn { background: rgba(240,178,74,.1); border-color: rgba(240,178,74,.35); }
.theme-dark .tabs { background: var(--bg); }
.theme-dark dialog { box-shadow: 0 40px 90px rgba(0,0,0,.7); }
.theme-dark .dot { background: #2a3654; }
.theme-dark a { color: #8fb4ff; } .theme-dark a.btn.primary { color: #fff; } .theme-dark a.btn { color: var(--ink); }
.theme-dark .leaflet-container a { color: #0078a8; }
.logo { flex: none; } .wm-sub { white-space: nowrap; } .top .office { white-space: nowrap; } .top button { white-space: nowrap; flex: none; }
@media (max-width: 480px) { .top .office { display: none; } }
