/* Book layout for a mixed IELTS unit (pilot, owner 12/11/2026). PROPOSED print components, not yet in the brand library:
   on the owner's yes they move into ~/Downloads/Mama/shared/brand/print.css with a row in guide/print.md.
   Load order: brand tokens.css, brand print.css, then this file. Only tokens here: no colour literal, no font name.
   Built from the conventions of real course books (Cullen's IELTS vocabulary book, Close-Up): two-column grid, sections that
   open with a coloured band and a picture, short lettered exercises, small answer boxes and inline gaps instead of writing
   space, a class book and a self-practice part, and the key, grammar reference and sources at the back.
   Colour version: class "print-colour" on <html> (the default for this book); black and white comes from the same file. */

@page { margin: 16mm 15mm 17mm 17mm;
  @top-right { content: string(unit) "   ·   " string(part); font-family: var(--font-sans); font-size: 7.5pt; color: var(--p-muted); }
  @bottom-right { content: counter(page); font-family: var(--font-sans); font-size: 9.5pt; font-weight: 700; } }
@page :left { margin: 16mm 17mm 17mm 15mm;
  @top-right { content: none; } @top-left { content: string(part) "   ·   " string(unit); font-family: var(--font-sans); font-size: 7.5pt; color: var(--p-muted); }
  @bottom-right { content: none; } @bottom-left { content: counter(page); font-family: var(--font-sans); font-size: 9.5pt; font-weight: 700; } }
@page opener { margin: 0; @top-right { content: none; } @top-left { content: none; } @bottom-right { content: none; } @bottom-left { content: none; } }

html { background: none; }
body.p-page { background: none; }
* { box-sizing: border-box; }
body.p-page { margin: 0; font-size: 9.4pt; line-height: 1.42; }
b { font-weight: 700; }
i { font-style: italic; }
.pg { break-before: page; }
.part { string-set: part content(); height: 0; overflow: hidden; margin: 0; }

