/* Math exam generator (/exam-generator/). Scoped under .eg so it sits inside the site template.
   Converted 2026-10-20 from the standalone page; source of truth is this file. */
@font-face{font-family:"Caveat";font-style:normal;font-weight:600;font-display:swap;src:url(/assets/fonts/caveat-latin-600-normal.woff2) format("woff2")}
.eg { font-family: var(--body); color: var(--ink); line-height: 1.5; }
.eg *, .eg *::before, .eg *::after { box-sizing: border-box; margin: 0; padding: 0; }
.eg .eg-intro { max-width: 1440px; margin: 0 auto; padding: 8px 24px 18px; }
.eg-wrap-bg { background-color: #e9edf3; background-image: linear-gradient(#cfd9e6 1px, transparent 1px), linear-gradient(90deg, #cfd9e6 1px, transparent 1px); background-size: 28px 28px; padding: 18px 0 8px; }
/* Online exam: keep the child focused on the paper */
body.online-mode .breadcrumbs, body.online-mode .reviewed, body.online-mode .eg-content, body.online-mode .faq-section, body.online-mode main > section:not(.eg-wrap-bg) { display: none !important; }
@media print {
  body > :not(main), main > :not(.eg-wrap-bg), .eg .eg-intro, .eg-content { display: none !important; }
  .eg-wrap-bg { background: #fff !important; background-image: none !important; padding: 0 !important; }
}
.eg { --ink: #16233b;
    --ink-soft: #4a5670;
    --desk: #e9edf3;
    --grid-line: #cfd9e6;
    --paper: #ffffff;
    --pencil: #f2b52a;
    --pencil-dark: #c98f0a;
    --pen-red: #d33127;
    --rule: #d8dee8;
    --focus: #2456d8;
    --radius: 10px;
    --display: "Lexend", system-ui, sans-serif;
    --body: "Lexend", system-ui, sans-serif;
    --pen: "Caveat", "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive; }
.eg .eg-intro { max-width: 1440px; margin: 0 auto; padding: 36px 24px 20px; }
.eg .eg-intro h1 { font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.7rem, 3.5vw, 2.4rem);
    letter-spacing: -0.01em; }
.eg .eg-intro h1 .underline { background: linear-gradient(transparent 68%, var(--pencil) 68%, var(--pencil) 92%, transparent 92%);
    padding: 0 2px; }
.eg .eg-intro p { margin-top: 6px; color: var(--ink-soft); max-width: 62ch; }
.eg .app { max-width: 1440px;
    margin: 0 auto 64px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 336px minmax(0, 1fr);
    gap: 28px;
    align-items: start; }
@media (max-width: 880px) {
.eg .app { grid-template-columns: 1fr; }
}
.eg .controls { background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: 0 4px 14px rgba(22, 35, 59, 0.08);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto; }
@media (max-width: 880px) {
.eg .controls { position: static; max-height: none; }
}
.eg .controls h2 { font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--pencil); }
.eg .field { margin-bottom: 16px; }
.eg .field > label { display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px; }
.eg .field select { width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--ink-soft);
    border-radius: 8px;
    cursor: pointer; }
.eg .check { display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 4px; }
.eg .check input { width: 17px; height: 17px; accent-color: var(--pencil-dark); cursor: pointer; }
.eg .field select:focus-visible,
.eg .field input:focus-visible,
.eg .check input:focus-visible,
.eg button:focus-visible { outline: 3px solid var(--focus);
    outline-offset: 2px; }
.eg .field select optgroup { font-style: normal;
    font-weight: 700;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft); }
.eg .field select optgroup > option { font-weight: 400;
    font-size: 1.08rem;
    text-transform: none;
    letter-spacing: normal;
    color: var(--ink); }
.eg .opts-box { border: 1.5px dashed var(--rule);
    border-radius: 8px;
    padding: 12px 12px 8px;
    margin-bottom: 16px; }
.eg .opts-box:empty { display: none; }
.eg .opts-box .field:last-child { margin-bottom: 8px; }
.eg .opts-legend { font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    margin-bottom: 10px; }
.eg .slider-row { display: flex; align-items: center; gap: 12px; }
.eg input[type="range"] { flex: 1; accent-color: var(--pencil-dark); cursor: pointer; min-height: 28px; }
.eg .count-badge { font-family: var(--display);
    font-weight: 800;
    font-size: 1.1rem;
    min-width: 2.2em;
    text-align: center;
    background: var(--ink);
    color: #fff;
    border-radius: 8px;
    padding: 3px 6px; }
