/* Khilte Zakhm — "The Open Divan". Styles.
   Wide screens (≥1024px): the book lies open as a two-page spread on a table.
   Phones and tablets: a single page, with a thumb-reachable version bar.
   See docs/ux-concept.md. */

/* ---------- Tokens ---------- */
:root {
  --scale: 1;
  --table: #e6dbc5;
  --page: #f8f1e3;
  --page-2: #f1e7d4;
  --ink: #221912;
  --ink-soft: #46372a;
  --ink-quiet: #5f4e3e;
  --accent: #7d1f1a;          /* oxblood: the wound, the rose, the rubric */
  --accent-deep: #4f100d;
  --accent-ink: #fbf5ea;
  --hl: rgba(125, 31, 26, .065);
  --rule: #b6a185;
  --rule-soft: #ddd0b7;
  --focus: #1f4e8c;
  --mark: #f0d9a8;
  --spine: rgba(84, 56, 26, .16);
  --lift: 0 0 0 1px rgba(120, 90, 50, .14), 0 2px 0 -1px var(--page-2), 0 3px 0 -1px rgba(120, 90, 50, .2), 0 5px 0 -2px var(--page-2), 0 6px 0 -2px rgba(120, 90, 50, .18), 0 30px 60px -30px rgba(60, 38, 16, .45);

  --latin: "EB Garamond", "Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Tiro Devanagari Hindi", "Noto Serif Devanagari", serif;
  --deva: "Tiro Devanagari Hindi", "Noto Serif Devanagari", "Kohinoor Devanagari", "Devanagari MT", "Mangal", serif;
  --measure: 40rem;
  --settle: cubic-bezier(.16, .84, .28, 1);
  --masthead-h: 4rem;

  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --table: #0e0b09; --page: #1b1612; --page-2: #15110e;
    --ink: #efe5d2; --ink-soft: #d9cbb3; --ink-quiet: #bba98f;
    --accent: #e8907a; --accent-deep: #f2b4a2; --accent-ink: #1a0f0b;
    --hl: rgba(232, 144, 122, .085);
    --rule: #6d5c47; --rule-soft: #3a3027;
    --focus: #9cc3ff; --mark: #5a4320;
    --spine: rgba(0, 0, 0, .55);
    --lift: 0 0 0 1px rgba(255, 235, 200, .06), 0 30px 60px -30px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --table: #0e0b09; --page: #1b1612; --page-2: #15110e;
  --ink: #efe5d2; --ink-soft: #d9cbb3; --ink-quiet: #bba98f;
  --accent: #e8907a; --accent-deep: #f2b4a2; --accent-ink: #1a0f0b;
  --hl: rgba(232, 144, 122, .085);
  --rule: #6d5c47; --rule-soft: #3a3027;
  --focus: #9cc3ff; --mark: #5a4320;
  --spine: rgba(0, 0, 0, .55);
  --lift: 0 0 0 1px rgba(255, 235, 200, .06), 0 30px 60px -30px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: calc(100% * var(--scale));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--latin);
  font-size: 1.375rem;          /* 22px at default */
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
/* spread */
  .wide body {
    background-color: var(--table);
    background-image: radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in srgb, var(--page) 45%, transparent), transparent 70%);
    background-attachment: fixed;
  }


[lang="hi"], .deva { font-family: var(--deva); font-variant-numeric: normal; }
[lang="en"], [lang="hi-Latn"] { font-family: var(--latin); }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.eye { fill: var(--page); }

a { color: var(--accent); text-decoration-thickness: .06em; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .1em; }
::selection { background: var(--mark); color: var(--ink); }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
main:focus-visible, section:focus-visible, h1:focus-visible, h2:focus-visible, .gloss-pop:focus-visible { outline: none; }

.skip-link {
  position: absolute; left: 1rem; top: -10rem; z-index: 100;
  padding: .7rem 1.1rem; background: var(--ink); color: var(--page);
  border-radius: 6px; font-size: 1.1rem; text-decoration: none;
}
.skip-link:focus { top: 1rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.orn { color: var(--accent); display: block; margin-inline: auto; }
.orn-rule { width: 10rem; height: 1.25rem; }

/* ---------- Masthead ---------- */
.masthead {
  font-size: calc(13px + 5px * var(--scale));     /* damped so the bar never overflows */
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--page) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule-soft);
  padding-top: env(safe-area-inset-top);
}
/* spread */
  .wide .masthead { background: color-mix(in srgb, var(--table) 86%, transparent); border-bottom-color: transparent; }

.masthead-inner {
  max-width: 88rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: .75em;
  padding: .45em max(clamp(.75em, 3vw, 2.25em), env(safe-area-inset-right)) .45em max(clamp(.75em, 3vw, 2.25em), env(safe-area-inset-left));
}
.wordmark {
  display: flex; align-items: center; gap: .55em;
  color: var(--ink); text-decoration: none; min-height: 44px; padding-block: .3em;
}
.wordmark-bloom { width: 1.15em; height: 1.15em; color: var(--accent); flex: none; }
.wordmark-roman { white-space: nowrap; font-size: 1.25em; font-weight: 500; letter-spacing: .02em; }
.wordmark-script { font-size: 1.05em; color: var(--accent); }
.wordmark:hover .wordmark-roman { color: var(--accent); }
.controls { display: flex; align-items: center; gap: .4em; }
.ctl-group { display: flex; }
.ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-width: 46px; min-height: 46px; padding: 0 .85em;
  font: inherit; font-size: 1.05em; line-height: 1;
  color: var(--ink); background: transparent;
  border: 1px solid var(--rule); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.ctl:hover { background: var(--hl); border-color: var(--accent); color: var(--accent); }
