/* =============================================
   CALZADA PLANNER — UI MATCHED TO DESIGN SCREENSHOTS
   ============================================= */

:root {
    --primary: #1a8fff;
    --primary-dark: #0f6fd1;
    --accent: #ff6b35;
    --surface: #ffffff;
    --bg-muted: #f1f5f9;
    --border: rgba(0, 0, 0, 0.08);
    --text: #0f172a;
    --text-muted: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --mode-jeep: #1a8fff;
    --mode-mjeep: #1a8fff;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --sheet-spring: cubic-bezier(0.32, 0.72, 0, 1);
    --sheet-dur: 0.42s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.planner-body {
    overflow: hidden;
    height: calc(var(--vh, 1vh) * 100);
    font-family: 'Inter', sans-serif;
    background: #e8edf3;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* =============================================
   MAP & FLOATING UI
   ============================================= */
.planner-map {
    position: fixed;
    inset: 0;
    z-index: 1;
}

.leaflet-control-attribution {
    font-size: 9px !important;
}

.route-bubble {
    position: absolute;
    background: #0f172a;
    color: white;
    padding: 8px 14px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 550;
    transform: translate(-50%, -100%);
    margin-top: -10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.route-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
}

.custom-mid-bubble {
    width: auto !important;
    height: auto !important;
    background: transparent;
    border: none;
}

.recenter-btn {
    position: fixed;
    right: 16px;
    bottom: 200px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(26, 143, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

@media (min-width: 768px) {
    .recenter-btn {
        bottom: 30px;
        right: 30px;
        left: auto;
    }
}

.recenter-btn:active {
    transform: scale(0.9);
}
.map-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 600;
    display: flex;
    justify-content: flex-end;
    padding: 16px;
    pointer-events: none;
}

.map-top-right {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.pill-btn {
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.2s;
}

.pill-btn:active {
    transform: scale(0.95);
}

.lang-toggle-btn {
    padding: 0 16px;
    color: var(--primary);
}

.lang-sep {
    margin: 0 6px;
    color: #cbd5e1;
}

.lang-other {
    color: var(--text-muted);
    font-weight: 500;
}

.map-top-pill {
    padding: 0 16px;
    gap: 6px;
    color: var(--text);
}

.map-top-pill ion-icon {
    font-size: 1.1rem;
    color: var(--primary);
}

.map-top-icon-btn {
    width: 40px;
    padding: 0;
    font-size: 1.4rem;
}

/* =============================================
   GLASSMORPHISM BASE
   ============================================= */
.glass-panel {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(28px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(28px) saturate(200%) brightness(1.05);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
}

.realtime-pointer-wrapper {
    position: relative;
    width: 44px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.pointer-img {
    width: 44px;
    height: 54px;
    object-fit: contain;
}

.gps-pulse-ring {
    animation: gps-pulse 2s ease-out infinite;
    transform-origin: 22px 44px;
}
@keyframes gps-pulse {
    0%   { r: 6;  opacity: 0.5; }
    70%  { r: 14; opacity: 0; }
    100% { r: 6;  opacity: 0; }
}

/* =============================================
   PLANNER GUI CONTAINER
   ============================================= */
.planner-gui-container {
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: none;
}

/* Guarantee all interactive elements inside the GUI container are clickable */
.bottom-sheet,
.bottom-sheet *,
.active-guide-card,
.active-guide-card *,
.bottom-status-pill,
.bottom-status-pill * {
    pointer-events: auto;
}

/* =============================================
   BOTTOM SHEET — DIRECTIONS CARD
   ============================================= */
.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    transition: transform var(--sheet-dur) var(--sheet-spring);
    max-height: calc(var(--vh, 1vh) * 92);
}

@media (max-width: 767px) {
    .bottom-sheet {
        background: rgba(255, 255, 255, 0.72);
        backdrop-filter: blur(28px) saturate(200%) brightness(1.05);
        -webkit-backdrop-filter: blur(28px) saturate(200%) brightness(1.05);
        border: 1px solid rgba(255, 255, 255, 0.45);
        box-shadow: 0 8px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
        border-radius: 24px;
        margin: 0 12px 12px 12px;
    }
}

/* .bottom-sheet.collapsed — JS handles transform; class used for state tracking only. */

.bottom-sheet.journey-active-hidden { display: none !important; }

.drag-handle-bar {
    width: 100%;
    padding: 12px 0 4px;
    display: flex;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
}

.drag-pill {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
}

@media (min-width: 768px) {
    .planner-gui-container {
        pointer-events: none;
    }

    .bottom-sheet {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
        width: 340px;
        background: rgba(255,255,255,0.72) !important;
        backdrop-filter: blur(28px) saturate(200%) brightness(1.05) !important;
        -webkit-backdrop-filter: blur(28px) saturate(200%) brightness(1.05) !important;
        box-shadow: 4px 0 32px rgba(0,0,0,0.10) !important;
        border-right: 1px solid rgba(255,255,255,0.45) !important;
        border-radius: 0;
        margin: 0;
        transform: none !important;
        max-height: none;
        z-index: 500;
        pointer-events: auto;
        display: flex !important;
        flex-direction: column;
    }

    /* Map stays full width — overlapped by sidebar visually, not in DOM */
    .planner-map {
        position: fixed;
        inset: 0;
        z-index: 1;
    }

    /* Recenter button stays on the right */
    .recenter-btn {
        right: 30px;
        bottom: 30px;
        left: auto;
    }

    .drag-handle-bar {
        display: none !important;
    }

    .bottom-sheet.collapsed {
        transform: none !important;
    }
}

/* =============================================
   DIRECTIONS CARD INTERNALS
   ============================================= */
.ds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 14px;
    flex-shrink: 0;
}

.ds-title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    flex: 1;
}

.ds-close-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s;
}

.ds-close-btn:hover {
    background: #e2e8f0;
}

.ds-peek-info {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0;
    margin-right: 16px;
    text-align: right;
}

.ds-body {
    padding: 0 16px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* =============================================
   ORIGIN / DESTINATION INPUT BLOCK
   ============================================= */
.od-input-block {
    background: #f1f5f9;
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.od-connector-img {
    height: 56px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.od-input-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.od-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
}

.od-icon {
    width: 22px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dot.blue {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2.5px solid white;
    box-shadow: 0 0 0 1.5px var(--primary);
}

.pin.red {
    color: #ef4444;
    font-size: 1.3rem;
}

.od-divider-line {
    height: 1px;
    background: #cbd5e1;
    margin: 4px 0;
}

.od-field {
    flex: 1;
    min-width: 0;
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.od-field.unfilled {
    color: #94a3b8;
    font-weight: 400;
}

.swap-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: var(--primary);
    cursor: pointer;
    margin-left: 10px;
    transition: transform 0.25s, box-shadow 0.2s;
}

.swap-btn:active {
    transform: rotate(180deg) scale(0.9);
}

/* =============================================
   SCHEDULE ROW
   ============================================= */
.schedule-row {
    display: flex;
    position: relative;
}

.schedule-pill {
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text);
    border: 1px solid transparent;
    transition: background 0.15s;
}

.schedule-pill:hover {
    background: #e2e8f0;
}

.schedule-pill ion-icon {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sakay-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: white;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
    list-style: none;
    display: none;
    z-index: 10;
    min-width: 150px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.sakay-dropdown-menu.open {
    display: block;
}

.sakay-dropdown-menu li {
    padding: 11px 16px;
    font-size: 0.87rem;
    cursor: pointer;
    color: var(--text);
}

.sakay-dropdown-menu li:hover {
    background: #f8fafc;
}

.sakay-dropdown-menu li.active {
    color: var(--primary);
    font-weight: 600;
    background: #eff6ff;
}

/* =============================================
   TRANSPORT MODE — SEGMENTED CONTROL
   ============================================= */
.mode-segment-control {
    margin: 10px 0 6px;
}
.segment-track {
    display: flex;
    background: #f1f5f9;
    border-radius: 50px;
    padding: 4px;
    gap: 2px;
}
.segment-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 6px;
    border: none;
    background: transparent;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.segment-btn.active {
    background: #0f6fbd;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15,111,189,0.30);
}
.segment-btn svg {
    flex-shrink: 0;
}
.segment-btn .segment-icon-img {
    filter: none;
    transition: filter 0.2s;
}
.segment-btn.active .segment-icon-img {
    filter: brightness(0) invert(1);
}

/* =============================================
   ROUTE SUMMARY BLOCK
   ============================================= */
.route-summary-block {
    padding: 4px 0 14px;
}

.summary-large {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.summary-sub {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-top: 4px;
}

.summary-note {
    font-size: 11px;
    font-style: italic;
    color: #94a3b8;
    margin-top: 6px;
}

/* =============================================
   START JOURNEY BUTTON
   ============================================= */
.start-journey-btn {
    margin: 16px 16px 20px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 14px;
    height: 52px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.start-journey-btn:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(26, 143, 255, 0.2);
}

.start-journey-btn:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* =============================================
   ACTIVE NAVIGATION — GUIDE CARD (Screen 3)
   ============================================= */
.active-guide-card {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    border-radius: 20px;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--sheet-dur) var(--sheet-spring);
    padding: 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(28px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(28px) saturate(200%) brightness(1.05);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
}

@media (min-width: 768px) {
    .active-guide-card {
        width: 360px;
        right: auto;
        top: 20px;
        left: 20px;
    }
}

.guide-top-section {
    background: transparent;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding-bottom: 12px;
    position: relative;
    z-index: 2;
}

.guide-header {
    padding: 16px 20px 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
}

.guide-steps-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Current step — white card */
.guide-current-step {
    display: flex;
    align-items: center;
    gap: 14px;
    background: transparent;
    margin: 0;
    padding: 8px 20px;
    border-radius: 0;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    box-shadow: none;
}

.guide-current-step ion-icon {
    font-size: 1.45rem;
    color: var(--text);
    flex-shrink: 0;
}

/* Next steps — on the glass background */
.guide-next-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    border-top: none;
}

.guide-next-step ion-icon {
    font-size: 1.2rem;
    color: var(--text);
    flex-shrink: 0;
}

.guide-expanded-steps {
    display: none;
}

.guide-expanded-steps.visible {
    display: block;
    max-height: 50vh;
    overflow-y: auto;
}

.expanded-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    border-top: none;
}

.expanded-step ion-icon {
    font-size: 1.2rem;
    color: var(--text);
    flex-shrink: 0;
}

.guide-drag-handle {
    padding: 4px 0 10px;
    touch-action: none;
    cursor: grab;
}
.guide-drag-handle:active {
    cursor: grabbing;
}

@media (min-width: 768px) {
    .guide-expanded-steps {
        display: block !important;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    .guide-drag-handle {
        display: none !important;
    }
}

/* =============================================
   BOTTOM STATUS PILL (Active Navigation)
   ============================================= */
.bottom-status-pill {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
    pointer-events: auto;
    transition: transform var(--sheet-dur) var(--sheet-spring),
                max-height 0.35s var(--sheet-spring),
                opacity 0.25s ease;
    will-change: transform;
    width: calc(100% - 40px);
    max-width: 360px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(28px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(28px) saturate(200%) brightness(1.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 12px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.9);
}

/* Bottom pill transit mode toggle - compact centered pill */
.active-mode-toggle {
    display: inline-flex;
    justify-content: center;
    align-self: center;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    margin: 4px auto 10px; /* Centered with top/bottom spacing */
    background: rgba(0,0,0,0.04);
    border-radius: 12px;
    transition: max-height 0.35s cubic-bezier(0.32,0.72,0,1), opacity 0.25s ease, padding 0.3s;
}
.bottom-status-pill.expanded .active-mode-toggle {
    display: inline-flex !important;
    max-height: 42px; /* Increased from 34px */
    opacity: 1;
    padding: 4px 6px; /* More breathing room */
}

.active-mode-toggle .segment-btn {
    display: flex;
    min-width: 75px; /* Consistent button width without stretching full container */
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    border: none;
    background: transparent;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.active-mode-toggle .segment-btn.active {
    background: #0f6fbd;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(15,111,189,0.3);
}

.active-mode-toggle .segment-btn svg,
.active-mode-toggle .segment-btn img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.pill-itinerary {
    width: 100%;
    display: none;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.38s cubic-bezier(0.32,0.72,0,1), opacity 0.25s ease;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-top: 0;
}

.bottom-status-pill.expanded .pill-itinerary {
    display: block;
    max-height: 260px;
    opacity: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pill-itinerary-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    padding: 8px 16px 4px;
}

.pill-itinerary-legs {
    padding: 4px 0 8px;
}

/* Make leg cards inside pill feel like a clean list, not heavy blocks */
.pill-itinerary .leg-card {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: transparent;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}
.pill-itinerary .leg-card:last-child {
    border-bottom: none;
}

/* Slim down the colored sidebar — thinner stripe instead of block */
.pill-itinerary .leg-sidebar {
    width: 4px;
    padding: 0;
    border-radius: 0;
    justify-content: flex-start;
    gap: 0;
}

/* Hide label and icon inside pill — sidebar becomes just a color stripe */
.pill-itinerary .leg-sidebar-icon,
.pill-itinerary .leg-sidebar-label {
    display: none;
}

/* Body gets left padding to compensate for the thin stripe */
.pill-itinerary .leg-body {
    padding: 10px 16px;
    flex: 1;
}

.pill-itinerary .leg-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.pill-itinerary .leg-detail,
.pill-itinerary .leg-meta {
    font-size: 0.72rem;
    color: #64748b;
}

.pill-itinerary .leg-route-label {
    font-size: 0.62rem;
}

.pill-itinerary .leg-sidebar.walk-sidebar  { background: #2563eb; }
.pill-itinerary .leg-sidebar.jeep-sidebar  { background: #1a8fff; }
.pill-itinerary .leg-sidebar.mjeep-sidebar { background: #7c3aed; }

.pill-itinerary .leg-fare-badge {
    font-size: 0.72rem;
    padding: 2px 7px;
}

@media (min-width: 768px) {
    .bottom-status-pill {
        left: calc(50% + 180px);
    }
}

.status-drag-handle {
    padding: 12px 0 0;
    touch-action: none;
    cursor: grab;
}
.status-drag-handle:active {
    cursor: grabbing;
}

.status-cols {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 24px 16px;
}

.bottom-status-pill .col:not(:last-child) {
    border-right: 1px solid rgba(0,0,0,0.08);
}

.bottom-status-pill .col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.bottom-status-pill .val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0;
    line-height: 1;
}

.bottom-status-pill .lbl {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.bottom-status-pill .sep {
    display: none;
}

.cancel-action-row {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 16px;
    width: 100%;
    transition: max-height 0.38s cubic-bezier(0.32,0.72,0,1), opacity 0.25s ease, padding 0.3s;
}

.bottom-status-pill.expanded .cancel-action-row {
    max-height: 100px;
    opacity: 1;
    padding: 8px 14px 14px;
}

.btn-cancel-route {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-family: 'Outfit';
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-cancel-route:active {
    opacity: 0.85;
}

/* =============================================
   CHANGE LOCATION MODAL (Screen 2)
   ============================================= */
.location-modal {
    position: fixed;
    top: 8%;
    left: 5%;
    right: 5%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px);
    transition: all 0.3s var(--ease);
    max-height: calc(var(--vh, 1vh) * 82);
}

@media (min-width: 768px) {
    .location-modal {
        width: 420px;
        left: 50%;
        right: auto;
        margin-left: -210px;
        top: 10%;
    }
}

.location-modal.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.loc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 14px;
}

.loc-header h3 {
    font-family: 'Outfit';
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.loc-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.15s;
}

.loc-close-btn:hover {
    background: #e2e8f0;
}

.loc-search {
    padding: 0 16px 12px;
}

.loc-search input {
    width: 100%;
    padding: 13px 16px;
    background: #f1f5f9;
    border: none;
    border-radius: 14px;
    font-family: 'Inter';
    font-size: 0.97rem;
    outline: none;
    color: var(--text);
}

.loc-search input::placeholder {
    color: #94a3b8;
}

.loc-search input:focus {
    background: #e8f0fe;
}

.loc-options {
    flex: 1;
    overflow-y: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.loc-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 20px;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 0;
}

/* First row: round top corners to match modal */
.loc-options .loc-row:first-child {
    border-radius: 0;
}

/* Last row: round bottom corners to match modal */
.loc-options .loc-row:last-child {
    border-bottom: none;
    border-radius: 0 0 18px 18px;
}

/* ONLY last child gets bottom radius on hover */
.loc-options .loc-row:last-child:hover,
.loc-options .loc-row:last-child:active {
    border-radius: 0 0 18px 18px;
}

/* All hover states use margin+radius trick to stay inset */
.loc-row:hover {
    background: #f1f5f9;
    border-radius: 12px;
    margin: 0 8px;
    padding: 15px 12px;
}

.loc-row:active {
    background: #e8edf3;
    border-radius: 12px;
    margin: 0 8px;
    padding: 15px 12px;
}

/* Gray background wrapper for search results */
.search-results-bubble {
    background: #f1f5f9;
    border-radius: 16px;
    margin: 0 16px;
    display: flex;
    flex-direction: column;
}

.search-results-bubble .loc-row {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 16px;
    gap: 0;
}

.search-results-bubble .loc-row:last-child {
    border-bottom: none;
}

/* Fix: search results bubble rows should NOT get the inset margin 
   since they're already inside a rounded container */
.search-results-bubble .loc-row:hover,
.search-results-bubble .loc-row:active {
    margin: 0;
    padding: 12px 16px;
    border-radius: 0;
    background: #e8edf3;
}
.search-results-bubble .loc-row:first-child:hover {
    border-radius: 16px 16px 0 0;
}
.search-results-bubble .loc-row:last-child:hover {
    border-radius: 0 0 16px 16px;
}
.search-results-bubble .loc-row:only-child:hover {
    border-radius: 16px;
}

.search-results-bubble .loc-text {
    font-weight: 500;
    font-size: 0.95rem;
}

.search-results-bubble .sub-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.loc-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.bg-blue {
    background: var(--primary);
}

.pin-blue {
    background: #eff6ff;
    color: var(--primary);
}

.loc-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.search-result .loc-text {
    display: flex;
    flex-direction: column;
}

.search-result .sub-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.loc-attribution {
    padding: 10px 20px;
    font-size: 0.68rem;
    color: #94a3b8;
    text-align: right;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    border-radius: 0 0 22px 22px;
    flex-shrink: 0;
}

/* =============================================
   SIDE DRAWER
   ============================================= */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.drawer-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    z-index: 1600;
    transform: translateX(100%);
    transition: transform var(--sheet-dur) var(--sheet-spring);
    display: flex;
    flex-direction: column;
    background: rgba(240,244,255,0.70);
    backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
    border-right: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 4px 0 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
}

@media (min-width: 768px) {
    .side-drawer {
        width: 340px;
    }
}

.side-drawer.open {
    transform: translateX(0);
}

.drawer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px 20px;
}

.drawer-logo {
    height: 30px;
    object-fit: contain;
}

.drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
}

.drawer-links {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.drawer-links a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

.drawer-links a:hover {
    background: rgba(255, 255, 255, 0.5);
}

.drawer-links a ion-icon {
    font-size: 1.4rem;
    color: var(--primary);
}

.drawer-separator {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 10px 24px;
}

.mobile-lang-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.mobile-lang-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.drawer-footer-text {
    padding: 20px 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* =============================================
   MODALS (Reminders, Auth)
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 8000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.reminders-modal,
.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
    width: 90%;
    max-width: 400px;
    z-index: 9000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
}

.reminders-modal.visible,
.auth-modal.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title-row h3 {
    font-family: 'Outfit';
    font-size: 1.1rem;
    font-weight: 800;
}

.modal-icon-blue {
    font-size: 1.4rem;
    color: var(--primary);
}

.modal-close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text);
}

.reminders-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reminder-row {
    display: flex;
    gap: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
}

.reminder-row ion-icon {
    font-size: 1.2rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.auth-body {
    padding: 20px;
}

.auth-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.google-signin-btn {
    width: 100%;
    padding: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.auth-or {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    position: relative;
}

.auth-or::before,
.auth-or::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.auth-or::before {
    left: 0;
}

.auth-or::after {
    right: 0;
}

.auth-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 20px;
}

.auth-input-group input {
    border: none;
    background: none;
    outline: none;
    font-size: 0.95rem;
    flex: 1;
}

.cta-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-family: 'Outfit';
    font-size: 1rem;
    cursor: pointer;
}

/* =============================================
   TOAST NOTIFICATION
   ============================================= */
.toast-notification {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 10000;
    padding: 12px 24px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.toast-notification.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-notification ion-icon {
    font-size: 1.2rem;
    color: var(--success);
}

/* =============================================
   CHAT WINDOW (planner page)
   ============================================= */
.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 340px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
}

.chat-window.open {
    display: flex;
}

.chat-header {
    background: var(--primary);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.close-chat-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
}

.chat-input-area textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    font-family: 'Inter';
    font-size: 0.9rem;
    resize: none;
    outline: none;
}

.chat-input-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.chat-input-toolbar button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mic-btn {
    background: #f1f5f9 !important;
    color: var(--text) !important;
}

/* =============================================
   DATETIME PICKER
   ============================================= */
.dt-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 8500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.dt-picker-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.dt-picker-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 24px 24px 0 0;
    padding: 20px;
    z-index: 9500;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
}

@media (min-width: 768px) {
    .dt-picker-modal {
        width: 400px;
        left: 50%;
        right: auto;
        margin-left: -200px;
    }
}

.dt-picker-modal.visible {
    transform: translateY(0);
}

.dt-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dt-time-display {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Outfit';
    margin-bottom: 20px;
}

.dt-sliders {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.dt-confirm-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-weight: 700;
    font-family: 'Outfit';
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

.dt-toggle {
    display: flex;
    gap: 8px;
}

.dt-toggle-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text-muted);
}

.dt-toggle-btn.active {
    background: var(--primary);
    color: white;
}

.dt-now-btn,
.dt-back-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text);
    font-size: 0.87rem;
}

