/* ==========================================================================
   Scholarship Media Studies 93303 — Site Stylesheet
   --------------------------------------------------------------------------
   DESIGN SYSTEM: "Soft editorial academic" (see /Media Studies Scholarship/
   Style Guide.dc.html). Warm parchment, deep ink, restrained accent trio
   (berry · teal · gold). Newsreader serif for headings, Hanken Grotesk for
   body/UI, Spline Sans Mono for labels and tags.

   TEACHER NOTES:
   - All colours are CSS variables below — change them in ONE place.
   - Light theme tokens in :root; the warm-ink dark theme in [data-theme="dark"].
   - Print styles at the bottom of this file.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Hanken+Grotesk:wght@400;500;600;700&family=Spline+Sans+Mono:wght@400;500&display=swap');

:root {
  /* Backgrounds */
  --bg: #F4ECE4;            /* warm parchment base */
  --bg-deep: #ECE1D6;       /* alternate / pull-quote */
  /* Surfaces */
  --surface: #FCF8F3;       /* cards */
  --surface-sand: #F2E7DA;
  --surface-blush: #EBD9D0;
  /* Accents — berry primary, teal secondary, gold highlight */
  --berry: #9C5B66;
  --berry-700: #7C4651;
  --teal: #5E7A78;
  --teal-700: #41605D;
  --teal-tint: #DEE8E6;
  --teal-line: #C3D4D1;
  --gold: #A9824B;
  --gold-700: #8a6a2f;
  --gold-tint: #F3E9DC;
  --gold-line: #E6D2B8;
  /* Text & lines */
  --ink: #221E1B;
  --ink-2: #4C443E;
  --muted: #8B7E73;
  --line: #E3D8CC;
  --line-2: #CDBDAD;
  /* Study semantics (never decorative) */
  --success: #5C7C5E;
  --success-tint: #E6EEE3;
  --success-line: #CBDAC5;
  --caution: #A8524F;
  --caution-tint: #F4E2DF;
  --caution-line: #E6C6C2;
  --warning: #B07A3C;
  /* Type */
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  /* Effects */
  --shadow-card: 0 1px 2px rgba(34,30,27,0.04), 0 16px 32px -26px rgba(34,30,27,0.3);
  --shadow-card-hover: 0 1px 2px rgba(34,30,27,0.04), 0 22px 40px -24px rgba(34,30,27,0.34);
  --shadow-hero: 0 1px 2px rgba(34,30,27,0.04), 0 24px 48px -32px rgba(34,30,27,0.28);
  --radius: 14px;
  --radius-lg: 18px;
  --maxw: 980px;
  --grain-opacity: 0.055;
  --header-bg: rgba(244, 236, 228, 0.86);
}

/* Warm-ink dark theme — derived from the style guide's dark "theory" panel */
[data-theme="dark"] {
  --bg: #221E1B;
  --bg-deep: #1B1815;
  --surface: #2E2A27;
  --surface-sand: #38322C;
  --surface-blush: #3C3231;
  --berry: #C9A0A9;
  --berry-700: #DBB9C0;
  --teal: #8FA39A;
  --teal-700: #ABBDB6;
  --teal-tint: #2C3635;
  --teal-line: #3D4B49;
  --gold: #D9B68C;
  --gold-700: #E7D4B8;
  --gold-tint: #352E24;
  --gold-line: #4A4032;
  --ink: #F4ECE4;
  --ink-2: #D9CFC4;
  --muted: #9B8F84;
  --line: #453E37;
  --line-2: #57504a;
  --success: #8FAE90;
  --success-tint: #2A332B;
  --success-line: #3D4D3E;
  --caution: #D08A87;
  --caution-tint: #3A2C2B;
  --caution-line: #553E3C;
  --warning: #D9A968;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 16px 32px -26px rgba(0,0,0,0.6);
  --shadow-card-hover: 0 1px 2px rgba(0,0,0,0.3), 0 22px 40px -24px rgba(0,0,0,0.65);
  --shadow-hero: 0 1px 2px rgba(0,0,0,0.3), 0 24px 48px -32px rgba(0,0,0,0.6);
  --grain-opacity: 0.04;
  --header-bg: rgba(34, 30, 27, 0.86);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;       /* 17px — style guide body size */
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Soft paper grain overlay (from the style guide) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22160%22 height=%22160%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.85%22 numOctaves=%222%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23n)%22/%3E%3C/svg%3E');
}

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.15;
}
h1 { font-weight: 400; font-size: 2.9rem; letter-spacing: -0.02em; margin: 0.4em 0 0.35em; }
h2 { font-weight: 400; font-size: 2rem; letter-spacing: -0.01em; margin: 2.1em 0 0.5em; }
h3 { font-weight: 500; font-size: 1.4rem; margin-top: 1.6em; }
h4 { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; margin-top: 1.4em; line-height: 1.3; }

a { color: var(--berry); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { color: var(--berry-700); text-decoration-color: currentColor; }

p, ul, ol { margin: 0.8em 0; }
li { margin: 0.35em 0; }

em { font-style: italic; }

code {
  font-family: var(--mono);
  background: var(--surface-sand);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-size: 0.88em;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4.5rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--ink-2);
  max-width: 64ch;
}

/* Mono kicker label — the design system's signature section label */
.kicker {
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--berry);
  font-weight: 500;
}

/* ---------- Header & navigation (sticky masthead) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
}
.brand:hover { color: var(--ink); }
.brand .brand-kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--berry);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--berry); color: var(--berry); }

.site-nav { flex: 1; }

/* Grouped dropdown navigation (built by js/nav.js) */
.nav-groups {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem;
}
.nav-group { position: relative; }
.nav-group-btn, .nav-top-link {
  display: inline-flex; align-items: center; gap: 0.28rem;
  font-family: var(--sans); font-size: 0.92rem; font-weight: 600;
  color: var(--ink-2); background: none; border: none; cursor: pointer;
  padding: 0.42rem 0.75rem; border-radius: 999px; white-space: nowrap;
  text-decoration: none;
}
.nav-group-btn:hover, .nav-top-link:hover,
.nav-group:focus-within > .nav-group-btn { color: var(--berry); background: var(--surface-blush); }
.nav-caret { font-size: 0.68em; opacity: 0.7; }
.nav-current > .nav-group-btn { color: var(--berry); }
.nav-top-link[aria-current="page"] { color: var(--berry); }

