/* CONTROLS-REFRESH-01 (seat A3, 21 Oct 2026; DESIGN-SPEC component 9): THE READING PAGES' RECITATION PANEL. Loaded only by
   _audio.html, after audio-player.css, which /listen also loads and which this file therefore leaves as it is: every rule here
   is on the panel's own rp-* classes, or on .au-bar / .au-src / .au-range where the panel must beat audio-player.css.
   The panel floats at the foot of the page while it plays (sticky, as before: it hides nothing the reader scrolls to), clear of
   the iPhone's home indicator (env(safe-area-inset-bottom), which is 0 everywhere else) and of the verse page's fixed
   previous/next bar. Colours, radii and shadows are the kit's (controls.css). */
/* CONTROLS-REFRESH-02 item 2: FIXED, NOT STICKY. The panel stands over the foot of the screen wherever it sits in the page, and the
   page is given bottom padding equal to the room it takes (html.rp-on, --rp-room, set by audio-player.js from the panel's measured top),
   so the last line of text scrolls clear of it; the same room is the page's scroll-padding, so a verse brought into view (the verse
   playing, or the verse name pressed) stops above the panel, not under it. */
.au-bar.rp-panel{
  position:fixed; left:12px; right:12px; bottom:max(12px, calc(env(safe-area-inset-bottom, 0px) + 6px)); z-index:20;
  display:flex; flex-direction:column; gap:12px; box-sizing:border-box;
  width:auto; max-width:60rem; margin:0 auto; padding:14px 20px;
  background:var(--paper-raised); border:1px solid var(--ctl-edge); border-radius:22px; box-shadow:var(--ctl-shadow-panel);
  font-family:var(--ctl-font); color:var(--ink);
}
.au-bar.rp-panel[hidden]{ display:none; }
/* the verse page keeps its fixed previous/next pair at the very bottom (redesign.css .rd-vnav, 3.25rem + 1rem + 1px tall) */
body:has(.rd-vnav) .au-bar.rp-panel{ bottom:calc(3.25rem + 1rem + 1px + 8px + env(safe-area-inset-bottom, 0px)); }

html.rp-on body{ padding-bottom:var(--rp-room, 0px); }
html.rp-on{ scroll-padding-bottom:var(--rp-room, 0px); scroll-padding-top:var(--rp-top, 0px); }   /* --rp-top: the sticky progress line */

.rp-row{ display:flex; align-items:center; gap:18px; min-width:0; }
.rp-transport{ display:flex; align-items:center; gap:6px; flex:none; }
.rp-transport .ctl-btn--bare{ color:var(--ink); }
/* item 6: Stop carries the same weight as Previous and Next - the same ink, and its square drawn as an outline at their stroke. */
.rp-transport [data-au-stop]{ color:var(--ink); }
.rp-transport [data-au-stop] svg{ fill:none; stroke:currentColor; stroke-width:2; stroke-linejoin:round; }
.rp-now{ flex:1 1 10rem; min-width:0; display:flex; flex-direction:column; gap:6px; }
.rp-now-line{ display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:2px 12px; }
.rp-panel .au-status{ flex:0 1 auto; min-width:0; font-size:.8125rem; font-weight:600; color:var(--ink); white-space:normal; }
/* item 3: the verse playing is a button - pressing it scrolls to the verse. Drawn as the kit's link (a green underline), 44 px tall. */
.rp-goto{ display:inline-flex; align-items:center; flex:0 1 auto; min-width:0; min-height:var(--ctl-hit, 44px); margin:0; padding:0 4px;
  border:0; border-radius:8px; background:none; font:inherit; color:var(--ink); text-align:start; cursor:pointer;
  -webkit-tap-highlight-color:transparent; }
.rp-goto:not([disabled]) .au-status{ color:var(--ctl-accent); text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:.2em; }
.rp-goto:not([disabled]):hover .au-status{ text-decoration-thickness:2px; }
.rp-goto[disabled]{ cursor:default; }
.rp-goto:focus-visible{ outline:2px solid var(--ctl-ring); outline-offset:2px; }
/* item 2: the minimise button, last in the row; its chevron points down while the panel is open and up once it is folded. */
.rp-min{ order:20; flex:none; margin-left:auto; color:var(--ctl-muted); }
.rp-min svg{ width:20px; height:20px; transition:transform .15s; }
.rp-min[aria-expanded="false"] svg{ transform:rotate(180deg); }
@media (prefers-reduced-motion:reduce){ .rp-min svg{ transition:none; } }
/* THE SLIM BAR: Play/Pause, the verse playing and the button that opens the panel again; everything else waits. */
.au-bar.rp-panel[data-au-folded]{ gap:0; padding:6px 10px 6px 8px; border-radius:999px; }
.au-bar.rp-panel[data-au-folded] .rp-row{ gap:8px; }
.au-bar.rp-panel[data-au-folded] .rp-transport > :not([data-au-pause]),
.au-bar.rp-panel[data-au-folded] .rp-time, .au-bar.rp-panel[data-au-folded] .rp-prog, .au-bar.rp-panel[data-au-folded] .rp-more,
.au-bar.rp-panel[data-au-folded] .rp-reciter, .au-bar.rp-panel[data-au-folded] .rp-opts{ display:none; }
.au-bar.rp-panel[data-au-folded] .ctl-play{ width:44px; height:44px; box-shadow:none; }
.au-bar.rp-panel[data-au-folded] .ctl-play svg{ width:18px; height:18px; }
.au-bar.rp-panel[data-au-folded] .rp-now{ flex:1 1 0; }
.rp-time{ font:400 .8125rem/1.2 var(--f-mono, monospace); color:var(--ctl-muted); font-variant-numeric:tabular-nums; }
.rp-prog{ height:4px; border-radius:4px; background:var(--paper-inset); overflow:hidden; }
.rp-prog > span{ display:block; width:0; height:100%; background:var(--ctl-accent); }
/* item 3: THE VERSE PLAYING, in the controls' green - a soft green ground, its edge the green ring (it replaces audio-player.css's
   madder outline on the reading pages; /listen, which also loads that file, is not touched). */
