h1:focus {
    outline: none;
}

.wb-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    /* Spacing & layout */
    --wb-space-1: 0.5rem;
    --wb-space-2: 0.75rem;
    --wb-space-3: 1rem;
    --wb-space-4: 1.5rem;
    --wb-space-5: 2rem;
    --wb-space-6: 3rem;
    --wb-radius-md: 1rem;
    --wb-radius-lg: 1.5rem;
    --wb-page-max-width: 70rem;
    --wb-route-fallback: #333333;

    /* App bar brand chip (white overlays — work on both teal and near-black appbar) */
    --wb-brand-chip-background: rgba(255, 255, 255, 0.08);
    --wb-brand-chip-border:     rgba(255, 255, 255, 0.15);
    --wb-brand-chip-hover:      rgba(255, 255, 255, 0.15);
    --wb-brand-mark-background: rgba(255, 255, 255, 0.18);

    /* Platform badge colours (8-slot rotating palette) */
    --wb-plat-bg-0: #AED6F1; --wb-plat-fg-0: #1A5276;
    --wb-plat-bg-1: #A9DFBF; --wb-plat-fg-1: #1E8449;
    --wb-plat-bg-2: #F9E79F; --wb-plat-fg-2: #7D6608;
    --wb-plat-bg-3: #F1948A; --wb-plat-fg-3: #78281F;
    --wb-plat-bg-4: #C39BD3; --wb-plat-fg-4: #6C3483;
    --wb-plat-bg-5: #76D7C4; --wb-plat-fg-5: #0E6655;
    --wb-plat-bg-6: #F0B27A; --wb-plat-fg-6: #784212;
    --wb-plat-bg-7: #BFC9CA; --wb-plat-fg-7: #2C3E50;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Inter", "Helvetica Neue", "Arial", sans-serif;
    background: linear-gradient(
        180deg,
        var(--mud-palette-background) 0%,
        var(--mud-palette-background-gray) 100%
    );
    color: var(--mud-palette-text-primary);
}

.mud-tooltip {
    max-width: min(22rem, 90vw);
    overflow-wrap: anywhere;
}

a {
    color: inherit;
}


.wb-page-shell {
    max-width: var(--wb-page-max-width);
    padding: clamp(var(--wb-space-4), 5vw, var(--wb-space-6)) clamp(var(--wb-space-3), 4vw, var(--wb-space-5));
}

.wb-full-width {
    width: 100%;
}

.wb-stack-tight {
    gap: var(--wb-space-2);
}

.wb-text-muted {
    color: var(--mud-palette-text-secondary);
}

.wb-block-spacing {
    margin-top: var(--wb-space-2);
}

.wb-page-title {
    letter-spacing: -0.02em;
}

.wb-page-subtitle {
    color: var(--mud-palette-text-secondary);
    max-width: 40rem;
}

.wb-surface {
    padding: clamp(var(--wb-space-3), 3vw, var(--wb-space-4));
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--wb-radius-lg);
    background: var(--mud-palette-surface);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
}

.wb-state {
    text-align: center;
}

.wb-search-results .wb-surface,
.wb-stop-metadata,
.wb-departure-card__content {
    width: 100%;
}

.wb-search-result__link {
    display: block;
    text-decoration: none;
    border-radius: var(--wb-radius-md);
    transition: background 0.15s;
}

.wb-search-result__link:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.05);
}

.wb-search-result__item {
    padding: var(--wb-space-2) var(--wb-space-3);
}

.wb-stop-metadata__row {
    flex-wrap: wrap;
}

.wb-route-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    box-sizing: border-box;
    min-width: 3.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    background: var(--wb-route-color, var(--wb-route-fallback));
    color: var(--wb-route-text-color, #fff);
    font-weight: 700;
}

.wb-route-badge-link {
    display: inline-flex;
    text-decoration: none;
}

