/*
 * Global Metro Status — Design System (metro-status.com family)
 */

:root {
    --brand-primary: #c00e2d;
    --brand-primary-hover: #a00c25;
    --brand-gradient-end: #e31e24;
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --surface-page: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --status-on-time: #16a34a;
    --status-delayed: #d97706;
    --status-offline: #94a3b8;
    --radius-card: 1rem;
    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-card-hover: 0 8px 24px rgba(15, 23, 42, 0.06);
    --header-height: 4rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--surface-page);
    min-height: 100vh;
}

.app-main { flex: 1; padding-bottom: 2rem; }
.app-main--flush-bottom { padding-bottom: 0; }

/* Navigation */
.nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-link--active { background: rgba(255, 255, 255, 0.15); color: #fff; }

.mobile-nav-link {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}
.mobile-nav-link:hover { background: rgba(255, 255, 255, 0.1); }

/* Page hero */
.page-hero { background: var(--surface); border-bottom: 1px solid #e2e8f0; }
.page-hero__title {
    font-size: clamp(1.5rem, 1.15rem + 1.75vw, 2.25rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.5rem;
}
.page-hero__subtitle { color: var(--text-secondary); margin-top: 0.5rem; max-width: 42rem; }

.section-heading {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Breadcrumbs */
.breadcrumbs { margin-bottom: 0.5rem; }
.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.breadcrumbs__item:not(:last-child)::after { content: '/'; margin-left: 0.25rem; color: #cbd5e1; }
.breadcrumbs__link { color: var(--brand-primary); }
.breadcrumbs__link:hover { text-decoration: underline; }
.breadcrumbs__current { color: var(--text-secondary); }

/* Status chips */
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-chip--on-time { background: #dcfce7; color: var(--status-on-time); }
.status-chip--delayed { background: #fef3c7; color: var(--status-delayed); }
.status-chip--offline { background: #f1f5f9; color: var(--status-offline); }
.status-chip--neutral { background: #e2e8f0; color: #475569; }

/* Country / city cards */
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.country-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
}
.country-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}
.country-card--soon { opacity: 0.7; cursor: default; pointer-events: none; }
.country-card__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-gradient-end));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.country-card__title { font-weight: 700; font-size: 1.0625rem; }
.country-card__meta { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.125rem; }
.country-card__stats { font-size: 0.8125rem; margin-top: 0.375rem; }

/* Status hero */
.status-hero {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
    border: 1px solid #e2e8f0;
}
.status-hero__counts { display: flex; gap: 2rem; flex-wrap: wrap; }
.status-hero__value { font-size: 2rem; font-weight: 700; line-height: 1; }
.status-hero__label { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.25rem; display: block; }
.status-hero__updated { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 1rem; }
.status-hero__notice {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #92400e;
}

/* Station / route lists */
.station-list, .route-list, .departure-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.station-card, .route-card, .departure-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--surface);
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.station-card:hover, .route-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-card);
}
.station-card__icon { color: var(--brand-primary); }
.station-card__name { flex: 1; font-weight: 600; }
.station-card__code { font-size: 0.75rem; color: var(--text-secondary); }
.station-card__arrow { color: #cbd5e1; }
.route-card__name { flex: 1; font-weight: 500; }

.route-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    background: var(--brand-primary);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
}
.route-badge--lg { min-width: 2.5rem; padding: 0.35rem 0.65rem; font-size: 1rem; }

.departure-card__body { flex: 1; min-width: 0; }
.departure-card__route { font-weight: 600; }
.departure-card__delay { font-size: 0.8125rem; color: var(--status-delayed); }
.departure-card__ontime { font-size: 0.8125rem; color: var(--status-on-time); }

/* ═══ City Page — Network overview chips ═══ */
.city-network-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 2rem;
}
.city-network-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    background: var(--surface, #fff);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    cursor: pointer;
}
.city-network-chip:hover {
    border-color: var(--brand-primary, #0d9488);
    box-shadow: 0 4px 12px rgba(13,148,136,0.1);
    transform: translateY(-2px);
}
.city-network-chip--active {
    background: var(--brand-primary, #0d9488);
    color: #fff;
    border-color: var(--brand-primary, #0d9488);
    box-shadow: 0 4px 12px rgba(13,148,136,0.25);
}
.city-network-chip--active .material-symbols-outlined { color: #fff; }
.city-network-chip--clear {
    border-style: dashed;
    color: var(--text-secondary);
    font-weight: 500;
}
.city-network-chip--clear:hover { color: #dc2626; border-color: #dc2626; }
.city-network-chip .material-symbols-outlined {
    font-size: 1.25rem;
    color: var(--brand-primary, #0d9488);
}
.city-network-chip__count {
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1;
}
.city-network-chip__label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.city-network-chip--active .city-network-chip__label { color: rgba(255,255,255,0.8); }
.city-network-chip--active .city-network-chip__count { color: #fff; }

/* ═══ City Page — Mode-grouped route sections ═══ */
.city-routes-section { margin-bottom: 2.5rem; }

.city-mode-group {
    margin-bottom: 1.5rem;
    background: var(--surface, #fff);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.city-mode-group__header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.city-mode-group__icon {
    font-size: 1.375rem;
    color: var(--brand-primary, #0d9488);
}
.city-mode-group__title {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.city-mode-group__count {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: #e2e8f0;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
}

.city-mode-group__grid {
    display: flex;
    flex-direction: column;
}

.city-route-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s, padding-left 0.15s;
}
.city-route-chip:last-child { border-bottom: none; }
.city-route-chip:hover {
    background: #f0fdfa;
    padding-left: 1.5rem;
}
.city-route-chip__name {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.city-route-chip__arrow {
    font-size: 1.125rem;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}
.city-route-chip:hover .city-route-chip__arrow {
    color: var(--brand-primary, #0d9488);
    transform: translateX(3px);
}

/* ═══ City Page — Stations section ═══ */
.city-stations-section { margin-bottom: 2rem; }
.city-stations-section__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.city-stations-section__header .section-heading { margin-bottom: 0; }

.city-station-search {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--surface, #fff);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.15s;
}
.city-station-search:focus-within { border-color: var(--brand-primary, #0d9488); }
.city-station-search__icon {
    padding: 0 0.625rem;
    color: #94a3b8;
    font-size: 1.25rem;
}
.city-station-search__input {
    border: none;
    outline: none;
    padding: 0.625rem 0;
    font-size: 0.875rem;
    width: 200px;
    background: transparent;
}
.city-station-search__btn {
    border-radius: 0 0.625rem 0.625rem 0;
    padding: 0.625rem 1rem;
}

.city-station-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.5rem;
}

.city-station-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: var(--surface, #fff);
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}
.city-station-card:hover {
    border-color: var(--brand-primary, #0d9488);
    box-shadow: 0 2px 8px rgba(13,148,136,0.08);
    transform: translateY(-1px);
}

.city-station-card__icon {
    font-size: 1.125rem;
    color: var(--brand-primary, #0d9488);
    flex-shrink: 0;
    opacity: 0.7;
}
.city-station-card:hover .city-station-card__icon { opacity: 1; }

.city-station-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.city-station-card__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.city-station-card__code {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.city-station-card__arrow {
    font-size: 1rem;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.city-station-card:hover .city-station-card__arrow { color: var(--brand-primary, #0d9488); }

@media (max-width: 640px) {
    .city-station-grid { grid-template-columns: 1fr; }
    .city-stations-section__header { flex-direction: column; align-items: stretch; }
    .city-station-search__input { width: 100%; flex: 1; }
    .city-network-stats { gap: 0.5rem; }
    .city-network-chip { padding: 0.5rem 0.75rem; font-size: 0.8125rem; }
}

/* Filter bar */
.filter-bar { margin-bottom: 1.5rem; }
.filter-bar__form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-input {
    flex: 1;
    min-width: 200px;
    padding: 0.625rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
}
.btn-primary {
    padding: 0.625rem 1.25rem;
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary:hover { background: var(--brand-primary-hover); }

/* Alerts */
.alerts-panel { margin-bottom: 2rem; }
.alert-card {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
}
.alert-card__title { font-weight: 600; }
.alert-card__text { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 1.5rem; }

.blog-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.blog-card {
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 0.75rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.blog-card:hover { border-color: var(--brand, #0d9488); box-shadow: 0 4px 12px rgb(15 23 42 / 0.06); }
.blog-card__link { display: block; padding: 1.25rem 1.5rem; text-decoration: none; color: inherit; }
.blog-card__date { display: block; font-size: 0.8125rem; color: #64748b; margin-bottom: 0.35rem; }
.blog-card__title { font-size: 1.125rem; font-weight: 700; color: #0f172a; margin: 0 0 0.5rem; }
.blog-card__excerpt { font-size: 0.9375rem; color: #475569; margin: 0 0 0.75rem; line-height: 1.5; }
.blog-card__more {
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-size: 0.875rem; font-weight: 600; color: var(--brand, #0d9488);
}
.blog-card__more .material-symbols-outlined { font-size: 1.125rem; }
.blog-empty {
    text-align: center; padding: 3rem 1.5rem;
    border: 1px dashed #cbd5e1; border-radius: 0.75rem; background: #f8fafc;
}
.blog-empty__icon { font-size: 3rem; color: #94a3b8; display: block; margin: 0 auto 1rem; }
.blog-empty__title { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0 0 0.5rem; }
.blog-empty__text { font-size: 0.9375rem; color: #64748b; margin: 0; max-width: 32rem; margin-inline: auto; line-height: 1.6; }
.blog-empty__code { font-size: 0.8125rem; background: #e2e8f0; padding: 0.1rem 0.35rem; border-radius: 0.25rem; }

.blog-article__meta { font-size: 0.875rem; color: #64748b; margin: 0 0 0.5rem; }
.blog-article__body {
    font-size: 1rem; line-height: 1.75; color: #334155;
}
.blog-article__body h2 {
    font-size: 1.25rem; font-weight: 700; color: #0f172a;
    margin: 2rem 0 0.75rem;
}
.blog-article__body h3 {
    font-size: 1.0625rem; font-weight: 700; color: #0f172a;
    margin: 1.5rem 0 0.5rem;
}
.blog-article__body p { margin: 0 0 1rem; }
.blog-article__body ul, .blog-article__body ol { margin: 0 0 1rem 1.25rem; }
.blog-article__body li { margin-bottom: 0.35rem; }
.blog-article__body a { color: var(--brand, #0d9488); font-weight: 500; text-decoration: underline; }
.blog-article__body a:hover { color: var(--brand-end, #0f766e); }
.blog-article__body img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1rem 0; }
.blog-article__footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #e2e8f0; }
.blog-article__back {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.9375rem; font-weight: 600; color: var(--brand, #0d9488); text-decoration: none;
}
.blog-article__back:hover { text-decoration: underline; }
.blog-article__back .material-symbols-outlined { font-size: 1.25rem; }
.faq-item__question { font-weight: 700; font-size: 1.0625rem; margin-bottom: 0.5rem; }
.faq-item__answer { color: var(--text-secondary); margin: 0; }

/* Forms */
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-label { display: flex; flex-direction: column; gap: 0.375rem; font-weight: 500; }
.form-input {
    padding: 0.625rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
}
.alert-success {
    padding: 0.75rem 1rem;
    background: #dcfce7;
    color: var(--status-on-time);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    background: var(--surface-muted);
    border-radius: var(--radius-card);
}

/* metro-status.com — live banner & train list */
.metro-live-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    margin-bottom: 0.75rem;
    background: #dcfce7;
    color: var(--status-on-time);
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
}
.metro-live-banner__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--status-on-time);
    animation: metro-pulse 1.5s ease-in-out infinite;
}
@keyframes metro-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.metro-status-hero .status-hero__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}
.metro-stat-icon { font-size: 1.5rem; }
.metro-stat-icon--running { color: var(--status-on-time); }
.metro-stat-icon--delayed { color: var(--status-delayed); }
.metro-stat-icon--stopped { color: var(--status-offline); }

.metro-legend {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
}
.metro-legend__title { font-weight: 600; margin-bottom: 0.5rem; }
.metro-legend__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    color: var(--text-secondary);
}
.metro-legend__list li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.metro-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 768px) {
    .metro-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .metro-search { flex: 0 1 320px; }
}

.metro-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.metro-pill {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: var(--surface);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.metro-pill:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.metro-pill--active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.metro-train-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.metro-train-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    background: var(--surface);
    border-radius: var(--radius-card);
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.metro-train-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}
.metro-train-card__body { flex: 1; min-width: 0; }
.metro-train-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}
.metro-train-card__meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.metro-train-card__delay { color: var(--status-delayed); font-weight: 600; }
.metro-train-card__arrow { color: #cbd5e1; flex-shrink: 0; }

.metro-empty-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
    background: var(--surface-muted);
    border-radius: var(--radius-card);
    margin-top: 0.5rem;
}
.metro-empty-search.hidden { display: none; }

.text-brand { color: var(--brand-primary); }

/* Route detail page */
.route-service-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.route-service-header__operator {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.route-service-header__updated { margin: 0; }

.route-status-counts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--surface);
    border-radius: var(--radius-card);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-card);
}
@media (max-width: 640px) {
    .route-status-counts { grid-template-columns: repeat(2, 1fr); }
}
.route-status-counts__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.route-status-counts__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}
.route-status-counts__label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.route-vehicle-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.route-train-card {
    list-style: none;
}
.route-train-card__link-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    background: var(--surface);
    border-radius: var(--radius-card);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.route-train-card__link-wrap:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}
.route-train-card__icon {
    color: var(--brand-primary);
    flex-shrink: 0;
    margin-top: 0.125rem;
}
.route-train-card__body { flex: 1; min-width: 0; }
.route-train-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--text-primary);
}
.route-train-card__meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.route-train-card__agency { font-weight: 600; }
.route-train-card__link {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 600;
}
.route-train-card__link:hover { text-decoration: underline; }
.route-train-card__speed {
    font-weight: 600;
    color: var(--text-primary);
}
.route-train-card__id {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
    font-family: ui-monospace, monospace;
}

.route-seo-doc {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}
.route-seo-doc__body {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9375rem;
}
.route-seo-doc__body p { margin: 0 0 1rem; }
.route-seo-doc__list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}
.route-seo-doc__list li { margin-bottom: 0.35rem; }
.route-seo-doc__note {
    font-size: 0.875rem;
    color: #64748b;
}
.route-seo-doc__note a {
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: none;
}
.route-seo-doc__note a:hover { text-decoration: underline; }

/* Train detail page — Pakistan Live Trains / metro-status.com UI */
.train-page {
    background: var(--surface-page);
    padding: 1.25rem 0 3rem;
}
.train-page__inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 640px) {
    .train-page__inner { padding: 0 1.5rem; }
}
@media (min-width: 1024px) {
    .train-page__inner { padding: 0 2rem; }
}

.train-breadcrumbs { margin-bottom: 1.25rem; }
.train-breadcrumbs .breadcrumbs__link,
.train-breadcrumbs .breadcrumbs__current {
    font-size: 0.875rem;
}

.train-hero-card {
    background: #0b1220;
    color: #fff;
    border-radius: 1rem;
    padding: 1.5rem 1.5rem 1.35rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 50px rgba(11, 18, 32, 0.35);
}
@media (min-width: 768px) {
    .train-hero-card { padding: 1.75rem 2rem 1.5rem; }
}
.train-hero-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.train-hero-card__live {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.7rem;
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.train-hero-card__live-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
    animation: metro-pulse 1.5s ease-in-out infinite;
}
.train-hero-card__code {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.02em;
}
.train-hero-card__body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 768px) {
    .train-hero-card__body {
        grid-template-columns: 1fr auto;
        align-items: start;
        gap: 2rem;
    }
}
.train-hero-card__title {
    font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem);
    font-weight: 800;
    margin: 0 0 0.5rem;
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.train-hero-card__route {
    font-size: 1.0625rem;
    color: rgba(248, 250, 252, 0.72);
    margin: 0;
    line-height: 1.45;
    max-width: 36rem;
}
.train-hero-card__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}
@media (min-width: 768px) {
    .train-hero-card__aside { align-items: flex-end; text-align: right; }
}
.train-hero-card__status {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1;
}
.train-hero-card__status--running {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(134, 239, 172, 0.25);
}
.train-hero-card__status--delayed {
    background: #fbbf24;
    color: #78350f;
    border: 1px solid #f59e0b;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.35);
}
.train-hero-card__status--stopped {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
    border: 1px solid rgba(203, 213, 225, 0.2);
}
.train-hero-card__updated {
    font-size: 0.8125rem;
    color: rgba(248, 250, 252, 0.5);
    margin: 0;
}
.train-hero-card__progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.62);
    margin-bottom: 0.55rem;
}
.train-hero-card__progress-bar {
    height: 0.45rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    overflow: hidden;
}
.train-hero-card__progress-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #4ade80);
    border-radius: 9999px;
    transition: width 0.45s ease;
}

.train-summary-section { margin-bottom: 2.5rem; }
.train-summary-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 1rem;
}
.train-summary-section__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}
.train-summary-section__hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}
.train-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
@media (max-width: 720px) {
    .train-summary-grid { grid-template-columns: 1fr; }
}
.train-summary-card {
    background: var(--surface);
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    padding: 1.25rem 1.35rem;
    min-height: 9.5rem;
    display: flex;
    flex-direction: column;
}
.train-summary-card__heading {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.5rem;
}
.train-summary-card__action {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0 0 0.35rem;
}
.train-summary-card__value {
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.train-summary-card__value--sm {
    font-size: 1.125rem;
    font-weight: 700;
}
.train-summary-card__value--muted {
    color: #94a3b8;
    font-size: 1.125rem;
    font-weight: 600;
}
.train-summary-card__value--delay {
    color: #d97706;
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
}
.train-summary-card__footnote {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: auto 0 0;
    padding-top: 0.65rem;
}
.train-summary-card__station-link {
    color: inherit;
    text-decoration: none;
}
.train-summary-card__station-link:hover { color: var(--brand-primary); }
.train-summary-card__eta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.65rem;
}
.train-summary-card__eta-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.train-eta-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.75rem;
    font-weight: 700;
}

.train-terminals-section { margin-bottom: 1rem; }
.train-terminals-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.train-terminals-section__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}
.train-terminals-section__hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}
.train-timetable-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 0.625rem;
    border: 1px solid #cbd5e1;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.65;
}
.train-timetable-btn .material-symbols-outlined { font-size: 1.125rem; }
.train-terminals-table-wrap {
    background: var(--surface);
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.train-terminals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}
.train-terminals-table th {
    text-align: left;
    padding: 0.9rem 1.25rem;
    background: #f8fafc;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
}
.train-terminals-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text-primary);
}
.train-terminals-table tr:last-child td { border-bottom: none; }
.train-terminals-table__station { font-weight: 600; }
.train-terminals-table__name { display: block; }
.train-terminals-table__crs {
    display: inline-block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.04em;
}
.train-terminals-table__delay {
    color: #d97706;
    font-weight: 700;
}
.train-terminals-table__ontime {
    color: #16a34a;
    font-weight: 600;
}
.train-terminals-table__empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2.5rem 1.25rem !important;
}

.prose-legal h2 { font-size: 1.25rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; color: #f8fafc; }
.prose-legal h3 { font-size: 1.1rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #f8fafc; }
.prose-legal p { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.6; }
.prose-legal ul { list-style-type: disc; margin-left: 1.5rem; margin-bottom: 1rem; color: var(--text-secondary); }
.prose-legal li { margin-bottom: 0.5rem; }
.prose-legal a { color: var(--brand-primary); text-decoration: underline; }
.prose-legal a:hover { color: var(--brand-light); }

/* Footer — metro-status.com inspired */
.site-footer {
    margin-top: auto;
    position: relative;
    overflow: hidden;
    color: #e2e8f0;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border-top: 4px solid var(--brand-primary);
}
.site-footer-glow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.site-footer-glow-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.15; }
.site-footer-glow-orb--brand { width: 300px; height: 300px; background: var(--brand-primary); top: -100px; left: 10%; }
.site-footer-glow-orb--green { width: 200px; height: 200px; background: var(--status-on-time); bottom: -50px; right: 20%; }
.site-footer-inner { padding: 3rem 0 1.5rem; }
.site-footer-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
@media (min-width: 768px) {
    .site-footer-main { grid-template-columns: 1.5fr 1fr; }
}
.site-footer-logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.site-footer-logo-icon {
    width: 2.5rem; height: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    display: flex; align-items: center; justify-content: center;
}
.site-footer-logo-title { font-weight: 700; display: block; }
.site-footer-logo-sub { font-size: 0.8125rem; color: #94a3b8; }
.site-footer-tagline { margin-top: 1rem; font-size: 0.875rem; color: #94a3b8; max-width: 28rem; }
.site-footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.site-footer-nav-heading { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 0.75rem; }
.site-footer-nav { list-style: none; padding: 0; margin: 0; }
.site-footer-nav li { margin-bottom: 0.5rem; }
.site-footer-link { color: #cbd5e1; text-decoration: none; font-size: 0.875rem; }
.site-footer-link:hover { color: #fff; }
.site-footer-copy { font-size: 0.8125rem; color: #64748b; border-top: 1px solid #374151; padding-top: 1.5rem; }

/* Route stop timeline styling */
.timeline-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: -0.25rem 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.timeline-hint::before {
    content: '👆';
    font-size: 0.875rem;
}

.timeline-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: 3.5rem;
}

/* ── Track: vertical line + numbered node ── */
.timeline-track {
    position: relative;
    width: 2.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 1rem;
}

/* vertical connecting line */
.timeline-track::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, var(--brand-primary, #0d9488) 0%, #94a3b8 100%);
    opacity: 0.3;
}
.timeline-item--first .timeline-track::before { top: 1rem; }
.timeline-item--last  .timeline-track::before { bottom: calc(100% - 2.25rem); }

.timeline-node {
    position: relative;
    z-index: 2;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--brand-primary, #0d9488);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--brand-primary, #0d9488), 0 2px 6px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.timeline-item:hover .timeline-node {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px var(--brand-primary, #0d9488), 0 4px 12px rgba(13,148,136,0.35);
}

.timeline-node__seq {
    font-size: 0.625rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.02em;
}

/* ── Card: the clickable stop row ── */
.timeline-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0 0.25rem 0.5rem;
    background: var(--surface, #fff);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    cursor: pointer;
}
.timeline-card:hover {
    border-color: var(--brand-primary, #0d9488);
    box-shadow: 0 4px 12px rgba(13,148,136,0.12);
    transform: translateX(4px);
    background: #f0fdfa;
}
.timeline-card:active {
    transform: translateX(2px) scale(0.995);
}

.timeline-card__icon {
    font-size: 1.25rem;
    color: var(--brand-primary, #0d9488);
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.timeline-card:hover .timeline-card__icon { opacity: 1; }

.timeline-card__body {
    flex: 1;
    min-width: 0;
}

.timeline-card__name {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.3;
    transition: color 0.15s;
}
.timeline-card:hover .timeline-card__name {
    color: var(--brand-primary, #0d9488);
}

.timeline-card__crs {
    display: inline-block;
    margin-top: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #f1f5f9;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}

.timeline-card__arrow {
    font-size: 1.25rem;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}
.timeline-card:hover .timeline-card__arrow {
    color: var(--brand-primary, #0d9488);
    transform: translateX(3px);
}

/* ── Live vehicle badges alongside stops ── */
.timeline-vehicles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.timeline-vehicle-badge {
    display: inline-flex;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
    50% { box-shadow: 0 1px 8px rgba(34,197,94,0.25); }
}

.timeline-vehicle-badge a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.timeline-vehicle-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background: var(--brand-primary, #0d9488);
    border-color: var(--brand-primary, #0d9488);
    color: #fff;
}

/* ── Responsive: stack card below track on tiny screens ── */
@media (max-width: 480px) {
    .timeline-card {
        padding: 0.625rem 0.75rem;
        margin-left: 0.25rem;
    }
    .timeline-card__name { font-size: 0.875rem; }
    .timeline-track { width: 2.25rem; }
}

/* ── Infinite Scroll Loader Spinner ── */
.infinite-scroll-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: var(--color-text-muted);
    width: 100%;
}
.infinite-scroll-loader__spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-brand);
    border-radius: 50%;
    animation: infinite-scroll-spin 0.8s linear infinite;
}
@keyframes infinite-scroll-spin {
    to { transform: rotate(360deg); }
}



