@import url("fonts.css");
:root {
  --bg: #eef1f4; --panel: #f8f9fb; --ink: #0f1722; --ink-2: #2b3644; --ink-3: #3c4756; --rule: #c9d0d9; --rule-soft: #dde2e8;
  --accent: #0b4fb3; --focus: #0b4fb3;
  --lift: #0947a3; --unknown: #8a1a6c; --stairs: #4a5563;
  --m-land: #e6eaef; --m-bld: #d3d9e1; --m-bld-line: #b9c1cc; --m-road: #ffffff; --m-road-case: #c3cad4; --m-road-major: #9aa4b1;
  --m-foot: #7f8a98; --m-park: #d5e3d2; --m-water: #b8cfe4; --m-ink: #0f1722; --m-ink-soft: #3c4756; --m-halo: #f4f6f9;
  --m-lift: #0947a3; --m-unknown: #8a1a6c; --m-stairs: #4a5563; --m-sel: #0f1722; --m-line-alpha: 0.55;
  --topbar: 44px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c121b; --panel: #111a26; --ink: #eef2f7; --ink-2: #ccd5e0; --ink-3: #b3bfcd; --rule: #2a3646; --rule-soft: #1d2735;
  --accent: #8fbaff; --focus: #8fbaff;
  --lift: #7fb0ff; --unknown: #f29ad8; --stairs: #b3bfcd;
  --m-land: #121b27; --m-bld: #243145; --m-bld-line: #33425a; --m-road: #2c3a4d; --m-road-case: #182230; --m-road-major: #44546a;
  --m-foot: #6f7f94; --m-park: #16261f; --m-water: #142a40; --m-ink: #eef2f7; --m-ink-soft: #b9c4d2; --m-halo: #0e1520;
  --m-lift: #6ea6ff; --m-unknown: #ef8fd2; --m-stairs: #a9b5c4; --m-sel: #ffffff; --m-line-alpha: 0.5;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c121b; --panel: #111a26; --ink: #eef2f7; --ink-2: #ccd5e0; --ink-3: #b3bfcd; --rule: #2a3646; --rule-soft: #1d2735;
    --accent: #8fbaff; --focus: #8fbaff;
    --lift: #7fb0ff; --unknown: #f29ad8; --stairs: #b3bfcd;
    --m-land: #121b27; --m-bld: #243145; --m-bld-line: #33425a; --m-road: #2c3a4d; --m-road-case: #182230; --m-road-major: #44546a;
    --m-foot: #6f7f94; --m-park: #16261f; --m-water: #142a40; --m-ink: #eef2f7; --m-ink-soft: #b9c4d2; --m-halo: #0e1520;
    --m-lift: #6ea6ff; --m-unknown: #ef8fd2; --m-stairs: #a9b5c4; --m-sel: #ffffff; --m-line-alpha: 0.5;
    color-scheme: dark;
  }
}
[hidden] { display: none !important; }
svg[hidden] { display: none; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 "IBM Plex Sans", system-ui, sans-serif; overflow-anchor: none; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 50; background: var(--panel); padding: 6px 10px; }

/* topbar */
.topbar { position: sticky; top: 0; z-index: 30; height: calc(var(--topbar) + var(--browser-safe-top, env(safe-area-inset-top))); padding: var(--browser-safe-top, env(safe-area-inset-top)) 14px 0;
  display: flex; align-items: center; gap: 14px; background: var(--bg); border-bottom: 1px solid var(--rule-soft); font-size: 14px; white-space: nowrap; }
.topbar .home { color: var(--ink); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.topbar .home svg { width: 18px; height: 18px; }
.topnav { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: var(--ink-2); text-decoration: none; }
.topnav a:hover { color: var(--ink); text-decoration: underline; }
.spacer { flex: 1; }
.chip { color: var(--ink); text-decoration: none; border: 1px solid var(--rule); border-radius: 99px; padding: 3px 10px; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--rule); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 0; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; } :root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-sun { display: block; } :root:not([data-theme="light"]) .icon-moon { display: none; } }

