:root {
    --primary: #3b6fe0;
    --primary-hover: #2f5bc4;
    --bg-page: #f4f6fb;
    --bg-card: #ffffff;
    --bg-darker: #eef1f8;
    --text-main: #1e2433;
    --text-muted: #6b7488;
    --danger: #e5534b;
    --success: #1fa97a;
    --warning: #f0a202;
    --border: #dfe3ee;
    --radius: 14px;

    /* Colori tenui per la scheda dei risultati dello studente (coerenti con
       quelli usati lato docente) */
    --result-success: #49af5b;
    --result-danger: #eb5f5e;
    --result-warning: #ffd374;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', Arial, Helvetica, "Liberation Sans", sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
}

.ti {
    vertical-align: -0.125em;
    line-height: 1;
    margin-right: 0.35em;
}
.calculator-close .ti {
    margin-right: 0;
}
.formulario-pager button .ti {
    margin-right: 0;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.1rem;
    background: var(--primary);
    color: white;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover { background: var(--primary-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary { background: var(--bg-darker); color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover { background: #dde2f0; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c9433c; }

input, textarea, select,
.rich-editor{
    font-family: inherit;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: var(--text-md);
}

input:focus, textarea:focus, select:focus,
.rich-editor:focus{
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 111, 224, 0.15);
}

.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.field label { font-size: var(--text-sm); color: var(--text-muted); }
.hint-text { color: var(--text-muted); font-size: var(--text-sm); }

/* --- JOIN PAGE --- */
.join-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.join-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 2.5rem; width: 100%; max-width: 380px; box-shadow: 0 20px 40px rgba(30,36,51,0.1); }
.join-logo { text-align: center; margin-bottom: 0.5rem; }
.join-logo img { height: 44px; }
.join-subtitle { text-align: center; color: var(--text-muted); font-size: var(--text-md); margin-bottom: 1.5rem; }
.join-error { background: rgba(229,83,75,0.1); border: 1px solid var(--danger); color: #b3312a; padding: 0.6rem 0.9rem; border-radius: 8px; font-size: var(--text-sm); margin-bottom: 1rem; }
#join-submit { width: 100%; margin-top: 0.5rem; }

/* --- EXAM TOPBAR --- */
.exam-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    gap: 1rem;
}

.exam-logo { height: 30px; }

/* Il timer è ancorato al centro esatto della topbar (indipendente dal numero di pulsanti a
   destra/sinistra), così non si sposta più in modo asimmetrico man mano che si attivano tool. */
.exam-topbar-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.exam-timer {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 0.3rem 1rem;
    border-radius: 10px;
    background: var(--bg-darker);
    min-width: 100px;
    text-align: center;
}

.exam-timer.low-time { background: rgba(229, 83, 75, 0.15); color: var(--danger); }

.exam-topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.violation-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(240, 162, 2, 0.15);
    color: #a06800;
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
}
.violation-indicator .ti {
    margin-right: 0;
}

.btn-tool { background: var(--bg-darker); color: var(--text-main); border: 1px solid var(--border); }
.btn-tool:hover { background: #dde2f0; }
.btn-submit { background: var(--success); }
.btn-submit:hover { background: #178a63; }

/* --- PHASES --- */
.exam-phase { display: none; padding: 2rem; }
.exam-phase.active { display: block; }

.center-card {
    max-width: 560px;
    margin: 4rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(30,36,51,0.06);
}

.intro-card h1 { margin-top: 0; }
.intro-text { white-space: pre-wrap; color: var(--text-main); line-height: 1.6; text-align: left; background: var(--bg-darker); padding: 1rem; border-radius: 10px; }
.intro-countdown { font-size: 3rem; font-weight: 700; color: var(--primary); margin: 1rem 0; }
.btn-start { margin-top: 1rem; padding: 0.8rem 2rem; font-size: var(--text-reading); }

/* --- QUESTION LAYOUT --- */
.exam-layout {
    display: grid;
    /* `minmax(0, 1fr)` e non `1fr`: la misura minima di una colonna in griglia è `auto`,
       cioè la larghezza minima del contenuto — e una parola lunghissima senza spazi
       (capita: un termine tecnico, un URL, o uno studente che incolla) è indivisibile,
       quindi allarga la colonna e con essa tutta la pagina, che comincia a scorrere in
       orizzontale. Con il minimo a zero la colonna resta nei suoi limiti e il testo va
       a capo. */
    grid-template-columns: 220px minmax(0, 1fr) 220px;
    gap: 1.5rem;
    max-width: 1320px;
    margin: 0 auto;
}

.question-nav {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
    align-content: flex-start;
    height: fit-content;
}

.nav-q-btn {
    background: var(--bg-darker);
    border: 1px solid var(--border);
    color: var(--text-main);
    height: 38px;
    width: 100%;
    padding: 0;
    font-size: var(--text-sm);
    border-radius: 8px;
}

.nav-q-btn.answered { background: rgba(31, 169, 122, 0.15); border-color: var(--success); color: #0f6b4d; }
.nav-q-btn.current { background: var(--primary); border-color: var(--primary); color: white; }

.question-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.question-panel-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.question-panel { min-width: 0; }   /* stesso motivo: un figlio di griglia non si sfonda */

/* Consegna e risposte vanno a capo ANCHE dentro una parola quando non c'è alternativa.
   `anywhere` e non `break-word`: il secondo non conta nel calcolo della larghezza minima
   del contenuto, quindi la colonna si allargherebbe lo stesso prima di spezzare. */
.question-content, .question-text, .answer-option, .answers-list {
    overflow-wrap: anywhere;
    min-width: 0;
}

.question-content { flex: 1; font-size: var(--text-reading); }
.question-text { margin-bottom: 1.5rem; line-height: 1.5; }

.question-hint { margin-bottom: 1.25rem; }
.hint-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--text-sm);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
}
.hint-toggle-btn:hover { background: var(--bg-darker); color: var(--text-main); }
.hint-text-box {
    margin-top: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--result-warning-subtle-bg, rgba(255, 211, 116, 0.15));
    border: 1px solid var(--result-warning, #ffd374);
    border-radius: 10px;
    font-size: var(--text-md);
    color: var(--text-main);
    line-height: 1.5;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.answer-option:hover { border-color: var(--primary); }
.answer-option.selected { border-color: var(--primary); background: rgba(59, 111, 224, 0.06); }

.answer-option .option-letter {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-darker);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--text-sm); flex-shrink: 0;
}

.answer-option.selected .option-letter { background: var(--primary); color: white; }

.open-answer-textarea { width: 100%; min-height: 160px; resize: vertical; }

/* --- Modalità risposta aperta: normale / programmazione / calcolo --- */
.answer-mode-switch {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.mode-switch-btn {
    background: var(--bg-darker);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    height: auto;
    border-radius: 8px;
}

.mode-switch-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.open-answer-textarea.code-mode {
    font-family: "Courier New", "Consolas", monospace;
    background: #1e1e2e;
    color: #cdd6f4;
    border-color: #313244;
    caret-color: #f5e0dc;
    tab-size: 4;
}

.math-toolbar-wrap {
    margin-bottom: 0.6rem;
    background: var(--bg-darker);
    border-radius: 8px;
    padding: 0.5rem;
}

.math-toolbar-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.math-tab-btn {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    height: auto;
    border-radius: 6px;
}

.math-tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.math-symbols-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.math-symbols-toolbar button {
    width: 34px;
    height: 34px;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: var(--text-md);
    border-radius: 6px;
}

.math-symbols-toolbar button:hover { background: var(--primary); color: white; }

.question-panel-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* --- RESULTS --- */
/* La card dei risultati è più larga per fare posto all'elenco domande (che vuole il
   testo a sinistra), ma la TESTATA — icona, titolo, sottotitolo — resta centrata come
   nella schermata «in attesa»: le due condividono `.results-header-icon/-sub`, quindi un
   ritocco a una si vede automaticamente anche nell'altra. */
.results-card { max-width: 720px; text-align: left; }
.results-card .results-header { text-align: center; }
.results-card #results-summary { text-align: center; }

.results-header-icon { font-size: 3rem; margin-bottom: 1rem; }
.results-header-sub { color: var(--text-muted); margin-top: 0.5rem; line-height: 1.6; }
#results-summary { margin-top: 0.75rem; font-size: var(--text-md); }
#results-summary { text-align: center; font-size: var(--text-lg); margin-bottom: 1.5rem; }
.result-question { border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin-bottom: 0.75rem; }
.result-question.correct { border-left: 4px solid var(--result-success); }
.result-question.wrong { border-left: 4px solid var(--result-danger); }
.result-question.pending { border-left: 4px solid var(--text-muted); }

/* --- BLOCKING OVERLAYS (pausa / disconnesso / terminata) --- */
.blocking-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 36, 51, 0.85);
    z-index: 900;
    align-items: center;
    justify-content: center;
}

.blocking-overlay.active { display: flex; }
.blocking-overlay .center-card { margin: 0; }
.blocking-overlay--danger { background: rgba(89, 20, 20, 0.88); }
.blocking-overlay--danger h1 { color: var(--result-danger); }

/* --- MODALS --- */
.exam-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 36, 51, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.exam-modal.active { display: flex; }

.exam-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.exam-modal-content--warning h2 {
    color: #a06800;
}

.exam-modal-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; }

