/* SaveAllVid — estilo app iOS (Human Interface Guidelines): tipografía del sistema, modo claro/oscuro automático,
   listas agrupadas, barras translúcidas y controles nativos. Colores = colores del sistema de iOS. */

/* ---------- Colores (claro) ---------- */
:root {
  color-scheme: light dark;
  --bg: #f2f2f7;                       /* systemGroupedBackground */
  --bg-2: #f2f2f7;
  --surface: #ffffff;                  /* secondarySystemGroupedBackground */
  --surface-2: #f2f2f7;                /* tertiary (dentro de una celda) */
  --surface-3: #e5e5ea;
  --fill: rgba(118, 118, 128, 0.12);   /* tertiarySystemFill */
  --fill-strong: rgba(118, 118, 128, 0.2);
  --border: rgba(60, 60, 67, 0.13);    /* separator */
  --border-strong: rgba(60, 60, 67, 0.22);
  --text: #000000;                     /* label */
  --muted: rgba(60, 60, 67, 0.6);      /* secondaryLabel */
  --faint: rgba(60, 60, 67, 0.3);      /* tertiaryLabel */
  --accent: #ff2d55;                   /* systemPink: el tinte de la app */
  --accent-2: #ff9500;
  --accent-soft: rgba(255, 45, 85, 0.1);
  --accent-line: rgba(255, 45, 85, 0.35);
  --accent-text: #e0204a;
  --on-accent: #ffffff;
  --ok: #34c759;                       /* systemGreen */
  --ok-soft: rgba(52, 199, 89, 0.12);
  --danger: #ff3b30;                   /* systemRed */
  --danger-soft: rgba(255, 59, 48, 0.1);
  --blue: #007aff;
  --bar: rgba(249, 249, 249, 0.78);    /* barras translúcidas */
  --overlay: rgba(0, 0, 0, 0.4);
  --grad: linear-gradient(135deg, #ff2d55, #ff6a3d);
  --radius: 12px;
  --radius-lg: 16px;
  --hair: 1px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Colores (oscuro) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-2: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --surface-3: #3a3a3c;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-strong: rgba(118, 118, 128, 0.32);
    --border: rgba(84, 84, 88, 0.42);
    --border-strong: rgba(84, 84, 88, 0.6);
    --text: #ffffff;
    --muted: rgba(235, 235, 245, 0.6);
    --faint: rgba(235, 235, 245, 0.3);
    --accent: #ff375f;
    --accent-2: #ff9f0a;
    --accent-soft: rgba(255, 55, 95, 0.16);
    --accent-line: rgba(255, 55, 95, 0.45);
    --accent-text: #ff6482;
    --ok: #30d158;
    --ok-soft: rgba(48, 209, 88, 0.16);
    --danger: #ff453a;
    --danger-soft: rgba(255, 69, 58, 0.16);
    --blue: #0a84ff;
    --bar: rgba(22, 22, 24, 0.78);
    --overlay: rgba(0, 0, 0, 0.6);
    --shadow: none;
    --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.6);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;                 /* «Body» de iOS */
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 12px; top: 12px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 10px; z-index: 300; }