.wb-route-badge-link:focus-visible .wb-route-badge {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.wb-route-header {
    display: flex;
    align-items: center;
    gap: var(--wb-space-2);
    flex-wrap: wrap;
}

.wb-route-header__meta {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.wb-route-header__long-name {
    line-height: 1.25;
}

.wb-route-header__id {
    color: var(--mud-palette-text-secondary);
}

.wb-route-meta__chips {
    flex-wrap: wrap;
}

.wb-route-meta__summary {
    color: var(--mud-palette-text-secondary);
}

.wb-route-meta__link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--mud-palette-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
}

.wb-route-meta__link:hover {
    text-decoration: underline;
}

.wb-route-meta__link:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.wb-route-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--wb-space-2);
}

.wb-route-controls__group {
    display: flex;
    align-items: center;
    gap: var(--wb-space-1);
    flex-wrap: wrap;
}

.wb-route-controls__group--date {
    margin-left: auto;
}

.wb-route-date-input {
    height: 2.25rem;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 0.5rem;
    padding: 0 0.6rem;
    background: var(--mud-palette-surface);
    color: inherit;
    font: inherit;
}

.wb-surface.wb-route-timetable-surface {
    padding: 0;
}

.wb-route-timetable__hint {
    display: block;
    padding: 0.55rem 0.75rem 0;
    color: var(--mud-palette-text-secondary);
}

.wb-route-timetable-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

.wb-route-timetable .mud-table-container {
    overflow: visible;
}

.wb-route-timetable .mud-table-root {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.wb-route-timetable .mud-table-root th,
.wb-route-timetable .mud-table-root td {
    border: 1px solid var(--mud-palette-divider);
    padding: 0.5rem 0.65rem;
    white-space: nowrap;
    text-align: center;
}

.wb-route-timetable .mud-table-root th {
    font-weight: 600;
}

.wb-route-timetable__stop-col,
.wb-route-timetable__stop-name {
    position: sticky;
    left: 0;
    z-index: 1;
    text-align: left !important;
    background: var(--mud-palette-surface);
    min-width: 14rem;
}

.wb-route-timetable__stop-col {
    z-index: 2;
}

.wb-route-timetable__stop-link {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: inherit;
    text-decoration: none;
}

.wb-route-timetable__stop-link:hover {
    text-decoration: underline;
}

.wb-route-timetable__trip-col {
    color: var(--mud-palette-text-secondary);
    font-size: 0.8rem;
    min-width: 4.25rem;
}

.wb-route-timetable__time {
    font-variant-numeric: tabular-nums;
}

.wb-surface.wb-departure-table {
    padding: 0;
    overflow: hidden;
}

.wb-dt-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: transparent;
}

.wb-dt-board {
    position: relative;
    z-index: 1060;
}

/* Route filter */
.wb-dt-route-filter-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

/* Route filter chips */
.wb-dt-route-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.5rem 0;
    align-items: center;
}

.wb-route-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    border: 2px solid var(--wb-route-color);
    background-color: var(--wb-route-color);
    color: var(--wb-route-text-color);
    cursor: pointer;
    transition: opacity 0.15s ease, filter 0.15s ease;
    min-width: 2rem;
    text-align: center;
}

.wb-route-filter-chip:hover {
    filter: brightness(1.1);
}

.wb-route-filter-chip--dimmed {
    background-color: transparent;
    color: var(--wb-route-color);
    opacity: 0.5;
}

.wb-route-filter-chip--dimmed:hover {
    opacity: 0.75;
}

.wb-route-filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.wb-route-filter-clear:hover {
    opacity: 1;
}

.wb-route-filter-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px dashed var(--mud-palette-text-secondary);
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease;
    min-width: 2rem;
}

.wb-route-filter-expand:hover {
    opacity: 1;
}

.wb-dt-table {
    width: 100%;
    overflow-x: hidden;
}

.wb-dt-table table {
    table-layout: fixed;
    width: 100%;
}

