/* ============================================================
   Music Theory and The Fretboard — Design System
   Light mode, "songbook / music-press" editorial aesthetic
   ============================================================ */

/* ─── Custom Properties ─────────────────────────────────────── */
:root {
  /* Paper & ink */
  --paper: #FBF7EF;
  --paper-dark: #F4EEE0;
  --paper-darker: #E8DEC8;
  --ink: #241F1A;
  --ink-muted: #5A4E42;
  --ink-faint: #8C7B6A;

  /* Guitar amber — primary accent */
  --amber: #B8741A;
  --amber-mid: #D4892A;
  --amber-light: #F5E6C8;
  --amber-xlight: #FBF3E4;
  --bass-accent: #24745F;
  --bass-accent-light: #E3F2EC;

  /* Sidebar (dark wood) */
  --sidebar-bg: #201C18;
  --sidebar-bg-hover: #2E2720;
  --sidebar-text: #EDE5D8;
  --sidebar-text-muted: #A09080;
  --sidebar-border: #3A3028;
  --sidebar-active-bg: #3D3020;
  --sidebar-active-text: #F5D68A;

  /* Chapter type accents */
  --theory-accent: #B8741A;      /* amber for Music Theory */
  --theory-accent-light: #FBF0DC;
  --fretboard-accent: #2564A8;   /* slate blue for The Fretboard */
  --fretboard-accent-light: #E0EBF5;
  --both-accent: #5A7A2A;        /* forest green for combined */
  --both-accent-light: #EDF4E0;
  --misc-accent: #5A4E42;

  /* Part color coding */
  --part-i-color: #B8741A;
  --part-ii-color: #2564A8;
  --part-iii-color: #8B3BAB;
  --part-iv-color: #2A8A5A;
  --part-v-color: #C94040;
  --part-vi-color: #B89A1A;

  /* Rainbow scale degrees */
  --deg-1: #E84040;
  --deg-2: #E8810A;
  --deg-3: #D4A800;
  --deg-4: #3AAA5A;
  --deg-5: #2878C8;
  --deg-6: #8844C8;
  --deg-7: #C83460;

  /* Typography */
  --font-display: 'Fraunces', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Newsreader', 'Georgia', 'Times New Roman', serif;
  --font-mono: 'Courier New', 'Courier', monospace;

  /* Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Layout */
  --sidebar-width: 280px;
  --content-max: 740px;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(36, 31, 26, 0.10), 0 1px 2px rgba(36, 31, 26, 0.06);
  --shadow: 0 4px 12px rgba(36, 31, 26, 0.10), 0 2px 4px rgba(36, 31, 26, 0.06);
  --shadow-lg: 0 8px 24px rgba(36, 31, 26, 0.12), 0 4px 8px rgba(36, 31, 26, 0.08);

  /* Animation */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 200ms var(--ease-out);
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.72;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Normalize musical accidental positioning. site.js adds these wrappers
   automatically to flats and sharps in chapter content. */
.accidental-flat {
  display: inline-block;
  margin-left: -0.28em;
  margin-right: -0.18em;
}

.accidental-sharp {
  display: inline-block;
  position: relative;
  top: -0.1em;
}

/* ─── Layout: Sidebar + Content ──────────────────────────────── */
.chapter-page {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: block;
  text-decoration: none;
  color: var(--sidebar-text);
}

.sidebar-logo-title {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--sidebar-active-text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.sidebar-logo-amp {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--amber-mid);
  font-size: var(--text-sm);
}

.sidebar-logo-sub {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--sidebar-text-muted);
  font-style: italic;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2) 0 var(--space-8);
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-border) transparent;
}

.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 2px; }

/* Part groups (details/summary) */
.sidebar-part {
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-part-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text-muted);
  list-style: none;
  user-select: none;
  transition: color var(--transition), background var(--transition);
}

.sidebar-part-title::-webkit-details-marker { display: none; }
.sidebar-part[open] .sidebar-part-title { color: var(--sidebar-text); }
.sidebar-part-title:hover { color: var(--sidebar-text); background: var(--sidebar-bg-hover); }

