/* ============================================================================
   SISTEMA DE DISEÑO — «OSSAC × KONE» (heredado del formulario CPQ)
   Una sola familia (Inter): 400 para titulares, 600 para etiquetas y botones.
   Neutros de la escala gris de kone.com; el azul es el de OSSAC.
   Tokens espejo de tailwind.config.js → theme.colors.ossac del CPQ.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('./assets/fonts/Inter-Latin.woff2') format('woff2');
}

:root {
  --primary: #0071B9;
  --primary-dark: #004987;
  --ink: #141414;
  --ink-soft: #575759;
  --muted: #6E6F73;
  --glass: #E8F2FA;
  --glass-deep: #C9E1F3;
  --line: #E8E9EB;
  --line-strong: #898B8F;
  --sand: #F3EEE6;
  --sand-soft: #F8F6F2;
  --paper: #FFFFFF;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --ok: #10b981;
  --ok-bg: #E6F2E8;
  --wa: #1DA851;
  --radio: 18px;
  --sombra: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px -12px rgba(20, 20, 20, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* `hidden` SIEMPRE gana — sin esto, cualquier display de clase lo pisa
   (el dock final salía en todos los pasos) */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--sand);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==================== CABECERA ==================== */
#cabecera {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.cab-logo { display: flex; align-items: center; }
.cab-logo img { display: block; height: 28px; width: auto; }
.cab-sep { width: 1px; height: 22px; background: var(--line); }
.cab-titulo { font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.02em; }
.cab-wa {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wa);
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.cab-wa:hover { background: var(--wa); color: #fff; }

/* ==================== LAYOUT ==================== */
.app {
  display: grid;
  grid-template-columns: minmax(0, 54fr) minmax(0, 46fr);
  /* fallback vh primero: los navegadores sin dvh (iOS ≤15.3, Android viejos)
     se quedan con la línea de arriba en vez de romperse */
  min-height: calc(100vh - 53px);
  min-height: calc(100dvh - 53px);
}

#visor {
  position: sticky;
  top: 0;
  height: calc(100vh - 53px);
  height: calc(100dvh - 53px);
  overflow: hidden;
}
#escena3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
/* viñeta sutil: cierra la composición como fotografía de producto */
#visor::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(115% 92% at 50% 42%, transparent 62%, rgba(30, 26, 19, 0.13) 100%);
}

.visor-ui { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; }
#chips {
  margin: 14px auto 0;
  max-width: min(92%, 640px);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  box-shadow: var(--sombra);
}
.visor-pills { position: absolute; bottom: 16px; left: 16px; display: flex; gap: 8px; }
.visor-pills button {
  pointer-events: auto;
  font: 600 12.5px/1 Inter, sans-serif;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 15px;
  cursor: pointer;
}
.visor-pills button[aria-pressed="true"] { color: var(--primary); border-color: var(--primary); background: var(--glass); }
#hint-visor {
  position: absolute;
  bottom: 58px;   /* sobre la fila de pills — a 1440–1600 se solapaban (QA 03-ago) */
  right: 16px;
  font-size: 11.5px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 6px 12px;
}
.sin3d-msg { display: none; }
#visor.sin3d canvas, #visor.sin3d .visor-pills, #visor.sin3d #hint-visor { display: none; }
#visor.sin3d .sin3d-msg {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
}
#visor.sin3d { background: linear-gradient(#f8f5ee, #d9d1bf); }
#visor.sin3d { height: auto; min-height: 180px; position: static; }

/* Contexto WebGL perdido en caliente. A diferencia de .sin3d NO se toca la
   altura: el visor ya ocupaba su sitio y encoger la página bajo los dedos del
   cliente a mitad de configuración se lee como un fallo mayor del que es. */
.caido-msg { display: none; }
#visor.visor-caido canvas, #visor.visor-caido .visor-pills, #visor.visor-caido #hint-visor { display: none; }
#visor.visor-caido .caido-msg {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  height: 100%;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
}
#visor.visor-caido { background: linear-gradient(#f8f5ee, #d9d1bf); }

/* ==================== PANEL ==================== */
.panel { background: var(--sand); min-width: 0; }
.panel-inner { max-width: 660px; margin: 0 auto; padding: clamp(22px, 4vw, 44px) clamp(16px, 3vw, 36px) 32px; }

