:root {
    color-scheme: light;
    --bg: #eef2f5;
    --surface: #ffffff;
    --surface-soft: #f6f8fb;
    --ink: #17212f;
    --muted: #667085;
    --line: #d7dee8;
    --line-strong: #b8c2cf;
    --primary: #2563eb;
    --primary-dark: #1746a2;
    --green: #5f7a3f;
    --green-soft: #e6eddc;
    --danger: #b42318;
    --danger-soft: #f8dfdc;
    --warning: #b7791f;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
    --soft-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
}

body[data-theme="ocean"] {
    --primary: #087ea4;
    --primary-dark: #075b78;
    --green: #0f766e;
    --green-soft: #ddf4ef;
}

body[data-theme="contrast"] {
    --bg: #f4f4f5;
    --surface-soft: #f7f7f8;
    --ink: #09090b;
    --muted: #3f3f46;
    --line: #a1a1aa;
    --primary: #111827;
    --primary-dark: #000000;
    --green: #14532d;
    --green-soft: #dcfce7;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
.button-link {
    min-height: 2.35rem;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.58rem 0.85rem;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

button:hover,
.button-link:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

button.secondary,
.button-link {
    border-color: var(--line);
    background: var(--surface-soft);
    color: var(--ink);
}

button.secondary:hover,
.button-link:hover {
    border-color: var(--line-strong);
    background: #e9eef5;
}

button.danger,
.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

button.danger:hover,
.danger:hover {
    background: #f1c7c1;
}

input,
textarea,
select {
    width: 100%;
    min-height: 2.4rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.6rem 0.72rem;
    background: #fff;
    color: var(--ink);
}

textarea {
    resize: vertical;
}

label {
    display: grid;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.eyebrow {
    margin-bottom: 0.35rem;
    color: var(--green);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.error {
    color: var(--danger);
    font-weight: 800;
}

/* Presentation studio */

.deck-shell {
    height: 100vh;
    overflow: hidden;
    background: #e9eef3;
}

.deck-topbar {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) auto minmax(22rem, 0.9fr) auto auto;
    align-items: center;
    gap: 0.8rem;
    height: 76px;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
}

.deck-brand {
    min-width: 0;
}

.deck-brand .eyebrow {
    margin-bottom: 0.15rem;
}

.deck-brand h1 {
    margin: 0;
    font-size: 1.4rem;
}

.deck-title-input {
    min-height: 2.4rem;
    border: 0;
    border-radius: 6px;
    padding: 0.2rem 0.35rem;
    background: transparent;
    color: var(--ink);
    font-size: clamp(1.25rem, 1.8vw, 1.8rem);
    font-weight: 900;
    line-height: 1.05;
}

.deck-title-input:focus {
    outline: 2px solid rgba(37, 99, 235, 0.22);
    background: #fff;
}

.deck-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: end;
}

.status-pill,
.participant-meter,
.save-state {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.participant-meter strong {
    margin-right: 0.25rem;
    color: var(--ink);
}

.compact-create {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.compact-create input {
    min-width: 0;
}

.top-actions,
.admin-logout {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.admin-logout button {
    background: #fff;
    color: var(--danger);
    border-color: var(--line);
}

.deck-editor {
    display: grid;
    grid-template-columns: 282px minmax(0, 1fr) 318px;
    height: calc(100vh - 76px);
    min-height: 0;
}

.slide-rail,
.slide-inspector {
    min-height: 0;
    overflow: auto;
    border-right: 1px solid var(--line);
    background: #f8fafc;
}

.slide-inspector {
    border-right: 0;
    border-left: 1px solid var(--line);
    padding: 0.75rem;
}

.deck-list {
    padding: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.slide-rail-main {
    padding: 0.75rem;
}

.rail-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.primary-compact {
    min-height: 2rem;
    padding: 0.38rem 0.58rem;
    font-size: 0.76rem;
}

.session-items,
.slide-list,
.template-buttons {
    display: grid;
    gap: 0.55rem;
}

.session-chip {
    display: grid;
    gap: 0.18rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.65rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.session-chip strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-chip span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.session-chip.is-active {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.add-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--soft-shadow);
}

.add-menu button {
    min-height: 2.1rem;
    background: var(--surface-soft);
    color: var(--ink);
    border-color: var(--line);
    font-size: 0.74rem;
}

.slide-thumb {
    position: relative;
    display: grid;
    grid-template-columns: 1.3rem 1fr;
    gap: 0.45rem;
    min-height: 102px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.45rem;
    background: #fff;
    cursor: pointer;
}

.slide-thumb.is-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.slide-thumb.is-live::after {
    content: "en vivo";
    position: absolute;
    top: 0.38rem;
    right: 0.4rem;
    border-radius: 999px;
    padding: 0.12rem 0.35rem;
    background: var(--green-soft);
    color: var(--green);
    font-size: 0.62rem;
    font-weight: 900;
}

.slide-drag {
    grid-column: 1;
    align-self: start;
    min-height: 1.4rem;
    width: 1.3rem;
    padding: 0;
    background: transparent;
    color: var(--muted);
    border: 0;
    cursor: grab;
}

.slide-drag:hover {
    background: transparent;
    transform: none;
}

.thumb-number {
    grid-column: 1;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-align: center;
}

.thumb-preview {
    grid-column: 2;
    min-width: 0;
    aspect-ratio: 16 / 9;
    border: 1px solid #e5ebf2;
    border-radius: 6px;
    padding: 0.45rem;
    background: #fbfcfe;
}

.thumb-type {
    display: block;
    margin-bottom: 0.18rem;
    color: var(--green);
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.thumb-preview strong {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.82rem;
    line-height: 1.12;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.thumb-preview p,
.thumb-lines span {
    display: block;
    overflow: hidden;
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.62rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thumb-actions {
    position: absolute;
    right: 0.4rem;
    bottom: 0.4rem;
    display: flex;
    gap: 0.25rem;
}

.thumb-actions button {
    min-height: 1.45rem;
    width: 1.45rem;
    padding: 0;
    border-color: var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 0.78rem;
}

.canvas-workbench {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) minmax(154px, 24vh);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #edf1f5;
}

.workbench-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    min-height: 54px;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--line);
    background: #f9fafb;
}

.control-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.workbench-toolbar button {
    min-height: 2.15rem;
    padding: 0.45rem 0.68rem;
    background: #fff;
    color: var(--ink);
    border-color: var(--line);
    font-size: 0.78rem;
}

.workbench-toolbar button:first-child {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.canvas-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: auto;
    padding: clamp(0.8rem, 2vw, 1.5rem);
}

.slide-canvas {
    width: min(100%, 1120px);
    max-height: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.slide-canvas-inner {
    position: relative;
    display: grid;
    align-content: center;
    gap: clamp(0.8rem, 1.6vw, 1.4rem);
    width: 100%;
    height: 100%;
    padding: clamp(2rem, 5vw, 4.4rem);
}

.slide-type-row {
    position: absolute;
    top: clamp(1rem, 2vw, 1.4rem);
    left: clamp(1.2rem, 3vw, 2.4rem);
    right: clamp(1.2rem, 3vw, 2.4rem);
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.slide-canvas h2 {
    max-width: 92%;
    margin: 0;
    color: var(--ink);
    font-size: clamp(2.1rem, 5.4vw, 4.8rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.slide-prompt,
.content-body-edit {
    max-width: 82%;
    margin: 0;
    color: #334155;
    font-size: clamp(1rem, 1.7vw, 1.55rem);
    line-height: 1.42;
}

.content-layout-text .content-body-edit,
.content-layout-instructions .content-body-edit {
    max-width: 90%;
    font-size: clamp(1.05rem, 1.9vw, 1.8rem);
}

[contenteditable="true"] {
    border-radius: 6px;
    outline: 2px solid transparent;
}

[contenteditable="true"]:hover {
    outline-color: rgba(37, 99, 235, 0.14);
}

[contenteditable="true"]:focus {
    outline-color: rgba(37, 99, 235, 0.34);
    background: rgba(255, 255, 255, 0.72);
}

.slide-media {
    position: absolute;
    right: 3rem;
    bottom: 3rem;
    width: min(32%, 18rem);
    margin: 0;
}

.slide-media img {
    width: 100%;
    border-radius: 8px;
}

.slide-join-card {
    position: absolute;
    right: clamp(1.2rem, 3vw, 2.4rem);
    bottom: clamp(1.2rem, 3vw, 2.4rem);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "label qr"
        "code qr"
        "url qr";
    gap: 0.25rem 0.75rem;
    align-items: center;
    max-width: 19rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.65rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--soft-shadow);
}

.slide-join-card span {
    grid-area: label;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.slide-join-card strong {
    grid-area: code;
    color: var(--ink);
    font-size: 2rem;
    line-height: 1;
}

.slide-join-card img {
    grid-area: qr;
    width: 5.6rem;
    height: 5.6rem;
}

.slide-join-card code {
    grid-area: url;
    max-width: 11rem;
    overflow-wrap: anywhere;
    color: #334155;
    font-size: 0.62rem;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    max-width: 88%;
}

.option-card,
.add-option-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 0.55rem;
    min-height: 3.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    background: #f8fafc;
    color: var(--ink);
}

.option-card.is-correct {
    border-color: #16a34a;
    background: #ecfdf3;
}

.option-order {
    display: inline-grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 6px;
    background: #e8eef6;
    color: var(--muted);
    font-weight: 900;
}

.option-label {
    min-width: 0;
    font-size: clamp(0.95rem, 1.3vw, 1.25rem);
    font-weight: 800;
}

.option-card button {
    min-height: 1.9rem;
    padding: 0.25rem 0.45rem;
    background: #fff;
    color: var(--ink);
    border-color: var(--line);
    font-size: 0.72rem;
}

.add-option-card {
    grid-template-columns: 1fr;
    justify-items: center;
    background: #fff;
    color: var(--primary);
    border-style: dashed;
}

.scale-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(2.8rem, 1fr));
    gap: 0.5rem;
    max-width: 80%;
}

.scale-preview span {
    display: grid;
    place-items: center;
    min-height: 3.4rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 1.3rem;
    font-weight: 900;
}

.live-placeholder {
    display: grid;
    gap: 0.35rem;
    max-width: 70%;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    padding: 1.3rem;
    background: #f8fafc;
}

.live-placeholder strong {
    font-size: 1.25rem;
}

.live-placeholder span {
    color: var(--muted);
}

.slide-empty,
.empty-studio {
    display: grid;
    place-items: center;
    align-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
}

.live-results-strip {
    min-height: 0;
    overflow: auto;
    border-top: 1px solid var(--line);
    padding: 0.7rem 0.85rem;
    background: #fff;
}

.results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.results-head strong {
    color: var(--ink);
}

.result-chart {
    width: 100% !important;
    height: 132px !important;
}

.result-alt {
    min-height: 0;
}

.word-cloud-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem 0.7rem;
    min-height: 110px;
    padding: 0.4rem;
}

.word-cloud-preview span {
    color: var(--ink);
    font-weight: 900;
}

.word-cloud-preview small {
    color: var(--green);
    font-size: 0.65em;
}

.response-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.5rem;
}

.response-card-grid article {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.65rem;
    background: var(--surface-soft);
}

.leaderboard-panel {
    display: grid;
    gap: 0.35rem;
}

.leaderboard-panel div {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
}

.moderation-panel {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.moderation-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.4rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.45rem;
    background: var(--surface-soft);
}

.moderation-item button {
    min-height: 1.9rem;
    padding: 0.25rem 0.45rem;
    font-size: 0.72rem;
}

.inspector-section {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
    background: #fff;
}

.inspector-section h3 {
    margin: 0;
    font-size: 0.95rem;
}

.inspector-kicker {
    margin: 0;
    color: var(--green);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.check-row input {
    width: auto;
    min-height: auto;
}

.inspector-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.inspector-actions button,
.inspector-chip {
    min-height: 2rem;
    padding: 0.35rem 0.55rem;
    border-color: var(--line);
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.74rem;
}

.template-buttons {
    grid-template-columns: 1fr;
}

.insights-box {
    max-height: 11rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.6rem;
    background: #0f172a;
    color: #e2e8f0;
}

/* Clean presentation route */

.present-only {
    background: #111827;
    height: 100vh;
    overflow: hidden;
}

.present-only .deck-topbar,
.present-only .slide-rail,
.present-only .slide-inspector,
.present-only .live-results-strip {
    display: none;
}

.present-only .deck-editor {
    grid-template-columns: 1fr;
    height: 100vh;
}

.present-only .canvas-workbench {
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    overflow: hidden;
    background: #111827;
}

.present-only .workbench-toolbar {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    width: min(92vw, 760px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.86);
    box-shadow: var(--shadow);
}

.present-only .workbench-toolbar button {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.18);
}

.present-only .save-state {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.18);
}

.present-only .canvas-stage {
    height: 100vh;
    overflow: hidden;
    padding: 2.2vw;
}

.present-only .slide-canvas {
    width: min(96vw, calc(96vh * 16 / 9));
    max-height: 96vh;
}

/* Join, login and audience */

.join-shell,
.audience-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1rem;
    background: #edf2f7;
}

.join-card-main,
.join-box,
.audience-card {
    width: min(100%, 640px);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: clamp(1.2rem, 4vw, 2.2rem);
    background: #fff;
    box-shadow: var(--shadow);
}

.join-card-main h1,
.join-box h1,
.audience-card h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.1rem, 7vw, 4rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.join-form,
.join-box form {
    display: grid;
    gap: 0.75rem;
}

.join-form {
    grid-template-columns: 1fr auto;
}

.join-form input {
    min-height: 3.5rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.audience-card {
    display: grid;
    gap: 1rem;
}

.audience-card header,
.audience-card footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.audience-card h1 {
    margin: 0;
    font-size: clamp(1.6rem, 6vw, 3rem);
}

.answer-area {
    display: grid;
    gap: 0.9rem;
    min-height: 16rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    background: var(--surface-soft);
}

.answer-options,
.scale-options {
    display: grid;
    gap: 0.6rem;
}

.answer-options {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.answer-options button,
.scale-options button {
    min-height: 3.2rem;
    background: #fff;
    color: var(--ink);
    border-color: var(--line);
}

.scale-options {
    grid-template-columns: repeat(auto-fit, minmax(3.5rem, 1fr));
}

.answer-area form {
    display: grid;
    gap: 0.7rem;
}

.ranking-list {
    display: grid;
    gap: 0.55rem;
}

.ranking-option {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.4rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem;
    background: #fff;
}

.ranking-option button {
    min-height: 2rem;
    padding: 0.3rem 0.5rem;
    background: var(--surface-soft);
    color: var(--ink);
    border-color: var(--line);
    font-size: 0.78rem;
}

.audience-content-slide {
    display: grid;
    gap: 1rem;
    justify-items: start;
}

.content-body {
    margin: 0;
    color: #334155;
    font-size: 1.1rem;
    line-height: 1.45;
}

.audience-qr {
    width: min(12rem, 60vw);
    border: 0.6rem solid #fff;
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
}

@media (max-width: 1180px) {
    .deck-topbar {
        grid-template-columns: 1fr auto;
        height: auto;
    }

    .deck-meta,
    .compact-create,
    .top-actions,
    .admin-logout {
        grid-column: span 2;
        justify-content: start;
    }

    .deck-editor {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .slide-inspector {
        position: fixed;
        z-index: 5;
        top: 86px;
        right: 0.75rem;
        bottom: 0.75rem;
        width: min(320px, 92vw);
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: var(--shadow);
    }
}

@media (max-width: 860px) {
    .deck-shell {
        height: auto;
        overflow: auto;
    }

    .deck-editor {
        grid-template-columns: 1fr;
        height: auto;
    }

    .slide-rail,
    .slide-inspector {
        position: static;
        width: auto;
        max-height: none;
        border: 0;
        border-bottom: 1px solid var(--line);
        box-shadow: none;
    }

    .canvas-workbench {
        grid-template-rows: auto auto auto;
        min-height: auto;
    }

    .canvas-stage {
        overflow: visible;
    }

    .slide-canvas {
        width: 100%;
        max-height: none;
    }

    .slide-canvas-inner {
        padding: 1.8rem;
    }

    .slide-canvas h2 {
        font-size: clamp(1.7rem, 8vw, 2.8rem);
    }

    .slide-prompt,
    .content-body-edit,
    .option-grid,
    .scale-preview,
    .live-placeholder {
        max-width: 100%;
    }

    .option-grid {
        grid-template-columns: 1fr;
    }

    .slide-join-card {
        position: static;
        margin-top: 1rem;
        max-width: 100%;
    }

    .join-form {
        grid-template-columns: 1fr;
    }
}