.nav-menu {
  list-style: none; margin: 0; padding: 0.4rem;
  position: absolute; top: 100%; left: 0; z-index: 120;
  min-width: 220px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-card);
  display: none;
}
.nav-menu li { margin: 0; }
.nav-menu a {
  display: block; padding: 0.5rem 0.8rem; border-radius: 8px;
  text-decoration: none; color: var(--ink); font-size: 0.92rem; white-space: nowrap;
}
.nav-menu a:hover { background: var(--surface-blush); color: var(--berry); }
.nav-menu a[aria-current="page"] { color: var(--berry); font-weight: 600; }

@media (hover: hover) and (min-width: 1081px) {
  .nav-group:hover > .nav-menu { display: block; }
}
@media (min-width: 1081px) {
  .nav-group:focus-within > .nav-menu,
  .nav-group.open > .nav-menu { display: block; }
}

.header-tools { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

.theme-toggle {
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.theme-toggle:hover { border-color: var(--berry); color: var(--berry); }

/* ---------- Search ---------- */

.search-wrap { position: relative; }

#site-search {
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9rem;
  width: 170px;
  transition: width 0.2s ease;
}
#site-search::placeholder { color: var(--muted); }
#site-search:focus { outline: 2px solid var(--berry); outline-offset: 1px; width: 230px; }

.search-results {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(420px, 90vw);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: none;
  z-index: 200;
}
.search-results.open { display: block; }
.search-results a {
  display: block;
  padding: 0.65rem 1rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover, .search-results a.active { background: var(--surface-blush); }
.search-results .sr-title { font-family: var(--serif); font-weight: 500; font-size: 1.02rem; color: var(--berry-700); }
.search-results .sr-snippet { font-size: 0.82rem; color: var(--muted); display: block; }
.search-results .sr-empty { padding: 0.8rem 1rem; color: var(--muted); font-size: 0.9rem; }

/* ---------- Components ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin: 1.3rem 0;
  box-shadow: var(--shadow-card);
}

.card h2:first-child, .card h3:first-child { margin-top: 0.2rem; }
.card::after { content: ""; display: block; clear: both; } /* contain floated portraits */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.3rem;
  margin: 1.3rem 0;
}
.card-grid .card {
  margin: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-grid .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }

/* Image-topped cards (home page) */
.card-art {
  height: 110px;
  margin: -1.4rem -1.6rem 1.1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  overflow: hidden;
  background: var(--surface-sand);
}
.card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Callout family — each owns one semantic colour AND a mono label,
   so meaning never relies on colour alone (style guide rule). */
.callout {
  background: var(--teal-tint);
  border: 1px solid var(--teal-line);
  border-left: 4px solid var(--teal);
  border-radius: 12px;
  padding: 1rem 1.3rem;
  margin: 1.3rem 0;
}
.callout::before {
  content: "Study note";
  display: block;
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-700);
  margin-bottom: 0.45rem;
}
.callout.warn {
  background: var(--caution-tint);
  border-color: var(--caution-line);
  border-left-color: var(--caution);
  color: var(--ink);
}
.callout.warn::before { content: "Avoid this"; color: var(--caution); }
.callout.examiner::before { content: "Examiner note"; }
.callout.insight {
  background: var(--gold-tint);
  border-color: var(--gold-line);
  border-left-color: var(--gold);
}
.callout.insight::before { content: "Scholarship insight"; color: var(--gold-700); }
.callout.task {
  background: var(--success-tint);
  border-color: var(--success-line);
  border-left-color: var(--success);
}
.callout.task::before { content: "Student task"; color: var(--success); }
.callout p:first-of-type { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* TEACHER-EDITABLE notice box — content teachers should review annually */
.teacher-notice {
  border: 2px dashed var(--gold-line);
  background: var(--gold-tint);
  color: var(--ink-2);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  margin: 1.5rem 0;
}
.teacher-notice::before {
  content: "Teacher note · review annually";
  display: block;
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-700);
  margin-bottom: 0.45rem;
}
.teacher-notice strong { color: var(--ink); }
.teacher-notice p:first-of-type { margin-top: 0; }
.teacher-notice p:last-child { margin-bottom: 0; }

/* Placeholder blocks for content to be added later */
.placeholder {
  border: 1.5px dashed var(--line-2);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  margin: 0.9rem 0;
  color: var(--muted);
  background: var(--surface-sand);
  font-size: 0.95rem;
}
.placeholder strong { color: var(--ink-2); font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }

