body.edit-page .content-frame {
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

body.edit-page .content-stack {
    min-height: 0;
    height: 100%;
    padding: 1rem;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
}

.edit-workspace-main {
    --edit-stage-height: clamp(16rem, 28vh, 21rem);
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: var(--edit-stage-height) minmax(0, 1fr);
    gap: 1rem;
    min-height: 0;
    overflow: hidden;
}

.edit-editor-panel,
.edit-stage-card,
.edit-stage-card .practice-stage,
.edit-stage-card .chapter-card,
.edit-stage-card .video-card,
.edit-editor-panel .editor-preview-shell,
.edit-editor-panel .editor-preview-stage,
.edit-editor-panel .editor-preview-canvas {
    min-height: 0;
}

.edit-editor-panel {
    display: block;
    min-width: 0;
}

.edit-editor-panel .editor-preview-shell {
    height: 100%;
    padding: 1rem 1rem 0.95rem;
}

.edit-editor-panel .editor-preview-stage {
    height: 100%;
}

.edit-editor-panel .editor-preview-canvas {
    height: 100%;
}

.edit-stage-card {
    display: block;
    height: 100%;
}

.edit-stage-card .practice-stage {
    --stage-rail-min: 23rem;
    height: 100%;
}

body.edit-page .app-player {
    padding: 0.85rem 1rem 1rem;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

@media (max-width: 1260px) {
    .edit-workspace-main {
        --edit-stage-height: clamp(15rem, 25vh, 19rem);
    }
}

@media (max-width: 960px) {
    body.edit-page .content-stack {
        overflow-y: auto;
        grid-template-rows: auto auto;
    }

    .edit-editor-panel .editor-preview-stage,
    .edit-editor-panel .editor-preview-canvas {
        min-height: 18rem;
        height: 18rem;
    }

    .edit-workspace-main {
        grid-template-rows: auto minmax(18rem, 1fr);
        overflow: visible;
    }
}