.ctl svg { width: 1.2em; height: 1.2em; flex: none; }
.ctl-group .ctl { border-radius: 0; padding: 0 .75em; font-weight: 500; }
.ctl-group .ctl:first-child { border-radius: 999px 0 0 999px; }
.ctl-group .ctl:last-child { border-radius: 0 999px 999px 0; margin-left: -1px; font-size: 1.25em; }
.ctl-size:disabled { opacity: .45; cursor: default; }
.ctl-size:disabled:hover { background: transparent; border-color: var(--rule); color: var(--ink); }
.ctl-theme .when-dark { display: none; }
.ctl-theme[data-dark="true"] .when-dark { display: block; }
.ctl-theme[data-dark="true"] .when-light { display: none; }
body[data-view="contents"] .ctl-contents { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

@media (max-width: 760px) {
  .wordmark-script { display: none; }
  .ctl-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ctl { padding: 0 .55em; }
}
@media (max-width: 420px) {
  .masthead { font-size: calc(14px + 2.5px * var(--scale)); }
  .masthead-inner { gap: .4rem; padding-inline: .6rem; }
  .wordmark { gap: .4em; }
  .wordmark-roman { font-size: 1.1em; }
  .controls { gap: .25em; }
  .ctl { min-width: 44px; padding: 0 .45em; }
  .ctl-group .ctl { padding: 0 .55em; }
}
@media (max-width: 350px) { .wordmark-roman { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: .5rem 1.5rem;
  font: inherit; font-size: 1.2rem; letter-spacing: .02em;
  color: var(--ink); background: transparent;
  border: 1px solid var(--ink-quiet); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.btn:hover { background: var(--hl); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); color: var(--accent-ink); }
.btn-quiet { border-color: transparent; color: var(--accent); text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .2em; }
.btn-quiet:hover { background: transparent; text-decoration-thickness: .1em; }
.btn-open::after { content: "→"; transition: transform .25s var(--settle); }
.btn-open:hover::after { transform: translateX(4px); }

/* ---------- The book: shared page surfaces ---------- */
.page { background: var(--page); }
/* spread */
  .wide .spread, .wide .poem-view .book, .wide .single-page, .wide .hashiya {
    position: relative;
    background: linear-gradient(90deg, var(--page-2), var(--page) 6%, var(--page) 94%, var(--page-2));
    box-shadow: var(--lift);
    border-radius: 3px;
  }
  .wide /* The spine of an open book */
  .spread::before, .wide .poem-view.is-facing .book::before, .wide .poem-view.is-blank .book::before, .wide .hashiya.is-spread::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 5rem; transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, var(--spine) 47%, color-mix(in srgb, var(--spine) 60%, transparent) 50%, var(--spine) 53%, transparent);
    pointer-events: none; z-index: 0; opacity: .75;
  }
  .wide .page { background: transparent; }


/* ---------- Cover ---------- */
.cover { padding: clamp(1.25rem, 4vw, 3.5rem) clamp(.75rem, 3vw, 2rem) clamp(2rem, 5vw, 4rem); }
.cover-board {
  position: relative;
  max-width: 38rem; margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.75rem) clamp(1.25rem, 5vw, 3.5rem) clamp(2rem, 5vw, 3rem);
  text-align: center;
  border: 1px solid var(--rule);
  outline: 1px solid var(--rule-soft);
  outline-offset: 7px;
}
/* spread */
  .wide .cover-board { background: var(--page); box-shadow: var(--lift); outline-offset: -14px; border: 0; outline: 1px solid var(--rule); max-width: 40rem; padding: 3.75rem 4rem 3.25rem; }
  .wide .cover-board::before { content: ""; position: absolute; inset: 20px; border: 1px solid var(--rule-soft); pointer-events: none; }