/* Buttons — pill-shaped per the style guide */
.btn {
  display: inline-block;
  font-family: var(--sans);
  background: var(--berry);
  color: var(--surface);
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 18px -10px rgba(156,91,102,0.7);
  transition: background 0.18s ease;
}
.btn:hover { background: var(--berry-700); color: var(--surface); }
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
  box-shadow: none;
}
.btn.secondary:hover { border-color: var(--berry); color: var(--berry); background: transparent; }
.btn.small { padding: 0.35rem 0.95rem; font-size: 0.85rem; }
.btn.danger { background: var(--caution); color: #fff; box-shadow: 0 8px 18px -10px rgba(168,82,79,0.6); }
.btn.danger:hover { background: #8f4441; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.3rem 0; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--surface);
  font-size: 0.95rem;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
}
td + td, th + th { border-left: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
th {
  background: var(--surface-sand);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Weak vs strong comparison — the "Scholarship move" pattern */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin: 1.3rem 0; }
.compare .weak, .compare .strong {
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--line);
}
.compare .weak { background: var(--surface-sand); border-top: 4px solid var(--caution); }
.compare .strong { background: var(--surface-blush); border-top: 4px solid var(--success); }
.compare h4 {
  margin-top: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.compare .weak h4 { color: var(--caution); }
.compare .strong h4 { color: var(--success); }

/* Detail/accordion sections */
details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0.9rem 0;
  padding: 0;
  box-shadow: var(--shadow-card);
}
details summary {
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  padding: 0.95rem 1.4rem;
  list-style-position: inside;
}
details summary:hover { background: var(--bg-deep); border-radius: var(--radius); color: var(--berry-700); }
details[open] summary { border-bottom: 1px solid var(--line); }
details .details-body { padding: 0.4rem 1.5rem 1.1rem; }

/* Tag pills — mono uppercase chips */
.tag {
  display: inline-block;
  font-family: var(--mono);
  background: var(--surface-blush);
  color: var(--berry-700);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.69rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0.12rem 0.18rem 0.12rem 0;
}

/* Page table of contents */
.page-toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.5rem;
  margin: 1.3rem 0;
  box-shadow: var(--shadow-card);
}
.page-toc > strong {
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--berry);
}
.page-toc ul { columns: 2; column-gap: 2rem; margin: 0.6rem 0 0; padding-left: 1.2rem; }
.page-toc li { break-inside: avoid; }
.page-toc a { color: var(--ink-2); text-decoration: none; }
.page-toc a:hover { color: var(--berry); text-decoration: underline; }

/* Forms (example bank) */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1.1rem; }
.form-grid .full { grid-column: 1 / -1; }
label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: block;
  margin-bottom: 0.3rem;
}
input[type="text"], input[type="search"], textarea, select {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.97rem;
}
textarea { min-height: 4.2em; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--berry); outline-offset: 1px; }
::placeholder { color: var(--muted); }

/* Checklists (study plan) */
.checklist { list-style: none; padding-left: 0; }
.checklist li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.42rem 0.5rem;
  border-radius: 9px;
  transition: background 0.18s ease;
}
.checklist li:hover { background: var(--bg-deep); }
.checklist input[type="checkbox"] {
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.18rem;
  flex-shrink: 0;
  accent-color: var(--berry);
  border-radius: 7px;
}
.checklist label {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.98rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  cursor: pointer;
  margin: 0;
}
.checklist input:checked + label {
  text-decoration: line-through;
  text-decoration-color: var(--line-2);
  color: var(--muted);
}

.progress-bar {
  height: 9px;
  background: var(--surface-blush);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.4rem 0 1rem;
}
.progress-bar > div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--berry), var(--gold));
  width: 0%;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
#progress-label { font-family: var(--mono); font-size: 0.85rem; color: var(--gold-700); }

/* Week counter chips inside study plan summaries */
.week-count { float: right; margin-left: 0.6rem; }

/* Glossary */
.glossary dt {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  margin-top: 1.5rem;
  color: var(--berry-700);
}
.glossary dd { margin: 0.3rem 0 0 0; padding-left: 0; color: var(--ink); }
.glossary .schol-note {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.92rem;
  color: var(--ink-2);
  border-left: 3px solid var(--gold-line);
  padding-left: 0.8rem;
}
.glossary .schol-note::before {
  content: "Scholarship note · ";
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-700);
}
.az-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 1.2rem 0; }
.az-nav a {
  display: inline-block;
  min-width: 2.1rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
}
.az-nav a:hover { border-color: var(--berry); color: var(--berry); background: var(--surface); }

/* Example bank entries */
.entry-card { position: relative; }
.entry-card .entry-meta { margin: 0.2rem 0 0.6rem; }
.entry-card .entry-field { margin: 0.55rem 0; }
.entry-card .entry-field strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.1rem;
}
.entry-card h3 { font-family: var(--serif); font-weight: 500; }
.entry-actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 2.2rem 1.5rem 2.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-footer .footer-inner { max-width: var(--maxw); margin: 0 auto; }
.site-footer strong { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; color: var(--ink); }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--berry); }

/* Hero (home page) — editorial split */
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.6rem 0;
  box-shadow: var(--shadow-hero);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 320px;
}
.hero-copy {
  padding: 2.8rem 2.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-copy .kicker { margin-bottom: 1rem; }
.hero h1 { margin: 0 0 0.35em; font-size: 2.9rem; line-height: 1.05; }
.hero h1 em { color: var(--berry); font-style: italic; }
.hero .lead { margin-top: 0; font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero-art {
  position: relative;
  background: var(--surface-sand);
  overflow: hidden;
  min-height: 200px;
}
.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}
.hero-image-dark { display: none !important; }
[data-theme="dark"] .hero-image-light { display: none; }
[data-theme="dark"] .hero-image-dark { display: block !important; }

/* Wide identity strips for top-level pages */
.page-art {
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-sand);
  box-shadow: var(--shadow-card);
}
.page-art img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
}

/* Concept and theory idea-motifs */
.concept-motif, .theory-motif {
  float: right;
  width: 170px;
  margin: 0.2rem 0 0.9rem 1.3rem;
}
.concept-motif img, .theory-motif img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

/* Empty example-bank state */
.empty-state {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1.2rem 0;
  padding: 1rem 1.3rem;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  color: var(--muted);
}
.empty-state img {
  width: 150px;
  height: 150px;
  flex: 0 0 auto;
  object-fit: contain;
}

[data-theme="dark"] .page-art img,
[data-theme="dark"] .card-art img,
[data-theme="dark"] .concept-motif img,
[data-theme="dark"] .theory-motif img {
  filter: brightness(0.72) saturate(0.82);
}

/* Elegant divider (style guide ornament) */
.divider {
  margin: 2.6rem 0;
  text-align: center;
}
.divider img {
  display: block;
  width: min(600px, 100%);
  height: auto;
  margin: 0 auto;
}

