/* Conversor HVstock v2.2 · estilo de las maquetas aprobadas el 16/10/2026 (docs/mockups/mockups.css).
   Solo tokens de docs/marca/GUIA-DE-MARCA.md (§2.2, §3, §4, §6). Radio 0, sin sombras, sin degradados.
   Fuentes locales (OFL, ver fonts/LICENCIA-FUENTES.txt): Hind 400/500/600 y Palanquin Dark 400/500.
   Sin estilos en línea ni recursos externos (CSP default-src 'self'). Ningún texto por debajo de 14 px.
   Ninguna caja con un lado más grueso que otro (REGISTRO-ERRORES del kit, #26). */

@font-face { font-family: "Hind"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/hind-400.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/hind-500.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/hind-600.woff2") format("woff2"); }
@font-face { font-family: "Palanquin Dark"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/palanquin-dark-400.woff2") format("woff2"); }
@font-face { font-family: "Palanquin Dark"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/palanquin-dark-500.woff2") format("woff2"); }

:root {
  /* Color (guía §2.2) */
  --brand: #0049E8;
  --brand-hover: #003BB8;
  --brand-tint: #EAF0FE;
  --ink: #242424;
  --text: #333333;
  --text-muted: #595959;
  --border: #E6E6E6;
  --bg: #FFFFFF;
  --bg-subtle: #F8F8F8;
  --btn-default: #F7F7F7;
  --btn-default-hover: #EFEFEF;
  --disabled-bg: #F3F3F3;
  --error: #B42318;
  --error-bg: #FEF3F2;
  --warning-text: #8A5A00;
  --warning-bg: #FFF7E0;

  /* Tipografía (guía §3; mínimo 14 px) */
  --font-body: "Hind", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-title: "Palanquin Dark", "Hind", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-lg: 20px;
  --fs-xl: 24px;

  /* Espacio (guía §4: 4, 8, 16, 24, 32, 48, 64) */
  --s-1: 4px; --s-2: 8px; --s-3: 16px; --s-4: 24px; --s-5: 32px; --s-6: 48px; --s-7: 64px;
  --control-h: 48px;
  --container: 1120px;
  --gutter: 16px;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-subtle);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 400; color: var(--ink); margin: 0; line-height: 1.3; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-base); font-family: var(--font-body); font-weight: 600; }
p { margin: 0; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
code { font-family: var(--font-mono); font-size: var(--fs-sm); }
.mono { font-family: var(--font-mono); font-size: var(--fs-sm); letter-spacing: 0; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.strong { font-weight: 600; color: var(--ink); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: square; stroke-linejoin: miter; }
.icon-24 { width: 24px; height: 24px; }
.icon-16 { width: 16px; height: 16px; }
[hidden] { display: none !important; }

/* Mejora progresiva: assets/early.js pone la clase «js» en <html> antes de pintar.
   Sin JS se ve todo lo necesario para usar la página (también el menú de cuenta). */
html:not(.js) [data-js-only] { display: none !important; }
html:not(.js) .account__button { display: none; }
html:not(.js) .account__menu[hidden] { display: flex !important; position: static; min-width: 0; padding: 0; border: 0; background: transparent; }
html:not(.js) .account__menu .account__who { display: none; }
.js .decision [data-when]:not(.is-active) { display: none; }

/* ---------- Cabecera ---------- */
.app-header { background: var(--bg); border-bottom: 1px solid var(--border); }
.app-header__inner {
  max-width: var(--container); margin: 0 auto; padding: var(--s-2) var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 72px;
}
.app-header__brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; color: var(--text-muted); }
.app-header__brand img { width: 136px; }
.app-header__tool { position: relative; font-size: var(--fs-sm); padding-left: var(--s-3); line-height: 1.2; }
.app-header__tool::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--border); }
@media (max-width: 599px) { .app-header__tool { display: none; } .app-header__brand img { width: 124px; } }

.account { position: relative; }
.account__button {
  display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-2);
  background: transparent; border: 1px solid transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.account__button:hover { background: var(--btn-default); border-color: var(--border); }
