html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    min-height: -webkit-fill-available;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: white;

    /* Prevent scrolling on body; overlays must scroll themselves */
    overflow: hidden;
    position: fixed;
    inset: 0;

    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
    touch-action: none;

    /* iOS Safe Area Support */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

:root {
    --bg-body: #2C2C2E;
    --bg-card: #3A3A3C;
    --bg-glass: rgba(58, 58, 60, 0.85);
    --bg-input: #48484A;

    --text-primary: #ffffff;
    --text-secondary: #8e8e93;

    --accent: #0a84ff;
    --accent-glow: rgba(10, 132, 255, 0.3);

    --island-width: 460px;
    --radius-l: 20px;
    --radius-m: 12px;
    --shadow-island: 0 12px 40px rgba(0, 0, 0, 0.6);

    /* SINGLE Z-INDEX POLICY (no random overrides) */
    --z-map: 0;
    --z-ui: 1000;
    --z-overlay: 20000;
    --z-toast: 25000;
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
}

body.light-mode {
    --bg-body: #ffffff;
    --bg-card: #f2f2f7;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --bg-input: #e5e5ea;
    --text-primary: #000000;
    --text-secondary: #3c3c43;
    --shadow-island: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* RESET */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* MAP */
#map-container,
#map {
    position: fixed;
    inset: 0;
    z-index: var(--z-map);
}

#map {
    position: absolute;
    inset: 0;
}

/* UTILS */
.hidden {
    display: none !important;
}

/* APP SHELL / ISLAND */
.app-shell {
    position: fixed;
    inset: 0;
    z-index: var(--z-ui);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    padding: 24px;
    padding-top: calc(24px + env(safe-area-inset-top));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* Island content wrapper */
.island-main-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    pointer-events: none;
}

.island-main-container>* {
    pointer-events: auto;
}

#app-island {
    max-width: calc(100vw - 32px);
}

.island-results-container {
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.island-results-container::-webkit-scrollbar {
    width: 6px;
}

.island-results-container::-webkit-scrollbar-track {
    background: transparent;
}

.island-results-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.island-results-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Desktop */
@media (min-width: 768px) {
    .app-shell {
        padding: 100px 24px 24px 24px;
    }
}

/* Mobile: island at bottom with upward growth */
@media (max-width: 767px) {
    .app-shell {
        justify-content: flex-end;
        align-items: stretch;
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .island-main-container {
        width: 100%;
        display: flex;
        flex-direction: column-reverse;
        /* Extensions grow UP from the bottom main card */
        gap: 12px;
        max-height: calc(100dvh - env(safe-area-inset-top) - 80px);
        /* Strict boundary */
    }
}

/* GLASS CARD */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-island);
    padding: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-card {
    width: 460px;
    max-width: var(--island-width);
}

@media (max-width: 767px) {
    .main-card {
        width: 100%;
        max-width: 100%;
    }
}

/* HEADER */
.brand-header h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.brand-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

/* INPUTS */
.input-stack {
    background: var(--bg-input);
    border-radius: var(--radius-m);
    overflow: hidden;
}

.input-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 50px;
}

.input-row:active {
    background: rgba(255, 255, 255, 0.1);
}

.decorator {
    width: 24px;
    color: var(--accent);
    display: flex;
    justify-content: center;
    margin-right: 12px;
}

.decorator.end {
    color: var(--text-secondary);
}

.input-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.label-micro {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
}

.value-main {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-left: 50px;
}

/* QUICK BUTTONS */
.quick-access-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
}

.quick-access-row::-webkit-scrollbar {
    display: none;
}