/* ---------- Barra de navegación (translúcida) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bar);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: var(--hair) solid var(--border-strong);
  padding-top: env(safe-area-inset-top);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; border-radius: 7px; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a:not(.btn) { color: var(--accent-text); font-size: 15px; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.nav a:not(.btn):hover { background: var(--fill); text-decoration: none; }
.nav .btn { margin-inline: 6px 2px; }
.lang-select {
  appearance: none; -webkit-appearance: none;
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 12px;
  color: var(--text); border: 0; border-radius: 99px; padding: 6px 26px 6px 12px;
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; max-width: 140px;
}
[dir="rtl"] .lang-select { background-position: left 8px center; padding: 6px 12px 6px 26px; }

/* ---------- Botones ---------- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px;
  border: 0; border-radius: 14px;
  background: var(--accent); color: var(--on-accent);
  font: inherit; font-size: 17px; font-weight: 600; letter-spacing: -0.02em;
  cursor: pointer; transition: opacity 0.15s, transform 0.1s, background 0.15s;
}
.btn:hover { color: var(--on-accent); text-decoration: none; opacity: 0.9; }
.btn:active { transform: scale(0.98); opacity: 0.8; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn svg { width: 19px; height: 19px; }
.btn-ghost, button.btn-ghost { background: var(--fill); color: var(--accent-text); }
.btn-ghost:hover { color: var(--accent-text); }
.btn-sm, button.btn-sm { min-height: 34px; padding: 0 14px; font-size: 15px; border-radius: 99px; }
.btn-block { width: 100%; }

/* ---------- Portada: título grande ---------- */
.hero { padding: 28px 0 40px; }
.hero-head { max-width: 720px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: -0.01em; text-transform: uppercase;
}
.eyebrow .mono { width: 20px; height: 20px; border-radius: 5px; font-size: 11px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.hero h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.07; letter-spacing: -0.03em; font-weight: 700; margin: 6px 0 12px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { color: var(--muted); font-size: clamp(17px, 2vw, 19px); line-height: 1.45; margin: 0; }
.chips { max-width: 720px; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 16px auto 0; list-style: none; }
.chips li { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; box-shadow: var(--shadow); }
.chips svg { width: 15px; height: 15px; color: var(--ok); flex: none; }

/* ---------- Descargador: grupo de celdas ---------- */
.tool {
  max-width: 720px; margin: 22px auto 0;
  background: var(--surface); border-radius: 20px; padding: 18px;
  box-shadow: var(--shadow);
}
.tool-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin: 0 2px 14px; }
.tool h2 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.tool .sub { color: var(--muted); font-size: 15px; margin: 0; }
.tool .sub strong { color: var(--text); font-weight: 600; }
.tool form { display: flex; flex-direction: column; gap: 12px; }

/* Campo de enlace: como el buscador de iOS */
.field {
  position: relative; display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 6px; border-radius: 14px;
  background: var(--fill); border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.field:focus-within { border-color: var(--accent-line); background: var(--surface); }
.field.locked { opacity: 0.5; }
.field-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 15px; }
.field-ico svg { width: 20px; height: 20px; }
.field-ico.hit { background: hsl(var(--h) 85% 55% / 0.15); color: hsl(var(--h) 70% 42%); }
.field-ico.has-logo { background: #fff; padding: 5px; box-shadow: 0 0 0 var(--hair) var(--border-strong); }
.field-ico img { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; }
.field-ico.miss { background: var(--danger-soft); color: var(--danger); }
.field input { flex: 1; min-width: 0; padding: 10px 4px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 17px; }
.field input:focus { outline: none; }
.field input::placeholder { color: var(--muted); }
.field input:disabled { cursor: not-allowed; }
.field-tag { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); padding: 3px 9px; border-radius: 99px; background: var(--fill); display: none; white-space: nowrap; }
.field-tag.show { display: inline-block; }
.field-tag.miss { color: var(--danger); background: var(--danger-soft); }
button.clear { display: none; flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: var(--faint); color: var(--surface); font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; }
.field.has-value button.clear { display: block; }
.field .paste { flex: none; min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 15px; }
.field.has-value .paste { display: none; }

/* Declaración: celda con interruptor de iOS */
.consent {
  display: flex; gap: 14px; align-items: center; flex-direction: row-reverse; justify-content: space-between;
  padding: 12px 14px; border-radius: 14px; background: var(--surface-2);
  font-size: 14px; color: var(--muted); line-height: 1.4; cursor: pointer;
}
.consent span { flex: 1; }
.consent input, .consent input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  position: relative; width: 51px; height: 31px; border-radius: 99px; cursor: pointer;
  background: var(--fill-strong); transition: background 0.2s;
}
.consent input::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.4, 1);
}
.consent input:checked { background: var(--ok); }
.consent input:checked::before { transform: translateX(20px); }
[dir="rtl"] .consent input::before { left: auto; right: 2px; }
[dir="rtl"] .consent input:checked::before { transform: translateX(-20px); }
.misuse { margin: 0 4px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.misuse a { color: var(--accent-text); }

.status { display: none; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; padding: 4px 2px; }
.status.show { display: flex; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--fill-strong); border-top-color: var(--muted); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.flash { background: var(--danger-soft); color: var(--danger); padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.4; word-break: break-word; }
.app-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--accent-soft); color: var(--text); }
.app-note .btn { flex: none; }