/* --- IMMAGINE DELLA DOMANDA: ANTEPRIMA E VISORE ---------------------------------------
   A piena risoluzione l'immagine spingeva giù consegna e risposte, e su un tablet in
   verticale lo studente doveva scorrere per sapere che cosa gli si chiedesse. Qui resta
   un'anteprima alta al massimo 180px; per guardarla si apre a tutto schermo. */
.question-image-preview {
    display: block;
    position: relative;
    padding: 0;
    margin: 0 0 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: none;
    cursor: zoom-in;
    overflow: hidden;
    max-width: 100%;
    line-height: 0;              /* niente spazio fantasma sotto l'immagine */
}
.question-image-preview img {
    display: block;
    max-height: 180px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}
/* L'invito a ingrandire: sempre visibile, non solo al passaggio del mouse — su tablet
   il passaggio del mouse non esiste, ed è lì che la prova si svolge. */
.question-image-lente {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(30, 36, 51, 0.72);
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.2;
}
.question-image-preview:hover { border-color: var(--accent); }

.image-viewer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;               /* sopra i modali della prova (1000) e i pannelli */
    background: rgba(20, 24, 36, 0.92);
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
}
.image-viewer.active { display: flex; }
.image-viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;         /* ingrandita quanto entra, mai deformata né tagliata */
    border-radius: 8px;
}
/* Pulsante di sola icona: quadrato, senza rientri e senza altezza imposta.
   La regola base `button { padding: 0.6rem 1.1rem; height: 42px; }` di questo foglio
   vince su una larghezza dichiarata dopo, e il glifo finiva spinto in alto a sinistra
   dentro il cerchio invece che al centro. Servono quindi TUTTE e tre: padding a zero,
   altezza esplicita e line-height 1 — l'ultima perché l'interlinea ereditata alza il
   glifo di qualche pixel anche quando il riquadro è centrato. */