/* Single-page parts (e.g. Introduction) rendered as a direct link */
.sidebar-part-link { text-decoration: none; }
.sidebar-part-flat.active .sidebar-part-link {
  color: var(--sidebar-active-text);
  background: var(--sidebar-active-bg);
}

.part-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  font-size: 0.7em;
  font-weight: 700;
  flex-shrink: 0;
}

/* Part color accents on the sidebar */
.sidebar-part.part-i .part-num { background: var(--part-i-color); color: white; }
.sidebar-part.part-ii .part-num { background: var(--part-ii-color); color: white; }
.sidebar-part.part-iii .part-num { background: var(--part-iii-color); color: white; }
.sidebar-part.part-iv .part-num { background: var(--part-iv-color); color: white; }
.sidebar-part.part-v .part-num { background: var(--part-v-color); color: white; }
.sidebar-part.part-vi .part-num { background: var(--part-vi-color); color: white; }
.sidebar-part.front-matter .part-num,
.sidebar-part.back-matter .part-num { background: var(--ink-faint); color: white; }

.sidebar-chapters {
  list-style: none;
  padding: var(--space-1) 0 var(--space-2);
}

.sidebar-chapter a {
  display: block;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-6);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  color: var(--sidebar-text-muted);
  text-decoration: none;
  line-height: 1.4;
  transition: color var(--transition), background var(--transition);
  position: relative;
}

.sidebar-chapter a:hover {
  color: var(--sidebar-text);
  background: var(--sidebar-bg-hover);
}

.sidebar-chapter.active a {
  color: var(--sidebar-active-text);
  background: var(--sidebar-active-bg);
  font-weight: 600;
}

/* Type accent stripe */
.sidebar-chapter.ch-theory a::before,
.sidebar-chapter.ch-fretboard a::before,
.sidebar-chapter.ch-both a::before {
  content: '';
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 2px;
}

.sidebar-chapter.ch-theory a::before { background: var(--theory-accent); }
.sidebar-chapter.ch-fretboard a::before { background: var(--fretboard-accent); }
.sidebar-chapter.ch-both a::before { background: var(--both-accent); }

.ch-num {
  font-size: var(--text-xs);
  color: var(--sidebar-text-muted);
  margin-right: var(--space-1);
  font-variant-numeric: tabular-nums;
}

/* ─── Drawer toggle (mobile) ─────────────────────────────────── */
.drawer-toggle {
  display: none;
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 200;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--sidebar-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow);
  align-items: center;
  justify-content: center;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--sidebar-text);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger { position: relative; }
.hamburger::before, .hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

.drawer-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.drawer-toggle[aria-expanded="true"] .hamburger::before { transform: rotate(45deg) translate(4px, 4px); }
.drawer-toggle[aria-expanded="true"] .hamburger::after { transform: rotate(-45deg) translate(4px, -4px); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(36, 31, 26, 0.5);
  z-index: 90;
  backdrop-filter: blur(2px);
}

/* ─── Main content area ──────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  padding: var(--space-8) var(--space-8) var(--space-16);
}

.chapter-article {
  max-width: var(--content-max);
  margin: 0 auto;
  animation: fadeInUp 0.4s var(--ease-out) both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  max-width: var(--content-max);
  margin: 0 auto var(--space-6);
  font-size: var(--text-sm);
  color: var(--ink-faint);
  font-family: var(--font-body);
}

.breadcrumb a {
  color: var(--amber);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.bc-sep {
  margin: 0 var(--space-2);
  color: var(--ink-faint);
}

/* ─── Print-first guitar / bass applications ────────────────── */

.instrument-variants {
  display: grid;
  gap: var(--space-5);
}

.instrument-variant {
  padding: var(--space-5);
  border: 1px solid var(--paper-darker);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  background: var(--amber-xlight);
}

.instrument-variant[data-instrument="bass"] {
  border-left-color: var(--bass-accent);
  background: var(--bass-accent-light);
}

