/* =============================================================================
   CrearQROnline — hoja de estilos única.
   Identidad: "taller de impresión". Tinta densa, lima eléctrica, bordes gruesos
   y sombras duras desplazadas (nada de degradados suaves), con una esquina
   recortada que se repite en todo: tarjetas, botones, campos y avisos.

   1 Tokens · 2 Reset · 3 Utilidades · 4 Tipografía · 5 Componentes
   6 Herramienta · 7 Secciones · 8 Publicidad · 9 Responsive · 10 Movimiento
   ========================================================================== */

/* ============================== 1. Tokens ============================== */
:root {
  --paper: #f1ede2;
  --paper-2: #fffdf6;
  --paper-3: #e9e3d4;
  --ink: #16162c;
  --ink-soft: #43435f;
  --muted: #75758f;
  --line: #16162c;
  --line-soft: #cdc6b4;

  --lime: #cbf227;
  --lime-deep: #a8c916;
  --violet: #6b4bff;
  --violet-soft: #ece8ff;
  --coral: #ff5b45;

  --ok: #0d7a52;
  --ok-soft: #dcf5e8;
  --warn: #8a5a00;
  --warn-soft: #fdf0d5;
  --bad: #b02216;
  --bad-soft: #ffe6e2;

  --display: "Space Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* La forma de la casa: tres esquinas redondas y una recortada. */
  --r-lg: 24px 24px 24px 6px;
  --r-md: 16px 16px 16px 5px;
  --r-sm: 11px 11px 11px 3px;
  --bw: 2px;
  --hard: 4px 4px 0 var(--line);
  --hard-sm: 3px 3px 0 var(--line);
  --hard-lg: 7px 7px 0 var(--line);

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101020;
    --paper-2: #1a1a2e;
    --paper-3: #23233c;
    --ink: #f3efe3;
    --ink-soft: #c6c2d6;
    --muted: #8f8fa8;
    --line: #4a4a6b;
    --line-soft: #35354f;

    --lime: #cbf227;
    --lime-deep: #b6db1f;
    --violet: #9d86ff;
    --violet-soft: #241d45;
    --coral: #ff7c69;

    --ok: #5fd9a0;
    --ok-soft: #10281f;
    --warn: #f2c877;
    --warn-soft: #2a2415;
    --bad: #ff8f80;
    --bad-soft: #2d1715;

    --hard: 4px 4px 0 var(--line);
    --hard-sm: 3px 3px 0 var(--line);
    --hard-lg: 7px 7px 0 var(--line);
  }
}

/* ============================== 2. Reset =============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
  background-color: var(--paper);
  /* Rejilla de taller, muy tenue */
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 7%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 7%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; text-wrap: balance; line-height: 1.08; letter-spacing: -.03em; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

/* ============================ 3. Utilidades ============================ */
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 999;
  padding: .6rem 1rem; background: var(--lime); color: #16162c;
  border: var(--bw) solid #16162c; border-radius: var(--r-sm); font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ============================ 4. Tipografía ============================ */
h1 { font-size: clamp(1.95rem, 1.1rem + 3.5vw, 3.4rem); }
h2 { font-size: clamp(1.45rem, 1.05rem + 1.7vw, 2.25rem); }
h3 { font-size: 1.08rem; letter-spacing: -.015em; }

/* =========================== 5. Componentes ============================ */
.site-header {
  border-bottom: var(--bw) solid var(--line);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 66px; }