.account__button[aria-expanded="true"] { background: var(--btn-default); border-color: var(--border); }
.account__avatar {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand); font-weight: 600; font-size: var(--fs-sm);
}
@media (max-width: 599px) { .account__name { display: none; } }
.account__menu {
  position: absolute; right: 0; top: calc(100% + var(--s-1)); z-index: 20; min-width: 248px;
  background: var(--bg); border: 1px solid var(--border); padding: var(--s-2) 0; margin: 0; list-style: none;
}
.account__who { padding: var(--s-2) var(--s-3) var(--s-3); border-bottom: 1px solid var(--border); margin-bottom: var(--s-2); font-size: var(--fs-sm); color: var(--text-muted); }
.account__who strong { display: block; color: var(--ink); font-size: var(--fs-base); }
.account__menu form { margin: 0; }
.account__menu a, .account__menu button {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 44px; padding: 0 var(--s-3);
  color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
}
.account__menu a:hover, .account__menu button:hover, .account__menu a[aria-current="page"] { background: var(--brand-tint); color: var(--brand); }

/* ---------- Estructura ---------- */
.page { flex: 1; width: 100%; max-width: var(--container); margin: 0 auto; padding: var(--s-5) var(--gutter) var(--s-7); }
.page--narrow { max-width: 640px; }
.page-head { display: grid; gap: var(--s-2); margin-bottom: var(--s-5); }
.page-head p { color: var(--text-muted); max-width: 70ch; }
.page-head p strong { color: var(--ink); }
.section { margin-top: var(--s-6); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-3); }
.section-head p { color: var(--text-muted); font-size: var(--fs-sm); }
.count { font-family: var(--font-body); color: var(--text-muted); font-weight: 400; }
.app-footer { border-top: 1px solid var(--border); background: var(--bg); }
.app-footer__inner { max-width: var(--container); margin: 0 auto; padding: var(--s-3) var(--gutter); font-size: var(--fs-sm); color: var(--text-muted); }
.generate-form { flex: 1; display: flex; flex-direction: column; }

.panel { background: var(--bg); border: 1px solid var(--border); padding: var(--s-4); }
@media (max-width: 599px) { .panel { padding: var(--s-3); } }

/* Mensajes de la página (flash) */
.flash { display: grid; gap: var(--s-3); margin-bottom: var(--s-4); }

/* ---------- Pasos (stepper) ---------- */
.steps { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: flex; gap: var(--s-2); counter-reset: step; }
.steps li { flex: 1; display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); color: var(--text-muted); padding-top: var(--s-2); border-top: 2px solid var(--border); counter-increment: step; }
.steps li::before {
  content: counter(step); width: 24px; height: 24px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font-weight: 600;
}
.steps li[aria-current="step"] { color: var(--ink); font-weight: 600; border-top-color: var(--brand); }
.steps li[aria-current="step"]::before { background: var(--brand); border-color: var(--brand); color: var(--bg); }
.steps li.is-done { color: var(--text); border-top-color: var(--brand); }
.steps li.is-done::before { content: "✓"; color: var(--brand); border-color: var(--brand); }
@media (max-width: 599px) { .steps li .step-long { display: none; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--control-h); padding: 0 var(--s-4); border: 1px solid var(--brand);
  background: var(--brand); color: var(--bg); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--bg); }
.btn--secondary { background: var(--btn-default); border-color: var(--border); color: var(--text); }
.btn--secondary:hover { background: var(--btn-default-hover); border-color: var(--border); color: var(--text); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 0 var(--s-2); }
.btn--ghost:hover { background: var(--brand-tint); border-color: transparent; color: var(--brand-hover); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--disabled-bg); border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
@media (max-width: 599px) { .btn-row .btn { width: 100%; } }

