.is-hidden {
    display: none !important;
}

/* Map layout */
.map-layout {
    --map-left-panel-width: 340px;
    --map-toggle-width: 15px;
    display: grid;
    grid-template-columns: var(--map-left-panel-width) var(--map-toggle-width) 1fr;
    width: 100%;
    margin: 0 auto;
    gap: 0;
    min-height: calc(100vh - 140px);
    position: relative;
    transition: grid-template-columns 0.3s ease;
}

.map-layout.is-left-collapsed {
    --map-left-panel-width: 0px;
    --map-toggle-width: 0px;
    grid-template-columns: 0 var(--map-toggle-width) 1fr;
}

.map-left-panel {
    display: flex;
    min-height: 100%;
    background: #34495e;
    color: #f0f4f8;
    position: relative;
    overflow: hidden;
    grid-column: 1;
}

.map-left-wrapper {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 18px;
    width: 100%;
    min-height: 100%;
    overflow-y: auto;
}

#map-controls-overlay {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.map-control-group {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.map-control-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #f6f8fb;
    font-size: 0.95em;
    letter-spacing: 0.02em;
}

.map-control-group--countries .map-control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.map-control-group--countries .map-control-title {
    margin: 0;
}

.airspace-filter-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #aedb34;
    color: #1c260d;
    font-size: 1.35em;
    line-height: 1;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.airspace-filter-add-btn:hover {
    background: #c6ef58;
    transform: translateY(-1px);
    color: #162008;
}

.airspace-filter-add-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 18px rgba(174, 219, 52, 0.3);
}

.airspace-filter-add-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 30, 44, 0.65), 0 0 0 5px rgba(174, 219, 52, 0.65);
}

.map-control-group--countries .airspace-filter-add-btn span {
    font-weight: 600;
}

.map-control-subtitle {
    display: block;
    margin: 14px 0 6px 0;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.78);
}

.map-control-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-control-input,
.map-control-select {
    width: 100%;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(17, 30, 44, 0.45);
    color: #f6f8fb;
    padding: 8px 10px;
    font-size: 0.95em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.map-control-input:focus,
.map-control-select:focus {
    outline: none;
    border-color: #aedb34;
    box-shadow: 0 0 0 2px rgba(174, 219, 52, 0.25);
}

.map-control-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.92em;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.4;
}

.map-control-checkbox input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #aedb34;
}

.map-filter-container {
    margin-top: 12px;
}

.airspace-selected-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.airspace-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.airspace-selected-empty {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85em;
    padding: 4px 0;
}

.airspace-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    color: #f6f8fb;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.airspace-chip:hover {
    background: rgba(174, 219, 52, 0.18);
    border-color: rgba(174, 219, 52, 0.55);
    color: #ffffff;
}

.airspace-chip:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(174, 219, 52, 0.35);
}

.airspace-chip-remove {
    font-size: 1.1em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.airspace-chip-label {
    white-space: nowrap;
}

.airspace-search-wrapper {
    position: relative;
}

.airspace-search-wrapper[hidden] {
    display: none !important;
}

.airspace-search-input {
    padding-right: 34px;
}

.airspace-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: rgba(17, 30, 44, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
    z-index: 20;
}

.airspace-search-results[hidden] {
    display: none !important;
}

.airspace-search-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
    transition: background 0.18s ease;
}

.airspace-search-option:hover,
.airspace-search-option:focus {
    background: rgba(174, 219, 52, 0.18);
    outline: none;
}

.airspace-search-option__meta {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.65);
    margin-left: 10px;
}

.airspace-search-empty {
    padding: 10px 12px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.65);
}

.altitude-filter {
    margin-top: 14px;
}

.altitude-filter-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.altitude-slider {
    position: relative;
    height: 34px;
}

.altitude-slider-track,
.altitude-slider-range {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
}

.altitude-slider-track {
    left: 0;
    right: 0;
    background: rgb(255 255 255 / 15%);
}

.altitude-slider-range {
    background: linear-gradient(90deg, #4aa3ff, #3bd6ff);
}

.altitude-slider input[type="range"] {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    pointer-events: none;
    background: none;
    -webkit-appearance: none;
    appearance: none;
    height: 25px;
}

.altitude-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: all;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b9eff;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    -webkit-appearance: none;
}

.altitude-slider input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b9eff;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.altitude-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
}

.altitude-slider input[type="range"]::-moz-range-track {
    height: 6px;
    background: transparent;
}