/* Vista previa */
.preview {
  display: none; grid-template-columns: 240px 1fr; gap: 16px;
  padding: 12px; border-radius: 16px; background: var(--surface-2);
  animation: rise 0.3s cubic-bezier(0.3, 0.7, 0.4, 1);
}
.preview.show { display: grid; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }
.preview-media { position: relative; align-self: start; }
.preview img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: var(--fill); }
.duration { position: absolute; inset-inline-end: 7px; bottom: 7px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.duration:empty { display: none; }
.preview-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.preview .title { font-weight: 600; font-size: 17px; line-height: 1.3; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview .meta { color: var(--muted); font-size: 14px; margin-top: -4px; line-height: 1.3; }

/* Calidades: cápsulas seleccionables */
.qualities { display: grid; gap: 12px; }
.qgroup { display: grid; gap: 7px; }
.qgroup-title { font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: 0; color: var(--muted); padding-inline-start: 2px; }
.qrow { display: flex; flex-wrap: wrap; gap: 8px; }
.qualities label { position: relative; cursor: pointer; }
.qualities input { position: absolute; opacity: 0; pointer-events: none; }
.qualities label > span {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 14px; border-radius: 12px; min-width: 78px;
  background: var(--surface); box-shadow: 0 0 0 var(--hair) var(--border-strong);
  font-weight: 600; font-size: 15px; line-height: 1.25; transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.qualities label > span small { font-weight: 400; font-size: 12px; color: var(--muted); }
.qualities input:checked + span { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.qualities input:checked + span small { color: rgba(255, 255, 255, 0.82); }
.qualities input:focus-visible + span { outline: 3px solid var(--accent-line); outline-offset: 2px; }
.qualities label.locked { cursor: pointer; }
.qualities label.locked > span { opacity: 0.45; }
.qualities label.locked small { color: var(--accent-text); }

.progress { display: none; flex-direction: column; gap: 8px; }
.progress.show { display: flex; }
.pbar { height: 4px; border-radius: 99px; background: var(--fill-strong); overflow: hidden; }
.pfill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width 0.4s; }
.pbar.indeterminate .pfill { width: 35% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { margin-inline-start: -35%; } 100% { margin-inline-start: 100%; } }
.progress.error .ptext { color: var(--danger); }
.ptext { color: var(--muted); font-size: 14px; }

.tool-foot { display: grid; gap: 10px; margin-top: 14px; }
.notice { margin: 0; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.notice strong { color: var(--text); font-weight: 600; }
.tool-note { margin: 0 4px; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* Miniatura que no carga */
.thumb-ph { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--fill) center / 30px no-repeat; }
.thumb-ph.video { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='15' height='14' rx='2'/%3E%3Cpath d='M17 10l5-3v10l-5-3z'/%3E%3C/svg%3E"); }
.thumb-retry { position: absolute; top: 8px; inset-inline-end: 8px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--bar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--accent-text); font-size: 18px; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }

/* Sitios en movimiento */
.marquee { margin: 26px auto 0; max-width: 980px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 8px; width: max-content; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 6px; border-radius: 99px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; box-shadow: var(--shadow); }
.mono { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 6px; background: hsl(var(--h) 85% 55% / 0.15); color: hsl(var(--h) 70% 42%); font-weight: 700; font-size: 12px; }
img.logo { display: block; background: #fff; object-fit: contain; padding: 2px; box-shadow: 0 0 0 var(--hair) var(--border-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mono, :root:not([data-theme="light"]) .field-ico.hit { color: hsl(var(--h) 90% 72%); }
}

@media (min-width: 1024px) {
  .hero { padding: 48px 0 40px; }
  .hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 48px; align-items: center; }
  .hero-head { grid-column: 1; grid-row: 1; margin: 0; }
  .chips { grid-column: 1; grid-row: 2; margin: 18px 0 0; align-self: start; }
  .tool { grid-column: 2; grid-row: 1 / span 2; margin: 0; width: 100%; }
  .marquee { grid-column: 1 / -1; grid-row: 3; margin-top: 36px; }
}

/* ---------- Secciones ---------- */
section { padding: 44px 0; }
.section-alt { background: transparent; }
.section-head { max-width: 720px; margin: 0 0 18px; }
.section-head h2 { font-size: clamp(28px, 4vw, 34px); letter-spacing: -0.025em; line-height: 1.12; font-weight: 700; margin: 0 0 6px; }
.section-head p { color: var(--muted); margin: 0; font-size: 17px; }
.kicker { display: block; color: var(--muted); font-size: 13px; font-weight: 400; text-transform: uppercase; margin-bottom: 4px; }

/* Sitios: lista agrupada (como Ajustes) */
.services-group { display: flex; align-items: center; gap: 8px; margin: 26px 16px 7px; font-size: 13px; font-weight: 400; text-transform: uppercase; color: var(--muted); }
.services-group:first-of-type { margin-top: 0; }
.services-group span { padding: 0 7px; border-radius: 99px; background: var(--fill); color: var(--muted); font-size: 12px; font-weight: 600; }
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 0; margin: 0; list-style: none; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.services li { position: relative; background: var(--surface); transition: background 0.15s; }
.services li::after { content: ""; position: absolute; left: 58px; right: 0; bottom: 0; height: var(--hair); background: var(--border); }
[dir="rtl"] .services li::after { left: 0; right: 58px; }
.services li > a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 9px 16px; color: inherit; }
.services li > a:hover { text-decoration: none; }
.services li > a::after { content: ""; flex: none; margin-inline-start: auto; width: 8px; height: 8px; border: solid var(--faint); border-width: 2px 2px 0 0; transform: rotate(45deg); }
[dir="rtl"] .services li > a::after { transform: rotate(-135deg); }
.services li:hover { background: var(--fill); }
.services li.current { background: var(--accent-soft); }
.services .mono, .services img.logo { width: 30px; height: 30px; border-radius: 7px; font-size: 14px; }
.services strong { display: block; font-size: 17px; font-weight: 400; line-height: 1.25; }
.services small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.services li a > div { min-width: 0; }

/* Pasos */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: step; padding: 0; margin: 0; list-style: none; }
.steps li { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; counter-increment: step; box-shadow: var(--shadow); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 14px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 700; }
.steps h3, .card h3 { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.steps p, .card p { color: var(--muted); font-size: 15px; margin: 0; line-height: 1.4; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.card .ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: var(--on-accent); margin-bottom: 14px; }
.card:nth-child(3n + 2) .ico { background: var(--blue); }
.card:nth-child(3n) .ico { background: var(--ok); }
.card .ico svg { width: 22px; height: 22px; }

/* Uso responsable: dos listas agrupadas */
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rule-box { border-radius: var(--radius-lg); padding: 6px 0; background: var(--surface); box-shadow: var(--shadow); }
.rule-box h3 { margin: 10px 16px 6px; font-size: 13px; font-weight: 400; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.rule-box ul { margin: 0; padding: 0; list-style: none; }
.rule-box li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 16px; font-size: 15px; line-height: 1.4; border-top: var(--hair) solid var(--border); }
.rule-box li svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.rule-ok li svg, .rule-ok h3 svg { color: var(--ok); }
.rule-no li svg, .rule-no h3 svg { color: var(--danger); }
.rule-box h3 svg { width: 16px; height: 16px; }

/* Preguntas frecuentes: lista con flecha */
.faq { max-width: 820px; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.faq details { border-bottom: var(--hair) solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; padding: 14px 16px; font-size: 17px; font-weight: 400; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary:hover { background: var(--fill); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 8px; height: 8px; border: solid var(--faint); border-width: 2px 2px 0 0; transform: rotate(135deg); transition: transform 0.2s; margin-top: -4px; }
.faq details[open] summary::after { transform: rotate(-45deg); margin-top: 4px; }
.faq details p { margin: 0; padding: 0 16px 16px; color: var(--muted); font-size: 15px; line-height: 1.45; }

/* Llamada final */
.cta { padding-top: 12px; }
.cta-box { padding: 32px 22px; border-radius: 20px; background: var(--surface); text-align: center; box-shadow: var(--shadow); }
.cta-box h2 { margin: 0 0 8px; font-size: clamp(24px, 3.4vw, 30px); letter-spacing: -0.025em; }
.cta-box p { margin: 0 auto 20px; color: var(--muted); max-width: 520px; }

/* ---------- App para Android ---------- */
.app-wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; align-items: center; }
.app-copy h2 { font-size: clamp(28px, 4vw, 34px); letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 8px; }
.app-copy p { color: var(--muted); margin: 0 0 18px; }
.app-req { font-size: 13px; color: var(--muted) !important; margin: 12px 0 0 !important; }

/* ---------- Pie ---------- */
.site-footer { padding: 32px 0 40px; color: var(--muted); font-size: 13px; }
.footer-grid { display: flex; justify-content: space-between; align-items: center; gap: 16px 28px; flex-wrap: wrap; margin-bottom: 18px; }
.footer-links { display: flex; gap: 6px 20px; flex-wrap: wrap; }
.footer-links a { color: var(--accent-text); font-size: 15px; }
.disclaimer { font-size: 12px; line-height: 1.5; max-width: 860px; margin: 0 0 10px; color: var(--muted); }
.copy { font-size: 12px; margin: 0; color: var(--muted); }

/* ---------- Aviso +18: alerta de iOS ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 24px;
  background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.gate-open:not(.age-ok) .gate { display: flex; }
html.gate-open:not(.age-ok) body { overflow: hidden; }
.gate-box {
  width: 100%; max-width: 320px; text-align: center; overflow: hidden;
  background: var(--bar); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-radius: 16px; padding: 22px 18px 0; box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  animation: pop 0.25s cubic-bezier(0.3, 0.7, 0.4, 1);
}
@keyframes pop { from { opacity: 0; transform: scale(1.12); } to { opacity: 1; transform: none; } }
.gate-badge { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 13px; background: var(--grad); color: #fff; font-weight: 700; font-size: 19px; margin-bottom: 12px; }
.gate-box h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.gate-box p { margin: 0 0 18px; color: var(--text); font-size: 13px; line-height: 1.4; }
.gate-actions { display: grid; margin: 0 -18px; border-top: var(--hair) solid var(--border-strong); }
.gate-actions .btn { min-height: 44px; border-radius: 0; background: transparent; color: var(--blue); font-weight: 600; font-size: 17px; }
.gate-actions .btn + .btn { border-top: var(--hair) solid var(--border-strong); font-weight: 400; }
.gate-actions .btn:hover { background: var(--fill); opacity: 1; }

/* Páginas sin conexión y 404 */
.offline { padding: 64px 0; }
.offline .gate-box { margin: 0 auto; max-width: 380px; background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; padding: 26px 22px 22px; box-shadow: var(--shadow); animation: none; }
.offline .gate-box p { color: var(--muted); font-size: 15px; }
.offline .gate-badge svg { width: 30px; height: 30px; }
.offline h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.e404-sites { list-style: none; padding: 0; margin: 24px auto 0; max-width: 520px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.e404-sites a { display: inline-block; padding: 6px 13px; border-radius: 99px; background: var(--surface); color: var(--accent-text); font-size: 15px; box-shadow: var(--shadow); }

/* Instalar en iPhone */

/* ---------- Bienvenida: hoja que sube desde abajo ---------- */
.welcome-modal {
  position: fixed; inset: 0; z-index: 150; overflow-y: auto;
  padding: 40px 0 0; background: var(--overlay);
  /* margin-top:auto en la hoja (no align-items:flex-end): si es más alta que la pantalla, su parte de arriba
     sigue siendo alcanzable al desplazar. */
  display: flex; flex-direction: column; align-items: center;
}
html.welcome-open body { overflow: hidden; }
html.welcome-open .gate { display: none !important; }
.welcome-box {
  position: relative; width: 100%; max-width: 560px; display: grid; gap: 12px; margin-top: auto; flex: none;
  background: var(--bg); border-radius: 14px 14px 0 0;
  padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-sheet); animation: sheet 0.35s cubic-bezier(0.3, 0.7, 0.4, 1);
}
.welcome-box::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 99px; background: var(--fill-strong); }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
.welcome-logo { width: 56px; height: 56px; border-radius: 13px; }
.welcome-box h2 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.025em; }
.welcome-box h3 { margin: 10px 4px 0; font-size: 13px; font-weight: 400; text-transform: uppercase; color: var(--muted); }
.welcome-langs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.welcome-langs a { position: relative; padding: 13px 16px; color: var(--text); font-size: 17px; border-bottom: var(--hair) solid var(--border); }
.welcome-langs a:nth-child(odd) { border-inline-end: var(--hair) solid var(--border); }
.welcome-langs a:nth-last-child(-n + 2) { border-bottom: 0; }
.welcome-langs a:hover { background: var(--fill); text-decoration: none; }
.welcome-langs a.current { color: var(--accent-text); font-weight: 600; }
.welcome-langs a.current::after { content: ""; position: absolute; inset-inline-end: 16px; top: 50%; width: 6px; height: 12px; margin-top: -8px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.welcome-text { margin: 0 4px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.welcome-box form { display: grid; gap: 12px; }
.welcome-box .consent { background: var(--surface); }
@media (min-width: 700px) {
  .welcome-modal { padding: 32px 16px; }
  .welcome-box { margin: auto; border-radius: 16px; padding-bottom: 24px; animation-name: pop; }
  .welcome-box::before { display: none; }
}

/* ---------- Páginas legales ---------- */
.legal { padding: 28px 0 64px; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(30px, 5vw, 40px); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 6px; font-weight: 700; }
.legal .updated { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
.legal h2 { font-size: 22px; font-weight: 700; margin: 36px 0 8px; letter-spacing: -0.02em; }
.legal p, .legal li { font-size: 17px; line-height: 1.5; }
.legal ul, .legal ol { padding-inline-start: 22px; }
.legal li { margin: 6px 0; }
.legal .callout { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: 20px 0; box-shadow: var(--shadow); border-inline-start: 4px solid var(--accent); }
.legal .callout p { margin: 0; font-size: 15px; }
.legal .callout.warn { border-inline-start-color: var(--danger); }
.toc { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 8px; box-shadow: var(--shadow); }
.toc strong { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 400; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; columns: 2; column-gap: 28px; font-size: 15px; }
.legal table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 16px 0; font-size: 15px; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.legal th, .legal td { text-align: start; padding: 10px 12px; border-bottom: var(--hair) solid var(--border); vertical-align: top; }
.legal tr:last-child td { border-bottom: 0; }
.legal th { font-weight: 600; font-size: 13px; color: var(--muted); text-transform: uppercase; }

/* ---------- Barra de pestañas (móvil) ---------- */
.tabbar { display: none; }
@media (max-width: 820px) {
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 6px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: var(--hair) solid var(--border-strong);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 0; padding: 2px 0; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="true"] { color: var(--accent); }
  .tabbar svg { width: 25px; height: 25px; }
  body:has(.tabbar) { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
}

/* ---------- Idiomas y escritura ---------- */
[dir="rtl"] .field input[type="url"] { direction: ltr; text-align: left; }
html[lang="ar"], html[lang="hi"], html[lang="ja"], html[lang="zh"] { --font: -apple-system, system-ui, "Segoe UI", "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans CJK SC", "Noto Sans CJK JP", sans-serif; }
html[lang="ar"] body, html[lang="hi"] body, html[lang="ja"] body, html[lang="zh"] body { letter-spacing: 0; }
html[lang="ar"] .hero h1, html[lang="hi"] .hero h1, html[lang="ja"] .hero h1, html[lang="zh"] .hero h1 { letter-spacing: 0; line-height: 1.2; }

/* ---------- Pantallas ---------- */
@media (max-width: 900px) {
  .steps, .grid-3, .rules { grid-template-columns: 1fr; }
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-wrap { grid-template-columns: 1fr; gap: 20px; }
  .toc ol { columns: 1; }
}
@media (max-width: 820px) {
  .nav a:not(.btn) { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .hero { padding: 18px 0 28px; }
  .tool { padding: 14px; border-radius: 16px; margin-top: 18px; }
  .preview { grid-template-columns: 1fr; }
  .field-tag { display: none !important; }
  .services { grid-template-columns: 1fr; }
  .nav .btn { display: none; }
  section { padding: 30px 0; }
  .app-note { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 2s; }
  .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee { mask-image: none; -webkit-mask-image: none; }
  .marquee-track [aria-hidden="true"] { display: none; }
  .preview, .gate-box, .welcome-box { animation: none; }
}
.welcome-modal:focus { outline: none; }

/* Preguntas frecuentes centradas en escritorio (título y lista en la misma columna). */
@media (min-width: 821px) {
  #faq .section-head { margin-inline: auto; text-align: center; max-width: 820px; }
  #faq .faq { margin-inline: auto; }
}

/* Saldo de datos de la hora (web) */
.quota-line { margin: -4px 2px 0; font-size: 13px; color: var(--muted); }
.qualities label.over small { color: var(--danger); }
.qualities label.open:not(.over) small { color: var(--ok); }

/* ---------- Web informativa: tarjeta «descárgalo con la app» ---------- */
.ext-steps { margin: 16px 0 0; padding-inline-start: 22px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.ext-steps li { margin: 2px 0; }
.ext-steps strong { color: var(--text); }
.app-features { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.app-features li { display: flex; align-items: center; gap: 12px; padding: 13px 16px; font-size: 16px; border-top: var(--hair) solid var(--border); }
.app-features li:first-child { border-top: 0; }
.app-features svg { width: 20px; height: 20px; flex: none; color: var(--ok); }

/* ---------- Carrusel (varias fotos/vídeos en un post) ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.g-item { position: relative; cursor: pointer; }
.g-item input { position: absolute; opacity: 0; pointer-events: none; }
.g-thumb { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--fill); box-shadow: 0 0 0 var(--hair) var(--border-strong); transition: opacity .15s; }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-thumb .thumb-ph { aspect-ratio: 1; border-radius: 0; }
.g-item input:not(:checked) + .g-thumb { opacity: .55; }
/* Las fotos no usan el estilo de «píldora» de las calidades: solo un borde fino al marcarlas. */
.qualities .g-item > .g-thumb { display: block; padding: 0; min-width: 0; min-height: 0; background: var(--fill); color: inherit; border: 0; }
.qualities .g-item input:checked + .g-thumb { background: var(--fill); box-shadow: 0 0 0 3px var(--accent); }
.g-item input:focus-visible + span { outline: 3px solid var(--accent-line); outline-offset: 2px; }
/* Casilla estilo Fotos de iOS: círculo vacío o relleno con ✓ */
.g-check { position: absolute; top: 5px; inset-inline-end: 5px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, 0.25); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.g-item input:checked + .g-thumb .g-check { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat; }
.g-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.g-toggle { appearance: none; border: 0; background: none; padding: 0; color: var(--accent-text); font: 600 13px/1.2 var(--font); text-transform: none; letter-spacing: 0; cursor: pointer; white-space: nowrap; }
.g-num { position: absolute; top: 5px; inset-inline-start: 5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.g-badge { position: absolute; bottom: 5px; inset-inline-end: 5px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 10px; display: grid; place-items: center; }
@media (max-width: 640px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- Web informativa: extensión (ordenador), app (Android) o aviso (iPhone), según el dispositivo ---- */
.get { display: grid; gap: 12px; }
.get-card { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.get-head { display: flex; gap: 12px; align-items: flex-start; }
.get-head svg { flex: none; width: 28px; height: 28px; color: var(--accent); margin-top: 2px; }
.get-head strong { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; }
.get-head p, .get-ios p { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.get-ios p { margin: 0; color: var(--text); }
.get .btn svg { width: 18px; height: 18px; }
.get-more { justify-self: start; font-size: 14px; }
.get-all { justify-self: start; appearance: none; border: 0; background: none; padding: 0; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; cursor: pointer; }
html[data-device="desktop"] .get-android, html[data-device="desktop"] .get-ios,
html[data-device="android"] .get-desktop, html[data-device="android"] .get-ios,
html[data-device="ios"] .get-desktop, html[data-device="ios"] .get-android,
html:not([data-device]) .get-all, html[data-device="all"] .get-all { display: none; }
/* Menú y barra inferior: «Extensión» en el ordenador (y en iPhone, donde no hay app), «App» en Android.
   Sin JavaScript, o tras «¿Usas otro dispositivo?», se ven las dos. */
html[data-device="desktop"] .only-app, html[data-device="ios"] .only-app, html[data-device="android"] .only-ext { display: none !important; }
.get { margin-top: 18px; }
.get-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }
#note.session-only .only-app { display: none !important; }
#note.session-only .only-ext { display: inline-flex !important; }
