:root{font-family:system-ui,-apple-system,"Segoe UI","Noto Sans JP",sans-serif;color:#203a38;background:#e6ece7;line-height:1.6;font-synthesis:none;--app-height:100vh;--map-height:35vh}
@supports(height:100dvh){:root{--app-height:100dvh;--map-height:35dvh}}
*{box-sizing:border-box}body{margin:0;overflow:hidden}button,select{font:inherit;color:inherit}button{min-height:44px;padding:8px 12px;border-radius:9px;border:1px solid #b7c8be;font-weight:700;cursor:pointer;background:white}button:disabled{opacity:.5;cursor:default}button:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible,#map:focus-visible{outline:3px solid #cf8522;outline-offset:2px}a{color:#17645b;overflow-wrap:anywhere}[hidden]{display:none!important}.primary{background:#17645b;color:#fff;border-color:#17645b}.primary:hover{background:#104b44}.secondary:hover{background:#edf4f0}
.phone-shell{width:100%;max-width:430px;height:var(--app-height);margin:0 auto;display:grid;grid-template-rows:auto minmax(0,1fr);background:#f5f6f2;overflow:hidden;box-shadow:0 0 32px #203a3815}.app-header{display:flex;align-items:center;gap:8px;min-height:52px;padding:calc(6px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left));background:#fff;border-bottom:1px solid #e0e7e1}.brand{font-size:18px;font-weight:800;line-height:1.25;white-space:nowrap}.brand span{display:block;font-size:10px;letter-spacing:.05em;font-weight:400}.badge{font-size:10px;color:#78551c;background:#fbf1d8;border-radius:20px;padding:4px 6px;margin-left:auto;white-space:nowrap}.help-button{font-size:12px;padding:8px}.map-app{min-height:0;display:grid;grid-template-rows:auto var(--map-height) auto minmax(0,1fr) auto auto}.map-toolbar{display:flex;gap:8px;padding:7px 12px 9px;background:#fff;min-width:0}.map-toolbar label{display:flex;flex-direction:column;gap:2px;font-size:10px;font-weight:700;min-width:0;flex:1}.map-toolbar select{width:100%;min-width:0;height:44px;border:1px solid #b7c8be;border-radius:8px;padding:5px 3px;background:#fff;font-size:12px}.map-stage{position:relative;height:var(--map-height);min-height:0;isolation:isolate;border-block:1px solid #dbe3dd}#map{height:100%;width:100%;background:#e4ebe4}.map-expand{position:absolute;right:10px;top:10px;z-index:460;min-width:92px;font-size:12px;background:#fffffff5;box-shadow:0 2px 8px #203a3820}.map-legend{position:absolute;left:8px;bottom:25px;z-index:450;display:flex;gap:9px;background:#fffffff0;border-radius:5px;padding:4px 7px;font-size:10px;pointer-events:none}.legend-location{color:#196ed1}.legend-shelter{color:#17645b}.legend-condition{color:#895613}#map-status{position:absolute;left:56px;right:10px;top:62px;z-index:450;background:#fffffff0;border-radius:4px;padding:3px 6px;margin:0;font-size:10px;line-height:1.4;pointer-events:none}.leaflet-container{font-family:inherit}.leaflet-control-zoom a{min-width:44px;min-height:44px;line-height:44px!important}.leaflet-control-attribution{font-size:10px!important;max-width:85%}.leaflet-control-scale{display:none}.position-dot{background:transparent;border:0}.position-dot span{display:block;width:22px;height:22px;background:#196ed1;border:4px solid white;border-radius:50%;box-shadow:0 0 0 5px #ffffff55,0 1px 8px #183b6070}.shelter-icon{display:grid;place-items:center;background:transparent;border:0}.shelter-icon>span{display:grid;place-items:center;width:32px;height:36px;background:#17645b;border:2px solid white;border-radius:12px 12px 12px 2px;color:#fff;font-size:16px;font-weight:800;box-shadow:0 1px 6px #203a3866}.shelter-icon.conditional>span{background:#895613}
.scope-bar{display:flex;align-items:center;gap:8px;justify-content:space-between;padding:6px 12px;background:#eef3ed;border-bottom:1px solid #dbe3dd;min-width:0}.scope-bar>div:first-child{flex:1;min-width:0}.scope-bar strong{font-size:11px}#shelter-summary{font-size:10px;line-height:1.4;margin:0;max-height:4.2em;overflow:auto}.scope-actions{display:flex;gap:4px;flex-shrink:0}.scope-actions button{font-size:10px;padding:6px}.scope-actions #radius-reset{width:44px;font-size:10px;white-space:normal}.selection-area{min-height:0;overflow:hidden;background:#fff;display:flex;flex-direction:column}#selection-empty{font-size:12px;color:#63716c;text-align:center;margin:auto;padding:12px}.detail-panel{background:white;color:#203a38;min-height:0;overflow:hidden}.selection-area>.detail-panel{flex:1;display:flex;flex-direction:column}.panel-header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0;padding:8px 12px;border-bottom:1px solid #e2e8e2}.panel-header h2{font-size:16px;line-height:1.4;margin:0;overflow-wrap:anywhere;min-width:0}.close-button{font-size:12px;min-width:72px;white-space:nowrap;padding:6px 8px}.panel-content{min-height:0;overflow:auto;overscroll-behavior:contain;padding:4px 14px 16px;font-size:13px;scrollbar-width:thin}.place-details p{margin:8px 0}.detail-distance{font-weight:700;color:#17645b}.place-details dl,dl{margin:10px 0}dl div{display:flex;justify-content:space-between;gap:8px;padding:5px 0;border-bottom:1px solid #edf0ed}dt,dd{font-size:12px;margin:0}dd{text-align:right}.condition-note{padding:8px;background:#fff1d4;color:#73470d;border-radius:6px}.small,.source-link{font-size:11px;color:#63716c}.source-link a{display:inline-block;padding:4px 0}.location-dock{padding:7px 12px 3px;background:white;border-top:1px solid #e2e8e2}.location-buttons{display:flex;gap:8px}.location-buttons button{flex:1;font-size:12px;padding:8px 5px;min-height:46px}.location-buttons .primary{flex:1.2}#status{font-size:10px;line-height:1.5;margin:4px 0 0;max-height:3em;overflow:auto;text-align:center}#status[data-error="true"]{color:#9b431e}.safety-line{font-size:10px;line-height:1.4;margin:0;padding:3px 12px calc(6px + env(safe-area-inset-bottom));background:white;text-align:center}.nearby-list{margin:12px 0}.nearby-list summary{padding:10px 0;min-height:44px;cursor:pointer;color:#17645b}.nearby-list ol{list-style:none;margin:0;padding:0}.place-button{width:100%;font-size:12px;text-align:left;margin:4px 0;background:#edf4f0}.help-panel{position:fixed;inset:0;width:min(430px,100%);max-width:100%;max-height:85vh;max-height:85dvh;margin:auto;padding:0;border:0;border-radius:14px}.help-panel[open]{display:flex;flex-direction:column}.help-panel::backdrop{background:#102a2966}.help-panel .panel-content{padding-bottom:calc(18px + env(safe-area-inset-bottom))}.help-panel h3{font-size:14px}.help-panel li{margin:6px 0}.help-panel .secondary{width:100%}
/* Expand the same map to the device viewport; controls stay above the map. */
.map-fullscreen .phone-shell{position:fixed;inset:0;max-width:none;z-index:1000;box-shadow:none}.map-fullscreen .app-header,.map-fullscreen .map-toolbar,.map-fullscreen .scope-bar,.map-fullscreen .location-dock,.map-fullscreen .safety-line{position:relative;z-index:500}.map-fullscreen .map-app{display:flex;flex-direction:column}.map-fullscreen .map-toolbar,.map-fullscreen .scope-bar,.map-fullscreen .location-dock,.map-fullscreen .safety-line{flex-shrink:0}.map-fullscreen .map-stage{position:fixed;inset:0;height:var(--app-height);width:100%;z-index:0;border:0}.map-fullscreen .selection-area{position:relative;z-index:500;flex:1;align-items:center;justify-content:flex-end;background:transparent;pointer-events:none;padding:0 10px 8px}.map-fullscreen #selection-empty{display:none}.map-fullscreen .selection-area>.detail-panel{flex:0 1 auto;width:min(430px,100%);max-height:30vh;max-height:30dvh;border-radius:12px;box-shadow:0 -2px 18px #203a3826;pointer-events:auto}.map-fullscreen .panel-header{padding:5px 10px}.map-fullscreen .map-stage .leaflet-top{top:var(--overlay-top,190px)}.map-fullscreen .map-expand{top:calc(var(--overlay-top,190px) + 10px)}.map-fullscreen #map-status{top:calc(var(--overlay-top,190px) + 62px)}.map-fullscreen .map-legend{bottom:var(--map-clearance,120px)}.map-fullscreen .leaflet-control-attribution{position:fixed;right:8px;bottom:calc(var(--map-clearance,120px) - 20px)}.map-fullscreen .app-header,.map-fullscreen .map-toolbar,.map-fullscreen .scope-bar{background:#fffffff2}
@media(max-width:350px){.app-header{gap:6px;padding-left:10px;padding-right:10px}.brand{font-size:16px}.badge{font-size:9px;padding:3px 5px}.map-toolbar{padding-inline:10px;gap:6px}.map-toolbar select{font-size:11px}.scope-bar{padding-inline:10px}.scope-actions{gap:3px}.scope-actions button{padding:4px;font-size:9px}.panel-header h2{font-size:14px}.location-dock{padding-inline:10px}}
@media(max-height:650px){.app-header{min-height:46px;padding-top:calc(3px + env(safe-area-inset-top));padding-bottom:3px}.map-toolbar{padding-block:4px}.map-toolbar label{font-size:9px;gap:0}.scope-bar{padding-block:3px}.panel-header{padding-block:3px}.location-dock{padding-top:4px}.safety-line{padding-bottom:calc(3px + env(safe-area-inset-bottom))}.map-legend{padding:2px 5px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Keep the phone frame on desktop in both map modes. On phones the frame
   still fills the viewport; only the map height expands in map mode. */
.phone-shell{width:min(100%,430px);min-width:0;grid-template-columns:minmax(0,1fr)}
.phone-shell>*{min-width:0}
.map-app{min-width:0;grid-template-columns:minmax(0,1fr)}
.map-app>*,.selection-area,.detail-panel,.panel-content{min-width:0;max-width:100%}
.app-header .brand{min-width:0;flex-shrink:1}
.app-header .badge{flex-shrink:0}
.map-fullscreen .phone-shell{width:min(100%,430px);max-width:430px;margin-inline:auto}
.map-fullscreen .map-stage{width:min(100%,430px);max-width:430px;margin-inline:auto}
@media(max-width:350px){.app-header .badge{font-size:8px;padding-inline:3px}.brand{font-size:15px}.help-button{padding-inline:6px}}

/* Desktop uses an iPhone-sized preview, including height, in both map modes.
   The transform contains fixed Leaflet controls inside the phone frame. */
body{display:grid;place-items:center;min-height:100vh;min-height:100dvh}
.phone-shell{position:relative;transform:translateZ(0)}
.map-fullscreen .phone-shell{position:relative;inset:auto}
.map-fullscreen .map-stage{width:100%;max-width:none;margin:0}
.map-fullscreen .selection-area>.detail-panel{max-height:calc(var(--app-height) * .3)}
@media(min-width:431px){
  .phone-shell,.map-fullscreen .phone-shell{width:390px;max-width:390px;border-radius:20px;box-shadow:0 0 0 1px #b7c8be,0 12px 40px #203a3826}
  .help-panel{width:390px;max-height:calc(var(--app-height) * .85)}
}

/* Reference pedestrian routing; no modal blocks map controls. */
.route-controls{flex-shrink:0;padding:6px 12px;border-bottom:1px solid #dbe3dd;background:#f7f3fb;max-height:44%;overflow:auto;overscroll-behavior:contain}.route-actions{display:flex;gap:6px}.route-actions button{font-size:12px;flex:1;min-height:44px;padding:6px}.route-actions .primary{background:#7138ad;border-color:#7138ad}#route-status{font-size:11px;line-height:1.5;margin:5px 0;overflow-wrap:anywhere}.route-caution{font-size:11px}.route-caution summary{cursor:pointer;padding:6px 0;min-height:32px;color:#583279}.route-caution p{margin:6px 0}.route-privacy{font-size:9px;margin:3px 0;color:#596c67}.destination-icon>span{display:grid;place-items:center;background:#a44e19;color:white;border:2px solid white;border-radius:8px;width:54px;height:32px;font-size:11px;font-weight:700;box-shadow:0 1px 5px #203a3855}#route-map-note{position:absolute;z-index:451;left:8px;right:8px;bottom:46px;padding:5px 7px;margin:0;border-radius:6px;background:#f7f1fff5;color:#502881;font-size:10px;line-height:1.4;pointer-events:none}.map-fullscreen #route-map-note{bottom:calc(var(--map-clearance,120px) + 24px)}.map-fullscreen .selection-area>.detail-panel{max-height:calc(var(--app-height) * .34)}.map-fullscreen .route-controls{max-height:130px}.map-fullscreen .route-caution{display:none}.map-fullscreen .route-privacy{font-size:9px}.map-fullscreen #route-status{max-height:3em;overflow:auto}.map-fullscreen .route-controls{padding-block:4px}

.route-warning{font-size:10px;line-height:1.4;margin:4px 0;color:#714522}.map-fullscreen .route-controls{max-height:155px}

/* Short phone screens scroll the whole selected-facility region so the route
   button remains reachable even when only a small details area is available. */
.selection-area>#place-panel{display:block;overflow:auto;overscroll-behavior:contain}
.selection-area>#place-panel .panel-content{overflow:visible}
.selection-area>#place-panel .route-controls{max-height:none;overflow:visible}
.map-fullscreen .selection-area>#place-panel{display:flex;overflow:hidden}
.map-fullscreen .selection-area>#place-panel .panel-content{overflow:auto}
.map-fullscreen .selection-area>#place-panel .route-controls{flex:0 1 auto;min-height:0;max-height:155px;overflow:auto}

/* Three states: search (35% map), compact selection, unobstructed route. */
.route-header,.route-footer{display:none}.place-overview .overview-distance{font-weight:700;color:#17645b;font-size:14px;margin:8px 0}.overview-disasters{font-size:12px;margin:6px 0}.facility-more>summary{cursor:pointer;min-height:44px;padding:10px 0;color:#17645b;font-size:12px}.route-controls .route-warning{display:none}.route-caution>summary{min-height:44px;padding:10px 0}.place-selected .panel-header h2{font-size:15px}.place-selected .route-controls{background:#f6f2fa}.place-overview .condition-note{font-size:11px}
.route-mode .phone-shell{grid-template-rows:minmax(0,1fr)}
.route-mode .app-header,.route-mode .map-app>.map-toolbar,.route-mode .map-app>.scope-bar,.route-mode .map-app>.selection-area,.route-mode .map-app>.location-dock,.route-mode .map-app>.safety-line{display:none}
.route-mode.map-fullscreen .map-app{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:calc(32px + env(safe-area-inset-top)) minmax(0,1fr) calc(84px + env(safe-area-inset-bottom));height:100%;min-height:0}
.route-mode .route-header{grid-row:1;display:flex;align-items:center;gap:8px;padding:calc(4px + env(safe-area-inset-top)) 12px 4px;min-width:0;background:#fff;border-bottom:1px solid #dbe3dd}.route-header>span{font-size:10px;color:#7138ad;white-space:nowrap}.route-header h1{font-size:13px;line-height:20px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.route-mode .map-stage{grid-row:2;position:relative;inset:auto;height:100%;width:100%;max-width:none;margin:0;border:0}
.route-mode .route-footer{grid-row:3;display:flex;flex-direction:column;justify-content:center;gap:2px;background:#fff;min-width:0;padding:3px max(10px,env(safe-area-inset-right)) calc(3px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));border-top:1px solid #dbe3dd;overflow:hidden}
#route-metrics{font-size:12px;line-height:16px;font-weight:700;color:#583279;text-align:center;margin:0;white-space:nowrap}.route-mode-actions{display:flex;gap:6px}.route-mode-actions button{flex:1;min-width:0;min-height:44px;height:44px;padding:4px;font-size:12px}.route-mode-actions .route-exit{border-color:#7138ad;color:#7138ad;background:#f7f2fc}.route-brief-warning{display:flex;justify-content:space-between;gap:6px;margin:0;font-size:9px;line-height:12px;white-space:nowrap}.route-brief-warning a{color:#63716c}
.route-mode .map-expand,.route-mode .map-legend,.route-mode #route-map-note,.route-mode #map-status{display:none}.route-mode #map-status[data-error="true"]{display:block;top:10px;left:62px;right:8px}.route-mode .map-stage .leaflet-top{top:0}.route-mode .leaflet-control-attribution{position:static;right:auto;bottom:auto}.route-mode .destination-icon>span{background:#a44e19}.route-mode .position-dot span{box-shadow:0 0 0 6px #ffffff99,0 1px 8px #183b6070}
@media(max-width:350px){#route-metrics{font-size:11px}.route-brief-warning{font-size:8px}.route-header h1{font-size:12px}.route-mode-actions{gap:4px}}

#selection-summary{padding:0 12px}#selection-summary .overview-distance{margin:6px 0 3px}#selection-summary .overview-disasters{margin:3px 0 6px}#selection-summary .condition-note{margin:4px 0}

/* Primary action is outside the scrolling details: immediately available
   after a pin selection, even when the available details height is small. */
.selection-action{display:none;flex-shrink:0;background:#f6f2fa;border-bottom:1px solid #ded2e9;padding:6px 12px 4px}
.place-selected .selection-action{display:block}
.selection-action .route-actions button{min-height:48px;font-size:14px}
.selection-action>p{margin:3px 0 0;font-size:9px;line-height:12px;color:#63716c}
.route-mode .selection-action{display:none}