.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 700; letter-spacing: -.04em; font-size: 1.18rem; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  background: var(--lime); padding: 4px; box-shadow: var(--hard-sm);
}
.brand-mark .m-ink { fill: #16162c; }
.brand em { font-style: normal; color: var(--violet); }

/* Menú: pastillas con borde, no enlaces sueltos */
.site-nav { display: flex; gap: .4rem; }
.site-nav a {
  font-family: var(--display); font-weight: 500; font-size: .88rem;
  padding: .38rem .8rem; border: var(--bw) solid transparent; border-radius: var(--r-sm);
  color: var(--ink-soft); transition: all .18s var(--ease-out);
}
.site-nav a:hover { border-color: var(--line); background: var(--lime); color: #16162c; box-shadow: var(--hard-sm); }

.hero { padding: clamp(2rem, 4.5vw, 3.6rem) var(--gutter) clamp(1.1rem, 2vw, 1.7rem); text-align: center; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--display); font-size: .76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  padding: .3rem .7rem; margin-bottom: 1rem;
  border: var(--bw) solid var(--line); border-radius: 100px;
  background: var(--violet-soft); color: var(--ink);
}
.hero-sub { max-width: 60ch; margin: 1rem auto 0; color: var(--ink-soft); font-size: clamp(1rem, .95rem + .3vw, 1.13rem); }
.hero-sub strong { color: var(--ink); background: linear-gradient(transparent 62%, var(--lime) 62%); padding: 0 .1em; }
/* En oscuro el texto es claro: el rotulador pasaría por encima, así que baja a subrayado. */
@media (prefers-color-scheme: dark) {
  .hero-sub strong { background: linear-gradient(transparent 86%, var(--lime) 86%); }
}

/* Botones: bloque con borde y sombra dura; se "hunden" al pulsar */
.btn-primary {
  display: flex; flex-direction: column; align-items: center; gap: .08rem;
  width: 100%; padding: .95rem 1.4rem;
  background: var(--lime); color: #16162c;
  border: var(--bw) solid #16162c; border-radius: var(--r-md);
  box-shadow: 5px 5px 0 #16162c;
  font-family: var(--display); font-weight: 700; letter-spacing: -.015em; line-height: 1.25;
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #16162c; }
.btn-primary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #16162c; }
.btn-primary:disabled { opacity: .65; cursor: progress; transform: none; box-shadow: 2px 2px 0 #16162c; }
.btn-primary .btn-main { font-size: 1.04rem; }
.btn-primary .btn-sub { font-family: var(--sans); font-size: .76rem; font-weight: 500; opacity: .78; }
.btn-inline { display: inline-flex; width: auto; margin-top: 1.2rem; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .58rem .95rem;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  background: var(--paper-2); color: var(--ink);
  font-family: var(--display); font-weight: 500; font-size: .88rem;
  box-shadow: var(--hard-sm);
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out), background .14s var(--ease-out);
}
.btn-ghost:hover { background: var(--lime); color: #16162c; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.btn-ghost:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn-ghost:disabled { opacity: .55; cursor: progress; }
.btn-small { padding: .38rem .68rem; font-size: .8rem; box-shadow: 2px 2px 0 var(--line); }

/* ========================== 6. La herramienta ========================== */
.tool-card {
  background: var(--paper-2);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--hard-lg);
  padding: clamp(1rem, 2.2vw, 1.85rem);
}
.noscript-note {
  background: var(--warn-soft); border: var(--bw) solid var(--line);
  padding: .9rem 1rem; border-radius: var(--r-sm); margin-bottom: 1rem;
}
.tool-grid { display: grid; gap: clamp(1.1rem, 2.4vw, 2rem); }

.preview-label {
  font-family: var(--display);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em;
  color: var(--ink); margin-bottom: .55rem;
  display: flex; align-items: baseline; gap: .5rem;
}
.preview-label .hint { text-transform: none; letter-spacing: 0; font-weight: 400; font-family: var(--sans); font-size: .74rem; color: var(--muted); }

.qr-frame {
  border: var(--bw) solid var(--line); border-radius: var(--r-md);
  padding: 10px; background: var(--paper-3); box-shadow: var(--hard-sm);
}
.qr-frame canvas { width: 100%; height: auto; border-radius: 4px; }

.preview-3d { margin-top: 1.2rem; }
.viewer-frame {
  position: relative;
  border: var(--bw) solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--hard-sm);
  background-color: var(--paper-3);
  background-image:
    radial-gradient(120% 85% at 50% 2%, color-mix(in srgb, var(--lime) 16%, transparent), transparent 58%),
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--line) 4%, transparent) 0 2px, transparent 2px 11px);
  aspect-ratio: 1 / 1; overflow: hidden;
}
.viewer-frame canvas { width: 100%; height: 100%; touch-action: pan-y; cursor: grab; opacity: 0; transition: opacity .35s var(--ease-out); }
.viewer-frame canvas:active { cursor: grabbing; }
.viewer-frame.is-ready canvas { opacity: 1; }
.viewer-msg {
  position: absolute; inset: 0; display: grid; place-content: center;
  text-align: center; padding: 1.5rem; color: var(--ink-soft); font-size: .88rem;
}
.viewer-msg[hidden] { display: none; }
.viewer-frame.is-fallback { aspect-ratio: 16 / 7; }
#btn-reset-view { margin-top: .6rem; }

.privacy-badge {
  margin-top: 1.2rem; padding: .75rem .9rem; font-size: .85rem;
  background: var(--ok-soft); color: var(--ink);
  border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--hard-sm);
}

