/* Optimal Journey - styled to match the Last Trip landing page design system. */
:root {
    --grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --purple: #667eea;
    --purple2: #764ba2;
    --navy: #1d3557;
    --ink: #333;
    --muted: #777;
    --line: #e8e8e8;
    --bg: #f5f7fa;
    --ok: #059669;
    --err: #dc2626;
    --warn: #b45309;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    background-image: radial-gradient(1100px 420px at 50% -140px, rgba(102, 126, 234, .12), rgba(102, 126, 234, 0) 70%);
    background-repeat: no-repeat;
    min-height: 100vh;
    color: var(--ink);
}

/* Sticky black nav (matches landing) */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #000;
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, .7);
    font-size: .9rem;
    font-weight: 600;
    transition: color .2s;
}

.nav-links a.active,
.nav-links a:hover {
    color: #fff;
}

/* "Live" dropdown — groups Live Departures + Live Status without widening the nav */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-drop-toggle {
    color: rgba(255, 255, 255, .7);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: color .2s;
}

.drop-caret {
    font-size: .7em;
    margin-left: 4px;
    opacity: .75;
}

.nav-dropdown:hover .nav-drop-toggle,
.nav-dropdown:focus-within .nav-drop-toggle,
.nav-drop-toggle.active {
    color: #fff;
}

.nav-drop-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    gap: 2px;
    min-width: 180px;
    padding: 8px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
    z-index: 1200;
}

.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown:focus-within .nav-drop-menu {
    display: flex;
}

.nav-links .nav-drop-menu a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    white-space: nowrap;
}

.nav-links .nav-drop-menu a:hover {
    background: rgba(255, 255, 255, .1);
}

/* First-position dropdowns anchor their menu to the left edge */
.nav-dropdown-start .nav-drop-menu {
    left: 0;
    right: auto;
}

/* White rounded container (matches landing) */
.container {
    max-width: 760px;
    margin: 28px auto;
    background: rgba(255, 255, 255, .97);
    border-radius: 24px;
    padding: 36px 40px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, .18), 0 0 0 1px rgba(255, 255, 255, .5) inset;
    animation: fadeInUp .5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.page-header h1 {
    color: var(--navy);
    font-size: 1.8rem;
    font-weight: 800;
    padding-bottom: 10px;
    background-image: var(--grad);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 48px 4px;
}

.share-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 1.5px solid var(--purple);
    background: #fff;
    color: var(--purple2);
    border-radius: 999px;
    padding: 8px 15px;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}

.share-btn:hover {
    background: var(--grad);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, .28);
}

.share-icon { font-size: 1rem; line-height: 1; }

.subtitle {
    color: #555;
    opacity: .85;
    font-size: 1.02rem;
    margin-bottom: 28px;
    max-width: 56ch;
}

/* Search panel */
.search-panel {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
        "from swap to"
        "time time time"
        "opts opts opts"
        "go   go   go";
    gap: 16px;
    align-items: end;
    padding: 22px;
    background: linear-gradient(180deg, #fbfcff 0%, #ffffff 100%);
    border: 1px solid #eef0f6;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(29, 53, 87, .05);
}

.field:nth-of-type(1) { grid-area: from; }
.field:nth-of-type(2) { grid-area: to; }

.field label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-weight: 700;
    font-size: .92rem;
    letter-spacing: .3px;
}

.autocomplete {
    position: relative;
}

.autocomplete input {
    width: 100%;
    padding: 15px 16px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    font-size: 16px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .04);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.autocomplete input:hover {
    border-color: #d0d0d0;
}

.autocomplete input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, .15);
}

/* "Use my location" pin button, docked inside the From field */
.autocomplete.has-geo input {
    padding-right: 48px;
}

.geo-btn {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9px;
    background: rgba(102, 126, 234, .1);
    color: var(--purple2);
    font-size: 1.05rem;
    cursor: pointer;
    transition: all .2s ease;
}

.geo-btn:hover {
    background: var(--grad);
    transform: translateY(-50%) scale(1.05);
}

.geo-btn:disabled {
    cursor: default;
    opacity: .8;
}

.geo-btn.locating .geo-icon { visibility: hidden; }

.geo-btn.locating::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 126, 234, .3);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

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

