/* ============================================================
   SBS Pāli-Español Recitations — Stylesheet
   Replicates the look & feel of the original SBS Pāli-English
   Recitations book (2025 edition).
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Gentium+Plus:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --color-maroon: #5B2333;
  --color-maroon-light: #7A3A4D;
  --color-text: #2C2C2C;
  --color-text-light: #555;
  --color-bg: #FDFAF5;
  --color-bg-alt: #F7F2EA;
  --color-rule: #C4A882;
  --color-rule-light: #D9CCBA;
  --color-accent: #8B6914;

  --font-body: 'Gentium Plus', 'Georgia', serif;
  --font-heading: 'Cormorant Garamond', 'Georgia', serif;

  --page-max-width: 680px;
  --page-padding: 2.5rem;
}

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

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.65;
}

/* ---------- Page Container ---------- */
.page {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--page-padding) var(--page-padding) 3rem;
  min-height: 100vh;
  position: relative;
}

/* ---------- Running Header ---------- */
.running-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
  padding-bottom: 0.4rem;
  border-bottom: 0.5px solid var(--color-rule);
  margin-bottom: 2rem;
}

.running-header .section-name {
  letter-spacing: 0.15em;
}

.running-header .page-number {
  font-variant-numeric: oldstyle-nums;
}

/* ---------- Chapter Divider ---------- */
.chapter-divider {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  text-align: center;
}

.chapter-divider h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--color-maroon);
  letter-spacing: 0.05em;
  margin-bottom: 0;
}

/* ---------- Sutta Title Block ---------- */
.sutta-title {
  text-align: center;
  margin-bottom: 1.8rem;
}

.sutta-title h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-maroon);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.sutta-title .pali-name {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-light);
  letter-spacing: 0.02em;
}

/* ---------- Chanting Leader Instruction ---------- */
.leader-instruction {
  text-align: center;
  font-size: 0.88rem;
  color: var(--color-text-light);
  margin-bottom: 1.8rem;
  font-style: normal;
}

.leader-instruction::before {
  content: '〈';
}

.leader-instruction::after {
  content: '〉';
}

/* ---------- Sutta Content ---------- */
.sutta-content {
  margin-bottom: 2rem;
}

/* Pali line — roman upright */
.pali {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.15rem;
  color: var(--color-text);
}

/* Translation line — italic, indented */
.translation {
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
  margin-left: 1.6rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

/* Spanish translation (new for this edition) */
.translation-es {
  font-style: normal;
  font-size: 0.95rem;
  line-height: 1.55;
  margin-left: 1.6rem;
  margin-bottom: 1rem;
  color: var(--color-maroon);
  border-left: 2px solid var(--color-rule-light);
  padding-left: 0.8rem;
}

/* ---------- Reference ---------- */
.reference {
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}

.reference a {
  color: var(--color-maroon);
  text-decoration: none;
  border-bottom: 0.5px solid var(--color-rule-light);
  transition: border-color 0.2s;
}

.reference a:hover {
  border-bottom-color: var(--color-maroon);
}

/* ---------- Source Tag (for audit trail) ---------- */
.source-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-family: system-ui, sans-serif;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.source-tag.priority-1 {
  background-color: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
}

.source-tag.priority-2 {
  background-color: #E3F2FD;
  color: #1565C0;
  border: 1px solid #90CAF9;
}

.source-tag.priority-3 {
  background-color: #FFF3E0;
  color: #E65100;
  border: 1px solid #FFCC80;
}

.source-tag.priority-4 {
  background-color: #FCE4EC;
  color: #C62828;
  border: 1px solid #EF9A9A;
}

.source-tag a {
  color: inherit;
  text-decoration: none;
}
.source-tag a:hover {
  text-decoration: underline;
}

/* ---------- Body Parts Table (Section 7) ---------- */
.body-parts-table {
  padding-left: 0;
}

.body-parts {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
}

.body-parts td {
  padding: 0.15rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  vertical-align: top;
}

.body-parts .pali-cell {
  text-align: right;
  font-style: italic;
  color: var(--color-maroon);
  width: 35%;
}

.body-parts .en-cell {
  text-align: left;
  color: var(--color-text-light);
  font-style: italic;
  width: 30%;
}

.body-parts .es-cell {
  text-align: left;
  color: var(--color-text);
  width: 35%;
}

/* ---------- Review Badge ---------- */
.needs-review {
  position: relative;
}

.needs-review::after {
  content: '⟡ Revisión pendiente';
  display: block;
  font-size: 0.7rem;
  font-family: system-ui, sans-serif;
  color: #C62828;
  background: #FCE4EC;
  border: 1px solid #EF9A9A;
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  margin-top: 0.3rem;
  width: fit-content;
  margin-left: 1.6rem;
}

/* ---------- Footer Navigation ---------- */
.page-footer {
  position: absolute;
  bottom: 1.5rem;
  left: var(--page-padding);
  right: var(--page-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-top: 3px solid var(--color-rule);
  padding-top: 0.5rem;
}

.page-footer a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s;
}

.page-footer a:hover {
  color: var(--color-maroon);
}

/* ---------- Table of Contents ---------- */
.toc {
  margin: 2rem 0;
}

.toc h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-maroon);
  text-align: center;
  margin-bottom: 2rem;
}

