/* Fonts are declared here rather than @import-ed from the fontsource CSS:
   an @import is only discovered after this file downloads, which adds two
   round trips before any text can be drawn in its real font. Latin and
   Latin Extended only; other scripts fall back to the system font. */
@font-face {
  font-family: 'Source Serif 4 Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(/vendor/fonts/source-serif/files/source-serif-4-latin-ext-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4 Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(/vendor/fonts/source-serif/files/source-serif-4-latin-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4 Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(/vendor/fonts/source-serif/files/source-serif-4-latin-ext-opsz-italic.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4 Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(/vendor/fonts/source-serif/files/source-serif-4-latin-opsz-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/vendor/fonts/inter/files/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/vendor/fonts/inter/files/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/vendor/fonts/plex-mono/files/ibm-plex-mono-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/vendor/fonts/plex-mono/files/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/vendor/fonts/plex-mono/files/ibm-plex-mono-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/vendor/fonts/plex-mono/files/ibm-plex-mono-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Concrete, asphalt and a traffic-cone highlighter: dark rules on cool grey,
   dashed lane lines between sections, a serif for headlines and mono only
   for small labels. */
:root {
  --paper: #eff0ed;
  --paper-2: #e2e4e0;
  --card: #f9faf8;
  --ink: #171b20;
  --ink-2: #3e454d;
  --muted: #6b737c;
  --line: #d0d4d0;
  --accent: #ff8a45;
  --accent-hover: #ffa068;
  --accent-ink: #171b20;
  /* Severity colour for the "small" pin and the admin severity meter. */
  --yellow: #f5c400;
  --yellow-ink: #171b20;
  --red: #c7401f;
  --amber: #e8a33d;
  --green: #3f7d4a;

  /* Dark surfaces (call-to-action blocks, admin sidebar). */
  --asphalt: #1c2228;
  --asphalt-2: #262d34;
  --asphalt-3: #343c45;
  --line-dark: #3d4650;

  --display: "Source Serif 4 Variable", "Source Serif 4", Georgia, "Times New Roman", serif;
  --body: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;
  --radius-lg: 12px;
  --lane: repeating-linear-gradient(90deg, var(--ink) 0 24px, transparent 24px 40px);
  --rule: 1px solid var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Highlighter: a marker stroke under a few words in headlines. */
mark, .hl {
  background: linear-gradient(transparent 58%, var(--accent) 58%, var(--accent) 92%, transparent 92%);
  color: inherit;
  padding: 0 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Small uppercase mono label. */
.label-mono, .eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--paper);
  color: var(--ink);
  border-bottom: var(--rule);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-dim { color: var(--muted); font-weight: 400; }
.brand-mark { width: 10px; height: 10px; flex: none; background: var(--accent); }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a:not(.btn) {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-2);
}
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.nav .btn { gap: 0; }
@media (max-width: 640px) {
  .nav .nav-hide-sm { display: none; }
}
@media (max-width: 400px) {
  .brand { font-size: 15px; gap: 8px; }
  .nav .btn-sm { padding: 0 12px; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border: var(--rule);
  border-radius: var(--radius);
  font-family: var(--body);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary, .btn-dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover, .btn-dark:hover { background: var(--asphalt-3); border-color: var(--asphalt-3); }
.btn-ghost { border-color: currentColor; background: transparent; }
.btn-ghost:hover { background: rgba(127, 127, 127, 0.12); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Landing: hero ---------- */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  padding-top: clamp(48px, 9vw, 112px);
  padding-bottom: clamp(56px, 9vw, 112px);
}
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 28px; }
.eyebrow b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 6.4vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}
.hero h1 mark { font-style: italic; font-weight: 600; }
.hero .lede {
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--ink-2);
  max-width: 32em;
  margin: 0 0 36px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-map {
  margin: 0;
  border: var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
}
.hero-map-canvas {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 540px;
  width: 100%;
  background: var(--paper-2);
}
.hero-map .leaflet-container { background: var(--paper-2); }
.hero-map-caption {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-top: var(--rule);
  font-family: var(--mono); font-size: 13px; color: var(--ink-2);
}
.hero-map-caption strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-map-caption a { color: var(--ink); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.live-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 1px var(--ink); flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: pulse 2s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.3; } }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-map-canvas { aspect-ratio: 1 / 1; max-height: 420px; }
}

