/* Shared player: its dock lives outside the replaceable page <main>. */
body.has-pdf-player { padding-bottom: var(--pdf-player-space, 160px); }
.pdf-player { --player-ink: #f2eddd; --player-muted: #b4c3b8; --player-gold: #d8b86b; --player-line: #d8b86b30; position: fixed; z-index: 80; bottom: max(12px, env(safe-area-inset-bottom)); left: 20px; right: 20px; width: min(1120px, calc(100% - 40px)); margin-inline: auto; color: var(--player-ink); font-size: 14px; line-height: 1.4; font-family: inherit; text-align: left; isolation: isolate; }
.pdf-player *, .pdf-player *::before, .pdf-player *::after { box-sizing: border-box; }
.pdf-player [hidden] { display: none !important; }
.pdf-player button, .pdf-player input, .pdf-player a { -webkit-tap-highlight-color: transparent; }
.pdf-player button { font: inherit; cursor: pointer; }
.pdf-player button:disabled { opacity: .38; cursor: default; }
.pdf-player a { color: inherit; text-decoration: none; }
.pdf-player button:focus-visible, .pdf-player a:focus-visible, .pdf-player input:focus-visible { outline: 2px solid #f3d792; outline-offset: 4px; }
.pdf-player svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.pdf-player__bar { padding: 14px 18px 12px; border: 1px solid #bfa36b66; border-radius: 18px; background: linear-gradient(130deg, #183e34fa, #0b231efc); box-shadow: 0 10px 40px #00130e66, inset 0 1px #f5e1a314; backdrop-filter: blur(22px); }
.pdf-player__core { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 13px; align-items: center; }
.pdf-player__art-link { width: 48px; height: 56px; overflow: hidden; border-radius: 7px; background: #294d3e; border: 1px solid var(--player-line); }
.pdf-player__art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.pdf-player__art-fallback { display: grid; width: 100%; height: 100%; place-items: center; color: var(--player-gold); }
.pdf-player__identity { min-width: 0; display: grid; gap: 1px; }
.pdf-player__label { color: var(--player-gold); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.pdf-player__title { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 16px; line-height: 1.35; letter-spacing: -.01em; }
.pdf-player__character { display: block; color: var(--player-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-player__transport { display: flex; align-items: center; gap: 6px; }
.pdf-player__icon { width: 36px; min-width: 36px; height: 36px; display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--player-muted); transition: background .15s, color .15s; }
.pdf-player__icon:hover, .pdf-player__icon[aria-pressed="true"] { background: #f3d79212; color: var(--player-gold); }
.pdf-player__play { width: 44px; min-width: 44px; height: 44px; border: 1px solid #e2c982; border-radius: 50%; background: var(--player-gold); color: #102e24; display: grid; place-items: center; box-shadow: 0 3px 12px #00150a3d; }
.pdf-player__play:hover { background: #ecd095; }
.pdf-player__play svg { width: 21px; height: 21px; stroke-width: 2.4; }
.pdf-player[data-playing="false"] .pdf-player__play svg { transform: translateX(1px); }
.pdf-player__queue { display: flex; align-items: center; gap: 9px; border: 1px solid var(--player-line); background: #f5dc9810; color: var(--player-ink); padding: 8px 12px; border-radius: 10px; text-align: left; margin-left: 10px; }
.pdf-player__queue:hover, .pdf-player__queue[aria-expanded="true"] { border-color: #d8b86b99; background: #f5dc981a; }
.pdf-player__queue > span { font-size: 12px; line-height: 1.2; font-weight: 650; }
.pdf-player__queue small { display: block; font-size: 10px; font-weight: 400; margin-top: 2px; color: var(--player-muted); }
.pdf-player__lower { display: flex; gap: 18px; align-items: center; margin-top: 8px; }
.pdf-player__timeline { flex: 1; min-width: 0; display: grid; grid-template-columns: 34px minmax(36px, 1fr) 34px; gap: 9px; align-items: center; font-size: 10px; font-variant-numeric: tabular-nums; color: var(--player-muted); }
.pdf-player__timeline > span:last-child { text-align: right; }
.pdf-player input[type="range"] { height: 24px; margin: 0; width: 100%; cursor: pointer; accent-color: var(--player-gold); background: transparent; }
.pdf-player input[type="range"]:disabled { opacity: .3; cursor: default; }
.pdf-player__settings { display: flex; align-items: center; gap: 2px; }
.pdf-player__settings .pdf-player__icon { width: 30px; min-width: 30px; height: 30px; }
.pdf-player__settings svg { width: 17px; height: 17px; }
.pdf-player__divider { width: 1px; height: 16px; background: var(--player-line); margin: 0 7px; }
.pdf-player__volume { max-width: 66px; min-width: 46px; }
.pdf-player__repeat { position: relative; }
.pdf-player__repeat > span { position: absolute; right: 0; top: 0; background: var(--player-gold); color: #153a2a; font-size: 8px; font-weight: 800; width: 12px; height: 12px; line-height: 12px; border-radius: 50%; }
.pdf-player__status { padding: 8px 0 0; margin: 0; font-size: 11px; color: #f4d89c; }
.pdf-player__panel { border: 1px solid #bfa36b66; background: #102f27; border-radius: 18px; padding: 20px; margin-bottom: 10px; box-shadow: 0 -10px 40px #00130e50; max-height: min(65vh, 560px); overflow: auto; overscroll-behavior: contain; }
.pdf-player__panel-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pdf-player__eyebrow { color: var(--player-gold); font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.pdf-player__panel h2 { font-family: Georgia, 'Times New Roman', serif; font-size: 25px; line-height: 1.15; font-weight: 400; margin: 4px 0 0; color: var(--player-ink); }
.pdf-player__search-label { font-size: 11px; display: block; margin-bottom: 6px; color: var(--player-muted); }
.pdf-player__search { display: block; width: 100%; border: 1px solid #d8b86b4f; border-radius: 9px; color: var(--player-ink); background: #071e18; padding: 11px 13px; font: inherit; font-size: 14px; }
.pdf-player__search::placeholder { color: #90a79b; }
.pdf-player__results { margin: 12px 0 5px; color: var(--player-muted); font-size: 11px; }
.pdf-player__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
.pdf-player__list li { margin: 0; padding: 0; min-width: 0; }
.pdf-player__track { display: flex; align-items: center; width: 100%; gap: 11px; min-height: 58px; padding: 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--player-ink); text-align: left; }
.pdf-player__track:hover { background: #c5d3bb0b; border-color: var(--player-line); }
.pdf-player__track.is-current { border-color: #d8b86b59; background: #d8b86b10; }
.pdf-player__track img { flex: 0 0 32px; width: 32px; height: 42px; object-fit: cover; object-position: center 22%; border-radius: 4px; }
.pdf-player__track-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.pdf-player__track-copy strong { font-size: 12px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-player__track-copy > span { color: var(--player-muted); font-size: 10px; line-height: 1.3; }
.pdf-player__track-marker { color: var(--player-gold); padding: 3px; }
.pdf-player__track-marker svg { width: 16px; height: 16px; }
.pdf-player__empty { font-size: 13px; color: var(--player-muted); padding: 20px 0; }
.pdf-player__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 700px) {
  .pdf-player { left: 10px; right: 10px; width: calc(100% - 20px); bottom: max(8px, env(safe-area-inset-bottom)); }
  .pdf-player__bar { padding: 11px 12px 9px; border-radius: 15px; }
  .pdf-player__core { grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 9px; }
  .pdf-player__art-link { width: 36px; height: 46px; }
  .pdf-player__label { font-size: 8px; letter-spacing: .07em; }
  .pdf-player__title { font-size: 13px; }
  .pdf-player__character { font-size: 10px; }
  .pdf-player__transport { gap: 0; }
  .pdf-player__transport .pdf-player__icon { width: 30px; min-width: 30px; height: 38px; }
  .pdf-player__transport .pdf-player__icon svg { width: 16px; height: 16px; }
  .pdf-player__play { width: 38px; min-width: 38px; height: 38px; }
  .pdf-player__queue { margin: 0; width: 32px; height: 38px; justify-content: center; padding: 0; border: 0; background: transparent; }
  .pdf-player__queue > span { display: none; }
  .pdf-player__queue svg { width: 19px; height: 19px; }
  .pdf-player__lower { gap: 8px; margin-top: 8px; }
  .pdf-player__timeline { grid-template-columns: 29px minmax(32px, 1fr) 29px; gap: 5px; font-size: 9px; }
  .pdf-player__settings { gap: 0; }
  .pdf-player__settings .pdf-player__icon { width: 28px; min-width: 28px; height: 32px; }
  .pdf-player__settings svg { width: 15px; height: 15px; }
  .pdf-player__divider { margin: 0 3px; }
  .pdf-player__volume { min-width: 36px; max-width: 42px; }
  .pdf-player__panel { padding: 16px 12px; border-radius: 15px; max-height: min(60vh, 490px); }
  .pdf-player__panel h2 { font-size: 22px; }
  .pdf-player__list { grid-template-columns: minmax(0, 1fr); }
  .pdf-player__search { font-size: 16px; }
}
@media (max-width: 380px) {
  .pdf-player__core { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
  .pdf-player__art-link { display: none; }
  .pdf-player__lower { flex-wrap: wrap; justify-content: space-between; gap: 0; }
  .pdf-player__timeline { flex-basis: 100%; }
  .pdf-player__settings { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .pdf-player * { transition: none !important; } }
