html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; overflow: hidden; }
.guest-navbar { flex: 0 0 auto; z-index: 1001; }
@media (max-width: 991px) {
  .guest-navbar .navbar-collapse { max-height: 70dvh; overflow-y: auto; }
}
.guest-workspace { flex: 1 1 auto; min-height: 0; position: relative; isolation: isolate; }
#guest-map { position: absolute; inset: 0; background: var(--bs-tertiary-bg, #e9ecef); }
#guest-sidebar { z-index: 1100; }
.guest-sidebar .leaflet-sidebar-content { color: var(--bs-body-color); }
.guest-sidebar .leaflet-sidebar-tabs a { color: var(--bs-body-color); }
.guest-sidebar .leaflet-sidebar-tabs li.active > a { color: white; }
.guest-sidebar .leaflet-sidebar-header { font-size: 1.1rem; }
.guest-sidebar .leaflet-sidebar-close { background: transparent; border: 0; color: inherit; padding: 0; }
.guest-pane-body { padding-top: 1rem; padding-bottom: 1rem; }
.guest-sidebar textarea, .guest-sidebar input:not([type=hidden]), .guest-sidebar select { display: block; width: 100%; padding: .375rem .75rem; font: inherit; color: var(--bs-body-color); background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); box-sizing: border-box; }
.guest-sidebar textarea { min-height: 130px; max-height: 250px; resize: vertical; }
.guest-sidebar label { font-size: .875rem; margin-bottom: .25rem; }
.guest-sidebar select { white-space: normal; }
.guest-sidebar fieldset { min-width: 0; }
.guest-address-search input { min-width: 0; }
.guest-search-combobox { position: relative; flex: 1; min-width: 0; }
.guest-search-controls > button { align-self: stretch; white-space: nowrap; }
#guest-address-search[aria-busy=true] ~ #guest-search-status::before { content: ''; display: inline-block; width: .85rem; height: .85rem; margin-right: .4rem; vertical-align: -.1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: guest-spin .8s linear infinite; }
.guest-sidebar .guest-search-controls input { height: 100%; line-height: 1.5; }
.guest-search-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; max-height: 16rem; overflow-y: auto; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); }
.guest-search-results [role=option] { padding: .5rem .75rem; font-size: .875rem; overflow-wrap: anywhere; cursor: pointer; }
.guest-search-results [role=option] + [role=option] { border-top: 1px solid var(--bs-border-color); }
.guest-search-results [role=option]:hover, .guest-search-results [aria-selected=true] { background: var(--bs-primary); color: white; }
.guest-sidebar legend { float: none; width: auto; }
.guest-sidebar .errorlist { color: var(--bs-danger); padding-left: 1.2rem; font-size: .875rem; }
.guest-sidebar pre, .guest-itinerary li { overflow-wrap: anywhere; white-space: pre-wrap; }
.guest-itinerary li { padding: .4rem 0; border-bottom: 1px solid var(--bs-border-color); }
.guest-action-bar { padding: .75rem 0; padding-bottom: max(.75rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--bs-border-color); z-index: 1; }
.guest-action-bar .btn { white-space: normal; overflow-wrap: anywhere; }
.guest-confirm-locations { font-size: .875rem; }
.guest-confirm-locations hr { margin: .75rem 0; }
.guest-confirm-locations h2 { margin-bottom: .375rem; }
.guest-confirm-locations > p { margin-bottom: .5rem; }
.guest-confirm-locations legend { font-size: .875rem; margin-bottom: .25rem; }
.guest-confirm-locations .card-body { padding: .375rem .5rem; }
.guest-confirm-locations fieldset { overflow-x: auto; }
.guest-stop-row { display: flex; align-items: center; gap: .375rem; white-space: nowrap; }
.guest-stop-number, .guest-stop-row > .btn { flex: 0 0 auto; }
.guest-stop-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .375rem .5rem 0; white-space: normal; }
.guest-stop-actions { display: flex; flex: 0 0 auto; gap: .375rem; }
.guest-depot-label { color: var(--bs-success-text-emphasis, #146c43); font-weight: 600; }
.guest-stop-field { flex: 1 0 4.5rem; min-width: 0; }
.guest-stop-field-label { flex: 1.5 0 5rem; }
.guest-stop-row .candidate-picker:empty { display: none; }
.guest-stop-row .candidate-picker:not(:empty) { flex: 0 0 auto; max-width: 12rem; }
.guest-stop-row .errorlist { white-space: normal; margin-bottom: 0; }
.guest-confirm-locations .card-body p { margin-bottom: .375rem; }
.guest-confirm-locations label { font-size: .75rem; margin-bottom: .125rem; }
.guest-confirm-locations input:not([type=hidden]), .guest-confirm-locations select { padding: .25rem .5rem; font-size: .875rem; }
.guest-confirm-locations .btn { padding: .25rem .5rem; font-size: .875rem; }
.guest-map-status { position: absolute; z-index: 500; bottom: 2rem; right: .75rem; max-width: min(380px, calc(100% - 60px)); border-radius: .375rem; padding: .5rem .75rem; font-size: .8rem; pointer-events: none; }
.guest-loading { position: absolute; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .2); cursor: wait; }
.guest-loading[hidden] { display: none; }
.guest-loading-card { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.5rem; border-radius: .5rem; }
.guest-spinner { width: 1.75rem; height: 1.75rem; flex: 0 0 auto; border: 3px solid var(--bs-border-color, #dee2e6); border-top-color: var(--bs-primary, #0d6efd); border-radius: 50%; animation: guest-spin .8s linear infinite; }
@keyframes guest-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .guest-spinner { animation-duration: 2s; } }
.guest-request-error { position: absolute; right: 1rem; top: 1rem; z-index: 1150; max-width: min(400px, calc(100% - 2rem)); }
.guest-noscript { position: absolute; right: 1rem; bottom: 1rem; z-index: 1001; max-width: 300px; }
.guest-marker { background: #0d6efd; color: white; text-align: center; border-radius: 50%; border: 2px solid white; font-weight: bold; line-height: 28px; }
.guest-marker-depot { background: #198754; border-radius: 6px; }
.guest-itinerary .guest-itinerary-depot { list-style: none; }
.guest-sidebar [role=tab]:focus-visible, .guest-sidebar button:focus-visible { outline: 3px solid var(--bs-warning); outline-offset: -3px; }
.guest-workspace:not(.guest-enhanced) .leaflet-sidebar-pane { display: block; }
.guest-workspace:not(.guest-enhanced) .guest-sidebar { position: absolute; top: 10px; bottom: 10px; left: 10px; width: min(440px, calc(100% - 20px)); }
.guest-workspace:not(.guest-enhanced) .leaflet-sidebar-content { overflow: auto; }
.guest-enhanced .leaflet-sidebar-pane:not(.active) { display: none; }
/* Scroll only the pane body; the header and confirmation action never clip. */
.guest-enhanced .leaflet-sidebar-content { overflow: hidden; }
.guest-enhanced .leaflet-sidebar-pane.active { display: flex; flex-direction: column; height: 100%; padding-bottom: 0; }
.guest-enhanced .leaflet-sidebar-header, .guest-enhanced .guest-action-bar { flex: 0 0 auto; }
.guest-enhanced .guest-pane-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
@media (max-width: 767px) {
  .guest-sidebar.leaflet-sidebar { top: 8px; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; width: calc(100% - 16px); }
  .guest-sidebar.collapsed { width: 40px; }
  .guest-sidebar .leaflet-sidebar-header { position: sticky; top: 0; z-index: 2; }
  .guest-map-status { bottom: 1.75rem; font-size: .75rem; }
}
