/* =============================================================
   QR3D — hoja de estilos única
   1. Tokens  2. Reset  3. Utilidades  4. Tipografía
   5. Componentes  6. Secciones  7. Efectos  8. Responsive
   9. Reduced-motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eff1f5;
  --surface-3: #e6e9ef;
  --ink: #13151c;
  --ink-2: #495062;
  --ink-3: #79808f;
  --line: #e0e4ec;
  --line-strong: #cbd1dd;

  /* Azul de marca. Elegido para que el texto BLANCO encima cumpla el minimo
     de accesibilidad (6,8:1; el estandar pide 4,5:1). El naranja anterior se
     quedaba en 3,1:1 y no llegaba. */
  --accent: #1d4ed8;
  --accent-hover: #1740b5;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0ff;
  /* Un color NO puede leerse bien sobre fondo claro Y sobre fondo oscuro a la
     vez. Por eso el azul de los TEXTOS e ICONOS es un token aparte, que cambia
     con el modo oscuro. El de arriba solo se usa como relleno. */
  --accent-text: #1d4ed8;

  --ok: #0f7a52;
  --ok-soft: #e6f5ee;
  --warn: #9a5b00;
  --warn-soft: #fdf2df;
  --danger: #bd2130;
  --danger-soft: #fdeaec;

  --radius: 18px;
  --radius-sm: 11px;
  --radius-xs: 8px;

  --shadow-sm: 0 1px 2px rgba(19, 21, 28, .05), 0 1px 3px rgba(19, 21, 28, .05);
  --shadow-md: 0 14px 34px -18px rgba(19, 21, 28, .28);
  --shadow-lg: 0 30px 60px -28px rgba(19, 21, 28, .34);

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

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --maxw: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015;
    --surface: #171a21;
    --surface-2: #1e222b;
    --surface-3: #262b36;
    --ink: #f2f4f8;
    --ink-2: #b3bac8;
    --ink-3: #868e9f;
    --line: #2b303b;
    --line-strong: #3a4151;
    --accent-soft: #16203a;
    --accent-text: #7fa9ff;
    --ok-soft: #10251d;
    --warn-soft: #2a2113;
    --danger-soft: #2c1518;
    --shadow-md: 0 14px 34px -18px rgba(0, 0, 0, .7);
    --shadow-lg: 0 30px 60px -28px rgba(0, 0, 0, .8);
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
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, h4 { font-family: var(--display); text-wrap: balance; line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

/* =============================================================
   3. Utilidades
   ============================================================= */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.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;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Tipografía
   ============================================================= */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: .34rem .7rem; border-radius: 999px;
}

/* =============================================================
   5. Componentes
   ============================================================= */

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 62px;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; }
.brand svg { width: 26px; height: 26px; }
.brand span b { color: var(--accent-text); }
.header-nav { display: flex; align-items: center; gap: .85rem; font-size: .82rem; color: var(--ink-2); font-weight: 500; }
.header-nav a:hover { color: var(--ink); }
/* En movil no caben los enlaces Y la etiqueta: la etiqueta es decorativa,
   los enlaces son navegacion. Se queda la navegacion. */
.header-nav .eyebrow { display: none; }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .82rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .95rem; line-height: 1;
  border: 1px solid transparent;
  transition: background-color .22s var(--ease-out), color .22s var(--ease-out),
              border-color .22s var(--ease-out), transform .22s var(--ease-out),
              box-shadow .22s var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink-3); }
.btn--sm { padding: .55rem .85rem; font-size: .85rem; border-radius: var(--radius-xs); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* --- Tarjeta de la herramienta --- */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}
.panel { padding: clamp(1rem, 3vw, 1.7rem); min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.panel--design, .panel--object { border-top: 1px solid var(--line); }
.panel--preview {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  gap: 1rem;
}
.preview-inner { display: flex; flex-direction: column; gap: 1.1rem; }

/* --- Grupos de campos --- */
.field-group { display: flex; flex-direction: column; gap: .75rem; }
.field-group > legend,
.group-title {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--display); font-weight: 700; font-size: .95rem;
  letter-spacing: -.01em; margin-bottom: .15rem;
}
.step-num {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: var(--surface);
  font-size: .72rem; font-weight: 700; font-family: var(--sans);
}
.field { display: flex; flex-direction: column; gap: .35rem; }
.field > label,
.label {
  font-size: .8rem; font-weight: 600; color: var(--ink-2);
  letter-spacing: .01em;
}
.hint { font-size: .78rem; color: var(--ink-3); line-height: 1.45; }

