:root {
  --bg: #f6f5f1; --fg: #1d2330; --muted: #5d6576; --card: #fff; --line: #d8d6cf;
  --floor: #ffffff; --g: #b9dcb4; --t: #c4d8ef; --r: #f4dd7c; --k: #c4d8ef; --h: #f3cfc4;
  --stroke: #5d6576; --route: #e2531f; --accent: #1f5fbf; --here: #1f5fbf;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171d; --fg: #e8eaee; --muted: #9aa2b1; --card: #1d2129; --line: #323846;
    --floor: #262b35; --g: #3d5a3c; --t: #34485f; --r: #6b5c22; --k: #34485f; --h: #5e3e36;
    --stroke: #8a93a3; --route: #ff7a45; --accent: #7fb0ff; --here: #7fb0ff;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; }
header a { color: var(--muted); text-decoration: none; font-size: 14px; }
.lang button { border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: 13px; padding: 4px 9px; cursor: pointer; }
.lang button:first-child { border-radius: 6px 0 0 6px; }
.lang button:last-child { border-radius: 0 6px 6px 0; }
.lang button + button { border-left: 0; }
.lang button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
main { max-width: 1100px; margin: 0 auto; padding: 0 16px 32px; }
h1 { font-size: 22px; margin: 4px 0 2px; }
h1 span { font-weight: 400; color: var(--muted); font-size: 16px; }
.lead { margin: 0 0 14px; color: var(--muted); }

.fields { display: grid; grid-template-columns: 1fr; gap: 6px; position: relative; }
.field { position: relative; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.field input { width: 100%; font: inherit; font-size: 17px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg); }
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
#swap { position: absolute; right: 8px; top: 50%; transform: translateY(-20%); z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--fg); font-size: 17px; cursor: pointer; display: none; }
@media (min-width: 720px) {
  .fields { grid-template-columns: 1fr auto 1fr; align-items: end; }
  #swap { position: static; transform: none; display: block; margin-bottom: 6px; }
}
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); max-height: 320px; overflow: auto; }
.suggest li { padding: 10px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.suggest li:hover { background: var(--bg); }
.suggest li small { margin-left: auto; color: var(--muted); font-size: 12px; }
.suggest li.empty { color: var(--muted); cursor: default; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; border: 1px solid var(--stroke); }
.dot.cat-g { background: var(--g); } .dot.cat-t, .dot.cat-k { background: var(--t); } .dot.cat-r { background: var(--r); } .dot.cat-h { background: var(--h); }

.examples { margin: 12px 0 4px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.examples button { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }

#steps { margin: 12px 0; scroll-margin-top: 8px; }
#steps:empty { display: none; }
#steps .dist { margin: 0 0 4px; font-weight: 600; }
#steps ol { margin: 0; padding-left: 22px; }
#steps li { margin: 3px 0; }

.mapwrap { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.map { display: block; width: 100%; height: auto; max-height: 78vh; }
.maptools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.maptools > :only-child { margin-left: auto; }
#zoom, .tabs button { font: inherit; font-size: 13px; padding: 5px 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }
#zoom { border-radius: 8px; margin-left: auto; }
.tabs button:first-child { border-radius: 8px 0 0 8px; }
.tabs button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.tabs button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.legtitle { font-size: 15px; margin: 10px 4px 4px; }
.legtitle:first-child { margin-top: 0; }
.esc-ring { fill: none; stroke: var(--route); stroke-width: 3; }

.floor { fill: var(--floor); stroke: var(--line); stroke-width: 1; }
.store rect { stroke: var(--stroke); stroke-width: .6; cursor: pointer; }
.store.cat-g rect { fill: var(--g); } .store.cat-t rect, .store.cat-k rect { fill: var(--t); }
.store.cat-r rect { fill: var(--r); } .store.cat-h rect { fill: var(--h); }
.store text { fill: var(--fg); font-family: system-ui, sans-serif; pointer-events: none; }
.store.is-from rect { stroke: var(--here); stroke-width: 2.2; }
.store.is-to rect { stroke: var(--route); stroke-width: 2.2; }
.store.is-to text, .store.is-from text { font-weight: 700; }
.esc rect { fill: var(--card); stroke: var(--stroke); stroke-width: 1; }
.esc path { fill: none; stroke: var(--fg); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.route-bg { fill: none; stroke: var(--card); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.route { fill: none; stroke: var(--route); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 10 6; animation: walk 1s linear infinite; }
@keyframes walk { to { stroke-dashoffset: -16; } }
@media (prefers-reduced-motion: reduce) { .route { animation: none; } }
.arrowhead { fill: var(--route); }
.here { fill: var(--here); stroke: #fff; stroke-width: 2; }
.here-halo { fill: var(--here); opacity: .25; }
.pin { fill: var(--route); stroke: #fff; stroke-width: 1.5; }

.disclaimer { margin-top: 14px; font-size: 12px; color: var(--muted); }
