/* Open World Classroom library site (references/design/BRAND.md), on the "Field Map" layout (SITE_REDESIGN.md).
   Fonts, the --pp-* tokens, header, footer and buttons live in site-tokens.css (shared with make.html and
   create.html). This file maps the short token names and styles the library pages. */
:root {
  --ground: var(--pp-ground); --paper: var(--pp-paper); --ink: var(--pp-ink); --muted: var(--pp-muted); --line: var(--pp-line);
  --sky: var(--pp-sky); --canola: var(--pp-canola);
  --math: var(--pp-math); --math-field: var(--pp-math-field); --math-field-2: var(--pp-math-field-2);
  --english: var(--pp-eng); --english-field: var(--pp-eng-field); --english-field-2: var(--pp-eng-field-2);
  --arabic: var(--pp-ar); --arabic-field: var(--pp-ar-field); --arabic-field-2: var(--pp-ar-field-2);
  --member: var(--pp-member);
  --rule: var(--pp-rule); --sheet-shadow: var(--pp-sheet-shadow);
  --sans: var(--pp-sans); --display: var(--pp-display); --ar: var(--pp-arabic);
  --gutter: var(--pp-gut);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.wrap { max-width: var(--pp-wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[lang=ar] { font-family: var(--ar); }
[hidden] { display: none !important; }
main:focus, h1:focus { outline: none; }
.loading { padding: 80px var(--gutter); color: var(--muted); }
.muted { color: var(--muted); }
.disp, h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.04; margin: 0; }
.label, .eyebrow { font: 700 12px/1.3 var(--sans); letter-spacing: .11em; text-transform: uppercase; margin: 0; }
.code { font: 700 13.5px/1.2 var(--sans); letter-spacing: .02em; color: var(--ink); } /* not monospace: Consolas and Cascadia slash the zero */
.more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; white-space: nowrap; }
.more svg { width: 16px; height: 16px; }
.math-bg { background: var(--math); } .english-bg { background: var(--english); } .arabic-bg { background: var(--arabic); }
/* A subject sets --f (field), --f2 (second tone) and --c (strong colour) for everything inside it. */
.f-math { --f: var(--math-field); --f2: var(--math-field-2); --c: var(--math); }
.f-english { --f: var(--english-field); --f2: var(--english-field-2); --c: var(--english); }
.f-arabic, .f-somali { --f: var(--arabic-field); --f2: var(--arabic-field-2); --c: var(--arabic); }
.f-french { --f: var(--english-field); --f2: var(--english-field-2); --c: var(--english); }
/* French (coverage page only for now, Rules F0) shares the languages colour with Arabic until the brand gives it its own. */
.f-french { --f: var(--arabic-field); --f2: var(--arabic-field-2); --c: var(--arabic); }
.french-bg { background: var(--arabic); } .sdot.french-bg { background: var(--arabic-field); }

/* ---------- header extras (mega panels and the drawer; base styles in site-tokens.css) ---------- */
.drawer-head { display: none; }
.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--ground); border-bottom: var(--rule); max-height: calc(100vh - 90px); overflow: auto; }
.mega-inner { max-width: var(--pp-wrap); margin: 0 auto; padding: 22px var(--gutter) 26px; }
.mega-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.mega-head p { margin: 0; color: var(--muted); font-size: 14px; }
.mega-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: var(--rule); border-left: var(--rule); }
.mega-col { min-width: 0; padding: 10px 12px 12px; border-right: var(--rule); border-bottom: var(--rule); }
.mega-col h3 { margin: 0 0 4px; font: 800 19px/1.15 var(--display); letter-spacing: -.01em; }
.mega-col h3 a { display: flex; align-items: center; min-height: 40px; text-decoration: none; }
.mega-col h3 a:hover { text-decoration: underline; }
.mega-col ul { list-style: none; margin: 0; padding: 0; }
.mega-col li a { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 2px 0; font-size: 14.5px; line-height: 1.25; text-decoration: none; }
.mega-col li a:hover { text-decoration: underline; }
.mega-col .n { margin-left: auto; padding-left: 6px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.mega-col .topics-ex { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.mega .soon-note { margin: 4px 0; }
.sdot { display: inline-block; flex: none; width: 11px; height: 11px; border: 1.5px solid var(--ink); }
.sdot.math-bg { background: var(--math-field); } .sdot.english-bg { background: var(--english-field); } .sdot.arabic-bg, .sdot.somali-bg { background: var(--arabic-field); } .sdot.french-bg { background: var(--english-field); }
.pill-note { display: inline-flex; align-items: center; padding: 3px 10px; border: 1.5px dashed var(--ink); background: var(--paper); font: 700 13px/1.3 var(--sans); }
.soon { font-weight: 600; color: var(--muted); font-size: .85em; }

/* ---------- section heads: a table-of-contents line ---------- */
.sec { padding: 56px 0 8px; }
.sec-h { display: flex; align-items: baseline; gap: 16px; margin: 0 0 20px; }
.sec-h h2 { font-size: 32px; line-height: 1.05; }
.sec-h .fill { flex: 1; border-bottom: 2px dotted var(--ink); transform: translateY(-6px); }

/* ---------- home: sky hero and horizon ---------- */
.hero { background: var(--sky); padding: 52px 0 0; overflow: hidden; }
.hero .cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: end; }
.hero h1 { margin: 12px 0 18px; font-size: clamp(2.5rem, 6.2vw, 5.4rem); line-height: 1.02; max-width: 15ch; }
.hl, .hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--canola) 62% 92%, transparent 92%); }
/* Open World Classroom: the headline's highlighter is one hand-pulled swipe (ragged ends, a slight rise), not a ruled band;
   it repeats per line when the words wrap. */
