.airspace-editor-page-body {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.airspace-editor-page-body > .topbar {
    flex: 0 0 auto;
}

.airspace-editor-page {
    flex: 1 1 auto;
    width: 100%;
    max-width: var(--page-max-width);
    min-height: 0;
    display: flex;
    box-sizing: border-box;
}

.airspace-editor-page-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.airspace-editor-page-heading {
    flex: 0 0 auto;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px var(--page-gutter);
    border-bottom: 1px solid var(--line);
}

.airspace-editor-page-heading h1 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.2;
}

.airspace-editor-maximize {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
}

.airspace-editor-maximize:hover {
    background: var(--control-bg-hover);
}

.airspace-editor-maximize img {
    width: 17px;
    height: 17px;
}

.airspace-editor-page-panel.is-maximized {
    position: fixed;
    inset: 0;
    z-index: var(--z-task-editor-fullscreen);
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
}

.airspace-editor-instance {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #f5f8fb;
}

.airspace-editor-commandbar {
    position: relative;
    z-index: var(--z-local-popover);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfd;
}

.airspace-export-trigger {
    margin-left: auto;
}

.airspace-editor-workspace {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
    overflow: hidden;
}

.airspace-editor-map-panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #dce6ee;
}

.airspace-editor-map {
    width: 100%;
    height: 100%;
}

.airspace-editor-list-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--line);
    background: #fff;
    overflow: hidden;
}

.airspace-filter-field {
    flex: 0 0 auto;
    display: grid;
    gap: 5px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.airspace-filter-field label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.airspace-filter-field input {
    width: 100%;
    min-height: 38px;
}

.airspace-filter-field small {
    min-height: 1em;
    color: var(--muted);
    font-size: 0.74rem;
}

.airspace-zone-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}

.airspace-zone-empty {
    margin: 18px 8px;
    color: var(--muted);
    text-align: center;
}

.airspace-zone-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    overflow: hidden;
}

.airspace-zone-row.is-active {
    border-color: #d5681d;
    box-shadow: 0 0 0 1px rgba(213, 104, 29, 0.22);
    background: #fff9f3;
}

.airspace-zone-select {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 10px;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.airspace-zone-select strong,
.airspace-zone-select small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.airspace-zone-select small {
    color: var(--muted);
}

.airspace-zone-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 6px;
}

.airspace-zone-actions button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
}

.airspace-zone-actions button:hover {
    background: var(--control-bg-hover);
}

.airspace-zone-actions img {
    width: 16px;
    height: 16px;
}

.airspace-editor-statusbar {
    flex: 0 0 auto;
    min-height: 52px;
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 0 10px;
    border-top: 1px solid var(--line);
    background: #fbfcfd;
}

.airspace-editor-metrics {
    display: flex;
    align-items: stretch;
}

.airspace-editor-metrics > span {
    min-width: 86px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px 12px;
    border-right: 1px solid var(--line);
}

.airspace-editor-metrics strong {
    font-size: 0.96rem;
}

.airspace-editor-metrics small {
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

.airspace-editor-active-metric {
    max-width: 300px;
}

.airspace-editor-active-metric strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.airspace-editor-alert {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #3d5264;
    font-size: 0.8rem;
}

.airspace-editor-alert[hidden] {
    display: none;
}

.airspace-editor-alert span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.airspace-editor-alert button {
    position: relative;
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.airspace-editor-alert button::before,
.airspace-editor-alert button::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 1.5px;
    background: currentColor;
    transform: rotate(45deg);
}

.airspace-editor-alert button::after {
    transform: rotate(-45deg);
}

.airspace-editor-mobile-tabs {
    display: none;
}

.airspace-polygon-path {
    cursor: pointer;
}

.airspace-vertex-marker-shell,
.airspace-insert-marker-shell {
    background: transparent;
    border: 0;
}

.airspace-vertex-marker {
    width: 13px;
    height: 13px;
    display: block;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #d35f15;
    box-shadow: 0 1px 5px rgba(25, 37, 49, 0.55);
}

.airspace-insert-marker {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #2d6f9f;
    color: #fff;
    box-shadow: 0 1px 5px rgba(25, 37, 49, 0.5);
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.airspace-vertex-popup {
    display: grid;
    gap: 8px;
}

.airspace-vertex-popup small {
    color: var(--muted);
}

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

.airspace-properties-name {
    grid-column: 1 / -1;
}

.airspace-altitude-group {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.airspace-altitude-group legend {
    padding: 0 5px;
    font-weight: 700;
}

@media (max-width: 760px) {
    .airspace-editor-page {
        padding: 0;
    }

    .airspace-editor-page-panel {
        border-radius: 0;
    }

    .airspace-editor-commandbar {
        gap: 5px;
        padding: 6px;
    }

    .airspace-editor-commandbar .page-action {
        gap: 4px;
        padding-inline: 7px;
        font-size: 0.76rem;
    }

    .airspace-editor-mobile-tabs {
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }

    .airspace-editor-mobile-tabs button {
        min-height: 38px;
        border: 0;
        border-bottom: 2px solid transparent;
        background: transparent;
        font-weight: 700;
    }

    .airspace-editor-mobile-tabs button.is-active {
        border-bottom-color: #d5681d;
        color: #a64d11;
    }

    .airspace-editor-workspace {
        display: block;
        position: relative;
    }

    .airspace-editor-map-panel,
    .airspace-editor-list-panel {
        position: absolute;
        inset: 0;
        display: none;
        border-left: 0;
    }

    .airspace-editor-map-panel.is-active,
    .airspace-editor-list-panel.is-active {
        display: flex;
    }

    .airspace-editor-map-panel.is-active {
        display: block;
    }

    .airspace-editor-statusbar {
        min-height: 46px;
        padding: 0 4px;
    }

    .airspace-editor-metrics > span {
        min-width: 62px;
        padding: 5px 7px;
    }

    .airspace-editor-active-metric {
        max-width: 140px;
    }

    .airspace-editor-alert {
        position: absolute;
        left: 8px;
        right: 8px;
        bottom: 52px;
        padding: 8px;
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: var(--shadow-md);
    }

    .airspace-properties-grid,
    .airspace-altitude-group {
        grid-template-columns: 1fr;
    }
}
