/*
 * Mobile-Specific Styles
 * Overrides style.css for mobile interactions (bottom sheets, touch targets, etc.)
 */

/* ==========================================================================
   Z-INDEX: map < Ko-fi < UI (TTC — mirrors body.go-app stack in go-mobile.css)
   Prevents SVG/map labels from painting over the Ko-fi overlay on iOS/WebKit.
   ========================================================================== */
body.ttc-app #map-viewport {
    z-index: 1 !important;
    isolation: isolate;
}

body.ttc-app .ui-layer {
    z-index: 2000 !important;
    isolation: isolate;
}

body.ttc-app #transit-kofi-button-host {
    z-index: 1500 !important;
}

/* --- Preview Mode (Amber Theme) --- */

.status-indicator.preview {
    border-color: #d97706;
    /* Amber-600 */
    background: rgba(217, 119, 6, 0.1);
    pointer-events: auto;
}

.status-indicator.preview .status-text {
    color: #d97706;
    font-weight: 700;
}

.status-indicator.preview .live-dot,
.status-indicator.preview .status-spinner {
    display: none;
}

/* Eye Icon */
.status-eye {
    display: none;
    color: #d97706;
    margin-right: 6px;
    font-size: 14px;
}

.status-indicator.preview .status-eye {
    display: block;
    animation: blinkEye 1s infinite;
}

@keyframes blinkEye {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Preview Cancel Button */
.preview-cancel-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #d97706;
    cursor: pointer;
    font-size: 10px;
    margin-left: 4px;
    transition: all 0.2s;
    pointer-events: auto;
}

.preview-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* --- Shuttle Bus Styling --- */

/* Preview glow effect */
.alert-preview {
}

/* Main shuttle outline - blue border around the affected path */
.shuttle-outline {
    stroke: var(--shuttle-color) !important;
    stroke-width: 36px;
    /* Much wider than alert-base (22px) so blue border is prominent */
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    opacity: 1;
}

/* Shuttle outline - allow dashed animation from style.css */
.shuttle-outline.flow-forward,
.shuttle-outline.flow-reverse {
    stroke-width: 34px;
    /* stroke-dasharray is inherited from style.css (20, 45) */
}

/* Solid alerts (both ways) - pulsing blue outline SYNCED with red alert (1.5s) */
.shuttle-outline.pulse-solid {
    stroke-dasharray: none;
    animation: shuttlePulse 1.5s ease-in-out infinite;
}

@keyframes shuttlePulse {

    0%,
    100% {
        stroke-opacity: 0.7;
        stroke-width: 32px;
    }

    50% {
        stroke-opacity: 1;
        stroke-width: 38px;
    }
}

.path.alert-preview {
    /* fill: none !important; */
}

/* Preview Button in Card */
.preview-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--delay-color), #d97706);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
}

/* --- Closed State (Moon Icon) --- */

.status-indicator.closed .status-spinner,
.status-indicator.closed .live-dot {
    display: none;
}

.status-indicator.closed .status-text {
    color: #9ca3af;
}

.status-indicator.closed {
    border-color: rgba(156, 163, 175, 0.3);
}

.status-indicator.closed::before {
    content: '\f186';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: #9ca3af;
    margin-right: 4px;
}

/* --- Subway Closed Overlay --- */
.closed-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* What's New overlay tweaks (responsive) */
.whats-new-overlay {
    background: rgba(0, 0, 0, 0.88);
    z-index: 3000;
}

.whats-new-content {
    max-width: min(480px, 100%);
    width: 100%;
    padding: clamp(20px, 4vw, 32px) clamp(18px, 4vw, 28px);
}

.whats-new-media {
    margin: 10px 0 14px;
    border-radius: 10px;
    overflow: hidden;
    background: #020617;
}

.whats-new-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(260px, 45vh);
    object-fit: cover;
}

.whats-new-body {
    font-size: 13px;
    line-height: 1.5;
    color: #d1d5db;
    margin-bottom: 12px;
    text-align: left;
}

.whats-new-body ul {
    padding-left: 18px;
    margin: 0;
}

.whats-new-close-btn {
    margin-top: 4px;
}

@media (max-width: 360px) {
    .whats-new-content {
        padding: 18px 14px;
    }
    .whats-new-body {
        font-size: 12px;
    }
}

@media (min-width: 768px) {
    .whats-new-content {
        max-width: 520px;
    }
    .whats-new-media img {
        max-height: 320px;
    }
}