.hero h1 em, .bhead h1 q {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M4 15C30 10 62 13 98 9s70-3 98-4c-1 4 2 8-1 12 2 5-1 9 1 14-36 2-70-1-104 3S30 36 6 37c2-5-3-8 0-12-2-4 1-6-2-10Z' fill='%23F4C52E'/%3E%3C/svg%3E") left bottom 6% / 100% 40% no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .04em;
}
/* the one place the home page names a region: a fact about coverage, not part of the brand */
.region-line { margin: -8px 0 20px; font-size: .98rem; }
.region-line a { margin-left: 4px; font-weight: 600; white-space: nowrap; }
.region-line .pin { display: inline-block; width: 11px; height: 11px; margin-right: 8px; border: 2px solid var(--ink); border-radius: 50%; background: var(--canola); vertical-align: -1px; }
/* the home headline is shorter than the old one: centre the two columns so it doesn't sit low on its own */
@media (min-width: 1001px) { .hero .cols { align-items: center; } .hero h1 { margin-bottom: 0; } }
.hero .lead { margin: 0 0 22px; max-width: 44ch; font-size: 1.2rem; }
.hero .draft-note { margin: -10px 0 18px; }
.draft-note { font-size: 14px; color: var(--muted); }
.find { display: flex; max-width: 560px; border: var(--rule); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); }
.find:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.find input { flex: 1; min-width: 0; height: 58px; padding: 0 16px; border: 0; background: none; color: var(--ink); font: 400 1.1rem var(--sans); }
.find input:focus { outline: none; }
.find input::placeholder { color: var(--muted); opacity: 1; }
.find button { border: 0; border-left: var(--rule); background: var(--canola); color: var(--ink); padding: 0 22px; font: 700 1.05rem var(--sans); cursor: pointer; }
.find button.ink { background: var(--ink); color: var(--ground); }
.find button:focus-visible { outline: 3px solid var(--ink); outline-offset: -6px; }
.find button.ink:focus-visible { outline-color: var(--canola); }
.try { margin: 12px 0 22px; font-size: .95rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.try a { display: inline-flex; align-items: center; min-height: 40px; font-weight: 600; }
.horizon { position: relative; height: 96px; margin-top: 4px; }
.horizon svg, .horizon img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- home: the field map ---------- */
.map-wrap { position: relative; }
.map { display: grid; grid-template-columns: 150px repeat(7, minmax(0, 1fr)); border-left: var(--rule); border-top: var(--rule); margin-top: -1.5px; }
.map > * { min-width: 0; border-right: var(--rule); border-bottom: var(--rule); }
.map .corner { padding: 10px 12px; background: var(--ground); color: var(--muted); font-size: .8rem; line-height: 1.3; }
.map .gh { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px 6px; background: var(--ground); font: 800 2.1rem/1 var(--display); text-decoration: none; }
.map .gh small { font: 600 .78rem var(--sans); color: var(--muted); }
.map .gh:hover small { text-decoration: underline; }
.map .sh { display: flex; flex-direction: column; justify-content: center; padding: 12px; background: var(--ground); text-decoration: none; }
.map .sh b { font: 800 1.35rem/1.1 var(--display); letter-spacing: -.01em; }
.map .sh b [lang=ar] { font: 600 .8em var(--ar); }
.map .sh span { font-size: .82rem; color: var(--muted); }
.map .sh:hover b { text-decoration: underline; }
.map .sh.is-soon { cursor: default; }
.map .sh.is-soon:hover b { text-decoration: none; }
.cell { position: relative; display: block; height: 112px; overflow: hidden; background: var(--f); text-decoration: none; }
.cell svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cell .n { position: absolute; left: 10px; bottom: 8px; padding: 2px 8px 1px; border: var(--rule); background: var(--paper); font: 800 1.25rem/1.2 var(--display); transition: transform .15s, box-shadow .15s; }
.cell .n small { margin-left: 4px; font: 600 .72rem var(--sans); }
a.cell:hover .n, a.cell:focus-visible .n { transform: translate(-2px, -4px) rotate(-3deg); box-shadow: 3px 3px 0 var(--ink); }
a.cell:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; }
.cell.fallow, .cell.none { background: var(--ground); }
.cell.fallow .n, .cell.none .n { border-style: dashed; font: 600 .78rem/1.5 var(--sans); }
.cell.none .n { color: var(--muted); }
.cell.soonrow { grid-column: span 7; height: auto; min-height: 64px; display: flex; align-items: center; padding: 10px 14px; background: var(--ground); }
.cell.soonrow .n { position: static; border-style: dashed; font: 600 .9rem/1.5 var(--sans); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 12px 0 0; color: var(--muted); font-size: .85rem; }
.legend span { display: inline-flex; align-items: center; }
.legend i { display: inline-block; width: 26px; height: 14px; margin-right: 6px; border: var(--rule); }