h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 400; letter-spacing: -0.01em; }
.lede { color: var(--ink-soft); margin-top: 8px; max-width: 46ch; }
.sellos { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 4px; }
.sellos li {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--glass);
  border: 1px solid var(--glass-deep);
  border-radius: 999px;
  padding: 5px 12px;
}

/* — aviso de proyecto restaurado: mismo ámbar que #aviso-esp porque es un
   aviso, no un error. `hidden` gana igual gracias a la regla global de arriba. */
#aviso-restaurado {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 20px;
  font-size: 12.5px;
  color: #92610e;
}

/* — pestañas multipuerta */
#tabs-puertas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
#tabs-puertas:has(> :nth-child(2):last-child) { display: none; }  /* solo "P1 + Otra" → oculto hasta que importe */
#tabs-puertas button {
  font: 600 12.5px/1 Inter, sans-serif;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
#tabs-puertas button[aria-current="true"] { color: #fff; background: var(--primary); border-color: var(--primary); }
#tabs-puertas #tab-add { border-style: dashed; }
#tabs-puertas button:disabled { opacity: 0.45; cursor: not-allowed; }

/* — stepper con riel de progreso (patrón KONE del formulario) */
#stepper {
  display: flex;
  gap: 10px;
  margin: 18px 0 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
#stepper::-webkit-scrollbar { display: none; }
#stepper button {
  flex: 1 0 auto;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-start;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 6px 2px;
}
#stepper button .n { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
#stepper button .t { font-size: 13px; font-weight: 500; }
#stepper button::after { content: ''; width: 100%; height: 3px; border-radius: 2px; background: var(--line); transition: background 0.2s; }
#stepper button.hecho { color: var(--ink); }
#stepper button.hecho::after { background: var(--ink-soft); }
#stepper button[aria-current="step"] { color: var(--primary); }
#stepper button[aria-current="step"]::after { background: var(--primary); }
#stepper button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ==================== PASOS ==================== */
.paso { padding: 22px 0 26px; scroll-margin-top: 14px; scroll-margin-bottom: 96px; }
/* entrada suave del paso (el hidden→visible re-monta la animación) */
.paso:not([hidden]) { animation: paso-entra 0.28s ease both; }
@keyframes paso-entra { from { opacity: 0; transform: translateY(10px); } }
.paso-head { margin-bottom: 20px; }
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.paso-head h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 400; letter-spacing: -0.01em; margin-top: 8px; }
/* el riel se abre desde el centro como la puerta MISMA: dos hojas que parten
   del eje y dejan la luz del paso en la mitad (la firma de la página) */
.rail { width: 64px; height: 2px; background: var(--line); margin-top: 14px; position: relative; }
.rail::before, .rail::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--primary);
  transform: scaleX(0);
  animation: rail-abre 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}
.rail::before { left: 0; right: calc(50% + 3px); transform-origin: right; }
.rail::after { right: 0; left: calc(50% + 3px); transform-origin: left; }
@keyframes rail-abre { to { transform: scaleX(1); } }
.ayuda { color: var(--ink-soft); font-size: 14.5px; margin-top: 10px; }
.sub-pregunta { font-size: 20px; font-weight: 400; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.sub-pregunta + .ayuda { margin-top: 6px; margin-bottom: 14px; }

/* — tarjetas de opción */
.cards { display: grid; gap: 14px; margin-top: 16px; }
.cards-2 { grid-template-columns: 1fr 1fr; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }

/* sello de campo opcional (R13g): informa sin presionar — buena práctica de
   formularios: se marca lo OPCIONAL, no lo obligatorio */
.tag-opcional {
  display: inline-block; margin-left: 8px; padding: 2px 9px;
  font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
  color: var(--muted); background: var(--sand-soft);
  border: 1px solid var(--line); border-radius: 999px;
  vertical-align: 2px;
}
.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radio);
  padding: 18px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.card:hover { border-color: var(--glass-deep); box-shadow: var(--sombra); }