.instrument-variant__title {
  margin-top: 0 !important;
  font-size: var(--text-lg) !important;
}

/* ─── Chapter header ─────────────────────────────────────────── */
.chapter-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  padding-left: var(--space-5);
  border-bottom: 2px solid var(--paper-darker);
  position: relative;
}

/* Chapter type accent bar */
.theme-theory .chapter-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--theory-accent);
  border-radius: 0 2px 2px 0;
}

.theme-fretboard .chapter-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--fretboard-accent);
  border-radius: 0 2px 2px 0;
}

.theme-both .chapter-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--theory-accent), var(--fretboard-accent));
  border-radius: 0 2px 2px 0;
}

.chapter-number-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--space-2);
}

.theme-theory .chapter-number-label { color: var(--theory-accent); }
.theme-fretboard .chapter-number-label { color: var(--fretboard-accent); }
.theme-both .chapter-number-label { color: var(--both-accent); }

.chapter-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ─── Body typography ────────────────────────────────────────── */
.chapter-body {
  font-size: var(--text-md);
  line-height: 1.78;
  color: var(--ink);
}

.chapter-body > * + * { margin-top: var(--space-5); }

.chapter-body p { margin-top: var(--space-5); }

.chapter-body h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

.chapter-body h2.centered-subhead {
  text-align: center;
  font-size: var(--text-lg);
  color: var(--ink-muted);
}

.chapter-body h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  color: var(--ink);
}

.chapter-body h3.centered-subhead {
  text-align: center;
  color: var(--ink-muted);
}

.chapter-body h4 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.chapter-body strong { font-weight: 700; color: var(--ink); }
.chapter-body em { font-style: italic; }

.chapter-body a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chapter-body a:hover { color: var(--amber-mid); }

.chapter-body ol, .chapter-body ul {
  padding-left: var(--space-6);
  margin-top: var(--space-4);
}

.chapter-body li { margin-top: var(--space-2); line-height: 1.65; }
.chapter-body li > p { margin-top: var(--space-2); }

/* ─── Figures & images ───────────────────────────────────────── */
.chapter-body figure {
  margin: var(--space-8) auto;
  text-align: center;
}

.chapter-body figure img,
.chapter-body p > img,
.chapter-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  display: block;
  margin: var(--space-6) auto;
  transition: box-shadow var(--transition), transform var(--transition);
}

.chapter-body img:hover {
  box-shadow: var(--shadow);
  transform: scale(1.005);
}

/* ─── Figure captions ────────────────────────────────────────── */
/* Pull the caption tight under its image so it reads as a caption, not a
   separate block. The default img has a bottom margin; drop it when a
   caption follows. */
.chapter-body figure > img {
  margin-bottom: 0;
}

.chapter-body figcaption {
  margin-top: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ─── Figure numbering ───────────────────────────────────────── */
/* Figures are auto-numbered per page with a CSS counter, so chapters can
   be reordered and figures inserted without renumbering by hand. A caption
   opts in by opening with an empty <span class="fig-label"></span>. */
.chapter-body { counter-reset: fig; }
.chapter-body figure { counter-increment: fig; }

.chapter-body .fig-label::after {
  content: "Figure " counter(fig) ".";
  font-weight: 600;
  color: var(--ink);
}

.chapter-body figcaption > .fig-label { margin-right: 0.45em; }

/* Legend caption: explains the connector lines in a diagram, mirroring
   their stroke styles with small inline-SVG swatches. The negative top
   margin tucks the box up into the diagram's internal bottom whitespace
   so it reads as a caption, not a detached block. */
.chapter-body figcaption.line-legend {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  margin-top: 0;
  padding: 0 var(--space-16);
  border: 1px solid var(--paper-darker);
  border-radius: var(--radius);
  background: var(--paper-dark);
}

.chapter-body figcaption.line-legend .line-legend-intro {
  font-style: italic;
}

.chapter-body figcaption.line-legend .line-legend-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-6);
}

