/* =============================================================
   QR3D — styles.css
   1 Tokens · 2 Reset · 3 Utilidades · 4 Tipografía · 5 Header
   6 Herramienta · 7 Vista previa · 8 Anuncios · 9 Secciones
   10 Footer · 11 Responsive · 12 Reduced-motion
   ============================================================= */

/* ===== 1. Tokens ===== */
:root {
  --ink:        #12131a;
  --ink-soft:   #45464f;
  --muted:      #6d6e78;
  --bg:         #f4f3ef;
  --card:       #ffffff;
  --card-2:     #faf9f6;
  --line:       #e3e1da;
  --line-soft:  #eeece6;
  --accent:     #e8501d;
  --accent-ink: #ffffff;
  --accent-soft:#fdeee8;
  --ok:         #17754a;
  --ok-soft:    #e4f4ec;
  --warn:       #8a5a00;
  --warn-soft:  #fdf1d8;
  --bad:        #b3261e;
  --bad-soft:   #fbe6e4;

  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(18,19,26,.05), 0 2px 8px rgba(18,19,26,.04);
  --shadow:    0 2px 4px rgba(18,19,26,.05), 0 12px 32px rgba(18,19,26,.07);
  --shadow-lg: 0 4px 8px rgba(18,19,26,.06), 0 28px 64px rgba(18,19,26,.12);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #f2f1ec;
    --ink-soft:   #c8c7c1;
    --muted:      #9a9992;
    --bg:         #131318;
    --card:       #1c1c22;
    --card-2:     #212129;
    --line:       #2f2f38;
    --line-soft:  #282830;
    --accent:     #ff6b34;
    --accent-ink: #1a0d06;
    --accent-soft:#2c1a12;
    --ok:         #6ddba4;
    --ok-soft:    #16301f;
    --warn:       #f0c164;
    --warn-soft:  #33280f;
    --bad:        #ff8b82;
    --bad-soft:   #351a19;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow:    0 2px 4px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
    --shadow-lg: 0 4px 8px rgba(0,0,0,.35), 0 28px 64px rgba(0,0,0,.45);
  }
}