.image-viewer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.75rem;
    height: 2.75rem;             /* bersaglio pieno per un dito, non solo per un cursore */
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}
/* Il glifo non deve portarsi dietro interlinea propria: con `display:inline-block`
   e line-height 1 il suo riquadro coincide con il disegno, e il centraggio del
   flex cade esattamente al centro del cerchio. */
/* Il disegno occupa un quadrato esatto dentro il cerchio: nessuna metrica tipografica
   di mezzo, quindi il centro del segno coincide con il centro del pulsante. */
.image-viewer-close svg { display: block; width: 1.35rem; height: 1.35rem; }
.image-viewer-close:hover { background: rgba(255, 255, 255, 0.28); }

/* --- CALCULATOR --- */
.calculator-panel {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 280px;
    z-index: 800;
    padding: 0.75rem;
}

.calc-mode-switch {
    display: flex;
    gap: 0.3rem;
    background: var(--bg-darker);
    border-radius: 8px;
    padding: 0.2rem;
    margin-bottom: 0.6rem;
}

.calc-mode-btn {
    flex: 1;
    background: transparent;
    color: var(--text-muted);
    height: 32px;
    font-size: var(--text-sm);
    padding: 0;
    border-radius: 6px;
}

.calc-mode-btn.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

#calc-scientific-row { display: none; margin-bottom: 0.4rem; }
#calc-scientific-row.active { display: grid; }

.calc-sci { background: var(--bg-darker); color: var(--primary); font-size: var(--text-sm); padding: 0; height: 36px; }
.calc-sci:hover { background: #dde2f0; }

.calculator-panel.active { display: block; }

/* --- FORMULARIO --- */
.formulario-panel {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: min(560px, 90vw);
    height: min(720px, 80vh);
    z-index: 800;
    padding: 0.75rem;
    flex-direction: column;
}

.formulario-panel.active { display: flex; }

.formulario-frame {
    flex: 1;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 0.5rem;
    background: #525659;
    overflow: auto;
}

.formulario-viewer {
    flex: 1;
    width: 100%;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 0.5rem;
    background: #525659;
    padding: 0.5rem;
}

.formulario-viewer canvas { display: block; margin: 0 auto; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }

.formulario-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: var(--text-md);
    color: var(--text-muted);
}

