:root {
    color-scheme: light;
    --ink: #102f35;
    --muted: #6f8386;
    --deep: #09262c;
    --teal: #176d6a;
    --orange: #cf6d45;
    --paper: #fbfcf8;
    --line: #d9e1dc;
    --shadow: 0 16px 50px rgba(6, 35, 40, .18);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: var(--deep); }
button, input { font: inherit; }
button { color: inherit; }
h1:focus { outline: none; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgba(207,109,69,.45); outline-offset: 2px; }

.atlas-shell { height: 100dvh; display: grid; grid-template-rows: 68px minmax(0,1fr); }
.topbar { z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; color: #eef7f3; background: linear-gradient(100deg,#08242a,#10353a); border-bottom: 1px solid rgba(255,255,255,.09); box-shadow: 0 5px 18px rgba(0,0,0,.2); }
.brand-block { display: flex; align-items: center; gap: 12px; }
.brand-block h1 { margin: 0; font-size: 19px; line-height: 1.1; letter-spacing: -.02em; }
.brand-block p { margin: 3px 0 0; color: #99b9b8; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { position: relative; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; left: 50%; top: 50%; background: rgba(255,255,255,.45); transform: translate(-50%,-50%); }
.brand-mark::before { width: 26px; height: 1px; }
.brand-mark::after { width: 1px; height: 26px; }
.brand-mark span { position: absolute; z-index: 1; left: 12px; top: 7px; width: 9px; height: 20px; background: var(--orange); clip-path: polygon(50% 0,100% 100%,50% 74%,0 100%); transform: rotate(24deg); }
.cycle-chip { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; color: #b6cdca; background: rgba(255,255,255,.055); font-size: 12px; }
.cycle-chip strong { color: #eff8f4; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #63c592; box-shadow: 0 0 0 4px rgba(99,197,146,.12); }
.flight-warning { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid rgba(255,190,92,.34); border-radius: 8px; color: #ffe3b3; background: rgba(112,58,18,.42); box-shadow: inset 3px 0 0 #f2a44f; font-size: 10px; }
.flight-warning strong { color: #fff4df; font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.flight-warning span { color: #eacda5; }

.map-stage { position: relative; min-height: 0; overflow: hidden; background: #dfe7e2; }
.airport-map { position: absolute; inset: 0; }
.map-loading { position: absolute; z-index: 4; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; color: #49646a; background: rgba(238,242,236,.9); transition: opacity .22s,visibility .22s; }
.map-loading.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.map-loading.has-error { flex-direction: column; color: #793c2a; }
.spinner { width: 24px; height: 24px; border: 3px solid rgba(23,109,106,.16); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.search-wrap { position: absolute; z-index: 8; top: 22px; left: 22px; width: min(420px,calc(100vw - 44px)); }
.map-stage.procedure-active .search-wrap,
.map-stage.procedure-active .region-switcher,
.map-stage.procedure-active .legend-card { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-8px); }
.search-box { display: flex; align-items: center; height: 52px; padding: 0 12px 0 16px; border: 1px solid rgba(15,63,67,.16); border-radius: 12px; background: rgba(252,253,249,.97); box-shadow: 0 10px 35px rgba(8,38,43,.18); backdrop-filter: blur(10px); }
.search-box:focus-within { border-color: #2c8c87; box-shadow: 0 10px 35px rgba(8,38,43,.2),0 0 0 3px rgba(44,140,135,.16); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 15px; }
.search-box input::placeholder { color: #799095; }
.search-icon { position: relative; width: 16px; height: 16px; margin-right: 12px; border: 2px solid var(--teal); border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; right: -5px; bottom: -2px; width: 6px; height: 2px; background: var(--teal); transform: rotate(45deg); }
.search-box kbd { padding: 2px 7px; border: 1px solid #d5ded9; border-radius: 5px; color: #7b8d8f; background: #f0f3ef; font: 11px ui-monospace,monospace; }
.clear-search { width: 28px; height: 28px; margin-right: 5px; border: 0; border-radius: 50%; color: #61777a; background: transparent; font-size: 21px; cursor: pointer; }
.clear-search:hover { background: #eef2ee; }
.search-results, .search-empty { margin-top: 8px; overflow: hidden; border: 1px solid rgba(15,63,67,.14); border-radius: 12px; background: rgba(252,253,249,.98); box-shadow: var(--shadow); }
.search-results button { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 11px; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid #e7ebe7; text-align: left; background: transparent; cursor: pointer; }
.search-results button:last-child { border-bottom: 0; }
.search-results button:hover { background: #eef5f1; }
.result-ident { padding: 5px 6px; border-radius: 5px; color: #fff; background: var(--teal); text-align: center; font: 700 12px ui-monospace,monospace; }
.result-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.result-copy strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.result-copy small { color: #708387; font-size: 11px; }
.result-arrow { color: var(--orange); font-size: 18px; }
.search-empty { padding: 16px; color: var(--muted); font-size: 13px; }

.region-switcher { position: absolute; z-index: 6; top: 88px; left: 22px; display: flex; align-items: center; gap: 3px; padding: 5px; border: 1px solid rgba(15,63,67,.13); border-radius: 9px; background: rgba(251,252,248,.93); box-shadow: 0 8px 22px rgba(9,37,42,.13); }
.region-switcher span { padding: 0 7px; color: #778b8c; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.region-switcher button { padding: 6px 8px; border: 0; border-radius: 5px; background: transparent; font-size: 11px; cursor: pointer; }
.region-switcher button:hover { color: white; background: var(--teal); }

.legend-card { position: absolute; z-index: 5; left: 22px; bottom: 38px; display: grid; grid-template-columns: auto auto; gap: 8px 14px; padding: 11px 13px; border-radius: 9px; background: rgba(251,252,248,.92); box-shadow: 0 7px 22px rgba(8,38,43,.12); font-size: 11px; }
.legend-card span { display: flex; align-items: center; gap: 7px; }
.legend-card small { grid-column: 1/-1; color: #78898b; }
.legend-dot { width: 9px; height: 9px; border: 1.5px solid; border-radius: 50%; }
.procedure-dot { border-color: #713621; background: var(--orange); }
.airport-dot { border-color: var(--teal); background: #f4f7f2; }
.map-status { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 20px; height: 27px; padding: 0 12px; color: #b7cbc9; background: rgba(7,34,39,.91); font-size: 10px; }
.map-status span:last-child { margin-left: auto; }
.map-status strong { color: white; }

.airport-panel { position: absolute; z-index: 12; top: 0; right: 0; bottom: 27px; width: min(470px,100vw); overflow: hidden auto; color: var(--ink); background: rgba(251,252,248,.985); box-shadow: -18px 0 55px rgba(5,29,33,.22); transform: translateX(calc(100% + 40px)); transition: transform .26s cubic-bezier(.22,.7,.25,1); }
.airport-panel.is-open { transform: translateX(0); }
.panel-close { position: absolute; z-index: 2; top: 15px; right: 15px; width: 34px; height: 34px; border: 1px solid #dce3de; border-radius: 50%; color: #617477; background: rgba(251,252,248,.92); font-size: 22px; line-height: 1; cursor: pointer; }
.panel-close:hover { color: var(--ink); background: #eaf1ed; }
.panel-drag-handle { display: none; }
.airport-heading { padding: 29px 60px 20px 26px; color: #f4faf7; background: linear-gradient(135deg,#0c3439,#15545a); }
.eyebrow { margin-bottom: 9px; color: #73908e; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.airport-heading .eyebrow { color: #8fc0bb; }
.airport-title-line { display: flex; align-items: flex-start; gap: 14px; }
.airport-ident { flex: none; padding: 8px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; background: rgba(255,255,255,.08); font: 800 16px ui-monospace,monospace; letter-spacing: .04em; }
.airport-title-line h2 { margin: 1px 0 7px; font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
.airport-title-line p { margin: 0; color: #a9c4c1; font: 11px ui-monospace,monospace; }
.airport-facts { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--line); background: #f4f6f1; }
.airport-facts div { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; border-right: 1px solid var(--line); }
.airport-facts div:last-child { border-right: 0; }
.airport-facts small { color: #718487; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.airport-facts strong { font: 700 13px ui-monospace,monospace; }

.procedure-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding: 20px 22px 12px; }
.procedure-toolbar > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.procedure-toolbar .eyebrow { margin: 0; }
.procedure-toolbar > div > strong { color: var(--orange); font-size: 12px; }
.filter-pills { display: flex; gap: 2px; padding: 3px; border-radius: 7px; background: #e9eeea; }
.filter-pills button { padding: 5px 7px; border: 0; border-radius: 5px; color: #667a7d; background: transparent; font-size: 9px; font-weight: 750; cursor: pointer; }
.filter-pills button.active { color: white; background: var(--teal); box-shadow: 0 2px 5px rgba(16,70,70,.22); }
.procedure-list { padding: 0 15px 24px; }
.procedure-group h3 { display: flex; align-items: center; gap: 8px; margin: 14px 7px 7px; color: #5e7376; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.procedure-group h3 span { padding: 3px 5px; border-radius: 4px; color: white; background: #6f8889; font-size: 8px; }
.procedure-card { display: grid; grid-template-columns: 24px minmax(0,1fr) auto 16px; align-items: center; gap: 9px; width: 100%; min-height: 63px; margin-bottom: 6px; padding: 10px 12px; border: 1px solid #dfe5e0; border-radius: 9px; text-align: left; background: white; box-shadow: 0 2px 6px rgba(20,53,55,.04); cursor: pointer; transition: border-color .12s,transform .12s,box-shadow .12s; }
.procedure-card:hover { border-color: #8fbbb5; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(17,69,70,.09); }
.procedure-route-mark { position: relative; width: 22px; height: 32px; }
.procedure-route-mark::before { content: ""; position: absolute; left: 10px; top: 3px; bottom: 3px; width: 1px; background: #92aaa7; }
.procedure-route-mark::after { content: ""; position: absolute; left: 7px; top: 4px; width: 7px; height: 7px; border: 2px solid var(--orange); border-radius: 50%; background: white; box-shadow: 0 18px 0 -1px white,0 18px 0 1px var(--teal); }
.procedure-card-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.procedure-card-copy strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.procedure-card-copy small { color: #75888a; font-size: 10px; }
.service-badge, .map-badge { padding: 4px 6px; border: 1px solid #9fc8ae; border-radius: 4px; color: #276846; background: #eaf6ed; font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.card-chevron { color: #92a29f; font-size: 21px; }
.empty-procedures { margin: 26px 8px; padding: 28px; border: 1px dashed #c7d3cd; border-radius: 10px; text-align: center; color: #728486; }
.empty-procedures > span { display: block; color: var(--orange); font-size: 30px; }
.empty-procedures strong { display: block; margin-top: 7px; color: var(--ink); font-size: 13px; }
.empty-procedures p { margin: 6px 0 0; font-size: 11px; }

.detail-header { padding: 24px 58px 19px 23px; border-bottom: 1px solid var(--line); background: linear-gradient(160deg,#f6f8f3,#edf3ef); }
.back-button { margin: 0 0 22px -4px; padding: 5px; border: 0; color: var(--teal); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.back-button span { margin-right: 4px; font-size: 16px; }
.detail-header .eyebrow { margin-bottom: 7px; color: var(--orange); }
.detail-header h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 11px; }
.detail-meta > span:not(.service-badge) { padding-right: 7px; border-right: 1px solid #cdd8d1; color: #6c7f82; font: 10px ui-monospace,monospace; }
.segment-list { padding: 14px 14px 3px; }
.segment-card { margin-bottom: 10px; overflow: hidden; border: 1px solid #dce4df; border-radius: 9px; background: white; transition: border-color .14s,box-shadow .14s,transform .14s; }
.segment-card:hover { border-color: #9abeb8; }
.segment-card.is-selected { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(207,109,69,.15),0 8px 20px rgba(18,70,71,.09); transform: translateX(-2px); }
.segment-card summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; background: #f3f6f2; cursor: pointer; list-style: none; }
.segment-card.is-selected summary { background: linear-gradient(90deg,#fff0e8,#f5f7f2 58%); }
.segment-card summary::-webkit-details-marker { display: none; }
.segment-card summary > span { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 750; }
.segment-card summary i { width: 8px; height: 8px; border: 2px solid var(--teal); border-radius: 50%; }
.segment-card.is-selected summary i { border-color: var(--orange); background: var(--orange); box-shadow: 0 0 0 4px rgba(207,109,69,.14); }
.segment-card summary small { color: #75878a; font-size: 9px; }
.segment-summary-meta { display: flex; align-items: center; gap: 8px; }
.map-selection-label { padding: 3px 5px; border-radius: 4px; color: #fff; background: var(--orange); font-size: 7px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.leg-table { border-top: 1px solid #e4e9e5; }
.leg-row { position: relative; display: grid; grid-template-columns: 35px 104px minmax(0,1fr); gap: 9px; padding: 11px 12px 11px 8px; border-bottom: 1px solid #edf0ed; }
.leg-row:last-child { border-bottom: 0; }
.leg-row::before { content: ""; position: absolute; left: 25px; top: 0; bottom: 0; width: 1px; background: #d5dfda; }
.leg-sequence { z-index: 1; align-self: start; padding: 4px 2px; border: 1px solid #cbd8d1; border-radius: 4px; color: #65797b; background: white; text-align: center; font: 8px ui-monospace,monospace; }
.leg-fix { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.leg-fix strong { font: 750 12px ui-monospace,monospace; }
.leg-fix span { color: #788a8c; font-size: 9px; line-height: 1.25; }
.leg-values { display: flex; flex-wrap: wrap; gap: 7px 10px; }
.leg-values span { display: flex; flex-direction: column; gap: 2px; color: #2e4b50; font: 650 10px ui-monospace,monospace; }
.leg-values small { color: #849497; font: 7px Inter,sans-serif; letter-spacing: .08em; }
.leg-values .altitude { color: #a0482a; }
.leg-values .hold-value { color: #784b78; }
.leg-note { grid-column: 2/-1; display: flex; flex-wrap: wrap; gap: 7px; color: #849396; font-size: 8px; }
.map-badge { padding: 2px 4px; border-color: #e4b09c; color: #934329; background: #fff0e9; }
.hold-badge { padding: 2px 5px; border: 1px solid #c9a9c8; border-radius: 4px; color: #6f436e; background: #f7edf7; font-weight: 750; letter-spacing: .04em; }
.data-note { margin: 10px 16px 24px; padding: 13px 14px; border-left: 3px solid var(--orange); color: #667a7d; background: #f5eee8; font-size: 10px; line-height: 1.45; }
.data-note strong { color: #563c32; }
.data-note p { margin: 4px 0 0; }

.maplibregl-ctrl-bottom-left { bottom: 34px; left: auto; right: 8px; }
.maplibregl-ctrl-bottom-right { bottom: 29px; }
.maplibregl-ctrl-group { overflow: hidden; border-radius: 7px !important; box-shadow: 0 4px 14px rgba(5,36,40,.18) !important; }
.maplibregl-ctrl-scale { border-color: #486566; color: #314f51; background: rgba(250,252,248,.78); }

#blazor-error-ui { position: fixed; z-index: 1000; right: 18px; bottom: 18px; display: none; max-width: 420px; padding: 13px 42px 13px 15px; border: 1px solid #e1a58e; border-radius: 9px; color: #552f23; background: #fff2ec; box-shadow: var(--shadow); }
#blazor-error-ui .reload { margin-left: 8px; color: #8c3d24; }
#blazor-error-ui .dismiss { position: absolute; top: 8px; right: 11px; cursor: pointer; }

@media (max-width: 760px) {
    .atlas-shell { grid-template-rows: 60px minmax(0,1fr); }
    .topbar { padding: 0 14px; }
    .brand-block p { display: none; }
    .brand-mark { width: 32px; height: 32px; }
    .brand-mark span { left: 11px; top: 6px; }
    .cycle-chip { padding: 7px 9px; font-size: 10px; }
    .flight-warning { padding: 7px 8px; }
    .flight-warning span { display: none; }
    .cycle-chip span:last-child { max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .search-wrap { top: 13px; left: 13px; width: calc(100vw - 26px); }
    .search-box { height: 47px; }
    .region-switcher { top: 68px; left: 13px; max-width: calc(100vw - 26px); overflow-x: auto; }
    .region-switcher span, .legend-card { display: none; }
    .map-status { gap: 10px; }
    .map-status span:last-child { display: none; }
    .airport-panel { top: auto; width: 100%; height: min(68dvh,620px); border-radius: 17px 17px 0 0; transform: translateY(calc(100% + 40px)); }
    .airport-panel.is-open { transform: translateY(0); }
    .panel-drag-handle { display: block; position: sticky; z-index: 3; top: 0; width: 42px; height: 4px; margin: 8px auto -12px; border-radius: 3px; background: rgba(183,205,200,.75); }
    .airport-heading { padding-top: 27px; }
    .maplibregl-ctrl-bottom-left { bottom: 32px; }
}

@media (max-width: 430px) {
    .brand-block { gap: 8px; }
    .brand-block h1 { font-size: 16px; }
    .cycle-chip span:last-child { max-width: 72px; }
    .flight-warning { padding: 6px 5px; }
    .flight-warning strong { font-size: 7px; letter-spacing: .05em; }
    .airport-facts div { padding: 12px 10px; }
    .procedure-toolbar { align-items: flex-start; flex-direction: column; }
    .leg-row { grid-template-columns: 32px 86px minmax(0,1fr); gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
