@font-face { font-family: 'Wm Sans'; font-weight: 100 900; font-display: swap; src: url(fonts/sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Wm Sans'; font-weight: 100 900; font-display: swap; src: url(fonts/sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Wm Sans'; font-weight: 100 900; font-display: swap; src: url(fonts/sans-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Wm Sans'; font-weight: 100 900; font-display: swap; src: url(fonts/sans-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Wm Serif'; font-weight: 200 900; font-display: swap; src: url(fonts/serif-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F; }
@font-face { font-family: 'Wm Serif'; font-weight: 200 900; font-display: swap; src: url(fonts/serif-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F; }
@font-face { font-family: 'Wm Mono'; font-weight: 100 800; font-display: swap; src: url(fonts/mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F; }
@font-face { font-family: 'Wm Mono'; font-weight: 100 800; font-display: swap; src: url(fonts/mono-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --sans: 'Wm Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Wm Serif', Georgia, serif;
  --mono: 'Wm Mono', ui-monospace, Consolas, monospace;
  --bg: #faf9f5; --bg2: #f5f4ed; --bg3: #e8e6dc; --pop: #ffffff;
  --fg: #141413; --fg2: #30302e; --fg3: #5e5d59; --fg4: #87867f;
  --line: #dedcd1; --line2: #c2c0b6; --focus: #154c92;
  --node: #141413; --way: #3e5f9a; --rel: #c47a55;
  --land: #f5f4ed; --land-uz: #ffffff; --water: #e8e6dc; --border: #87867f;
  --ok: #3f6b2e; --warn: #8a5a12; --bad: #9b2c2c;
  --radius: 16px; --ease: cubic-bezier(.165, .84, .44, 1); --rise: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141413; --bg2: #1f1e1d; --bg3: #262624; --pop: #1f1e1d;
  --fg: #faf9f5; --fg2: #d1cfc5; --fg3: #b0aea5; --fg4: #87867f;
  --line: #30302e; --line2: #3d3d3a; --focus: #8fb4ec;
  --node: #faf9f5; --way: #8fb4ec; --rel: #e3a17e;
  --land: #1a1918; --land-uz: #262624; --water: #141413; --border: #73726c;
  --ok: #9cc58a; --warn: #e2b866; --bad: #f09a9a;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; background: var(--bg); color: var(--fg); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code, kbd, pre { font-family: var(--mono); font-size: .88em; }
h1, h2 { font-family: var(--serif); font-weight: 420; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.08; }
h2 { font-size: clamp(22px, 2vw, 28px); line-height: 1.2; margin-top: 40px; }
h3 { font-size: 18px; font-weight: 600; margin: 0; }
p { margin: 0; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--pop); padding: 8px; }
.loading { padding: 48px 24px; color: var(--fg3); }
.muted { color: var(--fg3); } .small { font-size: 14px; } .cap { font-size: 13px; color: var(--fg3); }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .spread { justify-content: space-between; }

.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px; height: 60px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 640; text-decoration: none; white-space: nowrap; }
.tag { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--fg3); border: 1px solid var(--line2); border-radius: 99px; padding: 0 7px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav a { text-decoration: none; padding: 6px 12px; border-radius: 99px; font-size: 14.5px; color: var(--fg2); white-space: nowrap; }
.nav a:hover { background: var(--bg2); }
.nav a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.count:empty { display: none; }
.count { font-size: 11px; background: var(--bg3); color: var(--fg); border-radius: 99px; padding: 0 6px; margin-left: 3px; }
.theme { font: inherit; border: 1px solid var(--line2); background: transparent; color: var(--fg); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex: none; }
main { max-width: 1400px; margin: 0 auto; padding: 36px 32px 110px; outline: none; }
.foot { max-width: 1400px; margin: 0 auto; padding: 0 32px 90px; font-size: 13px; color: var(--fg3); }
.lede { font-size: 18px; color: var(--fg2); margin-top: 12px; max-width: 760px; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
a.card { display: block; text-decoration: none; transition: transform 400ms var(--ease), border-color 300ms; }
a.card:hover { transform: translateY(-3px); border-color: var(--line2); }
.stat b { display: block; font-family: var(--serif); font-weight: 420; font-size: clamp(28px, 2.6vw, 40px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat span { font-size: 14px; color: var(--fg3); }
.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 180px minmax(0, 1fr) 80px; gap: 12px; align-items: center; font-size: 14px; }
.bar .track { height: 12px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--fg); border-radius: 99px; transition: width 600ms var(--ease); }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg2); }
.bar a { text-decoration: none; }
.bar a:hover { text-decoration: underline; }

.btn { font: inherit; font-size: 14.5px; font-weight: 520; display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 99px;
  border: 1px solid var(--fg); background: var(--fg); color: var(--bg); cursor: pointer; text-decoration: none; transition: transform 200ms var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn.secondary { background: var(--bg3); color: var(--fg); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--fg2); border-color: var(--line2); }
.btn.sm { padding: 4px 11px; font-size: 13px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.input { font: inherit; font-size: 15px; color: var(--fg); background: var(--pop); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 12px; min-width: 0; }
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; }
textarea.input { width: 100%; resize: vertical; min-height: 120px; line-height: 1.5; }
.chip { font: inherit; font-size: 13px; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line2); background: transparent; color: var(--fg2); cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip .n { opacity: .65; margin-left: 3px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
.toolbar .input { flex: 1 1 260px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 1px; }
.dot.node { background: var(--node); } .dot.way { background: var(--way); } .dot.relation { background: var(--rel); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 1px 9px; border: 1px solid var(--line2); border-radius: 99px; white-space: nowrap; color: var(--fg2); }
.pill.cyr { border-style: dashed; }
.pill.none { color: var(--fg4); }

.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--pop); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--fg3); font-weight: 560; padding: 10px 12px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
th button { font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
th button[aria-sort]::after { content: " ↕"; opacity: .4; }
th button[aria-sort="ascending"]::after { content: " ↑"; opacity: 1; }
th button[aria-sort="descending"]::after { content: " ↓"; opacity: 1; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: var(--bg2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td a { text-decoration: none; } td a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-size: 13px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; font-size: 14px; color: var(--fg3); flex-wrap: wrap; }
.empty { padding: 48px 20px; text-align: center; color: var(--fg3); }
.empty h3 { color: var(--fg); }

/* map */
.mapwrap { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--water); }
.mapwrap canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.mapwrap canvas.drag { cursor: grabbing; }
.map-full { height: calc(100vh - 330px); min-height: 420px; }
.map-mini { height: 300px; }
.map-ui { position: absolute; top: 12px; right: 12px; display: grid; gap: 6px; }
.map-ui button { font: inherit; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line2); background: var(--pop); color: var(--fg); cursor: pointer; font-size: 17px; }
.legend { position: absolute; left: 12px; bottom: 12px; background: color-mix(in srgb, var(--pop) 92%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 12.5px; display: grid; gap: 3px; }
.tip { position: absolute; pointer-events: none; background: var(--fg); color: var(--bg); font-size: 13px; padding: 6px 10px; border-radius: 8px; max-width: 280px; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; z-index: 3; }
.maplayout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.side { display: grid; gap: 12px; align-content: start; max-height: calc(100vh - 330px); min-height: 420px; overflow: auto; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--fg3); } .kv dd { margin: 0; word-break: break-word; }
.list { display: grid; gap: 2px; }
.list a { display: flex; justify-content: space-between; gap: 10px; text-decoration: none; padding: 7px 10px; border-radius: 8px; font-size: 14px; }
.list a:hover { background: var(--bg3); }
.list a span:last-child { color: var(--fg3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* alphabet */
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.letter { position: relative; font: inherit; text-align: left; border: 1px solid var(--line); background: var(--pop); color: var(--fg); border-radius: 12px; padding: 10px 12px; cursor: pointer; transition: transform 200ms var(--ease), border-color 200ms; }
.letter:hover { transform: translateY(-2px); border-color: var(--line2); }
.letter[aria-pressed="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.letter b { font-size: 24px; font-weight: 500; display: block; line-height: 1.2; }
.letter span { font-family: var(--mono); font-size: 13px; color: var(--fg2); }
.letter.cond::after { content: "rule"; position: absolute; top: 8px; right: 8px; font-size: 10.5px; color: var(--fg3); border: 1px dashed var(--line2); border-radius: 6px; padding: 0 4px; }
.out { font-size: 20px; line-height: 1.5; min-height: 120px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); white-space: pre-wrap; word-break: break-word; }
.out mark { background: color-mix(in srgb, var(--way) 22%, transparent); color: inherit; border-radius: 3px; }
.check { font-weight: 600; } .check.ok { color: var(--ok); } .check.bad { color: var(--bad); }
.callout { border-left: 3px solid var(--line2); padding: 6px 0 6px 14px; color: var(--fg2); font-size: 14.5px; }
pre.code { background: #141413; color: #f5f4ed; padding: 16px 18px; border-radius: 12px; overflow: auto; font-size: 13px; line-height: 1.55; margin: 0; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--pop); color: var(--fg); padding: 0; width: min(500px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgb(0 0 0 / .25); }
dialog::backdrop { background: rgb(20 20 19 / .45); }
dialog[open] { animation: rise 420ms var(--rise); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.dlg { padding: 22px; display: grid; gap: 14px; }

.demo-pill { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 7px 13px; border-radius: 99px; background: var(--fg); color: var(--bg); box-shadow: 0 6px 20px rgb(0 0 0 / .18); }
.demo-pill .dot { width: 7px; height: 7px; background: #2969FF; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 60; background: var(--pop); color: var(--fg); border: 1px solid var(--line2); padding: 9px 16px; border-radius: 99px; font-size: 14px; transition: transform 380ms var(--rise), opacity 260ms; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .maplayout { grid-template-columns: minmax(0, 1fr); }
  .side { max-height: none; }
}
@media (max-width: 760px) {
  .top { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .brand { flex: 1; }
  main { padding: 24px 16px 100px; }
  .foot { padding: 0 16px 90px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .bar { grid-template-columns: 110px minmax(0, 1fr) 54px; }
  .map-full { height: 62vh; min-height: 380px; }
  .demo-pill { left: 16px; right: 16px; justify-content: center; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; } }
