/* Focused usability changes. Source architecture and route coordinates are unchanged. */
#show-route:disabled, #selection-route:disabled { color:#707981; background:#f2f4f6; border:1px solid #d8dfe4; box-shadow:none; cursor:not-allowed; }
#show-route:disabled svg { stroke:currentColor; opacity:.75; }
.suggestions { position:relative; inset:auto; margin-top:8px; max-height:min(300px,40dvh); overflow-y:auto; overscroll-behavior:contain; scroll-padding:8px; }
.suggestions li { min-height:44px; touch-action:pan-y; }
.search-wrap input { scroll-margin-top:16px; }
.journey-panel, .search-wrap { min-width:0; }
#room-options strong { overflow-wrap:anywhere; }
.floor-view select { min-width:0; }
.floor-view button { min-height:44px; padding:8px 12px; border:1px solid #b8d7e7; border-radius:10px; background:white; color:#006b99; font:inherit; font-size:13px; cursor:pointer; }
.door-key { background:#16804a; box-shadow:0 0 0 1px #16804a; }
.destination-highlight { fill:#e0f4e8!important; }
.journey li:last-child:before { border-color:#16804a; background:#eef9f2; }
.special-room > text { font-weight:600; pointer-events:all; }
.special-room > polygon { pointer-events:fill; }
#selection-bar[hidden] { display:none; }
#selection-bar { display:none; }
#analytics-dialog { width:min(560px,calc(100vw - 24px)); max-height:calc(100dvh - 32px); margin:auto; padding:18px; border:1px solid #cbe1ee; border-radius:20px; background:#fff; color:#213448; overflow:auto; overscroll-behavior:contain; }
#analytics-dialog::backdrop { background:#10354b70; }
#analytics-dialog .install-card { margin:12px 0 0; padding:14px; box-shadow:none; }
#analytics-dialog button { min-height:44px; }
#analytics-close { background:white; border:1px solid #bad6e6; border-radius:10px; color:#006b99; padding:8px 12px; font:inherit; cursor:pointer; }
#analytics-choice { margin-top:14px; font-size:14px; }
#analytics-accept { background:#006b99; color:white; }
@media(max-width:760px) {
  .map-viewport { touch-action:pan-y; }
  #map-content, #map-content > svg { touch-action:pan-y; }
  .floor-view { gap:6px; }
  .floor-view label { flex-basis:100%; }
  .floor-view select { padding:6px 9px; }
  #selection-bar:not([hidden]) { position:fixed; display:flex; align-items:center; gap:10px; inset-inline:10px; bottom:calc(68px + env(safe-area-inset-bottom)); z-index:31; padding:10px 12px; border:1px solid #bfdbe9; border-radius:16px; background:#fff; box-shadow:0 6px 24px #16496a26; }
  #selection-label { flex:1; min-width:0; overflow-wrap:anywhere; font-size:14px; font-weight:600; line-height:1.4; max-height:4.2em; overflow:auto; }
  html[dir="rtl"] #selection-label { text-align:right; }
  #selection-route { flex:none; min-height:44px; max-width:48%; padding:9px 14px; border-radius:12px; border:1px solid #006b99; background:#006b99; color:white; font:inherit; font-size:14px; font-weight:600; }
  #selection-route:disabled { background:#f2f4f6; color:#707981; border-color:#d8dfe4; }
  body.has-map-selection { padding-bottom:calc(166px + env(safe-area-inset-bottom)); }
  html:has(.has-map-selection) { scroll-padding-bottom:calc(176px + env(safe-area-inset-bottom)); }
  .map-panel { scroll-margin-top:12px; }
}

.floor-segments { display:flex; gap:5px; width:100%; padding:4px; border:1px solid #c4ddea; border-radius:13px; background:#edf6fb; }
.floor-segments button { flex:1; min-width:0; min-height:44px; padding:10px 6px; font-size:14px; font-weight:600; }
.floor-segments button[aria-pressed="true"] { background:#006b99; border-color:#006b99; color:white; box-shadow:0 2px 5px #006b9920; }
.floor-segments button:focus-visible { outline:3px solid #6bb9df; outline-offset:3px; }
.floor-view > #floor-view-label { font-size:13px; font-weight:600; }
.route-actions { grid-template-columns:1fr; }
@keyframes replay-reveal { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
/* Entrance descriptions always occupy their own line. */
.entrance > span { display:flex; flex-direction:column; align-items:stretch; }
.entrance .entrance-description { display:block; font-size:12px; line-height:1.65; font-weight:400; color:#5c6f7d; margin:2px 0 5px; }
.entrance strong { display:block; }
.entrances { align-items:stretch; }
/* Route controls occupy their own space, outside the architectural drawing. */
.navigation-actions { display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 14px; background:#f3f9fc; border-bottom:1px solid #dceaf2; }
.navigation-actions[hidden], .navigation-actions button[hidden] { display:none; }
.navigation-actions button { min-height:44px; max-width:100%; font:inherit; line-height:1.5; border-radius:11px; cursor:pointer; padding:9px 14px; }
#stage-action { width:100%; background:#006b99; color:white; border:1px solid #006b99; font-size:14px; font-weight:600; }
#stage-action:disabled { background:#e8eef2; border-color:#d3dfe6; color:#63747f; cursor:default; }
.stage-replay { display:flex; align-items:center; justify-content:center; gap:7px; background:white; border:1px solid #b5d5e5; color:#006b99; font-size:13px!important; animation:replay-reveal .22s ease-out both; }
.stage-replay svg { flex:none; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; }
.navigation-actions button:focus-visible { outline:3px solid #6bb9df; outline-offset:2px; }
@media(max-width:760px) {
  .has-route .map-viewport { height:clamp(260px,calc(100svh - 390px),520px); }
  .has-route .step-banner { padding:8px 12px; }
  .has-route .step-banner p { margin-top:3px; }
  .navigation-actions { padding:6px 12px; }
}
@media(prefers-reduced-motion:reduce) { .stage-replay { animation:none; } }

/* One shared floating dock for destination selection and route-stage actions. */
#selection-bar.route-bar:not([hidden]) { position:fixed; display:flex; align-items:center; padding:10px; gap:8px; z-index:31; bottom:auto; border:1px solid #bfdbe9; border-radius:16px; background:#fff; box-shadow:0 6px 24px #16496a26; }
#selection-bar [hidden] { display:none!important; }
#selection-bar .navigation-actions { display:flex; flex-direction:row; align-items:center; gap:8px; width:100%; padding:0; border:0; background:transparent; }
#selection-bar #stage-action { flex:1; width:auto; min-width:0; padding:9px 8px; }
#selection-bar .stage-replay { flex:1; min-height:44px; margin:0; background:#006b99; color:white; border-color:#006b99; }
#selection-bar .cross-floor .stage-replay { flex:0 0 44px; width:44px; height:44px; padding:0; background:white; color:#006b99; border-color:#b5d5e5; }
#selection-bar .cross-floor .stage-replay span { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

/* Paired Massar identity; the institutional logo remains unchanged. */
.massar-wordmark { display:block; width:110px; max-width:100%; height:auto; }
@media(max-width:760px) { .massar-wordmark { width:75px; } }

/* The map toolbar has its own layout space, never covering the drawing. */
.map-toolbar { display:flex; justify-content:center; padding:4px 12px; border-top:1px solid #e0eef6; background:#f6fbfe; }
.map-toolbar .map-controls { position:static; inset:auto; display:flex; flex-direction:row; gap:2px; padding:3px; margin:0; box-shadow:none; }
.map-toolbar .map-controls button { width:44px; min-height:44px; }
.map-toolbar .map-controls span { width:1px; height:auto; margin:5px 3px; }

/* Compact route actions share a reserved strip inside the visible map. */
.has-route #map-content { bottom:var(--route-safe-bottom,104px); }
#selection-bar.route-bar:not([hidden]) { padding:0; border:0; background:transparent; box-shadow:none; border-radius:14px; animation:replay-reveal .2s ease-out both; }
#selection-bar.route-bar .navigation-actions { gap:8px; }
#selection-bar.route-bar #stage-action, #selection-bar.route-bar .stage-replay { border-radius:14px; box-shadow:0 4px 14px #16496a26; }
#selection-bar.route-bar #stage-action { font-size:13px; }
#selection-bar.route-bar .stage-replay { animation:none; }
@media(prefers-reduced-motion:reduce) { #selection-bar.route-bar:not([hidden]) { animation:none; } }
