/* =============================================================
   I-74 Phase 1 Traffic — App Shell
   Engineering-editorial visual layer.
   Brand-locked: Pantone 433 primary, 172 orange ONLY as spark.
   Loaded by nav.js → applies to every tool page.
   ============================================================= */

:root {
  /* HNTB brand */
  --hntb-primary:    #1B242A;
  --hntb-orange:     #F9461C;
  --hntb-blue:       #5482AB;
  --hntb-blue-light: #93B1CC;
  --hntb-gray-dark:  #51626F;
  --hntb-gray:       #8996A0;
  --hntb-gray-light: #C9CAC8;
  --hntb-bg-soft:    #D5D6D2;
  --hntb-green-dark: #59705D;   /* Pantone 5615 */
  --hntb-green-mid:  #718674;   /* Pantone 5625 */
  --hntb-green:      #96A797;   /* Pantone 5635 — calendar "data available" */

  /* Engineering-editorial surface scale */
  --ink-0:  #0B1015;   /* deepest — only for top chrome */
  --ink-1:  #1B242A;   /* Pantone 433 */
  --ink-2:  #2A363F;
  --ink-3:  #51626F;   /* Pantone 7545 */
  --ink-4:  #8996A0;   /* Pantone 7544 */
  --ink-5:  #A4AEB5;
  --ink-6:  #C9CAC8;
  --ink-7:  #E5E7E4;

  --paper:        #FAFAF8;   /* warm paper, not blueish */
  --paper-soft:   #F2F2EE;
  --panel:        #FFFFFF;
  --panel-soft:   #F7F7F4;

  --hair:         rgba(27, 36, 42, 0.12);   /* 1px hairlines */
  --hair-strong:  rgba(27, 36, 42, 0.22);

  /* Spark — used micro-dose only */
  --spark:        #F9461C;

  /* Typography */
  --font-sans:    'Interstate', 'Arial', Helvetica, sans-serif;
  --font-mono:    'IBM Plex Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --tracking-eyebrow: .18em;
  --tracking-tab:     .12em;
  --tracking-tight:   .02em;

  /* Motion */
  --t-quick:  120ms cubic-bezier(.2,.6,.2,1);
  --t-mid:    180ms cubic-bezier(.2,.6,.2,1);
}

/* ============================================================
   Body atmosphere — a near-invisible contour-line texture.
   Pure CSS data-uri SVG. ~3% opacity. Prints clean (suppressed below).
   ============================================================ */
body::before {
  content: '';
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='800' viewBox='0 0 800 800'><g fill='none' stroke='%231B242A' stroke-width='1'><path d='M0 120 Q200 80 400 130 T800 110'/><path d='M0 200 Q200 160 400 215 T800 195'/><path d='M0 280 Q200 240 400 295 T800 275'/><path d='M0 360 Q200 320 400 380 T800 360'/><path d='M0 440 Q200 400 400 460 T800 440'/><path d='M0 520 Q200 480 400 545 T800 525'/><path d='M0 600 Q200 560 400 625 T800 605'/><path d='M0 680 Q200 640 400 705 T800 685'/><path d='M0 760 Q200 720 400 785 T800 765'/></g></svg>");
  background-size: 800px 800px;
  background-repeat: repeat;
}
body > * { position: relative; z-index: 1; }

/* ============================================================
   Top nav — wayfinding bar
   ============================================================ */
.hntb-nav {
  background: var(--ink-0) !important;
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
  padding: .9rem 1.6rem !important;
  position: relative;
  gap: 1.4rem !important;
}
.hntb-nav::after {
  /* hairline glow under bar */
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(249,70,28,.55) 18%,
    rgba(249,70,28,.55) 19%,
    transparent 19.4%,
    transparent 100%);
}
.hntb-nav-left { gap: 1.4rem !important; }
.hntb-nav-logo { height: 44px !important; }
.hntb-nav-divider {
  width: 1px !important; height: 44px !important;
  background: rgba(255,255,255,.16) !important;
}
.hntb-nav-titlewrap {
  gap: .25rem;
}
.hntb-nav-title {
  font-size: 1rem !important;
  letter-spacing: .16em !important;
  font-weight: 700 !important;
  color: #fff !important;
  line-height: 1 !important;
}
.hntb-nav-sub {
  font-size: .62rem !important;
  letter-spacing: .22em !important;
  color: rgba(255,255,255,.6) !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}