/* Theorist portraits (theory page) — images from Wikimedia Commons.
   Each image's licence requires attribution: keep the figcaption credit
   with the image, and keep the full list in resources.html#image-credits. */
.portrait {
  float: right;
  width: 138px;
  margin: 0.3rem 0 0.9rem 1.3rem;
}
.portrait img {
  width: 100%;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.portrait figcaption {
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
}
.portrait figcaption a { color: var(--muted); }
.portrait figcaption a:hover { color: var(--berry); }
.portrait.duo { width: 150px; }
.portrait.duo .duo-row { display: flex; gap: 6px; }
.portrait.duo img { width: calc(50% - 3px); }

@media (max-width: 640px) {
  .portrait { width: 104px; margin-left: 0.9rem; }
  .portrait.duo { width: 120px; }
}

/* Image credits list (resources page) */
.credits-list { font-size: 0.9rem; color: var(--ink-2); }
.credits-list li { margin: 0.5em 0; }

/* Pull quote */
.pull-quote {
  margin: 1.6rem 0;
  background: var(--bg-deep);
  border-radius: var(--radius);
  padding: 1.8rem 2rem 1.4rem;
  position: relative;
}
.pull-quote::before {
  content: "\201C";
  position: absolute;
  top: 2px; left: 16px;
  font-family: var(--serif);
  font-size: 4rem;
  color: #C9A9AE;
  line-height: 1;
}
.pull-quote p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.4;
  margin: 0.4rem 0 0.6rem;
  padding-left: 10px;
}
.pull-quote cite {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.69rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--berry);
  padding-left: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--berry); color: var(--surface);
  padding: 0.5rem 1rem; z-index: 300;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; order: 10; }
  .site-nav.open { display: block; }
  .nav-groups { flex-direction: column; align-items: stretch; padding: 0.5rem 0; gap: 0.1rem; }
  .nav-group { position: static; }
  .nav-group-btn { width: 100%; justify-content: space-between; font-size: 1.02rem; padding: 0.6rem 0.8rem; }
  .nav-top-link { display: block; font-size: 1.02rem; padding: 0.6rem 0.8rem; }
  .nav-menu {
    position: static; display: none; min-width: 0;
    border: none; box-shadow: none; background: transparent;
    padding: 0 0 0.4rem 0.9rem;
  }
  .nav-group.open > .nav-menu { display: block; }
  .nav-menu a { font-size: 1rem; padding: 0.45rem 0.7rem; }
  .nav-caret { transition: transform 0.2s ease; }
  .nav-group.open .nav-caret { transform: rotate(180deg); }
}

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { min-height: 130px; }
  .hero-art img { min-height: 170px; }
  .hero-copy { padding: 2rem 1.6rem; }
}

@media (max-width: 640px) {
  .compare { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-toc ul { columns: 1; }
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.1rem; }
  h2 { font-size: 1.6rem; }
  #site-search { width: 120px; }
  #site-search:focus { width: 160px; }
  .brand { flex-direction: column; gap: 0.05rem; align-items: flex-start; }
  .concept-motif, .theory-motif { float: none; width: 150px; margin: 0.2rem auto 1rem; }
  .empty-state { align-items: flex-start; }
  .empty-state img { width: 105px; height: 105px; }
}

/* ==========================================================================
   INTERACTIVE REVISION TOOLS (Revise hub, Flashcards, Explainers, Concept Map)
   Used by: pages/revise.html, flashcards.html, explainers.html, concept-map.html
   ========================================================================== */

/* --- Revise hub tool cards --- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.3rem; margin: 1.4rem 0; }
.tool-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); color: var(--ink); }
.tool-card .tool-icon { width: 44px; height: 44px; margin-bottom: 0.8rem; color: var(--berry); }
.tool-card h3 { margin: 0 0 0.3rem; font-size: 1.3rem; }
.tool-card p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }
.tool-card .tool-go { margin-top: auto; padding-top: 0.9rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--berry); }

/* --- Flashcards --- */
.fc-toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 1.2rem 0; }
.fc-toolbar .spacer { flex: 1; }
.deck-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.deck-switch button {
  font-family: var(--sans); font-weight: 600; font-size: 0.9rem;
  background: transparent; color: var(--ink-2); border: none;
  padding: 0.5rem 1.1rem; cursor: pointer;
}
.deck-switch button[aria-pressed="true"] { background: var(--berry); color: var(--surface); }

.flashcard-stage { perspective: 1600px; margin: 1.4rem auto; max-width: 640px; }
.flashcard {
  position: relative; width: 100%; min-height: 320px;
  transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(0.22,1,0.36,1);
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard .face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 2rem 2.2rem;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--surface); overflow: auto;
}
.flashcard .face-front { align-items: center; text-align: center; }
.flashcard .face-front .fc-kicker { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--berry); margin-bottom: 1rem; }
.flashcard .face-front .fc-term { font-family: var(--serif); font-size: 2rem; line-height: 1.15; margin: 0; }
.flashcard .face-front .fc-hint { margin-top: 1.4rem; font-size: 0.82rem; color: var(--muted); }
.flashcard .face-back { transform: rotateY(180deg); background: var(--surface-blush); }
.flashcard .face-back .fc-body { font-size: 1.02rem; }
.flashcard .face-back p { margin: 0 0 0.7rem; }
.flashcard .face-back .fc-label { font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--berry-700); }
.flashcard .face-back .fc-warn { color: var(--caution); }

.fc-controls { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: center; margin: 1.1rem 0; }
.fc-progress { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); min-width: 9ch; text-align: center; }
.fc-rate { display: flex; gap: 0.6rem; justify-content: center; margin-top: 0.4rem; }
.fc-deck-status { text-align: center; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-top: 0.8rem; }

