/*
 * YARE · estilos previos al bundle (sin tokens: App.css todavía no existe).
 *
 * Es un archivo externo, NO un <style> en index.html, a propósito: al empaquetar
 * la app de escritorio, Tauri añade un nonce a cada <style> del HTML y lo suma a
 * style-src; con un nonce presente el navegador ignora 'unsafe-inline' y se
 * bloquearían todos los estilos inyectados en tiempo de ejecución
 * (react-hot-toast, impresión de reportes, visor BIM). Ver csp.config.mjs.
 */

html.light { color-scheme: light; }
html.dark { color-scheme: dark; }

/* La entrada queda oculta hasta que llega su CSS (src/boot/splash.css). */
#yare-splash { visibility: hidden; }

/* Respaldo: la hoja de la app no cargó y public/yare-boot.js muestra su aviso.
   Colores del sistema (siguen a color-scheme) y sin marca: solo el aviso, legible
   y con su botón "Reintentar" enfocable. */
html[data-ys-css="missing"] #yare-splash {
  visibility: visible;
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: Canvas;
  color: CanvasText;
  font: 14px/1.5 system-ui, sans-serif;
  text-align: center;
}

html[data-ys-css="missing"] #yare-splash .ys-stage,
html[data-ys-css="missing"] #yare-splash .ys-status,
html[data-ys-css="missing"] #yare-splash .ys-version {
  display: none;
}

html[data-ys-css="missing"] #yare-splash .ys-alert-title {
  margin: 0 0 4px;
  font-weight: 600;
}

html[data-ys-css="missing"] #yare-splash .ys-alert-detail {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

/* Approved native intro overlay. Coordinates match brand/yare/v1/layout.json
   and the new legacy lockup PNG; the splash controller's boxes stay intact. */
#yare-splash .ys-canvas.ys-native { mix-blend-mode: normal; }
#yare-splash .ys-native > svg {
  position: absolute;
  left: 21.5091163165%;
  top: 3.1567590894%;
  width: 58.4289702233%;
  height: 62.8169166037%;
  max-width: none;
  display: block;
}

/* Outside #root so it remains readable when JavaScript cannot execute. */
.yare-nojs {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  background: Canvas;
  color: CanvasText;
  font: 16px/1.5 system-ui, sans-serif;
  text-align: center;
}
.yare-nojs img { width: 76px; height: auto; }
.yare-nojs p { max-width: 36rem; margin: 0; }