.map-filter-reset {
    margin-top: 6px;
    display: inline-block;
    font-size: 0.85em;
}

.map-filter-reset:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.map-control-checkbox.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.map-control-checkbox.is-disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.map-control-hint {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85em;
}

.map-button {
    border: none;
    border-radius: 6px;
    background: #aedb34;
    color: #1f2e3d;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.map-button:hover {
    background: #9bc429;
}

.map-button:active {
    transform: translateY(1px);
}

.map-button.is-secondary {
    background: transparent;
    color: #f6f8fb;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.map-button.is-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.map-secondary-link {
    color: #aedb34;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9em;
}

.map-secondary-link:hover {
    text-decoration: underline;
}

.map-left-toggle {
    grid-column: 2;
    align-self: stretch;
    width: 100%;
    min-width: var(--map-toggle-width);
    height: 100%;
    border: none;
    border-radius: 0;
    padding: 0;
    background: #167aad;
    color: #f6f8fb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, width 0.2s ease;
    z-index: 25;
    position: relative;
    box-shadow: none;
}

.map-left-toggle:hover {
    background: #9cc61f;
}

.map-left-toggle:focus-visible {
    outline: 2px solid #aedb34;
    outline-offset: 2px;
}

.map-toggle-icon {
    width: 12px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.2s ease;
    transform-origin: 50% 50%;
    display: block;
}

.map-layout.is-left-collapsed .map-left-wrapper {
    display: none;
}

.map-layout.is-left-collapsed .map-left-panel {
    display: none;
}

.map-layout.is-left-collapsed .map-left-toggle {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 50%;
    background: #aedb34;
    color: #252525;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    align-self: auto;
}

.map-layout.is-left-collapsed .map-left-toggle:hover {
    background: #81a322;
    color: #252525;
}

.map-layout.is-left-collapsed .map-toggle-icon {
    transform: rotate(180deg);
}

.airspace-slice-box {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(44, 62, 80, 0.18);
    border-radius: 10px;
    padding: 14px 16px 12px 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
}

.airspace-slice-box__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.airspace-slice-box__title {
    font-weight: 600;
    color: #22313f;
    letter-spacing: 0.01em;
}

.airspace-slice-box__hint {
    font-size: 0.85em;
    color: #607080;
    line-height: 1.35;
}

.airspace-slice-panel {
    width: 100%;
    margin: 0;
    padding: 0;
}

.airspace-slice-content {
    background: transparent;
    color: #1f2a33;
    border-radius: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: none;
}

.airspace-slice-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.airspace-slice-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.airspace-slice-heading {
    margin: 0;
    font-size: 1.4em;
    letter-spacing: 0.01em;
    color: #1c2b36;
}

.airspace-unit-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.airspace-unit-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.airspace-unit-switch .switch-rail {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 108px;
    height: 32px;
    border-radius: 999px;
    background: rgba(240, 245, 252, 0.82);
    border: 1px solid rgba(100, 110, 125, 0.35);
    padding: 0 14px;
    box-sizing: border-box;
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.airspace-unit-switch .switch-option {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(64, 81, 100, 0.55);
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 2;
}

.airspace-unit-switch .switch-thumb {
    position: absolute;
    top: 1px;
    left: 1px;
    width: calc(50% - 2px);
    height: calc(100% - 2px);
    border-radius: 999px;
    background: linear-gradient(90deg, #1d87f8 0%, #97acc2 100%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease, background 0.25s ease;
    z-index: 1;
}

#airspace-unit-switch:checked + .switch-rail .switch-thumb {
    transform: translateX(calc(100% + 2px));
}

#airspace-unit-switch:not(:checked) + .switch-rail .switch-option--metric,
#airspace-unit-switch:checked + .switch-rail .switch-option--imperial {
    color: rgba(32, 46, 64, 0.92);
}

#airspace-unit-switch:checked + .switch-rail {
    background: rgba(229, 239, 255, 0.9);
    border-color: rgba(28, 126, 214, 0.5);
}

.airspace-slice-status {
    font-size: 0.9em;
    color: #334455;
    background: #eef3fa;
    border-radius: 10px;
    padding: 8px 12px;
    max-width: 640px;
    line-height: 1.35;
}

.airspace-slice-status--warning {
    background: rgba(192, 57, 43, 0.08);
    color: #c0392b;
}

.airspace-slice-status.is-hidden {
    display: none;
}

#airspace-slice-canvas {
    width: 100%;
    height: 600px;
    display: block;
    border-radius: 14px;
    background: transparent;
}

