/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --ink: #0e1626;
  --ink-2: #2b3648;
  --muted: #5a6577;
  --line: #e1e6ee;
  --line-2: #cfd6e2;
  --brand: #1447e6;
  --brand-d: #0d34b3;
  --brand-l: #e8eeff;
  --ok: #157a3b;
  --ok-l: #e6f5ec;
  --warn: #8a5300;
  --warn-b: #f59e0b;
  --warn-l: #fff6e0;
  --err: #b42318;
  --err-l: #fdecea;
  --info: #1f4fa8;
  --info-l: #eaf1ff;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(14, 22, 38, .05), 0 8px 24px rgba(14, 22, 38, .06);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* =============================================================
   2. Reset y base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
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 { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand); color: #fff; }
[hidden] { display: none !important; }

.skip-link { position: fixed; top: -100px; left: 12px; padding: .6rem 1rem; background: #fff; color: var(--ink); z-index: 9999; border-radius: 8px; font-weight: 600; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: var(--gutter); }
.ic { width: 18px; height: 18px; flex: none; }
.ic-lg { width: 26px; height: 26px; }
.js-only { display: none; }
.js .js-only { display: inline-flex; }

/* =============================================================
   3. Cabecera
   ============================================================= */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; }
.site-nav { display: none; gap: 4px; }
.site-nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
.site-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }

/* =============================================================
   4. Hero
   ============================================================= */
