/* Shared student player styles. Keep behavior and presentation aligned across ReactivoSemilla, Examen and Practicas. */

/* Base propia: no tomar la tipografia, alineacion ni paleta del contenedor anfitrion.
   El contenido conserva sus clases e indicaciones de formato del autor. */
.exam-reactivo-player {
    --surface: #ffffff;
    --ink: #17202a;
    --ink-soft: #526171;
    --muted: #6f7a86;
    --line: #d9e0e7;
    --line-strong: #c4ced8;
    --brand: #176b67;
    --brand-strong: #0d504d;
    --danger: #b42318;
    --success: #16794c;
    font: 400 1rem/1.55 Inter, "Segoe UI", Arial, sans-serif;
    color: #17202a;
    text-align: left;
    text-transform: none;
    text-indent: 0;
    letter-spacing: normal;
    word-spacing: normal;
    white-space: normal;
    color-scheme: only light;
}

.exam-reactivo-player :where(button, input, select, textarea) {
    font-family: inherit;
    letter-spacing: normal;
    word-spacing: normal;
    text-transform: none;
    text-indent: 0;
}

.exam-reactivo-player .simulator-option {
    color: var(--ink);
    font: inherit;
    text-align: left;
    white-space: normal;
}

.rs-small { font-size: .85em; }
.rs-muted { color: var(--muted, #607080); }
.rs-title { margin: 12px 0 8px; font-size: 1.05rem; font-weight: 800; line-height: 1.4; }
.html-preview .text-left, .simulator-html .text-left, .simulator-option-html .text-left { text-align: left; }
.html-preview .text-center, .simulator-html .text-center, .simulator-option-html .text-center { text-align: center; }
.html-preview .text-right, .simulator-html .text-right, .simulator-option-html .text-right { text-align: right; }
.html-preview .text-justify, .simulator-html .text-justify, .simulator-option-html .text-justify { text-align: justify; }
.rs-table { width: min(100%, 860px); border-collapse: collapse; margin: 12px auto; }
.rs-table th, .rs-table td { border: 1px solid #26323f; padding: 6px 8px; vertical-align: top; }
.rs-table th { background: #d8edf8; font-weight: 800; }

.visual-bars-axis-layout.no-axis { grid-template-columns: minmax(0, 1fr); }
.visual-bars-axis-layout { --bar-plot-height: 180px; --bar-heading-height: 24px; --bar-row-gap: 8px; --bar-plot-padding: 14px; }
.visual-bars-y-axis { display: block; min-width: 5ch; min-height: 0; padding: 0; }
.visual-bars-y-scale { position: relative; height: var(--bar-plot-height); margin-top: calc(1px + var(--bar-plot-padding) + var(--bar-heading-height) + var(--bar-row-gap)); }
.visual-bars-y-scale > span { position: absolute; right: 0; transform: translateY(-50%); line-height: 1; white-space: nowrap; }
.visual-bars-plot { position: relative; grid-auto-columns: minmax(max(78px, calc(var(--visual-series-count, 1) * 34px)), 1fr); align-items: start; padding-top: var(--bar-plot-padding); background: #fbfcfd; }
.visual-bars-plot::before { content: ""; position: absolute; inset-inline: 0; top: calc(var(--bar-plot-padding) + var(--bar-heading-height) + var(--bar-row-gap)); height: var(--bar-plot-height); border-bottom: 1px solid #e1e9ef; background: linear-gradient(#e1e9ef 1px, transparent 1px); background-size: 100% 25%; pointer-events: none; }
.visual-bars-plot > article { position: relative; }
.visual-bar-column { grid-template-rows: 24px 180px minmax(2.2rem, auto); }
.visual-bar-stack-wrap, .visual-bar-group-vertical { height: 180px; min-height: 0; }
.visual-bar-group-vertical { gap: 9px; }
.visual-bar-series-column { position: relative; display: flex; align-items: end; justify-content: center; flex: 1 1 0; min-width: 20px; max-width: 42px; height: 100%; }
.visual-bar-series-column > i { width: 100%; min-height: 0; }
.visual-bar-column .visual-bar-series-value { position: absolute; left: 50%; transform: translateX(-50%); margin-bottom: 4px; font-size: .72rem; line-height: 1; white-space: nowrap; }
.visual-bar-track.visual-series-track { position: relative; overflow: visible; margin-right: 8px; }
.visual-series-horizontal-value { position: absolute; top: 50%; transform: translateY(-50%); padding-left: 5px; font-size: .75rem; white-space: nowrap; }
.visual-bar-series-value, .visual-series-horizontal-value { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
    .visual-bars-y-axis { display: none; }
}

.selection-simulator {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.selection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 750;
}

.selection-counter {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink-soft);
    background: #fff;
    font-size: .78rem;
}

.selection-counter.complete {
    color: #12613d;
    border-color: #a7e4c0;
    background: #ecfdf3;
}

.selection-actions {
    display: flex;
    justify-content: flex-end;
}

.ordering-simulator {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.ordering-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 750;
}

.ordering-card {
    display: grid;
    grid-template-columns: minmax(58px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    cursor: grab;
}

.ordering-card:active {
    cursor: grabbing;
}

.ordering-position {
    display: grid;
    width: auto;
    height: auto;
    min-width: 58px;
    min-height: 32px;
    padding: 0 9px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--brand);
    font-size: .78rem;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.ordering-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


.drag-classifier {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.drag-classifier-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.drag-classifier-toolbar > div:first-child {
    display: grid;
    gap: 3px;
}

.drag-classifier-toolbar > div:first-child span {
    color: var(--muted);
    font-size: .84rem;
}

.drag-classifier-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.drag-progress {
    padding: 5px 9px;
    border: 1px solid #c9d7e2;
    border-radius: 999px;
    background: #f5f8fb;
    color: #516777;
    font-size: .76rem;
    font-weight: 850;
}

.drag-progress.complete {
    border-color: #9bc8a7;
    background: #edf8ef;
    color: #277642;
}

.drag-source,
.drag-zone {
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.drag-source {
    min-height: 132px;
    padding: 14px;
    border: 1px dashed #90aac0;
    border-radius: 8px;
    background: #f6f9fc;
}

.drag-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.drag-section-header > div {
    display: grid;
    gap: 2px;
}

.drag-section-header h3 {
    margin: 0;
    font-size: .95rem;
}

.drag-section-header span:not(.drag-step) {
    color: var(--muted);
    font-size: .78rem;
}

.drag-step {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    place-items: center;
    border-radius: 50%;
    background: #1b506e;
    color: #fff;
    font-size: .78rem;
    font-weight: 900;
}

.drag-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 9px;
}

.drag-bank-empty {
    display: grid;
    gap: 3px;
    min-height: 66px;
    place-content: center;
    text-align: center;
    color: #277642;
}

.drag-bank-empty span {
    color: var(--muted);
    font-size: .78rem;
}

.drag-destinations {
    display: grid;
    gap: 10px;
}

.drag-destinations-header {
    margin-bottom: 0;
}

.drag-classifier .drag-zones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: stretch;
    gap: 12px;
}

.drag-classifier .drag-zone {
    display: grid;
    grid-template-rows: auto minmax(116px, 1fr);
    min-width: 0;
    min-height: 176px;
    padding: 0;
    overflow: hidden;
    border: 2px dashed #79aea9;
    border-radius: 8px;
    background: #f3faf9;
}

.drag-classifier .drag-zone > header {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 12px 13px;
    border-bottom: 1px solid #c8dfdc;
    background: #e8f4f2;
}

.drag-zone-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.drag-zone-meta > span {
    padding: 3px 7px;
    border-radius: 999px;
    background: #fff;
    color: #356c67;
    font-size: .7rem;
    font-weight: 800;
}

.drag-zone-body {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 116px;
    padding: 10px;
}

.drag-drop-placeholder {
    display: grid;
    align-self: stretch;
    min-height: 94px;
    place-content: center;
    justify-items: center;
    gap: 3px;
    color: #356c67;
    text-align: center;
}

.drag-drop-placeholder > span:last-child {
    color: var(--muted);
    font-size: .75rem;
}

.drag-drop-symbol {
    display: grid;
    width: 30px;
    height: 30px;
    margin-bottom: 2px;
    place-items: center;
    border: 1px solid #79aea9;
    border-radius: 50%;
    background: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.drag-source.drop-active,
.drag-classifier .drag-zone.drop-active {
    border-color: #277642;
    background: #edf8ef;
    box-shadow: 0 0 0 3px rgba(39, 118, 66, .14);
}

.drag-classifier .drag-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 9px;
    margin: 0;
    padding: 10px;
    border: 1px solid #cbd8e2;
    border-left: 4px solid #d19a2a;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(35, 54, 69, .1);
    cursor: grab;
}

.drag-classifier .drag-item:active {
    cursor: grabbing;
}

.drag-item-content {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.drag-handle {
    display: grid;
    grid-template-columns: repeat(2, 4px);
    grid-auto-rows: 4px;
    gap: 3px;
    width: 11px;
}

.drag-handle i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #7d93a3;
}

.drag-move-field {
    display: grid;
    gap: 4px;
}

.drag-move-field > span {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
}

.drag-move-field select {
    width: 100%;
    border-color: #d4e0e8;
    background-color: #f8fafc;
    color: var(--ink);
}

@media (max-width: 720px) {
    .drag-editor-summary {
        grid-template-columns: 1fr;
    }

    .drag-editor-summary > div {
        grid-template-columns: auto 1fr;
        align-items: center;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .drag-editor-summary > div:last-child {
        border-bottom: 0;
    }

    .drag-blueprint-empty,
    .drag-classifier-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .drag-classifier-status {
        width: 100%;
        justify-content: space-between;
    }

    .drag-item-grid,
    .drag-classifier .drag-zones,
    .drag-blueprint-grid,
    .drag-zone-picker > div {
        grid-template-columns: 1fr;
    }
}


.relation-matcher {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.relation-matcher-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.relation-matcher-toolbar > div:first-child {
    display: grid;
    gap: 3px;
}

.relation-matcher-toolbar > div:first-child span {
    color: var(--muted);
    font-size: .84rem;
}

.relation-matcher-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.relation-progress {
    min-width: 118px;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--muted);
    background: #edf2f5;
    font-size: .78rem;
    font-weight: 850;
    text-align: center;
}

.relation-progress.complete {
    color: #075f58;
    background: #dff3ef;
}

.relation-matcher-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr);
    align-items: start;
    gap: 16px;
}

.relation-origin-list,
.relation-destination-bank {
    display: grid;
    gap: 10px;
}

.relation-match-card {
    --pair-color: #18766f;
    --pair-soft: #edf8f6;
    overflow: hidden;
    border: 1px solid var(--line);
    border-left: 4px solid transparent;
    border-radius: 8px;
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.relation-match-card.active,
.relation-match-card.paired {
    border-left-color: var(--pair-color);
}

.relation-match-card.active {
    border-color: var(--pair-color);
    background: var(--pair-soft);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pair-color) 16%, transparent);
}

.relation-origin-button {
    display: grid;
    width: 100%;
    min-height: 62px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 0;
    color: var(--ink);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.relation-origin-number,
.relation-number {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--pair-color, var(--brand));
    font-size: .82rem;
    font-weight: 900;
}

.relation-origin-state,
.relation-destination-state {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.relation-select-label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-top: 1px solid #e4ebef;
    background: #f8fbfc;
}

.relation-select-label > span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.relation-select-full {
    width: 100%;
    min-width: 0;
}

.relation-destination-bank {
    padding: 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: #f8fbfc;
}

.relation-destination-bank header {
    display: grid;
    gap: 3px;
}

.relation-destination-bank header strong {
    font-size: .84rem;
    text-transform: uppercase;
}

.relation-destination-bank header span {
    color: var(--muted);
    font-size: .78rem;
}

.relation-destination-option {
    --pair-color: var(--brand);
    --pair-soft: #edf8f6;
    display: grid;
    width: 100%;
    min-height: 58px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.relation-destination-option:not(:disabled):hover,
.relation-destination-option:not(:disabled):focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(16, 117, 109, .12);
}

.relation-destination-option:disabled {
    cursor: default;
    opacity: .72;
}

.relation-destination-option.assigned {
    border-color: var(--pair-color);
    background: var(--pair-soft);
}

.relation-destination-option .relation-number {
    background: var(--pair-color);
}

.relation-destination-option.active-pair {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pair-color) 18%, transparent);
}

.pair-tone-1 {
    --pair-color: #14766f;
    --pair-soft: #eaf7f4;
}

.pair-tone-2 {
    --pair-color: #9b6b13;
    --pair-soft: #fff6df;
}

.pair-tone-3 {
    --pair-color: #326da8;
    --pair-soft: #edf5fc;
}

.pair-tone-4 {
    --pair-color: #3f7d32;
    --pair-soft: #eef8eb;
}

.pair-tone-5 {
    --pair-color: #6a5aa1;
    --pair-soft: #f2effa;
}


@media (max-width: 900px) {
    .relation-simulator-grid {
        grid-template-columns: 1fr;
    }

    .relation-matcher-grid {
        grid-template-columns: 1fr;
    }

    .relation-destination-bank {
        order: 2;
    }
}

@media (max-width: 640px) {
    .relation-matcher-toolbar,
    .relation-matcher-status {
        align-items: stretch;
        flex-direction: column;
    }

    .relation-matcher-status {
        justify-content: stretch;
    }

    .relation-progress,
    .relation-matcher-status .primary-button {
        width: 100%;
    }

    .relation-origin-button {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .relation-origin-state {
        grid-column: 2;
        white-space: normal;
    }

    .relation-select-label {
        grid-template-columns: 1fr;
    }

    .relation-destination-bank {
        display: none;
    }
}


.math-formula-editor {
    min-width: 0;
}

.math-formula-editor-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: start;
    padding: .85rem;
    border: 1px solid #d7e2ec;
    border-radius: 8px;
    background: #202229;
}

.math-formula-editor-board > button {
    min-width: 46px;
    color: #ffffff;
    border-color: rgba(255, 255, 255, .28);
    background: #353941;
}

.math-formula-editor.compact .mathfield-host {
    min-height: 100px;
}

.math-formula-editor.compact math-field.mathfield-lab-input {
    min-height: 96px;
    font-size: 2rem;
}

.student-math-keypad {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.student-math-keypad.calculator-layout {
    grid-template-columns: repeat(4, minmax(62px, 1fr));
}

.fraction-key-icon {
    display: inline-grid;
    grid-template-rows: auto 2px auto;
    min-width: 1.7rem;
    align-items: center;
    justify-items: center;
    font-size: .78rem;
    line-height: 1;
}

.fraction-key-icon::before {
    content: "";
    grid-row: 2;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.fraction-key-icon > span:first-child {
    grid-row: 1;
}

.fraction-key-icon > span:last-child {
    grid-row: 3;
}

.mathfield-key.command {
    background: #fff3f1;
    border-color: #f0c5bf;
    color: #9b2c20;
}

.mathfield-host {
    min-height: 132px;
}

math-field.mathfield-lab-input {
    display: block;
    width: 100%;
    min-height: 116px;
    padding: 1.15rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    background: #272a31;
    color: #ffffff;
    font-size: 1.85rem;
    --caret-color: #c8b6ff;
    --selection-background-color: rgba(200, 182, 255, .28);
    --contains-highlight-background-color: rgba(200, 182, 255, .18);
}

math-field.mathfield-lab-input::part(menu-toggle),
math-field.mathfield-lab-input::part(virtual-keyboard-toggle) {
    color: #ffffff;
}

.mathfield-preview-panel {
    display: grid;
    gap: .8rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #b7d7d3;
    border-left: 4px solid #007a72;
    border-radius: 8px;
    background: #f6fffd;
}

.mathfield-preview-panel h3 {
    margin: 0;
    font-size: 1rem;
}

.mathfield-preview-content {
    min-height: 86px;
    display: grid;
    place-items: center;
    padding: 1rem;
    border: 1px dashed #a9cbe6;
    border-radius: 8px;
    background: #ffffff;
    overflow-x: auto;
    font-size: 1.2rem;
}

.mathfield-tabs {
    display: flex;
    gap: 1.25rem;
    margin-top: 1rem;
    border-bottom: 1px solid #d7e2ec;
    overflow-x: auto;
}

.mathfield-tabs button {
    appearance: none;
    padding: .75rem 0 .65rem;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #6d7a88;
    font-weight: 900;
}

.mathfield-tabs button.active {
    border-color: #007a72;
    color: #102033;
}

.mathfield-keypad {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
    gap: .45rem;
    margin-top: .85rem;
}

.mathfield-key {
    min-height: 54px;
    padding: .6rem .75rem;
    border: 1px solid #d1dfeb;
    border-radius: 18px;
    background: #ffffff;
    color: #102033;
    font-size: 1.18rem;
    font-weight: 900;
    box-shadow: 0 1px 0 rgba(16, 32, 51, .04);
}

.mathfield-key:hover {
    border-color: #8ebbb7;
    background: #f4fbfa;
}

.mathfield-key.container,
.mathfield-key.function {
    background: #eef7f6;
    border-color: #a9d7d3;
    color: #006b63;
}

.mathfield-key.operator {
    background: #f2f0f8;
    border-color: #d7cdec;
}

.mathfield-key.number {
    background: #f7f9fb;
}

.mathfield-examples {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #d7e2ec;
}

.mathfield-example-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

.mathfield-example-list button {
    display: grid;
    gap: .45rem;
    min-height: 84px;
    padding: .85rem;
    border: 1px solid #d7e2ec;
    border-radius: 999px;
    background: #ffffff;
    color: #102033;
    text-align: center;
}

.mathfield-example-list button:hover {
    border-color: #8ebbb7;
    background: #f7fcfb;
}

.mathfield-example-math {
    overflow-x: auto;
}

@media (max-width: 980px) {
    .mathfield-lab-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .mathfield-board,
    .mathfield-preview-panel {
        padding: .75rem;
    }

    math-field.mathfield-lab-input {
        min-height: 92px;
        font-size: 1.35rem;
    }

    .mathfield-keypad {
        grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    }

    .mathfield-key {
        min-height: 46px;
        border-radius: 14px;
        font-size: 1rem;
    }

    .mathfield-example-list {
        grid-template-columns: 1fr;
    }

    .mathfield-example-list button {
        border-radius: 18px;
    }
}

.structured-response-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
    min-height: 5.5rem;
    padding: 1rem;
    border: 1px dashed #abc3d3;
    border-radius: 8px;
    background: #fff;
}

.structured-response-fixed {
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.1;
}

.structured-response-slot {
    display: grid;
    gap: .2rem;
    min-width: 6.5rem;
    min-height: 4rem;
    border: 1px dashed #a9bfd0;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: .55rem .7rem;
    text-align: center;
}

button.structured-response-slot {
    cursor: pointer;
}

.structured-response-slot.active,
.structured-response-slot:focus-within {
    border-color: var(--brand);
    background: #effbf9;
    box-shadow: 0 0 0 3px rgba(23, 107, 103, .12);
}

.structured-response-slot span {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
}

.structured-response-slot strong {
    min-height: 1.4rem;
    font-size: 1.1rem;
    font-weight: 950;
}

.structured-response-slot.empty strong {
    color: #94a3b8;
}

.structured-response-slot-input {
    width: 100%;
    min-width: 0;
    min-height: 2rem;
    padding: .2rem .35rem;
    border: 0;
    border-bottom: 2px solid #9fb9c8;
    border-radius: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 1.12rem;
    font-weight: 950;
    line-height: 1.2;
    text-align: center;
}

.structured-response-slot-input::placeholder {
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 700;
}

.structured-response-slot-input:focus {
    border-bottom-color: var(--brand);
}

.structured-piece-helper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.structured-piece-helper > div {
    display: grid;
    gap: .15rem;
}

.structured-piece-helper span {
    color: var(--muted);
    font-size: .82rem;
}

.structured-response-slot small {
    color: var(--danger);
    font-size: .68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.structured-response-fraction {
    display: inline-grid;
    gap: .28rem;
    min-width: 7rem;
    align-items: center;
    justify-items: stretch;
}

.structured-response-fraction-bar {
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
}

.structured-response-sqrt {
    display: inline-grid;
    grid-template-columns: auto minmax(6.5rem, 1fr);
    gap: .45rem;
    align-items: center;
    color: var(--ink);
    font-size: 2rem;
    font-weight: 950;
}

.structured-response-sqrt .structured-response-slot {
    border-top: 2px solid var(--ink);
}

.structured-response-operator {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.structured-response-operator-symbol {
    color: var(--brand-strong);
    font-size: 2rem;
    font-weight: 950;
}

.structured-response-operator-slots {
    display: grid;
    gap: .3rem;
}

.structured-response-matrix {
    display: grid;
    gap: .45rem;
    padding: .75rem 1rem;
    border-left: 3px solid var(--ink);
    border-right: 3px solid var(--ink);
    border-radius: 8px;
}

.structured-response-expected-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

@media (max-width: 980px) {
    .structured-response-grid,
    .structured-response-expected-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .selection-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .ordering-card {
        grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
    }

    .ordering-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .math-formula-editor-board {
        grid-template-columns: 1fr;
    }

    .math-formula-editor-board > button {
        width: 100%;
    }

    .student-math-keypad {
        grid-template-columns: repeat(4, minmax(54px, 1fr));
    }
}

.panel-visual-player .visual-data-table th {
    text-transform: none;
}

.panel-visual-player,
.panel-visual-player .visual-data-table-card {
    min-width: 0;
    max-width: 100%;
}

.panel-visual-player .visual-data-table-card {
    overflow: hidden;
}

.visual-data-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.visual-data-table-scroll:focus-visible {
    outline: 2px solid var(--brand-strong, #176b67);
    outline-offset: -2px;
}

.panel-visual-player .visual-data-table {
    width: 100%;
    table-layout: auto;
}

.panel-visual-player .visual-data-table th,
.panel-visual-player .visual-data-table td {
    min-width: 8rem;
    word-break: normal;
    overflow-wrap: anywhere;
    white-space: normal;
    vertical-align: middle;
}

.panel-visual-player .visual-data-table img {
    max-width: 100%;
    height: auto;
}

.panel-visual-player .visual-data-table p:first-child { margin-top: 0; }
.panel-visual-player .visual-data-table p:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
    .exam-reactivo-player.simulator-preview {
        min-width: 0;
        min-height: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        font-size: .875rem;
        line-height: 1.5;
    }

    .exam-reactivo-player .simulator-html,
    .exam-reactivo-player .simulator-option-html {
        font-size: .875rem;
        line-height: 1.5;
    }

    .exam-question-content-scroll > .exam-question-card {
        min-width: 0;
        padding: .75rem .5rem;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .panel-visual-player .visual-data-table-card {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .panel-visual-player .visual-data-table-title {
        padding: .625rem 0;
        background: transparent;
        text-align: left;
        font-size: .9375rem;
        line-height: 1.4;
    }

    .panel-visual-player .visual-data-table th,
    .panel-visual-player .visual-data-table td {
        padding: .625rem .75rem;
        font-size: .875rem;
        line-height: 1.5;
    }

    .panel-visual-player .visual-data-table th {
        font-size: .8125rem;
    }
}