.toc-section {
  margin-bottom: 1.5rem;
}

.toc-section h2 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.toc-entry {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.15rem 0;
  font-size: 0.92rem;
}

.toc-entry .title {
  font-style: italic;
  color: var(--color-text);
}

.toc-entry .title a {
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.2s;
}

.toc-entry .title a:hover {
  border-bottom-color: var(--color-maroon);
  color: var(--color-maroon);
}

.toc-entry .dots {
  flex: 1;
  border-bottom: 1px dotted var(--color-rule-light);
  margin: 0 0.5rem;
  min-width: 2rem;
}

.toc-entry .page-ref {
  font-variant-numeric: oldstyle-nums;
  color: var(--color-text-light);
  min-width: 1.5rem;
  text-align: right;
}

/* ---------- Cover Page ---------- */
.cover {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 90vh;
  text-align: center;
  padding: 3rem 2rem;
}

.cover .institution {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 2rem;
}

.cover h1 {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--color-maroon);
  letter-spacing: 0.06em;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.cover .subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: italic;
  color: var(--color-text-light);
  margin-bottom: 3rem;
}

.cover .edition-info {
  font-size: 0.82rem;
  color: var(--color-text-light);
  line-height: 1.7;
}

/* ---------- Quoted Verse Block ---------- */
.verse-block {
  margin: 1.5rem 0;
  padding-left: 1.2rem;
}

.verse-block .pali {
  margin-bottom: 0.08rem;
}

.verse-block .translation {
  margin-bottom: 0.7rem;
}

/* ---------- Section Separator ---------- */
.section-sep {
  text-align: center;
  margin: 2rem 0;
  color: var(--color-rule);
  font-size: 1.2rem;
  letter-spacing: 0.5em;
}

/* ---------- Endnote Superscript ---------- */
sup.endnote {
  font-size: 0.7em;
  color: var(--color-maroon-light);
  cursor: help;
}

/* ---------- Section Cover (Watercolor Art) ---------- */
.section-cover {
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  position: relative;
  background-color: #3C2819;
  background-size: cover;
  background-position: center bottom;
  overflow: hidden;
}

.section-cover .section-cover-title {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: #F5F0E8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.6rem 1.2rem;
  background-color: rgba(60, 40, 25, 1);
  margin: 0;
  padding: 1.5rem 1.6rem 1.2rem;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.3;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.section-cover .section-cover-subtitle {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #F5F0E8;
  position: absolute;
  bottom: 1.5rem;
  right: 2rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

/* Decorative border frame (like the original book's thin gold frame) */
.section-cover::before {
  content: '';
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.6rem;
  border: 1px solid rgba(180, 160, 120, 0.5);
  pointer-events: none;
  z-index: 1;
}

/* ---------- Title Page (p2 — SBS logo + epigraph) ---------- */
.title-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 90vh;
  text-align: center;
  padding: 4rem 2rem;
}

.title-page .sbs-logo {
  font-family: 'Georgia', serif;
  font-size: 4rem;
  font-style: italic;
  font-weight: 700;
  color: var(--color-maroon);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.title-page .sbs-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.title-page .ornament {
  color: var(--color-rule);
  font-size: 1.2rem;
  margin-bottom: 2rem;
  letter-spacing: 0.3em;
}

.title-page .book-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 2.5rem;
}

.title-page .epigraph {
  max-width: 480px;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.title-page .epigraph-ref {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* ---------- Acknowledgements Page ---------- */
.acknowledgements {
  padding-top: 3rem;
}

.acknowledgements h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.acknowledgements p {
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  text-align: justify;
}

.acknowledgements .dedication {
  text-align: center;
  font-style: italic;
  margin-top: 2rem;
  color: var(--color-text-light);
}

/* ---------- Recitation Schedule ---------- */
.schedule {
  padding-top: 1rem;
}

.schedule h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-maroon);
  text-align: center;
  margin-bottom: 2rem;
}

.schedule-set {
  margin-bottom: 2rem;
  text-align: center;
}

.schedule-set h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 0.8rem;
}

.schedule-set ul {
  list-style: none;
  padding: 0;
}

.schedule-set li {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.9;
  color: var(--color-text);
}

.schedule-set li a {
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 0.5px solid transparent;
  transition: all 0.2s;
}