.formulario-pager button {
    width: 34px;
    height: 34px;
    padding: 0;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.formulario-pager-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
}

.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.calculator-close { background: transparent; color: var(--text-muted); height: auto; padding: 0.2rem 0.5rem; }
.calculator-close:hover { background: var(--bg-darker); }

.calc-display {
    width: 100%;
    text-align: right;
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
    padding: 0.6rem;
}

.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
.calc-grid button { height: 42px; background: var(--bg-darker); color: var(--text-main); padding: 0; }
.calc-grid button:hover { background: #dde2f0; }
.calc-op { background: var(--border) !important; }
.calc-equals { background: var(--primary) !important; color: white !important; }

/* --- TOAST --- */
.exam-toast {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 8px 24px rgba(30,36,51,0.2);
    transform: translateY(200%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    max-width: 320px;
}

.exam-toast.active { transform: translateY(0); opacity: 1; }

@media (max-width: 800px) {
    .exam-layout { grid-template-columns: 1fr; }
    .question-nav { grid-template-columns: repeat(10, 1fr); }
    .exam-topbar { flex-wrap: wrap; }
    .exam-topbar-center { position: static; transform: none; order: 3; width: 100%; display: flex; justify-content: center; }
}

/* ============================================================================
   COMPLETAMENTO, ABBINAMENTO E SEQUENZA
   ============================================================================
   Tre tipi che si rispondono manipolando elementi invece di scegliere fra
   opzioni. Nessun trascinamento: su un tablet è impreciso e con la tastiera è
   inaccessibile. La sequenza si riordina con le frecce, l'abbinamento con una
   tendina. */

/* --- Completamento --- */

/* Lo spazio dentro il testo porta il proprio numero: con più spazi uguali si
   dovrebbe altrimenti contarli per capire quale si sta compilando. */
.blank-marker {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    margin: 0 0.15rem;
    font-weight: 600;
    color: var(--primary);
}
.blank-rule {
    display: inline-block;
    width: 4.5rem;
    border-bottom: 2px solid var(--text-muted);
}

.completion-blank {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.blank-number {
    flex: 0 0 auto;
    min-width: 2rem;
    font-weight: 600;
    color: var(--primary);
}
.blank-input { flex: 1 1 auto; min-width: 0; }

/* --- Abbinamento --- */

.matching-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.matching-row:last-child { border-bottom: none; }
.matching-arrow { color: var(--text-muted); }
.matching-select { width: 100%; }

/* PANNELLO ACCESSIBILITÀ: campi a piena larghezza.
   La regola esiste anche in theme.css; la si ripete QUI, dentro il foglio della prova,
   perché è la pagina in cui il pannello conta davvero — è lo studente con DSA che lo apre
   a metà verifica, e un campo strizzato è più difficile da centrare col dito.
   È deliberatamente ANNIDATA sotto `.a11y-mini-panel`: una regola generica sui `select`
   avrebbe allargato anche le tendine dell'abbinamento e quelle dentro le domande, che
   hanno misure loro. `box-sizing: border-box` perché la spaziatura interna dei campi in
   questo foglio è generosa: senza, il 100% più i rientri sfonda il pannello. */
.a11y-mini-panel select {
    width: 100%;
    box-sizing: border-box;
}

/* --- Sequenza --- */

.ordering-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.5rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.ordering-position {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    background: var(--bg-card);
    border-radius: 50%;
    font-weight: 700;
    color: var(--primary);
}
.ordering-text { flex: 1 1 auto; min-width: 0; }
.ordering-actions { flex: 0 0 auto; display: flex; gap: 0.2rem; }

/* Risposta breve: un campo su una riga.
   La forma del campo dice quanto ci si aspetta che sia lunga la risposta. Un riquadro grande
   inviterebbe a scrivere un tema, per poi vederselo confrontare parola per parola con quella
   attesa — e a quel punto la valutazione sarebbe incomprensibile. */
.short-answer-wrap { margin-top: 0.5rem; }
.short-answer-input {
    width: 100%;
    max-width: 26rem;
    font-size: var(--text-reading);
}