.hntb-nav-links { gap: .15rem !important; }
.hntb-nav-link {
  position: relative;
  color: rgba(255,255,255,.62) !important;
  font-size: .76rem !important;
  letter-spacing: .14em !important;
  padding: .8rem 1.1rem !important;
  border-bottom: none !important;
  transition: color var(--t-quick);
}
.hntb-nav-link:hover { color: #fff !important; }
.hntb-nav-link::before {
  /* spark dot — only on active */
  content: '';
  position: absolute;
  left: .4rem; top: 50%;
  width: 4px; height: 4px;
  background: var(--spark);
  transform: translateY(-50%) scale(0);
  transition: transform var(--t-mid);
}
.hntb-nav-link-active {
  color: #fff !important;
  border-bottom: none !important;
  padding-left: 1.2rem !important;
}
.hntb-nav-link-active::before { transform: translateY(-50%) scale(1); }

/* ============================================================
   Bottom partners — slug line
   ============================================================ */
.hntb-partners {
  background: var(--ink-0) !important;
  border-top: 1px solid rgba(255,255,255,.06) !important;
  padding: .85rem 1.6rem !important;
  gap: 1.4rem !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.hntb-partners-meta {
  font-size: .58rem !important;
  letter-spacing: .26em !important;
  color: rgba(255,255,255,.5) !important;
}
.hntb-partners-meta::before {
  content: '— ';
  color: var(--spark);
  letter-spacing: 0;
}
/* Right-side pair: label sits flush against the IDOT logo */
.hntb-partners-pair {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hntb-partners-label {
  font-size: .62rem !important;
  letter-spacing: .26em !important;
  color: rgba(255,255,255,.7) !important;
  text-transform: uppercase;
  font-weight: 700 !important;
  line-height: 1;
  border-right: 1px solid rgba(255,255,255,.16);
  padding-right: 1rem;
}
.hntb-partners-logos { gap: 1rem !important; }
.hntb-partners-logo {
  height: 52px !important;
  filter: brightness(1.1) contrast(1.05);
  display: block;
}
@media (max-width: 720px) {
  .hntb-partners { padding: .6rem .8rem !important; }
  .hntb-partners-label { font-size: .54rem !important; padding-right: .6rem; border-right-width: 0; }
  .hntb-partners-logo { height: 40px !important; }
}

/* ============================================================
   Hero band — replace gradient with editorial stack
   Targets .hero on every tool page.
   ============================================================ */
.hero {
  background: var(--ink-1) !important;
  padding: .7rem 1.25rem .8rem !important;
  position: relative !important;
  border-bottom: 1px solid var(--ink-2) !important;
}
.hero::before {
  /* orange spark divider */
  content: '';
  position: absolute;
  left: 1.25rem; top: .75rem;
  width: 24px; height: 2px;
  background: var(--spark);
}
.hero h1 {
  font-size: clamp(1.1rem, 1.7vw, 1.45rem) !important;
  font-weight: 700 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  margin: .85rem 0 .15rem !important;
  color: #fff !important;
}
.hero .sub {
  font-size: .62rem !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
  color: rgba(255,255,255,.55) !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}
.hero .source-badges { margin-top: .55rem !important; gap: .4rem !important; }
.hero .source-badge {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  color: rgba(255,255,255,.78) !important;
  font-size: .52rem !important;
  letter-spacing: .18em !important;
  padding: .22rem .55rem !important;
  border-radius: 0 !important;
}

/* Active range badge on crash-explorer */
.hero #activeRangeLabel,
.hero .fw-bold { color: #fff !important; letter-spacing: .04em; }
.hero .small { letter-spacing: .18em; text-transform: uppercase; font-size: .55rem !important; }

/* ============================================================
   Page tabs — wayfinding ribbon
   ============================================================ */
.page-tabs,
.forecast-subtabs {
  background: var(--paper) !important;
  border-bottom: 1px solid var(--hair) !important;
  padding: 0 1.25rem !important;
  gap: 0 !important;
  position: relative;
}
.page-tab,
.forecast-subtab {
  position: relative;
  font-size: .66rem !important;
  letter-spacing: var(--tracking-tab) !important;
  text-transform: uppercase;
  padding: .65rem 1.1rem !important;
  font-weight: 700 !important;
  color: var(--ink-3) !important;
  border-bottom: 2px solid transparent !important;
  margin-bottom: -1px !important;
  transition: color var(--t-quick), border-color var(--t-quick);
}
.page-tab:hover,
.forecast-subtab:hover { color: var(--ink-1) !important; }
.page-tab.active,
.forecast-subtab.active {
  color: var(--ink-1) !important;
  border-bottom-color: var(--ink-1) !important;
}
.page-tab.active::before,
.forecast-subtab.active::before {
  /* tiny orange spark above the active tab */
  content: '';
  position: absolute;
  top: 4px; left: 50%;
  width: 14px; height: 2px;
  transform: translateX(-50%);
  background: var(--spark);
}
.page-tab .tab-badge {
  background: var(--ink-3) !important;   /* badges no longer orange */
  color: #fff !important;
  letter-spacing: .14em !important;
  font-size: .46rem !important;
}

/* ============================================================
   Panels — hairlines, no soft shadow
   ============================================================ */
.panel {
  background: var(--panel) !important;
  border: 1px solid var(--hair) !important;
  border-radius: 2px !important;       /* sharper, signage-like */
  box-shadow: none !important;
}
.panel-header {
  background: var(--panel-soft) !important;
  border-bottom: 1px solid var(--hair) !important;
  padding: .42rem .7rem !important;
  border-radius: 0 !important;
  font-size: .58rem !important;
  font-weight: 700 !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  text-transform: uppercase !important;
  color: var(--ink-2) !important;
  position: relative;
}
.panel-header::before {
  /* tiny accent rule on every panel head */
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--ink-1);
}
.panel-header-title {
  color: var(--ink-2) !important;
  font-size: .58rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
}

/* viz-card on crash-explorer */
.viz-card {
  border: 1px solid var(--hair) !important;
  border-radius: 2px !important;
  box-shadow: none !important;
}

/* Summary strip → number-led ribbon */
.summary-strip {
  background: var(--panel) !important;
  border-bottom: 1px solid var(--hair) !important;
  padding: .65rem 1rem !important;
  gap: 1.6rem !important;
}
.summary-val {
  font-size: 1.55rem !important;
  font-weight: 700 !important;
  color: var(--ink-1) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.summary-label {
  font-size: .55rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  color: var(--ink-3) !important;
}
.summary-sep { background: var(--hair) !important; height: 1.6rem !important; }

/* ============================================================
   Year tabs / year toggle / direction toggle
   ============================================================ */
.year-tab,
.year-btn,
.dir-toggle button,
.pill {
  border-radius: 0 !important;
  font-family: var(--font-sans) !important;
  letter-spacing: var(--tracking-tight) !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}
.year-tab {
  border: 1px solid var(--hair) !important;
  background: var(--panel) !important;
  color: var(--ink-3) !important;
  font-size: .58rem !important;
  letter-spacing: .1em !important;
  padding: .25rem .55rem !important;
  transition: all var(--t-quick);
}
.year-tab:hover { background: var(--paper-soft) !important; color: var(--ink-1) !important; }
.year-tab.active {
  background: var(--ink-1) !important;
  border-color: var(--ink-1) !important;
  color: #fff !important;
}
.year-btn {
  border: 1px solid var(--hair) !important;
  background: var(--panel) !important;
  color: var(--ink-3) !important;
  font-size: .72rem !important;
  letter-spacing: .08em !important;
  padding: .42rem 0 !important;
  transition: all var(--t-quick);
}
.year-btn:hover { background: var(--paper-soft) !important; color: var(--ink-1) !important; }
.year-btn.active {
  background: var(--ink-1) !important;
  border-color: var(--ink-1) !important;
  color: #fff !important;
}

/* Direction toggle */
.dir-toggle {
  border: 1px solid var(--hair) !important;
  border-radius: 0 !important;
  overflow: hidden;
}
.dir-toggle button {
  background: var(--panel) !important;
  color: var(--ink-3) !important;
  font-size: .62rem !important;
  letter-spacing: .12em !important;
  padding: .25rem .65rem !important;
}
.dir-toggle button.active {
  background: var(--ink-1) !important;
  color: #fff !important;
}

/* ============================================================
   Pills — used on filters
   ============================================================ */
.pill {
  border: 1px solid var(--hair) !important;
  background: var(--panel) !important;
  color: var(--ink-3) !important;
  font-size: .56rem !important;
  letter-spacing: .12em !important;
  padding: .22rem .5rem !important;
  transition: all var(--t-quick);
}
.pill:hover { border-color: var(--ink-2) !important; color: var(--ink-1) !important; }
.pill.active {
  background: var(--ink-1) !important;
  border-color: var(--ink-1) !important;
  color: #fff !important;
}

/* ============================================================
   Reset / quick buttons — REMOVE orange (brand violation)
   Replace with primary outline.
   ============================================================ */
.quick-reset-btn,
.reset-btn {
  border: 1px solid var(--ink-1) !important;
  color: var(--ink-1) !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-size: .56rem !important;
  letter-spacing: .18em !important;
  padding: .35rem .8rem !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  transition: background var(--t-quick), color var(--t-quick);
}
.quick-reset-btn:hover,
.reset-btn:hover {
  background: var(--ink-1) !important;
  color: #fff !important;
}

/* Quick period bar */
.quick-period-bar {
  background: var(--panel) !important;
  border-bottom: 1px solid var(--hair) !important;
  padding: .55rem 1.1rem !important;
  gap: .9rem !important;
}
.quick-period-label {
  font-size: .55rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  color: var(--ink-3) !important;
}
.quick-period-select {
  border: 1px solid var(--hair) !important;
  border-radius: 0 !important;
  background: var(--paper) !important;
  color: var(--ink-1) !important;
  font-size: .72rem !important;
  font-weight: 700 !important;
  padding: .3rem .6rem !important;
}
.quick-date-range {
  font-size: .62rem !important;
  letter-spacing: .14em !important;
  color: var(--ink-1) !important;
  border-left: 1px solid var(--hair) !important;
}

/* ============================================================
   Selection bar — was solid orange box. Now hairline + spark dot.
   ============================================================ */
.sel-bar {
  background: var(--panel) !important;
  border: 1px solid var(--hair) !important;
  border-left: 2px solid var(--spark) !important;
  border-radius: 0 !important;
  font-size: .64rem !important;
  letter-spacing: .04em !important;
  color: var(--ink-1) !important;
  padding: .35rem .55rem !important;
}
.sel-bar .sel-date {
  background: var(--ink-1) !important;
  color: #fff !important;
  border-radius: 0 !important;
  letter-spacing: .08em !important;
  font-size: .56rem !important;
  text-transform: uppercase;
  padding: .12rem .4rem !important;
}

/* Tab-badge (e.g., "Pending") */
.tab-badge {
  background: var(--ink-3) !important;
  color: #fff !important;
  letter-spacing: .14em !important;
  border-radius: 0 !important;
}

/* ============================================================
   Sidebar (crash-explorer)
   ============================================================ */
.sidebar { background: var(--panel) !important; border-right: 1px solid var(--hair) !important; }
.sidebar-section { border-bottom: 1px solid var(--hair) !important; padding: .75rem .9rem !important; }
.sidebar-title {
  font-size: .58rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  color: var(--ink-1) !important;
  border-bottom: 1px solid var(--hair);
  padding-bottom: .35rem;
  margin-bottom: .55rem !important;
}
.filter-section-toggle .filter-label {
  font-size: .56rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  color: var(--ink-3) !important;
}
.filter-checkbox { font-size: .68rem !important; }

/* ============================================================
   Map/heat shells & legends — engineering instrument frame
   ============================================================ */
#mapWrap,
.map-container,
#heatMapWrap,
#volumesMapWrap {
  position: relative !important;
  border-radius: 0 !important;
  border: 1px solid var(--hair) !important;
  border-top: 2px solid var(--ink-1) !important;       /* heavy spec edge */
  background: var(--paper) !important;
  /* hairline inner shadow (vignette) — adds depth without blur slop */
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.55),
    inset 0 16px 28px -16px rgba(27,36,42,.22) !important;
}

/* Corner crop marks — orange top-left "live" mark, ink bottom-right
   spec mark. Sit on every map container as a single visual signature
   that ties the maps to the splash and the map-clock readout. */
#mapWrap::before,
.map-container::before,
#heatMapWrap::before,
#volumesMapWrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-top: 1.5px solid var(--spark);
  border-left: 1.5px solid var(--spark);
  z-index: 800;
  pointer-events: none;
}
#mapWrap::after,
.map-container::after,
#heatMapWrap::after,
#volumesMapWrap::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 8px; height: 8px;
  border-bottom: 1.5px solid var(--ink-1);
  border-right: 1.5px solid var(--ink-1);
  z-index: 800;
  pointer-events: none;
}

