.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-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-control-checkbox-divider {
    display: grid;
    grid-template-columns: minmax(12px, 1fr) auto minmax(12px, 1fr);
    align-items: center;
    gap: 8px;
    margin: 3px 0 1px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.map-control-checkbox-divider::before,
.map-control-checkbox-divider::after {
    content: "";
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
}

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

.map-unit-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    background: rgba(17, 30, 44, 0.35);
}

.map-unit-toggle__option {
    display: block;
    cursor: pointer;
}

.map-unit-toggle__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.map-unit-toggle__option span {
    display: block;
    padding: 5px 8px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.map-unit-toggle__option input:checked + span {
    background: #aedb34;
    color: #111e2c;
}

.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 {
    position: absolute;
    top: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 1203;
    width: min(680px, calc(100% - 24px));
    margin: 0;
    padding: 0;
    pointer-events: none;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.airspace-slice-panel.is-open {
    opacity: 1;
    transform: none;
}

.airspace-slice-panel.is-open .airspace-slice-content {
    pointer-events: auto;
}

.airspace-slice-content {
    --airspace-slice-bg-top: rgba(48, 58, 51, 0.96);
    --airspace-slice-bg-bottom: rgba(36, 47, 48, 0.96);
    --airspace-slice-grid-major: rgba(226, 233, 226, 0.22);
    --airspace-slice-grid-minor: rgba(226, 233, 226, 0.14);
    --airspace-slice-axis-text: #ffffff;
    --airspace-slice-axis-line: rgba(255, 255, 255, 0.22);
    --airspace-slice-ground-top: rgba(78, 78, 80, 0.96);
    --airspace-slice-ground-bottom: rgba(72, 72, 74, 0.98);
    --airspace-slice-ground-line: rgba(255, 255, 255, 0.12);
    --airspace-slice-ground-text: #ffffff;
    --airspace-slice-agl-line: rgba(255, 255, 255, 0.52);
    --airspace-slice-agl-text: #ffffff;
    --airspace-slice-fill-restricted: #ff1712;
    --airspace-slice-stroke-restricted: #ff1712;
    --airspace-slice-text-restricted: #ffffff;
    --airspace-slice-fill-tra: #ffffff;
    --airspace-slice-tra-pattern-bg: rgba(255, 255, 255, 0.96);
    --airspace-slice-stroke-tra: #16a340;
    --airspace-slice-text-tra: #15983b;
    --airspace-slice-fill-tma: #087abd;
    --airspace-slice-stroke-tma: #087abd;
    --airspace-slice-text-tma: #ffffff;
    --airspace-slice-fill-other: #8c9696;
    --airspace-slice-stroke-other: #657171;
    --airspace-slice-text-other: #ffffff;
    --airspace-slice-fill-class-e: rgba(255, 255, 255, 0.12);
    --airspace-slice-stroke-class-e: rgba(255, 255, 255, 0.22);
    --airspace-slice-text-class-e: rgba(255, 255, 255, 0.76);
    --airspace-slice-label-outline: rgba(36, 47, 48, 0.42);
    background: linear-gradient(145deg, rgba(48, 58, 51, 0.96) 0%, rgba(34, 47, 50, 0.96) 100%);
    color: #f7faf7;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 100%;
    overflow: auto;
    pointer-events: none;
    scrollbar-width: thin;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(8px);
}

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

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

.airspace-slice-heading {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.airspace-slice-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.airspace-slice-close-button {
    all: unset;
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    padding: 0;
    flex: 0 0 28px;
    text-align: center;
}

.airspace-slice-close-button:hover,
.airspace-slice-close-button:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
}

.airspace-slice-close-button:focus-visible {
    box-shadow: 0 0 0 2px rgba(174, 219, 52, 0.5);
}

.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: 72px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 0 9px;
    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.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.58);
    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: #ffffff;
    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(35, 46, 49, 0.95);
}

#airspace-unit-switch:checked + .switch-rail {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.32);
}

.airspace-slice-status {
    font-size: 0.78rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 6px 8px;
    max-width: 640px;
    line-height: 1.35;
}

.airspace-slice-status--warning {
    background: rgba(255, 23, 18, 0.16);
    color: #ffffff;
}

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

.airspace-slice-body {
    min-height: 0;
}

.airspace-slice-tabs {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.airspace-slice-tab {
    appearance: none;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font: 700 0.78rem/1.2 Arial, sans-serif;
    padding: 6px 12px;
}

.airspace-slice-tab:hover,
.airspace-slice-tab:focus-visible {
    color: #ffffff;
    outline: none;
}

.airspace-slice-tab:focus-visible {
    box-shadow: 0 0 0 2px rgba(174, 219, 52, 0.45);
}

.airspace-slice-tab.is-active {
    background: #ffffff;
    color: rgba(35, 46, 49, 0.95);
}

.airspace-slice-tab-panel[hidden] {
    display: none;
}

.airspace-slice-tab-panel {
    min-height: 0;
}

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

.airspace-slice-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.68);
}

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



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