.closed-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.closed-content {
    text-align: center;
    padding: 32px 28px;
    background: var(--surface-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--surface-glass-border);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 340px;
    width: 100%;
    animation: floatIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.closed-icon {
    font-size: 44px;
    color: #6366f1;
    margin-bottom: 16px;
    display: block;
    animation: moonGlow 3s ease-in-out infinite;
}

@keyframes moonGlow {

    0%,
    100% {
        text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    }

    50% {
        text-shadow: 0 0 40px rgba(99, 102, 241, 0.8), 0 0 60px rgba(99, 102, 241, 0.4);
    }
}

.closed-title {
    font-size: 26px;
    font-weight: 800;
    color: white;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.closed-subtitle {
    font-size: 15px;
    color: #9ca3af;
    font-weight: 500;
}

.closed-subtitle span {
    color: var(--l1-color);
    font-weight: 700;
}

.closed-divider {
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    margin: 20px auto;
    border-radius: 2px;
}

.closed-note {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}

.closed-hours {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
}

.hours-title {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hours-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.hours-row+.hours-row {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hours-day {
    color: #9ca3af;
    font-weight: 500;
}

.hours-time {
    color: white;
    font-weight: 600;
}

.close-overlay-btn {
    margin-top: 18px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, color 0.2s;
}

.close-overlay-btn:active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Light mode overrides for closed overlay */
body.light-mode .closed-overlay {
    background: rgba(255, 255, 255, 0.7);
}

body.light-mode .closed-content {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-mode .closed-title {
    color: #111827;
}

body.light-mode .closed-subtitle {
    color: #6b7280;
}

body.light-mode .closed-note {
    color: #9ca3af;
}

body.light-mode .closed-divider {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.15), transparent);
}

body.light-mode .closed-hours {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .hours-title {
    color: #6b7280;
}

body.light-mode .hours-day {
    color: #6b7280;
}

body.light-mode .hours-time {
    color: #111827;
}

body.light-mode .hours-row+.hours-row {
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .close-overlay-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
    color: #6b7280;
}

body.light-mode .close-overlay-btn:active {
    background: rgba(0, 0, 0, 0.1);
    color: #111827;
}



/* --- iOS Widget Setup --- */

/* Widget section in info popup */
.widget-section {
    background: rgba(243, 112, 33, 0.08);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(243, 112, 33, 0.15);
}

/* Map preview thumbnail */
.widget-preview-container {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f1115;
}

.widget-preview-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Setup button in info popup */
.widget-setup-btn {
    width: 100%;
    padding: 9px 16px;
    background: linear-gradient(135deg, var(--l5-color), #e05a10);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.15s, opacity 0.15s;
}

.widget-setup-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* ---- Widget Setup Modal ---- */
.widget-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    pointer-events: auto;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.widget-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.widget-modal-content {
    width: 100%;
    max-height: 90vh;
    background: #16191f;
    border-radius: 24px 24px 0 0;
    overflow-y: auto;
    animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpModal {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.widget-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
    position: sticky;
    top: 0;
    background: #16191f;
    z-index: 1;
}

.widget-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.widget-modal-close:active {
    background: rgba(255, 255, 255, 0.2);
}

.widget-modal-body {
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* Individual steps */
.widget-step {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    position: relative;
}

/* Connecting line between steps */
.widget-step::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: -14px;
    width: 2px;
    background: rgba(255, 255, 255, 0.06);
}

.widget-step:last-of-type::after {
    display: none;
}

.widget-step-number {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--l5-color), #e05a10);
    color: white;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.widget-step-content {
    flex: 1;
    padding-top: 4px;
}

/* SVG Pulse Animation (Mobile) */
@keyframes svg-pulse-red {
    0% {
        r: 6;
        opacity: 0.6;
        stroke-width: 0;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        r: 25;
        opacity: 0;
        stroke-width: 0;
    }
}

@keyframes svg-pulse-yellow {
    0% {
        r: 6;
        opacity: 0.6;
        stroke-width: 0;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        r: 25;
        opacity: 0;
        stroke-width: 0;
    }
}

.svg-alert-pulse {
    pointer-events: none;
    animation: svg-pulse-red 2s infinite;
    transform-origin: center;
    transform-box: fill-box;
}

.svg-alert-pulse.yellow {
    animation: svg-pulse-yellow 2s infinite;
    fill: #ff9f1c;
    /* Fallback if inline style missing */
}

.svg-alert-pulse.red {
    animation: svg-pulse-red 2s infinite;
    fill: #ef4444;
    /* Fallback if inline style missing */
}

.widget-step-title {
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.widget-step-text {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.5;
    margin: 0 0 8px;
}

.widget-step-text strong {
    color: #e0e0e0;
}

/* App Store link */
.widget-app-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(52, 120, 246, 0.15);
    border: 1px solid rgba(52, 120, 246, 0.25);
    border-radius: 8px;
    color: #5A9CFF;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.widget-app-link:active {
    background: rgba(52, 120, 246, 0.25);
}

/* Copy code button */
.widget-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.widget-copy-btn:active {
    transform: scale(0.97);
}

.widget-copy-btn.copied {
    background: rgba(0, 150, 57, 0.2);
    border-color: rgba(0, 150, 57, 0.35);
    color: #4ade80;
}

/* Done message */
.widget-step-done {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: rgba(0, 150, 57, 0.1);
    border: 1px solid rgba(0, 150, 57, 0.2);
    border-radius: 12px;
    color: #4ade80;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
}

.widget-step-done i {
    font-size: 18px;
}

/* ---- Light Mode Overrides ---- */
body.light-mode .widget-section {
    background: rgba(243, 112, 33, 0.06);
    border-color: rgba(243, 112, 33, 0.12);
}

body.light-mode .widget-preview-container {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .widget-modal-content {
    background: #f8f9fa;
}

body.light-mode .widget-modal-header {
    background: #f8f9fa;
}

body.light-mode .widget-modal-title {
    color: #111827;
}

body.light-mode .widget-modal-close {
    background: rgba(0, 0, 0, 0.06);
    color: #6b7280;
}

body.light-mode .widget-step::after {
    background: rgba(0, 0, 0, 0.08);
}

body.light-mode .widget-step-title {
    color: #111827;
}

body.light-mode .widget-step-text {
    color: #6b7280;
}

body.light-mode .widget-step-text strong {
    color: #111827;
}

body.light-mode .widget-copy-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #374151;
}

body.light-mode .widget-step-done {
    background: rgba(0, 150, 57, 0.06);
    border-color: rgba(0, 150, 57, 0.15);
    color: #15803d;
}

/* --- Notifications & Toggles --- */
.info-notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--surface-glass);
    pointer-events: none;
    z-index: 10;
}

/* Switches */
.switch-mobile {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider-mobile {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--border-color);
}

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

input:checked+.slider-mobile {
    background-color: var(--l2-color);
    border-color: var(--l2-color);
}

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

/* ==========================================
   PULSING ALERT MARKERS
   ========================================== */
.alert-marker-pulse {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    pointer-events: none;
}

.alert-marker-pulse::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
    animation: pulse-animation 2s infinite;
}

.alert-marker-pulse.red {
    color: #ef4444;
    background: #ef4444;
}

.alert-marker-pulse.yellow {
    color: #FFC425;
    background: #FFC425;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.2);
    }

    100% {
        box-shadow: 0 0 0 20px rgba(0, 0, 0, 0);
    }
}

/* Settings Button */
#btn-settings {
    top: max(16px, env(safe-area-inset-top));
    left: 16px;
    z-index: 100;
    /* Above map */
}

/* Settings Popup (anchored to fab-stack like info popup) */
#settings-modal {
    transform-origin: top left;
    top: 120px !important;
    width: 220px;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 0;
    overflow: hidden;
    z-index: 100;
}

