/* Convertidor universal — estilos propios */

/* --- Tipos admitidos --- */
.cu-tipos {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
  margin-top: 1.1rem;
}
@media (min-width: 700px) { .cu-tipos { grid-template-columns: repeat(2, 1fr); } }
.cu-tipos li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--t-sm);
}
.cu-tipos b { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-text); }
.cu-tipos span { color: var(--text-mute); }

/* --- Pantalla de carga del motor --- */
.cu-motor { text-align: center; padding: 0.8rem 0 1.4rem; }
.cu-motor__icono {
  width: 62px; height: 62px;
  margin: 0 auto 0.9rem;
  display: grid; place-items: center;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--accent-fill), var(--accent-2-fill));
  color: #fff;
  box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--accent) 62%, transparent), var(--clay-inset);
}
.cu-motor__icono svg { width: 30px; height: 30px; animation: spin 2.6s linear infinite; }
.cu-motor__titulo { font-size: var(--t-lg); margin-bottom: 0.4rem; }
.cu-motor__texto { font-size: var(--t-base); color: var(--text-soft); max-width: 44ch; margin-inline: auto; }

/* --- Cola de archivos --- */
.cu-cola { margin-bottom: 1rem; }
.cu-cola__cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.cu-cola__acc { display: flex; gap: 0.4rem; }

.cu-lista {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 2px;
}
.cu-fila {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.6rem;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1.5px solid var(--line);
  cursor: pointer;
  font-size: var(--t-sm);
  transition: border-color 0.18s var(--ease-out), background-color 0.18s var(--ease-out);
}
.cu-fila:hover { border-color: var(--line-strong); }
.cu-fila.is-actual { border-color: var(--accent); background: var(--accent-soft); }
.cu-fila.is-listo { border-left: 3px solid var(--ok); }
.cu-fila.is-error { border-left: 3px solid var(--err); }
.cu-fila__i { width: 20px; height: 20px; color: var(--accent-text); }
.cu-fila__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cu-fila__d {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-mute);
  white-space: nowrap;
}
.cu-fila__x {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--text-mute);
  line-height: 1;
}
.cu-fila__x:hover { color: var(--err-text); background: color-mix(in srgb, var(--err) 12%, transparent); }

/* --- Ajustes rápidos --- */
.cu-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

/* --- Línea de tiempo con onda --- */
.cu-linea {
  position: relative;
  height: 72px;
  border-radius: var(--r-sm);
  background: var(--bg);
  box-shadow: var(--neu-in);
  overflow: hidden;
  margin-top: 0.5rem;
  touch-action: none;
  user-select: none;
}
.cu-onda { display: block; width: 100%; height: 72px; }
.cu-linea__sel {
  position: absolute;
  top: 0; bottom: 0;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  pointer-events: none;
}
.cu-linea__cursor {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--accent-2);
  pointer-events: none;
}
.cu-tirador {
  position: absolute;
  top: 0; bottom: 0;
  width: 16px;
  margin-left: -8px;
  cursor: ew-resize;
  background: transparent;
}
.cu-tirador::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 30px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.cu-tirador:focus-visible::after { outline: 2px solid var(--text); outline-offset: 2px; }

.cu-linea__pies {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.5rem;
}
.cu-medios { display: none; }

/* --- Unir --- */
.cu-unir { margin-top: 1rem; }

/* --- Estimación --- */
.cu-estimacion {
  margin-top: 0.7rem;
  text-align: center;
  font-size: var(--t-sm);
  color: var(--text-mute);
}

/* --- Ficha del archivo --- */
.cu-archivo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}
.cu-archivo__icono {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent-fill), var(--accent-2-fill));
  color: #fff;
  box-shadow: var(--clay-inset);
}
.cu-archivo__icono svg { width: 23px; height: 23px; }
.cu-archivo__datos { flex: 1; min-width: 0; }
.cu-archivo__nombre {
  font-weight: 650; font-size: var(--t-base);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- Destinos --- */
.cu-destinos { margin-top: 1.1rem; }
.cu-destinos .chips { margin-top: 0.45rem; }

/* --- Opciones --- */
.cu-ops { margin-top: 1rem; display: grid; gap: 0.9rem; }
.cu-op {
  padding: 0.9rem 1rem;
  border-radius: var(--r-md);
  background: var(--bg);
  box-shadow: var(--neu-in);
}
.cu-op .field-row + .field { margin-top: 0.8rem; }

/* --- Resultado --- */
.cu-resultado {
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  animation: cuIn 0.35s var(--ease-out);
}
@keyframes cuIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.cu-resultado__cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.cu-resultado__cab .badge {
  background: color-mix(in srgb, var(--ok) 15%, transparent);
  color: color-mix(in srgb, var(--ok) 82%, var(--text));
}

.cu-vista {
  display: grid;
  place-items: center;
  padding: 0.9rem;
  margin-bottom: 0.9rem;
  border-radius: var(--r-md);
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 0 0 / 18px 18px;
  min-height: 90px;
}
.cu-vista:empty { display: none; }
.cu-vista img, .cu-vista video {
  max-width: 100%;
  max-height: 340px;
  border-radius: var(--r-sm);
  display: block;
  box-shadow: 0 8px 22px -10px rgba(20, 25, 45, 0.45);
}
.cu-vista audio { width: 100%; }

/* --- Créditos de licencia en el pie --- */
.cu-creditos {
  padding: 1rem 1.1rem;
  margin-bottom: 1.2rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.cu-creditos h4 {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  margin-bottom: 0.4rem;
}
.cu-creditos a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .cu-motor__icono svg { animation: none; }
}

/* =============================================================
   Ergonomía táctil (ver styles.css §9b para el porqué de la consulta)
   ============================================================= */
@media (max-width: 700px), (pointer: coarse) {
  /* La aspa de la cola medía 22×22. Con 44 y el destino a su izquierda al
     nombre le siguen quedando 120 px, que con la elipsis bastan. */
  .cu-fila { grid-template-columns: 26px 1fr auto 44px; gap: 0.55rem; }
  .cu-fila__x { width: 44px; height: 44px; font-size: var(--t-md); }
  .cu-lista { gap: 0.55rem; }

  .cu-cola__acc, .cu-presets { gap: 0.55rem; }

  /* Los tiradores de recorte de la onda se arrastran con el dedo */
  .cu-tirador { width: 44px; margin-left: -22px; }

  /* Suelo tipográfico */
  .cu-tipos b,
  .cu-fila__d,
  .cu-creditos h4 { font-size: var(--t-xs); }
}
