/* Oxidation States & Redox: tool-specific layout; common styles live in ../resources/styles.css */
[hidden] { display: none !important; }
.wrap { grid-template-columns: 19rem minmax(0, 1fr) 21rem; }
/* Test page: controls, score and feedback share the left column so the equations get the full width */
body[data-mode="test"] .wrap { grid-template-columns: 21rem minmax(0, 1fr); }
.leftcol > #controls { flex: none; }
header p { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modeswitch { display: inline-flex; gap: 0.3rem; flex: none; }
.modeswitch .btn { width: auto; text-decoration: none; padding: 0.4rem 1.1rem; font-size: 1.1rem; white-space: nowrap; }
.modeswitch .btn.active { background: var(--accent); color: var(--bg, #06121f); border-color: var(--accent); }
.controls-inline { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.seg button { flex: 1; }
.seg button.active { background: var(--seg-add); border-color: var(--accent); color: var(--btn-ink); }

/* Topic tick boxes */
.topics { display: flex; flex-direction: column; gap: 0.35rem; }
.screen-app .topics label.tick { display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.4rem 0.6rem;
    font-size: 1.02rem; font-weight: 500; cursor: pointer; border: 2px solid var(--border); border-radius: 0.6rem;
    background: var(--surface); }
.topics input { width: 1.2rem; height: 1.2rem; margin: 0; flex: none; accent-color: var(--accent); }

/* Board: question + working */
.board { display: flex; flex-direction: column; gap: 1rem; padding: 1.2rem 1.4rem; container-type: inline-size; }
.question { font-size: 1.6rem; line-height: 1.35; font-weight: 600; }
.bigeq { margin-top: 0.6rem; padding: 0.6rem 1rem; font-size: 1.9rem; font-weight: 600; border: 2px solid var(--border);
    border-radius: 0.8rem; background: var(--surface); }
.data { font-size: 1.3rem; line-height: 1.6; color: var(--ink); }
.data:empty { display: none; }
.work { display: grid; grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); gap: 1.4rem; align-items: start; }

/* Reference column */
.ref { position: sticky; top: 0; }
.refbox { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.8rem; text-align: center; font-size: 1.15rem; font-weight: 600;
    line-height: 1.35; border: 3px solid var(--accent); border-radius: 0.8rem; background: var(--surface); }
.refbox span { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.refbox small { color: var(--muted); font-weight: 500; }
.ref-tips { margin: 0.8rem 0 0; padding-left: 1.3rem; line-height: 1.5; color: var(--muted); }
.ref-tips li + li { margin-top: 0.25rem; }
.ref-cap { margin-top: 0.6rem; color: var(--muted); font-size: 0.95rem; }

/* Guided steps */
.step-list { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.step { padding: 0.6rem 0.9rem; font-size: 1.3rem; border: 2px solid var(--border); border-radius: 0.7rem; background: var(--surface); }
.step.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.step.done { display: flex; gap: 0.6rem; border-color: var(--good); }
.step.todo { color: var(--muted); font-size: 1rem; border-style: dashed; }
.step .tick { color: var(--good); font-weight: 700; }
.step p { margin: 0 0 0.6rem; color: var(--muted); font-size: 1.05rem; }
.sum { display: block; margin: 0.4rem 0; padding: 0.4rem 0.7rem; font-size: 1.2rem; color: var(--ink);
    border-radius: 0.5rem; background: var(--panel); }

/* Equations with boxes */
.eq { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.25rem; font-size: 1.45rem; overflow-x: auto; }
.eq > * { flex: none; white-space: nowrap; }
.nw, .sum { white-space: nowrap; }
/* Boxes are sized in em so they shrink with the equation */
.screen-app input.blank { width: 3.4em; padding: 0.15em 0.2em; text-align: center; font-size: 0.9em; }
.screen-app input.blank.coef { width: 1.9em; }
.screen-app input.blank::placeholder { color: var(--muted); opacity: 0.55; }
.screen-app input.blank.wrong { border-color: var(--bad); }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.screen-app .choice { width: auto; max-width: 100%; padding: 0.4rem 1rem; font-size: 1.3rem; font-weight: 600; text-align: left; white-space: nowrap; }
.screen-app .choice.wrong { border-color: var(--bad); opacity: 0.55; }
.screen-app .choice.selected { background: var(--seg-add); border-color: var(--accent); color: var(--btn-ink); }
.screen-app .step-check { width: auto; margin-top: 0.6rem; padding: 0.4rem 1.6rem; }

/* Test parts */
.parts { display: flex; flex-direction: column; gap: 0.8rem; margin: 0; padding: 0; list-style: none; }
.part { padding: 0.7rem 1rem; border: 2px solid var(--border); border-radius: 0.7rem; background: var(--surface); }
.part.right { border-color: var(--good); }
.part.wrong { border-color: var(--bad); }
.part-q { margin-bottom: 0.5rem; color: var(--muted); font-size: 1.1rem; }
.part-n { font-weight: 700; color: var(--accent); }
.part-sol { margin-top: 0.6rem; padding-top: 0.5rem; font-size: 1.2rem; border-top: 1px dashed var(--border); color: var(--good); }
.test-actions { display: flex; gap: 0.6rem; }
.screen-app .test-actions button { width: auto; padding: 0.5rem 1.6rem; }

@media (max-width: 900px) {
    body.screen-app { height: auto; overflow: auto; }
    .wrap { grid-template-columns: 1fr; }
    .work { grid-template-columns: 1fr; }
    .ref { position: static; max-width: 20rem; }
    header p { white-space: normal; }
}

/* Multi-line answer templates: one row per label + box */
.eq-rows { display: flex; flex-direction: column; gap: 0.5rem; }

/* Narrow board: rules box goes under the steps so equations get the full width */
@container (max-width: 52rem) {
    .work { grid-template-columns: 1fr; }
    .ref { position: static; order: 2; }
}

/* Worked steps: a short label above each finished line, so the full working reads as a model answer */
.sbody { display: flex; flex-direction: column; min-width: 0; }
.slabel { font-size: 0.75em; font-weight: 700; color: var(--muted); }
.sbody .note { font-size: 0.8em; color: var(--muted); }
