/* ================= 白色软拟态航空运行台 ================= */
:root {
    --bg-base: #f2f3f4;
    --bg-panel: #ffffff;
    --surface-high: #ffffff;
    --surface-low: #f7f8f8;
    --border-dim: rgba(24, 25, 23, 0.1);
    --border-bright: #d8d9d5;

    --text-main: #2d2e2a;
    --text-dim: #74766f;
    --text-bright: #151613;

    --alert-arr: #3f7fbd;
    --alert-critical: #f06565;
    --alert-dep: #287a5e;
    --alert-info: #4f6470;

    --heading-accent: #9b713a;
    --gold-soft: #c5a46a;
    --gold-wash: rgba(197, 164, 106, 0.1);
    --taf-change: #ffc928;
    --taf-change-text: #a87300;
    --shadow-raised: 0 18px 46px rgba(27, 28, 25, 0.07), 0 2px 8px rgba(27, 28, 25, 0.035);
    --shadow-soft: 0 10px 28px rgba(27, 28, 25, 0.065);
    --shadow-inset: none;

    --font-ui: "Segoe UI Variable Display", "Aptos Display", "Segoe UI", sans-serif;
    --font-data: "Bahnschrift", "Aptos", "Segoe UI", sans-serif;
    --font-digital: "Cascadia Mono", "SFMono-Regular", "Consolas", monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

body { margin: 0; padding: 28px; background-color: var(--bg-base); color: var(--text-main); font-family: var(--font-ui); font-weight: 400; min-height: 100vh; overflow-x: hidden; overflow-y: auto; }

header { position: relative; z-index: 20000; display: flex; justify-content: space-between; align-items: center; min-height: 64px; margin-bottom: 28px; padding: 10px 14px; border: 1px solid var(--border-dim); border-radius: 6px; background: var(--bg-panel); box-shadow: var(--shadow-raised); }
.logo-block { flex: 1 1 auto; min-width: 0; color: var(--text-bright); font-family: var(--font-ui); letter-spacing: 0; }
.sys-clock { flex: 0 0 auto; color: var(--text-bright); font-family: var(--font-data); font-size: 20px; font-weight: 600; white-space: nowrap; }

.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;
}

.airport-selector {
    position: relative;
    width: min(100%, 720px);
}

.airport-selector-trigger {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 12px;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 44px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-bright);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.airport-selector-trigger:hover,
.airport-selector-trigger[aria-expanded="true"] {
    border-color: var(--border-bright);
    background: var(--surface-low);
}

.airport-selector-trigger:focus-visible,
.airport-selector-search:focus-visible,
.airport-option:focus-visible {
    outline: 2px solid var(--alert-info);
    outline-offset: 2px;
}

.airport-selector-name {
    min-width: 0;
    overflow: hidden;
    font-size: 18px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.airport-selector-codes {
    color: var(--text-dim);
    font-family: var(--font-data);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.airport-selector-chevron {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    color: var(--text-dim);
    transform: translateY(-2px) rotate(45deg);
    transition: transform 140ms ease;
}

.airport-selector-trigger[aria-expanded="true"] .airport-selector-chevron {
    transform: translateY(2px) rotate(225deg);
}

.airport-selector-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20001;
    width: min(620px, calc(100vw - 44px));
    padding: 10px;
    border: 1px solid var(--border-bright);
    border-radius: 6px;
    background: var(--bg-panel);
    box-shadow: 0 20px 50px rgba(27, 28, 25, 0.16);
}

.airport-selector-panel[hidden] { display: none; }

.airport-selector-search {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border-bright);
    border-radius: 4px;
    color: var(--text-bright);
    background: var(--surface-low);
    font-family: var(--font-ui);
    font-size: 14px;
}

.airport-selector-search::placeholder { color: var(--text-dim); }

.airport-selector-list {
    max-height: min(420px, calc(100vh - 170px));
    margin-top: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.airport-region { padding-top: 8px; }

.airport-region-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 5px;
    color: #92958d;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.airport-region-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-dim);
}

