:root {
  --bg: #1a120b;
  --panel: #2a1f14;
  --vellum: #f5e8c7;
  --ink: #3c2f1e;
  --gold: #c9a227;
  --accent: #8b5a2b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--vellum);
  line-height: 1.5;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 18, 11, 0.95);
  border-bottom: 1px solid var(--accent);
  padding: 1rem 1.5rem;
}
.site-header-inner { max-width: 1400px; margin: 0 auto; }
.site-header h1 { margin: 0; font-size: 1.5rem; color: var(--gold); }
.tagline { margin: 0.25rem 0 0; font-size: 0.9rem; opacity: 0.85; }
.site-nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem; }
.site-nav a {
  color: var(--vellum);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a.active { border-bottom-color: var(--gold); color: var(--gold); }
.layout { max-width: 1400px; margin: 0 auto; padding: 1.5rem; display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.sidebar {
  background: var(--panel);
  border-radius: 8px;
  padding: 1rem;
  max-height: 85vh;
  overflow-y: auto;
}
.sidebar label { display: block; font-size: 0.8rem; margin-bottom: 0.35rem; }
.sidebar input, .sidebar select {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  background: var(--bg);
  color: var(--vellum);
  border: 1px solid var(--accent);
  border-radius: 4px;
}
.page-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
.page-pill {
  padding: 0.35rem;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}
.page-pill:hover, .page-pill.active { background: var(--accent); color: var(--vellum); }
.page-pill.status-complete { background: #2d4a2d; border-color: #6b9e6b; color: #e8f5e8; }
.page-pill.status-partial { background: #4a3d1a; border-color: var(--gold); color: var(--vellum); }
.page-pill.status-blank { background: #1f1a16; border-color: #4a4035; color: #8a7f72; opacity: 0.85; }
.page-pill.status-complete.active, .page-pill.status-partial.active { background: var(--accent); color: var(--vellum); }
.page-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.65rem; margin-bottom: 0.5rem; opacity: 0.9; }
.legend-item { display: flex; align-items: center; gap: 0.25rem; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.swatch-complete { background: #6b9e6b; }
.swatch-partial { background: var(--gold); }
.swatch-blank { background: #4a4035; }
.main-panel { min-width: 0; }
.section-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); }
.section h2 { margin: 0.25rem 0 0.75rem; color: var(--vellum); }
.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.tab {
  padding: 0.5rem 1rem;
  background: var(--panel);
  border: 1px solid var(--accent);
  color: var(--vellum);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.tab.active { background: var(--accent); }
.tabpanel { display: none; background: var(--panel); border-radius: 8px; padding: 1.25rem; }
.tabpanel.active { display: block; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.card {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 1rem;
}
.card h4 { margin: 0 0 0.5rem; color: var(--gold); font-size: 0.95rem; }
.timeline { position: relative; padding-left: 1.5rem; border-left: 2px solid var(--accent); }
.timeline-item { margin-bottom: 1rem; position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.65rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
}
.timeline-year { font-weight: bold; color: var(--gold); }
.alphabet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 0.5rem; }
.letter-cell {
  text-align: center;
  padding: 0.75rem 0.25rem;
  background: var(--vellum);
  color: var(--ink);
  border-radius: 4px;
  font-size: 1.5rem;
  cursor: pointer;
}
.letter-cell small { display: block; font-size: 0.6rem; margin-top: 0.25rem; }
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--gold);
  color: var(--ink);
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  margin-top: 0.5rem;
}
.btn:hover { filter: brightness(1.1); }
.year-slider { width: 100%; margin: 1rem 0; }
.preview-img { max-width: 100%; border-radius: 6px; border: 1px solid var(--accent); }
.view-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.view-tab {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--accent);
  color: var(--vellum);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.view-tab:hover,
.view-tab.active {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.layer-viewer {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--accent);
  overflow: hidden;
  background: #0d0906;
}
.layer-viewer-body {
  position: relative;
  width: 100%;
}
.layer-viewer.view-raw-mix .layer-viewer-body,
.layer-viewer.view-text-mix .layer-viewer-body,
.layer-viewer.view-triple .layer-viewer-body {
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--panel);
}
.layer-viewer.view-raw-mix .layer-viewer-body { grid-template-columns: 1fr 1fr; }
.layer-viewer.view-text-mix .layer-viewer-body { grid-template-columns: 1fr 1fr; }
.layer-viewer.view-triple .layer-viewer-body { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 900px) {
  .layer-viewer.view-triple .layer-viewer-body { grid-template-columns: 1fr; }
  .layer-viewer.view-raw-mix .layer-viewer-body,
  .layer-viewer.view-text-mix .layer-viewer-body { grid-template-columns: 1fr; }
}
.view-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #0d0906;
  border: 1px solid var(--accent);
  border-radius: 4px;
  overflow: hidden;
}
.view-pane-label {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: var(--bg);
  border-bottom: 1px solid var(--accent);
}
.text-pane {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  background: rgba(245, 232, 199, 0.92);
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-wrap;
  font-family: "Times New Roman", Georgia, serif;
  min-height: 200px;
  max-height: 72vh;
}
.text-pane code,
.text-pane-empty {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-size: 0.68rem;
}
.text-pane-empty {
  opacity: 0.65;
  font-style: italic;
}
.layer-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  max-height: 72vh;
}
.view-pane .layer-stack {
  flex: 1;
  max-height: none;
}
.layer-stack img.layer-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.2s;
  pointer-events: none;
}
.highlight-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.layer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
  font-size: 0.8rem;
}
.layer-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
}
.layer-control input[type="range"] { width: 60px; }
.highlight-toggle { font-size: 0.85rem; display: block; margin-bottom: 0.35rem; }
.highlight-toggle input:disabled + span, .highlight-toggle small { opacity: 0.55; }
.viewer-options { margin: 0.5rem 0 0.75rem; }
.layer-mixer {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.75rem;
  margin: 0.75rem 0;
}
.preset-row, .quick-toggles, .download-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.preset-btn, .toggle-btn {
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--vellum);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.preset-btn:hover, .toggle-btn:hover, .preset-btn.active, .toggle-btn.active {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.mix-row { margin: 0.65rem 0; font-size: 0.8rem; }
.mix-row input[type="range"] { width: 100%; margin-top: 0.35rem; }
.text-overlay {
  position: absolute;
  inset: 8%;
  overflow-y: auto;
  padding: 0.75rem;
  background: rgba(245, 232, 199, 0.88);
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  font-family: "Times New Roman", Georgia, serif;
  pointer-events: none;
  border-radius: 4px;
  z-index: 2;
}
.download-panel { margin: 1rem 0; }
.download-panel .section-label { margin-top: 0.5rem; }
.btn-dl {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  font-size: 0.72rem;
  background: var(--bg);
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 4px;
  text-decoration: none;
}
.btn-dl:hover { background: var(--gold); color: var(--ink); }
.btn-dl.missing { opacity: 0.4; pointer-events: none; }
.glyph-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 0.35rem;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 1rem;
}
.glyph-thumb {
  background: var(--vellum);
  border-radius: 3px;
  padding: 2px;
  text-align: center;
  cursor: pointer;
}
.glyph-thumb img { width: 100%; height: 36px; object-fit: contain; display: block; }
.glyph-thumb small { font-size: 0.55rem; color: var(--ink); }
.animation-stage {
  margin: 1rem 0;
  padding: 2rem;
  background: var(--bg);
  border: 1px solid var(--gold);
  border-radius: 8px;
  text-align: center;
  min-height: 160px;
}
.animation-glyph {
  font-size: 4rem;
  color: var(--gold);
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: stroke-reveal 0.8s ease-out;
}
.animation-glyph img { max-height: 80px; max-width: 80px; }
.animation-glyph.writing { animation: stroke-pulse 0.6s ease-in-out; }
@keyframes stroke-reveal {
  from { opacity: 0; transform: scale(0.85) translateY(8px); filter: blur(2px); }
  to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}