.airspace-slice-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.9em;
    color: #3f4a55;
}

.airspace-slice-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}



.airspace-slice-visual {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.airspace-slice-canvas-wrap {
    position: relative;
    border: 1px solid #d0d7e2;
    border-radius: 0px;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f4f9 100%);
}

.airspace-slice-svg-wrap {
    position: relative;
    width: 100%;
    min-height: 150px;
}

.airspace-slice-svg-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 14px;
}


.airspace-slice-axis-label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center;
    font-size: 0.78em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7a8e;
    pointer-events: none;
}

.airspace-slice-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.85em;
    color: #526170;
    padding-left: 6px;
}

.airspace-slice-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.airspace-slice-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: none;
    flex-shrink: 0;
}


.airspace-slice-hint {
    font-size: 0.82em;
    color: #7f8c8d;
}

.airspace-slice-pointer {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #111111;
    background: #e74c3c;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.airspace-slice-pointer.is-visible {
    opacity: 1;
}

.airspace-slice-box .map-button {
    min-width: 150px;
}

.map-layout.is-left-collapsed .airspace-slice-box {
    display: none;
}


.map-right-panel {
    display: flex;
    flex-direction: column;
    background: #f5f7fb;
    min-height: calc(100vh - 140px);
    min-width: 0;
    grid-column: 3;
}

.map-map-wrapper {
    flex: 1 1 auto;
    position: relative;
    min-height: 600px;
    display: flex;
    background: #dfe6ec;
}

.map-canvas {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: inherit;
}

@media (max-width: 1200px) {
    .map-layout {
        --map-left-panel-width: clamp(280px, 30vw, 340px);
    }
}

@media (max-width: 992px) {
    .map-layout {
        grid-template-columns: 1fr;
        --map-toggle-width: 0px;
        min-height: auto;
    }

    .map-left-panel {
        min-height: auto;
        grid-column: auto;
    }

    .map-left-toggle {
        display: none;
    }

    .map-right-panel {
        grid-column: auto;
    }

    .map-layout.is-left-collapsed .map-left-panel {
        display: flex;
    }

    .map-layout.is-left-collapsed .map-left-wrapper {
        display: flex;
    }

    .map-left-wrapper {
        overflow-x: visible;
        overflow-y: auto;
        padding-bottom: 0;
    }

    #map-controls-overlay {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
        gap: 14px;
        width: 100%;
    }

    .map-control-group {
        width: auto;
    }
}

@media (max-width: 768px) {
    .map-map-wrapper {
        min-height: 480px;
        flex-direction: column;
        gap: 12px;
    }

    #ol-feature-boxes-overlay {
        position: static;
        width: 100%;
        max-width: none;
        min-width: 0;
        pointer-events: auto;
        margin-top: 0;
    }

    .ol-feature-box {
        width: 100%;
    }
}

@media (max-width: 940px) {
    .airspace-slice-header {
        margin-right: 0;
    }
}

body.dark-mode .map-left-panel {
    background: #23272e;
}

body.dark-mode .map-control-group {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
}

body.dark-mode .map-button.is-secondary {
    color: #f0f4f8;
    border-color: rgba(255, 255, 255, 0.4);
}

body.dark-mode .map-right-panel {
    background: #1e232b;
}

body.dark-mode .map-map-wrapper {
    background: #1e232b;
}