.airport-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    width: 100%;
    min-height: 44px;
    padding: 10px 8px;
    border: 0;
    border-radius: 4px;
    color: var(--text-main);
    background: transparent;
    font-family: var(--font-ui);
    text-align: left;
    cursor: pointer;
}

.airport-option:hover,
.airport-option.is-active {
    background: var(--surface-low);
}

.airport-option[aria-selected="true"] {
    box-shadow: inset 2px 0 0 var(--heading-accent);
}

.airport-option-name {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.airport-option-codes {
    color: var(--text-dim);
    font-family: var(--font-data);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.airport-selector-empty {
    margin: 0;
    padding: 18px 8px;
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: 0;
}

.top-row {
    display: grid;
    grid-template-columns: minmax(380px, 0.85fr) minmax(520px, 1.15fr);
    gap: 22px;
    align-items: stretch;
    min-width: 0;
}

.panel { position: relative; min-width: 0; background-color: var(--bg-panel); border: 1px solid var(--border-dim); border-radius: 6px; padding: 22px; display: flex; flex-direction: column; box-shadow: var(--shadow-raised); }
.panel-header { font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--text-bright); text-transform: uppercase; letter-spacing: 0; margin-bottom: 12px; padding: 0; border: 0; box-shadow: none; white-space: nowrap; }

/* 跑道与气象模块 */
.runway-panel { min-height: 430px; overflow: visible; }
.rwy-container { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 16px; }
.runway-panel:has(.raw-popover-trigger:hover),
.runway-panel:has(.raw-popover-trigger.is-open),
.weather-panel:has(.raw-popover-trigger:hover),
.weather-panel:has(.raw-popover-trigger.is-open) {
    position: relative;
    z-index: 10000;
}
.rwy-container:has(.raw-popover-trigger:hover),
.rwy-container:has(.raw-popover-trigger.is-open) { z-index: 10001; }
.rwy-box { position: relative; flex: 1; min-width: 0; border: 1px solid var(--border-dim); border-radius: 6px; padding: 18px 14px; text-align: center; background: var(--surface-high); box-shadow: 0 7px 20px rgba(27, 28, 25, 0.05); cursor: pointer; transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease; }
.rwy-box:hover { border-color: var(--gold-soft); background: var(--gold-wash); box-shadow: 0 10px 24px rgba(27, 28, 25, 0.08); }
.rwy-box:first-child { border-bottom: 3px solid var(--alert-arr); }
.rwy-box:last-child { border-bottom: 3px solid var(--alert-dep); }
.rwy-box:focus-visible,
.metar-summary:focus-visible,
.taf-summary:focus-visible { outline: 3px solid var(--alert-info); outline-offset: 3px; }
.rwy-label { font-family: var(--font-ui); font-size: 10px; font-weight: 600; color: var(--text-dim); letter-spacing: 0; margin-bottom: 8px; white-space: nowrap; }
.rwy-value { font-family: var(--font-data); font-size: 48px; color: var(--text-bright); font-weight: 600; line-height: 1; }
.val-arr { color: var(--alert-arr); }
.val-dep { color: var(--alert-dep); }

.metar-summary {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    padding-top: 2px;
    border-top: 0;
    cursor: pointer;
}
.metar-summary:hover,
.metar-summary:focus-within,
.metar-summary.is-open { z-index: 3; }
.metar-summary-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--text-bright);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
}
.metar-summary-header > span { white-space: nowrap; }
.metar-summary-header #ui-metar-observed {
    margin-left: auto;
    color: var(--text-dim);
}
.metar-report-status {
    margin: 0;
    padding-left: 10px;
    border-left: 2px solid var(--alert-critical);
    color: var(--alert-critical);
    font-size: 10px;
}
.metar-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}
.metar-additional-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 9px;
}
.metar-detail-rows {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    margin-top: 9px;
}
.metar-detail-rows[hidden],
.metar-detail-rows .weather-metric[hidden] { display: none; }
.metar-detail-rows .weather-metric { min-height: 72px; }
.metar-detail-rows .weather-metric strong { white-space: pre-wrap; }
.metar-trend-detail { min-height: 162px !important; }
.metar-trend-detail.is-message-only { min-height: 72px !important; }
.metar-trend-heading {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-height: 17px;
    margin-bottom: 8px;
}
.metar-trend-heading > span { margin: 0; white-space: nowrap; }
.metar-trend-heading > div {
    color: var(--text-dim);
    font-family: var(--font-data);
    font-size: 10px;
}
.metar-trend-rows { display: grid; gap: 5px; }
.metar-trend-rows[hidden],
.metar-trend-message[hidden] { display: none; }
.metar-trend-message {
    color: var(--text-bright);
    font-family: var(--font-data);
    font-size: 13px;
    font-weight: bold;
    line-height: 1.35;
}
.metar-trend-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    min-height: 19px;
}
.metar-trend-label {
    color: var(--text-dim);
    font-size: 10px;
    font-weight: bold;
}
.metar-trend-value {
    min-width: 0;
    color: var(--text-bright);
    font-family: var(--font-data);
    font-size: 13px;
    font-weight: bold;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.metar-additional-grid:empty { display: none; }
.weather-metric-wide { grid-column: 1 / -1; }
.weather-metric {
    min-width: 0;
    min-height: 68px;
    padding: 11px;
    border: 1px solid var(--border-dim);
    border-radius: 5px;
    background: var(--surface-high);
    box-shadow: 0 4px 14px rgba(27, 28, 25, 0.035);
}
.weather-metric span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 600;
}
.weather-metric strong {
    display: block;
    color: var(--text-bright);
    font-family: var(--font-data);
    font-size: 13px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.raw-popover {
    position: absolute;
    z-index: 100000;
    top: calc(100% + 10px);
    left: 0;
    width: min(520px, calc(100vw - 48px));
    padding: 14px;
    border: 1px solid var(--border-bright);
    border-radius: 8px;
    background: var(--surface-high);
    box-shadow: 0 18px 44px rgba(31, 29, 24, 0.16);
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
}
.raw-popover-portal {
    position: fixed;
}
.raw-popover::before {
    display: none;
}
.raw-popover-dep { right: 0; left: auto; }
.raw-popover-dep::before { right: 24px; left: auto; }
.raw-popover-metar { width: min(680px, calc(100vw - 48px)); }
.raw-popover-taf { width: min(900px, calc(100vw - 48px)); }
.raw-popover-header {
    position: relative;
    min-height: 24px;
    margin-bottom: 8px;
    padding: 2px 34px 7px 0;
    border-bottom: 1px solid var(--border-dim);
    color: var(--text-bright);
    font-family: var(--font-digital);
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}
.raw-popover-close {
    position: absolute;
    top: -5px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.raw-popover-close:hover,
.raw-popover-close:focus-visible { background: var(--surface-low); color: var(--text-bright); outline: none; }
.atis-popover-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.atis-code {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}
.atis-code-arr { color: var(--alert-arr); }
.atis-code-dep { color: var(--alert-dep); }
.raw-popover-text {
    max-height: 280px;
    margin: 0;
    padding: 0;
    overflow: auto;
    color: var(--text-bright);
    font-family: var(--font-digital);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.raw-popover.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.raw-popover-trigger:hover,
.raw-popover-trigger:focus-within,
.raw-popover-trigger.is-open { z-index: 10002; }

.weather-panel { min-height: 230px; overflow: visible; }
.taf-summary {
    position: relative;
    min-width: 0;
    cursor: pointer;
}
.taf-summary-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 12px;
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 12px;
}
.taf-summary-header strong {
    color: var(--text-bright);
    font-size: 14px;
    font-weight: 600;
}
.taf-summary-header > * { white-space: nowrap; }
.taf-segments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.taf-segment {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    background: var(--surface-high);
    box-shadow: 0 7px 20px rgba(27, 28, 25, 0.045);
    border-top: 2px solid var(--alert-dep);
}
.taf-segment-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-dim);
    font-family: var(--font-data);
    font-size: 12px;
}
.taf-segment-header > * { white-space: nowrap; }
.taf-segment-type { color: var(--alert-dep); font-weight: bold; }
.taf-segment:not([data-segment-type="BASE"]) .taf-segment-type { color: var(--taf-change-text); }
.taf-segment:not([data-segment-type="BASE"]) { border-top-color: var(--taf-change); }
.taf-segment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}
.taf-metric { min-width: 0; }
.taf-metric span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 600;
}
.taf-metric strong {
    display: block;
    color: var(--text-bright);
    font-family: var(--font-data);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.taf-temp-metric { grid-column: 1 / -1; }
.taf-empty {
    grid-column: 1 / -1;
    padding: 28px 12px;
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    background: var(--surface-low);
    box-shadow: none;
    color: var(--text-dim);
    font-family: var(--font-data);
    font-size: 12px;
    text-align: center;
}

/* 航班列表模块 */
.flight-panel { min-height: 360px; overflow: visible; }
.schedule-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    flex: 1;
    min-height: 0;
}
.schedule-section {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 260px;
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    background: var(--surface-high);
    box-shadow: none;
    overflow: hidden;
}
.schedule-title {
    position: relative;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    padding: 12px 14px 12px 24px;
    border-bottom: 1px solid var(--border-dim);
    background: var(--surface-high);
    line-height: 1.25;
    white-space: nowrap;
}
.schedule-title::before { content: ''; position: absolute; left: 14px; top: 50%; width: 3px; height: 14px; transform: translateY(-50%); background: currentColor; }
.schedule-arr .schedule-title { color: var(--alert-arr); }
.schedule-dep .schedule-title { color: var(--alert-dep); }
.table-container { flex: 1; min-width: 0; overflow-x: auto; overflow-y: visible; }
table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; text-align: left; }
th { font-family: var(--font-ui); font-size: 11px; font-weight: 600; line-height: 1.25; color: var(--text-dim); padding: 13px 10px; border-bottom: 1px solid var(--border-bright); position: sticky; top: 0; background: var(--surface-high); letter-spacing: 0; white-space: nowrap; }
.ui-time-zone-label,
th:nth-child(1),
td:nth-child(1) { width: 135px; }
th:nth-child(2),
td:nth-child(2) { width: 92px; }
th:nth-child(4),
td:nth-child(4) { width: 185px; }
th:nth-child(5),
td:nth-child(5) { width: 115px; }
td { font-family: var(--font-data); font-size: 14px; font-weight: 500; padding: 13px 10px; border-bottom: 1px solid var(--border-dim); color: var(--text-bright); }
tr:hover td { background-color: var(--gold-wash); color: var(--text-bright); }
.td-time { font-weight: bold; }
.td-arr { color: var(--alert-arr); font-weight: bold; }
.td-dep { color: var(--alert-dep); font-weight: bold; }
.td-flight { font-weight: bold; }
.td-reg { color: var(--text-dim); }
.empty-cell { text-align: center; color: var(--text-dim); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-low); }
::-webkit-scrollbar-thumb { background: #b7b5ae; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* 底部全局状态栏 */
.system-footer {
    margin-top: 24px;
    padding: 14px 18px;
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    background: var(--bg-panel);
    box-shadow: var(--shadow-soft);
    font-family: var(--font-data);
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
}
.footer-hl { color: var(--text-bright); font-weight: bold; }
.status-ok { color: var(--alert-dep); font-weight: bold; }
.status-err { color: var(--alert-critical); font-weight: bold; }

/* 跑道地图模块 */
.runway-map-panel {
    padding-bottom: 12px;
    min-height: 430px;
}

#ui-rwy-map {
    width: 100% !important;
    height: 100% !important;
    min-height: 340px !important;
    flex-shrink: 0 !important;
    flex: 1 1 auto !important;
    display: block !important;
    border: 1px solid var(--border-bright);
    border-radius: 6px;
    box-shadow: none;
    overflow: hidden;
}


