:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f0f2f6;
  --border: #e1e4eb;
  --text: #161a23;
  --muted: #667085;
  --accent: #3b5bfd;
  --accent-soft: #e9edff;
  --accent-text: #ffffff;
  --ok: #12925a;
  --ok-soft: #e3f6ec;
  --warn: #b25e00;
  --warn-soft: #fff3e0;
  --err: #c9302c;
  --err-soft: #fdeceb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.05);
  --checker: repeating-conic-gradient(#e7e9ee 0% 25%, #ffffff 0% 50%) 50% / 18px 18px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0f1116;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #2b303b;
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --accent: #6d86ff;
  --accent-soft: #232a4d;
  --ok: #3ccf8e;
  --ok-soft: #13301f;
  --warn: #f0a646;
  --warn-soft: #33250f;
  --err: #ff7b72;
  --err-soft: #3a1a18;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --checker: repeating-conic-gradient(#262a33 0% 25%, #1c2027 0% 50%) 50% / 18px 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h2 { font-size: 15px; margin: 0; font-weight: 650; letter-spacing: 0.01em; }
h3.sub { font-size: 13px; color: var(--muted); font-weight: 600; margin: 22px 0 10px; text-transform: uppercase; letter-spacing: 0.06em; }
code, kbd { font-family: 'Cascadia Code', Consolas, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border); }
small { color: var(--muted); }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand svg { width: 22px; height: 22px; fill: var(--accent); }
.brand small { font-weight: 500; font-size: 12px; }
.tabs { display: flex; gap: 4px; margin: 0 auto; background: var(--surface-2); padding: 4px; border-radius: 11px; }
.tab {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600;
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tab .count { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 0 6px; margin-left: 4px; }
.tab .count:empty { display: none; }
.icon-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Vistas ---------- */
.view { display: none; padding: 20px; max-width: 1360px; margin: 0 auto; }
.view.active { display: grid; }
#view-create.active { grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.editor { display: grid; gap: 20px; min-width: 0; }
.preview-col { align-self: stretch; display: flex; flex-direction: column; }
.preview-col .preview-card { position: sticky; top: 76px; }
.preview-sticky { flex: 1; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.wide { width: 100%; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-actions select, .head-actions input { width: auto; }
.hint { color: var(--muted); margin: -4px 0 14px; }

/* ---------- Tipos de contenido ---------- */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 16px; }
.type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 11px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.type-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.type-btn:hover { border-color: var(--accent); }
.type-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- Formularios ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form .full { grid-column: 1 / -1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid1 { display: grid; gap: 10px; align-content: start; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-width: 0; }
.field output { color: var(--text); font-weight: 500; }
.field.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
input[type='text'], input[type='url'], input[type='email'], input[type='tel'], input[type='number'], input[type='search'],
input[type='datetime-local'], input[type='password'], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px; width: 100%; min-width: 0; font-weight: 400;
}
textarea { resize: vertical; font-family: 'Cascadia Code', Consolas, monospace; font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
input[type='range'] { accent-color: var(--accent); width: 100%; }
input[type='checkbox'] { accent-color: var(--accent); width: 16px; height: 16px; }
.color-row { display: flex; gap: 6px; }
.color-row input[type='color'] { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; flex: none; }
.color-row input[type='text'] { font-family: 'Cascadia Code', Consolas, monospace; text-transform: uppercase; }
.label { margin: 14px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.label:first-of-type { margin-top: 4px; }

.btn {
  font: inherit; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.danger:hover { border-color: var(--err); color: var(--err); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- Secciones de diseño ---------- */
.section { border-top: 1px solid var(--border); padding: 12px 0 4px; }
.section:first-of-type { border-top: 0; }
.section > summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; }
.section > summary::-webkit-details-marker { display: none; }
.section > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.2s; margin-right: 4px; }
.section[open] > summary::after { transform: rotate(225deg); }
.section > :not(summary) { margin-bottom: 12px; }

.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.shape-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 8px 4px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font: inherit; font-size: 11px; }
.shape-btn svg { width: 36px; height: 36px; fill: var(--text); }
.shape-btn:hover { border-color: var(--accent); }
.shape-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.shape-btn.active svg { fill: var(--accent); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.swatch:hover { box-shadow: 0 0 0 2px var(--accent); }

.logo-row { display: grid; grid-template-columns: 170px 1fr; gap: 16px; }
.drop {
  border: 1.5px dashed var(--border); border-radius: 12px; min-height: 150px; display: grid; place-items: center;
  text-align: center; color: var(--muted); cursor: pointer; padding: 12px; background: var(--surface-2); position: relative;
}
.drop.over, .drop:hover { border-color: var(--accent); color: var(--accent); }
.drop img { max-width: 100%; max-height: 130px; object-fit: contain; }
.drop.big { min-height: 220px; font-size: 15px; }

/* ---------- Vista previa ---------- */
.preview-card { display: grid; gap: 12px; }
.preview-stage { background: var(--checker); border-radius: 12px; padding: 24px; display: grid; place-items: center; min-height: 320px; border: 1px solid var(--border); }
.preview { width: 100%; max-width: 330px; display: grid; place-items: center; }
.preview svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.08)); }
.preview .err { color: var(--err); text-align: center; font-weight: 600; padding: 20px; }
.status { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.ok .dot { background: var(--ok); }
.status.bad { background: var(--err-soft); color: var(--err); }
.status.bad .dot { background: var(--err); }
.status.pending .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.warnings { display: grid; gap: 6px; }
.warnings:empty { display: none; }
.warn { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 500; }
.meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; }
.meta div { background: var(--surface-2); border-radius: 9px; padding: 7px 8px; text-align: center; }
.meta dt { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.meta dd { margin: 0; font-weight: 650; font-size: 13px; }
.capbar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; padding: 0 !important; }
.capbar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.export { display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.export .btn-row { margin-top: 0; }
.export .field.inline select { width: auto; flex: 1; }
.raw summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.raw pre { white-space: pre-wrap; word-break: break-all; background: var(--surface-2); padding: 10px; border-radius: 9px; font-size: 12px; max-height: 200px; overflow: auto; margin: 8px 0 0; }

/* ---------- Lote ---------- */
.batch-grid { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }
.batch-opts { display: grid; gap: 12px; align-content: start; }
.progress { position: relative; height: 26px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent-soft); transition: width 0.1s; }
.progress span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.batch-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 20px; }
.batch-item { background: var(--surface-2); border-radius: 10px; padding: 10px; text-align: center; font-size: 11.5px; color: var(--muted); overflow: hidden; }
.batch-item svg { width: 100%; height: auto; display: block; margin-bottom: 6px; }
.batch-item span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-item.error { color: var(--err); }

