:root {
  --ink: #16253a;
  --muted: #5c6878;
  --line: #9ba6b3;
  --soft: #eef2f4;
  --coral: #e96c53;
  --coral-soft: #fff0ea;
  --teal: #147f79;
  --teal-soft: #e7f5f3;
  --gold: #f4c257;
  font-family: Aptos, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  font-size: 12pt;
  line-height: 1.35;
  background: #dfe3e7;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, a { font: inherit; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.08; margin: 0 0 4mm; }
h1 { font-size: 31pt; letter-spacing: -.035em; }
h2 { font-size: 22pt; letter-spacing: -.025em; }
h3 { font-size: 15pt; }
p, ul, ol { margin-top: 0; }
svg { max-width: 100%; }

.screen-toolbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px max(20px, calc((100vw - 210mm) / 2)); color: #fff; background: var(--ink); box-shadow: 0 5px 20px rgba(0,0,0,.22); }
.screen-toolbar p { margin: 0; font-size: 10.5pt; }
.screen-toolbar__actions { display: flex; gap: 8px; }
.screen-toolbar button, .screen-toolbar a { min-height: 42px; display: inline-flex; align-items: center; padding: 8px 13px; border: 1px solid rgba(255,255,255,.45); border-radius: 8px; background: transparent; color: #fff; text-decoration: none; cursor: pointer; font-weight: 700; }
.screen-toolbar button { background: #fff; color: var(--ink); }
.booklet { padding: 12mm 0; }
.page { position: relative; width: 210mm; height: 297mm; margin: 0 auto 12mm; padding: 14mm 15mm 14mm; overflow: hidden; background: #fff; box-shadow: 0 7px 28px rgba(24,37,56,.17); break-after: page; page-break-after: always; }
.page:last-child { break-after: auto; page-break-after: auto; }
.page::after { content: attr(data-page); position: absolute; right: 15mm; bottom: 7mm; min-width: 20mm; color: var(--muted); font-size: 9pt; font-weight: 700; text-align: right; white-space: nowrap; }
.page--cover { display: flex; flex-direction: column; background: var(--ink); color: #fff; }
.page--cover::after { color: rgba(255,255,255,.75); }
.cover-mark { width: max-content; padding: 2mm 3mm; border: .5mm solid currentColor; border-radius: 99px; text-transform: uppercase; letter-spacing: .12em; font-size: 9pt; font-weight: 800; }
.cover-title { margin: auto 0 5mm; max-width: 165mm; }
.cover-title p { max-width: 155mm; color: #dce5ec; font-size: 14pt; }
.cover-art { position: absolute; inset: 18mm 0 auto 35mm; width: 170mm; height: 115mm; color: rgba(255,255,255,.14); }
.cover-name { display: grid; grid-template-columns: auto 1fr; gap: 4mm; align-items: end; margin-bottom: 8mm; }
.cover-name span:last-child { border-bottom: .45mm solid rgba(255,255,255,.75); min-height: 9mm; }
.cover-footer { padding-top: 6mm; border-top: .35mm solid rgba(255,255,255,.25); color: #dce5ec; font-size: 10pt; }

.page-head { display: flex; align-items: start; justify-content: space-between; gap: 10mm; margin-bottom: 6mm; padding-bottom: 4mm; border-bottom: .7mm solid var(--ink); }
.page-head__number { flex: 0 0 auto; width: 12mm; height: 12mm; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 10pt; font-weight: 900; }
.page-head p { color: var(--muted); margin: 0; }
.instruction { padding: 4mm; margin: 4mm 0; border-left: 2mm solid var(--coral); background: var(--coral-soft); }
.theme-teal .instruction { border-left-color: var(--teal); background: var(--teal-soft); }
.instruction p:last-child { margin-bottom: 0; }
.task-number { display: inline-grid; place-items: center; width: 8mm; height: 8mm; margin-right: 2mm; border-radius: 50%; background: var(--ink); color: #fff; font-size: 9pt; font-weight: 900; }
.task { margin: 5mm 0; }
.task h3 { display: flex; align-items: center; }
.lines { display: grid; gap: 6.5mm; margin-top: 7mm; }
.lines span { display: block; border-bottom: .35mm solid var(--line); }
.lines--tight { gap: 5mm; margin-top: 5mm; }
.writing-box { min-height: 35mm; border: .4mm solid var(--line); border-radius: 3mm; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 8.5mm, #d8dde2 8.5mm, #d8dde2 8.85mm); }
.drawing-box { min-height: 62mm; border: .45mm solid var(--ink); border-radius: 3mm; background: #fff; }
.drawing-box--grid { background-image: linear-gradient(#d7dde3 .25mm, transparent .25mm), linear-gradient(90deg, #d7dde3 .25mm, transparent .25mm); background-size: 10mm 10mm; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.card { padding: 4mm; border: .4mm solid var(--line); border-radius: 3mm; }
.card h3, .card h4 { margin-bottom: 2mm; }
.card p:last-child { margin-bottom: 0; }
.word-card--wide { display: grid; grid-template-columns: auto 52mm 1fr; gap: 3mm; align-items: center; margin: 3mm 0; padding-block: 2.5mm; }
.word-card--wide .label, .word-card--wide h3, .word-card--wide p { margin: 0; }
.word-card-grid .card { padding: 3mm; }
.word-card-grid .drawing-box { min-height: 5mm !important; }
.task--compact { margin-block: 3mm; }
.label { display: inline-block; margin-bottom: 2mm; padding: 1mm 2mm; border-radius: 1.5mm; background: var(--soft); text-transform: uppercase; letter-spacing: .06em; font-size: 8.5pt; font-weight: 900; }
.word-bank { display: flex; flex-wrap: wrap; gap: 2mm; padding: 3mm; margin: 3mm 0; border: .4mm dashed var(--line); border-radius: 2mm; }
.word-bank span { padding: 1mm 2mm; background: var(--soft); border-radius: 99px; font-size: 9.5pt; font-weight: 700; }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding: 0 0 3mm 8mm; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .5mm; width: 5mm; height: 5mm; border: .45mm solid var(--ink); border-radius: 1mm; }
.choice-line { display: flex; flex-wrap: wrap; gap: 3mm 8mm; margin: 3mm 0; }
.choice-line span::before { content: "○"; margin-right: 1.5mm; font-size: 14pt; vertical-align: -1px; }
.mini-table { width: 100%; border-collapse: collapse; margin: 3mm 0; font-size: 10pt; }
.mini-table th, .mini-table td { padding: 2.6mm 2.5mm; border: .35mm solid var(--line); text-align: left; vertical-align: top; }
.mini-table th { background: var(--soft); }
.mini-table td:empty { height: 10mm; }
.prompt { font-weight: 800; }
.sentence { margin: 4mm 0; }
.sentence span { display: inline-block; min-width: 45mm; border-bottom: .35mm solid var(--line); }
.calibration { display: flex; align-items: center; gap: 4mm; margin: 3mm 0; color: var(--muted); font-size: 9pt; }
.calibration__line { position: relative; width: 50mm; height: 4mm; border-inline: .45mm solid var(--ink); border-bottom: .45mm solid var(--ink); }
.calibration__line::before { content: ""; position: absolute; left: 24.75mm; bottom: 0; height: 2mm; border-left: .35mm solid var(--ink); }
.cut-note { display: flex; gap: 5mm; margin-top: 3mm; font-size: 9pt; color: var(--muted); }
.cut-note span::before { content: ""; display: inline-block; width: 12mm; margin-right: 2mm; vertical-align: middle; border-top: .6mm solid var(--ink); }
.cut-note span:last-child::before { border-top-style: dashed; }
.net { display: block; margin: 4mm auto 0; }
.net .cut { fill: none; stroke: #121b28; stroke-width: .65; stroke-linejoin: round; }
.net .fold { stroke: #5e6875; stroke-width: .45; stroke-dasharray: 3 2; }
.net text { font-family: Arial, sans-serif; font-size: 4px; fill: #5e6875; text-anchor: middle; }
.safety { margin-top: 4mm; padding: 3mm; border: .45mm solid var(--ink); border-radius: 2mm; font-size: 9.5pt; }
.spotlight { display: grid; grid-template-columns: 18mm 1fr; gap: 4mm; align-items: start; margin: 4mm 0; padding: 3.5mm; border: .4mm solid var(--line); border-left: 2mm solid var(--gold); border-radius: 3mm; background: #fffaf0; }
.theme-teal .spotlight { border-left-color: var(--teal); background: var(--teal-soft); }
.spotlight--compact { grid-template-columns: 15mm 1fr; gap: 3mm; padding: 2.5mm 3mm; }
.spotlight--compact .spotlight__mark { width: 13mm; height: 13mm; font-size: 9pt; }
.spotlight--compact p { font-size: 8.8pt; }
.spotlight--slim { padding-block: 2mm; }
.spotlight--slim h3 { display: inline; margin-right: 2mm; }
.spotlight--slim .label { margin-bottom: 1mm; }
.spotlight__mark { width: 16mm; height: 16mm; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11pt; font-weight: 900; }
.spotlight h3 { margin: 0 0 1.5mm; }
.spotlight p { margin-bottom: 1.5mm; font-size: 9.5pt; }
.spotlight p:last-child { margin-bottom: 0; }
.source-note { color: var(--muted); font-size: 8pt !important; }
.source-note a { text-decoration: none; }
.page-tag { position: absolute; top: 0; right: 15mm; padding: 2mm 3mm; border-radius: 0 0 2mm 2mm; background: var(--coral); color: #fff; text-transform: uppercase; letter-spacing: .08em; font-size: 8pt; font-weight: 900; }
.theme-teal .page-tag { background: var(--teal); }
.shape-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3mm; margin: 4mm 0; }
.shape-tile { padding: 2mm; min-height: 35mm; display: grid; place-items: center; border: .35mm solid var(--line); border-radius: 2mm; text-align: center; font-size: 8.5pt; }
.shape-tile svg { width: 23mm; height: 20mm; }
.shape-tile polygon, .shape-tile rect { fill: none; stroke: var(--ink); stroke-width: 2; }
.graph-box { padding: 3mm; border: .4mm solid var(--line); border-radius: 3mm; }
.graph-svg { display: block; width: 100%; height: auto; }
.graph-svg line, .graph-svg path { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.graph-svg circle { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.graph-svg text { fill: var(--ink); font-family: Arial, sans-serif; font-size: 14px; font-weight: 700; text-anchor: middle; }
.map-svg path { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.map-svg circle { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.map-svg text { fill: var(--ink); font-family: Arial, sans-serif; font-size: 12px; font-weight: 700; text-anchor: middle; }
.route-record { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2mm; margin: 3mm 0; }
.route-record > div { min-height: 16mm; padding: 2mm; border: .35mm solid var(--line); border-radius: 2mm; font-size: 9pt; }
.degree-dot { display: inline-grid; width: 7mm; height: 7mm; margin-inline: 1mm; place-items: center; border: .4mm solid var(--ink); border-radius: 50%; font-weight: 800; }
.rubric { display: grid; gap: 2mm; }
.rubric > div { display: grid; grid-template-columns: 36mm 1fr; gap: 4mm; padding: 3mm; border: .35mm solid var(--line); border-radius: 2mm; }
.small { font-size: 9pt; color: var(--muted); }
.footer-note { position: absolute; bottom: 7mm; left: 15mm; max-width: 150mm; margin: 0; color: var(--muted); font-size: 8.5pt; }

@media screen and (max-width: 850px) {
  .screen-toolbar { align-items: flex-start; flex-direction: column; }
  .booklet { overflow-x: auto; padding-inline: 10px; }
  .page { transform-origin: top left; }
}

@media print {
  @page { size: A4; margin: 0; }
  :root { background: #fff; }
  .screen-toolbar { display: none !important; }
  .booklet { padding: 0; }
  .page { margin: 0; box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