/* Live numbers under the hero */
.stats {
  list-style: none; margin: 0 0 clamp(56px, 8vw, 96px); padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: var(--rule); border-radius: var(--radius-lg); background: var(--card);
}
.stats li { padding: 22px 24px; }
.stats li + li { border-left: var(--rule); }
.stats b {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: clamp(32px, 4vw, 44px); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stats span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 560px) {
  .stats li { padding: 16px 14px; }
  .stats span { letter-spacing: 0.04em; }
}

/* ---------- Landing: sections ---------- */

/* Sections are separated by a dashed lane line, like a road's centre marking. */
.section { padding: 0 0 clamp(56px, 8vw, 104px); }
.section > .wrap::before {
  content: ""; display: block; height: 3px; border-radius: 2px;
  background: var(--lane); opacity: 0.85;
  margin-bottom: clamp(48px, 7vw, 88px);
}
.kicker {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 16px;
}
.kicker::before { content: ""; width: 18px; height: 3px; background: var(--accent); border-radius: 2px; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(20px, 5vw, 72px);
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-head h2, .h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
}
.section-head h2 em, .h2 em { font-weight: 500; }
.section-head p { margin: 0; color: var(--ink-2); font-size: 18px; max-width: 34em; align-self: end; }
@media (max-width: 760px) {
  .section-head { grid-template-columns: 1fr; }
}

/* The cost: a ledger between rules */
.ledger { list-style: none; margin: 0; padding: 0; border-top: var(--rule); }
.ledger li {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 12px 32px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.ledger li:last-child { border-bottom: var(--rule); }
.ledger .num {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(44px, 5.6vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ledger .num small { font-size: 0.5em; letter-spacing: 0; }
.ledger .what { font-size: 18px; line-height: 1.5; margin: 0; }
.ledger .src { font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--muted); margin: 0; }
.ledger .src a { color: var(--muted); }
@media (max-width: 760px) {
  .ledger li { grid-template-columns: 1fr; padding: 22px 0; }
}
.footnote {
  margin: 32px 0 0;
  max-width: 44em;
  font-family: var(--display);
  font-style: italic;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* How it works: three boxes sharing their borders */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.steps li { padding: 28px; border: var(--rule); border-radius: var(--radius-lg); background: var(--card); }
.steps .step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--mono); font-size: 14px; font-weight: 600;
}
.steps h3 {
  font-family: var(--display); font-weight: 600;
  font-size: 26px; line-height: 1.15; margin: 14px 0 10px;
}
.steps p { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; gap: 12px; }
}