.cover-bloom { display: block; width: clamp(5.5rem, 16vw, 7.5rem); height: auto; aspect-ratio: 1; margin: 0 auto .5rem; overflow: visible; }
.cover-bloom .petal { fill: var(--accent); transform-box: view-box; transform-origin: 50% 50%; animation: petal-open 1.35s var(--settle) both; }
.cover-bloom .p1 { animation-delay: .55s; } .cover-bloom .p2 { animation-delay: .68s; } .cover-bloom .p3 { animation-delay: .81s; }
.cover-bloom .p4 { animation-delay: .94s; } .cover-bloom .p5 { animation-delay: 1.07s; }
.cover-bloom .vein { fill: none; stroke: var(--page); stroke-width: 1.3; stroke-linecap: round; opacity: .55; animation: vein-in .8s ease 1.6s both; }
.cover-bloom .wound { fill: var(--accent-deep); stroke: var(--page); stroke-width: 1.4; transform-box: view-box; transform-origin: 50% 50%; animation: wound-cut .6s var(--settle) .1s both; }
@keyframes petal-open { from { transform: scale(.12) rotate(-24deg); opacity: 0; } 40% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes vein-in { from { opacity: 0; } to { opacity: .55; } }
@keyframes wound-cut { from { transform: scaleY(0) scaleX(.4); } to { transform: none; } }

.book-title { margin: .6rem 0 .25rem; font-weight: 400; line-height: 1.05; }
.book-title-roman { display: block; font-size: clamp(2.8rem, 9vw, 4.6rem); letter-spacing: .01em; color: var(--ink); }
.book-title-script { display: block; margin-top: .55rem; font-size: clamp(2rem, 6vw, 2.9rem); color: var(--accent); line-height: 1.4; }
.book-subtitle { margin: .2rem 0 1.1rem; color: var(--ink-soft); font-size: 1.25rem; font-style: italic; letter-spacing: .02em; }
.book-author { margin: 1rem 0 0; font-size: clamp(1.7rem, 4.5vw, 2.1rem); letter-spacing: .05em; }
.book-takhallus { margin: .15rem 0 0; font-size: clamp(1.35rem, 3.6vw, 1.6rem); font-style: italic; color: var(--accent); }
.book-edition { max-width: 29rem; margin: 1.5rem auto 0; color: var(--ink-soft); font-size: 1.15rem; line-height: 1.55; font-style: italic; }
.book-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .6rem 1rem; margin: 1.9rem 0 0; }
.btn-open { min-height: 58px; padding-inline: 2rem; font-size: 1.3rem; }
.cover-resume { margin: 1.4rem 0 0; font-size: 1.1rem; color: var(--ink-soft); }
.cover-resume a { display: inline-block; padding: .55rem .2rem; }
.cover-board > :not(.cover-bloom) { animation: rise .9s var(--settle) both; }
.cover-board > .book-title { animation-delay: .25s; }
.cover-board > .book-subtitle, .cover-board > .orn-rule { animation-delay: .4s; }
.cover-board > .book-author, .cover-board > .book-takhallus { animation-delay: .55s; }
.cover-board > .book-edition, .cover-board > .book-actions, .cover-board > .cover-resume { animation-delay: .7s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Section heads ---------- */
.section-head { text-align: center; margin-bottom: 1.5rem; }
.section-kicker { margin: 0; color: var(--accent); font-size: 1.35rem; }
.section-head h1 { margin: .05rem 0 .35rem; font-size: clamp(2.1rem, 5vw, 2.8rem); font-weight: 400; letter-spacing: .03em; line-height: 1.15; }
.section-sub { margin: 0; color: var(--ink-soft); font-style: italic; font-size: 1.15rem; }

/* ---------- Contents spread ---------- */
.contents-spread { padding: 1.5rem clamp(1rem, 4vw, 2rem) 2rem; max-width: 46rem; margin: 0 auto; }
/* spread */
  .wide .contents-spread {
    display: grid; grid-template-columns: 1fr 1fr;
    max-width: min(94vw, 84rem); margin: 1.75rem auto 0; padding: 0;
  }
  .wide .contents-spread .page { position: relative; z-index: 1; padding: 3.25rem clamp(2rem, 4vw, 4.5rem) 3.5rem; }
  .wide .dibacha-inner {
    position: sticky; top: calc(var(--masthead-h) + 2rem);
    max-height: calc(100vh - var(--masthead-h) - 3rem); overflow: auto;
    scrollbar-width: none;
  }
  .wide .dibacha-inner::-webkit-scrollbar { display: none; }
  .wide .dibacha .section-head { text-align: left; }


.search { margin: 0 0 1.5rem; }
.search-label { display: block; font-size: 1.15rem; margin-bottom: .35rem; color: var(--ink-soft); }
.search-field { position: relative; display: flex; gap: .5rem; }
.search-icon { position: absolute; left: .9rem; top: 50%; width: 1.25rem; height: 1.25rem; transform: translateY(-50%); color: var(--ink-quiet); pointer-events: none; }
.search-field input {
  flex: 1; min-width: 0; min-height: 54px;
  padding: .55rem .9rem .55rem 2.7rem;
  font: inherit; font-size: 1.2rem; color: var(--ink);
  background: color-mix(in srgb, var(--page) 60%, white);
  border: 1px solid var(--rule); border-radius: 999px;
}
:root[data-theme="dark"] .search-field input { background: var(--page-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .search-field input { background: var(--page-2); } }
.search-field input::placeholder { color: var(--ink-quiet); opacity: 1; }
.search-field input:focus-visible { outline-offset: 1px; border-color: var(--focus); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-clear {
  min-height: 54px; min-width: 54px; padding: 0 1.1rem; font: inherit; font-size: 1.05rem;
  color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: 999px; cursor: pointer;
}
.search-clear:hover { border-color: var(--accent); color: var(--accent); }
.search-hint { margin: .45rem 0 0 .2rem; font-size: 1rem; color: var(--ink-quiet); font-style: italic; }
.search-status { margin: .5rem 0 0 .2rem; font-size: 1.05rem; color: var(--ink-soft); min-height: 1.4em; }

/* The foretaste: opening lines of the poem pointed at, on the facing page */
.foretaste { display: none; }
/* spread */
  .wide .foretaste {
    display: block; margin: 2.25rem 0 0; padding: 1.75rem 0 0;
    border-top: 1px solid var(--rule-soft); position: relative;
  }
  .wide .foretaste::before {
    content: "“"; position: absolute; right: 0; top: .6rem; font-size: 4.5rem; line-height: 1; color: var(--accent); opacity: .18; font-family: var(--latin);
  }

.foretaste.is-fresh { animation: fade-soft .5s ease both; }
.foretaste-cap { margin: 0 0 .9rem; font-size: 1rem; letter-spacing: .1em; font-variant-caps: all-small-caps; color: var(--accent); font-size: 1.15rem; }
.foretaste-deva { font-size: 1.8rem; line-height: 1.8; }
.foretaste-deva[lang="hi-Latn"] { font-size: 1.4rem; line-height: 1.6; }
.foretaste-en { margin-top: .8rem; font-size: 1.28rem; font-style: italic; color: var(--ink-soft); line-height: 1.55; }
.foretaste .line { display: block; padding-left: 1.2em; text-indent: -1.2em; }
.foretaste-missing { font-size: 1.2rem; font-style: italic; color: var(--ink-soft); }
@keyframes fade-soft { from { opacity: 0; } to { opacity: 1; } }

/* Fihrist */
.fihrist { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.fihrist li { border-bottom: 1px solid var(--rule-soft); }
.fihrist li:first-child { border-top: 1px solid var(--rule); }
.entry {
  position: relative;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, max-content) minmax(1.25rem, 1fr) minmax(7rem, max-content);
  grid-template-areas: "num titles leader english" "num note note note";
  column-gap: .9rem;
  align-items: baseline;
  min-height: 56px;
  padding: .8rem .6rem .85rem .2rem;
  color: var(--ink); text-decoration: none;
  transition: background-color .18s ease;
}
.entry:hover, .entry:focus-visible { background: var(--hl); }
.entry:focus-visible { outline-offset: -3px; border-radius: 2px; }
.entry-num {
  grid-area: num; text-align: right; color: var(--accent); align-self: center;
  font-size: 1.15rem; font-variant-numeric: oldstyle-nums tabular-nums;
}
.entry-bloom { width: 1.1rem; height: 1.1rem; display: inline-block; vertical-align: middle; }
.entry-titles { grid-area: titles; display: flex; flex-direction: column; min-width: 0; }
.entry-script { font-size: 1.5rem; line-height: 1.45; color: var(--ink); transition: color .18s ease; }
.entry-roman { font-size: 1.12rem; font-style: italic; color: var(--ink-soft); line-height: 1.3; }
.entry:hover .entry-script, .entry:focus-visible .entry-script { color: var(--accent); }
.entry-leader { grid-area: leader; align-self: center; height: 0; border-bottom: 1px dotted var(--rule); margin-top: .2rem; }
.entry-english { grid-area: english; font-size: 1.08rem; color: var(--ink-soft); text-align: right; line-height: 1.35; align-self: center; max-width: 11.5rem; text-wrap: balance; }
.entry-snippet, .entry-note { grid-area: note; margin-top: .35rem; font-size: 1.05rem; color: var(--ink-soft); line-height: 1.45; }
.entry-note { color: var(--ink-quiet); font-style: italic; }
.entry-note-last { color: var(--accent); font-style: italic; }
.entry-note-last::before { content: "✦ "; font-style: normal; }
.entry-snippet mark { background: var(--mark); color: inherit; padding: 0 .1em; border-radius: 2px; }
.entry.is-missing .entry-script, .entry.is-missing .entry-roman { color: var(--ink-quiet); }
.entry.is-missing .entry-num { color: transparent; -webkit-text-stroke: 1px var(--accent); }
.entry.is-last .entry-num { font-weight: 600; }
.fihrist-empty { text-align: center; color: var(--ink-soft); font-style: italic; }
@media (max-width: 620px) {
  .entry {
    grid-template-columns: 2.1rem minmax(0, 1fr);
    grid-template-areas: "num titles" "num english" "num note";
    column-gap: .75rem;
  }
  .entry-leader { display: none; }
  .entry-english { text-align: left; max-width: none; font-size: 1.08rem; margin-top: .1rem; }
  .entry-num { align-self: baseline; padding-top: .2rem; }
}
@media (forced-colors: active) { .entry.is-missing .entry-num { color: CanvasText; -webkit-text-stroke: 0; } }

/* ---------- About / not found ---------- */
.about-view, .notfound { padding: 1.5rem clamp(1rem, 4vw, 2rem) 2rem; }
/* spread */
  .wide .about-view, .wide .notfound { padding: 1.75rem 1rem 0; }
  .wide .single-page { max-width: 50rem; margin: 0 auto; padding: 3.5rem clamp(2rem, 5vw, 5rem) 3.5rem; }

.prose { max-width: var(--measure); margin: 0 auto; hyphens: auto; }
.prose p { margin: 0 0 1em; }
.prose h2 { font-weight: 500; font-size: 1.45rem; margin: 2rem 0 .6rem; letter-spacing: .01em; }
.about-list { margin: 0; }
.about-list dt { font-variant-caps: all-small-caps; letter-spacing: .09em; color: var(--accent); font-size: 1.3rem; margin-top: 1rem; }
.about-list dd { margin: .1rem 0 0; }
.about-back { margin-top: 2rem; text-align: center; }
.notfound { text-align: center; }
.notfound h1 { font-weight: 400; }

/* ---------- Colophon ---------- */
.colophon {
  max-width: 46rem; margin: 2.5rem auto 0; padding: 2rem 1rem calc(3rem + env(safe-area-inset-bottom));
  text-align: center; color: var(--ink-soft); font-size: 1.05rem;
}
.colophon p { margin: .4rem 0; }
.colophon-bloom { display: block; width: 1.5rem; height: 1.5rem; margin: 0 auto 1rem; color: var(--accent); }
.colophon-title { color: var(--ink); font-size: 1.2rem; }
.colophon a { display: inline-block; padding: .6rem .3rem; }
.noscript { text-align: center; padding: 2rem; }
body[data-view="cover"] .colophon { margin-top: 0; padding-top: 1rem; }

/* ---------- Poem view ---------- */
.poem-view { max-width: 50rem; margin: 0 auto; padding: .75rem clamp(1rem, 4vw, 2rem) 2rem; }
/* spread */
  .wide .poem-view { max-width: min(94vw, 84rem); padding: .75rem 0 0; }
  .wide .poem-view.is-single .book { max-width: 50rem; margin-inline: auto; }

.poem-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
  margin-bottom: .5rem; font-size: 1.05rem; color: var(--ink-soft);
}
.crumb-back { display: inline-flex; align-items: center; gap: .35rem; min-height: 46px; padding: 0 .3rem; text-decoration: none; }
.crumb-back:hover { text-decoration: underline; }
.crumb-pos { font-style: italic; }

/* Version switcher: above the book on wide screens; a bar at the bottom of a phone */
.versions { display: flex; flex-direction: column; align-items: center; gap: .45rem; margin: 0 0 1.4rem; }
.versions-label { font-size: 1rem; color: var(--ink-quiet); font-style: italic; margin: 0; }
.seg {
  display: inline-flex; flex-wrap: wrap; justify-content: center;
  border: 1px solid var(--rule); border-radius: 999px; padding: 3px; gap: 2px;
  background: color-mix(in srgb, var(--page) 70%, transparent);
}
.seg button {
  min-height: 46px; min-width: 46px; padding: .3rem 1.1rem;
  font: inherit; font-size: 1.1rem; line-height: 1.15;
  color: var(--ink); background: transparent; border: 0; border-radius: 999px; cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.seg button:hover { background: var(--hl); color: var(--accent); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.seg button:disabled:hover { background: transparent; color: var(--ink); }
.seg button .deva { font-size: 1.05em; }
.seg-small { border-color: var(--rule-soft); }
.seg-small button { font-size: 1rem; min-height: 44px; padding: .25rem .9rem; }
.pairing { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem .6rem; font-size: 1rem; color: var(--ink-soft); margin: 0 0 1.5rem; position: relative; z-index: 1; }

/* spread */
  :root:not(.wide) .versions {
    position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; margin: 0;
    padding: .5rem max(.5rem, env(safe-area-inset-left)) calc(.5rem + env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--page) 93%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--rule-soft);
    box-shadow: 0 -8px 24px -18px rgba(40, 25, 10, .5);
  }
  :root:not(.wide) .versions-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  :root:not(.wide) .seg-versions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; max-width: 34rem; }
  :root:not(.wide) .seg-versions button { padding: .3rem .35rem; font-size: 1.02rem; min-height: 50px; }
  :root:not(.wide) body[data-view="poem"] { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
  :root:not(.wide) body[data-view="poem"] .poem-view.is-blank ~ * { padding-bottom: 0; }

@media (max-width: 400px) {
  .seg-versions button .deva { display: block; font-size: .95em; line-height: 1.1; }
  .seg-versions button { font-size: .95rem; line-height: 1.1; }
}

/* The book on the poem view */
.poem-view .book { position: relative; }
/* spread */
  .wide .poem-view .book { padding: 3.25rem 0 3.5rem; }
  .wide .poem-view.is-single .book { padding: 3.25rem clamp(2rem, 5vw, 4.5rem) 3.5rem; }


/* Title block */
.poem-head { text-align: center; margin: .5rem 0 1.75rem; position: relative; z-index: 1; }
.ph { display: flex; flex-direction: column; align-items: center; }
.poem-num { margin: 0; color: var(--accent); font-size: 1.15rem; letter-spacing: .1em; font-variant-caps: all-small-caps; }
.poem-title { margin: .3rem 0 0; font-weight: 400; line-height: 1.2; }
.poem-title-script { display: block; font-size: clamp(2rem, 5.5vw, 2.7rem); line-height: 1.45; color: var(--ink); }
.poem-title-roman { display: block; font-size: clamp(1.35rem, 3.6vw, 1.6rem); margin-top: .15rem; letter-spacing: .01em; font-style: italic; color: var(--ink-soft); }
.poem-title-english { margin: .5rem 0 0; font-size: clamp(1.3rem, 3.4vw, 1.5rem); color: var(--ink); }
.poem-meta { margin: .35rem 0 0; color: var(--ink-quiet); font-size: 1.15rem; font-variant-caps: all-small-caps; letter-spacing: .1em; }
.poem-orn { margin-top: 1rem; }
/* spread */
  .wide .is-facing .poem-head, .wide .is-blank .poem-head {
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 5rem; align-items: center; margin: 0 0 2rem;
  }
  .wide .is-facing .poem-orn, .wide .is-blank .poem-orn { display: none; }
  .wide .is-facing .ph-r, .wide .is-blank .ph-r { justify-content: center; }
  .wide .is-facing .poem-title-english, .wide .is-blank .poem-title-english { font-size: 2rem; font-style: italic; margin: 0; line-height: 1.25; }
  .wide .is-facing .poem-meta, .wide .is-blank .poem-meta { margin-top: .4rem; }
  .wide .is-facing .pairing { width: 50%; padding-right: 2.5rem; }


.notice {
  position: relative; z-index: 1;
  max-width: var(--measure); margin: 0 auto 1.75rem; padding: .85rem 1.1rem;
  border-left: 3px solid var(--accent); background: var(--hl);
  font-size: 1.1rem; color: var(--ink-soft); line-height: 1.5;
}
.notice strong { color: var(--ink); font-weight: 600; }
.notice p { margin: 0 0 .5rem; }
.notice p:last-child { margin: 0; }

/* Missing poem: a blank page facing the editorial note */
.blank-spread { position: relative; z-index: 1; }
.blank-page { display: none; }
/* spread */
  .wide .blank-spread { display: grid; grid-template-columns: 1fr 1fr; column-gap: 5rem; align-items: center; min-height: 22rem; padding: 0 clamp(2rem, 4vw, 4.5rem); }
  .wide .blank-page { display: flex; align-items: center; justify-content: center; min-height: 18rem; }
  .wide .blank-bloom { width: 4.5rem; height: 4.5rem; color: transparent; stroke: var(--rule); stroke-width: .35; }
  .wide .blank-spread .notice { margin: 0; }


/* Verse: single version */
.verse { margin: 0 auto; width: fit-content; max-width: 100%; position: relative; z-index: 1; }
.verse[lang="hi"] { font-size: 1.65rem; line-height: 1.85; }
.verse[lang="hi-Latn"] { font-size: 1.55rem; line-height: 1.6; }
.verse[lang="en"] { font-size: 1.5rem; line-height: 1.6; }
.stanza { margin: 0 0 1.25em; break-inside: avoid; }
.stanza:last-child { margin-bottom: 0; }
.line { display: block; padding-left: 1.6em; text-indent: -1.6em; text-wrap: pretty; transition: color .18s ease; }
.verse-label, .fh {
  display: block; text-align: center; margin: 0 0 1.1rem;
  font-size: 1.05rem; color: var(--ink-quiet); font-style: italic; font-family: var(--latin); line-height: 1.35;
}
.is-ghazal .poem-body .verse .stanza { text-align: center; margin-bottom: 1.6em; }
.is-ghazal .poem-body .verse .line { padding-left: 0; text-indent: 0; }
.is-ghazal .poem-body > .verse .stanza + .stanza::before {
  content: ""; display: block; width: .4rem; height: .4rem; margin: -.85em auto .85em;
  background: var(--accent); opacity: .5; transform: rotate(45deg);
}

/* Facing pages: each couplet faces its translation across the spine */
.facing { position: relative; z-index: 1; }
.facing-head { display: grid; grid-template-columns: 1fr; }
.frow { position: relative; }
.fcol .stanza { margin: 0; }
.fcol-l[lang="hi"] { font-size: 1.6rem; line-height: 1.85; }
.fcol-l[lang="hi-Latn"] { font-size: 1.5rem; line-height: 1.6; }
.fcol-r { font-size: 1.42rem; line-height: 1.6; }
.frow-bud { display: none; }
.bud { width: .8rem; height: .8rem; color: var(--accent); display: block; }

/* spread */
  .wide .facing-head, .wide .frow { grid-template-columns: 1fr 1fr; column-gap: 5rem; }
  .wide .facing-head { display: grid; margin-bottom: .75rem; }
  .wide .frow {
    display: grid; align-items: start;
    padding: .55em 0; margin: 0 0 .9em;
    transition: background-color .25s ease;
  }
  .wide .fcol { padding-inline: clamp(1.5rem, 3.6vw, 4.25rem); min-width: 0; }
  .wide .fcol-l[lang="hi"] { font-size: calc(var(--scale) * clamp(21px, 1.75vw, 27px)); }
  .wide .fcol-l[lang="hi-Latn"] { font-size: calc(var(--scale) * clamp(19px, 1.6vw, 25px)); }
  .wide .fcol-r { font-size: calc(var(--scale) * clamp(18.5px, 1.5vw, 23.5px)); }
  .wide .frow:hover { background: linear-gradient(90deg, transparent, var(--hl) 10%, var(--hl) 90%, transparent); }
  .wide .frow .line.is-lit { color: var(--accent); }
  .wide .is-ghazal .fcol { text-align: center; }
  .wide .is-ghazal .fcol .line { padding-left: 0; text-indent: 0; }
  .wide .is-ghazal .frow-bud { display: block; position: absolute; left: 50%; top: -.95em; transform: translateX(-50%); opacity: .7; }
  .wide .is-ghazal .frow { margin-bottom: 1.35em; }


/* Interlinear: Devanagari with its Roman beneath each line */
.stanza-inter .line { padding-left: 0; text-indent: 0; margin-bottom: .3em; }
.il-deva { display: block; }
.il-rom { display: block; font-family: var(--latin); font-size: .88em; line-height: 1.45; font-style: italic; color: var(--ink-soft); margin-top: .1em; padding-left: 1.4em; text-indent: -1.4em; }
.is-ghazal .il-rom { padding-left: 0; text-indent: 0; }
.stanza-rom { margin-top: .5em; font-style: italic; color: var(--ink-soft); font-size: .9em; }

/* Phones and tablets: rows stack; English follows each stanza */
/* spread */
  :root:not(.wide) .facing-head { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .5rem; margin-bottom: 1.25rem; }
  :root:not(.wide) .facing-head .fh { margin: 0; }
  :root:not(.wide) .facing-head .fh-l::after { content: " ·"; }
  :root:not(.wide) .frow { margin: 0 auto 2.1em; max-width: 34rem; }
  :root:not(.wide) .fcol-r {
    margin-top: .55em; padding-left: .9rem; border-left: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
    font-size: 1.28rem; font-style: italic; color: var(--ink-soft); line-height: 1.55;
  }
  :root:not(.wide) .is-ghazal .frow-bud { display: block; margin: -1.25em auto 1.1em; width: .8rem; opacity: .65; }
  :root:not(.wide) .line { padding-left: 1em; text-indent: -1em; }


/* Glossed words */
.gw {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; border-radius: 2px;
  text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, var(--accent) 65%, transparent);
  text-decoration-thickness: 1.5px; text-underline-offset: .28em; text-decoration-skip-ink: auto;
  -webkit-tap-highlight-color: transparent;
}
[lang="hi"] .gw, .gw:lang(hi) { text-underline-offset: .38em; }
.gw:hover { color: var(--accent); text-decoration-style: solid; }
.gw.is-open { background: var(--mark); color: var(--ink); }

.gloss-pop {
  position: absolute; z-index: 60; width: min(24rem, calc(100vw - 24px));
  padding: 1rem 1.2rem .8rem; background: var(--page); color: var(--ink);
  border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: 6px;
  box-shadow: 0 18px 40px -16px rgba(40, 25, 10, .45);
  animation: fade-soft .2s ease both;
}
.gloss-pop.is-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto;
  border-radius: 16px 16px 0 0; border-width: 1px 0 0; border-top: 3px solid var(--accent);
  padding: 1.2rem max(1.25rem, env(safe-area-inset-left)) calc(1rem + env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-right));
  animation: sheet-up .28s var(--settle) both;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.gp-head { margin: 0; }
.gp-term { font-size: 1.35rem; font-style: italic; font-weight: 500; }
.gp-script { font-size: 1.35rem; color: var(--accent); margin-left: .4rem; }
.gp-meaning { margin: .3rem 0 .6rem; font-size: 1.2rem; line-height: 1.5; color: var(--ink-soft); }
.gp-close {
  min-height: 44px; padding: 0 1rem; font: inherit; font-size: 1.05rem; color: var(--accent);
  background: transparent; border: 1px solid var(--rule); border-radius: 999px; cursor: pointer;
}
.gp-close:hover { border-color: var(--accent); }

/* ---------- Hashiya: poet's English, word guide, notes ---------- */
.hashiya { margin-top: 2.5rem; }
/* spread */
  .wide .hashiya {
    margin-top: 2rem; padding: 2.75rem clamp(2rem, 4vw, 4.5rem) 3rem;
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 5rem; align-items: start;
  }
  .wide .hashiya::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 5rem; transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, var(--spine) 47%, color-mix(in srgb, var(--spine) 60%, transparent) 50%, var(--spine) 53%, transparent);
    pointer-events: none; opacity: .75;
  }
  .wide .hashiya > .poem-section { margin: 0; position: relative; z-index: 1; }
  .wide .hashiya > .poet-english { grid-column: 1 / -1; margin-bottom: 2.5rem; max-width: none; }
  .wide .hashiya > .poet-english .verse { columns: 2; column-gap: 5rem; width: auto; }
  .wide .hashiya > .glossary { grid-column: 1; }
  .wide .hashiya > .notes { grid-column: 2; }
  .wide .hashiya > .notes:only-child, .wide .hashiya > .glossary:only-child { grid-column: 1 / -1; }