.quick-btn {
    background: var(--bg-input);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.quick-btn.active {
    background: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Selected schedule info default hidden */
.selected-schedule-info {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    display: none;
    margin-top: -8px;
}

/* RESULTS in island */
.island-results-container {
    display: none;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 16px;
    overflow-y: auto;
    max-height: 45vh;
    /* Tighter on mobile */
    scrollbar-width: none;
}

.island-results-container::-webkit-scrollbar {
    display: none;
}

/* SEARCH EXTENSION PANEL */
.search-extension-panel {
    width: 400px;
    min-height: 380px;
    max-height: 80vh;

    /* Hidden by default; shown via .app-shell.search-active */
    display: none;
    flex-direction: column;

    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

/* Show Search panel (desktop) */
@media (min-width: 768px) {
    .app-shell.search-active .search-extension-panel {
        display: flex;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    /* DO NOT hide the main island on desktop */
    .app-shell.search-active .main-card {
        display: flex;
    }

    /* Don’t clamp container width; let your desktop rules decide */
    .app-shell.search-active .island-main-container {
        max-width: none;
    }
}

/* When search is active, dim the main card so mobile feels like "one island" */
.app-shell.search-active .main-card {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.99);
}

/* MOBILE: Search becomes an in-island sheet (no second island on screen) */
@media (max-width: 768px) {
    .island-main-container {
        position: relative;
        width: 100%;
    }

    .search-extension-panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        min-height: 0;
        max-height: none;
    }

    /* Ensure the panel content can scroll (body is locked) */
    .search-results-content,
    #search-results {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1;
    }
}


@media (max-width: 767px) {
    .search-extension-panel {
        width: 100%;
        min-height: 300px;
        max-height: 65vh;
        /* Don't cover entire screen, let map show a bit */
    }
}

/* RESULTS LIST STYLING (NEW & FIXED) */
.results-list {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.result-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 4px 8px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    background: transparent;
    border: 1px solid transparent;
}

.result-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.result-row:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.1);
}

