/* Northern Mile — design reference (home)
   Stripe/Linear precision, warm paper, one deep-green accent. The spread rail
   is the signature: it draws on load and is the one memorable element.
   Light only. Every token clears 4.5:1 on paper. */

:root {
  --paper:   #FBFAF8;
  --raise:   #FFFFFF;
  --sink:    #F3F1EC;
  --ink:     #1A1A17;
  --ink-2:   #45423C;
  --muted:   #6B6862;
  --line:    #E8E4DD;
  --line-2:  #F0EDE7;

  --signal:  #0B5D3B;   /* brand — deep forest */
  --signal-2:#0A4E32;
  --wash:    #EDF3EF;   /* signal at 8% for fills */
  --amber:   #C8891A;   /* rare highlight, never the identity */

  --up:      #B3261E;   /* cost rising */
  --up-wash: #FBECEA;
  --amber-wash:#F7ECD6;
  --down:    #0B5D3B;   /* cost falling */
  --down-wash:#EDF3EF;

  --focus:   #1C6FE0;

  --display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --body:    'Inter', ui-sans-serif, system-ui, sans-serif;
  --data:    'IBM Plex Mono', ui-monospace, monospace;

  --maxw: 1000px;
  --pad:  clamp(20px, 5vw, 44px);
  --v:    clamp(44px, 7vw, 80px);

  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }
* { font-variant-numeric: tabular-nums; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--raise); padding: 10px 14px; border: 2px solid var(--focus); }

/* ── Masthead ───────────────────────────────────────────────────────── */

.hd { border-bottom: 1px solid var(--line); background: var(--paper); }
.hd .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark .logo { width: 32px; height: 32px; display: block; flex: none; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--sink); }
.seg-opt { padding: 5px 15px; border-radius: 999px; font-family: var(--body); font-size: .8125rem; font-weight: 600; line-height: 1.4; color: var(--muted); text-decoration: none; }
.seg-opt.is-on { background: var(--signal); color: #fff; }
.seg-opt:not(.is-on):hover { color: var(--ink); background: var(--line-2); }
.lane { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lane select { width: 100%; }
.links-list .why { display: block; font-size: .8125rem; color: var(--muted); margin-top: 3px; font-weight: 400; }
.mark .dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--signal);
  position: relative;
}
.mark .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--signal); opacity: .35;
}
.mark b { font-family: var(--display); font-weight: 600; font-size: 1.125rem; letter-spacing: -.02em; }
.mark span { font-family: var(--data); font-size: .75rem; color: var(--muted); display: none; }
@media (min-width: 680px) { .mark span { display: inline; } }

.nav { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.nav .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav .wrap::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto; position: relative;
  font-family: var(--data); font-size: .8125rem; letter-spacing: .01em;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  padding: 14px 14px 13px;
}
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); }
.nav a.on::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px;
  height: 2px; background: var(--signal);
}

/* ── Type ───────────────────────────────────────────────────────────── */

main { padding-bottom: var(--v); }

.eyebrow {
  font-family: var(--data); font-size: .8125rem; letter-spacing: .02em;
  color: var(--signal); margin: 0 0 14px; display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--signal); }

h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3rem); line-height: 1.08; letter-spacing: -.03em;
  margin: 0 0 16px; max-width: 18ch;
}
.stand { margin: 0 0 var(--v); font-size: 1.1875rem; color: var(--ink-2); max-width: 56ch; }

h2 { font-family: var(--display); font-weight: 600; font-size: 1.5rem; letter-spacing: -.02em; margin: 0 0 4px; }
h3 { font-family: var(--display); font-weight: 500; font-size: 1.0625rem; letter-spacing: -.01em; margin: 0 0 4px; }

.sec { margin-top: var(--v); }
.sec > .lead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.sec > .lead p { margin: 0; color: var(--muted); font-size: .9375rem; }

