/* Kutsal Kitap reader. Four colours: cobalt ground, quartz-white leaves, near-black ink, mercan apparatus.
   One family, Source Serif 4; Atkinson Hyperlegible Next is a reading-comfort option only. */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/source-serif-4-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/source-serif-4-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/source-serif-4-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/source-serif-4-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/atkinson-next-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/atkinson-next-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ground: #0f2a63;
  --ground-deep: #0a1d49;
  --leaf: #fcfcfd;
  --leaf-back: #f1f2f5;
  --ink: #14161c;
  --ink-quiet: #565b69;
  --hair: rgba(20, 22, 28, 0.2);
  --mercan: #d63c25;
  --mercan-wash: rgba(214, 60, 37, 0.15);
  --numeral: #d63c25;
  --on-ground: #f4f6fb;
  --on-ground-quiet: #b4c1e2;
  --ground-hair: rgba(244, 246, 251, 0.28);
  --shade: 4, 11, 32;

  /* Reading comfort, written by the settings leaf. */
  --fs: 19px;
  --leading: 1.6;
  --tracking: 0em;
  --face: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --align: left;

  /* One raking light. ground.js swings these; every shadow reads them. */
  --rake-x: 14px;
  --rake-y: 22px;

  --serif: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --measure: 64ch;
  --pad: clamp(1.5rem, 5vw, 3.75rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-light='night'] {
  --ground: #071029;
  --ground-deep: #040a1c;
  --leaf: #111a35;
  --leaf-back: #0d1429;
  --ink: #e3e6f0;
  --ink-quiet: #9ca6c1;
  --hair: rgba(227, 230, 240, 0.2);
  --mercan: #f26a52;
  --mercan-wash: rgba(242, 106, 82, 0.2);
  --numeral: #a5331f;
  --on-ground: #e3e6f0;
  --on-ground-quiet: #94a1c6;
  --ground-hair: rgba(227, 230, 240, 0.22);
  --shade: 0, 0, 0;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ground);
  color-scheme: light;
  scrollbar-color: var(--on-ground-quiet) var(--ground-deep);
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}
html[data-light='night'] { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--on-ground);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--mercan); color: #fff; }
input, textarea { caret-color: var(--mercan); }

:focus-visible { outline: 2px solid var(--on-ground); outline-offset: 3px; border-radius: 1px; }
.leaf :focus-visible, .side-leaf :focus-visible, .index-leaf :focus-visible, .slip :focus-visible, .listen-bar :focus-visible, .jump-list :focus-visible {
  outline-color: var(--mercan);
}

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

.skip {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 50;
  padding: 0.5rem 0.9rem; background: var(--leaf); color: var(--ink); text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- ground ---------- */

.ground {
  position: fixed; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  display: block;
  background: var(--ground);
}

.numeral {
  position: fixed; z-index: -1;
  right: -0.06em; bottom: -0.2em;
  font-size: 760px;               /* forty times the 19px body */
  line-height: 0.74;
  font-weight: 330;
  font-variation-settings: 'opsz' 60;
  font-variant-numeric: lining-nums;
  letter-spacing: -0.04em;
  color: var(--numeral);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.numeral[data-digits='2'] { font-size: 620px; }
.numeral[data-digits='3'] { font-size: 470px; }
.numeral span { display: block; transition: opacity 0.5s var(--ease), transform 0.7s var(--ease); }
.numeral.is-changing span { opacity: 0; transform: translateY(0.04em); }

/* ---------- apparatus in small capitals ---------- */

.cap, .tool span, .index-rail a, .index-rail button {
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: lining-nums;
}

button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button.cap, a.cap {
  padding: 0.55rem 0; color: inherit; text-decoration: none;
  background-image: linear-gradient(var(--mercan), var(--mercan));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0 1px;
  transition: background-size 0.35s var(--ease);
}
button.cap:hover, a.cap:hover, button.cap[aria-pressed='true'] { background-size: 100% 1px; }
button.cap:disabled, a.cap[aria-disabled='true'] { opacity: 0.4; cursor: default; background-size: 0 1px; }

/* ---------- top margin ---------- */

.top {
  display: grid;
  grid-template-columns: 1fr minmax(0, 26rem) 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem clamp(1rem, 3vw, 2.25rem) 0.4rem;
}
.mark { justify-self: start; display: inline-flex; padding: 0.2rem 0; text-decoration: none; }
.mark svg { display: block; height: 1.8rem; width: auto; overflow: visible; }
.mark-leaf { fill: var(--on-ground); }
.mark-mid { fill: var(--mercan); }
.top-end { justify-self: end; display: flex; gap: 1.25rem; }

.jump { position: relative; justify-self: center; width: 100%; }
.jump-input {
  width: 100%; padding: 0.6rem 2.4rem 0.6rem 0.2rem;
  font-family: var(--serif); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  text-align: center; color: var(--on-ground);
  background: transparent; border: 0; border-bottom: 1px solid var(--ground-hair); border-radius: 0;
  transition: border-color 0.3s var(--ease);
}
.jump-input::placeholder { color: var(--on-ground-quiet); opacity: 1; }
.jump-input:hover { border-bottom-color: var(--on-ground-quiet); }
.jump-input:focus { outline: none; border-bottom-color: var(--mercan); text-align: left; text-transform: none; letter-spacing: 0.02em; font-size: 1rem; font-weight: 400; }
.jump-key {
  position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%);
  font-family: var(--serif); font-size: 0.7rem; color: var(--on-ground-quiet);
  border: 1px solid var(--ground-hair); padding: 0 0.4rem; line-height: 1.4;
}
.jump-input:focus ~ .jump-key { visibility: hidden; }
.jump-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 0.6rem);
  margin: 0; padding: 0.4rem 0; list-style: none;
  background: var(--leaf); color: var(--ink);
  box-shadow: 0 1px 2px rgba(var(--shade), 0.5), var(--rake-x) var(--rake-y) 34px -8px rgba(var(--shade), 0.6);
}
.jump-list li {
  display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 1.1rem; cursor: pointer;
}
.jump-list li small { color: var(--ink-quiet); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; align-self: center; }
.jump-list li[aria-selected='true'], .jump-list li:hover { background: var(--mercan-wash); }