.eg .eg-btn { display: block;
    width: 100%;
    padding: 12px 16px;
    font: inherit;
    font-weight: 600;
    border-radius: 8px;
    border: 1.5px solid var(--ink);
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.06s ease; }
.eg .eg-btn:active { transform: translateY(1px); }
.eg .btn-primary { background: var(--ink); color: #fff; }
.eg .btn-primary:hover { background: #223354; }
.eg .btn-secondary { background: #fff; color: var(--ink); }
.eg .btn-secondary:hover { background: #f2f5fa; }
.eg .btn-key { background: #fff; color: var(--pen-red); border-color: var(--pen-red); }
.eg .btn-key:hover { background: #fdf1f0; }
.eg .btn-key[aria-pressed="true"] { background: var(--pen-red); color: #fff; }
.eg .eg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.eg .btn-row { display: flex; gap: 8px; }
.eg .btn-row .eg-btn { margin-top: 10px; }
.eg .hint { margin-top: 14px; font-size: 0.8rem; color: var(--ink-soft); }
.eg .paper { background: var(--paper);
    color: #000;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(22,35,59,0.12), 0 14px 34px rgba(22,35,59,0.14);
    padding: 48px 52px 56px;
    min-height: 620px; }
@media (max-width: 640px) {
.eg .paper { padding: 28px 20px 40px; }
}
.eg .paper-empty { color: var(--ink-soft); text-align: center; padding-top: 180px; font-size: 1.05rem; }
.eg .paper-empty .big { font-family: var(--display);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--ink);
    display: block;
    margin-bottom: 8px; }
.eg .notice { background: #fff7e0;
    border: 1.5px solid var(--pencil);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #6b5304;
    margin-bottom: 20px; }
.eg .exam-meta { display: flex; flex-wrap: wrap; gap: 18px 40px; font-size: 0.95rem; margin-bottom: 22px; }
.eg .exam-meta .line { flex: 1; min-width: 220px; white-space: nowrap; }
.eg .exam-meta .blankline { display: inline-block;
    width: 62%;
    border-bottom: 1.5px solid #000;
    vertical-align: baseline; }
.eg .exam-title { font-family: var(--display);
    font-weight: 800;
    font-size: 1.5rem;
    text-align: center;
    border-top: 2.5px solid #000;
    border-bottom: 2.5px solid #000;
    padding: 10px 0;
    margin-bottom: 8px; }
.eg .exam-sub { text-align: center; font-size: 0.9rem; color: #333; margin-bottom: 30px; }
.eg .questions { display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 32px 40px;
    font-size: 1.15rem; }
.eg .q { display: flex;
    align-items: baseline;
    gap: 10px;
    break-inside: avoid;
    position: relative; }
.eg .q.word { grid-column: 1 / -1; max-width: 68ch; }
.eg .q .qnum { font-weight: 700; font-family: var(--display); min-width: 1.9em; }
.eg .q .qbody { flex: 1; min-width: 0; }
.eg .q .expr { white-space: nowrap; }
.eg .q .wordq { white-space: normal; }
.eg .q .blank { display: inline-block;
    min-width: 64px;
    border-bottom: 1.5px solid #000;
    margin-left: 8px;
    position: relative;
    vertical-align: baseline; }
.eg .cmp { display: inline-block;
    width: 36px;
    height: 36px;
    border: 2px solid #000;
    border-radius: 50%;
    vertical-align: middle;
    margin: 0 10px;
    position: relative; }
.eg .cmp .answer { position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -58%) rotate(-4deg); }
.eg .clockq { display: inline-block; vertical-align: middle; margin-right: 10px; }
.eg .clockq svg { display: block; }
.eg .reroll { position: absolute;
    top: -6px;
    right: -4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--rule);
    background: #fff;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.12s ease, color 0.12s ease, border-color 0.12s ease; }
.eg .q:hover .reroll,
.eg .reroll:focus-visible { opacity: 1; color: var(--ink); border-color: var(--ink-soft); }
.eg .workbox { margin-top: 10px;
    min-height: 86px;
    border: 1.5px dashed #b9c2d0;
    border-radius: 6px; }
.eg .col-prob { display: inline-block;
    font-variant-numeric: tabular-nums;
    font-size: 1.35rem;
    line-height: 1.35;
    min-width: 96px; }
.eg .col-row,
.eg .col-ans { display: block; }
.eg .col-row { text-align: right; padding-right: 6px; }
.eg .col-row.op { border-bottom: 2.5px solid #000; padding-bottom: 3px; }
.eg .col-row.op .col-op { float: left; margin-left: 2px; padding-right: 14px; }
.eg .col-ans { text-align: right;
    padding-right: 6px;
    min-height: 2em;
    position: relative; }
.eg .ldiv { display: inline-grid;
    grid-template-columns: auto auto;
    font-variant-numeric: tabular-nums;
    font-size: 1.35rem;
    line-height: 1.4; }
.eg .ldiv-quot { grid-column: 2;
    min-height: 1.7em;
    padding: 0 10px 2px;
    position: relative;
    text-align: center; }
.eg .ldiv-divisor { grid-column: 1; grid-row: 2; padding: 3px 8px 0 0; }
.eg .ldiv-dividend { grid-column: 2;
    grid-row: 2;
    border-top: 2.5px solid #000;
    border-left: 2.5px solid #000;
    border-top-left-radius: 3px;
    padding: 3px 12px 42px 10px; }
.eg .frac { display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    line-height: 1.1;
    margin: 0 3px;
    font-size: 0.95em; }
.eg .frac .num { border-bottom: 1.5px solid #000; padding: 0 5px; }
.eg .frac .den { padding: 0 5px; }
.eg .mixedn { white-space: nowrap; }
.eg sup { font-size: 0.72em; }
.eg .answer { font-family: var(--pen);
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--pen-red);
    white-space: nowrap;
    display: none; }
.eg .blank .answer { position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%) rotate(-2deg); }
.eg .ldiv-quot .answer { transform: rotate(-2deg); }
body.show-answers.key-inline .eg .answer { display: inline-block; }
body.show-answers.key-inline .eg .paper .inline-key-stamp { display: block;
    margin-top: 36px;
    font-family: var(--pen);
    font-size: 1.3rem;
    color: var(--pen-red);
    text-align: right;
    transform: rotate(-1deg); }
.eg .inline-key-stamp { display: none; }
.eg .key-page { display: none; margin-top: 48px; border-top: 3px dashed var(--rule); padding-top: 32px; }
body.show-answers.key-separate .eg .key-page { display: block; }
.eg .key-title { font-family: var(--display);
    font-weight: 800;
    font-size: 1.3rem;
    border-top: 2.5px solid #000;
    border-bottom: 2.5px solid #000;
    text-align: center;
    padding: 8px 0;
    margin-bottom: 22px; }
.eg .key-list { display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px 24px;
    list-style: none;
    font-size: 1.05rem; }
.eg .key-list .knum { font-weight: 700; font-family: var(--display); margin-right: 8px; }
.eg .key-list .kans { font-family: var(--pen); font-size: 1.35rem; font-weight: 600; color: var(--pen-red); }
.eg .btn-online { background: #2f9457; color: #fff; border-color: #237443; }
.eg .btn-online:hover { background: #277e4a; }
body.online-mode .eg .reroll { display: none; }
body.online-mode .eg .controls,
body.online-mode .eg .eg-intro,
body.online-mode .eg .eg-content { display: none; }
body.online-mode .eg .app { grid-template-columns: 1fr;
    max-width: 980px;
    margin-top: 28px; }
.eg .ans-input { font: inherit;
    font-size: 1.05em;
    width: 96px;
    max-width: 40vw;
    border: none;
    border-bottom: 1.5px solid #000;
    border-radius: 0;
    background: #fbfcff;
    text-align: center;
    padding: 2px 4px;
    margin-left: 8px;
    vertical-align: baseline; }
.eg .ans-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; background: #fff; }
.eg .ans-input:disabled { background: transparent; color: #000; }
.eg .col-ans .ans-input,
.eg .ldiv-quot .ans-input { margin-left: 0; width: 88px; }
.eg .choice-group { display: inline-flex; gap: 8px; margin-left: 8px; vertical-align: middle; flex-wrap: wrap; }
.eg .choice { font: inherit;
    font-size: 0.95em;
    min-width: 44px;
    padding: 6px 12px;
    border: 1.5px solid var(--ink-soft);
    border-radius: 999px;
    background: #fff;
    cursor: pointer; }
.eg .choice:hover { background: #f2f5fa; }
.eg .choice.selected { background: var(--ink); color: #fff; border-color: var(--ink); }
.eg .choice:disabled { cursor: default; opacity: 0.85; }
.eg .choice:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.eg .online-bar { position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: #fffdf5;
    border: 1.5px solid var(--pencil);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 24px;
    font-size: 0.95rem; }
.eg .online-bar .progress { font-weight: 600; }
.eg .online-bar .retry-msg { color: #8a5a00; font-weight: 600; }
.eg .online-bar .bar-btn { font: inherit;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1.5px solid #237443;
    background: #2f9457;
    color: #fff;
    cursor: pointer;
    margin-left: auto; }
.eg .online-bar .bar-btn:hover { background: #277e4a; }
.eg .online-bar .bar-btn.alt { background: #fff; color: var(--ink); border-color: var(--ink); margin-left: 0; }
.eg .online-bar .bar-btn.alt:hover { background: #f2f5fa; }
.eg .online-bar .bar-btn:focus-visible,
.eg .name-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.eg .name-input { font: inherit;
    border: none;
    border-bottom: 1.5px solid #000;
    background: transparent;
    padding: 0 4px;
    width: 60%; }
.eg .score-card { display: flex;
    align-items: center;
    gap: 22px;
    border: 2.5px solid #000;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 28px;
    flex-wrap: wrap; }
.eg .score-card .ring { flex: 0 0 auto; }
.eg .score-big { font-family: var(--display); font-weight: 800; font-size: 1.7rem; }
.eg .score-sub { color: #333; font-size: 0.95rem; }
.eg .score-meta { margin-top: 6px; font-size: 0.85rem; color: #555; }
.eg .q .mark { position: absolute;
    top: -8px;
    right: -4px;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1; }
.eg .q .mark.ok { color: #2f9457; }
.eg .q .mark.no { color: var(--pen-red); }
.eg .q .mark.retry { color: #c9560f; }
.eg .q.q-wrong .ans-input { border-bottom-color: var(--pen-red); }
.eg .q.q-retry { background: #fff7e0;
    outline: 2px dashed var(--pencil);
    outline-offset: 8px;
    border-radius: 4px; }
.eg .correct-line { display: block; margin-top: 6px; font-size: 0.85rem; color: #555; }
.eg .correct-ans { font-family: var(--pen); font-size: 1.3rem; font-weight: 600; color: var(--pen-red); white-space: nowrap; }
.eg .brand-footer { display: none; }
@page { size: letter; margin: 0.55in 0.55in 0.7in; }
@media print {
.eg .eg-intro,
.eg .controls,
.eg .reroll,
.eg .notice,
.eg .online-bar { display: none !important; }
.eg .ans-input,
.eg .name-input { background: transparent !important; }
.eg .choice { border-width: 1px; }
.eg .choice.selected { background: #000 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.eg .score-card { break-inside: avoid; }
.eg .q.q-retry { outline: none; background: transparent; }
.eg .mark.ok { color: #2f9457 !important; }
.eg .mark.no,
.eg .correct-ans { color: var(--pen-red) !important; }
.eg .mark,
.eg .correct-ans { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.eg .app { display: block; max-width: none; margin: 0; padding: 0; }
.eg .paper { box-shadow: none; border-radius: 0; padding: 0 0 0.35in; min-height: 0; }
.eg .brand-footer { display: block;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      text-align: center;
      font-family: var(--display);
      font-size: 9pt;
      font-weight: 600;
      letter-spacing: 0.04em;
      color: #555;
      border-top: 0.75pt solid #bbb;
      padding-top: 4pt;
      background: #fff; }
.eg .questions { gap: 30px 36px; }
.eg .q,
.eg .workbox,
.eg .col-prob,
.eg .ldiv { page-break-inside: avoid; break-inside: avoid; }
.eg .answer,
.eg .kans { color: var(--pen-red) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body.show-answers.key-separate .eg .key-page { border-top: none;
      margin-top: 0;
      padding-top: 0;
      page-break-before: always; }
}
@media (prefers-reduced-motion: reduce) {
.eg .eg-btn,
.eg .reroll { transition: none; }
}
/* Print/online settings sit under the action buttons */
.eg .eg-settings { margin-top: 20px; padding-top: 14px; border-top: 1.5px dashed var(--rule); }
.eg .eg-settings .field { margin-bottom: 12px; }
@media (max-width: 640px) {
  .eg .eg-intro { padding: 4px 16px 12px; }
  .eg .eg-intro h1 { font-size: 1.55rem; }
  .eg .eg-intro .lede { font-size: 1rem; }
  .eg .app { padding: 0 12px; gap: 18px; }
  .eg .controls { padding: 16px 14px; }
}
@media (max-width: 640px) {
  .eg .controls h2 { font-size: .95rem; margin-bottom: 10px; padding-bottom: 6px; }
  .eg .field { margin-bottom: 10px; }
  .eg .field > label { margin-bottom: 3px; }
  .eg .field select { padding: 8px 10px; }
  .eg .opts-box { padding: 8px 10px 2px; margin-bottom: 10px; }
  .eg .opts-legend { display: none; }
  .eg .eg-intro .kid-say { margin-top: 8px; padding: 8px 12px; }
}
@media (max-width: 640px) {
  .eg .eg-intro h1 { font-size: 1.4rem; line-height: 1.25; }
  .eg .eg-intro .lede { margin-top: 4px; line-height: 1.45; }
  .eg .field:has(#count) { display: flex; align-items: center; gap: 10px; }
  .eg .field:has(#count) > label { margin: 0; flex: 0 0 auto; font-size: .85rem; }
  .eg .field:has(#count) .slider-row { flex: 1; }
  .eg .eg-btn { padding: 10px 14px; margin-top: 8px; }
}
/* Tap targets: 48 px tall on every screen (rulebook) */
.eg .field select { min-height: 48px; }
.eg input[type="range"] { min-height: 48px; }
.eg .check input { width: 22px; height: 48px; margin: -6px 0; }
.eg .eg-settings .field + .field { margin-top: 14px; }
@media (max-width: 640px) { .eg .field select { padding: 8px 10px; min-height: 48px; } }
/* ---------- Step 2: extra topics, versions, test header ---------- */
.eg .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eg .extra-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.eg .extra-row select { flex: 1; min-width: 0; min-height: 48px; padding: 8px 10px; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--ink-soft); border-radius: 8px; }
.eg .extra-del { flex: 0 0 48px; height: 48px; border: 1.5px solid var(--rule); border-radius: 8px; background: #fff; color: var(--ink-soft); font-size: 1rem; cursor: pointer; }
.eg .extra-del:hover { color: var(--pen-red); border-color: var(--pen-red); }
.eg .btn-add { background: #fff; color: var(--ink); border-style: dashed; margin: 0 0 16px; min-height: 48px; }
.eg .btn-add:hover { background: #f2f5fa; }
.eg .field input[type="text"], .eg .field input[type="number"] { width: 100%; min-height: 48px; padding: 8px 12px; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--ink-soft); border-radius: 8px; }
.eg .hdr-box { border: 1.5px dashed var(--rule); border-radius: 8px; padding: 0 12px; margin-bottom: 12px; }
.eg .hdr-box summary { cursor: pointer; font-weight: 600; font-size: .9rem; min-height: 48px; display: flex; align-items: center; }
.eg .hdr-box[open] { padding-bottom: 8px; }
.eg .exam-school { text-align: center; font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .04em; }
.eg .exam-meta .blankline.short { width: 3.2em; }
.eg .exam-meta strong { font-weight: 600; }
.eg .part-head { grid-column: 1 / -1; font-family: var(--display); font-weight: 700; font-size: 1.05rem; border-bottom: 1.5px solid #000; padding-bottom: 4px; margin-top: 6px; }
.eg .part-head span { font-weight: 400; font-size: .85rem; color: #444; }
.eg .exam-version + .exam-version { margin-top: 56px; padding-top: 40px; border-top: 3px dashed var(--rule); }
@media print {
  .eg .exam-version + .exam-version { break-before: page; page-break-before: always; margin-top: 0; padding-top: 0; border-top: none; }
  .eg .part-head { break-after: avoid; }
}
/* Topic options as a collapsible box */
.eg details.opts-box > summary.opts-legend { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-height: 32px; }
.eg details.opts-box > summary.opts-legend::-webkit-details-marker { display: none; }
.eg details.opts-box > summary.opts-legend::before { content: "\25B8"; font-size: .9em; transition: transform .15s; }
.eg details.opts-box[open] > summary.opts-legend::before { transform: rotate(90deg); }
.eg .opts-now { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); font-size: .85rem; }
.eg details.opts-box[open] .opts-now { display: none; }
@media (max-width: 640px) {
  .eg .opts-legend { display: flex; }
  .eg details.opts-box > summary.opts-legend { min-height: 48px; align-items: center; margin: -8px 0 -2px; }
  .eg details.opts-box[open] > summary.opts-legend { margin-bottom: 6px; }
}
/* Print: flex rows instead of grid so a question never splits across pages */
@media print {
  .eg .questions { display: flex; flex-wrap: wrap; gap: 26px 0; }
  .eg .questions > .q { flex: 0 0 50%; padding-right: 28px; break-inside: avoid; page-break-inside: avoid; }
  .eg .questions > .q.word, .eg .questions > .part-head { flex-basis: 100%; }
}
@media print {
  .eg .questions > .q { flex-basis: 33.33%; }
  .eg .questions > .q:has(.col-prob), .eg .questions > .q:has(.ldiv) { flex-basis: 25%; }
  .eg .questions > .q:has(.clockq) { flex-basis: 50%; }
  .eg .questions > .q.word, .eg .questions > .part-head { flex-basis: 100%; }
}
/* ---------- Step 3: kids' online mode ---------- */
.eg .check-btn { font: inherit; font-size: .9rem; font-weight: 600; min-height: 48px; padding: 0 16px; margin-left: 10px; border-radius: 10px; border: 1.5px solid #237443; background: #2f9457; color: #fff; cursor: pointer; vertical-align: middle; }
.eg .check-btn:hover { background: #277e4a; }
.eg .say-btn { width: 48px; height: 48px; margin-left: 8px; border-radius: 50%; border: 1.5px solid var(--rule); background: #fff; font-size: 1.15rem; cursor: pointer; vertical-align: middle; }
.eg .say-btn:hover { border-color: var(--ink-soft); }
.eg .check-btn:focus-visible, .eg .say-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.eg .hint-line { display: block; margin-top: 8px; font-size: .9rem; color: #8a5a00; background: #fff7e0; border-radius: 8px; padding: 6px 10px; }
.eg .stars { margin-top: 4px; font-size: 1.9rem; line-height: 1; letter-spacing: 2px; }
.eg .star { color: #d9dee8; }
.eg .star.on { color: var(--pencil); }
.eg .online-bar .timer { font-variant-numeric: tabular-nums; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: #fff; border: 1.5px solid var(--rule); }
.eg .online-bar .timer.low { color: var(--pen-red); border-color: var(--pen-red); }
.eg .q.q-right { background: #eefaf2; border-radius: 6px; }
@media print { .eg .check-btn, .eg .say-btn, .eg .hint-line, .eg .online-bar .timer { display: none !important; } .eg .q.q-right { background: transparent; } }
/* ---------- Student link: only the test ---------- */
.eg .btn-student { background: #fff7e0; color: var(--ink); border-color: var(--pencil-dark); }
.eg .btn-student:hover { background: #ffefc2; }
.eg .student-link { margin-top: 10px; padding: 10px 12px; border: 1.5px solid var(--pencil); border-radius: 8px; background: #fffdf5; font-size: .85rem; }
.eg .student-link label { display: block; font-weight: 600; margin-bottom: 6px; }
.eg .student-link input { width: 100%; min-height: 48px; padding: 8px 10px; font: inherit; font-size: .8rem; border: 1.5px solid var(--ink-soft); border-radius: 8px; background: #fff; }
.eg .student-link a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; color: var(--focus); }
.eg .name-msg { display: block; color: var(--pen-red); font-weight: 600; font-size: .9rem; margin-top: 4px; white-space: normal; }
body.student-mode .skip-link, body.student-mode .site-nav, body.student-mode .menu-toggle, body.student-mode .btn--app,
body.student-mode .site-footer, body.student-mode .breadcrumbs, body.student-mode .reviewed { display: none !important; }
body.student-mode .site-header .logo { pointer-events: none; }
body.student-mode .eg-wrap-bg { min-height: 100vh; }