.card[aria-pressed="true"] { border-color: var(--primary); background: var(--glass); }
.card .check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  transition: background 0.15s, border-color 0.15s;
}
.card[aria-pressed="true"] .check { background: var(--primary); border-color: var(--primary); }
.card[aria-pressed="true"] .check::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 4.5px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}
.card-ilu { flex: 0 0 200px; background: var(--sand-soft); border-radius: 12px; padding: 8px; }
.card-ilu svg { display: block; width: 100%; height: auto; }
.ilu-chica { flex-basis: 150px; }
.card-txt { flex: 1; min-width: 0; padding-right: 26px; }
.card-txt strong { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; }
.card-txt small { display: block; color: var(--ink-soft); font-size: 13.5px; margin-top: 4px; }
.card-txt em { display: block; color: var(--muted); font-size: 11.5px; font-style: normal; margin-top: 7px; }
.card-centro { flex-direction: column; text-align: center; }
.card-centro .card-ilu { flex-basis: auto; width: 100%; }
.card-centro .card-txt { padding: 0 8px; }
.card-mini { align-items: center; }
.card-mini .card-txt strong { font-size: 15.5px; }
.card-ancha { grid-column: 1 / -1; }
.acc-ico {
  flex: 0 0 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--sand-soft);
  border-radius: 12px;
  color: var(--primary);
}
.acc-ico svg { width: 28px; height: 28px; }
.inst-ilu { display: block; width: min(240px, 100%); margin: 0 auto; background: var(--sand-soft); border-radius: 12px; padding: 10px 14px; }
.inst-ilu svg { display: block; width: 100%; height: auto; }
.medida-anidada { margin-top: 14px; background: var(--sand-soft); }
.btn-mini { padding: 9px 14px; font-size: 12.5px; margin-top: 10px; display: inline-block; }