.note { color: var(--muted); font-size: .9375rem; max-width: 66ch; margin: 16px 0 0; }
.note a { color: var(--signal); text-underline-offset: 2px; }
.reading p { margin: 0 0 14px; max-width: 62ch; }

/* ── Hero figure ────────────────────────────────────────────────────── */

.hero { padding-top: var(--v); }

.figure { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; }
.figure .n {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(3rem, 10vw, 4.5rem); line-height: .9; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.figure .u { font-family: var(--data); font-size: 1rem; color: var(--muted); }
.figure .d {
  font-family: var(--data); font-size: .9375rem; padding: 5px 10px; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 5px;
}
.figure .d.up { color: var(--up); background: var(--up-wash); }
.figure .d.down { color: var(--down); background: var(--down-wash); }
.figure .d.flat { color: var(--muted); background: var(--sink); }
.figure .d.up::before { content: "▲"; font-size: .7em; }
.figure .d.down::before { content: "▼"; font-size: .7em; }

.meta { font-family: var(--data); font-size: .8125rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 30px; }
.meta b { color: var(--ink-2); font-weight: 500; }

/* ── Signature: spread rail ─────────────────────────────────────────── */

.rail {
  background: var(--raise); border: 1px solid var(--line); border-radius: 10px;
  padding: 26px 26px 20px; margin: 0;
  box-shadow: 0 1px 2px rgba(26,26,23,.03), 0 8px 24px rgba(26,26,23,.04);
}
.rail .cap { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.rail .cap h3 { margin: 0; }
.rail .cap .sp { font-family: var(--data); font-size: .8125rem; color: var(--muted); }
.rail .cap .sp b { color: var(--signal); font-weight: 600; }

.rail .row { display: grid; grid-template-columns: 2.75rem 1fr 4.5rem; align-items: center; gap: 14px; padding: 7px 0; text-decoration: none; }
.rail .row:hover .code { color: var(--ink); }
.rail .row .code { font-family: var(--data); font-size: .8125rem; color: var(--muted); transition: color .15s; }
.rail .row .track { position: relative; height: 12px; }
.rail .row .track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; border-radius: 2px; background: var(--line); }
.rail .row .fill {
  position: absolute; top: 50%; left: 0; height: 2px; border-radius: 2px;
  background: var(--signal); transform: translateY(-50%);
  transform-origin: left center;
}
.rail .row .dot {
  position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%;
  background: var(--raise); border: 2px solid var(--signal);
  transform: translate(-50%, -50%);
}
.rail .row .val { font-family: var(--data); font-size: .9375rem; text-align: right; }
.rail .row .val.up { color: var(--up); }
.rail .row .val.down { color: var(--down); }

.rail .mean-wrap { position: relative; height: 0; }
.rail .mean {
  position: absolute; top: -8px; width: 2px; background: var(--amber);
  transform: translateX(-1px);
}
.rail .mean .lab {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-family: var(--data); font-size: .75rem; color: var(--amber); white-space: nowrap;
}

/* Draw-on-load: rows fade up in sequence, tracks fill left-to-right. */
@media (prefers-reduced-motion: no-preference) {
  .rail .row { opacity: 0; transform: translateY(6px); animation: rise .5s var(--ease) forwards; }
  .rail .row:nth-child(1){animation-delay:.05s}
  .rail .row:nth-child(2){animation-delay:.10s}
  .rail .row:nth-child(3){animation-delay:.15s}
  .rail .row:nth-child(4){animation-delay:.20s}
  .rail .row:nth-child(5){animation-delay:.25s}
  .rail .row:nth-child(6){animation-delay:.30s}
  .rail .row:nth-child(7){animation-delay:.35s}
  .rail .row:nth-child(8){animation-delay:.40s}
  .rail .row:nth-child(9){animation-delay:.45s}
  .rail .row:nth-child(10){animation-delay:.50s}
  .rail .row .fill { transform: translateY(-50%) scaleX(0); animation: grow .6s var(--ease) forwards; animation-delay: inherit; }
  .rail .row .dot { opacity: 0; animation: pop .3s var(--ease) forwards; }
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
@keyframes grow { to { transform: translateY(-50%) scaleX(1); } }
@keyframes pop { to { opacity: 1; } }

/* ── Citation ───────────────────────────────────────────────────────── */

.cite { margin-top: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--wash); padding: 20px 22px; }
.cite .cl { font-family: var(--data); font-size: .8125rem; color: var(--signal); margin-bottom: 10px; }
.cite q { display: block; quotes: none; max-width: 64ch; font-family: var(--data); font-size: .875rem; line-height: 1.7; color: var(--ink-2); }
.cite .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.btn { font: inherit; font-family: var(--data); font-size: .875rem; padding: 9px 16px; border-radius: 7px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--raise); color: var(--ink); transition: border-color .15s, transform .1s; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn--brand { background: var(--signal); border-color: var(--signal); color: var(--raise); }
.btn--brand:hover { background: var(--signal-2); border-color: var(--signal-2); }

/* ── Stat strip ─────────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 26px; }
.stat { background: var(--raise); padding: 16px 18px; text-decoration: none; transition: background .15s; }
.stat:hover { background: var(--sink); }
.stat .l { font-family: var(--data); font-size: .75rem; color: var(--muted); }
.stat .v { font-family: var(--display); font-weight: 600; font-size: 1.5rem; letter-spacing: -.02em; margin-top: 4px; }
.stat .v.up { color: var(--up); } .stat .v.down { color: var(--down); }
.stat .s { font-family: var(--data); font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* ── Rows / lists ───────────────────────────────────────────────────── */

.two { display: grid; gap: var(--v); }
@media (min-width: 820px) { .two { grid-template-columns: 1fr 1fr; gap: 44px; } }

.rows .r { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; }
.rows .r:last-child { border-bottom: 0; }
.rows .r:hover { background: var(--sink); }
.rows .r .k { font-size: .9375rem; }
.rows .r .k small { display: block; font-family: var(--data); color: var(--muted); font-size: .75rem; }
.rows .r .v { font-family: var(--data); font-size: .9375rem; white-space: nowrap; }
.rows .r .v.up { color: var(--up); } .rows .r .v.down { color: var(--down); }

.links-list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; font-size: .9375rem; }
.links-list a:last-child { border-bottom: 0; }
.links-list a:hover { color: var(--signal); }
.links-list .src { font-family: var(--data); font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-right: 10px; }

