/* Narration player — rebuilt 12 Oct 2026. See narrator.js for why.
   Class prefix .np-* so nothing collides with the older .narr-* / .narrator-*
   rules still inlined on other properties. Palette is set below and overridden
   per property with --np-*. */

/* Own namespace, NO fallback to the page's generic names. The first cut read
   --ink / --accent / --bg, and this page defines --ink:#183d35 for a light
   background — so the player rendered dark-green icons on a dark-green bar and
   every control except play was invisible. A property themes it by setting
   --np-* and nothing else can reach in. */
.np{
  --np-bg:     #183d35;
  --np-panel:  #20453b;
  --np-ink:    #f6f4ec;
  --np-dim:    #ccd6cb;
  --np-faint:  #a9bbae;
  --np-rule:   #3b5d51;
  --np-accent: #e5d0a5;
  position:fixed; left:0; right:0; bottom:0; z-index:60;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color:var(--np-ink);
}
.np[hidden]{display:none}
.np svg{width:100%;height:100%;fill:currentColor;display:block}

/* ---- collapsed pill ------------------------------------------------------ */
.np-pill{
  position:absolute; right:16px; bottom:16px;
  display:flex; align-items:center; gap:10px;
  background:var(--np-bg); color:var(--np-ink);
  border:1px solid var(--np-rule); border-radius:999px;
  padding:11px 18px 11px 14px; min-height:46px;
  font-size:12px; font-weight:650; letter-spacing:.2px;
  box-shadow:0 6px 24px rgba(0,0,0,.22); cursor:pointer;
}
.np-pill:hover{border-color:var(--np-accent)}
.np-pill-ico{width:15px;height:15px;color:var(--np-accent);flex:none}
.np-pill-meta{color:var(--np-faint);font-weight:400}
.np[data-state=open] .np-pill{display:none}

/* ---- sheet --------------------------------------------------------------- */
.np-sheet{display:none;background:var(--np-bg);border-top:1px solid var(--np-rule);
  box-shadow:0 -8px 30px rgba(0,0,0,.2)}
.np[data-state=open] .np-sheet{display:block}

/* ---- compact row ---------------------------------------------------------
   The default while audio is playing. The full panel is 230px on a phone —
   27% of the screen, 67% with the chapter list open — which is not something
   you can read a page underneath. This is 56px. It collapses 4s after
   playback starts, immediately when the reader scrolls, and expands again on
   any touch or on pause. */