.wb-dt-table .mud-table-cell {
    padding: 0.4rem 0.5rem !important;
    vertical-align: middle;
}

.wb-dt-table .mud-table-head .mud-table-cell {
    color: var(--mud-palette-text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.wb-dt-header-indicator { width: 1.6rem; }
.wb-dt-header-route     { width: 5rem; }
/* .wb-dt-header-destination — no width; takes remaining space */
.wb-dt-header-sched     { width: 3.75rem; }
.wb-dt-header-eta       { width: 3.5rem; }
.wb-dt-header-status    { width: 5.5rem; }

.wb-dt-header-indicator,
.wb-dt-cell-indicator {
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
}

.wb-dt-header-route,
.wb-dt-cell-route {
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
}

.wb-dt-table .wb-dt-col-sched {
    display: none !important;
}

.wb-dt-source-indicator {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    display: inline-block;
    flex: none;
}

.wb-dt-source-indicator--live {
    background: var(--mud-palette-success);
}

.wb-dt-source-indicator--added {
    background: var(--mud-palette-info);
}

.wb-dt-cell-dest {
    width: 100%;
    min-width: 0;
    text-align: left;
}

.wb-dt-popover-anchor {
    display: block;
    position: relative;
    width: 100%;
    min-width: 0;
}

.wb-dt-popover-anchor--eta {
    display: inline-flex;
    justify-content: flex-end;
    width: 100%;
}

.wb-dt-popover-anchor--status {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.wb-dt-dest-button,
.wb-dt-eta-button,
.wb-dt-status-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
}

.wb-dt-dest-button:disabled,
.wb-dt-eta-button:disabled,
.wb-dt-status-button:disabled {
    cursor: default;
    opacity: 1;
}

.wb-dt-dest-button {
    display: block;
    width: 100%;
    min-width: 0;
    text-align: left;
}

.wb-dt-status-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}


.wb-dt-popover__content {
    padding: 0.55rem 0.7rem;
}

.wb-dt-popover__content--dest {
    display: inline-block;
    width: max-content;
    max-width: min(18rem, calc(100vw - 2rem));
}

.wb-dt-popover__content--eta {
    white-space: nowrap;
}

.wb-dt-popover__content--status {
    white-space: nowrap;
}

.wb-dt-dest-name {
    display: block;
    font-size: 0.875rem;
    line-height: 1.2;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.wb-dt-cell-sched,
.wb-dt-cell-eta {
    text-align: right;
    white-space: nowrap;
}

.wb-dt-cell-status {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.wb-dt-header-sched,
.wb-dt-header-eta {
    text-align: left;
    white-space: nowrap;
}

.wb-dt-header-route,
.wb-dt-header-status {
    text-align: center;
    white-space: nowrap;
}

.wb-dt-eta {
    font-size: 0.875rem;
    line-height: 1.1;
    font-weight: 700;
    white-space: nowrap;
}

.wb-dt-status-chip {
    display: inline-flex;
    max-width: 100%;
}

.wb-chip-center .mud-chip-content {
    justify-content: center;
    width: 100%;
    text-align: center;
}

.wb-status-chip {
    min-width: 0;
}

/* Non-default, non-dark status chips: deep semantic backgrounds take white text */
html[data-theme=dark] .wb-status-chip.mud-chip:not(.mud-chip-color-default):not(.mud-chip-color-dark),
html[data-theme=dark] .wb-route-line__status-chip.mud-chip:not(.mud-chip-color-default):not(.mud-chip-color-dark) {
    color: #ffffff !important;
}

/* Dark chip: #9CA3AF medium grey background needs dark text */
html[data-theme=dark] .wb-status-chip.mud-chip-color-dark,
html[data-theme=dark] .wb-route-line__status-chip.mud-chip-color-dark {
    color: #1a1a1a !important;
}

.wb-dt-table .mud-chip {
    margin: 0;
    max-width: 100%;
}

/* Status text: show full by default, short on mobile (toggled by media query) */
.wb-status-short { display: none; }

.wb-dt-status-chip-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.wb-dt-status-chip-wrap > .mud-chip-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.wb-dt-status-chip.wb-status-chip {
    margin-inline: auto;
}

.wb-last-updated {
    display: block;
    margin-top: var(--wb-space-2);
    padding-inline: var(--wb-space-1);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}



@media (max-width: 959.98px) {
    .wb-page-shell {
        padding-top: var(--wb-space-4);
    }

    .wb-route-controls__group--date {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 0.35rem;
    }

    .wb-route-controls__group--date .mud-button-root {
        min-width: 0;
        padding-inline: 0.45rem;
    }

    .wb-route-date-input {
        flex: 1 1 auto;
        min-width: 0;
    }

    .wb-route-timetable__stop-col,
    .wb-route-timetable__stop-name {
        min-width: 8rem;
        max-width: 8rem;
    }

    .wb-route-timetable__stop-name {
        vertical-align: top;
    }

    .wb-route-timetable__stop-link {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.2;
        word-break: break-word;
    }

    .wb-route-timetable .mud-table-root th,
    .wb-route-timetable .mud-table-root td {
        padding: 0.35rem 0.45rem;
        font-size: 0.78rem;
    }
}

/* ========== Service Alerts ========== */
.wb-service-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wb-service-alerts__item {
    border-radius: 8px !important;
}

.wb-service-alerts__content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wb-service-alerts__header {
    font-weight: 600;
}

.wb-service-alerts__description {
    opacity: 1;
}

.wb-service-alerts__details {
    width: 100%;
}

.wb-service-alerts__details > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.wb-service-alerts__details > summary::-webkit-details-marker {
    display: none;
}

.wb-service-alerts__details > summary::after {
    content: '▸';
    font-size: 0.75rem;
    opacity: 0.5;
    margin-left: 0.25rem;
    transition: transform 0.15s ease;
}

.wb-service-alerts__details[open] > summary::after {
    transform: rotate(90deg);
}

.wb-service-alerts__body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.375rem;
}

/* Alert entity chips (affected routes/stops) */
.wb-alert-entities {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding-top: 0.5rem;
    margin-top: 0.375rem;
    border-top: 1px solid var(--mud-palette-divider);
}

.wb-alert-entities__row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.25rem;
}

.wb-alert-entities__icon {
    color: var(--mud-palette-text-secondary);
    opacity: 0.6;
    padding-top: 0.0625rem;
}

.wb-alert-entities__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.wb-alert-entity-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.0625rem 0.375rem;
    border-radius: 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.4;
    border: 1.5px solid var(--wb-route-color);
    background-color: var(--wb-route-color);
    color: var(--wb-route-text-color);
    text-decoration: none;
    transition: filter 0.15s ease;
    min-width: 1.75rem;
    text-align: center;
}

