:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --ink: #16202f;
    --muted: #647084;
    --line: #d9e0ea;
    --blue: #1769e0;
    --blue-dark: #0f4faa;
    --green: #168466;
    --amber: #c27619;
    --shadow: 0 24px 70px rgba(20, 31, 49, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
}

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

.app-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    align-items: center;
    display: inline-flex;
    gap: 12px;
}

.brand-mark {
    align-items: center;
    background: var(--ink);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.top-nav {
    display: flex;
    gap: 6px;
}

.top-nav a {
    border-radius: 8px;
    color: var(--muted);
    font-size: 14px;
    padding: 10px 12px;
}

.top-nav a:hover {
    background: #edf2f8;
    color: var(--ink);
}

.search-page {
    background:
        linear-gradient(120deg, rgba(23, 105, 224, 0.12), rgba(22, 132, 102, 0.08)),
        var(--bg);
    min-height: calc(100vh - 72px);
    padding: 56px 24px;
}

.search-shell {
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(280px, 0.8fr) minmax(620px, 1.2fr);
    margin: 0 auto;
    max-width: 1180px;
}

.search-copy {
    padding-top: 26px;
}

.eyebrow {
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 14px;
    text-transform: uppercase;
}

h1 {
    font-size: 48px;
    line-height: 1.05;
    margin: 0;
    max-width: 560px;
}

.lede {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
    margin: 20px 0 0;
    max-width: 500px;
}

.search-panel {
    background: var(--surface);
    border: 1px solid rgba(217, 224, 234, 0.9);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.route-grid {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    margin-top: 22px;
}

.details-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.field {
    display: block;
    min-width: 0;
}

.location-field {
    position: relative;
}

.field span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 8px;
}

.field input,
.field select {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    height: 52px;
    outline: none;
    padding: 0 14px;
    width: 100%;
}

.field input:focus,
.field select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

.autocomplete-menu {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(20, 31, 49, 0.18);
    left: 0;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
}

.autocomplete-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    gap: 10px;
    padding: 10px;
    text-align: left;
    width: 100%;
}

.autocomplete-item:hover,
.autocomplete-item:focus {
    background: #f1f6fc;
    outline: none;
}

.hub-badge {
    align-items: center;
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 42px;
    font-size: 11px;
    font-weight: 800;
    height: 30px;
    justify-content: center;
}

.hub-badge.airport {
    background: var(--blue);
}

.hub-badge.bus {
    background: var(--green);
}

.hub-body {
    display: block;
    min-width: 0;
}

.hub-body strong,
.hub-body small {
    display: block;
}

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

.hub-body small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.autocomplete-empty {
    color: var(--muted);
    font-size: 13px;
    padding: 12px;
}

.swap-button {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--blue);
    cursor: pointer;
    display: inline-flex;
    font-size: 22px;
    height: 52px;
    justify-content: center;
    width: 44px;
}

.swap-button:hover {
    background: #edf5ff;
    border-color: rgba(23, 105, 224, 0.35);
}

.preference-row {
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 22px;
    padding: 16px 0;
}

.preference-row label {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 14px;
    gap: 8px;
}

.preference-row input {
    accent-color: var(--blue);
}

.panel-footer {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-top: 20px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.hint strong,
.hint span {
    display: block;
}

.hint strong {
    color: var(--amber);
}

.search-button {
    background: var(--blue);
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 52px;
    min-width: 160px;
    padding: 0 22px;
}

.search-button:hover {
    background: var(--blue-dark);
}

.results-page {
    background: var(--bg);
    min-height: calc(100vh - 72px);
    padding: 28px 24px 48px;
}

.results-shell {
    margin: 0 auto;
    max-width: 1240px;
}

.result-search-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 44px rgba(20, 31, 49, 0.08);
    margin-bottom: 18px;
}

.result-search-box summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    list-style: none;
    padding: 18px 22px;
}

.result-search-box summary::-webkit-details-marker {
    display: none;
}

.result-search-box summary span,
.result-search-box summary small {
    display: block;
}

.result-search-box summary small {
    color: var(--muted);
    font-size: 13px;
}

.compact-search {
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.result-details-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.results-layout {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: 280px minmax(0, 1fr);
}

.filters-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    position: sticky;
    top: 92px;
}

.filter-group {
    border-bottom: 1px solid var(--line);
    padding: 0 0 16px;
    margin-bottom: 16px;
}

.filter-group h2 {
    font-size: 14px;
    margin: 0 0 12px;
}

.filter-group label:not(.field) {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 14px;
    gap: 8px;
    margin: 10px 0;
}

.filter-group input[type="checkbox"] {
    accent-color: var(--blue);
}

.filter-button {
    background: var(--ink);
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 46px;
    width: 100%;
}

.results-list {
    min-width: 0;
}

.results-heading {
    align-items: end;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin: 4px 0 16px;
}

.results-heading h1 {
    font-size: 30px;
}

.results-heading p {
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
    max-width: 420px;
}

.empty-results {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    display: grid;
    gap: 6px;
    padding: 22px;
}

.empty-results strong {
    color: var(--ink);
}

