:root {
  --bg: #0b0f19;
  --surface: #0f1626;
  --surface-2: #151d30;
  --border: #24304a;
  --border-soft: #1d2740;
  --text: #e8ecf5;
  --muted: #8b95ad;
  --cyan: #22d3ee;
  --cyan-2: #06b6d4;
  --blue: #3b82f6;
  --green: #34d399;
  --red: #fb7185;
  --radius: 16px;
  font-size: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
}

.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }
.accent { color: var(--cyan); }

/* ================= Hero ================= */
.hero {
  position: relative;
  padding: 56px 20px 48px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 320px;
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.13), rgba(59, 130, 246, 0.06), transparent);
  filter: blur(40px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #041016;
  font-size: 21px;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.3);
}

.brand-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.4px; }

.hero-title {
  font-size: clamp(1.7rem, 4.5vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  text-wrap: balance;
}

.hero-sub {
  margin-top: 14px;
  color: #b6c2d9;
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* ================= Barra de búsqueda ================= */
.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin: 30px auto 0;
  background: rgba(15, 22, 38, 0.9);
  border: 1px solid #33415e;
  border-radius: 18px;
  padding: 8px 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.searchbar:focus-within {
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.search-icon { color: var(--muted); font-size: 1.3rem; padding-left: 6px; }

#url-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.98rem;
  padding: 10px 4px;
}

#url-input::placeholder { color: #5d6b87; }

.icon-btn, .ghost-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #b6c2d9;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover, .ghost-btn:hover { background: #1d2947; color: #fff; }

.primary-btn {
  background: linear-gradient(90deg, var(--cyan-2), var(--blue));
  border: none;
  color: #fff;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.2);
  transition: transform 0.15s, filter 0.15s;
}

.primary-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.12); }
.primary-btn:disabled { opacity: 0.55; cursor: wait; }

.hero-hint { color: var(--muted); font-size: 0.8rem; margin-top: 14px; }

/* ================= Plataformas ================= */
.platforms { margin-top: 34px; }

.platforms-title {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.platforms-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  font-size: 0.8rem;
  color: var(--muted);
}

.platform { display: inline-flex; align-items: center; gap: 6px; }

/* Plataformas que aún no se pueden descargar desde el servidor. */
.platform.soon { opacity: 0.8; }

.soon-tag {
  font-size: 0.6rem;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--muted);
  white-space: nowrap;
}

.platforms-note {
  max-width: 620px;
  margin: 12px auto 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0.9;
}

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ================= Main ================= */
.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* ================= Errores ================= */
.error-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.35);
  color: var(--red);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 0.92rem;
}

.error-box button { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1rem; }

/* ================= Loader ================= */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  padding: 36px 0;
  font-size: 0.95rem;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.spinner.small { width: 20px; height: 20px; border-width: 2.5px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Resultado ================= */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-head h3 {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--muted);
  font-weight: 700;
}

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 600;
}

.status-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.result-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-left, .result-right { padding: 24px; }

/* Miniatura */
.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  margin-bottom: 14px;
}

.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Metadatos */
.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.platform-badge {
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.video-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.meta-actions { display: flex; gap: 8px; }

.soft-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #b6c2d9;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.soft-btn:hover { background: #1d2947; color: #fff; border-color: #3b4d72; }

.soft-btn.active {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.5);
  color: #9beeff;
}

/* ================= Recortador de fragmentos ================= */
.trim-panel {
  margin-top: 12px;
  background: rgba(8, 12, 22, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
}

.trim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #cdd8ea;
}

.trim-head .mono { color: #7fe6f7; font-size: 0.78rem; }

.trim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.trim-label {
  width: 42px;
  flex: none;
  font-size: 0.74rem;
  color: var(--muted);
}

.trim-row input[type="range"] {
  flex: 1;
  accent-color: var(--cyan-2);
  height: 4px;
  cursor: pointer;
}

.trim-num {
  width: 62px;
  flex: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #e6edf7;
  padding: 5px 7px;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.trim-unit { font-size: 0.7rem; color: var(--muted); }

.trim-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.trim-hint { font-size: 0.7rem; color: var(--muted); }

.trim-hint.invalid { color: #ff9a9a; }

.trim-panel.hidden { display: none; }

/* ================= Cola en lote ================= */
.batch-open {
  display: block;
  margin: 18px auto 0;
  background: transparent;
  border: 1px dashed var(--border);
  color: #9fb0cc;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.batch-open:hover,
.batch-open.active {
  color: #9beeff;
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.08);
}

.batch { margin-top: 26px; }

.batch-count { font-size: 0.76rem; color: var(--muted); }

.batch-card {
  background: rgba(15, 22, 38, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.batch-input textarea {
  width: 100%;
  resize: vertical;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 0.82rem;
  font-family: inherit;
  line-height: 1.5;
}

.batch-input textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.55);
}

.batch-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
}

.batch-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.batch-note {
  margin-top: 10px;
  font-size: 0.71rem;
  color: var(--muted);
  line-height: 1.5;
}

.batch-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 12px;
}

.batch-thumb {
  width: 64px;
  height: 40px;
  flex: none;
  object-fit: cover;
  border-radius: 7px;
  background: #0b0f19;
}

.batch-item-info { flex: 1; min-width: 0; }

.batch-item-title {
  font-size: 0.81rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-item-sub {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.batch-track {
  height: 5px;
  background: #0b1322;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 7px;
}

.batch-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan-2), var(--blue));
  transition: width 0.3s ease;
}