.result-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.result-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.result-name {
    font-size: 15px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-details {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* Search header */
.search-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input-wrapper-v2 {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.search-input-wrapper-v2:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.search-icon-mini {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.island-search-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    outline: none;
    width: 100%;
}

.btn-close-search {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-search:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

.search-results-content {
    flex: 1;
    overflow-y: auto;
    margin: 0 -12px;
    padding: 0 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.search-results-content::-webkit-scrollbar {
    display: none;
}

/* DATETIME EXTENSION PANEL */
.datetime-extension-panel {
    width: 400px;
}

@media (max-width: 767px) {
    .datetime-extension-panel {
        width: 100%;
    }
}

/* --- PREMIUM SEARCH UI v11 (GOD TIER) --- */

/* 1. GLOWING MODE SELECTORS */
.mode-selector-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 6px;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.mode-btn {
    flex: 1;
    height: 48px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.mode-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.mode-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* Active States with SPECIFIC GLOWS */
.mode-btn.active.bus-mode {
    background: rgba(10, 132, 255, 0.15);
    color: #0a84ff;
    border-color: rgba(10, 132, 255, 0.4);
    box-shadow: 0 0 20px rgba(10, 132, 255, 0.25), inset 0 0 10px rgba(10, 132, 255, 0.1);
}

.mode-btn.active.bike-mode {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
    /* iOS Green */
    border-color: rgba(48, 209, 88, 0.4);
    box-shadow: 0 0 20px rgba(48, 209, 88, 0.25), inset 0 0 10px rgba(48, 209, 88, 0.1);
}

.mode-btn.active.walk-mode {
    background: rgba(255, 159, 10, 0.15);
    color: #ff9f0a;
    /* iOS Orange */
    border-color: rgba(255, 159, 10, 0.4);
    box-shadow: 0 0 20px rgba(255, 159, 10, 0.25), inset 0 0 10px rgba(255, 159, 10, 0.1);
}

.mode-btn.active svg {
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px currentColor);
}


/* 2. GLASS RESULT CARDS */
.result-card {
    position: relative;
    margin-bottom: 16px;
    padding: 20px;
    border-radius: 24px;
    background: rgba(35, 35, 35, 0.65);
    /* Dark Glass */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-2px) scale(1.01);
    background: rgba(45, 45, 45, 0.75);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.result-card.active {
    border-color: rgba(10, 132, 255, 0.5);
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.08), rgba(30, 30, 30, 0.7));
    box-shadow: 0 0 0 1px rgba(10, 132, 255, 0.3), 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* 3. BADGES & TYPOGRAPHY */
.route-badge {
    height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.route-badge.bus {
    background: linear-gradient(135deg, #007aff, #0055b3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.route-badge.walk {
    background: linear-gradient(135deg, #ff9f0a, #d48200);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.route-badge svg {
    width: 20px;
    height: 20px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.time-main {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.time-sub {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

/* Icon Row - Subtle but Clear */
.icon-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.icon-row svg {
    width: 15px;
    height: 15px;
    opacity: 0.9;
    fill: currentColor;
}

/* Datetime UI */

.dt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dt-title {
    font-weight: 800;
    font-size: 16px;
}

.dt-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: white;
    cursor: pointer;
}

.dt-tabs {
    display: flex;
    gap: 8px;
}

.dt-tab {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.dt-tab.active {
    background: rgba(10, 132, 255, 0.20);
    color: white;
    border: 1px solid rgba(10, 132, 255, 0.35);
}

.dt-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dt-field {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    position: relative;
    overflow: hidden;
}

.dt-field:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dt-field:active {
    transform: scale(0.98);
}

/* RIGHT CONTROLS */
.right-controls-stack {
    position: fixed;
    top: 100px;
    /* Matches island top padding */
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: var(--z-ui);
    pointer-events: auto;
}

.control-btn {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(28, 28, 30, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.control-btn:hover {
    background: rgba(44, 44, 46, 0.95);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.control-btn:active {
    transform: scale(0.95);
}

.zoom-group-vertical {
    display: flex;
    flex-direction: column;
    background: rgba(28, 28, 30, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.zoom-btn-small {
    width: 54px;
    height: 50px;
    background: transparent;
    border: none;
    color: white;
    font-size: 22px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.zoom-btn-small:hover {
    background: rgba(255, 255, 255, 0.08);
}

.divider-h {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    width: 70%;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .right-controls-stack {
        top: auto;
        bottom: 140px;
        right: 12px;
        gap: 12px;
    }

    .control-btn {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
}

/* OVERLAYS (Settings/Preferences) - ALWAYS ABOVE MAP */
.settings-page,
.full-page-overlay,
.overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    display: none;
    flex-direction: column;
    padding: 40px 24px;
    /* Fix: padding to prevent off-screen */
    background: rgba(0, 0, 0, 0.85) !important;
    /* Fixed: Not transparent */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    pointer-events: auto;
    overflow-y: auto;
    /* Allow the overlay itself to scroll if content fails */
}

@media (min-width: 768px) {

    .settings-page,
    .full-page-overlay,
    .overlay {
        padding: 60px 40px;
        align-items: center;
        /* Center overlays on desktop */
        justify-content: center;
    }
}

.settings-page.open,
.full-page-overlay.open,
.overlay.open {
    display: flex !important;
}

.settings-content {
    pointer-events: auto;
    /* Catch clicks back on the panel */
}

/* Desktop: settings panel pinned next to burger */
.settings-content {
    flex: none;
    max-height: 85vh;
    /* Fix: strict boundary on desktop */
    width: 380px;
    max-width: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    /* Fix: internal scroll */
    -webkit-overflow-scrolling: touch;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 767px) {
    .settings-page {
        justify-content: flex-end;
        padding: 0;
    }

    .settings-content {
        width: 100%;
        border-radius: 28px 28px 0 0;
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
        max-height: 92vh;
        overflow-y: auto;
    }
}

@media (min-width: 768px) {
    .settings-page .settings-content {
        position: absolute;
        top: 100px;
        right: 24px;
        /* Width handled in .settings-content */
    }
}

/* Settings rows */
.settings-section-card {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.settings-section-title {
    padding: 0 4px 8px 4px;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.settings-row {
    background: var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-row:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.15);
}

.menu-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    color: white;
    flex-shrink: 0;
}

.menu-icon-box svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5px;
}

.menu-label {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
}

.btn-close-round {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-close-round:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3a3c;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* Modal open: stop clicks on island/controls if you want */
body.modal-open #app-island,
body.modal-open .right-controls-stack {
    pointer-events: none !important;
}

/* TOAST */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(28, 28, 30, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
    z-index: var(--z-toast);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.toast-notification.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* NUCLEAR SCROLLBAR KILLER */
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

* {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* ROUTE SHEET */
.route-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 24px 24px 0 0;
    padding: 12px 24px 34px 24px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    z-index: calc(var(--z-ui) + 5);
    min-height: 250px;
    transform: translateY(110%);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.route-sheet.open {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .route-sheet {
        left: 24px;
        right: auto;
        width: 380px;
        bottom: 24px;
        border-radius: 20px;
        min-height: auto;
    }
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    align-self: center;
    margin-bottom: 4px;
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.route-big-time {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #34c759;
}

.route-meta {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-go {
    background: #34c759;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 32px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
}

.btn-go:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.bus-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 40vh;
    overflow-y: auto;
}

.bus-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
}

.bus-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.bus-badge {
    background: var(--accent);
    color: white;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 16px;
}

.bus-details {
    flex: 1;
}

.bus-times {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.bus-route-name {
    font-size: 13px;
    color: var(--text-secondary);
}

/* FIX FOR MASSIVE ICONS */
.mode-btn svg {
    width: 24px;
    height: 24px;
    min-width: 24px;
    /* Prevent shrink */
}

.route-badge svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.icon-row svg {
    width: 14px;
    height: 14px;
}