/* --- Basemap tile-pane filter ---
   A small, opinionated nudge: contrast up, saturation down. Pushes
   CARTO Positron from "internet gray" toward "engineering paper" so
   the data overlay (speeds, crashes, polylines) becomes the visual
   hero. Affects only basemap tiles — overlays/vector layers are in
   separate panes and are untouched. */
.leaflet-tile-pane {
  filter: contrast(1.05) saturate(.86) brightness(1.01);
}

/* Render labels (street names) above data so they stay legible over
   highlighted polylines. CARTO Positron's labels are in the standard
   tile pane, so we don't need a separate layer — just make sure the
   tooltip/label panes never get filtered. */
.leaflet-tooltip-pane,
.leaflet-popup-pane,
.leaflet-marker-pane { filter: none !important; }

/* --- Aerial-on linework boost ---
   When the aerial toggle is enabled, satellite imagery washes out
   colored polylines (speed bands, ramp/cross-street forecasts).
   Stack three drop-shadows on the overlay-pane SVG to give every
   path a thick dark halo while preserving the colored stroke
   identity (no contrast/brightness change to the colors themselves).
   Also darken the basemap labels-pane slightly so street names stay
   legible above the imagery. */
.hntb-aerial-on .leaflet-overlay-pane svg {
  filter:
    drop-shadow(0 0 1.5px rgba(0,0,0,.95))
    drop-shadow(0 0 1.5px rgba(0,0,0,.85))
    drop-shadow(0 0 .5px rgba(0,0,0,1));
}
.hntb-aerial-on .leaflet-marker-pane > * {
  filter: drop-shadow(0 0 2px rgba(0,0,0,.7));
}
.hntb-aerial-on .leaflet-tile-pane .leaflet-layer:last-child {
  /* slight contrast boost on labels-only layer to read on imagery */
  filter: contrast(1.15) brightness(.92);
}
.map-legend,
.speed-legend,
.weather-legend {
  font-size: .52rem !important;
  letter-spacing: .1em !important;
  color: var(--ink-2) !important;
  text-transform: uppercase;
  font-weight: 600;
}
.map-clock {
  background: rgba(11,16,21,.92) !important;
  border-radius: 0 !important;
  border-top: 2px solid var(--spark) !important;
  letter-spacing: .06em !important;
  font-variant-numeric: tabular-nums;
}