/* ---------- Campos ---------- */
.field { display: grid; gap: var(--s-2); align-content: start; }
.field + .field { margin-top: var(--s-4); }
.label { font-weight: 600; color: var(--ink); }
.hint { font-size: var(--fs-sm); color: var(--text-muted); }
.input, .select {
  width: 100%; min-height: var(--control-h); padding: 0 var(--s-3); background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 0; font: inherit; font-size: var(--fs-base);
}
.input:hover, .select:hover { border-color: var(--text-muted); }
.input:focus, .select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.select { appearance: none; padding-right: 40px; background-image: url("select-chevron.svg"); background-repeat: no-repeat; background-position: right 16px center; }
.input--invalid { border-color: var(--error); }
.field-error { display: flex; gap: var(--s-2); align-items: flex-start; color: var(--error); font-size: var(--fs-sm); font-weight: 600; }
.name-dup { margin-top: var(--s-1); }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 96px; }
.password-toggle {
  position: absolute; right: 2px; top: 2px; bottom: 2px; min-width: 88px; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1);
  background: var(--bg); border: 0; color: var(--brand); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.check { display: flex; align-items: flex-start; gap: var(--s-3); min-height: 44px; padding: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; cursor: pointer; }

/* ---------- Mensajes (borde de 1 px en todo el contorno; nunca un lado más grueso) ---------- */
.msg { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3); border: 1px solid var(--border); background: var(--bg); }
.msg .icon { margin-top: 2px; }
.msg > div { display: grid; gap: var(--s-1); min-width: 0; }
.msg p + p { margin-top: var(--s-1); }
.msg > div > p + p { margin-top: 0; } /* el hueco entre párrafos ya lo da el gap de la rejilla (QA 16/10, D-9) */
.msg ul { margin: var(--s-1) 0 0; padding-left: 20px; display: grid; gap: var(--s-1); }
.msg--error { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.msg--error strong { color: var(--error); }
.msg--error details.tech summary, .msg--error details.tech code { color: var(--error); }
.msg--info { background: var(--brand-tint); border-color: var(--brand-tint); color: var(--ink); }
.msg--info .icon { color: var(--brand); }
.msg--neutral { background: var(--bg); color: var(--text); }
.msg--neutral .icon { color: var(--text-muted); }
.msg .btn-row { margin-top: var(--s-2); }

/* ---------- Etiquetas ---------- */
.tag { display: inline-flex; align-items: center; gap: var(--s-1); padding: 2px var(--s-2); font-size: var(--fs-sm); font-weight: 600; line-height: 1.5; white-space: nowrap; }
.tag--brand { background: var(--bg); color: var(--brand); border: 1px solid var(--brand); }
.tag--attention { background: var(--warning-bg); color: var(--warning-text); }
.tag--neutral { background: var(--disabled-bg); color: var(--text-muted); }
.marker { width: 8px; height: 8px; background: var(--warning-text); display: inline-block; flex: none; }

/* ---------- Acceso ---------- */
.auth { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: var(--s-6) var(--gutter) var(--s-7); }
.auth__box { width: 100%; max-width: 440px; }
.auth__logo { display: flex; justify-content: center; margin-bottom: var(--s-5); }
.auth__logo img { width: 200px; }
.auth__card { background: var(--bg); border: 1px solid var(--border); padding: var(--s-5); }
.auth__card h1 { margin-bottom: var(--s-2); }
.auth__card > p { color: var(--text-muted); margin-bottom: var(--s-4); }
.auth__card .msg { margin-bottom: var(--s-4); }
.auth__card .flash { margin-bottom: 0; }
.panel > .flash { margin-bottom: calc(var(--s-2) + var(--s-1)); }
.auth__card .btn { margin-top: var(--s-4); }
.auth__foot { margin-top: var(--s-4); text-align: center; font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 599px) { .auth { padding-top: var(--s-5); } .auth__card { padding: var(--s-4) var(--s-3); } .auth__logo img { width: 160px; } }

/* Requisitos de contraseña */
.reqs { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: var(--s-1); font-size: var(--fs-sm); color: var(--text-muted); }
.reqs li { display: flex; align-items: center; gap: var(--s-2); }
.reqs li .icon { width: 16px; height: 16px; }
.reqs li.is-ok { color: var(--text); }
.reqs li.is-ok .icon { color: var(--brand); }
.form-actions { margin-top: var(--s-5); }

/* ---------- Subir ---------- */
.upload-layout { display: grid; gap: var(--s-5); }
@media (min-width: 960px) { .upload-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; } }
.dropzone {
  display: grid; justify-items: center; gap: var(--s-3); text-align: center; padding: var(--s-6) var(--s-4);
  background: var(--bg); border: 1px dashed var(--text-muted); cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { background: var(--brand-tint); border-color: var(--brand); }
.dropzone__icon { width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-tint); color: var(--brand); }
.dropzone__title { font-weight: 600; color: var(--ink); font-size: var(--fs-lg); line-height: 1.3; }
.dropzone__or { color: var(--text-muted); font-size: var(--fs-sm); }
@media (max-width: 599px) { .dropzone { padding: var(--s-5) var(--s-3); } .dropzone__drag { display: none; } }
.upload-nojs { margin-top: var(--s-3); display: grid; gap: var(--s-3); justify-items: start; }
html:not(.js) .dropzone input[type="file"] { position: static !important; width: auto; height: auto; clip: auto; white-space: normal; }
.upload-error { margin-top: var(--s-3); }
.facts { display: grid; gap: var(--s-3); margin: var(--s-4) 0 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts li { display: flex; gap: var(--s-3); align-items: flex-start; }
.facts li .icon { color: var(--text-muted); margin-top: 2px; }
.facts strong { display: block; color: var(--ink); }
.facts span { font-size: var(--fs-sm); color: var(--text-muted); }
.howto-steps { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-4); counter-reset: hs; }
.howto-steps li { display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); counter-increment: hs; }
.howto-steps li::before {
  content: counter(hs); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--brand); color: var(--brand); font-weight: 600; background: var(--bg);
}
.howto-steps strong { display: block; color: var(--ink); }
.howto-steps span { color: var(--text-muted); font-size: var(--fs-sm); }

