.ns-flight-safety {
    box-sizing: border-box;
    --ns-fs-bg: rgba(12, 17, 20, .97);
    --ns-fs-panel: #151d20;
    --ns-fs-line: rgba(214, 162, 66, .30);
    --ns-fs-text: #e9e4d6;
    --ns-fs-muted: #a9aaa0;
    --ns-fs-amber: #d9a441;
    --ns-fs-red: #dc7063;
    --ns-fs-green: #88ad82;
    color: var(--ns-fs-text);
    width: min(320px, calc(100vw - 28px));
    max-height: min(78vh, 680px);
    overflow: auto;
    background: var(--ns-fs-bg);
    border: 1px solid var(--ns-fs-line);
    border-radius: 7px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, .46);
    backdrop-filter: blur(12px);
    font: 12px/1.45 "DM Sans", "Segoe UI", sans-serif;
    scrollbar-color: #6c5939 transparent;
}
.ns-flight-safety * { box-sizing: border-box; }
/* Keep the existing Light/Dark/Satellite toolbar clickable above this panel. */
.leaflet-top.leaflet-right .ns-flight-safety { margin-top: 52px; }
.ns-flight-safety.ns-fs-collapsed { width: 196px; }
.ns-flight-safety .ns-fs-body[hidden] { display: none; }
.ns-fs-head {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 10px;
    border-bottom: 1px solid var(--ns-fs-line);
}
.ns-fs-mark {
    width: 7px; height: 7px; flex: none; border-radius: 50%;
    background: var(--ns-fs-amber); box-shadow: 0 0 0 3px rgba(217,164,65,.12);
}
.ns-fs-title {
    flex: 1; margin: 0; color: var(--ns-fs-text);
    font: 700 10px/1.2 "Spline Sans Mono", Consolas, monospace;
    letter-spacing: .12em; text-transform: uppercase;
}
.ns-fs-collapse, .ns-fs-button, .ns-fs-icon-button {
    appearance: none; border: 1px solid rgba(217,164,65,.28);
    border-radius: 4px; color: var(--ns-fs-text); background: #20282a;
    font: inherit; cursor: pointer; transition: background-color .16s, border-color .16s;
}
.ns-fs-collapse { width: 27px; height: 26px; padding: 0; font-size: 17px; line-height: 1; }
.ns-fs-button { padding: 6px 9px; }
.ns-fs-icon-button { padding: 3px 6px; }
.ns-fs-collapse:hover, .ns-fs-button:hover, .ns-fs-icon-button:hover {
    border-color: var(--ns-fs-amber); background: #2a302f;
}
.ns-fs-collapse:focus-visible, .ns-fs-button:focus-visible, .ns-fs-icon-button:focus-visible,
.ns-flight-safety input:focus-visible, .ns-flight-safety textarea:focus-visible,
.ns-flight-safety select:focus-visible {
    outline: 2px solid var(--ns-fs-amber); outline-offset: 2px;
}
.ns-fs-body { padding: 9px 10px 10px; }
.ns-fs-body[hidden] { display: none; }
.ns-fs-section { padding: 8px 0; border-bottom: 1px solid rgba(220,226,212,.09); }
.ns-fs-section:first-child { padding-top: 0; }
.ns-fs-section:last-child { border-bottom: 0; padding-bottom: 0; }
.ns-fs-kicker {
    margin: 0 0 7px; color: var(--ns-fs-muted);
    font: 700 9px/1.2 "Spline Sans Mono", Consolas, monospace;
    letter-spacing: .1em; text-transform: uppercase;
}
.ns-fs-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.ns-fs-toggle {
    min-height: 32px; display: flex; align-items: center; gap: 7px;
    padding: 5px 7px; border: 1px solid rgba(220,226,212,.12); border-radius: 4px;
    background: #171f21; cursor: pointer;
}
.ns-fs-toggle input { accent-color: var(--ns-fs-amber); margin: 0; }
.ns-fs-toggle span { flex: 1; }
.ns-fs-swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--swatch); }
.ns-fs-weather-state, .ns-fs-message, .ns-fs-source {
    color: var(--ns-fs-muted); overflow-wrap: anywhere;
}
.ns-fs-weather-state { margin: 0 0 7px; }
.ns-fs-weather-state[data-level="caution"] { color: var(--ns-fs-amber); }
.ns-fs-weather-state[data-level="do_not_fly"], .ns-fs-message[data-kind="error"] { color: #f08b7c; }
.ns-fs-weather-state[data-level="ok"] { color: var(--ns-fs-green); }
.ns-fs-weather-state[data-level="stale"], .ns-fs-weather-state[data-level="unavailable"] { color: var(--ns-fs-muted); }
.ns-fs-weather-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.ns-fs-reading { min-width: 0; }
.ns-fs-reading span { display: block; color: var(--ns-fs-muted); font-size: 10px; }
.ns-fs-reading strong { display: block; font: 600 11px/1.35 "Spline Sans Mono", Consolas, monospace; overflow-wrap: anywhere; }
.ns-fs-source { margin: 7px 0 0; font-size: 10px; }
.ns-fs-legend { display: grid; gap: 5px; }
.ns-fs-legend-row { display: flex; align-items: center; gap: 7px; }
.ns-fs-dot { width: 9px; height: 9px; border: 1px solid currentColor; border-radius: 50%; }
.ns-fs-dot.no-fly { color: #e67869; background: rgba(190,55,45,.35); }
.ns-fs-dot.caution { color: #e1b14f; background: rgba(203,147,37,.28); }
.ns-fs-dot.airport { color: #83b5c2; background: rgba(69,133,150,.3); }
.ns-fs-message { min-height: 1.3em; margin: 7px 0 0; font-size: 11px; }
.ns-fs-admin-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.ns-fs-zone-list { display: grid; gap: 5px; margin-top: 7px; }
.ns-fs-zone-row {
    display: flex; align-items: flex-start; gap: 6px; padding: 6px;
    border: 1px solid rgba(220,226,212,.1); border-radius: 4px; background: #171f21;
}
.ns-fs-zone-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ns-fs-zone-name small { display: block; color: var(--ns-fs-muted); }
.ns-fs-dialog {
    position: fixed; inset: 0; z-index: 10020; display: grid; place-items: center;
    padding: 12px; background: rgba(0,0,0,.68);
}
.ns-fs-dialog[hidden] { display: none; }
.ns-fs-form {
    width: min(480px, 100%); max-height: min(90dvh, 740px); overflow: auto;
    padding: 16px; border: 1px solid var(--ns-fs-line); border-radius: 7px;
    background: #111719; box-shadow: 0 16px 55px #000a;
}
.ns-fs-form h3 { margin: 0 0 12px; font-size: 14px; letter-spacing: .06em; }
.ns-fs-modal-head { display: flex; align-items: flex-start; gap: 8px; }
.ns-fs-modal-head h3 { flex: 1; }
.ns-fs-field { display: grid; gap: 4px; margin: 9px 0; }
.ns-fs-field label { color: var(--ns-fs-muted); font-size: 10px; }
.ns-fs-field input, .ns-fs-field textarea, .ns-fs-field select {
    width: 100%; min-height: 34px; padding: 7px 8px;
    color: var(--ns-fs-text); border: 1px solid rgba(217,164,65,.24);
    border-radius: 4px; background: #192123; font: inherit;
}
.ns-fs-field textarea { min-height: 68px; resize: vertical; }
.ns-fs-fields-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ns-fs-form-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 13px; }
.ns-fs-file { max-width: 100%; color: var(--ns-fs-muted); font: inherit; }
.ns-fs-route-results { margin: 0; padding-left: 18px; }
.ns-fs-route-results li { margin: 3px 0; }
.ns-fs-zone-shape { stroke-width: 2; }
.ns-fs-point-icon {
    width: 13px; height: 13px; display: block; border: 2px solid #b6d8df;
    border-radius: 50%; background: #397b8a; box-shadow: 0 0 0 3px rgba(76,148,165,.2);
}
.leaflet-control .ns-flight-safety { margin: 0; }
@media (max-width: 600px) {
    .ns-flight-safety { width: min(300px, calc(100vw - 24px)); max-height: 67dvh; }
    .ns-fs-body { padding: 8px; }
    .ns-fs-form { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .ns-flight-safety *, .ns-flight-safety *::before, .ns-flight-safety *::after {
        scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important;
    }
}
