/* ═══════════════════════════════════════════════════════════
   reproductor.css — reproductor de audio propio y reproductor flotante
   Usa los colores del sitio o del panel (variables), con valores de reserva.
   ═══════════════════════════════════════════════════════════ */
audio[data-rp-listo] { display: none !important; }
.rp {
  --rp-acento: var(--accent, #c41c1c); --rp-fondo: var(--surface, #141414); --rp-borde: var(--border-mid, #2a2a2a);
  --rp-texto: var(--text, #e8e8e8); --rp-tenue: var(--text-dim, #8a8a8a);
  display: flex; align-items: center; gap: .5rem; width: 100%; max-width: 640px; min-height: 48px; padding: .35rem .6rem;
  background: var(--rp-fondo); border: 1px solid var(--rp-borde); border-radius: 999px; color: var(--rp-texto);
  font: 500 .74rem/1 'IBM Plex Mono', ui-monospace, monospace; box-sizing: border-box;
}
.rp.rp-vacio { opacity: .55; pointer-events: none; }
.rp-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
  border: none; border-radius: 50%; background: transparent; color: var(--rp-texto); cursor: pointer; text-decoration: none;
  font: inherit; transition: background .15s, color .15s;
}
.rp-btn:hover, .rp-btn:focus-visible { background: rgba(255,255,255,.08); outline: none; }
.rp-btn svg { width: 20px; height: 20px; fill: currentColor; }
.rp-play { width: 38px; height: 38px; background: var(--rp-acento); color: #fff; }
.rp-play:hover, .rp-play:focus-visible { background: var(--rp-acento); filter: brightness(1.15); }
.rp-vel { width: auto; min-width: 40px; padding: 0 .4rem; border-radius: 999px; font-size: .7rem; }
.rp-tiempo { flex: 0 0 auto; min-width: 2.6rem; text-align: center; color: var(--rp-tenue); font-variant-numeric: tabular-nums; }
.rp input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; cursor: pointer; margin: 0; padding: 0; border: none;
  background: linear-gradient(to right, var(--rp-acento) var(--p, 0%), rgba(255,255,255,.18) var(--p, 0%));
}
.rp-barra { flex: 1 1 auto; min-width: 60px; }
.rp-volumen { flex: 0 0 70px; width: 70px; }
.rp input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: none; box-shadow: 0 0 0 3px rgba(0,0,0,.25); }
.rp input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: none; }
.rp input[type="range"]::-moz-range-track { background: transparent; }
.rp input[type="range"]:focus-visible { outline: 2px solid var(--rp-acento); outline-offset: 4px; }
@media (max-width: 480px) {
  .rp { gap: .3rem; padding: .3rem .45rem; }
  .rp-volumen { display: none; }
  .rp-tiempo { min-width: 2.2rem; font-size: .66rem; }
}

/* ── Reproductor flotante (panel) ── */
.rp-flot {
  position: fixed; right: calc(1rem + env(safe-area-inset-right, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 3500;
  display: flex; align-items: center; gap: .5rem; max-width: min(320px, calc(100vw - 2rem)); padding: .45rem .9rem .45rem .45rem;
  background: #161616; color: #eee; border: 1px solid #333; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  font: 500 .74rem 'IBM Plex Mono', monospace; cursor: pointer;
}
.rp-flot[hidden] { display: none; }
.rp-flot-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent, #c41c1c); flex: 0 0 auto; }
.rp-flot-ico svg { width: 18px; height: 18px; fill: #fff; }
.rp-flot.rp-sonando .rp-flot-ico { animation: rp-latido 1.6s ease-in-out infinite; }
@keyframes rp-latido { 50% { box-shadow: 0 0 0 6px rgba(196,28,28,.25); } }
.rp-flot-titulo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-modal { position: fixed; inset: 0; z-index: 3600; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0,0,0,.72); }
.rp-modal[hidden] { display: none; }
.rp-caja {
  width: min(720px, 100%); max-height: calc(100dvh - 2rem); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: .9rem;
  padding: 1.1rem; background: #121212; border: 1px solid #2a2a2a; border-radius: 10px; color: #e8e8e8; font-family: 'IBM Plex Mono', monospace;
}
.rp-cab { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.rp-titulo { font-size: .9rem; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-x { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid #333; background: transparent; color: #ccc; cursor: pointer; font-size: .9rem; }
.rp-x:hover { background: #222; color: #fff; }
.rp-texto { overflow-y: auto; min-height: 3rem; padding: .8rem .9rem; background: #0b0b0b; border: 1px solid #222; border-radius: 6px;
            font-size: .86rem; line-height: 1.75; white-space: pre-wrap; color: #ddd; }
.rp-texto[hidden] { display: none; }
.rp-caja .rp { max-width: none; }
.rp-acciones { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.rp-extra { display: contents; }
.rp-accion { min-height: 38px; padding: 0 .9rem; border-radius: 6px; border: 1px solid #333; background: #1b1b1b; color: #e8e8e8; cursor: pointer; font: 500 .72rem 'IBM Plex Mono', monospace; }
.rp-accion:hover { border-color: #666; }
.rp-accion[hidden] { display: none; }
.rp-cerrar { margin-left: auto; color: #f39a9a; border-color: rgba(196,28,28,.5); }
@media (max-width: 600px) {
  .rp-modal { align-items: flex-end; padding: 0; }
  .rp-caja { border-radius: 12px 12px 0 0; max-height: 90dvh; padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)); }
  .rp-acciones > .rp-accion, .rp-extra > .rp-accion { flex: 1 1 auto; }
  .rp-cerrar { margin-left: 0; }
}