/* Últimos archivos */
.table-wrap { background: var(--bg); border: 1px solid var(--border); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th { text-align: left; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); background: var(--bg-subtle); padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: var(--s-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.batches .batch-name { word-break: break-word; }
.status { display: inline-flex; align-items: center; gap: var(--s-2); }
.status .icon { width: 16px; height: 16px; }
.status--done .icon { color: var(--brand); }
.status--open .icon, .status--failed .icon { color: var(--text-muted); }
@media (max-width: 767px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: var(--s-3); border-bottom: 1px solid var(--border); }
  .table--stack tr:last-child { border-bottom: 0; }
  .table--stack td { border: 0; padding: 0; }
  .table--stack td + td { margin-top: var(--s-1); }
  .batches td.batch-action { margin-top: var(--s-2); }
  .batches td.batch-action .btn { width: 100%; }
}

/* Validando / generando */
.busy { display: grid; gap: var(--s-4); }
.busy__file { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); background: var(--bg-subtle); border: 1px solid var(--border); }
.busy__file .icon { color: var(--text-muted); }
.busy__file p { word-break: break-word; }
.busy__head { display: flex; align-items: center; gap: var(--s-3); }
.spinner { width: 32px; height: 32px; flex: none; border: 3px solid var(--brand-tint); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.9s linear infinite; }
.spinner--sm { width: 16px; height: 16px; border-width: 2px; }
.progress { height: 4px; background: var(--brand-tint); overflow: hidden; position: relative; }
.progress::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; background: var(--brand); animation: slide 1.6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slide { from { left: -30%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .spinner, .progress::after { animation: none; } .progress::after { left: 0; width: 100%; opacity: .4; } }
.doing { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.doing li { display: flex; gap: var(--s-3); align-items: flex-start; }
.doing li .icon { color: var(--text-muted); margin-top: 2px; }
.busy-note:empty { display: none; }
.busy-note { font-size: var(--fs-sm); color: var(--text-muted); }

/* ---------- Revisar ---------- */
.file-line { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); color: var(--text-muted); font-size: var(--fs-sm); }
.file-line span + span::before { content: "·"; margin-right: var(--s-3); }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--bg); border: 1px solid var(--border); margin: 0; padding: 0; list-style: none; }
.summary li { border-right: 1px solid var(--border); }
.summary li:last-child { border-right: 0; }
.summary a { display: grid; gap: var(--s-1); padding: var(--s-3) var(--s-4); color: var(--text); text-decoration: none; min-height: 100%; }
.summary a:hover { background: var(--bg-subtle); }
.summary__num { font-family: var(--font-title); font-size: var(--fs-lg); color: var(--ink); line-height: 1.2; }
.summary__label { font-size: var(--fs-sm); color: var(--text-muted); display: flex; align-items: center; gap: var(--s-2); }
.summary .marker { display: none; }
.summary .is-attention a { background: var(--warning-bg); }
.summary .is-attention .summary__label { color: var(--warning-text); font-weight: 600; }
.summary .is-attention .marker { display: inline-block; }
@media (max-width: 767px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .summary li:nth-child(2) { border-right: 0; }
  .summary li:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .summary a { padding: var(--s-3); }
}
.section-tight { margin-top: var(--s-3); }
.section-note { margin-top: var(--s-2); }
.messages { display: grid; gap: var(--s-3); margin-top: var(--s-3); }