@keyframes stroke-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; transform: scale(1.05); }
}
.animation-caption { font-size: 0.85rem; opacity: 0.85; margin-top: 0.5rem; }
.page-pill.has-events { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.event-chip {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  margin: 0.15rem;
  background: var(--accent);
  border-radius: 3px;
}
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { border: 1px solid var(--accent); padding: 0.4rem 0.6rem; text-align: left; }
th { background: var(--bg); color: var(--gold); }
.empty { opacity: 0.7; font-style: italic; }
.music-modes-panel {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
}
.music-modes-intro { font-size: 0.85rem; opacity: 0.9; margin-bottom: 0.75rem; }
.music-mode-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.music-mode-btn {
  background: var(--panel);
  color: var(--vellum);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.music-mode-btn:hover, .music-mode-btn.active {
  background: var(--gold);
  color: var(--bg);
}
.music-mode-note { font-size: 0.82rem; opacity: 0.9; min-height: 2.5rem; }
.runic-density { font-size: 0.9rem; padding: 0.5rem; background: var(--bg); border-radius: 4px; margin: 0.75rem 0; }
.runic-artifact-list { font-size: 0.88rem; line-height: 1.5; }
.runic-artifact-list li { margin-bottom: 0.75rem; }
.runic-panel {
  margin-top: 1rem; padding: 1rem; background: var(--panel);
  border: 1px solid var(--accent); border-radius: 8px; font-size: 0.88rem;
}
.runic-panel h3 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--gold); }