.airspace-slice-canvas-wrap {
    position: relative;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
}

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

.airspace-slice-svg-wrap svg {
    width: 100%;
    height: auto;
    max-height: 390px;
    display: block;
    border-radius: 0;
}


.airspace-slice-axis-label {
    display: none;
}

.airspace-slice-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.74);
    padding-left: 0;
}

.airspace-slice-legend--multi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.airspace-slice-card-summary {
    grid-column: 1 / -1;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
}

.airspace-slice-table-wrap {
    grid-column: 1 / -1;
    overflow-x: auto;
    background: rgba(250, 250, 248, 0.96);
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.airspace-slice-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    color: #333333;
    font-size: 0.92rem;
}

.airspace-slice-table th,
.airspace-slice-table td {
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.airspace-slice-table th {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.airspace-slice-table th:nth-child(1),
.airspace-slice-table td:nth-child(1) {
    width: 28%;
}

.airspace-slice-table th:nth-child(2),
.airspace-slice-table td:nth-child(2) {
    width: 8%;
}

.airspace-slice-table th:nth-child(3),
.airspace-slice-table td:nth-child(3) {
    width: 34%;
}

.airspace-slice-table th:nth-child(4),
.airspace-slice-table td:nth-child(4),
.airspace-slice-table th:nth-child(5),
.airspace-slice-table td:nth-child(5) {
    width: 16%;
}

.airspace-slice-table tbody tr:last-child td {
    border-bottom: 0;
}

.airspace-slice-table-name-inner {
    display: flex;
    align-items: stretch;
    gap: 5px;
    min-width: 0;
}

.airspace-slice-table-color {
    width: 5px;
    min-height: 26px;
    background: var(--airspace-table-color, #657171);
    flex: 0 0 auto;
}

.airspace-slice-table-title {
    min-width: 0;
    overflow-wrap: anywhere;
}

.airspace-slice-table-title {
    display: block;
    font-weight: 800;
}

.airspace-slice-table-type,
.airspace-slice-table-limit {
    color: #4b5563;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.airspace-slice-table-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    color: #8a8a8a;
}

.airspace-slice-table-status-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    line-height: 1.25;
}

.airspace-slice-table-status-row span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.airspace-slice-table-source {
    border-radius: 3px;
    padding: 1px 5px;
    background: rgba(75, 85, 99, 0.12);
    color: #4b5563;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.35;
    white-space: nowrap;
}

.airspace-slice-table-status-row.is-active {
    color: #ff1712;
}

.airspace-slice-table-status-row.is-active .airspace-slice-card-dot {
    background: #ff1712;
}

.airspace-slice-airspace-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;
    min-height: 0;
    background: rgba(250, 250, 248, 0.96);
    border-left: 0;
    border-top: 4px solid var(--airspace-card-color, #657171);
    border-radius: 4px;
    color: #333333;
    padding: 7px 8px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.airspace-slice-card-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.airspace-slice-card-title {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.airspace-slice-card-type {
    color: #606060;
    font-size: 0.68rem;
    line-height: 1.2;
}

.airspace-slice-card-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #8a8a8a;
    font-size: 0.66rem;
    line-height: 1.2;
    min-width: 0;
}

.airspace-slice-card-status span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.airspace-slice-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9b9b9b;
    flex: 0 0 auto;
}

.airspace-slice-card-status.is-active {
    color: #ff1712;
}

.airspace-slice-card-status.is-active .airspace-slice-card-dot {
    background: #ff1712;
}

.airspace-slice-card-limits {
    display: grid;
    align-content: start;
    gap: 2px;
    border-left: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.14);
    padding-left: 0;
    padding-top: 5px;
}

.airspace-slice-card-limit {
    color: #666666;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.18;
    white-space: normal;
    overflow-wrap: anywhere;
}

.airspace-slice-card-limit.is-upper {
    color: #3f3f3f;
}

.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 {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    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;
    }

    .airspace-slice-panel {
        top: auto;
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        max-height: 68%;
        transform: translateY(10px);
    }

    #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: linear-gradient(145deg, rgba(48, 58, 51, 0.96) 0%, rgba(34, 47, 50, 0.96) 100%);
    color: #f2f6fb;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
}

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: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

body.dark-mode .airspace-slice-canvas-wrap {
    border-color: transparent;
    background: transparent;
}

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

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

body.dark-mode .airspace-slice-meta {
    color: rgba(255, 255, 255, 0.68);
}

body.dark-mode .airspace-slice-legend {
    color: rgba(255, 255, 255, 0.74);
}

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; }
        .airspace-slice-legend--multi { grid-template-columns: 1fr; }
    }

    #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;
    }

    .airspace-slice-content {
        padding: 12px;
    }

    .airspace-slice-airspace-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .airspace-slice-card-limits {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        border-left: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.12);
        padding-left: 0;
        padding-top: 7px;
    }
}

.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;
}