.schedule-set li a:hover {
  color: var(--color-maroon);
  border-bottom-color: var(--color-maroon);
}

/* ---------- Prefatory / Prose Page ---------- */
.prose-page {
  padding-top: 0;
}

.prose-page .prose-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 1.5rem;
}

.prose-page .prose-subtitle {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 0.8rem;
  margin-top: 1.5rem;
}

.prose-page p {
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 0.8rem;
  text-align: justify;
  text-indent: 1.2rem;
}

.prose-page p:first-of-type,
.prose-page .prose-subtitle + p {
  text-indent: 0;
}

.prose-page blockquote {
  margin: 1rem 1.5rem;
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--color-text);
}

/* ---------- Ornamental Title Divider ---------- */
.ornament-divider {
  text-align: center;
  margin: 0.8rem 0 1.2rem;
  color: var(--color-rule);
  font-size: 0.9rem;
}

.ornament-divider::before {
  content: '—◇◆◇—';
  letter-spacing: 0.15em;
}

/* ---------- Repetition Marker ---------- */
.repeat-marker {
  font-size: 0.85rem;
  color: var(--color-text-light);
  text-align: right;
  margin-left: 0.5rem;
}

/* ---------- Copyright/Colophon Page ---------- */
.colophon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60vh;
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--color-text-light);
  text-align: center;
}

.colophon p {
  margin-bottom: 0.8rem;
}

.colophon .license {
  font-size: 0.78rem;
  margin-top: 1.5rem;
  font-style: italic;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  :root {
    --page-padding: 1.5rem;
  }

  html {
    font-size: 16px;
  }

  .cover h1 {
    font-size: 1.8rem;
  }

  .sutta-title h2 {
    font-size: 1.15rem;
  }
}

