.timetable-instruction {
    margin-bottom: 20px;
}

/* Column 1: Trip ID */
.timetable th:nth-child(1),
.timetable td:nth-child(1) {
    width: 60px;
    font-size: 14px;
    text-align: left;
}

/* Column 2: Headsign */
.timetable th:nth-child(2),
.timetable td:nth-child(2) {
    width: 250px;
    font-weight: 600;
    font-size: 16px;
    text-align: left;
    color: var(--accent-colour);
}

/* Column 3: First Stop */
.timetable th:nth-child(3),
.timetable td:nth-child(3) {
    width: 300px;
    font-size: 16px;
    text-align: right;
}

/* Column 4: First Stop Time */
.timetable th:nth-child(4),
.timetable td:nth-child(4) {
    width: 50px;
    color: var(--accent-colour);
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

/* Column 5: Last Stop */
.timetable th:nth-child(5),
.timetable td:nth-child(5) {
    width: 300px;
    font-size: 16px;
    text-align: right;
}

/* Column 6: Last Stop Time */
.timetable th:nth-child(6),
.timetable td:nth-child(6) {
    width: 100px;
    color: var(--accent-colour);
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

/* Column 7: Total Journey Time */
.timetable th:nth-child(7),
.timetable td:nth-child(7) {
    width: 70px;
    font-size: 16px;
    text-align: right;
}

/* Sortable table headers */
.timetable thead th {
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background-color 0.2s ease;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.timetable thead th:hover {
    background-color: var(--radio-hover);
}

/* Sort direction indicators */
.timetable thead th::after {
    content: ' ⇅';
    font-size: 12px;
    opacity: 0.5;
    margin-left: 5px;
}

.timetable thead th.sort-asc::after {
    content: ' ↑';
}

.timetable thead th.sort-desc::after {
    content: ' ↓';
}

/* Mobile & Portrait Viewport Adjustments */
@media (orientation: portrait) {
    .timetable td:nth-child(2), .timetable td:nth-child(3), .timetable td:nth-child(4), .timetable td:nth-child(5), .timetable td:nth-child(6), .timetable td:nth-child(7) {
        font-size: 140%;
    }

    .timetable td:nth-child(1) {
        color: var(--text-secondary);
        writing-mode: vertical-lr;
        text-align: center;
        font-size: 20px;
    }

    .timetable-instruction {
        font-size: 150%;
    }
}
