:root {
  --paper: #fbfaf7;
  --panel: #ffffff;
  --ink: #111827;
  --slate: #243142;
  --muted: #64748b;
  --line: #d7dde6;
  --navy: #17345c;
  --green: #1f6b57;
  --amber: #9a6700;
  --red: #9f3232;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
  --soft: 0 14px 38px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
summary {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  height: 4px;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--navy));
}

.hero {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fbfaf7 0%, #eef4f1 52%, #edf2f8 100%);
}

.hero-inner,
.wrap,
footer > div {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 40px;
  align-items: start;
  padding: 56px 0;
}

.eyebrow,
.section-kicker,
.card-kicker {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin: 16px 0 0;
  font-size: clamp(2.6rem, 6vw, 5.6rem);
  font-weight: 680;
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 760px;
  margin: 26px 0 0;
  color: var(--slate);
  font-size: 1.18rem;
  line-height: 1.75;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.badge,
.sticky-nav a,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--slate);
  font-size: 0.82rem;
  font-weight: 750;
}

.badge {
  padding: 0.25rem 0.75rem;
}

.purpose-card,
.premium-card,
.source-card,
.map-card,
.filter-card,
.selected-panel,
.interactive-shell,
.disclosure-card,
.faq-item,
.corrections-card,
.text-event-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--soft);
}

.purpose-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
}

.purpose-card p:last-child {
  margin: 12px 0 0;
  color: var(--slate);
  line-height: 1.7;
}

