/* Map controls stay above real geographic imagery, without obscuring the school. */
.map-wrap{height:clamp(520px,calc(100dvh - 60px),740px);border-radius:18px;border:1px solid #cdd7d2;box-shadow:0 18px 45px #17392f18;background:#263e35}
.map-wrap:after{content:"";position:absolute;inset:0;pointer-events:none;z-index:450;border-radius:inherit;box-shadow:inset 0 0 90px #12271d22}
.map-wrap[data-map-style=photo]:after{background:linear-gradient(180deg,#112e3122,transparent 28%,transparent 62%,#102e2522)}
.map-wrap .leaflet-tile-pane{filter:none}
.map-wrap[data-map-style=photo] .leaflet-landscape-pane{filter:saturate(.9) contrast(1.08) brightness(.98)}
.map-topbar{position:absolute;inset:18px 18px auto;z-index:650;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;pointer-events:none}
.map-identity{padding:12px 15px;background:#fffffff2;border:1px solid #ffffffdd;box-shadow:0 4px 18px #153c3110;border-radius:10px;backdrop-filter:blur(16px)}
.map-identity>div{display:flex;gap:8px;align-items:center;font-size:10px;letter-spacing:.04em;font-weight:600}
.map-identity>small{display:block;font-size:9px;color:#84948e;margin:3px 0 0 13px}
.map-identity #map-count{font-weight:400;color:#788b81;font-size:9px}
.map-progress{position:absolute;left:0;right:0;top:0;height:3px;background:linear-gradient(90deg,transparent,#d7bf83,transparent);transform:translateX(-100%);z-index:700;opacity:0;pointer-events:none}
.map-loading .map-progress,.map-moving .map-progress{opacity:1;animation:map-travel 1.35s ease-in-out infinite}
@keyframes map-travel{from{transform:translateX(-100%)}to{transform:translateX(100%)}}
.map-wrap .map-fit{top:18px;right:18px;background:#fffffff5;border:1px solid #fff;border-radius:8px;padding:9px 11px;color:#34564a}
.map-wrap .leaflet-control-zoom{margin-top:68px!important;margin-right:18px!important;border:1px solid #fff!important;border-radius:8px;overflow:hidden;box-shadow:0 4px 20px #123a3318!important}
.map-wrap .leaflet-control-zoom a{width:34px!important;height:34px!important;line-height:34px!important}
.map-wrap .map-pan{top:148px;right:18px;border:1px solid #fff;border-radius:8px;box-shadow:0 4px 20px #123a3318}
.map-wrap .map-radius{top:94px;left:18px;background:#fff9e8ef;backdrop-filter:blur(12px)}
.map-compass{position:absolute;z-index:620;left:24px;top:96px;display:flex;flex-direction:column;align-items:center;gap:3px;color:#315948;pointer-events:none}
.map-compass span{font:600 9px var(--sans);letter-spacing:.12em}
.map-compass svg{width:22px;height:28px;fill:#fff;stroke:#345c4e;stroke-width:1.1;filter:drop-shadow(0 2px 3px #173f3520)}
.map-wrap:has(.map-radius:not([hidden])) .map-compass{top:140px}
.map-wrap[data-map-style=photo] .map-compass{color:#fff;text-shadow:0 1px 6px #102e27}
.map-wrap .map-legend{left:18px;bottom:64px;padding:8px 11px;backdrop-filter:blur(10px);background:#fffffff0;border-color:#fff;box-shadow:0 2px 12px #14362b0c}
.map-wrap .map-bottom-note{background:none;border:0;left:auto;right:18px;bottom:60px;padding:7px 0;color:#446c5a;font-size:9px;text-shadow:0 1px 2px #fff}
.map-wrap[data-map-style=photo] .map-bottom-note{color:#fff;text-shadow:0 1px 4px #102e27}
.map-wrap .leaflet-control-scale{margin:0 0 9px 18px}
.map-wrap .leaflet-control-scale-line{border-color:#315645;color:#284d3d;background:#ffffffe0;font-size:9px;box-shadow:0 1px 6px #14352b12}
.map-wrap .leaflet-control-attribution{max-width:72%;line-height:1.4;font-size:8px!important;border-radius:5px 0 0 0;color:#5e6c64}
.map-wrap .map-cluster{width:43px;height:43px;padding-top:10px;background:#fffffff2;border:1px solid #fff;outline:4px solid #ffffff26;box-shadow:0 5px 15px #153b3020;color:#214e3b;font-weight:600;transition:background .18s,color .18s}
.map-wrap .map-pin{padding:7px 10px;border-radius:8px;box-shadow:0 4px 16px #18352f33;border:2px solid #fffffff0;transition:box-shadow .2s,background .2s}
.map-wrap .map-pin.selected{background:#173e35;border-color:#f5deb1;box-shadow:0 4px 22px #102d3980}
.map-wrap .map-pin.selected span{display:inline;max-width:170px;overflow:hidden;text-overflow:ellipsis}
.school-card.map-selected{border-color:#9cbaaa;box-shadow:0 8px 24px #294e4010;background:#fcfdf9}
.school-name button[data-map-school]{transition:color .15s}
.card-map-button{display:flex;align-items:center;gap:4px;color:#648270;font-size:10px;padding:0}
.card-map-button svg{width:13px;height:13px}
.card-bottom{gap:8px}
.school-reticle-anchor{pointer-events:none}
.school-reticle{position:absolute;width:88px;height:88px;transform:translate(-50%,-50%);pointer-events:none}
.school-reticle i,.school-reticle b,.school-reticle span{position:absolute;border-radius:50%;inset:0}
.school-reticle i{border:1px solid #fff9;background:#ffffff16;box-shadow:0 0 0 12px #ffffff0b}
.school-reticle b{inset:11px;border:1px dashed #f5e3ac;animation:reticle-orbit 14s linear 2}
.school-reticle span{inset:31px;border:2px solid #fff;background:#c3a76d;box-shadow:0 0 0 5px #c8aa7350}
.school-reticle:before,.school-reticle:after{content:"";position:absolute;inset:10px;border:1px solid #fff6cc;border-radius:50%;box-shadow:0 0 14px #f2df9b40;opacity:0}
.map-wrap:not(.map-moving) .school-reticle:before{animation:reticle-pulse 2.4s ease-out 3}
.map-wrap:not(.map-moving) .school-reticle:after{animation:reticle-pulse 2.4s .7s ease-out 3}
@keyframes reticle-pulse{from{transform:scale(.55);opacity:.9}to{transform:scale(2.5);opacity:0}}
@keyframes reticle-orbit{to{transform:rotate(180deg)}}
.map-school-preview{position:absolute;container-type:inline-size;z-index:660;left:18px;right:18px;bottom:53px;background:#fffdf8f5;backdrop-filter:blur(22px);border:1px solid #fff;border-radius:13px;box-shadow:0 12px 35px #18352f25;padding:13px 19px 0;animation:preview-arrive .4s ease-out}
@keyframes preview-arrive{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
.map-preview-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.map-preview-kicker{font-size:8px;letter-spacing:.16em;color:#a48a55}
.map-preview-close{font-size:24px;line-height:1;padding:0 0 0 8px;color:#879489}
.map-preview-main{display:flex;align-items:center;gap:16px;justify-content:space-between;margin:4px 0 13px}
.map-preview-main>div:first-child{min-width:0}
.map-preview-area{font-size:9px;color:#87958a}
.map-preview-main h3{font:500 22px/1.6 var(--display);color:#193c32;overflow-wrap:anywhere;margin:2px 0 3px}
.map-preview-main p{font-size:11px;color:#5f7e6c}
.map-preview-score{border-left:1px solid #dde4da;padding-left:20px;text-align:right;flex-shrink:0}
.map-preview-score span{display:block;font-size:9px;color:#87958a;white-space:nowrap}
.map-preview-score strong{display:block;font-size:29px;line-height:1.4;font-weight:500;color:#234e3e;letter-spacing:-.04em}
.map-preview-bottom{border-top:1px solid #e3e8de;padding:11px 0;display:flex;align-items:center;gap:16px;justify-content:space-between}
.map-preview-bottom>span{font-size:9px;color:#8a978d;min-width:0}
.map-preview-bottom button{font-size:11px;white-space:nowrap;padding:0;display:flex;gap:18px;align-items:center;color:#244f3d}
.has-map-selection .map-legend,.has-map-selection .map-bottom-note{display:none}
.has-map-selection .map-pin:not(.selected){opacity:.78}
.has-map-selection .map-pin:not(.selected) span{display:none}
.has-station-selection .map-pin:not(.station-linked){opacity:.3}
.has-station-selection .map-cluster{opacity:.4}
.map-wrap .map-pin.station-linked{position:absolute;transform:none;opacity:1;background:#174e45;color:#fff;border-color:#f9df9b;box-shadow:0 0 0 5px #ffe5a333,0 0 26px #f8dc9c70,0 5px 15px #092e3780}
.map-pin.station-linked:after{display:none}
.linked-school-dot{position:absolute;inset:-4px auto auto -4px;width:8px;height:8px;border-radius:50%;background:#ffe3a1;border:2px solid #fff;box-shadow:0 0 0 4px #ffde8d38;pointer-events:none}
.linked-school-leader{position:absolute;left:0;top:0;height:1px;background:#ffe3a1;box-shadow:0 1px 3px #183c31;transform-origin:left center;pointer-events:none}
.has-station-selection .map-pin.station-linked span{display:inline;max-width:150px;overflow:hidden;text-overflow:ellipsis}
.map-pin .linked-walk{font:500 10px var(--sans);color:#ffdf9b;border-left:1px solid #ffffff40;padding-left:7px;margin-left:3px;white-space:nowrap}
.school-card.station-linked{border-color:#c3ae73;background:#fffdf5;box-shadow:0 0 0 2px #e3cd8f25}
.station-reticle i{border-color:#b9e8ff;background:#62b8f329}
.station-reticle b{border-color:#8ad9ff}
.station-reticle span{background:#3d9dcc;box-shadow:0 0 0 5px #69c4ef50}
.station-reticle:before,.station-reticle:after{border-color:#a6e3ff;box-shadow:0 0 16px #72caff70}
.has-station-selection .map-preview-kicker{color:#4a7796;letter-spacing:.06em;font-size:10px}
.map-station-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-top:3px}
.map-station-heading h3{font:600 25px/1.4 var(--sans);color:#204c66;margin:0}
.map-station-heading h3 span{font-size:15px;margin-left:3px;font-weight:500}
.map-station-count{color:#6c8792;font-size:11px;white-space:nowrap}
.map-station-count strong{font-size:23px;font-weight:600;color:#245979;margin-right:4px}
.map-station-lines{font-size:9px;color:#70868e;margin:3px 0 10px;line-height:1.5}
.map-station-schools{max-height:164px;overflow:auto;overscroll-behavior:contain;border-top:1px solid #dfe7e6;margin:0 -3px 7px;scrollbar-width:thin}
.map-station-school{display:flex;align-items:center;gap:12px;width:100%;padding:12px 4px;text-align:left;color:#254d43;border-bottom:1px solid #e5eae4;font-size:12px}
.map-station-school:last-child{border-bottom:0}
.map-station-school>span:first-child{min-width:0;flex:1}
.map-station-school>strong{font-size:11px;font-weight:500;white-space:nowrap;color:#6a5b36;background:#f3eddc;padding:3px 7px;border-radius:5px}
.map-station-school>span:last-child{color:#769287}
.map-station-school:hover,.map-station-school:focus-visible{background:#edf5f2;border-radius:6px}
.map-station-empty{font-size:11px;line-height:1.7;color:#74878a;padding:12px 0 18px;border-top:1px solid #dfe7e6;margin-top:10px}
.map-station-back{font-size:11px;color:#346981;padding:0;text-align:left}
@container(min-width:560px){.map-station-schools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:22px}.map-station-school:nth-last-child(2){border-bottom:0}}
.map-status{top:43%;font-size:11px}
.map-status button{display:block;margin:10px auto 0;color:#315f47;text-decoration:underline}
.detail-dialog[open]{animation:detail-reveal .32s cubic-bezier(.2,.8,.2,1)}
@keyframes detail-reveal{from{opacity:0;transform:translateY(18px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
.map-sr-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.rail-dot{position:absolute;width:9px;height:9px;transform:translate(-50%,-50%);background:#2466a1;border:2px solid #fff;border-radius:3px;box-shadow:0 0 0 2px #204c7040,0 2px 8px #153d4c80}
.rail-dot-button{position:absolute;left:-12px;top:-12px;width:24px;height:24px;padding:0;background:transparent;border:0;border-radius:50%;cursor:pointer}
.rail-dot-button .rail-dot{left:12px;top:12px}
.rail-dot-button:focus-visible{outline:2px solid #b8e5ff;outline-offset:1px}
.rail-dot.access{width:12px;height:12px;background:#55b5e5;box-shadow:0 0 0 5px #5faee537,0 2px 8px #173d4c80}
.rail-connector{position:absolute;left:0;top:0;height:1px;background:#d2ebff;box-shadow:0 1px 2px #17415a80;transform-origin:left center;pointer-events:none}
.rail-label{position:absolute;display:flex;align-items:center;gap:7px;padding:6px 9px;color:#235480;background:#fffffff5;border:1px solid #fff;border-radius:7px;box-shadow:0 3px 13px #092c4d38;white-space:nowrap;min-height:32px;text-align:left;line-height:1.3;letter-spacing:0}
.rail-label>svg{width:17px;height:17px;stroke-width:1.8;flex-shrink:0}
.rail-label>span{min-width:0}.rail-label strong{display:block;font-size:11px;font-weight:600;overflow:hidden;text-overflow:ellipsis}
.rail-label small{display:block;font-size:9px;margin-top:3px;color:#c9e9ff}
.rail-label.major-station{min-height:36px;border-color:#b9d8ed;box-shadow:0 0 0 2px #fff4,0 4px 16px #092c4d50}
.rail-label.major-station strong{font-size:13px;font-weight:700}.rail-label.major-station>svg{width:19px;height:19px}
.rail-label.school-access{min-height:53px;background:#154d7bf5;color:#fff;border:1px solid #b4e4ff;box-shadow:0 0 0 3px #b2e5ff22,0 5px 20px #06365370;padding:8px 10px}
.rail-label.school-access>svg{width:20px;height:20px;color:#a2dcff}
.rail-label.school-access.compact{min-height:32px;padding:6px 9px}.rail-label.school-access.compact>svg{width:17px;height:17px}
.rail-label:hover{background:#edf8ff;box-shadow:0 3px 17px #0c37505c}.rail-label.school-access:hover{background:#1c6499}
.rail-label:focus-visible{outline:3px solid #9ddcff;outline-offset:3px}
.rail-label.selected-station{background:#12608df5;border:2px solid #bceaff;box-shadow:0 0 0 4px #8ad5fa33,0 5px 22px #08374f80}
.rail-legend{color:#235480!important;gap:4px!important}.rail-legend svg{width:12px;height:12px}
.rail-popup .leaflet-popup-content-wrapper{border-radius:10px;background:#fffffff5;box-shadow:0 6px 25px #14394d40}
.rail-popup .leaflet-popup-content{margin:15px 18px;color:#526979;font-size:11px;line-height:1.7}
.rail-popup-title{display:flex;align-items:center;gap:8px;color:#174e79;font-size:14px}
.rail-popup-title svg{width:19px;height:19px}.rail-popup p{margin:9px 0 3px!important}.rail-popup b{display:block;color:#23709b;font-size:11px}
.origin-marker{pointer-events:none}
.origin-pin{position:absolute;display:flex;gap:10px;width:max-content;min-width:172px;max-width:260px;align-items:center;padding:11px 14px 11px 11px;transform:none;white-space:nowrap;background:linear-gradient(135deg,#213b40,#10292e);color:#fff;border:1px solid #e7c98c;border-radius:12px;box-shadow:0 0 0 3px #e6c68624,0 8px 24px #071f3666}
.origin-pin{pointer-events:auto;text-align:left;cursor:pointer}
.origin-pin:hover,.origin-pin[aria-pressed=true]{border-color:#fff0c9;box-shadow:0 0 0 4px #e6c68640,0 8px 24px #071f3666}
.origin-pin:focus-visible{outline:3px solid #ffe2a2;outline-offset:4px}
.origin-symbol{width:35px;height:35px;display:grid;place-items:center;flex-shrink:0;border-radius:9px;background:#e9cf96;color:#263b37;box-shadow:inset 0 0 0 1px #fff5}
.origin-pin .origin-symbol svg{width:22px;height:22px;stroke-width:1.8}
.origin-copy{display:flex;flex-direction:column;gap:2px;min-width:0;line-height:1.4}
.origin-copy small{font-size:9px;font-weight:400;letter-spacing:.06em;color:#dfca9f}
.origin-copy strong{font-size:16px;font-weight:600;letter-spacing:.03em;overflow:hidden;text-overflow:ellipsis}
.origin-marker-dot{position:absolute;width:14px;height:14px;transform:translate(-50%,-50%);border-radius:50%;background:#e9cf96;border:3px solid #fff;box-shadow:0 0 0 6px #e9cf9640,0 2px 12px #102e3980}
.origin-leader{position:absolute;left:0;top:0;height:2px;background:#e9cf96;transform-origin:left center;box-shadow:0 1px 4px #102e3980}
.map-preview-main h3{font-weight:500;letter-spacing:0}
.map-preview-score strong{font-weight:600;font-variant-numeric:tabular-nums}
@media(min-width:1500px){.map-wrap{height:clamp(520px,calc(100dvh - 60px),780px)}}
@media(max-width:1100px){.map-topbar{gap:8px}.map-identity{padding:10px 12px}.map-preview-main h3{font-size:20px}.card-map-button{font-size:9px}}
@media(max-width:800px){.map-wrap{height:510px}.map-preview-main h3{font-size:21px}.map-wrap .map-pan{display:none}.map-wrap .map-bottom-note{display:none}}
@media(max-width:540px){
  .map-wrap{height:clamp(490px,70dvh,560px);border-radius:13px}
  .map-topbar{inset:12px 12px auto;gap:6px}
  .map-identity{padding:8px 9px;border-radius:7px}
  .map-identity>div{font-size:9px;gap:6px}.map-identity>small{font-size:8px;margin-left:11px}
  .map-identity #map-count{font-size:8px}
  .map-wrap .map-fit{top:12px;right:12px;font-size:9px;padding:7px 9px}
  .map-wrap .leaflet-control-zoom{margin-top:54px!important;margin-right:12px!important}
  .map-wrap .leaflet-control-zoom a{width:30px!important;height:30px!important;line-height:30px!important}
  .map-wrap .map-radius{left:12px;top:80px;max-width:60%;font-size:9px}
  .map-compass{left:19px;top:86px}.map-wrap:has(.map-radius:not([hidden])) .map-compass{top:121px}
  .has-map-selection .map-compass{display:none}
  .map-wrap .map-legend{left:12px;bottom:53px;font-size:8px}
  .map-wrap .leaflet-control-scale{margin-left:12px;margin-bottom:10px}
  .map-wrap .leaflet-control-attribution{max-width:75%;font-size:7px!important}
  .map-school-preview{left:10px;right:10px;bottom:48px;padding:9px 13px 0;border-radius:10px}
  .map-preview-main{gap:10px;margin:3px 0 10px}.map-preview-main h3{font-size:19px;line-height:1.5}
  .map-preview-main p{font-size:10px}.map-preview-score{padding-left:12px}.map-preview-score strong{font-size:24px}
  .map-preview-bottom{gap:10px;padding:9px 0}.map-preview-bottom>span{font-size:8px}.map-preview-bottom button{font-size:10px;gap:7px}
  .map-preview-kicker{font-size:7px}.map-preview-area{font-size:8px}
  .map-station-heading h3{font-size:22px}.map-station-lines{font-size:8px;margin-bottom:7px}
  .map-station-schools{max-height:115px}.map-station-school{font-size:11px;padding:10px 3px;gap:7px}
  .map-station-school>strong{font-size:10px;padding:3px 5px}
  .map-station-back{font-size:10px}
  .map-wrap .map-pin.station-linked{display:grid;grid-template-columns:auto auto;gap:2px 6px;max-width:155px;padding:5px 7px}
  .has-station-selection .map-pin.station-linked span{grid-row:1;grid-column:1 / -1;max-width:135px;font-size:10px}
  .map-pin .linked-walk{font-size:9px;padding-left:5px}
  .card-map-button{font-size:10px}
  .origin-pin{min-width:156px;padding:9px;gap:8px;border-radius:10px}.origin-copy strong{font-size:14px}.origin-copy small{font-size:8px}.origin-symbol{width:30px;height:30px}
}
@media(prefers-reduced-motion:reduce){.map-wrap *,.school-reticle:before,.school-reticle:after{animation:none!important;transition:none!important}.map-progress{display:none}}