:root [data-au-on]{ outline:2px solid var(--ctl-accent); outline-offset:6px; border-radius:12px;
  background-color:var(--ctl-accent-soft); box-shadow:0 0 0 6px var(--ctl-accent-soft); }
@media (forced-colors:active){ :root [data-au-on]{ outline-color:Highlight; } }

/* The reciter: the FULL name wraps to a second line and is never cut (Anwar, 21 Oct 2026). */
.rp-reciter{ flex:0 1 20rem; min-width:12rem; }

.rp-opts{ flex-wrap:wrap; gap:10px 28px; padding-top:12px; border-top:1px solid var(--ctl-hair); }
.rp-range{ display:inline-flex; align-items:center; gap:8px; font-size:.8125rem; color:var(--ctl-muted); }
.rp-range[hidden]{ display:none; }
.rp-field{ display:inline-flex; align-items:center; gap:8px; }
/* Sources: the kit's quiet expander. audio-player.css draws .au-src's summary as a 24 px list item; the panel's is 44 px. */
.rp-src{ margin:0 0 0 auto; font-size:inherit; }
.rp-src > summary{ display:inline-flex; width:auto; min-height:44px; font-size:var(--t-xs); }   /* the site's smallest muted text (16 Oct rule) */
.rp-src[open]{ flex-basis:100%; margin-left:0; }
.rp-src .au-credit{ margin:0 4px 4px; font-size:var(--t-xs); line-height:1.4; color:var(--ink-soft); }

/* PHONE (below 640 px): row 1 is the transport and the status; the reciter takes its own full-width line under them. */
@media (max-width:639.98px){
  .au-bar.rp-panel{ left:8px; right:8px; bottom:max(8px, calc(env(safe-area-inset-bottom, 0px) + 4px)); padding:12px 14px; gap:10px; border-radius:20px; }
  .rp-row{ flex-wrap:wrap; gap:10px 12px; }
  .rp-transport{ gap:2px; }
  .rp-reciter{ flex:1 1 calc(100% - 56px); min-width:0; }   /* the fold button (44 px and the 12 px gap) shares its line (02) */
  .rp-opts{ gap:8px 16px; padding-top:10px; }
}
/* THE COMPACT PANEL (under 600 px; the board, 22 Oct 2026): it opens with Previous, Play/Pause, Next, Stop and the verse playing on one
   row, and the "Settings" disclosure under them; the reciter card, Speed, Repeat and Sources show only once it is pressed
   (audio-player.js sets data-au-expanded). At 600 px and wider the disclosure is not shown and the panel is as before. */
.rp-more{ display:none; }
@media (max-width:599.98px){
  .rp-now{ flex:1 1 0; min-width:0; }
  /* LOOK-POLISH 9: Settings' chevron beside its word (it sat at the far end, beside the panel's own chevron) */
  .rp-more{ display:inline-flex; flex:1 1 calc(100% - 56px); order:19; justify-content:flex-start; gap:.4rem; padding:0 6px; border-top:1px solid var(--ctl-hair);
    border-radius:0; font-size:.875rem; font-weight:500; color:var(--ctl-muted); }
  .rp-more::after{ content:""; flex:none; width:14px; height:14px; background-color:currentColor; transition:transform .15s;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
            mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat; }
  .rp-more[aria-expanded="true"]::after{ transform:rotate(180deg); }
  .au-bar.rp-panel:not([data-au-expanded]) .rp-reciter, .au-bar.rp-panel:not([data-au-expanded]) .rp-opts{ display:none; }
}
@media (prefers-reduced-motion:reduce){ .rp-more::after{ transition:none; } }
/* Below 360 px the four transport buttons and the play circle need 236 px; the status goes under them. */
@media (max-width:359.98px){ .rp-now{ flex-basis:100%; } }