/* ── Unit opener (full page) */
.opener { page: opener; height: 297mm; display: flex; flex-direction: column; }
.opener__top { background: var(--p-accent); padding: 22mm 17mm 10mm; display: flex; gap: 8mm; align-items: flex-end; }
.opener__no { font-family: var(--font-display); font-variation-settings: 'SOFT' 100, 'WONK' 0; font-weight: 800; font-size: 96pt; line-height: .8; }
.opener__t { flex: 1; }
.opener__unit { font-size: 9pt; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.opener .p-h1 { font-size: 34pt; margin: 1mm 0 1mm; string-set: unit content(); }
.opener__en { font-size: 13pt; font-weight: 500; margin: 0; }
.opener__art { flex: none; width: 52mm; height: 52mm; border-radius: var(--p-radius); overflow: hidden; }
.opener__art img { width: 52mm; height: 52mm; display: block; }
.opener__body { flex: 1; padding: 10mm 17mm 12mm; }
.ou-list { columns: 2; column-gap: 9mm; }
.opener__body h3 { font-size: 10pt; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 3mm; }
.ou { display: flex; gap: 3mm; padding: 2.6mm 0; border-top: var(--p-hair) solid var(--p-rule); break-inside: avoid; }
.ou__no { flex: none; width: 8mm; height: 8mm; line-height: 8mm; text-align: center; border-radius: 50%; background: var(--p-ink); color: var(--p-ground); font-weight: 800; font-size: 10pt; }
.ou b { display: block; font-size: 10.5pt; } .ou span { font-size: 8.8pt; color: var(--p-muted); }
.legend { margin-top: 8mm; display: flex; gap: 6mm; font-size: 8.8pt; }
.legend > div { flex: 1; background: var(--p-field); border-radius: var(--p-radius); padding: 3mm 4mm; }
.legend img { width: 4.6mm; height: 4.6mm; vertical-align: -1.2mm; margin-right: 1mm; }

/* ── Section start: coloured band with a picture */
.band { column-span: all; break-inside: avoid; display: flex; align-items: stretch; margin: 0 0 5mm; border-radius: var(--p-radius); overflow: hidden; background: var(--p-accent); break-after: avoid; }
.band__no { flex: none; width: 15mm; display: flex; align-items: center; justify-content: center; background: var(--p-ink); color: var(--p-ground); font-weight: 800; font-size: 17pt; }
.band__t { flex: 1; padding: 3.5mm 5mm 3mm; }
.band .p-h2 { margin: 0; font-size: 20pt; }
.band__sub { font-size: 9pt; font-weight: 500; }
.band__art { flex: none; width: 27mm; height: 27mm; }
.band__art img { width: 27mm; height: 27mm; display: block; }
.part-band { column-span: all; background: var(--p-ink); color: var(--p-ground); border-radius: var(--p-radius); padding: 5mm 6mm; margin: 0 0 5mm; display: flex; gap: 5mm; align-items: center; }
.part-band .p-h2 { margin: 0; font-size: 22pt; }
.part-band p { margin: 1mm 0 0; font-size: 9pt; }
.part-band img { width: 13mm; height: 13mm; flex: none; }

/* ── Two-column body */
.cols { columns: 2; column-gap: 7mm; column-rule: var(--p-hair) solid var(--p-rule); }
.w { column-span: all; }

/* ── Exercise head: letter tag, short instruction, book marker, audio */
.ex { margin: 0 0 4.5mm; }
.ex.keep { break-inside: avoid; }
.exh { display: flex; gap: 2.4mm; align-items: flex-start; margin: 0 0 2mm; break-after: avoid; break-inside: avoid; }
.exh__no { flex: none; min-width: 7.5mm; height: 6.2mm; line-height: 6.2mm; text-align: center; border-radius: 1.2mm; background: var(--p-accent); font-weight: 800; font-size: 9pt; padding: 0 1mm; }
.exh__in { flex: 1; font-weight: 700; font-size: 9.6pt; line-height: 1.35; padding-top: .4mm; }
.exh__in .lab { font-size: 7pt; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--p-muted); display: block; margin-bottom: .3mm; }
.bm { display: inline-block; font-size: 7.2pt; font-weight: 700; border: var(--p-hair) solid var(--p-ink); border-radius: 1mm; padding: 0 1.4mm 0 .5mm; margin-left: 1.5mm; white-space: nowrap; }
.bm img { width: 3.4mm; height: 3.4mm; vertical-align: -.8mm; margin-right: .6mm; }
.au { display: inline-block; font-size: 7.2pt; font-weight: 800; border-radius: 3mm; padding: 0 2mm; margin-left: 1.5mm; background: var(--p-ink); color: var(--p-ground); white-space: nowrap; }
.sub { font-weight: 700; font-size: 9pt; margin: 2.4mm 0 1mm; break-after: avoid; }

/* ── Small parts: answer box, gap, tick, word box, note */
.box { display: inline-block; width: 5.6mm; height: 5.2mm; border: var(--p-line) solid var(--p-ink); border-radius: .9mm; vertical-align: -1.4mm; }
.gap { display: inline-block; min-width: 18mm; border-bottom: var(--p-line) solid var(--p-ink); height: 3.6mm; vertical-align: -.6mm; }
.gap.s { min-width: 11mm; } .gap.wide { min-width: 34mm; } .gap.xl { min-width: 62mm; }   /* never a class "l" on a gap: .l is a numbered line of a sheet */
.gl { font-size: 7.4pt; font-weight: 800; }
.tk { display: inline-block; width: 3.6mm; height: 3.6mm; border: var(--p-line) solid var(--p-ink); border-radius: .6mm; margin-right: 1.6mm; vertical-align: -.6mm; }
.words { background: var(--p-field); border-radius: var(--p-radius); padding: 2mm 3.5mm; margin: 0 0 2.5mm; font-weight: 700; text-align: center; word-spacing: .1em; line-height: 1.6; }
.note { background: var(--p-field); border-radius: var(--p-radius); padding: 3mm 4mm 2.4mm; margin: 0 0 4.5mm; font-size: 8.8pt; break-inside: avoid; }
.note h4 { margin: 0 0 1.2mm; font-size: 9.4pt; font-weight: 800; }
.note h4 .ic { display: inline-block; width: 5mm; height: 5mm; line-height: 5mm; text-align: center; border-radius: 50%; background: var(--p-ink); color: var(--p-ground); font-size: 7.6pt; margin-right: 1.6mm; }
.note p { margin: 0 0 1.4mm; } .note s { color: var(--p-muted); }
.note.skill { background: var(--p-accent); }
.note table { width: 100%; border-collapse: collapse; } .note td { padding: 1.1mm 2.5mm 1.1mm 0; vertical-align: top; border-top: var(--p-hair) solid var(--p-rule); } .note tr:first-child td { border-top: 0; }