input[type="text"], input[type="url"], input[type="password"], select {
  width: 100%; padding: .72rem .85rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
input[type="text"]:focus, input[type="url"]:focus, input[type="password"]:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: var(--ink-3); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2379808f' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 15px;
  padding-right: 2.2rem;
}

/* --- Pestañas (enlace / wifi) --- */
.tabs { display: flex; gap: .35rem; background: var(--surface-2); padding: .3rem; border-radius: var(--radius-xs); }
.tab {
  flex: 1; padding: .45rem .6rem; border-radius: 6px;
  font-size: .87rem; font-weight: 600; color: var(--ink-2);
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* --- Selector de estilo (chips) --- */
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.chip {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  padding: .6rem .3rem .5rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-xs);
  background: var(--surface); font-size: .74rem; font-weight: 600; color: var(--ink-2);
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.chip svg { width: 26px; height: 26px; }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.chip[aria-pressed="true"] svg { color: var(--accent-text); }

/* --- Colores --- */
.color-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.color-field {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .6rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs); background: var(--surface);
}
.color-field input[type="color"] {
  inline-size: 34px; block-size: 34px; padding: 0; flex: none; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 7px; background: none;
}
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-field .color-meta { display: flex; flex-direction: column; min-width: 0; }
.color-field .color-meta b { font-size: .78rem; font-weight: 600; }
.color-field .color-meta small { font-size: .7rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.palettes { display: flex; flex-wrap: wrap; gap: .4rem; }
.palette {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .45rem .3rem .35rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font-size: .74rem; font-weight: 600; color: var(--ink-2);
  transition: border-color .2s var(--ease-out), transform .2s var(--ease-out);
}
.palette:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.palette i { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(0,0,0,.14); display: block; }
.palette i + i { margin-left: -8px; }

/* --- Centro: emojis y logo --- */
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: .3rem; }
.emoji {
  aspect-ratio: 1; display: grid; place-items: center;
  font-size: 1.15rem; line-height: 1;
  border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface);
  transition: border-color .18s var(--ease-out), background-color .18s var(--ease-out), transform .18s var(--ease-out);
}
.emoji:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.emoji[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.center-actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.file-label {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem .85rem; border-radius: var(--radius-xs);
  border: 1px dashed var(--line-strong); background: var(--surface);
  font-size: .85rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.file-label:hover { border-color: var(--accent); color: var(--ink); }
.file-label input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.center-actions .btn--sm svg { width: 15px; height: 15px; }

/* --- Vista previa 2D --- */
.preview-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .75rem; }
.preview-head h2 { font-size: .95rem; white-space: nowrap; }
.preview-head .hint { margin: 0; }
.stage {
  display: grid; place-items: center;
  padding: clamp(.75rem, 3vw, 1.5rem);
  background:
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%, transparent 75%, var(--surface-3) 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%, transparent 75%, var(--surface-3) 75%) 9px 9px / 18px 18px,
    var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-height: 240px;
}
#qr-canvas { line-height: 0; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow-md); }
#qr-canvas canvas, #qr-canvas svg { width: 100%; height: auto; max-width: 300px; }

.dl-block { display: flex; flex-direction: column; gap: .6rem; }
.dl-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.dl-row--size { grid-template-columns: 1fr; }

/* --- Avisos --- */
.notice {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .65rem .8rem; border-radius: var(--radius-xs);
  font-size: .82rem; line-height: 1.45;
  border: 1px solid transparent;
}
.notice svg { width: 17px; height: 17px; flex: none; margin-top: .1rem; }
.notice--ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.notice--warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.notice--danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.notice--muted { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }

.privacy {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-top: 1rem; font-size: .85rem; color: var(--ink-2); text-align: center;
}
.privacy svg { width: 16px; height: 16px; flex: none; color: var(--ok); }

/* =============================================================
   6. Secciones
   ============================================================= */