body.dark-mode .airspace-slice-content {
    background: #1f252c;
    color: #f2f6fb;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

body.dark-mode .airspace-slice-unit-toggle {
    border-color: rgba(160, 172, 190, 0.45);
    background: rgba(45, 54, 66, 0.6);
}

body.dark-mode .airspace-slice-heading {
    color: #f2f6fb;
}

body.dark-mode .airspace-slice-status {
    color: #d5e2f5;
    background: rgba(70, 90, 120, 0.32);
}

body.dark-mode .airspace-slice-canvas-wrap {
    border-color: rgba(109, 123, 139, 0.42);
    background: linear-gradient(180deg, #252d38 0%, #1a212b 100%);
}

body.dark-mode #airspace-slice-canvas {
    background: transparent;
}

body.dark-mode .airspace-slice-axis-label {
    color: #7f8fa4;
}

body.dark-mode .airspace-slice-meta {
    color: #c3cfdd;
}

body.dark-mode .airspace-slice-legend {
    color: #a9b6c8;
}

body.dark-mode .airspace-slice-pointer {
    border-color: #f2f6fb;
    background: #ff6b6b;
}

body.dark-mode .airspace-slice-hint {
    color: #a9b4c2;
}

#map {
        width: 100%;
        max-width: 1400px;
        height: 80vh;
        max-height: 800px;
        margin: 0 auto;
        display: block;
        padding-top: 15px;
        background: #fff;
        border-radius: 8px;
        border: 1px solid #ccc;
    }

    body.dark-mode #map {
        background: #23272e !important;
        color: #eee !important;
        border: 1px solid #444 !important;
    }

    #layer-controls {
        z-index: 1201;
        background: #fff;
        padding: 8px 16px 12px 16px;
        border-radius: 8px;
        border: 1px solid #ccc;
        box-shadow: 0 2px 8px #0002;
        font-size: 1em;
        user-select: none;
        transition: background 0.2s, color 0.2s;
    }

    #layer-controls label,
    #layer-controls select,
    #layer-controls a {
        display: block;
        margin-bottom: 6px;
    }

    #layer-controls a {
        margin-top: 10px;
        color: #0074d9;
        text-decoration: underline;
        font-weight: bold;
        cursor: pointer;
        transition: color 0.2s;
    }

    #layer-controls select {
        background: #fff;
        color: #222;
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 2px 6px;
        transition: background 0.2s, color 0.2s, border 0.2s;
    }

    #layer-controls .legende-title {
        font-weight: bold;
        margin-top: 18px;
    }

    #layer-controls .legende-entry {
        display: flex;
        align-items: center;
        margin-bottom: 4px;
    }

    #layer-controls .legende-color {
        display: inline-block;
        width: 22px;
        height: 10px;
        margin-right: 8px;
        border: 2px solid #000;
        border-radius: 2px;
    }

    body.dark-mode #layer-controls {
        background: #23272e !important;
        color: #eee !important;
        border: 1px solid #444 !important;
    }

    body.dark-mode #layer-controls a {
        color: #66b3ff !important;
    }

    body.dark-mode #layer-controls select {
        background: #23272e !important;
        color: #eee !important;
        border: 1px solid #444 !important;
    }

    body.dark-mode #layer-controls .legende-color,
    body.dark-mode .legend-color {
        border-color: #eee !important;
    }

    body.dark-mode .legend-label {
        color: #eee !important;
    }

    body.light-mode #layer-controls {
        background: #fff !important;
        color: #222 !important;
        border: 1px solid #ccc !important;
    }

    body.light-mode #layer-controls a {
        color: #0074d9 !important;
    }

    body.light-mode #layer-controls select {
        background: #fff !important;
        color: #222 !important;
        border: 1px solid #ccc !important;
    }

    body.light-mode #layer-controls .legende-color,
    body.light-mode .legend-color {
        border-color: #000 !important;
    }

    body.light-mode .legend-label {
        color: #222 !important;
    }

    /* Österreich-Maske */
    .austria-mask {
        background: transparent !important;
        pointer-events: none;
        z-index: 1100;
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
    }

    #airspace-info-box {
        z-index: 2200;
        background: #fff;
        padding: 15px 18px 12px 18px;
        border-radius: 8px;
        border: 1px solid #ccc;
        box-shadow: 0 2px 8px #0002;
        min-width: 260px;
        max-width: 650px;
        max-height: 70vh;
        overflow-y: auto;
        font-size: 1em;
        display: none;
    }

    #airspace-info-box.active {
        display: block;
    }

    body.dark-mode #airspace-info-box {
        background: #23272e !important;
        color: #eee !important;
        border: 1px solid #444 !important;
    }

    body.light-mode #airspace-info-box {
        background: #fff !important;
        color: #222 !important;
        border: 1px solid #ccc !important;
    }



    #aip-source-modal {
        display: none;
        position: fixed;
        z-index: 2000;
        left: 0; top: 0; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.35);
    }

    #aip-source-modal .modal-content {
        background: #fff;
        color: #222;
        max-width: 700px;
        margin: 40px auto;
        padding: 28px 24px 18px 24px;
        border-radius: 10px;
        box-shadow: 0 6px 32px #0004;
        position: relative;
        font-family: monospace, monospace;
        font-size: 0.97em;
        max-height: 500px;
        overflow-y: auto;
    }

    #aip-source-modal .modal-content .close-btn {
        position: absolute;
        top: 12px; right: 16px;
        background: #eee;
        border: none;
        border-radius: 4px;
        font-size: 1.1em;
        padding: 2px 10px;
        cursor: pointer;
        color: #222;
    }

    body.dark-mode #aip-source-modal .modal-content {
        background: #23272e !important;
        color: #eee !important;
        box-shadow: 0 6px 32px #000a !important;
    }

    body.dark-mode #aip-source-modal .modal-content .close-btn {
        background: #333 !important;
        color: #eee !important;
    }

    body.light-mode #aip-source-modal .modal-content {
        background: #fff !important;
        color: #222 !important;
        box-shadow: 0 6px 32px #0004 !important;
    }

    body.light-mode #aip-source-modal .modal-content .close-btn {
        background: #eee !important;
        color: #222 !important;
    }

    .tra-label {
        background: rgba(255,255,255,0.85);
        color: #222;
        font-weight: bold;
        border-radius: 4px;
        border: 1px solid #888;
        padding: 2px 12px;
        font-size: 1.08em;
        box-shadow: 0 1px 4px #0002;
        pointer-events: none;
        text-align: center;
        z-index: 1202;
        font-family: inherit;
        font-weight: bold;
        font-size: 0.85em;
    }
    .tra-label.tra-label-active {
        background: #eaffea !important;
        color: #2ecc40 !important;
        border: 1.5px solid #1e9c2b !important;
        font-weight: bold;
    }
    body.dark-mode .tra-label {
        background: rgba(40,40,40,0.92);
        color: #fff;
        border: 1px solid #444;
    }
    body.dark-mode .tra-label.tra-label-active {
        background: #23272e !important;
        color: #2ecc40 !important;
        border: 1.5px solid #1e9c2b !important;
        font-weight: bold;
    }

    @media (max-width: 900px) {
        #map {
            height: 60vh;
            max-height: 500px;
            min-height: 300px;
        }
        .tra-aktivierung-reiter {
            font-size: 1.1em;
        }
        #layer-controls {
            font-size: 0.98em;
            padding: 8px 6px 10px 6px;
        }
        .tra-label {
            font-size: 0.8em;
        }
    }
    @media (max-width: 600px) {
        #map {
            height: 55vh;
            max-height: 350px;
            min-height: 180px;
        }
        .tra-aktivierung-reiter {
            font-size: 1em;
        }
        #layer-controls {
            font-size: 0.95em;
            padding: 6px 2px 8px 2px;
        }
        .tra-label {
            font-size: 0.7em;
        }
        .tra-aktivierung-reiter,
        #layer-controls,
        #airspace-info-box {
            max-width: 100vw !important;
        }
        .tra-aktivierung-reiter {
            padding-left: 6px;
        }
        #ol-info-box {
            margin: 8px 0 0 18px !important;
            max-width: 340px !important;
            background: #f5f5f5 !important;
            border: none !important;
            border-radius: 6px !important;
            color: #444 !important;
            font-size: 0.98em !important;
            box-shadow: none !important;
            padding: 7px 14px !important;
            display: block;
            position: relative;
            font-weight: normal !important;
            opacity: 0.85;
        }
    }
    @media (max-width: 480px) {
        #map {
            height: 45vh;
            max-height: 220px;
            min-height: 120px;
        }
        .tra-label {
            font-size: 0.65em;
        }
    }

    /* OpenLayers: CTA-Lufträume transparent darstellen */
    .ol-cta-airspace {
        background: transparent !important;
        border: 2px solid #000 !important;
        /* keine Füllfarbe */
        box-shadow: none !important;
        opacity: 1 !important;
    }