.chapter-body figcaption.line-legend .line-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.chapter-body figcaption.line-legend .line-legend-swatch {
  flex: 0 0 auto;
}

.chapter-body figcaption.line-legend strong {
  color: var(--ink);
  font-weight: 600;
}

/* ─── Media rows (image beside text) ─────────────────────────── */
/* A figure sat alongside a block of text rather than stacked above
   or below it. Add `.reverse` to flip the image to the other side. */
.chapter-body .media-row {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin: var(--space-10) 0;
}

.chapter-body .media-row.reverse {
  flex-direction: row-reverse;
}

.chapter-body .media-row > .media-figure {
  flex: 0 0 auto;
  max-width: 42%;
  margin: 0;
}

/* Image-dominant variant: for wide, detail-rich figures (e.g. waveform
   comparisons) that need room. The figure takes the larger share and the
   text sits in a narrower column beside it. */
.chapter-body .media-row.media-wide > .media-figure {
  max-width: 58%;
}

.chapter-body .media-row > .media-figure img {
  width: auto;
  max-width: 100%;
  margin: 0;
}

.chapter-body .media-row > .media-text {
  flex: 1 1 0;
  min-width: 0;
}

/* The text block manages its own internal spacing; don't let the
   first paragraph push away from the top of the row. */
.chapter-body .media-row > .media-text > :first-child {
  margin-top: 0;
}

@media (max-width: 600px) {
  .chapter-body .media-row,
  .chapter-body .media-row.reverse {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
  }

  .chapter-body .media-row > .media-figure,
  .chapter-body .media-row.media-wide > .media-figure {
    max-width: 100%;
    align-self: center;
  }
}

/* ─── Audio comparisons ──────────────────────────────────────── */
.chapter-body .chapter-audio-comparison {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  border: 1px solid var(--paper-darker);
  border-radius: var(--radius);
  background: var(--paper);
}

.chapter-body .chapter-audio-comparison > h4 {
  margin-top: 0;
}

.chapter-body .audio-example {
  padding: var(--space-4);
  border-left: 4px solid var(--theory-accent);
  background: var(--paper-dark);
}

.chapter-body .audio-example + .audio-example {
  margin-top: var(--space-4);
  border-left-color: var(--both-accent);
}

.chapter-body .audio-example p:first-child {
  margin-top: 0;
}

.chapter-body .audio-example audio {
  display: block;
  width: 100%;
  margin-top: var(--space-3);
}

/* ─── Tables ─────────────────────────────────────────────────── */
.chapter-body table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
  overflow-x: auto;
  display: block;
}

.chapter-body thead tr { background: var(--paper-dark); }

.chapter-body th, .chapter-body td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border: 1px solid var(--paper-darker);
  vertical-align: top;
  min-width: 2.5rem;
}

.chapter-body th {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  background: var(--paper-dark);
}

.chapter-body tr:nth-child(even) td { background: var(--paper); }
.chapter-body tr:hover td { background: var(--amber-xlight); }

/* Table wrapper for horizontal scroll */
.chapter-body table {
  max-width: 100%;
}

/* Center a table horizontally and shrink it to its content */
.chapter-body table.table-center {
  display: table;
  width: auto;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Student Assignment callout boxes ───────────────────────── */
.chapter-body .assignment-box {
  background: var(--amber-xlight);
  border: 1.5px solid var(--amber-light);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: var(--space-6) var(--space-8);
  margin: var(--space-8) 0;
}

.chapter-body .assignment-box .assignment-heading {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--amber);
  margin-top: 0;
  margin-bottom: var(--space-4);
}

/* ─── Callout: "Note" / "Tip" ────────────────────────────────── */
.chapter-body .textbox {
  background: var(--paper-dark);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
  border-left: 3px solid var(--ink-faint);
  font-size: var(--text-sm);
}

/* ─── Level 3 melody concept diagrams ───────────────────────── */
.chapter-body .pull-question {
  background: var(--amber-xlight);
  border: 1px solid var(--amber-light);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-6) 0;
}

.chapter-body .pull-question p {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 650;
  line-height: 1.25;
  color: var(--ink);
}