.dt-ampm-row {
    display: flex;
    gap: 8px;
}

.dt-ampm-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-weight: 600;
    background: white;
    color: var(--text-muted);
}

.dt-ampm-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.dt-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dt-slider-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 32px;
}

.dt-slider {
    flex: 1;
    accent-color: var(--primary);
}

.dt-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.dt-cal-monthyear {
    font-weight: 700;
    font-size: 0.95rem;
}

.dt-cal-nav {
    display: flex;
    gap: 8px;
}

.dt-cal-nav-btn {
    background: #f1f5f9;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.dt-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
}

.dt-cal-weekdays span {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 4px 0;
}

.dt-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* =============================================
   ARRIVAL SCREEN (TRIP RECEIPT)
   ============================================= */
.arrival-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 9998; display: none;
}
.arrival-overlay.visible { display: block; }

.trip-receipt {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -60%) scale(0.88);
  z-index: 9999; opacity: 0; pointer-events: none;
  transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh; overflow-y: auto; scrollbar-width: none;
}
.trip-receipt::-webkit-scrollbar { display: none; }
.trip-receipt.visible {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.receipt-paper {
  background: #fffef5; width: 280px; padding: 24px 20px 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem; color: #1a1a1a;
  box-shadow: 0 2px 0 #e8e6d9, 0 4px 0 #fffef5, 0 6px 0 #e8e6d9, 0 20px 60px rgba(0,0,0,0.4);
}
.receipt-header { text-align: center; margin-bottom: 10px; }
.receipt-logo { font-size: 1.5rem; font-weight: 900; letter-spacing: 0.25em; color: #0f172a; }
.receipt-tagline { font-size: 0.65rem; letter-spacing: 0.2em; color: #64748b; margin-top: 2px; }
.receipt-dashes { color: #cbd5e1; font-size: 0.72rem; margin: 8px 0; overflow: hidden; white-space: nowrap; }
.receipt-destination {
  text-align: center; font-size: 1rem; font-weight: 800;
  font-family: 'Courier New', monospace; letter-spacing: 0.05em;
  text-transform: uppercase; color: #0f172a; margin: 6px 0;
}
.receipt-meta-row { display: flex; justify-content: space-between; margin: 3px 0; font-size: 0.72rem; }
.receipt-label { color: #94a3b8; text-transform: uppercase; letter-spacing: 0.08em; }
.receipt-value { font-weight: 700; color: #1e293b; text-align: right; max-width: 160px; }
.receipt-items { margin: 4px 0; }
.receipt-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 5px 0; border-bottom: 1px dashed #e2e8f0; font-size: 0.72rem; gap: 8px;
}
.receipt-item:last-child { border-bottom: none; }
.receipt-item-left { display: flex; flex-direction: column; gap: 1px; }
.receipt-item-name { font-weight: 700; color: #0f172a; font-size: 0.75rem; }
.receipt-item-sub { color: #64748b; font-size: 0.68rem; }
.receipt-item-price { font-weight: 800; color: #1a8fff; white-space: nowrap; font-size: 0.75rem; }
.receipt-total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 0.85rem; margin: 5px 0; color: #0f172a; }
.receipt-total-dist, .receipt-total-time { font-weight: 600; font-size: 0.72rem; color: #64748b; }
.receipt-footer { text-align: center; margin-top: 10px; font-size: 0.65rem; color: #94a3b8; letter-spacing: 0.1em; line-height: 2; }
.receipt-barcode { font-size: 1.2rem; letter-spacing: 0.05em; color: #cbd5e1; margin-top: 4px; }
.receipt-tear {
  height: 12px;
  background: repeating-linear-gradient(90deg, #fffef5 0px, #fffef5 8px, transparent 8px, transparent 16px);
  margin: 16px -20px -12px; border-top: 2px dashed #e2e8f0;
}
.receipt-done-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 14px; margin-top: 20px;
  background: #0f172a; color: white; border: none; border-radius: 10px;
  font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; transition: background 0.2s;
}
.receipt-done-btn:active { background: #1e293b; }

/* =============================================
   MAP PICKER UI
   ============================================= */
.map-picker-ui {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 700;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.picker-address {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.picker-confirm-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.picker-cancel-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.map-center-pin {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 599;
    font-size: 2.5rem;
    color: var(--danger);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* =============================================
   SPINNER
   ============================================= */
.route-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================
   RECENTER / COMPASS BUTTON
   ============================================= */
.recenter-btn {
    position: fixed;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: #1C6EF2;
    cursor: pointer;
    transition: all 0.3s;
    /* MOBILE defaults */
}

/* =============================================
   SAKAY-STYLE ITINERARY LEG CARDS
   ============================================= */
.itinerary-legs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.leg-card {
  display: flex;
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.15s;
}

.leg-card:active {
  background: #f1f5f9;
}

/* Left colored sidebar — matches Sakay.ph design */
.leg-sidebar {
  width: 52px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
  background: #2563eb; /* walk = blue by default */
  gap: 4px;
}

.leg-sidebar.walk-sidebar  { background: #2563eb; }
.leg-sidebar.jeep-sidebar  { background: #1a8fff; }
.leg-sidebar.mjeep-sidebar { background: #7c3aed; }

.leg-sidebar-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.20);
  display: flex;
  align-items: center;
  justify-content: center;
}

.leg-sidebar-icon ion-icon {
  font-size: 1rem;
  color: white;
}

.leg-sidebar-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.leg-body {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.leg-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
}

.leg-detail {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.leg-detail strong {
  color: #0f172a;
  font-weight: 600;
}

.leg-meta {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2px;
}

.leg-fare-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1a8fff;
  margin-left: auto;
  padding-left: 8px;
  white-space: nowrap;
}

.leg-route-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #e2e8f0;
}

.leg-route-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.76rem;
  color: #475569;
}

.leg-route-label {
  font-weight: 700;
  color: #94a3b8;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 46px;
  margin-top: 1px;
}

/* Stop dot line — mimics Sakay.ph vertical connector */
.leg-stop-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 3px;
}
.leg-stop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  background: white;
  flex-shrink: 0;
}
.leg-stop-dot.filled { background: #94a3b8; }
.leg-stop-connector {
  width: 2px;
  height: 14px;
  background: #cbd5e1;
}

/* =============================================
   NAVIGATION CURSOR ANIMATIONS
   ============================================= */
.nav-cursor-wrapper {
  transform-origin: center center;
  will-change: transform;
}

.nav-pulse-ring {
  animation: nav-pulse 2.4s ease-out infinite;
  transform-origin: 24px 24px;
}

@keyframes nav-pulse {
  0%   { r: 14; opacity: 0.4; }
  70%  { r: 22; opacity: 0; }
  100% { r: 14; opacity: 0; }
}

/* =============================================
   TERMINAL SUGGESTION PANEL (PostGIS)
   ============================================= */

.ts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.ts-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.terminal-suggest-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 901;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border-radius: 28px 28px 0 0;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 -8px 48px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.9);
    transform: translateY(110%);
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    max-height: 75vh;
    overflow: hidden;
}
.terminal-suggest-panel.visible {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .terminal-suggest-panel {
        left: 350px;
        right: auto;
        width: 380px;
        bottom: 24px;
        border-radius: 24px;
        max-height: 70vh;
        transform: translateY(120%) scale(0.95);
        transform-origin: bottom center;
    }
    .terminal-suggest-panel.visible {
        transform: translateY(0) scale(1);
    }
}

.ts-drag-bar {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
    flex-shrink: 0;
}
@media (min-width: 768px) { .ts-drag-bar { display: none; } }
.ts-drag-pill {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
}

.ts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 16px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.ts-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ts-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1C6EF2, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(28,110,242,0.35);
}
.ts-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}
.ts-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
}
.ts-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    flex-shrink: 0;
}
.ts-close-btn:hover { background: #e2e8f0; transform: scale(1.05); }

/* Terminal List */
.ts-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.ts-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Terminal Card */
.ts-terminal-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    padding: 14px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    cursor: default;
    animation: ts-card-in 0.35s ease both;
}
@keyframes ts-card-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ts-terminal-card:nth-child(1) { animation-delay: 0.05s; }
.ts-terminal-card:nth-child(2) { animation-delay: 0.12s; }
.ts-terminal-card:nth-child(3) { animation-delay: 0.19s; }
.ts-terminal-card:hover { background: #f1f5f9; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.ts-card-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 1.5px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ts-code {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1.1;
}
.ts-card-body {
    flex: 1;
    min-width: 0;
}
.ts-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.ts-types {
    font-size: 0.74rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 4px;
}
.ts-dist-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}
.ts-dist-row ion-icon {
    font-size: 0.85rem;
}

/* Board Button */
.ts-board-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 9px 13px;
    border: none;
    border-radius: 999px;
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}
.ts-board-btn:hover { opacity: 0.9; transform: scale(1.04); box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
.ts-board-btn:active { transform: scale(0.97); }
.ts-board-btn ion-icon { font-size: 0.9rem; }

/* Skip Button */
.ts-skip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 8px 16px 20px;
    padding: 13px;
    background: transparent;
    border: 1.5px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
}
.ts-skip-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #475569;
}
.ts-skip-btn ion-icon { font-size: 1rem; }