/* Heatmap header strip */
.hm-title {
  font-size: .58rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  color: var(--ink-1) !important;
}
.hm-isolate-chip {
  background: var(--panel) !important;
  border: 1px solid var(--hair) !important;
  border-left: 2px solid var(--spark) !important;
  border-radius: 0 !important;
  font-size: .54rem !important;
  letter-spacing: .12em !important;
  text-transform: uppercase;
}
.hm-isolate-chip .chip-clear { color: var(--ink-1) !important; }

/* ============================================================
   Tables (weather / cluster / data)
   ============================================================ */
.wx-table,
.cluster-table {
  border: 1px solid var(--hair) !important;
  border-radius: 0 !important;
}
.wx-table th {
  background: var(--ink-1) !important;
  font-size: .54rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  border-right-color: var(--ink-2) !important;
}
.wx-table td {
  border-bottom-color: var(--hair) !important;
  border-right-color: var(--hair) !important;
}
.wx-stat {
  background: var(--panel) !important;
  border: 1px solid var(--hair) !important;
  border-radius: 0 !important;
  border-left: 2px solid var(--ink-1) !important;
}
.wx-stat .lbl {
  font-size: .5rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  color: var(--ink-3) !important;
}
.wx-stat .val {
  font-size: 1.25rem !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* ============================================================
   Print — strip the body texture so print sheets stay clean
   ============================================================ */
@media print {
  body::before { display: none !important; }
  .hntb-nav, .hntb-partners { display: none !important; }
}

/* ============================================================
   PASS 2 — instrument detail layer
   Calendar grid, form controls, range sliders, Leaflet, scrollbar,
   custom selection, focus ring. Reaches into elements that were
   still defaulting to browser chrome.
   ============================================================ */

/* --- Custom selection color (keeps the system identity even when
       a user drags-to-select tabular numbers) --- */
::selection { background: var(--ink-1); color: #fff; }
::-moz-selection { background: var(--ink-1); color: #fff; }

/* --- Single distinctive focus ring across the system ---
   Two-stop ring: 2px deep ink + a 1px hairline glow.  No purple. */
:focus-visible {
  outline: 2px solid var(--ink-1) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 1px rgba(249,70,28,.25) !important;
}
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ink-1) !important;
  outline-offset: 2px !important;
}

/* --- Custom scrollbar (WebKit + Firefox) ---
   A thin signage-style track with a brand-primary thumb. */
* { scrollbar-color: var(--ink-3) var(--paper-soft); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper-soft); }
::-webkit-scrollbar-thumb {
  background: var(--ink-4);
  border: 2px solid var(--paper-soft);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-2); }
