.listen-controls { position: fixed; z-index: 4; left: max(14px, env(safe-area-inset-left)); bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); display: flex; align-items: center; gap: 8px; padding: 5px; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 26px var(--scrim); backdrop-filter: blur(14px); }
.listen-control { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; transition: background 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease); }
.listen-control:hover { background: var(--surface-2); } .listen-control:active { transform: scale(.94); } .listen-play.listen-is-playing { color: var(--on-accent); background: var(--accent); } .listen-control:disabled { opacity: .45; cursor: not-allowed; } .listen-control .icon { width: 20px; height: 20px; }
.listen-control:focus-visible, .listen-timer-option:focus-visible, .listen-rain-toggle:focus-visible, .listen-sleep-sheet .sheet-close:focus-visible, .listen-dim:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.listen-now { max-width: 0; overflow: hidden; white-space: nowrap; color: var(--muted); font: 500 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; opacity: 0; transition: opacity 180ms var(--ease); }
.listen-controls:has(:focus-visible) .listen-now { max-width: 120px; padding-left: 8px; opacity: 1; }
.listen-dim { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; width: 100%; padding: 0 24px; border: 0; color: var(--muted); background: var(--bg); opacity: 0; pointer-events: none; cursor: pointer; transition: opacity 700ms var(--ease); }
.listen-dim.listen-is-dimmed { opacity: 1; pointer-events: auto; } .listen-dim-copy { font: 400 12px/1.4 var(--sans); letter-spacing: .04em; }
.listen-sleep-content { display: grid; gap: 22px; padding-bottom: max(4px, var(--safe-b)); } .listen-sleep-line { margin: 0; max-width: 34ch; color: var(--muted); font: 400 16px/1.45 var(--serif); }
.listen-sleep-sheet { width: min(100% - 24px, 480px); max-height: min(84dvh, 560px); margin: auto; padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.listen-sleep-sheet::backdrop { background: var(--scrim); }
.listen-sleep-sheet .sheet-body { padding: 20px 20px calc(20px + var(--safe-b)); }
.listen-option-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--line); }
.listen-timer-option { min-height: 48px; padding: 0 16px; text-align: left; color: var(--ink); background: var(--surface); border: 0; font: 500 14px var(--sans); cursor: pointer; transition: background 150ms var(--ease); } .listen-timer-option:hover, .listen-timer-option:focus-visible { background: var(--surface-2); }
.listen-rain-row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 2px; color: var(--ink); cursor: pointer; } .listen-rain-row span { display: grid; gap: 3px; font: 500 14px var(--sans); } .listen-rain-row small { color: var(--muted); font: 400 12px var(--sans); }
.listen-rain-toggle { width: 46px; height: 26px; appearance: none; position: relative; margin: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); cursor: pointer; transition: background 180ms var(--ease); } .listen-rain-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform 180ms var(--ease), background 180ms var(--ease); } .listen-rain-toggle:checked { background: var(--accent); } .listen-rain-toggle:checked::after { transform: translateX(20px); background: var(--on-accent); }
@media (prefers-reduced-motion: reduce) { .listen-control, .listen-now, .listen-dim, .listen-timer-option, .listen-rain-toggle, .listen-rain-toggle::after { transition: none; } }
@media (min-width: 700px) { .listen-controls { left: calc(50% - (var(--app-w) / 2) + 14px); } }
.listen-control.listen-auto-on { background: var(--accent); color: var(--on-accent); }
/* auto-scroll speed: a breathing wave line above the pill (drawn in listen.js), a small time readout over the dot */
.listen-speed { position: absolute; left: 18px; bottom: calc(100% + 18px); width: min(230px, calc(100vw - 40px)); height: 52px; opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
.listen-speed.is-open { opacity: 1; transform: none; pointer-events: auto; }
.listen-speed output { position: absolute; top: 0; transform: translateX(-50%); padding: 3px 8px; border-radius: 999px; background: var(--glass); color: var(--ink); font: 500 11px/1.3 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.listen-speed output:empty { display: none; }
.listen-speed svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 28px; overflow: visible; pointer-events: none; }
.listen-speed path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.listen-wave-rest { stroke: var(--line); } .listen-wave-done { stroke: var(--ink); }
.listen-speed input { position: absolute; left: 0; bottom: 0; display: block; width: 100%; height: 28px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.listen-speed input::-webkit-slider-runnable-track { height: 28px; background: none; }
.listen-speed input::-moz-range-track { height: 28px; background: none; }
.listen-speed input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: 5px; border: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--bg); }
.listen-speed input::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--bg); }
@media (prefers-reduced-motion: reduce) { .listen-speed { transition: none; } }
.listen-speed::before { content: ''; position: absolute; left: -12px; right: -12px; bottom: -6px; height: 40px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 0 10px 28px rgb(0 0 0 / .25); }
.listen-speed output { background: var(--surface); border: 1px solid var(--line); top: -6px; }
.listen-speed input::-webkit-slider-thumb { box-shadow: none; } .listen-speed input::-moz-range-thumb { box-shadow: none; }
/* no white knob: the native thumb is invisible (still the touch target); a small glow on the wave marks the spot and brightens while dragging */
.listen-speed input::-webkit-slider-thumb { width: 32px; height: 28px; margin-top: 0; background: transparent; }
.listen-speed input::-moz-range-thumb { width: 32px; height: 28px; background: transparent; }
.listen-wave-glow { fill: var(--ink); opacity: .55; filter: drop-shadow(0 0 3px var(--ink)); transition: opacity 200ms var(--ease-out), r 200ms var(--ease-out), filter 200ms var(--ease-out); }
.listen-speed.is-drag .listen-wave-glow { opacity: 1; r: 4.5px; filter: drop-shadow(0 0 6px var(--ink)) drop-shadow(0 0 14px var(--ink)); }
.listen-wave-done { opacity: .75; transition: opacity 200ms var(--ease-out); } .listen-speed.is-drag .listen-wave-done { opacity: 1; }
/* the selected part of the wave glows; brighter while dragging */
.listen-wave-done { filter: drop-shadow(0 0 2px var(--ink)) drop-shadow(0 0 6px color-mix(in srgb, var(--ink) 55%, transparent)); transition: opacity 200ms var(--ease-out), filter 200ms var(--ease-out); }
.listen-speed.is-drag .listen-wave-done { filter: drop-shadow(0 0 3px var(--ink)) drop-shadow(0 0 10px var(--ink)) drop-shadow(0 0 18px color-mix(in srgb, var(--ink) 60%, transparent)); }
