/* Umhlahlandlela web reader, second design. Phone first; tablet and desktop add columns, never clutter.
   Colour is rationed: navy = key facts and primary buttons, teal = progress and links, gold = the one main action, red = mistakes. */
@font-face { font-family: Inter; src: url(fonts/inter-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Stix; src: url(fonts/stix-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Stix; src: url(fonts/stix-400i.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Stix; src: url(fonts/stix-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Stix; src: url(fonts/stix-700i.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --paper: #fff; --surface: #F6F8FA; --ink: #17222D; --head: #0E2439; --quiet: #5A6876; --line: #E3E8ED;
  --navy: #0E2439; --navy2: #15506A; --teal: #4BBCA0; --tealink: #14705B; --link: #14705B; --gold: #F2C14E; --goldink: #7A5705; --red: #B4232A;
  --try: #FFF6DA; --tryink: #7A5705; --def: #EAF7F3; --defink: #14705B; --mist: #FDECEC; --mistink: #B4232A;
  --fur: #F0EEFB; --furink: #5546B5; --proof: #F4F6F8; --ans: #EAF7F3; --key: #0E2439; --keyline: #0E2439; --keyink: #fff;
  --workline: #CFE9E1; --workhead: #EAF7F3; --figbg: #F4F8FB; --scrim: rgba(14,36,57,.45);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --math: Stix, "STIX Two Text", Cambria, Georgia, serif;
  --scale: 1; --ease: cubic-bezier(.2,.8,.2,1); --top: 48px; --gut: 20px; --r: 14px;
  color-scheme: light;
}
/* Sepia is the default page colour. Light and dark are choices in the Aa sheet. */
:root { --paper: #FBF4E6; --surface: #F3EAD7; --ink: #2B261E; --head: #231F17; --quiet: #6B6152; --line: #E4D8BF;
  --try: #F7E8B4; --def: #E1EFE2; --mist: #F8DDD6; --fur: #EAE2EE; --proof: #F3EAD7; --ans: #E1EFE2; --workline: #CFE0CF; --workhead: #E1EFE2; --figbg: #F3EAD7; }
:root[data-theme="light"] {
  --paper: #fff; --surface: #F6F8FA; --ink: #17222D; --head: #0E2439; --quiet: #5A6876; --line: #E3E8ED;
  --try: #FFF6DA; --def: #EAF7F3; --mist: #FDECEC; --fur: #F0EEFB; --proof: #F4F6F8; --ans: #EAF7F3; --workline: #CFE9E1; --workhead: #EAF7F3; --figbg: #F4F8FB;
}
:root[data-theme="dark"] {
  --paper: #0B1622; --surface: #13273A; --ink: #E4ECF2; --head: #F4F8FB; --quiet: #9DB0C0; --line: #223A50;
  --tealink: #5FD0B4; --link: #7FE0C8; --goldink: #F2C14E; --red: #FF9A9E;
  --try: #2A2410; --tryink: #F2C14E; --def: #0F2E29; --defink: #5FD0B4; --mist: #37181A; --mistink: #FF9A9E;
  --fur: #211E44; --furink: #B9AEF7; --proof: #13273A; --ans: #0F2E29; --key: #173450; --keyline: #2A4D6E;
  --workline: #24504A; --workhead: #0F2E29; --figbg: #EEF3F7; --scrim: rgba(0,0,0,.6);
  color-scheme: dark;
}
:root[data-size="xs"] { --scale: .88; } :root[data-size="s"] { --scale: .94; } :root[data-size="l"] { --scale: 1.12; } :root[data-size="xl"] { --scale: 1.26; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .15s; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); background: var(--paper); }
body { margin: 0; font-family: var(--sans); font-size: calc(16.5px * var(--scale)); line-height: 1.6; color: var(--ink); background: var(--paper);
  font-variant-numeric: lining-nums; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
strong { font-weight: 650; color: var(--head); }
p { margin: 0 0 .85em; }
ul, ol { margin: 0 0 .85em; padding-left: 1.4em; }
li { margin-bottom: .4em; } li > p { margin-bottom: .4em; }
li::marker { color: var(--tealink); font-weight: 700; font-variant-numeric: tabular-nums; }
sup, sub { font-size: 70%; line-height: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--navy); padding: 10px 16px; z-index: 60; font-weight: 700; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); background: var(--paper); border-bottom: 1px solid var(--line); }
.js .top { transition: transform .2s var(--ease); } .top.away { transform: translateY(-100%); }
.topin { height: 100%; display: flex; align-items: center; gap: 4px; padding: 0 4px; max-width: 1280px; margin: 0 auto; }
.tback, .tset { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--head); text-decoration: none; background: none; border: 0; cursor: pointer; }
.tset { font-weight: 750; font-size: 17px; letter-spacing: -.02em; display: none; } .js .tset { display: grid; }
.tback:active, .tset:active { background: var(--surface); }
.ttitle { flex: 1; min-width: 0; text-align: center; font-size: 13px; font-weight: 650; color: var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbrand { display: none; text-decoration: none; line-height: 1.15; align-items: center; gap: 10px; }
.tbrand img { height: 34px; width: auto; display: block; }
.tbrand b { display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--tealink); font-weight: 750; }
.tbrand .tb > span { font-size: 15px; font-weight: 750; color: var(--head); }
.is-home .tbrand { display: flex; margin-left: 12px; } .is-home .tback, .is-home .ttitle { display: none; } .is-home .topin { justify-content: space-between; }
.tprog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.tprog i { display: block; height: 100%; width: 0; background: var(--teal); }

/* ---------- frame ---------- */
.frame { display: block; }
main { display: block; min-width: 0; }
.page { max-width: 680px; margin: 0 auto; padding: 20px var(--gut) 40px; }
.has-dock .page { padding-bottom: 104px; }
.side, .rail { display: none; }
@media (min-width: 720px) { :root { --gut: 32px; } body { font-size: calc(17.5px * var(--scale)); } .page { padding-top: 32px; } }
@media (min-width: 1100px) {
  :root { --top: 56px; }
  body { font-size: calc(18px * var(--scale)); line-height: 1.62; }
  .frame { display: grid; grid-template-columns: 264px minmax(0, 680px) 220px; gap: 56px; max-width: 1280px; margin: 0 auto; padding: 0 32px; }
  .is-home .frame, .is-wide .frame { display: block; padding: 0; }
  .page { padding: 40px 0 72px; max-width: none; } .has-dock .page { padding-bottom: 72px; }
  .is-home .page { max-width: 1080px; padding: 40px 32px 72px; } .is-wide .page { max-width: 744px; padding: 40px 32px 72px; }
  .side, .rail { display: block; position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 40px 0 32px; font-size: 14px; line-height: 1.35; }
  .tbrand { display: flex; margin: 0 20px 0 28px; } .tbrand img { height: 38px; } .tback { display: none; } .ttitle { text-align: left; font-size: 14px; color: var(--quiet); font-weight: 550; }
  .is-home .tbrand { margin-left: 28px; }
  .topin { padding: 0 8px; }
}

/* chapter list: left column on desktop, bottom sheet on phones */
.sidehead { font-weight: 750; color: var(--head); font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 12px; line-height: 1.25; }
.sidehead small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--tealink); font-weight: 750; margin-bottom: 2px; }
.sidelist { list-style: none; padding: 0; margin: 0 0 16px; }
.sidelist li { margin: 0; }
.sidelist a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.sidelist a:hover { background: var(--surface); }
.sidelist a[aria-current] { background: var(--navy); color: #fff; font-weight: 650; }
.sidelist .n { color: var(--tealink); font-weight: 750; min-width: 2.2em; font-variant-numeric: tabular-nums; }
.sidelist a[aria-current] .n { color: var(--teal); }
a.done::after { content: ""; flex: none; margin-left: auto; width: 16px; height: 16px; align-self: center; background: var(--tealink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.sidelist a[aria-current].done::after { background: var(--teal); }
.sideback { font-size: 13px; color: var(--quiet); padding-left: 10px; margin: 0; }

/* on this page: right column, desktop only */
.rail h2 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--quiet); font-weight: 750; margin: 0 0 10px; border: 0; padding: 0; }
.rail ol { list-style: none; margin: 0 0 24px; padding: 0; border-left: 2px solid var(--line); font-size: 13px; }
.rail li { margin: 0; }
.rail a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--quiet); text-decoration: none; }
.rail a:hover { color: var(--ink); } .rail a.on { border-left-color: var(--teal); color: var(--head); font-weight: 650; }
.rail .keys { font-size: 12px; color: var(--quiet); } .rail kbd { font: inherit; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; background: var(--surface); }

