:root {
  --navy: #0f1b3d; --navy2: #17285a; --amber: #f6b900; --bg: #eef1f6; --card: #fff; --line: #e1e6ee;
  --text: #14213d; --muted: #566274; --green: #17874f; --green-bg: #ddf3e6; --red: #c8283c; --red-bg: #fce4e7;
  --warn: #6b4e00; --warn-bg: #fff3cc; --blue: #1d4e89; --blue-bg: #e1ecfa; --grey-bg: #e8ecf1;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, 'Noto Sans Devanagari', 'Hind', sans-serif; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: linear-gradient(135deg, var(--navy2), var(--navy)); color: #fff; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: var(--amber); display: grid; place-items: center; }
.top b { font-size: 19px; letter-spacing: .2px; }
.top small { display: block; font-size: 12px; opacity: .75; line-height: 1.1; }
.top .grow { flex: 1; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; }

main { max-width: 600px; margin: 0 auto; padding: 16px 16px 96px; display: flex; flex-direction: column; gap: 14px; }
.wide main { max-width: 1040px; }
.cols { display: grid; gap: 14px; }
@media (min-width: 900px) { .wide .cols { grid-template-columns: 1.4fr 1fr; align-items: start; } }

.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: center; gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.nav a { position: relative; flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--muted); }
.nav a.on { background: var(--navy); color: #fff; }
.nav a.on svg { color: var(--amber); }
.badge { position: absolute; top: 2px; right: 22%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.card.amber { background: var(--warn-bg); border-color: #e8c766; }
.card.red { background: var(--red); border-color: var(--red); color: #fff; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--grey-bg); color: var(--muted); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; }
.btn svg { color: var(--amber); }
.btn.green { background: var(--green); } .btn.green svg { color: #fff; }
.btn.red { background: var(--red); } .btn.red svg { color: #fff; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); } .btn.ghost svg { color: var(--navy); }
.btn.sm { min-height: 38px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; }

.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea { min-height: 48px; padding: 8px 12px; border: 1.5px solid #b8c2d0; border-radius: 12px; background: #fff; font-weight: 400; font-size: 16px; }
.field textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; }
.err { color: var(--red); font-weight: 600; min-height: 1.4em; }

.login { max-width: 420px; margin: 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 18px; }
.login .logo { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, var(--navy2), var(--navy)); }
.login h1 { font-size: 30px; }

.duty { min-height: 72px; font-size: 19px; }
.codebox { font-size: 44px; font-weight: 800; letter-spacing: 10px; text-align: center; color: var(--navy); }
.speed { font-size: 34px; font-weight: 700; }
.speed.over { color: var(--red); }
.panic { min-height: 64px; font-size: 18px; }
.kid { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.kid:first-child { border-top: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue-bg); color: var(--blue); display: grid; place-items: center; flex-shrink: 0; }
.alert { border-left: 5px solid var(--blue); }
.alert.warn { border-left-color: #e08a00; }
.alert.severe { border-left-color: var(--red); background: var(--red-bg); }

.map { position: relative; height: 320px; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: #e4ebe0; touch-action: none; cursor: grab; }
.mk { width: 38px; height: 38px; pointer-events: none; border-radius: 50%; border: 3px solid #fff; display: grid; place-items: center; background: var(--navy); color: var(--amber); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.mk.pin { background: var(--green); color: #fff; width: 32px; height: 32px; }
.mk.off { background: #6b7686; color: #fff; }

.sheet-back { position: fixed; inset: 0; z-index: 40; background: rgba(11, 18, 32, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 600px; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: #fff; display: flex; flex-direction: column; gap: 12px; }

.toasts { position: fixed; bottom: 88px; left: 12px; right: 12px; z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { max-width: 560px; padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.toast.warn { background: #8a5a00; }
.toast.severe { background: var(--red); font-size: 18px; }

@media (prefers-reduced-motion: no-preference) { .toast { animation: pop .25s ease-out; } @keyframes pop { from { transform: translateY(-8px); opacity: 0; } } }