.controls-col { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.block { border-top: var(--bw) dashed var(--line-soft); padding-top: 1.2rem; }
.block:first-child { border-top: 0; padding-top: 0; }
.block legend, .block > legend {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  letter-spacing: -.02em; margin-bottom: .85rem;
  /* La leyenda se apoya sobre la línea discontinua del bloque: deja aire. */
  padding-right: .8rem;
}
.step-dot {
  display: grid; place-content: center; width: 26px; height: 26px; flex: 0 0 26px;
  border: var(--bw) solid var(--line); border-radius: 50%;
  background: var(--lime); color: #16162c;
  font-family: var(--display); font-size: .8rem; font-weight: 700;
}

/* Pestañas del contenido */
.tabs { display: inline-flex; gap: 0; margin-bottom: .9rem; border: var(--bw) solid var(--line); border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--hard-sm); }
.tab { padding: .45rem .95rem; font-family: var(--display); font-size: .88rem; font-weight: 500; color: var(--ink-soft); background: var(--paper-2); }
.tab + .tab { border-left: var(--bw) solid var(--line); }
.tab.is-active { background: var(--lime); color: #16162c; font-weight: 700; }

.field { display: block; margin-bottom: .8rem; }
.field-label { display: block; font-family: var(--display); font-size: .8rem; font-weight: 700; color: var(--ink); margin-bottom: .32rem; }
.field input[type="text"], .field select {
  width: 100%; padding: .68rem .8rem;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  background: var(--paper-2);
}
.field input[type="text"]:focus, .field select:focus { outline: none; box-shadow: var(--hard-sm); }
.field-help { font-size: .8rem; color: var(--muted); margin-top: -.4rem; margin-bottom: .5rem; }
.field-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.field-row .field { flex: 1 1 12rem; }
.field-narrow { flex: 0 1 10rem !important; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .87rem; color: var(--ink-soft); }
input[type="range"] { width: 100%; accent-color: var(--violet); }
output { font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 700; }

/* Selectores de estilo y de formato: fichas con sombra dura */
.style-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .4rem 0 1.15rem; }
.style-btn {
  display: grid; justify-items: center; gap: .32rem; padding: .65rem .3rem;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  background: var(--paper-2); color: var(--ink);
  font-family: var(--display); font-size: .72rem; font-weight: 500;
  box-shadow: var(--hard-sm);
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out), background .14s var(--ease-out);
}
.style-btn svg { width: 28px; height: 28px; fill: currentColor; }
.style-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.style-btn.is-active { background: var(--lime); color: #16162c; font-weight: 700; box-shadow: 1px 1px 0 var(--line); transform: translate(2px, 2px); }

.color-row { display: flex; align-items: flex-end; gap: .65rem; flex-wrap: wrap; margin: .4rem 0 .7rem; }
.color-field { display: grid; gap: .3rem; font-family: var(--display); font-size: .78rem; font-weight: 500; color: var(--ink-soft); }
.color-field input[type="color"] {
  width: 76px; height: 42px; padding: 0;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  background: none; cursor: pointer; box-shadow: var(--hard-sm);
}
.combo-row { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.combo { display: flex; width: 50px; height: 26px; border-radius: 7px 7px 7px 2px; overflow: hidden; border: var(--bw) solid var(--line); box-shadow: 2px 2px 0 var(--line); }
.combo span { flex: 1; }
.combo:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--line); }

.emoji-row { display: flex; gap: .35rem; flex-wrap: wrap; margin: .4rem 0 .7rem; }
.emoji-btn {
  width: 40px; height: 40px; display: grid; place-content: center; font-size: 1.15rem;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm); background: var(--paper-2);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background .12s var(--ease-out);
}
.emoji-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--line); }
.emoji-btn.is-active { background: var(--lime); box-shadow: 1px 1px 0 var(--line); transform: translate(1px, 1px); }
.emoji-btn.is-none { width: auto; padding: 0 .65rem; font-family: var(--display); font-size: .78rem; font-weight: 500; color: var(--ink-soft); }
.center-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.file-btn { cursor: pointer; }