.result-notice {
    background: #fff8ec;
    border: 1px solid rgba(194, 118, 25, 0.3);
    border-radius: 8px;
    color: #8a4f0c;
    font-weight: 700;
    margin-bottom: 14px;
    padding: 14px 16px;
}

.itinerary-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    padding: 18px;
}

.select-itinerary-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
    padding: 0 18px 18px;
}

.select-itinerary-button,
.secondary-button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 46px;
    padding: 0 18px;
}

.select-itinerary-button {
    background: var(--blue);
    color: #fff;
}

.select-itinerary-button:hover {
    background: var(--blue-dark);
}

.secondary-button {
    background: #edf2f8;
    color: var(--ink);
}

.itinerary-main {
    align-items: start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.itinerary-main h2 {
    font-size: 20px;
    margin: 8px 0 6px;
}

.itinerary-main p {
    color: var(--muted);
    margin: 0;
}

.pattern-pill {
    background: #edf5ff;
    border: 1px solid rgba(23, 105, 224, 0.2);
    border-radius: 999px;
    color: var(--blue);
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
}

.price-block {
    min-width: 140px;
    text-align: right;
}

.price-block strong,
.price-block span {
    display: block;
}

.price-block strong {
    font-size: 22px;
}

.price-block span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.price-block small {
    color: var(--amber);
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-top: 5px;
}

.segment-list {
    border-top: 1px solid var(--line);
    list-style: none;
    margin: 16px 0 0;
    padding: 14px 0 0;
}

.segment-list li {
    display: grid;
    gap: 12px;
    grid-template-columns: 82px minmax(0, 1fr) 150px;
    padding: 10px 0;
}

.segment-list li.has-transfer-note {
    gap: 8px 12px;
}

.segment-badge {
    align-self: start;
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    justify-content: center;
    padding: 7px 8px;
}

.segment-badge.flight {
    background: var(--blue);
}

.segment-badge.bus {
    background: var(--green);
}

.segment-badge.transfer {
    background: var(--amber);
}

.segment-body strong,
.segment-body span,
.segment-body small {
    display: block;
}

.segment-body strong {
    font-size: 15px;
}

.segment-body span {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.segment-body small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.segment-price {
    align-self: start;
    border-left: 1px solid var(--line);
    padding-left: 14px;
    text-align: right;
}

.segment-price span,
.segment-price strong {
    display: block;
}

.segment-price span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.segment-price strong {
    font-size: 15px;
    margin-top: 4px;
}

.segment-transfer-note {
    background: #fff8eb;
    border: 1px solid #f7d39a;
    border-radius: 8px;
    color: #70490a;
    grid-column: 2 / 4;
    padding: 10px 12px;
}

.segment-transfer-note strong,
.segment-transfer-note span {
    display: block;
}

.segment-transfer-note strong {
    font-size: 13px;
}

.segment-transfer-note span {
    font-size: 12px;
    margin-top: 3px;
}

.decision-page {
    background:
        linear-gradient(120deg, rgba(23, 105, 224, 0.12), rgba(22, 132, 102, 0.08)),
        var(--bg);
    min-height: calc(100vh - 72px);
    padding: 56px 24px;
}

.decision-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 0 auto;
    max-width: 760px;
    padding: 28px;
}

.decision-panel h1 {
    font-size: 34px;
    margin: 14px 0 10px;
}

.decision-panel p {
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

.price-comparison {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 22px 0;
}

.price-comparison div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.price-comparison span,
.price-comparison strong {
    display: block;
}

.price-comparison span {
    color: var(--muted);
    font-size: 13px;
}

.price-comparison strong {
    font-size: 26px;
    margin-top: 6px;
}

.provider-checks {
    border-top: 1px solid var(--line);
    margin-top: 20px;
    padding-top: 12px;
}

.provider-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 82px minmax(0, 1fr);
    padding: 10px 0;
}

.provider-row strong,
.provider-row small {
    display: block;
}

.provider-row small {
    color: var(--muted);
    margin-top: 3px;
}

.decision-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.link-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 920px) {
    .app-header {
        padding: 0 20px;
    }

    .search-shell {
        grid-template-columns: 1fr;
    }

    .search-copy {
        padding-top: 0;
    }

    h1 {
        font-size: 38px;
    }

    .results-layout {
        grid-template-columns: 1fr;
    }

    .filters-panel {
        position: static;
    }

    .results-heading {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 680px) {
    .top-nav {
        display: none;
    }

    .search-page {
        padding: 28px 14px;
    }

    h1 {
        font-size: 32px;
    }

    .search-panel {
        padding: 16px;
    }

    .route-grid,
    .details-grid {
        grid-template-columns: 1fr;
    }

    .swap-button {
        justify-self: stretch;
        width: 100%;
    }

    .panel-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .search-button {
        width: 100%;
    }

    .results-page {
        padding: 18px 14px 32px;
    }

    .result-search-box summary,
    .itinerary-main {
        align-items: start;
        flex-direction: column;
    }

    .price-block {
        text-align: left;
    }

    .segment-list li {
        grid-template-columns: 1fr;
    }

    .segment-price {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding-left: 0;
        padding-top: 10px;
        text-align: left;
    }

    .segment-transfer-note {
        grid-column: auto;
    }
}
