/* L49: two control rows; one self-hosted, paper-coloured map. */
.top-controls{display:grid;gap:10px}.top-controls .routes{margin:0}.qf{display:flex;gap:6px;align-items:stretch;margin:0 -16px;padding:0 16px 4px;scrollbar-width:none}.qf button,.qf .scope-select{min-height:44px}.scope-select{flex:none;min-width:108px;max-width:180px;background:var(--ink);color:var(--paper);border:1.5px solid var(--ink);border-radius:0;padding:6px 24px 6px 9px;font:700 13px var(--sans)}.top-controls .line-filter{display:flex;gap:8px;align-items:center}.line-filter .sel{min-height:44px;width:100%}.filters:not([open]){display:none}.top-controls .filters{font-size:13px;padding:4px 0}.top-controls+.contents{margin-top:0}
.near-mode .top-controls{position:sticky;top:calc(env(safe-area-inset-top,0px) + 58px);z-index:6;background:var(--page);padding:0}.near-mode .page{gap:0}.near-mode #results{margin:0 -16px}.near-mode #results .near-frame{margin-top:6px}.near-frame{position:relative;isolation:isolate;height:calc(100dvh - 180px - env(safe-area-inset-top,0px));min-height:430px;max-height:900px;background:#eee6d5;overflow:hidden}.near-canvas{position:absolute;inset:0;background:#eee6d5!important;z-index:0}.near-search-row{position:absolute;top:12px;left:16px;right:16px;display:flex;gap:8px;z-index:4}.near-search-field{flex:1;min-width:0;position:relative}.near-search-field input{width:100%;height:44px;padding:8px 36px 8px 12px;background:var(--paper);border:2px solid var(--ink);border-radius:0;font:700 15px var(--sans);color:var(--ink)}.near-clear{position:absolute;right:0;top:0;width:36px;height:44px;border:0;background:transparent;color:var(--ink);font-size:22px}.near-search-row>.near-locate{width:44px;height:44px;background:var(--paper);border:2px solid var(--ink);font-size:24px;color:var(--ink);flex:none}.near-locate[aria-busy=true]{opacity:.5}.near-options{position:absolute;top:48px;left:0;right:0;max-height:260px;overflow-y:auto;background:var(--paper);border:2px solid var(--ink);box-shadow:0 4px 12px #14141422}.near-options:empty{display:none}.near-options button{display:block;min-height:44px;width:100%;text-align:left;padding:8px 12px;border:0;border-bottom:1px solid var(--rule);background:transparent;color:var(--ink);font:700 14px var(--sans)}.near-options small{font-weight:500;color:var(--muted);margin-left:8px}.near-map-message{position:absolute;top:64px;left:16px;right:16px;z-index:3;margin:0;padding:7px;background:var(--paper);font-size:12px}.near-credit{position:absolute;left:8px;bottom:4px;z-index:3;display:flex;gap:5px;background:#faf7efe8;font-size:9px;line-height:1.5;padding:0 4px;color:#514e45}.near-credit a{color:inherit;min-height:20px;display:inline-flex;align-items:center}
.near-drawer{position:absolute;z-index:5;left:0;right:0;bottom:24px;height:128px;background:var(--paper);border-top:2px solid var(--ink);box-shadow:0 -3px 10px #14141415;display:flex;flex-direction:column;transition:height .18s ease;min-height:0}.near-drawer[data-snap=half]{height:48%}.near-drawer[data-snap=full]{height:calc(100% - 84px)}.near-drag{display:flex;justify-content:center;align-items:center;min-height:28px;width:100%;border:0;background:transparent;cursor:grab;touch-action:none}.near-drag::before{content:'';width:40px;height:5px;background:#c6bba6;border-radius:4px}.near-drawer-header{display:flex;gap:6px;justify-content:space-between;align-items:center;padding:0 16px 8px;flex:none}.near-drawer-header b{font-size:12px;text-transform:uppercase;letter-spacing:.09em;max-width:70%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.near-snaps{display:flex;gap:2px}.near-snaps button{min-width:28px;min-height:28px;background:transparent;color:var(--muted);border:1px solid var(--rule);font-size:14px}.near-snaps button[aria-pressed=true]{border-color:var(--ink);color:var(--ink)}.near-drawer-content{padding:0 16px;min-height:0;overflow-y:auto;overscroll-behavior:contain}.near-drawer-content>p{font-size:13px;margin:4px 0 16px;color:var(--muted)}.near-item{display:grid;grid-template-columns:28px minmax(0,1fr) 45px;gap:8px;padding:12px 0;border-top:1px solid var(--rule);text-decoration:none;color:var(--ink);align-items:start}.near-item .near-rank{font:900 19px var(--sans)}.near-item .near-name{font:700 16px/1.2 var(--sans)}.near-item .near-name .ja{font:500 11px var(--ja);display:block;color:var(--muted)}.near-item small{display:block;color:var(--muted);font-size:12px;line-height:1.4;margin-top:4px}.near-item .near-score{font:800 20px/1 var(--sans);text-align:right;color:var(--score)}.near-item.closed{opacity:.6}.near-popcard{position:absolute;z-index:4;bottom:calc(24px + 136px);left:16px;right:16px;background:var(--paper);border:2px solid var(--ink);padding:12px;text-decoration:none;color:var(--ink);box-shadow:0 2px 10px #14141422;display:grid;grid-template-columns:1fr 55px;gap:5px;min-height:64px}.near-popcard .near-score{text-align:right;font-weight:800;font-size:23px;color:var(--score)}.near-popcard small{font-size:12px;color:var(--muted)}.near-drawer[data-snap=half]~.near-popcard,.near-drawer[data-snap=full]~.near-popcard{bottom:auto;top:76px}.near-marker{background:transparent;border:0}.near-pin{position:relative;display:flex;align-items:center;justify-content:center;line-height:1;color:#fff;background:#141414;border:2px solid #fff;box-shadow:0 1px 3px #14141466}.rank-pin{width:28px;height:28px;border-radius:50% 50% 50% 0;transform:rotate(-45deg)}.rank-pin b{transform:rotate(45deg);font:800 12px var(--sans)}.near-pin.selected{background:#c33e26}.other-pin{width:12px;height:12px;background:#faf7ef;border:2px solid #141414;border-radius:50%;margin:6px}.near-pin i{position:absolute;right:-7px;top:-6px;font:800 10px var(--sans);background:var(--sk-bg);color:#fff;min-width:12px;min-height:12px;text-align:center;border-radius:50%;transform:rotate(45deg)}.other-pin i{transform:none}.near-pin em{position:absolute;font:800 8px var(--sans);bottom:-8px;transform:rotate(45deg)}.near-station-label{color:#716f64;font:600 10px var(--sans);text-align:center;text-shadow:0 0 3px #fff;white-space:nowrap;pointer-events:none}.near-canvas .leaflet-control-zoom{margin-bottom:160px;border:1px solid #141414}.near-canvas .leaflet-control-zoom a{background:var(--paper);color:var(--ink)}.near-canvas .leaflet-control-scale{margin-bottom:160px}.near-fallback{position:absolute;inset:80px 16px 160px;z-index:2;padding:16px;background:var(--paper);font-size:14px;overflow:auto}.near-fallback[hidden]{display:none}
@media(min-width:701px){.near-mode #results{margin:0}.near-frame{border:1px solid var(--rule);height:650px}.near-drawer{left:16px;right:auto;width:350px;border:2px solid var(--ink);bottom:24px}.near-drawer[data-snap=full]{height:calc(100% - 100px)}.near-search-row{right:auto;width:420px}.near-popcard{left:auto;right:16px;width:330px}.qf{margin:0;padding:0}.top-controls .filters{padding:8px 0}.scope-select{min-width:140px}}
@media(prefers-reduced-motion:reduce){.near-drawer{transition:none}}

.near-popcard .ja{display:block;font:500 11px var(--ja);color:var(--muted)}.near-drawer[data-snap=full]~.near-popcard{display:none}

/* L60: native pickers over text-sized chips; fade follows overflow. */
.qf-wrap{position:relative;min-width:0}.qf{overflow-x:auto}.qf-select{position:relative;display:inline-flex;align-items:center;flex:none;width:max-content;min-height:44px;padding:6px 9px;border:1.5px solid var(--ink);font:700 13px var(--sans);white-space:nowrap;background:var(--paper);color:var(--ink)}.qf-select>span{display:inline-flex;align-items:center;gap:6px}.qf-select select{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.qf-select:focus-within{outline:2px solid var(--ink);outline-offset:2px}.scope-chip{background:var(--ink);color:var(--paper)}.qf-select .lb{gap:5px;margin:0;font-size:13px}.qf-select .lb em{font-style:normal}.qf-arrow{font-size:12px}.qf-fade{display:none;position:absolute;right:-16px;top:0;bottom:4px;width:24px;background:linear-gradient(to right,transparent,var(--page));pointer-events:none}.qf-wrap.has-more .qf-fade{display:block}.near-drawer{bottom:0;padding-bottom:env(safe-area-inset-bottom,0px);box-sizing:border-box}.near-drawer-content{padding-bottom:12px}.near-credit{bottom:128px;z-index:6;transition:bottom .18s ease}.near-drawer[data-snap=half]~.near-credit{bottom:48%}.near-drawer[data-snap=full]~.near-credit{bottom:calc(100% - 84px)}.near-canvas .leaflet-control-zoom,.near-canvas .leaflet-control-scale{display:none}.near-popcard{bottom:136px}.near-permission{padding:8px 0 12px;font-size:13px;line-height:1.5}.near-permission b{display:block}.near-permission details{margin:8px 0}.near-permission summary{min-height:44px;display:flex;align-items:center;text-decoration:underline;cursor:pointer}.near-permission li{margin:6px 0}.near-permission button{min-height:44px;padding:8px 12px;background:var(--paper);color:var(--ink);border:1px solid var(--ink);font:700 13px var(--sans);margin:4px 6px 0 0}.near-permission #nearStationAlternative{border:0;text-decoration:underline;padding-left:0}
@media(min-width:701px){.qf-fade{right:0}.near-credit{bottom:4px}.near-drawer[data-snap]~.near-credit{bottom:4px}.near-drawer{bottom:24px}}
@media(prefers-reduced-motion:reduce){.near-credit{transition:none}}

/* Five nearby cafés fit in the location sheet without hiding the map entirely. */
.near-drawer[data-origin=here][data-snap=half]{height:68%}.near-drawer[data-origin=here][data-snap=half]~.near-credit{bottom:68%}.near-drawer[data-origin=here][data-snap=half] .near-drawer-content>p{margin:2px 0 7px;font-size:11px;line-height:1.25}.near-drawer[data-origin=here][data-snap=half] .near-item{padding:5px 0;align-items:center}.near-drawer[data-origin=here][data-snap=half] .near-item .near-name .ja{display:none}.near-drawer[data-origin=here][data-snap=half] .near-item small{font-size:11px;line-height:1.2;margin-top:1px}.near-drawer[data-origin=here][data-snap=half] .near-drawer-header{padding-bottom:2px}
@media(min-width:701px){.near-drawer[data-origin=here][data-snap=half]{height:48%}.near-drawer[data-origin=here][data-snap=half]~.near-credit{bottom:4px}}

.near-drawer[data-origin=here]:not([data-snap=full]) .near-item:nth-of-type(n+6){display:none}
/* L67: an unobstructed half map with three nearby rows, then five and all. */
@media(max-width:700px){
.near-drawer[data-snap=half],.near-drawer[data-origin=here][data-snap=half]{height:50%}
.near-drawer[data-snap=five],.near-drawer[data-origin=here][data-snap=five]{height:80%}
.near-drawer[data-snap=half]~.near-credit,.near-drawer[data-origin=here][data-snap=half]~.near-credit{bottom:50%}
.near-drawer[data-snap=five]~.near-credit,.near-drawer[data-origin=here][data-snap=five]~.near-credit{bottom:80%}
.near-drawer[data-snap=half] .near-item:nth-of-type(n+4),.near-drawer[data-snap=five] .near-item:nth-of-type(n+6){display:none}
.near-drawer[data-snap=half] .near-drawer-content>p,.near-drawer[data-snap=five] .near-drawer-content>p{margin:2px 0 7px;font-size:11px;line-height:1.25}
.near-drawer[data-snap=half] .near-item,.near-drawer[data-snap=five] .near-item{padding:5px 0;align-items:center}
.near-drawer[data-snap=half] .near-item small,.near-drawer[data-snap=five] .near-item small{font-size:11px;line-height:1.2;margin-top:1px}
.near-drawer[data-snap=five]~.near-popcard{bottom:auto;top:76px}
}
@media(max-width:360px){
.near-drawer[data-snap=half],.near-drawer[data-origin=here][data-snap=half]{height:56%}
.near-drawer[data-snap=half]~.near-credit,.near-drawer[data-origin=here][data-snap=half]~.near-credit{bottom:56%}
.near-drawer[data-snap=five] .near-item .near-name .ja{display:none}
}

.near-station-text{display:inline-block}

/* L107: desktop/tablet controls and content-sized 3/5 stops; phones unchanged. */
@media(min-width:701px){
 .near-canvas:not([data-visit-map]) .leaflet-control-zoom{display:block;margin:12px}
 /* L109b (#251): ink squares. 36 px buttons, 44 px hit areas from an invisible extension; Leaflet's grey ring, radius and shadow are removed. */
 .near-canvas .leaflet-control-zoom.leaflet-bar{border:1.5px solid var(--ink);border-radius:0;box-shadow:none;background:var(--paper);background-clip:border-box}
 .near-canvas .leaflet-control-zoom.leaflet-bar a{position:relative;display:block;width:36px;height:36px;line-height:0;padding:0;border:0;border-radius:0;background:var(--paper);color:var(--ink);text-indent:0;font-size:0;text-align:center}
 .near-canvas .leaflet-control-zoom.leaflet-bar a+a{border-top:1.5px solid var(--ink)}
 .near-canvas .leaflet-control-zoom.leaflet-bar a::before{content:"";position:absolute;inset:-4px}
 .near-canvas .leaflet-control-zoom.leaflet-bar a:first-child::before{inset:-8px -4px 0 -4px}
 .near-canvas .leaflet-control-zoom.leaflet-bar a:last-child::before{inset:0 -4px -8px -4px}
 .near-canvas .leaflet-control-zoom a .oz{position:absolute;left:50%;top:50%;width:14px;height:14px;margin:-7px 0 0 -7px;display:block}
 .near-canvas .leaflet-control-zoom a:hover,.near-canvas .leaflet-control-zoom a:focus-visible{background:var(--tint);color:var(--ink)}
 .near-canvas .leaflet-control-zoom a:focus-visible{outline:3px solid var(--act);outline-offset:-3px}
 .near-canvas .leaflet-control-zoom a.leaflet-disabled{background:var(--paper);color:var(--faint);cursor:default}.near-canvas[data-visit-map] .leaflet-control-zoom{display:none}
 .near-drawer[data-snap=half],.near-drawer[data-origin=here][data-snap=half],.near-drawer[data-snap=five]{height:auto;max-height:calc(100% - 100px)}
 .near-drawer[data-snap=half] .near-item:nth-of-type(n+4),.near-drawer[data-snap=five] .near-item:nth-of-type(n+6){display:none}
 .near-drawer[data-snap=half] .near-drawer-content,.near-drawer[data-snap=five] .near-drawer-content{overflow:hidden}
 .near-drawer[data-snap=half] .near-drawer-content>p,.near-drawer[data-snap=five] .near-drawer-content>p{display:none}
 .near-drawer[data-snap=half] .near-item,.near-drawer[data-snap=five] .near-item{padding:6px 0;align-items:center}
 .near-drawer[data-snap=half] .near-name,.near-drawer[data-snap=five] .near-name{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .near-drawer[data-snap=half] .near-item small,.near-drawer[data-snap=five] .near-item small{font-size:11px;line-height:1.2;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .near-drawer[data-snap=half] .near-name .ja,.near-drawer[data-snap=five] .near-name .ja{display:none}
}