/* the tool */
.tool { display: grid; grid-template-columns: minmax(340px, 410px) 1fr; height: calc(var(--vh-locked, 100vh) - var(--topbar)); min-height: 560px; scroll-margin-top: var(--topbar); }
.panel { overflow-y: auto; padding: 22px 24px 18px; background: var(--panel); border-right: 1px solid var(--rule-soft); }
.kicker { margin: 0 0 6px; font-size: 13px; letter-spacing: .02em; color: var(--ink-3); }
h1 { font-size: 27px; line-height: 1.18; margin: 0 0 10px; font-weight: 600; letter-spacing: -.01em; }
.deck { margin: 0 0 14px; color: var(--ink-2); font-size: 16px; }
.legend { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 5px; font-size: 14.5px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 9px; }
.legend b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.key { display: inline-block; width: 15px; height: 15px; flex: none; position: relative; }
.key-lift { background: var(--lift); border-radius: 3px; }
.key-lift::before, .key-lift::after { content: ""; position: absolute; left: 4px; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; }
.key-lift::before { top: 2px; border-bottom: 4px solid #fff; } .key-lift::after { bottom: 2px; border-top: 4px solid #fff; }
.key-unknown { border: 2.2px dashed var(--unknown); border-radius: 50%; }
.key-stairs { border: 2px solid var(--stairs); border-radius: 50%; }
.qform { position: relative; margin: 0 0 14px; }
.qform label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.qform input { width: 100%; font: inherit; font-size: 16px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); color: var(--ink); }
.sug { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.sug button { width: 100%; text-align: left; font: inherit; font-size: 15px; padding: 8px 10px; background: none; border: 0; color: var(--ink); cursor: pointer; border-radius: 6px; display: flex; justify-content: space-between; gap: 8px; min-height: 40px; align-items: center; }
.sug button:hover, .sug button:focus-visible { background: var(--rule-soft); }
.sug .none { padding: 8px 10px; color: var(--ink-3); font-size: 15px; }
.card { border-top: 1px solid var(--rule); padding-top: 14px; scroll-margin-top: calc(var(--topbar) + 8px); }
.card-hint { color: var(--ink-3); margin: 0; }
.st-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.st-head h3 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; }
.ent-t { white-space: nowrap; }
.back { border: 1px solid var(--rule); background: none; color: var(--ink); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 16px; flex: none; }
.lines { display: inline-flex; gap: 3px; }
.ln { font: 700 12px/1 "Barlow Condensed", system-ui, sans-serif; padding: 3px 5px 2px; border-radius: 3px; color: #fff; letter-spacing: .03em; }
.ln-M1 { background: #f8c301; color: #111; } .ln-M2 { background: #495676; } .ln-M3 { background: #9c1810; } .ln-M4 { background: #2c574f; } .ln-M5 { background: #f7951e; color: #111; }
.st-sum { margin: 4px 0 10px; color: var(--ink-2); font-size: 15.5px; }
.grp { margin: 0 0 10px; }
.grp-t { margin: 0 0 5px; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-e { font: 700 16px/1 "Barlow Condensed", system-ui, sans-serif; min-width: 44px; min-height: 40px; padding: 4px 10px; border-radius: 8px; border: 1.5px solid var(--rule); background: var(--bg); color: var(--ink); cursor: pointer; }
.grp-lift .chip-e { border-color: var(--lift); }
.grp-unknown .chip-e { border-style: dashed; border-color: var(--unknown); }
.chip-e:hover { background: var(--rule-soft); }
.mx { font-size: 14px; color: var(--ink-3); margin: 0 0 8px; }
.tapmap { font-size: 14px; color: var(--ink-3); margin: 4px 0 10px; }
.verdict { font-size: 17px; font-weight: 600; margin: 6px 0 6px; display: flex; gap: 9px; align-items: flex-start; line-height: 1.4; }
.verdict .key { margin-top: 4px; }
.feedname { font-size: 14px; color: var(--ink-3); margin: 0 0 8px; }
.feedname q { color: var(--ink-2); }
.cut { width: 100%; max-width: 360px; height: auto; display: block; margin: 4px 0 8px; }
.cut-sky { fill: transparent; } .cut-earth { fill: var(--rule-soft); }
.cut-ground { stroke: var(--ink-2); stroke-width: 2; } .cut-floor { stroke: var(--ink-3); stroke-width: 1.5; }
.cut-l { font: 600 11.5px "IBM Plex Sans", sans-serif; fill: var(--ink-2); }
.cut-s { font: 400 11.5px "IBM Plex Sans", sans-serif; fill: var(--ink-3); }
.cut-q { font: 700 15px "Barlow Condensed", sans-serif; fill: var(--unknown); }
.cut-gap { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 2 5; fill: none; }
.cut-shaft { fill: var(--panel); stroke: var(--lift); stroke-width: 2; }
.cut-cab { fill: var(--lift); } .cut-arr-w { fill: #fff; }
.cut-stairs { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; }
.cut-esc { stroke: var(--ink-2); stroke-width: 4; stroke-linecap: round; } .cut-esc-rail { stroke: var(--ink-3); stroke-width: 1.5; }
.cut-arr { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cut-walk { fill: none; stroke: var(--unknown); stroke-width: 2.2; stroke-dasharray: 4 3; }
.pair, .reach, .today, .osm { font-size: 15px; margin: 0 0 8px; color: var(--ink-2); }
.today { border-left: 3px solid var(--ink-3); padding-left: 9px; color: var(--ink); }
.osm { font-size: 14px; color: var(--ink-3); }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 32px; }
.st-links { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 14.5px; margin: 10px 0 0; }

.mapwrap { position: relative; overflow: hidden; background: var(--m-land); }
#map { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#map.dragging { cursor: grabbing; }
.mapctl { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.mapctl button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); font-size: 20px; cursor: pointer; }
.whole-map { position: absolute; left: 12px; top: 12px; z-index: 5; font: inherit; font-size: 14.5px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); cursor: pointer; min-height: 40px; }
.attrib { position: absolute; right: 6px; bottom: 4px; font-size: 11.5px; color: var(--ink-3); background: color-mix(in srgb, var(--m-land) 80%, transparent); padding: 1px 5px; border-radius: 4px; z-index: 4; }
.attrib a { color: var(--ink-3); }
.callout, .tip { position: absolute; left: 0; top: 0; z-index: 6; background: var(--panel); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; padding: 7px 10px; font-size: 14px; line-height: 1.35; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.tip { pointer-events: none; }
.callout-more { display: none; margin-left: 6px; }
.maphint { position: absolute; left: 12px; bottom: 10px; z-index: 4; font-size: 13px; color: var(--ink-2); background: color-mix(in srgb, var(--panel) 88%, transparent); padding: 4px 8px; border-radius: 6px; max-width: 70%; }

/* article */
.article { max-width: 1100px; margin: 0 auto; padding: 8px 20px 40px; }
.article section { padding: 40px 0 8px; border-top: 1px solid var(--rule-soft); scroll-margin-top: var(--topbar); }
.article section:first-child { border-top: 0; }
.prose { max-width: 40rem; }
h2 { font-size: 25px; line-height: 1.25; margin: 0 0 14px; font-weight: 600; letter-spacing: -.005em; }
h3.sub { font-size: 18px; margin: 22px 0 6px; font-weight: 600; }
p { margin: 0 0 14px; }
.num { font-variant-numeric: tabular-nums; }
.grid208 { display: block; width: 100%; max-width: 760px; height: auto; margin: 6px 0 10px; }
.g-lift { fill: var(--lift); } .g-unknown { fill: none; stroke: var(--unknown); stroke-width: 1.6; stroke-dasharray: 2.4 1.6; } .g-noedge { fill: none; stroke: var(--lift); stroke-width: 1.6; stroke-dasharray: 2.4 1.6; } .g-stairs { fill: var(--stairs); opacity: .55; }
.g-cap { font: 600 13px "IBM Plex Sans", sans-serif; fill: var(--ink-2); }
.figcap { font-size: 14.5px; color: var(--ink-3); max-width: 40rem; }
.doors { width: 100%; max-width: 40rem; border-collapse: collapse; font-size: 15px; margin: 6px 0 14px; }
.doors th, .doors td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.doors th { font-weight: 600; color: var(--ink-2); font-size: 14px; }
.doors td.r, .doors th.r { text-align: right; font-variant-numeric: tabular-nums; }
.stlist { width: 100%; border-collapse: collapse; font-size: 15px; }
.stlist th, .stlist td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.stlist th { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.stlist td.c { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stlist .extra, .doors .extra { display: none; }
.stlist .let-lift { color: var(--lift); font-weight: 600; } .stlist .let-unknown { color: var(--unknown); font-weight: 600; }
.more { font: inherit; font-size: 15px; margin: 12px 0 0; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); cursor: pointer; min-height: 44px; }
.sources li { margin-bottom: 6px; }
.share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 28px 0 6px; }
.share .lbl { color: var(--ink-3); font-size: 14px; margin-right: 4px; }
.share a, .share button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule-soft); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent); }
.share svg { width: 18px; height: 18px; }
@media (pointer: coarse) { .share a, .share button { width: 44px; height: 44px; } }
#share-status { font-size: 14px; color: var(--ink-3); min-height: 1.4em; }
.related { font-size: 15.5px; }
footer { border-top: 1px solid var(--rule-soft); padding: 18px 20px 40px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--ink-3); max-width: 1100px; margin: 0 auto; }
footer a { color: var(--ink-2); }

