/* MowDrift: snow and lawn operations
   Built for a truck cab at 3 AM: dark by default, big tap targets for gloves,
   one loud element (the green "next stop" road sign), everything else quiet. */

@font-face { font-family: 'Overpass'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/overpass-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Overpass'; font-weight: 600; font-display: swap; src: url('../vendor/fonts/overpass-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Overpass'; font-weight: 800; font-display: swap; src: url('../vendor/fonts/overpass-latin-800-normal.woff2') format('woff2'); }

:root {
  --bg: #0E1823;          /* pre-dawn sky */
  --surface: #162332;
  --surface-2: #1E2E41;
  --line: #2B3D52;
  --text: #E8EEF4;        /* snowpack */
  --muted: #93A6BA;       /* road salt */
  --sign: #0B6B4C;        /* highway guide sign */
  --sign-ink: #FFFFFF;
  --amber: #FFB01F;       /* plow light */
  --amber-ink: #1D1400;
  --late: #F2554F;
  --soon: #FF7F3A;
  --today: #E8C34E;
  --later: #7EA6D8;
  --done: #46C28B;
  --focus: #FFD27A;
  --radius-s: 8px;
  --radius-m: 12px;
  --tabs-h: 66px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #EEF3F7;
    --surface: #FFFFFF;
    --surface-2: #F3F6F9;
    --line: #D3DCE5;
    --text: #13202D;
    --muted: #586B7F;
    --amber: #F5A300;
    --late: #D23B36;
    --soon: #D9581A;
    --today: #A07800;
    --later: #3B6CAD;
    --done: #1C935E;
    --focus: #B76E00;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Overpass', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.sheet-open { overflow: hidden; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0.4em 0; }
a { color: inherit; }
code { font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.pad { padding: 16px; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.center { justify-content: center; }
.push-right { margin-left: auto; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
svg { width: 1.2em; height: 1.2em; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px;
  border-radius: var(--radius-m);
  border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-small { min-height: 42px; padding: 0 14px; font-size: 0.92rem; }
.btn-amber { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.danger { color: var(--late); border-color: color-mix(in srgb, var(--late) 45%, transparent); background: transparent; }
.block { width: 100%; }
.link {
  background: none; border: 0; padding: 8px 0; color: var(--muted); font: inherit; font-size: 0.92rem;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 40px;
}
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 1.2rem; width: 44px; height: 44px; cursor: pointer; border-radius: 50%; }

/* ---------- shell ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.2rem; letter-spacing: 0.01em; display: flex; align-items: center; gap: 8px; }
.brand .brand-icon { width: 28px; height: 28px; flex: none; }
.demo-tag { font-size: 0.7rem; font-weight: 700; background: var(--amber); color: var(--amber-ink); padding: 2px 7px; border-radius: 999px; }
.storm-pill {
  margin-left: auto; border: 1.5px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: 0.82rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 36px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.brand { flex: none; }
.storm-pill.on { color: var(--amber-ink); background: var(--amber); border-color: var(--amber); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 800; font-size: 0.85rem; cursor: pointer;
}
.view { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--tabs-h) + env(safe-area-inset-bottom) + 28px); }
.view-board, .view-props, .view-crew { max-width: 980px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tab {
  flex: 1; max-width: 180px; height: var(--tabs-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--text); }
.tab.active svg { color: var(--amber); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.8rem; font-weight: 700; line-height: 1;
  padding: 6px 9px 5px; border-radius: 6px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.chip.tiny { padding: 3px 6px 2px; font-size: 0.72rem; }
.chip.svc { background: transparent; }
.chip.warn { color: var(--soon); border-color: color-mix(in srgb, var(--soon) 50%, transparent); background: transparent; }
.dl-late { color: #fff; background: var(--late); border-color: var(--late); }
.dl-soon { color: #fff; background: var(--soon); border-color: var(--soon); }
.dl-today { color: var(--today); border-color: color-mix(in srgb, var(--today) 55%, transparent); background: color-mix(in srgb, var(--today) 12%, transparent); }
.dl-later { color: var(--later); border-color: color-mix(in srgb, var(--later) 45%, transparent); background: transparent; }

.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.route-chip {
  --rc: var(--muted);
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.route-chip::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--rc); }
.route-chip.active { border-color: var(--rc); box-shadow: inset 0 0 0 1.5px var(--rc); }

/* ---------- route view ---------- */
.route-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 10px; }
.route-head h1 { display: flex; align-items: center; gap: 10px; }
.route-head h1::before { content: ''; width: 14px; height: 14px; border-radius: 4px; background: var(--rc); }
.route-head .muted { margin: 2px 0 0; font-size: 0.9rem; }
.progress-num { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.progress-num strong { color: var(--text); font-size: 1.6rem; font-weight: 800; }
.bar { --rc: var(--done); display: block; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--rc); border-radius: 99px; transition: width 0.4s ease; }
.bar.thick { height: 14px; }

.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 14px 0; padding: 12px 14px; border-radius: var(--radius-m);
  border: 1.5px dashed color-mix(in srgb, var(--amber) 60%, var(--line)); background: color-mix(in srgb, var(--amber) 7%, transparent);
}
.notice p { margin: 0; flex: 1 1 220px; }
.notice-btn { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }

.loc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin: 12px 0 8px; font-size: 0.88rem; }
.loc { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.loc.ok svg { color: #3E8EF7; }
.loc.off svg { color: var(--soon); }
.back-link { margin-bottom: 4px; }

/* The road sign: the one loud thing on the screen. */
.sign { background: var(--sign); color: var(--sign-ink); border-radius: 18px; padding: 6px; margin: 6px 0 22px; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.55); }
.sign-inner { border: 2.5px solid rgba(255, 255, 255, 0.92); border-radius: 13px; padding: 16px 16px 10px; }
.sign-top { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 0.95rem; opacity: 0.88; }
.sign-dist { font-size: 1.15rem; font-weight: 800; opacity: 1; }
.sign h2 { font-size: clamp(1.7rem, 7vw, 2.2rem); margin: 6px 0 2px; }
.sign-addr { font-size: 1.05rem; margin: 0 0 4px; opacity: 0.92; }
.sign .chip { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.32); color: #fff; }
.sign .chip.dl-late { background: var(--late); border-color: #fff; }
.sign .chip.dl-soon { background: var(--soon); border-color: #fff; }
.sign .chip.warn { background: transparent; border-color: #FFC48A; color: #FFD9B3; }
.sign-notes { margin: 12px 0 0; padding: 10px 12px; background: rgba(0, 0, 0, 0.22); border-left: 4px solid var(--amber); border-radius: 6px; font-size: 0.95rem; }
.sign-notes.dark { background: var(--surface-2); color: var(--text); }
.sign-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.sign-actions .btn { min-height: 60px; font-size: 1.05rem; padding: 0 10px; white-space: nowrap; }
.btn-sign-nav { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, 0.85); }
.link.on-sign { color: rgba(255, 255, 255, 0.82); display: block; margin: 4px auto 0; }
.done-sign { background: color-mix(in srgb, var(--sign) 70%, var(--surface)); }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 6px; }
.stops, .prop-list, .route-rows, .route-admin, .people, .att-list, .feed, .done-list ul { list-style: none; margin: 0; padding: 0; }
.stop, .prop {
  width: 100%; display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 4px; background: none; border: 0; border-bottom: 1px solid var(--line);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.num {
  flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); border: 1.5px solid var(--line); font-weight: 800; font-size: 0.95rem;
}
.stop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stop-name { font-weight: 700; }
.stop-addr { color: var(--muted); font-size: 0.88rem; }
.leg { color: var(--muted); font-size: 0.85rem; white-space: nowrap; padding-top: 4px; }
.prop { border-left: 4px solid var(--rc); padding-left: 12px; }

.tools { margin: 16px 0; }
.map-slot { margin: 8px 0 16px; }
.map { height: 380px; border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.num-pin span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font: 800 13px/1 'Overpass', sans-serif; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.35); }

.done-list { margin-top: 18px; border-top: 1px solid var(--line); }
.done-list summary { padding: 14px 0; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.count { background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; font-size: 0.82rem; }
.done-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.done-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--done) 18%, transparent); color: var(--done); flex: none; }
.done-mark.skipped { background: var(--surface-2); color: var(--muted); }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 36px 16px; border: 1.5px dashed var(--line); border-radius: var(--radius-m); margin: 12px 0; }
.empty p { color: var(--muted); max-width: 42ch; margin: 8px auto 16px; }
.empty.small { padding: 18px; }
.empty.small p { margin-bottom: 10px; }

/* ---------- board ---------- */
.storm-card { display: grid; gap: 14px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; }
.storm-card.on { border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); }
.storm-card .bar > span { background: var(--amber); }
.big-count { display: flex; align-items: baseline; gap: 10px; }
.big-count strong { font-size: 3.2rem; font-weight: 800; line-height: 1; }
.big-count span { color: var(--muted); }
.board-grid { display: grid; gap: 8px 28px; }
@media (min-width: 820px) { .board-grid { grid-template-columns: 1.15fr 1fr; } }
.section-title { font-size: 1.05rem; margin: 18px 0 10px; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.route-rows li, .route-admin li { margin-bottom: 10px; }
.route-row {
  width: 100%; display: grid; gap: 8px; padding: 14px 14px 12px;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--rc);
  border-radius: var(--radius-m); color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.route-row .bar { --rc: inherit; }
.route-row .bar > span { background: var(--rc); }
.route-row-top, .route-row-meta { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.route-name { font-weight: 800; font-size: 1.05rem; }
.route-count { color: var(--muted); }
.route-count strong { color: var(--text); font-size: 1.25rem; }
.route-row-meta { color: var(--muted); font-size: 0.85rem; }
.att { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 0; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.att > span:nth-child(2) { flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.hollow { border: 2px solid var(--soon); }
.feed li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.feed-time { color: var(--muted); min-width: 64px; }

/* ---------- properties / crew ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.search {
  width: 100%; min-height: 50px; padding: 0 14px; margin-bottom: 10px;
  border-radius: var(--radius-m); border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit;
}
.route-tag { color: var(--text); }
.chip.price { color: var(--done); border-color: color-mix(in srgb, var(--done) 45%, transparent); background: color-mix(in srgb, var(--done) 10%, transparent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 14px 0; }
.pending-card { border-color: color-mix(in srgb, var(--amber) 60%, var(--line)); }
.person { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.person .person-id { grid-column: 1 / -1; }
.people li:last-child { border-bottom: 0; }
.pending-card .person { grid-template-columns: 1fr; }
@media (min-width: 640px) { .person { grid-template-columns: 1.4fr 1fr 1fr; align-items: end; } .person .person-id { grid-column: auto; } .pending-card .person { grid-template-columns: 1fr auto; align-items: center; } }
.person-id { display: flex; flex-direction: column; }
.mini { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.invite p { color: var(--muted); }
.copy-row { display: flex; gap: 8px; margin-top: 10px; }
.copy-row input { flex: 1; min-width: 0; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 0.9rem; }
input, select, textarea {
  font: inherit; font-weight: 400; font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--radius-s);
  min-height: 48px; padding: 10px 12px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
input[type='checkbox'], input[type='radio'] { width: 22px; height: 22px; min-height: 0; accent-color: var(--amber); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; }
legend { font-weight: 800; font-size: 0.9rem; padding: 0 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch span { display: block; width: 40px; height: 40px; border-radius: 10px; background: var(--c); border: 3px solid transparent; cursor: pointer; }
.swatch input:checked + span { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--bg); }
.swatch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 600; }
.pin-address { margin: 0; min-height: 1.2em; }
.pin-address.ok { color: var(--done); font-weight: 600; }
.link.inline { min-height: 0; padding: 0; font-size: inherit; color: var(--amber); font-weight: 700; }
.pin-map { height: 220px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface-2); }
.format { font-weight: 800; background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-s); }
.preview { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 0.82rem; color: var(--text); }
.preview th, .preview td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.warn-text { color: var(--soon); font-weight: 800; }
.status-line { font-weight: 700; color: var(--done); }
details.install summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
details.install p { font-size: 0.9rem; color: var(--muted); }

/* ---------- photos ---------- */
.photos { display: grid; gap: 8px; }
.photos-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-top: 4px; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumb {
  position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); color: var(--text);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72)); color: #fff;
  font-size: 0.72rem; font-weight: 600; line-height: 1.2; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb.add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1.5px dashed color-mix(in srgb, var(--amber) 60%, var(--line)); background: transparent;
  font-size: 0.82rem; font-weight: 700;
}
.thumb.add .plus { font-size: 1.7rem; line-height: 1; color: var(--amber); }
.thumb.add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.thumb.add:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.photo-box .photos { gap: 6px; }
.sign-links { display: flex; justify-content: center; gap: 4px 22px; flex-wrap: wrap; margin-top: 4px; }
.sign-links .link.on-sign { margin: 0; }

.lightbox {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
  background: #05090E; color: #E8EEF4;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 16px; font-weight: 800; }
.lb-close { color: #E8EEF4; }
.lb-img { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.lb-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-info { padding: 12px 16px 18px; display: grid; gap: 10px; max-width: 720px; width: 100%; margin: 0 auto; }
.lb-info .muted { color: #93A6BA; }
.lb-cap { display: flex; gap: 8px; }
.lb-cap input { flex: 1; min-width: 0; background: #162332; color: #E8EEF4; border-color: #2B3D52; }
.lb-caption { font-size: 1.05rem; font-weight: 600; margin: 0; }
.lb-info .btn.danger { justify-self: start; }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: none; }
.sheet.open { display: block; }
.scrim { position: absolute; inset: 0; background: rgba(4, 9, 15, 0.6); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 20px 20px 0 0; border-top: 1px solid var(--line);
  padding: 8px 18px calc(env(safe-area-inset-bottom) + 22px);
  display: grid; gap: 12px; align-content: start;
  animation: sheet-up 0.22s ease-out;
}
@media (min-width: 700px) {
  .sheet-panel { left: 50%; right: auto; bottom: auto; top: 6vh; width: 560px; transform: translateX(-50%); border-radius: 18px; border: 1px solid var(--line); max-height: 88vh; animation: none; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: -8px; background: var(--surface); padding: 10px 0 4px; z-index: 2; }
.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.sheet-actions .btn { flex: 1 1 160px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 14px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: var(--radius-m);
  background: var(--text); color: var(--bg); font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35); transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-btn { background: none; border: 0; color: var(--amber); font: inherit; font-weight: 800; cursor: pointer; padding: 6px 4px; }
@media (prefers-color-scheme: light) { .toast-btn { color: #FFC54D; } }

/* ---------- login / splash ---------- */
.splash, .login { max-width: 460px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 40px) 18px 40px; }
.splash { text-align: center; display: grid; gap: 12px; justify-items: center; }
.splash p { color: var(--muted); }
.brand-mark { font-weight: 800; font-size: 2.6rem; letter-spacing: -0.02em; display: flex; align-items: center; justify-content: inherit; gap: 14px; }
.brand-mark .brand-icon { width: 54px; height: 54px; }
.splash .brand-mark { justify-content: center; }
.login-sign .brand-icon { border-radius: 22%; box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.92); }
.login-sign { background: var(--sign); color: #fff; border-radius: 18px; padding: 6px; margin-bottom: 22px; }
.login-sign-inner { border: 2.5px solid rgba(255, 255, 255, 0.92); border-radius: 13px; padding: 22px 18px; }
.login-sign-inner p { margin: 4px 0 0; opacity: 0.9; }
.login .card h1 { font-size: 1.35rem; }
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.setup-note { padding: 16px; border: 1.5px dashed var(--line); border-radius: var(--radius-m); margin-bottom: 16px; display: grid; gap: 12px; }
.setup-note p { margin: 0; color: var(--muted); }
.setup-note strong { color: var(--text); }

/* ---------- leaflet in dark mode ---------- */
.leaflet-container { font-family: inherit; }
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: brightness(0.82) contrast(1.05) saturate(0.85); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
