.slide-stage {
    --slide-text-size: 2.4cqw;
    display: flex;
    flex-direction: column;
    gap: 0.45em;
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 5%;
    color: #f8fafc;
    background: #10243c;
    line-height: 1.35;
    overflow: auto;
    overflow-wrap: anywhere;
    font-size: clamp(8px, var(--slide-text-size), 64px);
    scrollbar-width: thin;
}

.slide-stage[data-layout="centered"], .slide-stage[data-type="title"] {
    justify-content: safe center;
    text-align: center;
}

.slide-title {
    font-size: 1.85em;
    line-height: 1.14;
    margin: 0;
    white-space: pre-line;
}

.slide-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 0.5em;
}

.slide-content > * {
    flex: 0 0 auto;
}

.slide-text, .slide-live-text {
    margin: 0;
    white-space: pre-wrap;
}

.slide-stage[data-type="text-image"][data-layout="split"] .slide-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.slide-placeholder {
    opacity: 0.8;
    margin: 0;
}

.slide-counter {
    font-size: 3.2em;
    font-weight: 750;
    line-height: 1;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.slide-media {
    max-width: 100%;
    max-height: 34cqw;
    object-fit: contain;
    align-self: center;
}

.slide-stage video.slide-media {
    width: 80%;
}

.slide-stage iframe.slide-media {
    width: 100%;
    aspect-ratio: 16 / 6;
    border: 0;
    background: #fff;
}

.slide-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    text-align: start;
}

.slide-table th, .slide-table td {
    text-align: start;
    border-bottom: 1px solid currentColor;
    padding: 0.2em 0.35em;
}

.slide-legend, .slide-bars, .slide-options, .slide-answer-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.slide-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45em;
    counter-reset: option;
}

.slide-options li {
    counter-increment: option;
    padding: 0.4em;
    border: 1px solid currentColor;
    border-radius: 0.35em;
}

.slide-options li::before {
    content: counter(option, upper-alpha) ". ";
    font-weight: 750;
}

.slide-options .slide-correct {
    background: #166534;
    color: white;
}

.slide-correct-label {
    margin: 0.25em 0 0;
    font-weight: 700;
}

.slide-chart {
    min-width: 0;
}

.slide-chart-pie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8em;
}

.slide-pie {
    width: 20cqw;
    max-width: 40%;
    aspect-ratio: 1;
    border-radius: 50%;
}

.slide-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em 0.6em;
    font-size: 0.8em;
}

.slide-legend li {
    display: flex;
    align-items: center;
    gap: 0.25em;
}

.slide-swatch {
    display: inline-block;
    width: 0.75em;
    aspect-ratio: 1;
    border-radius: 0.2em;
}

.slide-bars {
    display: grid;
    gap: 0.2em;
}

.slide-bars li {
    display: grid;
    grid-template-columns: minmax(5ch, 1fr) minmax(3ch, 3fr) max-content;
    gap: 0.5em;
    align-items: center;
}

.slide-bar-track {
    background: color-mix(in srgb, currentColor 12%, transparent);
    height: 0.7em;
    border-radius: 0.25em;
}

.slide-bar {
    display: block;
    border-radius: inherit;
    height: 100%;
    transform-origin: left;
    animation: bar-appear 300ms ease-out;
}

@keyframes bar-appear {
    from {
        transform: scaleX(0);
    }
}

.slide-line {
    display: block;
    width: min(100%, 60cqw);
    max-height: 20cqw;
    object-fit: contain;
}

.slide-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.2em 0.6em;
    font-weight: 680;
}

.slide-cloud span {
    line-height: 1.25;
}

.teacher-heading, .teacher-actions, .editor-toolbar, .new-presentation {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.teacher-heading, .editor-toolbar {
    justify-content: space-between;
    margin-bottom: 1rem;
}

.teacher-heading h1 {
    margin-block: 0;
}

.teacher-message:empty {
    display: none;
}

.presentation-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.presentation-card, .editor-sidebar, .slide-form, .presenter-controls, .presenter-sharing, .presenter-quick, .instant-form:not(:empty) {
    background: #fff;
    color: #13253d;
    border: 1px solid #dce4f0;
    border-radius: 1rem;
    padding: 1rem;
}

.presentation-card h2, .presenter-controls h2, .presenter-sharing h2, .presenter-quick h2 {
    font-size: 1rem;
    margin: 0 0 .6rem;
}

.teacher-body {
    width: 100%;
}

.editor-workspace {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(0, 3fr);
    align-items: start;
    gap: 1rem;
}

.slide-list {
    padding: 0;
    margin: .7rem 0 0;
    list-style: none;
    display: grid;
    gap: .35rem;
}

.slide-selector {
    text-align: start;
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    border: 1px solid #cbd5e1;
    border-radius: .5rem;
    background: #f2f6fb;
    color: #13253d;
    padding: .55rem;
    cursor: pointer;
}

.slide-selector.selected {
    border-color: #2369b5;
    background: #d9ebff;
    color: #124277;
}

.builder-preview, .presenter-previews > div, .smartboard-viewport {
    container-type: inline-size;
    min-width: 0;
}

.builder-preview {
    margin-bottom: 1rem;
}

.builder-preview .slide-stage, .presenter-previews .slide-stage {
    border-radius: .9rem;
}

.editor-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    min-width: 0;
    font-weight: 600;
}

