html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overflow: auto !important;
}

body {
    min-height: 100vh;
    position: static;
    overscroll-behavior-y: auto;
}

.terminal-connections-section {
    min-width: 0;
    min-height: 0;
    height: auto;
    margin: 0;
    color: #fff;
    overflow: visible;
}

.route-hub {
    width: min(100%, 860px);
    height: auto;
    min-height: 0;
    padding: 22px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #061d31, #0a4565);
    box-shadow: 0 18px 36px rgba(7,29,50,.16);
    overflow: visible;
}

.route-hub-heading { margin-bottom: 16px; }
.route-hub .section-kicker { color: #f4b63b; }
.route-hub-heading h2 { margin: 7px 0; color: #fff; font-size: 1.55rem; line-height: 1.15; }
.route-hub-heading p { max-width: 540px; margin: 0; color: rgba(255,255,255,.76); font-size: .82rem; line-height: 1.5; }
.route-options { display: grid; grid-template-columns: 1fr; gap: 8px; }
.route-option { display: grid; grid-template-columns: 34px minmax(0,1fr) max-content; align-items: center; gap: 2px 9px; width: 100%; min-width: 0; padding: 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 11px; color: #fff; background: rgba(255,255,255,.07); text-align: left; font: inherit; cursor: pointer; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.route-option:hover,
.route-option:focus-visible { transform: translateY(-1px); border-color: rgba(244,182,59,.62); background: rgba(255,255,255,.12); }
.route-option-icon { display: grid; grid-row: 1 / span 2; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #f4b63b; background: rgba(255,255,255,.1); }
.route-option-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.route-option-copy { display: grid; min-width: 0; gap: 2px; }
.route-option-title { overflow-wrap: anywhere; color: #fff; font-size: .72rem; font-weight: 900; line-height: 1.35; }
.route-option-bus { color: rgba(255,255,255,.72); font-size: .68rem; line-height: 1.3; }
.route-toggle-label { grid-column: 3; grid-row: 1 / span 2; padding: 8px 9px; border-radius: 7px; color: #071d32; background: #f4b63b; font-size: .68rem; font-weight: 900; white-space: nowrap; }
.route-option:hover .route-toggle-label,
.route-option:focus-visible .route-toggle-label { background: #ffd36d; }

.route-dialog { position: fixed; inset: 50% auto auto 50%; width: min(620px, calc(100vw - 32px)); max-width: 620px; max-height: min(82vh,760px); margin: 0; padding: 22px; overflow: auto; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,.16); border-radius: 18px; color: #fff; background: linear-gradient(145deg,#071d32,#0a4565); box-shadow: 0 28px 80px rgba(0,0,0,.42); }
.route-dialog::backdrop { background: rgba(3,14,24,.72); backdrop-filter: blur(4px); }
.route-dialog .route-detail-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; padding-right: 42px; }
.route-dialog .route-detail-heading h3 { margin: 0; color: #fff; font-size: 1.05rem; }
.route-dialog-close { position: absolute; top: 14px; right: 14px; display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #fff; background: rgba(255,255,255,.08); font: 1.4rem/1 Arial,sans-serif; cursor: pointer; }
.route-dialog-close:hover,
.route-dialog-close:focus-visible { color: #071d32; background: #f4b63b; }
.route-bus-label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(244,182,59,.4); border-radius: 999px; color: #f4b63b; background: rgba(244,182,59,.1); font-size: .75rem; font-weight: 800; }
.route-bus-label svg,
.route-stop-marker svg,
.route-map-link svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.route-map-link { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 10px; border: 1px solid rgba(244,182,59,.45); border-radius: 8px; color: #f4b63b; font-size: .75rem; font-weight: 800; text-decoration: none; transition: background .2s ease, transform .2s ease; }
.route-map-link:hover,
.route-map-link:focus-visible { transform: translateY(-1px); background: rgba(244,182,59,.12); }
.route-map-link[hidden] { display: none; }
.route-transport-tabs,
.route-direction-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px;
}
.route-transport-tab,
.route-direction-tab {
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.82);
    padding: 8px 12px;
    font-size: .74rem;
    font-weight: 800;
    cursor: pointer;
}
.route-transport-tab.is-active,
.route-direction-tab.is-active {
    background: #f4b63b;
    border-color: #f4b63b;
    color: #071d32;
}
.route-timeline {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.route-stop {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-height: 34px;
    padding: 4px 0;
    color: rgba(255,255,255,.82);
    font-size: .86rem;
    line-height: 1.5;
    width: 100%;
}
.route-stop:not(:last-child)::before {
    position: absolute;
    top: 23px;
    bottom: -11px;
    left: 9px;
    width: 1px;
    background: rgba(244,182,59,.55);
    content: "";
}
.route-stop-marker {
    z-index: 1;
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    color: #f4b63b;
    background: #0b3652;
    margin-top: 2px;
}
.route-stop-label {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    font-weight: 600;
    text-align: left;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    overflow: visible;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}
.route-stop.is-terminal { color: #fff; font-weight: 800; }
.route-schedules { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.16); }
.route-schedules[hidden] { display: none; }
.route-schedules h4 { margin: 0 0 8px; color: #fff; font-size: .82rem; }
.route-service-list { margin: 0; padding: 0; list-style: none; }
.route-service { display: grid; grid-template-columns: minmax(0,1fr) max-content; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.8); font-size: .75rem; line-height: 1.4; }
.route-service:last-child { border-bottom: 0; }
.route-service-name { display: grid; grid-template-columns: max-content minmax(0,1fr); align-items: start; gap: 9px; min-width: 0; }
.route-service-code { color: #f4b63b; white-space: nowrap; }
.route-service-name > span { min-width: 0; overflow-wrap: anywhere; }
.route-service-time { color: #fff; white-space: nowrap; font-weight: 700; }

.home-hero-layout .terminal-connections-section { align-self: start; padding: 0; }
.home-hero-layout .route-hub { width: 100%; padding: 18px; }
.home-hero-layout .route-hub-heading { margin-bottom: 12px; }
.home-hero-layout .route-hub-heading h2 { font-size: 1.45rem; }
.home-hero-layout .route-option { grid-template-columns: 32px minmax(0,1fr) max-content; padding: 9px; }
.home-hero-layout .route-option-icon { width: 32px; height: 32px; }
.home-hero-layout .route-option-title { font-size: .7rem; }
.home-hero-layout .route-option-bus,
.home-hero-layout .route-toggle-label { font-size: .68rem; }

.dashboard-main {
    min-height: 100vh;
    height: auto;
    overflow: visible;
}

.dashboard-main > .terminal-connections-section { margin: 30px 0 0; }
.dashboard-main > .terminal-connections-section .route-hub { width: min(100%, 900px); }

@media (max-width: 640px) {
    .route-hub { padding: 18px; }
    .route-dialog { width: calc(100vw - 24px); max-height: 86vh; padding: 18px; }
    .route-service { align-items: start; gap: 8px; }
    .route-service-name { grid-template-columns: 1fr; gap: 2px; }
    .home-hero-layout .route-option { grid-template-columns: 36px minmax(0,1fr) max-content; }
    .home-hero-layout .route-option-icon { width: 36px; height: 36px; }
    .home-hero-layout .route-option-title { font-size: .76rem; }
    .home-hero-layout .route-option-bus,
    .home-hero-layout .route-toggle-label { font-size: .72rem; }
}