.hero { padding: clamp(1.15rem, 5vw, 3rem) 0 clamp(.9rem, 3vw, 1.6rem); text-align: center; }
.hero h1 {
  font-size: clamp(1.75rem, 5.2vw, 3.05rem);
  margin: .55rem auto .5rem;
  max-width: 18ch;
}
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero-sub {
  max-width: 62ch; margin-inline: auto;
  color: var(--ink-2); font-size: clamp(.98rem, 2.1vw, 1.09rem);
}
.tool-section { padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(2rem, 6vw, 4rem);
  padding: 2rem 0 2.5rem;
  color: var(--ink-2); font-size: .88rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

/* --- Visor 3D y panel del objeto --- */
.chips--3 { grid-template-columns: repeat(3, 1fr); }
.chips--3 .chip { font-size: .72rem; gap: .35rem; }

.visor-bloque { display: flex; flex-direction: column; gap: .75rem; padding-top: .3rem; border-top: 1px solid var(--line); }
.visor-marco { position: relative; }
#visor3d {
  width: 100%; height: clamp(230px, 42vw, 300px);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: radial-gradient(circle at 50% 32%, var(--surface) 0%, var(--surface-3) 100%);
  overflow: hidden; touch-action: none; cursor: grab;
}
#visor3d:active { cursor: grabbing; }
#visor3d canvas { display: block; width: 100%; height: 100%; }
.visor-carga {
  position: absolute; inset: auto .6rem .6rem auto;
  padding: .3rem .6rem; border-radius: 999px;
  background: var(--ink); color: var(--surface);
  font-size: .73rem; font-weight: 600;
}
.avisos { display: flex; flex-direction: column; gap: .45rem; }
.avisos .hint { margin-bottom: .1rem; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px; background: var(--surface-3);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--surface-3); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -7px;
  border-radius: 50%; background: var(--accent);
  border: 3px solid var(--surface); box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface); box-shadow: var(--shadow-sm);
}
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Secciones de contenido --- */
.seccion { padding: clamp(2.4rem, 7vw, 4.5rem) 0; }
.seccion--alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.seccion h2 {
  font-size: clamp(1.5rem, 3.6vw, 2.15rem);
  text-align: center; margin-bottom: .6rem;
}
.seccion-intro {
  max-width: 62ch; margin: 0 auto clamp(1.6rem, 4vw, 2.6rem);
  text-align: center; color: var(--ink-2);
}

/* Pasos */
.pasos { list-style: none; display: grid; gap: 1rem; counter-reset: paso; }
.pasos li {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.35rem 1.35rem; box-shadow: var(--shadow-sm);
}
.pasos svg { width: 30px; height: 30px; color: var(--accent-text); margin-bottom: .85rem; }
.pasos h3 { font-size: 1.06rem; margin-bottom: .4rem; }
.pasos p { color: var(--ink-2); font-size: .93rem; }
.paso-num {
  position: absolute; top: -13px; left: 1.35rem;
  display: grid; place-items: center; width: 27px; height: 27px;
  border-radius: 50%; background: var(--ink); color: var(--surface);
  font-size: .78rem; font-weight: 700;
}

/* Tarjetas de ideas */
.tarjetas { display: grid; gap: 1rem; }
.tarjeta {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.tarjeta:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
a.tarjeta:hover { border-color: var(--accent-text); }
a.tarjeta h3::after { content: " \2192"; color: var(--accent-text); opacity: 0; transition: opacity .2s var(--ease-out); }
a.tarjeta:hover h3::after { opacity: 1; }
.tarjeta-emoji { font-size: 1.7rem; line-height: 1; display: block; margin-bottom: .6rem; }
.tarjeta h3 { font-size: 1.02rem; margin-bottom: .35rem; }
.tarjeta p { color: var(--ink-2); font-size: .91rem; }

/* Texto largo */
.prosa { max-width: 74ch; }
.prosa h2 { text-align: left; }
.prosa h3 { font-size: 1.14rem; margin: 1.9rem 0 .5rem; }
.prosa p { color: var(--ink-2); margin-bottom: .8rem; }
.prosa strong { color: var(--ink); }

/* Preguntas frecuentes */
.faq { max-width: 74ch; margin-inline: auto; display: flex; flex-direction: column; gap: .5rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden;
}
.faq summary {
  padding: .95rem 2.6rem .95rem 1.1rem; cursor: pointer;
  font-weight: 600; font-size: .97rem; position: relative;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 1.1rem; top: 50%;
  width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg); transition: transform .25s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq summary:hover { background: var(--surface-2); }
.faq p { padding: 0 1.1rem 1.1rem; color: var(--ink-2); font-size: .93rem; }

/* --- Huecos de publicidad (vacios: el propietario pega aqui su codigo) --- */
.ad-slot {
  display: grid; place-items: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-3); font-size: .7rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
}
.ad-slot--banner { min-height: 96px; margin-top: 1.6rem; }
.ad-slot--inline { min-height: 260px; margin: clamp(1.6rem, 4vw, 2.4rem) 0; }

