.tt-result {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    margin-top: 6px;
    border: 0;
    border-radius: 18px;
    background: #f4f6f8;
    color: #000;
    font-weight: 500;
}

.tt-result:hover,
.tt-result:focus {
    background: #e6ebf0;
}

.tt-card {
    background: #fff;
    border-radius: 34px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.tt-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.05);
}

.tt-badge {
    flex: none;
    min-width: 52px;
    padding: 8px 10px;
    border-radius: 10px;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.tt-badge-generic {
    background: #607d96;
    color: #fff;
}

.tt-dest {
    font-weight: 700;
    color: #555;
}

.tt-times {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 12px;
    padding: 18px 8px 6px;
}

.tt-time {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tt-mins {
    font-weight: 800;
    font-size: 1.5rem;
    color: #000;
}

.tt-mins small {
    font-size: 0.65em;
    font-weight: 700;
}

.tt-train {
    color: #000;
    font-size: 1.6rem;
}

.tt-none,
.tt-meta {
    color: #777;
    font-size: 0.85em;
}

.tt-meta {
    margin: 4px 0 16px;
}

body.dark-mode .tt-result {
    background: #3a3330;
    color: #fff;
}

body.dark-mode .tt-result:hover,
body.dark-mode .tt-result:focus {
    background: #4a423e;
}

body.dark-mode .tt-card {
    background: #3F3835;
    border: 1px solid #2b2b2b33;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.233), 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .tt-head {
    background: rgba(255, 255, 255, 0.07);
}

body.dark-mode .tt-dest {
    color: #ddd;
}

body.dark-mode .tt-mins {
    color: #fff;
}

body.dark-mode .tt-none,
body.dark-mode .tt-meta {
    color: #bbb;
}

body.dark-mode .tt-train {
    color: #fff;
}

.tt-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tt-top-text {
    min-width: 0;
    flex: 1 1 200px;
}

.tt-filter {
    display: flex;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tt-filter::-webkit-scrollbar {
    display: none;
}

.tt-chip {
    flex: none;
    border: 2px solid var(--chip, #607d96);
    background: transparent;
    color: var(--chip, #607d96);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.tt-chip.active {
    background: var(--chip, #607d96);
    color: var(--chip-fg, #fff);
}

/* Desktop: tabs sit on the right, beside the button */

.tt-head {
    cursor: pointer;
}

.tt-dest {
    flex: 1 1 auto;
    min-width: 0;
}

.tt-next-hint {
    display: none;
    font-weight: 700;
    font-size: 0.85rem;
    color: #777;
    white-space: nowrap;
}

.tt-chevron {
    flex: none;
    color: #000;
    transition: transform 0.2s ease;
}

body.dark-mode .tt-chevron {
    color: #fff;
}

.tt-card.collapsed .tt-times {
    display: none;
}

.tt-card.collapsed .tt-next-hint {
    display: inline;
}

.tt-card.collapsed .tt-chevron {
    transform: rotate(-90deg);
}

body.dark-mode .tt-next-hint {
    color: #bbb;
}

.tt-fl-btn {
    order: 2;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: #555;
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
    border: 1px solid #cccccc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tt-fl-btn:hover,
.tt-fl-btn:focus {
    color: #fff;
    opacity: 0.9;
    text-decoration: none;
}

.tt-filter {
    order: 1;
}

/* Mobile: title on its own row; line tabs (scrollable) and the button share the next row, button on the right */
@media (max-width: 575px) {
    .tt-top-text {
        flex: 1 1 100%;
    }

    .tt-filter {
        flex: 1 1 0;
        min-width: 0;
    }

    .tt-fl-btn {
        margin-left: auto;
    }
}

body.dark-mode .tt-fl-btn {
    background: #f0d1a9;
    color: #2b2220;
    border: 1px solid #2b2b2b33;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.233), 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .tt-fl-btn:hover,
body.dark-mode .tt-fl-btn:focus {
    color: #2b2220;
    background: #af8e63;
}

.tt-mins.tt-arr,
.tt-next-hint.tt-arr,
body.dark-mode .tt-mins.tt-arr,
body.dark-mode .tt-next-hint.tt-arr {
    color: #f5a623;
}

.tt-banner {
    border-radius: 22px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #000;
    background: #ffb300;
}

.tt-banner[hidden] {
    display: none;
}

.tt-banner-major {
    background: #e53935;
    color: #fff;
}

.tt-banner-title {
    font-weight: 800;
    margin-bottom: 6px;
}

.tt-banner-msg {
    margin-top: 6px;
    white-space: pre-line;
    word-break: break-word;
}

.tt-flag {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ffb300;
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.tt-card.tt-disrupted .tt-times {
    opacity: 0.45;
    filter: grayscale(1);
}

.tt-card.tt-disrupted .tt-next-hint {
    opacity: 0.6;
    text-decoration: line-through;
}

.tt-caplets {
    display: inline-flex;
    margin-right: 6px;
    vertical-align: middle;
}

.tt-result {
    display: flex;
    align-items: center;
}
/* Mobile: caplet on its own line, station name underneath */
@media (max-width: 575px) {
    #stationTitle .tt-caplets {
        display: flex;
        width: fit-content;
        margin: 0 0 8px;
    }

    #stationTitle .tt-name {
        display: block;
    }
}

/* Mobile: tighter cards so the destination keeps room on one line */
@media (max-width: 575px) {
    .tt-card {
        padding: 10px;
        border-radius: 28px;
    }

    .tt-head {
        flex-wrap: wrap;
        gap: 6px 10px;
        padding: 10px 14px;
        border-radius: 20px;
    }

    .tt-badge {
        min-width: 46px;
        padding: 6px 8px;
        font-size: 1rem;
    }

    .tt-dest {
        flex: 1 1 0;
        min-width: 0;
        font-size: 0.95rem;
        line-height: 1.25;
    }

    .tt-dest .fa-circle-arrow-right {
        margin-right: 4px;
    }

    .tt-next-hint {
        flex: none;
        font-size: 0.8rem;
    }

    .tt-times {
        padding: 14px 4px 4px;
    }

    .tt-mins {
        font-size: 1.25rem;
    }

    .tt-time {
        gap: 8px;
    }

    .tt-train {
        font-size: 1.3rem;
    }
}

/* Toolbar above the station card: line tabs plus the First & Last button, button always on the right */
.tt-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.tt-toolbar[hidden] {
    display: none;
}

.tt-toolbar .tt-filter {
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
}

.tt-toolbar .tt-fl-btn {
    order: 2;
    margin-left: 0;
}

@media (max-width: 575px) {
    .tt-toolbar .tt-filter {
        flex: 1 1 0;
    }

    .tt-toolbar .tt-fl-btn {
        margin-left: auto;
    }
}

/* Image caplet badge */
.tt-badge.tt-badge-img {
    min-width: 0;
    padding: 0;
    height: 30px;
    width: auto;
    border-radius: 0;
    background: none;
}


/* Beta notice icon */
.tt-title-row { position: relative; z-index: 1100; display: flex; align-items: center; gap: 10px; }
.tt-title-row .page-title { margin: 0; }
.tt-beta { position: relative; display: inline-flex; align-items: center; font-size: 1.25rem; opacity: 0.7; cursor: help; outline: none; }
.tt-beta:hover, .tt-beta:focus { opacity: 1; }
.tt-beta::after { content: attr(data-tip); position: absolute; top: 50%; left: calc(100% + 10px); width: max-content; max-width: clamp(140px, calc(100vw - 270px), 260px); padding: 8px 12px; border-radius: 10px; background: #2a2420; color: #f0d1a9; border: 1px solid #574c47; font-size: 0.8rem; font-weight: 500; line-height: 1.35; box-shadow: 0 6px 18px rgba(0,0,0,0.3); opacity: 0; visibility: hidden; transform: translate(-4px, -50%); transition: opacity .15s, transform .15s, visibility .15s; z-index: 50; pointer-events: none; }
.tt-beta:hover::after, .tt-beta:focus::after { opacity: 1; visibility: visible; transform: translate(0, -50%); }
@media (max-width: 600px) {
  .tt-beta { position: static; }
  .tt-beta::after { top: calc(100% + 6px); left: 0; right: 0; width: auto; max-width: none; transform: translateY(-4px); }
  .tt-beta:hover::after, .tt-beta:focus::after { transform: none; }
}