.format-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-bottom: 1.15rem; }
.format-btn {
  display: grid; justify-items: center; gap: .2rem; padding: .8rem .4rem;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  background: var(--paper-2); text-align: center; box-shadow: var(--hard-sm);
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out), background .14s var(--ease-out);
}
.format-btn svg { width: 44px; height: 34px; fill: var(--ink); }
.format-btn strong { font-family: var(--display); font-size: .84rem; font-weight: 700; }
.format-btn small { font-size: .7rem; color: var(--muted); }
.format-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.format-btn.is-active { background: var(--lime); box-shadow: 1px 1px 0 var(--line); transform: translate(2px, 2px); }
.format-btn.is-active svg { fill: #16162c; }
.format-btn.is-active strong, .format-btn.is-active small { color: #16162c; }

.advanced { margin-top: .4rem; border-top: var(--bw) dashed var(--line-soft); padding-top: .8rem; }
.advanced summary { cursor: pointer; font-family: var(--display); font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.advanced summary:hover { color: var(--ink); }
.advanced > *:not(summary) { margin-top: .8rem; }

.warnings { display: grid; gap: .45rem; }
.warn-line {
  font-size: .85rem; line-height: 1.45; padding: .6rem .75rem;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm);
}
.warn-ok { background: var(--ok-soft); color: var(--ok); }
.warn-warn { background: var(--warn-soft); color: var(--warn); }
.warn-bad { background: var(--bad-soft); color: var(--bad); box-shadow: var(--hard-sm); }

.downloads { display: grid; gap: .65rem; }
.secondary-downloads { display: flex; gap: .5rem; flex-wrap: wrap; }
.secondary-downloads .btn-ghost { flex: 1 1 8rem; }
.downloads-note { font-size: .8rem; color: var(--muted); }

/* ============================ 7. Secciones ============================= */
.section { padding-block: clamp(2.6rem, 5vw, 4.4rem); }
.section h2 { margin-bottom: .5rem; }
.section h2 .mark { background: var(--lime); border: var(--bw) solid var(--line); border-radius: var(--r-sm); padding: 0 .28em; display: inline-block; }
.section-sub { color: var(--ink-soft); margin-bottom: 1.7rem; }

.steps { list-style: none; padding: 0; display: grid; gap: 1.1rem; margin-top: 1.8rem; }
.step {
  background: var(--paper-2); border: var(--bw) solid var(--line);
  border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--hard);
}
.step-num {
  display: grid; place-content: center; width: 40px; height: 40px;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  background: var(--violet); color: #fff;
  font-family: var(--display); font-size: 1.1rem; font-weight: 700; margin-bottom: .85rem;
}
.step h3 { margin-bottom: .35rem; }
.step p { color: var(--ink-soft); font-size: .94rem; }

.prose { max-width: 72ch; }
.prose h2 { margin-bottom: 1rem; }
.prose h3 { font-size: 1.18rem; margin: 1.8rem 0 .5rem; }
.prose p { color: var(--ink-soft); margin-bottom: .95rem; }
.prose strong { color: var(--ink); }

.ideas-grid { list-style: none; padding: 0; display: grid; gap: 1.1rem; }
.idea {
  background: var(--paper-2); border: var(--bw) solid var(--line);
  border-radius: var(--r-lg); padding: 1.35rem; box-shadow: var(--hard);
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out);
}
.idea:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--line); }
.idea-emoji {
  font-size: 1.35rem; display: grid; place-content: center;
  width: 46px; height: 46px; margin-bottom: .7rem;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm); background: var(--lime);
}
.idea h3 { margin-bottom: .3rem; }
.idea p { font-size: .92rem; color: var(--ink-soft); }