/* ---------- left margin: the sections of the book ---------- */

.index-rail {
  position: fixed; left: clamp(1rem, 3vw, 2.25rem); top: 7.5rem; z-index: 5;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  width: 11rem;
}
.index-rail button {
  padding: 0.5rem 0; color: var(--on-ground-quiet); text-align: left;
  background-image: linear-gradient(var(--mercan), var(--mercan));
  background-repeat: no-repeat; background-position: 0 calc(100% - 0.3rem); background-size: 0 1px;
  transition: color 0.3s var(--ease), background-size 0.35s var(--ease);
}
.index-rail button:hover { color: var(--on-ground); }
.index-rail button[aria-current='true'] { color: var(--on-ground); background-size: 100% 1px; }

/* ---------- right margin: what you can do to this leaf ---------- */

.tools {
  position: fixed; right: clamp(1rem, 3vw, 2.25rem); top: 7.5rem; z-index: 5;
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem;
}
.tool {
  display: inline-flex; flex-direction: row-reverse; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0; color: var(--on-ground-quiet);
  transition: color 0.3s var(--ease);
}
.tool svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.tool:hover { color: var(--on-ground); }
.tool[aria-pressed='true'], .tool[aria-expanded='true'] { color: var(--on-ground); }
.tool[aria-pressed='true'] span, .tool[aria-expanded='true'] span { box-shadow: 0 0.35rem 0 -0.29rem var(--mercan); }
.tool .ico-pause { display: none; }
.tool[aria-pressed='true'] .ico-pause { display: inline; }
.tool[aria-pressed='true'] .ico-play { display: none; }
.tool:disabled { opacity: 0.4; cursor: default; }
.tool-index { display: none; }

/* ---------- the desk and its leaves ---------- */

.desk {
  padding: 1.6rem 0 7rem;
  margin-inline: auto;
  width: min(100% - 1.25rem, calc(100vw - 27rem));
}

.leaves { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; perspective: 2400px; }

.leaf, .side-leaf, .index-leaf, .slip, .listen-bar {
  background: var(--leaf);
  color: var(--ink);
  box-shadow:
    0 1px 1.5px rgba(var(--shade), 0.55),
    var(--rake-x) var(--rake-y) 40px -10px rgba(var(--shade), 0.62);
  transition: box-shadow 2.2s linear;
}

.leaf {
  position: relative;
  padding: clamp(2.25rem, 6vw, 4.5rem) var(--pad) clamp(2rem, 5vw, 3.5rem);
  font-family: var(--face);
  font-size: var(--fs);
  line-height: var(--leading);
  letter-spacing: var(--tracking);
  min-height: 60vh;
  width: min(100%, calc(var(--measure) + 2 * var(--pad)));
  justify-self: center;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  outline: none;
}

.leaf h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.4rem);
  font-weight: 360; line-height: 1.08; letter-spacing: -0.015em;
  font-variation-settings: 'opsz' 60;
  text-wrap: balance;
}
.leaf-rule {
  display: flex; align-items: center; gap: 0.55rem; margin: 1.15rem 0 0.75rem;
}
.leaf-rule::before { content: ''; flex: 0 0 2.75rem; height: 1px; background: var(--hair); }
.leaf-rule::after { content: ''; flex: 1; height: 1px; background: var(--hair); }
.leaf-rule i { width: 5px; height: 5px; border-radius: 50%; background: var(--mercan); }
.leaf .leaf-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1.5rem;
  margin: 0 0 2.6rem; color: var(--ink-quiet); text-align: left; text-indent: 0;
  font-family: var(--serif); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  font-variant-numeric: lining-nums tabular-nums;
}

.leaf .leaf-meta .leaf-version {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; text-align: right;
  padding-bottom: 0.15em; border-bottom: 1px dotted var(--ink-quiet);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.leaf .leaf-meta .leaf-version::after { content: ''; display: inline-block; width: 0.38em; height: 0.38em; margin: 0 0 0.14em 0.5em; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); opacity: 0.7; }
.leaf .leaf-meta .leaf-version:hover, .leaf .leaf-meta .leaf-version[aria-expanded='true'] { color: var(--ink); border-bottom: 1px solid var(--mercan); }

.leaf h2 {
  margin: 2.6em 0 0.85em;
  font-family: var(--serif);
  font-size: 0.74rem; font-weight: 650; letter-spacing: 0.17em; text-transform: uppercase;
  color: var(--ink); line-height: 1.4;
}
.leaf .leaf-meta + h2 { margin-top: 0; }