.wb-alert-entity-chip:hover {
    filter: brightness(1.15);
    text-decoration: none;
}

.wb-alert-entity-stop {
    display: inline-flex;
    align-items: center;
    padding: 0.0625rem 0.375rem;
    border-radius: 0.625rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.4;
    border: 1.5px solid var(--mud-palette-lines-default);
    background: transparent;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.wb-alert-entity-stop:hover {
    background-color: var(--mud-palette-background-hover);
    text-decoration: none;
}

.wb-alert-entity-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.0625rem 0.375rem;
    border-radius: 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border: 1.5px dashed var(--mud-palette-text-secondary);
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease;
    min-width: 1.75rem;
}

.wb-alert-entity-expand:hover {
    opacity: 1;
}

@media (max-width: 959.98px) {
    .wb-route-timetable__trip-col {
        min-width: 3.5rem;
        font-size: 0.72rem;
    }

    /* Hide indicator column — rarely populated, saves ~2.6rem on narrow screens */
    .wb-dt-header-indicator,
    .wb-dt-cell-indicator {
        display: none !important;
    }

    /* Tighter cell padding on mobile */
    .wb-dt-table .mud-table-cell {
        padding: 0.3rem 0.3rem !important;
    }

    /* Column width overrides for mobile */
    .wb-dt-header-route    { width: 3.8rem; }
    .wb-dt-header-platform { width: 2.8rem; }
    .wb-dt-header-eta      { width: 3.5rem; }
    .wb-dt-header-status   { width: 4.5rem; }

    /* Compact route badge on mobile */
    .wb-route-badge {
        min-width: 2.75rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.82rem;
    }

    /* Compact status chip on mobile — smaller font + tighter padding */
    .wb-dt-table .wb-status-chip.mud-chip {
        font-size: 0.68rem !important;
        padding: 0 6px !important;
        height: 20px !important;
    }

    /* Show abbreviated status text on mobile */
    .wb-status-full { display: none; }
    .wb-status-short { display: inline; }

    .wb-dt-header-destination {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .wb-dt-popover__content--dest {
        max-width: min(24rem, calc(100vw - 2rem));
        white-space: nowrap;
    }
}

@media (min-width: 960px) {
    .wb-dt-table .wb-dt-col-sched {
        display: table-cell !important;
    }
}

/* ── Platform column ─────────────────────────────────────────── */
.wb-dt-header-platform {
    text-align: center;
    font-size: 0.75rem;
    width: 3.4rem;
}

.wb-dt-cell-platform {
    text-align: center;
    padding: 0.15rem 0.25rem !important;
}


.wb-platform-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 0 0.5rem;
    height: 24px;
    min-width: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
}