/* Tarjeta de decisión */
.decisions { display: grid; gap: var(--s-4); }
.decision { background: var(--bg); border: 1px solid var(--border); scroll-margin-top: var(--s-3); }
.decision__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.decision__body { display: grid; gap: var(--s-4); padding: var(--s-4); grid-template-columns: minmax(0, 1fr); }
.decision__body > * { min-width: 0; }
@media (min-width: 960px) { .decision__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-5); } }
@media (max-width: 599px) { .decision__head, .decision__body { padding-left: var(--s-3); padding-right: var(--s-3); } }
.decision__title { margin-bottom: var(--s-2); }
.decision__why { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: var(--s-3); }
.decision__note { margin-bottom: var(--s-3); }
.compare { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.compare + .compare { margin-top: var(--s-3); }
.compare th, .compare td { text-align: left; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--border); vertical-align: top; }
.compare thead th { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; background: var(--bg-subtle); }
.compare tbody th { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; width: 26%; }
.compare .diff-row td { font-weight: 600; color: var(--ink); }
.cmp { display: block; font-size: var(--fs-sm); font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.diff-row .cmp { color: var(--ink); font-weight: 600; }
.cmp .icon { width: 14px; height: 14px; vertical-align: -2px; }
@media (max-width: 599px) {
  .compare th, .compare td { padding: var(--s-2); }
  .compare thead tr, .compare tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .compare thead th:first-child { display: none; }
  .compare tbody th { grid-column: 1 / -1; width: auto; padding-bottom: 0; border-bottom: 0; }
}

.options { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-2); min-width: 0; }
.options legend { font-weight: 600; color: var(--ink); margin-bottom: var(--s-2); padding: 0; }
.option { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: var(--s-1) var(--s-3); padding: var(--s-3); background: var(--bg); border: 1px solid var(--border); cursor: pointer; }
.option:hover { border-color: var(--text-muted); }
.option input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); cursor: pointer; }
.option:has(input:checked) { background: var(--brand-tint); border-color: var(--brand); outline: 1px solid var(--brand); outline-offset: -2px; }
.option__title { font-weight: 600; color: var(--ink); display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.option__text { grid-column: 2; font-size: var(--fs-sm); color: var(--text); }
.option__extra { grid-column: 2; margin-top: var(--s-2); display: grid; gap: var(--s-2); justify-items: start; }
.option__extra .btn { white-space: normal; text-align: left; padding-top: var(--s-2); padding-bottom: var(--s-2); }
.outcome { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3); background: var(--bg-subtle); margin-top: var(--s-3); font-size: var(--fs-sm); }
.outcome .icon { color: var(--brand); margin-top: 1px; }
.outcome strong { color: var(--ink); }
.create-fields { display: grid; gap: var(--s-3); margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--border); }
@media (min-width: 600px) { .create-fields { grid-template-columns: 1fr 1fr; } }
.create-fields .field + .field { margin-top: 0; }

