:root {
    --bg: #050a08;
    --panel: #0a1510;
    --panel-2: #0f1e17;
    --border: #223b2d;
    --muted: #829a8b;
    --text: #e7f4eb;
    --green: #42f58d;
    --green-soft: #173b27;
    --header-height: 64px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
button, input { font: inherit; }
button { color: inherit; }

.app-shell { height: 100%; display: flex; flex-direction: column; }
.topbar {
    height: var(--header-height);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 16, 12, .98);
    z-index: 1001;
}
.back-button, .topbar-button {
    border: 1px solid #2b4938;
    border-radius: 9px;
    background: #0d1b14;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}
.back-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #bdd0c3;
    font-size: 21px;
}
.back-button:hover, .topbar-button:hover { border-color: var(--green); background: #12271b; }
.brand { flex: 1; min-width: 0; }
.brand h1 { margin: 0; font-size: 19px; line-height: 1.05; letter-spacing: -.01em; }
.eyebrow { display: block; margin-bottom: 3px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.topbar-button { min-height: 40px; display: flex; align-items: center; gap: 7px; padding: 8px 10px; cursor: pointer; font-size: 13px; font-weight: 700; }
.layers-icon { color: var(--green); font-size: 16px; }
.active-layer-count {
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 99px;
    background: #1b3b29;
    color: #9effc2;
    font-size: 10px;
}

.workspace { flex: 1; min-height: 0; display: flex; position: relative; }
.sidebar {
    width: min(340px, calc(100vw - 32px));
    max-height: calc(100% - 32px);
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #2b4938;
    border-radius: 14px;
    background: rgba(8, 18, 13, .96);
    box-shadow: 0 18px 55px rgba(0,0,0,.48);
    backdrop-filter: blur(14px);
    z-index: 900;
    transform-origin: top right;
    transition: opacity .16s ease, transform .18s ease, visibility .18s;
}
.sidebar.is-collapsed { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-8px) scale(.98); }
.panel-header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 11px 17px; border-bottom: 1px solid var(--border); }
.panel-header h2 { margin: 2px 0 0; font-size: 16px; letter-spacing: -.01em; }
.panel-eyebrow { display: block; color: var(--green); font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.panel-close { width: 34px; height: 34px; border: 1px solid #294535; border-radius: 8px; background: #0d1b14; color: #9db2a4; cursor: pointer; font-size: 21px; line-height: 1; }
.panel-close:hover { border-color: var(--green); color: #fff; }
.sidebar-scroll { flex: 1; min-height: 0; padding: 0 12px 12px; overflow-y: auto; scrollbar-color: #31523d transparent; }
.sidebar-footer { padding: 10px 16px; border-top: 1px solid var(--border); color: #6f8577; font-size: 10px; text-align: center; }

.map-search-panel {
    width: min(410px, calc(100% - 120px));
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 800;
}
.search-box {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    margin-bottom: 5px;
    border: 1px solid #31523e;
    border-radius: 12px;
    background: rgba(7, 17, 13, .94);
    box-shadow: 0 8px 28px rgba(0,0,0,.34);
    backdrop-filter: blur(12px);
    color: #7f9988;
}
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px rgba(66,245,141,.1); }
.search-icon { color: var(--green); font-size: 19px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: #effaf2; font-size: 13px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-icon[hidden], .route-clear[hidden] { display: none; }
.route-clear { flex: none; border: 0; padding: 0 3px; background: transparent; color: #315b83; font-size: 20px; line-height: 1; cursor: pointer; }
.route-clear:hover, .route-clear:focus-visible { color: #0e314e; }
.search-box input::placeholder { color: #63786b; }
.search-hint { min-width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #395344; border-radius: 5px; color: #789080; font: 10px ui-monospace, monospace; }
.search-summary { display: none; }
.search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: 51px;
    z-index: 4;
    max-height: min(400px, calc(100vh - 150px));
    margin: 0;
    overflow-y: auto;
    border: 1px solid #294535;
    border-radius: 12px;
    background: rgba(9, 21, 15, .98);
    box-shadow: 0 12px 28px rgba(0,0,0,.35);
}

.control-dock {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 820;
    display: flex;
    align-items: center;
    gap: 7px;
}
.control-group { position: relative; }
.control-pill {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid #31523e;
    border-radius: 999px;
    background: rgba(7, 17, 13, .94);
    box-shadow: 0 7px 24px rgba(0,0,0,.32);
    color: #d9e9de;
    backdrop-filter: blur(12px);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}
.control-pill:hover,
.control-pill[aria-expanded="true"] { border-color: #4f8e68; background: rgba(15, 35, 23, .98); }
.control-pill[aria-expanded="true"] { box-shadow: 0 0 0 2px rgba(66,245,141,.1), 0 8px 26px rgba(0,0,0,.36); }
.pill-icon { color: var(--green); font-size: 15px; }
.facility-pill-icon { color: #ffcf73; }
.pill-selection {
    padding-left: 7px;
    border-left: 1px solid #355142;
    color: #91a99a;
    font-size: 10px;
    font-weight: 650;
}
.pill-chevron { color: #779183; font-size: 13px; transition: transform .15s ease; }
.control-pill[aria-expanded="true"] .pill-chevron { transform: rotate(180deg); }
.pill-count {
    min-width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    margin-left: -2px;
    border-radius: 99px;
    background: #1a3a28;
    color: #a1ffc4;
    font-size: 9px;
}
.control-menu {
    width: 320px;
    max-height: min(610px, calc(100vh - 145px));
    position: absolute;
    top: 50px;
    right: 0;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #31513e;
    border-radius: 14px;
    background: rgba(8, 19, 13, .98);
    box-shadow: 0 18px 50px rgba(0,0,0,.52);
    backdrop-filter: blur(16px);
    scrollbar-color: #31523d transparent;
}
.control-menu[hidden] { display: none; }
.menu-heading { display: flex; flex-direction: column; gap: 2px; padding: 7px 8px 10px; border-bottom: 1px solid #1d3226; }
.menu-heading strong { color: #f0faf3; font-size: 13px; }
.menu-heading small { color: #718679; font-size: 9px; }
.control-menu .layer-list { padding: 6px 0 0; }
.control-menu .layer-row { min-height: 42px; }
.search-result { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-bottom: 1px solid #1c3025; background: transparent; text-align: left; cursor: pointer; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result.is-active { background: #14291d; }
.search-result.is-active { box-shadow: inset 2px 0 var(--green); }
.search-result b { min-width: 43px; color: #fff; font-size: 12px; }
.search-result span { overflow: hidden; color: #92aa9a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { padding: 11px; color: #819588; font-size: 10px; line-height: 1.4; }

.layer-section { border-bottom: 1px solid #1c3025; }
.layer-section:last-child { border-bottom: 0; }
.section-heading { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 5px; color: #799080; cursor: pointer; list-style: none; }
.section-heading::-webkit-details-marker { display: none; }
.section-heading > span:first-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.section-heading b { color: #dcece1; font-size: 12px; letter-spacing: 0; }
.section-heading small { overflow: hidden; color: #708477; font-size: 9px; font-weight: 500; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.summary-chevron { color: #759081; font-size: 17px; transition: transform .15s ease; }
.layer-section[open] .summary-chevron { transform: rotate(180deg); }
.summary-meta { display: flex; align-items: center; gap: 8px; }
.section-note { max-width: 170px; overflow: hidden; font-size: 8px; font-weight: 600; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.section-reset { padding: 0; border: 0; background: none; color: #6da982; cursor: pointer; font-size: 9px; }
.layer-list { display: grid; gap: 2px; padding: 0 0 10px; }
.layer-row {
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 7px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s;
}
.layer-row:hover { background: rgba(39, 75, 53, .35); }
.layer-row input { position: absolute; opacity: 0; pointer-events: none; }
.layer-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.layer-copy strong { color: #dcece1; font-size: 12px; font-weight: 650; }
.layer-copy small { overflow: hidden; color: #718679; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.switch { width: 28px; height: 16px; flex: 0 0 auto; position: relative; border: 1px solid #405348; border-radius: 99px; background: #18231d; transition: .15s; }
.switch::after { content: ""; width: 10px; height: 10px; position: absolute; left: 2px; top: 2px; border-radius: 50%; background: #728078; transition: .15s; }
.layer-row input:checked + .switch { border-color: #39c979; background: #176138; }
.layer-row input:checked + .switch::after { left: 14px; background: #a8ffc9; }
.radio-dot { width: 15px; height: 15px; flex: 0 0 auto; border: 1px solid #4a6052; border-radius: 50%; box-shadow: inset 0 0 0 3px #0c1812; }
.layer-row input:checked + .radio-dot { border-color: var(--green); background: var(--green); }
.swatch { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 2px; }
.swatch.y90 { background: #7dffa8; }
.swatch.a90 { background: #ffad5c; }
.swatch.n90 { background: #c3a2ff; }
.swatch.alb { background: #ff839b; }
.swatch.pvd { background: #61d6ff; }
.swatch.zbw-low { background: #ffe56b; }
.swatch.zbw-high { background: #61d6ff; }
.swatch.class-b { background: #39d7ff; }
.swatch.class-c { background: #ff65c8; }
.swatch.class-d { background: #6baeff; }
.symbol-preview { width: 12px; flex: 0 0 auto; text-align: center; font-size: 12px; font-weight: 800; }
.airport-symbol { color: #62d8ff; }
.fix-symbol { color: #ffe15f; font-size: 9px; }
.vor-symbol { color: #ffb45f; font-size: 13px; }
.airway-symbol { color: #72e8d1; }
.video-symbol { color: #9eb4a5; }
.ring-symbol { color: #6c9f7d; }
.orientation-symbol { color: #75dcff; }
.radar-symbol { color: #ff6262; }
.weather-status { padding: 2px 5px; border: 1px solid #344b3d; border-radius: 4px; color: #708679; font-size: 8px; letter-spacing: .07em; }
.weather-status.is-loading { border-color: #7f7332; color: #e9d86e; }
.weather-status.is-live { border-color: #287b4d; color: #72ef9f; }
.weather-status.is-error { border-color: #7f3434; color: #ff8585; }
.radar-legend { display: flex; align-items: center; gap: 7px; padding: 6px 8px 0 44px; color: #637a6b; font-size: 7px; font-weight: 800; }
.radar-gradient { height: 5px; flex: 1; border-radius: 99px; background: linear-gradient(90deg,#43c7ff,#29da5c,#fff044,#ff9d24,#ff3333,#d22bff); }

.map-wrap { flex: 1; min-width: 0; position: relative; overflow: hidden; background: #050a08; }

#map { position: absolute; inset: 0; background: #07110d; }
.maplibregl-map { font: inherit; }
.maplibregl-canvas { outline: none; }
.maplibregl-control-container { display: none; }

.sector-label {
    min-width: 54px;
    padding: 3px 5px;
    border: 1px solid rgba(255,229,107,.62);
    border-radius: 4px;
    background: rgba(3,10,7,.82);
    box-shadow: 0 1px 6px rgba(0,0,0,.65);
    color: #fff3a7;
    pointer-events: none;
    text-align: center;
    text-shadow: 0 1px 2px #000;
    white-space: nowrap;
}
.sector-label strong { display: block; font-size: 10px; line-height: 1; letter-spacing: .08em; }
.sector-label span { display: block; margin-top: 2px; font-size: 7px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sector-label.sector-color-1 { border-color: rgba(97,214,255,.62); color: #bdeeff; }
.sector-label.sector-color-2 { border-color: rgba(195,162,255,.62); color: #ddcaff; }
.sector-label.sector-color-3 { border-color: rgba(255,131,155,.62); color: #ffc0cc; }

.airspace-label {
    display: none;
    min-width: 38px;
    padding: 3px 5px 4px;
    border: 1px solid color-mix(in srgb, currentColor 68%, transparent);
    border-radius: 5px;
    background: rgba(3, 9, 7, .9);
    box-shadow: 0 1px 5px rgba(0,0,0,.8);
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
    transition: opacity .1s ease;
}
.show-airspace-labels .airspace-label { display: grid; justify-items: center; }
.airspace-label.is-collision-hidden { opacity: 0; }
.airspace-label.class-b { color: #39d7ff; }
.airspace-label.class-c { color: #ff72cb; }
.airspace-label.class-d { color: #62aaff; }
.airspace-ident {
    display: none;
    margin-bottom: 2px;
    color: currentColor;
    font: 900 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .05em;
    text-shadow: 0 1px 2px #000;
}
.show-airspace-identifiers .airspace-ident { display: block; }
.airspace-ident b {
    display: inline-grid;
    width: 11px;
    height: 11px;
    place-items: center;
    border: 1px solid currentColor;
    font-size: 7px;
    line-height: 1;
}
.airspace-area {
    display: none;
    margin-bottom: 3px;
    padding-bottom: 2px;
    border-bottom: 1px solid color-mix(in srgb, currentColor 45%, transparent);
    color: #eef6f1;
    font: 800 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .025em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px #000;
}
.show-airspace-identifiers .airspace-area { display: block; }
.airspace-altitude {
    display: grid;
    min-width: 27px;
    justify-items: stretch;
    color: currentColor;
    font: 900 10px/.82 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: -.02em;
    text-shadow: 0 1px 2px #000;
}
.airspace-altitude i {
    height: 1px;
    margin: 2px -1px;
    background: currentColor;
    box-shadow: none;
}
.delta-ceiling {
    display: block;
    min-width: 26px;
    padding: 1px 3px 0;
    border: 1.5px solid currentColor;
    background: rgba(3, 9, 7, .95);
    color: currentColor;
    font: 900 11px/1.05 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: -.03em;
    text-shadow: none;
}

.map-tools { position: absolute; right: 14px; bottom: 43px; z-index: 700; display: grid; gap: 5px; }
.map-tools button { width: 39px; height: 39px; border: 1px solid #3a5846; border-radius: 8px; background: rgba(8,22,14,.92); box-shadow: 0 4px 16px rgba(0,0,0,.28); cursor: pointer; font-size: 19px; font-weight: 700; }
.map-tools button:hover { border-color: var(--green); background: #132b1d; }
.map-readout { position: absolute; right: 14px; bottom: 12px; z-index: 700; padding: 5px 7px; border: 1px solid rgba(69,101,79,.6); border-radius: 5px; background: rgba(4,13,8,.82); color: #789080; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; pointer-events: none; }
.panel-backdrop { display: none; }

.airport-marker, .fix-marker, .vor-marker, .airway-label, .ring-label { background: none; border: 0; }
.marker-inner { position: relative; width: 18px; height: 18px; white-space: nowrap; filter: drop-shadow(0 1px 2px #000); }
.marker-inner .glyph { position: absolute; inset: 0; display: block; overflow: visible; fill: none; }
.marker-inner .label { position: absolute; left: 12px; top: -8px; display: none; padding: 1px 3px; border-radius: 3px; background: rgba(2, 7, 4, .78); color: #ecf7ef; text-shadow: 0 1px 2px #000, 0 0 4px #000; font: 800 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .025em; }
.show-airport-labels .airport-marker .label, .show-fix-labels .fix-marker .label, .show-vor-labels .vor-marker .label { display: block; }
.fix-marker { display: none; }
.show-fix-symbols .fix-marker { display: block; }
.airport-marker .glyph { width: 18px; height: 18px; color: #75dcff; stroke: currentColor; stroke-width: 1.4; filter: drop-shadow(0 0 1px #000); }
.airport-marker .label { color: #9fe7ff; }
.fix-marker .glyph { width: 18px; height: 18px; color: #ffe36b; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 1px #000); }
.vice-source-symbol path { vector-effect: non-scaling-stroke; }
.fix-marker.navaid .glyph { inset: 3px; width: 12px; height: 12px; }
.fix-marker .label { color: #ffec97; }
.vor-marker .glyph { width: 18px; height: 18px; color: #ffb45f; stroke: currentColor; stroke-width: 1.15; fill: rgba(255, 180, 95, .08); stroke-linejoin: round; filter: drop-shadow(0 0 2px #000); }
.vor-marker .label { color: #ffd19a; }
.airway-label { display: none; }
.show-airport-labels .airway-label { display: block; }
.airway-label span { display: block; transform: translate(-50%, -50%); padding: 2px 5px; border: 1px solid rgba(87,213,191,.8); border-radius: 4px; background: rgba(2,14,10,.94); color: #b4fff0; font: 800 10px ui-monospace, monospace; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.7); }
.ring-label span { color: #70917b; font: 8px ui-monospace, monospace; white-space: nowrap; }

.maplibregl-popup-content, .maplibregl-popup-tip { background: #0c1912; color: #e8f4eb; }
.maplibregl-popup-content { padding: 11px 13px; border: 1px solid #31513e; border-radius: 9px; box-shadow: 0 8px 28px rgba(0,0,0,.55); font-size: 11px; line-height: 1.45; }
.maplibregl-popup-content h3 { margin: 0 0 2px; color: #fff; font-size: 13px; }
.maplibregl-popup-content p { margin: 2px 0; color: #9fb2a5; }
.maplibregl-popup-close-button { color: #8caa97; font-size: 18px; }
.popup-tag { display: inline-block; margin-top: 5px; padding: 2px 5px; border-radius: 4px; background: #183524; color: #77eba3; font-size: 9px; font-weight: 800; }
.ownership-list { display: grid; gap: 3px; margin-top: 7px; }
.ownership-row { display: flex; justify-content: space-between; gap: 15px; padding-top: 3px; border-top: 1px solid #22382b; }
.ownership-row b { color: #fff; }
.user-location-marker { width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: #43a6ff; box-shadow: 0 1px 5px #000; }
.search-highlight-marker {
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(66, 245, 141, .16);
    box-shadow: 0 0 0 4px rgba(66, 245, 141, .22), 0 0 18px rgba(66, 245, 141, .9);
}
.search-highlight-marker::before,
.search-highlight-marker::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    background: #fff;
    transform: translate(-50%, -50%);
}
.search-highlight-marker::before { width: 2px; height: 40px; }
.search-highlight-marker::after { width: 40px; height: 2px; }
.search-highlight-marker span {
    position: absolute;
    inset: -10px;
    border: 2px solid rgba(99, 255, 162, .8);
    border-radius: 50%;
    animation: search-pulse 1.35s ease-out infinite;
}
.search-highlight-marker.airport { background: rgba(98, 216, 255, .2); box-shadow: 0 0 0 4px rgba(98, 216, 255, .24), 0 0 18px rgba(98, 216, 255, .9); }
.search-highlight-marker.airport span { border-color: rgba(98, 216, 255, .85); }
.search-highlight-marker.fix,
.search-highlight-marker.navaid { background: rgba(255, 225, 95, .18); box-shadow: 0 0 0 4px rgba(255, 225, 95, .22), 0 0 18px rgba(255, 225, 95, .86); }
.search-highlight-marker.fix span,
.search-highlight-marker.navaid span { border-color: rgba(255, 225, 95, .82); }
@keyframes search-pulse {
    from { opacity: .95; transform: scale(.65); }
    to { opacity: 0; transform: scale(1.45); }
}

@media (max-width: 760px) {
    :root { --header-height: 56px; }
    .topbar { padding: 0 10px; gap: 10px; }
    .back-button { width: 37px; height: 37px; }
    .brand h1 { font-size: 17px; }
    .map-search-panel { width: calc(100% - 20px); top: 10px; left: 10px; }
    .search-box { height: 43px; border-radius: 10px; }
    .search-hint { display: none; }
    .search-results { top: 48px; max-height: min(48vh, 340px); }
    .control-dock {
        width: calc(100% - 20px);
        top: 61px;
        right: 10px;
        justify-content: flex-end;
        gap: 5px;
    }
    .control-pill { min-height: 37px; gap: 5px; padding: 0 9px; font-size: 10px; }
    .pill-icon { display: none; }
    .pill-selection { display: none; }
    .pill-count { min-width: 17px; height: 17px; }
    .control-menu {
        width: min(330px, calc(100vw - 20px));
        position: fixed;
        top: 161px;
        right: 10px;
        max-height: calc(100vh - 171px);
    }
    .map-readout { bottom: 13px; }

    .map-tools { right: 10px; bottom: 42px; }
}

@media (min-width: 761px) and (max-width: 980px) {
    .map-search-panel { width: 330px; }
    .control-dock { top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
    .search-highlight-marker span { animation: none; }
}

/* Compact chart-workspace chrome, inspired by the familiar aviation-map layout. */
.map-toolbar { position: absolute; z-index: 820; top: 0; left: 0; right: 0; height: 29px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 5px; background: rgba(39, 48, 57, .84); box-shadow: 0 1px 3px #2635477a; color: #fff; }
.map-search-panel { position: relative; top: auto; left: auto; width: 220px; flex: 0 1 220px; height: 23px; z-index: 3; }
.search-box { height: 23px; margin: 0; padding: 0 3px 0 6px; gap: 2px; border: 1px solid #555; border-radius: 2px; background: #fff; box-shadow: inset 0 1px 2px #bbb; color: #1b2b38; backdrop-filter: none; }
.search-box:focus-within { border-color: #2c72ae; box-shadow: 0 0 0 2px #80c6fd7a; }
.search-box input { color: #233344; font-size: 12px; }
.search-box input::placeholder { color: #89949d; }
.search-icon { color: #315b83; font-size: 19px; line-height: 1; }
.search-results { top: 26px; border: 1px solid #9eabb8; border-radius: 3px; background: #fff; box-shadow: 0 7px 16px #15263880; }
.search-result { border-bottom-color: #e4e9ed; }
.search-result b { color: #1a3c62; }
.search-result span, .search-empty { color: #556576; }
.search-result:hover, .search-result.is-active { background: #e1ecf8; }
.search-result.is-active { box-shadow: inset 2px 0 #2672ae; }
.toolbar-spacer { flex: 1; }
.toolbar-link { height: 27px; border: 0; padding: 0 5px; background: none; color: #fff; text-shadow: 0 1px 1px #1d2731; font-size: 13px; cursor: pointer; white-space: nowrap; }
.toolbar-link:hover, .toolbar-link[aria-expanded="true"] { background: #ffffff33; }
.control-dock { position: static; display: block; }
.layers-button { display: flex; align-items: center; gap: 6px; }
.layers-hint {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 218px;
    max-width: calc(100vw - 20px);
    padding: 12px 15px;
    border: 1px solid #d3aa50;
    border-radius: 8px;
    background: #fff5d9;
    box-shadow: 0 4px 18px #182a3955;
    color: #483714;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
}
.layers-hint::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 32px;
    width: 12px;
    height: 12px;
    border-top: 1px solid #d3aa50;
    border-left: 1px solid #d3aa50;
    background: #fff5d9;
    transform: rotate(45deg);
}
.layers-hint strong, .layers-hint span { display: block; }
.layers-hint[hidden] { display: none; }
.pill-count { background: #ffffff38; color: #fff; font-size: 10px; }
.control-menu { top: 29px; width: 328px; max-height: min(650px, calc(100vh - 103px)); padding: 0 6px 7px; border: 1px solid #7c9bb5; border-radius: 2px; background: #f7f9fb; box-shadow: 0 8px 23px #182a39a3; color: #2f4459; scrollbar-color: #b9cad8 #fff; backdrop-filter: none; }
.menu-heading { padding: 10px 8px; border-bottom: 1px solid #cbd6e0; }
.menu-heading strong { color: #213c57; font-size: 14px; }
.menu-heading small, .layer-copy small { color: #677b89; font-size: 10px; }
.menu-subheading { display: flex; justify-content: space-between; padding: 9px 8px 4px; color: #416481; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.menu-subheading span { color: #738da0; }
.control-menu .layer-list { padding: 0 0 5px; }
.control-menu .layer-row { min-height: 34px; padding: 4px 7px; border-radius: 3px; }
.layer-row:hover { background: #e7f0f8; }
.layer-row input:focus-visible + .switch { outline: 2px solid #276ba4; outline-offset: 2px; }
.layer-copy strong { color: #263d51; font-size: 11px; }
.switch { background: #d0d8df; border-color: #aab8c3; }
.switch::after { background: #fff; }
.layer-row input:checked + .switch { background: #467bb0; border-color: #467bb0; }
.layer-row input:checked + .switch::after { background: #fff; }
.weather-status { color: #596f80; }
.radar-legend { color: #5e7588; }
.chart-pills { position: absolute; z-index: 710; top: 33px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; max-width: calc(100% - 18px); overflow-x: auto; padding: 2px 4px 5px; scrollbar-width: none; }
.chart-pills::-webkit-scrollbar { display: none; }
.chart-pill { display: block; cursor: pointer; white-space: nowrap; }
.chart-pill input { position: absolute; opacity: 0; pointer-events: none; }
.chart-pill span { display: block; padding: 2px 10px 3px; border: 1px solid #8494a2; border-radius: 10px; background: linear-gradient(#fff, #dce3e9); box-shadow: 0 1px 3px #203447a6; color: #1e2e3d; font-size: 11px; line-height: 1.1; font-weight: 600; }
.chart-pill:hover span { background: #e9f5ff; }
.chart-pill input:checked + span { background: linear-gradient(#648fb3, #316189); color: #fff; border-color: #204a70; }
.chart-pill input:focus-visible + span { outline: 2px solid #225f9b; outline-offset: 2px; }
.flight-plan-panel { position: absolute; z-index: 810; top: 64px; left: 15px; width: min(385px, calc(100vw - 30px)); max-height: calc(100% - 79px); overflow-y: auto; border: 1px solid #8095a8; border-radius: 4px; background: #f4f5f6; box-shadow: 0 7px 24px #142a39a3; color: #263d52; font-size: 12px; }
.flight-plan-panel[hidden], .plan-distance[hidden], .search-results[hidden], .radar-legend[hidden] { display: none; }
.flight-plan-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-bottom: 1px solid #c4d1dd; background: linear-gradient(#fff,#e7edf2); }
.flight-plan-head strong { font-size: 14px; color: #1e354b; }
.flight-plan-head button { width: 22px; height: 22px; border: 1px solid #b4c1cb; border-radius: 3px; background: #fff; color: #455f73; cursor: pointer; font-size: 18px; line-height: 16px; }
#flight-plan-form, #flight-plan-compare-form { padding: 12px 10px 8px; }
#plan-route, #plan-route-compare { display: block; width: 100%; margin-top: 5px; padding: 7px; border: 1px solid #aebbc6; border-radius: 2px; background: #fff; color: #1c3347; outline-color: #2677b7; font-size: 12px; text-transform: uppercase; }
#plan-route::placeholder, #plan-route-compare::placeholder { color: #939fa9; text-transform: none; }
.waypoint-label { display: block; font-weight: 600; }
#plan-route, #plan-route-compare { min-height: 78px; resize: vertical; font-family: inherit; line-height: 1.5; }
.plan-actions { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.plan-actions button { padding: 6px 11px; border: 1px solid #2a638e; border-radius: 3px; background: linear-gradient(#6aa1cb, #2d6b9c); color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.plan-actions button:hover { filter: brightness(1.08); }
.plan-actions button:last-child { background: #fff; border-color: #adbcc9; color: #44617a; }
.plan-message { padding: 8px 10px; border-top: 1px solid #d4dfe7; color: #5c7180; line-height: 1.4; overflow-wrap: anywhere; }
.plan-message.is-error { color: #a23b36; background: #fff1ef; }
.plan-distance { display: grid; grid-template-columns: 1fr auto; gap: 2px; align-items: center; padding: 9px 10px; border-top: 1px solid #cbd7e0; background: #e5eef6; }
.plan-distance span { font-weight: 700; }
.plan-distance strong { color: #174c78; font-size: 19px; }
.plan-distance small { grid-column: 1 / -1; color: #657a88; }
.map-identity { border-radius: 3px; }
.map-tools button { border-radius: 50%; background: linear-gradient(#eff7fb,#82a9c8); color: #214362; border-color: #476b87; }
.map-tools button:hover { background: #d4ebfa; border-color: #316d9b; }
@media (max-width: 760px) {
    .map-toolbar { height: 37px; gap: 5px; padding: 0 6px; }
    .map-search-panel { width: auto; flex: 1; height: 27px; min-width: 0; }
    .search-box { height: 27px; }
    .toolbar-link { height: 35px; font-size: 11px; }
    .layers-button { gap: 3px; }
    .control-menu { position: fixed; top: 37px; right: 5px; max-height: calc(100vh - 56px); width: min(328px, calc(100vw - 10px)); }
    .search-results { top: 29px; }
    .chart-pills { top: 42px; left: 0; right: 0; transform: none; justify-content: flex-start; max-width: 100%; }
    .chart-pill span { font-size: 10px; padding: 3px 8px; }
    .flight-plan-panel { top: 76px; left: 8px; max-height: calc(100% - 84px); }
}
@media (min-width: 761px) and (max-width: 980px) { .map-search-panel { width: 220px; } .control-dock { position: static; } }
.flight-plan-waypoint { padding: 2px 5px; border: 1px solid #3974a5; border-radius: 3px; background: #fff; box-shadow: 0 1px 3px #1118; color: #1c527e; font: 700 11px/1.2 ui-monospace, monospace; white-space: nowrap; pointer-events: none; }
.flight-plan-airway { border-color: #2572d4; background: #2572d4; color: #fff; }
@media (max-width: 760px) {
    .control-dock { width: auto; flex: 0 0 auto; }
    .toolbar-spacer { display: none; }
    .map-search-panel { flex: 1 1 auto; }
}

#flight-plan-compare-form { border-top: 1px solid #c4d1dd; }
.route-one-label { color: #205fae; }
.route-two-label, .route-two-distance strong { color: #a64b05; }
.plan-comparison { padding: 10px; border-top: 1px solid #cbd7e0; background: #fff; font-weight: 700; line-height: 1.5; }
.plan-comparison[hidden] { display: none; }
.flight-plan-waypoint.flight-plan-compare { border-color: #c45b08; color: #a64b05; }
.flight-plan-airway.flight-plan-compare { background: #c45b08; color: #fff; }

/* Y90 flows share one layer toggle; changing flow never stacks alternatives. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.y90-flow-picker { min-width: 0; margin: 0 7px 8px 34px; padding: 7px 8px 8px; border: 1px solid #c7d6e1; border-radius: 6px; background: #edf3f8; }
.y90-flow-picker legend { padding: 0 4px; color: #42627b; font-size: 10px; font-weight: 700; }
.y90-flow-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.y90-flow-options label { position: relative; cursor: pointer; min-width: 0; }
.y90-flow-options input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.y90-flow-options span { display: flex; align-items: center; justify-content: center; min-height: 34px; border: 1px solid #b3c5d3; border-radius: 4px; background: #fff; color: #37566e; font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.y90-flow-options label:hover span { background: #dcebf6; border-color: #749ab6; }
.y90-flow-options input:checked + span { background: #245b82; border-color: #174768; color: #fff; box-shadow: inset 0 -2px 0 #7dffa8; }
.y90-flow-options input:focus-visible + span { outline: 2px solid #2274b8; outline-offset: 2px; }
.y90-flow-picker > small { display: block; margin-top: 7px; color: #657b8b; font-size: 10px; line-height: 1.4; }
.y90-flow-bar { position: absolute; z-index: 700; bottom: 26px; left: 14px; width: 310px; max-width: calc(100% - 78px); border: 1px solid #7892a8; border-radius: 8px; background: #f7f9fbf5; color: #294c65; box-shadow: 0 3px 16px #152b4060; }
.y90-flow-bar[hidden] { display: none; }
.y90-flow-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 5px 0 12px; }
.y90-flow-head strong { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.y90-flow-head i { width: 7px; height: 7px; border-radius: 50%; background: #23804c; box-shadow: 0 0 0 3px #23804c16; }
.y90-flow-head strong span { font-size: 10px; font-weight: 500; color: #657c8d; }
.y90-flow-head button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #607b8f; font-size: 21px; cursor: pointer; }
.y90-flow-head button:hover { background: #e0eaf2; color: #234c6a; }
.y90-flow-bar .y90-flow-picker { margin: 0; padding: 2px 10px 10px; border: 0; background: transparent; }
.y90-flow-bar .y90-flow-options span { min-height: 38px; }
@media (max-width: 760px) {
    .y90-flow-bar { left: 8px; bottom: 26px; width: 294px; }
    .y90-flow-bar .y90-flow-options { gap: 3px; }
    .y90-flow-bar .y90-flow-picker { padding: 2px 7px 8px; }
    .y90-flow-bar .y90-flow-options span { min-height: 44px; font-size: 10px; }
}
