/* Now-playing bar (see nowplaying.js). Colours come from the reader theme. */
#np-bar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: min(620px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px 10px; border-radius: 18px; overflow: hidden;
  background: var(--t-bar, #0b2a4a); color: #fff; box-shadow: 0 22px 50px -18px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.18);
  font: 400 14px/1.25 var(--sans, "Inter", system-ui, sans-serif);
  transform: translate(-50%, 140%); opacity: 0; transition: transform .26s cubic-bezier(.2,.8,.2,1), opacity .2s; }
#np-bar.on { transform: translate(-50%, 0); opacity: 1; }
#np-bar button { font: inherit; color: inherit; cursor: pointer; border: 0; display: inline-grid; place-items: center; }
#np-bar svg { width: 20px; height: 20px; }
#np-bar .np-pp { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--t-bar, #0b2a4a); }
#np-bar .np-pp svg { width: 22px; height: 22px; }
#np-bar .np-info { flex: 1; min-width: 0; display: grid; gap: 1px; }
#np-bar .np-k { font: 800 10px/1.2 var(--sans, sans-serif); letter-spacing: .14em; text-transform: uppercase; opacity: .72; display: inline-flex; align-items: center; gap: 6px; }
#np-bar .np-k::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5fd39a; box-shadow: 0 0 0 0 rgba(95,211,154,.6); animation: np-pulse 1.6s infinite; }
#np-bar.paused .np-k::before { background: rgba(255,255,255,.55); animation: none; }
#np-bar .np-t { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#np-bar .np-s { font-size: 12.5px; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#np-bar .np-time { flex: none; font: 600 12.5px/1 var(--sans, sans-serif); font-variant-numeric: tabular-nums; opacity: .8; }
#np-bar .np-go { flex: none; display: inline-flex; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.32); font-weight: 700; }
#np-bar .np-go:hover { background: rgba(255,255,255,.24); }
#np-bar .np-go svg { width: 17px; height: 17px; }
#np-bar .np-x { flex: none; width: 36px; height: 36px; border-radius: 50%; background: transparent; opacity: .75; }
#np-bar .np-x:hover { opacity: 1; background: rgba(255,255,255,.12); }
#np-bar button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#np-bar .np-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.18); }
#np-bar .np-prog i { display: block; height: 100%; width: 0; background: #fff; transition: width .25s linear; }
html[data-theme="night"] #np-bar { background: #22343a; border: 1px solid var(--t-line2); }
html[data-theme="night"] #np-bar .np-pp { background: var(--t-accent); color: #0c1314; }
html[data-theme="night"] #np-bar .np-prog i { background: var(--t-accent); }
html[data-theme="contrast"] #np-bar { border: 2px solid #fff; outline: 2px solid #000; }
@keyframes np-pulse { 70% { box-shadow: 0 0 0 7px rgba(95,211,154,0); } 100% { box-shadow: 0 0 0 0 rgba(95,211,154,0); } }

/* the exercise you return to */
.np-glow { animation: np-glow 2.2s ease-out; border-radius: 10px; }
@keyframes np-glow { 0%, 35% { box-shadow: 0 0 0 4px var(--t-accent), 0 0 0 12px color-mix(in srgb, var(--t-accent) 22%, transparent); }
  100% { box-shadow: 0 0 0 4px transparent, 0 0 0 12px transparent; } }

/* keep the end of the page reachable above the bar */
body:has(#np-bar.on) { padding-bottom: 96px; }

@media (max-width: 560px) {
  #np-bar { gap: 8px; padding: 8px 8px 10px; border-radius: 16px; }
  #np-bar .np-time { display: none; }
  #np-bar .np-go { width: 40px; padding: 0; }
  #np-bar .np-go span { display: none; }
  #np-bar .np-t { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { #np-bar, #np-bar .np-prog i { transition: none; } .np-glow, #np-bar .np-k::before { animation: none; } .np-glow { outline: 4px solid var(--t-accent); } }
@media print { #np-bar { display: none !important; } }
