/* =============================================
   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);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
}

.planner-body {
    overflow: hidden;
    height: 100vh;
    font-family: 'Inter', sans-serif;
    background: #e8edf3;
    -webkit-tap-highlight-color: transparent;
}

/* =============================================
   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: 20px;
    }
}

.recenter-btn:active {
    transform: scale(0.9);
}

@media (min-width: 768px) {
    .recenter-btn {
        left: 380px;
        right: auto;
        bottom: 30px;
    }
}

.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: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.pointer-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

/* =============================================
   PLANNER GUI CONTAINER
   ============================================= */
.planner-gui-container {
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: none;
}

/* =============================================
   BOTTOM SHEET — DIRECTIONS CARD
   ============================================= */
.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 92vh;
}

@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 {
    transform: translateY(calc(100% - 80px));
}

.drag-handle-bar {
    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;
    }

    .bottom-sheet.collapsed {
        transform: none !important;
    }

    .drag-handle-bar {
        display: none !important;
    }
    
    .planner-map {
        left: 0 !important;
        right: 0;
        width: 100%;
    }
}

/* =============================================
   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;
}

/* =============================================
   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 PILLS
   ============================================= */
.mode-pills-row {
    display: flex;
    gap: 10px;
    padding-top: 4px;
}

.mode-pill {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    min-width: 120px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.transit-icon {
    width: 28px;
    height: auto;
}

.outline-pill {
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    background: transparent;
}

.outline-pill:hover {
    background: #f8fafc;
}

.selected-pill {
    border: 2px solid #2563eb;
    color: #2563eb;
    background: transparent;
    font-weight: 700;
}

/* =============================================
   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 0.42s cubic-bezier(0.32, 0.72, 0, 1);
    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;
}

/* =============================================
   BOTTOM STATUS PILL (Active Navigation)
   ============================================= */
.bottom-status-pill {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
    transition: all 0.42s cubic-bezier(0.32, 0.72, 0, 1);
    width: calc(100% - 40px);
    max-width: 360px;
    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);
}

.active-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 16px;
    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 {
    max-height: 60px;
    opacity: 1;
    padding: 10px 16px 0;
}
.amt-btn {
    flex: 1;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.amt-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

@media (min-width: 768px) {
    .bottom-status-pill {
        left: calc(50% + 180px);
    }
}

.status-drag-handle {
    padding: 12px 0 0;
}

.status-cols {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 28px 20px;
}

.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.6rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0;
    line-height: 1;
}

.bottom-status-pill .lbl {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: lowercase;
    letter-spacing: 0;
    margin-top: 6px;
}

.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: 0 16px 16px;
}

.btn-cancel-route {
    width: 100%;
    padding: 15px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-family: 'Outfit';
    font-size: 1rem;
    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: 82vh;
}

@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;
}

.loc-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 20px;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    transition: background 0.15s;
}

.loc-row:last-child {
    border-bottom: none;
}

.loc-row:hover {
    background: #f8fafc;
}

.loc-row:active {
    background: #f1f5f9;
}

/* 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;
}

.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 0.42s cubic-bezier(0.32, 0.72, 0, 1);
    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
   ============================================= */
.arrival-screen-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0, 0, 0, 0.6);
    display: none;
}

.arrival-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 12000;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    display: none;
    flex-direction: column;
    align-items: center;
    transition: all 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);
}

.arrival-screen.visible {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
}

.arrival-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #dcfce7;
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 20px;
}

.arrival-screen h2 {
    font-family: 'Outfit';
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 24px;
}

.arrival-close-btn {
    padding: 16px 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    font-family: 'Outfit';
    font-size: 1.1rem;
    cursor: pointer;
}

/* =============================================
   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 */
}

.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
   ============================================= */
.arrival-screen-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0, 0, 0, 0.6);
    display: none;
}

.arrival-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 12000;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    display: none;
    flex-direction: column;
    align-items: center;
    transition: all 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);
}

.arrival-screen.visible {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
}

.arrival-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #dcfce7;
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 20px;
}

.arrival-screen h2 {
    font-family: 'Outfit';
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 24px;
}

.arrival-close-btn {
    padding: 16px 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    font-family: 'Outfit';
    font-size: 1.1rem;
    cursor: pointer;
}

/* =============================================
   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);
    }
}
