/* ============================================================================
   Reader and audiobook player — TZ 4.2.2б / 4.2.2в / 4.2.2г.

   Every display setting is a token on .reader, so the script only ever writes
   custom properties and data attributes. The colour theme goes one level up:
   html[data-reader-theme] remaps the portal palette itself, so the masthead,
   the cards at the end of the tale and the panels all follow the reader into
   sepia or dark instead of sitting on it as paper-coloured blocks.
   ========================================================================= */

html[data-reader-theme="sepia"] {
  --paper: #F6EDDD; --paper-alt: #EFE3CF; --paper-warm: #E9DCC5; --white: #FCF5E8;
  --ink: #3B3227; --ink-soft: #4E4335; --muted: #6B5C48; --faint: #766753;
  --line: #E3D6BF; --line-strong: #D9CAB1; --sand: #BFAD92; --accent-wash: #F6E2D4;
}
html[data-reader-theme="dark"] {
  --paper: #1C1917; --paper-alt: #221E1B; --paper-warm: #2A2522; --white: #262220;
  --ink: #E8E1D8; --ink-soft: #D6CDC2; --muted: #ABA297; --faint: #9A9186;
  --line: #3A342F; --line-strong: #47403A; --sand: #5E554D;
  --accent-deep: #F58A7F; --accent-wash: #3E2A26;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4); --shadow: 0 10px 30px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  color-scheme: dark;
}
html[data-reader-theme="dark"] .footer { background: #100E0D; }
html[data-reader-theme="dark"] .btn--primary { color: #fff; }
html[data-reader-theme="dark"] .pagination .current { color: #1C1917; }

/* ------------------------------------------------------------------ tokens */
.reader {
  --r-size: 100%;
  --r-leading: 1.75;
  --r-width: 38rem;
  --r-font: var(--font-serif);
  --rd-bar-h: 56px;
  --rd-player-h: 0px;
  position: relative;
  background: var(--paper);
  color: var(--ink);
  padding-bottom: calc(3rem + var(--rd-player-h));
  transition: padding-bottom .4s cubic-bezier(.2,.8,.2,1);
}
.reader.has-player { --rd-player-h: 7.5rem; }
.reader[data-font="serif"]   { --r-font: var(--font-reading-serif); }
.reader[data-font="sans"]    { --r-font: var(--font-ui); }
.reader[data-font="legible"] { --r-font: "Atkinson Hyperlegible", var(--font-ui); }
.reader[data-leading="tight"] { --r-leading: 1.55; }
.reader[data-leading="loose"] { --r-leading: 1.95; }
.reader[data-width="narrow"] { --r-width: 32rem; }
.reader[data-width="wide"]   { --r-width: 46rem; }

/* ------------------------------------------------------------- reading bar */
.reader__bar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .reader__bar { background: var(--paper); }
}
.reader__bar-inner {
  position: relative; max-width: var(--wrap); margin: 0 auto;
  padding: .5rem 1.5rem; min-height: var(--rd-bar-h);
  display: flex; align-items: center; gap: .5rem;
}
.reader__bar-title {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: .625rem;
}
.reader__bar-name {
  font-family: var(--font-serif); font-weight: 500; font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(4px);
  transition: opacity .3s ease, transform .3s ease;
}
/* the title only rises into the bar once the real heading has scrolled away */
.reader.is-scrolled .reader__bar-name { opacity: 1; transform: none; }
.reader__bar-pct {
  font-size: .75rem; color: var(--faint); font-variant-numeric: tabular-nums;
  flex: none;
}
.reader__tools { display: flex; align-items: center; gap: .125rem; flex: none; }

.rd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-width: 40px; min-height: 40px; padding: 0 .5rem; border-radius: 9px;
  border: 0; background: transparent; color: var(--ink); cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 500; text-decoration: none;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.rd-btn:hover { background: var(--paper-warm); text-decoration: none; }
.rd-btn:active { transform: scale(.94); }
.rd-btn[aria-expanded="true"], .rd-btn[aria-pressed="true"] {
  background: var(--ink); color: var(--paper);
}
.rd-btn--listen[aria-pressed="true"] { background: var(--accent); color: #fff; }
.rd-btn__label { display: none; }
@media (min-width: 900px) { .rd-btn__label { display: inline; } }
.rd-btn--close { min-width: 32px; min-height: 32px; font-size: 1.25rem; line-height: 1;
                 color: var(--muted); margin-left: auto; }
#rd-mark[aria-pressed="true"] .rd-mark-shape { fill: currentColor; }

/* thin progress line along the bottom edge of the bar */
.reader__progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: transparent; pointer-events: none;
}
.reader__progress span {
  display: block; height: 100%; width: 100%; background: var(--accent);
  transform: scaleX(var(--rd-progress, 0)); transform-origin: left center;
  transition: transform .2s ease-out;
}

/* ----------------------------------------------------------------- panels */
.reader__panel {
  position: absolute; right: max(1.5rem, calc((100% - var(--wrap)) / 2 + 1.5rem));
  top: calc(100% + .5rem); z-index: 41;
  width: min(24rem, calc(100vw - 2rem));
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 1rem 1.125rem 1.125rem;
  max-height: calc(100vh - var(--rd-bar-h) - 1.5rem); overflow-y: auto;
  animation: rd-panel-in .22s cubic-bezier(.2,.8,.2,1) both;
}
.reader__panel[hidden] { display: none; }
@keyframes rd-panel-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.reader__panel-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.reader__panel-head .eyebrow { margin: 0; }
.reader__panel-note { margin: 1rem 0 0; }

.reader__toc { margin: 0; padding-left: 1.25rem; }
.reader__toc li { margin-bottom: .375rem; }
.reader__toc a { color: var(--ink); }
.reader__toc a.is-current { color: var(--accent-deep); font-weight: 600; }
.reader__marks { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .375rem; }
.reader__marks li { display: flex; gap: .5rem; align-items: flex-start; }
.reader__marks a {
  flex: 1; color: var(--ink); font-size: .875rem; line-height: 1.4;
  font-family: var(--font-serif); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.reader__marks a::before { content: "❝ "; color: var(--accent); }
.reader__marks a:hover { color: var(--accent-deep); }
.reader__marks .rd-btn--close { margin: 0; }
.reader__marks-empty { font-size: .8125rem; color: var(--faint); margin: .25rem 0 0; }

/* settings */
.rd-set { display: grid; grid-template-columns: 7.5rem 1fr; align-items: center;
          gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.rd-set:first-of-type { border-top: 0; }
.rd-set__label { font-size: .8rem; font-weight: 500; color: var(--muted); }
.rd-seg {
  display: inline-flex; background: var(--paper-alt); border-radius: 9px; padding: 3px;
  gap: 2px;
}
.rd-seg button, .rd-stepper button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: .8125rem; font-weight: 500;
  min-height: 34px; min-width: 34px; padding: 0 .625rem; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; gap: .125rem;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.rd-seg button:hover { color: var(--ink); }
.rd-seg button[aria-pressed="true"] {
  background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm);
}
.rd-stepper { display: inline-flex; align-items: center; gap: .25rem; }
.rd-stepper button { background: var(--paper-alt); font-family: var(--font-serif);
                     font-size: .95rem; }
.rd-stepper button span { font-size: .7rem; font-family: var(--font-ui); }
.rd-stepper button:hover { background: var(--paper-warm); color: var(--ink); }
.rd-stepper output { min-width: 3.25rem; text-align: center; font-size: .8125rem;
                     font-variant-numeric: tabular-nums; color: var(--ink); }
.rd-swatches { display: inline-flex; gap: .5rem; }
.rd-swatch {
  width: 44px; height: 36px; border-radius: 9px; cursor: pointer;
  font-family: var(--font-serif); font-size: .9rem;
  border: 1.5px solid var(--line-strong); transition: border-color .15s, transform .15s;
}
.rd-swatch:hover { transform: translateY(-1px); }
.rd-swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }
.rd-swatch--light { background: #FAF6EF; color: #2C2622; }
.rd-swatch--sepia { background: #F6EDDD; color: #3B3227; }
.rd-swatch--dark  { background: #1C1917; color: #E8E1D8; }

/* ------------------------------------------------------------------- text */
.reader__surface { padding: 2rem 1.5rem 0; }
.reader__text {
  max-width: var(--r-width); margin: 0 auto;
  font-family: var(--r-font); font-size: var(--r-size); line-height: var(--r-leading);
  animation: rd-rise .5s ease both;
}
@keyframes rd-rise { from { opacity: 0; } }
.reader__head { text-align: center; margin: 1.5rem 0 2.5rem; }
.reader__head h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin: .25rem 0 .5rem; }
.reader__meta { font-family: var(--font-ui); font-size: .8125rem; color: var(--faint);
                display: flex; gap: .5rem; justify-content: center; margin: 0; }
.reader__text h2 { font-size: 1.35em; margin: 2.5rem 0 1rem; text-align: center; }
.reader__chapter { scroll-margin-top: calc(var(--rd-bar-h) + 1rem); }

.reader__p {
  position: relative;
  font-size: 1.125em;
  margin: 0 0 1em;
  padding: .1em .5em; margin-inline: -.5em;
  border-radius: 8px;
  scroll-margin-top: 30vh;
  text-wrap: pretty;
  hyphens: auto;
  transition: background-color .3s ease, box-shadow .3s ease;
  cursor: text;
}
.reader__p:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
/* opening initial — the one flourish the paper gets. A span rather than
   ::first-letter: the modifier in «Oʻtgan» is a letter, not punctuation, so
   ::first-letter would leave it stranded on the line below. */
.reader__cap {
  float: left; font-size: 3.1em; line-height: .82; padding: .08em .12em 0 0;
  font-weight: 500; color: var(--accent);
}
.reader__ornament { display: flex; align-items: center; justify-content: center;
                    gap: .75rem; margin: 2.25rem 0; }
.reader__ornament::before, .reader__ornament::after {
  content: ""; width: 2.5rem; height: 1px; background: var(--line-strong);
}
.reader__ornament i { width: 8px; height: 8px; border: 1.5px solid var(--sand);
                      transform: rotate(45deg); }
.reader__ornament--end { margin-top: 3rem; }

/* narration: the paragraph being read and, where the timing exists, the word */
.reader.is-listening .reader__p { cursor: pointer; }
.reader__p.is-playing {
  background: var(--accent-wash);
  box-shadow: inset 3px 0 0 var(--accent);
}
.rd-w { border-radius: 3px; transition: background-color .12s ease, color .12s ease; }
.rd-w.is-word { background: var(--accent); color: #fff; }
.reader__p.is-bookmarked::before {
  content: ""; position: absolute; left: -1.25rem; top: .55em;
  width: 8px; height: 12px; background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%);
}

/* end of the tale */
.reader__end { text-align: center; margin-top: 1rem; }
.reader__fin {
  font-family: var(--font-serif); font-style: italic; font-size: 1.05em;
  color: var(--muted); margin: 1rem 0 .5rem; letter-spacing: .12em; text-transform: uppercase;
}
.reader__source { font-family: var(--font-ui); margin: 0; }
.reader__source a { color: var(--accent-deep); }
.reader__after { margin-top: 3.5rem; padding: 2.5rem 0 0; border-top: 1px solid var(--line); }
.reader__after .wrap { padding: 0; max-width: 56rem; }
@media (max-width: 640px) { .reader__related { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------ paged mode */
.reader.is-paged .reader__surface {
  height: calc(100vh - var(--rd-bar-h) - 3.5rem - var(--rd-player-h));
  height: calc(100dvh - var(--rd-bar-h) - 3.5rem - var(--rd-player-h));
  overflow: hidden; padding-top: 1.5rem;
  touch-action: pan-y; user-select: text;
  /* only the current page shows — the neighbouring columns are clipped */
  clip-path: inset(0 calc((100% - var(--rd-page-w, 100%)) / 2 - 2px));
}
.reader.is-paged .reader__text {
  --rd-gap: 3rem;
  width: var(--rd-page-w, 100%); max-width: var(--r-width); height: 100%;
  column-width: var(--rd-page-w, 100%); column-gap: var(--rd-gap); column-fill: auto;
  transform: translateX(calc(var(--rd-page, 0) * -1 * (var(--rd-page-w) + var(--rd-gap))));
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  animation: none;
}
.reader.is-paged .reader__head { margin-top: 0; }
.reader.is-paged .reader__after { display: none; }
.reader.is-paged .reader__p { break-inside: avoid; }
.reader.is-paged .reader__head { break-after: avoid; }
.reader__pager {
  position: fixed; left: 0; right: 0; bottom: var(--rd-player-h, 0px); z-index: 39;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  height: 3.5rem; background: var(--paper); border-top: 1px solid var(--line);
  transition: bottom .4s cubic-bezier(.2,.8,.2,1);
}
.reader__pager[hidden] { display: none; }
.reader__pager-count { font-size: .8125rem; color: var(--faint); min-width: 6rem;
                       text-align: center; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------- return pill and toast */
.reader__return, .reader__toast {
  position: fixed; left: 50%; z-index: 45;
  bottom: calc(var(--rd-player-h, 0px) + 1.25rem);
  transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  border-radius: 99px; padding: .5rem 1rem; font-size: .8125rem; font-weight: 500;
  box-shadow: var(--shadow-lg); border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4rem;
  animation: rd-pill-in .3s cubic-bezier(.2,.8,.2,1) both;
  font-family: var(--font-ui);
}
.reader__return[hidden], .reader__toast[hidden] { display: none; }
.reader__return:hover { background: var(--accent); color: #fff; }
.reader__toast { cursor: default; pointer-events: none; }
.reader__toast a, .reader__toast button {
  pointer-events: auto; color: inherit; text-decoration: underline; background: none;
  border: 0; font: inherit; cursor: pointer; padding: 0;
}
html[data-reader-theme="dark"] .reader__return,
html[data-reader-theme="dark"] .reader__toast { background: #F3EADD; color: #1C1917; }
@keyframes rd-pill-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ------------------------------------------------------------ word popup */
.word-pop {
  position: fixed; z-index: 60; width: min(22rem, calc(100vw - 2rem));
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .875rem 1rem;
  font-family: var(--font-ui); font-size: 1rem; line-height: 1.5;
  animation: rd-panel-in .18s cubic-bezier(.2,.8,.2,1) both;
}
.word-pop[hidden] { display: none; }
.word-pop__head { display: flex; align-items: baseline; gap: .5rem; }
.word-pop__head strong { font-family: var(--font-serif); font-size: 1.15rem; }
.word-pop__lemma { font-family: var(--font-serif); font-size: 1rem; color: var(--muted); }
.word-pop__lemma[hidden] { display: none; }
.word-pop__gloss { margin: .375rem 0 0; font-size: .9375rem; }
.word-pop__foot { display: flex; justify-content: space-between; gap: .75rem;
                  margin-top: .5rem; align-items: baseline; }
.word-pop__listen { margin-top: .75rem; width: 100%; }
.word-pop__listen[hidden] { display: none; }
.word-pop.is-loading .word-pop__gloss { min-height: 1rem; border-radius: 4px;
  background: linear-gradient(90deg, var(--line) 25%, var(--paper-warm) 37%, var(--line) 63%);
  background-size: 400% 100%; animation: rd-shimmer 1.4s ease-in-out infinite; color: transparent; }
.word-pop.is-loading .word-pop__foot { visibility: hidden; }
@keyframes rd-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* --------------------------------------------------------------- player */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  --pl-bg: #211D1A; --pl-fg: #F3EADD; --pl-dim: #B7AC9F; --pl-line: rgba(255,255,255,.14);
  background: var(--pl-bg); color: var(--pl-fg);
  border-top: 1px solid var(--pl-line);
  box-shadow: 0 -12px 32px rgba(0,0,0,.18);
  transform: translateY(105%); visibility: hidden;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), visibility 0s linear .4s;
  font-family: var(--font-ui);
}
.player.is-open { transform: none; visibility: visible; transition-delay: 0s; }
html[data-reader-theme="dark"] .player,
:root[data-theme="dark"]:not([data-reader-theme]) .player { --pl-bg: #100E0D; }
.player__inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: .75rem 1.5rem calc(.75rem + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas:
    "who transport extras"
    "timeline timeline timeline";
  align-items: center; gap: .5rem 1rem;
}
.player__who { grid-area: who; display: flex; align-items: center; gap: .75rem; min-width: 0; }
.player__cover { width: 44px; height: 59px; object-fit: cover; border-radius: 5px; flex: none;
                 box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.player__meta { display: flex; flex-direction: column; min-width: 0; gap: .125rem; }
.player__title { font-family: var(--font-serif); font-weight: 500; font-size: .95rem;
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__narrator { font-size: .75rem; color: var(--pl-dim); display: flex; align-items: center;
                    gap: .5rem; flex-wrap: wrap; }
.player__narrator select {
  background: transparent; color: var(--pl-fg); border: 1px solid var(--pl-line);
  border-radius: 6px; padding: .2rem .4rem; font: inherit; min-height: 30px; max-width: 14rem;
}
.player__narrator select option { color: #2C2622; }
.player__synthetic {
  font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--pl-line); border-radius: 99px; padding: .1rem .5rem; color: var(--pl-dim);
  cursor: help;
}

.player__transport { grid-area: transport; display: flex; align-items: center; gap: .5rem; }
.player__skip {
  width: 44px; height: 44px; border-radius: 99px; border: 0; background: transparent;
  color: var(--pl-fg); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, transform .15s ease;
}
.player__skip:hover { background: rgba(255,255,255,.08); }
.player__skip:active { transform: scale(.92); }
.player__play {
  position: relative; width: 56px; height: 56px; flex: none; border-radius: 99px;
  border: 0; background: var(--accent); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background-color .15s ease, box-shadow .2s ease;
  box-shadow: 0 6px 18px rgba(251,73,59,.35);
}
.player__play:hover { background: #E23B2E; }
.player__play:active { transform: scale(.94); }
.pl-ico-pause { display: none; }
.player.is-playing .pl-ico-play { display: none; }
.player.is-playing .pl-ico-pause { display: block; }
.player__spinner {
  position: absolute; inset: -3px; border-radius: 99px; display: none;
  border: 2px solid transparent; border-top-color: #fff; animation: rd-spin .8s linear infinite;
}
.player.is-waiting .player__spinner { display: block; }
.player.is-waiting .player__play-icon { opacity: .5; }
@keyframes rd-spin { to { transform: rotate(360deg); } }

.player__extras { grid-area: extras; display: flex; align-items: center; justify-content: flex-end;
                  gap: .375rem; }
.player__chip {
  min-height: 36px; min-width: 44px; padding: 0 .625rem; border-radius: 99px;
  border: 1px solid var(--pl-line); background: transparent; color: var(--pl-fg);
  font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
  transition: background-color .15s ease, border-color .15s ease;
}
.player__chip:hover { background: rgba(255,255,255,.08); }
.player__chip--icon { min-width: 36px; padding: 0; width: 36px; }
.player__chip[aria-pressed="true"] { background: var(--pl-fg); color: var(--pl-bg); border-color: var(--pl-fg); }
.player__chip[aria-pressed="false"] { color: var(--pl-dim); }
.player__vol { display: inline-flex; align-items: center; gap: .375rem; color: var(--pl-dim);
               padding: 0 .375rem; }
.player__vol input { width: 5.5rem; accent-color: var(--pl-fg); }

.player__timeline { grid-area: timeline; display: flex; align-items: center; gap: .75rem; }
.player__time { font-size: .75rem; color: var(--pl-dim); font-variant-numeric: tabular-nums;
                min-width: 2.75rem; }
.player__time--end { text-align: right; }
.player__seek {
  --pl-played: 0%; --pl-buffered: 0%;
  flex: 1; -webkit-appearance: none; appearance: none; height: 28px; background: transparent;
  margin: 0; cursor: pointer;
}
.player__seek::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right,
    var(--accent) var(--pl-played), rgba(255,255,255,.35) var(--pl-played),
    rgba(255,255,255,.35) var(--pl-buffered), rgba(255,255,255,.14) var(--pl-buffered));
}
.player__seek::-moz-range-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right,
    var(--accent) var(--pl-played), rgba(255,255,255,.35) var(--pl-played),
    rgba(255,255,255,.35) var(--pl-buffered), rgba(255,255,255,.14) var(--pl-buffered));
}
.player__seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 99px;
  background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.4);
  transition: transform .15s ease;
}
.player__seek:hover::-webkit-slider-thumb, .player__seek:active::-webkit-slider-thumb { transform: scale(1.25); }
.player__seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 99px; background: #fff; border: 0; }
.player__seek:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.player__status { grid-column: 1 / -1; margin: 0; color: #F5A79F; }
.player__status[hidden] { display: none; }

/* -------------------------------------------------------------- narrow */
@media (max-width: 760px) {
  .reader__bar-inner { padding-inline: .75rem; gap: .25rem; }
  .reader__bar-pct { display: none; }
  .reader__panel { right: .75rem; left: .75rem; width: auto; }
  .rd-set { grid-template-columns: 1fr; gap: .375rem; }
  .rd-set--width { display: none; }              /* one column on a phone anyway */
  .reader__surface { padding: 1.25rem 1.125rem 0; }
  .reader__p { padding-inline: .25em; margin-inline: -.25em; }
  .reader__p.is-bookmarked::before { left: -.9rem; }
  .reader.has-player { --rd-player-h: 9.5rem; }

  .player__inner {
    padding-inline: 1rem; gap: .5rem .75rem;
    grid-template-columns: 1fr auto; grid-template-areas:
      "who extras"
      "timeline timeline"
      "transport transport";
  }
  .player__transport { justify-content: center; gap: 1.5rem; }
  .player__vol { display: none; }              /* phones have volume keys */
  .player__title { font-size: .875rem; }
  .player__cover { width: 36px; height: 48px; }
  /* one line under the title: the narrator trimmed, the badge kept */
  .player__narrator { flex-wrap: nowrap; }
  .player__narrator > span:not(.player__synthetic) {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  }
  .player__synthetic { flex: none; }
}

/* ------------------------------------------------------------ focus mode */
html.rd-focus .masthead, html.rd-focus .footer { display: none; }

@media (prefers-reduced-motion: reduce) {
  .reader__text, .reader__panel, .word-pop, .reader__return, .reader__toast { animation: none; }
  .reader.is-paged .reader__text { transition: none; }
  .player { transition: none; }
}

@media print {
  .reader__bar, .player, .reader__after, .reader__pager, .reader__return { display: none; }
  .reader__p { break-inside: avoid; }
}
