/* P48 Portal / Critical CSS from the very first paint.
   Loaded for both hosts but ONLY active when tema.js marks portal.*.
   It overrides CRM tokens before React, during OAuth callbacks and navigation. */
html.p48-portal-host,
html.p48-portal-host.dark {
  color-scheme: dark;
  --c-bg: #0A0A0A;
  --c-card: #141414;
  --c-field: #161616;
  --c-surface: #101010;
  --c-surface-2: #1B1B1B;
  --c-surface-3: #282828;
  --c-line: #343434;
  --c-text: #F5F5F5;
  --c-text-2: #D0D0D0;
  --c-text-inv: #0A0A0A;
  --c-muted: #ACACAC;
  --c-muted-2: #949494;
  --c-accent: #BEFF00;
  --c-accent-hover: #D3FF59;
  --c-on-accent: #0A0A0A;
  --c-danger: #E8005A;
  --c-ok: #BEFF00;
  --c-warn: #F1C86B;
  --c-info: #BEFF00;
  --module: #BEFF00;
  --module-soft: rgba(190, 255, 0, 0.06);
  --font-sans: 'Lexend', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  background: #0A0A0A;
  color: #F5F5F5;
}
html.p48-portal-host body,
html.p48-portal-host #root {
  min-height: 100dvh;
  margin: 0;
  background: #0A0A0A;
  color: #F5F5F5;
}
html.p48-portal-host body {
  font-family: var(--font-sans);
}
html.p48-portal-host ::selection {
  background: #BEFF00;
  color: #0A0A0A;
}
/* Static HTML loader is hidden on crm.p48.cl; React replaces it when ready. */
.p48-portal-preload {
  display: none;
}
html.p48-portal-host .p48-portal-preload {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  box-sizing: border-box;
  text-align: center;
}
html.p48-portal-host .p48-portal-preload__symbol {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
}
html.p48-portal-host .p48-portal-preload__symbol img {
  width: 54px;
  height: 54px;
}
html.p48-portal-host .p48-portal-preload__symbol::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(190, 255, 0, 0.23);
  border-top-color: #BEFF00;
  animation: p48-portal-bootstrap-sweep 18s linear infinite;
}
html.p48-portal-host .p48-portal-preload__title {
  color: #F5F5F5;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
html.p48-portal-host .p48-portal-preload__title strong {
  color: #BEFF00;
}
html.p48-portal-host .p48-portal-preload__description {
  color: #ACACAC;
  font-size: 12px;
}
html.p48-portal-host .p48-portal-loading-screen {
  min-height: 100dvh;
  background: #0A0A0A;
  color: #F5F5F5;
  font-family: var(--font-sans);
}
@keyframes p48-portal-bootstrap-sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
/* Also animates the React gateway fallback while its bundle loads. */
html.p48-portal-host .p48-portal-mark .p48-portal-radar {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: p48-portal-bootstrap-sweep 18s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  html.p48-portal-host .p48-portal-preload__symbol::after,
  html.p48-portal-host .p48-portal-mark .p48-portal-radar {
    animation: none;
  }
}