.poem-section { max-width: var(--measure); margin: 3rem auto 0; }
.poem-section > h2 {
  display: flex; align-items: center; gap: 1rem;
  font-weight: 400; font-size: 1.6rem; letter-spacing: .03em; margin: 0 0 1rem;
}
.poem-section > h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.section-note { margin: -.4rem 0 1rem; font-size: 1.05rem; color: var(--ink-quiet); font-style: italic; }
.poet-english .verse { width: auto; font-size: 1.4rem; }
.poet-english .stanza { break-inside: avoid; }

.gloss { margin: 0; display: grid; grid-template-columns: 1fr; }
.gloss-item { padding: .7rem 0; border-bottom: 1px solid var(--rule-soft); break-inside: avoid; }
.gloss-item:first-child { border-top: 1px solid var(--rule-soft); }
.gloss dt { font-size: 1.3rem; line-height: 1.35; }
.gloss .term { font-style: italic; font-weight: 500; }
.gloss .term-script { margin-left: .6rem; color: var(--accent); font-size: 1.12em; font-style: normal; }
.gloss dd { margin: .15rem 0 0; font-size: 1.2rem; color: var(--ink-soft); line-height: 1.5; }

.notes-list { margin: 0; padding-left: 1.2rem; font-size: 1.15rem; color: var(--ink-soft); line-height: 1.55; }
.notes-list li { margin-bottom: .6rem; padding-left: .3rem; }
.notes-list li::marker { color: var(--accent); }
.notes-pages { font-size: 1.05rem; color: var(--ink-quiet); margin: .75rem 0 0; }