.chapter-body .chapter-diagram {
  text-align: left;
  background: var(--paper-dark);
  border: 1px solid var(--paper-darker);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.chapter-body .chapter-diagram figcaption {
  margin-top: var(--space-4);
  text-align: center;
}

.question-shift-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-4);
}

.question-card {
  min-height: 7.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-5);
  border: 1px solid var(--paper-darker);
  border-top: 4px solid var(--fretboard-accent);
  border-radius: var(--radius);
  background: var(--fretboard-accent-light);
}

.question-card-emphasis {
  border-top-color: var(--both-accent);
  background: var(--both-accent-light);
}

.question-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.question-card p {
  margin: var(--space-2) 0 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.question-arrow {
  align-self: center;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
  color: var(--amber);
}

.toolkit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.toolkit-card {
  min-height: 10rem;
  padding: var(--space-4);
  border: 1px solid var(--paper-darker);
  border-radius: var(--radius);
  background: var(--paper);
}

.toolkit-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: white;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
}

.toolkit-phrasing .toolkit-number { background: var(--theory-accent); }
.toolkit-shape .toolkit-number { background: var(--fretboard-accent); }
.toolkit-choice .toolkit-number { background: var(--both-accent); }

.toolkit-card h3 {
  margin: var(--space-3) 0 var(--space-2);
  font-size: var(--text-md);
  line-height: 1.25;
}

.toolkit-card p {
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.45;
  color: var(--ink-muted);
}

.diagram-eyebrow {
  display: block;
  margin-bottom: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.palette-decision-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-4);
}

.palette-panel {
  min-width: 0;
  min-height: 11rem;
  padding: var(--space-5);
  border: 1px solid var(--paper-darker);
  border-top: 4px solid var(--fretboard-accent);
  border-radius: var(--radius);
  background: var(--fretboard-accent-light);
}

.palette-panel-decisions {
  border-top-color: var(--both-accent);
  background: var(--both-accent-light);
}

.palette-panel p {
  margin: var(--space-4) 0 0;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.25;
}

.palette-note-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.palette-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  color: white;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16);
}

.note-do { background: var(--deg-1); }
.note-re { background: var(--deg-2); }
.note-mi { background: var(--deg-3); color: var(--ink); }
.note-fa { background: var(--deg-4); }
.note-so { background: var(--deg-5); }
.note-la { background: var(--deg-6); }
.note-ti { background: var(--deg-7); }

.decision-stack {
  display: grid;
  gap: var(--space-2);
}

.decision-stack span {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--both-accent);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.44);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.component-dials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.component-dial {
  min-width: 0;
  min-height: 13rem;
  padding: var(--space-5) var(--space-4);
  border: 1px solid var(--paper-darker);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
}

.component-dial h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
  line-height: 1.25;
}

.component-dial p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--ink-muted);
}

.dial-face {
  display: block;
  position: relative;
  width: 5.25rem;
  height: 5.25rem;
  margin: 0 auto var(--space-4);
  border: 2px solid var(--paper-darker);
  border-radius: 50%;
  background: var(--paper-dark);
}

.dial-face::before {
  content: '';
  position: absolute;
  inset: 0.72rem;
  border: 1px solid var(--paper-darker);
  border-radius: 50%;
  background: var(--paper);
}

.dial-face::after {
  content: '';
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 3px;
  height: 1.9rem;
  border-radius: 2px;
  transform-origin: bottom center;
}

.toolkit-phrasing .dial-face { border-color: var(--theory-accent); }
.toolkit-shape .dial-face { border-color: var(--fretboard-accent); }
.toolkit-choice .dial-face { border-color: var(--both-accent); }
.toolkit-phrasing .dial-face::after { background: var(--theory-accent); transform: translateX(-50%) rotate(-34deg); }
.toolkit-shape .dial-face::after { background: var(--fretboard-accent); transform: translateX(-50%) rotate(8deg); }
.toolkit-choice .dial-face::after { background: var(--both-accent); transform: translateX(-50%) rotate(39deg); }