.swap-btn {
    grid-area: swap;
    align-self: end;
    width: 46px;
    height: 50px;
    border: 2px solid var(--line);
    background: #fff;
    border-radius: var(--radius);
    font-size: 1.2rem;
    color: var(--purple);
    cursor: pointer;
    transition: all .25s;
}

.swap-btn:hover {
    border-color: var(--purple);
    background: rgba(102, 126, 234, .06);
}

/* Autocomplete dropdown (matches landing) */
.suggestions {
    position: absolute;
    z-index: 1000;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    list-style: none;
    background: #fff;
    border: 2px solid var(--purple);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 12px 24px rgba(102, 126, 234, .2);
}

.suggestions li {
    padding: 13px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
}

.suggestions li:last-child { border-bottom: none; }

.suggestions li:hover,
.suggestions li[aria-selected="true"] {
    background: linear-gradient(90deg, rgba(102, 126, 234, .08), rgba(118, 75, 162, .05));
    padding-left: 20px;
}

.suggestions .s-name {
    font-weight: 600;
    color: var(--navy);
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    width: 100%;
}

.suggestions .s-icon {
    flex: 0 0 auto;
    line-height: 1.35;
}

.suggestions .s-text {
    /* Show the full station name - wrap instead of truncating */
    white-space: normal;
    overflow-wrap: anywhere;
}

.suggestions .s-meta {
    font-size: .8rem;
    color: var(--muted);
    padding-left: 1.6rem;
}

/* Toggle chips */
/* When-to-travel row (leave now / depart at / arrive by) */
.time-row {
    grid-area: time;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.time-modes {
    display: inline-flex;
    background: #f1f2f7;
    border: 1px solid #e6e8ef;
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
}

.time-mode {
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-weight: 700;
    font-size: .85rem;
    padding: 8px 14px;
    border-radius: 9px;
    cursor: pointer;
    transition: all .2s ease;
}

.time-mode:hover { color: var(--purple2); }

.time-mode.active {
    background: #fff;
    color: var(--purple2);
    box-shadow: 0 2px 6px rgba(29, 53, 87, .1);
}

.when-input {
    flex: 1 1 190px;
    min-width: 160px;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.when-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, .15);
}

.flavour-toggles {
    grid-area: opts;
    border: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.flavour-toggles legend {
    font-size: .92rem;
    font-weight: 700;
    color: var(--ink);
    margin-right: 4px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 2px solid var(--purple);
    background: #fff;
    color: var(--purple);
    border-radius: 10px;
    padding: 7px 14px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all .25s;
}

.chip:has(input:checked) {
    background: var(--grad);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, .3);
}

.chip input { accent-color: #fff; }

.chip-note {
    font-size: .8rem;
    color: var(--muted);
}

/* Primary CTA */
.search-btn {
    grid-area: go;
    width: 100%;
    padding: 16px 24px;
    background: var(--grad);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(102, 126, 234, .4);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, .5);
}

.search-btn:disabled {
    background: #c7cbd1;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Banner */
.banner {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 500;
}

.banner.info {
    background: linear-gradient(135deg, #f0f4ff, #e8eeff);
    color: var(--navy);
}

.banner.warn {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: var(--warn);
}

.banner.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: var(--err);
}

/* Results header */
.results-header {
    margin-top: 28px;
    padding-bottom: 4px;
}

.results-header .rh-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.results-header .rh-sub {
    margin-top: 4px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
}

/* Option tiles: every route type visible up front; tap one to open it */
.category-nav {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.opt-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 13px 15px 12px;
    background: #fff;
    border: 1.5px solid #e6e8f4;
    border-radius: 14px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.opt-tile:hover {
    border-color: var(--purple);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, .16);
}

.opt-tile.selected {
    border-color: var(--purple);
    background: linear-gradient(135deg, rgba(102, 126, 234, .10), rgba(118, 75, 162, .07));
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .14);
}

.tile-name {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--muted);
}

.opt-tile.selected .tile-name { color: var(--purple2); }

.tile-time {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.15;
}

.tile-sub {
    font-size: .74rem;
    font-weight: 600;
    color: var(--muted);
}

