/* Reader controls (2026-11-20): chapter heading row with Listen + edition info, compact floating autoscroll control,
   verse-selection bar centred on the reading pane with action icons. Variables --reading-pane-* come from
   initReadingPaneMetrics() (components/ReaderControls.tsx). */

/* 6. No breadcrumb (kept out of the markup; this also covers cached pages). */
.reader-breadcrumb { display:none !important; }

/* 4 + 5. Chapter heading row: title, edition information, Listen. */
.chapter-heading-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px 10px; }
.chapter-heading-row > h1 { flex:1 1 auto; min-width:0; margin-right:auto; }
.chapter-listen { display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:6px 14px 6px 12px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--ink); font:600 14px/1 system-ui,-apple-system,sans-serif; cursor:pointer; flex-shrink:0; }
/* one width for Listen / Pause (Escuchar / Pausar): toggling never re-wraps the heading row */
.chapter-listen { min-width:8.4em; justify-content:center; }
.chapter-listen:hover { background:var(--soft); }
.chapter-listen:focus-visible, .edition-info-button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.chapter-listen[aria-pressed="true"] { background:var(--accent); border-color:var(--accent); color:#fff; }
.chapter-listen[data-state="paused"]::after { content:""; width:6px; height:6px; border-radius:50%; background:var(--accent); }
.edition-info { display:contents; }
.edition-info-button { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--muted); cursor:pointer; flex-shrink:0; }
.edition-info-button:hover, .edition-info-button[aria-expanded="true"] { background:var(--soft); color:var(--accent); }
.edition-info-panel { order:10; flex-basis:100%; margin:2px 0 10px; font:14px/1.55 system-ui,-apple-system,sans-serif; color:var(--ink); padding:10px 12px; border-left:3px solid var(--gold,var(--accent)); background:var(--surface); border-radius:0 8px 8px 0; }
.edition-info-panel[hidden] { display:none; }
.continuous-passages>[data-passage-chapter]+[data-passage-chapter] .edition-info { display:none; }
@media(max-width:899px){ .chapter-heading-row { margin:0 0 22px; } .chapter-heading-row > h1 { margin:0; } .chapter-listen { padding:6px 12px 6px 10px; } }

/* 1. Autoscroll: a compact floating control (docked portal) over the reading pane instead of a full-width row. */
.playback-dock [data-chapter-listen] { display:none !important; }        /* Listen now lives beside the chapter heading */
.playback-dock .playback-dock-controls { gap:2px; }
.playback-dock .playback-dock-controls span { flex:0 0 auto; }
.playback-dock .autoscroll-toggle, .playback-dock .autoscroll-speed { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.playback-dock .autoscroll-toggle[aria-pressed="true"] { color:var(--accent); font-weight:600; }
.playback-dock .autoscroll-speed { font-size:12px !important; opacity:.8; font-variant-numeric:tabular-nums; }
.playback-dock:not(:has(.audio-position)):not(:has(> div:not([hidden]) > .speech-player)) { border-radius:999px; }
@media(min-width:900px){
 .playback-dock { left:var(--reading-pane-center,50%); right:auto; transform:translateX(-50%); bottom:20px; width:max-content;
   max-width:min(520px, calc(var(--reading-pane-width,100vw) - 32px)); padding:3px 6px; }
 .playback-dock:has(.audio-position), .playback-dock:has(> div:not([hidden]) > .speech-player) { width:min(460px, calc(var(--reading-pane-width,100vw) - 32px)); padding:7px 10px; border-radius:18px; }
 .playback-dock .playback-settings { left:50%; right:auto; transform:translateX(-50%); width:min(360px, calc(var(--reading-pane-width,100vw) - 32px)); }
 body:has(.playback-dock:not([hidden])) .reading-layout { padding-bottom:84px; }
}
@media(max-width:899px){
 .playback-dock:not(:has(.audio-position)):not(:has(> div:not([hidden]) > .speech-player)) { left:auto; right:12px; width:max-content; max-width:calc(100vw - 24px); padding:2px 4px; }
}

/* 2 + 3. Verse selection bar: centred on the reading pane, clear of the Study pane; small icons above the labels. */
@media(min-width:900px){
 .selection-dock { left:var(--reading-pane-center, calc(50% + 102px)); max-width:calc(var(--reading-pane-width, calc(100vw - 240px)) - 24px); }
}
.selection-dock .selection-controls { overflow:hidden; }
.selection-dock .selection-controls > button { flex-shrink:0; }   /* real widths, so the fit logic can move what does not fit under More */
/* display stays with the existing rules (the fit logic shows/hides [data-sel] copies); only the layout changes */
.selection-dock .selection-controls > button:not([data-sel]):has(> .selection-icon) { display:inline-flex; }
.selection-dock .selection-controls > button:has(> .selection-icon) { flex-direction:column; align-items:center; justify-content:center; gap:2px; min-width:52px; padding:5px 8px; font-size:12px; line-height:1.15; white-space:nowrap; }
.selection-dock .selection-popover > button > .selection-icon { vertical-align:-5px; margin-right:10px; }
.selection-dock .selection-icon { flex-shrink:0; }