.balance-spectrum {
  padding: var(--space-3) var(--space-2) 0;
}

.balance-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 1rem;
  overflow: visible;
  border: 1px solid var(--paper-darker);
  border-radius: 999px;
  background: var(--paper);
}

.balance-left { border-radius: 999px 0 0 999px; background: var(--fretboard-accent-light); }
.balance-center { background: var(--both-accent-light); }
.balance-right { border-radius: 0 999px 999px 0; background: var(--amber-light); }

.balance-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.55rem;
  height: 1.55rem;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--both-accent);
  box-shadow: var(--shadow-sm);
  transform: translate(-50%, -50%);
}

.balance-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-md);
  line-height: 1.2;
  text-align: center;
}

.balance-labels span {
  color: var(--ink-muted);
}

.balance-labels strong {
  color: var(--both-accent);
}

.phrase-anatomy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
}

.phrase-anatomy-card {
  min-height: 7rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-5);
  border: 1px solid var(--paper-darker);
  border-top: 4px solid var(--theory-accent);
  border-radius: var(--radius);
  background: var(--paper);
}

.phrase-end-card {
  border-top-color: var(--both-accent);
}

.phrase-anatomy-card span,
.qa-phrase-card span {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.phrase-anatomy-card strong,
.qa-phrase-card strong {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.2;
}

.phrase-breath-mark {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  color: var(--ink-muted);
}

.phrase-breath-mark span {
  display: block;
  width: 5rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ink-faint), transparent);
}

.phrase-breath-mark strong {
  font-size: var(--text-xs);
  font-style: italic;
  font-weight: 600;
}

.phrase-starts {
  display: grid;
  gap: var(--space-3);
}

.phrase-start-row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
}

.phrase-start-row > strong {
  font-family: var(--font-display);
  font-size: var(--text-md);
  line-height: 1.2;
}

.phrase-start-timeline {
  display: grid;
  grid-template-columns: minmax(4.5rem, 0.8fr) repeat(4, minmax(3rem, 1fr));
  gap: var(--space-2);
}

.timing-cell {
  position: relative;
  min-height: 3.6rem;
  display: flex;
  justify-content: center;
  padding-top: var(--space-2);
  border: 1px solid var(--paper-darker);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
}

.pickup-cell {
  border-style: dashed;
  background: var(--amber-xlight);
}

.strong-beat {
  border-color: var(--ink-faint);
  color: var(--ink);
}

.timing-cell.note-on::after {
  content: "C";
  position: absolute;
  left: 50%;
  bottom: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--deg-1);
  color: white;
  font-size: var(--text-xs);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16);
  transform: translateX(-50%);
}

.timing-cell.rest-cell::after {
  content: "rest";
  position: absolute;
  left: 50%;
  bottom: 0.55rem;
  color: var(--ink-faint);
  font-size: var(--text-xs);
  font-style: italic;
  font-weight: 600;
  transform: translateX(-50%);
}

.qa-phrasing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-4);
}

.qa-phrase-card {
  min-height: 8.5rem;
  padding: var(--space-5);
  border: 1px solid var(--paper-darker);
  border-top: 4px solid var(--fretboard-accent);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
}

.qa-answer {
  border-top-color: var(--both-accent);
}

