:root {
  --ink: #142638;
  --muted: #637689;
  --line: #d8e1e8;
  --panel: #f6f8fa;
  --blue: #146bd7;
  --blue-deep: #0d4eaa;
  --orange: #ef8b24;
  --green: #15966f;
  --red: #c74d4d;
  --shadow: 0 12px 32px rgba(18, 39, 59, .14);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: #e7eef3; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }

.topbar { height: 64px; display: flex; align-items: center; gap: 11px; padding: 0 16px; background: #0c1c30; color: #fff; border-bottom: 1px solid #213953; position: relative; z-index: 900; }
.icon-button { width: 38px; height: 38px; border: 1px solid #49637c; border-radius: 11px; color: #dce8f5; background: #182d45; font-size: 1.18rem; display: grid; place-items: center; }
.icon-button:hover { background: #24435f; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #1379d8, #10a9a2); font-weight: 900; letter-spacing: -.06em; color: inherit; text-decoration: none; flex-shrink: 0; }
.brand-mark:hover { filter: brightness(1.12); }
.brand-mark:focus-visible { outline: 3px solid #a5e6ff; outline-offset: 3px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 1.06rem; letter-spacing: .01em; }
.brand-copy span { color: #a9bfd3; font-size: .79rem; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.app-logo-link { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, #1f6bd1, #0d9494); color: #fff; font-weight: 900; font-size: 18px; text-decoration: none; }
.app-logo-link:hover { filter: brightness(1.12); }
.app-logo-link:focus-visible { outline: 3px solid #a5e6ff; outline-offset: 3px; }
.mode-pill, .cycle-pill { padding: 7px 10px; border: 1px solid #38536f; border-radius: 999px; color: #d5e2f0; font-size: .71rem; letter-spacing: .06em; white-space: nowrap; }
.mode-pill { color: #8edce1; border-color: #22636d; }

.workspace { height: calc(100vh - 64px); display: grid; grid-template-columns: 385px minmax(0, 1fr); transition: grid-template-columns .22s ease; }
.workspace.panel-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.route-panel { position: relative; z-index: 700; overflow: hidden; background: var(--panel); border-right: 1px solid var(--line); min-width: 0; }
.panel-scroll { width: 385px; height: 100%; overflow: auto; padding: 18px 18px 32px; }
.panel-intro { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--blue); font-size: .69rem; font-weight: 900; letter-spacing: .15em; }
h1 { margin: 5px 0 6px; font-size: 1.38rem; line-height: 1.08; letter-spacing: -.035em; }
p { margin: 0; color: var(--muted); line-height: 1.45; font-size: .87rem; }
.section-label { color: #516477; font-size: .74rem; font-weight: 900; letter-spacing: .04em; margin-bottom: 9px; }
.route-endpoints, .search-block, .selection-block, .legend-block { padding-top: 15px; }
.endpoint-grid { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); gap: 7px; align-items: end; }
label { display: block; color: #52667a; font-size: .73rem; font-weight: 850; }
label input, label select { display: block; width: 100%; margin-top: 6px; border: 1px solid #bccbd7; border-radius: 8px; background: #fff; color: var(--ink); padding: 10px 10px; outline: none; }
label input:focus, label select:focus, .search-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20, 107, 215, .13); }
.endpoint-arrow { color: #8a9bab; font-size: 1rem; padding-bottom: 10px; text-align: center; }
.auto-route-card { margin-top: 14px; border: 1px solid #c6d5e2; border-radius: 10px; padding: 11px 12px 12px; background: #fff; box-shadow: 0 4px 14px rgba(18, 39, 59, .05); }
.auto-route-card summary { cursor: pointer; color: #284866; font-size: .8rem; font-weight: 900; }
.manual-route-card { margin-top: 14px; padding: 11px 12px 12px; border: 1px solid #a9c7e2; border-radius: 10px; background: #f7fbff; box-shadow: 0 4px 14px rgba(18,39,59,.05); }
.manual-route-card > summary { cursor: pointer; color: #185b99; font-size: .8rem; font-weight: 900; }
.manual-route-method { margin-top: 11px; }
.manual-route-method > strong { color: #294b69; font-size: .73rem; }
.manual-route-method > p { margin-top: 3px; color: #748698; font-size: .67rem; line-height: 1.4; }
.manual-route-card .search-block { padding-top: 8px; }
.manual-route-card .search-row input { padding: 8px 9px; font-size: .72rem; }
.manual-route-card .search-row button { padding: 8px 10px; font-size: .7rem; }
.manual-route-divider { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; color: #8798a7; font-size: .61rem; font-weight: 850; text-transform: uppercase; }
.manual-route-divider::before, .manual-route-divider::after { content: ''; height: 1px; flex: 1; background: #d7e3ed; }
.manual-route-input { font-size: .68rem; }
.manual-route-input textarea { width: 100%; min-height: 68px; margin-top: 5px; padding: 8px 9px; resize: vertical; border: 1px solid #b9cbd9; border-radius: 8px; outline: 0; color: var(--ink); background: #fff; font: .7rem/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; text-transform: uppercase; }
.manual-route-input textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,107,215,.13); }
.manual-route-hint { margin-top: 6px; color: #7b8d9e; font-size: .62rem; line-height: 1.4; }
.manual-route-button { width: 100%; margin-top: 8px; padding: 8px 10px; font-size: .71rem; }
.manual-route-status { min-height: 16px; margin-top: 6px; color: #728598; font-size: .65rem; line-height: 1.4; }
.manual-route-status.good { color: var(--green); }
.manual-route-status.error { color: var(--red); }
.auto-route-hint { margin-top: 8px; color: #708397; font-size: .72rem; line-height: 1.4; }
.auto-route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 11px; }
.auto-route-grid label, .auto-route-exclude { font-size: .68rem; }
.auto-route-grid input, .auto-route-exclude input { padding: 8px 8px; font-size: .75rem; }
.auto-route-exclude { margin-top: 9px; }
.auto-route-exclude-hint { display: block; margin-top: 5px; color: #8192a3; font-size: .65rem; font-weight: 600; line-height: 1.35; }
.route-variation-option { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; color: #52667a; font-size: .68rem; line-height: 1.35; }
.route-variation-option input { width: 14px; height: 14px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--blue); }
.route-variation-option small { display: block; color: #8192a3; font-size: .63rem; font-weight: 600; }
.country-picker { position: relative; }
.country-picker-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-top: 6px; padding: 8px 9px; border: 1px solid #bccbd7; border-radius: 8px; background: #fff; color: var(--ink); text-align: left; font-size: .75rem; }
.country-picker-toggle:hover, .country-picker-toggle[aria-expanded="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20, 107, 215, .13); }
.country-picker-toggle span { color: #6b8195; font-size: .95rem; line-height: 1; }
.country-picker-menu { position: absolute; z-index: 30; left: 0; right: 0; top: 57px; padding: 8px; border: 1px solid #b9cad8; border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.country-picker-menu input { width: 100%; margin: 0; }
.country-options { max-height: 205px; overflow: auto; margin-top: 7px; border-top: 1px solid #e1e9ef; padding-top: 5px; }
.country-option { display: flex; align-items: center; gap: 7px; padding: 5px 6px; border-radius: 6px; color: #2e4b65; font-size: .73rem; font-weight: 650; cursor: pointer; }
.country-option:hover, .country-option:focus-within { background: #eef5fb; }
.country-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--blue); }
.country-option small { margin-left: auto; color: #8b9aaa; font-size: .63rem; font-weight: 750; letter-spacing: .04em; }
.country-empty { padding: 9px 6px; color: var(--muted); font-size: .72rem; }
.auto-route-button { width: 100%; margin-top: 11px; padding: 9px 10px; font-size: .76rem; }
.route-calc-status { min-height: 18px; margin-top: 8px; color: #6f8193; font-size: .7rem; line-height: 1.4; }
.route-calc-status.good { color: var(--green); }
.route-calc-status.error { color: var(--red); }
.search-row { display: flex; gap: 7px; }
.search-row input { min-width: 0; flex: 1; border: 1px solid #b9c9d9; border-radius: 8px; background: #fff; color: var(--ink); padding: 10px 10px; outline: none; }
.primary-button { background: var(--blue); color: #fff; border-radius: 8px; padding: 10px 13px; font-weight: 850; }
.primary-button:hover { background: var(--blue-deep); }
.secondary-button { background: #e6edf3; color: #29455f; border-radius: 8px; padding: 10px 12px; font-weight: 800; }
.secondary-button:hover { background: #d7e3ec; }
.quiet-button { background: transparent; color: var(--blue); padding: 2px 0; font-size: .76rem; font-weight: 850; }
.search-results { display: grid; gap: 7px; margin-top: 9px; }
.search-result { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; color: var(--ink); text-align: left; }
.search-result:hover { border-color: #8cb1db; background: #f7fbff; }
.search-result-main { min-width: 0; background: transparent; color: inherit; padding: 0; text-align: left; }
.search-result-main b { display: block; font-size: .82rem; }
.search-result-main span { display: block; color: var(--muted); font-size: .71rem; margin-top: 2px; }
.result-actions { display: flex; gap: 4px; flex-shrink: 0; }
.result-actions button { border-radius: 6px; padding: 6px 7px; background: #e9f0f7; color: #2c557b; font-size: .67rem; font-weight: 850; }
.result-actions button:hover { background: #d9e8f5; }
.filter-card { margin-top: 19px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 0 14px; }
.filter-card summary { cursor: pointer; color: #435a70; font-size: .78rem; font-weight: 900; }
.filter-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 8px; margin-top: 12px; }
.filter-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.filter-actions .secondary-button { padding: 8px 10px; font-size: .73rem; }
.airport-filter { margin-top: 13px; padding-top: 12px; border-top: 1px solid #dbe4eb; }
.airport-filter-main { display: flex; align-items: flex-start; gap: 8px; color: #29455f; cursor: pointer; }
.airport-filter-main input { margin-top: 2px; accent-color: var(--blue); }
.airport-filter-main span { min-width: 0; display: grid; gap: 2px; }
.airport-filter-main strong { font-size: .77rem; }
.airport-filter-main small { color: #75889a; font-size: .62rem; line-height: 1.35; }
.airport-filter-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 9px; margin: 9px 0 0 21px; }
.airport-filter-grid > label { font-size: .66rem; }
.airport-filter-grid select { margin-top: 4px; }
.airport-filter-options { display: grid; align-content: end; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 7px; }
.airport-filter-options label { display: flex; align-items: center; gap: 4px; color: #526b81; font-size: .64rem; cursor: pointer; }
.airport-filter-options input { accent-color: var(--blue); }
.section-heading { display: flex; align-items: center; justify-content: space-between; font-weight: 900; font-size: .94rem; }
.empty-state { margin-top: 10px; color: var(--muted); border: 1px dashed #bdcbd8; border-radius: 8px; padding: 11px; font-size: .78rem; line-height: 1.35; }
.selection-list { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; counter-reset: route-leg; }
.selection-item { counter-increment: route-leg; position: relative; padding: 9px 31px 9px 34px; border: 1px solid #cbd8e5; border-radius: 8px; background: #fff; font-size: .78rem; }
.selection-item::before { content: counter(route-leg); position: absolute; left: 10px; top: 10px; width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: #dcecff; color: var(--blue-deep); font-size: .66rem; font-weight: 900; }
.selection-item strong { color: var(--blue-deep); }
.selection-item small { display: block; color: var(--muted); margin-top: 3px; }
.route-node-item { counter-increment: route-leg; position: relative; padding: 9px 31px 9px 34px; border: 1px solid #b8d8d4; border-radius: 8px; background: #f8fffd; font-size: .78rem; }
.route-node-item[data-focus-plan-index] { cursor: pointer; }
.route-node-item[data-focus-plan-index]:hover, .route-node-item[data-focus-plan-index]:focus-visible { border-color: #15966f; background: #effcf8; outline: none; box-shadow: 0 0 0 3px rgba(21, 150, 111, .13); }
.route-node-item::before { content: counter(route-leg); position: absolute; left: 10px; top: 10px; width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: #d8f2ec; color: #117760; font-size: .66rem; font-weight: 900; }
.route-node-item strong { color: #117760; }
.route-node-item small { display: block; color: var(--muted); margin-top: 3px; }
.route-node-badge { position: absolute; left: 11px; top: 12px; color: transparent; }
.selection-remove { position: absolute; top: 7px; right: 8px; color: #8b9aa7; background: transparent; padding: 2px 3px; font-size: .92rem; }
.selection-remove:hover { color: var(--red); }
.route-metrics { display: grid; grid-template-columns: .75fr 1fr 1.15fr; gap: 6px; margin: 12px 0 8px; }
.route-metrics div { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; }
.route-metrics strong { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-metrics span { display: block; color: var(--muted); font-size: .66rem; margin-top: 2px; }
.state-good { color: var(--green); }
.state-warning { color: var(--orange); }
.state-neutral { color: #708398; }
.route-diagnostic { min-height: 28px; color: var(--muted); font-size: .74rem; line-height: 1.4; margin-top: 10px; }
.route-diagnostic.warning { color: #9a621e; }
.route-diagnostic.good { color: var(--green); }
.route-pps-compatibility { min-height: 0; margin-top: 7px; font-size: .71rem; line-height: 1.45; }
.route-pps-compatibility.good { color: var(--green); }
.route-pps-compatibility.warning { color: #9a621e; }
.route-pps-compatibility.error { color: var(--red); font-weight: 750; }
.route-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.route-actions button { font-size: .74rem; padding: 9px 8px; }
.route-text { width: 100%; min-height: 63px; resize: vertical; margin-top: 9px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; line-height: 1.4; }
.navlog-block { padding-top: 19px; border-top: 1px solid var(--line); margin-top: 21px; }
.navlog-block > summary { display:flex; align-items:center; gap:7px; cursor:pointer; list-style:none; color:#435a70; font-size:.78rem; font-weight:900; }
.navlog-block > summary::-webkit-details-marker { display:none; }
.navlog-block > summary::before { content:'▸'; color:#8192a3; transition:transform .15s ease; }
.navlog-block[open] > summary::before { transform:rotate(90deg); }
.navlog-block > summary > span:first-of-type { flex:1; }
.section-hint { color: #8192a3; font-size: .68rem; font-weight: 700; }
.navlog-wrap { overflow-x: auto; margin-top: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.navlog-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .68rem; }
.navlog-table th { padding: 7px 6px; color: #587087; background: #edf3f7; text-align: left; font-size: .62rem; letter-spacing: .03em; white-space: nowrap; }
.navlog-table td { padding: 7px 6px; color: #35516b; border-top: 1px solid #e6edf2; white-space: nowrap; }
.navlog-table td strong { color: var(--ink); }
.navlog-airway { display: inline-block; padding: 2px 5px; border-radius: 4px; color: #185ca9; background: #eaf2fd; font-weight: 850; }
.navlog-airway.direct { color: #93611f; background: #fff3de; }
.navlog-empty { white-space: normal !important; color: var(--muted) !important; line-height: 1.35; }
.legend-block { border-top: 1px solid var(--line); margin-top: 21px; }
.legend-row { display: flex; align-items: center; gap: 9px; color: #536b82; font-size: .75rem; margin-bottom: 8px; }
.legend-line { width: 27px; height: 4px; border-radius: 999px; display: inline-block; background: var(--blue); }
.oneway-line { background: #d86b1f; }
.selected-line { background: #0b1420; height: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #fff; border: 3px solid var(--orange); }
.airport-legend { flex-wrap: wrap; gap: 6px; }
.airport-legend span:not(.airport-dot) { margin-right: 5px; font-size: .66rem; }
.airport-dot { width: 10px; height: 10px; display: inline-block; border: 1.5px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(24,50,73,.25); }
.airport-short { background: #d88924; }
.airport-medium { background: #216fbd; }
.airport-long { background: #168461; }
.legend-arrow { width: 27px; display: inline-flex; justify-content: center; gap: 3px; font-size: 1.05rem; line-height: 1; }
.legend-arrow-oneway { color: #d86b1f; }
.legend-arrow-both { color: var(--blue); }
.legend-note { margin-top: 14px; color: #8292a5; font-size: .69rem; line-height: 1.45; }

.map-wrap { min-width: 0; position: relative; background: #c5dbe4; }
#map { position: absolute; inset: 0; }
.route-drag-target { cursor: grab; }
.route-drag-target:active, .route-dragging .route-drag-target { cursor: grabbing; }
.route-dragging .leaflet-grab { cursor: grabbing; }
.route-dragging .leaflet-overlay-pane { cursor: grabbing; }
.route-drag-handle { width: 22px !important; height: 22px !important; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #0b1420; background: #f7fbff; box-shadow: 0 1px 6px rgba(11, 20, 32, .46); cursor: grab; font: 900 14px/1 system-ui, sans-serif; }
.route-drag-handle:hover, .route-dragging .route-drag-handle { color: #fff; background: #0b1420; cursor: grabbing; }
.route-recalculating .route-drag-target { cursor: wait; }
.route-recalculating .route-drag-handle { opacity: .72; }
.map-toolbar { position: absolute; top: 16px; left: 16px; z-index: 500; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.95); border: 1px solid #cad7e3; border-radius: 10px; padding: 8px 11px; box-shadow: var(--shadow); }
.map-toolbar-title { font-weight: 900; font-size: .8rem; color: #27425e; white-space: nowrap; }
.map-status { color: #61788f; font-size: .74rem; }
.map-quick-controls { position: absolute; z-index: 520; top: 58px; left: 56px; display: flex; align-items: flex-start; gap: 11px; }
.map-control-group { display: flex; align-items: flex-start; gap: 4px; }
.map-control-group + .map-control-group { position: relative; margin-left: 2px; }
.map-control-group + .map-control-group::before { content: ''; position: absolute; top: 5px; bottom: 5px; left: -7px; width: 1px; background: rgba(53,81,107,.25); }
.map-icon-button { position: relative; width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid #c6d3de; border-radius: 9px; color: #35516b; background: rgba(255,255,255,.96); box-shadow: 0 3px 11px rgba(15,35,58,.13); list-style: none; }
.map-icon-button::-webkit-details-marker { display: none; }
.map-icon-button:hover { color: var(--blue); border-color: #8fb4d7; background: #fff; }
.map-icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.map-icon-toggle { position: relative; display: block; cursor: pointer; }
.map-icon-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.map-icon-toggle input:checked + .map-icon-button { color: #fff; border-color: var(--blue); background: var(--blue); }
.route-build-toggle input:checked + .map-icon-button { border-color: #7650aa; background: #7650aa; }
.route-build-active .leaflet-overlay-pane { cursor: crosshair; }
.route-build-active .route-drag-target { cursor: grab; }
.map-icon-toggle input:focus-visible + .map-icon-button, .map-filter-control > summary:focus-visible { outline: 3px solid rgba(20,107,215,.22); outline-offset: 2px; }
.map-filter-control { position: relative; }
.map-filter-control > summary { cursor: pointer; }
.map-filter-control[open] > summary, .map-filter-control.has-active-filters > summary { color: var(--blue); border-color: #82add6; background: #eef6ff; }
.map-filter-control.has-active-filters > summary::after { content: ''; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border: 2px solid #fff; border-radius: 50%; background: var(--orange); }
.map-icon-letters { font-size: .65rem; font-weight: 950; letter-spacing: -.03em; }
.map-filter-popover { position: absolute; top: 43px; left: 0; width: 278px; padding: 12px; border: 1px solid #c8d5df; border-radius: 12px; background: rgba(255,255,255,.98); box-shadow: var(--shadow); }
.map-filter-popover-airways { width: 218px; }
.map-filter-popover-airports { left: -130px; }
.map-filter-heading { display: grid; gap: 2px; margin-bottom: 10px; }
.map-filter-heading strong { color: #29455f; font-size: .78rem; }
.map-filter-heading small { color: #76899b; font-size: .62rem; line-height: 1.3; }
.map-filter-field, .map-airport-selects label, .airport-category-field { color: #5b6f82; font-size: .64rem; }
.map-filter-field select, .map-airport-selects select { margin-top: 4px; padding: 7px 8px; border-radius: 7px; font-size: .7rem; }
.map-filter-field select { width: 100%; }
.map-filter-clear { width: 100%; margin-top: 7px; padding: 7px 8px; border-radius: 7px; color: #245b8f; background: #e9f2fb; font-size: .64rem; font-weight: 850; }
.map-filter-note { margin: 8px 0 0; color: #7b8d9d; font-size: .6rem; line-height: 1.35; }
.map-airport-options { display: grid; gap: 9px; }
.map-airport-selects { display: grid; grid-template-columns: .8fr 1.2fr; gap: 8px; }
.map-airport-selects select { width: 100%; }
.airport-category-field { display: grid; gap: 4px; }
.airport-category-picker { position: relative; }
.airport-category-picker > summary { min-height: 31px; display: flex; align-items: center; padding: 7px 28px 7px 8px; border: 1px solid #c8d5df; border-radius: 7px; color: #263f57; background: #fff; font-size: .68rem; font-weight: 750; cursor: pointer; list-style: none; }
.airport-category-picker > summary::-webkit-details-marker { display: none; }
.airport-category-picker > summary::after { content: ''; position: absolute; top: 11px; right: 10px; width: 6px; height: 6px; border-right: 1.5px solid #35516b; border-bottom: 1.5px solid #35516b; transform: rotate(45deg); }
.airport-category-picker[open] > summary::after { top: 14px; transform: rotate(225deg); }
.map-filter-checks { position: absolute; z-index: 3; top: calc(100% + 4px); left: 0; right: 0; display: grid; gap: 3px; padding: 6px; border: 1px solid #c8d5df; border-radius: 8px; background: #fff; box-shadow: 0 6px 16px rgba(15,35,58,.16); }
.map-filter-checks label { display: flex; align-items: center; gap: 7px; padding: 5px 6px; border-radius: 5px; color: #526b81; font-size: .65rem; cursor: pointer; }
.map-filter-checks label:hover { background: #edf4fa; }
.map-filter-checks input { width: 14px; height: 14px; flex: 0 0 14px; margin: 0; accent-color: var(--blue); }
.map-airport-search { position: absolute; z-index: 515; top: 58px; left: 280px; width: 36px; min-width: 36px; height: 36px; display: grid; grid-template-columns: 34px 0 0; align-items: center; border: 1px solid #c6d3de; border-radius: 9px; background: rgba(255,255,255,.96); box-shadow: 0 3px 11px rgba(15,35,58,.13); transition: width .18s ease, border-color .18s ease, box-shadow .18s ease; }
.map-airport-search.is-expanded, .map-airport-search:focus-within { width: min(230px, calc(100% - 296px)); grid-template-columns: 28px minmax(0,1fr) 28px; }
.map-airport-search-toggle { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border-radius: 8px; color: #526b81; background: transparent; }
.map-airport-search-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.map-airport-search-toggle:hover { color: var(--blue); background: #edf4fa; }
.map-airport-search input { width: 0; min-width: 0; height: 34px; padding: 0; border: 0; border-radius: 0; outline: 0; opacity: 0; pointer-events: none; color: #263f57; background: transparent; font-size: .68rem; transition: opacity .12s ease; }
.map-airport-search.is-expanded input, .map-airport-search:focus-within input { width: 100%; padding: 0 5px 0 7px; opacity: 1; pointer-events: auto; }
.map-airport-search input::-webkit-search-cancel-button { display: none; }
.map-airport-search:focus-within { border-color: #72a6d4; box-shadow: 0 0 0 3px rgba(20,107,215,.13), 0 3px 11px rgba(15,35,58,.13); }
.map-airport-search-clear { width: 24px; height: 24px; display: grid; place-items: center; justify-self: center; padding: 0; border-radius: 6px; color: #6e8193; background: transparent; font-size: 1rem; }
.map-airport-search-clear[hidden] { display: none; }
.map-airport-search-clear:hover { color: #204f78; background: #edf3f8; }
.map-airport-search-results { position: absolute; top: 41px; left: 0; right: 0; max-height: min(330px, 50vh); overflow-y: auto; padding: 5px; border: 1px solid #c8d5df; border-radius: 10px; background: rgba(255,255,255,.98); box-shadow: var(--shadow); }
.map-airport-search-result { width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 7px 8px; border-radius: 7px; text-align: left; background: transparent; }
.map-airport-search-result:hover, .map-airport-search-result:focus-visible { background: #edf4fa; }
.map-airport-search-result b { grid-row: 1/3; align-self: center; color: #1d609b; font-size: .68rem; }
.map-airport-search-result span { overflow: hidden; color: #334f68; font-size: .64rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.map-airport-search-result small { color: #7a8b9a; font-size: .56rem; }
.map-airport-search-empty { padding: 9px; color: #7a8b9a; font-size: .63rem; text-align: center; }
.airport-search-marker { background: transparent; border: 0; }
.airport-search-marker-ring { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; border: 3px solid #ef8b24; border-radius: 50%; background: rgba(255,255,255,.28); box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 2px 9px rgba(10,31,51,.32); transform: translate(-50%,-50%); animation: airport-search-pulse 1.7s ease-in-out infinite; }
.airport-search-marker-label { position: absolute; left: 50%; bottom: 17px; width: max-content; max-width: 180px; padding: 4px 7px; border-radius: 6px; color: #173c64; background: rgba(255,255,255,.96); box-shadow: 0 2px 8px rgba(10,31,51,.2); font: 850 .62rem/1.1 system-ui,sans-serif; transform: translateX(-50%); }
@keyframes airport-search-pulse { 50% { box-shadow: 0 0 0 7px rgba(239,139,36,.14), 0 2px 9px rgba(10,31,51,.32); } }
@media (hover:hover) {
  .map-airport-search:hover { width: min(230px, calc(100% - 296px)); grid-template-columns: 28px minmax(0,1fr) 28px; }
  .map-airport-search:hover input { width: 100%; padding: 0 5px 0 7px; opacity: 1; pointer-events: auto; }
}
.map-help { position: absolute; left: 16px; bottom: 16px; z-index: 500; padding: 7px 10px; border-radius: 7px; color: #405971; background: rgba(255,255,255,.91); font-size: .72rem; box-shadow: 0 3px 12px rgba(15, 35, 58, .1); }
.route-map-feedback { position: absolute; left: 16px; right: 16px; bottom: 76px; z-index: 500; padding: 10px 12px; border-radius: 8px; color: #27425e; background: rgba(255,255,255,.97); border: 1px solid #cad7e3; font-size: .78rem; box-shadow: var(--shadow); pointer-events: none; }
.route-map-feedback.good { color: #087858; border-color: #15966f; }
.route-map-feedback.error { color: #a33023; border-color: #d76b59; }
.route-map-feedback[hidden] { display: none; }
.leaflet-popup-content { min-width: 215px; }
.point-context-popup .leaflet-popup-content-wrapper { border-radius: 11px; box-shadow: 0 5px 18px rgba(10,31,51,.2); }
.point-context-popup .leaflet-popup-content { width: auto !important; min-width: 0; margin: 7px 30px 7px 7px; }
.point-context-popup .leaflet-popup-tip { box-shadow: 2px 2px 4px rgba(10,31,51,.1); }
.point-context-popup .leaflet-popup-close-button { top: 5px; right: 5px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: #61768a; background: #edf2f6; font: 700 17px/1 system-ui,sans-serif; }
.point-context-popup .leaflet-popup-close-button:hover { color: #173c64; background: #dfe9f1; }
.point-context-main { display: flex; align-items: center; gap: 6px; min-width: 190px; }
.point-context-name { min-width: 0; display: grid; flex: 1; line-height: 1.15; }
.point-context-name strong { overflow: hidden; color: var(--blue-deep); font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.point-context-name small { max-width: 105px; overflow: hidden; color: var(--muted); font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.point-context-add { flex: 0 0 auto; padding: 6px 8px; border-radius: 7px; color: #fff; background: var(--blue); font-size: .66rem; font-weight: 850; }
.point-context-add.selected { color: #087858; background: #e4f3ed; }
.point-context-more { position: relative; flex: 0 0 auto; }
.point-context-more summary { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: #536b82; background: #edf2f6; cursor: pointer; font: 900 .7rem/1 system-ui; list-style: none; }
.point-context-more summary::-webkit-details-marker { display: none; }
.point-context-menu { position: absolute; z-index: 2; top: 31px; right: 0; width: 174px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 7px; border: 1px solid #c9d5df; border-radius: 9px; background: #fff; box-shadow: 0 6px 18px rgba(10,31,51,.18); }
.point-context-menu span { grid-column: 1/-1; color: var(--muted); font-size: .58rem; white-space: nowrap; }
.point-context-menu button { padding: 6px 5px; border-radius: 6px; color: #2c557b; background: #e9f0f7; font-size: .61rem; font-weight: 800; }
.airport-popup .leaflet-popup-content-wrapper { border-radius: 13px; box-shadow: 0 8px 24px rgba(10,31,51,.24); overflow: hidden; }
.airport-popup .leaflet-popup-content { width: min(360px, calc(100vw - 96px)) !important; min-width: 270px; max-height: min(62vh, 560px); margin: 0; padding: 11px 7px 11px 11px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; touch-action: pan-y; }
.airport-popup .leaflet-popup-close-button { z-index: 5; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 0 12px 0 8px; color: #526b81; background: rgba(255,255,255,.94); font-size: 20px; }
.airport-popup .leaflet-popup-close-button:hover { color: #173c64; background: #edf4fa; }
.airport-card { color: #314a61; font-size: .69rem; }
.airport-card header { position: sticky; z-index: 2; top: -11px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; margin: -1px -1px 0; padding: 12px 32px 8px 1px; border-bottom: 1px solid #e4ebf1; background: rgba(255,255,255,.97); }
.airport-card header > span:last-child { min-width: 0; }
.airport-card header strong,.airport-card header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.airport-card header strong { color: #173c64; font-size: .78rem; }
.airport-card header small { margin-top: 2px; color: #7a8b9a; font-size: .61rem; }
.airport-card-code { display: grid; place-items: center; gap: 1px; padding: 5px 7px; border-radius: 7px; color: #fff; background: #1f6fc1; font-weight: 900; letter-spacing: .04em; }
.airport-card-code small { margin: 0; color: rgba(255,255,255,.82); font-size: .48rem; letter-spacing: .08em; }
.airport-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin-top: 10px; }
.airport-facts span { min-width: 0; padding: 7px 5px; border-radius: 7px; background: #eef4f8; text-align: center; }
.airport-facts b,.airport-facts small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.airport-facts b { color: #294b6a; font-size: .68rem; }
.airport-facts small { margin-top: 2px; color: #76899a; font-size: .52rem; }
.airport-compact-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; padding: 5px 2px; color: #718394; }
.airport-compact-row b { color: #36536d; }
.airport-details { margin-top: 4px; border-top: 1px solid #dce5ec; border-bottom: 1px solid #dce5ec; padding: 7px 2px; }
.airport-details-title { color: #315777; font-weight: 850; }
.airport-details table { width: 100%; margin-top: 7px; border-collapse: collapse; font-size: .62rem; }
.airport-details th,.airport-details td { padding: 4px; border-bottom: 1px solid #e6edf2; text-align: left; }
.airport-details th { color: #6d8193; background: #f2f6f9; }
.airport-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 7px; }
.airport-info-grid span { padding: 6px; border-radius: 6px; color: #697c8e; background: #f3f6f8; font-size: .58rem; line-height: 1.35; }
.airport-info-grid b { display: block; color: #36536d; font-size: .59rem; }
.airport-operational-restrictions { display: grid; gap: 4px; margin-top: 7px; padding: 6px; border-radius: 6px; color: #6b4a23; background: #fff7e8; font-size: .56rem; line-height: 1.4; }
.airport-operational-restrictions strong { color: #8c5919; }
.airport-operational-restrictions span + span { padding-top: 4px; border-top: 1px solid #f1ddba; }
.airport-frequency-list { max-height: 86px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 7px; overflow-y: auto; }
.airport-frequency-list span { display: grid; grid-template-columns: 34px 1fr; gap: 2px 5px; padding: 4px 5px; border-radius: 5px; color: #456078; background: #edf3f7; font-size: .57rem; }
.airport-frequency-list b { color: #1d659f; }
.airport-frequency-list small { grid-column: 1/-1; color: #7a8b9a; }
.airport-source-note { display: block; margin-top: 7px; color: #7b8996; font-size: .52rem; line-height: 1.35; }
.airport-live-status { margin-top: 8px; padding: 7px; border-radius: 7px; color: #315777; background: #edf4fa; font-size: .62rem; }
.airport-live-status.warning { color: #95601d; background: #fff5e3; }
.airport-weather { display: grid; gap: 6px; margin-top: 8px; }
.airport-weather > div { display: grid; grid-template-columns: 38px 1fr; gap: 2px 7px; padding: 7px; border-radius: 7px; background: #edf5fb; }
.airport-weather strong { grid-row: 1/3; color: #1f609e; }
.airport-weather span { overflow-wrap: anywhere; color: #294b6a; font: 600 .6rem/1.35 ui-monospace,SFMono-Regular,Menlo,monospace; }
.airport-weather small { color: #7a8b9a; font-size: .55rem; }
.airport-card-actions { position: sticky; z-index: 2; bottom: -11px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 8px -1px -1px; padding: 8px 1px 12px; border-top: 1px solid #e4ebf1; background: rgba(255,255,255,.97); }
.airport-card-actions button,.airport-card-actions a { display: grid; place-items: center; min-height: 29px; padding: 5px; border: 0; border-radius: 6px; color: #28587f; background: #e7eff6; font-size: .61rem; font-weight: 850; text-align: center; text-decoration: none; }
.airport-card-actions a { color: #fff; background: #526b81; }
.leaflet-overlay-pane path { stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.popup-direction { display: inline-block; margin-top: 2px; padding: 2px 6px; border-radius: 999px; color: #1a5fac; background: #e9f2fd; font-weight: 800; }
.popup-title { color: var(--blue-deep); font-size: .98rem; font-weight: 900; }
.popup-meta { color: var(--muted); font-size: .75rem; line-height: 1.5; margin-top: 4px; }
.popup-button { width: 100%; margin-top: 9px; padding: 8px 9px; color: #fff; background: var(--blue); border-radius: 7px; font-size: .75rem; font-weight: 850; }
.popup-button:hover { background: var(--blue-deep); }
.point-popup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px; }
.point-popup-actions .popup-button { grid-column: 1 / -1; margin-top: 0; }
.popup-small-button { padding: 7px 6px; border-radius: 6px; color: #2c557b; background: #e9f0f7; font-size: .7rem; font-weight: 850; }
.popup-small-button:hover { background: #d8e7f4; }
.leaflet-control-container { z-index: 500 !important; }
/* Leaflet's controls/panes must not intercept the overlaid mobile form. */
.map-wrap { isolation: isolate; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 340px minmax(0, 1fr); }
  .panel-scroll { width: 340px; padding-left: 15px; padding-right: 15px; }
  .mode-pill { display: none; }
}
@media (max-width: 700px) {
  .auto-route-grid { grid-template-columns: 1fr 1fr; }
  .topbar { height: 58px; padding: 0 10px; }
  .brand-copy span { display: none; }
  .workspace { height: calc(100vh - 58px); grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
  .workspace.panel-collapsed { grid-template-columns: 1fr; }
  .route-panel { position: absolute; left: 0; top: 58px; bottom: 0; z-index: 700; width: min(92vw, 390px); box-shadow: var(--shadow); transform: translateX(0); transition: transform .22s ease; }
  .panel-scroll { width: 100%; }
  .workspace.panel-collapsed .route-panel { transform: translateX(-102%); }
  .map-wrap { min-height: 100%; }
  .cycle-pill { display: none; }
  .map-toolbar { top: 12px; left: 12px; }
  .map-quick-controls { top: 55px; left: 56px; }
  .map-airport-search { top: 98px; left: 56px; }
  .map-airport-search.is-expanded, .map-airport-search:focus-within { width: min(230px, calc(100vw - 72px)); }
  .map-filter-popover { width: min(278px, calc(100vw - 24px)); }
  .map-help { left: 12px; bottom: 12px; }
}
/* Validation is independent from geometric continuity and AIRAC coverage. */
.validation-card { margin-top: 16px; padding: 14px; border: 1px solid #d9e2eb; border-radius: 12px; background: #f8fafc; }
.validation-card summary { cursor: pointer; font-weight: 650; margin-bottom: 12px; }
.validation-card button { margin-top: 10px; }
.validation-card pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; font: 12px/1.5 system-ui, sans-serif; }
.validation-card .good { color: #126044; background: #effaf4; }
#rulesCoverage { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
#rulesCoverage a { display: inline-block; margin-top: 8px; }
#routeDepartureTime { width: 100%; margin: 6px 0 12px; min-height: 38px; }
.map-toolbar { left: 56px; right: 16px; width: fit-content; max-width: calc(100% - 72px); }
.route-toolbox { position: absolute; z-index: 510; top: 74px; right: 14px; width: auto; max-height: calc(100% - 110px); color: #253c51; font-size: 12px; }
.route-toolbox > summary { width: fit-content; min-height: 34px; display: flex; align-items: center; gap: 6px; margin-left: auto; padding: 6px 9px; border: 1px solid #c9d5df; border-radius: 10px; background: rgba(255,255,255,.94); box-shadow: 0 3px 11px rgba(15,35,58,.12); cursor: pointer; color: #27425e; font-weight: 850; font-size: 11px; list-style: none; }
.route-toolbox > summary::-webkit-details-marker { display: none; }
.route-tool-summary-icon { color: #6e3daa; font-size: 14px; }
.route-toolbox[open] { width: 258px; }
.route-toolbox[open] > summary { margin-bottom: 6px; }
.route-toolbox-body { max-height: calc(100vh - 178px); overflow: auto; padding: 9px; border: 1px solid #c9d5df; border-radius: 11px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.route-tool-buttons { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; margin: 0 0 7px; }
.route-toolbox button { font-size: 12px; padding: 8px 6px; border-radius: 6px; }
.route-tool-buttons button { min-width: 0; display: grid; place-items: center; gap: 2px; padding: 5px 2px; color: #35516b; background: #edf2f6; border: 1px solid transparent; }
.route-tool-buttons button > span:first-child { font-size: 14px; line-height: 1; }
.route-tool-label { font-size: 8px; line-height: 1.05; }
.route-tool-buttons button[aria-pressed=true] { color: #6534a1; background: #f0e7fc; border-color: #9665c8; }
.route-tool-buttons [data-route-tool=pass] { color: #087858; background: #e4f3ed; }
.route-tool-buttons [data-route-tool=avoid] { background: #e1e5e8; color: #4f5a67; }
.route-tool-buttons [data-route-tool=erase] { background:#fff; border-color:#c9d5df; }
.brush-cursor.eraser { border-style:dashed; background:rgba(255,255,255,.35); }
.zone-shape { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.zone-shape select { width:140px; padding:5px; border:1px solid #c9d5df; border-radius:6px; }
.tool-hint { font-size: 11px; line-height: 1.5; color: #617285; margin: 9px 0; }
.tool-selection { border-top:1px solid #dce4eb; padding-top:10px; margin-top:10px; color:#783db2; font-weight:750; }
.tool-actions { display:flex; gap:6px; margin-top:6px; }
.tool-actions button { flex:1; background:#edf2f6; color:#35516b; }
#routeToolApply { width:100%; }
.zone-list { display:flex; flex-wrap:wrap; gap:5px; }
.zone-row { display:flex; background:#e4f3ed; border-radius:6px; }
.zone-row.avoid { background:#e1e5e8; }
.zone-row button { background:transparent; color:#35516b; padding:5px; font-size:11px; }
.zone-number { background:#09845d; color:white; border:2px solid white; border-radius:50%; display:grid; place-items:center; font:bold 12px system-ui; }
.zone-drawing, .zone-drawing .route-drag-target, .zone-drawing .leaflet-interactive { cursor:crosshair !important; touch-action:none; }
.brush-cursor { position:absolute; z-index:490; pointer-events:none; border:1.5px solid; border-radius:50%; transform:translate(-50%,-50%); box-shadow:0 0 0 1px #fff; background:rgba(255,255,255,.1); }
.brush-size-label { display:flex; justify-content:space-between; margin:12px 0 3px; }
#routeBrushSize { width:100%; accent-color:#087858; cursor:ew-resize; }
.paint-target { display:flex; flex-direction:column; gap:6px; color:#617285; font-size:11px; margin:7px 0; }
#routeNewZone { background:#edf2f6; color:#35516b; }
.zone-row button[aria-pressed=true] { box-shadow:inset 0 0 0 2px #09845d; border-radius:5px; }
.zone-row.avoid button[aria-pressed=true] { box-shadow:inset 0 0 0 2px #586371; }
.route-selecting .leaflet-overlay-pane, .zone-drawing .leaflet-overlay-pane, .route-dragging .leaflet-overlay-pane { opacity:.5; }
.route-selection-bound { color:#7938b8; background:white; border:2px solid #853ed0; border-radius:50%; font:bold 11px/20px system-ui; text-align:center; pointer-events:none; }
.route-drag-handle.selected { background:#853ed0; color:white; width:28px!important; height:28px!important; }
.route-dragging .route-portion { opacity:.25; }
.route-selecting, .route-selecting .route-drag-target { cursor:crosshair!important; }
.navlog-table .edit-selected td { background:#f0e7fc; }
.navlog-table [data-edit-leg] { padding:4px 6px; border-radius:4px; background:#e9e1f7; color:#713ca9; }
@media(max-width:700px) { .route-toolbox {right:10px;top:68px;} .route-toolbox[open]{width:min(246px,calc(100vw - 20px));} .map-toolbar-title{display:none;} .map-help{font-size:10px;right:12px;} }

/* Candidate comparison and recoverable edits. */

.route-alternatives { margin-top: 12px; padding-top: 11px; border-top: 1px solid #dce6ee; }
.alternative-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #29455f; font-size: .75rem; }
.alternative-heading span { color: #7b8c9c; font-size: .64rem; }
.alternative-list { display: grid; gap: 7px; margin-top: 8px; }
.alternative-card { width: 100%; display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 8px; padding: 9px; border: 1px solid #d2dde7; border-radius: 9px; color: #314d66; background: #f9fbfd; text-align: left; }
.alternative-card:hover { border-color: #8cb1db; background: #f1f7fd; }
.alternative-card.active { border-color: var(--blue); background: #eaf3ff; box-shadow: inset 3px 0 0 var(--blue); }
.alternative-rank { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #506a83; font-size: .68rem; font-weight: 900; }
.alternative-card.active .alternative-rank { background: var(--blue); }
.alternative-copy { min-width: 0; }
.alternative-copy strong,.alternative-copy small { display: block; }
.alternative-copy strong { color: #243d55; font-size: .72rem; }
.alternative-copy small { margin-top: 2px; color: #728497; font-size: .62rem; line-height: 1.35; }
.alternative-verdict { padding: 3px 6px; border-radius: 999px; color: #8b631c; background: #fff2d8; font-size: .58rem; font-weight: 850; white-space: nowrap; }
.alternative-card.active .alternative-verdict.validated { color: #087858; background: #dff4eb; }
.alternative-skeleton { height: 48px; border-radius: 9px; background: linear-gradient(90deg,#edf2f6 25%,#f8fafc 50%,#edf2f6 75%); background-size: 200% 100%; animation: alternative-loading 1.2s infinite; }
@keyframes alternative-loading { to { background-position: -200% 0; } }

.route-status-banner { width: 100%; display: grid; grid-template-columns: 31px 1fr; align-items: center; gap: 8px; margin: 11px 0 8px; padding: 10px; border: 1px solid #d2dce5; border-radius: 10px; color: #52677b; background: #fff; text-align: left; }
.route-status-banner .status-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #edf2f6; font-weight: 950; }
.route-status-banner strong,.route-status-banner small { display: block; }
.route-status-banner strong { font-size: .76rem; }
.route-status-banner small { margin-top: 2px; color: #758798; font-size: .64rem; line-height: 1.35; }
.route-status-banner.pending { color: #8b631c; border-color: #e4c88e; background: #fffaf0; }
.route-status-banner.pending .status-icon { background: #ffe7b8; }
.route-status-banner.good { color: #087858; border-color: #8bcdb7; background: #f0fbf7; }
.route-status-banner.good .status-icon { color: #fff; background: var(--green); }
.route-status-banner.error { color: #a33023; border-color: #e1a59c; background: #fff5f3; }
.route-status-banner.error .status-icon { color: #fff; background: var(--red); }
.selection-item.validation-failed,.route-node-item.validation-failed { border-color: #d76b59; background: #fff1ee; box-shadow: inset 3px 0 0 #c74d4d; }

.route-history-card { margin-top: 13px; padding: 11px 12px; border: 1px solid #d9e2eb; border-radius: 10px; background: #fff; }
.transfer-card { margin-top: 13px; padding: 12px; border: 1px solid #c9d8e5; border-radius: 10px; background: #eef5fb; }
.transfer-card .secondary-button { width: 100%; background: var(--blue); color: #fff; }
.route-history-card summary { cursor: pointer; color: #435a70; font-size: .72rem; font-weight: 850; }
.route-history-card summary span { color: #7b8c9c; font-weight: 700; }
.route-history-list { display: grid; gap: 6px; margin-top: 9px; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; padding: 8px; border-radius: 8px; background: #f3f7fa; }
.history-item strong,.history-item small { display: block; }
.history-item strong { color: #29455f; font-size: .69rem; }
.history-item small { margin-top: 2px; color: #7a8b9c; font-size: .6rem; }
.history-item button { padding: 6px 8px; border-radius: 6px; color: #205e9a; background: #e3eef8; font-size: .63rem; font-weight: 850; }
.history-empty { color: #7b8c9c; font-size: .66rem; }

.map-toolbar-button { padding: 5px 8px; border: 1px solid #c9d7e2; border-radius: 7px; color: #3d5b75; background: #f5f8fb; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.map-toolbar-button[aria-pressed="false"] { color: #fff; border-color: #516b83; background: #516b83; }
.route-edit-preview { margin-top: 9px; padding: 10px; border: 1px solid #74bba3; border-radius: 9px; background: #effaf6; }
.route-edit-preview strong,.route-edit-preview span { display: block; }
.route-edit-preview strong { color: #087858; font-size: .72rem; }
.route-edit-preview span { margin-top: 4px; color: #526c61; font-size: .64rem; line-height: 1.4; }
.route-edit-preview > div { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.route-edit-preview button { margin: 0; }
.route-edit-preview #routeEditCancel { color: #35516b; background: #e1e8ed; }
.route-preview-line { filter: drop-shadow(0 1px 2px rgba(5,61,43,.25)); }

.map-focus .leaflet-overlay-pane path:not(.route-portion):not(.route-preview-line):not(.direction-arrow-overlay) { transition: opacity .16s ease; }
@media(max-width:700px) {
  .map-toolbar-button { display:none; }
}

/* Progressive disclosure: guidance is reachable by keyboard and touch, while
   route state, restrictions and validation errors remain in their own panels. */
.context-help{margin-top:10px;border-top:1px solid #e0e7ed;padding-top:7px;color:#607487;font-size:11px;line-height:1.5}
.context-help>summary{display:list-item;cursor:pointer;min-height:30px;margin:0;font-size:11px;font-weight:600;line-height:30px;color:#486177}
.context-help>summary:focus-visible{outline:2px solid var(--blue);outline-offset:3px;border-radius:3px}
.context-help p{margin:5px 0 8px;line-height:1.5}
.context-help .route-variation-option{font-size:12px}
.manual-route-card>.context-help,.validation-card>.context-help{background:transparent;padding-bottom:0}
.route-tool-help{margin:3px 0 6px;padding-top:0;border-top:0}
.route-tool-help>summary{min-height:26px;line-height:26px;font-size:10px}
.route-tool-help .tool-hint{margin:2px 0 7px}
.route-toolbox .tool-selection{font-size:12px;line-height:1.4;padding-top:8px;margin-top:8px}
.route-toolbox #routeToolScope{margin:5px 0 9px;font-size:10px}
.route-toolbox-body [hidden],.route-status-banner small[hidden]{display:none!important}
.route-toolbox .tool-actions button{min-height:36px}
.route-toolbox .route-tool-buttons button{min-height:42px}
.route-toolbox .route-tool-label{font-size:9px;line-height:1.2}
.route-toolbox-body{padding:10px}
.route-status-banner{padding:8px 10px;grid-template-columns:25px 1fr}
.route-status-banner .status-icon{width:23px;height:23px}
.route-points{margin:8px 0;border:1px solid #d8e2ea;border-radius:8px;background:#fff;padding:0 10px}
.route-points>summary{cursor:pointer;min-height:38px;line-height:38px;color:#435d72;font-size:12px;font-weight:650}
.route-points>summary:focus-visible{outline:2px solid var(--blue);outline-offset:3px;border-radius:3px}
.route-points[open]{padding-bottom:10px}
.route-points>.selection-list{max-height:360px;overflow-y:auto;overscroll-behavior:contain;margin-top:3px}
.panel-intro{margin-bottom:16px}
.route-calc-status:empty,.manual-route-status:empty,.route-diagnostic:empty,#transferStatus:empty{min-height:0;margin:0;padding:0}
@media(max-width:700px){
  .route-toolbox .route-tool-buttons button,.route-toolbox .tool-actions button,.route-toolbox #routeToolApply{min-height:44px}
  .context-help>summary{min-height:40px;line-height:40px}
  .route-toolbox .route-tool-help>summary{min-height:34px;line-height:34px}
  .route-toolbox[open]{width:min(280px,calc(100vw - 24px))}
  .route-points>summary{min-height:44px;line-height:44px}
}