#ol-map {
    width: 100%;
    height: 100%;
    min-height: inherit;
    z-index: 1;
}
body.dark-mode #ol-map  {
    border: 1px solid #ccc;
}

#ol-feature-boxes-overlay {
    position: static;
    left: 0;
    top: 0;
    z-index: 1202;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: none;
    min-width: 0;
    pointer-events: auto;
}
    .ol-feature-box {
        background: #fff;
        border: 1px solid #bbb;
        border-radius: 0px;
        padding: 10px 14px;
        box-shadow: 0 2px 8px #0001;
        font-size: 1em;
        margin-bottom: 0;
        pointer-events: auto;
        transition: box-shadow 0.15s, border-color 0.15s, background 0.15s;
    }
    .ol-feature-box.active {
        box-shadow: 0 0 0 3px #222;
        border-color: #222;
        z-index: 9999;
    }
    .ol-feature-box.tra-active {
        background: linear-gradient(90deg, #eaffea 0%, #e0ffe0 100%);
        border-color: #2ecc40;
    }
    .ol-feature-box.tra-inactive {
        background: linear-gradient(90deg, #eaf0ff 0%, #e0eaff 100%);
        border-color: #2040ec;
    }
    .ol-feature-box .tra-title-active {
        color: #2ecc40;
    }
    .ol-feature-box .tra-title-inactive {
        color: #2040ec;
    }

    /* Dark mode styles */
    body.dark-mode #ol-feature-boxes-overlay {
        /* overlay itself doesn't need color, but keep for completeness */
    }
    body.dark-mode .ol-feature-box {
        background: #23272e !important;
        border: 1px solid #444 !important;
        color: #eee !important;
        box-shadow: 0 2px 8px #0006 !important;
    }
    body.dark-mode .ol-feature-box.active {
        box-shadow: 0 0 0 3px #eee !important;
        border-color: #eee !important;
    }
    body.dark-mode .ol-feature-box.tra-active {
        background: linear-gradient(90deg, #2a3d2a 0%, #1e2e1e 100%) !important;
        border-color: #2ecc40 !important;
    }
    body.dark-mode .ol-feature-box.tra-inactive {
        background: linear-gradient(90deg, #232e3d 0%, #1e232e 100%) !important;
        border-color: #2040ec !important;
    }
    body.dark-mode .ol-feature-box .tra-title-active {
        color: #2ecc40 !important;
    }
    body.dark-mode .ol-feature-box .tra-title-inactive {
        color: #66aaff !important;
    }

    @media (min-width: 769px) {
        #ol-feature-boxes-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: auto;
            max-width: 500px;
            min-width: 260px;
            pointer-events: none;
        }

        .ol-feature-box {
            width: auto;
        }
    }

    @media (max-width: 600px) {
        #ol-map { height: 250px; }
        #ol-feature-boxes-overlay { max-width: none; }
    }

    #legend-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.25);
    align-items: center;
    justify-content: center;
}

#legend-modal .legend-content {
    background: #fff;
    padding: 24px 28px 18px 28px;
    border-radius: 12px;
    box-shadow: 0 4px 32px #0003;
    max-width: 620px;
    min-width: 260px;
    position: relative;
    color: #222;
}