/* --- Step-through explainers --- */
.explainer {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 1.5rem 1.6rem; margin: 1.6rem 0;
}
.explainer h2 { margin-top: 0; }
.explainer .stage-wrap { background: var(--bg-deep); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.explainer svg { display: block; width: 100%; height: auto; }
.explainer .ex-step-text { display: none; } /* caption source read by JS; never shown directly */
.explainer .ex-caption { min-height: 4.5em; font-size: 1.02rem; color: var(--ink); margin: 0.6rem 0; }
.explainer .ex-caption .ex-step-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--berry); display: block; margin-bottom: 0.3rem; }
.explainer .ex-controls { display: flex; align-items: center; gap: 0.7rem; }
.explainer .ex-dots { display: flex; gap: 0.4rem; margin-left: auto; }
.explainer .ex-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); border: none; padding: 0; cursor: pointer; }
.explainer .ex-dot[aria-current="true"] { background: var(--berry); }
/* SVG stateful elements: dim then reveal per step */
.explainer [data-step] { opacity: 0; transition: opacity 0.4s ease; }
.explainer [data-step].on { opacity: 1; }
/* SVG palette helpers so diagrams adapt to light/dark theme */
.explainer svg text { fill: var(--ink); }
.explainer .s-berry { fill: var(--berry); }
.explainer .s-teal { fill: var(--teal); }
.explainer .s-gold { fill: var(--gold); }
.explainer .s-surface { fill: var(--surface); }
.explainer .s-sand { fill: var(--surface-sand); }
.explainer .ln { stroke: var(--ink-2); fill: none; }
.explainer .ln-berry { stroke: var(--berry); fill: none; }
.explainer .txt-light { fill: var(--surface); }
.explainer .txt-mono { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }

/* --- Concept map --- */
.map-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 0.5rem; margin: 1.4rem 0; overflow: hidden; }
.map-wrap svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.map-edge { stroke: var(--line-2); stroke-width: 1.5; opacity: 0.45; transition: stroke 0.2s, opacity 0.2s, stroke-width 0.2s; }
.map-edge.active { stroke: var(--berry); opacity: 0.95; stroke-width: 2.5; }
.map-node { cursor: pointer; }
.map-node circle, .map-node rect { transition: opacity 0.2s, stroke-width 0.2s; }
/* Node fills are set in CSS (not as SVG attributes) because var() is not valid
   in presentation attributes — CSS resolves it and overrides the attribute. */
.map-node rect.s-berry { fill: var(--berry); }
.map-node rect.s-teal { fill: var(--teal); }
.map-node text { font-family: var(--sans); font-size: 12px; font-weight: 600; pointer-events: none; fill: var(--surface); }
.map-node.dim { opacity: 0.28; }
.map-node.selected circle, .map-node.selected rect { stroke: var(--ink); stroke-width: 3; }
.map-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0.8rem 0; font-size: 0.85rem; color: var(--ink-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.map-legend .dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.map-panel { background: var(--surface-blush); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1rem 0; min-height: 6em; }
.map-panel h3 { margin-top: 0; }
.map-panel .map-panel-empty { color: var(--muted); }
.map-panel .map-links a { margin-right: 1rem; font-weight: 600; }

@media (max-width: 600px) {
  .flashcard .face { padding: 1.4rem 1.3rem; }
  .flashcard .face-front .fc-term { font-size: 1.6rem; }
}

/* ==========================================================================
   GLOSSARY TOOLTIPS (js/tooltips.js + js/definitions.js)
   ========================================================================== */
.gloss {
  border-bottom: 1.5px dotted var(--berry);
  cursor: help;
  text-underline-offset: 2px;
}
.gloss:hover, .gloss:focus-visible {
  background: var(--surface-blush);
  outline: none;
  border-radius: 3px;
}
.gloss:focus-visible { box-shadow: 0 0 0 2px var(--berry); }

#gloss-tip {
  position: fixed;
  z-index: 400;
  max-width: 300px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  box-shadow: 0 6px 24px -8px rgba(34,30,27,0.5);
  pointer-events: none;       /* never blocks the text underneath */
  opacity: 0;
  transition: opacity 0.12s ease;
}
#gloss-tip.show { opacity: 1; }

/* ==========================================================================
   VIDEO EMBEDS (js/videos.js + js/video-embed.js)
   Privacy-friendly, click-to-load. Nothing loads from YouTube until clicked.
   ========================================================================== */
.video-slot { margin: 1.4rem 0; }
.video-slot-head { margin: 0 0 0.6rem; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.video-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
/* 16:9 clickable thumbnail (button to play, or link-out) */
.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  padding: 0;
  cursor: pointer;
  background-color: var(--surface-sand);
  background-size: cover;
  background-position: center;
  text-decoration: none;
}
.video-thumb .video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34,30,27,0.7);
  color: #fff;
  border-radius: 50%;
  font-size: 1.3rem;
  padding-left: 4px;
}
.video-thumb:hover .video-play { background: var(--berry); }
.video-thumb .video-ext {
  position: absolute;
  left: 10px; bottom: 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  background: rgba(34,30,27,0.78);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
}
.video-thumb-search {
  background: linear-gradient(135deg, var(--surface-blush), var(--surface-sand));
}
.video-thumb-search .video-ext { background: var(--berry); }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-meta { padding: 0.8rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.video-title { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; line-height: 1.25; color: var(--ink); }
.video-channel { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--berry-700); }
.video-why { font-size: 0.9rem; color: var(--ink-2); }
.watch-topic { margin: 1.4rem 0 2rem; }
.watch-topic h3 { margin: 0 0 0.8rem; }

/* ==========================================================================
   EXAM SIMULATOR (js/exam-simulator.js)
   ========================================================================== */
.sim-instruction { font-weight: 500; }
.sim-options { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.8rem 0 1rem; }
.sim-option {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); cursor: pointer;
  font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--ink); margin: 0;
}
.sim-option:hover { border-color: var(--berry); }
.sim-option input { margin-top: 0.25rem; accent-color: var(--berry); flex: none; }
.sim-answer { min-height: 12em; font-size: 1.02rem; line-height: 1.6; }
.sim-wordcount { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin: 0.3rem 0 0; text-align: right; }