.qa-phrase-card p {
  margin: var(--space-3) 0 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.qa-contour-line {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 4;
  margin: var(--space-3) auto 0;
  overflow: visible;
}

.qa-contour-line path {
  fill: none;
  stroke: var(--fretboard-accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.qa-answer .qa-contour-line path {
  stroke: var(--both-accent);
}

.phrase-arrow {
  align-self: center;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
  color: var(--amber);
}

.energy-movement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.energy-card {
  min-width: 0;
  min-height: 16rem;
  padding: var(--space-4);
  border: 1px solid var(--paper-darker);
  border-top: 4px solid var(--fretboard-accent);
  border-radius: var(--radius);
  background: var(--paper);
}

.energy-card-level {
  border-top-color: var(--theory-accent);
}

.energy-card-down {
  border-top-color: var(--both-accent);
}

.energy-line {
  display: block;
  width: 100%;
  aspect-ratio: 15 / 8;
  margin-bottom: var(--space-3);
  overflow: visible;
}

.energy-line path,
.energy-line circle,
.contour-shape-card svg path,
.repeat-phrase svg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.energy-line path {
  stroke: var(--fretboard-accent);
  stroke-width: 6;
}

.energy-line circle {
  fill: var(--paper);
  stroke: var(--fretboard-accent);
  stroke-width: 4;
}

.energy-card-level .energy-line path,
.energy-card-level .energy-line circle {
  stroke: var(--theory-accent);
}

.energy-card-down .energy-line path,
.energy-card-down .energy-line circle {
  stroke: var(--both-accent);
}

.energy-card h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-md);
  line-height: 1.2;
}

.energy-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.2;
}

.energy-card p {
  margin: var(--space-3) 0 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.melody-motion-aside {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  border: 1px solid var(--paper-darker);
  border-left: 4px solid var(--both-accent);
  border-radius: var(--radius);
  background: var(--both-accent-light);
}

.melody-motion-aside p {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
}

.melody-motion-aside span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.75rem;
  padding: var(--space-3);
  border: 1px solid rgba(90, 122, 42, 0.24);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.48);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.contour-shape-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.contour-shape-card {
  min-width: 0;
  min-height: 10.5rem;
  padding: var(--space-3);
  border: 1px solid var(--paper-darker);
  border-radius: var(--radius);
  background: var(--paper);
}

.contour-shape-card svg {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 11;
  margin-bottom: var(--space-2);
  overflow: visible;
}

.contour-shape-card svg path {
  stroke: var(--fretboard-accent);
  stroke-width: 5;
}

.contour-shape-card:nth-child(2) svg path,
.contour-shape-card:nth-child(5) svg path {
  stroke: var(--ink-faint);
}

.contour-shape-card:nth-child(3) svg path,
.contour-shape-card:nth-child(6) svg path {
  stroke: var(--both-accent);
}

.contour-shape-card:nth-child(4) svg path {
  stroke: var(--theory-accent);
}

.contour-shape-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-md);
  line-height: 1.2;
}

.contour-shape-card span {
  display: block;
  margin-top: var(--space-1);
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: 1.25;
}

.repeat-contour {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.repeat-phrase {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--paper-darker);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
}

.repeat-phrase .phrase-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.repeat-phrase strong {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.2;
}

.repeat-phrase svg {
  display: block;
  width: 100%;
  aspect-ratio: 18 / 7;
  margin-top: var(--space-3);
}

.repeat-phrase svg path {
  stroke: var(--fretboard-accent);
  stroke-width: 5;
}

.chapter-body .chapter-ending {
  margin: var(--space-8) 0 0;
  padding: var(--space-5) var(--space-6);
  border-left: 4px solid var(--both-accent);
  border-radius: var(--radius);
  background: var(--both-accent-light);
}

.chapter-body .chapter-ending p {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.25;
}

.chapter-body .chapter-ending p + p {
  margin-top: var(--space-2);
  color: var(--both-accent);
}

@media (max-width: 700px) {
  .question-shift-flow,
  .toolkit-grid,
  .palette-decision-flow,
  .component-dials,
  .phrase-anatomy,
  .qa-phrasing,
  .energy-movement-grid,
  .contour-shape-grid,
  .repeat-contour,
  .melody-motion-aside p {
    grid-template-columns: 1fr;
  }

  .question-arrow,
  .phrase-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .palette-panel,
  .component-dial {
    min-height: 0;
  }

  .balance-labels {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .chapter-body .chapter-diagram,
  .chapter-body .pull-question,
  .chapter-body .chapter-ending {
    padding: var(--space-4);
  }

  .phrase-breath-mark span {
    width: 2px;
    height: 2.5rem;
    background: linear-gradient(180deg, transparent, var(--ink-faint), transparent);
  }

  .phrase-start-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .phrase-start-timeline {
    grid-template-columns: minmax(3.8rem, 0.8fr) repeat(4, minmax(2.4rem, 1fr));
    gap: var(--space-1);
  }

  .timing-cell {
    min-height: 3.35rem;
    font-size: var(--text-xs);
  }
}

/* ─── Prev/Next navigation ───────────────────────────────────── */
.prev-next {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--content-max);
  margin: var(--space-12) auto 0;
  padding-top: var(--space-8);
  border-top: 1px solid var(--paper-darker);
}