.empty { padding: 20px 0; color: var(--muted); font-size: .9375rem; }
.empty b { display: block; font-family: var(--display); color: var(--ink); font-weight: 500; margin-bottom: 3px; }

/* ── Subscribe ──────────────────────────────────────────────────────── */

.sub { margin-top: var(--v); padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, var(--wash), var(--raise)); }
.sub .e { font-family: var(--data); font-size: .8125rem; color: var(--signal); margin-bottom: 8px; }
.sub h2 { margin-bottom: 8px; }
.sub p { margin: 0 0 18px; color: var(--ink-2); max-width: 54ch; }
.sub-btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--data); font-size: .9375rem; color: var(--raise); background: var(--signal); padding: 12px 22px; border-radius: 8px; text-decoration: none; transition: background .15s; }
.sub-btn:hover { background: var(--signal-2); }
.sub .fine { font-family: var(--data); font-size: .75rem; color: var(--muted); margin-top: 10px; }

/* ── Footer ─────────────────────────────────────────────────────────── */

.ft { margin-top: var(--v); padding: 32px 0 40px; border-top: 1px solid var(--line); }
.ft .wrap { display: grid; gap: 16px; }
.ft .brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ft .brand .name { font-family: var(--display); font-weight: 600; font-size: 1.0625rem; color: var(--ink); text-decoration: none; }
.ft .brand .name:hover { color: var(--signal); }
.ft .brand .tag { font-family: var(--data); font-size: .8125rem; color: var(--muted); }
.ft .flinks { display: flex; gap: 8px 22px; flex-wrap: wrap; }
.ft .flinks a { color: var(--ink-2); text-decoration: none; font-size: .9375rem; }
.ft .flinks a:hover { color: var(--signal); }
.ft .bottom { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-family: var(--data); font-size: .75rem; color: var(--muted); }
.ft .bottom a { color: var(--muted); text-decoration: none; }
.ft .bottom a:hover { color: var(--signal); }
.ft .bottom > * + *::before { content: "\00B7"; margin-right: 8px; color: var(--muted); }

