@font-face {
    font-family: 'BlinkMacSystemFont';
    src: url('../fonts/BlinkMacSystemFont-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BlinkMacSystemFont';
    src: url('../fonts/BlinkMacSystemFont-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'BlinkMacSystemFont';
    src: url('../fonts/BlinkMacSystemFont-Semibold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'BlinkMacSystemFont';
    src: url('../fonts/BlinkMacSystemFont-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

:root {
    --patco-red: #c30032;
    --patco-red-dark: #a00029;
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --glow: rgba(195, 0, 50, 0.3);
    --blue-accent: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    -webkit-user-select: none;
    user-select: none;
}

.container {
    max-width: 480px;
    width: 100%;
}

header {
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--patco-red);
    width: 100%;
}

.patco-logo-img {
    width: 63.13%;
    /* (250/396) Relative to SCHEDULE wordmark */
    max-width: 252px;
    /* Scaled proportionally to 400px */
    aspect-ratio: 250/35;
    display: block;
    background-image: url('../images/patco.svg');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.schedule-logo-img {
    width: 100%;
    max-width: 400px;
    /* Split the difference between 360px and 420px */
    aspect-ratio: 396/35;
    display: block;
    background-image: url('../images/schedule.svg');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}



.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(20px);
}

.selector-card {
    position: relative;
    z-index: 10;
    overflow: visible;
}

/* Disable buttons and other triggers in the selector card when a dropdown is active */
body.has-custom-select-open .selector-card button,
body.has-custom-select-open .custom-select:not(.open) .custom-select-trigger {
    pointer-events: none;
    opacity: 0.5;
}

.selector-group {
    margin-bottom: 1rem;
}

.selector-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select.open {
    z-index: 1000;
}

.custom-select-trigger {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-right: 2.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: opacity 0.1s ease-out, border-color 0.2s, box-shadow 0.2s, pointer-events 0s linear 0.1s;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.custom-select-trigger.placeholder {
    color: var(--text-muted);
}

.custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.custom-select.open .custom-select-trigger {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.custom-select-trigger .select-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
    font-size: 1.4rem;
    font-variation-settings: 'wght' 500;
    transition: color 0.2s;
}

.custom-select-trigger:hover .select-arrow {
    color: #fff;
}

.custom-select.open .select-arrow {
    color: #fff;
}

.custom-select-options {
    position: absolute;
    top: 0;
    left: 8px;
    right: 8px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: transparent;
    border: none;
    /* Static positioning - NOT transitioned to avoid sliding */
    transform: translateY(var(--dropdown-offset, 0px));
    /* Delay removing visibility/pointer-events until the opacity fade finishes to avoid hit-test layout thrashing during animation */
    transition: opacity 0.1s ease-out, visibility 0s linear 0.1s, pointer-events 0s linear 0.1s;
    will-change: opacity, visibility;
}

.custom-select-panel {
    background: #181822;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
    /* Exit shrink animation - synced to 0.1s close */
    transform: scale(0.96);
    transition: transform 0.1s ease-out;

    /* Hardware acceleration for smooth mobile popping */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.custom-select-list {
    position: relative;
    max-height: 96vh;
    /* Maximize visibility to fit all items without cutting off stations */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.custom-select.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Delay interaction until animation finishes to prevent accidental touch highlights on mobile */
    transition: opacity 0.1s ease-out, visibility 0s linear 0s, pointer-events 0s linear 0.1s;
}

.custom-select.open .custom-select-panel {
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.15);
    /* Smooth elastic pop on opening */
    transition: transform 0.15s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.15s ease;
}


.custom-select-group-label {
    padding: 0.6rem 1rem 0.3rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    pointer-events: none;
}

.custom-select-option {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
}

@media (hover: hover) {
    .custom-select-option:not(.disabled):hover {
        background: rgba(255, 255, 255, 0.06);
    }
}

/* On mobile, only allow hover states *after* the popup has been open for 0.75s to prevent sticky flash on open */
@media (hover: none) {
    .custom-select.hover-ready .custom-select-option:not(.disabled):active {
        background: rgba(255, 255, 255, 0.06);
    }
}

.custom-select-option.selected {
    color: var(--blue-accent);
    background: rgba(59, 130, 246, 0.08);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-select-option.selected::after {
    content: '✓';
    font-size: 0.85rem;
    font-weight: 700;
}

.custom-select-option.disabled {
    color: rgba(255, 255, 255, 0.2);
    cursor: default;
}

.custom-select-option.origin-station {
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
}

.origin-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: var(--text-muted);
    line-height: 1;
    margin-left: 0.5rem;
}

/* Remove "No destination" option from the visible list */
#destinationSelect .custom-select-option[data-value=""] {
    display: none;
}

/* Scrollbar styling for dropdown */
.custom-select-options::-webkit-scrollbar {
    width: 4px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}



.direction-toggle {
    display: flex;
    gap: 0.5rem;
}

.direction-btn {
    flex: 1;
    position: relative;
    padding: 0.6rem 0.5rem;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.1s ease-out, transform 0.2s, border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s, pointer-events 0s linear 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.direction-btn[data-direction="westbound"] .btn-text {
    padding-left: 1.5rem;
}

.direction-btn[data-direction="eastbound"] .btn-text {
    padding-right: 1.5rem;
}

.direction-btn .btn-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.direction-btn .btn-dir {
    font-size: 0.95rem;
    font-weight: 600;
}

.direction-btn .btn-dest {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 400;
}

.direction-btn .btn-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease-out, color 0.15s ease;

    /* Force GPU texture rendering for smooth Windows subpixel animation */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.direction-btn[data-direction="westbound"] .btn-arrow {
    left: 0.75rem;
}

.direction-btn[data-direction="eastbound"] .btn-arrow {
    right: 0.75rem;
}

.direction-btn[data-direction="westbound"]:not(.active):hover .btn-arrow {
    transform: translate(1px, -50%);
    /* hardware accelerated minimum integer shift right */
}

.direction-btn[data-direction="eastbound"]:not(.active):hover .btn-arrow {
    transform: translate(-1px, -50%);
    /* hardware accelerated minimum integer shift left */
}

.direction-btn[data-direction="eastbound"]:not(.active):hover {
    border-color: var(--east-color, var(--patco-red));
    box-shadow: inset 0 0 0 1px var(--east-color, var(--patco-red));
    color: var(--east-color, var(--text-primary));
}

.direction-btn[data-direction="westbound"]:not(.active):hover {
    border-color: var(--west-color, var(--patco-red));
    box-shadow: inset 0 0 0 1px var(--west-color, var(--patco-red));
    color: var(--west-color, var(--text-primary));
}

.direction-btn.active {
    background: linear-gradient(135deg, var(--patco-red), var(--patco-red-dark));
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px var(--glow);
    font-weight: 500;
}

.next-train-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.countdown-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.countdown {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--patco-red), #ff9a5c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.countdown-unit {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.next-time {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
    -webkit-user-select: text;
    user-select: text;
}

.upcoming-time {
    font-size: 1.1rem;
    font-weight: 600;
    -webkit-user-select: text;
    user-select: text;
}

.schedule-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--patco-red);
    font-weight: 700;
    background: rgba(195, 0, 50, 0.1);
    border: 1.5px solid rgba(195, 0, 50, 0.3);
    border-radius: 9999px;
    margin-top: 1rem;
    text-decoration: none;
    transition: all 0.2s;
}

/* Special schedule - yellow */
.schedule-badge.special {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

a.schedule-badge.special:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}

/* Weekday schedule - light blue */
.schedule-badge.weekday {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

a.schedule-badge.weekday:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
}

/* Weekend schedule - light purple */
.schedule-badge.weekend {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.1);
    border-color: rgba(192, 132, 252, 0.3);
}

a.schedule-badge.weekend:hover {
    background: rgba(192, 132, 252, 0.2);
    border-color: #c084fc;
}

/* Sunday schedule - pink */
.schedule-badge.sunday {
    color: #f472b6;
    background: rgba(244, 114, 182, 0.1);
    border-color: rgba(244, 114, 182, 0.3);
}

a.schedule-badge.sunday:hover {
    background: rgba(244, 114, 182, 0.2);
    border-color: #f472b6;
}

a.schedule-badge:hover {
    background: rgba(195, 0, 50, 0.2);
    border-color: var(--patco-red);
}

.optional-label {
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.label-row label {
    margin-bottom: 0;
}

.clear-btn,
.geo-btn {
    background: none;
    border: 1.5px solid var(--border-color);
    border-radius: 9999px;
    color: var(--text-muted);
    font-size: 0.65rem;
    cursor: pointer;
    padding: 0.1rem 0.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: opacity 0.1s ease-out, color 0.2s, border-color 0.2s, pointer-events 0s linear 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.clear-btn:hover {
    color: var(--patco-red);
    border-color: var(--patco-red);
}

.geo-btn:hover {
    color: var(--blue-accent);
    border-color: var(--blue-accent);
}

.show-more-btn:hover {
    color: var(--blue-accent);
    border-color: var(--blue-accent);
}

.geo-icon {
    font-size: 0.9rem !important;
    width: 0.9rem;
    height: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.geo-btn.geo-loading .geo-icon {
    display: none;
}

.geo-btn.geo-loading .spinner-small {
    display: inline-block !important;
}

.spinner-small {
    width: 0.9rem;
    height: 0.9rem;
    vertical-align: middle;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--blue-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-sizing: border-box;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.geo-control {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.geo-toast {
    position: absolute;
    top: 100%;
    right: -8px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: #1c1c26;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.clear-btn:hover {
    color: var(--patco-red);
    border-color: var(--patco-red);
}

.arrival-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.arrival-time .arrival-arrow {
    font-size: 0.75rem;
}

.arrival-time .arrival-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.arrival-time .arrival-closed {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    font-style: italic;
}

.next-arrival {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    font-weight: 500;
}

.next-arrival .arrival-dest {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.upcoming-list {
    list-style: none;
}

.upcoming-item {
    display: grid;
    grid-template-columns: 5.5rem 3.5rem 1fr auto;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
}

/* Only remove padding and border if it's the very last list in the card */
.upcoming-list:last-of-type .upcoming-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.upcoming-item.thick-border {
    border-bottom: 2px solid var(--border-color);
}

.upcoming-item:first-child {
    padding-top: 0;
}

#hiddenTrains {
    margin-top: 0;
    padding-top: 0;
}

#hiddenTrains .upcoming-item:first-child {
    padding-top: 0.75rem;
}

.upcoming-time {
    font-size: 1.1rem;
    font-weight: 600;
    -webkit-user-select: text;
    user-select: text;
}

.upcoming-tomorrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1;
}

.upcoming-minutes {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upcoming-schedule {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-left: 0.5rem;
    text-decoration: none;
    display: inline-block;
    border: 1.5px solid rgba(195, 0, 50, 0.3);
    color: var(--patco-red);
    background: rgba(195, 0, 50, 0.1);
    transition: all 0.2s;
}

.upcoming-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0 0.5rem 0;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.upcoming-header:first-child {
    margin-top: 0;
    padding-top: 0;
}

#hiddenTrains .upcoming-header:first-child {
    margin-top: 1rem;
    padding-top: 1rem;
}

a.upcoming-schedule:hover {
    background: rgba(195, 0, 50, 0.2);
    border-color: var(--patco-red);
    text-decoration: none;
    opacity: 1;
}

.upcoming-schedule.special {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

a.upcoming-schedule.special:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
}

.upcoming-schedule.weekday {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

a.upcoming-schedule.weekday:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
}

.upcoming-schedule.weekend {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.15);
    border-color: rgba(192, 132, 252, 0.3);
}

a.upcoming-schedule.weekend:hover {
    background: rgba(192, 132, 252, 0.2);
    border-color: #c084fc;
}

.upcoming-schedule.sunday {
    color: #f472b6;
    background: rgba(244, 114, 182, 0.15);
    border-color: rgba(244, 114, 182, 0.3);
}

a.upcoming-schedule.sunday:hover {
    background: rgba(244, 114, 182, 0.2);
    border-color: #f472b6;
}

.show-more-btn {
    width: 100%;
    padding: 0.5rem;
    margin-top: 1.25rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
}

.show-more-btn .material-symbols-outlined {
    font-size: 1.8rem;
    font-variation-settings: 'wght' 500;
    transition: transform 0.2s ease;
}

.show-more-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.geo-icon {
    font-size: 0.9rem !important;
    vertical-align: middle;
}

.show-more-btn:hover {
    border-color: var(--severity-color, var(--patco-red));
    box-shadow: inset 0 0 0 1px var(--severity-color, var(--patco-red));
    color: var(--text-primary);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--patco-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    text-align: center;
    padding: 2rem;
    color: #ff6b6b;
}

.refresh-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

.refresh-note #refreshCountdown {
    display: inline-block;
    min-width: 1.25em;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.refresh-ring {
    width: 20px;
    height: 20px;
    position: relative;
}

.refresh-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.refresh-ring circle {
    fill: none;
    stroke-width: 2;
}

.refresh-ring .bg {
    stroke: var(--border-color);
}

.refresh-ring .progress {
    stroke: var(--patco-red);
    stroke-linecap: round;
}

.refresh-ring .progress.animated {
    transition: stroke-dashoffset 1s linear;
}

footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 480px) {
    body {
        padding: 1rem 0.75rem;
    }

    header {
        margin-top: 0.5rem;
        margin-bottom: 2rem;
    }

    .patco-logo-img {
        width: 53.67%;
        /* Scales height to exactly match the 85% wide Schedule line */
    }

    .schedule-logo-img {
        width: 85%;
    }

    .card {
        padding: 1.25rem;
    }

    .next-train-card {
        padding: 1.5rem 1.25rem;
    }

    .countdown {
        font-size: 3.5rem;
    }

    .selector-group {
        margin-bottom: 0.75rem;
    }

    footer {
        padding-top: 1rem;
    }

    /* Disable links and buttons outside selector card when popup is open on mobile */
    body.has-custom-select-open .schedule-badge,
    body.has-custom-select-open .show-more-btn,
    body.has-custom-select-open footer a {
        pointer-events: none;
        opacity: 0.5;
    }
}