::-webkit-scrollbar-corner { background: var(--paper-soft); }

/* ============================================================
   Form inputs — selects, text inputs, number inputs
   Repaints all generic browser chrome with the editorial system.
   ============================================================ */
select,
input[type="text"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="date"],
.export-field select,
.export-field input {
  font-family: var(--font-sans) !important;
  font-size: .68rem !important;
  font-weight: 600 !important;
  letter-spacing: .04em !important;
  color: var(--ink-1) !important;
  background: var(--paper) !important;
  border: 1px solid var(--hair) !important;
  border-radius: 0 !important;
  padding: .35rem .55rem !important;
  transition: border-color var(--t-quick), background var(--t-quick);
  appearance: none;
  -webkit-appearance: none;
}
select {
  /* signage chevron inline svg */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0 L5 6 L10 0' fill='none' stroke='%231B242A' stroke-width='1.4'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right .5rem center !important;
  background-size: 9px 5px !important;
  padding-right: 1.6rem !important;
}
select:hover,
input[type="text"]:hover,
input[type="number"]:hover,
input[type="search"]:hover {
  border-color: var(--ink-2) !important;
  background: var(--panel) !important;
}
select:focus,
input:focus { border-color: var(--ink-1) !important; }

/* checkbox accent — primary, not blue */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--ink-1) !important;
}

/* ============================================================
   Range sliders — playback / hour-slider
   Repaint the generic blue bar into a signage track + tab thumb.
   ============================================================ */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent !important;
  height: 22px;
  cursor: pointer;
}
input[type="range"]:focus { outline: none; }

/* WebKit */
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--ink-6);
  border: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border-radius: 0;                 /* signage square thumb */
  background: var(--ink-1);
  border: 2px solid var(--ink-1);
  box-shadow: 0 0 0 2px var(--paper);
  transition: background var(--t-quick), box-shadow var(--t-quick);
}
input[type="range"]:hover::-webkit-slider-thumb { background: var(--spark); border-color: var(--spark); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px rgba(27,36,42,.18); }

/* Firefox */
input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--ink-6);
  border: none;
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 0;
  background: var(--ink-1);
  border: 2px solid var(--ink-1);
}
input[type="range"]::-moz-range-progress { background: var(--ink-1); height: 2px; }