/* Lista de productos */
.list-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-2) var(--s-3); padding: 0 var(--s-3); background: var(--bg); border: 1px solid var(--border); border-bottom: 0; }
.list-tools .check { padding: 10px 0; }
.products { width: 100%; border-collapse: collapse; background: var(--bg); border: 1px solid var(--border); }
.products th { text-align: left; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); background: var(--bg-subtle); padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.products td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.products tr { scroll-margin-top: var(--s-3); }
.products .col-inc { width: 56px; text-align: center; padding-right: 0; }
.products .col-inc label { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; }
.products .col-inc input { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; margin: 0; }
.products .col-name { width: 32%; min-width: 220px; }
.products .col-price { text-align: right; white-space: nowrap; }
.products .col-link { width: 1%; white-space: nowrap; }
.products .name-input { min-height: 44px; font-weight: 600; color: var(--ink); }
/* Nombre en textarea que crece (assets/app.js): se ve entero, sin cortar (QA 2.3.0, H-1) */
textarea.input { display: block; padding: 10px var(--s-3); line-height: 1.4; resize: none; overflow-wrap: anywhere; overflow: hidden; }
textarea.input.is-scroll { overflow-y: auto; }
.products tr.is-off td { background: var(--bg-subtle); }
.products tr.is-off .name-input { color: var(--text-muted); background: var(--bg-subtle); }
.price-old { color: var(--text-muted); text-decoration: line-through; margin-right: var(--s-1); }
.img-yes { display: inline-flex; align-items: center; gap: var(--s-2); }
.img-yes .icon { color: var(--brand); width: 16px; height: 16px; }
.link-out { display: inline-flex; align-items: center; gap: var(--s-1); min-height: 44px; font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.link-out:hover { text-decoration: underline; }
.link-out .icon { width: 16px; height: 16px; }
.m-label { display: none; }
.row-notes { display: grid; gap: var(--s-1); margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--text-muted); white-space: normal; }
.row-notes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-1); }
.row-notes .note-warn { color: var(--warning-text); }
.row-notes .tag { justify-self: start; }
.products .col-cat { min-width: 380px; }
.products .col-cat .select { min-width: 364px; padding-left: var(--s-2); padding-right: 32px; background-position: right 10px center; }
.products .col-cat .hint { display: block; margin-top: var(--s-1); }
@media (max-width: 1099px) {
  .products thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .products, .products tbody { display: block; }
  .products tr {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: var(--s-2); row-gap: var(--s-1);
    grid-template-areas: "inc name name" "inc ref price" "inc img link" "cat cat cat";
    padding: var(--s-2) var(--s-3) 0 var(--s-1); border-bottom: 1px solid var(--border);
  }
  .products tr.is-off { background: var(--bg-subtle); }
  .products td { display: block; border: 0; padding: 0; width: auto !important; background: transparent !important; font-size: var(--fs-sm); }
  .products .col-inc { grid-area: inc; padding: 0; }
  .products .col-name { grid-area: name; }
  .products .col-ref { grid-area: ref; align-self: center; }
  .products .col-price { grid-area: price; align-self: center; text-align: right; }
  .products .col-img { grid-area: img; align-self: center; padding-bottom: var(--s-2); }
  .products .col-link { grid-area: link; text-align: right; }
  .products .col-cat { grid-area: cat; padding: 0 0 var(--s-3) var(--s-1); }
  .products .col-price .small, .products .col-price .m-label { display: none; }
  .m-label { display: inline; color: var(--text-muted); }
  .products .col-cat { min-width: 0; }
  .products .col-cat .select { min-width: 0; max-width: 560px; padding-left: var(--s-3); padding-right: 40px; background-position: right 16px center; }
}
/* Móvil: la categoría ocupa todo el ancho de la tarjeta (también bajo la casilla) y se lee entera a 14 px (QA 2.3.0, H-1) */
@media (max-width: 599px) { .products .col-cat .select { font-size: var(--fs-sm); padding-left: var(--s-2); padding-right: 32px; background-position: right 10px center; } }