/* ---------- Previous / next ---------- */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  max-width: var(--measure); margin: 3rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
/* spread */ .wide .pager { max-width: none; border-top: 0; padding-top: 0; margin-top: 2rem; } 
.pager a {
  display: flex; flex-direction: column; gap: .1rem; min-height: 64px;
  padding: .85rem 1.2rem; text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule-soft); border-radius: 10px;
  transition: background-color .18s ease, border-color .18s ease;
}
/* spread */ .wide .pager a { background: color-mix(in srgb, var(--page) 70%, transparent); border-color: transparent; } 
.pager a:hover { background: var(--hl); border-color: var(--accent); }
.pg-dir { color: var(--accent); font-variant-caps: all-small-caps; letter-spacing: .09em; font-size: 1.15rem; }
.pg-script { font-size: 1.35rem; line-height: 1.4; }
.pg-title { font-size: 1.1rem; font-style: italic; color: var(--ink-soft); line-height: 1.3; }
.pg-next { text-align: right; align-items: flex-end; }
.pager-hint { max-width: var(--measure); margin: .8rem auto 0; text-align: center; font-size: 1rem; color: var(--ink-quiet); font-style: italic; }
@media (max-width: 560px) {
  .pager { grid-template-columns: 1fr; }
  .pg-none { display: none; }
}
:root:not(.wide) .pager-hint { display: none; }
@media (hover: none) { .pager-hint { display: none; } }