#settings-modal .layer-popup-title {
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--surface-glass-border);
    font-size: 16px;
}

#settings-modal .walkthrough-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
    margin: 0;
}

#settings-modal .walkthrough-section:last-of-type {
    border-bottom: none;
}

.theme-toggle-wrapper {
    display: flex;
    align-items: center;
}

/* Alert Overlay Card (Toast Style) */
.alert-overlay-card {
    position: absolute;
    bottom: 85px;
    left: 12px;
    right: 12px;
    background: #252525; /* dark grey matching screenshot */
    border: none;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 2000;

    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;

    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
    pointer-events: auto;
}

.alert-overlay-card.hidden {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    display: flex;
    /* Maintain flex layout */
}

/* Columns */
.alert-icon-col {
    flex-shrink: 0;
    padding-top: 2px;
}

.alert-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.alert-close-col {
    flex-shrink: 0;
    margin-left: 0;
}

/* Typography & Elements */
.alert-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.alert-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.alert-card-location {
    font-size: 10px;
    font-weight: 700;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.alert-card-text {
    font-size: 12px;
    line-height: 1.4;
    color: #d0d0d0;
    margin-top: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Icons */
.shuttle-tag {
    display: none;
    /* Hidden by default, toggled to inline-flex by JS */
    align-items: center;
    gap: 4px;
    background: var(--l3-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 0;
    /* Removing top margin as it's now inline */
    width: fit-content;
    vertical-align: middle;
    line-height: 1;
}

/* Close Btn */
.close-btn {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
}

/* Light Mode Support */
.light-mode .alert-overlay-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.light-mode .alert-card-title {
    color: #111;
}

.light-mode .alert-card-text {
    color: #444;
}

.light-mode .close-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

/* ==========================================================================
   TTC ARRIVALS SNACKBAR — matches GO mobile layout (responsive chips + sort)
   ========================================================================== */
#arrivals-snackbar.ttc-arrivals-snackbar.alert-overlay-card {
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: max(72px, calc(72px + env(safe-area-inset-bottom, 0px)));
    width: auto;
    max-width: min(560px, calc(100vw - 16px));
    margin-left: auto;
    margin-right: auto;
    max-height: min(62vh, calc(100vh - 120px));
    max-height: min(62vh, calc(100dvh - 120px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    gap: clamp(6px, 2vw, 10px);
    padding: clamp(10px, 3vw, 14px) clamp(10px, 3.5vw, 16px);
    box-sizing: border-box;
}

/* Slim scrollbar for station panel (TTC + GO share #arrivals-snackbar) */
#arrivals-snackbar.alert-overlay-card {
    color-scheme: dark;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) rgba(255, 255, 255, 0.06);
}

#arrivals-snackbar.alert-overlay-card::-webkit-scrollbar {
    width: 5px;
}

#arrivals-snackbar.alert-overlay-card::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    margin: 6px 0;
}