/* 压制 Leaflet 默认样式干扰 */
.leaflet-container { font-family: var(--font-ui); }
.leaflet-control-attribution { font-size: 9px; opacity: 0.5; }

.rwy-strip-icon,
.rwy-strip-svg,
.rwy-component-icon,
.rwy-component-svg {
    overflow: visible;
    pointer-events: none;
}

.rwy-strip-svg,
.rwy-component-svg {
    display: block;
    transform-origin: center center;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.28));
}

.rwy-end-label-svg {
    fill: #111;
    font-family: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", sans-serif;
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
}

.rwy-end-label {
    width: 18px;
    height: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    color: #111;
    font-family: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", sans-serif;
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    background: rgba(255,255,255,0.88);
    padding: 0;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
    transform-origin: center center;
}

.rwy-operation-arrow-svg {
    overflow: visible;
    pointer-events: none;
}

.rwy-operation-arrow-svg {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}

@media (max-width: 980px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .dashboard {
        display: flex;
        flex-direction: column;
    }

    .top-row,
    .schedule-grid {
        grid-template-columns: 1fr;
    }

    .runway-map-panel,
    .weather-panel,
    .flight-panel {
        min-height: 260px;
    }
}

@media (max-width: 640px) {
    body { padding: 8px; }
    header { min-height: 64px; margin-bottom: 12px; padding: 10px 12px; align-items: center; flex-wrap: nowrap; gap: 4px; border-radius: 4px; }
    .logo-block { flex: 1 1 0; }
    .airport-selector { width: 100%; }
    .airport-selector-trigger { grid-template-columns: minmax(0, 1fr) auto 10px; gap: 8px; padding: 5px 6px; }
    .airport-selector-name { font-size: 14px; }
    .airport-selector-codes { font-size: 11px; }
    .airport-selector-panel { position: fixed; top: 80px; right: 8px; left: 8px; width: auto; }
    .airport-selector-list { max-height: calc(100dvh - 136px); }
    .sys-clock { flex-shrink: 0; margin-left: auto; font-size: 13px; }
    .dashboard,
    .top-row,
    .schedule-grid { gap: 12px; }
    .panel { width: 100%; padding: 12px; border-radius: 4px; box-shadow: 0 8px 22px rgba(27, 28, 25, 0.055); }
    .panel-header { margin-bottom: 10px; font-size: 12px; }
    table { min-width: 700px; }
    .runway-panel { min-height: 0; }
    .rwy-container { gap: 8px; }
    .rwy-box { min-height: 96px; padding: 14px 8px; }
    .rwy-value { font-size: 28px; }
    .metar-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metar-additional-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .weather-metric { min-height: 64px; padding: 9px; }
    .taf-segments { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .taf-segment { padding: 12px; }
    .runway-map-panel { min-height: 320px; }
    #ui-rwy-map { min-height: 280px !important; }
    .schedule-section { min-height: 0; }
    th { padding: 11px 8px; }
    td { padding: 11px 8px; font-size: 13px; }
    .raw-popover {
        position: fixed;
        top: max(10px, env(safe-area-inset-top));
        right: auto !important;
        left: 10px !important;
        display: flex;
        flex-direction: column;
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        padding: 12px;
        border-radius: 6px;
        overscroll-behavior: contain;
        transform: translateY(-4px);
    }
    .raw-popover::before { display: none; }
    .raw-popover.is-open {
        transform: translateY(0);
    }
    .raw-popover-text {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
    .raw-popover-close { width: 36px; height: 36px; top: -7px; right: -5px; }
    .system-footer { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 12px; padding: 12px; }
}

@media (max-width: 420px) {
    .airport-selector-trigger { grid-template-columns: minmax(0, 1fr) 10px; }
    .airport-selector-codes { display: none; }
    .rwy-label { font-size: 10px; }
    .rwy-value { font-size: 25px; }
}