/* ===== 2. Reset ===== */
*, *::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 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.025em; font-weight: 800; }
fieldset { border: 0; padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

/* ===== 3. Utilidades ===== */
.wrap { width: min(1180px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { width: min(760px, 100%); }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ===== 4. Tipografía ===== */
h1 { font-size: clamp(1.85rem, 1.1rem + 3.1vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.15rem); }
h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.015em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em;
       background: var(--line-soft); padding: .1em .35em; border-radius: 5px; }

/* ===== 5. Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; }
.brand-mark { width: 26px; height: 26px; color: var(--accent); }
.brand-name { font-weight: 800; font-size: 1.18rem; letter-spacing: -0.04em; }
.header-nav { display: flex; gap: 1.4rem; font-size: .93rem; font-weight: 600; color: var(--ink-soft); }
.header-nav a { transition: color .2s var(--ease-out); }
.header-nav a:hover { color: var(--accent); }
@media (max-width: 719px) { .header-nav { display: none; } }

/* ===== 6. Hero + herramienta ===== */
.hero { padding: clamp(1.7rem, 4vw, 3.2rem) 0 1.6rem; }
.hero h1 { max-width: 20ch; }
.hero-sub {
  margin-top: .85rem; max-width: 62ch;
  font-size: clamp(1rem, .96rem + .25vw, 1.12rem); color: var(--ink-soft);
}

.tool-card {
  margin-top: clamp(1.3rem, 3vw, 2rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr;
  overflow: hidden;
}
@media (min-width: 960px) {
  .tool-card { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .tool-controls { border-right: 1px solid var(--line-soft); }
}
.tool-controls { padding: clamp(1.1rem, 2.4vw, 1.7rem); display: grid; gap: 1.5rem; align-content: start; }
.tool-preview  { padding: clamp(1.1rem, 2.4vw, 1.7rem); background: var(--card-2); display: grid; gap: 1.15rem; align-content: start; }

/* --- paneles / campos --- */
.panel { display: grid; gap: .95rem; }
.panel > legend {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 800; font-size: 1.02rem; letter-spacing: -0.02em; padding: 0; margin-bottom: .2rem;
}
.step-n {
  display: grid; place-items: center; width: 22px; height: 22px; flex: none;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-size: .78rem; font-weight: 800;
}
.field { display: grid; gap: .4rem; }
.field-label { font-size: .86rem; font-weight: 700; color: var(--ink-soft); }
.field-opt { font-weight: 500; color: var(--muted); }
.field-help { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.field-narrow { max-width: 220px; }
.row { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 540px) { .row { grid-template-columns: 1fr auto; } }

input[type="text"], input[type="url"], textarea, select {
  width: 100%; padding: .68rem .8rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
input[type="text"]:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea { resize: vertical; min-height: 76px; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

input[type="range"] { width: 100%; accent-color: var(--accent); height: 26px; }

/* --- tabs --- */
.tabs { display: flex; gap: .3rem; padding: .25rem; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; }
.tab {
  flex: 1; padding: .48rem .5rem; border-radius: 8px; font-size: .9rem; font-weight: 700;
  color: var(--muted); transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

/* --- colores --- */
.colors { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; }
.color { display: grid; gap: .3rem; justify-items: center; font-size: .74rem; font-weight: 600; color: var(--muted); }
.color input[type="color"] {
  width: 62px; height: 44px; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: none;
}
.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.btn-swap { padding: .5rem .7rem; font-size: .82rem; }
.btn-swap svg { width: 16px; height: 16px; }

.palettes { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.pal {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .55rem .28rem .32rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
  font-size: .76rem; font-weight: 600; color: var(--ink-soft);
  transition: border-color .18s var(--ease-out), transform .18s var(--ease-out);
}
.pal:hover { border-color: var(--accent); transform: translateY(-1px); }
.pal i { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(0,0,0,.14); display: block; }
.pal i + i { margin-left: -9px; }

/* --- chips (estilos) --- */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .45rem .8rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg);
  font-size: .87rem; font-weight: 600; color: var(--ink-soft);
  transition: all .18s var(--ease-out);
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* --- emojis / logo --- */
.center-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.emojis { display: flex; flex-wrap: wrap; gap: .28rem; margin-top: .5rem; }
.emoji {
  width: 38px; height: 38px; display: grid; place-items: center;
  font-size: 1.15rem; line-height: 1; border-radius: 10px;
  border: 1px solid transparent; background: var(--bg);
  transition: transform .16s var(--ease-out), border-color .16s var(--ease-out);
}
.emoji:hover { transform: translateY(-2px); border-color: var(--line); }
.emoji.is-active { border-color: var(--accent); background: var(--accent-soft); }
.emojis-small .emoji { width: 34px; height: 34px; font-size: 1rem; }

/* --- formatos --- */
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.format {
  position: relative; display: grid; justify-items: center; gap: .18rem;
  padding: .8rem .4rem .7rem; text-align: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg);
  transition: all .18s var(--ease-out);
}
.format input { position: absolute; opacity: 0; pointer-events: none; }
.format svg { width: 34px; height: 34px; color: var(--ink-soft); }
.format b { font-size: .82rem; font-weight: 700; line-height: 1.2; }
.format small { font-size: .7rem; color: var(--muted); }
.format:hover { border-color: var(--accent); }
.format.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.format.is-active svg { color: var(--accent); }

.advanced { border-top: 1px dashed var(--line); padding-top: .8rem; }
.advanced > summary { cursor: pointer; font-size: .86rem; font-weight: 700; color: var(--muted); list-style: none; }
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before { content: "▸ "; display: inline-block; transition: transform .2s var(--ease-out); }
.advanced[open] > summary::before { content: "▾ "; }
.advanced > .field { margin-top: .7rem; }

/* ===== 7. Vista previa ===== */
.preview-block { display: grid; gap: .6rem; }
.preview-title { font-size: .86rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.preview-note { font-weight: 500; text-transform: none; letter-spacing: 0; }

.qr-stage {
  display: grid; place-items: center; padding: .9rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  min-height: 210px;
}
.qr-holder { width: 100%; max-width: 260px; aspect-ratio: 1; display: grid; place-items: center; }
.qr-holder canvas, .qr-holder svg { width: 100% !important; height: auto !important; border-radius: 6px; }

.viewer {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  touch-action: none;
}
.viewer canvas { width: 100%; height: 100%; display: block; }
.viewer-msg {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .6rem; padding: 1rem;
  text-align: center; font-size: .87rem; color: var(--muted); background: var(--card-2);
}
.viewer[data-viewer-state="ready"] .viewer-msg { display: none; }
.viewer[data-viewer-state="error"] .spinner { display: none; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.viewer-legend { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.swatch { width: 13px; height: 13px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; vertical-align: -2px; }

/* --- avisos de calidad --- */
.checks { display: grid; gap: .4rem; }
.check-item {
  display: flex; gap: .5rem; align-items: flex-start;
  padding: .55rem .7rem; border-radius: 10px; font-size: .82rem; line-height: 1.45;
}
.check-item svg { width: 16px; height: 16px; flex: none; margin-top: .12rem; }
.check-item.ok   { background: var(--ok-soft);   color: var(--ok); }
.check-item.warn { background: var(--warn-soft); color: var(--warn); }
.check-item.bad  { background: var(--bad-soft);  color: var(--bad); }
.check-item b { font-weight: 800; }

/* --- botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.1rem; border-radius: var(--r-sm);
  font-weight: 700; font-size: .93rem; text-align: center;
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), opacity .16s var(--ease-out);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-sm { padding: .55rem .85rem; font-size: .85rem; }
.btn-big { width: 100%; padding: .95rem 1.1rem; font-size: 1rem; text-align: left; justify-content: flex-start; }
.btn-big svg { width: 24px; height: 24px; flex: none; }
.btn-big span { display: grid; gap: .1rem; }
.btn-big small { font-weight: 500; font-size: .76rem; opacity: .82; }
.btn-stl { width: 100%; font-weight: 600; font-size: .8rem; color: var(--muted); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem .8rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg);
  font-size: .85rem; font-weight: 600; color: var(--ink-soft);
  transition: border-color .18s var(--ease-out), color .18s var(--ease-out);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }
.btn-quiet { color: var(--muted); }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 130px; }
.download-block { display: grid; gap: .45rem; }

.privacy { font-size: .82rem; line-height: 1.5; color: var(--ink-soft); }
.limits  { font-size: .76rem; line-height: 1.5; color: var(--muted); }
.noscript-note {
  padding: .7rem .85rem; border-radius: 10px;
  background: var(--warn-soft); color: var(--warn); font-size: .85rem; font-weight: 600;
}

/* --- estados de trabajo --- */
.tool-card[data-state="working"] .btn-primary { opacity: .65; pointer-events: none; }

/* ===== 8. Anuncios (huecos vacíos, sin scripts de terceros) ===== */
.ad-slot {
  position: relative; display: grid; place-items: center;
  border: 1px dashed color-mix(in srgb, var(--muted) 45%, transparent);
  border-radius: var(--r); background: color-mix(in srgb, var(--muted) 6%, transparent);
  color: var(--muted);
}
.ad-tag { font-size: .68rem; font-weight: 800; letter-spacing: .2em; }
.ad-leaderboard { min-height: 100px; margin: clamp(1.4rem, 3vw, 2.4rem) 0; }
@media (min-width: 960px) { .ad-leaderboard { min-height: 120px; } }
.ad-incontent { min-height: 260px; margin: clamp(1.4rem, 3vw, 2.4rem) 0; }
@media (min-width: 720px) { .ad-incontent { min-height: 280px; } }

/* pop-up al descargar */
.ad-dialog {
  /* el reset pone margin:0 en todo y eso rompe el centrado nativo
     de <dialog>: hay que devolverle el margin auto */
  margin: auto; padding: 0;
  width: min(380px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem); overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg);
}
.ad-dialog::backdrop { background: rgba(12,12,16,.55); backdrop-filter: blur(2px); }
.ad-dialog-inner { padding: 1rem; display: grid; gap: .8rem; }
.ad-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.ad-dialog-head p { font-weight: 700; font-size: .98rem; }
.ad-dialog-x { display: grid; place-items: center; width: 32px; height: 32px; flex: none;
               border-radius: 50%; color: var(--muted); transition: background .18s var(--ease-out); }
.ad-dialog-x:hover { background: var(--line-soft); color: var(--ink); }
.ad-dialog-x svg { width: 18px; height: 18px; }
.ad-modal { min-height: 250px; }

/* aviso de esquina */
.ad-toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  width: min(300px, calc(100vw - 2rem));
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-lg); padding: .55rem;
  animation: toast-in .45s var(--ease-out) both;
}
.ad-toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } }
.ad-toast-x {
  position: absolute; top: -9px; right: -9px; z-index: 1;
  display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm);
}
.ad-toast-x svg { width: 14px; height: 14px; }
.ad-corner { min-height: 96px; }

/* ===== 9. Secciones de contenido ===== */
.section { padding: clamp(2rem, 5vw, 3.6rem) 0; }
.section > .wrap > h2 { max-width: 22ch; }
.section-sub { margin-top: .6rem; max-width: 60ch; color: var(--ink-soft); }

.steps { list-style: none; padding: 0; margin-top: 1.6rem; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 1.2rem; } }
.steps li {
  position: relative; padding: 1.3rem 1.2rem 1.4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.step-badge {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 11px; background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 1rem; margin-bottom: .7rem;
}
.steps h3 { margin-bottom: .35rem; }
.steps p { font-size: .92rem; color: var(--ink-soft); }

.section-prose { background: var(--card); border-block: 1px solid var(--line); }
.section-prose h2 { margin-bottom: 1rem; }
.section-prose h3 { font-size: 1.12rem; margin-top: 1.9rem; margin-bottom: .5rem; }
.section-prose p { color: var(--ink-soft); margin-bottom: .8rem; }

.ideas { margin-top: 1.6rem; display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 540px) { .ideas { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .ideas { grid-template-columns: repeat(4, 1fr); } }
.idea {
  padding: 1.15rem 1.1rem 1.25rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.idea:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.idea-icon { width: 26px; height: 26px; color: var(--accent); margin-bottom: .65rem; }
.idea h3 { margin-bottom: .3rem; }
.idea p { font-size: .87rem; color: var(--ink-soft); }

.faq { margin-top: 1.4rem; display: grid; gap: .5rem; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.faq-item > summary {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: .95rem 1.1rem; cursor: pointer; font-weight: 700; font-size: .98rem;
  list-style: none;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+"; flex: none; font-size: 1.35rem; font-weight: 400; line-height: 1; color: var(--accent);
  transition: transform .22s var(--ease-out);
}
.faq-item[open] > summary::after { transform: rotate(45deg); }
.faq-a { padding: 0 1.1rem 1.05rem; }
.faq-a p { font-size: .92rem; color: var(--ink-soft); }

/* ===== 10. Footer ===== */
.site-footer { border-top: 1px solid var(--line); padding: 2.2rem 0 2.6rem; background: var(--card); }
.footer-inner { display: grid; gap: 1.1rem; }
@media (min-width: 720px) { .footer-inner { grid-template-columns: 1fr auto; align-items: start; } }
.footer-brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.04em; }
.footer-tag { font-size: .87rem; color: var(--muted); max-width: 46ch; margin-top: .2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.footer-links a:hover { color: var(--accent); }
.credits { margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--line-soft);
           font-size: .74rem; color: var(--muted); }
.credits a { text-decoration: underline; text-underline-offset: 2px; }

/* --- Móvil: una sola columna, intercalando controles y vistas
       previas para que el resultado nunca quede a mil píxeles.
       display:contents sube los bloques hijos a la rejilla de la
       tarjeta y así se pueden ordenar entre sí. --- */
@media (max-width: 959px) {
  .tool-card {
    padding: clamp(1.1rem, 4vw, 1.6rem);
    gap: 1.5rem;
    background: var(--card);
  }
  .tool-controls, .tool-preview { display: contents; }
  .panel-content  { order: 1; }
  .block-qr       { order: 2; }
  .panel-design   { order: 3; }
  .panel-object   { order: 4; }
  .block-3d       { order: 5; }
  .viewer-legend  { order: 6; }
  #checks         { order: 7; }
  .download-block { order: 8; }
  .privacy        { order: 9; }
  .limits         { order: 10; }
  .noscript-note  { order: 11; }
}

/* ===== 11. Responsive extra ===== */
@media (max-width: 400px) {
  .formats { grid-template-columns: 1fr; }
  .format { grid-template-columns: 34px 1fr; justify-items: start; text-align: left; align-items: center;
            column-gap: .7rem; padding: .7rem .8rem; }
  .format svg { grid-row: span 2; }
}

/* páginas legales */
.legal { padding: clamp(2rem, 5vw, 3.4rem) 0; }
.legal h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin-bottom: 1rem; }
.legal h2 { font-size: 1.2rem; margin-top: 1.8rem; margin-bottom: .5rem; }
.legal p, .legal li { color: var(--ink-soft); font-size: .95rem; margin-bottom: .7rem; }
.legal ul { padding-left: 1.2rem; }
.legal .todo {
  background: var(--warn-soft); color: var(--warn); border-radius: 10px;
  padding: .8rem 1rem; font-size: .87rem; font-weight: 600; margin-bottom: 1.2rem;
}

/* ===== 12. Reduced-motion (solo lo intrusivo) ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ad-toast { animation: none; }
}