/* ── Platforms section ───────────────────────────────────────── */
.wb-platforms__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem 0.5rem;
}

.wb-platforms__header-icon {
    color: var(--mud-palette-primary);
}

.wb-platforms__header-text {
    font-weight: 600;
}

.wb-platforms__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: inherit;
}

.wb-platforms__link:hover {
    background: var(--mud-palette-action-default-hover);
}

.wb-platforms__name {
    flex: 1;
    font-size: 0.875rem;
}

.wb-platforms__chevron {
    color: var(--mud-palette-text-secondary);
    flex-shrink: 0;
}

/* ========== Live Services ========== */

.wb-route-tab-panel {
    padding-top: 1rem;
}

.wb-live-services {
    gap: 0.5rem;
}

.wb-live-services__refresh-hint {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.7;
    padding: 0.5rem 0;
}

.wb-live-services__refresh-icon {
    vertical-align: middle;
}

/* Route line visualization */
.wb-route-line {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
}

.wb-route-line__stop {
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    position: relative;
}

.wb-route-line__stop-track {
    width: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    align-self: stretch;
}

.wb-route-line__stop-track::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: var(--mud-palette-primary);
    transform: translateX(-50%);
}

.wb-route-line__stop--first .wb-route-line__stop-track::before {
    top: 50%;
}

.wb-route-line__stop--last .wb-route-line__stop-track::before {
    bottom: 50%;
}

.wb-route-line__stop-node {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--mud-palette-surface);
    border: 3px solid var(--mud-palette-primary);
    z-index: 1;
}

.wb-route-line__stop--first .wb-route-line__stop-node,
.wb-route-line__stop--last .wb-route-line__stop-node {
    width: 18px;
    height: 18px;
    border-width: 4px;
}

.wb-route-line__stop-label {
    padding: 0.25rem 0 0.25rem 0.5rem;
    flex: 1;
    min-width: 0;
}

.wb-route-line__stop-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
}

.wb-route-line__stop-name a {
    color: inherit;
    text-decoration: none;
}

.wb-route-line__stop-name a:hover {
    text-decoration: underline;
}