.err-paso {
  margin-top: 14px;
  background: var(--error-bg);
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 14px;
  padding: 12px 16px;
}
.nota-suave {
  margin-top: 14px;
  background: var(--sand-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* R28: los avisos de vitrina llegan unidos por \n — uno por línea */
#hint-vitrina {
  white-space: pre-line;
}

/* — segmentados (acabado, sabe-medidas, mano) */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.seg button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 15px 16px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.seg button:hover { border-color: var(--primary); }
.seg button[aria-pressed="true"] { border-color: var(--primary); background: var(--glass); box-shadow: inset 0 0 0 1px var(--primary); }
.seg button strong { font-size: 14.5px; font-weight: 600; display: block; }
.seg button small { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 400; }
.seg button svg { width: 44px; flex: 0 0 auto; color: var(--ink-soft); }
.seg button[aria-pressed="true"] svg { color: var(--primary); }
.sw { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 1px solid rgba(20, 20, 20, 0.18); flex: 0 0 auto; }
.seg-acabados { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.seg-acabados button { justify-content: flex-start; text-align: left; }
.seg-acabados button > span:last-child { flex: 1; }
/* el swatch elegido gana su anillo — el color ES la decisión de este paso */
.seg button[aria-pressed="true"] .sw { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--primary); }

/* — medidas */
.tarjeta { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radio); padding: 18px; margin-top: 16px; }
.etiqueta { font-size: 15px; font-weight: 600; }
.etiqueta small, .campo label small { color: var(--muted); font-weight: 400; }
.sabe-head { display: flex; align-items: center; gap: 10px; }
.tooltip-hueco { position: relative; }
.tooltip-hueco summary {
  list-style: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 50%;
  font-weight: 600;
  font-size: 14px;
}
.tooltip-hueco summary::-webkit-details-marker { display: none; }
.tooltip-hueco[open] summary { background: var(--primary); color: #fff; }
.tooltip-hueco p {
  margin-top: 10px;
  position: absolute;
  right: 0;
  z-index: 5;
  width: min(300px, 74vw);
  background: var(--sand-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  box-shadow: var(--sombra);
}
.seg-2 { margin-top: 14px; }

.medida { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px 18px; margin-top: 14px; }
.medida-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.medida-head label { font-size: 15px; font-weight: 600; }
.medida-head label small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.rango { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.medida-controles { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.medida-controles input[type="range"] { flex: 1; accent-color: var(--primary); min-width: 0; }
.medida-controles .num { display: flex; align-items: baseline; gap: 6px; font-weight: 600; white-space: nowrap; }
.medida-controles .num input {
  width: 76px;
  font: 600 16px/1.2 Inter, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 10px;
  text-align: right;
  background: var(--paper);
}
.medida-controles .num input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.equiv { font-size: 11.5px; color: var(--muted); font-style: normal; font-weight: 400; }
.sug-unidad { margin-top: 10px; font-size: 13px; color: #92610e; }
.sug-unidad button {
  font: 600 12.5px/1 Inter, sans-serif;
  color: #14532d;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 7px 12px;
  margin-left: 6px;
  cursor: pointer;
  min-height: 32px;
}
.medidas-error {
  margin-top: 14px;
  background: #fefce8;
  border: 1px solid #fde68a;
  color: #854d0e;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13.5px;
}
.medidas-error .sugerencia { color: #713f12; margin-top: 6px; }

.cant-fila { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.cant { display: inline-flex; align-items: center; gap: 16px; }
.cant button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s, color 0.15s;
}
.cant button:hover { border-color: var(--primary); color: var(--primary); }
.cant button:disabled { opacity: 0.4; cursor: not-allowed; }
#cant-mas { background: var(--primary); border-color: var(--primary); color: #fff; }
#cant-num { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--primary); min-width: 34px; text-align: center; }
.cant-nota { flex-basis: 100%; color: var(--muted); font-size: 12px; }

/* ==================== RESUMEN ==================== */
.puerta-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px 18px; margin-top: 14px; }
.puerta-card.activa { border-color: var(--glass-deep); box-shadow: var(--sombra); }
.puerta-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.puerta-card header strong { font-size: 15.5px; }
.pc-cant { display: inline-flex; align-items: center; gap: 9px; }
.pc-cant button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.pc-cant button:disabled { opacity: 0.4; cursor: not-allowed; }
.pc-cant b { font-variant-numeric: tabular-nums; }
.pc-desc { margin-top: 8px; font-size: 14px; font-weight: 500; }
.pc-esp { color: #92610e; }
.pc-sub { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; line-height: 1.55; }
.pc-acciones { display: flex; gap: 8px; margin-top: 12px; }
.pc-acciones button {
  font: 600 12px/1 Inter, sans-serif;
  color: var(--ink-soft);
  background: var(--sand-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
}
.pc-acciones button:hover { color: var(--primary); border-color: var(--glass-deep); }
.pc-acciones button:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-add { margin-top: 14px; }

/* — datos de contacto */
.datos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo-full { grid-column: 1 / -1; }
.campo label { font-size: 13.5px; font-weight: 600; }
.req { color: var(--error); font-weight: 600; }
.campo input, .campo textarea {
  font: 400 15px/1.4 Inter, sans-serif;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
}
.campo input:focus, .campo textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.campo input[aria-invalid="true"] { border-color: var(--error); background: var(--error-bg); }
.campo textarea { resize: vertical; }
.err-campo { color: var(--error); font-size: 12.5px; font-style: normal; }
.hp { position: absolute; left: -9999px; top: -9999px; }

/* — archivos */
.bloque-archivos { margin-top: 22px; }
.bloque-archivos .ayuda { margin: 6px 0 12px; font-size: 13px; }
#zona-archivos {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radio);
  padding: 26px 16px;
  text-align: center;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
#zona-archivos:hover, #zona-archivos.arrastrando { border-color: var(--primary); background: var(--glass); }
#zona-archivos b { color: var(--primary); text-decoration: underline; }
#zona-archivos svg { color: var(--muted); margin-bottom: 6px; }
.hint-arch { font-size: 11.5px; color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.archivo {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F2F6FA;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  margin-top: 8px;
}
.archivo img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; }
.arch-pdf {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--error);
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
}
.arch-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.arch-info b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch-info small { color: var(--muted); font-size: 11.5px; }
.archivo button {
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  font-size: 14px;
}
.archivo button:hover { color: var(--error); background: #fef2f2; }

.privacidad {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radio);
  padding: 14px 16px;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 13px;
}
.privacidad svg { flex: 0 0 auto; color: var(--muted); margin-top: 2px; }

.estado { margin-top: 16px; border-radius: 14px; padding: 13px 16px; font-size: 14px; background: var(--sand-soft); border: 1px solid var(--line); }
.estado.ok { background: var(--ok-bg); border-color: #a7dcb6; color: #14532d; }
.estado.error { background: var(--error-bg); border-color: #fecaca; color: #b91c1c; }

/* ==================== PIE + DOCK ==================== */
.pie { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.pie-reset { margin-top: 6px; }
/* botón con aire de enlace: lo usan el aviso y el pie. Hereda tamaño y color de
   su contenedor, así el reinicio está disponible sin gritar. */
.btn-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.btn-link:hover { color: var(--primary); }

#dock {
  position: sticky;
  bottom: 0;
  background: rgba(243, 238, 230, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 10px clamp(16px, 3vw, 36px) max(10px, env(safe-area-inset-bottom));
}
#aviso-esp { font-size: 12px; color: #92610e; text-align: center; margin-bottom: 8px; }
.dock-nav { display: flex; align-items: center; gap: 12px; max-width: 660px; margin: 0 auto; }
#dock-paso { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.btn-cta {
  font: 600 15px/1 Inter, sans-serif;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-cta:hover { background: var(--primary-dark); }
.btn-cta:disabled { opacity: 0.6; cursor: wait; }
.btn-ghost {
  font: 600 14px/1 Inter, sans-serif;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 13px 22px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.dock-final { flex: 1; display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
#btn-wa {
  font: 600 14px/1 Inter, sans-serif;
  color: #fff;
  background: var(--wa);
  border-radius: 999px;
  padding: 13px 18px;
  text-decoration: none;
  white-space: nowrap;
}
#btn-wa:hover { filter: brightness(0.94); }

.noscript { padding: 30px; text-align: center; }

/* ==================== MODO PRESENTACIÓN (TV showroom) ==================== */
/* R25b: el texto vive en una barra inferior con scrim — nunca tapa el
   producto — y hay cursor + controles porque el enlace del QR lo abre un
   cliente, no un televisor. */
#tv-capa { display: none; }
.modo-tv #cabecera, .modo-tv .panel, .modo-tv #aviso-viejo,
.modo-tv #chips, .modo-tv .visor-pills, .modo-tv #hint-visor { display: none !important; }
.modo-tv .app { grid-template-columns: 1fr; }
.modo-tv #visor { position: fixed; inset: 0; height: 100vh; height: 100dvh; }
.modo-tv #visor canvas { cursor: grab; }
.modo-tv #visor canvas:active { cursor: grabbing; }
.modo-tv #tv-capa {
  display: block;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
.tv-logo { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 22px; height: 38px; filter: drop-shadow(0 1px 6px rgba(20,20,20,0.18)); }
.tv-pie {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 64px 18px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(16, 21, 27, 0.66) 0%, rgba(16, 21, 27, 0.38) 55%, rgba(16, 21, 27, 0) 100%);
  text-align: center;
}
.tv-textos { display: flex; flex-direction: column; gap: 3px; }
.tv-titulo {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}
#tv-caption {
  font-size: clamp(15px, 2vw, 21px);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 8px rgba(10, 14, 18, 0.35);
  transition: opacity 0.6s ease;
  max-width: min(92vw, 880px);
}
#tv-caption.cambiando { opacity: 0; }
#tv-controles {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.tv-boton {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font: 600 13.5px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.12s ease;
}
.tv-boton:hover { background: rgba(255, 255, 255, 0.26); }
.tv-boton:active { transform: scale(0.97); }
.tv-boton:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tv-boton[aria-pressed="true"] { background: rgba(255, 255, 255, 0.92); color: #16263a; border-color: transparent; }
.tv-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.28); }
.tv-wa { background: #1faf5a; border-color: #1faf5a; }
.tv-wa:hover { background: #24c265; }
.tv-cta { font-size: 12px; color: rgba(255, 255, 255, 0.62); letter-spacing: 0.04em; }
@media (max-width: 640px) {
  .tv-pie { gap: 10px; padding-top: 84px; }
  .tv-sep { display: none; }
  .tv-cta { display: none; }
}

/* ==================== PULIDO UX (03-ago noche) ====================
   Disciplina silenciosa: foco visible en TODO lo operable, feedback de
   presión, y detalles de forma — sin tocar la identidad OSSAC×KONE. */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.card:focus-visible, .seg button:focus-visible, #zona-archivos:focus-visible { outline-offset: 3px; }
#stepper button:focus-visible { outline-offset: 4px; }

.card { transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.1s; }
.card:active, .seg button:active, .cant button:active { transform: scale(0.992); }
.btn-cta:active, .btn-ghost:active, #btn-wa:active, .pc-acciones button:active { transform: translateY(1px); }

/* el check aparece con un pop breve — confirmación táctil de la elección */
.card[aria-pressed="true"] .check { animation: check-pop 0.24s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes check-pop { from { transform: scale(0.55); } }

h1, .paso-head h2 { text-wrap: balance; }
.paso-head h2 { line-height: 1.18; }

.campo input:hover, .campo textarea:hover, .medida-controles .num input:hover { border-color: var(--glass-deep); }
::placeholder { color: var(--muted); opacity: 1; }
.sug-unidad button { min-height: 36px; }
#btn-wa { padding: 14px 18px; }

/* — confort táctil universal: sin retardo de doble-tap en lo operable — */
button, a, summary, input, .card { touch-action: manipulation; }
/* iOS hace ZOOM automático a inputs con letra <16px — se evita de raíz */
.campo input, .campo textarea { font-size: 16px; }
input[type="range"] { height: 30px; }
.pc-cant button { width: 36px; height: 36px; }
.tooltip-hueco summary { width: 34px; height: 34px; }

/* aviso para navegadores sin import maps (el 3D no puede cargar ahí) */
#aviso-viejo {
  background: #fefce8;
  border-bottom: 1px solid #fde68a;
  color: #854d0e;
  padding: 14px clamp(16px, 3vw, 32px);
  font-size: 14px;
  line-height: 1.55;
}
#aviso-viejo a { color: #713f12; font-weight: 600; }

@media (max-width: 960px) {
  /* el stepper insinúa que sigue: desvanecido en los bordes al hacer scroll */
  #stepper {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  }
  .dock-final { flex-wrap: nowrap; }
  .dock-final #btn-solicitar { flex: 1; }
}

/* teléfonos angostos (≤360px): las ilustraciones ceden espacio al texto */
@media (max-width: 360px) {
  .card { gap: 10px; padding: 12px; }
  .card-ilu { flex-basis: 106px; }
  .ilu-chica { flex-basis: 90px; }
  .card-txt strong { font-size: 14px; }
  .panel-inner { padding-left: 12px; padding-right: 12px; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
  .card-ilu { flex-basis: 160px; }
  .ilu-chica { flex-basis: 120px; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  /* svh: el visor NO salta cuando el teclado del celular abre/cierra */
  #visor { height: 44vh; height: 44svh; min-height: 300px; z-index: 3; box-shadow: 0 8px 20px -14px rgba(20, 20, 20, 0.35); }
  /* el visor es sticky y tapa la cabecera del paso cuando irPaso() hace
     scrollIntoView: sin esto el cliente aterriza a mitad de la lista y no llega
     a ver la pregunta. max() replica el min-height de arriba, porque en pantallas
     bajas manda el min-height y un calc() sobre svh se queda corto. */
  :root { scroll-padding-top: max(44svh, 300px); }
  #chips { font-size: 11px; margin-top: 10px; }
  #hint-visor { display: none; }
  .cards-2, .cards-3 { grid-template-columns: 1fr; }
  .card { gap: 13px; padding: 14px; }
  .card-ilu { flex-basis: 128px; }
  .ilu-chica { flex-basis: 104px; }
  .card-txt strong { font-size: 15px; }
  .datos { grid-template-columns: 1fr; }
  .seg { grid-template-columns: 1fr; }
  .seg-2 { grid-template-columns: 1fr 1fr; }
  .medida-controles { flex-wrap: wrap; }
  .medida-controles input[type="range"] { flex-basis: 100%; order: 2; }
  .dock-nav { gap: 8px; }
  #dock-paso { display: none; }
  .btn-cta, .btn-ghost { padding: 13px 18px; font-size: 14px; }
  .dock-final { flex-wrap: wrap; }
}

/* Teléfonos APAISADOS / ventanas bajas: el visor cede alto al panel. VA DESPUÉS
   del bloque de arriba a propósito — misma especificidad (#visor), así que gana
   el último del fichero. Estaba escrito ANTES y quedaba 100% muerto: el visor
   se quedaba en min-height 300px y, con el dock pegado abajo, en 740×360 no
   quedaba UN SOLO píxel de formulario visible ni alcanzable. */
@media (max-height: 520px) and (max-width: 960px) {
  #visor { height: 52vh; height: 52svh; min-height: 220px; }
  :root { scroll-padding-top: max(52svh, 220px); }
}

/* pills del visor compactas: a ≤520px la fila de 5 no cabía y «Interior»
   quedaba cortado fuera de pantalla sin scroll (QA 03-ago) */
@media (max-width: 520px) {
  .visor-pills { left: 10px; right: 10px; bottom: 12px; gap: 5px; }
  .visor-pills button { font-size: 10.5px; padding: 8px 9px; flex: 1; text-align: center; }
}

@media (max-width: 420px) {
  .cab-titulo { display: none; }
  .cab-sep { display: none; }
  .cab-wa-txt { display: none; }
  .cab-wa { padding: 8px 10px; }
}
