/* ==========================================================================
   Stilux · sistema firmado · BASE (reset suave, cuerpo y tipografía)
   Solo var(--sx-*) de tokens.css. Se carga en app.html y en las páginas sueltas de la
   app, ANTES del CSS viejo (main.css…). NUNCA en los iframes de las plantillas de CV
   ni de carta (cv-builder.html y letter-editor.html cargan solo tokens y componentes).

   «Suave»: no toca márgenes, listas, enlaces ni el foco del marcado viejo. El reset duro
   que necesitan los componentes nuevos va acotado a sus contenedores .ui-* (abajo), para
   que una pantalla sin migrar se vea igual que antes salvo fuente, color y fondo.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* scrollbar-gutter: stable (columna fija con o sin barra) llega con la cabecera nueva
   (fase 3): con la cabecera blanca vieja deja una franja gris a la derecha. */

body {
  margin: 0;
  min-height: 100vh;
  background: var(--sx-bg);
  color: var(--sx-text);
  font-family: var(--sx-font);
  font-size: var(--sx-fs-body);
  font-weight: var(--sx-w-regular);
  line-height: var(--sx-lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font-family: inherit; }

::selection { background: var(--sx-accent-soft-2); color: var(--sx-text); }

/* ---------- Reset acotado al sistema nuevo ----------
   Dentro de una pieza .ui-* (página, cabecera, tarjeta, modal, menú, aviso…) el marcado
   empieza limpio, como en la maqueta firmada. :where() deja la especificidad en 0: la
   regla de cualquier componente gana sin pelear. */
:where(.ui-page, .ui-header, .ui-topbar, .ui-tabbar, .ui-card, .ui-list, .ui-modal, .ui-menu, .ui-toast, .ui-empty)
  :where(h1, h2, h3, h4, p, ul, ol, figure) { margin: 0; }
:where(.ui-page, .ui-header, .ui-topbar, .ui-tabbar, .ui-card, .ui-list, .ui-modal, .ui-menu, .ui-toast, .ui-empty)
  :where(ul, ol) { padding: 0; list-style: none; }
:where(.ui-page, .ui-header, .ui-topbar, .ui-tabbar, .ui-card, .ui-list, .ui-modal, .ui-menu, .ui-toast, .ui-empty)
  :where(img, svg) { display: block; }
:where(.ui-page, .ui-header, .ui-topbar, .ui-tabbar, .ui-card, .ui-list, .ui-modal, .ui-menu, .ui-toast, .ui-empty)
  :where(a) { color: inherit; text-decoration: none; }
:where([class^="ui-"], [class*=" ui-"]) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(button[class^="ui-"], button[class*=" ui-"]) { cursor: pointer; border: 0; background: transparent; }
:where([class^="ui-"], [class*=" ui-"]):focus { outline: none; }
:where([class^="ui-"], [class*=" ui-"]):focus-visible { outline: none; box-shadow: var(--sx-focus); }

/* Solo para lectores de pantalla */
.ui-sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