.leaf p { margin: 0; text-align: var(--align); hyphens: auto; -webkit-hyphens: auto; hanging-punctuation: first; text-wrap: pretty; }
.leaf p + p { text-indent: 1.4em; }
.stanza { margin: 0 0 1.35em; text-align: left; }
.stanza .line { display: block; padding-left: 1.4em; text-indent: -1.4em; }
.stanza .line + .line { padding-left: 2.8em; }

.v { cursor: pointer; border-radius: 1px; transition: color 0.4s var(--ease), background-color 0.3s var(--ease); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.vn {
  font-family: var(--serif);
  font-size: 0.62em; font-weight: 600; letter-spacing: 0.02em; color: var(--mercan);
  vertical-align: 0.48em; line-height: 0; margin-right: 0.28em; user-select: none; white-space: nowrap;
  font-variant-numeric: lining-nums;
}
.stanza .vn { display: inline-block; text-indent: 0; }
.leaf[data-numbers='false'] .vn { display: none; }
/* The ring after a verse number: this verse has cross-references. */
.xr {
  display: inline-block; vertical-align: 0.55em; width: 0.38em; height: 0.38em; margin: 0 0.3em 0 -0.08em;
  border: 1px solid var(--mercan); border-radius: 50%; opacity: 0.7; box-sizing: border-box;
  transition: opacity 0.25s var(--ease), background 0.25s var(--ease);
}
.xr:hover, .v.is-selected .xr { opacity: 1; background: var(--mercan); }
.leaf[data-numbers='false'] .xr { margin-left: 0; }
.leaf h2 .parallel .ref, .leaf .ref { font: inherit; color: inherit; text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 0.2em; }
.leaf h2 .parallel .ref:hover { text-decoration-color: var(--mercan); color: var(--ink); }
.refs-for { margin: -0.8rem 0 1rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mercan); }
.v:hover { background: color-mix(in srgb, var(--mercan) 7%, transparent); }
.v.is-highlighted { background: var(--mercan-wash); }
.v.is-selected { text-decoration: underline; text-decoration-color: var(--mercan); text-decoration-thickness: 1px; text-underline-offset: 0.28em; }
.v.is-target { animation: arrive 2.4s var(--ease) 1; }
@keyframes arrive { 0%, 35% { background: var(--mercan-wash); } 100% { background: transparent; } }
.leaf.is-listening .v { color: var(--ink-quiet); }
.leaf.is-listening .v.is-speaking { color: var(--ink); }

/* A folded tape flag hangs over the leaf's edge onto the ground at the verse you marked. */
.flag {
  position: absolute; left: -0.9rem; width: 2.1rem; height: 0.85rem;
  background: var(--mercan);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0.42rem 50%);
  filter: drop-shadow(calc(var(--rake-x) * 0.1) calc(var(--rake-y) * 0.1) 1.5px rgba(var(--shade), 0.45));
  pointer-events: none;
}
.flag::after { content: ''; position: absolute; left: 0.9rem; top: 0; bottom: 0; width: 1px; background: rgba(0, 0, 0, 0.22); }

.leaf .leaf-foot {
  text-indent: 0;
  margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--hair);
  font-family: var(--serif); font-size: 0.82rem; line-height: 1.5; letter-spacing: 0; color: var(--ink-quiet);
  text-align: left;
}
.leaf-foot strong { font-weight: 600; color: var(--ink); }

/* Verso: orientation for the first-time reader, out of the daily reader's way. */
.leaf .verso-intro { font-size: 1.04em; margin-bottom: 2.2em; text-indent: 0; }
.terms { margin: 0; padding: 0; list-style: none; }
.terms li { display: grid; grid-template-columns: 3.2rem 1fr; gap: 0 0.6rem; padding: 0.95em 0; border-top: 1px solid var(--hair); }
.terms li:last-child { border-bottom: 1px solid var(--hair); }
.terms button { grid-row: span 2; align-self: start; text-align: left; color: var(--mercan); font-family: var(--serif); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; padding: 0.35em 0; font-variant-numeric: lining-nums; }
.terms button:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.terms dfn { font-style: normal; font-weight: 600; }
.terms span { color: var(--ink-quiet); font-size: 0.94em; }
.leaf[data-face='verso'] p { text-align: left; }

/* Face down: the text is not here. Blank back, nothing pretending otherwise. */
.leaf[data-face='down'] { background: var(--leaf-back); min-height: 46vh; }
.desk-note { margin: 1.5rem auto 0; max-width: 34rem; text-align: center; color: var(--on-ground); font-size: 1rem; line-height: 1.55; }
.desk-note button { color: var(--on-ground); text-decoration: underline; text-decoration-color: var(--mercan); text-underline-offset: 0.25em; }
.desk-note button:hover { text-decoration-thickness: 2px; }