/* Book viewer & showcase pages */
.showcase-main { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.book-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; padding: 0.75rem; background: var(--panel); border-radius: 8px;
}
.book-toolbar button, .layer-chip {
  background: var(--bg); color: var(--vellum); border: 1px solid var(--accent);
  border-radius: 4px; padding: 0.4rem 0.75rem; cursor: pointer; font-size: 0.85rem;
}
.book-toolbar button:hover:not(:disabled), .layer-chip:hover, .layer-chip.active {
  background: var(--gold); color: var(--bg); border-color: var(--gold);
}
.book-toolbar button:disabled { opacity: 0.4; cursor: not-allowed; }
.book-spread {
  background: var(--panel); border-radius: 8px; padding: 1rem;
  display: flex; justify-content: center; min-height: 60vh;
}
.book-spread img {
  max-height: 75vh; max-width: 100%; object-fit: contain;
  border: 1px solid var(--accent); border-radius: 4px; background: #0d0a07;
}
.book-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; font-size: 0.9rem; }
.status-badge { padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.75rem; }
.status-complete { background: #2d4a2d; }
.status-partial { background: #4a3d1a; }
.status-blank { background: #1f1a16; }
.variation-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem;
}
.variation-card {
  background: var(--panel); border: 1px solid var(--accent); border-radius: 8px;
  overflow: hidden;
}
.variation-card img { width: 100%; display: block; cursor: zoom-in; }
.variation-card figcaption { padding: 0.6rem 0.75rem; font-size: 0.85rem; }
.readalong-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .readalong-grid { grid-template-columns: 1fr; } }
.readalong-col {
  background: var(--panel); border-radius: 8px; padding: 1rem; border: 1px solid var(--accent);
}
.readalong-line {
  padding: 0.5rem 0.4rem; border-radius: 4px; cursor: pointer; transition: background 0.2s;
}
.readalong-line:hover, .readalong-line.active { background: var(--accent); }
.readalong-line small { display: block; opacity: 0.85; margin-top: 0.2rem; }
.variation-strip { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.variation-strip img { height: 100px; border: 1px solid var(--accent); border-radius: 4px; cursor: pointer; }
.btn { display: inline-block; padding: 0.45rem 0.9rem; background: var(--accent); color: var(--vellum); border-radius: 4px; text-decoration: none; font-size: 0.85rem; border: none; cursor: pointer; }
.btn:hover { background: var(--gold); color: var(--bg); }

/* Catalog & Collation tab */
.catalog-section {
  margin: 1.25rem 0 2rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 8px;
}
.catalog-section h3 { margin: 0 0 0.75rem; color: var(--gold); font-size: 1rem; }
.catalog-intro { font-size: 0.85rem; opacity: 0.9; margin-bottom: 1rem; }
.completion-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.completion-card {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
}
.completion-card .label { color: var(--gold); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.completion-bar {
  height: 6px;
  background: #1f1a16;
  border-radius: 3px;
  margin: 0.4rem 0 0.25rem;
  overflow: hidden;
}
.completion-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 3px;
}
.completion-card.warn .completion-bar span { background: linear-gradient(90deg, #8b3a2b, #c96040); }
.completion-pct { font-size: 1.1rem; font-weight: bold; }
.folio-placement { margin-bottom: 1rem; }
.folio-diagram {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: stretch;
  min-height: 120px;
  border: 2px solid var(--gold);
  border-radius: 6px;
  overflow: hidden;
  background: var(--vellum);
  color: var(--ink);
}
.folio-edge {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  font-size: 0.65rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem;
}
.folio-edge.spine { background: #3c2f1e; color: var(--vellum); }
.folio-edge.fore { background: #8b5a2b; color: var(--vellum); }
.folio-edge.active { box-shadow: inset 0 0 0 3px var(--gold); }
.folio-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
}
.folio-face .siglum { font-size: 1.4rem; font-weight: bold; color: var(--ink); }
.folio-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.8rem; }
.folio-meta span {
  padding: 0.2rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
}
.quire-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.quire-cell {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 3px;
  cursor: default;
}
.quire-cell.current { background: var(--gold); color: var(--bg); font-weight: bold; }
.quire-cell.empty { opacity: 0.35; }
.expansion-chart {
  position: relative;
  height: 140px;
  margin: 1rem 0 1.5rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  overflow: hidden;
}
.expansion-axis {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  height: 2px;
  background: var(--accent);
}
.expansion-tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 0.65rem;
  text-align: center;
  white-space: nowrap;
}
.expansion-tick::before {
  content: "";
  display: block;
  width: 2px;
  height: 12px;
  background: var(--gold);
  margin: 0 auto 4px;
}
.expansion-event {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.62rem;
  max-width: 90px;
  text-align: center;
  line-height: 1.2;
  padding: 0.2rem 0.3rem;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 4px;
}
.expansion-event::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 2px;
  height: 8px;
  background: var(--gold);
  transform: translateX(-50%);
}
.expansion-era {
  position: absolute;
  top: 0;
  height: 18px;
  font-size: 0.6rem;
  opacity: 0.75;
  display: flex;
  align-items: center;
  padding-left: 0.35rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.3);
}
.phase-card {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: var(--bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 4px 4px 0;
  font-size: 0.85rem;
}
.phase-card.planned { border-left-color: var(--accent); opacity: 0.9; }
.phase-card.research { border-left-color: #5a6a8b; opacity: 0.85; }
.phase-status {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.35rem;
  background: var(--accent);
  border-radius: 3px;
  margin-left: 0.5rem;
}
.tei-block { font-size: 0.85rem; line-height: 1.55; }
.tei-block dt { color: var(--gold); font-size: 0.72rem; text-transform: uppercase; margin-top: 0.6rem; }
.tei-block dd { margin: 0.15rem 0 0 0; }

/* Scribe backstory */
.scribe-backstory {
  margin: 0 0 1.25rem;
  padding: 1rem;
  background: var(--bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
}
.scribe-backstory h4 { margin: 0 0 0.5rem; color: var(--gold); }
.timeline-item.milestone { border-left-color: var(--gold); }

/* Page music chart — above layer viewer */
.page-music-chart {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 8px;
}
.page-music-chart .page-music-title {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.15rem;
  color: var(--gold);
}
.page-music-chart .music-modes-intro {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 0.75rem;
}

/* Chant notation */
.chant-staff-panel {
  margin: 1rem 0;
  padding: 1rem;
  background: #f5e8c7;
  border-radius: 6px;
  color: var(--ink);
}
.chant-svg { width: 100%; max-width: 560px; display: block; margin: 0 auto; }
.chant-mode-note { font-size: 0.78rem; margin: 0.5rem 0 0; color: var(--ink); opacity: 0.85; }
.chant-lyrics-panel { margin-top: 1rem; }
.chant-lyrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-size: 0.88rem;
}
@media (max-width: 700px) { .chant-lyrics-grid { grid-template-columns: 1fr; } }
.chant-lyrics-grid h4 { margin: 0 0 0.5rem; color: var(--gold); font-size: 0.9rem; }

/* Restoration compare */
.restoration-compare {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.restore-panel {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  overflow: hidden;
}
.restore-panel figcaption {
  font-size: 0.68rem;
  padding: 0.35rem 0.5rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.restore-panel img {
  width: 100%;
  display: block;
  min-height: 100px;
  object-fit: cover;
  background: #0d0a07;
}
.restore-panel img.missing-img { opacity: 0.35; }