#arrivals-snackbar.alert-overlay-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 100px;
    border: 1px solid transparent;
    background-clip: padding-box;
}

#arrivals-snackbar.alert-overlay-card::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.38);
    background-clip: padding-box;
}

body.light-mode #arrivals-snackbar.alert-overlay-card {
    color-scheme: light;
    scrollbar-color: rgba(0, 0, 0, 0.35) rgba(0, 0, 0, 0.06);
}

body.light-mode #arrivals-snackbar.alert-overlay-card::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode #arrivals-snackbar.alert-overlay-card::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.22);
}

body.light-mode #arrivals-snackbar.alert-overlay-card::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

.ttc-arrivals-snackbar__section {
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 1.5vw, 8px);
    width: 100%;
    min-width: 0;
}

.ttc-arrivals-snackbar__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.ttc-arrivals-snackbar__station {
    font-size: clamp(13px, 3.8vw, 17px);
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

body.light-mode .ttc-arrivals-snackbar__station {
    color: #111;
}

.ttc-arrivals-snackbar__placeholder {
    font-size: clamp(11px, 3.2vw, 14px);
    line-height: 1.4;
    color: var(--text-muted, #a0a0a0);
    padding: clamp(4px, 1vw, 8px) 0;
}

body.light-mode .ttc-arrivals-snackbar__placeholder {
    color: #666;
}

.ttc-arrivals-snackbar__header .close-btn {
    flex-shrink: 0;
    margin-left: 0;
}

.ttc-arrivals-snackbar__content {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 2vw, 10px);
    margin-top: clamp(2px, 1vw, 6px);
    width: 100%;
    min-width: 0;
}

#snackbar-arrivals-content.ttc-arrivals-list {
    gap: clamp(8px, 2.5vw, 12px) !important;
}

.ttc-arrival-row {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2.2vw, 12px);
    padding: clamp(10px, 2.8vw, 14px) clamp(10px, 3.2vw, 16px);
    border-radius: clamp(10px, 2.5vw, 14px);
    background: var(--surface-glass, rgba(26, 28, 32, 0.75));
    border: 1px solid var(--surface-glass-border, rgba(255, 255, 255, 0.12));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