/* ---------- cards: a white page lying on its field ---------- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: var(--rule); border-left: var(--rule); }
.card { display: flex; flex-direction: column; min-width: 0; border-right: var(--rule); border-bottom: var(--rule); background: var(--ground); color: var(--ink); text-decoration: none; }
.card:focus-visible { outline: 3px solid var(--ink); outline-offset: -6px; }
.card:focus-visible .ctitle, .card:hover .ctitle { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.plot { position: relative; height: 250px; overflow: hidden; border-bottom: var(--rule); background: var(--hatch, none) center / cover no-repeat, var(--f); }
.plot.t2 { background-color: var(--f2); }
.plot img, .plot .placeholder { position: absolute; left: 9%; top: 22px; width: 82%; height: auto; aspect-ratio: 600 / 777; background: #fff; box-shadow: var(--sheet-shadow); transition: transform .22s cubic-bezier(.2, .7, .2, 1); }
.card:hover .plot img, .card:focus-visible .plot img { transform: translateY(-12px); }
.plot .tag { position: absolute; left: 0; bottom: 0; padding: 3px 9px; background: var(--ink); color: var(--ground); font: 700 .72rem/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.plot .draft { position: absolute; right: 8px; top: 8px; padding: 1px 8px; border: 1.5px dashed var(--ink); background: var(--paper); font: 700 .72rem/1.5 var(--sans); transform: rotate(3deg); }
.placeholder { display: grid; place-items: center; padding: 12px; color: var(--muted); font-size: 13px; text-align: center; background: repeating-linear-gradient(0deg, #fff 0 22px, #F4F1EA 22px 23px); }
.cbody { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 14px 16px 16px; }
.ctitle { margin: 0; font: 700 1.06rem/1.28 var(--sans); }
.ctitle .ar { display: block; font: 600 1.2rem/1.6 var(--ar); direction: rtl; text-align: right; }
.csub { margin: -2px 0 0; color: var(--muted); font-size: 13.5px; }
.cmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: auto; padding-top: 6px; color: var(--muted); font-size: .85rem; }
.cmeta .code { font-size: .85rem; }
.stars { color: var(--ink); letter-spacing: 1px; white-space: nowrap; }
.stars i { font-style: normal; opacity: .38; }
.tick { display: inline-flex; align-items: center; }
.tick::before { content: ""; display: inline-block; width: 15px; height: 12px; margin-right: 4px; background: var(--pp-tick-red) no-repeat; }
.fit-partial { display: inline-flex; align-items: center; gap: 5px; padding: 0 6px; border: 1.5px dashed var(--ink); color: var(--ink); font-size: .85em; font-weight: 600; white-space: nowrap; }
.colour-chip { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); font: 700 11.5px/1.3 var(--sans); }
.cdots { display: inline-flex; gap: 2px; }
.cdots i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #D9482B; }
.cdots i:nth-child(2) { background: #2F6DB5; } .cdots i:nth-child(3) { background: #F2C230; } .cdots i:nth-child(4) { background: #3F9B5B; }
.card.member .plot::after { content: "Members"; position: absolute; right: 8px; top: 8px; padding: 1px 8px; background: var(--member); color: #fff; font: 700 .72rem/1.5 var(--sans); }

/* ---------- home: make band and the planted ledger ---------- */
.make-band { margin-top: 56px; background: var(--canola); border-block: var(--rule); overflow: hidden; }
.make-band .wrap { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: end; padding-top: 52px; }
.make-band .left { padding-bottom: 52px; }
.make-band h2 { margin: 10px 0 10px; font-size: clamp(2rem, 4.2vw, 3.3rem); max-width: 18ch; }
.make-band p { margin: 0 0 18px; max-width: 46ch; font-size: 1.08rem; }
.make-band .find { box-shadow: 4px 4px 0 var(--ink); }
.make-band .feed { position: relative; height: 300px; }
.make-band .feed img { position: absolute; left: 10%; top: 34px; width: 74%; height: auto; aspect-ratio: 600 / 777; box-shadow: var(--sheet-shadow); transform: rotate(-2.5deg); background: #fff; }
.make-band .feed img + img { left: 22%; top: 70px; transform: rotate(3deg); }
.badge { display: inline-flex; align-items: center; gap: 6px; margin: 14px 8px 0 0; padding: 3px 10px; border: var(--rule); background: var(--paper); font-size: .85rem; font-weight: 600; }
.ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: var(--rule); border-left: var(--rule); }
.ledger > div { padding: 20px; border-right: var(--rule); border-bottom: var(--rule); }
.ledger h3 { margin: 0; font: 800 1.5rem/1.1 var(--display); }
.ledger .big { margin: 10px 0 2px; font: 800 3.2rem/1 var(--display); }
.ledger .big small { font: 600 1rem var(--sans); }
.ledger p { margin: 0; color: var(--muted); font-size: .92rem; }
.plots { display: flex; flex-wrap: wrap; gap: 2px; margin: 14px 0 10px; }
.plots i, .plots a { display: block; width: 10px; height: 10px; border: 1px solid var(--ink); background: var(--paper); }
.plots .full { background: var(--c); }
.plots .set { background: repeating-linear-gradient(135deg, var(--c) 0 2px, var(--paper) 2px 4px); }
.plots .part { background: linear-gradient(135deg, var(--c) 50%, var(--paper) 50%); }
.cov-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; color: var(--muted); font-size: .88rem; }
.cov-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cov-legend .plots { margin: 0; }

/* ---------- breadcrumbs and page heads ---------- */
.crumbs { padding: 16px 0 0; color: var(--muted); font-size: 14px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: 0; padding: 0; }
.crumbs li { display: flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "›"; margin-right: 8px; }
.crumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; color: var(--muted); }
.crumbs [aria-current] { overflow: hidden; max-width: 60vw; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.bhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; padding: 6px 0 4px; }
.bhead h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); }
.bhead h1 q { quotes: "“" "”"; } /* its highlighter swipe is with the hero headline above */
.bhead h1 [lang=ar] { font: 600 .55em var(--ar); letter-spacing: 0; }
.bhead p { margin: 8px 0 0; max-width: 70ch; font-size: 17px; }
.bhead .sub { color: var(--ink); }