/* Empty / initial state */
.empty-state {
    margin-top: 30px;
    padding: 34px 26px;
    text-align: center;
    background: linear-gradient(135deg, #f7f9ff, #f2f0fb);
    border: 1px solid #ece9f7;
    border-radius: 18px;
}

.empty-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    margin: 0 auto 14px;
    font-size: 2rem;
    line-height: 1;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, .16), rgba(118, 75, 162, .12));
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, .18);
}

.empty-state h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 8px;
}

.empty-state p {
    max-width: 46ch;
    margin: 0 auto;
    color: #555;
    font-size: .95rem;
    line-height: 1.5;
}

.example-block {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.example-lead {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--muted);
}

.example-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.example {
    border: 1.5px solid var(--purple);
    background: #fff;
    color: var(--purple2);
    border-radius: 999px;
    padding: 8px 15px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}

.example:hover {
    background: var(--grad);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, .28);
}

/* Results */
.results {
    margin-top: 20px;
    display: grid;
    gap: 18px;
}

/* One card per classification */
.route-card {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
    scroll-margin-top: 80px;
    transition: box-shadow .3s ease, border-color .3s ease, transform .2s ease;
}

.route-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(29, 53, 87, .10);
}

.card-head {
    margin-bottom: .9rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--line);
}

.category-title {
    margin: 0;
    position: relative;
    padding-left: 14px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--navy);
}

.category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: .15em;
    bottom: .15em;
    width: 5px;
    border-radius: 999px;
    background: var(--grad);
}

.category-blurb {
    margin: 3px 0 0 14px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
}

/* Numbers the journeys inside a category (Option 1 of 3, ...) */
.j-label {
    margin-bottom: .35rem;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--purple2);
}

/* A single journey inside a card */
.journey + .journey {
    margin-top: .9rem;
    padding-top: .9rem;
    border-top: 1px dashed var(--line);
}

/* Journey hero row: duration, clock times, fare badge */
.j-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.j-when {
    display: flex;
    align-items: baseline;
    gap: .7rem;
    flex-wrap: wrap;
}

.j-duration {
    font-size: 1.65rem;
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.j-times {
    font-size: .95rem;
    font-weight: 700;
    color: var(--navy);
}

.j-arrow {
    color: var(--muted);
    font-weight: 400;
}

.j-fare {
    flex: 0 0 auto;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    color: var(--ok);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: .85rem;
    font-weight: 800;
}

/* Route summary strip: one coloured pill per line, walks as quiet text */
.j-strip {
    margin-top: .7rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .3rem;
}

.strip-leg {
    padding: .26rem .65rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

.strip-walk {
    font-size: .76rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.strip-sep {
    color: #c3c8d4;
    font-size: .8rem;
    font-weight: 700;
}

/* Stat chips */
.j-stats {
    margin-top: .6rem;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.j-chip {
    background: #f4f5fa;
    border: 1px solid #e8eaf2;
    border-radius: 8px;
    padding: .24rem .6rem;
    font-size: .76rem;
    font-weight: 600;
    color: #4a5568;
}

.j-chip.good {
    background: #ecfdf5;
    border-color: #d1fae5;
    color: var(--ok);
}

.j-chip.bad {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--err);
}

.j-chip.premium {
    background: #fffbeb;
    border-color: #fde68a;
    color: var(--warn);
}

/* Step-by-step / map toggles */
.j-actions {
    margin-top: .55rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.4rem;
}

.j-toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: none;
    border: none;
    padding: .45rem 0;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 700;
    color: var(--purple);
    cursor: pointer;
}

.j-toggle:hover { color: var(--purple2); }
.j-toggle:disabled { color: var(--muted); cursor: wait; }

.j-toggle .j-chevron { transition: transform .18s ease; }
.j-toggle.open .j-chevron { transform: rotate(180deg); }

/* Journey map */
.j-map {
    position: relative;
    margin-top: .5rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.j-map-canvas {
    width: 100%;
    height: clamp(280px, 52vh, 440px);
    background: #eef1f5;
}

.map-follow {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1100;   /* above Leaflet panes and controls */
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid #d7dbe8;
    border-radius: 999px;
    background: #fff;
    color: var(--navy);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .16);
}

.map-follow.on {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* Step-by-step timeline: a coloured bar per leg, dots at each station */
.itinerary {
    list-style: none;
    margin: .55rem 0 0;
    padding: 0;
}

.it-leg {
    position: relative;
    padding: 2px 0 2px 24px;
}

.it-leg::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: var(--lc, var(--navy));
}

.it-station {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: .55rem;
    padding: .16rem 0;
}

.it-station::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--lc, var(--navy));
    box-sizing: border-box;
}