/* ── Data visuals (server-rendered SVG) ───────────────────────────── */
.viz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin: 18px 0; }
.viz-card { background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.viz-title { font-family: var(--display); font-weight: 600; font-size: 1rem; margin: 0 0 2px; color: var(--ink); }
.viz-sub { font-family: var(--data); font-size: .75rem; color: var(--muted); margin: 0 0 14px; }
.viz { width: 100%; height: auto; display: block; }
.viz.viz-donut { max-width: 170px; margin: 0 auto; }
.viz-bar.down { fill: var(--down); }
.viz-bar.up { fill: var(--up); }
.viz-col { fill: var(--amber); }
.viz-ref { stroke: var(--amber); stroke-width: 1; stroke-dasharray: 4 3; }
.viz-axis { stroke: var(--line); stroke-width: 1; }
.viz-lab { fill: var(--muted); font-family: var(--data); font-size: 11px; }
.viz-val { fill: var(--ink); font-family: var(--data); font-size: 12px; }
.viz-reflab { fill: var(--amber); font-family: var(--data); font-size: 10px; }
.viz-donut-a { stroke: var(--amber); }
.viz-donut-b { stroke: var(--focus); }
.viz-donut-num { fill: var(--ink); font-family: var(--display); font-weight: 600; font-size: 28px; }
.viz-donut-lab { fill: var(--muted); font-family: var(--data); font-size: 11px; }
.viz-line { stroke: var(--muted); stroke-width: 1.2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.viz-ma { stroke: var(--signal); stroke-width: 2.5; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.viz-gridline { stroke: var(--line-2); stroke-width: 1; }
.viz-dot { fill: var(--signal); }
.viz-track { fill: var(--sink); }
.viz-marker { stroke: var(--ink); stroke-width: 1.5; }
.viz-marker-dot { fill: var(--signal); }
.viz-marker-ring { fill: none; stroke: var(--ink); stroke-width: 2; }
.viz-seg { stroke: var(--line); stroke-width: 1; }
.viz-seg-noise { fill: var(--down); }
.viz-seg-notable { fill: var(--amber); }
.viz-seg-material { fill: #C07A1A; }
.viz-seg-alert { fill: var(--up); }
.viz-hist { fill: var(--sink); }
.viz-hist.active { fill: var(--signal); }
.fx-num { font-family: var(--data); font-size: 1.5rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }

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

/* ── Diesel chart (home + fuel only) ─────────────────────────────────── */
.chart-card { background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 22px 22px 14px; margin-top: 24px; box-shadow: 0 1px 2px rgba(26,26,23,.03), 0 8px 24px rgba(26,26,23,.04); }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.chart-head h3 { font-family: var(--display); font-weight: 600; font-size: 1.0625rem; letter-spacing: -.02em; margin: 0; }
.chart-head .sub { font-family: var(--data); font-size: .8125rem; color: var(--muted); }
.chart-svg { width: 100%; height: 320px; display: block; touch-action: pan-y; cursor: grab; }
.chart-svg.grabbing { cursor: grabbing; }
.chart-svg .axis text { font-family: var(--data); font-size: 11px; fill: var(--muted); }
.chart-svg .axis path, .chart-svg .axis line { stroke: var(--line); }
.chart-svg .grid line { stroke: var(--line-2); }
.chart-svg .grid path { stroke: none; }
.chart-svg .line { fill: none; stroke: var(--signal); stroke-width: 1.75; }
.chart-svg .area { fill: var(--wash); opacity: .6; }
.chart-svg .hover-dot { fill: var(--signal); stroke: var(--raise); stroke-width: 2; }
.chart-svg .hover-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-card .tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); font-family: var(--data); font-size: 12px; padding: 7px 10px; border-radius: 6px; opacity: 0; transition: opacity .1s; white-space: nowrap; z-index: 5; }
.chart-card .tip .v { font-weight: 600; font-size: 13px; }
.chart-card .tip .d { color: var(--line); font-size: 11px; }
.chart-card .hint { font-family: var(--data); font-size: .75rem; color: var(--ink-2); margin: 10px 2px 0; text-align: left; }
.chart-card .foot-note { font-family: var(--data); font-size: .7rem; color: var(--muted); margin-top: 8px; }
.chart-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 14px 0 4px; }
.cstat { background: var(--raise); padding: 10px 14px; text-align: center; }
.cstat .l { display: block; font-family: var(--data); font-size: .6875rem; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.cstat b { display: block; font-family: var(--data); font-size: 1.0625rem; font-weight: 500; color: var(--ink); margin-top: 2px; }
.cstat .s { display: block; font-family: var(--data); font-size: .6875rem; color: var(--muted); margin-top: 1px; min-height: 1em; }
.story { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.story .sl { font-family: var(--data); font-size: .75rem; color: var(--muted); margin-right: 4px; }
.story button { font: inherit; font-family: var(--data); font-size: .75rem; letter-spacing: .01em; color: var(--muted); background: none; border: 1px dashed var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; transition: all .12s; }
.story button:hover { border-color: var(--muted); color: var(--ink); border-style: solid; }
.story button.on { background: var(--wash); border-color: var(--signal); color: var(--signal); border-style: solid; }
.ann-line { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }
.ann-dot { stroke: var(--raise); stroke-width: 1.5; }
.ann-low .ann-dot { fill: var(--down); }
.ann-high .ann-dot { fill: var(--up); }
.ann-today .ann-dot { fill: var(--signal); }
.ann-label { font-family: var(--data); font-size: 10px; fill: var(--muted); }
@media (prefers-reduced-motion: reduce) { .chart-svg .line { transition: none; } }

/* ── Overflow & alignment safety ─────────────────────────────────────
   Long unbreakable strings (URLs in citations, external links, incident
   sources) must wrap inside their container rather than push past its
   padding. And flex/grid children default to min-width:auto, which lets a
   wide child stretch the parent past the viewport — reset it so tracks and
   values stay inside their cells. */

/* Long strings wrap instead of overflowing. */
.cite q,
.cite .cl,
.links-list a,
.rows .r .k,
.rows .r .k small,
.inc .h,
.inc .m,
.inc-detail,
.foot-note,
.meta,
.mark span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* The citation URL specifically: keep it on the line but let it break. */
.cite q { hyphens: none; }

/* Flex/grid children can shrink below content width (min-width:auto trap). */
.two > *,
.rail .row,
.rail .row .track,
.rows .r,
.stat,
.calc > *,
.chart-card {
  min-width: 0;
}

/* Values in rows should never wrap awkwardly or overflow their cell; they
   stay right-aligned and shrink the label instead. */
.rows .r { gap: 12px; }
.rows .r .v { flex-shrink: 0; }

/* Rail value column holds its width; the track flexes. */
.rail .row .val { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Nothing horizontally overflows the page. */
html, body { overflow-x: hidden; }
main.wrap, .hd .wrap, .nav .wrap, .ft .wrap { max-width: min(var(--maxw), 100%); }

/* ── Road incidents page ─────────────────────────────────────────────
   The incidents template ports markup that needs these styles. Without
   them the map has no height, the list has no structure, and the detail
   panel is unstyled. */

/* Map container — needs an explicit height or Leaflet renders 0px tall. */
.incmap {
  height: 380px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 8px 0 20px;
  overflow: hidden;
  background: var(--sink);
}

/* The scrollable list of incidents. */
.panel-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 520px;
  overflow-y: auto;
  background: var(--raise);
}

/* Each incident row. */
.inc {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: background .12s;
}
.inc:last-child { border-bottom: 0; }
.inc:hover, .inc:focus-visible { background: var(--sink); outline: none; }
.inc .h {
  font-size: .9375rem; font-weight: 500; color: var(--ink);
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 3px;
}
.inc .m {
  font-family: var(--data); font-size: .8125rem; color: var(--muted); line-height: 1.5;
}
.inc .inc-time {
  font-family: var(--data); font-size: .8125rem; font-weight: 600; color: var(--ink);
  letter-spacing: .01em; margin: 0 0 4px;
}
.inc .inc-time .t-lab {
  font-weight: 400; font-size: .6875rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
}

/* Severity pill. */
.pill {
  flex-shrink: 0;
  font-family: var(--data); font-size: .6875rem; letter-spacing: .02em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 100px;
  background: var(--down-wash); color: var(--down);
}
.pill.closed { background: var(--up-wash); color: var(--up); }
.pill.heavy { background: var(--amber-wash); color: var(--amber); }

/* Active row highlight (synced with the open popup). */
.inc.active { background: var(--wash); box-shadow: inset 3px 0 0 var(--signal); }

/* Incident detail popup on the map marker. */
.inc-popup .leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: 0 6px 24px rgba(26,26,23,.16); }
.inc-popup .leaflet-popup-content { margin: 14px 16px; font-family: var(--body); }
.ipop-h { font-family: var(--display); font-weight: 600; font-size: 1rem; color: var(--ink); margin-bottom: 8px; letter-spacing: -.01em; }
.ipop-closed { display: inline-block; font-family: var(--data); font-size: .7rem; font-weight: 600; color: var(--up); background: var(--up-wash); padding: 3px 9px; border-radius: 100px; margin-bottom: 8px; }
.ipop-sev { margin-bottom: 10px; }
.ipop-what { font-size: .875rem; line-height: 1.5; color: var(--ink-2); margin-bottom: 12px; overflow-wrap: anywhere; }
.ipop-rows { border-top: 1px solid var(--line-2); padding-top: 10px; }
.ipop-rows div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 3px 0; font-size: .8125rem; color: var(--ink-2); }
.ipop-rows span { font-family: var(--data); font-size: .6875rem; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.ipop-src { display: inline-block; margin-top: 12px; font-family: var(--data); font-size: .8125rem; color: var(--signal); font-weight: 500; text-decoration: none; }
.ipop-src:hover { text-decoration: underline; }

/* Scheduled roadwork rows: road + dates on a header line, description below.
   Reads cleanly on mobile instead of cramming everything into one flex row. */
.rw { padding: 14px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.rw:last-child { border-bottom: 0; }
.rw:hover, .rw:focus-visible { background: var(--sink); outline: none; }
.rw.active { background: var(--wash); box-shadow: inset 3px 0 0 var(--signal); }
.rw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.rw-road { font-family: var(--data); font-size: .8125rem; font-weight: 500; color: var(--ink); letter-spacing: .02em; }
.rw-when { font-family: var(--data); font-size: .8125rem; font-weight: 600; color: var(--ink); flex-shrink: 0; letter-spacing: .02em; }
.rw-what { font-size: .9375rem; color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .lane { grid-template-columns: 1fr; }
  .inp input, .inp select { min-height: 44px; }
  .calc .out { margin-top: 20px; }
}
