/* Beyond STEP: site style, matching drafts/latex/stepbook.sty */
:root {
  --ink: #1F2A33;
  --ink-soft: #4a5761;
  --teal: #1D5C63;
  --teal-pale: #E8F1F1;
  --amber: #B5651D;
  --amber-pale: #FBF1E6;
  --plum: #5B3F72;
  --plum-pale: #F2EDF6;
  --rule: #B9C6C8;
  --paper: #FFFFFF;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "TeX Gyre Pagella", "URW Palladio L", Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --measure: 44rem;
}
/* Chinese editions: Latin text keeps the families above, Chinese falls back to these */
:root:lang(zh) {
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "TeX Gyre Pagella", "URW Palladio L", Georgia,
           "Noto Serif CJK HK", "Noto Serif HK", "Songti TC", "PMingLiU", "MingLiU", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", "Noto Sans CJK HK", "Noto Sans HK",
          "PingFang HK", "Microsoft JhengHei", sans-serif;
}
:root:lang(zh-Hans) {
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "TeX Gyre Pagella", "URW Palladio L", Georgia,
           "Noto Serif CJK SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", "Noto Sans CJK SC", "Noto Sans SC",
          "PingFang SC", "Microsoft YaHei", sans-serif;
}
:root:lang(ja) {
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "TeX Gyre Pagella", "URW Palladio L", Georgia,
           "Noto Serif CJK JP", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", "Noto Sans CJK JP", "Noto Sans JP",
          "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}
:root:lang(ko) {
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "TeX Gyre Pagella", "URW Palladio L", Georgia,
           "Noto Serif CJK KR", "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", "Noto Sans CJK KR", "Noto Sans KR",
          "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
:lang(zh) body, :lang(ja) body { line-height: 1.85; letter-spacing: 0.02em; }
:lang(ko) body { line-height: 1.8; word-break: keep-all; overflow-wrap: break-word; }
:lang(zh) em, :lang(ja) em, :lang(ko) em { font-style: normal; font-weight: 600; }
:lang(zh) .hero-kicker, :lang(zh) .ch-kicker, :lang(ja) .hero-kicker, :lang(ja) .ch-kicker { letter-spacing: 0.04em; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.09rem;
  line-height: 1.6;
}
a { color: var(--teal); }
a:hover { color: var(--amber); }
img { max-width: 100%; height: auto; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: calc(var(--measure) + 32px); }

/* ---------- header / footer ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 3.4rem; }
.brand { font-family: var(--sans); font-weight: 700; color: var(--teal); text-decoration: none; letter-spacing: 0.01em; font-size: 1.05rem; }
.site-header nav a { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft); text-decoration: none; margin-left: 1.2rem; }
.site-header nav a:hover { color: var(--amber); }
.site-header nav a.lang-switch + a.lang-switch { margin-left: 0.4rem; }
.site-header nav a.lang-switch { border: 1px solid var(--rule); border-radius: 3px; padding: 0.05rem 0.45rem; }
.site-header nav a.lang-switch:hover { border-color: var(--amber); }
.mt-note { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-soft); background: var(--teal-pale); border-left: 3px solid var(--teal); padding: 0.5rem 0.8rem; margin: 1rem 0; }
.site-footer { margin-top: 4rem; border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; font-family: var(--sans); font-size: 0.82rem; color: var(--ink-soft); }
.site-footer p { margin: 0.25rem 0; }

/* ---------- banners ---------- */
.hero, .chapter-banner, .section-banner { background: var(--teal); color: #fff; }
.hero { border-bottom: 6px solid var(--amber); padding: 4.5rem 0 3.5rem; }
.hero-kicker, .ch-kicker { font-family: var(--sans); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: #b9d0d2; }
.hero h1 { font-family: var(--sans); font-size: clamp(2.6rem, 7vw, 4.2rem); line-height: 1.05; margin: 0.4rem 0 0.6rem; }
.hero-sub { font-style: italic; font-size: 1.3rem; margin: 0; color: #e3eeee; max-width: 36rem; }

.chapter-banner { border-bottom: 6px solid var(--amber); padding: 3.5rem 0 2.6rem; }
.ch-num { font-family: var(--sans); font-weight: 700; font-size: clamp(5rem, 14vw, 7.5rem); line-height: 0.9; margin: 0.2rem 0 1.4rem; }
.chapter-banner h1 { font-family: var(--sans); font-size: clamp(1.9rem, 5vw, 2.7rem); line-height: 1.1; margin: 0 0 0.6rem; }
.strap { font-style: italic; font-size: 1.15rem; color: #dbe8e8; margin: 0; max-width: 38rem; }

.section-banner { padding: 1.4rem 0 1.9rem; }
.section-banner .wrap { max-width: calc(var(--measure) + 32px); }
.crumb { font-family: var(--sans); font-size: 0.82rem; color: #b9d0d2; text-decoration: none; }
.crumb:hover { color: #fff; }
.src { font-family: var(--sans); font-size: 0.85rem; color: #cfe0e1; letter-spacing: 0.04em; margin-top: 0.3rem; }
.sec-head { display: flex; align-items: center; gap: 1.1rem; margin-top: 1.1rem; }
.sec-num { font-family: var(--sans); font-weight: 700; font-size: clamp(2.4rem, 8vw, 3.4rem); line-height: 1; flex: none; }
.sec-head h1 { font-family: var(--sans); font-size: clamp(1.45rem, 4.5vw, 2rem); line-height: 1.15; margin: 0; }

/* ---------- downloads ---------- */
.downloads { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.6rem 0 0.6rem; }
.dl { display: inline-flex; align-items: center; gap: 0.7rem; padding: 0.6rem 1rem 0.6rem 0.8rem; border: 1px solid var(--rule); border-radius: 4px; text-decoration: none; color: var(--ink); background: #fff; }
.dl:hover { border-color: var(--teal); background: var(--teal-pale); color: var(--ink); }
.dl-icon { width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--teal); flex: none; position: relative; }
.dl-icon::after { content: ""; position: absolute; left: 50%; top: 45%; width: 0.5rem; height: 0.5rem; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: translate(-50%, -50%) rotate(45deg); }
.dl-label { display: block; font-family: var(--sans); font-weight: 700; font-size: 0.92rem; color: var(--teal); }
.dl-sub { display: block; font-family: var(--sans); font-size: 0.78rem; color: var(--ink-soft); }

/* ---------- contents ---------- */
.contents-head { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); margin: 2.4rem 0 0.8rem; }
.toc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.toc li { display: flex; align-items: center; gap: 0.6rem; border-bottom: 1px solid var(--rule); }
.toc-link { flex: 1; display: grid; grid-template-columns: 2.6rem 1fr auto; gap: 0.6rem; align-items: baseline; padding: 0.6rem 0; text-decoration: none; color: var(--ink); }
.toc-link:hover .toc-title { color: var(--teal); text-decoration: underline; }
.toc-num { font-family: var(--sans); font-weight: 700; color: var(--teal); }
.toc-src { font-family: var(--sans); font-size: 0.75rem; color: #6c9497; white-space: nowrap; }
.toc-ws { font-family: var(--sans); font-size: 0.75rem; font-weight: 700; color: var(--amber); text-decoration: none; border: 1px solid var(--amber); border-radius: 3px; padding: 0.1rem 0.45rem; }
.toc-ws:hover { background: var(--amber-pale); }
@media (max-width: 34rem) { .toc-src { display: none; } .toc-link { grid-template-columns: 2.3rem 1fr; } }

/* ---------- home ---------- */
.lede { font-size: 1.22rem; }
.parts { list-style: none; padding: 0; margin: 0; counter-reset: part; display: grid; gap: 0.5rem; }
.parts li { counter-increment: part; display: grid; grid-template-columns: 2rem 1fr; column-gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.parts li::before { content: counter(part); grid-row: span 2; font-family: var(--sans); font-weight: 700; color: var(--teal); font-size: 1.1rem; }
.parts strong { font-family: var(--sans); font-size: 0.95rem; color: var(--teal); }
.parts span { font-size: 0.98rem; }
.note { font-size: 0.98rem; color: var(--ink-soft); margin-top: 1.2rem; }

/* ---------- newsletter ---------- */
.newsletter-box { margin: 2.2rem 0 0.6rem; padding: 1.2rem 1.3rem 1rem; border: 1px solid var(--rule); border-left: 5px solid var(--amber); border-radius: 4px; background: var(--amber-pale); }
.newsletter-box h2 { font-family: var(--sans); font-size: 1.1rem; color: var(--amber); margin: 0 0 0.3rem; }
.nl-text p { margin: 0 0 0.8rem; }
.nl-form { display: flex; gap: 0.5rem; max-width: 30rem; }
.nl-form input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: 0.5rem 0.75rem; border: 1px solid var(--rule); border-radius: 4px; background: #fff; color: var(--ink); }
.nl-form input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.nl-form button { font-family: var(--sans); font-weight: 700; font-size: 0.95rem; padding: 0 1.1rem; border: 0; border-radius: 4px; background: var(--amber); color: #fff; cursor: pointer; }
.nl-form button:hover { background: #9a5518; }
.nl-small { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-soft); margin: 0.6rem 0 0; }
.newsletter-callout { margin: 2.4rem 0 0; padding: 0.8rem 1rem; border-left: 4px solid var(--amber); background: var(--amber-pale); font-size: 0.98rem; }
.newsletter-callout strong { font-family: var(--sans); color: var(--amber); }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.ch-card { display: flex; gap: 0.9rem; padding: 1.1rem 1.1rem 1rem; border: 1px solid var(--rule); border-radius: 4px; text-decoration: none; color: var(--ink); background: #fff; }
.ch-card.live { border-color: var(--teal); border-top: 4px solid var(--teal); }
.ch-card.live:hover { background: var(--teal-pale); color: var(--ink); }
.card-num { font-family: var(--sans); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--rule); flex: none; width: 2.2rem; }
.ch-card.live .card-num { color: var(--teal); }
.card-body { display: flex; flex-direction: column; gap: 0.35rem; }
.card-title { font-family: var(--sans); font-weight: 700; font-size: 1rem; line-height: 1.25; }
.card-blurb { font-size: 0.92rem; line-height: 1.45; color: var(--ink-soft); }
.card-status { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; color: var(--teal); margin-top: auto; padding-top: 0.3rem; }
.card-status.soon { color: #8b989e; font-weight: 400; }

/* ---------- prose ---------- */
.prose { margin-top: 1.4rem; }
.prose p { margin: 0 0 0.8rem; hyphens: auto; }
.prose h2 { font-family: var(--sans); font-size: 1.28rem; color: var(--teal); margin: 2.3rem 0 0.8rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--rule); }
.prose h3 { font-family: var(--sans); font-size: 1.02rem; color: var(--ink); margin: 1.7rem 0 0.5rem; }
.prose h4.stage { font-family: var(--sans); font-size: 1.02rem; margin: 1.8rem 0 0.6rem; }
.stage-n { color: var(--amber); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 0.5rem; }
.prose strong { font-family: var(--sans); font-size: 0.94em; }
.prose ul { padding-left: 1.4rem; list-style: none; }
.prose ul > li { position: relative; margin-bottom: 0.35rem; }
.prose ul > li::before { content: "\25B8"; position: absolute; left: -1.2rem; color: var(--teal); }
.prose ol { padding-left: 2.2rem; }
.prose li > p { margin-bottom: 0.3rem; }
.prose ol.roman { list-style: none; counter-reset: rom; }
.prose ol.roman > li { counter-increment: rom; position: relative; }
.prose ol.roman > li::before { content: "(" counter(rom, lower-roman) ")"; position: absolute; left: -2.2rem; width: 1.9rem; text-align: right; }
.prose ol.alpha { list-style: none; counter-reset: alp; }
.prose ol.alpha > li { counter-increment: alp; position: relative; }
.prose ol.alpha > li::before { content: "(" counter(alp, lower-alpha) ")"; position: absolute; left: -2.2rem; width: 1.9rem; text-align: right; }
.qed { float: right; color: var(--teal); font-size: 0.85em; margin-left: 0.5rem; }
.hard { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); font-weight: 700; }
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; max-width: 100%; padding: 2px 0; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
.prose table { border-collapse: collapse; font-size: 0.93rem; width: 100%; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.prose th { font-family: var(--sans); text-align: left; border-bottom: 1px solid var(--ink); padding: 0.4rem 0.6rem 0.4rem 0; }
.prose td { padding: 0.3rem 0.6rem 0.3rem 0; vertical-align: top; }
.prose td:first-child { font-family: var(--sans); font-weight: 700; color: var(--teal); }

.essay-kicker { font-family: var(--sans); font-weight: 700; font-size: 0.85rem; color: var(--amber); margin-top: 2.8rem; }
.essay-title { font-family: var(--sans); color: var(--teal); font-size: 2rem; margin: 0.2rem 0 0.5rem; line-height: 1.15; }
.essay-rule { width: 8rem; height: 3px; background: var(--amber); margin-bottom: 1.6rem; }
.pullquote { text-align: center; margin: 1.6rem auto; max-width: 34rem; }
.pullquote p { font-style: italic; font-size: 1.2rem; color: var(--teal); margin-bottom: 0.3rem; }
.pullquote p.who { font-style: normal; font-family: var(--sans); font-size: 0.85rem; color: var(--amber); }

/* ---------- boxes ---------- */
.box-title { display: block; font-family: var(--sans); font-weight: 700; font-size: 0.88rem; margin-bottom: 0.5rem; }
.stepquestion { background: var(--teal-pale); border-left: 4px solid var(--teal); padding: 0.9rem 1.1rem 0.5rem; margin: 1.2rem 0 1.4rem; }
.stepquestion .box-title { color: var(--teal); }

.askyourself, .pausebox { position: relative; padding: 0.7rem 1rem 0.2rem 3.1rem; margin: 1rem 0; border-radius: 4px; }
.askyourself { background: var(--plum-pale); }
.pausebox { background: var(--amber-pale); border: 1px dashed var(--amber); }
.askyourself::before, .pausebox::before { position: absolute; left: 0.85rem; top: 0.75rem; width: 1.45rem; height: 1.45rem; border-radius: 50%; color: #fff; font-family: var(--sans); font-weight: 700; font-size: 0.9rem; line-height: 1.45rem; text-align: center; }
.askyourself::before { content: "?"; background: var(--plum); }
.pausebox::before { content: "\270E"; background: var(--amber); font-size: 0.85rem; }
.askyourself > p:first-child::before, .pausebox > p:first-child::before { font-family: var(--sans); font-weight: 700; font-size: 0.8rem; margin-right: 0.5rem; }
.askyourself > p:first-child::before { content: "Ask yourself"; color: var(--plum); }
.pausebox > p:first-child::before { content: "Pause and try"; color: var(--amber); }
:lang(zh) .askyourself > p:first-child::before { content: "想一想"; }
:lang(zh) .pausebox > p:first-child::before { content: "停一停，试一试"; }
:lang(ja) .askyourself > p:first-child::before { content: "考えてみよう"; }
:lang(ja) .pausebox > p:first-child::before { content: "手を止めて、やってみよう"; }
:lang(ko) .askyourself > p:first-child::before { content: "생각해 보기"; }
:lang(ko) .pausebox > p:first-child::before { content: "잠깐, 직접 해 보기"; }

.skillbox { border: 1.5px solid var(--teal); padding: 0.9rem 1.2rem 0.4rem; margin: 1.2rem 0; }
.skillbox .box-title { color: var(--teal); font-size: 0.95rem; }
.historybox { border-bottom: 1px solid var(--rule); padding: 0.2rem 0 0.4rem; margin: 1rem 0 1.4rem; }
.historybox .box-title { color: var(--amber); }

.exercises ol { padding-left: 2rem; }
.exercises ol > li::marker { font-family: var(--sans); font-weight: 700; color: var(--teal); }
.exercises ol > li { margin-bottom: 0.7rem; }

/* ---------- figures ---------- */
figure.stepfig { margin: 1.8rem 0; text-align: center; }
figure.stepfig img { width: auto; max-height: 30rem; }
figure.steppic { margin: 1rem 0; text-align: center; }
figure.steppic img { width: auto; max-height: 22rem; }
figure.stepfig figcaption { text-align: left; font-size: 0.93rem; line-height: 1.5; max-width: 36rem; margin: 0.6rem auto 0; }
.fig-label { font-family: var(--sans); font-weight: 700; color: var(--teal); margin-right: 0.5rem; }

/* ---------- pager ---------- */
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 3rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.92rem; }
.pager a { text-decoration: none; font-weight: 700; }
.pager .next { margin-left: auto; text-align: right; }

@media print {
  .site-header, .site-footer, .downloads, .pager, .newsletter-box, .newsletter-callout { display: none; }
}

.prose .flushright { text-align: right; margin-top: 2rem; }

/* glossary (description lists) */
.prose dl { margin: 0.6rem 0 1.2rem; }
.prose dt { font-family: var(--sans); font-weight: 700; color: var(--teal); margin-top: 0.9rem; }
.prose dd { margin: 0.15rem 0 0 1.4rem; }
.front-matter td:first-child { font-family: inherit; font-weight: normal; color: inherit; white-space: nowrap; }

/* ---------- search ---------- */
.nav-search::before { content: ""; display: inline-block; width: 0.7em; height: 0.7em; border: 2px solid currentColor; border-radius: 50%; margin-right: 0.35em; vertical-align: -0.05em; box-sizing: border-box; }
.hero-search { display: flex; gap: 0.5rem; max-width: 34rem; margin-top: 1.2rem; }
.hero-search input, .search-form input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: 0.55rem 0.8rem; border: 1px solid var(--rule); border-radius: 4px; background: #fff; color: var(--ink); }
.hero-search button { font-family: var(--sans); font-weight: 700; font-size: 0.95rem; padding: 0 1.1rem; border: 0; border-radius: 4px; background: var(--amber); color: #fff; cursor: pointer; }
.hero-search button:hover { background: #9a5518; }
.search-form { display: flex; margin: 1.6rem 0 0.4rem; }
.search-form input { font-size: 1.1rem; padding: 0.7rem 0.9rem; }
.search-form input:focus, .hero-search input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.search-status { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-soft); margin: 0.4rem 0 1rem; }
.search-results { list-style: none; padding: 0; margin: 0 0 3rem; }
.search-results li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.sr-title { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.sr-meta { font-family: var(--sans); font-size: 0.78rem; color: var(--amber); margin-top: 0.15rem; }
.sr-snip { margin: 0.35rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.sr-snip mark { background: var(--amber-pale); color: var(--ink); padding: 0 1px; }

/* header on narrow screens: brand above a scrollable nav */
@media (max-width: 56rem) {
  .site-header .wrap { height: auto; flex-wrap: wrap; row-gap: 0.2rem; padding-top: 0.55rem; padding-bottom: 0.45rem; }
  .site-header nav { width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .site-header nav a { margin: 0 1.1rem 0 0; }
}

/* ---------- analytics consent ---------- */
.footer-links a { color: inherit; }
.consent-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 46rem; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.9rem 1.1rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-left: 5px solid var(--teal); border-radius: 8px;
  box-shadow: 0 12px 36px rgba(31,42,51,0.22), 0 2px 6px rgba(31,42,51,0.08);
  padding: 1rem 1.1rem; font-family: var(--sans); font-size: 0.88rem; line-height: 1.5;
  animation: consent-in 0.35s ease-out; }
@keyframes consent-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .consent-banner { animation: none; } }
.consent-icon { width: 2.6rem; height: 2.6rem; border-radius: 9px; background: url("favicon.svg") center / cover no-repeat; flex: none; }
.consent-text p { margin: 0; color: var(--ink-soft); }
.consent-text .consent-title { color: var(--teal); font-weight: 700; font-size: 0.98rem; margin-bottom: 0.15rem; }
.consent-text a { color: var(--teal); }
.consent-buttons { display: flex; gap: 0.5rem; }
.consent-banner button { font: inherit; font-weight: 700; font-size: 0.9rem; padding: 0.6rem 1.25rem; border-radius: 6px; cursor: pointer; white-space: nowrap;
  background: var(--paper); border: 1.5px solid var(--teal); color: var(--teal); transition: background 0.15s, color 0.15s; }
.consent-banner button:hover { background: var(--teal); color: #fff; }
.consent-banner button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (max-width: 40rem) {
  .consent-banner { grid-template-columns: auto 1fr; left: 12px; right: 12px; bottom: 12px; }
  .consent-buttons { grid-column: 1 / -1; }
  .consent-banner button { flex: 1; }
}
@media print { .consent-banner { display: none; } }

/* ---------- Download section (home page) ---------- */
#download { margin-bottom: 2.5rem; }
.dl-options { display: grid; gap: 1rem; margin-top: 1rem; }
.dl-option { padding: 1rem 1.2rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); }
.dl-option h3 { margin: 0 0 0.4rem; font-family: var(--sans); font-size: 1.05rem; color: var(--teal); }
.dl-option p { margin: 0.4rem 0; }
.dl-tag { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--teal-pale); color: var(--teal); font-size: 0.78rem; font-weight: normal; vertical-align: middle; }
.book-dl { display: flex; gap: 1.4rem; align-items: flex-start; background: var(--teal-pale); }
.book-cover { width: 140px; height: auto; flex: none; border-radius: 3px; box-shadow: 0 4px 14px rgba(31,42,51,0.25); }
.book-dl-text { flex: 1; min-width: 0; }
.dl-warn { margin: 0.8rem 0 1rem !important; padding: 0.6rem 0.8rem; border-left: 4px solid var(--amber); background: var(--amber-pale); font-size: 0.95rem; }
@media (max-width: 34rem) { .book-dl { flex-direction: column; } .book-cover { width: 120px; } }

/* Questions by paper and year */
.q-jump { font-family: var(--sans); font-weight: 700; }
.q-count { font-family: var(--sans); font-size: 0.85rem; font-weight: 400; color: var(--ink-soft); margin-left: 0.4rem; }
.prose table.q-index td:first-child { white-space: nowrap; }
.prose table.q-index td:nth-child(2) { font-family: var(--sans); white-space: nowrap; color: var(--ink); }
.prose table.q-index tr.q-newyear td { border-top: 1px solid var(--teal-pale); }
.prose table.q-index tbody tr:first-child td { border-top: 0; }
.q-sec { font-family: var(--sans); font-weight: 700; margin-right: 0.15rem; }
.q-also { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber); font-weight: 700; }

/* Links to STEP database questions open in a small window (scripts/site/question.js) */
a.q-popup::after { content: "\2197"; font-family: var(--sans); font-size: 0.8em; margin-left: 0.15em; text-decoration: none; display: inline-block; }

/* Worked solutions index */
.sol-progress { font-family: var(--sans); font-weight: 700; color: var(--teal); }
.sol-filter { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; margin: 1rem 0 0.6rem;
  padding: 0.7rem 0.8rem; background: var(--teal-pale); font-family: var(--sans); font-size: 0.9rem; }
.sol-filter[hidden] { display: none; }
.sol-filter input[type=search] { flex: 1 1 16rem; min-width: 0; padding: 0.4rem 0.5rem; border: 1px solid var(--rule);
  font: inherit; background: var(--paper); color: var(--ink); }
.sol-filter select { padding: 0.35rem; border: 1px solid var(--rule); font: inherit; background: var(--paper); color: var(--ink); }
.sol-filter label { white-space: nowrap; }
#sol-count { color: var(--ink-soft); }
.sol-jump { line-height: 1.9; font-size: 0.9rem; }
.sol-year[hidden] { display: none; }
.prose table.sol-index td:first-child, .prose table.sol-index td:nth-child(2) { font-family: var(--sans); white-space: nowrap; }
.sol-sect { display: block; font-family: var(--sans); font-size: 0.75rem; color: var(--ink-soft); }
.sol-links { white-space: nowrap; font-family: var(--sans); font-size: 0.88rem; }
.sol-links > * { margin-right: 0.7rem; }
.sol-links > *:last-child { margin-right: 0; }
.sol-pdf { font-weight: 700; }
.sol-book-dl { margin: 0.2rem 0 0.6rem; }
.sol-book-size { font-size: 0.8rem; color: var(--teal); opacity: 0.75; margin-left: 0.4rem; }
.sol-pdf span { font-size: 0.7rem; letter-spacing: 0.05em; color: var(--amber); }
.sol-soon { color: var(--ink-soft); font-style: italic; }
.sol-book { font-weight: 700; color: var(--plum); }
@media (max-width: 34rem) {
  .sol-links { white-space: normal; }
  .sol-links > * { display: inline-block; margin: 0.1rem 0.6rem 0.1rem 0; }
}
