:root {
  color-scheme: dark;
  --bg: #0b1014;
  --panel: #10171b;
  --line: #283238;
  --ink: #e7e3d9;
  --muted: #9ba8af;
  --gold: #cbb58a;
  --red: #ba555b;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
button,
input,
a {
  font: inherit;
}
a {
  color: var(--gold);
}
button {
  color: var(--ink);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 12px;
  min-height: 40px;
}
button:hover {
  background: #233039;
  border-color: var(--gold);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
button:disabled {
  cursor: not-allowed;
}
h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}
p {
  line-height: 1.65;
  color: var(--muted);
}
.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;
}
.skip-link {
  position: fixed;
  top: -100px;
  z-index: 3000;
  background: var(--panel);
  padding: 14px;
}
.skip-link:focus {
  top: 0;
}
.masthead {
  height: 86px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 24px;
  background: #101619;
}
.brand {
  text-decoration: none;
  display: flex;
  gap: 13px;
  align-items: center;
  font-family: Georgia, serif;
  font-size: 26px;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.brand i {
  font-size: 17px;
  color: var(--gold);
}
.brand small {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-top: 4px;
}
.brand-mark {
  font-size: 40px;
  color: var(--red);
}
.edition {
  font-size: 10px;
  letter-spacing: 0.2em;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}
.year {
  color: var(--gold);
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}
.masthead nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.text-button {
  border: 0;
  padding: 0;
  min-height: 36px;
  background: none;
  color: var(--muted);
  text-decoration: none;
}
.text-button:hover {
  background: none;
  color: var(--ink);
  border: 0;
}
.audience {
  font-size: 11px;
  text-decoration: none;
  letter-spacing: 0.04em;
  border: 1px solid #4a4235;
  padding: 10px 13px;
  color: var(--gold);
  border-radius: 4px;
}
.atlas-layout {
  display: grid;
  grid-template-columns: 290px minmax(300px, 1fr) 310px;
  height: calc(100dvh - 86px);
  min-height: 600px;
}
.sidebar,
.dossier {
  background: var(--panel);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #39434a transparent;
}
.sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar-intro {
  padding: 28px 24px 20px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 600;
}
.sidebar h1 {
  font-size: 32px;
  line-height: 1.12;
  margin: 14px 0;
  color: var(--ink);
}
.sidebar-intro p {
  font-size: 12px;
  margin-bottom: 0;
}
.audience-note {
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 12px 24px;
  background: #182126;
  color: #b1c1c9;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.audience-note.classified {
  background: #352327;
  color: #edacaa;
}
.control-section {
  padding: 19px 24px;
  border-bottom: 1px solid var(--line);
}
summary {
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink);
}
summary span,
.directory h2 span {
  float: right;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0;
}
#layer-controls {
  padding-top: 14px;
}
.layer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  position: relative;
}
.layer-row input {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
}
.layer-row label {
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  font-size: 12px;
}
.layer-glyph {
  font-size: 15px;
  width: 18px;
  text-align: center;
  color: var(--layer-color);
}
.layer-row.locked {
  color: #9ba8af;
}
.layer-row.locked label {
  cursor: default;
}
.lock-tag {
  font-size: 8px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  padding: 3px;
  margin-left: auto;
}
.opacity-label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 15px;
}
.opacity-label output {
  float: right;
  color: var(--gold);
}
#opacity {
  width: 100%;
  accent-color: var(--gold);
  margin: 12px 0 0;
  height: 20px;
}
.small-button {
  font-size: 10px;
}
.directory {
  padding: 20px 24px;
}
.directory h2 {
  font-family: system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  margin: 0 0 14px;
}
.directory input {
  width: 100%;
  background: #0b1216;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px;
  color: var(--ink);
  font-size: 11px;
}
#districts {
  padding-top: 10px;
}
.district-button {
  width: 100%;
  display: flex;
  gap: 10px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #202a30;
  border-radius: 0;
  padding: 11px 0;
  font-size: 11px;
  align-items: center;
}
.district-button:hover,
.district-button[aria-pressed="true"] {
  background: #1d282e;
}
.district-number {
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  font-size: 10px;
  min-width: 20px;
}
.district-name {
  flex: 1;
  line-height: 1.4;
}
.district-name small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}
.claim-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--claim-color);
  flex-shrink: 0;
}
.sidebar-footer {
  padding: 14px 24px 20px;
  margin-top: auto;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
}
.sidebar-footer button {
  font-size: 10px;
}
.map-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #111b20;
}
#map {
  position: absolute;
  inset: 0;
  background: #111b20;
  z-index: 0;
}
.map-heading {
  position: absolute;
  top: 26px;
  left: 26px;
  z-index: 500;
  pointer-events: none;
  text-shadow: 0 2px 8px #000;
  max-width: 70%;
}
.map-heading h2 {
  font-size: 36px;
  line-height: 1.15;
  margin: 9px 0;
}
.map-heading p {
  font-size: 11px;
  letter-spacing: 0.03em;
  color: #c2c9cc;
  margin: 0;
}
.map-tools {
  position: absolute;
  top: 140px;
  left: 26px;
  z-index: 500;
  display: flex;
  gap: 8px;
}
.map-tools button {
  background: #111a20ef;
  font-size: 10px;
  border-color: #3a454c;
  box-shadow: 0 4px 16px #0006;
}
.map-compass {
  position: absolute;
  right: 25px;
  top: 180px;
  z-index: 500;
  pointer-events: none;
  color: var(--gold);
  font-size: 10px;
  text-align: center;
}
.map-compass span {
  display: block;
  font-size: 25px;
}
.map-status {
  position: absolute;
  top: 190px;
  left: 26px;
  right: 26px;
  z-index: 600;
  background: #182329ed;
  border: 1px solid #3c505a;
  padding: 10px 13px;
  font-size: 11px;
  border-radius: 4px;
  line-height: 1.5;
}
.map-status:empty {
  display: none;
}
#retry {
  position: absolute;
  top: 260px;
  left: 26px;
  z-index: 601;
  background: var(--panel);
}
.legend {
  position: absolute;
  bottom: 68px;
  left: 22px;
  right: 22px;
  z-index: 500;
  background: #10191feb;
  border: 1px solid #344047;
  border-radius: 6px;
  padding: 14px 16px;
  backdrop-filter: blur(12px);
  max-height: 30%;
  overflow: auto;
  box-shadow: 0 8px 30px #0005;
}
.legend-title {
  font-size: 9px;
  letter-spacing: 0.13em;
  color: var(--gold);
  margin: 0 0 9px;
}
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 7px;
  font-size: 10px;
  color: #d5dade;
}
.legend-row strong {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  min-width: 82px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-swatch {
  width: 12px;
  height: 7px;
  display: inline-block;
  background: var(--swatch-color);
  border-radius: 1px;
}
.legend-line {
  height: 0;
  border-top: 2px dashed var(--swatch-color);
  background: none;
}
.map-caption {
  position: absolute;
  bottom: 27px;
  left: 22px;
  z-index: 500;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: #a6b4bc;
  pointer-events: none;
}
.map-caption span {
  padding: 0 7px;
  color: var(--gold);
}
.leaflet-control-zoom {
  border: 1px solid #45525a !important;
  margin: 25px 24px 0 0 !important;
}
.leaflet-control-zoom a {
  background: #111a20 !important;
  color: #dedbd3 !important;
  border-color: #3a454c !important;
}
.leaflet-control-attribution {
  background: #10191fe8 !important;
  color: #a8b6be !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a {
  color: #b8d0dc !important;
}
.leaflet-control-scale-line {
  background: #111a20c9;
  border-color: #a2b1b9;
  color: #d1d8dc;
  text-shadow: none;
  margin-left: 12px;
}
.leaflet-tooltip {
  background: #151f26;
  border: 1px solid #596169;
  border-radius: 4px;
  color: #ede7dc;
  box-shadow: 0 3px 15px #000a;
  font-size: 11px;
}
.leaflet-tooltip:before {
  display: none;
}
.district-label {
  font:
    10px system-ui,
    sans-serif;
  fill: #f4eee2;
  paint-order: stroke;
  stroke: #0b1014;
  stroke-width: 3px;
  pointer-events: none;
}
.dossier {
  border-left: 1px solid var(--line);
  padding: 28px 25px;
}
.dossier-symbol {
  font-size: 90px;
  color: #6f5541;
  text-align: center;
  margin: 45px 0 30px;
}
.dossier h2 {
  font-size: 30px;
  line-height: 1.2;
  margin: 20px 0 16px;
}
.dossier p {
  font-size: 12px;
}
.dossier h3 {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 24px 0 10px;
}
.dossier-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--line));
  margin: 25px 0;
}
.provenance-tag {
  display: block;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--gold);
  border: 1px solid #474032;
  padding: 9px;
  line-height: 1.6;
  margin-top: 24px;
}
.district-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--claim-color);
  border: 1px solid var(--claim-color);
  padding: 6px 9px;
  border-radius: 3px;
  margin-bottom: 8px;
}
.district-status {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--gold) !important;
  font-size: 14px !important;
}
.pressure-table {
  margin: 18px 0;
}
.pressure-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}
.pressure-row dt {
  color: var(--muted);
}
.pressure-row dd {
  margin: 0;
  color: var(--ink);
  text-align: right;
}
.story-hook {
  border-left: 2px solid var(--gold);
  padding-left: 13px;
  font-family: Georgia, serif;
  font-size: 14px !important;
  color: #ddd6c4 !important;
}
.private-notes {
  border: 1px solid #604045;
  background: #2b1d23;
  padding: 14px;
  margin-top: 20px;
  border-radius: 4px;
}
.private-notes h3 {
  margin-top: 0;
  color: #e8a9af;
}
.boundary-note {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 22px;
}
.boundary-note summary {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0;
  line-height: 1.6;
}
.boundary-note p,
.boundary-note a {
  font-size: 10px;
  overflow-wrap: anywhere;
}
.back-button {
  width: 100%;
  margin-top: 14px;
  font-size: 10px;
}
.dossier-close {
  float: right;
  padding: 2px 8px;
  min-height: 30px;
}
dialog {
  background: #111b20;
  color: var(--ink);
  border: 1px solid #59626a;
  border-radius: 8px;
  max-width: 640px;
  width: calc(100% - 32px);
  max-height: 85dvh;
  padding: 28px;
  box-shadow: 0 20px 100px #000b;
}
dialog::backdrop {
  background: #020709bb;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-size: 31px;
}
dialog h3 {
  font-size: 14px;
  color: var(--gold);
  margin-top: 24px;
}
dialog p {
  font-size: 13px;
}
dialog .legal {
  font-size: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dialog-top button {
  border: 0;
  font-size: 24px;
  min-height: 36px;
  padding: 0 8px;
}
.no-script {
  position: fixed;
  bottom: 0;
  z-index: 2000;
  background: #392126;
  padding: 20px;
  width: 100%;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1700px) {
  .atlas-layout {
    grid-template-columns: 320px minmax(300px, 1fr) 350px;
  }
  .sidebar-intro,
  .control-section,
  .directory {
    padding-left: 30px;
    padding-right: 30px;
  }
  .dossier {
    padding: 35px;
  }
}
@media (max-width: 1180px) {
  .atlas-layout {
    grid-template-columns: 260px minmax(280px, 1fr);
  }
  .dossier {
    position: absolute;
    right: 0;
    top: 86px;
    bottom: 0;
    width: 300px;
    z-index: 900;
    box-shadow: -20px 0 70px #0007;
    display: none;
  }
  .dossier.is-open {
    display: block;
  }
  .edition {
    display: none;
  }
  .map-heading h2 {
    font-size: 32px;
  }
}
@media (max-width: 700px) {
  .masthead {
    height: 72px;
    padding: 0 16px;
    gap: 12px;
  }
  .brand {
    font-size: 21px;
    gap: 8px;
  }
  .brand-mark {
    font-size: 30px;
  }
  .brand small {
    font-size: 7px;
  }
  .masthead nav {
    gap: 10px;
  }
  .masthead .text-button {
    font-size: 10px;
  }
  .audience {
    font-size: 9px;
    padding: 9px;
  }
  .atlas-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  .map-stage {
    order: 0;
    height: 65dvh;
    min-height: 450px;
  }
  .sidebar {
    order: 1;
    overflow: visible;
    border-right: 0;
  }
  .sidebar-intro {
    padding: 24px;
  }
  .sidebar h1 {
    font-size: 29px;
  }
  .sidebar h1 br {
    display: none;
  }
  .sidebar h1 br:after {
    content: " ";
  }
  .sidebar-intro p br {
    display: none;
  }
  .sidebar-intro p {
    margin-top: 10px;
  }
  .dossier {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 78dvh;
    z-index: 1100;
    border-top: 1px solid #647078;
    border-radius: 12px 12px 0 0;
    padding: 24px;
    box-shadow: 0 -20px 70px #0009;
  }
  .map-heading {
    top: 22px;
    left: 18px;
  }
  .map-heading h2 {
    font-size: 29px;
  }
  .map-heading p {
    font-size: 10px;
  }
  .map-tools {
    left: 18px;
    top: 128px;
  }
  .map-status {
    top: 177px;
    left: 18px;
    right: 18px;
  }
  .legend {
    bottom: 54px;
    left: 12px;
    right: 12px;
    padding: 12px;
    max-height: 29%;
  }
  .map-caption {
    bottom: 26px;
    left: 14px;
    font-size: 7px;
    letter-spacing: 0.02em;
  }
  .map-compass {
    display: none;
  }
  .leaflet-control-zoom {
    margin: 20px 16px 0 0 !important;
  }
  .control-section {
    padding: 22px 24px;
  }
  #layer-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
  }
  .layer-row {
    min-height: 45px;
  }
  .layer-row label {
    font-size: 11px;
    gap: 6px;
  }
  .lock-tag {
    font-size: 7px;
  }
  .directory {
    padding-bottom: 10px;
  }
  .district-button {
    font-size: 13px;
    min-height: 52px;
  }
  .directory h2 {
    font-size: 11px;
  }
  .directory input {
    font-size: 13px;
  }
  .sidebar-footer {
    padding-bottom: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
.territory-number.leaflet-tooltip {
  background: #101a20dd;
  border: 1px solid #71828c99;
  border-radius: 50%;
  font-size: 9px;
  width: 21px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #ded6c2;
  box-shadow: 0 1px 8px #0009;
  pointer-events: none;
}

#map .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.72) saturate(0.5);
}
.leaflet-bottom.leaflet-right .leaflet-control-scale {
  margin-bottom: 12px;
  margin-right: 12px;
}