.editor-field:has(input[type="checkbox"]) {
    display: flex;
    flex-direction: row-reverse;
    justify-content: start;
    align-items: center;
}

.editor-field input[type="checkbox"] {
    width: auto;
}

.editor-field input[type="color"] {
    min-height: 2.1rem;
}

.slide-fields, .slide-form {
    display: grid;
    gap: .9rem;
}

.style-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.media-picker {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.presenter-previews {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1rem;
}

.presenter-previews h2 {
    margin-block: .6rem;
    font-size: 1rem;
}

.presenter-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: .55rem;
}

.metric-card {
    display: grid;
    gap: .2rem;
    padding: .55rem .7rem;
    border-radius: .7rem;
    border: 1px solid #dce4f0;
    background: #fff;
    color: #13253d;
}

.metric-card span {
    font-size: .8rem;
}

.metric-card strong {
    text-transform: capitalize;
    font-variant-numeric: tabular-nums;
}

.presenter-controls, .presenter-sharing, .presenter-quick, .instant-form {
    margin-top: .8rem;
}

.presenter-sharing .teacher-actions + .teacher-actions {
    margin-top: .55rem;
}

.instant-form .teacher-actions {
    margin-top: .8rem;
}

dialog.instant-form {
    margin: auto;
}

.activity-state {
    font-weight: 700;
    margin-bottom: .65rem;
}

.moderation-list li {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-block: .3rem;
}

.moderation-list summary {
    cursor: pointer;
    padding: .5rem 0;
}

.smartboard-page {
    margin: 0;
    color: #f8fafc;
    background: #071627;
}

.smartboard-page #app {
    display: grid;
    justify-items: center;
    align-content: center;
    min-height: 100dvh;
    max-width: none;
    padding: 0;
    margin: 0;
}

.smartboard-frame {
    width: min(97vw, calc((100dvh - 4.5rem) * 16 / 9));
    margin-inline: auto;
}

.smartboard-viewport {
    position: relative;
}

.smartboard-viewport .slide-stage {
    animation: slide-appear 220ms ease-out;
}

@keyframes slide-appear {
    from {
        opacity: .72;
        transform: translateY(2px);
    }
}

.smartboard-status {
    min-height: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: .8em;
    align-items: center;
    justify-content: center;
    font-size: clamp(.8rem, 2vmin, 1.4rem);
}

.smartboard-status strong {
    font-variant-numeric: tabular-nums;
    letter-spacing: .12em;
    color: #7dd3fc;
}

.smartboard-connection, .smartboard-fullscreen, .smartboard-paused {
    position: absolute;
    padding: .25rem .5rem;
    border-radius: .45rem;
}

.smartboard-fullscreen {
    bottom: .3rem;
    right: .3rem;
}

.smartboard-connection {
    bottom: .5rem;
    left: .6rem;
    background: #10243c;
}

.smartboard-paused {
    top: .5rem;
    right: .6rem;
    background: #78350f;
}

@media (max-width: 700px) {
    .editor-workspace, .presenter-previews {
        grid-template-columns: minmax(0, 1fr);
    }

    .slide-list {
        display: flex;
        overflow-x: auto;
    }

    .slide-selector {
        min-width: 8rem;
    }

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

    .smartboard-frame {
        width: min(100vw, calc((100dvh - 5rem) * 16 / 9));
    }
}

@media (prefers-reduced-motion: reduce) {
    .slide-bar, .smartboard-viewport .slide-stage {
        animation: none;
    }
}

.deck-preview-dialog {
    width: min(calc(100% - 1.5rem), 1000px, 135vh);
    max-height: calc(100vh - 1.5rem);
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    color: var(--ink);
}

.deck-preview-dialog::backdrop {
    background: #112340c4;
}

.deck-preview-dialog .teacher-actions {
    margin-top: .8rem;
    align-items: center;
}

.deck-preview-dialog .teacher-actions span {
    white-space: nowrap;
}
.response-options, .response-entries {
    list-style: none;
    padding: 0;
    margin: 0;
}

.response-options li, .response-entries li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(4rem, 2fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .35rem 0;
    overflow-wrap: anywhere;
}

.response-options meter {
    width: 100%;
    height: 1rem;
}

.response-entries li {
    grid-template-columns: minmax(0, 1fr) auto;
}
.presenter-controls h3 {
    margin: 1rem 0 .55rem;
    font-size: 1rem;
}

dialog input[readonly] {
    width: 100%;
    margin-bottom: .65rem;
}