.empty { padding: var(--s-4); background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); display: flex; gap: var(--s-3); align-items: flex-start; }
.empty .icon { color: var(--text-muted); margin-top: 2px; }
.plain-list { margin: 0; padding: 0; list-style: none; background: var(--bg); border: 1px solid var(--border); }
.plain-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-3); border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list .what { display: grid; gap: 2px; min-width: 0; }
.plain-list .what span { font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 599px) { .plain-list li .btn { width: 100%; } }

details.more { background: var(--bg); border: 1px solid var(--border); }
details.more > summary { min-height: 48px; display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-3); cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; }
/* 2.5.0: «>» para que el «+»/«−» no se herede al «Detalles técnicos» de dentro (salía un «–» suelto). */
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; width: 20px; color: var(--brand); font-weight: 600; }
details.more[open] > summary::before { content: "−"; }
details.more { min-width: 0; max-width: 100%; }
details.more ul { margin: 0; padding: 0 var(--s-3) var(--s-3) 44px; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); font-size: var(--fs-sm); }
/* 2.4.1 (QA 2.4.0, H-1): textos largos sin espacios (claves de Amazon, códigos) parten la línea a 375 px. */
details.more li { min-width: 0; overflow-wrap: anywhere; }
.issue-where { color: var(--text-muted); }
.issue-msg { overflow-wrap: anywhere; }

/* «Detalles técnicos»: el código, la celda y el campo, plegados (QA navegador 15/10, H5) */
details.tech { display: inline-block; max-width: 100%; font-size: var(--fs-sm); }
details.tech summary { display: inline-flex; align-items: center; min-height: 44px; gap: var(--s-1); cursor: pointer; color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; list-style: none; }
details.tech summary::-webkit-details-marker { display: none; }
/* 2.5.0: indicador de plegado lineal (guía de marca, iconografía: trazo fino, 16 px), girado al abrir. */
details.tech summary::before { content: ""; flex: none; width: 16px; height: 16px; background: url("select-chevron.svg") center / 16px 16px no-repeat; transform: rotate(-90deg); transition: transform .15s ease; }
details.tech[open] summary::before { transform: none; }
@media (prefers-reduced-motion: reduce) { details.tech summary::before { transition: none; } }
details.tech code { display: block; color: var(--text-muted); word-break: break-all; }
details.tech .tech__detail { display: block; margin-top: var(--s-1); color: var(--text-muted); overflow-wrap: anywhere; }

/* Barra de acción inferior */
.action-bar { position: sticky; bottom: 0; z-index: 10; background: var(--bg); border-top: 1px solid var(--border); }
.action-bar__inner { max-width: var(--container); margin: 0 auto; padding: var(--s-3) var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.action-bar__msg { min-width: 0; flex: 1; }
.action-bar__text { display: grid; gap: 2px; font-size: var(--fs-sm); color: var(--text-muted); }
.action-bar__block { display: flex; gap: var(--s-2); align-items: flex-start; color: var(--error); font-weight: 600; }
.action-bar__block .icon { flex: none; margin-top: 2px; }
.action-bar__block a { color: var(--error); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.action-bar__text strong { font-size: var(--fs-base); color: var(--ink); }
@media (max-width: 767px) {
  .action-bar__inner { flex-direction: column; align-items: stretch; gap: var(--s-2); padding-top: var(--s-2); padding-bottom: var(--s-2); }
  .action-bar__text { grid-template-columns: 1fr; }
  .action-bar__text > span { display: none; }
  .action-bar .btn { width: 100%; }
}
.confirm-box { background: var(--bg); border: 1px solid var(--border); padding: var(--s-2) var(--s-3); }
.confirm-box + .confirm-box { margin-top: var(--s-2); }

/* ---------- Resultado ---------- */
.downloads { display: grid; gap: var(--s-3); }
@media (min-width: 900px) { .downloads { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dl { display: flex; flex-direction: column; gap: var(--s-3); background: var(--bg); border: 1px solid var(--border); padding: var(--s-4); }
.dl__icon { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-tint); color: var(--brand); }
.dl--report .dl__icon { background: var(--disabled-bg); color: var(--text-muted); }
.dl__title { font-weight: 600; color: var(--ink); font-size: var(--fs-lg); line-height: 1.3; font-family: var(--font-body); }
.dl__text { color: var(--text); }
.dl__file { font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl .btn { margin-top: auto; width: 100%; }
@media (max-width: 599px) { .dl { padding: var(--s-3); } }
/* 2.4.2: varios ficheros que importar, en orden (ACTUALIZAR-1, -2… y después CREAR). */
.import-order { margin-bottom: var(--s-3); border-left: 4px solid var(--brand); }
.import-order .import-order__list { padding-left: 24px; list-style: decimal; }
.import-order__list li { overflow-wrap: anywhere; }
.import-steps { list-style: none; margin: 0; padding: 0; background: var(--bg); border: 1px solid var(--border); counter-reset: is; }
.import-steps > li { display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); padding: var(--s-4); border-bottom: 1px solid var(--border); counter-increment: is; }
.import-steps > li:last-child { border-bottom: 0; }
.import-steps > li::before { content: counter(is); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand); color: var(--bg); font-weight: 600; }
.import-steps h3 { margin-bottom: var(--s-1); }
.import-steps p + p { margin-top: var(--s-2); }
.ui { font-weight: 600; color: var(--ink); }
.path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); font-weight: 600; color: var(--ink); }
.path .icon { width: 14px; height: 14px; color: var(--text-muted); }
@media (max-width: 599px) { .import-steps > li { padding: var(--s-3); gap: var(--s-2); } }