/* ============================================================
   Calendar mini-grid — corridor-speeds.html
   The single most-seen element on the speeds page. Pushes from
   browser-default to a signage-grid: bigger numerics, hairlines,
   spark on selection.
   ============================================================ */
.cal-year-grid { gap: .45rem .55rem !important; }

/* ============================================================
   Single-month calendar (corridor-speeds.html)
   The calendar is now one month at a time, rendered as a <table>
   (table-layout: fixed, 7 columns). The previous 12-month
   grow-to-fill rules forced #calYearGrid's children and the
   day/dow cells to display:flex, which overrode the table's
   display:table and collapsed the whole month into a single
   column (and stacked the prev/next nav). Those structural
   overrides are intentionally removed; the table sizes itself
   from the page's own CSS.
   ============================================================ */
.mini-month-title {
  font-size: .54rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  font-weight: 700 !important;
  color: var(--ink-1) !important;
  border-bottom: 1px solid var(--hair);
  padding-bottom: .15rem;
  margin-bottom: .2rem !important;
  text-align: left !important;
  padding-left: .15rem;
}
.mini-grid .mini-dow {
  font-size: .58rem !important;
  letter-spacing: .14em !important;
  color: var(--ink-4) !important;
  text-transform: uppercase;
  font-weight: 700 !important;
}
.mini-grid .mini-day {
  font-size: .82rem !important;
  font-weight: 600 !important;
  color: var(--ink-6) !important;
  font-variant-numeric: tabular-nums;
  border-radius: 0 !important;
  padding: .42rem 0 !important;
  letter-spacing: .02em;
}
.mini-grid .mini-day.has-data {
  background: var(--hntb-green) !important;     /* Pantone 5635 */
  color: #fff !important;
  font-weight: 700 !important;
  border-radius: 0 !important;
  position: relative;
}
.mini-grid .mini-day.has-data:hover {
  background: var(--hntb-green-mid) !important; /* Pantone 5625 */
  color: #fff !important;
}
.mini-grid .mini-day.selected,
.mini-grid .mini-day.has-data.selected {
  background: var(--ink-1) !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px var(--ink-1) !important;
  font-weight: 700 !important;
}
.mini-grid .mini-day.selected::after {
  /* spark dot on selected day */
  content: '';
  position: absolute;
  bottom: 1px; left: 50%;
  width: 4px; height: 1px;
  background: var(--spark);
  transform: translateX(-50%);
}
.mini-grid .mini-day.today {
  box-shadow: inset 0 0 0 1px var(--spark) !important;
}
.cal-footer {
  font-size: .5rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  text-transform: uppercase;
  color: var(--ink-3) !important;
  border-top: 1px solid var(--hair) !important;
  font-weight: 700 !important;
}
.cal-footer .leg-avail::before {
  background: var(--hntb-green) !important;
  border: 1px solid var(--hntb-green-mid) !important;
}
.cal-footer .leg-sel::before {
  background: var(--ink-1) !important;
  border: 1px solid var(--ink-1) !important;
}

/* ============================================================
   Playback controls
   ============================================================ */
.play-row button {
  border: 1px solid var(--hair) !important;
  border-radius: 0 !important;
  background: var(--paper) !important;
  color: var(--ink-1) !important;
  font-size: .58rem !important;
  letter-spacing: .12em !important;
  text-transform: uppercase;
  font-weight: 700 !important;
  padding: .28rem .65rem !important;
  transition: all var(--t-quick);
}
.play-row button:hover {
  background: var(--ink-1) !important;
  color: #fff !important;
  border-color: var(--ink-1) !important;
}
.play-row button.active {
  background: var(--ink-1) !important;
  color: #fff !important;
  border-color: var(--ink-1) !important;
}
.play-row select {
  border-radius: 0 !important;
}
#timeDisplay {
  font-size: .82rem !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--ink-1) !important;
  font-weight: 700 !important;
  border-left: 2px solid var(--spark);
  padding-left: .45rem;
}

/* ============================================================
   Map clock — flight-strip readout style
   ============================================================ */
.map-clock {
  background: rgba(11,16,21,.92) !important;
  border-radius: 0 !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-top: 2px solid var(--spark) !important;
  padding: .35rem .8rem !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  position: relative;
}
.map-clock::before {
  /* corner crop marks */
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 6px; height: 6px;
  border-top: 1px solid var(--spark);
  border-left: 1px solid var(--spark);
}
.map-clock::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 6px; height: 6px;
  border-bottom: 1px solid rgba(255,255,255,.4);
  border-right: 1px solid rgba(255,255,255,.4);
}

/* ============================================================
   Export panel (forecasts)
   ============================================================ */
