/* Estilos del bloque media (vídeo, audio y GIF). Clases con prefijo .med- */

/* Filas de listas (unir vídeos/audios, convertir audio) */
.med-row { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-s, 10px); padding: 8px 10px; background: var(--sheet); min-width: 0; }
.med-num { width: 1.6em; text-align: center; color: var(--ink-3); flex: none; }
.med-ico { width: 28px; height: 28px; color: var(--c, var(--accent)); flex: none; }
.med-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.med-row-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; flex: none; }

/* Onda de audio de solo lectura */
.med-wave { position: relative; background: #f4f6fb; border-radius: 8px; overflow: hidden; }
.med-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); pointer-events: none; }

/* GIF */
.med-gifstage { display: flex; justify-content: center; align-items: center; min-height: 200px; padding: 12px; border-radius: 8px;
  background-color: #fff; background-image: linear-gradient(45deg, #eceef3 25%, transparent 25%), linear-gradient(-45deg, #eceef3 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eceef3 75%), linear-gradient(-45deg, transparent 75%, #eceef3 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.med-gifcanvas, .med-gifimg { max-width: 100%; max-height: 60vh; height: auto; image-rendering: auto; display: block; }

/* Recorte (GIF) */
.med-crop-wrap { position: relative; width: 100%; margin: 0 auto; overflow: hidden; border-radius: 6px; user-select: none; touch-action: none;
  background-color: #fff; background-image: linear-gradient(45deg, #eceef3 25%, transparent 25%), linear-gradient(-45deg, #eceef3 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eceef3 75%), linear-gradient(-45deg, transparent 75%, #eceef3 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.med-crop { position: absolute; border: 2px solid #fff; outline: 1px solid rgba(0,0,0,.4); box-shadow: 0 0 0 9999px rgba(0,0,0,.5); cursor: move; touch-action: none; box-sizing: border-box; }
.med-crop:focus-visible { outline: 3px solid var(--accent); }
.med-crop-h { position: absolute; width: 22px; height: 22px; background: #fff; border: 2px solid var(--accent); border-radius: 50%; touch-action: none; }
.med-crop-nw { top: -12px; left: -12px; cursor: nwse-resize; }
.med-crop-ne { top: -12px; right: -12px; cursor: nesw-resize; }
.med-crop-sw { bottom: -12px; left: -12px; cursor: nesw-resize; }
.med-crop-se { bottom: -12px; right: -12px; cursor: nwse-resize; }

/* Grabadora */
.med-recorder { display: grid; gap: 14px; }
.med-rec-time { font-family: var(--display); font-size: clamp(40px, 9vw, 64px); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1; }
.med-recording .med-rec-time { color: var(--danger); }
.med-scope { width: 100%; height: 90px; background: #f4f6fb; border-radius: 8px; display: block; }
.med-meter { height: 12px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.med-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), #d6a10a 75%, var(--danger)); transition: width .06s linear; }
.med-meter i.hot { box-shadow: inset 0 0 0 2px var(--danger); }
.med-rec-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.med-rec-btns .btn.big { width: auto; min-width: 180px; }
.med-rec svg { color: #fff; }
.med-recording .med-rec { opacity: .55; }
.med-take { border: 1px solid var(--line); border-radius: var(--radius-s, 10px); padding: 10px; display: grid; gap: 8px; background: var(--sheet); }
.med-take-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }

@media (max-width: 520px) {
  .med-row { flex-wrap: wrap; }
  .med-row > div:nth-child(3), .med-row > div:nth-child(4) { flex-basis: calc(100% - 60px); }
  .med-rec-btns .btn { flex: 1 1 auto; }
}
