.hymn-recording { margin:0 0 1.5rem; padding:1rem; border:1px solid var(--border-color, #d9e2eb); border-radius:.5rem; background:var(--surface-color, #f6f8fb); }
.hymn-recording p { margin:0 0 .5rem; font-family:var(--font-sans, sans-serif); font-size:.95rem; }
.hymn-recording audio { display:block; width:100%; max-width:100%; }
.hymn-recording audio:focus-visible, .hymn-audio-editor audio:focus-visible { outline:3px solid var(--gold-500, #bf9549); outline-offset:3px; }
.hymn-audio-editor { min-width:0; }
.hymn-audio-editor audio { display:block; width:100%; max-width:32rem; margin:.75rem 0; }
.hymn-audio-editor audio[hidden] { display:none; }
.hymn-audio-editor progress { width:100%; max-width:32rem; }
@media print { .hymn-recording, .hymn-audio-editor { display:none !important; } }

/* The music player occupies the reader's existing sticky listening row. */
.reader-audio-region.hymn-text-player { display:block; }
.hymn-text-player>.hymn-player-ui { grid-template-columns:minmax(0,1fr) auto; }
.hymn-player .hymn-player-song-link,.hymn-player-song-disabled { display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; padding:.45rem; border-radius:7px; color:#254d63; }
.hymn-player .hymn-player-song-link:hover { background:#edf3f4; }
.hymn-player .hymn-player-song-link:focus-visible { outline:3px solid #ad7c21; outline-offset:3px; }
.hymn-player-song-disabled { opacity:.35; }
.hymn-text-player .reader-listen-controls { margin-top:.5rem; }
.hymn-player { flex:1 0 100%; min-width:0; border-top:1px solid #dbe4e7; padding:.65rem .1rem .35rem; color:#173b53; font-family:system-ui,sans-serif; }
.hymn-player [hidden] { display:none!important; }
.hymn-player audio { width:100%; }
.hymn-player-ui { position:relative; display:grid; grid-template-columns:minmax(7rem,1fr) auto minmax(7rem,1fr) auto; align-items:center; gap:.6rem .6rem; }
.hymn-player-tools,.hymn-player-secondary { display:flex; align-items:center; gap:.2rem; min-width:0; }
.hymn-player-secondary>button { position:relative; width:44px; height:44px; padding:0; box-sizing:border-box; }
.hymn-player-secondary>button[aria-pressed=true] { border-color:#2a637a; background:#e9f2f5; color:#16475f; }
.hymn-player-repeat-one { position:absolute; top:0; right:0; display:grid; place-items:center; width:15px; height:15px; border-radius:50%; background:#265f75; color:#fff; font-size:10px; line-height:1; }
.hymn-player-track { display:flex; align-items:center; gap:.7rem; min-width:0; }
.hymn-player-note { flex:none; display:grid; place-items:center; width:42px; height:46px; border-radius:8px; background:#edf3f4; color:#326476; font:1.7rem Georgia,serif; border:1px solid #dce6e8; }
.hymn-player-track>div { display:flex; flex-direction:column; min-width:0; gap:.1rem; }
.hymn-player-eyebrow { font-size:.65rem; font-weight:700; letter-spacing:.13em; color:#546b77; }
.hymn-player-track strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.94rem; font-weight:650; line-height:1.35; }
.hymn-player-caption { color:#536979; font-size:.75rem; }
.hymn-player button,.hymn-player summary { -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.hymn-player button { display:inline-flex; align-items:center; justify-content:center; gap:.4rem; min-width:44px; min-height:44px; border:1px solid transparent; border-radius:7px; background:transparent; color:#254d63; padding:.45rem; cursor:pointer; font:600 .875rem/1.3 system-ui,sans-serif; }
.hymn-player button:hover,.hymn-player summary:hover { background:#edf3f4; }
.hymn-player button:disabled { opacity:.4; cursor:default; }
.hymn-player button:focus-visible,.hymn-player summary:focus-visible,.hymn-player input:focus-visible { outline:3px solid #ad7c21; outline-offset:3px; }
.hymn-player svg { flex:none; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.hymn-player-transport { display:flex; align-items:center; gap:.25rem; }
.hymn-player-transport .hymn-player-play { width:46px; height:46px; border-radius:50%; color:#fff; background:#173f57; box-shadow:0 2px 5px #173b5329; }
.hymn-player-transport .hymn-player-play:hover { background:#285b70; }
.hymn-player-play [data-play-icon] { fill:currentColor; stroke-width:1; margin-left:2px; }
.hymn-player-play [data-pause-icon] { stroke-width:4; }
.hymn-player-progress { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.55rem; min-width:0; font-size:.75rem; font-variant-numeric:tabular-nums; color:#4c6575; }
.hymn-player input[type=range] { width:100%; min-width:0; min-height:32px; padding:0; margin:0; accent-color:#2b647b; cursor:pointer; }
.hymn-player input[type=range]:disabled { cursor:default; }
.hymn-player-tools details { position:static; }
.hymn-player-tools summary { display:flex; align-items:center; justify-content:center; width:44px; height:44px; min-height:44px; padding:0; box-sizing:border-box; border:1px solid #dbe4e7; border-radius:7px; color:#254d63; cursor:pointer; list-style:none; }
.hymn-player-tools summary::-webkit-details-marker { display:none; }
.hymn-player-output[data-connected=true]>summary { border-color:#2a637a; background:#e9f2f5; }
.hymn-player-panel,.hymn-player-output-panel,.hymn-player-volume-panel,.hymn-player-queue-panel { position:absolute; z-index:2; right:0; top:calc(100% + .75rem); width:min(350px,100%); max-height:min(65vh,440px); overflow:auto; overscroll-behavior:contain; padding:1rem; box-sizing:border-box; border:1px solid #cbdadd; border-radius:12px; background:#fff; box-shadow:0 12px 35px #183b5329; }
.hymn-player-volume-panel { width:min(300px,100%); }
.hymn-player-queue-panel { width:min(360px,100%); }
.hymn-player-output-panel { width:min(320px,100%); box-sizing:border-box; }
.hymn-player-output-panel>strong { display:block; font-size:.85rem; margin-bottom:.6rem; }
.hymn-player-output-panel button { display:grid; grid-template-columns:20px minmax(0,1fr); align-items:center; gap:.65rem; text-align:left; justify-items:start; width:100%; padding:.65rem .5rem; }
.hymn-player-output-panel button small { display:block; font-size:.72rem; font-weight:400; line-height:1.4; margin-top:.2rem; }
.hymn-player-output-panel button[aria-pressed=true] { background:#e9f2f5; color:#16475f; }
.hymn-player-continue { display:flex; align-items:center; justify-content:space-between; gap:.75rem; min-height:44px; margin:0 0 .7rem; cursor:pointer; }
.hymn-player-continue>span { min-width:0; flex:1; }
.hymn-player-continue strong { display:block; font-size:.875rem; }
.hymn-player-continue small { display:block; color:#586d78; font-size:.75rem; font-weight:400; margin-top:.2rem; white-space:normal; overflow-wrap:break-word; line-height:1.4; }
.hymn-player-continue input { flex:none; appearance:none; width:40px; height:24px; border:1px solid #8799a4; border-radius:20px; background:#d7dfe3; position:relative; cursor:pointer; }
.hymn-player-continue input::after { content:''; position:absolute; left:3px; top:3px; width:16px; height:16px; border-radius:50%; background:#fff; box-shadow:0 1px 3px #0003; }
.hymn-player-continue input:checked { background:#265f75; border-color:#265f75; }
.hymn-player-continue input:checked::after { left:19px; }
.hymn-player-volume { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:.6rem; align-items:center; color:#435f6e; font-size:.8rem; margin:0; }
.hymn-player-volume output { min-width:2.6rem; font-variant-numeric:tabular-nums; text-align:right; }
.hymn-player-queue-heading { display:flex; justify-content:space-between; padding:.85rem 0 .5rem; border-top:1px solid #e0e7ea; font-size:.8rem; }
.hymn-player-queue-heading>span { color:#596f7b; }
.hymn-player-queue-panel .hymn-player-queue-heading { border:0; padding-top:0; }
.hymn-player-queue { list-style:none; margin:0; padding:0; }
.hymn-player-queue li { margin:0; }
.hymn-player-queue button { display:grid; grid-template-columns:2.6rem minmax(0,1fr) 1rem; width:100%; gap:.5rem; text-align:left; justify-content:stretch; padding:.6rem .5rem; font-weight:500; }
.hymn-player-queue button>span:first-child { font-size:.75rem; color:#5c7280; font-variant-numeric:tabular-nums; }
.hymn-player-queue button[aria-current=true] { background:#eaf2f4; color:#16485f; font-weight:700; }
.hymn-player-current { visibility:hidden; }
[aria-current=true]>.hymn-player-current { visibility:visible; }
.hymn-player-help { margin:.65rem 0 0; font-size:.75rem; line-height:1.5; color:#5a707c; }
.hymn-player-status { grid-column:1/-1; margin:.25rem 0 0; padding:.55rem .7rem; font-size:.8rem; line-height:1.4; background:#f5f2e8; border-radius:6px; color:#4d4b35; }
.library-prose>.hymn-verse-active { position:relative; background:#e9f2f5; outline:.4rem solid #e9f2f5; border-radius:.2rem; }
.library-prose>.hymn-verse-active::before { content:''; position:absolute; left:-.65rem; top:0; bottom:0; width:3px; border-radius:2px; background:#28637a; }
.hymn-lyric-line.hymn-verse-active { background:#e9f2f5; box-shadow:0 0 0 .16em #e9f2f5; border-radius:.15em; -webkit-box-decoration-break:clone; box-decoration-break:clone; }
@media print {
  .library-prose>.hymn-verse-active, .hymn-lyric-line.hymn-verse-active { background:none; outline:0; box-shadow:none; }
  .library-prose>.hymn-verse-active::before { display:none; }
}
@container library-reader (max-width:46rem) {
  .reader-toolbar:has(.hymn-player) .reader-breadcrumbs { display:flex; flex:1 0 100%; padding-inline:.2rem; }
  .reader-toolbar:has(.hymn-player) .reader-breadcrumbs a { min-height:28px; }
  .library-compact-page .reader-toolbar:has(.hymn-player) { padding:.35rem .65rem; box-sizing:border-box; }
  .hymn-text-player>.hymn-player-ui { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
  .hymn-text-player>.hymn-player-ui .hymn-player-transport { grid-row:1; grid-column:2; }
  .hymn-player-ui { width:100%; min-width:0; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:.1rem 0; }
  .hymn-player-tools { display:contents; }
  .hymn-player-secondary { grid-column:1/-1; grid-row:3; justify-self:center; gap:.5rem; }
  .hymn-player-secondary>button { width:32px; min-width:32px; height:28px; min-height:28px; }
  .hymn-player-secondary summary { width:32px; height:28px; min-height:28px; border-color:transparent; }
  .hymn-player-secondary svg { width:16px; height:16px; }
  .hymn-player-secondary details[open]>summary { border-color:#dbe4e7; background:#edf3f4; }
  .hymn-player-repeat-one { width:12px; height:12px; font-size:9px; top:-1px; right:-1px; }
  .hymn-player-track { display:none; }
  .hymn-player-note { display:none; }
  .hymn-player-eyebrow { display:none; }
  .hymn-player-options { grid-column:3; grid-row:1; justify-self:end; }
  .hymn-player-output { grid-column:1; grid-row:1; justify-self:start; }
  .hymn-player-output-panel { left:0; right:auto; }
  .hymn-player-transport { grid-column:2; grid-row:1; justify-self:center; }
  .hymn-player-progress { grid-column:1/-1; grid-row:2; width:calc(100% - .75rem); max-width:100%; justify-self:center; padding-inline:.25rem; box-sizing:border-box; margin:0; gap:.35rem; }
  .hymn-player-progress input[type=range] { max-width:100%; min-height:24px; box-sizing:border-box; }
  .hymn-player-panel,.hymn-player-output-panel,.hymn-player-volume-panel,.hymn-player-queue-panel { top:calc(100% + .5rem); max-height:min(60vh,400px); }
  .hymn-player { border:0; padding:.25rem .4rem .35rem; box-sizing:border-box; }
}
@container library-reader (max-width:23rem) {
  .hymn-player-transport { gap:0; }
  .hymn-player-transport .hymn-player-play { width:44px; height:44px; }
  .hymn-player-options>summary { padding-inline:.45rem; gap:.3rem; }
}
@media print { .hymn-player { display:none!important; } }