body.light-mode .ttc-arrival-row {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ttc-arrival-row__head {
    display: flex;
    align-items: flex-start;
    gap: clamp(8px, 2vw, 12px);
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
}

/* TTC line badge: circle (subway line pill) */
.ttc-arrival-line-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(22px, 6.5vw, 28px);
    height: clamp(22px, 6.5vw, 28px);
    min-width: clamp(22px, 6.5vw, 28px);
    border-radius: 50%;
    font-size: clamp(10px, 2.8vw, 12px);
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ttc-arrival-direction {
    font-weight: 600;
    font-size: clamp(11px, 3.2vw, 14px);
    line-height: 1.35;
    color: var(--text-main, #e8eaed);
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

body.light-mode .ttc-arrival-direction {
    color: #1a1a1a;
}

.ttc-arrival-times {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 4.75rem), 1fr));
    gap: clamp(6px, 2vw, 12px);
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

@media (max-width: 280px) {
    .ttc-arrival-times {
        grid-template-columns: 1fr;
    }
}

.ttc-arrival-time-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: clamp(8px, 2.2vw, 12px) clamp(8px, 2.8vw, 16px);
    border-radius: clamp(10px, 2.2vw, 14px);
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

body.light-mode .ttc-arrival-time-chip {
    background: #f0f2f5;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ttc-arrival-time-chip--due {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

body.light-mode .ttc-arrival-time-chip--due {
    background: #fee2e2;
    border-color: #ef4444;
}

.ttc-arrival-time-chip__eta {
    font-size: clamp(14px, 4.2vw, 18px);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    letter-spacing: -0.02em;
    text-align: center;
    max-width: 100%;
    overflow-wrap: break-word;
}

body.light-mode .ttc-arrival-time-chip__eta {
    color: #111;
}

.ttc-arrival-time-chip--due .ttc-arrival-time-chip__eta {
    color: #fecaca;
}

body.light-mode .ttc-arrival-time-chip--due .ttc-arrival-time-chip__eta {
    color: #b91c1c;
}

.ttc-arrival-time-chip__clock {
    margin-top: clamp(2px, 0.8vw, 6px);
    font-size: clamp(9px, 2.6vw, 12px);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

body.light-mode .ttc-arrival-time-chip__clock {
    color: rgba(0, 0, 0, 0.55);
}

.ttc-arrival-time-chip--due .ttc-arrival-time-chip__clock {
    color: rgba(254, 202, 202, 0.9);
}

body.light-mode .ttc-arrival-time-chip--due .ttc-arrival-time-chip__clock {
    color: #7f1d1d;
}

.ttc-arrival-row__empty {
    font-size: clamp(11px, 3vw, 13px);
    color: var(--text-muted, #a0a0a0);
    line-height: 1.35;
}

body.light-mode .ttc-arrival-row__empty {
    color: #666;
}

/* ==========================================================================
   TTC station sheet — live arrivals, then service alerts, then station access
   ========================================================================== */
.ttc-station-sheet__section {
    margin-bottom: clamp(10px, 2.5vw, 14px);
    padding-bottom: clamp(10px, 2.5vw, 14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .ttc-station-sheet__section {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.ttc-station-sheet__section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ttc-station-sheet__section--arrivals {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.ttc-station-sheet__divider {
    height: 1px;
    margin: clamp(6px, 2vw, 12px) 0 clamp(10px, 2.5vw, 16px);
    background: rgba(255, 255, 255, 0.12);
}

body.light-mode .ttc-station-sheet__divider {
    background: rgba(0, 0, 0, 0.1);
}

.ttc-station-sheet__h {
    margin: 0 0 clamp(8px, 2vw, 12px) 0;
    font-size: clamp(12px, 3.2vw, 14px);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

body.light-mode .ttc-station-sheet__h {
    color: rgba(0, 0, 0, 0.5);
}

.ttc-station-sheet__arrivals-wrap {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2.5vw, 12px);
}

.ttc-station-sheet__section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.ttc-station-sheet__line-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
}

.ttc-station-sheet__effect {
    font-size: clamp(13px, 3.5vw, 15px);
    font-weight: 700;
    color: #fff;
}

body.light-mode .ttc-station-sheet__effect {
    color: #111;
}

.ttc-station-sheet__route {
    font-size: clamp(12px, 3.2vw, 14px);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
    line-height: 1.35;
}

body.light-mode .ttc-station-sheet__route {
    color: #333;
}

.ttc-station-sheet__reason {
    margin: 0;
    font-size: clamp(12px, 3.1vw, 14px);
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.75);
}

body.light-mode .ttc-station-sheet__reason {
    color: #444;
}

.ttc-station-sheet__meta {
    margin-top: 6px;
    font-size: clamp(11px, 2.9vw, 13px);
    color: rgba(255, 255, 255, 0.55);
}

body.light-mode .ttc-station-sheet__meta {
    color: #666;
}

.ttc-station-sheet__shuttle {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(11px, 2.9vw, 13px);
    font-weight: 600;
    color: #fbbf24;
}

.ttc-station-sheet__section--access .ttc-station-sheet__acc-icon-wrap {
    color: #f59e0b;
    font-size: 16px;
}

.ttc-station-sheet__section--access .ttc-station-sheet__effect {
    color: #fbbf24;
}

body.light-mode .ttc-station-sheet__section--access .ttc-station-sheet__effect {
    color: #b45309;
}