/* Open data */
.data-grid {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px);
}
.who { list-style: none; margin: 0; padding: 0; border-top: var(--rule); }
.who li { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 16px; }
.who li b { font-weight: 600; }
.who li span { color: var(--ink-2); }
.downloads {
  background: var(--card);
  border: var(--rule);
  border-radius: var(--radius-lg);
  padding: 28px;
  align-self: start;
}
.downloads h3 { margin: 0 0 8px; font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.downloads p { margin: 0 0 20px; color: var(--ink-2); font-size: 15px; }
.downloads .row { display: flex; flex-wrap: wrap; gap: 10px; }
.downloads code { font-family: var(--mono); font-size: 13px; background: var(--paper-2); padding: 1px 5px; }
@media (max-width: 760px) {
  .data-grid { grid-template-columns: 1fr; }
  .who li { grid-template-columns: 1fr; gap: 2px; }
}

/* Closing call to action: one dark block */
.cta-block {
  position: relative;
  overflow: hidden;
  background: var(--asphalt);
  color: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(36px, 6vw, 72px) clamp(28px, 6vw, 72px);
}
/* A lane marking along the bottom edge. */
.cta-block::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 44px, transparent 44px 72px);
}
.cta-block .h2 { max-width: 16em; margin-bottom: 16px; }
.cta-block .counter { font-size: 17px; color: #b8c0c8; margin: 0 0 32px; }
.cta-block .counter b { color: var(--paper); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Footer */
.site-footer {
  border-top: var(--rule);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  padding: 28px 0 44px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.site-footer a { color: var(--ink); }
.site-footer p { margin: 0; }

/* ---------- Pothole detail (map panel + standalone page) ---------- */

.detail h2 {
  font-family: var(--body); font-weight: 700;
  font-size: 24px; line-height: 1.2; margin: 0 0 6px;
}
.detail .place { font-family: var(--mono); color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.badge {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 3px 10px; border: var(--rule); border-radius: 999px; background: var(--card);
}
.badge-sev-3 { background: var(--accent); }
.badge-sev-2 { background: var(--paper-2); }
.badge-fixed { background: var(--ink); color: var(--paper); }

.gallery {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 18px;
}
.gallery a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--paper-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery a:first-child { grid-column: span 3; aspect-ratio: 4 / 3; }

.facts {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 20px; font-size: 14px;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.facts dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.facts dd { margin: 0; }

.vote-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.plus-one { min-width: 132px; }
.plus-one .count { font-variant-numeric: tabular-nums; }
.plus-one[aria-pressed="true"] { background: var(--accent); border-color: var(--ink); color: var(--ink); }
.detail .small { font-size: 13px; color: var(--muted); }
.detail .small a { color: var(--ink-2); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(23, 27, 32, 0.94);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 100%; object-fit: contain; }
.lightbox button {
  position: absolute; top: 12px; right: 12px; background: none; border: 0; color: #fff;
  font-size: 32px; line-height: 1; cursor: pointer; padding: 8px 12px;
}

/* ---------- Forms (report page) ---------- */

.page { padding-top: clamp(32px, 6vw, 64px); padding-bottom: 88px; }
.page-narrow { max-width: 720px; }
.page h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(38px, 5vw, 56px); line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 12px;
}
.page .intro { color: var(--ink-2); margin: 0 0 36px; }

.field { margin: 0 0 32px; border: 0; padding: 0; }
.field > legend, .field > label.label {
  display: block; font-weight: 600; font-size: 16px; margin: 0 0 10px; padding: 0;
}
.field .hint { font-size: 14px; color: var(--muted); margin: -4px 0 10px; }
.step-label {
  font-family: var(--mono); color: var(--muted); font-weight: 400; margin-right: 8px;
  font-variant-numeric: tabular-nums;
}
.step-label::before { content: "0"; }

.drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 200px;
  border: 1px dashed var(--ink);
  border-radius: var(--radius-lg);
  background: repeating-linear-gradient(-45deg, var(--paper-2) 0 14px, var(--card) 14px 28px);
  text-align: center;
  padding: 20px;
  cursor: pointer;
  overflow: hidden;
}
.drop:hover { border-style: solid; }
.drop.has-photo { border-style: solid; padding: 0; min-height: 0; background: var(--card); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop strong { font-size: 16px; background: var(--card); padding: 6px 14px; border: var(--rule); border-radius: 999px; }
.drop span { font-size: 14px; color: var(--muted); }
.drop img { width: 100%; max-height: 380px; object-fit: cover; }

.pick-map {
  height: 320px; border: var(--rule); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--paper-2);
}
.loc-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; font-size: 14px; }
.loc-status { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.loc-status.warn { color: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px;
  border: var(--rule); border-radius: 999px; background: var(--card); font-size: 15px;
}
.chip input:checked + span { background: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.input {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: var(--rule); border-radius: var(--radius); background: var(--card);
}
.input:focus { outline: 2px solid var(--ink); outline-offset: 0; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-error {
  display: none; margin: 0 0 20px; padding: 12px 14px; border: 1px solid var(--red); border-radius: var(--radius);
  background: #f7e4dc; color: #6d1f0c;
}
.form-error.show { display: block; }

.result { display: none; }
.result.show { display: block; }
.result .big {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(36px, 5vw, 54px); line-height: 1.08; margin: 0 0 12px;
}
.result p { font-size: 18px; color: var(--ink-2); margin: 0 0 24px; max-width: 32em; }

/* ---------- Map page ---------- */

.map-page { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--paper); }
.map-page .site-header { flex: none; }
.map-shell { position: relative; flex: 1; min-height: 0; display: flex; }
#map { flex: 1; min-width: 0; background: #d8d4ca; }
/* Multiply-blend the heat into the map instead of painting over it, so roads,
   rivers and built-up areas stay visible through hotspots. The blend has to
   sit on the pane: each Leaflet pane is its own stacking context. Heat
   opacity is lowered further as you zoom in (see map.js). */
#map .leaflet-overlay-pane { mix-blend-mode: multiply; }
#map .leaflet-heatmap-layer { transition: opacity 0.2s; }

.map-toolbar {
  position: absolute; z-index: 800; top: 12px; left: 12px; right: 12px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start;
  pointer-events: none;
}
.map-toolbar > * { pointer-events: auto; }
.search {
  display: flex; flex: 1 1 260px; max-width: 360px;
  background: var(--card); border: var(--rule); border-radius: var(--radius);
}
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 12px; min-height: 42px; }
.search input:focus { outline: none; }
.search:focus-within { outline: 2px solid var(--ink); outline-offset: 1px; }
.search button {
  border: 0; border-left: var(--rule); background: none; padding: 0 14px; cursor: pointer;
  font-size: 14px; font-weight: 600;
}
.map-select {
  min-height: 44px; border: var(--rule); border-radius: var(--radius); background: var(--card); padding: 0 10px;
  font-size: 14px;
}
.seg {
  display: inline-flex; background: var(--card); border: var(--rule); border-radius: var(--radius); overflow: hidden;
}
.seg button {
  border: 0; background: none; min-height: 42px; padding: 0 14px; cursor: pointer;
  font-size: 14px; font-weight: 600;
}
.seg button + button { border-left: var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.map-legend {
  position: absolute; z-index: 800; left: 12px; bottom: 24px;
  background: var(--card); color: var(--ink); border: var(--rule); border-radius: var(--radius);
  padding: 10px 12px; font-family: var(--mono); font-size: 12px; max-width: 250px;
}
.map-legend .ramp {
  height: 8px; width: 180px; margin: 6px 0 4px;
  background: linear-gradient(90deg, #f5e27a, #f5c400, #e8702a, #c7401f, #7a1408);
}
.map-legend .ends { display: flex; justify-content: space-between; color: var(--muted); }
.map-legend .dot-key { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.map-note {
  position: absolute; z-index: 800; left: 50%; transform: translateX(-50%); bottom: 24px;
  background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 12px; padding: 8px 14px; border-radius: 999px;
  display: none;
}
.map-note.show { display: block; }

.panel {
  flex: none;
  width: 400px;
  background: var(--paper);
  border-left: var(--rule);
  overflow-y: auto;
  padding: 22px 24px 28px;
  display: none;
  position: relative;
  z-index: 900;
}
.panel.open { display: block; }
.panel-close {
  position: absolute; top: 10px; right: 10px; border: 0; background: none; cursor: pointer;
  font-size: 26px; line-height: 1; padding: 6px 10px; color: var(--ink-2);
}
.panel-grip { display: none; }
@media (max-width: 760px) {
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 62%;
    border-left: 0; border-top: var(--rule); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
    padding-top: 26px;
  }
  .panel-grip {
    display: block; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 2px; background: var(--line);
  }
  .map-legend { bottom: 16px; }
  .search { max-width: none; }
}

/* Markers */
.ph-marker {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--yellow); border: 2px solid var(--ink);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}
.ph-marker.sev-3 { background: var(--red); }
.ph-marker.sev-2 { background: var(--amber); }
.ph-marker.fixed { background: var(--green); }
.ph-cluster {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-weight: 600; font-size: 12px; border: 2px solid var(--paper);
  font-variant-numeric: tabular-nums;
}

.leaflet-container { font-family: var(--body); }
.leaflet-control-attribution { font-size: 11px; }
.leaflet-bar { border: var(--rule) !important; border-radius: var(--radius) !important; box-shadow: none !important; }
.leaflet-bar a { border-radius: 0 !important; background: var(--card); color: var(--ink); }

/* ---------- Misc pages ---------- */

.demo-bar {
  flex: none;
  background: var(--accent); color: var(--accent-ink);
  border-bottom: var(--rule);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-align: center;
  padding: 6px 16px;
}

.notfound { padding: 104px var(--gutter); }
.notfound h1 { font-family: var(--display); font-weight: 400; font-size: clamp(48px, 8vw, 72px); line-height: 1.05; margin: 0 0 14px; }

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