.sim-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.5rem 0.7rem 0.5rem 1.1rem;
  margin: 0 0 1.4rem; box-shadow: var(--shadow-card);
}
.sim-bar-spacer { flex: 1; }
.sim-timer {
  font-family: var(--mono); font-size: 1.3rem; font-weight: 500;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.sim-timer.warn { color: var(--gold-700); }
.sim-timer.danger { color: var(--caution); }
.sim-timer.untimed { font-size: 0.95rem; color: var(--muted); }
.sim-question { scroll-margin-top: 5rem; }
.sim-chosen { font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ink); }

.sim-checks { list-style: none; padding-left: 0; margin: 0.6rem 0 0; }
.sim-check { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.3rem 0; }
.sim-check span[aria-hidden] { flex: none; width: 1.2rem; text-align: center; font-weight: 700; }
.sim-check.ok > span[aria-hidden] { color: var(--success); }
.sim-check.miss > span[aria-hidden] { color: var(--caution); }
.sim-hint { color: var(--muted); font-size: 0.92rem; }

/* Distraction-free: hide site chrome while a sitting is active */
body.exam-active .site-header,
body.exam-active .site-footer { display: none; }
body.exam-active main { max-width: 820px; }

/* ==========================================================================
   DASHBOARD (home) + CONCEPT CONFIDENCE (concepts page) — js/dashboard.js
   ========================================================================== */
.dashboard:empty, #confidence:empty { display: none; }
.dashboard {
  background: linear-gradient(160deg, var(--surface), var(--gold-tint));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.6rem 1.8rem;
  margin: 1.6rem 0;
}
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.dash-head h2 { margin: 0; }
.dash-note { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.9rem; margin: 1.2rem 0 1.4rem; }
.dash-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 0.9rem; }
.dash-stat-value { font-family: var(--serif); font-size: 1.7rem; line-height: 1; color: var(--ink); }
.dash-stat-label { font-size: 0.82rem; color: var(--ink-2); margin-top: 0.2rem; }
.dash-stat-sub { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 0.2rem; }
.dash-bar { height: 6px; border-radius: 999px; background: var(--surface-blush); overflow: hidden; margin-top: 0.5rem; }
.dash-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--berry), var(--gold)); }
.dash-next { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--berry); border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.dash-next h3 { margin: 0.15rem 0 0.4rem; font-size: 1.35rem; }
.dash-next p { margin: 0.3rem 0; }
.dash-actions { margin-top: 0.9rem !important; }
.dash-also { font-size: 0.9rem; color: var(--ink-2); }
.dash-also a { margin-right: 0.3rem; }

/* Concept confidence rating */
.conf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.5rem 1.4rem; margin-top: 1rem; }
.conf-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.conf-label { font-weight: 600; text-decoration: none; color: var(--ink); font-size: 0.95rem; }
.conf-label:hover { color: var(--berry); }
.conf-dots { display: inline-flex; gap: 0.3rem; flex: none; }
.conf-dot {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--line-2); background: var(--bg);
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.conf-dot:hover { border-color: var(--berry); }
.conf-dot.on { background: var(--berry); border-color: var(--berry); color: var(--surface); }

/* ==========================================================================
   PARAGRAPH COACH (js/coach.js)
   ========================================================================== */
.coach-mode { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; margin: 0.4rem 0 1rem; }
.coach-mode button {
  font-family: var(--sans); font-weight: 600; font-size: 0.9rem;
  background: transparent; color: var(--ink-2); border: none;
  padding: 0.5rem 1.1rem; cursor: pointer;
}
.coach-mode button[aria-pressed="true"] { background: var(--berry); color: var(--surface); }
.coach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; align-items: start; }
.coach-editor textarea {
  width: 100%; min-height: 18em; font-size: 1.02rem; line-height: 1.6; resize: vertical;
}
.coach-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 1.1rem 1.3rem; min-height: 12em;
}
.coach-meter { margin-bottom: 0.8rem; }
.coach-meter .progress-bar { margin: 0 0 0.3rem; }
.coach-meter-label { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin: 0; }
.coach-disclaimer { font-size: 0.85rem; color: var(--muted); margin-top: 0.9rem; }
@media (max-width: 760px) { .coach-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   DATA EMBEDS (Our World in Data CC BY charts on concept pages)
   ========================================================================== */
.data-embed {
  margin: 1.4rem 0; padding: 1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.data-embed figcaption { font-size: 0.95rem; color: var(--ink-2); margin-bottom: 0.7rem; }
.data-embed figcaption .kicker { display: block; margin-bottom: 0.2rem; }
.data-embed-frame { position: relative; width: 100%; height: 460px; background: var(--surface-sand); border-radius: 10px; overflow: hidden; }
.data-embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.data-embed-src { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin: 0.6rem 0 0; }
@media (max-width: 640px) { .data-embed-frame { height: 380px; } }

/* ==========================================================================
   THIS YEAR IN MEDIA (js/current-media.js)
   ========================================================================== */
.cm-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 1.2rem; }
.cm-filter {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 0.3rem 0.8rem; cursor: pointer;
}
.cm-filter:hover { border-color: var(--berry); color: var(--berry); }
.cm-filter.on { background: var(--berry); color: var(--surface); border-color: var(--berry); }
.cm-list { display: flex; flex-direction: column; gap: 1rem; }
.cm-item { margin: 0; }
.cm-meta { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--muted); }
.cm-title { margin: 0.3rem 0 0.4rem; font-size: 1.25rem; }
.cm-title a { text-decoration: none; }
.cm-why { margin: 0 0 0.7rem; color: var(--ink-2); }
.cm-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cm-chip {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--surface-blush); color: var(--berry-700);
  border-radius: 999px; padding: 0.22rem 0.7rem; text-decoration: none;
}
.cm-chip:hover { background: var(--berry); color: var(--surface); }
.cm-qchip {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--teal-tint); color: var(--teal-700);
  border-radius: 999px; padding: 0.22rem 0.7rem;
}
/* Home "fresh in media" mini-panel */
.cm-mini-panel:empty { display: none; }
.cm-mini { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.cm-mini li { display: flex; flex-direction: column; }
.cm-mini a { font-weight: 600; text-decoration: none; }
.cm-mini-meta { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }

/* ==========================================================================
   VIEWING LIBRARY (js/viewing-library.js)
   ========================================================================== */
.vl-intro-card h2 { margin-top: 0.2rem; }
.vl-panel { margin-top: 1.5rem; }
.vl-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.vl-panel-head h2 { margin: 0.2rem 0 0; }
.vl-search-row { margin: 0 0 1rem; }
.vl-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem 1rem;
}
.vl-field label, .vl-search-row label { line-height: 1.35; }
.vl-filter-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.9rem 0 0;
}
.vl-results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.3rem 0 0.8rem;
}
.vl-results-head .kicker { margin: 0; }
.vl-active {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}
.vl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
}
.vl-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.vl-card:hover { box-shadow: var(--shadow-card-hover); }
.vl-card-art {
  display: block;
  text-decoration: none;
  color: inherit;
}
.vl-card-body {
  padding: 1rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}