/* ---------- Motion ---------- */
.view.is-entering { animation: fade-in .4s ease both; }
.view.turn-next { animation: turn-next .42s var(--settle) both; }
.view.turn-prev { animation: turn-prev .42s var(--settle) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes turn-next { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes turn-prev { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Forced colours / high contrast ---------- */
@media (forced-colors: active) {
  .seg button[aria-pressed="true"] { border: 2px solid CanvasText; }
  .orn, .bud, .wordmark-bloom, .colophon-bloom { color: CanvasText; }
  .cover-bloom .petal { fill: CanvasText; }
  .gw { text-decoration-color: LinkText; }
}
@media (prefers-contrast: more) {
  :root { --ink-soft: var(--ink); --ink-quiet: var(--ink-soft); --rule-soft: var(--rule); }
}

/* ---------- Print ---------- */
@media print {
  :root, :root[data-theme="dark"] {
    --page: #fff; --page-2: #fff; --table: #fff; --ink: #000; --ink-soft: #222; --ink-quiet: #444;
    --accent: #6b1f14; --rule: #999; --rule-soft: #ccc; --hl: transparent; color-scheme: light;
  }
  @page { margin: 18mm 16mm; }
  html { font-size: 11pt; }
  body { background: #fff !important; font-size: 1.15rem; padding: 0 !important; }
  .masthead, .skip-link, .search, .versions, .pairing, .pager, .pager-hint, .crumb-back, .book-actions, .cover-resume,
  .colophon a, .gloss-pop, .foretaste, .frow-bud { display: none !important; }
  .spread, .poem-view .book, .single-page, .hashiya, .cover-board { box-shadow: none !important; background: #fff !important; display: block !important; }
  .spread::before, .poem-view .book::before, .hashiya::before, .cover-board::before { display: none !important; }
  .cover { break-after: page; padding-top: 20vh; }
  .cover-board { border: 0; outline: 0; }
  .entry { break-inside: avoid; }
  .entry-snippet { display: none; }
  a { color: inherit; text-decoration: none; }
  .gw { text-decoration: none; }
  .poem-view { max-width: none; padding: 0; }
  .poem-view.is-facing .frow { display: grid !important; grid-template-columns: 1fr 1fr; column-gap: 2rem; margin-bottom: 1em; }
  .fcol-r { border: 0 !important; padding: 0 !important; font-style: normal !important; }
  .poem-section, .frow, .stanza, .gloss-item { break-inside: avoid; }
  .poem-section > h2 { break-after: avoid; }
  .notice { border-left-color: #000; }
}
.cover-bloom .petal-in { fill: var(--accent-deep); opacity: .55; transform-box: view-box; transform-origin: 50% 50%; animation: petal-open 1.1s var(--settle) both; }
.cover-bloom .i1 { animation-delay: 1.15s; } .cover-bloom .i2 { animation-delay: 1.25s; } .cover-bloom .i3 { animation-delay: 1.35s; }
.cover-bloom .i4 { animation-delay: 1.45s; } .cover-bloom .i5 { animation-delay: 1.55s; }
:root[data-theme="dark"] .cover-bloom .petal-in { fill: #7a2a1e; opacity: .7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cover-bloom .petal-in { fill: #7a2a1e; opacity: .7; } }
:root[data-theme="dark"] .cover-bloom .wound { fill: #4a120c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cover-bloom .wound { fill: #4a120c; } }

/* Line-level alignment across the spine (wide screens, equal line counts) */
@supports (grid-template-rows: subgrid) {
  /* spread */
    .wide .frow.is-linked { grid-template-rows: repeat(var(--n, 1), auto); row-gap: 0; }
    .wide .frow.is-linked > .fcol { grid-row: 1 / span var(--n, 1); display: grid; grid-template-rows: subgrid; align-items: baseline; }
    .wide .frow.is-linked > .fcol > .stanza { display: contents; }
    .wide .frow.is-linked .stanza-inter .line { margin-bottom: .3em; }
  
}
/* spread */
  .wide .hashiya.is-single { display: block; max-width: 50rem; margin-inline: auto; }
  .wide .hashiya.is-single::before { display: none; }
  .wide .hashiya.is-single > .poem-section { max-width: none; }

/* spread */
  .wide .is-facing .book > .notice {
    width: calc(50% - 2.5rem - 2 * clamp(1.5rem, 3.6vw, 4.25rem)); max-width: none;
    margin: 0 0 1.5rem clamp(1.5rem, 3.6vw, 4.25rem);
  }

.wide .is-facing .ph, .wide .is-blank .ph { padding-inline: clamp(1.5rem, 3.6vw, 4.25rem); text-wrap: balance; }
.wide .is-facing .pairing { width: calc(50% - 2.5rem); padding: 0 1rem; }

/* Small phones at large text sizes: keep the bars inside the screen */
@media (max-width: 420px) {
  .masthead-inner { padding-inline: 10px; gap: 6px; }
  .wordmark-roman { font-size: 1em; }
  .ctl, .ctl-group .ctl { min-width: 44px; padding: 0 .3em; }
  .ctl-group .ctl:last-child { font-size: 1.1em; }
  :root:not(.wide) .seg-versions button { font-size: calc(11px + 4px * var(--scale)); padding: .25rem .15rem; }
}
body { overflow-wrap: break-word; }
.gloss { grid-template-columns: minmax(0, 1fr); }
.gloss dt, .gloss dd, .entry-titles, .pg-title, .pg-script { overflow-wrap: anywhere; }

/* ---------- Cover sher: a random couplet in which the poet names himself ---------- */
.cover-sher { margin: 2rem auto 0; max-width: 40rem; padding: 1.6rem 0 0; border-top: 1px solid var(--rule-soft); }
.cover-board > .cover-sher { animation-delay: .75s; }
.cs-kicker { margin: 0 0 1rem; font-size: .95rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-quiet); }
.cs-body { transition: opacity .26s ease, transform .26s var(--settle); }
.cs-body.is-leaving { opacity: 0; transform: translateY(6px); }
.cs-lines {
  margin: 0; font-family: var(--deva); color: var(--ink);
  font-size: clamp(1.35rem, 1rem + 1.4vw, 1.7rem); line-height: 1.8; text-wrap: balance;
}
.cs-roman { margin: .7rem 0 0; font-size: 1.2rem; line-height: 1.55; color: var(--ink-soft); font-style: italic; }
.cs-english { margin: .9rem auto 0; max-width: 30rem; font-size: 1.22rem; line-height: 1.6; color: var(--ink-soft); }
.takh { color: var(--accent); }
.cs-lines .takh { font-weight: 600; }
.cs-cap { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: 1.2rem 0 0; font-size: 1.05rem; }
.cs-from { display: inline-block; max-width: 100%; padding: .6rem .2rem; line-height: 1.45; color: var(--ink-soft); text-wrap: balance; }
.cs-from:hover { color: var(--accent); }
.cs-from-roman { font-style: italic; }
.cs-next {
  min-height: 44px; padding: 0 1.1rem; font: inherit; color: var(--accent);
  background: transparent; border: 1px solid var(--rule); border-radius: 999px; cursor: pointer;
}
.cs-next:hover { border-color: var(--accent); background: var(--hl); }
@media (max-width: 420px) { .cover-sher { margin-top: 1.5rem; padding-top: 1.25rem; } .cs-roman { font-size: 1.1rem; } .cs-english { font-size: 1.12rem; } }
@media (prefers-reduced-motion: reduce) { .cs-body { transition: none; } }
@media print { .cs-cap { display: none; } }

/* Give the cover card room for a full misra on one line when the spread is available. */
.wide .cover-board { max-width: 46rem; }