/* ---------- browse and search ---------- */
.strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin: 22px 0 0; border-top: var(--rule); border-left: var(--rule); }
.strip button { display: flex; align-items: baseline; gap: 8px; min-width: 0; min-height: 52px; padding: 8px 12px; border: 0; border-right: var(--rule); border-bottom: var(--rule); background: var(--ground); color: var(--ink); font: 800 1.7rem/1.1 var(--display); text-align: left; cursor: pointer; }
.strip button small { font: 600 .8rem var(--sans); color: var(--muted); }
.strip button:hover { background: #FBF7EC; }
.strip button[aria-pressed=true] { background: var(--ink); color: var(--ground); }
.strip button[aria-pressed=true] small { color: var(--ground); }
.strip button.zero { color: var(--muted); }
.strip button.zero small { color: var(--muted); }
.strip button.all { font: 700 1rem/1.9 var(--sans); }
.strip button:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; }
.strip button[aria-pressed=true]:focus-visible { outline-color: var(--canola); }
.topics { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; margin: 16px 0 0; padding: 2px 2px 6px; scrollbar-width: thin; }
.topic { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border: var(--rule); background: var(--paper); color: var(--ink); font: 600 14.5px/1 var(--sans); white-space: nowrap; cursor: pointer; }
.topic .n { color: var(--muted); font-weight: 500; }
.topic[aria-pressed=true] { background: var(--ink); color: var(--ground); }
.topic[aria-pressed=true] .n { color: var(--ground); }
.browse { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 24px 0 16px; }
.filters { position: sticky; top: 16px; align-self: start; border: var(--rule); background: var(--ground); }
.filters-head { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: var(--ground); }
.filters-head h2 { margin: 0; padding: 10px 14px; font: 700 12px/1.3 var(--sans); letter-spacing: .11em; text-transform: uppercase; }
.filters-head h2:focus { outline: 3px solid var(--canola); outline-offset: -3px; }
.sheet-close, .sheet-foot { display: none; }
.fgroup { min-width: 0; margin: 0; padding: 12px 14px; border: 0; border-top: var(--rule); }
.filters-head + .fgroup { border-top: 0; }
.fgroup legend { float: left; width: 100%; margin: 0 0 6px; padding: 0; font-weight: 700; }
.fgroup legend + * { clear: both; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; cursor: pointer; clear: both; }
.check input { appearance: none; -webkit-appearance: none; flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin: 0; border: var(--rule); background: var(--paper); cursor: pointer; }
.check input[type=radio] { border-radius: 50%; }
.check input:checked::after { content: ""; width: 15px; height: 12px; background: var(--pp-tick-ink) no-repeat; }
.check input[type=radio]:checked::after { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.check input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.check .lbl { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.check .n { margin-left: auto; color: var(--muted); font-size: .85rem; }
.fnote { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.f-topic { display: none; }
.rbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.rbar .count { margin: 0; color: var(--muted); font-size: 15px; }
.rbar .count b { color: var(--ink); }
.rbar .ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
select { min-height: 44px; padding: 0 10px; border: var(--rule); border-radius: 0; background: var(--paper); color: var(--ink); font: 600 14.5px var(--sans); }
.filter-btn { display: none; }
.applied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.achip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 14px; border: var(--rule); background: var(--paper); color: var(--ink); font: 600 14px var(--sans); cursor: pointer; }
.achip svg { width: 14px; height: 14px; }
.achip:hover { background: #FBF7EC; }
.link-btn { min-height: 44px; min-width: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink); font: 600 15px var(--sans); text-decoration: underline; cursor: pointer; }
.browse .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grp { margin-bottom: 36px; }
.grp-h { display: flex; align-items: baseline; gap: 14px; margin: 0 0 12px; }
.grp-h .num { font: 800 3rem/.9 var(--display); letter-spacing: -.02em; }
.grp-h .num.word { font-size: 1.6rem; line-height: 1.1; }
.grp-h b { font-size: 1.05rem; }
.grp-h .gsub { color: var(--muted); font-size: .9rem; }
.grp-h .fill { flex: 1; min-width: 20px; border-bottom: 2px dotted var(--ink); transform: translateY(-6px); }
.grp-more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--ink); font: 700 15px var(--sans); text-decoration: underline; cursor: pointer; }
.grp-more svg { width: 16px; height: 16px; }
.loadmore { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 30px; color: var(--muted); font-size: 14px; }
.loadmore .pp-btn { min-width: 220px; }
.showing-for { margin: 0 0 14px; }
.empty { position: relative; padding: 26px 28px; border: 1.5px dashed var(--ink); background: var(--ground); }
.empty h2 { margin: 0 0 8px; font-size: 26px; }
.empty p { margin: 0 0 12px; color: var(--muted); }
.empty ul { margin: 12px 0 0; padding-left: 20px; }
.empty li { margin: 6px 0; }
.empty .popular { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.empty .popular > span { flex-basis: 100%; }
.empty .popular a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; padding: 0 12px; border: var(--rule); background: var(--paper); color: var(--ink); text-decoration: none; }
.empty .popular a:hover { text-decoration: underline; }
.empty.nograde { margin-bottom: 24px; }
.closest-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; font-size: 24px; }
.closest-h .n { color: var(--muted); font: 600 14px var(--sans); }
.spot { float: right; width: 120px; height: 90px; margin: 0 0 8px 16px; } /* meadowlark slot, off until the drawing is approved */