/* The turn and the lay: the surface's one authored motion. */
.leaf.is-turning-out { animation: turn-out 0.34s cubic-bezier(0.5, 0, 0.9, 0.4) forwards; }
.leaf.is-turning-in { animation: turn-in 0.62s var(--ease) forwards; }
@keyframes turn-out { to { transform: rotateY(-89deg) translateZ(30px); filter: brightness(0.82); } }
@keyframes turn-in { from { transform: rotateY(89deg) translateZ(30px); filter: brightness(0.82); } to { transform: none; filter: none; } }
.leaf.is-leaving { animation: leave 0.3s cubic-bezier(0.5, 0, 0.9, 0.4) forwards; }
.leaf.is-laying { animation: lay 0.8s var(--ease) forwards; }
@keyframes leave { to { transform: translate3d(calc(var(--dir, 1) * -7vw), 0.5rem, 0) rotate(calc(var(--dir, 1) * -1.4deg)); opacity: 0; } }
@keyframes lay { from { transform: translate3d(calc(var(--dir, 1) * 9vw), -1.2rem, 0) rotate(calc(var(--dir, 1) * 1.8deg)) scale(1.012); opacity: 0; } to { transform: none; opacity: 1; } }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 1.6rem auto 0; max-width: 100%; color: var(--on-ground); }
.pager a { display: inline-flex; align-items: center; gap: 0.6rem; }
.pager svg { flex: none; width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.pager a { max-width: 48%; }
.pager-next { margin-left: auto; text-align: right; }

/* ---------- side leaves: comfort and marks ---------- */

.side-leaf {
  position: fixed; z-index: 20; right: clamp(1rem, 3vw, 2.25rem); top: 7.5rem;
  width: min(21rem, calc(100vw - 1.25rem)); max-height: calc(100dvh - 9rem); overflow: auto;
  padding: 1.6rem 1.6rem 1.2rem;
  font-size: 0.95rem;
  animation: lay-side 0.55s var(--ease);
  scrollbar-color: var(--ink-quiet) transparent;
}
@keyframes lay-side { from { transform: translate3d(2rem, -0.6rem, 0) rotate(1.2deg); opacity: 0; } }
.side-leaf h2 { margin: 0 0 1.2rem; font-size: 1.35rem; font-weight: 400; letter-spacing: -0.01em; font-variation-settings: 'opsz' 32; }
.field { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 1rem; align-items: baseline; margin-bottom: 1.1rem; }
.field label, .choice legend, .check span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-quiet); }
.field output { font-size: 0.82rem; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.field label { grid-area: 1 / 1; }
.field output { grid-area: 1 / 2; }
.field input[type='range'] { grid-area: 2 / 1 / 3 / -1; }

input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 1.75rem; background: transparent; cursor: pointer; margin: 0; }
input[type='range']::-webkit-slider-runnable-track { height: 1px; background: var(--ink-quiet); }
input[type='range']::-moz-range-track { height: 1px; background: var(--ink-quiet); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 0.55rem; height: 1.25rem; margin-top: -0.6rem; background: var(--mercan); border: 0; border-radius: 0; }
input[type='range']::-moz-range-thumb { width: 0.55rem; height: 1.25rem; background: var(--mercan); border: 0; border-radius: 0; }

.choice { border: 0; margin: 0 0 1.1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.choice legend { padding: 0; margin-bottom: 0.3rem; width: 100%; }
.choice label { position: relative; cursor: pointer; padding: 0.35rem 0; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span { padding-bottom: 0.2rem; border-bottom: 1px solid transparent; color: var(--ink-quiet); transition: color 0.25s var(--ease), border-color 0.25s var(--ease); }
.choice label:hover span { color: var(--ink); }
.choice input:checked + span { color: var(--ink); border-bottom-color: var(--mercan); }
.choice input:focus-visible + span { outline: 2px solid var(--mercan); outline-offset: 3px; }
.check { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 1rem; height: 1rem; margin: 0; border: 1px solid var(--ink-quiet); border-radius: 0; display: grid; place-content: center; cursor: pointer; }
.check input:checked { border-color: var(--mercan); background: var(--mercan); }
.check input:checked::after { content: ''; width: 0.5rem; height: 0.28rem; border: solid #fff; border-width: 0 0 1.5px 1.5px; transform: translateY(-1px) rotate(-45deg); }
.fine { margin: 0 0 1rem; font-size: 0.82rem; line-height: 1.5; color: var(--ink-quiet); }
.side-close { display: block; margin-left: auto; }

.marks-list { margin: 0 0 1rem; padding: 0; list-style: none; }
.marks-list li { border-top: 1px solid var(--hair); }
.marks-list li:last-child { border-bottom: 1px solid var(--hair); }
.marks-list button { display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 1rem; width: 100%; padding: 0.75rem 0; text-align: left; }
.marks-list button:hover .mark-ref { text-decoration: underline; text-decoration-color: var(--mercan); text-underline-offset: 0.25em; }
.mark-ref { font-weight: 600; }
.mark-kind { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mercan); align-self: center; }
.mark-text { grid-column: 1 / -1; color: var(--ink-quiet); font-size: 0.88rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mark-note { grid-column: 1 / -1; color: var(--ink); font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.v.has-note { text-decoration: underline dotted var(--mercan); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }

/* ---------- the account leaf: a small form in the leaf's own idiom ---------- */

.field-text { display: grid; gap: 0.25rem; margin-bottom: 0.9rem; }
.field-text span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-quiet); }
.field-text input, .note-edit textarea {
  width: 100%; padding: 0.45rem 0; font: inherit; font-size: 1rem; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--ink-quiet); border-radius: 0;
  transition: border-color 0.3s var(--ease);
}
.field-text input:focus, .note-edit textarea:focus { outline: none; border-bottom-color: var(--mercan); }
.field-text input:autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px var(--leaf) inset; }
.account-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1.4rem; margin-bottom: 1rem; }
.account-who { margin: 0 0 0.6rem; display: grid; gap: 0.15rem; }
.account-who span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-quiet); }
.account-who b { font-weight: 500; overflow-wrap: anywhere; }
.account-error { color: var(--mercan); }
.account-danger { color: var(--mercan); }
.account-more { margin: 0.2rem 0 1rem; }
.account-more summary { list-style: none; cursor: pointer; padding: 0.55rem 0; color: var(--ink-quiet); }
.account-more summary::-webkit-details-marker { display: none; }
.account-more summary:hover, .account-more[open] summary { color: var(--ink); }
.account-more .account-form { margin-top: 0.6rem; padding-top: 0.8rem; border-top: 1px solid var(--hair); }