/* ---------- Lector ---------- */
.scan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.engine { font-size: 12px; color: var(--muted); }
.cam-wrap { position: relative; margin-top: 12px; border-radius: 12px; overflow: hidden; background: #000; }
.cam-wrap video { width: 100%; display: block; }
.cam-frame { position: absolute; inset: 15%; border: 3px solid rgba(255, 255, 255, 0.85); border-radius: 16px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35); pointer-events: none; }
.scan-canvas { max-width: 100%; margin-top: 12px; border-radius: 10px; border: 1px solid var(--border); }
.scan-result { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface-2); }
.scan-result.empty { color: var(--muted); text-align: center; padding: 40px 16px; }
.scan-result .kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); font-weight: 700; }
.scan-result .value { font-family: 'Cascadia Code', Consolas, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-all; margin: 8px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 10px; max-height: 260px; overflow: auto; }
.scan-result table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.scan-result td { padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: top; word-break: break-all; }
.scan-result td:first-child { color: var(--muted); width: 35%; font-weight: 600; }
.scan-result .tech { font-size: 11.5px; color: var(--muted); }
.scan-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.scan-history li { background: var(--surface-2); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; display: flex; gap: 10px; justify-content: space-between; cursor: pointer; }
.scan-history li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-history li time { color: var(--muted); flex: none; }