.batch-badge {
  flex: none;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.batch-badge.pending { color: #9fb0cc; background: rgba(159, 176, 204, 0.1); border-color: rgba(159, 176, 204, 0.25); }
.batch-badge.ready { color: #7fe6f7; background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.3); }
.batch-badge.active { color: #fbbf24; background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.3); }
.batch-badge.done { color: var(--green); background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.3); }
.batch-badge.error { color: var(--red); background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.3); }

.batch-remove {
  flex: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.batch-remove:hover { color: var(--red); background: rgba(251, 113, 133, 0.1); }

/* ================= Pestañas ================= */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 9px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab:hover { color: #fff; }

.tab.active {
  background: var(--surface-2);
  border-color: var(--border);
  color: #fff;
}

.info-note {
  display: flex;
  gap: 8px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #9dc0fb;
  font-size: 0.78rem;
  line-height: 1.45;
  border-radius: 11px;
  padding: 11px 13px;
  margin-bottom: 12px;
}

/* ================= Filas de formato ================= */
.format-list { display: flex; flex-direction: column; gap: 10px; }

.format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(8, 12, 22, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  transition: background 0.15s, border-color 0.15s;
}

.format-row:hover { background: rgba(8, 12, 22, 0.85); border-color: #2c3b5c; }

.format-info { display: flex; align-items: center; gap: 12px; min-width: 0; }

.format-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.format-label { font-size: 0.88rem; font-weight: 700; color: #fff; }

.format-badge {
  display: inline-block;
  margin-left: 7px;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--cyan);
}

.format-sub { font-size: 0.74rem; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cyan-2);
  color: #041016;
  border: none;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}

.download-btn:hover:not(:disabled) { background: var(--cyan); }
.download-btn:active:not(:disabled) { transform: scale(0.96); }
.download-btn:disabled { opacity: 0.5; cursor: wait; }

.format-row.audio .download-btn { background: var(--blue); color: #fff; }
.format-row.audio .download-btn:hover:not(:disabled) { background: #60a5fa; }

.empty-note { color: var(--muted); font-size: 0.82rem; padding: 8px 2px; }

/* ================= Extras: miniatura y subtítulos ================= */
.asset-card {
  background: rgba(8, 12, 22, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 12px;
}

.asset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.thumb-mini {
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-soft);
}

.thumb-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }

.subs-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }

.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(15, 22, 38, 0.8);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 0.82rem;
}

.sub-name { color: #dfe6f3; font-weight: 600; display: flex; align-items: center; gap: 7px; min-width: 0; }

.sub-tag {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 5px;
  padding: 1px 5px;
}

.sub-actions { display: flex; gap: 6px; flex-shrink: 0; }

.sub-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #b6c2d9;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sub-btn:hover:not(:disabled) { background: #1d2947; color: #fff; }
.sub-btn:disabled { opacity: 0.5; cursor: wait; }

/* ================= Aviso de descarga con progreso ================= */
.progress-notice {
  background: rgba(34, 211, 238, 0.07);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 14px;
  font-size: 0.8rem;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: #8ee9f8;
  font-weight: 700;
  font-size: 0.83rem;
}

.progress-track {
  height: 8px;
  background: #131c2e;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan-2), var(--blue));
  transition: width 0.3s ease;
}

/* Avance desconocido (p. ej. mientras se prepara un archivo) */
.progress-fill.indeterminate {
  width: 34%;
  transition: none;
  animation: progress-sweep 1.5s ease-in-out infinite;
}

@keyframes progress-sweep {
  0%   { margin-left: 0; }
  50%  { margin-left: 66%; }
  100% { margin-left: 0; }
}

.progress-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}

.progress-foot .ghost-btn { margin-left: auto; }

.ghost-btn.small { padding: 5px 10px; font-size: 0.72rem; }

/* ================= Toast ================= */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #101828;
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: #fff;
  border-radius: 13px;
  padding: 13px 17px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.25s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= Footer ================= */
.footer {
  max-width: 780px;
  margin: 20px auto 0;
  padding: 24px 20px 36px;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
  border-top: 1px solid var(--border-soft);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 10px;
}

.footer-links a {
  color: #9fb0cc;
  text-decoration: none;
  border-bottom: 1px dashed rgba(159, 176, 204, 0.35);
}

.footer-links a:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.footer-kofi {
  color: #ffd166 !important;
  font-weight: 700;
  border-bottom-color: rgba(255, 209, 102, 0.5) !important;
}

/* ================= Legal ================= */
.legal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 42px 20px 8px;
}

.legal-hero { text-align: center; }
.legal-hero h1 { font-size: 2rem; letter-spacing: -0.5px; }
.legal-hero > p { color: var(--muted); font-size: 0.84rem; margin-top: 8px; }

.legal-index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.legal-index a {
  color: #a9b5cc;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.legal-index a:hover { color: #fff; border-color: rgba(34, 211, 238, 0.45); }

.legal-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-top: 18px;
}

.legal-card h2 { font-size: 1.25rem; margin-bottom: 14px; }
.legal-card h3 { font-size: 0.95rem; margin: 20px 0 6px; color: #cfe3ff; }
.legal-card p,
.legal-card li { color: #b9c3d6; font-size: 0.86rem; line-height: 1.7; }
.legal-card p + p { margin-top: 8px; }
.legal-card ul { margin: 8px 0 0 18px; display: grid; gap: 4px; }
.legal-card a { color: var(--cyan); }

.legal-todo {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

@media (max-width: 700px) {
  .legal-page { padding-top: 28px; }
  .legal-card { padding: 20px 18px; }
  .legal-hero h1 { font-size: 1.6rem; }
}

/* ================= Responsive ================= */
@media (max-width: 700px) {
  .searchbar { flex-wrap: wrap; }
  #url-input { order: 1; flex-basis: 60%; }
  .search-icon { order: 0; }
  .icon-btn { order: 2; }
  .ghost-btn { order: 3; flex: 1; }
  .primary-btn { order: 4; flex: 1; }
  .result-card { grid-template-columns: 1fr; }
  .result-left { padding-bottom: 6px; }
}

/* ================= Barra de navegación de herramientas ================= */
.toolnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 22px;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.toolnav-brand {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.toolnav-links { display: flex; gap: 6px; flex-wrap: wrap; }

.toolnav-links a {
  color: #a9b5cc;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.toolnav-links a:hover { color: #fff; background: rgba(34, 211, 238, 0.08); }

.toolnav-links a.active {
  color: #9beeff;
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.35);
}

.muted-small { font-size: 0.74rem; color: var(--muted); }

.cross-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.79rem;
  color: #9fb0cc;
  text-decoration: none;
  border-bottom: 1px dashed rgba(159, 176, 204, 0.45);
  padding-bottom: 1px;
}

.cross-link:hover { color: #9beeff; border-bottom-color: rgba(34, 211, 238, 0.6); }
.cross-link strong { color: #9beeff; font-weight: 700; }

/* ================= Compresor: dropzone ================= */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  padding: 38px 20px;
  background: rgba(15, 22, 38, 0.6);
  border: 2px dashed #2b3a5a;
  border-radius: var(--radius);
  transition: border-color 0.18s, background 0.18s, transform 0.1s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: rgba(34, 211, 238, 0.65);
  background: rgba(34, 211, 238, 0.06);
}

.dropzone.dragover { transform: scale(1.005); }

.dropzone-icon { font-size: 2rem; }

.dropzone-title { font-size: 0.95rem; font-weight: 700; }
.dropzone-sub { font-size: 0.76rem; color: var(--muted); }

/* ================= Compresor: ficha del archivo ================= */
.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  animation: fadeUp 0.25s ease;
}

.file-icon { font-size: 1.5rem; flex-shrink: 0; }

.file-info { flex: 1; min-width: 0; }

.file-name {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta { font-size: 0.75rem; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

.file-preview {
  width: 104px;
  height: 62px;
  border-radius: 8px;
  background: #000;
  object-fit: cover;
  flex-shrink: 0;
}

/* ================= Compresor: presets ================= */
.presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  background: rgba(15, 22, 38, 0.7);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 13px 14px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.preset:hover { border-color: #3b4d72; background-color: #162033; transform: translateY(-1px); }

.preset.active {
  border-color: rgba(34, 211, 238, 0.65);
  background: rgba(34, 211, 238, 0.1);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.preset-icon { font-size: 1rem; }
.preset-name { font-size: 0.84rem; font-weight: 700; }
.preset-size { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.preset-size input {
  width: 58px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 3px 6px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

/* ================= Compresor: opciones ================= */
.compress-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.option-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}

.option-field select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  cursor: pointer;
}

.compress-action {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 18px;
  background: rgba(15, 22, 38, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.primary-btn.big, .download-btn.big {
  padding: 14px 26px;
  font-size: 0.95rem;
  border-radius: 13px;
}

/* ================= Compresor: resultado ================= */
.result { margin-top: 28px; animation: fadeUp 0.3s ease; }

.compare-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.compare-preview {
  width: 100%;
  max-height: 380px;
  border-radius: 12px;
  background: #000;
  display: block;
}

.compare-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.compare-stat { display: flex; flex-direction: column; gap: 2px; }
.compare-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.compare-value { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.compare-arrow { color: var(--muted); font-size: 1.2rem; }

.compare-saved {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 999px;
  padding: 6px 13px;
}

.compare-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ================= Contenido SEO ================= */
.seo-block {
  margin-top: 46px;
  padding-top: 30px;
  border-top: 1px solid var(--border-soft);
}

.seo-block h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin: 28px 0 12px;
}

.seo-block h2:first-child { margin-top: 0; }

.seo-block p { color: #b6c2d9; font-size: 0.88rem; line-height: 1.6; }

.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; }

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 42px;
  color: #c3cde0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.13);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #9beeff;
  font-size: 0.78rem;
  font-weight: 800;
}

.limits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  background: rgba(15, 22, 38, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}

.limits-table th, .limits-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.limits-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.limits-table tr:last-child td { border-bottom: none; }

.faq {
  background: rgba(15, 22, 38, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 10px;
}

.faq summary { cursor: pointer; font-size: 0.86rem; font-weight: 700; color: #e8ecf5; }
.faq summary::marker { color: var(--cyan); }
.faq p { margin-top: 10px; font-size: 0.83rem; }

/* ================= Cruce entre herramientas ================= */
.tool-cross {
  margin-top: 40px;
  text-align: center;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: var(--radius);
  padding: 24px;
}

.tool-cross p { font-size: 0.9rem; color: #c3cde0; margin-bottom: 14px; }

.tool-cross a { text-decoration: none; display: inline-block; }

/* ================= Directorio de herramientas ================= */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}

.tool-card:hover { border-color: rgba(34, 211, 238, 0.55); transform: translateY(-2px); background: var(--surface-2); }

.tool-card.soon { opacity: 0.6; pointer-events: none; }

.tool-card-icon { font-size: 1.7rem; }
.tool-card-name { font-size: 1rem; font-weight: 800; letter-spacing: -0.2px; }
.tool-card-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.tool-card-tag {
  align-self: flex-start;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 5px;
  padding: 2px 6px;
}

.tool-card-tag.soon-tag { color: #cbd5e1; background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.3); }

/* ================= Clips verticales ================= */
.clip-src-tabs { max-width: 520px; }

.clip-panel { margin-bottom: 18px; }

.clip-panel .searchbar { margin: 0; max-width: none; }

#clip-url {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 4px;
}

#clip-url::placeholder { color: #5d6b87; }

.clip-hint-line {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 10px;
}

.clip-info {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  animation: fadeUp 0.3s ease;
}

.clip-info-body { flex: 1; min-width: 280px; }

.clip-info-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.35;
}

.clip-info-meta {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Vista previa del encuadre que tendrá el clip */
.clip-preview {
  position: relative;
  width: 100%;
  max-width: 190px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: #05080f;
  border: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.clip-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.clip-preview .pv-bg { object-fit: cover; filter: blur(16px) brightness(0.62); transform: scale(1.2); }
.clip-preview .pv-fg { object-fit: cover; }

.clip-preview.vertical-blur .pv-fg { object-fit: contain; }

.clip-preview.square { aspect-ratio: 1 / 1; }
.clip-preview.original { aspect-ratio: 16 / 9; max-width: 300px; }
.clip-preview.original .pv-bg { display: none; }
.clip-preview.original .pv-fg { object-fit: contain; }

.pv-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #dff7ff;
  background: rgba(3, 8, 16, 0.72);
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 999px;
  padding: 3px 8px;
}

.option-readout {
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #9beeff;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.soft-btn.small { padding: 5px 11px; font-size: 0.72rem; }

.clip-aspects { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* Resultado */
.clip-result-wrap {
  display: flex;
  justify-content: center;
  background: #05080f;
  border-radius: 12px;
  padding: 10px;
}

.clip-result-video {
  max-height: 460px;
  max-width: 100%;
  border-radius: 10px;
  background: #000;
  display: block;
}

@media (max-width: 700px) {
  .presets { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .compare-saved { margin-left: 0; }
  .file-preview { display: none; }
  .clip-info { gap: 14px; }
  .clip-info-body { min-width: 0; }
  .clip-preview { max-width: 148px; }
  .clip-preview.original { max-width: 100%; }
  .searchbar { flex-wrap: wrap; }
  .searchbar .primary-btn { width: 100%; }
}

/* ================= Generador de enlaces de WhatsApp ================= */

.wa-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

/* El país ocupa menos que el número: la lista de prefijos es corta. */
.wa-form .option-field:first-child { flex: 0 1 250px; }

.wa-phone {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 12px;
}

.wa-phone:focus-within { border-color: var(--cyan); }

.wa-prefix {
  width: 4.5ch;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border);
  color: var(--cyan);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 7px 9px 7px 0;
  text-align: right;
}

.wa-number {
  flex: 1;
  min-width: 130px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 0.86rem;
  letter-spacing: 0.4px;
  padding: 7px 0;
}

.wa-prefix:focus-visible, .wa-number:focus-visible { outline: none; }
.wa-number:disabled, .wa-prefix:disabled { opacity: 0.45; }

.wa-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
}

.wa-check input { width: 15px; height: 15px; accent-color: var(--cyan); cursor: pointer; }

.wa-textarea {
  width: 100%;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 14px 16px;
  resize: vertical;
}

.wa-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.wa-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wa-chip:hover { border-color: rgba(34, 211, 238, 0.55); background: #1a2440; }
.wa-chip-clear { color: var(--muted); }

.wa-output {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.wa-link-row { display: flex; gap: 10px; flex-wrap: wrap; }

.wa-link {
  flex: 1;
  min-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.82rem;
  padding: 11px 13px;
}

.wa-link:focus-visible { border-color: var(--cyan); }

.wa-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.soft-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.wa-qr-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.wa-qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 260px;
  height: 260px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
}

.wa-qr-box img { width: 240px; height: 240px; }

.wa-qr-empty { font-size: 0.78rem; color: #64748b; text-align: center; padding: 0 20px; }

.wa-qr-info { flex: 1; min-width: 240px; }
.wa-qr-info h4 { font-size: 0.95rem; font-weight: 800; margin-bottom: 8px; }
.wa-qr-info p { font-size: 0.8rem; color: var(--muted); line-height: 1.6; }
.wa-qr-info p + p { margin-top: 8px; }

/* ================= Añadidos: accesibilidad y utilidades ================= */

/* Fuerza el tema oscuro en controles nativos (scrollbars, selects…). */
:root { color-scheme: dark; }

/* Texto solo para lectores de pantalla. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Fila del tamaño personalizado (el input ya no va dentro del botón). */
.custom-mb-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.custom-mb-row label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.custom-mb-row input {
  width: 84px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 9px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.custom-mb-row input:focus-visible { border-color: var(--cyan); }

/* Aviso de error en el toast (antes todo salía con el mismo estilo). */
.toast-error { border-color: rgba(251, 113, 133, 0.65); }

/* Zona de arrastre usable con teclado. */
.dropzone { cursor: pointer; }
.dropzone:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* Respeta a quien prefiere menos animaciones. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   FasTools.app - rediseño de portada, directorio y navegación compartida
   ========================================================================== */

:root {
  --bg: #080c14;
  --surface: #0e1522;
  --surface-2: #141e30;
  --border: #26334c;
  --border-soft: #1a2438;
  --text: #f1f5fb;
  --muted: #a4b0c5;
  --cyan: #22d3ee;
  --cyan-2: #06b6d4;
  --blue: #3b82f6;
  --green: #34d399;
  --red: #fb7185;
  --radius: 18px;
  --maxw: 1180px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --ring: 0 0 0 3px rgba(34, 211, 238, 0.28);
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef3fa;
  --border: #d3dce9;
  --border-soft: #e1e8f2;
  --text: #101827;
  --muted: #52617a;
  --cyan: #0e7490;
  --cyan-2: #0891b2;
  --blue: #2563eb;
  --green: #047857;
  --red: #be123c;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
  --ring: 0 0 0 3px rgba(14, 116, 144, 0.18);
}

body {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page-shell {
  width: min(calc(100% - 40px), var(--maxw));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--cyan);
  color: #041016;
  font-weight: 800;
  text-decoration: none;
  transform: translate(-50%, -180%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ---------- Cabecera y navegación ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 12, 20, 0.88);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(14px);
}

html[data-theme="light"] .site-header {
  background: rgba(244, 247, 251, 0.9);
}

.nav-shell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #041016;
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.24);
}

.brand-text {
  font-size: 1.08rem;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.brand-tools {
  color: var(--muted);
  font-weight: 600;
}

.site-menu {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.site-menu a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.site-menu a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.site-menu a[aria-current="page"] {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.09);
  border-color: rgba(34, 211, 238, 0.3);
}

html[data-theme="light"] .site-menu a[aria-current="page"] {
  background: rgba(14, 116, 144, 0.08);
  border-color: rgba(14, 116, 144, 0.25);
}

.theme-toggle,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover,
.nav-toggle:hover {
  color: var(--text);
  border-color: var(--cyan);
}

.theme-toggle-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.lang-switch a[aria-current="true"] {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
}

html[data-theme="light"] .lang-switch a[aria-current="true"] {
  color: #0e7490;
  background: rgba(14, 116, 144, 0.09);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 42px;
  padding: 9px;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

/* ---------- Hero y buscador ---------- */

.hero-v2 {
  position: relative;
  overflow: hidden;
  padding: 76px 0 58px;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(600px 280px at 50% -10%, rgba(34, 211, 238, 0.16), transparent 70%),
    linear-gradient(180deg, #0b111d 0%, var(--bg) 100%);
}

html[data-theme="light"] .hero-v2 {
  background:
    radial-gradient(600px 280px at 50% -10%, rgba(8, 145, 178, 0.12), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.hero-orbit {
  position: absolute;
  inset: auto 50% -260px auto;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(34, 211, 238, 0.12);
  border-radius: 50%;
  transform: translateX(50%);
  pointer-events: none;
}

.hero-shell {
  position: relative;
  max-width: 860px;
  text-align: center;
}

.hero-kicker,
.section-kicker {
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-v2 .hero-title {
  max-width: 900px;
  margin-inline: auto;
  font-size: clamp(2.25rem, 5.2vw, 4.1rem);
  font-weight: 850;
  line-height: 1.04;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.hero-lede {
  max-width: 650px;
  margin: 18px auto 30px;
  color: var(--muted);
  font-size: clamp(1.03rem, 1.8vw, 1.25rem);
  line-height: 1.55;
  text-wrap: balance;
}

.tools-search {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.tools-search:focus-within {
  border-color: var(--cyan);
  box-shadow: var(--ring);
}

.tools-search-icon {
  flex-shrink: 0;
  margin-left: 11px;
  color: var(--muted);
}

.tools-search input {
  flex: 1;
  min-width: 0;
  padding: 11px 6px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.tools-search input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.tools-search-btn {
  flex-shrink: 0;
  padding: 11px 17px;
  border: 0;
  border-radius: 10px;
  background: var(--cyan);
  color: #041016;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.tools-search-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.category-chip:hover {
  color: var(--text);
  border-color: var(--cyan);
}

.category-chip.is-active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #041016;
  font-weight: 800;
}

html[data-theme="light"] .category-chip.is-active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #ffffff;
}

html[data-theme="light"] .tools-search-btn,
html[data-theme="light"] .skip-link {
  color: #ffffff;
}

.hero-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.76rem;
}

/* ---------- Secciones y tarjetas ---------- */

.page-shell > .tools-section,
.page-shell > .workflow-section {
  padding: 52px 0;
  border-bottom: 1px solid var(--border-soft);
}

.page-shell > .tools-section:last-child {
  border-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.section-sub {
  max-width: 640px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tools-count {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 0;
}

.tools-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 70%),
    var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease, background 0.16s ease;
}

a.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.06), transparent 65%),
    var(--surface);
}

.tool-card.is-soon {
  border-style: dashed;
  background: var(--surface);
}

.tool-card.is-soon:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.tool-card[hidden] {
  display: none !important;
}

.tool-card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: var(--surface-2);
  font-size: 1.45rem;
  line-height: 1;
}

.tool-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}

.tool-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tool-card-name {
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.tool-card-desc {
  flex: 1;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.tool-card-category {
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tool-badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border: 1px solid rgba(52, 211, 153, 0.32);
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tool-badge.soon {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

.tools-empty {
  margin-top: 18px;
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.tools-empty[hidden] {
  display: none !important;
}

.ad-slot {
  min-height: 90px;
  margin: 28px 0;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.ad-slot[hidden] {
  display: none !important;
}

/* ---------- Flujos y herramientas relacionadas ---------- */

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
}

.workflow-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.workflow-card h3 {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.workflow-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.workflow-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px !important;
}

.workflow-links a {
  color: var(--cyan);
  font-weight: 750;
  text-decoration: none;
}

.workflow-links a:hover {
  text-decoration: underline;
}

.workflow-links span {
  color: var(--muted);
}

/* ---------- Pie de página ---------- */

.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}

.footer-shell {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  padding: 36px 0;
}

.footer-brand p {
  max-width: 390px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 10px 18px;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-note {
  grid-column: 1 / -1;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.75rem;
}

/* ---------- Ajustes del tema claro en las herramientas existentes ---------- */

html[data-theme="light"] .hero {
  background:
    radial-gradient(600px 260px at 50% 0%, rgba(8, 145, 178, 0.1), transparent 70%),
    var(--bg);
}

html[data-theme="light"] .hero-sub,
html[data-theme="light"] .section-sub,
html[data-theme="light"] .seo-block p,
html[data-theme="light"] .legal-card p,
html[data-theme="light"] .legal-card li,
html[data-theme="light"] .faq p,
html[data-theme="light"] .muted-small {
  color: var(--muted);
}

html[data-theme="light"] .legal-card h3,
html[data-theme="light"] .faq summary,
html[data-theme="light"] .format-label {
  color: var(--text);
}

html[data-theme="light"] .searchbar,
html[data-theme="light"] .dropzone,
html[data-theme="light"] .file-card,
html[data-theme="light"] .progress-notice,
html[data-theme="light"] .compare-card,
html[data-theme="light"] .legal-card,
html[data-theme="light"] .seo-block,
html[data-theme="light"] .presets,
html[data-theme="light"] .preset,
html[data-theme="light"] .compress-options,
html[data-theme="light"] .option-field select,
html[data-theme="light"] .clip-info,
html[data-theme="light"] .clip-controls,
html[data-theme="light"] .clip-result-wrap,
html[data-theme="light"] .wa-form,
html[data-theme="light"] .wa-output,
html[data-theme="light"] .wa-phone,
html[data-theme="light"] .wa-textarea,
html[data-theme="light"] .wa-chip,
html[data-theme="light"] .batch-card,
html[data-theme="light"] .format-row,
html[data-theme="light"] .asset-card,
html[data-theme="light"] .toast {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="light"] .preset:hover,
html[data-theme="light"] .format-row:hover,
html[data-theme="light"] .wa-chip:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

html[data-theme="light"] .limits-table th {
  background: var(--surface-2);
  color: var(--text);
}

html[data-theme="light"] .limits-table td {
  border-color: var(--border-soft);
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 28px), var(--maxw));
  }

  .nav-shell {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .nav-toggle {
    display: inline-flex;
    order: 2;
    margin-left: auto;
  }

  .lang-switch {
    order: 3;
  }

  .theme-toggle {
    order: 4;
  }

  .theme-toggle-text {
    display: none;
  }

  .site-menu {
    display: none;
    order: 5;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-left: 0;
    padding: 8px 0 4px;
  }

  .site-menu.is-open {
    display: flex;
  }

  .site-menu a {
    padding: 11px 13px;
  }

  .hero-v2 {
    padding: 52px 0 44px;
  }

  .tools-search-btn {
    padding-inline: 14px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .footer-shell {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 440px) {
  .hero-v2 .hero-title {
    font-size: 2.05rem;
  }

  .tools-search {
    flex-wrap: wrap;
  }

  .tools-search input {
    flex-basis: calc(100% - 40px);
  }

  .tools-search-btn {
    width: 100%;
  }
}

/* Sin JavaScript: la navegación móvil se muestra desplegada y los controles
   que dependen de JS no aparecen como botones muertos. */
html:not(.js) .nav-toggle,
html:not(.js) .theme-toggle {
  display: none !important;
}

@media (max-width: 760px) {
  html:not(.js) .nav-shell {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  html:not(.js) .site-menu {
    display: flex;
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-left: 0;
    padding: 8px 0 4px;
  }

  html:not(.js) .site-menu a {
    padding: 11px 13px;
  }
}

/* Las secciones a las que se salta con el menú o los filtros no quedan bajo
   la cabecera fija. */
#main,
.tools-section,
.related-tools {
  scroll-margin-top: 88px;
}

.related-tools {
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--border-soft);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tool-card,
  .tools-search-btn,
  .skip-link {
    transition: none;
  }
}

/* ==========================================================================
   Herramientas de imagen: comprimir, convertir y redimensionar
   ========================================================================== */

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 7px 13px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.noscript-note {
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.08);
  color: #fcd34d;
  font-size: 0.88rem;
  line-height: 1.55;
}

.image-workspace {
  margin-top: 30px;
  animation: fadeUp 0.25s ease;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.image-preview-card {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.image-preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  max-height: 340px;
  padding: 10px;
  border-radius: 12px;
  overflow: hidden;
}

.image-checker {
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #dbe3ee 25%, transparent 25%),
    linear-gradient(-45deg, #dbe3ee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dbe3ee 75%),
    linear-gradient(-45deg, transparent 75%, #dbe3ee 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.image-preview-frame img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.image-preview-empty {
  max-width: 200px;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
}

.image-preview-card figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 0 2px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.image-preview-card figcaption .muted-small {
  text-align: right;
  font-weight: 500;
}

.image-controls {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  animation: fadeUp 0.25s ease;
}

.image-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.image-options > .option-field {
  flex: 1 1 230px;
  min-width: 0;
  margin: 0;
}

.image-options .option-field > span,
.image-quality-field > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.image-quality-field output {
  color: var(--cyan);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.image-quality-field input[type="range"] {
  width: 100%;
  margin: 9px 0 4px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.image-quality-field input[type="range"]:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.field-hint {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.image-suboption {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 12, 22, 0.45);
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 650;
}

.image-suboption input[type="color"] {
  width: 46px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}

.warning-box {
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.08);
  color: #fcd34d;
  font-size: 0.8rem;
  line-height: 1.55;
}

.warning-box strong {
  display: block;
  margin-bottom: 3px;
  color: #fde68a;
  font-size: 0.84rem;
}

.warning-box p {
  color: inherit;
}

.image-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.image-note strong {
  color: var(--text);
}

.image-note.is-error {
  color: var(--red);
  font-weight: 650;
}

.image-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.working {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 12, 22, 0.5);
  color: var(--muted);
  font-size: 0.82rem;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  color: #c3cde0;
  font-size: 0.84rem;
  cursor: pointer;
}

.check-field input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.size-inputs {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.size-inputs > label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.size-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.size-input-wrap input {
  width: 96px;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.size-input-wrap:focus-within {
  border-color: var(--cyan);
  box-shadow: var(--ring);
}

.size-times {
  padding-bottom: 9px;
  color: var(--muted);
  font-size: 0.9rem;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.compare-detail {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.compare-saved.is-increase {
  color: var(--red);
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.34);
}

.result-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.seo-block code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--cyan);
  font-size: 0.78em;
}

html[data-theme="light"] .image-preview-card,
html[data-theme="light"] .image-controls,
html[data-theme="light"] .image-suboption,
html[data-theme="light"] .working {
  border-color: var(--border);
  background: var(--surface);
}

html[data-theme="light"] .image-note,
html[data-theme="light"] .field-hint,
html[data-theme="light"] .compare-detail,
html[data-theme="light"] .result-note,
html[data-theme="light"] .hero-badge {
  color: var(--muted);
}

html[data-theme="light"] .check-field {
  color: var(--text);
}

html[data-theme="light"] .warning-box {
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(251, 191, 36, 0.14);
  color: #92400e;
}

html[data-theme="light"] .warning-box strong {
  color: #78350f;
}

html[data-theme="light"] .noscript-note {
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(251, 191, 36, 0.14);
  color: #92400e;
}

@media (max-width: 700px) {
  .image-preview-grid {
    grid-template-columns: 1fr;
  }

  .image-preview-frame {
    min-height: 150px;
  }

  .image-preview-card figcaption {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .image-preview-card figcaption .muted-small {
    text-align: left;
  }

  .image-controls {
    padding: 15px;
  }

  .size-input-wrap input {
    width: 74px;
  }
}


/* ==========================================================================
   Suite PDF: unir, dividir, imágenes a PDF y PDF a JPG
   ========================================================================== */

.pdf-files {
  margin-top: 26px;
  animation: fadeUp 0.25s ease;
}

.pdf-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdf-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.pdf-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 9px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.pdf-file-info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pdf-file-name {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}

.pdf-file-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.pdf-file-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
}

.pdf-file-action {
  min-width: 30px;
  padding: 5px 8px;
  text-align: center;
}

.pdf-workspace {
  margin-top: 30px;
  animation: fadeUp 0.25s ease;
}

.pdf-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 10px;
}

.pdf-preview-card {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.pdf-preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  max-height: 225px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
}

.pdf-preview-frame canvas,
.pdf-preview-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 210px;
  object-fit: contain;
}

.pdf-preview-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.pdf-preview-card figcaption strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-preview-empty {
  padding: 14px;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  color: #fcd34d;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

.pdf-controls {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  animation: fadeUp 0.25s ease;
}

.pdf-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.pdf-options > .option-field {
  flex: 1 1 260px;
  min-width: 0;
  margin: 0;
}

.pdf-options .option-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pdf-options input[type="text"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.pdf-options input[type="text"]:focus {
  border-color: var(--cyan);
  box-shadow: var(--ring);
}

.pdf-options input[type="range"] {
  width: 100%;
  margin: 4px 0;
  accent-color: var(--cyan);
  cursor: pointer;
}

.pdf-options output {
  color: var(--cyan);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pdf-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.pdf-note strong {
  color: var(--text);
}

.pdf-note.is-error {
  color: var(--red);
  font-weight: 650;
}

.pdf-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.pdf-progress {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.pdf-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

.pdf-progress-head span:last-child {
  color: var(--cyan);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pdf-progress progress {
  display: block;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  accent-color: var(--cyan);
}

.pdf-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--surface-2);
}

.pdf-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan-2), var(--blue));
}

.pdf-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan-2), var(--blue));
}

.pdf-result-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.pdf-result-preview {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 12, 22, 0.35);
}

.pdf-result-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 190px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.pdf-result-preview figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
}

.pdf-hero .hero-badge {
  max-width: 100%;
}

html[data-theme="light"] .pdf-file-item,
html[data-theme="light"] .pdf-preview-card,
html[data-theme="light"] .pdf-controls {
  border-color: var(--border);
  background: var(--surface);
}

html[data-theme="light"] .pdf-result-preview {
  border-color: var(--border);
  background: rgba(241, 245, 249, 0.9);
}

html[data-theme="light"] .pdf-preview-empty {
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(251, 191, 36, 0.14);
  color: #92400e;
}

@media (max-width: 700px) {
  .pdf-file-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .pdf-file-info {
    flex-basis: calc(100% - 58px);
  }

  .pdf-file-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .pdf-preview-grid,
  .pdf-result-previews {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  }

  .pdf-controls {
    padding: 15px;
  }

  .pdf-progress-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

/* ================= Generador de códigos QR ================= */

.qr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.qr-tab {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.qr-tab:hover {
  border-color: rgba(34, 211, 238, 0.55);
  background: #1a2440;
}

.qr-tab.is-active {
  border-color: rgba(34, 211, 238, 0.7);
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}

.qr-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.qr-panel .option-field + .option-field,
.qr-panel .image-options + .option-field {
  margin-top: 14px;
}

.qr-panel .image-options + .check-field {
  margin-top: 14px;
}

.qr-colors {
  align-items: flex-end;
  margin-top: 16px;
}

.qr-color-field {
  flex: 0 1 180px;
}

.qr-color-field input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
}

.qr-workspace {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.qr-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 300px;
  height: 300px;
  flex-shrink: 0;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
}

.qr-preview-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.qr-preview-info {
  flex: 1;
  min-width: 240px;
}

.qr-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  font-weight: 700;
}

.qr-payload {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: #cfe3ff;
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  max-height: 150px;
  overflow: auto;
}

.qr-preview-info .wa-actions {
  margin-top: 14px;
}

/* ================= Transcripción ================= */

.transcript-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.transcript-stats span {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
}

.transcript-stats strong {
  color: var(--text);
  font-weight: 800;
}

.transcript-text {
  min-height: 260px;
  margin-top: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.transcript-text:focus-visible {
  border-color: var(--cyan);
  outline: none;
}

@media (max-width: 760px) {
  .qr-preview-box {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
}

html[data-theme="light"] .qr-tab:hover {
  background: #e8eef7;
}

html[data-theme="light"] .qr-preview-box {
  border: 1px solid var(--border);
}