.it-time {
    flex: 0 0 42px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.it-name {
    font-size: .92rem;
    font-weight: 700;
    color: var(--navy);
    overflow-wrap: anywhere;
}

.it-ride {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin: .18rem 0 .18rem calc(42px + .55rem);
}

.it-line-name {
    font-size: .74rem;
    font-weight: 700;
    padding: .15rem .5rem;
    border-radius: 6px;
    white-space: nowrap;
}

.it-ride-meta {
    font-size: .78rem;
    color: var(--muted);
}

.it-leg.disrupted .it-ride-meta { color: var(--err); }

.it-walk {
    position: relative;
    margin: 2px 0;
    padding: .45rem 0 .45rem 24px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
}

.it-walk::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    bottom: 2px;
    border-left: 3px dotted #c9cede;
}

.skeleton {
    height: 84px;
    border-radius: 16px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e9edf2 37%, #f3f4f6 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* SEO / supporting content */
.seo-content {
    max-width: 760px;
    margin: 8px auto 22px;
    padding: 0 20px;
}

.seo-inner {
    background: rgba(255, 255, 255, .97);
    border-radius: 24px;
    padding: 32px 36px;
    box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .16);
}

.seo-content h2 {
    color: var(--navy);
    font-size: 1.25rem;
    font-weight: 800;
    margin: 26px 0 12px;
    padding-bottom: 9px;
    background-image: var(--grad);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 40px 3px;
}

.seo-content h2:first-child { margin-top: 0; }

/* Keyboard focus rings (accessibility polish; no behaviour change) */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--purple2);
    outline-offset: 2px;
    border-radius: 8px;
}

.seo-content p {
    color: #4a4a4a;
    font-size: .98rem;
    line-height: 1.65;
    margin-bottom: 12px;
}

.seo-content strong { color: var(--navy); font-weight: 700; }

.faq-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.faq-item:last-child { border-bottom: none; }

.faq-item h3 {
    color: var(--navy);
    font-size: 1.02rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.faq-item p { margin-bottom: 0; }

.seo-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.seo-links li {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    color: #4a4a4a;
    font-size: .95rem;
    line-height: 1.5;
}

.seo-links li:last-child { border-bottom: none; }

.seo-links a {
    color: var(--purple2);
    font-weight: 700;
    text-decoration: none;
}

.seo-links a:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .seo-inner { padding: 24px 22px; border-radius: 20px; }
}

/* Footer */
.site-footer {
    max-width: 760px;
    margin: 8px auto 40px;
    padding: 0 24px;
    text-align: center;
    color: rgba(29, 53, 87, .6);
    font-size: .82rem;
    line-height: 1.6;
}

.site-footer p { margin: 4px 0; }

.site-footer a {
    color: var(--purple2);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover { text-decoration: underline; }

.footer-links { font-weight: 600; }

.footer-note { opacity: .8; }

@media (max-width: 640px) {
    .container {
        margin: 16px;
        padding: 26px 22px;
        border-radius: 20px;
    }

    .search-panel {
        grid-template-columns: 1fr;
        grid-template-areas:
            "from"
            "swap"
            "to"
            "time"
            "opts"
            "go";
    }

    .time-row { flex-direction: column; align-items: stretch; }
    .time-modes { width: 100%; }
    .time-mode { flex: 1; text-align: center; }

    .swap-btn {
        justify-self: center;
        width: 100%;
    }

    .j-duration { font-size: 1.4rem; }
    .results-header .rh-title { font-size: 1.15rem; }

    .header-top { align-items: flex-start; }
    .page-header h1 { font-size: 1.55rem; }

    /* Show every option at once (no left-right scrolling): a 2-up grid where
       a lone trailing tile spans the full width. */
    .category-nav {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }
    .opt-tile:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    /* Let the map use the card's full width on small screens */
    .j-map {
        margin-left: -20px;
        margin-right: -20px;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
}

/* Share toast */
.share-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%) translateY(12px);
    background: var(--navy);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
    transition: opacity .25s ease, transform .25s ease;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