/* ── Lists */
ol.q { margin: 0; padding-left: 5mm; } ol.q > li { margin: 0 0 1.7mm; padding-left: .8mm; break-inside: avoid; } ol.q > li::marker { font-weight: 800; }
.opts { margin: .6mm 0 0; } .opts div { margin: .2mm 0; } .opts b { display: inline-block; width: 4.5mm; }
.tickgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4mm 4mm; }
.ml { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0 6mm; }
.ml .it { display: flex; gap: 2mm; align-items: flex-start; margin: 0 0 1.8mm; break-inside: avoid; } .ml .it b { flex: none; width: 4mm; } .ml .it .box { flex: none; margin-top: -.6mm; }

/* ── Tables */
.tb { width: 100%; border-collapse: collapse; font-size: 8.9pt; margin: 0 0 1mm; }
.tb th { text-align: left; font-size: 7.6pt; font-weight: 800; padding: 1.4mm 2mm; background: var(--p-field); }
.tb td { padding: 0 2mm; height: 8.2mm; border-bottom: var(--p-hair) solid var(--p-rule); vertical-align: middle; }
.tb td.n { width: 6mm; color: var(--p-muted); font-size: 7.6pt; }
.tb td.wd { font-weight: 700; }
.tb tr.ex td { font-style: italic; color: var(--p-muted); } .tb tr.ex td.wd { font-style: normal; color: var(--p-ink); }
.tb.auto td { height: auto; padding: 1.5mm 2mm; vertical-align: top; }
.tb.tall td { height: 20mm; vertical-align: top; padding-top: 1.6mm; }
.tb .c { text-align: center; }
.pron { width: 100%; border-collapse: collapse; } .pron td { padding: .9mm 0; width: 25%; } .pron b { display: inline-block; width: 5.5mm; }

/* ── Numbered-line texts (number every fifth line, in the margin) */
.lines { font-size: 8.9pt; }
.l { display: flex; height: 4.85mm; line-height: 4.85mm; white-space: nowrap; } .l.p1 { margin-top: 1.4mm; } .lines .l:first-child { margin-top: 0; }
.l .no { flex: none; width: 6mm; font-size: 6.8pt; color: var(--p-muted); text-align: right; padding-right: 2mm; }
.l .tx { flex: 1; min-width: 0; }
.pb { flex: none; width: 8mm; height: 4.4mm; margin: .2mm 0 0 2mm; border: var(--p-line) solid var(--p-ink); border-radius: .8mm; }
.nw { font-style: italic; } .ref { border: var(--p-line) solid var(--p-ink); border-radius: 50%; padding: 0 1mm; }
u.mis { text-decoration: underline; text-decoration-thickness: .8pt; text-underline-offset: 1.2pt; } sup { font-size: 6.2pt; font-weight: 700; }
.rs { display: grid; grid-template-columns: 1fr 50mm; gap: 5mm; align-items: start; }
.aid { width: 100%; border-collapse: collapse; font-size: 7.7pt; line-height: 1.28; }
.aid th { text-align: left; font-size: 6.8pt; font-weight: 800; padding: 1mm; background: var(--p-field); }
.aid td { padding: 1mm; border-bottom: var(--p-hair) solid var(--p-rule); vertical-align: top; } .aid td:first-child { color: var(--p-muted); width: 6mm; } .aid .f { color: var(--p-muted); width: 6mm; }
.notes2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 6mm; align-items: start; }
.title2 { font-family: var(--font-display); font-variation-settings: 'SOFT' 100, 'WONK' 0; font-weight: 700; font-size: 18pt; margin: 0 0 2mm; }
.cutl { display: flex; gap: 2.5mm; height: 6.6mm; line-height: 6.6mm; border-bottom: var(--p-line) solid var(--p-ink); font-size: 8.9pt; } .cutl span { flex: none; width: 4mm; font-size: 7pt; color: var(--p-muted); } .cutl.d { font-style: italic; }
.cuth { font-size: 7.8pt; font-weight: 700; color: var(--p-muted); margin: 2mm 0 .4mm; }
.pf { font-size: 7.6pt; color: var(--p-muted); white-space: nowrap; } .pf .gap { min-width: 7mm; }

