@font-face { font-family: 'Plex Condensed'; src: url('/assets/vendor/plex-condensed-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Plex Condensed'; src: url('/assets/vendor/plex-condensed-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Plex Condensed'; src: url('/assets/vendor/plex-condensed-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('/assets/vendor/public-sans.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  /* Overcast morning after a storm: the page is sky, the hail is the only color. */
  --sky: #e9edef;
  --paper: #f7f8f9;
  --ink: #14212b;
  --slate: #5b6b76;
  --rule: #cfd6db;
  --ice: #7cc8dc;
  --hot: #d8327f;
  --lead: #1d7a55;
  --display: 'Plex Condensed', 'Arial Narrow', sans-serif;
  --body: 'Public Sans', -apple-system, 'Segoe UI', sans-serif;
  --r: 4px;
  --page: #eef1f3;
  --card: #ffffff;
  --soft: #2c3b46;
  --track: #dfe4e7;
  --hover: #e6ebee;
  --on-ink: #ffffff;
  --ink-hover: #22323e;
  --wind: #c27a12;
  --alert: #b3263e;
}
/* Only the dashboard sets a theme; the brief and the public pages stay light. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --sky: #0a1116; --page: #0a1116; --paper: #0e161c; --card: #121b22; --rule: #26343e;
  --ink: #ffffff; --slate: #a9b8c2; --soft: #c9d5dc; --lead: #6fd0a6; --track: #26343e;
  --hover: #17222a; --on-ink: #0e161c; --ink-hover: #dfe6ea; --wind: #e09a3a; --alert: #ff7a8c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sky); color: var(--ink); font: 16px/1.5 var(--body); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -0.005em; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid #2f6fd6; outline-offset: 2px; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 600; }
.muted { color: var(--slate); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Hailstone mark: concentric growth rings, sized to the stone. */
.stone { display: inline-block; flex: none; vertical-align: middle; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: var(--r);
  background: var(--ink); color: var(--on-ink); font-weight: 650; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--ink-hover); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.ghost:hover { background: var(--card); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* ---------- Brief (phone first) ---------- */
.brief { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(300px, 52svh) auto; min-height: 100svh; }
.brief .map { position: sticky; top: 0; height: 52svh; min-height: 300px; z-index: 0; }
.sheet {
  position: relative; z-index: 1; margin-top: -18px; background: var(--paper);
  border-radius: 14px 14px 0 0; box-shadow: 0 -1px 0 var(--rule); padding: 10px 18px 40px;
}
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--rule); margin: 0 auto 14px; }
.when { font-size: 14px; color: var(--slate); }
.sheet h1 { font-size: clamp(30px, 8.4vw, 44px); margin: 4px 0 16px; text-wrap: balance; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-block: 1px solid var(--rule); margin-bottom: 16px; }
.facts > div { padding: 12px 0; }
.facts > div + div { padding-left: 14px; border-left: 1px solid var(--rule); }
.facts .num { display: block; font-size: 30px; line-height: 1; }
.facts small { display: block; color: var(--slate); font-size: 13px; line-height: 1.3; margin-top: 5px; }
.facts .size { display: flex; align-items: center; gap: 8px; }
.facts .num .u { font-size: 16px; margin-left: 3px; }

.go { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 22px; }
.go .btn { min-height: 54px; font-size: 17px; }

.zones { display: flex; gap: 6px; overflow-x: auto; margin: 0 -18px 18px; padding: 2px 18px; scrollbar-width: none; }
.zones button {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 9px; border: 0; border-radius: var(--r);
  background: transparent; box-shadow: inset 0 0 0 1px var(--rule); cursor: pointer; text-align: left; line-height: 1.2;
}
.zones button[aria-pressed='true'] { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.zones b { display: block; font-size: 14px; }
.zones span { font-size: 12.5px; color: var(--slate); }

h2.sec { font-size: 21px; margin: 26px 0 4px; }
.sec + .muted { font-size: 14px; margin-bottom: 10px; }

.stops { list-style: none; margin: 0; padding: 0; }
.stop { display: grid; grid-template-columns: 30px 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.stop .n {
  width: 28px; height: 28px; border: 0; padding: 0; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center;
  font: 600 14px/1 var(--display); cursor: pointer;
}
.stop .street { font-weight: 650; line-height: 1.25; }
.stop .detail { font-size: 13.5px; color: var(--slate); display: flex; gap: 6px; align-items: center; }
.stop .acts { display: flex; gap: 6px; }
.stop .acts button {
  min-width: 44px; min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--r); background: #fff;
  box-shadow: inset 0 0 0 1px var(--rule); font-size: 14px; font-weight: 600; cursor: pointer;
}
.stop .acts button[aria-pressed='true'] { background: var(--ink); color: #fff; box-shadow: none; }
.stop .acts .lead[aria-pressed='true'] { background: var(--lead); }
.stop.done .n { background: #7d8a93; }
.stop.done .street { color: var(--slate); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.stop.skip { opacity: 0.55; }
.tally { display: flex; gap: 18px; margin: 12px 0 0; font-size: 14px; color: var(--slate); }
.tally b { color: var(--ink); font-family: var(--display); font-size: 18px; }

.reports { list-style: none; margin: 0; padding: 0; }
.reports li { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.reports .num { font-size: 18px; display: flex; align-items: center; gap: 8px; min-width: 76px; }
.reports p { font-size: 14px; }
.reports p span { color: var(--slate); }
.more { background: none; border: 0; padding: 10px 0; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.legend {
  position: absolute; left: 10px; bottom: 28px; z-index: 2; display: flex; gap: 2px; align-items: flex-end;
  background: rgba(247, 248, 249, 0.92); padding: 6px 8px 5px; border-radius: var(--r); font-size: 11px; color: var(--slate);
  backdrop-filter: blur(4px);
}
.legend span { display: grid; justify-items: center; gap: 2px; min-width: 26px; }
.legend i { display: block; width: 26px; height: 8px; }
.legend .unit { align-self: center; padding-left: 4px; }
.legend .wl { align-self: center; margin-left: 12px; }
.legend .wl i { width: 22px; height: 10px; background: repeating-linear-gradient(135deg, var(--wind) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1.5px var(--wind); }

.about { margin-top: 30px; font-size: 13px; color: var(--slate); }
.about a { color: var(--slate); }

/* ---------- Dashboard ---------- */
.brand { display: flex; align-items: center; gap: 8px; font: 700 21px/1 var(--display); text-decoration: none; }
/* The sidebar's color runs the full height of the page, even past the sticky panel. */
.dash { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100svh; background: linear-gradient(90deg, var(--paper) 239px, var(--rule) 239px 240px, var(--page) 240px); }
.side {
  position: sticky; top: 0; align-self: start; height: 100svh; overflow-y: auto; display: flex; flex-direction: column; gap: 28px;
  padding: 24px 16px; background: var(--paper); border-right: 1px solid var(--rule);
}
.side .brand { padding: 0 10px; font-size: 23px; gap: 9px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r);
  background: none; color: var(--soft); font-size: 15px; font-weight: 600; text-align: left; cursor: pointer;
}
.nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav:hover { background: var(--hover); color: var(--ink); }
.nav[aria-current] { background: var(--ink); color: var(--on-ink); }
/* Plan and the settings pages sit behind "More" in the phone's tab bar; here they're plain sidebar items. */
#more { display: none; }
.extra { display: contents; }
.acct { margin-top: auto; display: grid; gap: 12px; }
.acct p { display: grid; gap: 3px; padding: 16px 12px 0; border-top: 1px solid var(--rule); font-size: 13.5px; line-height: 1.4; color: var(--slate); }
.acct b { font-size: 15px; font-weight: 650; color: var(--ink); }
.acct a { margin-top: 6px; font-weight: 600; color: var(--ink); text-underline-offset: 3px; }

.main { min-width: 0; padding: 32px 40px 56px; }
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 24px; }
.top .when { font-size: 15px; margin-bottom: 6px; }
.top h1 { font-size: clamp(30px, 3vw, 38px); line-height: 1.02; letter-spacing: -0.012em; text-wrap: balance; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tool {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r); background-color: var(--card); box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer;
}
.tool:hover { box-shadow: inset 0 0 0 1px var(--slate); }
select.tool {
  appearance: none; padding-right: 38px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2314212b' stroke-width='1.6'/%3E%3C/svg%3E") right 16px center / 10px no-repeat;
}
:root[data-theme='dark'] select.tool { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='1.6'/%3E%3C/svg%3E"); }

#today, #days-view, #leads-view, #plan-view { display: flex; flex-direction: column; gap: 24px; }
#today, #days-view { container-type: inline-size; }
#today.empty :is(.kpis, .cols), #today.quiet :is(#areas, #reports), #today.quiet:not(.picks) :is(.kpis, .col:not(.wide)) { display: none; }
.note {
  display: grid; gap: 18px; justify-items: start; max-width: 64ch; padding: 24px; background: var(--card);
  border: 1px solid var(--rule); border-radius: 6px; font-size: 17px; color: var(--soft);
}
.note a { color: var(--ink); }

/* Key numbers: one strip, each tile drawing its own left and top rule so wrapped rows stay clean. */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.kpi { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 22px 24px 24px; box-shadow: -1px 0 0 var(--rule), 0 -1px 0 var(--rule); }
.kpi > span { font-size: 14px; line-height: 1.4; color: var(--slate); }
.kpi b { display: flex; align-items: center; gap: 10px; font: 600 42px/1 var(--display); font-variant-numeric: tabular-nums; }
/* Four across or two by two, never three and a straggler. */
@container (max-width: 720px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.cols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.col { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col.wide { flex: 999 1 560px; }
.card { min-width: 0; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.chead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; padding: 20px 24px 18px; }
.chead h2 { font-size: 21px; line-height: 1.1; }
.chead .meta { font-size: 14px; color: var(--slate); }
.chead .legend { position: static; padding: 0; background: none; backdrop-filter: none; align-self: center; }
.chead .legend :is(.unit, .wl) { align-self: end; }
#whole { margin-left: auto; }
.dash .more { min-height: 44px; padding: 0; font-size: 14.5px; color: var(--ink); }
.card .map { position: relative; height: clamp(340px, 48vh, 520px); border-top: 1px solid var(--rule); }

.tbl { overflow-x: auto; }
.tbl table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.tbl th { padding: 11px 14px; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--slate); border-block: 1px solid var(--rule); white-space: nowrap; }
.tbl td { padding: 14px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl :is(th, td):first-child { padding-left: 24px; }
.tbl :is(th, td):last-child { padding-right: 24px; }
.tbl .r { text-align: right; }
.tbl .big { font: 600 18px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .rank { width: 1%; font: 600 16px/1 var(--display); color: var(--slate); }
.tbl tr[data-zone] { cursor: pointer; }
.tbl tbody tr:is([data-zone]:hover, .on) td { background: var(--hover); }
.tbl tr.on td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
.area { display: grid; gap: 2px; padding: 0; border: 0; background: none; color: inherit; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.area b { font-size: 15.5px; font-weight: 650; }
.area span { font-size: 13.5px; color: var(--slate); }
a.area:hover b, tr[data-zone]:hover .area b { text-decoration: underline; text-underline-offset: 3px; }
.hail { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.hail b { font: 600 18px/1 var(--display); }
.hail span { font-size: 13.5px; color: var(--slate); }
/* A narrow areas card drops the size word ("golf ball") before the table has to scroll. */
#areas { container-type: inline-size; }
@container (max-width: 700px) { .hail span { display: none; } }
:root[data-theme='dark'] .stone .ring { stroke: #fff; }
.prog { display: grid; gap: 6px; min-width: 150px; white-space: nowrap; }
.prog i { display: block; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--lead) var(--p), var(--track) var(--p)); }
.tbl .nowrap { white-space: nowrap; }

/* Past storms: how much of each claim window is left, red in the last 30 days. */
.left { display: grid; gap: 6px; min-width: 120px; white-space: nowrap; }
.left i { display: block; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--slate) var(--p), var(--track) var(--p)); }
.left.soon { color: var(--alert); font-weight: 600; }
.left.soon i { background: linear-gradient(90deg, var(--alert) var(--p), var(--track) var(--p)); }
#days-view .card .map { height: clamp(300px, 42vh, 460px); }
#past-table .chead { align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tool[aria-pressed='true'] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.again { display: block; margin-top: 5px; font-size: 13.5px; color: var(--slate); white-space: nowrap; }
.again b { font-weight: 650; color: var(--ink); }
.again a { color: inherit; text-underline-offset: 3px; }

/* Plans: three cards side by side, the current one outlined. */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; align-items: stretch; }
.plan { display: flex; flex-direction: column; }
.plan.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.plan .route { flex: 1; gap: 12px; }
.plan .price { color: var(--slate); }
.plan .price b { font: 600 44px/1 var(--display); color: var(--ink); }
.plan .route .btn { margin-top: auto; }
.plan .fine { margin-top: 0 !important; }
.mine { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; }

.route { display: flex; flex-direction: column; padding: 0 24px 24px; }
.route > * + .fine { margin-top: 12px; }
.route .btn { margin-top: 20px; min-height: 52px; font-size: 16px; }
.route > .fine:first-child + .btn { margin-top: 16px; }
/* A quiet morning's best past area, in the route card's place. */
.route.start { gap: 12px; }
.route.start .area b { font-size: 19px; }
.route.start > .fine { margin-top: 0; }
.route.start .btn { margin-top: 8px; }
.fine { font-size: 14px; color: var(--slate); }
.segs { display: flex; gap: 3px; height: 8px; }
.segs i { border-radius: 2px; background: var(--track); }
.segs i.on { background: var(--lead); }
.route .count { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 16px; font-size: 14px; color: var(--slate); }
.route .stops { border-top: 1px solid var(--rule); }
.dash .stop { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 4px 14px; padding: 14px 0; }
.dash .stop.done .n { background: var(--slate); }
.dash .stop .street { font: 600 20px/1.15 var(--display); }
.dash .tally { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--lead); font-size: 13.5px; font-weight: 600; }
.dash .stop .detail { flex-wrap: wrap; gap: 0 14px; }
.dash .stop .lead { min-height: 28px; padding: 0 2px; white-space: nowrap; border: 0; background: none; color: var(--lead); font-size: 13.5px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dash .stop .acts .check, .dash .stop .acts .check[aria-pressed='true'] { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; background: none; box-shadow: none; }
.check > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--ink); color: transparent; }
.check:hover > span { background: var(--hover); }
.check[aria-pressed='true'] > span { background: var(--ink); color: var(--on-ink); }
.route .finished { background: var(--lead); color: var(--on-ink); }

.reps { list-style: none; margin: 0; padding: 0; }
.reps button {
  display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%;
  padding: 13px 24px; border: 0; border-top: 1px solid var(--rule); background: none; text-align: left; cursor: pointer;
}
.reps button:hover { background: var(--hover); }
.reps b { display: flex; align-items: center; gap: 8px; font: 600 18px/1 var(--display); }
.reps span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.reps time { font-size: 13.5px; color: var(--slate); white-space: nowrap; }
.reps.wind button { grid-template-columns: 152px minmax(0, 1fr) auto; }
.reps.wind b { font-size: 16px; white-space: nowrap; }
.cfoot { padding: 4px 24px 8px; border-top: 1px solid var(--rule); }

.zmark { display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; white-space: nowrap; }
.zmark span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font: 700 14px/1 var(--display); box-shadow: 0 0 0 2px var(--on-ink); }
.zmark b { visibility: hidden; padding: 5px 8px; border-radius: 3px; background: var(--ink); color: var(--on-ink); font: 600 13px/1 var(--body); }
.zmark:is(.hot, :hover, :focus-visible) { z-index: 3; }
.zmark:is(.hot, :hover, :focus-visible) b { visibility: visible; }
.zmark:is(.hot, :hover, :focus-visible) span { background: var(--on-ink); color: var(--ink); box-shadow: 0 0 0 2.5px var(--ink); }
.map.close .zmark { display: none; }
.zmark.wind span { background: var(--wind); color: #fff; }
.rep-pop .maplibregl-popup-content { padding: 5px 9px; border-radius: var(--r); font: 600 13px/1.2 var(--body); background: var(--ink); color: var(--on-ink); box-shadow: none; }
.rep-pop .maplibregl-popup-tip { border-top-color: var(--ink); border-bottom-color: var(--ink); }
:root[data-theme='dark'] .maplibregl-ctrl-group { background: var(--card); box-shadow: 0 0 0 1px var(--rule); }
:root[data-theme='dark'] .maplibregl-ctrl-group button + button { border-top-color: var(--rule); }
:root[data-theme='dark'] .maplibregl-ctrl-icon { filter: invert(1); }
:root[data-theme='dark'] .maplibregl-ctrl-attrib { background: rgba(18, 27, 34, 0.9); color: var(--slate); }
:root[data-theme='dark'] .maplibregl-ctrl-attrib a { color: var(--soft); }
:root[data-theme='dark'] .maplibregl-ctrl-attrib-button { filter: invert(1); }
:root[data-theme='dark'] .form :is(input, select) { background: var(--card); border-color: #3a4a55; }

dialog { border: 0; border-radius: 10px; padding: 0; width: min(560px, 94vw); max-height: 92svh; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(20, 33, 43, 0.45); }
.form { padding: 22px; display: grid; gap: 14px; }
.form h2 { font-size: 26px; }
.form label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
.form input, .form select { min-height: 46px; padding: 0 12px; border: 1px solid #b7c1c8; border-radius: var(--r); background: #fff; font-weight: 400; font-size: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .pick { height: 260px; border-radius: var(--r); overflow: hidden; position: relative; }
.form .hint { font-size: 13px; color: var(--slate); font-weight: 400; }
.form .err { color: #b3263e; font-size: 14px; min-height: 1.2em; }
.form .check { display: flex; gap: 10px; align-items: center; font-weight: 400; }
.form .check input { min-height: 0; width: 20px; height: 20px; }
.form .acts { display: flex; gap: 10px; justify-content: flex-end; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--on-ink);
  padding: 12px 16px; border-radius: var(--r); font-size: 15px; max-width: 92vw;
}

@media (max-width: 899px) {
  .dash { display: block; background: var(--page); }
  /* The sidebar folds into a top bar with the brand and look switch, and a tab bar along the bottom. */
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 16px 8px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .side .brand { padding: 0; }
  .side nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--rule); }
  .side nav > .nav { flex-direction: column; justify-content: center; gap: 4px; min-height: 52px; padding: 6px 2px; font-size: 12px; }
  #more { display: flex; }
  .side nav:has(.extra [aria-current]) #more { background: var(--ink); color: var(--on-ink); }
  .extra { display: none; position: absolute; right: 8px; bottom: calc(100% + 8px); flex-direction: column; gap: 2px; width: 220px; padding: 6px; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.2); }
  .side.open .extra { display: flex; }
  .acct .nav { width: auto; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .acct { margin: 0 0 0 auto; }
  .acct p { display: none; }
  .main { padding: 24px 16px calc(100px + env(safe-area-inset-bottom)); }
  /* On a phone the route comes right after the map: it's what the crew works from. */
  .cols, .col { display: contents; }
  #today { gap: 16px; }
  #mapcard { order: 1; } #route { order: 2; } #areas, #picks { order: 3; } #reports { order: 4; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 16px; gap: 8px; }
  .kpi b { font-size: 30px; gap: 8px; }
  .kpi b .stone { width: 26px; height: 26px; }
  .card .map { height: 56svh; }
  .chead, .route { padding-left: 16px; padding-right: 16px; }
  .reps button { padding-left: 16px; padding-right: 16px; grid-template-columns: 78px minmax(0, 1fr) auto; }
  .tbl :is(th, td):first-child { padding-left: 16px; }
  .tbl :is(th, td):last-child { padding-right: 16px; }
  .dash .stop .lead { min-height: 36px; }
  /* Hail areas as stacked rows instead of a table that scrolls sideways. */
  #areas table { min-width: 0; }
  #areas :is(table, tbody) { display: block; }
  #areas thead { display: none; }
  #areas tr { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--rule); }
  #areas td { padding: 0 !important; border: 0; }
  #areas td.rank { grid-row: 1 / span 3; align-self: start; padding-top: 3px !important; }
  #areas td:nth-child(2) { grid-column: 2; grid-row: 1; }
  #areas td:nth-child(3) { grid-column: 2 / span 2; grid-row: 2; }
  #areas td:nth-child(4) { grid-column: 3; grid-row: 1; align-self: start; }
  #areas td:nth-child(4)::after { content: ' roofs'; font: 400 13.5px/1 var(--body); color: var(--slate); }
  #areas td:nth-child(5) { grid-column: 2 / span 2; grid-row: 3; font-size: 14px; }
  #areas .area { white-space: normal; }
  #areas .hail > span { display: inline; }
  #areas tbody tr:is([data-zone]:hover, .on) td { background: none; box-shadow: none; }
  #areas tbody tr:is([data-zone]:hover, .on) { background: var(--hover); }
  #areas tbody tr.on { box-shadow: inset 3px 0 0 var(--ink); }
  /* Past storms the same way: area and roofs, storm and date, route and days left. */
  :is(#past-table, #picks) table { min-width: 0; }
  :is(#past-table, #picks) :is(table, tbody) { display: block; }
  :is(#past-table, #picks) thead { display: none; }
  :is(#past-table, #picks) tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--rule); }
  :is(#past-table, #picks) td { padding: 0 !important; border: 0; }
  :is(#past-table, #picks) td:nth-child(1) { grid-area: 1 / 1; }
  :is(#past-table, #picks) td:nth-child(4) { grid-area: 1 / 2; align-self: start; }
  :is(#past-table, #picks) td:nth-child(4)::after { content: ' roofs'; font: 400 13.5px/1 var(--body); color: var(--slate); }
  :is(#past-table, #picks) td:nth-child(2) { grid-area: 2 / 1; }
  :is(#past-table, #picks) td:nth-child(3) { grid-area: 2 / 2; text-align: right; font-size: 14px; color: var(--slate); }
  :is(#past-table, #picks) td:nth-child(5) { grid-area: 3 / 1; font-size: 14px; }
  :is(#past-table, #picks) td:nth-child(6) { grid-area: 3 / 2; font-size: 14px; }
  :is(#past-table, #picks) .area { white-space: normal; }
  :is(#past-table, #picks) .left { min-width: 110px; }
}
@media (min-width: 861px) {
  .brief { grid-template-columns: minmax(380px, 440px) 1fr; grid-template-rows: none; height: 100svh; }
  .brief .map { order: 2; height: 100svh; }
  .brief .sheet { order: 1; margin: 0; border-radius: 0; overflow-y: auto; padding-top: 22px; box-shadow: 1px 0 0 var(--rule); }
  .brief .sheet::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
