:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #e5e7eb;
    --landing: #16a34a;
    --takeoff: #2563eb;
    --warning: #f59e0b;
    --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 22px;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 850;
    min-width: 0;
}

.site-brand:hover {
    color: var(--takeoff);
}

.site-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #172033;
    flex: 0 0 auto;
    overflow: hidden;
    position: relative;
}

.site-brand-mark::before {
    content: "";
    position: absolute;
    width: 4px;
    height: 48px;
    border-radius: 999px;
    background: #ffffff;
    transform: rotate(38deg);
}

.site-brand-mark::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 22px;
    border-radius: 999px;
    background: repeating-linear-gradient(
        to bottom,
        #172033 0 4px,
        transparent 4px 9px
    );
    transform: rotate(38deg);
}

.site-brand-text {
    display: grid;
    gap: 1px;
    line-height: 1.1;
}

.site-brand-text strong {
    font-size: 16px;
}

.site-brand-text span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-nav a {
    color: var(--muted);
    border-radius: 999px;
    padding: 8px 11px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.site-nav a:hover {
    background: #f1f5f9;
    color: var(--text);
}

.language-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-left: 1px solid var(--border);
    padding-left: 12px;
}

.language-nav a {
    color: var(--muted);
    border-radius: 999px;
    padding: 7px 9px;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.language-nav a:hover,
.language-nav a.active {
    color: var(--text);
    background: #eef2ff;
}

.hero {
    background: linear-gradient(135deg, #ffffff, #edf6ff);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 28px;
    margin-bottom: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

h1 {
    margin: 0;
    max-width: 780px;
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1.05;
}

.subtitle {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 18px;
}

.search-panel {
    margin-top: 8px;
    max-width: 680px;
}

.search-panel label {
    display: block;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.search-panel input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px 16px;
    font-size: 17px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.intro-copy {
    max-width: 900px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
}

.selects {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

select {
    border: 1px solid var(--border);
    background: white;
    border-radius: 999px;
    padding: 12px 16px;
    font-size: 16px;
    min-width: 210px;
}

.answer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 22px;
}

.answer-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 22px;
}

.answer-label {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 8px;
}

.answer-main {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.landing { color: var(--landing); }
.takeoff { color: var(--takeoff); }

.confidence {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 10px 14px;
    background: white;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 15px;
}

.weather-summary {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: wrap;
    margin-top: 18px;
}

.weather-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex: 1 1 520px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 18px;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
}

.weather-main img {
    width: 52px;
    height: 52px;
    margin-left: -8px;
}

.weather-description {
    color: var(--muted);
    font-size: 15px;
    margin-top: 4px;
}

.weather-status {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.weather-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: center;
    gap: 8px;
    max-width: 390px;
}

.weather-metrics span {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.runway-insight {
    display: grid;
    grid-template-columns: minmax(210px, 0.8fr) 2fr;
    gap: 12px;
    margin-top: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 18px;
}

.runway-insight-main strong {
    display: block;
    font-size: 28px;
    line-height: 1.05;
}

.runway-insight-main span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.runway-insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.runway-insight-grid div {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
}

.runway-insight-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 3px;
}

.runway-insight-grid strong {
    font-size: 16px;
}

.runway-insight-grid .runway-warning {
    background: #fee2e2;
    color: #991b1b;
}

.airport-data-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    margin-top: 12px;
    padding: 16px 18px;
}

.airport-data-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.airport-data-main strong {
    display: block;
    font-size: 28px;
    line-height: 1.05;
}

.airport-data-main span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.airport-data-links {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.airport-data-links a {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 12px;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.airport-data-links a:hover {
    background: #f8fafc;
}

.airport-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.airport-data-grid div {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
}

.airport-data-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 3px;
}

.airport-data-grid strong {
    font-size: 16px;
    line-height: 1.25;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.dot.high { background: var(--landing); }
.dot.medium { background: var(--warning); }
.dot.low { background: var(--danger); }

.map-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
    margin-bottom: 18px;
}

#map {
    height: 610px;
    width: 100%;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    padding: 11px 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
}

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

.map-legend-line {
    width: 28px;
    height: 4px;
    border-radius: 999px;
    display: inline-block;
}

.landing-line {
    background: var(--landing);
}

.takeoff-line {
    background: var(--takeoff);
}

.wind-line {
    background: var(--warning);
}

.map-legend-airport {
    width: 9px;
    height: 9px;
    border: 2px solid white;
    border-radius: 999px;
    background: var(--text);
    box-shadow: 0 0 0 1px var(--border);
    display: inline-block;
}

.explanation {
    padding: 18px 22px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: 16px;
    line-height: 1.5;
}

.timeline-title {
    font-size: 22px;
    font-weight: 800;
    margin: 22px 0 10px;
}

.timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.time-card {
    border: 0;
    color: white;
    border-radius: 20px;
    padding: 16px;
    cursor: pointer;
    text-align: left;
    transition: 0.15s ease;
    min-height: 118px;
}

.time-card.same {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.time-card.change {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.time-card.medium {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #172033;
}

.time-card.low {
    background: linear-gradient(135deg, #64748b, #94a3b8);
}

.time-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.time-card.active {
    outline: 4px solid rgba(37, 99, 235, 0.25);
    transform: translateY(-2px);
}

.time {
    font-weight: 900;
    margin-bottom: 8px;
    font-size: 17px;
}

.direction-big {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 8px;
}

.direction-small {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.35;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.legend-dot.same { background: #16a34a; }
.legend-dot.change { background: #dc2626; }
.legend-dot.medium { background: #f59e0b; }
.legend-dot.low { background: #64748b; }

details {
    background: white;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px 22px;
}

summary {
    cursor: pointer;
    font-weight: 700;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.detail-box {
    background: #f8fafc;
    border-radius: 16px;
    padding: 14px;
}

.small {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 16px;
    border-radius: 18px;
    margin-bottom: 18px;
}

.overview-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.overview-link {
    display: block;
    background: white;
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    transition: 0.15s ease;
}

.overview-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.overview-link strong {
    display: block;
    margin-bottom: 4px;
}

.home-section {
    margin: 26px 0;
}

.content-section {
    margin: 28px 0;
}

.text-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.text-grid article {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}

.text-grid h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.25;
}

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

.faq-list {
    display: grid;
    gap: 10px;
}

.faq-list details {
    border-radius: 12px;
    padding: 16px 18px;
}

.faq-list p {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 36px 0 12px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--text);
}

.legal-page {
    min-height: 100vh;
    padding: 36px 18px;
    background: var(--bg);
}

.legal-content {
    max-width: 820px;
    margin: 0 auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    line-height: 1.65;
}

.legal-content h1 {
    margin: 0 0 18px;
    font-size: 32px;
}

.legal-content h2 {
    margin-top: 28px;
    font-size: 22px;
}

.legal-content h3 {
    margin: 22px 0 8px;
    font-size: 18px;
}

.legal-content a {
    color: #2563eb;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 12px;
}

.section-heading h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
}

.section-heading p {
    margin: 0;
    max-width: 620px;
    color: var(--muted);
    line-height: 1.45;
}

.airport-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.airport-card {
    display: grid;
    gap: 6px;
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text);
    text-decoration: none;
    transition: 0.15s ease;
}

.airport-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.airport-card strong {
    line-height: 1.2;
}

.airport-card span:last-child {
    color: var(--muted);
    font-size: 14px;
}

.airport-traffic {
    color: #0f766e;
    font-size: 14px;
    font-weight: 800;
}

.airport-code {
    width: fit-content;
    padding: 5px 8px;
    border-radius: 8px;
    background: #e0f2fe;
    color: #075985;
    font-size: 13px;
    font-weight: 900;
}

.continent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.continent-block {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.continent-block h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

.country-links {
    display: grid;
    gap: 8px;
}

.country-links a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.country-links a:hover {
    color: var(--takeoff);
}

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

.letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.letter-nav a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
}

.letter-nav a.active,
.letter-nav a:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.letter-nav span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .page { padding: 12px; }
    .site-header {
        display: grid;
        gap: 12px;
        padding: 12px;
    }
    .site-nav {
        justify-content: flex-start;
    }
    .site-nav a {
        padding: 8px 10px;
    }
    .hero { padding: 20px; border-radius: 22px; }
    .topbar { display: block; }
    .selects { display: block; }
    select { width: 100%; margin-top: 10px; }
    .answer-grid { grid-template-columns: 1fr; }
    .weather-card { display: block; }
    .weather-metrics { justify-content: flex-start; margin-top: 12px; }
    .runway-insight { grid-template-columns: 1fr; }
    #map { height: 480px; }
    .section-heading { display: block; }
    .section-heading p { margin-top: 8px; }
    .legal-content { padding: 22px; }
}

.plane-icon {
    background: transparent;
    border: 0;
}

.wind-icon {
    background: transparent;
    border: 0;
    filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.18));
}

.wind-icon > div {
    width: 38px;
    height: 38px;
    transform-origin: center center;
}

.wind-icon span {
    position: absolute;
    left: 50%;
    top: 36px;
    transform: translateX(-50%);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #92400e;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    padding: 4px 7px;
    white-space: nowrap;
}

.wind-particle-icon {
    background: transparent;
    border: 0;
    filter:
        drop-shadow(0 2px 4px rgba(15, 23, 42, 0.38))
        drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
}

.wind-particle-rotation {
    display: block;
    width: 24px;
    height: 24px;
    transform: rotate(var(--wind-rotate, 0deg));
    transform-origin: center center;
}

.wind-particle-motion {
    display: block;
    width: 24px;
    height: 24px;
    animation: wind-particle 1.65s cubic-bezier(0.42, 0, 0.2, 1) infinite;
    will-change: transform, opacity;
}

.leaflet-overlay-pane path.flight-flow {
    animation-duration: 1.1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.leaflet-overlay-pane path.landing-flow {
    animation-name: landing-flow;
}

.leaflet-overlay-pane path.takeoff-flow {
    animation-name: takeoff-flow;
}

@keyframes landing-flow {
    from { stroke-dashoffset: 22; }
    to { stroke-dashoffset: 0; }
}

@keyframes takeoff-flow {
    from { stroke-dashoffset: 22; }
    to { stroke-dashoffset: 0; }
}

@keyframes wind-particle {
    0% {
        opacity: 0;
        transform: translate3d(0, calc(var(--wind-distance, 22px) * 0.42), 0) scale(0.9);
    }
    18% {
        opacity: calc(var(--wind-opacity, 0.82) * 0.55);
    }
    52% {
        opacity: var(--wind-opacity, 0.82);
        transform: translate3d(0, -1px, 0) scale(1);
    }
    82% {
        opacity: calc(var(--wind-opacity, 0.82) * 0.55);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, calc(var(--wind-distance, 22px) * -0.52), 0) scale(0.94);
    }
}

@media (prefers-reduced-motion: reduce) {
    .leaflet-overlay-pane path.flight-flow,
    .wind-particle-motion {
        animation: none;
    }
}