.export-field label {
  font-size: .5rem !important;
  letter-spacing: var(--tracking-eyebrow) !important;
  text-transform: uppercase;
  color: var(--ink-3) !important;
  font-weight: 700 !important;
  display: block;
  margin-bottom: .15rem;
}
.export-btn {
  border-radius: 0 !important;
  border: 1px solid var(--ink-2) !important;
  background: transparent !important;
  color: var(--ink-1) !important;
  font-family: var(--font-sans) !important;
  font-size: .56rem !important;
  letter-spacing: .16em !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  padding: .42rem .8rem !important;
  transition: background var(--t-quick), color var(--t-quick), border-color var(--t-quick);
  position: relative;
}
.export-btn:hover {
  background: var(--ink-1) !important;
  color: #fff !important;
  filter: none !important;
}
.export-btn.primary {
  background: var(--ink-1) !important;
  color: #fff !important;
  border-color: var(--ink-1) !important;
}
.export-btn.primary:hover {
  background: var(--ink-0) !important;
  border-color: var(--ink-0) !important;
}
.export-btn::before {
  /* tiny spark mark on left edge */
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--spark);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--t-mid);
}
.export-btn:hover::before { transform: scaleY(1); }

/* ============================================================
   Layer / legend rows (forecasts)
   ============================================================ */
.layer-row {
  font-size: .68rem !important;
  letter-spacing: .03em;
  color: var(--ink-1) !important;
  padding: .28rem .15rem !important;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-quick);
}
.layer-row:hover { border-bottom-color: var(--hair); }

/* ============================================================
   Leaflet overrides — popups, tooltips, controls
   ============================================================ */
.leaflet-container {
  font-family: var(--font-sans) !important;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--ink-1) !important;
  color: #fff !important;
  border-radius: 0 !important;
  border-top: 2px solid var(--spark);
  box-shadow: 0 8px 24px rgba(0,0,0,.25) !important;
}
.leaflet-popup-content-wrapper { padding: .15rem .35rem; }
.leaflet-popup-content {
  margin: .55rem .8rem !important;
  font-size: .7rem !important;
  letter-spacing: .02em !important;
  color: #fff !important;
  line-height: 1.35;
}
.leaflet-popup-content b,
.leaflet-popup-content strong {
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .58rem;
  font-weight: 700;
}
.leaflet-popup-close-button {
  color: rgba(255,255,255,.65) !important;
  font-size: 18px !important;
  padding: 4px 6px !important;
}
.leaflet-popup-close-button:hover { color: #fff !important; }

.leaflet-tooltip {
  background: var(--ink-1) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 0 !important;
  font-family: var(--font-sans) !important;
  font-size: .56rem !important;
  letter-spacing: .12em !important;
  text-transform: uppercase;
  font-weight: 700 !important;
  padding: .25rem .5rem !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.2) !important;
}
.leaflet-tooltip::before { display: none !important; }

.leaflet-control-zoom {
  border: 1px solid var(--hair) !important;
  border-radius: 0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.06) !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  background: var(--paper) !important;
  color: var(--ink-1) !important;
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid var(--hair) !important;
  font-family: var(--font-sans) !important;
  font-weight: 700 !important;
  width: 26px !important;
  height: 26px !important;
  line-height: 26px !important;
  font-size: 14px !important;
  transition: background var(--t-quick), color var(--t-quick);
}
.leaflet-control-zoom a:last-child { border-bottom: none !important; }
.leaflet-control-zoom a:hover {
  background: var(--ink-1) !important;
  color: #fff !important;
}

.leaflet-control-attribution,
.leaflet-control-scale-line {
  background: rgba(250,250,248,.85) !important;
  color: var(--ink-3) !important;
  font-family: var(--font-sans) !important;
  font-size: .5rem !important;
  letter-spacing: .08em !important;
  border: 1px solid var(--hair) !important;
  border-radius: 0 !important;
  padding: .12rem .4rem !important;
}
.leaflet-control-attribution a {
  color: var(--ink-2) !important;
}

/* Map legend — shared */
.map-legend {
  background: rgba(250,250,248,.94) !important;
  border-radius: 0 !important;
  border: 1px solid var(--hair) !important;
  border-top: 2px solid var(--ink-1) !important;
  padding: .35rem .6rem !important;
  letter-spacing: var(--tracking-tab) !important;
  text-transform: uppercase;
  font-weight: 700;
}

/* ============================================================
   Old north-arrow markup — superseded by .hntb-map-controls
   ============================================================ */
.north-arrow,
.vol-north-arrow { display: none !important; }

/* ============================================================
   Unified map controls cluster (upper-right of every map)
   - Bigger north arrow with orange spark needle
   - Aerial toggle (Esri World Imagery)
   - Opacity slider (revealed when aerial is on)
   Built by assets/js/map-controls.js
   ============================================================ */
.hntb-map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 850;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: auto;
  font-family: var(--font-sans);
}