.vl-card h3 {
  margin: 0;
  font-size: 1.35rem;
}
.vl-card h3 a {
  color: var(--ink);
  text-decoration: none;
}
.vl-card h3 a:hover { color: var(--berry); text-decoration: underline; }
.vl-card p { margin: 0; }
.vl-meta, .vl-creator {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.vl-creator { min-height: 1.45em; }
.vl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.vl-tag {
  text-decoration: none;
  border: 1px solid transparent;
}
.vl-tag:hover {
  background: var(--berry);
  color: var(--surface);
}
.vl-card-foot {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.vl-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-700);
  background: var(--teal-tint);
  border: 1px solid var(--teal-line);
  border-radius: 999px;
  padding: 0.24rem 0.7rem;
}
.vl-empty { grid-column: 1 / -1; }

.vl-poster {
  min-height: 245px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(252,248,243,0.52), transparent 28%),
    linear-gradient(145deg, var(--surface-blush), var(--surface-sand));
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  isolation: isolate;
}
.vl-poster::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(252,248,243,0.52);
  border-radius: 12px;
  z-index: -1;
}
.vl-poster::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -44px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(252,248,243,0.18);
  border: 1px solid rgba(252,248,243,0.28);
  z-index: -1;
}
.vl-poster-year,
.vl-poster-concept {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(252,248,243,0.9);
}
.vl-poster-mark {
  font-family: var(--serif);
  font-size: 4.6rem;
  line-height: 0.95;
  color: rgba(252,248,243,0.94);
  letter-spacing: 0;
  text-shadow: 0 14px 28px rgba(34,30,27,0.18);
}
.vl-poster-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.08;
  color: #FCF8F3;
  max-width: 11ch;
}
.vl-tone-0 { background: linear-gradient(145deg, #9C5B66, #5E7A78); }
.vl-tone-1 { background: linear-gradient(145deg, #5E7A78, #A9824B); }
.vl-tone-2 { background: linear-gradient(145deg, #7C4651, #A9824B); }
.vl-tone-3 { background: linear-gradient(145deg, #41605D, #9C5B66); }
.vl-tone-4 { background: linear-gradient(145deg, #A9824B, #7C4651); }
.vl-tone-5 { background: linear-gradient(145deg, #5E7A78, #2E2A27); }

.vl-entry-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hero);
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) 1fr;
  overflow: hidden;
  margin: 1.2rem 0 1.4rem;
}
.vl-entry-poster {
  background: var(--surface-sand);
  border-right: 1px solid var(--line);
}
.vl-poster-large {
  min-height: 100%;
  height: 100%;
  border-bottom: none;
}
.vl-poster-large .vl-poster-mark { font-size: 6.8rem; }
.vl-poster-large .vl-poster-title { font-size: 2rem; max-width: 12ch; }
.vl-entry-copy {
  padding: 2rem 2.2rem;
}
.vl-entry-copy h1 { margin-top: 0; }
.vl-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.75rem;
  margin: 1.2rem 0;
}
.vl-facts div {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
}
.vl-facts dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.vl-facts dd {
  margin: 0.15rem 0 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
}
.vl-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0;
}
.vl-watch-summary {
  color: var(--ink-2);
  font-size: 0.95rem;
}
.vl-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  align-items: start;
}
.vl-two-col .card { margin: 0; }
.vl-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.vl-related {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-height: 5.4rem;
  background: var(--surface-sand);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  padding: 0.85rem 0.95rem;
  text-decoration: none;
}
.vl-related:hover {
  border-color: var(--berry);
  color: var(--berry);
  background: var(--surface-blush);
}
.vl-related span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.vl-watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0;
}
.vl-watch-box {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.95rem 1rem;
}
.vl-watch-box h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--berry);
  margin: 0 0 0.45rem;
}
.vl-watch-box ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.vl-watch-box li {
  margin: 0.55rem 0;
}
.vl-watch-box li span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}
.vl-muted, .vl-disclaimer {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Synthesis Pathways ---------- */

.sp-masthead {
  padding: 2.8rem 0 0.8rem;
}
.sp-masthead h1 {
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 1.03;
  max-width: 13ch;
  margin: 0 0 0.35em;
}
.sp-masthead .lead {
  max-width: 58ch;
  font-size: 1.16rem;
}
.sp-intent-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.6rem;
}
.sp-intent-row span {
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
}
.sp-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 1.55rem;
}
.sp-rule::before,
.sp-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--line-2));
}
.sp-rule::after {
  background: linear-gradient(90deg, var(--line-2), transparent);
}
.sp-rule span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--berry);
}
.sp-brief {
  background: var(--teal-tint);
  border: 1px solid var(--teal-line);
  border-left: 4px solid var(--teal);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  margin: 1.4rem 0 0;
}
.sp-brief p {
  margin: 0;
  color: var(--ink-2);
}
.sp-brief .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.sp-chooser-card {
  margin: 1rem 0 1.7rem;
}
.sp-chooser-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.05rem;
}
.sp-chooser-head h2 {
  margin: 0.15rem 0 0;
  font-size: 2rem;
}
.sp-chooser {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.sp-choice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 0.45rem;
  min-height: 124px;
  padding: 0.95rem 1.05rem;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.sp-choice:hover,
.sp-choice:focus-visible {
  border-color: var(--berry);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.sp-choice.is-active {
  background: var(--surface);
  border-left: 4px solid var(--berry);
  border-color: var(--berry);
}
.sp-choice-number {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--berry);
}
.sp-choice-title {
  font-family: var(--serif);
  font-size: 1.24rem;
  line-height: 1.14;
  color: var(--ink);
}
.sp-choice-desc {
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sp-panel {
  margin-top: 1.5rem;
}
.sp-stage {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-hero);
  margin: 1rem 0 1.25rem;
}
.sp-stage-dark,
.sp-stage-paper {
  padding: 2rem 2.1rem;
}
.sp-stage-dark {
  background: linear-gradient(135deg, #2E2A27, #443635);
  color: #F4ECE4;
}
.sp-stage-dark h2 {
  color: #FCF8F3;
  margin: 0.5rem 0 0.8rem;
}
.sp-stage-dark p:not(.sp-stage-label) {
  color: rgba(252,248,243,0.86);
  font-size: 1.04rem;
  line-height: 1.65;
}
.sp-stage-label {
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 0.7rem;
}
.sp-stage-dark .sp-stage-label {
  color: rgba(252,248,243,0.72);
}
.sp-stage-paper {
  background: var(--surface);
}
.sp-stage-paper .sp-stage-label {
  color: var(--berry);
}
.sp-stage-paper h3 {
  margin: 0.25rem 0 0.25rem;
  font-size: 1.25rem;
}
.sp-stage-paper ol {
  margin: 1rem 0 0;
  padding-left: 1.35rem;
}
.sp-stage-paper li {
  margin: 0.55rem 0;
}
.sp-chip-row,
.sp-token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}
.sp-exam-chip,
.sp-token {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.25rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.sp-exam-chip {
  background: var(--surface-blush);
  border: 1px solid var(--line);
  color: var(--berry);
}
.sp-token {
  background: var(--surface-sand);
  border: 1px solid transparent;
  color: var(--ink);
}
.sp-token:hover {
  border-color: var(--berry);
  color: var(--berry);
  background: var(--surface-blush);
}
.sp-token-muted {
  color: var(--muted);
}
.sp-avoid {
  margin-top: 1.1rem;
}
.sp-resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0;
}
.sp-resource,
.sp-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.05rem 1.1rem;
}
.sp-resource h3,
.sp-section h3 {
  margin-top: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sp-writing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.sp-section-wide {
  grid-column: 1 / -1;
}
.sp-angle-list,
.sp-comparison-list,
.sp-practice-list {
  margin-bottom: 0;
}
.sp-angle-list li,
.sp-comparison-list li,
.sp-practice-list li {
  margin: 0.55rem 0;
}

@media (max-width: 760px) {
  .vl-panel-head,
  .vl-results-head {
    display: block;
  }
  .vl-active { text-align: left; margin-top: 0.3rem; }
  .vl-entry-hero { grid-template-columns: 1fr; }
  .vl-entry-poster { border-right: none; border-bottom: 1px solid var(--line); }
  .vl-poster-large { min-height: 320px; }
  .vl-entry-copy { padding: 1.5rem 1.4rem; }
  .vl-two-col { grid-template-columns: 1fr; }
  .sp-stage,
  .sp-resource-grid {
    grid-template-columns: 1fr;
  }
  .sp-masthead { padding-top: 2.1rem; }
  .sp-masthead h1 { font-size: 2.8rem; }
  .sp-brief { display: block; }
  .sp-brief .btn { margin-top: 0.75rem; }
  .sp-chooser { grid-template-columns: 1fr; }
  .sp-chooser-head {
    display: block;
  }
  .sp-chooser-head .btn {
    margin-top: 0.75rem;
  }
  .sp-choice {
    min-height: 0;
  }
  .sp-stage-dark,
  .sp-stage-paper {
    padding: 1.45rem;
  }
  .sp-writing-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Print ---------- */

@media print {
  .site-header, .site-footer, .nav-toggle, .theme-toggle, .search-wrap,
  .btn, .entry-actions, .no-print, .video-grid, .sim-bar, .sim-options, .sim-wordcount,
  .coach-mode, .coach-editor, .cm-filters, .vl-panel, .data-embed-frame,
  .conf-dots,
  .flashcard-stage, .fc-controls, .fc-toolbar, .fc-rate, .explainer .ex-controls, .map-wrap,
  #gloss-tip { display: none !important; }
  .gloss { border-bottom: none; }                  /* no dotted underline on paper */
  body { background: #fff; color: #000; font-size: 11pt; }
  body::before { display: none; }                 /* no grain on paper */
  main { max-width: 100%; padding: 0; }
  .card, .callout, .teacher-notice, details, .table-wrap { box-shadow: none; break-inside: avoid; }
  .card-art, .hero-art, .page-art, .concept-motif, .theory-motif, .empty-state img { display: none; }
  details { border: 1px solid #999; }
  /* js/main.js opens all <details> automatically before printing */
  a { color: #000; text-decoration: none; }
  h2 { break-after: avoid; }
}