.np-mini{display:none;align-items:center;gap:10px;padding:0 6px 0 10px;height:56px;position:relative}
.np[data-size=compact] .np-mini{display:flex}
.np[data-size=compact] .np-scrub,
.np[data-size=compact] .np-now,
.np[data-size=compact] .np-bar{display:none}
.np-mini-progress{position:absolute;top:0;left:0;right:0;height:3px;background:var(--np-rule)}
.np-mini-progress span{display:block;height:100%;width:0;background:var(--np-accent)}
.np-mini-play{background:var(--np-accent);color:var(--np-bg);border:0;border-radius:50%;
  min-width:40px;min-height:40px;flex:none;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.np-mini-play svg{width:17px;height:17px}
.np-mini-open{flex:1 1 auto;min-width:0;background:transparent;border:0;color:var(--np-ink);
  cursor:pointer;text-align:left;display:flex;flex-direction:column;gap:2px;padding:4px 0;min-height:44px;justify-content:center}
.np-mini-title{font-size:12.5px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.np-mini-clock{font-size:11px;color:var(--np-faint);font-variant-numeric:tabular-nums}
.np-mini-follow,.np-mini-x{min-width:40px;min-height:40px;flex:none;padding:0}
.np-mini-follow svg{width:17px;height:17px}
.np-mini-x svg{width:14px;height:14px}

/* ---- scrubber ------------------------------------------------------------
   The whole 44px block is the pointer target; the rail inside it is only the
   visual. The previous player exposed a 6px click-only bar, which on a phone
   is not a control. */
.np-scrub{position:relative;height:44px;display:flex;align-items:center;
  padding:0 18px;cursor:pointer;touch-action:none}
.np-scrub:focus-visible{outline:2px solid var(--np-accent);outline-offset:-4px}
.np-rail{position:relative;width:100%;height:6px;background:var(--np-rule);border-radius:3px}
.np-buffer{position:absolute;inset:0 auto 0 0;width:0;background:var(--np-faint);opacity:.35;border-radius:3px}
.np-fill{position:absolute;inset:0 auto 0 0;width:0;background:var(--np-accent);border-radius:3px}
.np-ticks{position:absolute;inset:0;pointer-events:none}
.np-ticks i{position:absolute;top:-2px;width:2px;height:10px;background:var(--np-bg);opacity:.85}
.np-thumb{position:absolute;top:50%;left:0;width:14px;height:14px;margin:-7px 0 0 -7px;
  background:var(--np-accent);border-radius:50%;pointer-events:none;
  box-shadow:0 0 0 3px var(--np-bg); transition:transform .12s ease}
.np-scrub.dragging .np-thumb,.np-scrub:hover .np-thumb{transform:scale(1.35)}
.np-bubble{position:absolute;bottom:38px;transform:translateX(-50%);
  background:var(--np-panel);border:1px solid var(--np-accent);border-radius:6px;
  padding:7px 11px;white-space:nowrap;pointer-events:none;max-width:70vw;overflow:hidden;text-overflow:ellipsis}
.np-bubble b{font-size:14px;font-variant-numeric:tabular-nums}
.np-bubble span{display:block;font-size:10px;color:var(--np-dim);margin-top:2px}

/* ---- now playing --------------------------------------------------------- */
.np-now{padding:2px 18px 10px}
.np-title{font-size:13px;font-weight:700;letter-spacing:-.2px}
.np-line{font-size:12px;color:var(--np-dim);margin-top:4px;line-height:1.5;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.np-speaker{color:var(--np-accent);font-weight:700;margin-right:8px;text-transform:uppercase;font-size:10px;letter-spacing:1px}

/* ---- control bar --------------------------------------------------------- */
.np-bar{display:flex;align-items:center;gap:6px;padding:0 14px 14px;flex-wrap:wrap}
.np-btn,.np-play{background:transparent;border:1px solid transparent;color:var(--np-ink);
  display:inline-flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;
  min-width:44px;min-height:44px;padding:0 8px;border-radius:8px}
.np-btn svg{width:20px;height:20px}
.np-btn:hover{background:var(--np-panel)}
.np-play{background:var(--np-accent);color:var(--np-bg);border-radius:50%;
  min-width:52px;min-height:52px;flex:none}
.np-play svg{width:22px;height:22px}
.np-play:hover{filter:brightness(1.08)}
.np-clock{font-size:12px;font-variant-numeric:tabular-nums;color:var(--np-dim);
  margin-left:8px;display:inline-flex;gap:5px;align-items:baseline}
.np-clock b{color:var(--np-ink);font-weight:650}
.np-clock i{opacity:.5;font-style:normal}
.np-spacer{flex:1 1 auto}
.np-wide{padding:0 13px;font-size:11px;font-weight:650;border-color:var(--np-rule)}
.np-wide svg{width:16px;height:16px}
.np-rate{font-size:12px;font-weight:700;border-color:var(--np-rule);font-variant-numeric:tabular-nums}
.np-follow[data-on="1"]{border-color:var(--np-accent);color:var(--np-accent)}
.np-follow[data-on="0"]{opacity:.6}

/* ---- chapter list -------------------------------------------------------- */
.np-chapters{border-bottom:1px solid var(--np-rule);max-height:min(46vh,340px);
  overflow:auto;background:var(--np-panel)}
.np-chapters-head{display:flex;align-items:center;justify-content:space-between;
  padding:12px 10px 10px 18px;font-size:10px;letter-spacing:1.6px;text-transform:uppercase;
  font-weight:750;color:var(--np-faint);position:sticky;top:0;background:var(--np-panel);
  border-bottom:1px solid var(--np-rule)}
.np-x{background:transparent;border:0;color:var(--np-dim);cursor:pointer;
  min-width:40px;min-height:40px;display:inline-flex;align-items:center;justify-content:center}
.np-x svg{width:15px;height:15px}
.np-list{list-style:none;margin:0;padding:4px 0}
.np-list button{width:100%;background:transparent;border:0;cursor:pointer;color:var(--np-dim);
  display:flex;align-items:center;gap:14px;padding:13px 18px;min-height:48px;
  font-size:13px;text-align:left;line-height:1.4}
.np-list button:hover{background:var(--np-bg);color:var(--np-ink)}
.np-n{font-size:10px;color:var(--np-faint);font-variant-numeric:tabular-nums;flex:none}
.np-ct{flex:1 1 auto}
.np-cd{font-size:11px;color:var(--np-faint);font-variant-numeric:tabular-nums;flex:none}
.np-list .here button{color:var(--np-accent);background:var(--np-bg)}
.np-list .here .np-n{color:var(--np-accent)}

/* ---- phone --------------------------------------------------------------- */
@media(max-width:650px){
  .np-pill{right:12px;bottom:12px;left:12px;justify-content:center}
  .np-scrub{height:48px;padding:0 14px}
  .np-now{padding:0 14px 8px}
  .np-bar{padding:0 10px 12px;gap:4px}
  .np-clock{margin-left:4px;font-size:11px}
  /* the chapter and follow labels are the first thing to go, not the controls */
  .np-wide span{display:none}
  .np-wide{padding:0 10px}
  .np-follow[data-on="0"]{opacity:.45}
}
@media(max-width:380px){ .np-btn{min-width:40px;padding:0 4px} }

@media(prefers-reduced-motion:reduce){ .np-thumb{transition:none} }

/* The player is fixed at the bottom, so the footer needs room or it sits
   under it. Pad the footer, not the body: padding on <body> shows the page
   background below the footer's own band.

   Two sizes, because reserving space for the OPEN sheet at all times leaves a
   dead band under every page. #narrator precedes <footer> in the document, so
   a sibling selector can pay for the sheet only while it is open. Measured
   12 Oct 2026: pill 46px, sheet 166px desktop / 230px phone. The chapter list
   is scroll-capped and overlays, so it is not paid for here. */
footer{padding-bottom:calc(29px + 74px)}
#narrator[data-state=open] ~ footer{padding-bottom:calc(29px + 186px)}
#narrator[data-state=open][data-size=compact] ~ footer{padding-bottom:calc(29px + 76px)}
@media(max-width:650px){
  footer{padding-bottom:calc(29px + 74px)}
  #narrator[data-state=open] ~ footer{padding-bottom:calc(29px + 250px)}
  #narrator[data-state=open][data-size=compact] ~ footer{padding-bottom:calc(29px + 76px)}
}
@media print{ .np{display:none!important} footer{padding-bottom:29px} }