/* ---------- Biblioteca ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.lib-grid.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.lib-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 8px; background: var(--surface); }
.lib-item .thumb { background: var(--checker); border-radius: 9px; padding: 10px; cursor: pointer; }
.lib-item .thumb svg { width: 100%; height: auto; display: block; }
.lib-item b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.lib-item .btn-row { margin-top: 0; }
.empty-msg { color: var(--muted); grid-column: 1 / -1; padding: 20px; text-align: center; background: var(--surface-2); border-radius: 12px; }

/* ---------- Dinámicos ---------- */
.dyn-intro { max-width: 720px; line-height: 1.6; }
.dyn-intro ol { padding-left: 20px; }
.dyn-intro li { margin: 6px 0; }
.dyn-auth { display: grid; gap: 12px; max-width: 380px; }
.dyn-auth p { margin: 0; color: var(--muted); }
.dyn-cta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.dyn-cta:empty { display: none; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; min-width: 0; }
.chart-title { font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 8px; }
.bar-chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar-chart .bar { fill: var(--accent); }
.bar-chart .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bar-chart .axis { fill: var(--muted); font-size: 11px; }
.bar-chart .hit { fill: transparent; cursor: crosshair; }
.bar-chart .hit:hover { fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; opacity: 0; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transition: opacity 0.1s; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.stats-grid .chart-box:first-child { grid-column: 1 / -1; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 76px; gap: 10px; align-items: center; font-size: 12.5px; }
.hbar .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.muted-sm { color: var(--muted); font-size: 12.5px; }
.base-bar { display: grid; gap: 8px; margin-bottom: 16px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; }
.base-row { display: flex; gap: 8px; }
.dyn-toolbar { display: flex; gap: 10px; margin-bottom: 12px; align-items: center; }
.dyn-toolbar input { max-width: 280px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.dyn-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dyn-table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.dyn-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.dyn-table tr:last-child td { border-bottom: 0; }
.dyn-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dyn-table .dest { max-width: 260px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.dyn-table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.dyn-table .short { background: var(--accent-soft); color: var(--accent); border: 0; }
.pill { font-size: 11.5px; font-weight: 650; padding: 2px 9px; border-radius: 20px; }
.pill.on { background: var(--ok-soft); color: var(--ok); }
.pill.paused { background: var(--warn-soft); color: var(--warn); }
.pill.off { background: var(--err-soft); color: var(--err); }
.card-head h2 small { font-weight: 500; }
a.btn { text-decoration: none; }
.hint a { color: var(--accent); word-break: break-all; }

/* ---------- Web pública: idioma, portada, FAQ, anuncios, pie ---------- */
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lang-pick { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 0 4px 0 10px; height: 36px; color: var(--muted); }
.lang-pick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.lang-pick select { border: 0; background: transparent; padding: 6px 4px; width: auto; font-weight: 600; color: var(--text); cursor: pointer; }
.lang-pick select:focus { outline: none; }
.tab[hidden] { display: none; }
a.brand { color: inherit; text-decoration: none; }
body:not([data-tab='create']) .only-create { display: none; }
.hero { max-width: 1360px; margin: 0 auto; padding: 22px 20px 0; }
.hero h1 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 6px; letter-spacing: -0.02em; line-height: 1.2; }
.hero p { margin: 0; color: var(--muted); max-width: 760px; font-size: 15px; }
.faq { max-width: 1360px; margin: 0 auto; padding: 8px 20px 20px; }
.faq h2 { font-size: 18px; margin: 10px 0 14px; }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq details p { margin: 8px 0 2px; color: var(--muted); line-height: 1.55; }
.ad-slot { display: block; text-align: center; }
.ad-slot[hidden] { display: none; }
.ad-slot .ad-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.ad-slot .ad-box { min-height: 100px; }
.wide-slot { max-width: 1360px; margin: 0 auto 10px; padding: 0 20px; }
.top-slot { margin-top: 16px; }
.top-slot .ad-box { min-height: 90px; }
.side-slot { margin-top: 28px; }
.side-slot .ad-box { min-height: 250px; }
.ad-placeholder { display: grid; place-items: center; min-height: 100px; border: 1.5px dashed var(--border); border-radius: 12px; color: var(--muted); font-size: 12.5px; background: var(--surface-2); }
.site-footer { max-width: 1360px; margin: 0 auto; padding: 18px 20px 28px; display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.footer-note { margin-left: auto; }
.legal { max-width: 760px; margin: 0 auto; padding: 24px 20px 40px; line-height: 1.65; }
.legal h1 { font-size: 28px; margin: 14px 0 4px; letter-spacing: -0.02em; }
.legal h2 { font-size: 17px; margin: 26px 0 6px; }
.legal .updated { color: var(--muted); margin: 0 0 18px; font-size: 13px; }
.legal a { color: var(--accent); }
.legal .back { font-weight: 600; text-decoration: none; font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; transition: 0.2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Impresión ---------- */
.print-area { display: none; }
@media print {
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; }
  .print-area .sheet { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 8mm; }
  .print-area .cell { text-align: center; break-inside: avoid; font: 9pt 'Segoe UI', sans-serif; }
  .print-area .cell svg { width: 100%; height: auto; }
  .print-area .single { display: grid; place-items: center; height: 90vh; }
  .print-area .single svg { width: 12cm; height: auto; }
  @page { margin: 12mm; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .brand small { display: none; }
  .topbar { gap: 12px; }
  .tab { padding: 7px 12px; }
}
@media (max-width: 1080px) {
  #view-create.active { grid-template-columns: 1fr; }
  .preview-col { order: -1; }
  .preview-col .preview-card { position: static; }
  .preview-col .side-slot { display: none !important; } /* en móvil quedaría antes del formulario */
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .brand small { display: none; }
  .footer-note { margin-left: 0; }
  .hero { padding: 16px 16px 0; }
  .faq, .wide-slot, .site-footer { padding-left: 16px; padding-right: 16px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .tab { flex: 1; padding: 7px 8px; }
  .view { padding: 16px; }
  .form, .grid2, .batch-grid, .scan-grid, .logo-row { grid-template-columns: 1fr; }
  .meta { grid-template-columns: repeat(2, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .hbar { grid-template-columns: 90px 1fr 64px; }
  .dyn-toolbar { flex-wrap: wrap; }
}
