/* The Chromozone: the random test page, /practice/ (tools/build_practice.py, 5 Nov 2026).
   Builds on site.css (.btn, .field, .role, .topic-check, .tag, .form-status) and accounts.css (.acct, .acct-card,
   .acct-msg, .acct-hint, .acct-confirm). Phone first: one column, 44 px targets, tables scroll inside their card. */

.rt > .wrap { max-width: 820px; }
.rt-field { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.rt-field legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.rt-field legend .acct-hint { font-weight: 400; }
.rt-select { max-width: 100%; appearance: auto; }
.rt-topics { display: grid; gap: 8px; }
@media (min-width: 620px) { .rt-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rt-topics h3 { grid-column: 1 / -1; font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 6px 0 -2px; }
.rt-topics .topic-check { min-height: 44px; }
.rt-topics .topic-check b { font-weight: 700; }
.rt-topics .topic-check .acct-hint { display: block; }
.rt-setup .form-status:empty { display: none; }
.rt .acct-link { min-height: 36px; padding: 2px 0; }
.rt .acct-msg[tabindex]:focus { outline: none; }
.rt .acct-msg[tabindex]:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* the test */
.rt-test { display: grid; gap: 14px; }
.rt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: rtq; }
.rt-q { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow); min-width: 0; counter-increment: rtq; }
@media (min-width: 720px) { .rt-q { padding: 20px 22px; } }
.rt-q > * { min-width: 0; }
.rt-q-head { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.rt-num { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--leaf-strong); min-width: 1.4em; }
.rt-num::before { content: counter(rtq); }
.rt-marks { font-weight: 600; color: var(--ink-3); font-size: 0.92rem; margin-left: auto; white-space: nowrap; }
.rt-stem { background: var(--paper); border-radius: 10px; padding: 10px 14px; display: grid; gap: 8px; }
.rt-part { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; }
.rt-part-letter { font-weight: 700; color: var(--ink-2); }
.rt-html { display: grid; gap: 8px; overflow-wrap: anywhere; }
.rt-html ul, .rt-html ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.rt-html ol[type="A"] { list-style: upper-alpha; }
.rt-html ol[type="a"] { list-style: lower-alpha; }
.rt-html ol[type="i"] { list-style: lower-roman; }
.rt-html img, .rt-html svg { max-width: 100%; height: auto; }
.rt-html figure { margin: 0; display: grid; gap: 6px; }
.rt-html figcaption { font-size: 0.88rem; color: var(--ink-2); }
.rt-html .credit { display: block; font-size: 0.78rem; color: var(--ink-3); }
.rt-html .formula { font-family: var(--font-mono); background: var(--paper-2); border-radius: 8px; padding: 8px 12px; font-weight: 600; }
.rt-html .mark { font-size: 0.85rem; font-weight: 600; color: var(--leaf); white-space: nowrap; }
.rt-html .ms-note { list-style: none; margin-left: -1.1em; color: var(--ink-3); }
.rt-html p:empty { display: none; }
.rt-scroll { overflow-x: auto; max-width: 100%; }
.rt-scroll:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.rt-html table { border-collapse: collapse; font-size: 0.92rem; min-width: 100%; background: #fff; }
.rt-html caption { text-align: left; font-weight: 600; padding: 0 0 6px; color: var(--ink-2); }
.rt-html th, .rt-html td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.rt-html thead th { background: var(--paper-2); }

/* options */
.rt-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rt-opt { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; align-items: start; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line-soft); border-radius: 10px; background: #fff; cursor: pointer; line-height: 1.4; }
.rt-opt input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--leaf); }
.rt-opt:has(input:checked) { border-color: var(--leaf); background: #f3faf6; }
.rt-opt:has(input:focus-visible) { outline: 3px solid var(--hl); outline-offset: 1px; }
.rt-letter { font-weight: 700; color: var(--ink-2); min-width: 1.1em; }
.rt-opt input[disabled] + .rt-letter { color: var(--ink-3); }
.rt-ans { width: 100%; min-height: 72px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: 400 1rem/1.5 var(--font-body); color: var(--ink); resize: vertical; }
.rt-ans:focus { border-color: var(--leaf); outline: 3px solid var(--leaf-tint); outline-offset: 0; }
.rt-ans[readonly] { background: var(--paper); }
.rt-from { font-size: 0.88rem; color: var(--ink-3); }

/* after Finished */
.rt-badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; border-radius: 999px; padding: 6px 14px; justify-self: start; }
.rt-badge--ok { background: var(--leaf-tint); color: var(--leaf-strong); }
.rt-badge--no { background: var(--red-tint); color: #7a2617; }
.rt-badge--none { background: var(--paper-2); color: var(--ink-2); }
.rt-explain { background: var(--leaf-tint); border-radius: 10px; padding: 10px 14px; }
.rt-scheme { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 12px 14px; display: grid; gap: 10px; }
.rt-scheme-k { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.rt-scheme li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.rt-scheme li.rt-plain, .rt-scheme ol li.rt-plain { display: list-item; }
.rt-scheme li:not(.rt-plain) { list-style: none; margin-left: -1.3em; }
.rt-tick { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -8px 0; border-radius: 10px; cursor: pointer; }
.rt-tick input { width: 22px; height: 22px; accent-color: var(--leaf); margin: 0; }
.rt-tick:has(input:focus-visible) { outline: 3px solid var(--hl); }
.rt-self { font-weight: 700; }
.rt-self b { color: var(--leaf-strong); }
.rt-finish { display: grid; gap: 12px; }
.rt-count { color: var(--ink-2); }
.rt-total { font-weight: 700; font-size: 1.15rem; }
.rt-total b { color: var(--leaf-strong); font-size: 1.3em; }
.rt .btn[disabled] { opacity: 0.55; cursor: progress; }

@media print {
  .rt-finish, .acct-bar .btn, .rt-after { display: none !important; }
  .rt-q { break-inside: avoid; box-shadow: none; }
}

/* the short-test note (17 Nov 2026): flashes up once when it appears */
@keyframes rt-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(231, 200, 115, 0); } 30% { box-shadow: 0 0 0 6px rgba(231, 200, 115, 0.9); } }
.rt-flash { animation: rt-flash 0.9s ease-out 2; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .rt-flash { animation: none; } }

/* An assigned test (17 Nov 2026): the "Assign to class" panel on /practice/ and the test page /practice/test/<id>/
   (js/practice-test.js builds its questions in the hand-in markup of css/test.css and css/hw-submit.css) */
.rt-assign { margin: 0 0 20px; }
.rt-assign h3 { margin: 0 0 12px; }
.pt .pt-qs { margin-top: 16px; }
.pt-q { margin: 0 0 22px; }
.pt-opts { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.pt-opt { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.pt-opt .pt-html > :first-child { margin-top: 0; }
.pt-opt .pt-html > :last-child { margin-bottom: 0; }
.pt-scroll { overflow-x: auto; }
.pt-from { font-size: 0.85rem; color: var(--muted, #5b6470); margin: 8px 0 0; }