.prev-next-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-decoration: none;
  padding: var(--space-4) var(--space-5);
  border: 1.5px solid var(--paper-darker);
  border-radius: var(--radius);
  max-width: 48%;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  background: var(--paper);
}

.prev-next-link:hover {
  border-color: var(--amber);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.next-link { margin-left: auto; text-align: right; }

.pn-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  font-family: var(--font-body);
}

.pn-title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--ink);
  line-height: 1.4;
}

/* ─── Back to top ────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border: none;
  font-size: var(--text-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--amber);
}

/* ─── Lightbox ───────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(36, 31, 26, 0.92);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.lightbox[hidden] { display: none; }

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: zoomIn 0.2s var(--ease-out);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-size: var(--text-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

/* ─── Responsive: mobile ─────────────────────────────────────── */
@media (max-width: 900px) {
  .drawer-toggle { display: flex; }

  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open { display: block; }

  .content {
    margin-left: 0;
    padding: var(--space-12) var(--space-5) var(--space-12);
  }

  .chapter-header::before { left: 0; }

  .chapter-title { font-size: var(--text-2xl); }
}

@media (max-width: 600px) {
  :root { --space-8: 1.5rem; }

  .content { padding: var(--space-10) var(--space-4) var(--space-10); }
  .chapter-title { font-size: var(--text-xl); }
  .chapter-body { font-size: var(--text-base); }
  .prev-next { flex-direction: column; }
  .prev-next-link, .next-link { max-width: 100%; margin: 0; }
}

/* ─── Print stylesheet ───────────────────────────────────────── */
@media print {
  .sidebar, .drawer-toggle, .back-to-top, .lightbox, .sidebar-overlay { display: none !important; }
  .content { margin-left: 0; padding: 1cm 2cm; }
  .chapter-article { max-width: 100%; }
  .chapter-body img { box-shadow: none; cursor: default; page-break-inside: avoid; }
  .assignment-box { break-inside: avoid; }
  .prev-next { display: none; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 0.8em; color: #666; }
  a[href^="#"]::after, a[href^="../"]::after { content: ''; }
  body { font-size: 11pt; line-height: 1.5; color: black; background: white; }
  h1, h2, h3 { page-break-after: avoid; }
  .instrument-variant {
    break-inside: avoid;
    box-shadow: none;
    background: white;
  }
}

/* ─── Scale degree chips ─────────────────────────────────────── */
.deg-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.75em;
  color: white;
  vertical-align: middle;
}

.deg-1 { background: var(--deg-1); }
.deg-2 { background: var(--deg-2); }
.deg-3 { background: var(--deg-3); color: var(--ink); }
.deg-4 { background: var(--deg-4); }
.deg-5 { background: var(--deg-5); }
.deg-6 { background: var(--deg-6); }
.deg-7 { background: var(--deg-7); }

/* ─── Fretboard decorative divider ──────────────────────────── */
.fret-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-10) 0;
  position: relative;
}

.fret-divider::before,
.fret-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--paper-darker) 0px,
    var(--paper-darker) 1px,
    transparent 1px,
    transparent 24px
  );
}

/* ─── Missing image placeholder ─────────────────────────────── */
img[data-missing="true"] {
  min-height: 80px;
  background: var(--paper-dark);
  border: 1.5px dashed var(--paper-darker);
  display: block;
  position: relative;
}

img[data-missing="true"]::after {
  content: '⚠ image unavailable';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--ink-faint);
}
