:root {
  color-scheme: dark;
  --bg: #08111e;
  --bg-soft: #0d1929;
  --panel: #111f31;
  --panel-2: #15263a;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f5f8fb;
  --muted: #a8b7c8;
  --purple: #a78bfa;
  --purple-strong: #7c3aed;
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.13);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.13);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.12);
  --cyan: #22d3ee;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius: 22px;
  --content: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 6%, rgba(124, 58, 237, 0.16), transparent 27rem),
    radial-gradient(circle at 88% 18%, rgba(34, 211, 238, 0.09), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; display: block; }
code { color: #d8ccff; font-size: 0.9em; overflow-wrap: anywhere; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 9999;
  background: white;
  color: #111827;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 12px max(24px, calc((100vw - var(--content)) / 2));
  background: rgba(8, 17, 30, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 286px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #160b2f;
  background: linear-gradient(145deg, #c4b5fd, #8b5cf6);
  font-size: 15px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -0.01em; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 1px; }
.site-header nav { display: flex; justify-content: center; gap: 8px; flex: 1; }
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}
.site-header nav a:hover, .site-header nav a:focus-visible { background: rgba(255,255,255,.07); color: white; }
.status-pill, .status-inline, .method-state {
  display: inline-flex;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.status-pill { padding: 7px 10px; white-space: nowrap; }
.status-pill.danger, .status-inline, .method-state.retracted { color: #fecdd3; background: var(--red-soft); }
.status-inline { padding: 4px 8px; }

main { display: block; }
.hero, .section, .flow-strip, footer {
  width: min(calc(100% - 40px), var(--content));
  margin-inline: auto;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, .75fr);
  gap: 42px;
  padding: 92px 0 64px;
  align-items: center;
}
.eyebrow {
  margin: 0 0 8px;
  color: #c4b5fd;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(42px, 5.7vw, 78px);
  line-height: .99;
  letter-spacing: -.055em;
}
.lede {
  max-width: 820px;
  margin: 26px 0 0;
  color: #c3cfdb;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 820;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .mini-button:focus-visible, .preset-button:focus-visible { outline: 3px solid rgba(34,211,238,.65); outline-offset: 2px; }
.button.primary { color: #15082e; background: linear-gradient(135deg, #c4b5fd, #8b5cf6); }
.button.secondary { color: white; background: rgba(255,255,255,.06); border-color: var(--line-strong); }
.button.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button.wide { width: 100%; }
.hero-metrics { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.hero-metrics div {
  min-width: 150px;
  padding: 14px 17px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.hero-metrics strong, .hero-metrics span { display: block; }
.hero-metrics strong { font-size: 23px; }
.hero-metrics span { color: var(--muted); font-size: 12px; }
.hero-warning {
  position: relative;
  padding: 30px;
  border: 1px solid rgba(251, 113, 133, .48);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(251, 113, 133, .15), rgba(17, 31, 49, .88));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-warning .warning-icon {
  position: absolute;
  top: -18px;
  right: 8px;
  color: rgba(251, 113, 133, .15);
  font-size: 170px;
  font-weight: 950;
  line-height: 1;
}
.hero-warning h2 { position: relative; margin: 0; font-size: 28px; line-height: 1.12; }
.hero-warning p:not(.eyebrow) { position: relative; color: #f4c7ce; }
.hero-warning a { position: relative; color: white; font-weight: 800; text-underline-offset: 4px; }

.flow-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 70px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(13, 25, 41, .75);
  overflow: hidden;
}
.flow-strip a { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding: 18px; text-decoration: none; border-right: 1px solid var(--line); }
.flow-strip a:last-child { border: 0; }
.flow-strip span { grid-row: span 2; color: #c4b5fd; font-size: 12px; font-weight: 900; }
.flow-strip strong, .flow-strip small { display: block; }
.flow-strip small { color: var(--muted); }
.flow-strip a:hover { background: rgba(255,255,255,.04); }

.section { padding: 78px 0; }
.section.tone { width: 100%; max-width: none; padding-inline: max(20px, calc((100vw - var(--content)) / 2)); background: rgba(255,255,255,.025); border-block: 1px solid var(--line); }
.section-heading { max-width: 820px; margin-bottom: 30px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 4vw, 55px); line-height: 1.05; letter-spacing: -.035em; }
.section-heading > p:last-child { color: var(--muted); font-size: 18px; }
.split-heading { max-width: none; display: flex; justify-content: space-between; gap: 28px; align-items: end; }
.split-heading > div:first-child { max-width: 860px; }
.support-badge {
  display: grid;
  grid-template-columns: 12px auto;
  gap: 0 10px;
  min-width: 235px;
  padding: 14px 16px;
  border: 1px solid rgba(74,222,128,.4);
  border-radius: 14px;
  background: var(--green-soft);
}
.support-badge span { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(74,222,128,.12); }
.support-badge strong, .support-badge small { display: block; grid-column: 2; }
.support-badge small { color: var(--muted); }
.support-badge.retracted { border-color: rgba(251,113,133,.44); background: var(--red-soft); }
.support-badge.retracted span { background: var(--red); box-shadow: 0 0 0 5px rgba(251,113,133,.12); }
.support-badge.experimental { border-color: rgba(251,191,36,.44); background: var(--amber-soft); }
.support-badge.experimental span { background: var(--amber); box-shadow: 0 0 0 5px rgba(251,191,36,.12); }

.evidence-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, .7fr); gap: 26px; align-items: start; }
.image-card, .viewer-shell, .map-card, .control-inspector, .mapping-inspector, .registration-figure, .route-controls, .frontier-card, .sequence-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.image-card { margin: 0; overflow: hidden; }
.image-card .image-open { max-height: 690px; }
.tall-image-card .image-open img { width: 100%; max-height: 690px; object-fit: contain; background: #050a11; }
.image-open { position: relative; display: block; width: 100%; padding: 0; border: 0; color: white; background: #060d17; cursor: zoom-in; overflow: hidden; }
.image-open > span { position: absolute; right: 14px; bottom: 14px; padding: 7px 10px; border-radius: 999px; background: rgba(8,17,30,.78); border: 1px solid rgba(255,255,255,.25); font-size: 12px; font-weight: 800; backdrop-filter: blur(10px); }
.image-card figcaption, .registration-figure figcaption { padding: 14px 17px; color: var(--muted); font-size: 13px; }
.evidence-notes { display: grid; gap: 13px; }
.note-card { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(17,31,49,.74); }
.note-card h3 { margin: 0 0 5px; font-size: 17px; }
.note-card p { margin: 0; color: var(--muted); }
.note-index { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 10px; background: rgba(167,139,250,.14); color: #ddd6fe; font-weight: 900; }

.detection-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.viewer-shell { overflow: hidden; }
.viewer-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; background: #0c1726; border-bottom: 1px solid var(--line); }
.viewer-toolbar label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 800; }
.viewer-toolbar input[type="number"] { width: 70px; }
.viewer-toolbar input[type="number"], .mini-button {
  min-height: 38px;
  padding: 7px 10px;
  color: var(--text);
  background: #15263a;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}
.mini-button { cursor: pointer; font-size: 13px; font-weight: 800; }
.mini-button[aria-pressed="true"] { color: #160b2f; background: #c4b5fd; }
.zoom-control { flex: 1; min-width: 210px; }
.zoom-control input { flex: 1; accent-color: var(--purple); }
.detection-viewport { height: min(68vh, 720px); min-height: 440px; overflow: auto; overscroll-behavior: contain; background: #050a11; }
.detection-canvas { position: relative; width: 100%; min-width: 700px; line-height: 0; transform-origin: 0 0; }
.detection-canvas img { width: 100%; height: auto; }
#detectionMarkers { position: absolute; inset: 0; pointer-events: none; }
.detection-marker {
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 2px solid white;
  border-radius: 50%;
  background: rgba(124, 58, 237, .94);
  color: white;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 3px 10px rgba(0,0,0,.45);
}
.detection-marker:hover, .detection-marker:focus-visible { z-index: 4; transform: translate(-50%,-50%) scale(1.2); }
.detection-marker.selected { z-index: 5; color: #1b1100; background: var(--amber); box-shadow: 0 0 0 7px rgba(251,191,36,.22); }
.detection-canvas.audit #detectionMarkers { display: none; }
.control-inspector, .mapping-inspector { position: sticky; top: 96px; padding: 22px; }
.control-number { color: rgba(196,181,253,.18); font-size: 78px; font-weight: 950; line-height: .95; letter-spacing: -.06em; }
.control-inspector h3, .mapping-inspector h3 { margin: 4px 0 18px; font-size: 26px; }
dl { margin: 0; }
dl div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-weight: 750; }
.inspector-note { padding: 13px; color: #f6d48a; background: var(--amber-soft); border: 1px solid rgba(251,191,36,.3); border-radius: 12px; font-size: 13px; }

.warning-banner { margin: 18px 0 24px; padding: 15px 17px; color: #f9c6cf; border: 1px solid rgba(251,113,133,.38); border-radius: 14px; background: var(--red-soft); }
.mapping-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.map-card { position: relative; padding: 8px; overflow: hidden; }
.leaflet-map { width: 100%; height: 640px; border-radius: 16px; background: #d9dedf; }
.map-key { position: absolute; left: 24px; bottom: 23px; z-index: 500; padding: 8px 10px; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; color: #1f2937; background: rgba(255,255,255,.9); box-shadow: 0 5px 15px rgba(0,0,0,.16); font-size: 11px; }
.map-warning-badge { position: absolute; z-index: 500; top: 22px; left: 22px; padding: 8px 11px; border: 1px solid rgba(251,113,133,.72); border-radius: 999px; background: rgba(65,10,24,.9); color: #fff1f2; box-shadow: 0 5px 15px rgba(0,0,0,.22); font-size: 11px; font-weight: 900; letter-spacing: .025em; text-transform: uppercase; backdrop-filter: blur(10px); }
.map-key span { display: inline-block; width: 9px; height: 9px; margin: 0 4px 0 8px; border-radius: 50%; }
.map-key span:first-child { margin-left: 0; }
.key-control { background: #f59e0b; }.key-start { background: #16a34a; }.key-end { background: #e11d48; }
.coordinate { margin: -8px 0 16px; color: #fbcfe8; font: 700 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.registration-figure { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); margin: 24px 0 0; overflow: hidden; }
.registration-figure .image-open { max-height: 470px; }
.registration-figure img { width: 100%; height: 100%; object-fit: cover; }
.registration-figure figcaption { display: grid; align-content: center; padding: 28px; font-size: 16px; }
.registration-figure figcaption strong { display: block; margin-bottom: 7px; color: white; }

.route-section { padding-top: 92px; }
.route-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.route-controls { position: sticky; top: 96px; display: grid; gap: 22px; padding: 22px; }
.input-block { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.input-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.input-heading label, .field-label { font-weight: 850; }
.input-heading output { color: #ddd6fe; font-weight: 850; }
.route-controls input[type="range"] { width: 100%; accent-color: var(--purple); }
.range-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.preset-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-button {
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.preset-button.active { color: #160b2f; border-color: #c4b5fd; background: #c4b5fd; }
.route-disclaimer { margin: 0; padding: 13px; color: #f6d48a; background: var(--amber-soft); border-radius: 12px; font-size: 12px; }
.route-results { display: grid; gap: 16px; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.result-grid article { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.result-grid span, .result-grid strong, .result-grid small { display: block; }
.result-grid span { color: var(--muted); font-size: 12px; }
.result-grid strong { margin: 5px 0; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.05; letter-spacing: -.03em; }
.result-grid small { color: #c4b5fd; overflow-wrap: anywhere; }
.route-map { height: 560px; }
.route-map-badge { position: absolute; z-index: 500; bottom: 22px; left: 22px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: rgba(8,17,30,.86); color: white; font-size: 11px; font-weight: 850; backdrop-filter: blur(10px); }
.route-summary-line { display: grid; grid-template-columns: 160px 1fr; gap: 12px; }
.route-summary-line div { padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03); }
.route-summary-line span, .route-summary-line strong { display: block; }
.route-summary-line span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.route-summary-line strong { margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.route-detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 24px; margin-top: 24px; }
.frontier-card, .sequence-card { padding: 22px; min-width: 0; }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.card-heading h3 { margin: 0; font-size: 22px; }
.card-heading > span { color: var(--muted); font-size: 12px; text-align: right; }
#frontierChart { display: block; width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.chart-grid { stroke: rgba(255,255,255,.09); stroke-width: 1; }
.chart-axis { fill: #8fa2b6; font-size: 11px; }
.chart-line { fill: none; stroke: #8b5cf6; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#frontierGradient); }
.chart-point { fill: #c4b5fd; stroke: #111f31; stroke-width: 3; cursor: pointer; }
.chart-point:hover, .chart-point.selected { fill: #fbbf24; stroke: white; }
.route-sequence { display: flex; flex-wrap: wrap; gap: 7px; max-height: 300px; margin-top: 18px; overflow: auto; }
.route-sequence span { display: inline-flex; align-items: center; min-height: 31px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.04); font-size: 12px; font-weight: 800; }
.route-sequence span:first-child { color: #bbf7d0; border-color: rgba(74,222,128,.45); }
.route-sequence span:last-child { color: #fecdd3; border-color: rgba(251,113,133,.45); }
.comparison-heading { margin: 42px 0 16px; }
.scenario-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.scenario-card { padding: 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: var(--panel); cursor: pointer; text-align: left; }
.scenario-card:hover { border-color: rgba(167,139,250,.55); transform: translateY(-1px); }
.scenario-card strong, .scenario-card span, .scenario-card small { display: block; }
.scenario-card > span { color: #c4b5fd; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.scenario-card strong { margin: 8px 0 2px; font-size: 24px; }
.scenario-card small { color: var(--muted); }

.method-section { padding-bottom: 100px; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.method-grid article { padding: 21px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.method-grid h3 { margin: 15px 0 6px; }
.method-grid p { margin: 0; color: var(--muted); }
.method-state { padding: 5px 8px; }
.method-state.supported { color: #bbf7d0; background: var(--green-soft); }
.method-state.experimental { color: #fde68a; background: var(--amber-soft); }
details { margin-top: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
summary { cursor: pointer; font-weight: 850; }
details p { color: var(--muted); }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 28px 0 42px; color: var(--muted); border-top: 1px solid var(--line); }
footer strong { color: white; }

#imageDialog { width: min(96vw, 1500px); max-width: none; max-height: 94vh; padding: 0; color: white; border: 1px solid var(--line-strong); border-radius: 18px; background: #06101c; box-shadow: var(--shadow); }
#imageDialog::backdrop { background: rgba(0,0,0,.82); backdrop-filter: blur(6px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; background: rgba(8,17,30,.94); border-bottom: 1px solid var(--line); }
.dialog-head button { width: 40px; height: 40px; color: white; background: rgba(255,255,255,.08); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 25px; }
.dialog-body { max-height: calc(94vh - 66px); overflow: auto; }
.dialog-body img { width: auto; max-width: none; min-width: 100%; margin: auto; }

.loading-state, .error-state { position: fixed; z-index: 5000; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(8,17,30,.94); box-shadow: var(--shadow); font-size: 13px; font-weight: 800; }
.loading-state span { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 2px solid #c4b5fd; border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
.error-state { color: #fecdd3; border-color: rgba(251,113,133,.45); }
@keyframes spin { to { transform: rotate(360deg); } }

.leaflet-control-attribution { font-size: 9px !important; }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 12px 14px; color: #172033; }
.leaflet-popup-content strong { color: #111827; }

@media (max-width: 1050px) {
  .site-header nav { display: none; }
  .status-pill { margin-left: auto; }
  .hero { grid-template-columns: 1fr; padding-top: 64px; }
  .hero > * { min-width: 0; }
  .evidence-grid, .detection-layout, .mapping-layout, .route-layout, .route-detail-grid { grid-template-columns: 1fr; }
  .control-inspector, .mapping-inspector, .route-controls { position: static; }
  .registration-figure { grid-template-columns: 1fr; }
  .scenario-cards { grid-template-columns: repeat(3, 1fr); }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 76px; }
  .site-header { min-height: 66px; padding: 10px 14px; }
  .brand { min-width: 0; }
  .brand small { display: none; }
  .brand-mark { width: 40px; height: 40px; }
  .status-pill { max-width: 120px; white-space: normal; text-align: center; line-height: 1.1; }
  .hero, .section, .flow-strip, footer { width: min(calc(100% - 24px), var(--content)); }
  .hero { padding: 48px 0 44px; gap: 24px; }
  .hero h1 { font-size: clamp(40px, 13vw, 58px); }
  .hero-warning { padding: 23px; }
  .flow-strip { grid-template-columns: repeat(2, 1fr); }
  .flow-strip a:nth-child(2) { border-right: 0; }
  .flow-strip a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .section { padding: 58px 0; }
  .section.tone { width: 100%; padding-inline: 12px; }
  .split-heading { display: block; }
  .support-badge { margin-top: 18px; min-width: 0; width: 100%; }
  .viewer-toolbar { align-items: stretch; }
  .zoom-control { order: 2; flex-basis: 100%; }
  .detection-viewport { min-height: 360px; height: 62vh; }
  .detection-canvas { min-width: 560px; }
  .leaflet-map { height: 520px; }
  .route-map { height: 500px; }
  .result-grid, .method-grid, .scenario-cards { grid-template-columns: 1fr 1fr; }
  .route-summary-line { grid-template-columns: 1fr; }
  .registration-figure figcaption { padding: 20px; }
  footer { display: grid; }
}

@media (max-width: 440px) {
  .hero-actions .button { width: 100%; }
  .hero-metrics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero-metrics div { min-width: 0; }
  .hero-metrics div:last-child { grid-column: 1 / -1; }
  .flow-strip { grid-template-columns: 1fr; }
  .flow-strip a { border-right: 0; border-bottom: 1px solid var(--line); }
  .flow-strip a:last-child { border-bottom: 0; }
  .result-grid, .method-grid, .scenario-cards { grid-template-columns: 1fr; }
  .map-key { left: 18px; right: 18px; bottom: 18px; text-align: center; }
  .leaflet-map { height: 470px; }
  .scenario-card { min-height: 100px; }
}

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