/* ---------- Navigation + Language Toggle Bar ---------- */
.lang-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.6rem;
  background: rgba(91, 35, 51, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

/* -- Nav group (left) -- */
.lang-bar__nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

/* -- Shared button style -- */
.lang-bar__btn {
  background: none;
  border: none;
  color: #F5F0E8;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.1rem 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: opacity 0.2s;
}

.lang-bar__btn:hover {
  opacity: 0.7;
}

.lang-bar__btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* -- Section name (center) -- */
.lang-bar__section-name {
  color: #F5F0E8;
  font-size: 0.72rem;
  max-width: 40vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.3s;
}

.lang-bar__section-name.visible {
  opacity: 0.85;
}

/* -- Toggles group (right) -- */
.lang-bar__toggles {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.lang-bar label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #F5F0E8;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}

.lang-bar label:hover {
  opacity: 0.85;
}

.lang-bar input[type="checkbox"] {
  accent-color: var(--color-rule);
  width: 13px;
  height: 13px;
  cursor: pointer;
}

/* Offset body so content isn't hidden behind the fixed bar */
body.has-lang-bar {
  padding-top: 1.8rem;
}

/* Hide languages when unchecked */
body.hide-pali .pali { display: none; }
body.hide-en .translation { display: none; }
body.hide-es .translation-es { display: none; }

/* Hide section name on mobile */
@media (max-width: 720px) {
  .lang-bar__section-name {
    display: none;
  }
  .lang-bar__toggles {
    gap: 0.5rem;
  }
}

/* ---------- DPD Overlay ---------- */
span.lookup { position: relative; cursor: pointer; border-radius: 2px; transition: background 120ms; }
span.lookup:hover { background: rgba(139, 105, 20, 0.15); }
span.lookup.active { background: rgba(139, 105, 20, 0.22); }

/* Desktop tooltip (hover) */
span.lookup .dpd-tooltip {
  position: absolute; bottom: 2em; left: 0; z-index: 300;
  background: #FFF8E7; border: 1.5px solid var(--color-accent, #8B6914);
  border-radius: 6px; padding: 0.5rem 0.7rem;
  font-size: 0.86rem; line-height: 1.4;
  min-width: 240px; max-width: 440px; width: max-content;
  box-shadow: 0 4px 14px rgba(0,0,0,0.13);
  visibility: hidden; opacity: 0;
  transition: opacity 100ms, visibility 100ms;
  pointer-events: none; font-style: normal; color: var(--color-text);
}
span.lookup:hover .dpd-tooltip { visibility: visible; opacity: 1; pointer-events: auto; }

/* Shared tooltip typography */
.dpd-tooltip .tt-word, .dpd-drawer .tt-word {
  font-weight: 700; font-size: 0.95rem; color: var(--color-maroon);
  border-bottom: 1px solid var(--color-rule); padding-bottom: 0.15rem; margin-bottom: 0.25rem;
}
.dpd-tooltip .tt-entry, .dpd-drawer .tt-entry { margin-bottom: 0.2rem; }
.dpd-tooltip .tt-entry:last-child, .dpd-drawer .tt-entry:last-child { margin-bottom: 0; }
.dpd-tooltip b, .dpd-drawer b { color: var(--color-maroon); }
.dpd-tooltip .tt-deconstruction, .dpd-drawer .tt-deconstruction {
  font-size: 0.78rem; color: var(--color-accent, #8B6914); margin-top: 0.2rem;
  padding-top: 0.2rem; border-top: 1px dashed rgba(0,0,0,0.1);
}
.dpd-tooltip .tt-not-found, .dpd-drawer .tt-not-found { color: var(--color-text-light); font-style: italic; font-size: 0.82rem; }
.dpd-tooltip .tt-source, .dpd-drawer .tt-source { font-size: 0.68rem; color: #999; margin-top: 0.25rem; text-align: right; }

/* Language badges */
.tt-lang {
  display: inline-block; font-size: 0.6rem; font-weight: 700; padding: 0 3px;
  border-radius: 2px; vertical-align: middle; margin-right: 3px; letter-spacing: 0.5px;
}
.tt-lang-es { background: #E8D5B7; color: #5B2333; }
.tt-lang-en { background: #D4E4F7; color: #2A4A6B; }

/* Bottom drawer (both desktop click + mobile tap) */
.dpd-drawer-wrap {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 400;
  display: flex; align-items: stretch;
  transform: translateY(100%); transition: transform 200ms ease-out;
  pointer-events: none;
}
.dpd-drawer-wrap.open { transform: translateY(0); pointer-events: auto; }

.dpd-drawer {
  flex: 1; min-width: 0;
  background: #FFF8E7; border-top: 2px solid var(--color-accent, #8B6914);
  padding: 0.6rem 1rem 1rem; max-height: 45vh; overflow-y: auto;
  font-size: 0.9rem; line-height: 1.45; color: var(--color-text);
}
.dpd-drawer .dpd-drawer__header {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--color-rule); padding-bottom: 0.3rem; margin-bottom: 0.3rem;
}
.dpd-drawer .dpd-drawer__header .tt-word {
  flex: 1; font-size: 1.1rem; font-weight: 700; color: var(--color-maroon);
  border-bottom: none; padding-bottom: 0; margin-bottom: 0;
}
.dpd-drawer .dpd-drawer__close {
  background: none; border: none; font-size: 1.3rem; color: var(--color-text-light);
  cursor: pointer; padding: 0 0.2rem; line-height: 1; flex-shrink: 0;
}
.dpd-drawer .dpd-drawer__handle {
  display: block; width: 36px; height: 4px; background: #ccc; border-radius: 2px;
  margin: 0 auto 0.4rem;
}

/* Side navigation arrows — same bg as drawer, no overflow */
.dpd-nav-btn {
  flex-shrink: 0; width: 2.4rem;
  background: #FFF8E7; border: none; border-top: 2px solid var(--color-accent, #8B6914);
  color: var(--color-rule); font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 100ms, background 100ms;
}
.dpd-nav-btn:hover { color: var(--color-maroon); }
.dpd-nav-btn:active { background: #F5EDD8; color: var(--color-maroon); }
.dpd-nav-btn--prev { border-radius: 12px 0 0 0; }
.dpd-nav-btn--next { border-radius: 0 12px 0 0; }
.dpd-drawer-wrap { box-shadow: 0 -4px 20px rgba(0,0,0,0.18); border-radius: 12px 12px 0 0; }

/* Hide hover tooltips when drawer is open */
body.dpd-study-mode span.lookup .dpd-tooltip { display: none !important; }

/* Scrim behind drawer */
.dpd-scrim {
  position: fixed; inset: 0; z-index: 399; background: rgba(0,0,0,0.25);
  opacity: 0; visibility: hidden; transition: opacity 200ms, visibility 200ms;
}
.dpd-scrim.open { opacity: 1; visibility: visible; }

/* On touch/mobile: hide hover tooltips, show drawer instead */
@media (hover: none) and (pointer: coarse) {
  span.lookup .dpd-tooltip { display: none !important; }
  span.lookup:hover .dpd-tooltip { display: none !important; }
}

/* Hide DPD overlay in print */
@media print {
  span.lookup .dpd-tooltip, .dpd-drawer, .dpd-scrim { display: none !important; }
}

/* ---------- Print Styles ---------- */
@media print {
  body {
    background: white;
  }

  .page {
    min-height: auto;
    padding: 0;
    page-break-after: always;
  }

  .page-footer {
    position: fixed;
    bottom: 0;
  }

  .lang-bar,
  .source-tag,
  .needs-review::after {
    display: none;
  }

  body.has-lang-bar {
    padding-top: 0;
  }
}
