/* ======= Timetable page ======= */
.tt-page {
    width: 100%;
}

.tt-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.tt-seg {
    display: flex;
    border: 2px solid #c8d0de;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.tt-seg-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    background: none;
    border: none;
    border-right: 2px solid #c8d0de;
    cursor: pointer;
    font-size: 0.94rem;
    color: #1b1b1b;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s;
    line-height: 1.3;
}

.tt-seg-btn:last-child {
    border-right: none;
}

.tt-seg-btn:hover {
    background: var(--global--color-the-airline-grey-blue);
}

.tt-seg-btn.is-active {
    background: var(--global--color-the-airline-blue);
    color: #fff;
}

.tt-seg-btn.is-active .tt-route-dot::before,
.tt-seg-btn.is-active .tt-route-dot::after {
    background: #fff;
}

.tt-seg-btn.is-active .tt-route-dot__line {
    background: rgba(255, 255, 255, 0.6);
}

/* Route dot icon */
.tt-route-dot {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 10px;
}

.tt-route-dot::before,
.tt-route-dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--global--color-the-airline-blue);
}

.tt-route-dot__line {
    width: 2px;
    height: 8px;
    background: var(--global--color-the-airline-blue);
}

/* Date controls */
.tt-date-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid #c8d0de;
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    background: #fff;
}

#tt-date {
    border: none;
    outline: none;
    font-size: 0.96rem;
    font-family: inherit;
    color: #1b1b1b;
    background: transparent;
    cursor: pointer;
}

.tt-update-btn {
    background: #e8798c;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.45rem 1rem;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.tt-update-btn:hover {
    background: #d4607a;
}

/* Table wrapper — full-width horizontal scroll */
.tt-wrap {
    width: min(1320px, calc(100vw - 2rem));
    margin-left: 50%;
    transform: translateX(-50%);
    overflow-x: auto;
    border: 1px solid #d7ddea;
    border-radius: 6px;
    background: #fff;
    min-height: 120px;
}

.tt-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: 0.9rem;
}

/* Sticky first column */
.tt-table th.tt-stop-col,
.tt-table td.tt-stop-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: inherit;
    min-width: 360px;
    max-width: 360px;
    white-space: normal;
    overflow: visible;
    text-align: left;
    padding: 0.55rem 0.85rem;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: anywhere;
}

.tt-table thead tr {
    background: var(--global--color-the-airline-blue);
    color: #fff;
}

.tt-table thead th.tt-stop-col {
    background: var(--global--color-the-airline-blue);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.tt-table thead th {
    padding: 0.55rem 0.65rem;
    text-align: center;
    font-weight: 700;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

/* Journey header badges */
.tt-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.tt-badge--lhr {
    background: #0072BC;
    color: #fff;
}

.tt-badge--lgw {
    background: #00377B;
    color: #fff;
}

.tt-badge--oxf {
    background: #5DA9DD;
    color: #fff;
}

.tt-badge--other {
    background: #888;
    color: #fff;
}

/* Body rows */
.tt-table tbody tr {
    background: #fff;
}

.tt-table tbody tr:nth-child(even) {
    background: #f2f6fb;
}

.tt-table tbody tr:hover {
    background: #eaf3ff;
}

.tt-table tbody td.tt-stop-col {
    font-weight: 600;
    color: #1b1b1b;
    border-right: 2px solid #d7ddea;
    border-bottom: 1px solid #d6dde8;
}

.tt-table tbody tr:nth-child(even) td.tt-stop-col {
    background: #f2f6fb;
}

.tt-table tbody tr:hover td.tt-stop-col {
    background: #eaf3ff;
}

.tt-timing-row td.tt-stop-col {
    font-weight: 700;
    box-shadow: inset 4px 0 0 var(--global--color-the-airline-light-blue);
}

.tt-table tbody td {
    padding: 0.5rem 0.65rem;
    text-align: center;
    border-right: 1px solid #e8ecf2;
    border-bottom: 1px solid #dfe5ef;
    color: #1b1b1b;
    white-space: nowrap;
}

.tt-table tbody td.tt-time--none {
    color: #b0b8c8;
}

.tt-table tbody td.tt-time--timing {
    font-weight: 700;
}

/* State messages */
.tt-status {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
}

/* Footer note */
.tt-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
    max-width: 900px;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .tt-wrap {
        width: calc(100vw - 1.25rem);
    }

    .tt-table th.tt-stop-col,
    .tt-table td.tt-stop-col {
        min-width: 260px;
        max-width: 260px;
    }
}

/* Stop links use the same styling as the stop names */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}