.faq-list { display: grid; gap: .7rem; margin-top: 1.5rem; }
.faq-item {
  background: var(--paper-2); border: var(--bw) solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--hard-sm);
}
.faq-item summary {
  padding: 1rem 1.15rem; font-family: var(--display); font-weight: 700; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex: 0 0 24px; width: 24px; height: 24px;
  display: grid; place-content: center; font-size: 1rem; line-height: 1;
  border: var(--bw) solid var(--line); border-radius: 6px 6px 6px 2px; background: var(--lime); color: #16162c;
}
.faq-item[open] summary::after { content: "–"; background: var(--violet); color: #fff; }
.faq-a { padding: 0 1.15rem 1.15rem; color: var(--ink-soft); font-size: .94rem; }

.closing { text-align: center; }
.closing p { color: var(--ink-soft); max-width: 56ch; margin-inline: auto; }

.site-footer { border-top: var(--bw) solid var(--line); padding-block: 2.2rem; margin-top: 1rem; background: var(--paper-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.footer-brand { font-family: var(--display); font-weight: 700; letter-spacing: -.04em; font-size: 1.05rem; }
.footer-note { font-size: .85rem; color: var(--muted); }
.footer-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.footer-links a {
  font-family: var(--display); font-size: .85rem; font-weight: 500;
  padding: .3rem .7rem; border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  background: var(--paper);
}
.footer-links a:hover { background: var(--lime); color: #16162c; }

/* ====================== 8. Huecos de publicidad ======================== */
/* Solo marcos vacíos: esta web no carga ningún script de anuncios. */
.ad-slot {
  display: grid; place-content: center;
  border: var(--bw) dashed var(--line); border-radius: var(--r-md);
  background: repeating-linear-gradient(-45deg,
    color-mix(in srgb, var(--line) 4%, transparent) 0 8px, transparent 8px 16px);
}
.ad-tag {
  font-family: var(--display);
  font-size: .7rem; font-weight: 700; letter-spacing: .24em;
  color: var(--muted); text-transform: uppercase;
}
.ad-leaderboard { min-height: 100px; margin-block: .6rem 0; }
.ad-incontent { min-height: 260px; margin-block: 1.2rem; }

.ad-modal { border: 0; padding: 0; background: transparent; max-width: min(92vw, 380px); }
.ad-modal::backdrop { background: color-mix(in srgb, #16162c 62%, transparent); backdrop-filter: blur(2px); }
.ad-modal-inner {
  position: relative; background: var(--paper-2); color: var(--ink);
  border: var(--bw) solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--hard-lg);
  padding: 1.5rem 1.25rem 1.25rem; display: grid; gap: .9rem;
}
.ad-modal-title { font-family: var(--display); font-weight: 700; text-align: center; font-size: 1.02rem; }
.ad-modal-slot { min-height: 250px; }
.ad-close {
  position: absolute; top: -12px; right: -12px;
  width: 34px; height: 34px; border-radius: 50%; font-size: 1.25rem; line-height: 1;
  color: #16162c; background: var(--lime); border: var(--bw) solid var(--line);
  box-shadow: 2px 2px 0 var(--line);
}
.ad-close:hover { background: var(--coral); color: #fff; }

.ad-toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  width: min(300px, calc(100vw - 2rem));
  background: var(--paper-2); border: var(--bw) solid var(--line);
  border-radius: var(--r-md); padding: .65rem; box-shadow: var(--hard);
}
.ad-toast[hidden] { display: none; }
.ad-toast .ad-close { top: -13px; right: -13px; width: 28px; height: 28px; font-size: 1rem; }
.ad-toast-slot { min-height: 92px; }

/* ============================ 9. Responsive ============================ */
@media (max-width: 620px) {
  /* El aviso de esquina se queda pequeño de verdad: no debe tapar el formulario */
  .ad-toast { width: min(210px, calc(100vw - 1.5rem)); right: .6rem; bottom: .6rem; padding: .5rem; }
  .ad-toast-slot { min-height: 62px; }
  .ad-tag { font-size: .6rem; letter-spacing: .17em; }
}

@media (max-width: 959px) {
  .preview-col { display: contents; }
  .preview-2d { order: 1; }
  .controls-col { order: 2; }
  .preview-3d { order: 3; margin-top: 0; }
  #btn-reset-view { order: 4; justify-self: start; }
  .privacy-badge { order: 5; margin-top: 0; }
  .qr-frame { max-width: 210px; margin-inline: auto; padding: 8px; }
  .site-nav { display: none; }
  /* Compacto para que el campo del enlace entre en pantalla sin desplazarse */
  .hero { padding-top: 1.2rem; padding-bottom: .8rem; }
  .hero-kicker { margin-bottom: .7rem; }
  .hero-sub { font-size: .95rem; margin-top: .7rem; }
  .preview-2d .preview-label { display: none; }
  .tool-grid { gap: .9rem; }
  .block legend, .block > legend { margin-bottom: .65rem; }
  .tool-card { box-shadow: var(--hard); }
}

@media (min-width: 540px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .ideas-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .tool-grid { grid-template-columns: minmax(300px, 380px) 1fr; align-items: start; }
  .preview-col { position: sticky; top: 86px; }
  .ideas-grid { grid-template-columns: repeat(3, 1fr); }
  .ad-leaderboard { min-height: 120px; }
}

/* ====================== 10. Movimiento reducido ======================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-primary:hover, .btn-ghost:hover, .style-btn:hover, .format-btn:hover,
  .emoji-btn:hover, .idea:hover, .combo:hover, .site-nav a:hover { transform: none; }
  .viewer-frame canvas { transition: none; }
}