#legend-modal .legend-content b {
    font-size: 1.15em;
}

.legend-entry,
#legend-modal .legend-entry {
    display: flex;
    align-items: center;
    margin-bottom: 7px;
}

.legend-color,
#legend-modal .legend-color {
    display: inline-block;
    width: 22px;
    height: 10px;
    margin-right: 8px;
    border-radius: 2px;
    /* border is set individually below */
}

.legend-label,
#legend-modal .legend-label {
    font-size: 0.97em;
    font-style: italic;
}

#legend-modal .legend-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 1.6em;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
}

body.dark-mode #legend-modal .legend-content {
    background: #23272e !important;
    color: #eee !important;
    box-shadow: 0 4px 32px #000a !important;
}

body.dark-mode #legend-modal .legend-close-btn {
    color: #bbb !important;
}

/* Farben für die Legende */
.legend-color-w-active { background: rgba(3, 242, 3, 0.61); border: 2px solid #0cf30cff; }
.legend-color-w-inactive { background: rgba(30, 74, 253, 0.51); border: 2px dashed #0400ff; }
.legend-color-ctr,
.legend-color-mctr,
.legend-color-r { background: rgba(255,0,0,0.2); border: 2px solid #FF0000; }
.legend-color-q { background: rgba(255,165,0,0.2); border: 2px solid #FFA500; }
.legend-color-grey { background: rgba(136,136,136,0.2); border: 2px solid #888888; }
.legend-color-cta { background: rgba(0,0,0,0); border: 2px solid #000; }

/* Optional: Responsive */
@media (max-width: 700px) {
    #legend-modal .legend-content {
        max-width: 98vw;
        min-width: 0;
        padding: 14px 6vw 12px 6vw;
    }
}

.heute-link {
    padding: 2px 10px;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f8f8f8;
    text-decoration: none;
}

body.dark-mode .heute-link {
    border: 1px solid #444;
    background: #23272e;
    color: #eee;
}


body.dark-mode a.heute-link {
    color: #fff !important;
    background: #23272e;
    border: 1px solid #444;
}

.basemap-link {
    color: #012b4f;
    text-decoration: underline;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

body.dark-mode .basemap-link {
    color: #002952 !important;
    text-decoration: underline;
}
