/* ==========================================================================
   Endulzat — hoja de estilo única.
   Secciones: 1 tokens · 2 base · 3 layout · 4 cabecera/pie · 5 tarjeta de
   herramienta · 6 controles · 7 resultados · 8 contenido SEO/FAQ · 9 anuncios
   · 10 portada · 11 utilidades · 12 responsive
   ========================================================================== */

/* --- 1. Tokens ---------------------------------------------------------- */
:root {
  --ink:            #14181b;
  --ink-soft:       #4a5560;
  --ink-faint:      #7b8794;
  --bg:             #f7f8f7;
  --surface:        #ffffff;
  --surface-2:      #f0f2f1;
  --line:           #dfe4e2;
  --line-strong:    #c6cecb;

  --accent:         #0d9488;
  --accent-strong:  #0b7c72;
  --accent-soft:    #e2f4f1;
  --warn:           #b45309;
  --warn-soft:      #fdf3e3;
  --danger:         #b3261e;
  --danger-soft:    #fdeceb;

  --radius:         14px;
  --radius-sm:      9px;
  --shadow:         0 1px 2px rgba(20, 24, 27, .05), 0 8px 24px -12px rgba(20, 24, 27, .18);
  --shadow-lift:    0 2px 4px rgba(20, 24, 27, .06), 0 16px 40px -16px rgba(20, 24, 27, .28);

  --wrap:           1080px;
  --wrap-narrow:    720px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:           #e9edeb;
    --ink-soft:      #a3aeb4;
    --ink-faint:     #7d888e;
    --bg:            #101314;
    --surface:       #191d1f;
    --surface-2:     #212628;
    --line:          #2c3234;
    --line-strong:   #3d4548;

    --accent:        #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft:   #14312e;
    --warn:          #fbbf24;
    --warn-soft:     #33270f;
    --danger:        #fca5a5;
    --danger-soft:   #3a1d1b;

    --shadow:        0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lift:   0 2px 4px rgba(0, 0, 0, .45), 0 16px 40px -16px rgba(0, 0, 0, .7);
  }
}

/* --- 2. Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 700; }
p  { margin: 0 0 1em; }

a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

code, kbd { font-family: var(--mono); font-size: .9em; }

/* --- 3. Layout ---------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.wrap--narrow { max-width: var(--wrap-narrow); }
main { display: block; }

.section { padding-block: clamp(32px, 5vw, 56px); }
.section + .section { padding-top: 0; }

/* --- 4. Cabecera y pie -------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem;
  color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand__mark {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  border-radius: 7px;
}
@media (prefers-color-scheme: dark) { .brand__mark { color: #06201d; } }
.brand__mark svg { width: 16px; height: 16px; }

.site-nav { display: flex; align-items: center; gap: 18px; font-size: .95rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.site-nav a:hover { color: var(--accent-strong); text-decoration: underline; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 48px; padding-block: 28px;
  color: var(--ink-faint); font-size: .9rem;
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* --- 5. Cabecera de herramienta + tarjeta ------------------------------- */
.tool-head { padding-top: clamp(24px, 4vw, 40px); text-align: center; }
.tool-head p.lede {
  color: var(--ink-soft); font-size: 1.05rem;
  max-width: 60ch; margin-inline: auto;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 26px);
  margin-top: 20px;
}

/* Máquina de estados: un único data-state en .tool-card manda sobre todo. */
[data-panel] { display: none; }
.tool-card[data-state="idle"]    [data-panel="idle"],
.tool-card[data-state="loading"] [data-panel="loading"],
.tool-card[data-state="working"] [data-panel="working"],
.tool-card[data-state="done"]    [data-panel="done"],
.tool-card[data-state="error"]   [data-panel="error"] { display: block; }

/* Sin JS no hay herramienta: se avisa en vez de dejar botones muertos. */
.needs-js {
  display: block;
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid currentColor; border-radius: var(--radius-sm);
  padding: 14px 16px; font-weight: 600; font-size: .95rem;
}
.js .needs-js { display: none; }
.tool-card__body { display: none; }
.js .tool-card__body { display: block; }

/* Zona de soltar archivos */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  min-height: 168px; padding: 24px 18px;
  border: 2px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.dropzone svg { width: 30px; height: 30px; color: var(--accent); }
.dropzone strong { font-size: 1.05rem; }
.dropzone span { color: var(--ink-soft); font-size: .92rem; }
.dropzone input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Insignia de privacidad + límites honestos */
.privacy-badge {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 14px; padding: 11px 14px;
  background: var(--accent-soft); border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--ink-soft); line-height: 1.5;
}
.privacy-badge svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--accent-strong); }
.privacy-badge b { color: var(--ink); }
.limits { margin-top: 8px; font-size: .85rem; color: var(--ink-faint); text-align: center; }