/* ---------- resource page ---------- */
.res { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); margin-top: 10px; border: var(--rule); }
.res.rtl { direction: rtl; }
.res.rtl .info { direction: ltr; }
/* The stage ends with the sheet and stays in view while the details scroll (critic R1 fix 6: no dead hatch). */
.viewer { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding: 40px 40px 0; background: var(--hatch, none) center / cover no-repeat, var(--f); }
.viewer.t2 { background-color: var(--f2); }
.res > .info { border-left: var(--rule); }
.res.rtl > .info { border-left: 0; border-right: var(--rule); }
.viewer .p2 { position: absolute; right: 5%; top: 64px; width: 62%; height: auto; aspect-ratio: 600 / 777; background: #fff; box-shadow: var(--sheet-shadow); transform: rotate(4deg); filter: brightness(.97); }
.res.rtl .viewer .p2 { right: auto; left: 5%; transform: rotate(-4deg); }
.viewer .stage { position: relative; display: block; width: 74%; margin: 0 auto 0 4%; background: #fff; box-shadow: var(--sheet-shadow); }
.res.rtl .viewer .stage { margin: 0 4% 0 auto; }
.viewer .stage img, .viewer .stage .placeholder { display: block; width: 100%; height: auto; aspect-ratio: 600 / 777; }
.viewer .keynote-tag { position: absolute; right: 16px; top: 16px; padding: 4px 10px; border: var(--rule); background: var(--paper); font-size: .85rem; font-weight: 700; transform: rotate(3deg); }
.res.rtl .viewer .keynote-tag { right: auto; left: 16px; transform: rotate(-3deg); }
/* The pager wraps to more rows instead of scrolling sideways, so Zoom and the key are never off screen. */
.pager { position: relative; display: flex; flex-wrap: wrap; margin: 40px -40px 0; border-top: var(--rule); background: var(--ground); }
.pager button, .pager a { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; min-height: 52px; min-width: 52px; margin: -1.5px 0 0 -1.5px; padding: 0 14px; border: 0; border-left: var(--rule); border-top: var(--rule); background: var(--ground); color: var(--ink); font: 700 15px var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; }
.res.rtl .pager button, .res.rtl .pager a { margin: -1.5px -1.5px 0 0; border-left: 0; border-right: var(--rule); }
.pager [aria-current=true] { background: var(--ink); color: var(--ground); }
.pager button:focus-visible, .pager a:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; }
.pager [aria-current=true]:focus-visible { outline-color: var(--canola); }
.info { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 28px 32px 32px; background: var(--ground); }
.info h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.06; }
.info h1 .ar { display: block; margin-bottom: 4px; font: 700 .9em/1.5 var(--ar); letter-spacing: 0; direction: rtl; text-align: right; }
.info p { margin: 0; }
.info .desc { font-size: 17px; }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; border-top: var(--rule); border-left: var(--rule); }
.levels a, .levels span { min-width: 0; padding: 8px 10px; border-right: var(--rule); border-bottom: var(--rule); font-size: .85rem; line-height: 1.3; text-decoration: none; }
.levels a { font-weight: 600; }
.levels b { display: block; font-size: 1rem; letter-spacing: 1px; }
.levels b i { font-style: normal; opacity: .38; }
.levels [aria-current=page] { background: var(--ink); color: var(--ground); }
.levels a:hover { background: #FBF7EC; }
.levels a[aria-current=page]:hover { background: var(--ink); }
.levels a:focus-visible { position: relative; z-index: 1; outline: 3px solid var(--ink); outline-offset: -5px; }
.levels a[aria-current=page]:focus-visible { outline-color: var(--canola); }
.tip { flex-basis: 100%; }
.row2 .tip { flex-basis: auto; }
.tip summary { list-style: none; }
.tip summary::-webkit-details-marker { display: none; }
.tip[open] { flex-basis: 100%; }
.tip p { margin: 8px 0 0 !important; padding: 10px 12px; border: 1.5px dashed var(--ink); background: var(--paper); font-size: .92rem; }
.dl { width: 100%; min-height: 60px; font-size: 1.15rem; }
.dl-colour { width: 100%; }
.dl-key { width: 100%; }
.dl-key .tick::before { margin-right: 6px; }
.dl-all { color: inherit; font-weight: 700; white-space: nowrap; }
.dl-meta { margin-top: -6px !important; color: var(--muted); font-size: .9rem; }
.member-btn { width: 100%; min-height: 56px; border: 2px dashed var(--member); background: var(--paper); color: var(--member); font: 700 16px var(--sans); cursor: not-allowed; }
.row2 { display: flex; flex-wrap: wrap; gap: 10px; }
.row2 .pp-btn { min-height: 44px; padding: 0 16px; font-size: .95rem; }
.row2 .tip summary.pp-btn { display: inline-flex; }
.facts { list-style: none; margin: 0; padding: 0; border-top: var(--rule); }
.facts > li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px dotted var(--ink); }
.facts > li > b { padding-top: 3px; font-size: .75rem; letter-spacing: .11em; text-transform: uppercase; }
.olist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.olist > li > a { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 40px; padding: 2px 0; font-weight: 700; }
.olist > li > a .code { text-decoration: none; display: inline-block; }
.olist details summary { display: inline-flex; align-items: center; min-height: 36px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.olist details p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.draft-flag { display: inline-block; padding: 2px 10px; border: 1.5px dashed var(--ink); background: var(--paper); font-weight: 700; font-size: 14px; }

/* ---------- coverage ---------- */
.cov-intro { max-width: 72ch; }
.howcount { margin: 14px 0 0; max-width: 80ch; border: var(--rule); background: var(--ground); }
.howcount summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 16px; font-weight: 700; list-style: none; cursor: pointer; }
.howcount summary::-webkit-details-marker { display: none; }
.howcount summary .chev { width: 18px; height: 18px; flex: none; transition: transform .15s; }
.howcount[open] summary .chev { transform: rotate(180deg); }
.howcount summary:hover { text-decoration: underline; }
.howcount > div { padding: 0 16px 6px; }
.howcount p { margin: 0 0 12px; }
.subj-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; }
.cur-subject { margin-top: 36px; padding-top: 28px; border-top: var(--rule); }
.cur-subject > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-bottom: 8px; }
.cur-subject h2 { font-size: 34px; }
.cur-subject .src { max-width: 80ch; margin: 6px 0 14px; color: var(--muted); font-size: 14px; }
.cur-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 14px; }
.cur-total .big { font: 800 2.6rem/1 var(--display); }
.cur-total .lbl { font-weight: 600; }
/* one ruled row per grade: numeral, the plot strip, the numbers, a chevron; opening it lists the outcomes */
.cgrades { border-top: var(--rule); border-left: var(--rule); margin-bottom: 14px; }
details.cgrade { border-right: var(--rule); border-bottom: var(--rule); background: var(--ground); }
details.cgrade > summary { display: grid; grid-template-columns: 56px minmax(0, 1fr) 230px 24px; gap: 4px 14px; align-items: center; min-height: 56px; padding: 8px 14px; list-style: none; cursor: pointer; }
details.cgrade > summary::-webkit-details-marker { display: none; }
details.cgrade > summary:hover { background: #FBF7EC; }
details.cgrade > summary:focus-visible { position: relative; z-index: 1; outline: 3px solid var(--ink); outline-offset: -4px; }
details.cgrade[open] > summary { border-bottom: 1px dotted var(--ink); }
details.cgrade > summary .g { font: 800 1.7rem/1 var(--display); }
details.cgrade > summary .plots { margin: 0; }
details.cgrade > summary .plots i { width: 12px; height: 12px; }
details.cgrade > summary .lbl { color: var(--muted); font-size: .85rem; line-height: 1.35; }
.cbodywrap { background: var(--paper); }
.gbrowse { margin: 0; }
details.cgrade > summary .chev { width: 18px; height: 18px; transition: transform .15s; }
details.cgrade[open] > summary .chev { transform: rotate(180deg); }
.cbodywrap { padding: 4px 16px 16px; }
.strand h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 16px 0 8px; font: 700 16px/1.3 var(--sans); }
.strand h3 small { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.outs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.out { display: grid; grid-template-columns: 22px 118px minmax(0, 1fr); gap: 4px 12px; padding: 10px 4px; border-bottom: 1px dotted var(--ink); }
.out .pl { width: 14px; height: 14px; margin-top: 3px; border: 1px solid var(--ink); background: var(--paper); }
.out.full .pl { background: var(--c); }
.out.set .pl { background: repeating-linear-gradient(135deg, var(--c) 0 2px, var(--paper) 2px 4px); }
.out.part .pl { background: linear-gradient(135deg, var(--c) 50%, var(--paper) 50%); }
.out .t { font-weight: 700; }
.out .off { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.out .res-links, .out .status { grid-column: 3; }
.out .res-links { display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 14px; }
.out .res-links a { display: inline-flex; align-items: center; min-height: 40px; font-weight: 700; }
.out .status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.out .status svg { width: 14px; height: 14px; }
.out .status.ok, .out .status.set { color: var(--ink); font-weight: 700; }
.out .status.partial { color: var(--ink); font-weight: 600; }
.out.none .t, .out.none .code { color: var(--muted); font-weight: 600; }
.out.hl { outline: 3px solid var(--canola); outline-offset: 2px; background: #FFF8DD; }

/* ---------- make page ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; border-top: var(--rule); border-left: var(--rule); }
.tool { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-right: var(--rule); border-bottom: var(--rule); }
.tool h2 { font-size: 26px; }
.tool h2 [lang=ar] { font: 600 .7em var(--ar); }
.tool p { margin: 0; color: var(--muted); }
.tool ul { margin: 4px 0 10px; padding-left: 18px; }
.tool .pp-btn { align-self: flex-start; margin-top: auto; }
.callout { margin-top: 22px; padding: 14px 16px; border: 1.5px dashed var(--ink); background: var(--paper); }
.open-maker { min-height: 54px; margin-top: 18px; font-size: 17px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .browse .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* drawer navigation */
@media (max-width: 1023px) {
  .pp-hrow { flex-wrap: wrap; gap: 8px 12px; padding-top: 8px; padding-bottom: 10px; min-height: 0; }
  .pp-hrow > .pp-search { order: 3; flex: 1 1 100%; max-width: none; }
  .pp-nav { display: none; margin: 0; }
  .pp-nav.open { position: fixed; inset: 0; z-index: 100; display: block; overflow-y: auto; overscroll-behavior: contain; background: var(--ground); }
  .drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 10px var(--gutter); border-bottom: var(--rule); background: var(--sky); }
  .drawer-title { font: 800 24px/1 var(--display); }
  .pp-navlist { flex-direction: column; padding: 0 var(--gutter) 40px; }
  .pp-navlist > li { flex-direction: column; border-bottom: var(--rule); }
  .pp-navlink { width: 100%; justify-content: flex-start; min-height: 56px; padding: 0 2px; font-size: 18px; }
  .pp-navlink::after { left: 2px; right: auto; width: 120px; }
  .pp-navlink .pp-chev { margin-left: auto; width: 16px; height: 16px; }
  .mega { position: static; max-height: none; overflow: visible; border: 0; box-shadow: none; }
  .mega-inner { padding: 4px 0 16px; }
  .mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.drawer-open { overflow: hidden; }
}
@media (max-width: 1000px) {
  .hero .cols { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .horizon { height: 64px; }
  .map { grid-template-columns: 54px repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(8, auto); grid-auto-flow: column; }
  .map .corner { padding: 0; font-size: 0; }
  .map .gh { justify-content: center; align-items: center; padding: 0; font-size: 1.7rem; }
  .map .gh small { display: none; }
  .map .sh { padding: 8px; }
  .map .sh b { font-size: 1.05rem; }
  .map .sh span { font-size: .72rem; }
  .cell { height: 74px; }
  .cell .n { left: 6px; bottom: 6px; font-size: 1.05rem; }
  .cell .n small { display: none; }
  .cell.soonrow { grid-column: auto; grid-row: span 7; align-items: flex-start; }
  .make-band .wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .make-band .left { padding-bottom: 8px; }
  .make-band .feed { height: 210px; }
  .ledger { grid-template-columns: minmax(0, 1fr); }
  .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* one order at every width under 1000px: label, title, description, Download and its file line, then the stage,
     then the levels, secondary actions and facts (critic R1 fix 6: Download in the first screen) */
  .res { display: flex; flex-direction: column; }
  .res > .info { display: contents; }
  .res .info > * { order: 4; margin-left: 16px; margin-right: 16px; }
  .res .info > .label, .res .info > h1, .res .info > .desc, .res .info > .draft-flag, .res .info > .draft-note { order: 1; }
  .res .info > .dl, .res .info > .dl-colour, .res .info > .dl-key, .res .info > .member-btn, .res .info > .dl-meta { order: 2; }
  .res .info > .label { margin-top: 18px; }
  .res .info > * + * { margin-top: 14px; }
  .res .info > .dl-meta { margin-top: 6px !important; }
  .res .info > :last-child { margin-bottom: 18px; }
  .res .info > .dl, .res .info > .dl-colour, .res .info > .dl-key, .res .info > .member-btn { width: auto; }
  .res > .viewer { order: 3; position: relative; align-self: stretch; margin: 18px 0 4px; padding: 24px 16px 0; border-block: var(--rule); }
  .res .viewer .pager { margin: 24px -16px 0; }

  .viewer .stage, .res.rtl .viewer .stage { width: min(80%, calc(56vh * .772)); margin: 0 auto; }
  .viewer .p2 { width: min(62%, calc(46vh * .772)); }
  details.cgrade > summary { grid-template-columns: 40px minmax(0, 1fr) 24px; }
  details.cgrade > summary .lbl { grid-column: 2; grid-row: 2; }
  details.cgrade > summary .chev { grid-column: 3; grid-row: 1; }
}
@media (max-width: 900px) {
  .browse { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 16px; }
  .filter-btn { display: inline-flex; }
  .filters { position: fixed; inset: 0; z-index: 120; display: none; overflow-y: auto; overscroll-behavior: contain; border: 0; background: var(--ground); }
  .filters.open { display: block; }
  .filters-head { position: sticky; top: 0; z-index: 2; padding-right: 8px; }
  .filters-head h2 { font-size: 14px; padding: 14px 16px; }
  .sheet-close { display: inline-flex; min-height: 40px; }
  .sheet-foot { position: sticky; bottom: 0; display: block; padding: 12px 16px 16px; border-top: var(--rule); background: var(--ground); }
  .sheet-foot .pp-btn { width: 100%; }
  .f-topic { display: block; }
  body.sheet-open { overflow: hidden; }
  .tools-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .grid, .browse .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sec { padding-top: 40px; }
  .sec-h { flex-wrap: wrap; gap: 4px 16px; }
  .sec-h .fill { display: none; }
  .sec-h h2 { font-size: 1.6rem; }
  .plot { height: 190px; }
  .cbody { padding: 10px 10px 12px; }
  .ctitle { font-size: .95rem; }
  .cmeta { gap: 2px 8px; font-size: .8rem; }
  .facts > li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .out { grid-template-columns: 18px minmax(0, 1fr); }
  .out > div, .out .res-links, .out .status { grid-column: 2; }
  .out .code { grid-column: 2; }
  .empty { padding: 20px 16px; }
  .levels a, .levels span { padding: 8px 6px; }
}
@media (max-width: 560px) {
  .hero { padding-top: 28px; }
  .hero h1 { margin-top: 10px; }
  .hero .lead { font-size: 1.05rem; }
  .find input { height: 52px; padding: 0 12px; }
  .find button { padding: 0 14px; }
  .strip button { padding: 6px 8px; font-size: 1.3rem; min-height: 46px; }
  .grp-h .num { font-size: 2.2rem; }
  .grp-h .gsub { display: none; }
  .ledger .big { font-size: 2.6rem; }
}
@media (max-width: 359px) {
  .grid, .browse .grid { grid-template-columns: minmax(0, 1fr); }
  .menu-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .card:hover .plot img, .card:focus-visible .plot img, a.cell:hover .n, a.cell:focus-visible .n { transform: none; }
}
@media print {
  .find, .strip, .filters, .rbar, .applied, .pager, .row2 { display: none !important; }
}
.pp-ftr li a [lang=ar], .tool h2 [lang=ar] { margin-left: .35em; }
.hero h1 { max-width: 16ch; font-size: clamp(2.5rem, 5.6vw, 5rem); }
/* RTL regions: the layout mirrors, English labels inside stay left-to-right */
[dir=rtl] .cmeta > *, [dir=rtl] .tag, [dir=rtl] .keynote-tag, [dir=rtl] .pager > *, [dir=rtl] .grp-h > b, [dir=rtl] .grp-h .gsub { direction: ltr; unicode-bidi: isolate; }

/* ---------- site critic R1 fixes (references/design/SITE_CRITIC_R1.md) ---------- */
/* fix 3: cards mark only the whole-outcome case, with a small solid label */
.whole { display: inline-flex; align-items: center; margin-left: -6px; padding: 0 5px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); font-size: .78em; font-weight: 700; line-height: 1.45; }
/* fix 7: English lines inside RTL regions stay left-to-right but sit at the region's start (right) edge */
[dir=rtl] .whole { margin-left: 0; margin-right: -6px; }
.ctitle .en { unicode-bidi: isolate; }
[dir=rtl] .ctitle .en { display: block; text-align: right; }
.arrun { font-family: var(--ar); font-size: 1.15em; line-height: 1; unicode-bidi: isolate; }
/* fix 5: results plots a little shorter, so the sheets are the loudest thing */
.browse .plot { height: 220px; }
/* fix 8: topic chips wrap (two rows, then "More topics"), each topic group heads with its strand */
.topics { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
.topics-more { border-style: dashed; }
.grp-h .gstrand { color: var(--muted); font-size: .85rem; font-weight: 600; white-space: nowrap; }
@media (min-width: 1101px) { .grp-more.only3 { display: none; } }
@media (max-width: 1100px) { .grp .grid .card:nth-child(n+3) { display: none; } }
/* fix 9: one search box on home; the hero's own box is the search there */
body[data-route=home] .pp-hdr .pp-search { display: none; }
/* fix 10 / smaller: home grids of four show 2x2 between phone and desktop */
@media (min-width: 761px) and (max-width: 1100px) { .grid.quad { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* home coverage: outcomes touched first, the strict share second */
.ledger .big { font-size: 2.6rem; }
.ledger .big small { margin-left: 4px; }
.ledger .strict { margin: 2px 0 0; color: var(--ink); font-size: .95rem; }
.ledger .strict b { font: 800 1.15rem var(--display); }
/* fix 2: public Arabic row on the map, seven short dotted cells */
.cell.soon .n { color: var(--muted); }
/* smaller: focus rings sit above the neighbours that would paint over them */
.strip button:focus-visible, .map > a:focus-visible, .topic:focus-visible, .pager > :focus-visible { position: relative; z-index: 2; }
.map .gh:focus-visible, .map .sh:focus-visible { outline: 3px solid var(--ink); outline-offset: -4px; }
@media (max-width: 1000px) { .strip .allg { display: none; } }
@media (max-width: 760px) {
  /* push-back on cropped thumbnails: on phones the sheet bleeds wider and shows its top */
  .plot img, .plot .placeholder { left: 3%; top: 12px; width: 94%; }
  .browse .plot { height: 190px; }
}
@media (max-width: 560px) {
  .cmeta .pg { display: none; }
  .grp-h { flex-wrap: wrap; gap: 2px 12px; }
  .grp-h .fill { display: none; }
  .grp-h .gstrand { flex-basis: 100%; white-space: normal; }
  .hero { padding-top: 22px; }
  .hero h1 { margin: 8px 0 12px; }
  .hero .lead { margin-bottom: 14px; }
  .try { margin: 8px 0 6px; }
  .try a:nth-of-type(n+3) { display: none; }
  .try a { min-height: 36px; }
  .horizon { height: 40px; }
  .ledger .big { font-size: 2.2rem; }
}

/* ---------- site critic R2 fixes (references/design/SITE_CRITIC_R2.md) ---------- */
/* horizon B in the home hero: the user-approved pen strip as generated, sized and cropped in CSS only. The file is
   opaque white; multiply drops the white onto the sky. It overlaps the ruled bottom edge by about 10% of its height
   so only grass tips touch the rule. Never below half scale: fixed heights under 1000px, the far end cropped off. */
.hero { border-bottom: var(--rule); }
.horizon.pen { --hz: min(170px, calc(100vw * 241 / 2172)); height: var(--hz); margin: 6px 0 calc(var(--hz) * -.04); }
.horizon.pen svg { display: none; }
.horizon.pen img { object-fit: cover; object-position: left bottom; mix-blend-mode: multiply; filter: brightness(1.015); } /* the scan white is 251-254: lift it to pure white so no faint box shows */
@media (max-width: 1000px) { .horizon.pen { --hz: 120px; } }
@media (max-width: 560px) { .horizon.pen { --hz: 96px; } }
@media print { .horizon { display: none !important; } }

/* concept borrow 1: a grade cell joined to the hero search */
.find-grade { display: flex; border-left: var(--rule); }
.find-grade select { min-height: 0; height: 100%; border: 0; padding: 0 10px; background-color: var(--paper); font: 600 1rem var(--sans); cursor: pointer; }
.find-grade select:focus-visible { outline: 3px solid var(--ink); outline-offset: -6px; }
@media (max-width: 560px) {
  .hero .find { flex-wrap: wrap; }
  .hero .find input { flex: 1 1 100%; border-bottom: var(--rule); }
  .hero .find .find-grade { flex: 1 1 auto; border-left: 0; }
  .hero .find .find-grade select { width: 100%; height: 48px; }
  .hero .find button { min-height: 48px; }
}

/* concept borrows 3 and 4: bigger sheets on cards and a quieter hatch (cards only; the map and stage keep theirs) */
.card .plot { background: var(--f); }
.card .plot.t2 { background: var(--f2); }
.card .plot::before { content: ""; position: absolute; inset: 0; background: var(--hatch, none) center / cover no-repeat; opacity: .6; }
.plot img, .plot .placeholder { left: 6%; width: 88%; }
@media (min-width: 761px) {
  .grid.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.trio > :nth-child(n+4) { display: none; }
}
/* concept borrow 5: more air between the home sections */
@media (min-width: 761px) {
  body[data-route=home] .sec { padding-top: 72px; }
  body[data-route=home] .make-band { margin-top: 72px; }
}
/* push-back: the public Arabic row on the map is half height; its home ledger is one line */
.cell.soon { height: auto; min-height: 56px; }
.map .sh.t-arabic:has(+ .cell.soon) { padding-block: 8px; }
.soon-ledger .soon-line { margin-top: 10px; color: var(--ink); font-size: 1rem; }

/* fix 3: the resource frame ends with each column, so no empty ground box under the pager */
@media (min-width: 1001px) {
  .res { align-items: start; border: 0; }
  .res > .viewer { border: var(--rule); }
  .res > .info, .res.rtl > .info { border: var(--rule); margin-left: -1.5px; }
  .res.rtl > .info { margin-left: 0; margin-right: -1.5px; }
}

/* fix 4: fewer rows above the first result: count, applied chips and Sort share a row; tighter heading */
.bhead p { margin-top: 4px; }
.strip { margin-top: 16px; }
.topics { margin-top: 12px; }
.browse { padding-top: 18px; }
.rbar { justify-content: flex-start; margin-bottom: 14px; }
.rbar .applied { flex: 1 1 auto; margin: 0; }
.rbar .ctl { margin-left: auto; }

/* fix 7: a long topic chip wraps instead of pushing the page wider */
.topic { max-width: 100%; white-space: normal; text-align: left; line-height: 1.2; padding-block: 6px; }

/* fix 10: no text under 12px */
.whole { font-size: 12px; }
.plot .tag, .plot .draft, .card.member .plot::after, .colour-chip { font-size: 12px; }
@media (max-width: 900px) { .rbar .ctl { margin-left: 0; } }

/* Batch 2 formats (COVERAGE_PLAN §6.1-6.2): format label on cards and resource pages, coverage tiers, placeholders. */
.fmt { display: inline-flex; align-items: center; padding: 0 6px; border: 1px solid currentColor; border-radius: 0; font-size: .8em; font-weight: 700; white-space: nowrap; }
.fmt-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 6px; font-size: 15px; }
.res-links .fmt { align-self: center; margin-right: 6px; padding: 1px 7px; line-height: 1.3; }
.cur-tiers { margin: -6px 0 14px; font-size: 15px; color: var(--muted); }
.out.ph .t, .out.ph .code { color: var(--muted); font-weight: 600; }
.out.ph .pl { opacity: .35; }
.browse.soon-only { grid-template-columns: minmax(0, 1fr); }

/* ---------- site critic R3 fixes (references/design/SITE_CRITIC_R3.md) ---------- */
/* fix 5: phones show only the parent link ("‹ Reading comprehension (non-fiction)"); the full trail from 561px up */
@media (max-width: 560px) {
  .crumbs li:not(:nth-last-child(2)) { display: none; }
  .crumbs li:nth-last-child(2)::before { content: "‹"; margin-right: 6px; }
}
/* fix 11: the front sheet in the home Make band sits lower, so the back sheet's title line stays whole */
.make-band .feed img + img { top: 94px; }
/* fix 12: on phones the count says "47 sheets", the Sort label is for screen readers only and the Filters button is
   its icon, so the count, the applied chip and the controls share one row when they fit */
.rbar .count .cnt-short { display: none; }
@media (max-width: 560px) {
  .rbar { gap: 6px; }
  .rbar .count .cnt-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rbar .count .cnt-short { display: inline; }
  .rbar .count .cnt-more { display: none; }
  .rbar .applied { flex: 0 1 auto; }
  .rbar .ctl { gap: 4px; margin-left: auto; }
  .rbar .ctl label[for=sort], #filter-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rbar .filter-btn { min-width: 44px; padding-inline: 8px; }
  .rbar #sort { max-width: 102px; padding: 0 2px; font-size: 14px; }
  .rbar .achip { gap: 6px; padding: 0 8px 0 10px; }
  .rbar .achip-l { overflow: hidden; max-width: 6.2em; text-overflow: ellipsis; white-space: nowrap; }
}
/* fix 9: a resource page prints as one tidy page: the preview, the title and what it practises, plus a note to print
   the PDF for the real sheet. Buttons, neighbours and the second page preview stay on screen. */
.print-note { display: none; }
@media print {
  .res ~ .sec, .viewer .p2, .keynote-tag, .dl, .dl-colour, .dl-key, .dl-meta, .pp-btn, .levels, .lvl-wrap, .row2 { display: none !important; }
  .stage, .res .info { break-inside: avoid; }
  .print-note { display: block; margin: 0 0 12px; padding: 8px 10px; border: 1.5px solid #000; font: 700 14px/1.4 var(--sans); }
}

/* Languages menu and hub (LANGUAGES_PLAN.md, 2026-11-17) */
.mega-grid.lang-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lang-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 20px 0 48px; padding: 0; list-style: none; }
.lang-card { display: flex; flex-direction: column; gap: 10px; min-height: 120px; padding: 18px 20px; border: var(--rule); background: var(--paper); color: var(--ink); text-decoration: none; }
.lang-card b { font: 800 22px/1.2 var(--display); }
.lang-card:hover b, .lang-card:focus-visible b { text-decoration: underline; }
@media (max-width: 1023px) { .mega-grid.lang-grid { grid-template-columns: minmax(0, 1fr); } }
.lang-native { margin-left: .4em; font-weight: 600; }
