@font-face {
    font-family: "Ikobrin Roboto";
    src: url("fonts/Roboto-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

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

@font-face {
    font-family: "Ikobrin Roboto";
    src: url("fonts/Roboto-Bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

:root {
    --brand: #735ff2;
    --brand-deep: #4933bd;
    --brand-soft: #eeebff;
    --paper: #ffffff;
    --canvas: #f4f5fb;
    --ink: #202235;
    --muted: #71758b;
    --line: #e1e3ed;
    --workday: #178c5b;
    --workday-soft: #e6f6ef;
    --weekend: #cf4f62;
    --weekend-soft: #fff0f2;
    --top-bar: 72px;
    --direction-height: 96px;
    --bottom-space: 92px;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas);
    scroll-behavior: smooth;
}

body {
    min-width: 300px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 5%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 26rem),
        var(--canvas);
    font-family: "Ikobrin Roboto", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
a {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.eyebrow {
    display: block;
    color: var(--brand-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.topbar {
    position: fixed;
    z-index: 100;
    inset: 0 0 auto;
    height: var(--top-bar);
    padding: 0 16px;
    background: rgba(255, 255, 255, .91);
    border-bottom: 1px solid rgba(218, 220, 232, .88);
    box-shadow: 0 8px 30px rgba(35, 37, 58, .06);
    backdrop-filter: blur(18px);
}

.topbar__inner {
    width: min(1160px, 100%);
    height: 100%;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 0 auto;
}

.topbar__tools {
    display: flex;
    align-items: center;
    gap: 7px;
}

.topbar__notifications {
    position: relative;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--brand);
    background: var(--brand-soft);
    border: 0;
    border-radius: 11px;
    cursor: pointer;
}

.topbar__notifications > span {
    position: relative;
    width: 13px;
    height: 14px;
    display: block;
    border: 2px solid currentColor;
    border-radius: 8px 8px 4px 4px;
    font-size: 0;
    line-height: 0;
}

.topbar__notifications > span::before {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: -5px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.topbar__notifications > b {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    color: #fff;
    background: #df586b;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 9px;
}

.notification-center {
    position: fixed;
    z-index: 180;
    top: calc(var(--top-bar) + 8px);
    right: max(12px, calc((100vw - 1160px) / 2));
    width: min(370px, calc(100vw - 24px));
    max-height: min(540px, calc(100vh - var(--top-bar) - 24px));
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(32, 34, 53, .2);
}

.notification-center > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 15px 10px;
}

.notification-center > header button {
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--muted);
    background: #f3f3f9;
    border: 0;
    border-radius: 9px;
    font-size: 21px;
    cursor: pointer;
}

.notification-center__body {
    max-height: 405px;
    overflow-y: auto;
    padding: 0 10px 6px;
}

.notification-item {
    padding: 11px 12px;
    background: #f8f7ff;
    border: 1px solid #ece9ff;
    border-radius: 13px;
}

.notification-item + .notification-item {
    margin-top: 7px;
}

.notification-item strong,
.notification-item p,
.notification-item time {
    display: block;
}

.notification-item strong {
    font-size: 13px;
}

.notification-item p {
    margin: 4px 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.notification-item time {
    color: #9699aa;
    font-size: 10px;
}

.notification-center__empty {
    padding: 18px 8px;
    color: var(--muted);
    text-align: center;
}

.notification-center__read {
    width: calc(100% - 20px);
    margin: 4px 10px 10px;
    padding: 10px;
    color: var(--brand-deep);
    background: var(--brand-soft);
    border: 0;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.topbar h1 {
    overflow: hidden;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar__action,
.topbar__logo {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 14px;
    font-size: 25px;
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
}

.topbar__logo {
    color: #fff;
    background: linear-gradient(145deg, var(--brand), var(--brand-deep));
    font-size: 28px;
}

.topbar__action:hover,
.topbar__logo:hover {
    transform: translateY(-1px);
}

.topbar__action:focus-visible,
.topbar__logo:focus-visible,
.direction-bar__switch:focus-visible,
.direction-bar__actions button:focus-visible,
.direction-bar__actions a:focus-visible,
.route-card:focus-visible,
.stop__toggle:focus-visible,
.day-switch button:focus-visible,
.countdown-popover:focus-visible,
.route-alert-modal__confirm:focus-visible,
.time-chip:focus-visible,
.map-route-select select:focus-visible,
.map-direction-select:focus-visible,
.map-directions button:focus-visible,
.map-trip-stops select:focus-visible,
.map-trip-planner button:focus-visible,
.map-time-controls input:focus-visible,
.map-time-controls button:focus-visible,
.map-simulation > summary:focus-visible,
.map-mobile-focus:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--brand) 38%, transparent);
    outline-offset: 3px;
}

/* Home */
.home-main {
    width: min(1160px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(var(--top-bar) + 28px) 0 36px;
}

.schedule-profile-notice {
    min-height: 84px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin: 0 0 18px;
    padding: 15px 18px;
    color: #184f3a;
    background: #f1fbf6;
    border: 1px solid #ccebdc;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(35, 37, 58, .05);
    animation: content-rise-in .38s cubic-bezier(.22, .8, .25, 1) both;
}

.schedule-profile-notice--repair {
    color: #6e3710;
    background: linear-gradient(135deg, #fff8e8, #fff1d4);
    border-color: #f2d08d;
}

.schedule-profile-notice__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #178c5b;
    border-radius: 15px;
    font-size: 23px;
    font-weight: 700;
}

.schedule-profile-notice--repair .schedule-profile-notice__icon {
    background: #e47b25;
}

.schedule-profile-notice__copy {
    min-width: 0;
}

.schedule-profile-notice__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: currentColor;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .7;
}

.schedule-profile-notice__copy strong {
    display: block;
    font-size: 17px;
}

.schedule-profile-notice__copy p {
    margin: 4px 0 0;
    color: currentColor;
    font-size: 13px;
    line-height: 1.4;
    opacity: .78;
}

.schedule-profile-notice > a {
    padding: 10px 13px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid currentColor;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
}

.schedule-profile-notice--compact {
    min-height: 64px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 18px;
    padding: 11px 14px;
    border-radius: 16px;
}

.schedule-profile-notice--compact .schedule-profile-notice__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 18px;
}

.home-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
    align-items: center;
    gap: 28px;
    overflow: hidden;
    padding: 19px 22px;
    color: #fff;
    background: linear-gradient(135deg, #735af0 0%, var(--brand-deep) 100%);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 23px;
    box-shadow: 0 16px 32px color-mix(in srgb, var(--brand) 25%, transparent);
}

.home-hero .eyebrow {
    color: rgba(255, 255, 255, .72);
}

.home-hero__copy h2 {
    margin: 6px 0 0;
    font-size: clamp(27px, 4vw, 40px);
    line-height: 1;
    letter-spacing: -.03em;
}

.home-hero__updated {
    display: block;
    margin-top: 9px;
    color: rgba(255, 255, 255, .78);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .01em;
}

.clock {
    min-width: 236px;
    min-height: 86px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .17);
    text-align: center;
}

.clock__label {
    margin-bottom: 4px;
    color: rgba(255, 255, 255, .7);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.clock__time {
    font-size: clamp(31px, 4vw, 43px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.045em;
    line-height: 1;
}

.clock__date {
    margin-top: 3px;
    color: rgba(255, 255, 255, .8);
    font-size: 12px;
}

.routes-section {
    margin-top: 14px;
    padding: 13px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 21px;
    box-shadow: 0 12px 30px rgba(35, 37, 58, .045);
}

.home-actions {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 9px;
    margin-top: 12px;
}

.home-actions--links-1 {
    grid-template-columns: minmax(220px, 1fr) auto;
}

.home-actions--links-0 {
    grid-template-columns: minmax(0, 1fr);
}

.route-search {
    min-width: 0;
    height: 44px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 5px;
    padding: 0 9px 0 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.route-search > span {
    color: var(--brand);
    font-size: 22px;
}

.route-search input {
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font: inherit;
}

.route-search input::-webkit-search-cancel-button,
.route-search input::-webkit-search-decoration {
    appearance: none;
    display: none;
}

.route-search button {
    width: 28px;
    height: 28px;
    padding: 0;
    color: var(--muted);
    background: #f1f1f7;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.nearby-link,
.map-link {
    height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
}

.home-action-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: grid;
    place-items: center;
    line-height: 0;
}

.home-action-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map-link {
    color: var(--brand-deep);
    background: #fff;
    border: 1px solid #dcd6ff;
}

/* Transit map */
.transit-map-main {
    width: min(1180px, calc(100% - 28px));
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(var(--top-bar) + 14px) 0 14px;
}

.transit-map-layout {
    height: calc(100vh - var(--top-bar) - 28px);
    height: calc(100dvh - var(--top-bar) - 28px);
    min-height: 570px;
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    gap: 12px;
}

.transit-map-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 18px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: 21px;
    box-shadow: 0 16px 38px rgba(35, 37, 58, .08);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d8d5e8 transparent;
}

.transit-map-panel header h2 {
    margin: 4px 0 6px;
    font-size: 25px;
    line-height: 1.02;
    letter-spacing: -.035em;
}

.transit-map-panel header p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.map-route-select {
    display: grid;
    gap: 5px;
}

.map-route-select > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.map-route-select select {
    width: 100%;
    height: 43px;
    padding: 0 11px;
    color: var(--ink);
    background: #f7f7fc;
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
}

.map-direction-picker {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.map-direction-picker__label {
    color: var(--ink);
    font-size: 11px;
    font-weight: 800;
}

.map-directions {
    display: grid;
    gap: 6px;
}

.map-direction-select {
    display: none;
}

.map-directions button {
    min-width: 0;
    display: grid;
    gap: 1px;
    padding: 8px 10px;
    color: var(--muted);
    background: #f5f4fb;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.map-directions button small {
    font-size: 8px;
    font-weight: 700;
    opacity: .78;
    text-transform: uppercase;
}

.map-directions button strong {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 11px;
    line-height: 1.2;
}

.map-directions button.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-color: var(--brand);
    box-shadow: 0 7px 17px color-mix(in srgb, var(--brand) 20%, transparent);
}

.map-directions button.is-active strong {
    color: #fff;
}

.map-trip-planner {
    display: grid;
    gap: 8px;
    padding: 11px;
    background: linear-gradient(155deg, #fbfaff 0%, #f4f2ff 100%);
    border: 1px solid #ded9ff;
    border-radius: 15px;
}

.map-trip-planner__head,
.map-trip-planner__actions,
.map-trip-planner__footer,
.map-trip-result__top,
.map-trip-result__labels,
.map-trip-result__badges,
.map-trip-next {
    display: flex;
    align-items: center;
}

.map-trip-planner__head {
    justify-content: space-between;
    gap: 8px;
}

.map-trip-planner__head > div:first-child {
    display: grid;
    gap: 1px;
}

.map-trip-planner__head > div:first-child span {
    color: var(--brand-deep);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.map-trip-planner__head > div:first-child strong {
    font-size: 15px;
    line-height: 1.1;
}

.map-trip-planner__actions {
    gap: 5px;
}

.map-trip-planner__actions button {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--brand-deep);
    background: #fff;
    border: 1px solid #ddd8ff;
    border-radius: 9px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}

.map-trip-planner__actions button.is-active {
    color: #f49a26;
    background: #fff7e8;
    border-color: #f5d493;
}

.map-trip-planner__actions button:disabled {
    color: #aaa7b8;
    background: #f5f4f8;
    border-color: #e6e4ec;
    cursor: not-allowed;
}

.map-trip-stops {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
    align-items: end;
    gap: 4px;
}

.map-trip-stops label {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.map-trip-stops label > span {
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.map-trip-stops select {
    min-width: 0;
    width: 100%;
    height: 34px;
    padding: 0 7px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #dcd9ee;
    border-radius: 9px;
    font: inherit;
    font-size: 9px;
    font-weight: 700;
    text-overflow: ellipsis;
}

.map-trip-stops > i {
    padding-bottom: 9px;
    color: var(--brand);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    text-align: center;
}

.map-trip-result {
    min-height: 106px;
    display: grid;
    align-content: center;
    gap: 7px;
    padding: 10px;
    color: #fff;
    background: linear-gradient(140deg, #6651e8, #4936c9);
    border-radius: 13px;
    box-shadow: 0 10px 20px rgba(83, 62, 208, .18);
}

.map-trip-result__state {
    align-self: center;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.map-trip-result__state.is-error {
    color: #ffe0e0;
}

.map-trip-result__top {
    justify-content: space-between;
    gap: 8px;
    font-size: 8px;
}

.map-trip-result__top > span {
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    opacity: .78;
}

.map-trip-result__top > strong {
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.map-trip-result__times {
    display: grid;
    grid-template-columns: auto minmax(46px, 1fr) auto;
    align-items: center;
    gap: 7px;
}

.map-trip-result__times > strong {
    font-size: 24px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.04em;
}

.map-trip-result__times > span {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, .82);
    font-size: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.map-trip-result__times > span i {
    height: 1px;
    flex: 1;
    min-width: 5px;
    background: rgba(255, 255, 255, .4);
}

.map-trip-result__labels {
    justify-content: space-between;
    gap: 10px;
    font-size: 8px;
}

.map-trip-result__labels span {
    max-width: 47%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: .82;
}

.map-trip-result__labels span:last-child {
    text-align: right;
}

.map-trip-result__badges {
    flex-wrap: wrap;
    gap: 4px;
}

.map-trip-result__badges span {
    padding: 3px 6px;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    font-size: 7px;
    font-weight: 800;
}

.map-trip-result__badges .is-alert,
.map-trip-result__badges .is-last {
    color: #fff0d1;
    background: rgba(255, 152, 39, .2);
}

.map-trip-next {
    gap: 5px;
}

.map-trip-next > span {
    margin-right: auto;
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.map-trip-next button {
    display: grid;
    gap: 0;
    padding: 5px 7px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #dedbea;
    border-radius: 8px;
    font: inherit;
    cursor: pointer;
}

.map-trip-next button strong {
    font-size: 10px;
}

.map-trip-next button small {
    color: var(--muted);
    font-size: 7px;
}

.map-trip-walk {
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    background: #edf9f3;
    border: 1px solid #cdebdc;
    border-radius: 10px;
}

.map-trip-walk strong {
    color: #14734d;
    font-size: 10px;
}

.map-trip-walk span {
    color: var(--muted);
    font-size: 8px;
}

.map-trip-walk.is-warning {
    background: #fff7e8;
    border-color: #f2d89d;
}

.map-trip-walk.is-warning strong {
    color: #9a5b09;
}

.map-trip-planner__footer {
    gap: 6px;
}

.map-trip-planner__footer button {
    min-height: 30px;
    flex: 1;
    padding: 0 8px;
    color: var(--brand-deep);
    background: #fff;
    border: 1px solid #dcd8f4;
    border-radius: 9px;
    font: inherit;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}

.map-trip-planner__footer button:disabled {
    opacity: .62;
    cursor: wait;
}

.map-trip-day {
    max-height: 252px;
    display: grid;
    gap: 9px;
    overflow-y: auto;
    padding: 9px;
    background: #fff;
    border: 1px solid #e1dfed;
    border-radius: 11px;
}

.map-trip-day[hidden] {
    display: none;
}

.map-trip-day section {
    display: grid;
    gap: 5px;
}

.map-trip-day__date {
    position: sticky;
    z-index: 1;
    top: -9px;
    margin: -9px -9px 0;
    padding: 8px 9px 6px;
    color: var(--ink);
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid #eceaf4;
    font-size: 9px;
    font-weight: 800;
}

.map-trip-day section > strong {
    color: var(--muted);
    font-size: 8px;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.map-trip-day section > div {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}

.map-trip-day button {
    display: grid;
    gap: 1px;
    padding: 5px 2px;
    color: var(--ink);
    background: #f8f8fc;
    border: 1px solid #e2e1eb;
    border-radius: 7px;
    font: inherit;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}

.map-trip-day button small {
    color: var(--muted);
    font-size: 7px;
    font-weight: 600;
}

.map-trip-day button.is-past {
    color: #a8a9b4;
    opacity: .55;
    cursor: default;
}

.map-trip-day button.is-selected {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.map-trip-day button.is-selected small {
    color: rgba(255, 255, 255, .76);
}

.map-simulation {
    display: contents;
}

.map-simulation > summary {
    display: none;
}

.map-simulation__body {
    display: contents;
}

.map-live-card {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 11px;
    background: #f2f9f6;
    border: 1px solid #d5eee3;
    border-radius: 13px;
}

.map-live-card__pulse {
    width: 9px;
    height: 9px;
    background: var(--workday);
    border: 2px solid #ccefe1;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(23, 140, 91, .28);
    animation: map-live-pulse 1.8s ease-out infinite;
}

@keyframes map-live-pulse {
    70% { box-shadow: 0 0 0 7px rgba(23, 140, 91, 0); }
    100% { box-shadow: 0 0 0 0 rgba(23, 140, 91, 0); }
}

.map-live-card div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.map-live-card div > span {
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
}

.map-live-card strong {
    font-size: 12px;
}

.map-time-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 6px;
}

.map-time-controls label {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.map-time-controls label span {
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.map-time-controls input,
.map-time-controls button {
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: 10px;
}

.map-time-controls input {
    min-width: 0;
    width: 100%;
    padding: 0 7px;
    background: #f7f7fc;
}

.map-time-controls button {
    padding: 0 9px;
    color: var(--brand-deep);
    background: var(--brand-soft);
    font-weight: 700;
    cursor: pointer;
}

.map-route-status,
.map-estimate-note {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}

.map-estimate-note {
    padding: 10px;
    color: #725125;
    background: #fff8e8;
    border: 1px solid #f2dfb3;
    border-radius: 11px;
}

.map-schedule-link {
    min-height: 39px;
    display: grid;
    place-items: center;
    margin-top: auto;
    color: #fff;
    background: var(--brand);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.map-fix-link {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.map-fix-link a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.transit-map-canvas-wrap {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #e8e9f0;
    border: 1px solid var(--line);
    border-radius: 21px;
    box-shadow: 0 16px 38px rgba(35, 37, 58, .08);
}

.transit-map-canvas {
    width: 100%;
    height: 100%;
    min-height: 360px;
    z-index: 1;
}

.map-mobile-focus {
    display: none;
}

.map-loading,
.map-unavailable {
    position: absolute;
    z-index: 500;
    inset: 50% auto auto 50%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    color: var(--ink);
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(35, 37, 58, .14);
    font-size: 11px;
    font-weight: 700;
    transform: translate(-50%, -50%);
}

.map-loading span {
    width: 15px;
    height: 15px;
    border: 2px solid #d9d4ff;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: map-loading-spin .8s linear infinite;
}

@keyframes map-loading-spin { to { transform: rotate(360deg); } }

.map-legend {
    position: absolute;
    z-index: 450;
    left: 10px;
    bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 7px 9px;
    color: #555a6d;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(220, 222, 233, .95);
    border-radius: 10px;
    box-shadow: 0 5px 16px rgba(35, 37, 58, .1);
    font-size: 9px;
    pointer-events: none;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.map-legend i {
    display: inline-block;
    flex: 0 0 auto;
}

.map-legend__route {
    width: 18px;
    height: 4px;
    background: var(--brand);
    border-radius: 3px;
}

.map-legend__stop {
    width: 8px;
    height: 8px;
    background: #fff;
    border: 2px solid var(--brand);
    border-radius: 50%;
}

.map-legend__bus {
    width: 15px;
    height: 12px;
    background: var(--brand-deep);
    border: 2px solid #fff;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(35, 37, 58, .24);
}

.map-stop-marker {
    width: 14px;
    height: 14px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 3px solid var(--brand);
    border-radius: 50%;
    box-shadow: 0 2px 7px rgba(35, 37, 58, .22);
}

.map-stop-marker--terminal {
    width: 18px;
    height: 18px;
    background: var(--brand);
    border-color: #fff;
}

.map-bus-marker {
    min-width: 36px;
    height: 27px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border: 3px solid #fff;
    border-radius: 9px;
    box-shadow: 0 5px 14px rgba(51, 36, 150, .34);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.map-bus-marker-wrap {
    transition: transform .8s linear;
}

.map-bus-marker::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 7px;
    height: 7px;
    background: var(--brand-deep);
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translateX(-50%) rotate(45deg);
}

.transit-map-page .leaflet-control-attribution {
    font-size: 8px;
}

.transit-map-page .leaflet-popup-content {
    margin: 10px 12px;
    font: 11px/1.35 "Ikobrin Roboto", Arial, sans-serif;
}

.transit-map-page .leaflet-popup-content strong {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
}

.route-search-summary {
    margin: 7px 3px 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.routes-section__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.routes-section__header h2 {
    margin: 3px 0 0;
    font-size: clamp(24px, 3vw, 31px);
    line-height: 1.05;
}

.routes-section__count {
    padding: 7px 11px;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
}

.route-tile {
    position: relative;
    min-width: 0;
}

.route-tile .route-card {
    height: 100%;
}

.route-tile__favorite {
    position: absolute;
    z-index: 2;
    top: 7px;
    left: 7px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #c5c2d5;
    background: rgba(255, 255, 255, .94);
    border: 1px solid #ece9ff;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}

.route-tile__favorite.is-active {
    color: #e19a22;
    background: #fff8dc;
    border-color: #f4d98f;
}

.route-tile.is-favorite .route-card {
    border-color: #e8d08d;
}

.routes-empty {
    margin: 18px 0;
    color: var(--muted);
    text-align: center;
}

.route-card {
    position: relative;
    min-width: 0;
    min-height: 96px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(48px, 1fr) auto;
    place-items: center;
    gap: 5px;
    padding: 10px;
    background: linear-gradient(145deg, #fbfaff, #f5f3ff);
    border: 1px solid #ece9ff;
    border-radius: 15px;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.route-card:hover {
    border-color: color-mix(in srgb, var(--brand) 54%, #ece9ff);
    box-shadow: 0 10px 20px color-mix(in srgb, var(--brand) 13%, transparent);
    transform: translateY(-2px);
}

.route-card__icon-wrap {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: #fff;
    border: 1px solid rgba(108, 83, 235, .1);
    border-radius: 14px;
}

.route-card__icon {
    font-size: 29px;
    line-height: 1;
}

.route-card__copy {
    width: 100%;
    min-width: 0;
    text-align: center;
}

.route-card__copy strong {
    display: block;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-card__alert {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #e07531;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(191, 79, 45, .28);
    font-size: 12px;
    font-weight: 700;
}

.route-card--warning {
    border-color: #ece9ff;
}

.home-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
    padding: 16px 2px 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.home-footer a {
    color: var(--brand-deep);
    font-weight: 700;
}

/* Route */
.route-page {
    background:
        radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 28rem),
        var(--canvas);
}

.direction-bar {
    position: fixed;
    z-index: 90;
    top: calc(var(--top-bar) + 14px);
    left: 50%;
    width: min(1080px, calc(100% - 32px));
    overflow: hidden;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(220, 222, 234, .95);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(35, 37, 58, .13);
    transform: translateX(-50%);
    backdrop-filter: blur(18px);
    animation: direction-bar-in .42s cubic-bezier(.22, .8, .25, 1) both;
}

.direction-bar__main {
    min-height: var(--direction-height);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
}

.direction-bar__endpoint {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.direction-bar__endpoint small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.direction-bar__endpoint strong {
    width: 100%;
    overflow: hidden;
    font-size: clamp(17px, 2.2vw, 24px);
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.direction-bar__endpoint strong > span {
    vertical-align: top;
}

.direction-bar__endpoint--last {
    align-items: flex-end;
    text-align: right;
}

.direction-bar__switch {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 68px;
    height: 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0;
    color: #fff;
    background: linear-gradient(145deg, var(--brand), var(--brand-deep));
    border: 0;
    border-radius: 21px;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 26%, transparent);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform .14s ease-out;
}

.direction-bar__switch::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 4px;
    border: 1px solid rgba(255, 255, 255, .46);
    border-radius: inherit;
    opacity: 0;
    transform: scale(.82);
}

.direction-bar__switch-icon,
.direction-bar__switch small {
    position: relative;
    z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
    .direction-bar__switch:not(:disabled):hover {
        box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 34%, transparent);
        transform: translateY(-2px);
    }
}

.direction-bar__switch:not(:disabled):active {
    box-shadow: 0 7px 16px color-mix(in srgb, var(--brand) 24%, transparent);
    transform: scale(.97);
}

.direction-bar__switch-icon {
    display: inline-block;
    font-size: 25px;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
}

.direction-bar__switch small {
    font-size: 10px;
    font-weight: 700;
}

.direction-bar__switch.is-switching {
    cursor: wait;
}

.direction-bar__switch.is-switching::after {
    animation: direction-switch-pulse .22s ease-out both;
}

.direction-bar__switch.is-switching .direction-bar__switch-icon {
    animation: direction-switch-turn .24s cubic-bezier(.2, .75, .3, 1) both;
}

.direction-bar__switch:disabled {
    box-shadow: none;
    cursor: default;
    opacity: .72;
}

.direction-bar__switch.is-switching:disabled {
    box-shadow: 0 8px 19px color-mix(in srgb, var(--brand) 22%, transparent);
    cursor: wait;
    opacity: 1;
}

.direction-bar__actions {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 3px;
    margin: 0 10px 7px;
    padding-top: 7px;
    border-top: 1px solid var(--line);
}

.direction-bar__actions button,
.direction-bar__actions a {
    min-width: 0;
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 8px;
    overflow: hidden;
    color: #6c6f82;
    background: transparent;
    border: 0;
    border-radius: 11px;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: color .16s ease, background-color .16s ease, transform .16s ease;
}

.direction-bar__actions button:hover,
.direction-bar__actions a:hover {
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.direction-bar__actions button:active,
.direction-bar__actions a:active {
    transform: scale(.97);
}

.direction-bar__actions button.is-active {
    color: var(--brand-deep);
    background: var(--brand-soft);
}

.route-tool__icon {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    color: var(--brand);
    font-size: 15px;
    line-height: 1;
}

.direction-bar__actions [data-route-tool-label],
.direction-bar__actions a > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-main {
    width: min(1080px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(var(--top-bar) + var(--direction-height) + 48px) 0 calc(var(--bottom-space) + 32px);
}

.route-main--with-direction-actions {
    padding-top: calc(var(--top-bar) + var(--direction-height) + 76px);
}

.route-page .route-main--no-direction-bar {
    padding-top: calc(var(--top-bar) + 34px);
}

.route-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin: 0 3px 20px;
}

.route-intro h2 {
    margin: 5px 0 0;
    font-size: clamp(27px, 4vw, 38px);
    line-height: 1.05;
}

.route-intro p {
    max-width: 470px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
    text-align: right;
}

.direction-panels {
    position: relative;
    width: 100%;
    overflow-anchor: none;
}

.direction-panel {
    width: 100%;
    transform-origin: top center;
}

.direction-panel__fallback-title {
    display: grid;
    gap: 5px;
    margin: 8px 3px 16px;
}

.direction-panel__fallback-title span {
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.direction-panel__fallback-title strong {
    font-size: clamp(17px, 2.5vw, 22px);
    line-height: 1.25;
}

.direction-panel__separator {
    height: 1px;
    margin: 30px 3px 22px;
    background: var(--border);
    border: 0;
}

.stop {
    position: relative;
    margin-bottom: 10px;
}

.stop h3 {
    position: relative;
    margin: 0;
}

.stop__favorite {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 52px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #c7c5d4;
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 15px;
    transform: translateY(-50%);
    cursor: pointer;
}

.stop__favorite.is-active {
    color: #e19a22;
    background: #fff5d8;
}

.stop__copy {
    padding-right: 28px;
}

.route-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 10px;
}

.route-tools button,
.route-tools a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    color: #626578;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.route-tools button.is-active {
    color: var(--brand-deep);
    background: var(--brand-soft);
    border-color: #d9d2ff;
}

/* Departures */
.departures-main {
    width: min(760px, calc(100% - 28px));
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(var(--top-bar) + 16px) 0 40px;
}

.departures-heading {
    margin-bottom: 10px;
}

.departures-heading h2 {
    margin: 4px 0 5px;
    font-size: clamp(25px, 4vw, 32px);
    letter-spacing: -.035em;
}

.departures-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.departure-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.field-select {
    display: grid;
    gap: 5px;
}

.field-select > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.field-select select {
    width: 100%;
    min-height: 43px;
    padding: 0 11px;
    color: var(--ink);
    background: #f8f8fc;
    border: 1px solid #dedfea;
    border-radius: 11px;
    font: inherit;
}

.location-button {
    width: 100%;
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    color: #fff;
    background: var(--brand);
    border: 0;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.location-button > span,
.map-trip-planner__footer button > span {
    font-size: 14px;
}

.favorite-stops,
.departure-days,
.departure-status {
    grid-column: 1;
}

.favorite-stops {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow-x: auto;
    color: var(--muted);
    font-size: 11px;
}

.favorite-stops > div {
    display: flex;
    gap: 5px;
}

.favorite-stops button,
.departure-days button {
    padding: 7px 9px;
    color: var(--muted);
    background: #f3f2fb;
    border: 0;
    border-radius: 9px;
    font-size: 11px;
    white-space: nowrap;
    cursor: pointer;
}

.departure-days {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.departure-days button.is-active {
    color: #fff;
    background: var(--brand);
}

.map-trip-marker {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #178f63;
    border: 3px solid #fff;
    border-radius: 9px 9px 9px 2px;
    box-shadow: 0 5px 14px rgba(35, 37, 58, .3);
    font-size: 11px;
    font-weight: 900;
    transform: rotate(-45deg);
}

.map-trip-marker--finish {
    background: #ed7f32;
}

.map-trip-marker-wrap .map-trip-marker {
    line-height: 1;
}

.map-trip-marker-wrap {
    background: transparent;
    border: 0;
}

.map-trip-marker-wrap .map-trip-marker b {
    transform: rotate(45deg);
}

.departure-status {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.nearby-stop-picker {
    grid-column: 1 / -1;
    padding: 11px;
    background: linear-gradient(145deg, #f8f7ff, #fff);
    border: 1px solid #d9d5ff;
    border-radius: 14px;
}

.location-button:disabled {
    opacity: .66;
    cursor: wait;
}

.nearby-stop-picker > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.nearby-stop-picker > header > div {
    display: grid;
    gap: 2px;
}

.nearby-stop-picker > header strong {
    font-size: 13px;
}

.nearby-stop-picker > header span {
    color: var(--muted);
    font-size: 10px;
}

.nearby-stop-picker > header button {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--muted);
    background: #eeecff;
    border: 0;
    border-radius: 9px;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.nearby-stop-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.nearby-stop-option {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.nearby-stop-option:hover,
.nearby-stop-option:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 7px 18px rgba(92, 70, 220, .11);
    transform: translateY(-1px);
}

.nearby-stop-option.is-nearest {
    border-color: #b8adff;
}

.nearby-stop-option__name {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.nearby-stop-option__name strong,
.nearby-stop-option__name small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nearby-stop-option__name strong {
    font-size: 12px;
}

.nearby-stop-option__name small {
    color: var(--muted);
    font-size: 9px;
}

.nearby-stop-option__distance {
    display: grid;
    gap: 1px;
    color: var(--brand-deep);
    font-size: 11px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.nearby-stop-option__distance small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 500;
}

.nearby-stop-attribution {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 9px;
}

.nearby-stop-attribution a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.departure-results {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.departure-card {
    min-height: 60px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
}

.departure-card__route {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, var(--brand), var(--brand-deep));
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.departure-card__way,
.departure-card time {
    display: grid;
    gap: 3px;
}

.departure-card__way strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.departure-card small {
    color: var(--muted);
    font-size: 10px;
}

.departure-card time {
    font-size: 17px;
    font-weight: 700;
    text-align: right;
}

.departure-empty {
    padding: 28px;
    color: var(--muted);
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 15px;
    text-align: center;
}

.stop__toggle {
    width: 100%;
    min-height: 64px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 7px 22px rgba(35, 37, 58, .045);
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.stop__toggle:hover {
    border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
    box-shadow: 0 11px 28px rgba(35, 37, 58, .08);
    transform: translateY(-1px);
}

.stop__toggle:active {
    transform: translateY(0) scale(.995);
}

.stop__marker {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 14px;
}

.stop__icon {
    font-size: 29px;
    line-height: 1;
}

.stop__copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.stop__name {
    min-width: 0;
    overflow: hidden;
    font-size: 17px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stop__copy small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.stop__caret {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    justify-self: end;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 11px;
    font-size: 15px;
    transition: color .2s ease, background-color .2s ease;
}

.stop__caret::before {
    display: block;
    transform: rotate(0);
    transition: transform .2s ease;
}

.stop.is-open .stop__toggle,
.stop.is-closing .stop__toggle {
    border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
    border-bottom-color: transparent;
    border-radius: 18px 18px 0 0;
    box-shadow: none;
    transform: none;
}

.stop.is-open .stop__caret {
    color: #fff;
    background: var(--brand);
}

.stop.is-open .stop__caret::before {
    transform: rotate(180deg);
}

.stop--featured .stop__toggle {
    border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
    background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 8%, white), #fff 38%);
}

.stop--featured .stop__marker {
    color: #fff;
    background: linear-gradient(145deg, var(--brand), var(--brand-deep));
}

.stop--control .stop__toggle {
    background: linear-gradient(135deg, rgba(101, 75, 232, .1), rgba(139, 116, 244, .05));
}

.stop--unpublished .stop__toggle {
    background: #fafafe;
}

.stop--unpublished .stop__marker {
    background: #ececf4;
    color: #8b8da0;
}

.stop--unpublished .stop__copy small {
    color: #818398;
}

.stop__unpublished-note {
    margin: 4px 0 2px;
    padding: 16px;
    border: 1px dashed #d5d5e4;
    border-radius: 14px;
    background: #fafafe;
    color: #595b70;
}

.stop__unpublished-note strong {
    display: block;
    margin-bottom: 5px;
    color: #282a3b;
}

.stop__unpublished-note p {
    margin: 0;
    font-size: .88rem;
    line-height: 1.45;
}

.route-schedule-explainer {
    margin: 14px 0 20px;
    padding: 16px 18px;
    border: 1px solid #ddddea;
    border-radius: 18px;
    background: #fff;
    color: #55576b;
}

.route-schedule-explainer--temporary {
    border-color: #d8cffd;
    background: linear-gradient(135deg, #f7f4ff, #fff);
}

.route-schedule-explainer strong {
    display: block;
    margin-bottom: 5px;
    color: #26283b;
}

.route-schedule-explainer p {
    margin: 0;
    font-size: .9rem;
    line-height: 1.5;
}

.route-schedule-explainer span {
    display: inline-flex;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eae4ff;
    color: #573ed1;
    font-size: .78rem;
    font-weight: 800;
}

.direction-leg {
    display: grid;
    gap: 3px;
    margin: 0 0 12px;
    padding: 13px 16px;
    border-radius: 16px;
    background: #f4f1ff;
}

.direction-leg > span,
.direction-leg small {
    color: #77798f;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.direction-leg strong {
    color: #26283b;
    line-height: 1.35;
}

.additional-controls {
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid #ded6ff;
    border-radius: 18px;
    background: #faf8ff;
}

.additional-controls > header {
    display: grid;
    gap: 3px;
    padding: 2px 4px 10px;
}

.additional-controls > header strong {
    color: #40318e;
    font-size: .86rem;
}

.additional-controls > header span {
    color: #79758d;
    font-size: .74rem;
    line-height: 1.35;
}

.stop__body {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows var(--stop-motion-duration, 280ms) cubic-bezier(.45, 0, .55, 1);
}

.stop__body[hidden] {
    display: none;
}

.stop.is-open .stop__body {
    grid-template-rows: 1fr;
}

.stop__body-clip {
    min-height: 0;
    overflow: hidden;
}

.stop__body-inner {
    padding: 18px;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
    border-top: 1px solid var(--line);
    border-radius: 0 0 18px 18px;
    transform-origin: top center;
}

.schedule {
    text-align: left;
}

.schedule__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.schedule__label {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    color: var(--workday);
    background: var(--workday-soft);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.1;
}

.schedule[data-mode="weekends"] .schedule__label {
    color: var(--weekend);
    background: var(--weekend-soft);
}

.schedule__next {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
}

.schedule__next strong {
    min-width: 84px;
    padding: 7px 10px;
    color: var(--ink);
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.schedule__next small {
    font-size: 11px;
}

.schedule__empty {
    width: fit-content;
    margin: 4px 0;
    padding: 10px 14px;
    color: var(--weekend);
    background: var(--weekend-soft);
    border-radius: 10px;
    font-weight: 700;
}

.time-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
}

.time-chip {
    position: relative;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 9px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: default;
    text-align: center;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.time-chip:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
}

.time-chip b {
    width: 14px;
    height: 14px;
    display: inline-grid;
    place-items: center;
    margin-left: 2px;
    color: #fff;
    background: var(--weekend);
    border-radius: 50%;
    font-size: 9px;
}

.time-chip.is-past {
    color: #9699a9;
    background: #f8f8fb;
}

.time-chip.is-next {
    color: #fff;
    background: linear-gradient(145deg, var(--brand), var(--brand-deep));
    border-color: transparent;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 24%, transparent);
    cursor: default;
}

.time-chip:disabled {
    cursor: default;
    opacity: 1;
}

.time-chip--noted::before {
    content: attr(data-note);
    position: absolute;
    z-index: 30;
    left: 50%;
    bottom: calc(100% + 9px);
    max-width: 250px;
    padding: 8px 11px;
    color: #fff;
    background: #242638;
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(25, 27, 43, .24);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity .15s ease, transform .15s ease;
    white-space: nowrap;
}

.time-chip--noted:hover::before,
.time-chip--noted:focus::before,
.time-chip--noted:focus-visible::before {
    opacity: 1;
    transform: translate(-50%, 0);
}

.day-switch {
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: 14px;
    width: min(600px, calc(100% - 24px));
    min-height: 64px;
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: center;
    gap: 7px;
    padding: 8px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(220, 222, 234, .95);
    border-radius: 20px;
    box-shadow: 0 16px 42px rgba(35, 37, 58, .2);
    transform: translateX(-50%);
    backdrop-filter: blur(18px);
    animation: day-switch-in .44s cubic-bezier(.22, .8, .25, 1) .08s both;
}

.day-switch__label {
    padding: 0 9px 0 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.day-switch button {
    min-height: 46px;
    padding: 0 12px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.day-switch button:not(.is-active):hover {
    color: var(--ink);
    background: color-mix(in srgb, var(--brand-soft) 62%, transparent);
}

.day-switch button:active {
    transform: scale(.97);
}

.day-switch button[data-day="workdays"].is-active {
    color: #fff;
    background: var(--workday);
    box-shadow: 0 7px 16px rgba(23, 140, 91, .22);
}

.day-switch button[data-day="weekends"].is-active {
    color: #fff;
    background: var(--weekend);
    box-shadow: 0 7px 16px rgba(207, 79, 98, .22);
}

.countdown-popover {
    position: fixed;
    z-index: 130;
    top: calc(var(--top-bar) + var(--direction-height) + 28px);
    left: 50%;
    min-width: 190px;
    padding: 13px 18px;
    color: #fff;
    background: #242638;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 16px 34px rgba(24, 26, 42, .3);
    text-align: center;
    transform: translateX(-50%);
    animation: popover-in .18s ease-out;
    cursor: pointer;
    transition: background-color .18s ease, transform .18s ease;
}

.countdown-popover:hover {
    background: #303246;
}

.countdown-popover:active {
    transform: translateX(-50%) scale(.97);
}

.route-alert-modal {
    position: fixed;
    z-index: 400;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}

.route-alert-modal.is-visible {
    opacity: 1;
    visibility: visible;
}

.route-alert-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(22, 24, 39, .66);
    border: 0;
    backdrop-filter: blur(5px);
    cursor: pointer;
    touch-action: none;
}

.route-alert-modal__dialog {
    position: relative;
    width: min(430px, 100%);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 30px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 25px;
    box-shadow: 0 28px 80px rgba(20, 22, 38, .34);
    transform: translateY(14px) scale(.97);
    transition: transform .26s cubic-bezier(.22, .8, .25, 1);
    overscroll-behavior: contain;
}

.route-alert-modal.is-visible .route-alert-modal__dialog {
    transform: translateY(0) scale(1);
}

.route-alert-modal__icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 19px;
    color: #fff;
    background: linear-gradient(145deg, #f08a42, #d85b45);
    border-radius: 17px;
    box-shadow: 0 11px 24px rgba(216, 91, 69, .25);
    font-size: 29px;
    font-weight: 700;
}

.route-alert-modal__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #bc4f36;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.route-alert-modal h2 {
    margin: 0;
    font-size: clamp(24px, 5vw, 31px);
    line-height: 1.1;
}

.route-alert-modal p {
    margin: 14px 0 24px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
}

.route-alert-modal__confirm {
    width: 100%;
    min-height: 50px;
    padding: 0 20px;
    color: #fff;
    background: linear-gradient(145deg, var(--brand), var(--brand-deep));
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 25%, transparent);
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease;
}

.route-alert-modal__confirm:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.route-alert-modal__confirm:active {
    transform: scale(.98);
}

@keyframes popover-in {
    from { opacity: 0; transform: translate(-50%, -5px); }
}

@keyframes content-rise-in {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes direction-bar-in {
    from { opacity: 0; transform: translate(-50%, -10px) scale(.99); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes day-switch-in {
    from { opacity: 0; transform: translate(-50%, 10px) scale(.98); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes direction-switch-turn {
    0% { transform: rotate(0); }
    100% { transform: rotate(180deg); }
}

@keyframes direction-switch-pulse {
    0% { opacity: 0; transform: scale(.88); }
    45% { opacity: .72; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.08); }
}

/* Content and errors */
.content-main {
    width: min(900px, calc(100% - 32px));
    min-height: calc(100vh - var(--top-bar) - 64px);
    margin: calc(var(--top-bar) + 30px) auto 34px;
    padding: clamp(24px, 5vw, 54px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(35, 37, 58, .07);
    font-size: 16px;
    line-height: 1.65;
}

.content-main h1,
.content-main h2,
.content-main h3 {
    line-height: 1.15;
}

.content-main h2,
.content-main h3 {
    margin-top: 1.7em;
}

.content-main a {
    color: var(--brand-deep);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.not-found {
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
}

.not-found .icon-404 {
    color: var(--brand);
    font-size: 96px;
}

@media (max-width: 820px) {
    :root {
        --top-bar: 64px;
        --direction-height: 84px;
    }

    .topbar {
        padding: 0 10px;
    }

    .topbar__inner {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .topbar h1 {
        font-size: 16px;
    }

    .topbar__action,
    .topbar__logo {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 23px;
    }

    .transit-map-page .topbar__inner {
        grid-template-columns: 44px minmax(0, 1fr) auto;
    }

    .transit-map-page .topbar__action,
    .transit-map-page .topbar__logo {
        width: 44px;
        height: 44px;
    }

    .transit-map-page .topbar__notifications {
        width: 40px;
        height: 40px;
    }

    .transit-map-main {
        width: calc(100% - 12px);
        padding: calc(var(--top-bar) + 6px) 0 6px;
    }

    .transit-map-layout {
        height: calc(100vh - var(--top-bar) - 12px);
        height: calc(100dvh - var(--top-bar) - 12px);
        min-height: 500px;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(275px, 52%) minmax(225px, 48%);
        gap: 7px;
    }

    .transit-map-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 7px 9px;
        padding: 10px;
        border-radius: 16px;
        overscroll-behavior: contain;
        scroll-padding: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .transit-map-panel > header {
        display: none;
    }

    .transit-map-panel > header p,
    .map-fix-link {
        display: none;
    }

    .map-route-select,
    .map-direction-picker,
    .map-directions {
        min-width: 0;
    }

    .map-trip-planner {
        grid-column: 1 / -1;
    }

    .map-route-select select,
    .map-direction-select,
    .map-directions button,
    .map-trip-stops select,
    .map-trip-planner__footer button,
    .map-time-controls input,
    .map-time-controls button {
        min-height: 44px;
        touch-action: manipulation;
    }

    .map-trip-planner__actions button {
        width: 44px;
        height: 44px;
        touch-action: manipulation;
    }

    .map-directions {
        display: none;
    }

    .map-direction-select {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        display: block;
        padding: 0 9px;
        color: var(--ink);
        background: #f7f7fc;
        border: 1px solid var(--line);
        border-radius: 12px;
        font: inherit;
        font-size: 10px;
        font-weight: 700;
        text-overflow: ellipsis;
        touch-action: manipulation;
    }

    .map-directions button {
        padding: 8px;
        text-align: center;
    }

    .map-direction-picker__label {
        font-size: 9px;
    }

    .map-trip-next {
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .map-trip-next::-webkit-scrollbar {
        display: none;
    }

    .map-trip-next > span {
        flex: 0 0 auto;
    }

    .map-trip-next button {
        min-width: 54px;
        min-height: 44px;
        flex: 0 0 auto;
        touch-action: manipulation;
    }

    .map-trip-day {
        max-height: none;
        overflow: visible;
    }

    .map-trip-day button {
        min-height: 44px;
        touch-action: manipulation;
    }

    .map-simulation {
        grid-column: 1 / -1;
        display: block;
        overflow: hidden;
        background: #f7f7fb;
        border: 1px solid var(--line);
        border-radius: 12px;
    }

    .map-simulation > summary {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 11px;
        color: var(--ink);
        font-size: 10px;
        font-weight: 800;
        cursor: pointer;
        list-style: none;
        touch-action: manipulation;
    }

    .map-simulation > summary::-webkit-details-marker {
        display: none;
    }

    .map-simulation > summary::after {
        content: "+";
        width: 26px;
        height: 26px;
        display: grid;
        flex: 0 0 auto;
        place-items: center;
        color: var(--brand-deep);
        background: var(--brand-soft);
        border-radius: 8px;
        font-size: 17px;
    }

    .map-simulation[open] > summary::after {
        content: "−";
    }

    .map-simulation > summary small {
        margin-left: auto;
        color: var(--muted);
        font-size: 8px;
        font-weight: 600;
        text-align: right;
    }

    .map-simulation__body {
        display: grid;
        gap: 7px;
        padding: 0 9px 9px;
    }

    .map-live-card {
        padding: 8px 9px;
    }

    .map-time-controls {
        align-self: center;
    }

    .map-route-status {
        display: none;
    }

    .map-estimate-note {
        padding: 8px 9px;
        font-size: 9px;
    }

    .map-schedule-link {
        grid-column: 1 / -1;
        min-height: 34px;
        margin-top: 0;
    }

    .transit-map-canvas-wrap {
        border-radius: 16px;
    }

    .map-mobile-focus {
        position: absolute;
        z-index: 470;
        top: 9px;
        right: 9px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 0 12px;
        color: var(--brand-deep);
        background: rgba(255, 255, 255, .95);
        border: 1px solid #dad6f5;
        border-radius: 12px;
        box-shadow: 0 6px 18px rgba(35, 37, 58, .15);
        font: inherit;
        font-size: 10px;
        font-weight: 800;
        cursor: pointer;
        touch-action: manipulation;
        backdrop-filter: blur(10px);
    }

    .map-mobile-focus span {
        font-size: 15px;
    }

    .transit-map-layout.is-map-focus {
        grid-template-rows: 0 minmax(0, 1fr);
        gap: 0;
    }

    .transit-map-layout.is-map-focus .transit-map-panel {
        min-height: 0;
        overflow: hidden;
        padding: 0;
        border: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .transit-map-canvas {
        min-height: 225px;
    }

    .transit-map-page .leaflet-control-zoom a {
        width: 44px;
        height: 44px;
        line-height: 44px;
        font-size: 22px;
    }

    .home-main {
        width: min(100% - 20px, 1160px);
        padding-top: calc(var(--top-bar) + 14px);
    }

    .home-hero {
        min-height: 0;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 18px;
        padding: 16px 18px;
        border-radius: 20px;
    }

    .home-hero__copy h2 {
        font-size: clamp(25px, 5vw, 34px);
    }

    .clock {
        min-width: 205px;
        min-height: 78px;
        padding: 10px 14px;
        border-radius: 16px;
    }

    .routes-section {
        margin-top: 14px;
        padding: 11px;
    }

    .direction-bar {
        top: calc(var(--top-bar) + 8px);
        width: calc(100% - 20px);
        min-height: 0;
        border-radius: 19px;
    }

    .direction-bar__main {
        min-height: var(--direction-height);
        grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
        gap: 8px;
        padding: 10px 12px;
    }

    .direction-bar__endpoint {
        gap: 2px;
    }

    .direction-bar__endpoint strong {
        font-size: 15px;
    }

    .direction-bar__endpoint small {
        font-size: 9px;
    }

    .direction-bar__switch {
        width: 54px;
        height: 54px;
        border-radius: 16px;
    }

    .direction-bar__switch-icon {
        font-size: 21px;
    }

    .route-main {
        width: calc(100% - 20px);
        padding-top: calc(var(--top-bar) + var(--direction-height) + 34px);
    }

    .route-main--with-direction-actions {
        padding-top: calc(var(--top-bar) + var(--direction-height) + 70px);
    }

    .route-intro {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 16px;
    }

    .route-intro p {
        max-width: 100%;
        text-align: left;
    }
}

@media (max-width: 520px) {
    :root {
        --direction-height: 82px;
    }

    .home-main {
        width: min(100% - 16px, 1160px);
        min-height: 100svh;
        padding: calc(var(--top-bar) + 10px) 0 12px;
    }

    .topbar__notifications {
        width: 30px;
        height: 30px;
    }

    .topbar__tools {
        gap: 5px;
    }

    .home-actions {
        grid-template-columns: minmax(0, 1fr) 40px 40px;
        gap: 6px;
        margin-top: 8px;
    }

    .home-actions--links-1 {
        grid-template-columns: minmax(0, 1fr) 40px;
    }

    .home-actions--links-0 {
        grid-template-columns: minmax(0, 1fr);
    }

    .route-search,
    .nearby-link,
    .map-link {
        height: 40px;
    }

    .nearby-link,
    .map-link {
        justify-content: center;
        padding: 0;
        font-size: 0;
    }

    .nearby-link .home-action-label,
    .map-link span {
        display: none;
    }

    .nearby-link .home-action-icon {
        display: grid;
        font-size: initial;
    }

    .transit-map-panel {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        padding: 8px;
    }

    .map-trip-planner {
        gap: 7px;
        padding: 8px;
    }

    .map-trip-result {
        min-height: 94px;
    }

    .map-trip-result__times > strong {
        font-size: 21px;
    }

    .transit-map-panel .eyebrow {
        font-size: 8px;
    }

    .transit-map-panel header h2 {
        font-size: 16px;
    }

    .map-route-select select,
    .map-direction-select {
        height: 44px;
        font-size: 12px;
    }

    .map-directions button {
        min-height: 44px;
        line-height: 1.12;
    }

    .map-directions button small {
        font-size: 7px;
    }

    .map-directions button strong {
        display: -webkit-box;
        overflow: hidden;
        font-size: 9px;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .map-time-controls input,
    .map-time-controls button {
        height: 44px;
        font-size: 10px;
    }

    .map-live-card strong,
    .map-route-status {
        font-size: 9px;
    }

    .map-legend {
        right: 8px;
        left: 8px;
        justify-content: center;
        gap: 6px;
        padding: 6px 7px;
        font-size: 8px;
    }

    .schedule-profile-notice {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 11px;
        min-height: 0;
        padding: 12px;
        border-radius: 16px;
    }

    .schedule-profile-notice__icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 19px;
    }

    .schedule-profile-notice__copy strong {
        font-size: 15px;
    }

    .schedule-profile-notice__copy p {
        font-size: 12px;
    }

    .schedule-profile-notice > a {
        grid-column: 1 / -1;
        padding: 8px 10px;
        text-align: center;
    }

    .schedule-profile-notice--compact {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        gap: 9px;
        margin-inline: 4px;
        padding: 9px;
    }

    .schedule-profile-notice--compact .schedule-profile-notice__icon {
        width: 34px;
        height: 34px;
    }

    .schedule-profile-notice--compact > a {
        grid-column: auto;
        padding: 7px 8px;
    }

    .home-hero {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 72px;
        gap: 10px;
        padding: 10px;
        border-radius: 17px;
    }

    .home-hero .eyebrow {
        display: block;
        margin-bottom: 2px;
        font-size: 8px;
        letter-spacing: .09em;
    }

    .home-hero__copy h2 {
        margin: 0;
        font-size: 18px;
        line-height: 1.05;
        white-space: nowrap;
    }

    .home-hero__updated {
        margin-top: 2px;
        color: rgba(255, 255, 255, .78);
        font-size: 8px;
        font-weight: 400;
    }

    .clock {
        min-width: 108px;
        min-height: 52px;
        padding: 6px 7px;
        border-radius: 13px;
    }

    .clock__label {
        margin-bottom: 1px;
        font-size: 7px;
    }

    .clock__time {
        font-size: 24px;
    }

    .clock__date {
        margin-top: 1px;
        font-size: 8px;
    }

    .routes-section__header {
        align-items: end;
        flex-direction: row;
        gap: 8px;
        margin-bottom: 11px;
    }

    .routes-section__count {
        padding: 6px 9px;
        font-size: 11px;
    }

    .routes-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
    }

    .routes-section {
        margin-top: 10px;
        padding: 8px;
        border-radius: 17px;
    }

    .route-card {
        min-height: 70px;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(35px, 1fr) auto;
        gap: 2px;
        padding: 6px 3px;
        border-radius: 12px;
    }

    .route-card__icon-wrap {
        width: 35px;
        height: 35px;
        border-radius: 11px;
    }

    .route-card__icon {
        font-size: 22px;
    }

    .route-card__copy strong {
        font-size: 11px;
        line-height: 1.05;
    }

    .route-card__alert {
        top: 4px;
        right: 3px;
        width: 15px;
        height: 15px;
        font-size: 10px;
    }

    .route-tile__favorite {
        top: 3px;
        left: 3px;
        width: 17px;
        height: 17px;
        border-radius: 6px;
        font-size: 9px;
    }

    .route-tools {
        gap: 5px;
        margin: 0 4px 8px;
    }

    .route-tools button,
    .route-tools a {
        min-height: 30px;
        padding: 6px 8px;
        font-size: 9px;
    }

    .stop__favorite {
        right: 45px;
        width: 25px;
        height: 25px;
        font-size: 13px;
    }

    .stop__copy {
        padding-right: 22px;
    }

    .departures-main {
        width: min(100% - 16px, 760px);
        padding-top: calc(var(--top-bar) + 14px);
    }

    .departures-heading h2 {
        margin-top: 3px;
        font-size: 25px;
    }

    .departures-heading p {
        font-size: 13px;
    }

    .departure-picker {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .location-button,
    .favorite-stops,
    .departure-days,
    .departure-status,
    .nearby-stop-picker {
        grid-column: 1;
    }

    .nearby-stop-list {
        grid-template-columns: 1fr;
    }

    .departure-card {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 7px 9px;
    }

    .departure-card__route {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .departure-card time {
        font-size: 16px;
    }

    .home-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .route-page .topbar {
        box-shadow: none;
    }

    .route-page .topbar,
    .route-page .direction-bar,
    .route-page .day-switch {
        background: #fff;
        backdrop-filter: none;
    }

    .direction-bar {
        top: var(--top-bar);
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0;
        background: rgba(255, 255, 255, .96);
        border-width: 0 0 1px;
        border-radius: 0 0 15px 15px;
        box-shadow: 0 10px 24px rgba(35, 37, 58, .09);
    }

    .direction-bar__main {
        height: var(--direction-height);
        min-height: var(--direction-height);
        grid-template-columns: minmax(0, 1fr) 54px;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "departure switch"
            "arrival switch";
        gap: 0 8px;
        padding: 4px 12px;
    }

    .direction-bar__endpoint {
        position: relative;
        grid-area: departure;
        justify-content: center;
        align-items: flex-start;
        padding: 0 0 2px 18px;
        text-align: left;
    }

    .direction-bar__endpoint::before {
        content: "";
        position: absolute;
        left: 2px;
        top: 50%;
        width: 8px;
        height: 8px;
        background: var(--brand);
        border: 2px solid var(--brand-soft);
        border-radius: 50%;
        transform: translateY(-50%);
    }

    .direction-bar__endpoint:first-child::after {
        content: "";
        position: absolute;
        left: 7px;
        top: calc(50% + 5px);
        height: calc(100% - 5px);
        border-left: 2px dashed color-mix(in srgb, var(--brand) 34%, transparent);
    }

    .direction-bar__endpoint--last {
        grid-area: arrival;
        align-items: flex-start;
        padding-top: 2px;
        padding-bottom: 0;
        border-top: 1px solid var(--line);
        text-align: left;
    }

    .direction-bar__switch {
        grid-area: switch;
        width: 54px;
        height: 70px;
        align-self: center;
        border-radius: 16px;
    }

    .direction-bar__switch small {
        display: block;
    }

    .direction-bar__endpoint strong {
        display: -webkit-box;
        overflow: hidden;
        font-size: 13px;
        line-height: 1.08;
        text-overflow: clip;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .direction-bar__endpoint small {
        font-size: 8px;
        line-height: 1;
    }

    .route-main {
        width: calc(100% - 12px);
        padding-top: calc(var(--top-bar) + var(--direction-height) + 14px);
    }

    .route-main--with-direction-actions {
        padding-top: calc(var(--top-bar) + var(--direction-height) + 58px);
    }

    .direction-bar__actions {
        gap: 1px;
        margin: 0 5px 5px;
        padding-top: 5px;
    }

    .direction-bar__actions button,
    .direction-bar__actions a {
        min-height: 40px;
        gap: 4px;
        padding: 4px 2px;
        border-radius: 9px;
        font-size: 10px;
    }

    .direction-bar__actions .route-tool__icon {
        font-size: 14px;
    }

    .route-intro {
        margin-inline: 4px;
    }

    .route-intro h2 {
        font-size: 27px;
    }

    .stop {
        margin-bottom: 5px;
    }

    .stop__toggle {
        min-height: 56px;
        grid-template-columns: 42px minmax(0, 1fr) 34px;
        gap: 10px;
        padding: 7px 10px;
        border-radius: 15px;
    }

    .stop__marker {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .stop__icon {
        font-size: 25px;
    }

    .stop__name {
        font-size: 15px;
    }

    .stop__caret {
        width: 31px;
        height: 31px;
        border-radius: 10px;
    }

    .stop.is-open .stop__toggle,
    .stop.is-closing .stop__toggle {
        border-radius: 15px 15px 0 0;
    }

    .stop__body-inner {
        padding: 10px;
        border-radius: 0 0 15px 15px;
    }

    .schedule__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
        margin-bottom: 10px;
    }

    .schedule__next {
        justify-content: flex-start;
    }

    .time-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 5px;
    }

    .time-chip {
        min-height: 36px;
        gap: 1px;
        padding: 4px 2px;
        border-radius: 8px;
        font-size: 13px;
    }

    .time-chip b {
        width: 12px;
        height: 12px;
        margin-left: 1px;
        font-size: 8px;
    }

    .day-switch {
        bottom: 7px;
        width: calc(100% - 14px);
        min-height: 58px;
        grid-template-columns: 1fr 1fr;
        padding: 6px;
        border-radius: 17px;
    }

    .day-switch__label {
        display: none;
    }

    .day-switch button {
        min-height: 44px;
        padding: 0 8px;
        border-radius: 12px;
        font-size: 13px;
    }

    .content-main {
        width: calc(100% - 16px);
        margin-top: calc(var(--top-bar) + 14px);
        padding: 22px 18px;
        border-radius: 18px;
    }

    .route-alert-modal {
        padding: 12px;
    }

    .route-alert-modal__dialog {
        max-height: calc(100dvh - 24px);
        padding: 24px 21px 21px;
        border-radius: 21px;
    }

    .route-alert-modal__icon {
        width: 46px;
        height: 46px;
        margin-bottom: 16px;
        border-radius: 15px;
        font-size: 25px;
    }

    .route-alert-modal h2 {
        font-size: 25px;
    }

    .route-alert-modal p {
        margin: 12px 0 20px;
        font-size: 14px;
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 600px) {
    .transit-map-main {
        width: calc(100% - 12px);
        padding: calc(var(--top-bar) + 6px) 0 6px;
    }

    .transit-map-layout {
        height: calc(100vh - var(--top-bar) - 12px);
        height: calc(100dvh - var(--top-bar) - 12px);
        min-height: 0;
        grid-template-columns: minmax(290px, 42%) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 7px;
    }

    .transit-map-layout.is-map-focus {
        grid-template-columns: 0 minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 0;
    }

    .transit-map-panel {
        min-height: 0;
    }

    .transit-map-canvas-wrap,
    .transit-map-canvas {
        min-height: 0;
        height: 100%;
    }
}

/* Home: compact status row */
.home-page .home-hero--status {
    min-height: 120px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    grid-template-areas: "clock copy meta";
    align-items: center;
    gap: 0 18px;
    padding: 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(35, 37, 58, .06);
    text-align: left;
}

.home-page .home-hero--status .home-hero__copy {
    grid-area: copy;
    align-self: center;
    padding-bottom: 0;
}

.home-page .home-hero--status .eyebrow {
    color: var(--brand-deep);
    font-size: 10px;
}

.home-page .home-hero--status .home-hero__copy h2 {
    margin: 3px 0 0;
    font-size: 24px;
    line-height: 1.05;
    letter-spacing: -.025em;
}

.home-page .home-hero--status .clock {
    grid-area: clock;
    width: 120px;
    min-width: 0;
    min-height: 94px;
    padding: 10px 8px;
    color: #fff;
    background: linear-gradient(145deg, var(--brand), var(--brand-deep));
    border: 0;
    border-radius: 15px;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 20%, transparent);
}

.home-page .home-hero--status .clock__label {
    margin-bottom: 5px;
    font-size: 8px;
}

.home-page .home-hero--status .clock__time {
    font-size: 31px;
}

.home-page .home-hero--status .home-hero__meta {
    grid-area: meta;
    align-self: center;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding-right: 10px;
    color: var(--muted);
    text-align: right;
}

.home-page .home-hero--status .home-hero__updated {
    margin: 0;
    color: inherit;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
}

.home-page .home-hero--status .home-hero__updated {
    color: var(--brand-deep);
}

.home-page .routes-section {
    overflow: hidden;
    padding: 0;
    background: #fff;
}

.home-page .routes-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0;
    background: #fff;
}

.home-page .route-card {
    min-height: 88px;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: inset -1px -1px 0 var(--line);
}

.home-page .route-card:hover {
    z-index: 1;
    background: #f8f6ff;
    border-color: transparent;
    box-shadow:
        inset -1px -1px 0 var(--line),
        inset 0 0 0 2px color-mix(in srgb, var(--brand) 44%, transparent);
    transform: none;
}

.home-page .route-card__icon-wrap {
    background: transparent;
    border: 0;
}

.home-page .route-card--warning {
    background: linear-gradient(145deg, #fff 45%, #fff9f3);
}

.home-page .route-tile.is-favorite .route-card {
    box-shadow:
        inset -1px -1px 0 var(--line),
        inset 0 0 0 1px #e8d08d;
}

.home-page .route-tile:first-child .route-card {
    border-radius: 20px 0 0;
}

.home-page .route-tile:nth-child(10) .route-card {
    border-radius: 0 20px 0 0;
}

.home-page .route-tile:nth-last-child(10) .route-card {
    border-radius: 0 0 0 20px;
}

.home-page .route-tile:last-child .route-card {
    border-radius: 0 0 20px;
}

@media (max-width: 820px) {
    .home-page .routes-section {
        border-radius: 16px;
    }

    .home-page .routes-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .home-page .route-tile:first-child .route-card,
    .home-page .route-tile:nth-child(10) .route-card,
    .home-page .route-tile:nth-last-child(10) .route-card,
    .home-page .route-tile:nth-child(5) .route-card,
    .home-page .route-tile:nth-last-child(5) .route-card,
    .home-page .route-tile:last-child .route-card {
        border-radius: 0;
    }

    .home-page .route-tile:first-child .route-card {
        border-radius: 15px 0 0;
    }

    .home-page .route-tile:nth-child(4) .route-card {
        border-radius: 0 15px 0 0;
    }

    .home-page .route-tile:nth-last-child(4) .route-card {
        border-radius: 0 0 0 15px;
    }

    .home-page .route-tile:last-child .route-card {
        border-radius: 0 0 15px;
    }
}

@media (max-width: 520px) {
    .home-page .home-main {
        padding-top: calc(var(--top-bar) + 10px);
    }

    .home-page .home-hero--status {
        min-height: 94px;
        grid-template-columns: 82px minmax(0, 1fr);
        grid-template-areas:
            "clock copy"
            "clock meta";
        gap: 0 10px;
        padding: 8px;
        border-radius: 17px;
    }

    .home-page .home-hero--status .eyebrow {
        display: none;
    }

    .home-page .home-hero--status .home-hero__copy {
        align-self: end;
        padding-bottom: 3px;
    }

    .home-page .home-hero--status .home-hero__copy h2 {
        margin: 0;
        font-size: 15px;
        line-height: 1.05;
    }

    .home-page .home-hero--status .clock {
        width: 82px;
        min-height: 76px;
        padding: 8px 5px;
        border-radius: 12px;
    }

    .home-page .home-hero--status .clock__label {
        margin-bottom: 4px;
        font-size: 7px;
    }

    .home-page .home-hero--status .clock__time {
        font-size: 22px;
    }

    .home-page .home-hero--status .home-hero__updated {
        font-size: 9px;
    }

    .home-page .home-hero--status .home-hero__meta {
        align-self: start;
        align-items: flex-start;
        gap: 3px;
        padding-right: 0;
        text-align: left;
    }

    .home-page .routes-section {
        margin-top: 9px;
        padding: 0;
        border-radius: 16px;
    }

    .home-page .routes-grid {
        gap: 0;
    }

    .home-page .route-card {
        min-height: 76px;
        grid-template-rows: 40px auto;
        gap: 2px;
        padding: 7px 3px 6px;
        border-radius: 0;
    }

    .home-page .route-card__icon-wrap {
        width: 40px;
        height: 40px;
        border-radius: 0;
    }

    .home-page .route-card__icon {
        font-size: 28px;
    }

    .home-page .route-card__copy strong {
        font-size: 12px;
        line-height: 1.05;
    }

    .home-page .route-card__alert {
        top: 3px;
        right: 3px;
        width: 14px;
        height: 14px;
        border-width: 1px;
        font-size: 9px;
    }

    .home-page .route-tile__favorite {
        top: 6px;
        left: 6px;
        width: 18px;
        height: 18px;
        background: rgba(255, 255, 255, .86);
        border-radius: 6px;
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .stop__body {
        transition-duration: var(--stop-motion-duration, 280ms) !important;
    }

    .stop__toggle,
    .stop__caret,
    .stop__caret::before {
        transition-duration: .2s !important;
    }
}