/* ---------- Mapeo ---------- */
.map-grid { display: grid; gap: 0; background: var(--bg); border: 1px solid var(--border); }
.map-row { display: grid; gap: var(--s-2) var(--s-4); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); align-items: center; }
.map-row:last-child { border-bottom: 0; }
@media (min-width: 900px) { .map-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); } }
.map-row--head { background: var(--bg-subtle); font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); padding-top: var(--s-2); padding-bottom: var(--s-2); }
@media (max-width: 899px) { .map-row--head { display: none; } .map-row { padding: var(--s-3); } }
.map-field strong { display: block; color: var(--ink); }
.map-field span { font-size: var(--fs-sm); color: var(--text-muted); }
.map-sample { font-size: var(--fs-sm); color: var(--text-muted); word-break: break-word; }
.map-sample b { color: var(--ink); font-weight: 600; font-family: var(--font-mono); }
.req { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.sample-table td, .sample-table th { white-space: nowrap; }
/* Campo obligatorio vacío: texto neutro; el rojo solo si se intenta seguir sin él */
.map-need { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-sm); color: var(--text); }
.map-need .icon { color: var(--brand); margin-top: 2px; }
.map-need.is-error { color: var(--error); font-weight: 600; }
.map-need.is-error .icon { color: var(--error); }

/* ---------- Foco y deshabilitado (guía §4 y §6.8) ---------- */
.btn:focus-visible, .account__button:focus-visible, .link-out:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.password-toggle:focus-visible { outline-offset: -2px; }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; }
.check:has(input:focus-visible), .option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.check input:focus-visible, .option input:focus-visible, .products .col-inc input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.input:disabled, .select:disabled { background: var(--disabled-bg); color: var(--text-muted); border-color: var(--border); cursor: not-allowed; opacity: .6; }
.check:has(input:disabled), .option:has(input:disabled) { cursor: not-allowed; color: var(--text-muted); }
.check:has(input:disabled) input, .option:has(input:disabled) input { cursor: not-allowed; opacity: .6; }
.option:has(input:disabled) { background: var(--disabled-bg); }
.btn--secondary[disabled], .btn--ghost[disabled], .btn--ghost[aria-disabled="true"] { background: var(--disabled-bg); border-color: var(--border); color: var(--text-muted); opacity: .6; cursor: not-allowed; }
.btn[disabled]:hover, .btn[aria-disabled="true"]:hover { background: var(--disabled-bg); border-color: var(--border); color: var(--text-muted); }