/* The note editor unfolds beneath the slip's row of actions; the slip takes a set width for it, since a wrapping max-content row would run away. */
.slip.is-noting { width: min(36rem, calc(100vw - 1.25rem)); }
.note-edit { flex-basis: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 0.1rem 1.2rem; align-items: baseline; padding: 0.2rem 0 0.35rem; }
.note-edit textarea { grid-column: 1 / -1; width: 100%; min-height: 3.4rem; resize: vertical; font-size: 0.95rem; line-height: 1.45; }
.note-edit #note-delete { grid-column: 2; color: var(--ink-quiet); }
.note-edit #note-save { grid-column: 3; color: var(--mercan); }

/* The version leaf: the versions by language, the one on this leaf marked. */
.version-lang { margin: 0 0 0.2rem; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mercan); }
.version-group + .version-group { margin-top: 1.1rem; }
.version-list { margin-bottom: 0.4rem; }
.version-list button[aria-current='true'] .mark-ref { box-shadow: 0 0.5rem 0 -0.42rem var(--mercan); }
.version-list button:disabled { cursor: default; }
.version-list button:disabled .mark-ref, .version-list button:disabled .mark-kind { color: var(--ink-quiet); }
.version-list button:disabled:hover .mark-ref { text-decoration: none; }
.version-status { margin: 0.2rem 0 0.4rem; }
.version-retry { color: var(--ink); text-decoration: underline; text-decoration-color: var(--mercan); text-underline-offset: 0.25em; }

/* ---------- index leaf ---------- */

.index-leaf {
  width: min(52rem, calc(100vw - 1.25rem)); max-height: min(44rem, calc(100dvh - 5.5rem));
  padding: 0; border: 0; overflow: hidden; outline: none;
  margin-top: 4.5rem;
  box-shadow: 0 1px 2px rgba(var(--shade), 0.6), calc(var(--rake-x) * 1.8) calc(var(--rake-y) * 1.8) 70px -14px rgba(var(--shade), 0.75);
}
.index-leaf[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); animation: lay-index 0.6s var(--ease); }
@keyframes lay-index { from { transform: translate3d(0, -1.5rem, 0) rotate(-1deg) scale(1.02); opacity: 0; } }
.index-leaf::backdrop { background: rgba(var(--shade), 0.5); }
.index-head { display: flex; justify-content: space-between; align-items: baseline; padding: 1.5rem 1.75rem 0.4rem; }
.index-head h2 { margin: 0; font-size: 1.7rem; font-weight: 380; letter-spacing: -0.012em; font-variation-settings: 'opsz' 40; }
.index-sections { display: flex; gap: 0.2rem 1.3rem; flex-wrap: wrap; padding: 0.2rem 1.75rem 0.9rem; border-bottom: 1px solid var(--hair); }
.index-sections button { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-quiet); padding: 0.45rem 0 0.3rem; border-bottom: 1px solid transparent; }
.index-sections button:hover { color: var(--ink); }
.index-sections button[aria-current='true'] { color: var(--ink); border-bottom-color: var(--mercan); }
.index-body { overflow: auto; padding: 0.4rem 1.75rem 1.75rem; scrollbar-color: var(--ink-quiet) transparent; }

/* One label grid rules every book: abbreviation, name, chapter count. */
.book-row { display: grid; grid-template-columns: 3.4rem 1fr auto; align-items: baseline; gap: 0 0.75rem; width: 100%; padding: 0.7rem 0; border-bottom: 1px solid var(--hair); text-align: left; }
.book-row:hover .book-name, .book-row[aria-expanded='true'] .book-name { text-decoration: underline; text-decoration-color: var(--mercan); text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
.book-abbr { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mercan); }
.book-name { font-size: 1.12rem; }
.book-count { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-quiet); font-variant-numeric: lining-nums tabular-nums; }
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr)); gap: 0; padding: 0.6rem 0 1rem 4.15rem; border-bottom: 1px solid var(--hair); }
.chapters button { height: 2.75rem; font-size: 1rem; font-variant-numeric: lining-nums tabular-nums; color: var(--ink); }
.chapters button:hover { background: var(--mercan-wash); }
.chapters button[aria-current='true'] { color: var(--leaf); background: var(--mercan); }

/* ---------- slips at the foot of the desk ---------- */

