:root {
  --bg: #0b0d12; --panel: #141821; --panel-2: #1b2030; --text: #e6e8ee; --muted: #8a93a6;
  --accent: #f2b84b; --accent-2: #5ec8e5; --good: #6fcf7f; --warn: #f2994a; --bad: #eb5757; --border: #262c3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.5 "Inter", system-ui, sans-serif; }
.mono, .num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
a { color: var(--accent-2); }
nav.top { height: 48px; display: flex; align-items: center; gap: 24px; padding: 0 16px;
  border-bottom: 1px solid var(--border); background: var(--panel); }
nav.top .brand { font-weight: 700; letter-spacing: .14em; font-size: 13px; color: var(--accent); }
nav.top a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 13px 0; border-bottom: 2px solid transparent; }
nav.top a.active { color: var(--text); border-bottom-color: var(--accent); }

/* map page */
.app { display: grid; grid-template-columns: 1fr 360px; height: calc(100% - 48px); }
#map { background: var(--bg); }
aside { background: var(--panel); border-left: 1px solid var(--border); overflow-y: auto; padding: 14px 16px 40px; }
aside h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
aside h2:first-child { margin-top: 0; }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { flex: 1; background: none; border: 0; color: var(--muted); padding: 6px 4px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 12.5px; }
.seg button.on { background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
label.chk { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
label.chk.disabled { opacity: .35; pointer-events: none; }
.legend { display: flex; flex-direction: column; gap: 4px; }
.bar { height: 10px; border-radius: 3px; }
.ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.card h3 { margin: 0 0 4px; font-size: 14px; }
.card p { margin: 4px 0; color: var(--muted); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12.5px; }
.kv span:nth-child(odd) { color: var(--muted); }
table.routes { width: 100%; border-collapse: collapse; font-size: 12px; }
table.routes td, table.routes th { padding: 4px 4px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.routes th { color: var(--muted); font-weight: 500; }
table.routes td.num, table.routes th.num { text-align: right; }
table.routes tr { cursor: pointer; }
table.routes tr:hover td { background: var(--panel-2); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.hint { color: var(--muted); font-size: 12px; }
#readout { position: absolute; left: 10px; bottom: 10px; z-index: 500; background: rgba(11,13,18,.85);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 12px; pointer-events: none; }
.leaflet-container { font: inherit; background: var(--bg); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.leaflet-popup-content { margin: 10px 12px; font-size: 12.5px; }
.leaflet-popup-content h4 { margin: 0 0 4px; font-size: 14px; }
.leaflet-bar a { background: var(--panel); color: var(--text); border-color: var(--border); }
.leaflet-bar a:hover { background: var(--panel-2); }
.lbl { background: rgba(11,13,18,.75); border: 0; color: var(--text); box-shadow: none; font-size: 11.5px; padding: 1px 5px; }
.lbl::before { display: none; }

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 60vh auto; height: auto; }
  aside { border-left: 0; border-top: 1px solid var(--border); }
  nav.top { gap: 14px; overflow-x: auto; }
}

/* notes page */
.doc { max-width: 920px; margin: 0 auto; padding: 28px 16px 80px; }
.doc h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.01em; }
.doc .lede { color: var(--muted); font-size: 16px; margin: 0 0 26px; }
.doc h2 { font-size: 20px; margin: 40px 0 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.doc h3 { font-size: 15px; margin: 22px 0 6px; color: var(--accent); }
.doc p, .doc li { color: #c9cdd8; }
.doc table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0 18px; }
.doc th, .doc td { border-bottom: 1px solid var(--border); padding: 7px 8px; text-align: left; vertical-align: top; }
.doc th { color: var(--muted); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.callout { border-left: 3px solid var(--accent); background: var(--panel); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0; }

/* resources */
.sel { width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; font: inherit; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; vertical-align: 2px; border: 1px solid currentColor; }
.tag.good { color: var(--good); } .tag.warn { color: var(--warn); } .tag.muted { color: var(--muted); }
.cnt { margin-left: auto; }
.pixelated img, img.pixelated, .pixelated { image-rendering: pixelated; }
.lmk { color: #f4f1e8; font-size: 11px; white-space: nowrap; text-shadow: 0 0 3px #000, 0 0 2px #000; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer; }
.lmk.big { font-size: 13px; font-style: italic; letter-spacing: .08em; text-transform: uppercase; color: #e8dcc0; }
#info .kv span:nth-child(even) { white-space: nowrap; text-align: right; }