.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px max(20px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.sticky-nav a {
  flex: 0 0 auto;
  padding: 0.36rem 0.78rem;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.sticky-nav a:hover {
  border-color: var(--navy);
  background: #f2f6f9;
  color: var(--navy);
}

.wrap {
  padding: 28px 0;
}

.disclaimer {
  border: 1px solid #f3d48c;
  border-radius: 18px;
  background: rgba(255, 248, 230, 0.86);
  padding: 22px;
  box-shadow: var(--soft);
}

.disclaimer p:last-child {
  margin: 12px 0 0;
  color: var(--slate);
  font-size: 1rem;
  line-height: 1.75;
}

.section-title {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: clamp(2rem, 3vw, 2.85rem);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: 0;
}

.glance-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.premium-card {
  min-height: 145px;
  padding: 20px;
}

.premium-card h3 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.35;
}

.premium-card p {
  color: var(--muted);
  line-height: 1.65;
}

.source-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.source-card h2 {
  margin: 10px 0 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.source-card p {
  color: var(--slate);
  font-size: 1.08rem;
  line-height: 1.7;
}

.source-card aside {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 20px;
}

.source-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 0;
}

.source-facts div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.source-facts dt,
.selected-list dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.source-facts dd,
.selected-list dd {
  margin: 6px 0 0;
  color: var(--slate);
  font-weight: 700;
}

.section-head {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-head > p {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.map-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.map-card {
  overflow: hidden;
}

.control-bar {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 14px;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.control-group > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.control-button {
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: var(--slate);
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.control-button:hover {
  border-color: var(--navy);
  background: #f2f6f9;
}

.control-button:active {
  transform: translateY(1px);
}

.control-button.is-selected,
.control-button.is-animating {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.map-stage {
  position: relative;
  height: min(68vh, 620px);
  min-height: 460px;
  background: #e8eef3;
}

.case-map,
.simple-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.simple-map {
  z-index: 3;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(23, 52, 92, 0.08) 1px, transparent 1px), linear-gradient(rgba(23, 52, 92, 0.08) 1px, transparent 1px), #eef4f8;
  background-size: 48px 48px;
}

.simple-map svg {
  display: block;
  width: 100%;
  height: 100%;
}

.simple-empty {
  padding: 20px;
  color: var(--slate);
  font-weight: 750;
}

.map-status {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  max-width: min(34rem, calc(100% - 32px));
  border: 1px solid rgba(215, 221, 230, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 15px;
  color: var(--slate);
  font-size: 0.88rem;
  font-weight: 750;
  box-shadow: var(--soft);
  backdrop-filter: blur(12px);
}

.legend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  border-top: 1px solid var(--line);
  padding: 14px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 750;
}

.legend-grid span,
.meta-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.legend-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--navy);
}

.legend-dot.filing { background: var(--navy); }
.legend-dot.approx { background: var(--amber); }
.legend-dot.exact { background: var(--green); }
.legend-dot.review { background: var(--red); }
.legend-dot.high { background: var(--slate); }

.legend-line {
  width: 26px;
  border-top: 3px dashed var(--green);
}

.side-stack {
  display: grid;
  gap: 16px;
}

.map-grid.map-only {
  grid-template-columns: 1fr;
}

.record-explorer {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  padding: 18px;
  box-shadow: var(--soft);
}

.record-explorer > .section-head {
  margin-bottom: 16px;
}

.record-explorer > .section-head p:last-child,
#interactiveCount {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.explorer-controls {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.pov-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.pov-button {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--slate);
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.pov-button:hover,
.pov-button:focus-visible,
.pov-button.is-selected {
  border-color: var(--navy);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.pov-button.is-selected {
  background: #f4f8fb;
  box-shadow: inset 0 0 0 2px rgba(23, 52, 92, 0.2), 0 12px 28px rgba(15, 23, 42, 0.12);
}

.pov-button strong,
.pov-button span {
  display: block;
}

.pov-button strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.pov-button span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.explorer-search {
  max-width: 760px;
}

.advanced-filters {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8fafc;
  padding: 0 14px;
}

.advanced-filters summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.record-tabs {
  margin: 6px 0 14px;
}

.clear-filters {
  justify-self: start;
}

.filter-card,
.selected-panel {
  padding: 18px;
}

.filter-card h3,
.interactive-head h3 {
  font-size: 1.12rem;
  font-weight: 800;
}

.search-label {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-input {
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 13px;
  padding: 0 13px;
}

.filter-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  padding: 7px 10px;
  color: var(--slate);
  font-weight: 750;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--navy);
}

.check-row:has(input:checked) {
  border-color: var(--navy);
  background: #f4f8fb;
  box-shadow: inset 0 0 0 1px rgba(23, 52, 92, 0.14);
}

.selected-panel h2 {
  margin: 8px 0 0;
  font-size: 1.45rem;
  line-height: 1.18;
}

#selectedEventBody {
  margin-top: 16px;
  color: var(--slate);
  line-height: 1.65;
}

.selected-list {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}

.interactive-shell {
  margin-top: 18px;
  padding: 16px;
}

.interactive-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.interactive-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.interactive-timeline {
  display: grid;
  max-height: none;
  overflow: visible;
  gap: 10px;
}

.interactive-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  padding: 16px;
  font-weight: 750;
}

.interactive-event {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.interactive-event:hover,
.interactive-event.is-selected {
  border-color: var(--navy);
  box-shadow: var(--soft);
}

.interactive-event.is-selected {
  background: #f8fbfd;
}

.interactive-time {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.interactive-event h3,
.text-event-card h3 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.interactive-event p,
.text-event-card p {
  margin: 6px 0 10px;
  color: #475569;
  line-height: 1.58;
}

.status-chip {
  min-height: 28px;
  padding: 2px 9px;
  font-size: 0.76rem;
}

.status-chip.good {
  border-color: #b7d7cc;
  background: #edf8f4;
  color: var(--green);
}

.status-chip.warn {
  border-color: #f3d48c;
  background: #fff8e6;
  color: #805400;
}

.marker-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.24);
  font-size: 0.72rem;
  font-weight: 900;
}

.marker-dot.review {
  box-shadow: 0 0 0 4px rgba(154, 103, 0, 0.26), 0 8px 22px rgba(15, 23, 42, 0.24);
}

.marker-dot.active {
  outline: 4px solid rgba(23, 52, 92, 0.28);
  transform: scale(1.16);
}

.movement-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 160px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--movement-color, var(--navy));
  color: #fff;
  padding: 0 12px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.playback-line-complete {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-timeline {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.text-event-card {
  display: block;
  padding: 18px;
}

.text-event-card.is-filtered-out {
  display: none !important;
}

.text-event-toggle {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.text-event-card.is-highlighted {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(23, 52, 92, 0.15), var(--soft);
}

.text-event-card.is-expanded {
  background: #f8fbfd;
}

.text-event-summary {
  min-width: 0;
}

.expand-indicator {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 900;
}

.text-event-card.is-expanded .expand-indicator {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.text-event-card.is-expanded .expand-indicator::before {
  content: "Collapse";
}

.text-event-card.is-expanded .expand-indicator {
  font-size: 0;
}

.text-event-card.is-expanded .expand-indicator::before {
  font-size: 0.74rem;
}

.event-full-detail {
  margin: 16px 0 0 11rem;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--slate);
  line-height: 1.65;
}

.text-event-date {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.text-event-date span {
  display: block;
  margin-top: 6px;
  color: var(--green);
}

.hidden {
  display: none !important;
}

.note-card {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 18px;
  color: var(--slate);
}

.disclosure-card {
  padding: 22px;
}

.disclosure-card summary,
.faq-item summary {
  cursor: pointer;
  list-style: none;
}

.disclosure-card summary::-webkit-details-marker,
.faq-item summary::-webkit-details-marker {
  display: none;
}

.disclosure-card summary,
.faq-item summary {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.disclosure-card summary strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.disclosure-card summary::after,
.faq-item summary::after {
  content: "+";
  color: var(--navy);
  font-size: 1.4rem;
  font-weight: 850;
}

.disclosure-card[open] summary::after,
.faq-item[open] summary::after {
  content: "-";
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
  color: var(--slate);
  line-height: 1.65;
}

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.faq-item {
  padding: 18px;
}

.faq-item summary {
  color: var(--ink);
  font-weight: 800;
}

.faq-item p {
  margin: 12px 0 0;
  color: #475569;
  line-height: 1.65;
}

.corrections-card {
  padding: 28px;
  box-shadow: var(--shadow);
}

.corrections-card p {
  max-width: 760px;
  color: var(--slate);
  line-height: 1.7;
}

.correction-form {
  display: grid;
  gap: 14px;
  max-width: 860px;
  margin-top: 22px;
}

.correction-form label {
  display: grid;
  gap: 7px;
  color: var(--slate);
  font-weight: 800;
}

.correction-form input,
.correction-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
}

.correction-form textarea {
  min-height: 150px;
  resize: vertical;
}

.honeypot {
  display: none !important;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.form-status.success {
  color: var(--green);
}

.form-status.error {
  color: var(--red);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.correction-form button,
.corrections-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.corrections-card a {
  background: #f8fafc;
  color: var(--navy);
  border: 1px solid var(--line);
}

.form-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

footer {
  border-top: 1px solid var(--line);
  background: var(--slate);
  color: #fff;
}

footer > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 30px 0;
}

footer p {
  margin: 0;
  line-height: 1.7;
}

footer a {
  color: #fff;
  font-weight: 800;
  text-underline-offset: 4px;
}

.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
}

.leaflet-popup-content {
  min-width: 230px;
  max-width: min(320px, 78vw);
  max-height: 320px;
  overflow: auto;
  margin: 14px;
  color: var(--slate);
  line-height: 1.45;
}

.leaflet-popup-content a {
  color: var(--navy);
  font-weight: 800;
}

@media (max-width: 1100px) {
  .hero-inner,
  .source-card,
  .map-grid {
    grid-template-columns: 1fr;
  }

  .side-stack {
    grid-template-columns: 1fr 1fr;
  }

  .glance-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pov-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hero-inner,
  .wrap,
  footer > div {
    width: min(100% - 28px, 1240px);
  }

  .hero-inner {
    padding: 40px 0;
  }

  .section-head,
  footer > div {
    display: block;
  }

  .source-facts,
  .method-grid,
  .three-grid,
  .glance-grid,
  .category-grid,
  .side-stack,
  .pov-tabs,
  .interactive-event,
  .text-event-toggle,
  .text-event-card {
    grid-template-columns: 1fr;
  }

  .event-full-detail {
    margin-left: 0;
  }

  .map-stage {
    height: 58vh;
    min-height: 420px;
  }

  .control-group {
    align-items: stretch;
  }

  .control-group > span {
    width: 100%;
  }

  .control-button {
    flex: 1 1 10rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 4.2rem);
  }

  footer a {
    display: inline-block;
    margin-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