/* Aviso emergente al descargar */
.ad-modal {
  border: 0; padding: 0; background: transparent;
  max-width: min(92vw, 460px); width: 100%;
}
.ad-modal::backdrop { background: rgba(10, 12, 18, .62); backdrop-filter: blur(3px); }
.ad-modal-caja {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: .9rem;
}
.ad-modal-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.ad-modal-cab h2 { font-size: 1.06rem; }
.ad-modal-cab p { font-size: .87rem; color: var(--ink-2); margin-top: .2rem; }
.ad-cerrar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2);
  color: var(--ink-2); transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.ad-cerrar:hover { background: var(--surface-3); color: var(--ink); }
.ad-cerrar svg { width: 16px; height: 16px; }
.ad-modal .ad-slot { min-height: 250px; }

/* Aviso pequeño en la esquina */
.ad-toast {
  position: fixed; z-index: 80; right: 1rem; bottom: 1rem;
  width: min(90vw, 320px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: .7rem; display: flex; gap: .6rem; align-items: flex-start;
  transform: translateY(130%); opacity: 0;
  transition: transform .45s var(--ease-out), opacity .45s var(--ease-out);
}
.ad-toast[data-visible="true"] { transform: translateY(0); opacity: 1; }
.ad-toast .ad-slot { flex: 1; min-height: 90px; }
.ad-toast .ad-cerrar { width: 26px; height: 26px; }
.ad-toast .ad-cerrar svg { width: 13px; height: 13px; }

/* --- Paginas legales --- */
.legal { max-width: 760px; padding-top: clamp(1.5rem, 5vw, 3rem); padding-bottom: 1rem; }
.legal h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); margin-bottom: .5rem; }
.legal h2 { font-size: 1.12rem; margin: 1.9rem 0 .5rem; }
.legal p, .legal ul { color: var(--ink-2); }
.legal ul { padding-left: 1.15rem; display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; }
.legal p + p { margin-top: .7rem; }

/* =============================================================
   7. Efectos
   ============================================================= */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.copied { color: var(--ok) !important; border-color: var(--ok) !important; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .dl-row--size { grid-template-columns: auto 1fr; align-items: center; }
  .tarjetas { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 720px) {
  .pasos { grid-template-columns: repeat(3, 1fr); gap: 1.15rem; }
  .header-nav { gap: 1.25rem; font-size: .92rem; }
  .header-nav .eyebrow { display: inline-flex; }
}

@media (min-width: 960px) {
  .tarjetas { grid-template-columns: repeat(3, 1fr); }
  /* Columna izquierda: los pasos. Columna derecha: la vista previa, pegada
     arriba mientras se hace scroll por los controles. */
  .tool-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); align-items: stretch; }
  .panel--content, .panel--design, .panel--object { grid-column: 1; }
  .panel--design, .panel--object { border-top: 1px solid var(--line); }
  .panel--preview {
    grid-column: 2; grid-row: 1 / span 20;
    border-top: 0; border-left: 1px solid var(--line);
  }
  /* Nada de sticky aqui: la columna lleva DOS vistas previas (2D y 3D) y es
     mas alta que la pantalla; al fijarla, su mitad de abajo quedaba
     inalcanzable por mucho scroll que hicieras. */
  #qr-canvas canvas, #qr-canvas svg { max-width: 340px; }
  .panel { padding: 1.7rem; }
  .stage { min-height: 320px; }
}

@media (min-width: 1280px) {
  .tool-card { grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); }
}

/* =============================================================
   9. Reduced-motion — solo efectos intrusivos
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spin { animation-duration: 2.4s; }
}