.wb-route-line__stop--first .wb-route-line__stop-name,
.wb-route-line__stop--last .wb-route-line__stop-name {
    font-weight: 700;
}

/* Vehicle markers on the route line */
.wb-route-line__vehicle {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    position: relative;
    padding: 0.25rem 0;
}

.wb-route-line__vehicle-track {
    width: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    align-self: stretch;
}

.wb-route-line__vehicle-track::before {
    content: '';
    position: absolute;
    top: -0.25rem;
    bottom: -0.25rem;
    left: 50%;
    width: 3px;
    background: var(--mud-palette-primary);
    transform: translateX(-50%);
}

.wb-route-line__vehicle-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


.wb-route-line__vehicle--delayed .wb-route-line__vehicle-marker {
    background: var(--mud-palette-warning);
    color: var(--mud-palette-warning-text);
}

.wb-route-line__vehicle--early .wb-route-line__vehicle-marker {
    background: var(--mud-palette-info);
    color: var(--mud-palette-info-text);
}

.wb-route-line__vehicle--cancelled .wb-route-line__vehicle-marker {
    background: var(--mud-palette-error);
    color: var(--mud-palette-error-text);
}

.wb-route-line__vehicle--added .wb-route-line__vehicle-marker {
    background: var(--mud-palette-tertiary);
    color: var(--mud-palette-tertiary-text);
}

.wb-route-line__vehicle-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.5rem;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.wb-route-line__status-chip {
    font-size: 0.7rem;
    height: 1.5rem !important;
}

.wb-route-line__vehicle-headsign {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-route-line__vehicle-eta {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.8;
}

.wb-route-line__vehicle-consist {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    opacity: 0.6;
    background: var(--mud-palette-background-grey);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

/* Vehicle button (tappable area for popover) */
.wb-route-line__vehicle-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
    flex-wrap: wrap;
    min-width: 0;
    position: relative;
    z-index: 1060;
}

.wb-route-line__vehicle-button:hover {
    background: var(--mud-palette-action-default-hover);
}

/* Pulse animation for moving vehicles */
.wb-route-line__vehicle-marker--moving {
    animation: wb-vehicle-pulse 2s ease-in-out infinite;
}

@keyframes wb-vehicle-pulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Popover */
.wb-route-line__popover {
    z-index: 1300;
}

.wb-route-line__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: transparent;
}

/* Unpositioned vehicles (scheduled-only or no NextStopSequence) */
.wb-route-line__vehicle--unpositioned .wb-route-line__vehicle-track::before {
    border-left: 3px dashed var(--mud-palette-text-disabled);
    background: none;
    width: 0;
}

.wb-route-line__vehicle--unpositioned .wb-route-line__vehicle-marker {
    opacity: 0.5;
}

@media (max-width: 600px) {
    .wb-route-line__vehicle-info {
        gap: 0.25rem;
    }

    .wb-route-line__vehicle-headsign {
        font-size: 0.75rem;
    }
}

html[data-theme=dark] {
    color-scheme: dark;
    --wb-route-fallback: #D7DDE4;

    /* Platform badge colours – dark mode */
    --wb-plat-bg-0: #1A3A4F; --wb-plat-fg-0: #8EC3E8;
    --wb-plat-bg-1: #1A3A2A; --wb-plat-fg-1: #8ED4A8;
    --wb-plat-bg-2: #3A3520; --wb-plat-fg-2: #E8D580;
    --wb-plat-bg-3: #3F1F1C; --wb-plat-fg-3: #E8847A;
    --wb-plat-bg-4: #2F1F3F; --wb-plat-fg-4: #B88FCC;
    --wb-plat-bg-5: #1A3530; --wb-plat-fg-5: #6BC7B4;
    --wb-plat-bg-6: #3A2A18; --wb-plat-fg-6: #E8A468;
    --wb-plat-bg-7: #252D33; --wb-plat-fg-7: #A8B5BD;
}
