:root {
    --ink: #17201d;
    --muted: #65716c;
    --soft: #f5f7f6;
    --surface: #fff;
    --line: #dce4e0;
    --line-strong: #c7d2cd;
    --accent: #08775c;
    --accent-dark: #065f49;
    --accent-soft: #eef8f4;
    --link: #1c5fa8;
    --danger: #b42318;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: var(--soft);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

a { color: var(--link); }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--line);
}

.nav-wrap {
    position: relative;
    max-width: 1120px;
    min-height: 64px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand a {
    color: var(--ink);
    font-size: 19px;
    font-weight: 750;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 9px;
}

.brand-logo { width: auto; height: 44px; display: block; }
.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-links a {
    padding: 8px 10px;
    border-radius: 6px;
    color: #46524d;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a.current { color: var(--ink); background: #eef3f1; }

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.nav-toggle:hover { background: #eef3f1; }
.nav-toggle span {
    display: block;
    height: 2px;
    margin: 4px 0;
    border-radius: 2px;
    background: var(--ink);
}

.container { max-width: 1120px; margin: 0 auto; padding: 36px 20px 56px; }
h1, h2, h3 { color: var(--ink); letter-spacing: 0; }
h1 { margin: 0 0 10px; font-size: 34px; line-height: 1.15; }
.page-intro { max-width: 760px; margin-bottom: 24px; }
.subtitle { margin: 0; color: #52605a; font-size: 17px; line-height: 1.55; }
.subtitle-extra { margin: 4px 0 24px; color: var(--muted); font-size: 14px; font-style: normal; }
.container > .subtitle { margin-bottom: 22px; }

.filters {
    margin-bottom: 28px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.field-include { grid-column: span 3; }
.dropdown-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field label { color: #3f4b46; font-size: 13px; font-weight: 700; }

.field input,
.field select,
.field textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 119, 92, .12);
}

.field textarea { min-height: 140px; resize: vertical; }
.controls { display: flex; gap: 10px; align-items: flex-end; margin: 0; }

.controls button,
.controls button.active,
.btn {
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    box-shadow: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 750;
    text-decoration: none;
    transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.controls button:hover,
.controls button.active:hover,
.btn:hover {
    border-color: var(--accent-dark);
    box-shadow: none;
    background: var(--accent-dark);
    transform: none;
}

.controls button.secondary,
.btn.secondary { border-color: var(--line-strong); background: var(--surface); color: #3f4b46; }
.controls button.secondary:hover,
.btn.secondary:hover { background: #eef3f1; }

.content-card,
.form-card,
.empty,
.success-box,
.error-box {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    background: var(--surface);
}

.content-card { max-width: 760px; }
.content-card p { margin: 0 0 14px; line-height: 1.7; }
.content-card p:last-child { margin-bottom: 0; }
.success-box { border-color: #a9d5c5; background: var(--accent-soft); }
.error-box { border-color: #efc2bd; background: #fff5f4; color: var(--danger); }

.results-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding: 0 2px 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line-strong);
}

.results-count { display: block; color: var(--ink); font-size: 18px; font-weight: 750; }
.results-context,
.results-range { color: var(--muted); font-size: 13px; }

.route-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    background: var(--surface);
}

.route-card-bookable { border: 1px solid #acd2c4; }

.route-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 24px;
    padding: 20px;
}

.route-main { min-width: 0; }

.route-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    padding: 3px 8px;
    border: 1px solid #b9ddcf;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #076047;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
}

.route-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex: 0 0 auto;
}

.route-title {
    color: var(--ink);
    font-size: 19px;
    font-weight: 750;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.route-arrow { margin: 0 2px; color: #9aa6a1; font-weight: 400; }
.route-summary { min-width: 164px; text-align: right; }

.route-price {
    color: var(--ink);
    font-size: 25px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.price-prefix { color: var(--muted); font-size: 12px; font-weight: 650; vertical-align: middle; }
.route-duration,
.route-trip-days { margin-top: 5px; color: var(--muted); font-size: 13px; }

.segments {
    margin-top: 0;
    padding: 18px 20px 2px;
    border-top: 1px solid var(--line);
    background: #fafcfb;
}

.segment {
    position: relative;
    padding: 0 0 18px 30px;
    border: 0;
}

.segment:first-child { padding-top: 0; }

.segment::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 5px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--surface);
    z-index: 1;
}

.segment:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 17px;
    bottom: -4px;
    width: 1px;
    background: #bfd1ca;
}

.segment-route {
    min-width: 0;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    font-weight: 700;
}

.segment-city { color: var(--ink); }
.segment-arrow { color: #9aa6a1; }

.segment-airport-code {
    padding: 1px 5px;
    border: 1px solid #d5dfdb;
    border-radius: 4px;
    background: #edf2f0;
    color: #4b5b54;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.4;
}

.segment-date {
    margin-left: auto;
    padding: 0;
    background: transparent;
    color: #4b5b54;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.segment-details {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.segment-details > span + span::before { content: "\00b7"; margin-right: 8px; color: #9aa6a1; }
.segment-price { color: #076047; font-weight: 750; }
.segment-airline,
.segment-duration { color: var(--muted); }
.segment-scraped { color: #84908b; font-size: 12px; cursor: help; }
.segment-price-date { color: var(--muted); font-size: 12px; font-weight: 400; }

.airline-link,
.stay-links a { color: var(--link); text-decoration: none; font-weight: 650; }
.airline-link:hover,
.stay-links a:hover { text-decoration: underline; }
.stay-links { margin-top: 7px; color: var(--muted); font-size: 13px; }

.recommended {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    margin-top: 0;
    padding: 14px 20px 16px;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    color: #3f4b46;
    font-size: 13px;
}

.recommended-title { margin: 0; color: var(--ink); font-weight: 750; }
.note { max-width: 760px; margin-top: 26px; color: var(--muted); font-size: 13px; }

.empty-fun { padding: 38px 20px; text-align: center; }
.empty-mascot { display: block; width: auto; height: 64px; margin: 0 auto 12px; }
.empty-hint { margin-top: 8px; color: var(--muted); font-size: 13px; }

.site-footer { margin-top: 20px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-wrap { max-width: 1120px; margin: 0 auto; padding: 20px; color: var(--muted); font-size: 13px; }

.ts-wrapper { width: 100%; }
.ts-wrapper .ts-control,
.ts-wrapper input,
.ts-dropdown,
.ts-dropdown .option,
.ts-dropdown .item { font-family: inherit !important; font-size: 15px !important; }

.ts-wrapper .ts-control {
    min-height: 44px;
    padding: 6px 9px !important;
    border-color: var(--line-strong) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(8, 119, 92, .12) !important;
}

.ts-dropdown {
    border-color: var(--line-strong) !important;
    border-radius: 6px !important;
    box-shadow: 0 10px 24px rgba(23, 32, 29, .12) !important;
}

.ts-wrapper.multi .ts-control > div {
    border-radius: 4px !important;
    background: #edf3f0 !important;
    color: var(--ink) !important;
}

.pagination { display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; margin: 26px 0; }
.page-link {
    min-width: 38px;
    height: 38px;
    padding: 0 9px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    color: #3f4b46;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-link:hover { background: #eef3f1; }
.page-link.current { border-color: var(--ink); background: var(--ink); color: #fff; }
.page-dots { color: var(--muted); }

@media (max-width: 820px) {
    .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field-month,
    .field-duration { grid-column: auto; }
    .field-include,
    .controls { grid-column: 1 / -1; }
    .controls button { width: 100%; }
}

@media (max-width: 700px) {
    .nav-wrap { min-height: 58px; padding: 7px 14px; }
    .brand a { font-size: 18px; }
    .brand-logo { height: 38px; }
    .nav-toggle { display: block; }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 1px);
        left: 12px;
        right: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 6px;
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: 0 12px 30px rgba(23, 32, 29, .14);
        background: var(--surface);
    }

    .nav-links.open { display: flex; }
    .nav-links a { padding: 10px 11px; }
    .container { padding: 26px 14px 44px; }
    h1 { font-size: 28px; }
    .subtitle { font-size: 16px; }
    .filters { margin-bottom: 24px; padding: 14px; }
    .filter-grid { gap: 12px 10px; }

    .results-bar { align-items: flex-start; flex-direction: column; gap: 4px; }
    .route-card-head { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
    .route-summary { min-width: 0; text-align: left; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
    .route-price { font-size: 23px; }
    .route-duration,
    .route-trip-days { margin-top: 0; }
    .route-title { font-size: 17px; }
    .segments { padding: 16px 14px 0; }
    .segment { padding-left: 27px; }
    .segment-route { font-size: 14px; }
    .segment-date { width: 100%; margin-left: 0; }
    .segment-details > span + span::before { display: none; }
    .recommended { grid-template-columns: 1fr; gap: 5px; padding: 13px 16px 15px; }
    .pagination .btn { padding: 9px 11px; }
}

@media (max-width: 420px) {
    .filter-grid { grid-template-columns: 1fr; }
    .field-include,
    .controls { grid-column: 1; }
    .route-summary { display: block; }
    .route-duration,
    .route-trip-days { margin-top: 4px; }
}