/* reading rail */
.rail { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 8; display: flex; flex-direction: column; gap: 12px; opacity: 0; transition: opacity .3s; }
.past-tool .rail { opacity: 1; }
.rail a { position: relative; display: block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink-3); }
.rail a[aria-current] { background: var(--ink); border-color: var(--ink); }
.rail a span { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 13px; background: var(--panel); border: 1px solid var(--rule); padding: 2px 7px; border-radius: 5px; color: var(--ink); opacity: 0; pointer-events: none; }
.rail a:hover span, .rail a:focus-visible span { opacity: 1; }
@media (max-width: 1259px) { .rail { display: none; } }

/* phone */
@media (max-width: 899px) {
  .tool { display: flex; flex-direction: column; height: auto; min-height: 0; background: var(--panel); }
  .panel { display: contents; }
  .panel > * { order: 1; margin-left: 16px !important; margin-right: 16px !important; }
  .panel > .kicker { margin-top: 16px !important; }
  .mapwrap { order: 2; height: calc(var(--vh-locked, 100vh) * 0.56); min-height: 320px; margin-bottom: 0; }
  .panel > .card { order: 3; border-top: 0; padding: 14px 0 16px; }
  h1 { font-size: 23px; }
  .deck { font-size: 15.5px; margin-bottom: 10px; }
  .legend { grid-template-columns: 1fr; font-size: 14px; }
  .callout-more { display: inline; }
  .article { padding: 0 16px 30px; }
  h2 { font-size: 22px; }
  .stlist .hide-s { display: none; }
  .topnav { display: none; }
}
@media print { .rail, .topbar, .mapctl, .share { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