/* --- 6. Controles ------------------------------------------------------- */
.controls { display: grid; gap: 16px; margin-top: 18px; }
.controls--2 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.field { display: grid; gap: 6px; }
.field > label, .field__label {
  font-size: .85rem; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .04em;
}
.field__hint { font-size: .82rem; color: var(--ink-faint); }

input[type="text"], input[type="url"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; padding: 11px 13px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline-offset: 1px; }

input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="color"] {
  width: 100%; height: 42px; padding: 3px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); cursor: pointer;
}

/* Grupo de opciones tipo segmented control */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: .92rem; font-weight: 600; color: var(--ink-soft);
  transition: background .15s, color .15s, border-color .15s;
}
.segmented label:hover { border-color: var(--accent); color: var(--accent-strong); }
.segmented input:checked + label { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .segmented input:checked + label { color: #06201d; } }
.segmented input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.segmented input:disabled + label { opacity: .45; cursor: not-allowed; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font: inherit; font-size: 1rem; font-weight: 700;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn--primary { color: #06201d; }
  .btn--primary:hover { color: #06201d; }
}
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn--big { width: 100%; padding: 15px 22px; font-size: 1.08rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1 1 190px; }

.linky {
  background: none; border: 0; padding: 0; margin-top: 14px;
  font: inherit; font-size: .92rem; font-weight: 600;
  color: var(--ink-soft); cursor: pointer; text-decoration: underline;
}
.linky:hover { color: var(--accent-strong); }

/* --- 7. Progreso y resultados ------------------------------------------ */
.progress {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
}
.progress__bar {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width .25s ease;
}
.status { margin-top: 10px; text-align: center; color: var(--ink-soft); font-size: .95rem; }
.status strong { color: var(--ink); }

.error-box {
  background: var(--danger-soft); border: 1px solid var(--danger);
  border-radius: var(--radius-sm); padding: 14px 16px; color: var(--ink);
}
.error-box h3 { color: var(--danger); margin-bottom: .3em; }
.error-box p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* Vista previa del QR */
.qr-stage {
  display: grid; place-items: center;
  min-height: 260px; padding: 18px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.qr-stage > div { line-height: 0; max-width: 100%; }
.qr-stage canvas, .qr-stage svg { max-width: 100%; height: auto; border-radius: 6px; }

/* Lista de archivos (conversor / compresor) */
.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.file-item {
  display: grid; gap: 4px;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.file-item__name {
  font-weight: 650; font-size: .95rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-item__meta { grid-column: 1; font-size: .86rem; color: var(--ink-soft); }
.file-item__action { grid-row: 1 / span 2; grid-column: 2; }
.file-item[data-ok="no"] .file-item__meta { color: var(--danger); }

.saving { font-weight: 700; color: var(--accent-strong); }
.saving[data-neg="yes"] { color: var(--warn); }

.summary-line {
  margin-top: 14px; padding: 12px 14px;
  background: var(--accent-soft); border-radius: var(--radius-sm);
  font-size: .95rem; text-align: center;
}

/* --- 8. Contenido SEO, pasos y FAQ ------------------------------------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.steps li { display: grid; gap: 6px; }
.steps svg { width: 24px; height: 24px; color: var(--accent); }
.steps b { font-size: 1rem; }
.steps span { color: var(--ink-soft); font-size: .94rem; }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.4em; }
.prose h3 { margin-top: 1.3em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

.faq { display: grid; gap: 8px; max-width: 68ch; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 2px 16px;
}
.faq summary {
  cursor: pointer; font-weight: 650; padding: 13px 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > p { margin: 0 0 14px; color: var(--ink-soft); font-size: .96rem; }

/* --- 9. Huecos de anuncio (SIEMPRE vacíos — los rellena el propietario) - */
.ad-slot {
  display: grid; place-items: center;
  margin-block: 28px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-faint); font-size: .78rem;
  letter-spacing: .12em; text-transform: uppercase;
}
.ad-slot--leaderboard { min-height: 92px; }
.ad-slot--incontent  { min-height: 250px; }

/* --- 10. Portada -------------------------------------------------------- */
.hero { text-align: center; padding-block: clamp(36px, 6vw, 68px) clamp(20px, 3vw, 32px); }
.hero p { color: var(--ink-soft); font-size: 1.1rem; max-width: 56ch; margin-inline: auto; }
.hero__points {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: center;
  font-size: .93rem; color: var(--ink-soft);
}
.hero__points li { display: inline-flex; align-items: center; gap: 7px; }
.hero__points svg { width: 16px; height: 16px; color: var(--accent); }

.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }
.tool-tile {
  display: flex; flex-direction: column; gap: 8px; height: 100%;
  padding: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tool-tile:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lift);
  border-color: var(--accent); color: inherit;
}
.tool-tile svg { width: 26px; height: 26px; color: var(--accent); }
.tool-tile b { font-size: 1.06rem; }
.tool-tile span { color: var(--ink-soft); font-size: .93rem; }

.soon-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.soon-list li {
  padding: 6px 13px; border-radius: 999px;
  border: 1px dashed var(--line-strong); background: var(--surface-2);
  color: var(--ink-faint); font-size: .88rem; font-weight: 600;
}

/* Bloque «más herramientas» al pie de cada página */
.more-tools { border-top: 1px solid var(--line); padding-top: 26px; }

/* --- 11. Utilidades ----------------------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
[hidden] { display: none !important; }

/* --- 12. Responsive ----------------------------------------------------- */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  .site-nav { gap: 12px; font-size: .9rem; }
  .btn-row .btn { flex-basis: 100%; }
  .file-item { grid-template-columns: 1fr; }
  .file-item__action { grid-row: auto; grid-column: 1; }
}

/* --- 13. Objeto 3D: paneles, visor y avisos ---------------------------- */
.split3d { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.split3d > figure { margin: 0; display: grid; gap: 8px; }
.split3d figcaption {
  font-size: .8rem; font-weight: 700; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .06em; text-align: center;
}

.visor3d {
  position: relative;
  min-height: 300px; height: 300px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  overflow: hidden;
  cursor: grab;
  /* pan-y: el dedo hacia arriba/abajo hace scroll de la pagina y de lado
     gira el objeto. Con touch-action:none el visor secuestraba el scroll. */
  touch-action: pan-y;
}
.visor3d:active { cursor: grabbing; }
.visor3d canvas { display: block; width: 100%; height: 100%; }
.visor3d__estado {
  position: absolute; inset: 0;
  display: grid; place-items: center; padding: 18px;
  text-align: center; color: var(--ink-soft); font-size: .93rem;
}
.visor3d__pista {
  text-align: center; font-size: .82rem; color: var(--ink-faint); margin: 0;
}

.ficha {
  margin-top: 12px; padding: 10px 13px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: .88rem; color: var(--ink-soft); text-align: center;
}
.ficha b { color: var(--ink); }

.avisos { display: grid; gap: 8px; margin-top: 12px; }
.aviso {
  margin: 0; padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: .9rem; line-height: 1.5; border: 1px solid transparent;
}
.aviso--error { background: var(--danger-soft); border-color: var(--danger); color: var(--ink); }
.aviso--aviso { background: var(--warn-soft);   border-color: var(--warn);   color: var(--ink); }
.aviso--info  { background: var(--accent-soft); border-color: var(--accent); color: var(--ink-soft); }

.btn--warn { background: var(--warn); }
.btn--warn:hover { background: var(--warn); filter: brightness(.93); }

/* Emojis para el centro del código */
.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.emoji-btn {
  width: 40px; height: 40px; padding: 0;
  font-size: 20px; line-height: 1;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); cursor: pointer;
}
.emoji-btn:hover { border-color: var(--accent); }
.emoji-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.center-state { font-size: .85rem; color: var(--ink-faint); }
.file-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: .92rem; font-weight: 600;
}
.file-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* --- 14. Huecos de anuncio: pop-up y esquina --------------------------- */
/* Los dos se muestran DESPUÉS de que la descarga ya ha empezado: un anuncio
   que bloquea el archivo es peor que no tener anuncio. */
.ad-modal {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  padding: 0; max-width: min(92vw, 420px); box-shadow: var(--shadow-lift);
}
.ad-modal::backdrop { background: rgba(10, 14, 16, .55); backdrop-filter: blur(2px); }
.ad-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.ad-modal__head strong { font-size: .95rem; }
.ad-modal__close {
  width: 32px; height: 32px; flex: none; padding: 0;
  font-size: 20px; line-height: 1; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 50%; color: var(--ink);
}
.ad-modal__close:hover { border-color: var(--accent); color: var(--accent-strong); }
.ad-modal__body { padding: 14px; }
.ad-modal__foot { padding: 0 14px 14px; }

.ad-toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: min(88vw, 320px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
  padding: 12px;
}
.ad-toast[hidden] { display: none !important; }
.ad-toast__head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 8px;
}
.ad-toast__close {
  width: 24px; height: 24px; padding: 0; font-size: 16px; line-height: 1;
  background: none; border: 0; cursor: pointer; color: var(--ink-faint);
}
.ad-toast__close:hover { color: var(--ink); }

@media (max-width: 560px) {
  .visor3d { height: 260px; min-height: 260px; }
  .ad-toast { right: 10px; left: 10px; bottom: 10px; width: auto; }
}

/* --- 15. Títulos de bloque dentro de la tarjeta ------------------------ */
.block-title {
  margin: 26px 0 2px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: .82rem; font-weight: 750; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* --- 16. Pasada de móvil ----------------------------------------------
   Objetivos: nada se sale de ancho, todo lo pulsable llega a 44 px (el
   mínimo que recomiendan Apple y Google), y la herramienta se usa sin
   pelearse con el teclado ni con el scroll.
   ---------------------------------------------------------------------- */

/* Red de seguridad contra desbordamientos horizontales */
/* Sin overflow-x aqui a proposito: en el elemento raiz arrastra al eje
   vertical y puede dejar la pagina sin scroll, y ademas rompe el sticky de
   la cabecera. Se evita el desbordamiento en origen, no tapandolo. */
html, body { max-width: 100%; }
img, svg, canvas, video { max-width: 100%; }
.prose { overflow-wrap: anywhere; }

/* Que un ancla no quede debajo de la cabecera fija */
[id] { scroll-margin-top: 76px; }

/* Gris de tap de Android: molesta más que ayuda con nuestro :active */
a, button, label, summary { -webkit-tap-highlight-color: rgba(13, 148, 136, .12); }

@media (max-width: 720px) {
  /* Cabecera más baja: en móvil cada píxel vertical cuenta */
  .site-header__inner { min-height: 54px; }
  .site-nav { gap: 4px; }
  .site-nav a { padding: 10px 8px; }          /* zona pulsable real */
  .brand { font-size: 1rem; }

  .tool-head { padding-top: 18px; }
  .tool-head p.lede { font-size: .98rem; }
  .tool-card { margin-top: 14px; border-radius: 12px; }

  /* Las dos vistas previas, una encima de otra y más contenidas */
  .split3d { gap: 12px; }
  .visor3d { height: 250px; min-height: 250px; }
  .qr-stage { min-height: 220px; padding: 12px; }
  .qr-stage canvas, .qr-stage svg { max-height: 210px; }

  /* Todo lo pulsable, a 44 px */
  .segmented label { padding: 11px 15px; font-size: .95rem; }
  .emoji-btn { width: 46px; height: 46px; font-size: 22px; }
  .file-btn { min-height: 46px; }
  input[type="color"] { height: 48px; }
  input[type="range"] { height: 30px; }
  .btn { padding: 13px 18px; min-height: 48px; }
  .linky { padding: 8px 0; min-height: 40px; }
  .faq summary { padding: 15px 0; }

  /* Menos aire entre bloques: en móvil los huecos grandes obligan a scrollear */
  .controls { gap: 14px; }
  .section { padding-block: 26px; }
  .block-title { margin-top: 22px; padding-top: 14px; }
  .privacy-badge { font-size: .87rem; }

  /* Rejillas a una columna limpia */
  .tool-grid { grid-template-columns: 1fr; gap: 12px; }
  .steps { gap: 20px; grid-template-columns: 1fr; }
  .hero__points { gap: 8px 14px; font-size: .88rem; }

  /* El pop-up de anuncio, dentro de pantalla y sin tapar la barra del móvil */
  .ad-modal {
    max-width: calc(100vw - 24px);
    max-height: 86vh;
    max-height: 86dvh;
    overflow: auto;
  }
  .ad-modal__close { width: 40px; height: 40px; }

  /* El aviso de esquina respeta la zona segura del iPhone y no tapa botones */
  .ad-toast {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    bottom: 0; right: 0; left: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 0;
  }
  .ad-toast__close { width: 40px; height: 40px; }
}

/* Pantallas muy estrechas (iPhone SE y similares) */
@media (max-width: 380px) {
  .wrap { padding-inline: 14px; }
  .segmented label { padding: 10px 12px; font-size: .9rem; }
  .visor3d { height: 220px; min-height: 220px; }
  .qr-stage { min-height: 200px; }
}

/* Móvil en horizontal: la pantalla es baja, no gastarla en la cabecera */
@media (max-height: 480px) and (orientation: landscape) {
  .site-header { position: static; }
  .visor3d { height: 200px; min-height: 200px; }
}