.slip, .listen-bar {
  position: fixed; z-index: 25; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.2rem 1.4rem; flex-wrap: wrap; justify-content: center;
  width: max-content; max-width: calc(100vw - 1.25rem);
  padding: 0.45rem 1.4rem;
  animation: lay-slip 0.5s var(--ease);
}
@keyframes lay-slip { from { transform: translate(-50%, 1.5rem) rotate(-0.8deg); opacity: 0; } }
.slip-ref, .listen-state { font-weight: 600; font-size: 0.95rem; margin-right: 0.4rem; font-variant-numeric: lining-nums; }
/* Lifted to the pointer by a right-click, the slip stands as a menu: the reference on top, one action a line. */
.slip.is-floating {
  left: 0; top: 0; bottom: auto; transform: none; z-index: 35;
  flex-direction: column; align-items: stretch; gap: 0; flex-wrap: nowrap;
  width: max-content; min-width: 13rem; max-width: min(20rem, calc(100vw - 1rem)); padding: 0.35rem 0 0.4rem;
  animation: lay-menu 0.22s var(--ease);
}
@keyframes lay-menu { from { transform: translateY(-0.3rem) scale(0.98); opacity: 0; } }
.slip.is-floating .slip-ref { margin: 0.25rem 1.1rem 0.3rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--hair); font-size: 0.85rem; }
.slip.is-floating button.cap { padding: 0.5rem 1.1rem; text-align: left; background: none; }
.slip.is-floating button.cap:hover, .slip.is-floating button.cap:focus-visible { background: var(--mercan-wash); outline: none; }
.slip.is-floating .slip-close { margin-top: 0.2rem; border-top: 1px solid var(--hair); padding-top: 0.6rem; }
.slip-close { color: var(--mercan); }
.listen-bar input[type='range'] { width: 6.5rem; }
.listen-bar .listen-seek { width: min(14rem, 30vw); }
.listen-time { font-size: 0.82rem; color: var(--ink-quiet); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.listen-bar { bottom: max(1rem, env(safe-area-inset-bottom)); }
.slip:not([hidden]) ~ .listen-bar { bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 3.6rem); }

.toast {
  position: fixed; z-index: 40; left: 50%; top: 1rem; transform: translate(-50%, calc(-100% - 2rem)); visibility: hidden;
  padding: 0.55rem 1.2rem; background: var(--leaf); color: var(--ink); font-size: 0.9rem;
  box-shadow: 0 1px 2px rgba(var(--shade), 0.5), var(--rake-x) var(--rake-y) 30px -8px rgba(var(--shade), 0.6);
  transition: transform 0.5s var(--ease), visibility 0s 0.5s; max-width: calc(100vw - 2rem); text-align: center;
}
.toast.is-up { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }

[hidden] { display: none !important; }

/* ---------- parallel: a second leaf laid beside the first ---------- */

.leaves[data-parallel='true'] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-parallel='true'] .desk { width: min(100% - 1.25rem, calc(100vw - 27rem), 86rem); }
.leaves[data-parallel='true'] .leaf { --pad: clamp(1.4rem, 2.6vw, 2.75rem); }
/* Side by side, each verse stands on its own line so it can sit beside its twin. */
.leaves[data-parallel='true'] .v { display: block; }
.leaves[data-parallel='true'] .leaf p + p { text-indent: 0; }
.leaves[data-parallel='true'] .leaf h1 { font-size: clamp(1.9rem, 1.2rem + 1.6vw, 2.7rem); }

/* ---------- narrower desks ---------- */

/* ---------- the reading plan leaf ---------- */

.plan-name { margin: -0.8rem 0 1rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-quiet); }
.plan-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; }
.plan-arrow { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-inline: -0.5rem; color: var(--ink-quiet); transition: color 0.25s var(--ease); }
.plan-arrow:hover { color: var(--ink); }
.plan-arrow:disabled { opacity: 0.3; cursor: default; }
.plan-arrow svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.plan-date { text-align: center; display: grid; gap: 0.1rem; }
.plan-date b { font-size: 1.05rem; font-weight: 500; letter-spacing: -0.005em; }
.plan-date span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mercan); }
.plan-return { display: block; margin: -0.3rem auto 1rem; }
.plan-note { margin: 0 0 0.8rem; text-align: center; font-style: italic; color: var(--ink-quiet); }
.plan-list { margin: 0 0 1rem; padding: 0; list-style: none; }
.plan-list li { display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; align-items: center; border-top: 1px solid var(--hair); }
.plan-list li:last-child { border-bottom: 1px solid var(--hair); }
.plan-check { width: 1rem; height: 1rem; border: 1px solid var(--ink-quiet); display: grid; place-content: center; transition: background 0.25s var(--ease), border-color 0.25s var(--ease); }
.plan-check[aria-pressed='true'] { border-color: var(--mercan); background: var(--mercan); }
.plan-check[aria-pressed='true']::after { content: ''; width: 0.5rem; height: 0.28rem; border: solid #fff; border-width: 0 0 1.5px 1.5px; transform: translateY(-1px) rotate(-45deg); }
.plan-go { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; width: 100%; padding: 0.75rem 0; text-align: left; font-weight: 600; }
.plan-go small { font-size: 0.78rem; font-weight: 400; color: var(--ink-quiet); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.plan-go:hover span:first-child { text-decoration: underline; text-decoration-color: var(--mercan); text-underline-offset: 0.25em; }
.plan-go[aria-current='true'] span:first-child { box-shadow: 0 0.45rem 0 -0.39rem var(--mercan); }
.plan-list li[data-read='true'] .plan-go { font-weight: 400; color: var(--ink-quiet); }
.plan-status { margin: 0 0 0.9rem; font-size: 0.88rem; color: var(--ink-quiet); font-variant-numeric: lining-nums tabular-nums; }
.plan-begin { display: block; margin-bottom: 1.2rem; }
.plan-year { margin-bottom: 0.4rem; }

/* ---------- the verse of the day: a slip laid on the desk above the leaf ---------- */

.day-slip {
  width: min(100%, calc(var(--measure) + 2 * var(--pad)));
  margin: 0 auto 1.5rem; padding: 1.5rem var(--pad) 1.35rem;
  font-size: var(--fs); /* so the measure matches the leaf's */
  background: var(--leaf); color: var(--ink);
  box-shadow: 0 1px 1.5px rgba(var(--shade), 0.55), var(--rake-x) var(--rake-y) 40px -10px rgba(var(--shade), 0.62);
  font-family: var(--face);
  animation: lay-day 0.7s var(--ease);
}
@keyframes lay-day { from { transform: translate3d(0, -1rem, 0) rotate(-0.6deg); opacity: 0; } }
.day-cap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1.5rem; margin: 0;
  color: var(--ink-quiet); font-family: var(--serif); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  font-variant-numeric: lining-nums tabular-nums;
}
.day-cap span:first-child { color: var(--mercan); }
.day-slip .leaf-rule { margin: 0.9rem 0 1.1rem; }
.day-text { margin: 0 0 1.1rem; font-size: 1.12em; line-height: 1.5; letter-spacing: var(--tracking); text-wrap: pretty; }
.day-text .line { display: block; }
.day-text .line[data-l='2'] { padding-left: 1.5em; }
.day-text .line[data-l='3'] { padding-left: 3em; }
.day-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.4rem; }
.day-ref { color: var(--mercan); }
.day-close { margin-left: auto; }