/* ── Exam material keeps the exam's own plain look, in one frame */
.exam { border: var(--p-line) solid var(--p-ink); border-radius: var(--p-radius); padding: 3.4mm 4.5mm; font-size: 8.9pt; margin: 0 0 4mm; }
.exam h5 { margin: 0 0 1.6mm; font-size: 9.6pt; font-weight: 800; letter-spacing: .04em; }
.exam p { margin: 0 0 1.3mm; } .exam .qi { font-style: italic; margin-top: 2.4mm; }
.ebox { border: var(--p-hair) solid var(--p-ink); padding: 2mm 3.5mm; margin: 1.5mm 0 2.4mm; } .ebox div { margin: .2mm 0; }
.eq { margin: 1.8mm 0; break-inside: avoid; } .eq .opts { margin-left: 5mm; }
.dots { color: var(--p-muted); }
.yn td { padding: .2mm 4mm .2mm 0; font-size: 8.6pt; }
.chart { width: 100%; height: auto; color: var(--p-ink); }
.ctitle { text-align: center; font-weight: 700; margin: 2mm 0 1mm; font-size: 8.8pt; }

/* ── Writing: rewrite items */
.rw { margin: 0 0 3mm; break-inside: avoid; } .rw .kw { font-weight: 800; letter-spacing: .06em; margin: .4mm 0; }
.fix { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5mm 6mm; margin-top: 2mm; }

/* ── Speaking card */
.card { border: var(--p-line) solid var(--p-ink); border-radius: var(--p-radius); overflow: hidden; margin: 0 0 4.5mm; break-inside: avoid; }
.card > div { padding: 2mm 3.5mm; border-top: var(--p-hair) solid var(--p-rule); font-size: 8.8pt; }
.card .k { display: block; font-size: 6.9pt; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--p-muted); margin-bottom: .3mm; }
.card .cq { background: var(--p-ink); color: var(--p-ground); font-weight: 700; font-size: 10pt; border-top: 0; } .card .cq .k { color: var(--p-ground); }
.card .two { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.card .st { background: var(--p-field); }

/* ── Pictures inside the columns */
.pic { break-inside: avoid; margin: 0 0 4mm; text-align: center; } .pic img { width: 44mm; height: 44mm; border-radius: var(--p-radius); }
.pic p { margin: 1mm 0 0; font-size: 8pt; font-style: italic; color: var(--p-muted); }

/* ── Self-practice (the book, as printed) */
.ln { border-bottom: var(--p-line) solid var(--p-ink); height: 7.2mm; }
.bk-pass { columns: 2; column-gap: 6mm; font-size: 8.6pt; text-align: justify; hyphens: auto; border-top: var(--p-hair) solid var(--p-rule); border-bottom: var(--p-hair) solid var(--p-rule); padding: 2.5mm 0; margin: 0 0 3mm; }
.bk-pass p { margin: 0 0 1.5mm; }
.speech { display: inline-block; background: var(--p-field); border-radius: 3mm; padding: 1mm 3mm; margin: 0 2mm 1.6mm 0; font-size: 8.6pt; }

/* ── Back of the book */
.back h3 { font-family: var(--font-sans); font-size: 11pt; font-weight: 800; margin: 0 0 2mm; }
.kh { font-size: 8.6pt; font-weight: 800; margin: 2.6mm 0 .6mm; break-after: avoid; } .kp { margin: 0 0 .8mm; font-size: 8.2pt; line-height: 1.38; }
.src td { font-size: 8pt; } .src td:first-child { width: 14mm; font-weight: 700; }