/* ---------- bottom dock (phone and tablet) ---------- */
.dock { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.js .dock { transition: transform .2s var(--ease); } .dock.away { transform: translateY(110%); }
.dock a { height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 15px; }
.dprev { width: 48px; flex: none; color: var(--head); background: var(--surface); } .dprev.none { visibility: hidden; }
.dmid { flex: 1; min-width: 0; gap: 8px; color: var(--head); background: var(--surface); padding: 0 16px; }
.dmid .d2 { color: var(--quiet); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dnext { flex: none; padding: 0 18px 0 22px; gap: 4px; background: var(--navy); color: #fff; } .dnext.none { visibility: hidden; }
:root[data-theme="dark"] .dnext { background: var(--teal); color: #06241D; }
.dock a:active { transform: scale(.97); }
@media (min-width: 720px) { .dock { left: 50%; right: auto; bottom: 16px; width: 420px; margin-left: -210px; border: 1px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: 0 4px 24px rgba(14,36,57,.14); } }
@media (min-width: 1100px) { .dock { display: none; } }

/* sheets (chapter list, reading settings) */
dialog.sheet { border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: none; max-height: 80dvh; background: var(--paper); color: var(--ink); border-radius: 20px 20px 0 0; box-shadow: 0 -4px 24px rgba(14,36,57,.18); overflow: hidden; }
dialog.sheet::backdrop { background: var(--scrim); }
.sheetin { max-height: 80dvh; overflow-y: auto; padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.sheetin::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 16px; }
.sheethead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheethead h2 { font-size: 18px; margin: 0; border: 0; padding: 0; color: var(--head); }
.sheetclose { width: 44px; height: 44px; margin-right: -10px; display: grid; place-items: center; border: 0; background: none; border-radius: 12px; cursor: pointer; color: var(--quiet); }
.sheet .sidelist a { padding: 12px 10px; font-size: 16px; }
@media (min-width: 720px) { dialog.sheet { margin: auto; width: 440px; border-radius: 20px; max-height: 84dvh; } .sheetin::before { display: none; } .sheetin { padding-top: 20px; } }
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: sheetup .28s var(--ease); } dialog.sheet[open]::backdrop { animation: fade .2s ease-out; }
  @keyframes sheetup { from { transform: translateY(100%); } } @keyframes fade { from { opacity: 0; } }
}
.setrow { margin: 16px 0 20px; } .setlab { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--quiet); margin: 0 0 10px; }
.sizes { display: flex; align-items: center; gap: 12px; } .sizes span { font-weight: 750; color: var(--head); } .sizes .a1 { font-size: 13px; } .sizes .a2 { font-size: 24px; }
.sizes input { flex: 1; accent-color: var(--tealink); height: 44px; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.themes button { height: 56px; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; font-size: 13px; font-weight: 650; }
.themes button[aria-pressed="true"] { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal); }
.th-light { background: #fff; color: #17222D; } .th-sepia { background: #FBF4E6; color: #2B261E; } .th-dark { background: #0B1622; color: #E4ECF2; }
.setreset { border: 0; background: none; color: var(--quiet); text-decoration: underline; cursor: pointer; padding: 10px 0; font-size: 14px; }

/* ---------- headings ---------- */
h1, h2 { color: var(--head); letter-spacing: -.015em; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; font-weight: 700; color: var(--tealink); margin: 0 0 8px; line-height: 1.3; }
.eyebrow a { color: inherit; text-decoration: none; } .eyebrow .mins { color: var(--quiet); font-weight: 550; }
.eyebrow .sep { color: var(--line); }
.ptitle { font-size: calc(26px * var(--scale)); line-height: 1.18; font-weight: 750; margin: 0 0 24px; }
h2.sub, .content h2 { font-size: calc(20px * var(--scale)); line-height: 1.25; font-weight: 700; margin: 40px 0 12px; }
@media (min-width: 1100px) { .ptitle { font-size: calc(34px * var(--scale)); margin-bottom: 28px; } h2.sub, .content h2 { font-size: calc(23px * var(--scale)); } }
.tag { display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 750; padding: 2px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.6; }
.tag.fnd { background: var(--def); color: var(--defink); } .tag.acc { background: var(--fur); color: var(--furink); }
.content > :first-child { margin-top: 0; }
.content > p, .content > ul, .content > ol { max-width: 41rem; }

/* ---------- chapter opener ---------- */
.opener { position: relative; padding-top: 28px; margin-bottom: 8px; }
.chapnum { position: absolute; right: 0; top: -6px; font-weight: 800; font-size: 64px; line-height: 1; color: var(--teal); opacity: .22; pointer-events: none; letter-spacing: -.04em; }
.chapkick { font-size: 12px; letter-spacing: .22em; font-weight: 750; color: var(--tealink); margin-bottom: 8px; }
.opener h1 { font-size: calc(32px * var(--scale)); line-height: 1.12; font-weight: 780; margin: 0 0 24px; max-width: 11em; position: relative; }
@media (min-width: 1100px) { .opener h1 { font-size: calc(44px * var(--scale)); } .chapnum { font-size: 160px; top: -28px; } }
.objectives { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 24px; background: var(--paper); }
.objectives .boxlabel { color: var(--tealink); }
.objectives ul { list-style: none; margin: 8px 0 0; padding: 0; }
.objectives li { position: relative; padding-left: 28px; margin-bottom: 8px; } .objectives li:last-child { margin-bottom: 0; }
.objectives li::before { content: ""; position: absolute; left: 0; top: .28em; width: 18px; height: 18px; border-radius: 50%; background: var(--def)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.2 8.4l2.5 2.5 5-5.3' fill='none' stroke='%2314705B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.why { font-size: 1.04em; color: var(--ink); }
.startbtn { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 20px; margin: 24px 0 8px; border-radius: var(--r); background: var(--gold); color: var(--navy); text-decoration: none; font-weight: 750; }
.startbtn small { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 750; opacity: .75; }
.startbtn:active { transform: scale(.985); }

/* ---------- callouts: one anatomy ---------- */
.box { border-radius: var(--r); padding: 16px; margin: 24px 0; background: var(--surface); position: relative; }
.box > :last-child, .box li:last-child, .ansbody > :last-child { margin-bottom: 0; }
.boxlabel { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 750; margin: 0 0 8px; line-height: 1.3; color: var(--quiet); }
.boxlabel strong { color: inherit; font-weight: 750; }
.boxlabel::before { content: ""; flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat; }
.objectives .boxlabel::before, .worked > .boxlabel::before { display: none; }
.try { background: var(--try); } .try .boxlabel { color: var(--tryink); --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M12.7 2.3l3 3L6 15l-3.8.8L3 12z' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.def { background: var(--def); } .def .boxlabel { color: var(--defink); --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M3 3.5h5a2 2 0 0 1 2 2V15a2 2 0 0 0-2-1.5H3zM15 3.5h-3a2 2 0 0 0-2 2V15a2 2 0 0 1 2-1.5h3z' fill='none' stroke='%23000' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.term { font-weight: 750; color: var(--head); display: block; font-size: 1.1em; margin-bottom: 2px; }
.def .term::first-letter { text-transform: uppercase; }
.law { background: var(--key); color: var(--keyink); border: 1px solid var(--keyline); } .law .boxlabel { color: var(--gold); --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 1.8l2.2 4.6 5 .7-3.6 3.5.9 5L9 13.2l-4.5 2.4.9-5L1.8 7.1l5-.7z' fill='%23000'/%3E%3C/svg%3E"); }
.law strong, .law .term { color: #fff; } .law a { color: #9BE3CF; }
.law:has(+ .proof) { border-radius: var(--r) var(--r) 0 0; margin-bottom: 0; }
.proof { background: var(--proof); } .law + .proof { margin-top: 0; border-radius: 0 0 var(--r) var(--r); }
.proof .boxlabel { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M3 9.5l3.5 3.5L15 4.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.mistake { background: var(--mist); } .mistake .boxlabel { color: var(--mistink); --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 4.5l9 9M13.5 4.5l-9 9' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.further { background: var(--fur); border: 1px dashed color-mix(in srgb, var(--furink) 45%, transparent); } .further .boxlabel { color: var(--furink); --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M3 15L15 3M8 3h7v7' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.live { background: linear-gradient(135deg, var(--navy), var(--navy2)); color: #fff; } .live .boxlabel { color: var(--gold); --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M6.6 6.8a2.5 2.5 0 1 1 3.6 2.3c-.8.4-1.2 1-1.2 1.9M9 14.2v.1' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); } .live strong { color: #fff; } .live a { color: #9BE3CF; }
.check { background: var(--paper); border: 1px solid var(--line); } .check .boxlabel { color: var(--head); --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='6.6' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3Cpath d='M6 9.3l2.1 2.1L12.2 7' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.check ol { margin-top: 4px; }
@media (min-width: 1100px) { .box { padding: 20px 24px; } }

/* ---------- figures, tables ---------- */
figure { margin: 24px 0; position: relative; }
.figscroll { border-radius: var(--r); background: var(--figbg); overflow: hidden; }
.figscroll > svg { display: block; width: 100%; height: auto; }
figcaption { font-size: 14px; color: var(--quiet); margin-top: 8px; line-height: 1.45; }
figcaption b { color: var(--tealink); margin-right: 4px; }
.figbtn { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 0; cursor: pointer; background: rgba(255,255,255,.86); color: #0E2439; box-shadow: 0 1px 4px rgba(14,36,57,.18); }
.figbtn .ico { width: 18px; height: 18px; }
dialog.zoom { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #fff; }
.zoomin { height: 100%; overflow: auto; padding: 60px 8px 16px; display: grid; }
.zoomin svg { display: block; width: max(100%, 46rem); max-width: none; height: auto; margin: auto; }
.zoomclose { position: fixed; top: 10px; right: 10px; z-index: 2; font-weight: 700; background: #0E2439; color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer; }
.scroll { overflow-x: auto; margin: 16px 0 24px; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-size: .92em; font-variant-numeric: lining-nums tabular-nums; }
th { background: var(--surface); color: var(--head); text-align: left; padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid var(--line); padding: 10px 14px; vertical-align: top; } tr:last-child td { border-bottom: 0; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 8px; }
p.keep { margin-bottom: 8px; }
.scis { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 12px 0 24px; }
@media (min-width: 640px) { .scis { grid-template-columns: 1fr 1fr; } }
.sci { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--paper); }
.sci svg { flex: none; width: 64px; height: 64px; }
.sci img.pt, .credits img.pt { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; background: var(--surface); }
.credits { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.credits li { display: flex; gap: 12px; align-items: center; } .credits b { display: block; color: var(--head); } .credits span { font-size: .86em; line-height: 1.4; color: var(--quiet); overflow-wrap: anywhere; }
.scn { font-weight: 750; color: var(--head); } .scl { font-size: 13px; color: var(--tealink); font-weight: 650; margin-bottom: 2px; } .scw { font-size: .88em; line-height: 1.45; }

/* ---------- questions and answers ---------- */
p.level { display: flex; align-items: center; gap: 10px; font-size: calc(17px * var(--scale)); font-weight: 750; color: var(--head); margin: 36px 0 12px; --dot: var(--teal); }
p.level strong { font-weight: 750; }
p.level::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); flex: none; }
p.level.stretch { --dot: #2D7FB8; } p.level.challenge { --dot: var(--head); } p.level.data { --dot: #7B6BD6; } p.level.write { --dot: #E8A33D; } p.level.olympiad { --dot: var(--gold); } p.level.mixed { --dot: #7B6BD6; }
.questions .content > ol > li, .check ol > li { margin-bottom: 14px; }
details.ans { margin: 8px 0 0; }
details.ans > summary { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 132px; padding: 0 16px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 700;
  color: var(--defink); background: var(--ans); border-radius: 999px; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
details.ans > summary::-webkit-details-marker { display: none; }
details.ans > summary:active { transform: scale(.97); }
details.ans .s2, details.ans[open] .s1 { display: none; } details.ans[open] .s2 { display: inline; }
details.ans[open] > summary { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--quiet); }
.ansbody { margin: 8px 0 4px; padding: 14px 16px; background: var(--ans); border-radius: 12px; }
@media (prefers-reduced-motion: no-preference) { details.ans[open] > .ansbody { animation: rise .22s ease-out; } @keyframes rise { from { opacity: 0; transform: translateY(-6px); } } }
.selfmark { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--defink) 18%, transparent); font-size: 13px; color: var(--quiet); }
.selfmark button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--defink) 35%, transparent); background: var(--paper); cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink); }
.selfmark button[aria-pressed="true"].yes { background: var(--tealink); border-color: var(--tealink); color: #fff; }
:root[data-theme="dark"] .selfmark button[aria-pressed="true"].yes { color: #06241D; }
.selfmark button[aria-pressed="true"].no { background: var(--gold); border-color: var(--gold); color: #0E2439; }
.tally { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--surface); font-size: 14px; margin: 0 0 24px; }
.tally b { color: var(--head); }
@media (min-width: 720px) { .questions .content > ol.short { columns: 2; column-gap: 40px; } .questions .content > ol.short > li { break-inside: avoid; } }

/* ---------- end of page ---------- */
.donecard { display: flex; align-items: center; gap: 14px; padding: 16px; margin: 40px 0 0; border-radius: var(--r); background: var(--def); color: var(--ink); }
.donecard svg { width: 36px; height: 36px; flex: none; } .donecard circle { fill: none; stroke: var(--tealink); stroke-width: 2.5; } .donecard path { fill: none; stroke: var(--tealink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.donecard b { display: block; color: var(--head); } .donecard span { font-size: 14px; color: var(--quiet); }
@media (prefers-reduced-motion: no-preference) {
  .donecard.pop { animation: rise .3s var(--ease); }
  .donecard.pop circle { stroke-dasharray: 101; stroke-dashoffset: 101; animation: draw .6s ease-out forwards; }
  .donecard.pop path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .45s .25s ease-out forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}
.pager { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pager .prev { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--quiet); text-decoration: none; font-size: 14px; font-weight: 600; }
.pager .prev { max-width: 100%; min-width: 0; } .pager .prev span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager .prev .ico { width: 16px; height: 16px; }
.pager .next { display: flex; align-items: center; gap: 16px; min-height: 68px; padding: 12px 20px; border-radius: var(--r); background: var(--navy); color: #fff; text-decoration: none; }
:root[data-theme="dark"] .pager .next { background: var(--key); border: 1px solid var(--keyline); }
.pager .next > span { flex: 1; min-width: 0; }
.pager .dir { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 750; color: var(--teal); }
.pager .ttl { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager .next:active { transform: scale(.985); }
@media (hover: hover) { .pager .next, .chap, .ccard { transition: transform .12s ease-out, box-shadow .12s ease-out; } .pager .next:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(14,36,57,.18); } }
.finish { margin-top: 32px; padding: 16px; background: var(--def); border-radius: var(--r); font-weight: 600; }

/* lists of sections (chapter page, contents) */
.seclist { list-style: none; padding: 0; margin: 0 0 24px; }
.seclist li { margin: 0; border-bottom: 1px solid var(--line); } .seclist li:last-child { border-bottom: 0; }
.seclist a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 4px; color: var(--ink); text-decoration: none; line-height: 1.3; }
.seclist .n { color: var(--tealink); font-weight: 750; min-width: 2.3em; font-variant-numeric: tabular-nums; align-self: baseline; }
.seclist .t { flex: 1; min-width: 0; } .seclist .t small { display: block; font-size: 12.5px; color: var(--quiet); margin-top: 2px; }
.seclist .tag { font-size: 10px; padding: 1px 8px; }
@media (hover: hover) { .seclist a:hover { background: var(--surface); border-radius: 10px; } }

/* ---------- home ---------- */
.hero { display: grid; gap: 24px; background: linear-gradient(160deg, #081726, var(--navy) 45%, var(--navy2)); color: #fff; border-radius: 20px; padding: 24px 20px; margin-bottom: 16px; }
.herotext { min-width: 0; }
.hero .kick span { display: none; } @media (min-width: 720px) { .hero .kick span { display: inline; } }
.hero .kick { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--teal); font-weight: 750; margin-bottom: 8px; }
.hero h1 { color: #fff; font-size: min(40px, 11.5vw); line-height: 1.05; font-weight: 800; margin: 0 0 8px; letter-spacing: -.025em; }
.hero .sub { font-size: 17px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.hero .by { display: flex; align-items: center; gap: 12px; font-size: 14px; line-height: 1.35; margin-bottom: 20px; color: rgba(255,255,255,.85); }
.hero .by img { height: 44px; width: auto; flex: none; }
.btn { display: flex; align-items: center; gap: 12px; min-height: 60px; background: var(--gold); color: var(--navy); text-decoration: none; border-radius: var(--r); padding: 10px 18px; line-height: 1.25; }
.btn > span { flex: 1; min-width: 0; } .btn .l1 { display: block; font-weight: 800; } .btn .l2 { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn:active { transform: scale(.985); }
.cover { display: none; }
.homemeta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.homemeta a, .homemeta span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 650; }
.homemeta span { color: var(--quiet); font-weight: 550; }
.week { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: var(--surface); font-size: 14px; margin: 8px 0 0; }
.week .dots { display: flex; gap: 6px; margin-left: auto; } .week i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; color: var(--quiet); }
.week i.on { background: var(--teal); border-color: var(--teal); color: #06241D; } .week i.today { border-color: var(--tealink); }
.retry { margin: 24px 0 0; padding: 16px; border-radius: var(--r); background: var(--try); }
.retry h2 { font-size: 15px; margin: 0 0 8px; color: var(--head); letter-spacing: 0; } .retry ul { list-style: none; padding: 0; margin: 0; } .retry li { margin: 0; } .retry a { display: block; padding: 8px 0; font-weight: 600; font-size: 15px; }
.conthead { display: flex; align-items: baseline; gap: 16px; margin: 40px 0 16px; }
.conthead h2 { margin: 0; flex: 1; } .overall { font-size: 14px; color: var(--tealink); font-weight: 700; margin: 0; }
.chaps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; overflow-wrap: anywhere; }
.chapcol { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.chap { margin: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.chap summary { display: flex; align-items: center; gap: 14px; padding: 14px 14px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.chap summary::-webkit-details-marker { display: none; }
.ring { position: relative; flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: var(--head); }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); } .ring circle { fill: none; stroke-width: 3; } .ring .bg { stroke: var(--line); } .ring .fg { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 119.4; }
.js .ring .fg { transition: stroke-dashoffset .6s ease-out; }
.chap.alldone .ring { color: var(--tealink); }
.ct { flex: 1; min-width: 0; font-weight: 700; color: var(--head); line-height: 1.25; } .ct small { display: block; font-size: 13px; font-weight: 500; color: var(--quiet); margin-top: 3px; }
.chev { flex: none; color: var(--quiet); transition: transform .2s var(--ease); } .chap details[open] .chev { transform: rotate(180deg); }
.chap .seclist { margin: 0; padding: 0 14px 6px; border-top: 1px solid var(--line); }
.reset { margin-top: 24px; } .reset button { font-size: 13px; color: var(--quiet); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 10px 0; }
@media (min-width: 720px) {
  .hero { grid-template-columns: 1fr 200px; align-items: center; padding: 40px; } .hero h1 { font-size: 56px; } .hero .sub { font-size: 20px; } .btn { display: inline-flex; min-width: 320px; max-width: 100%; }
  .cover { display: block; } .cover svg { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.45); transform: rotate(2deg); }
}
@media (min-width: 1100px) { .chaps { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; } .chapcol { gap: 16px; } .hero { grid-template-columns: 1fr 230px; padding: 48px 56px; } }

/* ---------- glossary ---------- */
.findwrap { position: sticky; top: var(--top); z-index: 5; background: var(--paper); padding: 8px 0 10px; margin: 0 0 8px; }
.find { display: block; } .find span { position: absolute; left: -999px; }
.find input { display: block; width: 100%; height: 48px; font: inherit; color: var(--ink); padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.jump { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; margin: 0; scrollbar-width: none; } .jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); text-decoration: none; font-weight: 750; font-size: 14px; color: var(--head); }
.letter { font-size: 14px !important; color: var(--tealink) !important; margin: 28px 0 8px !important; letter-spacing: .1em; }
dl.gloss { margin: 0; font-size: .95em; }
.gl { padding: 12px 0; border-bottom: 1px solid var(--line); }
.gloss dt { font-weight: 750; color: var(--head); display: flex; align-items: baseline; gap: 12px; } .gloss dt::first-letter { text-transform: uppercase; }
.gloss dd { margin: 2px 0 0; }
.gch { margin-left: auto; flex: none; font-size: 12px; font-weight: 700; white-space: nowrap; text-decoration: none; padding: 2px 10px; border-radius: 999px; background: var(--def); color: var(--defink); }
mark { background: color-mix(in srgb, var(--gold) 55%, transparent); color: inherit; border-radius: 3px; }

.foot { border-top: 1px solid var(--line); padding: 24px var(--gut) 32px; font-size: 13px; color: var(--quiet); text-align: center; line-height: 1.5; }
.has-dock .foot { padding-bottom: 104px; } @media (min-width: 1100px) { .has-dock .foot { padding-bottom: 32px; } }
.footlogo { display: inline-block; margin-bottom: 10px; } .footlogo img { height: 48px; width: auto; display: block; }
.foot p { margin: 0 auto 6px; max-width: 40rem; } .foot strong { color: var(--quiet); }

@media print { .top, .side, .rail, .dock, .pager, .foot, .figbtn, .cover-btn, .selfmark, .donecard { display: none !important; } details.ans > .ansbody { display: block; } .page { max-width: none; } }

/* ---------- maths: one typeface per expression, breaks only before a relation ---------- */
.m { font-family: var(--math); font-size: 1.08em; font-variant-numeric: lining-nums tabular-nums; font-style: normal; font-weight: 400; }
strong .m, .wq .m, .term .m, th .m { font-weight: 700; }
.m.nw, .mseg { white-space: nowrap; }
em.var, i.var { font-family: var(--math); font-style: italic; }
.m sup, .m sub { font-size: 70%; position: relative; vertical-align: baseline; line-height: 0; } .m sup { top: -.42em; } .m sub { top: .22em; }
.m em.var + sup { margin-left: .04em; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; text-indent: 0; font-family: var(--math); font-size: .76em; line-height: 1.05; margin: 0 .1em; white-space: nowrap; }
.frac > span:first-child { border-bottom: max(1px, .075em) solid currentColor; padding: 0 .2em .05em; } .frac > span:last-child { padding: .06em .2em 0; }
.frac > .sl { font-size: 0; height: 0; padding: 0; border: 0; overflow: hidden; }
.frac.mix { margin-left: .06em; }
.hasfrac { line-height: 1.9; }
.bp { font-size: 1.6em; line-height: 1; vertical-align: -.14em; font-weight: 400; }
.rec { position: relative; } .rec::after { content: "˙"; position: absolute; left: 0; right: 0; top: -.62em; text-align: center; }
.rad { border-top: max(1px, .07em) solid currentColor; padding: 0 .12em; }
/* display lines: same left edge everywhere, continuation rows hang under the first */
p.dm { margin: .5em 0 .8em 1.25em; padding-left: 2em; text-indent: -2em; max-width: none; overflow-x: auto; overflow-y: hidden; }
p.dm .m, .wmath .m { font-size: 1.14em; }
p.dm .frac, .wmath .frac { font-size: .88em; line-height: 1.12; }
p.dm.hasfrac, .wmath:has(.frac) { line-height: 2.5; }
.box p.dm { margin-left: 0; }
.formula { font-family: var(--math); font-size: 1.14em; margin: .5em 0 .8em 1.25em; overflow-x: auto; }

/* parts (a) (b) (c) */
ol.parts { list-style: none; padding: 0; margin: .45em 0 0; display: grid; gap: .45em 1.5em; }
ol.parts.cols { grid-template-columns: repeat(auto-fill, minmax(7.5em, 1fr)); }
ol.parts > li { display: grid; grid-template-columns: 1.9em minmax(0, 1fr); margin: 0; }
.pl { color: var(--quiet); font-weight: 600; }
.ansbody ol.parts:first-child { margin-top: 0; }

/* ---------- worked examples ---------- */
.box.worked { background: var(--paper); border: 1px solid var(--workline); padding: 0 0 16px; overflow: hidden; }
.worked > .boxlabel { margin: 0; padding: 4px 6px 4px 16px; min-height: 46px; background: var(--workhead); color: var(--defink); }
.cover-btn { margin-left: auto; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--paper); color: var(--defink); font-size: 12.5px; font-weight: 700; letter-spacing: 0; text-transform: none; cursor: pointer; white-space: nowrap; }
.cover-btn:active { transform: scale(.97); }
.worked > .wq { margin: 0; padding: 14px 16px 2px; font-weight: 650; color: var(--head); }
.wpart { padding: 12px 16px 0; }
.wpart.lab { display: grid; grid-template-columns: 1.9em minmax(0, 1fr); }
.wpart + .wpart { margin-top: 12px; border-top: 1px solid var(--line); }
.wpart:not(:has(.wstep:not([hidden]))) { display: none; }
.wlab { font-weight: 700; color: var(--tealink); }
.wstep { margin: 0 0 .45em; } .wbody > .wstep:last-child { margin-bottom: 0; }
.wmath { padding-left: 2em; text-indent: -2em; overflow-x: auto; overflow-y: hidden; }
.wstep.wmath { margin: .3em 0 .55em; }
.wwhy { font-size: .93em; color: var(--quiet); }
.wstep.chk { margin-top: .75em; padding-top: .6em; border-top: 1px dashed var(--line); font-size: .93em; color: var(--quiet); }
.m.ans, .mseg.ans { font-weight: 700; background: var(--ans); padding: .1em .28em; margin: 0 -.06em; border-radius: .3em; -webkit-box-decoration-break: clone; box-decoration-break: clone; text-indent: 0; }
.worked.covered .trynow { display: none; }
.wcover { margin: 14px 16px 0; padding: 14px; border: 1px dashed var(--workline); border-radius: 12px; text-align: center; font-size: 14px; color: var(--quiet); }
.wcover p { margin: 0 0 10px; }
.wnext { min-height: 40px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--navy); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
:root[data-theme="dark"] .wnext { background: var(--teal); color: #06241D; }
.trynow { margin: 14px 16px 0; font-size: 14px; font-weight: 650; }
@media (min-width: 1100px) { .worked > .boxlabel { padding-left: 24px; } .worked > .wq { padding: 18px 24px 2px; } .wpart { padding: 14px 24px 0; } .wcover, .trynow { margin-left: 24px; margin-right: 24px; } .box.worked { padding-bottom: 20px; } }

/* ---------- answers stay out of sight until the reader switches them on ---------- */
.js:not(.answers-on) details.ans, .js:not(.answers-on) .tally { display: none !important; }
.answ { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 4px 0 0; border: 0; background: none; cursor: pointer; font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--quiet); -webkit-tap-highlight-color: transparent; }
.answ .track { position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: color-mix(in srgb, var(--quiet) 35%, transparent); transition: background .15s ease-out; }
.answ .track i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(14,36,57,.3); transition: transform .15s ease-out; }
.answ[aria-checked="true"] { color: var(--defink); } .answ[aria-checked="true"] .track { background: var(--tealink); } .answ[aria-checked="true"] .track i { transform: translateX(16px); }
.boxlabel .answ { margin-left: auto; }
.ansbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; margin: 0 0 24px; border-radius: 12px; background: var(--surface); font-size: 14px; color: var(--quiet); }

/* ---- usage records: the line in reading settings and the footer link to "What we record" (there is no notice) ---- */
.setnote { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--quiet); } .setnote a { color: var(--link); }
.foot .footrec { margin-top: 4px; } .foot .footrec a { color: var(--quiet); text-underline-offset: .2em; }
/* A message from "Continue on another phone" on a page with no panel for it (the shelf, say). */
.contnote { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; padding: 14px 16px; border-radius: 14px;
  background: var(--head); color: var(--paper); box-shadow: 0 10px 30px rgba(14,36,57,.28); font-size: 14px; line-height: 1.45; }
.contnote p { margin: 0 0 10px; }
.contnote button { min-height: 40px; padding: 0 20px; border-radius: 10px; border: 0; background: var(--paper); color: var(--head); font: inherit; font-weight: 700; cursor: pointer; }
@media print { .contnote { display: none; } }

/* ---- the bookshelf at /books/: one card per book ---- */
.shelflead { margin: 8px 0 24px; max-width: 46ch; color: var(--quiet); }
.shelf { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.shelfbook { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); text-decoration: none; transition: transform .15s ease-out, box-shadow .15s ease-out; }
.shelfbook:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(14,36,57,.12); } .shelfbook:active { transform: scale(.99); }
.shelfcover svg { display: block; width: 96px; height: auto; border-radius: 6px; box-shadow: 0 6px 16px rgba(14,36,57,.28); }
.shelftext { display: grid; gap: 4px; min-width: 0; } .shelftext b { font-size: 22px; line-height: 1.15; color: var(--head); letter-spacing: -.01em; }
.shelftext span { font-size: 15px; line-height: 1.35; } .shelftext small { font-size: 13px; color: var(--quiet); }
.shelfbook > .ico { color: var(--quiet); }

/* ---- the way back to the shelf of all books, in the top bar of every page ---- */
.tbooks { flex: none; height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; color: var(--head); text-decoration: none; font-size: 14px; font-weight: 700; margin-left: auto; }
.tbooks span { display: none; } .tbooks:active { background: var(--surface); }
.ttitle + .tbooks { margin-left: 0; }
@media (min-width: 600px) { .tbooks { padding: 0 12px; } .tbooks span { display: inline; } }
@media (hover: hover) { .tbooks:hover { background: var(--surface); } }
@media print { .tbooks { display: none; } }
.is-home .tbrand { margin-right: auto; }

/* ---- a name for each icon button when the pointer rests on it (or the keyboard reaches it) ---- */
.tback, .tbooks, .tset { position: relative; }   /* .figbtn is already positioned */
@media (hover: hover) {
  .tback[aria-label]:hover::after, .tbooks[aria-label]:hover::after, .tset[aria-label]:hover::after, .figbtn[aria-label]:hover::after,
  .tback[aria-label]:focus-visible::after, .tbooks[aria-label]:focus-visible::after, .tset[aria-label]:focus-visible::after, .figbtn[aria-label]:focus-visible::after {
    content: attr(aria-label); position: absolute; top: calc(100% + 6px); right: 0; z-index: 80; width: max-content; max-width: 240px; padding: 7px 10px; border-radius: 8px;
    background: var(--head); color: var(--paper); font: 600 12.5px/1.3 Inter, system-ui, sans-serif; letter-spacing: 0; text-transform: none; text-align: left; white-space: normal; pointer-events: none; box-shadow: 0 6px 18px rgba(14,36,57,.25); }
  .tback[aria-label]:hover::after, .tback[aria-label]:focus-visible::after { right: auto; left: 0; }
}

/* ---- chemistry: a formula never breaks; an equation breaks only before + or the arrow ---- */
.chem { font-family: var(--math); font-size: 1.08em; font-variant-numeric: lining-nums; white-space: nowrap; }
.chem sub, .chem sup { font-size: 70%; position: relative; vertical-align: baseline; line-height: 0; } .chem sub { top: .22em; } .chem sup { top: -.42em; }
.chemeq .chem { font-size: 1.08em; }
p.chemline { margin: .5em 0 .8em 1.25em; max-width: none; overflow-x: auto; overflow-y: hidden; } p.chemline .chem { font-size: 1.14em; }
.box p.chemline { margin-left: 0; }
strong .chem, b .chem, .wq .chem { font-weight: 700; }

/* ---- science books: safety notes, things never to try at home, and three views of one idea ---- */
.safety { background: var(--mist); box-shadow: inset 4px 0 0 #E5484D; } .safety .boxlabel { color: var(--mistink); --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 2.6l7 12.3H2zM9 7.4v3.4M9 13v.1' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.never { background: #8E2327; color: #fff; } .never .boxlabel { color: #FFD7D7; --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='6.6' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M4.4 13.6l9.2-9.2' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }
.never a, .never .m, .never .chem, .never strong { color: #fff; }
.views { background: var(--surface); } .views .boxlabel { color: var(--tealink); }

/* ---- report a problem: a quiet link under a figure, a worked example, a revealed answer and the page; and the panel it opens ---- */
.rp { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--quiet); text-align: right; }
.rpb { border: 0; background: none; min-height: 36px; padding: 8px 0; font-size: 12.5px; color: var(--quiet); cursor: pointer; text-decoration: underline; text-underline-offset: .2em;
  text-decoration-color: color-mix(in srgb, var(--quiet) 40%, transparent); -webkit-tap-highlight-color: transparent; }
.worked > .rp { margin: 6px 16px -10px; } .ansbody > .rp { margin: 4px 0 -6px; } .page > .rp { margin-top: 28px; text-align: center; }
.rpp { margin: 4px 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 14px; text-align: left; }
.worked > .rpp { margin: 12px 16px 0; }
.rpp fieldset { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.rpp legend, .rpl { display: block; padding: 0; margin: 0 0 4px; font-weight: 700; color: var(--head); }
.rpp fieldset label { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.rpp input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--tealink); }
.rpp textarea { display: block; width: 100%; font: inherit; font-size: 16px; line-height: 1.4; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: vertical; }
.rph, .rpe { margin: 6px 0 12px; font-size: 12.5px; color: var(--quiet); } .rpe { color: var(--red); font-weight: 650; }
.rpa { display: flex; gap: 8px; }
.rpa button { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.rpa .rps { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .rpa .rps { background: var(--teal); border-color: var(--teal); color: #06241D; }
.offscreen { position: fixed; left: -999px; top: 0; opacity: 0; }

/* ---- share this page, and the book as a PDF ---- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0 0; font-size: 13px; color: var(--quiet); }
.share span { flex: 1 0 100%; }
.share a, .share button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-size: 13.5px; font-weight: 650; text-decoration: none; cursor: pointer; }
.share a:active, .share button:active { background: var(--surface); }
.pdfdl { display: grid; gap: 6px; margin: 12px 0 0; font-size: 13px; color: var(--quiet); }
.pdfbtn { justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--head);
  font-size: 15px; font-weight: 700; text-decoration: none; }

/* ---- the four question survey, shown once at the end of a section ---- */
.survey { margin: 16px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.svlead { margin: 0 0 10px; font-size: 13px; color: var(--quiet); }
.svq { margin: 0 0 12px; font-weight: 700; color: var(--head); } .svq small { margin-left: 6px; font-size: 12.5px; font-weight: 550; color: var(--quiet); white-space: nowrap; }
.svo { display: flex; flex-wrap: wrap; gap: 8px; }
.svo button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 14.5px; font-weight: 650; cursor: pointer; }
.svo .svx { background: none; border-style: dashed; color: var(--quiet); }
.sve { display: flex; gap: 20px; margin: 12px 0 -6px; }
.sve button { border: 0; background: none; min-height: 40px; padding: 8px 0; font-size: 13px; color: var(--quiet); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }

/* ---- "You told us, we fixed it", the page served at /books/fixes ---- */
.fixcount { display: flex; flex-wrap: wrap; gap: 6px 28px; padding: 12px 16px; border-radius: 12px; background: var(--surface); } .fixcount b { color: var(--head); font-size: 1.15em; }
.fixes { list-style: none; padding: 0; margin: 20px 0 0; } .fixes li { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fixline { margin: 0 0 4px; font-weight: 600; } .fixmeta { margin: 0; font-size: 13px; color: var(--quiet); }
.fixnone { margin-top: 20px; padding: 16px; border-radius: var(--r); background: var(--def); }
@media print { .rp, .rpp, .share, .survey, .pdfdl { display: none !important; } }

/* ---- save for offline: the button in each chapter, the panel on the contents page, the Home screen hint ---- */
.sv { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 12px 0 0; font-size: 13.5px; color: var(--quiet); } .sv:empty { display: none; }
.chap .sv { margin: 0; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.svbtn { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--head); font-size: 14px; font-weight: 700; line-height: 1.25; text-align: left; cursor: pointer; }
.svbtn:active { background: var(--surface); } .svbtn[disabled] { opacity: .5; cursor: default; }
.svok { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 700; color: var(--tealink); } .svok .ico { width: 18px; height: 18px; }
.svrm { border: 0; background: none; min-height: 36px; padding: 8px 0; font-size: 13px; color: var(--quiet); cursor: pointer; text-decoration: underline; text-underline-offset: .2em;
  text-decoration-color: color-mix(in srgb, var(--quiet) 40%, transparent); }
.svprog { font-weight: 650; color: var(--head); font-variant-numeric: tabular-nums; }
.svmsg { flex: 1 0 100%; margin: 6px 0 0; font-size: 13.5px; font-weight: 650; color: var(--red); }
.chap.saved .ct small::after { content: " · saved"; font-weight: 650; color: var(--tealink); }
.offl { margin: 24px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); }
.offl h2 { margin: 0; font-size: 15px; letter-spacing: 0; } .offl h3 { margin: 18px 0 2px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--quiet); }
.svnote { margin: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--quiet); }
.svlist { list-style: none; padding: 0; margin: 0; }
.svlist li { display: flex; align-items: center; gap: 12px; min-height: 46px; margin: 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.3; }
.svlist span { flex: 1; min-width: 0; } .svlist small { white-space: nowrap; color: var(--quiet); }
.svfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; margin: 6px 0 -6px; font-size: 13px; color: var(--quiet); }
.upd { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--try); color: var(--ink); font-size: 14px; } .upd p { margin: 0 0 10px; }
.a2hs { margin: 16px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); font-size: 14px; } .a2hs p { margin: 0 0 10px; }
.a2hs div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
@media print { .sv, .offl, .a2hs { display: none !important; } }

/* The ways to read with no data sit under the contents, folded, so the first thing on a book's page is the book. */
.nodata { margin: 28px 0 0; border-top: 1px solid var(--line); padding-top: 6px; }
.nodata > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 650; color: var(--ink); }
.nodata > summary::-webkit-details-marker { display: none; }
.nodata > summary .ico { flex: none; transition: transform .15s; } .nodata[open] > summary .ico { transform: rotate(180deg); }
.nodata .pdfdl { margin-top: 4px; } .nodata .offl { margin-top: 16px; }
@media print { .nodata { display: none !important; } }

/* ---- continue on another phone: a fold under the contents, a code, its link and its QR code ---- */
.cont { margin-top: 8px; }
.contin > p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.controw { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.contuse { margin: 8px 0 0; } .contuse label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--head); }
.contuse input { flex: 1 1 140px; min-width: 0; max-width: 220px; height: 44px; padding: 0 14px; font: inherit; font-size: 17px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.contout { margin: 12px 0 4px; font-size: 14px; } .contout:empty { display: none; } .contout p { margin: 0 0 8px; }
.contcode { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.contbig { margin: 6px 0 2px !important; font: 800 30px/1.2 var(--sans); letter-spacing: .12em; color: var(--head); font-variant-numeric: tabular-nums; }
.contlink { font-size: 13px; overflow-wrap: anywhere; } .contlink a { color: var(--link); }
.contqr { width: 200px; max-width: 70%; margin: 8px 0 12px; padding: 0; } .contqr svg { display: block; width: 100%; height: auto; border-radius: 6px; }
.contcode .svbtn { display: inline-flex; align-items: center; text-decoration: none; }
.contsmall { font-size: 12.5px !important; color: var(--quiet); margin-top: 12px !important; }
.contnote p { margin: 0 0 10px; }
@media print { .cont { display: none !important; } }

/* ---- the survey's town question: a search box, "Use my location", the list, and the other choices ---- */
.svfind { flex: 1 0 100%; height: 44px; padding: 0 16px; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; }
.svo .svloc { border: 0; border-radius: 0; background: none; min-height: 40px; padding: 8px 0; font-size: 13.5px; font-weight: 650; color: var(--link); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.svmsg { flex: 1 0 100%; margin: 0; font-size: 13.5px; color: var(--ink); } .svmsg:empty { display: none; } .svmsg button { margin-left: 8px; }
.svnone { font-size: 13.5px; color: var(--quiet); }
.svo .svo { flex: 1 0 100%; }

/* The survey's place question: quiet text links under the choices, one small thing on screen at a time. */
.svalt { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 0; }
.svo .svlink { border: 0; border-radius: 0; background: none; min-height: 40px; padding: 8px 0; font-size: 13.5px; font-weight: 600; color: var(--quiet); text-decoration: underline; text-underline-offset: 3px; }

/* Connection: a small "Offline" mark in the top bar, and a short notice when the connection goes or comes back. */
.tnet { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 8px; margin: 0 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--head); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tnet[hidden] { display: none; }
.tnet svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nettoast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 999px; background: #0E2439; color: #fff; font-size: 14px; font-weight: 650; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.28); pointer-events: none; opacity: 0; transform: translate(-50%, 16px); transition: opacity .25s, transform .25s; }
.nettoast.show { opacity: 1; transform: translate(-50%, 0); }
.nettoast.good { background: #14705B; }
@media print { .tnet, .nettoast { display: none !important; } }

/* Practise this section (practice.js). */
.prac { margin: 36px 0 8px; padding: 20px 18px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); scroll-margin-top: calc(var(--top) + 12px); }
.prac[hidden] { display: none; }
.prtrial { margin: 0 0 12px; font-size: 12px; font-weight: 700; color: var(--goldink); }
.prkick { margin: 0 0 4px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 750; color: var(--tealink); }
.prtitle { margin: 0 0 8px; font-size: 22px; line-height: 1.2; color: var(--head); }
.prnote, .prrule { margin: 0 0 14px; font-size: 15px; color: var(--quiet); } .prrule { font-size: 13px; }
.prhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 13px; color: var(--tealink); letter-spacing: .04em; }
.prdots { display: flex; gap: 6px; } .prdots i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.prdots i.on { background: var(--head); } .prdots i.ok { background: var(--teal); } .prdots i.no { background: var(--gold); }
.prstem { margin: 0 0 16px; font-size: 1.06em; color: var(--head); }
.prac .var { font-family: var(--math); font-style: italic; font-size: 1.08em; }
.prac sup { font-size: 70%; line-height: 0; position: relative; top: -.42em; vertical-align: baseline; }
.prac sub { font-size: 70%; line-height: 0; position: relative; top: .22em; vertical-align: baseline; }
.propts { display: grid; gap: 10px; }
.propt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px; text-align: left; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
.prmark { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--quiet); }
.propt[aria-pressed="true"] { border-color: var(--head); } .propt[aria-pressed="true"] .prmark { border-color: var(--head); background: radial-gradient(circle, var(--head) 0 5px, transparent 6px); }
.propt.wrong { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--paper)); }
.propt.right { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 16%, var(--paper)); } .propt.right .prmark { border-color: var(--tealink); background: radial-gradient(circle, var(--tealink) 0 5px, transparent 6px); }
.propts.locked .propt { cursor: default; }
.prwork { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); } .prwork p { margin: 4px 0; }
.prblank span { display: inline-block; padding: 2px 12px; border-radius: 8px; border: 1.5px dashed var(--quiet); color: var(--quiet); font-size: 13px; }
.prnum input { width: 100%; max-width: 240px; height: 52px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 20px; }
.prnum { display: flex; align-items: center; gap: 8px; } .prnum input { flex: 1 1 auto; min-width: 0; }
.prsign { flex: none; min-width: 52px; height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 17px; cursor: pointer; }
.prnum input:focus { outline: none; border-color: var(--head); } .prnum input.wrong { border-color: var(--gold); }
.prunits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--quiet); }
.prunit { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.prunit[aria-pressed="true"] { border-color: var(--head); background: var(--head); color: var(--paper); }
.prorder { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prorder li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); }
.prline { flex: 1; min-width: 0; overflow-x: auto; } .prmove { flex: none; display: flex; gap: 4px; }
.prmove button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--head); font-size: 18px; cursor: pointer; } .prmove button:disabled { opacity: .3; cursor: default; }
.prfb { margin-top: 14px; } .prfb:empty { display: none; }
.prsay { margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; font-weight: 650; }
.prfb.ok .prsay { background: color-mix(in srgb, var(--teal) 20%, var(--paper)); color: var(--head); } .prfb.no .prsay, .prfb.no:not(:has(.prsay)) { background: color-mix(in srgb, var(--gold) 22%, var(--paper)); color: var(--head); }
.prfb.no:not(:has(.prsay)) { padding: 10px 14px; border-radius: 12px; font-weight: 650; }
.pranswer { margin: 0 0 10px; }
.prsol { padding: 12px 14px; border-radius: 12px; background: var(--ans); } .prsol b { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--tealink); margin-bottom: 6px; }
.prsol ol { margin: 0; padding-left: 1.3em; } .prsol li { margin: 4px 0; }
.practs { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 16px; }
.prgo { min-height: 48px; padding: 0 26px; border-radius: 999px; border: 0; background: var(--navy); color: #fff; font: inherit; font-weight: 750; cursor: pointer; }
:root[data-theme="dark"] .prgo { background: var(--teal); color: #06241D; } .prgo:disabled { opacity: .4; cursor: default; }
.prlink { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--link); font: inherit; font-weight: 650; text-decoration: underline; cursor: pointer; }
.prscore { margin: 0 0 6px; font-size: 20px; color: var(--head); } .prsub { margin: 18px 0 8px; font-size: 15px; color: var(--head); }
.prskills { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.prskills li { padding: 10px 14px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--line); }
.prskills li.lv1 { border-left-color: var(--gold); } .prskills li.lv2 { border-left-color: var(--teal); }
.prname { display: block; color: var(--head); font-weight: 650; } .prlv { display: block; font-size: 13px; color: var(--quiet); }
@media print { .prac { display: none !important; } }

/* ---- the Noticeboard: our own notices and free listings, in a few fixed spaces. Never in the text, never in practice. ---- */
.nb { margin: 28px 0 8px; }
.nb[hidden] { display: none; }
.nbhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.nbhead h2 { font-size: 13px; margin: 0; color: var(--quiet); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.nbhead a { font-size: 14px; font-weight: 700; color: var(--link); text-decoration: none; white-space: nowrap; }
.nbwhere { font-size: 13.5px; color: var(--quiet); margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.nbwhere select { font: inherit; font-weight: 700; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 40px; max-width: 100%; }
/* A notice is a plain card in the book's own type. An advert is the same card in a shaded box used nowhere else, under the word Advert. */
:root { --ad: #EEF0F8; --adline: #B9C0DC; --adink: #2F3A75; }
:root[data-theme="dark"] { --ad: #1B2140; --adline: #3B4680; --adink: #C3CBF7; }
.nbitem { position: relative; margin: 0 0 10px; }
.nbgone { margin: 0 0 10px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r); font-size: 14px; color: var(--quiet); } .nbgone button { min-height: 36px; padding: 0 8px; font: inherit; font-weight: 650; color: var(--link); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.nbcard { display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); color: var(--ink); text-decoration: none; }
.nbtxt { flex: 1; min-width: 0; display: block; }
.nbkind { display: block; font-size: 12.5px; line-height: 1.35; font-weight: 650; color: var(--tealink); margin: 0 0 4px; }
.nbitem .nbkind { padding-right: 46px; }
.nbkind b { font-weight: 800; }
.nbcard > .nbtxt > b { display: block; font-size: 16px; line-height: 1.3; color: var(--head); margin: 0 0 3px; font-weight: 750; }
.nbsub { display: block; font-size: 14px; line-height: 1.45; color: var(--ink); }
.nbmeta { display: block; font-size: 13px; color: var(--quiet); margin-top: 5px; }
.nbmore { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.nbthumb { flex: none; width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--surface); margin-top: 22px; }
.nbpaid { background: var(--ad); border-color: var(--adline); }
.nbpaid .nbkind, .nbpaidpage > .nbkind { color: var(--adink); }
.nbpaid .nbkind b, .nbpaidpage > .nbkind b { background: var(--adink); color: var(--ad); border-radius: 5px; padding: 1px 7px; margin-right: 2px; }
.nbhide { position: absolute; top: 4px; right: 4px; min-width: 44px; min-height: 36px; padding: 0 10px; font: inherit; font-size: 12.5px; font-weight: 650; color: var(--quiet); background: none; border: 0; border-radius: 10px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.nbline { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.nbline em { font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--tealink); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.nbline.nbpaid { background: var(--ad); border-color: var(--adline); } .nbline.nbpaid em { color: var(--adink); }
.nbline span { flex: 1; min-width: 0; }
.nbline svg { width: 16px; height: 16px; stroke: var(--quiet); fill: none; stroke-width: 2.2; flex: none; }
.nbchips { display: flex; gap: 8px; overflow-x: auto; padding: 2px var(--gut) 12px; margin: 0 calc(-1 * var(--gut)); }
.nbchips button { flex: none; font: inherit; font-size: 13.5px; font-weight: 700; padding: 7px 12px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.nbchips button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.nbshare { font-size: 14px; font-weight: 700; color: var(--link); }
.nbnone, .nbnote { font-size: 13px; color: var(--quiet); line-height: 1.5; margin: 14px 0 0; }
/* A notice's own page. */
.nbpage > .nbkind { font-size: 13.5px; margin: 0 0 6px; }
.nbart { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; border-radius: var(--r); background: var(--surface); margin: 6px 0 18px; }
.nbart.nbtall { aspect-ratio: 4 / 5; max-width: 360px; }
.nblead { font-size: 1.08em; color: var(--head); font-weight: 600; }
.nbfacts { margin: 18px 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.nbfacts div { display: flex; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); } .nbfacts div:first-child { border-top: 0; }
.nbfacts dt { flex: 0 0 34%; color: var(--quiet); font-size: 14px; } .nbfacts dd { margin: 0; flex: 1; font-weight: 600; font-size: 15px; }
.nbleave { margin: 22px 0 6px; }
.nbgo { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: 14px; background: var(--navy); color: #fff; font-weight: 750; text-decoration: none; }
.nbgo .ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; }
:root[data-theme="dark"] .nbgo { background: var(--teal); color: #06241D; }
.nbleave small { display: block; text-align: center; margin-top: 8px; font-size: 13px; color: var(--quiet); }
.nbtools { margin: 14px 0 0; text-align: center; }
.nbabout { margin: 30px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14.5px; }
.nbabout h2 { font-size: 17px; margin: 0 0 8px; color: var(--head); } .nbabout ul { padding-left: 20px; margin: 0 0 12px; } .nbabout li { margin: 0 0 6px; }
.nbswitch label { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 600; } .nbswitch input { width: 20px; height: 20px; }
/* The way to the Noticeboard in the top bar, and the funder's quiet line. */
.tnb { position: relative; flex: none; height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; color: var(--head); text-decoration: none; font-size: 14px; font-weight: 700; }
.tnb .ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tnb span { display: none; } .is-home .tnb { margin-left: auto; }
/* The bar never grows wider than the screen: the name gives way first. */
.is-home .tbrand { min-width: 0; flex: 0 1 auto; margin-right: 0; } .tbrand .tb { min-width: 0; } .tbrand .tb > span, .tbrand b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topin { min-width: 0; overflow: hidden; }
.is-home[data-book="."] .tnb span { display: inline; } .is-home[data-book="."] .tnb { padding: 0 10px; }   /* the word only on the shelf, where there is room */
.tnb i { display: none; position: absolute; top: 9px; left: 26px; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); border: 2px solid var(--paper); } .tnb.new i { display: block; }
.tnb:active { background: var(--surface); }
.funder { font-size: 13px; color: var(--quiet); margin: 10px 2px 14px; } .funder a, .funder strong { color: var(--ink); font-weight: 700; font-size: inherit; display: inline; }
span.funder { display: block; margin: 4px 0 0; font-size: 12.5px; }
@media (hover: hover) { .nbcard:hover, .nbline:hover { border-color: var(--teal); } }

/* ---- search (web/search.js): the button in the top bar, the box on the shelf and on a book's contents page, and the top of
   the sheet, which reader.js shows at once while search.js and search.css load. The rest of its look is in search.css. ---- */
.tsrch { display: none; position: relative; flex: none; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--head); cursor: pointer; }
.js .tsrch { display: grid; } .tsrch:active { background: var(--surface); }
.is-home .tsrch { margin-left: auto; } .is-home .tsrch + .tnb, .is-home .tsrch ~ .tbooks { margin-left: 0; }
@media (hover: hover) { .tsrch:hover { background: var(--surface); }
  .tsrch:hover::after, .tsrch:focus-visible::after { content: attr(aria-label); position: absolute; top: calc(100% + 6px); right: 0; z-index: 80; width: max-content; padding: 7px 10px; border-radius: 8px;
    background: var(--head); color: var(--paper); font: 600 12.5px/1.3 Inter, system-ui, sans-serif; pointer-events: none; box-shadow: 0 6px 18px rgba(14,36,57,.25); } }
@media (max-width: 359px) { .is-home[data-book="."] .tnb span { display: none; } .is-home[data-book="."] .tnb { padding: 0; } }   /* at 320 px the bar keeps the name whole */
.sbox { display: none; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin: 4px 0 20px; padding: 0 12px 0 16px; border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--quiet); font: inherit; font-size: 16px; text-align: left; cursor: text; }
.js .sbox { display: flex; } .sbox span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbox .ico { color: var(--head); } .sbox kbd { display: none; font: 600 12px/1 var(--sans); padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--quiet); }
@media (hover: hover) and (pointer: fine) { .sbox kbd { display: inline-block; } .sbox:hover { border-color: var(--teal); } }
.homemeta + .sbox { margin-top: 12px; }
dialog.srch { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink); overflow: hidden; }
dialog.srch::backdrop { background: var(--scrim); }
.srbox { display: flex; flex-direction: column; height: 100%; }
.srhead { flex: none; display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 4px; border-bottom: 1px solid var(--line); }
.srhead button { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--head); cursor: pointer; }
.srhead svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.srfield { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); }
.srfield:focus-within { border-color: var(--tealink); }
.srfield svg { flex: none; color: var(--quiet); width: 20px; height: 20px; }
.srfield input { flex: 1; min-width: 0; height: 100%; border: 0; padding: 0; background: none; color: var(--ink); font: inherit; font-size: 17px; outline: none; }
.srfield input::-webkit-search-cancel-button { display: none; }
.srfield input::placeholder { color: var(--quiet); opacity: 1; }
.srwait { margin: 0; padding: 20px; font-size: 15px; color: var(--quiet); }
@media (min-width: 720px) {
  dialog.srch { inset: 8vh 0 auto; width: min(640px, calc(100% - 48px)); height: auto; max-height: 84vh; margin: 0 auto; border-radius: 20px; box-shadow: 0 24px 60px rgba(14,36,57,.3); }
  dialog.srch .srbox { height: auto; max-height: 84vh; }
  .srhead { padding: 12px 12px 12px 8px; }
}
@media print { .tsrch, .sbox, dialog.srch { display: none !important; } }

/* The books' own privacy page (privacy.html, export.py write_privacy_page): the switch for usage records and the
   reader's survey answers, both drawn by switch.js. */
.privacy ul { padding-left: 1.2em; } .privacy li { margin: 0 0 10px; }
.recswitch { margin: 16px 0; }
.recbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; border: 2px solid var(--head); border-radius: var(--r); background: var(--paper); color: var(--ink); font-weight: 700; text-align: left; cursor: pointer; }
.recbtn:disabled { opacity: .6; cursor: default; }
.recbtn .umhpill { flex: none; min-width: 44px; padding: 4px 10px; border-radius: 99px; background: var(--teal); color: #06241D; font-size: 14px; font-weight: 800; text-align: center; }
.recbtn[aria-checked="false"] .umhpill { background: var(--line); color: var(--ink); }
.recswitch .umhstate, .recdate { margin: 8px 0 0; font-size: 14px; color: var(--quiet); }
.recanswers form { margin: 12px 0 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.recanswers select { display: block; width: 100%; min-height: 44px; margin-top: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; }
.recanswers form .recbtn { width: auto; margin-top: 12px; }