@media (max-width: 1279px) {
  /* Two leaves no longer fit side by side: they lie in a row you slide across, heights matched verse for verse. */
  .leaves[data-parallel='true'] {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc(100% - 1.6rem);
    gap: 0.7rem; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: -0.625rem; padding: 0 0.625rem 3rem; margin-bottom: -3rem; scrollbar-width: none;
  }
  .leaves[data-parallel='true']::-webkit-scrollbar { display: none; }
  .leaves[data-parallel='true'] .leaf { scroll-snap-align: center; }
}

@media (max-width: 1139px) {
  .index-rail { display: none; }
  .tool-index { display: inline-flex; }
  .top { grid-template-columns: auto minmax(0, 1fr) auto; padding-top: 0.9rem; }
  .jump-key { display: none; }
  .jump-input { padding-right: 0.2rem; }

  /* The tools become one slip of paper in the bottom margin. */
  .tools {
    left: 50%; right: auto; top: auto; bottom: max(0.625rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
    flex-direction: row; align-items: stretch; gap: 0; z-index: 15;
    width: min(calc(100vw - 1.25rem), 30rem);
    background: var(--leaf); color: var(--ink);
    box-shadow: 0 1px 1.5px rgba(var(--shade), 0.55), var(--rake-x) var(--rake-y) 30px -8px rgba(var(--shade), 0.7);
  }
  .tools { transition: transform 0.5s var(--ease), visibility 0s; }
  body.tools-away .tools, body.has-slip .tools { transform: translate(-50%, calc(100% + 2rem)); visibility: hidden; transition: transform 0.4s cubic-bezier(0.5, 0, 0.9, 0.4), visibility 0s 0.4s; }
  .tool { flex-direction: column; gap: 0.2rem; padding: 0.6rem 0.1rem 0.5rem; color: var(--ink-quiet); min-height: 3.25rem; }
  .tool:hover, .tool[aria-pressed='true'], .tool[aria-expanded='true'] { color: var(--ink); }
  .tools { padding-inline: 0.5rem; justify-content: space-between; }
  .tool { flex: 0 1 auto; padding-inline: 0.3rem; }
  .tool span { font-size: 0.6875rem; letter-spacing: 0.04em; }
  .tool :focus-visible, .tool:focus-visible { outline-color: var(--mercan); outline-offset: -3px; }
  .desk { padding-bottom: 8.5rem; width: min(100% - 1.25rem, 60rem); }
  body[data-parallel='true'] .desk { width: min(100% - 1.25rem, 60rem); }
  .slip { bottom: max(0.625rem, env(safe-area-inset-bottom)); }
  .listen-bar { bottom: calc(max(0.625rem, env(safe-area-inset-bottom)) + 4rem); transition: bottom 0.4s var(--ease); }
  body.tools-away .listen-bar { bottom: max(0.625rem, env(safe-area-inset-bottom)); }
  .slip:not([hidden]) ~ .listen-bar { bottom: calc(max(0.625rem, env(safe-area-inset-bottom)) + 6.4rem); }
  .side-leaf { left: 50%; right: auto; top: auto; bottom: calc(max(0.625rem, env(safe-area-inset-bottom)) + 4rem); transform: translateX(-50%); max-height: calc(100dvh - 7rem); animation-name: lay-side-up; }
  body.has-slip .side-leaf { bottom: calc(max(0.625rem, env(safe-area-inset-bottom)) + var(--slip-h, 4rem) + 0.5rem); max-height: calc(100dvh - var(--slip-h, 4rem) - 4rem); }
  @keyframes lay-side-up { from { transform: translate(-50%, 1.5rem) rotate(-0.8deg); opacity: 0; } }
}

@media (max-width: 719px) {
  :root { --fs: 18px; }
  /* On a phone the ground thins to a margin, so the numeral takes the top of the desk and the leaf slides over it. */
  .numeral { right: 0.09em; bottom: auto; top: 3.4rem; font-size: 118vw; line-height: 0.78; }
  .numeral[data-digits='2'] { font-size: 86vw; right: 0.06em; }
  .numeral[data-digits='3'] { font-size: 62vw; }
  .desk { padding-top: min(30vh, 15rem); }
  body.has-day .desk { padding-top: 1.25rem; }
  body.has-day .numeral { opacity: 0; }
  .day-slip { padding-inline: var(--pad); }
  .leaf p + p { text-indent: 1.2em; }
  .flag { left: -0.5rem; width: 1.7rem; }
  .flag::after { left: 0.5rem; }
  .chapters { padding-left: 0; }
  .index-head, .index-sections, .index-body { padding-inline: 1.2rem; }
  .slip { gap: 0 1.1rem; padding-inline: 1rem; }
}

@media (max-width: 419px) {
  /* Eight tools on a phone: the slip keeps every label, set a touch smaller and closer. */
  .tools { padding-inline: 0.3rem; }
  .tool { padding-inline: 0.05rem; min-width: 0; }
  .tool span { font-size: 0.6rem; letter-spacing: 0; }
}

@media (max-width: 359px) {
  /* The narrowest phones: the tools keep their icons, and their names for assistive technology, but not the room for labels. */
  .tools { padding-inline: 0.5rem; }
  .tool { padding: 0.85rem 0.3rem; }
  .tool span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tool[aria-pressed='true'], .tool[aria-expanded='true'] { color: var(--mercan); }
}

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

@media print {
  .ground, .numeral, .top, .tools, .index-rail, .pager, .slip, .listen-bar, .side-leaf, .toast { display: none !important; }
  html, body { background: #fff; }
  .desk { width: auto; padding: 0; }
  .leaf { box-shadow: none; padding: 0; }
}

/* ---------- scripture apparatus: superscriptions, divisions, poetry levels, notes ---------- */

.leaf h2 .parallel {
  display: block; margin-top: 0.3em;
  font-weight: 450; letter-spacing: 0.04em; text-transform: none; color: var(--ink-quiet);
  font-variant-numeric: lining-nums;
}
.leaf p.major {
  margin: 0 0 2.4em; text-indent: 0; text-align: center;
  font-family: var(--serif); font-size: 0.86rem; font-weight: 650; letter-spacing: 0.22em; text-transform: uppercase;
}
.leaf p.super { margin: 0 0 1.1em; text-indent: 0; font-style: italic; color: var(--ink-quiet); text-align: left; }
.leaf p.label {
  margin: 1.8em 0 0.55em; text-indent: 0; text-align: left;
  font-family: var(--serif); font-size: 0.7rem; font-weight: 650; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mercan);
}
.leaf p.super + p, .leaf p.major + p, .leaf p.label + p, .leaf h2 + p { text-indent: 0; }

.leaf .line { display: block; }
.stanza .line, .leaf p .line { padding-left: 1.4em; text-indent: -1.4em; }
.stanza .line + .line { padding-left: 1.4em; }
.leaf .line[data-l='2'] { padding-left: 2.8em; }
.leaf .line[data-l='3'] { padding-left: 4.2em; }
.leaf .line[data-l='0'] { padding-left: 0; text-indent: 0; }
.leaf .line[data-k='selah'] { text-align: right; font-style: italic; color: var(--ink-quiet); padding-left: 0; text-indent: 0; }
.leaf .line[data-k='pc'] { text-align: center; padding: 0.3em 0; text-indent: 0; letter-spacing: 0.08em; font-size: 0.92em; }

.fn {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: 0.6em; vertical-align: 0.55em; line-height: 0; color: var(--mercan);
  margin: 0 0.12em 0 0.05em; padding: 0 0.1em; cursor: pointer; user-select: none;
}
.fn:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.leaf .notes-title { margin-top: 3rem; }
.notes { margin: 0; padding: 0.4rem 0 0; list-style: none; font-size: 0.86rem; line-height: 1.5; color: var(--ink-quiet); text-align: left; }
.notes li { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0 0.3rem; padding: 0.35em 0; border-radius: 2px; }
.notes li b { font-style: italic; font-weight: 600; color: var(--mercan); }
.notes li.is-target { animation: arrive 2.4s var(--ease) 1; }
.note-ref { font-weight: 600; color: var(--ink); font-variant-numeric: lining-nums; padding: 0; }
.note-ref:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* Verso: the book's own introduction and outline. */
.leaf .verso-para { text-indent: 0; margin-bottom: 1em; }
.outline { margin: 0; padding: 0; list-style: none; }
.outline li { display: grid; grid-template-columns: 6rem 1fr; gap: 0 0.6rem; padding: 0.6em 0; border-top: 1px solid var(--hair); align-items: baseline; }
.outline li:last-child { border-bottom: 1px solid var(--hair); }
.outline button { text-align: left; color: var(--mercan); font-family: var(--serif); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; padding: 0.2em 0; font-variant-numeric: lining-nums tabular-nums; }
.outline button:hover, .outline button[aria-current='true'] { text-decoration: underline; text-underline-offset: 0.25em; }
.outline span { font-size: 0.96em; }
