:root {
    --ink: #1c2430;
    --muted: #5c6b7a;
    --paper: #f3efe6;
    --panel: #fffdf8;
    --line: #ddd4c4;
    --navy: #16324f;
    --clay: #c4552a;
    --shadow: 0 10px 30px rgba(22, 50, 79, 0.08);
    --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    color: var(--ink);
    background: var(--paper);
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page {
    flex: 1 1 auto;
    min-height: 0;
}

html[data-page="info"] #page-map,
html[data-page="map"] #page-info,
.page[hidden] {
    display: none !important;
}

#page-map { overflow: hidden; }

#page-info { overflow: auto; }

.shell {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    grid-template-areas:
        "header header"
        "stats map"
        "method map"
        "flights map"
        "footer footer";
}

.shell > header {
    grid-area: header;
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 16px 20px 12px;
    background: var(--navy);
    color: #f7f3ea;
}

.eyebrow {
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 11px;
    color: #d7c4a4;
}

h1, h2 { font-weight: 650; }

h1 { margin: 2px 0 0; font-size: 28px; }

.header-bridge { margin: 6px 0 0; font-size: 14px; }

.header-bridge a { color: #f0d3b0; }

.available {
    margin: 0 0 8px auto;
    color: #d7c4a4;
    font-size: 13px;
}

.date-field, .speed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.date-field select {
    min-width: 14rem;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
}

input[type="search"], select, button {
    font: inherit;
    color: var(--ink);
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
}

.lang {
    display: flex;
    margin-left: auto;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.lang button {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--navy);
    min-width: 42px;
    padding: 8px 10px;
    cursor: pointer;
}

.lang button[aria-pressed="true"] {
    background: var(--navy);
    color: #f7f3ea;
}

.stats,
.method,
.flights-panel {
    background: var(--panel);
    border-right: 1px solid var(--line);
}

.stats {
    grid-area: stats;
    padding: 16px 16px 4px;
}

.method {
    grid-area: method;
    margin: 0;
    padding: 4px 16px 8px;
}

.flights-panel {
    grid-area: flights;
    min-height: 0;
    overflow: auto;
    padding: 8px 16px 16px;
}

h2 {
    margin: 0 0 10px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stats h2, .note, .now { grid-column: 1 / -1; }

.stat {
    background: var(--paper);
    border-radius: 12px;
    padding: 12px;
}

.stat span {
    display: block;
    font-size: 32px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat p, .note, .now { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

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

.flight-tools {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 0 8px;
    padding: 4px 0;
    background: var(--panel);
}

.flight-search { display: block; margin: 0; }

.flight-search input { width: 100%; }

.clear-selection {
    width: 100%;
    margin-top: 8px;
    cursor: pointer;
    color: var(--navy);
    background: #eef3f8;
    border-color: var(--navy);
}

.search-count { margin-top: 0; }

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

.flights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.flights button {
    width: 100%;
    text-align: left;
    background: transparent;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    cursor: pointer;
}

.flights button.selected { border-color: var(--navy); background: #eef3f8; }

.badge {
    grid-row: span 2;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 30px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
}

.badge svg {
    width: 42px;
    height: 29px;
    display: block;
}

.flights small { color: var(--muted); }

.method { font-size: 13px; color: var(--muted); }

.method p { line-height: 1.45; }

.legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 12px; }

.legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

#map { grid-area: map; min-height: 280px; background: #d5dde4; }

.heatmap-control {
    width: 176px;
    padding: 8px 10px;
    color: var(--ink);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-size: 13px;
}

.heatmap-control label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 650;
}

.heatmap-control input {
    width: auto;
    margin: 0;
    padding: 0;
    accent-color: var(--clay);
}

.heatmap-caption,
.heatmap-status {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.heatmap-legend { margin-top: 8px; }

.heatmap-bar {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #1b7f4e 0%, #c4a000 25%, #e07a1f 50%, #d64545 75%, #8e1b4a 100%);
}

.heatmap-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.leaflet-tooltip.heatmap-tip {
    padding: 4px 8px;
    color: #f7f3ea;
    background: var(--navy);
    border: 0;
    border-radius: 6px;
    box-shadow: none;
    font-weight: 650;
}

.leaflet-tooltip.heatmap-tip.leaflet-tooltip-top::before {
    border-top-color: var(--navy);
}

.simulation-control {
    width: 300px;
    padding: 8px 10px;
    color: var(--ink);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.simulation-control label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.simulation-control select {
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

footer {
    grid-area: footer;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 16px 12px;
    background: var(--panel);
    border-top: 1px solid var(--line);
}

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

#clock {
    font-variant-numeric: tabular-nums;
    min-width: 72px;
    font-size: 18px;
}

input[type="range"] { flex: 1; accent-color: var(--clay); }

.status { grid-column: 1 / -1; margin: 0; min-height: 1.2em; color: var(--clay); font-size: 13px; }

.leaflet-div-icon.place-label,
.place-label {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--navy);
    font-weight: 700;
    text-shadow: 0 1px 0 white, 0 0 4px white;
}

.leaflet-div-icon.runway-label {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #86198f;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    text-shadow: 0 1px 0 white, 0 0 4px white;
}

.leaflet-popup-content a.airport-link {
    color: var(--navy);
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.leaflet-popup-content a.airport-link:hover,
.leaflet-popup-content a.airport-link:focus {
    color: var(--clay);
}

.leaflet-tooltip.runway-tip {
    padding: 4px 8px;
    color: #f7f3ea;
    background: #86198f;
    border: 0;
    border-radius: 6px;
    box-shadow: none;
    font-weight: 650;
}

button#play { background: var(--navy); color: white; border-color: var(--navy); cursor: pointer; min-width: 112px; }

.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    width: 14px;
    height: 28px;
    flex: none;
    border-radius: 3px;
    background:
        linear-gradient(var(--clay), var(--clay)) 0 0 / 100% 4px no-repeat,
        var(--navy);
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }

.brand-text strong {
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.1;
}

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

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

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 650;
    padding: 8px 12px;
    border-radius: 999px;
}

.nav-links a[aria-current="page"] {
    background: var(--navy);
    color: #f7f3ea;
}

.story {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
    grid-template-areas:
        "hero join"
        "main join";
    gap: 28px 36px;
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 72px;
}

.hero { grid-area: hero; }

.story-main { grid-area: main; display: flex; flex-direction: column; gap: 28px; }

.join-card { grid-area: join; }

.hero .eyebrow,
.map-teaser .eyebrow,
.join-kicker {
    margin: 0 0 10px;
    color: var(--clay);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
}

.hero h1 {
    margin: 0;
    max-width: 16ch;
    font-family: var(--serif);
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 650;
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.salute {
    margin: 22px 0 0;
    font-family: var(--serif);
    font-size: 22px;
}

.lede {
    max-width: 62ch;
    margin: 8px 0 0;
    font-size: 18px;
    line-height: 1.55;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button-clay { background: var(--clay); color: white; }

.button-ghost { background: transparent; color: var(--navy); border-color: var(--line); }

.button:focus-visible,
.nav-links a:focus-visible,
.brand:focus-visible,
.header-bridge a:focus-visible,
.map-teaser:focus-visible {
    outline: 2px solid var(--clay);
    outline-offset: 3px;
}

.join-card {
    align-self: start;
    position: sticky;
    top: 20px;
    padding: 22px;
    color: #f7f3ea;
    background: var(--navy);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.join-card:focus {
    outline: 3px solid #f0d3b0;
    outline-offset: 5px;
}

.join-card.is-called {
    animation: join-call 1.15s ease;
}

@keyframes join-call {
    0%, 100% { box-shadow: var(--shadow); }
    16% { box-shadow: 0 0 0 6px #c4552a, 0 14px 34px rgba(196, 85, 42, 0.5); }
    38% { box-shadow: 0 0 0 0 rgba(196, 85, 42, 0); }
    58% { box-shadow: 0 0 0 8px #e7b097, 0 14px 36px rgba(196, 85, 42, 0.38); }
    100% { box-shadow: var(--shadow); }
}

@media (prefers-reduced-motion: reduce) {
    .join-card.is-called { animation: none; }
}

.join-card h2 {
    margin: 0;
    color: #f7f3ea;
    font-family: var(--serif);
    font-size: 32px;
    letter-spacing: -0.03em;
    text-transform: none;
}

.join-lead,
.join-note,
.join-count,
.join-status { margin: 10px 0 0; line-height: 1.45; }

.join-lead { color: #f0d3b0; }

.join-note,
.join-count { color: #d7c4a4; font-size: 13px; }

.join-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }

.field input,
.field textarea {
    width: 100%;
    color: var(--ink);
    background: var(--panel);
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    font-weight: 500;
}

.field input:focus,
.field textarea:focus {
    outline: 3px solid var(--clay);
    outline-offset: 2px;
}

.join-card .button { width: 100%; }

.join-status:empty { display: none; }

.join-status[data-tone="bad"] { color: #ffd0c2; }

.join-status[data-tone="good"] { color: #d9f5e4; }

.thanks-dialog {
    width: min(34rem, calc(100% - 32px));
    margin: auto;
    padding: 32px 28px 24px;
    color: #f7f3ea;
    background: var(--navy);
    border: 0;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(22, 50, 79, 0.45);
}

.thanks-dialog::backdrop {
    background: rgba(28, 36, 48, 0.62);
}

.thanks-dialog p {
    margin: 0;
    font-family: var(--serif);
    font-size: 28px;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.thanks-dialog .button { width: 100%; margin-top: 24px; }

.story-main section,
.map-teaser {
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
}

.story-main h2 {
    margin: 0 0 12px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 28px;
    letter-spacing: -0.03em;
    text-transform: none;
}

.story-main p,
.boundaries li,
.demands li,
.steps li { font-size: 16px; line-height: 1.55; }

.story-main p { margin: 0; }

.story-main p + p { margin-top: 12px; }

.map-teaser {
    display: block;
    color: inherit;
    text-decoration: none;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(255, 253, 248, 0.96)),
        linear-gradient(90deg, #1b7f4e, #c4a000, #e07a1f, #d64545, #8e1b4a);
}

.map-teaser h2 { max-width: 22ch; }

.teaser-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--clay);
    font-weight: 700;
}

.argument + .argument { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

.argument h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.demands,
.steps,
.boundaries ul { margin: 0; padding: 0; list-style: none; }

.demands { display: grid; gap: 12px; }

.demands li,
.steps li {
    position: relative;
    padding-left: 48px;
}

.demands li::before,
.steps li::before {
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--paper);
    color: var(--clay);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.demands li:nth-child(1)::before { content: "1"; }
.demands li:nth-child(2)::before { content: "2"; }
.demands li:nth-child(3)::before { content: "3"; }
.demands li:nth-child(4)::before { content: "4"; }
.demands li:nth-child(5)::before { content: "5"; }

.story-main section.boundaries {
    background: #f7f1e6;
}

#pridat-se,
#volby { scroll-margin-top: 12px; }

.boundaries li + li { margin-top: 12px; }

.steps { display: flex; flex-direction: column; gap: 14px; }

.steps li::before {
    content: "";
    background: var(--navy);
}

.steps li:nth-child(1)::before { content: "1"; color: #f7f3ea; }
.steps li:nth-child(2)::before { content: "2"; color: #f7f3ea; }
.steps li:nth-child(3)::before { content: "3"; color: #f7f3ea; }
.steps li:nth-child(4)::before { content: "4"; color: #f7f3ea; }
.steps li:nth-child(5)::before { content: "5"; color: #f7f3ea; }
.steps li:nth-child(6)::before { content: "6"; color: #f7f3ea; }

.contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 16px 0 0;
    font-style: normal;
}

.contact-name {
    font-family: var(--serif);
    font-size: 22px;
    letter-spacing: -0.02em;
}

.vote-parties {
    color: var(--clay);
    font-weight: 700;
}

.vote-advice,
.contact a {
    color: var(--clay);
    font-weight: 700;
    text-decoration: none;
}

.vote-parties:hover,
.contact a:hover { text-decoration: underline; }

@media (max-width: 800px) {
    .site-nav { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
    .nav-links { order: 3; width: 100%; flex-wrap: wrap; }
    .nav-links a { text-align: center; }
    .story {
        grid-template-columns: 1fr;
        grid-template-areas:
            "hero"
            "join"
            "main";
        width: min(1120px, calc(100% - 28px));
        padding-top: 24px;
    }
    .join-card { position: static; }
    .hero h1 { max-width: none; }
    #page-map { overflow: auto; }
    .shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto minmax(52vh, 68vh) auto auto auto;
        grid-template-areas:
            "header"
            "stats"
            "map"
            "method"
            "footer"
            "flights";
        height: auto;
        min-height: 100%;
    }

    .shell > header { flex-wrap: wrap; }
    .available { margin-left: 0; }
    .stats,
    .method,
    .flights-panel { border-right: 0; }
    .stats { border-bottom: 1px solid var(--line); }
    .method { border-top: 1px solid var(--line); }
    .flights-panel { overflow: visible; }
    footer {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "play speed"
            "time time"
            "status status";
        border-bottom: 1px solid var(--line);
    }
    button#play { grid-area: play; }
    .speed { grid-area: speed; }
    .slider { grid-area: time; min-width: 0; }
    .status { grid-area: status; }
}