/* North arrow */
.hmc-north {
  width: 56px;
  height: 80px;
  padding: 8px 6px;
  box-sizing: border-box;
  background: rgba(11,16,21,.94);
  border: 1px solid rgba(255,255,255,.14);
  border-top: 2px solid var(--spark);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.hmc-north::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 7px; height: 7px;
  border-top: 1px solid var(--spark);
  border-left: 1px solid var(--spark);
}
.hmc-north::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 7px; height: 7px;
  border-bottom: 1px solid rgba(255,255,255,.42);
  border-right: 1px solid rgba(255,255,255,.42);
}
.hmc-north svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

/* Aerial toggle button */
.hmc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(11,16,21,.94);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.78);
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  transition: background var(--t-quick), color var(--t-quick), border-color var(--t-quick);
}
.hmc-toggle .hmc-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.35);
  transition: background var(--t-quick), border-color var(--t-quick), box-shadow var(--t-quick);
}
.hmc-toggle:hover {
  background: rgba(11,16,21,1);
  color: #fff;
}
.hmc-toggle:hover .hmc-dot { border-color: var(--spark); }
.hmc-toggle.on {
  background: var(--ink-1);
  border-color: var(--ink-1);
  color: #fff;
}
.hmc-toggle.on .hmc-dot {
  background: var(--spark);
  border-color: var(--spark);
  box-shadow: 0 0 6px rgba(249,70,28,.7);
}

/* Opacity slider strip */
.hmc-opacity {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(11,16,21,.94);
  border: 1px solid rgba(255,255,255,.14);
  padding: 8px 12px;
  color: rgba(255,255,255,.7);
  font-size: .5rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.hmc-opacity[hidden] { display: none; }
.hmc-opacity input[type="range"] {
  width: 90px;
  height: 18px;
  background: transparent;
  cursor: pointer;
}
/* Re-skin the slider for the dark cluster (overrides app-shell's light-bg
   slider). */
.hmc-opacity input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: rgba(255,255,255,.22);
}
.hmc-opacity input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  margin-top: -5px;
  background: var(--spark);
  border: 2px solid var(--spark);
  border-radius: 0;
  box-shadow: 0 0 0 2px rgba(11,16,21,.94);
}
.hmc-opacity input[type="range"]::-moz-range-track {
  height: 2px;
  background: rgba(255,255,255,.22);
}
.hmc-opacity input[type="range"]::-moz-range-thumb {
  width: 10px; height: 10px;
  background: var(--spark);
  border: 2px solid var(--spark);
  border-radius: 0;
}
.hmc-opacity-val {
  color: var(--spark);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  min-width: 2.6rem;
  text-align: right;
}

/* Tighter on small viewports */
@media (max-width: 720px) {
  .hntb-map-controls { top: 8px; right: 8px; gap: 6px; }
  .hmc-north { width: 44px; height: 64px; padding: 6px 4px; }
  .hmc-toggle { padding: 6px 9px; font-size: .5rem; letter-spacing: .18em; }
  .hmc-opacity { padding: 6px 9px; gap: 7px; }
  .hmc-opacity input[type="range"] { width: 70px; }
}

/* Map clock placement
   Originally top-right. Top-right now hosts the new controls cluster,
   and bottom-right hosts the Leaflet attribution which was clipping
   the date readout. Park it at top-left, just past the zoom buttons
   (~10-36px wide) where it has full horizontal room and no neighbors. */
.map-clock {
  top: 12px !important;
  left: 80px !important;
  right: auto !important;
  bottom: auto !important;
}
@media (max-width: 720px) {
  .map-clock { left: 60px !important; }
}

/* ============================================================
   Top warning banner (crash-explorer)
   ============================================================ */
.top-warning {
  background: var(--ink-1) !important;
  color: #fff !important;
  border-bottom: 1px solid var(--ink-2) !important;
  font-size: .58rem !important;
  letter-spacing: .14em !important;
  text-transform: uppercase;
  font-weight: 700 !important;
  padding: .45rem 1.1rem !important;
  position: relative;
}
.top-warning::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--spark);
}
.top-warning strong { color: var(--spark) !important; letter-spacing: .14em; }

/* ============================================================
   Override original "AI-default" hard-coded inline styles where
   possible. Inline `style="..."` rules can't be overridden by CSS
   without `!important`, so we strengthen common ones here.
   ============================================================ */
.dir-toggle-note,
.export-status,
[id$="ExportStatus"] {
  font-size: .58rem !important;
  letter-spacing: .04em;
  color: var(--ink-3) !important;
}

/* ============================================================
   Page-level small-screen tweaks for new shell
   ============================================================ */
@media (max-width: 720px) {
  .summary-strip { gap: 1rem !important; padding: .55rem .8rem !important; }
  .summary-val { font-size: 1.25rem !important; }
  input[type="range"] { height: 28px; }
}

/* ============================================================
   Small viewport refinements (existing)
   ============================================================ */
@media (max-width: 720px) {
  .hero { padding: .55rem .8rem .65rem !important; }
  .hero::before { left: .8rem; }
  .hero h1 { letter-spacing: .03em !important; }
  .page-tabs, .forecast-subtabs { padding: 0 .6rem !important; }
}
