:root {
  color-scheme: dark;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  --page: #182320;
  --sidebar: #1b2823;
  --line: #35463d;
  --muted: #b8c4bb;
  --cream: #f2f0e6;
  --accent: #f3cf80;
  --dark: #21312a;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--cream); background: var(--page); }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible, .layer-row:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; }
svg:not(.leaflet-zoom-animated) { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.masthead { height: 82px; display: flex; align-items: center; gap: 14px; padding: 0 26px; border-bottom: 1px solid var(--line); }
.brand { min-width: 0; flex: 1; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.18rem, 2.2vw, 1.6rem); line-height: 1.2; letter-spacing: -.03em; }
.brand p { color: var(--muted); margin-top: 4px; font-size: .82rem; }
.brand p span { padding: 0 3px; }
.edition { display: flex; flex-direction: column; line-height: 1.1; gap: 5px; border-left: 1px solid var(--line); padding-left: 17px; }
.edition span { color: var(--muted); font-size: .75rem; }
.edition strong { color: var(--accent); font-size: .95rem; white-space: nowrap; }
.workspace { height: calc(100dvh - 82px); min-height: 280px; display: grid; grid-template-columns: 332px minmax(0,1fr); }
.sidebar { border-right: 1px solid var(--line); background: var(--sidebar); padding: 22px 20px; overflow: auto; scrollbar-color: #4d6356 transparent; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: #2d3628; border: 1px solid #536043; border-radius: 12px; color: #f0e6c9; font-size: .84rem; }
.notice svg { color: var(--accent); width: 18px; height: 18px; margin-top: 1px; }
.notice p { margin-top: 4px; color: #d7d8c8; }
.panel-section { margin-top: 24px; }
.panel-section h2 { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: 1.02rem; }
.panel-section h2 svg, .source-button svg { color: #a6baac; }
.layer-row { position: relative; display: grid; grid-template-columns: 19px 1fr 35px; gap: 9px; align-items: center; min-height: 44px; padding: 1px 0; border-radius: 5px; cursor: pointer; font-size: .88rem; }
.layer-row:hover { color: #fff; }
.layer-row input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch { width: 17px; height: 17px; border: 1.5px solid; border-radius: 4px; }
.allowed { background: #2aad65; border-color: #8adea5; }
.red { background: #c8494c; border-color: #f39790; }
.uncertain { background: repeating-linear-gradient(135deg,#35294d 0 4px,#d5b4ff 4px 6px); border-color: #ccb7eb; }
.landmark { width: 13px; height: 13px; border: 2px solid #d7edf4; background: #218399; border-radius: 50%; margin-left: 2px; }
.switch { position: relative; width: 35px; height: 20px; border: 1px solid #64746a; background: #2a3832; border-radius: 20px; pointer-events: none; }
.switch::before { content: ""; width: 12px; height: 12px; position: absolute; top: 3px; left: 4px; border-radius: 50%; background: #aab7ae; transition: transform .15s ease; }
input:checked + .switch { background: #f0cd80; border-color: #f0cd80; }
input:checked + .switch::before { transform: translateX(13px); background: #2b3027; }
.legend-note, .fine-print { margin-top: 7px; color: var(--muted); font-size: .79rem; }
.basemaps { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 3px; border-radius: 10px; }
.basemaps { margin-top: 13px; background: #131d19; border: 1px solid var(--line); }
.basemaps button { min-height: 39px; padding: 0 10px; border-radius: 7px; background: transparent; font-size: .84rem; font-weight: 650; white-space: nowrap; }
.basemaps button[aria-pressed="true"] { background: #36483d; }
.file-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; margin-top: 6px; border: 1px solid var(--line); background: #202f28; border-radius: 8px; text-decoration: none; font-size: .88rem; min-height: 48px; }
.file-row:hover, .source-button:hover { background: #2d4036; }
.file-row small { display: block; color: var(--muted); font-size: .76rem; }
.extension { background: #314238; border: 1px solid #495e50; color: #e9eadf; border-radius: 5px; font-weight: 700; font-size: .72rem; padding: 2px 6px; }
.source-button { margin-top: 17px; min-height: 44px; width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 5px 10px; background: transparent; border: 1px solid var(--line); border-radius: 8px; font-size: .86rem; }
.fine-print { margin-top: 13px; }
.map-panel { position: relative; min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; background-color: #e8ece1; background-image: linear-gradient(#a7b2a338 1px, transparent 1px), linear-gradient(90deg, #a7b2a338 1px, transparent 1px); background-size: 40px 40px; color: #25332b; }
.map-top { position: absolute; z-index: 600; top: 15px; right: 15px; pointer-events: none; }
.north { background: #f8f8ef; color: #25372e; border: 1px solid #c9d2c5; box-shadow: 0 4px 14px #29362b26; }
.map-tools button:focus-visible { outline-color: #245d6a; outline-offset: -2px; }
.north { width: 44px; height: 62px; text-align: center; font-size: .7rem; line-height: 1.1; font-weight: 850; border-radius: 9px; padding-top: 7px; }
.north svg { width: 21px; height: 28px; margin: 2px auto; display: block; fill: #f6f0dd; stroke: #314a3b; }
.north .needle { fill: #314a3b; }
.map-tools { z-index: 601; position: absolute; top: 88px; right: 15px; display: flex; flex-direction: column; gap: 8px; }
.tool-group { background: #f8f8ef; color: #243a30; border: 1px solid #c9d2c5; border-radius: 9px; overflow: hidden; box-shadow: 0 4px 14px #29362b26; }
.icon-button { display: grid; place-items: center; background: transparent; width: 43px; height: 43px; padding: 0; }
.tool-group button + button { border-top: 1px solid #d9dfd3; }
.tool-group button:hover, .map-message button:hover { background: #e4eae0; }
.tool-group button[aria-busy="true"] { background: #dceadb; }
.map-message { display: flex; align-items: center; gap: 9px; position: absolute; bottom: 47px; left: 50%; transform: translateX(-50%); z-index: 660; width: max-content; max-width: calc(100% - 26px); padding: 5px 6px 5px 12px; background: #f8f8ef; color: #25352b; border: 1px solid #abb9ad; border-radius: 9px; box-shadow: 0 4px 14px #29362b26; font-size: .83rem; }
.map-message button { flex-shrink: 0; color: #25352b; border-radius: 6px; }
.position-readout { position: absolute; bottom: 21px; right: 10px; z-index: 610; background: #f9f9f0; border: 1px solid #bac4b5; padding: 4px 7px; border-radius: 5px; color: #25362b; font-size: .73rem; font-variant-numeric: tabular-nums; }
.leaflet-container { font: inherit; }
.leaflet-container .leaflet-control-attribution { font-size: .67rem; }
.leaflet-popup-content { line-height: 1.42; color: #26342b; font-size: .88rem; }
.leaflet-popup-content strong { display: block; margin-bottom: 4px; }
.leaflet-popup-content p { margin: 0; }
.leaflet-tooltip.map-label { border-radius: 5px; padding: 3px 6px; font-size: .75rem; color: #135264; border-color: #9dbec1; font-weight: 700; }
.leaflet-control-scale-line { color: #1e2c24; border-color: #354b3e; background: #f8f8ebca; }
.mobile-bar, .close-sidebar { display: none; }
dialog { border: 1px solid #576b5c; border-radius: 14px; width: min(780px,calc(100% - 24px)); max-height: calc(100dvh - 24px); color: var(--cream); padding: 0; background: var(--sidebar); }
dialog::backdrop { background: #102019a0; }
.dialog-head { position: sticky; z-index: 1; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 17px; background: var(--sidebar); border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.05rem; }
.dialog-body { padding: 14px 16px 18px; }
.dialog-body img { width: 100%; border-radius: 8px; border: 1px solid #536157; }
.dialog-body p { margin-top: 10px; font-size: .9rem; }
.dialog-body a { display: inline-block; margin-top: 13px; color: var(--accent); font-size: .85rem; }
@media (max-width: 760px) {
  .masthead { height: 67px; padding: 0 12px; gap: 9px; }
  .masthead img { width: 34px; height: 34px; }
  .brand p { font-size: .73rem; line-height: 1.2; }
  .edition { padding-left: 8px; }
  .edition strong { font-size: .79rem; }
  .edition span { font-size: .68rem; }
  .workspace { height: calc(100dvh - 67px); min-height: 230px; display: grid; grid-template: minmax(0,1fr) auto / minmax(0,1fr); }
  .sidebar { display: none; position: fixed; z-index: 800; inset: auto 0 calc(56px + env(safe-area-inset-bottom)) 0; border: 1px solid var(--line); border-radius: 16px 16px 0 0; max-height: min(700px,calc(100dvh - 123px - env(safe-area-inset-bottom))); padding: 14px; box-shadow: 0 -8px 35px #12201b55; }
  .sidebar.is-open { display: block; }
  .close-sidebar { display: grid; margin-left: auto; margin-bottom: 3px; }
  .mobile-bar { display: grid; position: relative; z-index: 801; grid-template-columns: repeat(3,1fr); height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); }
  .mobile-bar button { display: flex; justify-content: center; align-items: center; gap: 6px; background: transparent; font-size: .84rem; }
  .mobile-bar button[aria-expanded="true"] { background: #35473c; }
  .mobile-bar svg { width: 17px; height: 17px; }
  .map-top { top: 9px; right: 9px; }
  .map-tools { top: 78px; right: 9px; }
}
@media (max-width: 340px) {
  .brand p { font-size: .66rem; }
  .masthead { gap: 7px; }
  .edition { padding-left: 6px; }
  .mobile-bar button { font-size: .77rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { transition: none !important; }
}
.streets-layer { filter: saturate(.68); }

.source-photos { display: grid; gap: 7px; margin-top: 13px; }
.source-photos details { border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; }
.source-photos summary { cursor: pointer; font-size: .9rem; }
.source-photos img { display: block; margin-top: 9px; }
