* { box-sizing:border-box; }
body { margin:0; background:#f1effa; color:#211d40; font:16px/1.55 Arial,sans-serif; }
a { color:#382b80; text-underline-offset:.2em; }
.generator-toolbar { display:flex; justify-content:space-between; flex-wrap:wrap; gap:1rem; max-width:1100px; padding:1.5rem; margin:auto; }
.generator-brand { font-size:1.3rem; font-weight:800; text-decoration:none; }
.generator-controls { max-width:1000px; margin:0 auto 2rem; padding:clamp(1.2rem,4vw,2rem); border:1px solid #d8d3e9; border-radius:22px; background:white; }
h1 { font-size:clamp(1.6rem,4vw,2.1rem); line-height:1.2; margin-top:0; }
.generator-controls p { max-width:75ch; }
.control-fields,.generator-actions { display:flex; flex-wrap:wrap; align-items:center; gap:1rem; margin:1.3rem 0; }
.generator-controls label { display:grid; gap:.35rem; font-weight:700; }
.generator-controls .check-label { display:flex; align-items:center; }
input { min-height:44px; border:2px solid #d0cae4; border-radius:9px; padding:.5rem .7rem; font:inherit; max-width:100%; }
input[type=number] { width:7rem; }
input[type=checkbox] { width:1.2rem; min-height:1.2rem; height:1.2rem; margin:0 .4rem 0 0; accent-color:#493a98; }
#series-code { width:15rem; text-transform:uppercase; }
#series-link { width:100%; }
button { min-height:46px; border:2px solid #493a98; border-radius:10px; padding:.7rem 1rem; background:#493a98; color:white; font:700 1rem Arial,sans-serif; cursor:pointer; }
button.secondary { background:white; color:#382b80; }
button:disabled { opacity:.5; cursor:wait; }
:focus-visible { outline:3px solid #edb820; outline-offset:3px; }
summary { cursor:pointer; text-decoration:underline; text-underline-offset:.2em; }
details { border-top:1px solid #ddd7ec; padding-top:1rem; }
details label { margin-bottom:.7rem; }
[hidden] { display:none !important; }
#worksheets { padding:0 1rem 2rem; }
.worksheet-page { width:210mm; height:297mm; max-width:100%; margin:0 auto 1.5rem; padding:14mm; background:white; box-shadow:0 3px 16px #211d4018; display:flex; flex-direction:column; color:#211d40; }
.sheet-kicker { display:flex; justify-content:space-between; gap:1rem; font-weight:700; font-size:9pt; color:#493a98; }
.sheet-title { font-size:23pt; margin:12px 0 8px; line-height:1.2; }
.sheet-intro { font-size:10.5pt; line-height:1.5; margin:0 0 12px; }
.sheet-code { font-size:9pt; font-weight:700; margin:0 0 12px; }
.sheet-name { font-size:10pt; margin:0 0 14px; }
.sheet-questions { display:grid; grid-template-rows:repeat(6,minmax(0,1fr)); padding:0; margin:0; list-style:none; flex:1; min-height:0; }
.sheet-question { min-height:0; position:relative; display:flex; gap:12px; border-bottom:1px solid #d8d4e1; padding:10px 0 12px; }
.question-number { flex:0 0 19px; font-weight:700; color:#493a98; font-size:11pt; }
.question-text { flex:1; min-width:0; font-size:11pt; line-height:1.65; }
.question-visual { flex:0 0 155px; width:155px; height:82px; align-self:center; }
.answer-page .sheet-question { border-bottom:0; }
.sheet-footer { border-top:1px solid #d8d4e1; padding-top:8px; margin-top:15px; font-size:8pt; line-height:1.5; }
.sheet-fraction { display:inline-flex; flex-direction:column; vertical-align:middle; align-items:stretch; text-align:center; font-size:.85em; line-height:1.15; margin:0 .15em; min-width:.8em; }
.sheet-fraction > span:first-child { border-bottom:1px solid currentColor; padding:0 .2em .12em; }
.sheet-fraction > span:last-child { padding-top:.12em; }
@media(max-width:600px) { .worksheet-page { height:auto; min-height:1050px; padding:1rem; } .sheet-question { min-height:120px; } .question-visual { width:115px; flex-basis:115px; } .generator-actions { align-items:stretch; flex-direction:column; } .sheet-kicker { font-size:8pt; } .sheet-title { font-size:20pt; } }
@page { size:A4; margin:14mm; }
@media print {
 body { margin:0; background:white; }
 .generator-toolbar,.generator-controls { display:none !important; }
 main,#worksheets { margin:0; padding:0; }
 .worksheet-page { width:100%; max-width:none; height:268mm; min-height:0; margin:0; padding:0; box-shadow:none; break-after:page; page-break-after:always; break-inside:avoid; }
 .worksheet-page:last-child { break-after:auto; page-break-after:auto; }
 .sheet-question { min-height:0; break-inside:avoid; }
 .question-visual { width:155px; flex-basis:155px; }
 .sheet-title { font-size:23pt; }
 .sheet-kicker { font-size:9pt; }
}
