/* Pantalla de carga: un solo estilo, el del sistema v3 y su tema.
   Toma los tokens --ds-* (tokens.css y el tema elegido); los valores de respaldo son los del tema B,
   así se ve igual aunque una vista no cargue tokens.css. */
/* Con id: las hojas de cada vista (p. ej. `body.wi-on main` del What-if) no deben repintar el fondo al montarse. */
#viewLoading.view-loading, .view-loading {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--ds-bg-app, #f1f4f4);
    color: var(--ds-text, #111827);
    font-family: var(--ds-font, 'Inter', system-ui, sans-serif);
}
.view-loading-card { text-align: center; max-width: 380px; }
.view-loading-card h1 {
    margin: 18px 0 6px;
    font-family: var(--ds-font-display, 'Inter', system-ui, sans-serif);
    font-size: var(--ds-fs-lg, 1.25rem);
    font-weight: var(--ds-fw-display, 600);
    letter-spacing: -0.01em;
    color: var(--ds-text, #111827);
}
.view-loading-card p { margin: 0; color: var(--ds-text-muted, #6b7280); font-size: var(--ds-fs-sm, 0.8125rem); line-height: 1.6; }
.view-loading-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 2px solid var(--ds-border, #e5e7eb);
    border-top-color: var(--ds-accent, #c9622a);
    border-radius: 50%;
    animation: view-loading-spin .8s linear infinite;
}
.view-loading-card button {
    margin-top: 14px;
    height: 32px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--ds-radius-full, 999px);
    background: var(--ds-text, #111827);
    color: var(--ds-text-on-ink, #ffffff);
    cursor: pointer;
    font: inherit;
    font-size: var(--ds-fs-sm, 0.8125rem);
    font-weight: var(--ds-fw-medium, 500);
}
.view-loading-card button:focus-visible { outline: none; box-shadow: var(--ds-focus-ring, 0 0 0 3px rgba(201, 98, 42, 0.22)); }
#viewLoading.view-loading[hidden], .view-loading[hidden], .view-loading-spinner[hidden] { display: none; }
@keyframes view-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .view-loading-spinner { animation: none; }
}