.hero { padding-top: 28px; padding-bottom: 8px; }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.75rem); font-weight: 800; letter-spacing: -.035em; max-width: 24ch; }
.hero-sub { margin-top: 12px; max-width: 78ch; color: var(--ink-2); font-size: clamp(1rem, 1.6vw, 1.12rem); }
.trust { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.trust li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.trust .ic { color: var(--brand); }

/* =============================================================
   5. Tarjeta de herramienta
   ============================================================= */
.tool-section { padding-top: 18px; padding-bottom: 14px; }
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.tool-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); border: 1px solid transparent; transition: background .2s var(--ease); }
.step .n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 700; }
.step:hover { background: var(--surface-2); }
.step[aria-selected="true"] { background: var(--brand-l); color: var(--brand-d); border-color: #c9d7ff; }
.step[aria-selected="true"] .n { background: var(--brand); color: #fff; border-color: var(--brand); }
.tool-top-r { display: flex; align-items: center; gap: 10px; }
.privacy-pill { display: none; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ok); background: var(--ok-l); padding: 5px 10px; border-radius: 999px; }

.tool-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.panels { padding: 14px; min-width: 0; }
.preview { padding: 14px; background: var(--surface-2); border-top: 1px solid var(--line); min-width: 0; order: -1; }

.panel[hidden] { display: none; }
.block { margin-bottom: 20px; }
.block:last-child { margin-bottom: 4px; }
.block-h { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.block-h small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.pane-msg { font-size: 13px; margin-top: 8px; min-height: 0; }
.pane-msg.ok { color: var(--ok); } .pane-msg.err { color: var(--err); } .pane-msg.warn { color: var(--warn); }

/* Tipo de código */
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.type-grid button { text-align: left; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; display: flex; flex-direction: column; gap: 1px; transition: border-color .15s, background .15s; }
.type-grid button b { font-size: 14.5px; font-weight: 700; }
.type-grid button span { font-size: 12px; color: var(--muted); }
.type-grid button:hover { border-color: var(--brand); }
.type-grid button[aria-checked="true"] { border-color: var(--brand); background: var(--brand-l); box-shadow: inset 0 0 0 1px var(--brand); }
.type-grid button[aria-checked="true"] b { color: var(--brand-d); }

/* Segmentado */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 10px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--ink-2); line-height: 1.2; }
.seg button[aria-checked="true"] { background: #fff; color: var(--brand-d); box-shadow: 0 1px 2px rgba(14, 22, 38, .12); }
.seg-sm { margin-bottom: 0; }
.seg-sm button { padding: 8px 14px; }

/* Formularios */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .field .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field label small, .field .lbl small, .block-h small, .chk small { color: var(--muted); font-weight: 400; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; padding: 9px 11px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-s); min-height: 40px; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #b7c1d3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 71, 230, .16); }
input.mono, .mono { font-family: var(--mono); letter-spacing: .02em; }
input[type="color"] { padding: 3px; height: 40px; cursor: pointer; }
input[type="range"] { padding: 0; min-height: 40px; accent-color: var(--brand); border: 0; background: none; box-shadow: none; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
input.invalid { border-color: var(--err); background: #fffafa; }
input.valid-ok { border-color: #7cc79a; }
textarea { resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.45; }
output { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

.code-msg { font-size: 13px; line-height: 1.45; min-height: 20px; display: flex; flex-direction: column; gap: 4px; }
.code-msg .m { display: flex; gap: 6px; align-items: flex-start; }
.code-msg .m svg { margin-top: 2px; }
.code-msg .m-err { color: var(--err); font-weight: 500; }
.code-msg .m-ok { color: var(--ok); font-weight: 500; }
.code-msg .m-note { color: var(--muted); }
.code-msg .m-note a { text-decoration: underline; }
.code-msg .fix { align-self: flex-start; }

.check-grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 4px 14px; margin-bottom: 12px; }
.chk { display: flex; align-items: center; gap: 9px; padding: 6px 2px; font-size: 14.5px; cursor: pointer; }

/* Plantillas */
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tpl-grid button { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.tpl-grid button .ic { grid-row: span 2; color: var(--brand); width: 22px; height: 22px; }
.tpl-grid button b { font-size: 14px; }
.tpl-grid button span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.tpl-grid button:hover { border-color: var(--brand); }
.tpl-grid button.on { border-color: var(--brand); background: var(--brand-l); box-shadow: inset 0 0 0 1px var(--brand); }

.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.logo-thumb { width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff center/contain no-repeat; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: #fff; font-weight: 600; font-size: 14.5px; line-height: 1.2; color: var(--ink); transition: background .15s, border-color .15s, transform .15s; min-height: 40px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 11px; min-height: 34px; font-size: 13.5px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn-lg { padding: 13px 20px; font-size: 16px; min-height: 52px; }
.btn[disabled], .btn.is-busy { opacity: .65; pointer-events: none; }
.link-btn { font-size: 13.5px; font-weight: 600; align-self: center; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }

/* Avisos */
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.5; margin-bottom: 16px; border: 1px solid; }
.callout .ic { margin-top: 2px; }
.callout strong { display: block; margin-bottom: 2px; }
.callout-warn { background: var(--warn-l); border-color: #f3d48a; color: #5c3a00; }
.callout-warn .ic { color: var(--warn-b); }
.callout-err { background: var(--err-l); border-color: #f2b8b2; color: #7a1a12; }
.callout-info { background: var(--info-l); border-color: #c5d7f8; color: #15386f; }
.print-how { display: block; margin-top: 6px; font-size: 13px; color: #6b4a08; }
.print-warn { border-width: 2px; border-color: var(--warn-b); }
.spec-line { font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 10px; }
.custom-grid { margin-top: 12px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface-2); }

/* =============================================================
   6. Modo masivo: tabla
   ============================================================= */
.bulk-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bulk-pane { border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; background: var(--surface-2); margin-bottom: 12px; }
.pane-t { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.bulk-pane textarea { margin-bottom: 4px; }
.seq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.table-wrap { border: 1px solid var(--line-2); border-radius: 10px; overflow: auto; max-height: 460px; background: #fff; }
.grid-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; min-width: 620px; }
.grid-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; padding: 7px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.grid-table td { padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: middle; }
.grid-table td:last-child { border-right: 0; }
.grid-table td.n { padding: 0 8px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; background: var(--surface-2); font-size: 12px; }
.grid-table td input { border: 0; border-radius: 0; min-height: 36px; padding: 6px 8px; font-size: 13.5px; background: transparent; box-shadow: none; }
.grid-table td input:focus { background: #f1f5ff; box-shadow: inset 0 0 0 2px var(--brand); }
.grid-table td input.mono { font-size: 13px; }
.grid-table tr.sel td { background: #f5f8ff; }
.grid-table tr.bad td.c-code-td input { color: var(--err); }
.grid-table .c-n { width: 40px; } .grid-table .c-p { width: 84px; } .grid-table .c-code { width: 150px; } .grid-table .c-ref { width: 96px; } .grid-table .c-c { width: 64px; } .grid-table .c-s { width: 34px; } .grid-table .c-x { width: 34px; }
.st { display: grid; place-items: center; height: 36px; }
.st svg { width: 17px; height: 17px; }
.st.ok { color: var(--ok); } .st.bad { color: var(--err); } .st.empty { color: var(--line-2); }
.rm { width: 34px; height: 36px; display: grid; place-items: center; color: var(--muted); }
.rm:hover { color: var(--err); }
.table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.repeat { font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.repeat input { width: 64px; min-height: 34px; padding: 4px 8px; }
.pager { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pager button { min-width: 30px; height: 30px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; font-weight: 600; color: var(--ink-2); }
.pager button:hover:not([disabled]) { border-color: var(--brand); }
.pager button[disabled] { opacity: .4; cursor: default; }
.row-errors { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.row-errors .re { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--err-l); color: #7a1a12; border: 1px solid #f2b8b2; }
.row-errors .re button { font-weight: 700; text-decoration: underline; color: inherit; }
.row-errors .re-sum { background: var(--warn-l); color: #5c3a00; border-color: #f3d48a; }

/* =============================================================
   7. Vista previa
   ============================================================= */
.pv { margin-bottom: 18px; }
.pv:last-child { margin-bottom: 0; }
.pv-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pv-t { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.label-stage { background: #fff; background-image: linear-gradient(45deg, #f1f3f8 25%, transparent 25%), linear-gradient(-45deg, #f1f3f8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f1f3f8 75%), linear-gradient(-45deg, transparent 75%, #f1f3f8 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; border: 1px solid var(--line-2); border-radius: 12px; padding: 18px; display: grid; place-items: center; min-height: 150px; }
#labelPreview { width: 100%; display: grid; place-items: center; }
#labelPreview svg { width: 100%; max-width: 520px; max-height: 340px; height: auto; filter: drop-shadow(0 6px 14px rgba(14, 22, 38, .18)); }
.warn-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.wl { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; border: 1px solid; }
.wl .ic { margin-top: 2px; }
.wl b { display: block; font-size: 13.5px; }
.wl .tip { display: block; margin-top: 3px; opacity: .92; }
.wl-error { background: var(--err-l); border-color: #f2b8b2; color: #7a1a12; }
.wl-warn { background: var(--warn-l); border-color: #f3d48a; color: #5c3a00; }
.wl-info { background: var(--info-l); border-color: #c5d7f8; color: #15386f; }
.wl-ok { background: var(--ok-l); border-color: #b5e0c5; color: #0f5a2a; }

.gallery { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.gal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.thumb { position: relative; padding: 4px; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; display: block; width: 100%; }
.thumb svg { width: 100%; height: auto; }
.thumb:hover { border-color: var(--brand); }
.thumb.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(20, 71, 230, .25); }
.thumb.bad { border-color: var(--err); }
.thumb .tn { position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, .85); padding: 0 4px; border-radius: 4px; }

.sheet-stage { background: #dde2ec; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; display: grid; place-items: start center; }
#sheetPreview { width: 100%; max-width: 620px; box-shadow: 0 6px 20px rgba(14, 22, 38, .22); background: #fff; line-height: 0; }
#sheetPreview svg { width: 100%; height: auto; }
.pv-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* Vista por pasos: en el paso 3 se ve la hoja; en 1 y 2 la etiqueta */
.tool-card[data-step="1"] .pv-sheet, .tool-card[data-step="2"] .pv-sheet { display: none; }
.tool-card[data-step="3"] .pv-label { display: none; }

/* =============================================================
   8. Barra de descarga
   ============================================================= */
.dl-bar { border-top: 1px solid var(--line); padding: 14px; display: grid; gap: 12px; background: var(--surface); border-radius: 0 0 16px 16px; }
.dl-main { display: flex; flex-direction: column; gap: 8px; }
#btnPDF { width: 100%; flex-wrap: wrap; text-align: left; justify-content: center; }
#btnPDF small { font-weight: 500; opacity: .85; font-size: 12.5px; }
.scale-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; background: var(--warn-l); border: 1px solid #f3d48a; color: #5c3a00; padding: 8px 10px; border-radius: 8px; line-height: 1.4; }
.scale-note .ic { color: var(--warn-b); margin-top: 1px; }
.dl-sec { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dl-sec select { width: auto; min-height: 34px; padding: 4px 8px; font-size: 13.5px; }
.dl-lbl { font-size: 13px; color: var(--muted); margin-right: 2px; }
.dl-status { font-size: 13px; color: var(--muted); min-height: 0; }
.dl-status.ok { color: var(--ok); font-weight: 500; } .dl-status.err { color: var(--err); font-weight: 500; }
.dl-status:empty { display: none; }

.fineprint { font-size: 13px; color: var(--muted); line-height: 1.55; margin-top: 12px; max-width: 110ch; }

/* =============================================================
   9. Anuncios (solo huecos). Apagados con <html class="ads-off">: para activarlos,
   quita esa clase en el <html> de cada página cuando AdSense esté aprobado.
   ============================================================= */
html.ads-off .ad, html.ads-off .ad-mid { display: none !important; }
.ad { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 2px dashed #b8c1d1; background: repeating-linear-gradient(135deg, #f7f8fb, #f7f8fb 10px, #f0f2f7 10px, #f0f2f7 20px); color: #6b7689; border-radius: 10px; text-align: center; }
.ad-tag { font-weight: 800; letter-spacing: .28em; font-size: 15px; color: #56607a; }
.ad-fmt { font-size: 11.5px; letter-spacing: .02em; }
.ad-banner { margin: 18px auto; max-width: 970px; min-height: 100px; }
.ad-mid { margin-top: 8px; }
.ad-rect { width: min(336px, 100%); min-height: 280px; margin: 10px auto; }
.ad-mini { min-height: 100px; width: 100%; border-radius: 8px; }
.ad-dialog { border: 0; border-radius: 16px; padding: 0; width: min(420px, calc(100vw - 24px)); box-shadow: 0 24px 80px rgba(14, 22, 38, .4); }
.ad-dialog::backdrop { background: rgba(14, 22, 38, .55); }
.ad-dlg-in { position: relative; padding: 20px 18px 18px; text-align: center; background: #fff; }
.ad-dlg-t { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; margin: 0 28px 6px; color: var(--ok); }
.ad-dlg-note { font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.ad-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2); z-index: 3; }
.ad-close:hover { background: #fff; border-color: var(--brand); }
.ad-toast { position: fixed; right: 14px; bottom: 14px; width: min(320px, calc(100vw - 28px)); z-index: 60; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 8px; box-shadow: 0 10px 40px rgba(14, 22, 38, .28); animation: toastIn .4s var(--ease); }
.ad-toast .ad-close-sm { top: -12px; right: -8px; width: 28px; height: 28px; background: #fff; box-shadow: 0 2px 8px rgba(14, 22, 38, .2); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; max-width: min(520px, calc(100vw - 24px)); background: #0e1626; color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 1.45; box-shadow: 0 10px 40px rgba(14, 22, 38, .4); }
.toast.err { background: #8f1d14; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* =============================================================
   10. Secciones de contenido
   ============================================================= */
.section { padding-top: 34px; padding-bottom: 18px; }
.section h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 16px; }
.lead { font-size: 1.06rem; color: var(--ink-2); max-width: 80ch; margin-bottom: 16px; }
.steps-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); counter-reset: none; }
.steps-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.big-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 800; font-size: 19px; margin-bottom: 12px; }
.steps-list h3 { font-size: 1.15rem; margin-bottom: 6px; }
.steps-list p { color: var(--ink-2); font-size: 15.5px; }
.cards { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.card p { color: var(--ink-2); font-size: 15px; }
.icon-card .ic { color: var(--brand); margin-bottom: 10px; }
.two-col { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; color: var(--ink-2); font-size: 15.5px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 12px; height: 7px; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }
.excel-sample { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow-x: auto; }
.excel-sample table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-family: var(--mono); min-width: 380px; }
.excel-sample th, .excel-sample td { border: 1px solid var(--line-2); padding: 6px 8px; text-align: left; }
.excel-sample th { background: #e9f3ec; color: #14532d; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
.spec-table th, .spec-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.spec-table th { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); position: sticky; top: 0; }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table td:first-child { font-weight: 600; white-space: nowrap; }
.spec-table td .use { font-weight: 600; font-size: 13px; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line-2); background: #fff; color: var(--brand); }
.spec-table td .use:hover { border-color: var(--brand); }

.faq { display: grid; gap: 10px; max-width: 940px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; letter-spacing: -.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; font-weight: 500; color: var(--brand); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 16px; color: var(--ink-2); font-size: 15.5px; }

/* =============================================================
   11. Pie
   ============================================================= */
.site-footer { margin-top: 40px; background: #0e1626; color: #c7d0e0; padding: 32px 0 20px; }
.site-footer .brand { color: #fff; }
.site-footer .fineprint { color: #97a3ba; max-width: 60ch; }
.footer-in { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: #dfe6f3; font-size: 14.5px; }
.copy { margin-top: 24px; padding-top: 16px; border-top: 1px solid #243047; }

/* Páginas legales */
.legal { max-width: 760px; margin: 32px auto; padding: 0 var(--gutter); }
.legal h1 { font-size: 2rem; margin-bottom: 14px; }
.legal h2 { font-size: 1.2rem; margin: 22px 0 6px; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { padding-left: 20px; }
.todo { background: var(--warn-l); border: 1px dashed var(--warn-b); padding: 1px 6px; border-radius: 4px; }

/* =============================================================
   12. Responsive
   ============================================================= */
@media (min-width: 540px) {
  :root { --gutter: 20px; }
  .type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .privacy-pill { display: inline-flex; }
  .gal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 720px) {
  .site-nav { display: flex; }
  .steps-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; }
  .dl-bar { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; }
  .dl-status { grid-column: 1 / -1; }
  .seq-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .tool-body { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); }
  .panels { padding: 18px 20px; }
  .preview { order: 0; border-top: 0; border-left: 1px solid var(--line); border-radius: 0 0 16px 0; padding: 18px 20px; }
  .preview-inner { position: sticky; top: 72px; }
  .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-card { position: relative; }
  .gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table-wrap { max-height: 520px; }
}
@media (min-width: 1280px) {
  .tool-body { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
  .gal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { padding-top: 40px; }
}
@media (min-width: 1600px) {
  .wrap { max-width: 1520px; }
}

@media (max-width: 539px) {
  .hero { padding-top: 16px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-sub { font-size: .94rem; line-height: 1.5; margin-top: 8px; }
  .trust { gap: 6px; margin-top: 10px; }
  .trust li { font-size: 12.5px; padding: 4px 10px; }
  .trust li:nth-child(n+3) { display: none; }
  .tool-section { padding-top: 10px; }
  .steps { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .step { justify-content: center; padding: 9px 4px; font-size: 13.5px; text-align: center; }
  .step .n { display: none; }
  .step[aria-selected="true"] { box-shadow: inset 0 0 0 1px #c9d7ff; }
  .tool-top-r { width: 100%; justify-content: flex-end; }
  #labelPreview svg { max-height: 240px; }
  .label-stage { padding: 12px; }
  .seg button { font-size: 13px; padding: 9px 6px; }
  .ad-toast { right: 8px; bottom: 8px; left: 8px; width: auto; }
}

/* Solo se apagan los efectos intrusivos (no hay animaciones esenciales) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ad-toast { animation: none; }
}

@media print {
  .site-header, .dl-bar, .ad, .ad-toast, .ad-dialog, .toast { display: none !important; }
}

/* Tarjetas de guías */
a.guide-card { display: block; color: inherit; transition: border-color .15s, transform .15s; }
a.guide-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-2px); }
a.guide-card h3 { color: var(--brand-d); }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); text-decoration: underline; }
.prose { max-width: 78ch; }
.prose p { margin-bottom: 14px; color: var(--ink-2); font-size: 16px; }
.prose h3 { font-size: 1.15rem; margin: 22px 0 8px; }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 14px; color: var(--ink-2); }
.prose li { margin-bottom: 6px; }
.prose code, .lead code { font-family: var(--mono); font-size: .9em; background: #eef1f7; padding: 1px 6px; border-radius: 5px; }
.note { background: var(--info-l); border: 1px solid #c5d7f8; color: #15386f; padding: 12px 14px; border-radius: 10px; font-size: 14.5px; margin: 16px 0; max-width: 78ch; }
