/* === Fuente: c0010-j0ui-reset.css === */
/* =============================================================================
   c0010-j0ui-reset.css
   RESET DE SCOPE — Aislamiento CSS para el componente j0ui.

   Scope canónico: .j0
   · En la web app: aplicar a <body class="j0"> o al contenedor raíz de la app.
   · En la extensión Chrome: aplicar al contenedor inyectado en el DOM ajeno
     (evita herencia del host).
   · En el widget embebido: ídem extensión.

   El reset está en .j0 (no en body) para que funcione igual en los tres contextos.
   Si la web app quiere reset en body, agrega class="j0" al body en el layout PHP.
   ============================================================================= */


.j0 {
    all: initial;
	font-family: var(--j0ui-font, system-ui, sans-serif); 
}

.j0,
.j0 *,
.j0 *::before,
.j0 *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* font-family: var(--j0ui-font, system-ui, sans-serif); */
}

.j0 {
    /* color:                   var(--j0ui-text-main); */
    /* line-height:             1.5; */
    -webkit-font-smoothing:  antialiased;
    display:                 block;
}


/* === Fuente: c0101-j0pt-font-sizes.css === */
:root {
    /* Sistema Tipográfico J0 (Escala 5 por Octava - K0) */
    --j0-pt-6:  0.5rem;    /* ~8px  */
    --j0-pt-7:  0.574rem;  /* ~9px  */
    --j0-pt-8:  0.66rem;   /* ~10.5px */
    --j0-pt-9:  0.758rem;  /* ~12px */
    --j0-pt-10: 0.871rem;  /* ~14px */
    --j0-pt-11: 0.935rem;  /* ~15px */
    --j0-pt-12: 1rem;      /* ~16px */
    --j0-pt-14: 1.149rem;  /* ~18px */
    --j0-pt-16: 1.32rem;   /* ~21px */
    --j0-pt-18: 1.516rem;  /* ~24px */
    --j0-pt-21: 1.741rem;  /* ~28px */
    --j0-pt-24: 2rem;      /* ~32px */
    --j0-pt-28: 2.297rem;  /* ~37px */
    --j0-pt-32: 2.639rem;  /* ~42px */
    --j0-pt-36: 3.031rem;  /* ~48px */
    --j0-pt-42: 3.482rem;  /* ~56px */
    --j0-pt-48: 4rem;      /* ~64px */
    --j0-pt-56: 4.595rem;  /* ~74px */
    --j0-pt-64: 5.278rem;  /* ~84px */
    --j0-pt-72: 6.063rem;  /* ~97px */
    --j0-pt-84: 6.964rem;  /* ~111px */
    --j0-pt-96: 8rem;      /* ~128px */
    --j0-pt-112: 9.19rem;  /* ~147px */
    --j0-pt-128: 10.556rem;/* ~169px */
    --j0-pt-144: 12.126rem;/* ~194px */
}

/* ─── ESCALA DUAL — complementa c0026 ───────────────────────────────────────── */

/* Escala WEB — default fuera de j0-window */
:root, .j0, HTML {
    --j0ui-size-font-sm:    var(--j0-pt-11, 0.935rem);   /* ~15px — secundario   */
	--j0ui-size-font-ui:    var(--j0-pt-12, 1rem);
    --j0ui-size-font-lg:    var(--j0-pt-14, 1.149rem);   /* ~18px — subtítulos   */
    --j0ui-size-font-xl:    var(--j0-pt-18, 1.516rem);   /* ~24px — h3/h4        */
    --j0ui-size-font-2xl:   var(--j0-pt-24, 1.896rem);   /* ~30px — h2           */
    --j0ui-size-font-3xl:   var(--j0-pt-30, 2.273rem);   /* ~36px — h1           */
    --j0ui-size-input:      42px;
    --j0ui-size-header:     56px;
    --j0ui-space-sm:        12px;
    --j0ui-space-md:        20px;
    --j0ui-space-lg:        32px;
    --j0ui-success:         #40c057;
}

/* Escala UI COMPACTA — dentro de j0-window */
j0-window, .j0ui-compact {
    --j0ui-size-font-ui:    var(--j0-pt-12, 0.935rem);
    --j0ui-size-font-sm:    var(--j0-pt-10, 0.871rem);
    --j0ui-size-font-lg:    var(--j0-pt-12, 1rem);
    --j0ui-size-font-xl:    var(--j0-pt-14, 1.149rem);
    --j0ui-size-font-2xl:   var(--j0-pt-18, 1.516rem);
    --j0ui-size-font-3xl:   var(--j0-pt-24, 1.896rem);
    --j0ui-size-input:      26px;
    --j0ui-size-header:     34px;
    --j0ui-space-sm:        6px;
    --j0ui-space-md:        10px;
    --j0ui-space-lg:        20px;
}


/* === Fuente: c0015-j0-colorgroups.css === */
/* =============================================================================
   c0015-j0-colorgroups.css
   PALETA + GRUPOS + RELACIONES — EJEMPLO de Layer A / Layer B del modelo IPAX.

   Requiere: c0020-j0ui-core-tokens.css (define THIS-* con su default
   paper-on-ink; Core lee siempre de THIS-*, nunca de este archivo directo).

   Namespace: todo bajo --j0-* (nivel IPAX, agnóstico de UI vs. editorial —
   no --j0ui-*, que es namespace específico del framework de componentes).
   Clases bajo .j0-* por el mismo motivo: son gramática de color, no
   componentes de interfaz — deberían poder usarse igual en un artículo
   editorial (.k0c) que en una ventana de j0ui.

   Convención de nombrado en custom properties:
     __  separa NAMESPACE → PARTE     (grupo → rol:  --j0-destacados__paper)
     --  separa BASE → VARIANTE       (entorno:      --j0-naranja--fdark)
   Un guion simple queda libre para usarse DENTRO de cada segmento
   (--j0-naranja-osc, --j0-alto-contraste) sin ambigüedad.

   ESTE ARCHIVO ES ADITIVO: si no se carga, c0020 sigue funcionando exacto
   como antes (THIS-* default apunta a los relativos del tema activo). Cargar
   este archivo solo agrega la posibilidad de más de un grupo y de relaciones
   distintas a paper-on-ink — no cambia nada de lo que ya funciona sin él.
   ============================================================================= */


/* ─────────────────────────────────────────────────────────────────────────────
   NIVEL -1 — PALETA (ejemplo)
   Lista plana, global, de colores con nombre. Sin rol, sin grupo, sin
   validación todavía — es materia prima para los grupos de más abajo.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
    --j0-naranja:     #FF6600;
    --j0-naranja-osc: #CC5200;
    --j0-siena-osc:   #4A2C1D;
    --j0-blanco-tiza: #FAF4E8;
}

/* Override por entorno — mecanismo de sufijo con variante BEM (--), no una
   bandera aparte. Si un grupo no referencia la variante -dark de un color,
   sigue leyendo la entrada base sin ninguna acción explícita: ESE es el link
   por default entre entornos, no hace falta declararlo aparte. */
html[data-theme="dark"] {
    --j0-naranja--dark: #CC5200;  /* más apagado en dark, para reducir fatiga cromática */
    /* --j0-siena-osc no tiene variante --dark: los grupos que lo usan en dark
       siguen leyendo --j0-siena-osc tal cual. */
}


/* ─────────────────────────────────────────────────────────────────────────────
   NIVEL 0-6 — GRUPOS (ejemplo: "destacados")
   Un grupo referencia entradas de la Paleta y les asigna un rol. Regla dura:
   exactamente un Paper y un Ink por grupo — es lo que le permite al motor
   IPAX Score saber contra qué validar todo lo demás.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
    --j0-destacados__paper:  var(--j0-naranja);
    --j0-destacados__ink:    var(--j0-ipax-paper-x);   /* blanco puro, Nivel 0 ya validado */
    --j0-destacados__accent: var(--j0-siena-osc);       /* mismo siena, reusado como accent acá */
}
html[data-theme="dark"] {
    --j0-destacados__paper:  var(--j0-naranja--dark);
    /* ink y accent sin variante --dark declarada: se heredan sin cambios */
}


/* ─────────────────────────────────────────────────────────────────────────────
   LAYER A — SELECCIÓN DE GRUPO
   Reasigna los relativos "crudos" (--j0-ipax-paper/ink/accent) al grupo
   elegido. THIS-* (definido en c0020) los vuelve a leer más abajo, siguiendo
   el cascade en el punto de uso — no hace falta redeclarar THIS-* acá.
   ───────────────────────────────────────────────────────────────────────────── */

.j0-colorgroup--destacados {
    --j0-ipax-paper:    var(--j0-destacados__paper);
    --j0-ipax-ink:      var(--j0-destacados__ink);
    --j0-ipax-accent:   var(--j0-destacados__accent);
    /* Este grupo no abrió accent-p/accent-i todavía — no hacía falta
       (Nivel 2 es opcional hasta que un componente de adentro necesite
       accent como texto en ambas direcciones). Mientras no se abran,
       THIS-accent-p/i siguen heredando los del grupo "main" — ver nota
       de apertura progresiva en la Especificación de Tokens. */
}


/* ─────────────────────────────────────────────────────────────────────────────
   LAYER B — RELACIÓN (equivalente de this-ink/this-paper de k0)
   Decide qué rol pinta fondo y cuál pinta texto, con los colores que Layer A
   dejó disponibles. Nunca reasigna --j0-ipax-paper/ink/accent* directo —
   regla dura, ver Implementación CSS §5.2.
   ───────────────────────────────────────────────────────────────────────────── */

.j0-this-paper-on-ink {           /* explícito; es el default ya establecido en c0020 */
    --j0-ipax-this-paper: var(--j0-ipax-paper);
    --j0-ipax-this-ink:   var(--j0-ipax-ink);
}
.j0-this-accent-on-paper {
    --j0-ipax-this-paper: var(--j0-ipax-paper);
    --j0-ipax-this-ink:   var(--j0-ipax-accent-i, var(--j0-ipax-accent));
    /* accent-i si el grupo lo abrió; si no, cae al accent plano del grupo —
       mejor que romper, aunque no sea la validación más fina posible. */
}
.j0-this-paper-on-accent {
    --j0-ipax-this-paper: var(--j0-ipax-accent);
    --j0-ipax-this-ink:   var(--j0-ipax-paper-x);   /* text-on-accent: extremo absoluto, no relativo */
}


/* ─────────────────────────────────────────────────────────────────────────────
   EJEMPLO DE USO (referencia, no aplica solo por estar en el archivo):

   <div class="j0-colorgroup--destacados j0-this-accent-on-paper">
       fondo: naranja (paper de "destacados")
       texto: siena-osc (accent del mismo grupo, como texto sobre su paper)
   </div>

   Ambas clases son ortogonales — cero solapamiento de propiedades — así que
   el orden en el HTML no importa, y no hace falta anidar dos <div> salvo que
   la relación deba aplicarse a una región más chica que todo el grupo.
   ───────────────────────────────────────────────────────────────────────────── */

/* === Fuente: c0020-j0ui-core-tokens.css === */
/* =============================================================================
   c0020-j0ui-core-tokens.css
   LAS VARIABLES SAGRADAS (MODELO IPAX) — Definición de identidad visual.
   
   Mecanismo de theming: SSOT único → html[data-theme]
     · :root + html[data-theme="light"]         = LIGHT (default)
	 · html[data-theme="dark"]  = DARK  

   Niveles de Abstracción:
     1. Absolutos: Valores Hex duros por paleta.
     2. Relativos: Variables agnósticas (paper, ink, accent-p, accent-i).
     3. THIS-* (Layer B — relación): qué rol de los relativos pinta fondo y
        qué rol pinta texto. Default: paper-on-ink. Ver c0015-j0-colorgroups.css
        para relaciones alternativas (accent-on-paper, paper-on-accent) y para
        grupos de color adicionales al principal.
     4. Core: asignación semántica para el motor j0ui — lee siempre de THIS-*,
        nunca de paper/ink/accent directo. Es lo que permite que un grupo o
        una relación distintos, aplicados en cualquier subárbol del DOM, se
        propaguen solos sin que Core ni nada de lo que consume Core se entere.
     
   NOTA ARQUITECTÓNICA: Los bloques temáticos están deliberadamente separados y 
   duplicados para permitir la edición manual directa de excepciones por tema.

   NOTA DE ESTADO (2026-07): el bloque "dark" de la escala absoluta sigue
   siendo, en gran parte, la inversión naive de light (swap de roles) — no
   auditada por separado con el motor ergonómico (ver documento "IPAX Score").
   Es un stub de bootstrap válido para empezar a trabajar, no una decisión de
   diseño final. FlowStyler (c3000) ya pisa varios de estos valores con
   colores autorados a mano — ese es el camino correcto para ir saliendo del
   stub, tema por tema, campo por campo.
   ============================================================================= */


/* ─────────────────────────────────────────────────────────────────────────────
   NIVEL 1: ESCALAS ABSOLUTAS IPAX
   ───────────────────────────────────────────────────────────────────────────── */
:root {
	/* DEFAULT LIGHT PALETTE*/
	/* Tricontrast purple for debugging */
	--j0-absolute-light-paper-x:  #FFFFFF;
	--j0-absolute-light-paper:    #FAF4FD;
	--j0-absolute-light-accent-p: #E15CFF;
	--j0-absolute-light-accent:	#C100FA;
	--j0-absolute-light-accent-i: #8800B6;
	--j0-absolute-light-ink:      #310A40;
	--j0-absolute-light-ink-x:    #000000;

	/* Greenish Blue */
	/* https://icograma.com/ipax/?p=ffffff-000000-F2F2F2-61DDFF-007C9E-005066-1F1F1F */
	/* --j0-absolute-light-paper-x:  #FFFFFF;
	--j0-absolute-light-paper:    #F2F2F2;
	--j0-absolute-light-accent-p: #61DDFF;
	--j0-absolute-light-accent:	#007C9E;
	--j0-absolute-light-accent-i: #005066;
	--j0-absolute-light-ink:      #1F1F1F;
	--j0-absolute-light-ink-x:    #000000; */

	/* DEFAULT DARK PALETTE en base a valores Light */
	--j0-absolute-dark-paper-x: var(--j0-absolute-light-ink-x);
	--j0-absolute-dark-paper: var(--j0-absolute-light-ink);
	--j0-absolute-dark-accent-p: var(--j0-absolute-light-accent-i);
	--j0-absolute-dark-accent: var(--j0-absolute-light-accent);
	--j0-absolute-dark-accent-i: var(--j0-absolute-light-accent-p);
	--j0-absolute-dark-ink:  var(--j0-absolute-light-paper);
	--j0-absolute-dark-ink-x: var(--j0-absolute-light-paper-x);
}

/* ─────────────────────────────────────────────────────────────────────────────
   NIVEL 2: ESCALA RELATIVA (Agnóstica al tema)
   ───────────────────────────────────────────────────────────────────────────── */

:root, html[data-theme="light"] {
    --j0-ipax-paper-x:  var(--j0-absolute-light-paper-x);
    --j0-ipax-paper:    var(--j0-absolute-light-paper);
    --j0-ipax-accent-p: var(--j0-absolute-light-accent-p);
    --j0-ipax-accent: var(--j0-absolute-light-accent);
	--j0-ipax-accent-i: var(--j0-absolute-light-accent-i);
    --j0-ipax-ink:      var(--j0-absolute-light-ink);
    --j0-ipax-ink-x:    var(--j0-absolute-light-ink-x);
}
html[data-theme="dark"] {
    --j0-ipax-paper-x:  var(--j0-absolute-dark-paper-x);
    --j0-ipax-paper:    var(--j0-absolute-dark-paper);
    --j0-ipax-accent-p: var(--j0-absolute-dark-accent-p);
	--j0-ipax-accent: var(--j0-absolute-dark-accent);
    --j0-ipax-accent-i: var(--j0-absolute-dark-accent-i);
    --j0-ipax-ink:      var(--j0-absolute-dark-ink);
    --j0-ipax-ink-x:    var(--j0-absolute-dark-ink-x);
}


/* ─────────────────────────────────────────────────────────────────────────────
   NIVEL 3: THIS-* — LAYER B, relación por default (paper-on-ink)

   Este es el ÚNICO lugar del sistema que tiene permiso de leer
   --j0-ipax-paper/ink/accent* "crudos" fuera de c0021-j0-contexts.css.
   Todo lo de abajo (Core) lee de acá, nunca de los relativos directo.

   THIS-* son roles de CONSUMO, no alias de nombre — igual que INK/PAPER en
   el ZX Spectrum eran registros de hardware (texto/fondo), no nombres de
   color. --j0-ipax-this-ink SIEMPRE se consume como `color` (texto),
   --j0-ipax-this-paper SIEMPRE como `background-color` (fondo),
   --j0-ipax-this-accent SIEMPRE como el acento usable dentro de ese
   contexto — sin importar qué valor concreto de paper/ink/accent-i/accent-p
   ocupe cada rol en cada uno de los seis contextos de c0021.

   Por qué exactamente tres slots, no cinco: accent-p y accent-i son
   variantes de VALIDACIÓN (contra qué extremo funciona cada una), no roles
   de consumo. Esa elección ya se resuelve en la clase de contexto
   (c0021-j0-contexts.css) — THIS-accent recibe el valor YA resuelto para
   ese contexto. Nada de lo que consume THIS-* necesita saber que accent-p/
   accent-i existen.

   Por qué esto no se "congela" al declararse acá: una custom property no
   sustituye su var() en el momento en que se declara, lo hace en el momento
   en que se consume, siguiendo el cascade de CADA elemento donde finalmente
   se usa. Si un descendiente (una clase de contexto, en c0021-j0-contexts.css)
   reasigna --j0-ipax-paper/ink/accent* más abajo en el árbol, todo lo que lee
   THIS-* —incluido Core— ve automáticamente el valor nuevo.
   ───────────────────────────────────────────────────────────────────────────── */

/* Default: contexto ink-on-paper (ink es texto, paper es fondo).
   El acento usable en este contexto es accent-i (validado contra paper). */
:root {
    --j0-ipax-this-paper:  var(--j0-ipax-paper);
    --j0-ipax-this-ink:    var(--j0-ipax-ink);
    --j0-ipax-this-accent: var(--j0-ipax-accent-i);
}


/* ─────────────────────────────────────────────────────────────────────────────
   NIVEL 4: TOKENS DEL SISTEMA (Derivados puros de THIS-* y de los relativos)
   ───────────────────────────────────────────────────────────────────────────── */

:root, html[data-theme="light"] {
    --j0ui-core-bg-surface: var(--j0-ipax-this-paper);

    /* bg-field en light: paper-x directo, sin cambios respecto del original —
       no había bug reportado acá. Paper-x/Ink-x son anclas absolutas
       GLOBALES del sistema (no por grupo, ver Especificación de Tokens
       Nivel 0), por eso no pasan por THIS-* como el resto de esta sección. */
    --j0ui-core-bg-field:   var(--j0-ipax-paper-x);

    --j0ui-core-border:     color-mix(in srgb, var(--j0-ipax-this-ink) 18%, transparent);
    --j0ui-core-text-main:  var(--j0-ipax-this-ink);
    --j0ui-core-text-muted: color-mix(in srgb, var(--j0-ipax-this-ink) 60%, var(--j0-ipax-this-paper));

    /* accent SÓLIDO (fondo de botón primario, marca): NO depende del
       contexto — sigue siendo el mismo acento de marca en cualquier caja,
       invertida o no. Por eso lee del relativo directo, no de THIS-*. */
    --j0ui-core-accent:      var(--j0-ipax-accent);
    --j0ui-core-accent-p:    var(--j0-ipax-accent-p);
    --j0ui-core-accent-i:    var(--j0-ipax-accent-i);

    /* accent USABLE EN EL CONTEXTO (texto de link, highlight): sí depende
       del contexto — es lo que cambia entre accent-i/accent-p/accent-pp
       según qué caja de c0021 esté activa. */
    --j0ui-core-this-accent: var(--j0-ipax-this-accent);

    --j0ui-core-radius:     8px;
}

html[data-theme="dark"] {
    --j0ui-core-bg-surface: var(--j0-ipax-this-paper);

    /* bg-field en dark: Default 10%, queda expuesto como perilla ajustable por theme, no como fórmula fija,
       pero el DEFAULT no se toca sin verificar el resultado antes. */
    --j0ui-core-field-lift: 10%;
    --j0ui-core-bg-field:   color-mix(in srgb, var(--j0-ipax-this-paper) calc(100% - var(--j0ui-core-field-lift)), var(--j0-ipax-this-ink) var(--j0ui-core-field-lift));

    --j0ui-core-border:     color-mix(in srgb, var(--j0-ipax-this-ink) 10%, transparent);
    --j0ui-core-text-main:  var(--j0-ipax-this-ink);
    --j0ui-core-text-muted: color-mix(in srgb, var(--j0-ipax-this-ink) 60%, var(--j0-ipax-this-paper));

    --j0ui-core-accent:      var(--j0-ipax-accent);
    --j0ui-core-accent-p:    var(--j0-ipax-accent-p);
    --j0ui-core-accent-i:    var(--j0-ipax-accent-i);
    --j0ui-core-this-accent: var(--j0-ipax-this-accent);

    --j0ui-core-radius:     8px;
}

/* === Fuente: c0021-j0-contexts.css === */
/* =============================================================================
   c0021-j0-contexts.css
   LOS SEIS CONTEXTOS — combinaciones canónicas de IPAX, heredadas de k0
   (ver section-contexts.php). Layer B: qué rol pinta fondo, qué rol pinta
   texto, con los colores que estén activos (relativos de tema, o los de un
   grupo si c0021 se usa junto con un mecanismo de grupos en userland).

   Requiere: c0020-j0ui-core-tokens.css (define THIS-* con su default
   ink-on-paper; Core lee siempre de THIS-*, nunca de los relativos directo).

   NOMENCLATURA: A-on-B significa A es TEXTO, B es FONDO. "paper-on-ink" es
   el NEGATIVO de "ink-on-paper" (texto claro sobre fondo oscuro) — no es
   sinónimo ni default de nada.

   THIS-ink SIEMPRE se consume como texto, THIS-paper SIEMPRE como fondo,
   THIS-accent SIEMPRE como el acento usable dentro de esa caja — el nombre
   del slot es el ROL (herencia ZX Spectrum INK/PAPER), no el color que hoy
   le toca ocupar. Por eso "paper-on-ink" reasigna el VALOR paper al ROL
   this-ink, no al revés.

   accent-on-accent (séptimo contexto en el k0 original, texto accent-ii
   sobre fondo accent-pp) queda deliberadamente afuera — no se considera un
   contexto válido para producción.

   accent-pp no está definido todavía como token de primer nivel en c0020
   (es una extensión opcional, ver Especificación de Tokens). Mientras no
   se autore, cae a accent-p vía fallback de var() — mejor que romper.
   ───────────────────────────────────────────────────────────────────────────── */


/* ─── 1. ink-on-paper — DEFAULT, ya establecido en c0020, explícito acá por si se necesita reforzar tras otro contexto ─── */
.j0-ink-on-paper {
    --j0-ipax-this-ink:    var(--j0-ipax-ink);
    --j0-ipax-this-paper:  var(--j0-ipax-paper);
    --j0-ipax-this-accent: var(--j0-ipax-accent-i);
}

/* ─── 2. paper-on-ink — el NEGATIVO. Texto claro sobre fondo oscuro. ─── */
.j0-paper-on-ink {
    --j0-ipax-this-ink:    var(--j0-ipax-paper);
    --j0-ipax-this-paper:  var(--j0-ipax-ink);
    --j0-ipax-this-accent: var(--j0-ipax-accent-p);
}

/* ─── 3. accent-on-paper — acento como texto/link, sobre fondo claro. ─── */
.j0-accent-on-paper {
    --j0-ipax-this-ink:    var(--j0-ipax-accent-i);
    --j0-ipax-this-paper:  var(--j0-ipax-paper);
    --j0-ipax-this-accent: var(--j0-ipax-accent-i);
}

/* ─── 4. accent-on-ink — acento como texto/link, sobre fondo oscuro. ─── */
.j0-accent-on-ink {
    --j0-ipax-this-ink:    var(--j0-ipax-accent-p);
    --j0-ipax-this-paper:  var(--j0-ipax-ink);
    --j0-ipax-this-accent: var(--j0-ipax-accent-p);
}

/* ─── 5. paper-on-accent — bloque de acento sólido, texto claro encima
   (botón primario, badge de marca). accent-i como fondo, no accent plano —
   así lo define k0; validado como capaz de sostener texto claro encima. ─── */
.j0-paper-on-accent {
    --j0-ipax-this-ink:    var(--j0-ipax-paper);
    --j0-ipax-this-paper:  var(--j0-ipax-accent-i);
    /* THIS-accent dentro de una caja ya-de-acento queda sin resolver acá —
       necesitaría su propio token validado contra accent-i como fondo.
       TODO real, no inventado: ver nota de Santiago sobre ".accent" pendiente. */
}

/* ─── 6. ink-on-accent — bloque de acento pálido, texto oscuro encima.
   accent-pp (extendido, más claro que accent-p) como fondo — así lo define
   k0; con fallback a accent-p si accent-pp no está autorado todavía. ─── */
.j0-ink-on-accent {
    --j0-ipax-this-ink:    var(--j0-ipax-ink);
    --j0-ipax-this-paper:  var(--j0-ipax-accent-pp, var(--j0-ipax-accent-p));
    /* THIS-accent acá: mismo TODO que el contexto anterior. */
}


/* ─────────────────────────────────────────────────────────────────────────────
   CONSUMO — igual que k0c.css, siempre los mismos dos roles:
     color: var(--j0ui-text-main);       ← lee THIS-ink vía Core
     background: var(--j0ui-bg-window);  ← lee THIS-paper vía Core
   Ningún componente necesita saber qué contexto está activo.
   ───────────────────────────────────────────────────────────────────────────── */

/* === Fuente: c0022-j0ui-typography.css === */
/* =============================================================================
   c0021-j0ui-typography.css
   TIPOGRAFÍA BASE — Estilos aplicados a elementos semánticos HTML.
   Agnóstico al producto. Scope: .j0 (hereda tokens de c0026).

   Escala automática:
     Fuera de j0-window  → escala web  (tamaños generosos, lectura cómoda)
     Dentro de j0-window → escala UI   (compacta, heredada de c0026)
   ============================================================================= */




/* ─── HEADINGS ───────────────────────────────────────────────────────────────── */

.j0 h1, .j0 h2, .j0 h3, .j0 h4, .j0 h5, .j0 h6 {
    font-family:    var(--j0ui-font);
    color:          var(--j0ui-text-main);
    line-height:    1.2;
    font-weight:    700;
    margin:         0 0 var(--j0ui-space-sm) 0;
}

.j0 h1 { font-size: var(--j0ui-size-font-3xl); }
.j0 h2 { font-size: var(--j0ui-size-font-2xl); }
.j0 h3 { font-size: var(--j0ui-size-font-xl);  font-weight: 600; }
.j0 h4 { font-size: var(--j0ui-size-font-lg);  font-weight: 600; }
.j0 h5 { font-size: var(--j0ui-size-font-ui);  font-weight: 600; }
.j0 h6 { font-size: var(--j0ui-size-font-sm);  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }


/* ─── BODY TEXT ──────────────────────────────────────────────────────────────── */

.j0 p {
    font-family: var(--j0ui-font);
    font-size:   var(--j0ui-size-font-ui);
    color:       var(--j0ui-text-main);
    line-height: 1.6;
    margin:      0 0 var(--j0ui-space-sm) 0;
}

.j0 p:last-child { margin-bottom: 0; }

.j0 strong, .j0 b { font-weight: 700; color: var(--j0ui-text-main); }
.j0 em, .j0 i     { font-style: italic; }

.j0 small {
    font-size: var(--j0ui-size-font-sm);
    color:     var(--j0ui-text-muted);
}


/* ─── LINKS ──────────────────────────────────────────────────────────────────── */

.j0 a {
    color:           var(--j0ui-text-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition:      color 0.15s, opacity 0.15s;
}

.j0 a:hover  { opacity: 0.8; }
.j0 a:active { opacity: 0.6; }


/* ─── LISTAS ─────────────────────────────────────────────────────────────────── */

.j0 ul, .j0 ol {
    font-size:   var(--j0ui-size-font-ui);
    color:       var(--j0ui-text-main);
    line-height: 1.6;
    margin:      0 0 var(--j0ui-space-sm) 0;
    padding-left: 1.5em;
}

.j0 li { margin-bottom: 4px; }
.j0 li:last-child { margin-bottom: 0; }


/* ─── CODE ───────────────────────────────────────────────────────────────────── */

.j0 code {
    font-family:      var(--j0ui-font-mono);
    font-size:        0.9em;
    background:       var(--j0ui-bg-input);
    border:           1px solid var(--j0ui-border-subtle);
    border-radius:    var(--j0ui-radius-sm);
    padding:          1px 5px;
    color:            var(--j0ui-text-accent);
}

.j0 pre {
    font-family:   var(--j0ui-font-mono);
    font-size:     var(--j0ui-size-font-sm);
    background:    var(--j0ui-bg-input);
    border:        1px solid var(--j0ui-border-subtle);
    border-radius: var(--j0ui-radius);
    padding:       var(--j0ui-space-md);
    overflow-x:    auto;
    margin:        0 0 var(--j0ui-space-sm) 0;
}

.j0 pre code {
    background: none;
    border:     none;
    padding:    0;
    font-size:  inherit;
}


/* ─── SEPARADOR ──────────────────────────────────────────────────────────────── */

.j0 hr {
    border:        none;
    border-top:    1px solid var(--j0ui-border-subtle);
    margin:        var(--j0ui-space-md) 0;
}


/* ─── CLASES UTILITARIAS DE TEXTO ────────────────────────────────────────────── */

.j0ui-text-main    { color: var(--j0ui-text-main)    !important; }
.j0ui-text-muted   { color: var(--j0ui-text-muted)   !important; }
.j0ui-text-accent  { color: var(--j0ui-text-accent)  !important; }
.j0ui-text-danger  { color: var(--j0ui-danger)        !important; }
.j0ui-text-success { color: var(--j0ui-success)       !important; }
.j0ui-text-sm      { font-size: var(--j0ui-size-font-sm)  !important; }
.j0ui-text-micro   { font-size: var(--j0ui-size-font-micro) !important; }
.j0ui-text-mono    { font-family: var(--j0ui-font-mono)   !important; }
.j0ui-sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* === Fuente: c0026-j0ui-derived-tokens.css === */
/* =============================================================================
   c0026-j0ui-derived-tokens.css
   TOKENS DERIVADOS — Los tokens del framework expandidos desde las variables core.

   Requiere: c0020-j0ui-core-tokens.css (define las vars core).
   No sabe nada de light/dark — hereda el tema desde las vars sagradas.
   No hardcodea colores — todo es color-mix() o referencia a core vars.

   ESCALA DUAL:
     · :root, .j0          → escala WEB (página, login, formularios, artículos)
     · j0-window, .j0ui-compact → escala UI COMPACTA (paleta, inspector, herramientas)

   Para ajustes quirúrgicos producto-específicos: en el CSS del producto, nunca aquí.
   ============================================================================= */

/* ─────────────────────────────────────────────────────────────────────────────
   TOKENS DE COLOR Y ESTRUCTURA — Iguales en ambas escalas
   ───────────────────────────────────────────────────────────────────────────── */
:root, .j0 {

	/* ─── BROWSER NATIVE CONTROLS ────────────────────────────────────── */
	/* Controla cómo dibuja el motor los elementos irreemplazables (calendarios, dropdowns nativos) */
	--j0ui-color-scheme: light;

    /* ─── TIPOGRAFÍA ─────────────────────────────────────────────────── */
    --j0ui-font:            system-ui, -apple-system, 'Helvetica Neue', sans-serif;
    --j0ui-font-mono:       ui-monospace, 'SF Mono', 'Courier New', monospace;
    --j0ui-font-serif:      Georgia, serif;

    /* ─── BACKGROUNDS ────────────────────────────────────────────────── */
    --j0ui-bg-app:          color-mix(in srgb, var(--j0ui-core-bg-surface) 60%, transparent);
    --j0ui-bg-window:       var(--j0ui-core-bg-surface);
    --j0ui-bg-acrylic:      color-mix(in srgb, var(--j0ui-core-bg-surface) 90%, transparent);
    --j0ui-bg-header:       color-mix(in srgb, var(--j0ui-core-bg-surface) 92%, var(--j0ui-core-text-muted) );
    --j0ui-bg-panel:        color-mix(in srgb, var(--j0ui-core-bg-surface) 90%, var(--j0ui-core-bg-field) 10%);
    --j0ui-bg-input:        var(--j0ui-core-bg-field);
    --j0ui-bg-input-focus:  color-mix(in srgb, var(--j0ui-core-bg-field) 90%, var(--j0ui-core-text-main) 10%);
    --j0ui-bg-hover:        color-mix(in srgb, var(--j0ui-core-text-main) 7%, transparent);
    
    /* El Active de componentes efímeros usa el Acento SÓLIDO — es fondo con
       texto encima, no texto sobre paper. accent-i estaba mal acá: es la
       variante validada como TEXTO, no como fondo. */
    --j0ui-bg-active:       var(--j0ui-core-accent);

    /* ─── BORDES ─────────────────────────────────────────────────────── */
    --j0ui-border-window:        var(--j0ui-core-border);
    --j0ui-border-window-active: color-mix(in srgb, var(--j0ui-core-border) 50%, var(--j0ui-core-text-main) 50%);
    --j0ui-border-input:         color-mix(in srgb, var(--j0ui-core-border) 130%, transparent);
    --j0ui-border-input-focus:   var(--j0ui-core-this-accent);
    --j0ui-border-subtle:        color-mix(in srgb, var(--j0ui-core-border) 50%, transparent);

    /* ─── TEXTO ──────────────────────────────────────────────────────── */
    --j0ui-text-main:       var(--j0ui-core-text-main);
    --j0ui-text-secondary:  color-mix(in srgb, var(--j0ui-core-text-main) 80%, var(--j0ui-core-text-muted) 20%);
    --j0ui-text-muted:      var(--j0ui-core-text-muted);
    
    /* El texto de acento sigue el contexto activo (c0021) — en ink-on-paper
       resuelve a accent-i, en paper-on-ink a accent-p, etc. Ya no es un
       valor fijo. */
    --j0ui-text-accent:     var(--j0ui-core-this-accent);
    
    /* Links (Aislados del texto acentuado base para control semántico) */
    --j0ui-text-link:       var(--j0ui-core-this-accent);
    --j0ui-text-link-hover: color-mix(in srgb, var(--j0ui-core-this-accent) 80%, var(--j0ui-core-text-main) 20%);
    
    /* El texto SOBRE áreas de Acento Sólido requiere extremos IPAX absolutos para contrastar */
    --j0ui-text-on-accent:  var(--j0-ipax-paper-x);
    --j0ui-text-on-danger:  var(--j0-ipax-paper-x);
    --j0ui-text-on-success: var(--j0-ipax-paper-x);
    /* warning es ámbar (#ffaa00) — contra paper-x (blanco) no llega a 4.5:1.
       Validado contra el extremo opuesto, no por simetría con los otros dos. */
    --j0ui-text-on-warning: var(--j0-ipax-ink-x);

    /* ─── SOMBRAS ────────────────────────────────────────────────────── */
    --j0ui-shadow-window:        0 10px 30px rgba(0, 0, 0, 0.25);
    --j0ui-shadow-window-active: 0 16px 40px rgba(0, 0, 0, 0.5);
    --j0ui-shadow-menu:          0 4px 16px rgba(0, 0, 0, 0.25);
    --j0ui-shadow-item:          0 1px 2px rgba(0, 0, 0, 0.5);
    --j0ui-shadow-item-active:   0 1px 1px rgba(0, 0, 0, 0.5);
    --j0ui-shadow-track:         inset 0px 1px 1px rgba(0, 0, 0, 0.25);

    /* ─── ACENTOS SEMÁNTICOS (Sólido vs Relativo) ────────────────────── */
    --j0ui-accent:          var(--j0ui-core-accent); /* Acento SÓLIDO (Brand) */
    --j0ui-accent-hover:    color-mix(in srgb, var(--j0ui-core-accent) 85%, #000 15%);
    --j0ui-accent-bg:       color-mix(in oklch, var(--j0ui-core-accent-p) 15%, transparent);
    
    --j0ui-danger:          #ff4444;
    --j0ui-danger-hover:    color-mix(in srgb, var(--j0ui-danger) 85%, #000 15%);
    --j0ui-danger-soft:     color-mix(in srgb, var(--j0ui-danger) 12%, transparent);
    
    --j0ui-warning:         #ffaa00;
    --j0ui-warning-soft:    color-mix(in srgb, var(--j0ui-warning) 12%, transparent);
    
    --j0ui-success:         #40c057;
    --j0ui-success-hover:   color-mix(in srgb, var(--j0ui-success) 85%, #000 15%);
    --j0ui-success-soft:    color-mix(in srgb, var(--j0ui-success) 12%, transparent);

    /* ─── TOKENS DE COMPONENTE ───────────────────────────────────────── */
    --j0ui-slider-track-bg:         var(--j0ui-core-bg-field);
    --j0ui-slider-thumb:            var(--j0ui-core-text-main);
/*     --j0ui-slider-thumb:            var(--j0ui-core-text-muted); */
/*     --j0ui-slider-thumb: color-mix(in srgb, var(--j0ui-text-muted) 80%, transparent ); */
    
    --j0ui-slider-thumb-border:     rgba(0, 0, 0, 0.3);
    --j0ui-tab-indicator:           var(--j0ui-core-this-accent);
    --j0ui-window-inactive-opacity: 0.75;
    --j0ui-badge-bg:                color-mix(in srgb, var(--j0ui-core-text-main) 12%, transparent);
    --j0ui-badge-text:              var(--j0ui-core-text-muted);

}


html[data-theme="dark"]{
	/* ─── BROWSER NATIVE CONTROLS (DARK THEME) ───────────────────────── */
	--j0ui-color-scheme: dark;
	
    /* ─── SOMBRAS más fuertes para modo oscuro ───────────────────────── */
    --j0ui-shadow-window:        0 10px 30px rgba(0, 0, 0, 0.5);
    --j0ui-shadow-window-active: 0 16px 40px rgba(0, 0, 0, 0.75);
    --j0ui-shadow-menu:          0 4px 16px rgba(0, 0, 0, 0.5);
    --j0ui-shadow-item:          0 1px 2px rgba(0, 0, 0, 0.75);
    --j0ui-shadow-item-active:   0 1px 1px rgba(0, 0, 0, 0.75);
    --j0ui-shadow-track:         inset 0px 1px 1px rgba(0, 0, 0, 0.5);

    /* Ajustes físicos para percepción en fondos oscuros */
    --j0ui-slider-track-bg:      color-mix(in srgb, var(--j0ui-core-bg-field) 95%, var(--j0ui-core-text-main));
}


/* ─────────────────────────────────────────────────────────────────────────────
   ESCALA WEB — Página, login, formularios, artículos
   Default: fuera de j0-window
   ───────────────────────────────────────────────────────────────────────────── */
:root, .j0 {

    

    /* Métricas físicas web */
    --j0ui-size-input:      42px;
    --j0ui-size-header:     56px;
    --j0ui-radius:          var(--j0ui-core-radius, 8px);
    --j0ui-radius-sm:       calc(var(--j0ui-core-radius, 8px) / 1.6);
    --j0ui-space-sm:        12px;
    --j0ui-space-md:        20px;

    /* Espaciado semántico web — usado por c1720 y artículos */
    --j0-space-xs:          0.5rem;    /* 8px  */
    --j0-space-sm:          0.75rem;   /* 12px */
    --j0-space-md:          1.25rem;   /* 20px */
    --j0-space-lg:          2rem;      /* 32px */
    --j0-space-xl:          3rem;      /* 48px */
    --j0-space-2xl:         5rem;      /* 80px */

}


/* ─────────────────────────────────────────────────────────────────────────────
   ESCALA UI COMPACTA — Dentro de j0-window o con .j0ui-compact
   Paleta, inspector, herramientas, ventanas flotantes
   ───────────────────────────────────────────────────────────────────────────── */
j0-window,
.j0ui-compact {


    /* Métricas físicas compactas */
    --j0ui-size-input:      26px;
    --j0ui-size-header:     34px;
    --j0ui-radius:          calc(var(--j0ui-core-radius, 8px) * 0.75);
    --j0ui-radius-sm:       calc(var(--j0ui-core-radius, 8px) / 2.5);
    --j0ui-space-sm:        6px;
    --j0ui-space-md:        10px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   VENTANA INACTIVA
   ───────────────────────────────────────────────────────────────────────────── */
.j0ui-window-inactive {
    --j0ui-text-main:      var(--j0ui-text-secondary);
    --j0ui-text-secondary: var(--j0ui-text-muted);
    --j0ui-border-window:  var(--j0ui-border-subtle);
    --j0ui-bg-header:      var(--j0ui-bg-panel);
    opacity: var(--j0ui-window-inactive-opacity);
}
/* === Fuente: c0027-j0ui-browser-chrome.css === */
/* =============================================================================
   c0027-j0ui-browser-chrome.css
   CAPA "OS" — Estandarización de componentes nativos del navegador.
   Evita que Chrome/Safari inyecten fondos blancos, barras de sistema 
   o destellos nativos que rompan la identidad del framework.
   ============================================================================= */



/* 
  1. ROOT VIRTUAL Y W3C ESTÁNDAR
  Se aplica a :root o al contenedor inyectado (.j0)
*/

:root, .j0 {

	/* ─── SCROLLBAR tokens: en base a SLIDERS ────────────────────────────── */
	--j0ui-scrollbar-track-bg:		var(--j0ui-bg-window);
	--j0ui-scrollbar-thumb:			color-mix(in srgb, var(--j0ui-text-muted) 25%, transparent);
	--j0ui-scrollbar-thumb-hover:	color-mix(in srgb, var(--j0ui-text-muted) 60%, var(--j0ui-core-accent));
	--j0ui-scrollbar-thumb-active:	var(--j0ui-scrollbar-thumb-hover);

    /* Fuerza los controles internos (calendarios, dropdowns) al esquema actual */
    color-scheme: var(--j0ui-color-scheme, light);

    /* Scrollbars estándar (Firefox y navegadores modernos no-Blink) */
    scrollbar-color: var(--j0ui-scrollbar-thumb) var(--j0ui-scrollbar-track-bg);
    scrollbar-width: thin;

    /* Neutraliza el destello nativo al hacer tap en pantallas táctiles (Safari/Chrome Mobile) */
    -webkit-tap-highlight-color: transparent;
}

/* 
  2. MOTOR WEBKIT / BLINK (Chrome, Edge, Safari)
  Scopeado estrictamente a .j0 para no romper el DOM hostil si estamos inyectados.
*/
/* .j0  */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

/* .j0  */
::-webkit-scrollbar-track {
    background-color: var(--j0ui-scrollbar-track-bg);
}

/* .j0  */
::-webkit-scrollbar-thumb {
    background-color: var(--j0ui-scrollbar-thumb);
    /* Borde transparente para separar el thumb de los bordes del track */
    border: 3px solid var(--j0ui-scrollbar-track-bg);
    border-radius: 8px;
    background-clip: padding-box; 
}

/* .j0  */
::-webkit-scrollbar-thumb:hover {
    background-color: var(--j0ui-scrollbar-thumb-hover);
}

/* .j0  */
::-webkit-scrollbar-thumb:active {
    background-color: var(--j0ui-scrollbar-thumb-active);
}

/* .j0  */
::-webkit-scrollbar-corner {
    background-color: var(--j0ui-scrollbar-track-bg);
}


/* 
  3. PARCHE AUTOFILL WEBKIT
  Sobrescribe la inyección forzada de fondo blanco/amarillo en inputs autocompletados.
  Usamos el token derivado --j0ui-bg-input que mapea al core de field.
*/
/*
.j0 input:-webkit-autofill,
.j0 input:-webkit-autofill:hover, 
.j0 input:-webkit-autofill:focus, 
.j0 input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--j0ui-bg-input) inset !important;
    -webkit-text-fill-color: var(--j0ui-text-main) !important;

    transition: background-color 5000s ease-in-out 0s;
}
    Hack de transición infinita para demorar el re-pintado nativo
*/

/* === Fuente: c0104-j0ui-utils.css === */
/* =============================================================================
   c0070-j0ui-utils.css
   UTILIDADES — Visibilidad condicional por viewport y por tema.
   Agnóstico al producto. Sin prefijos fs- ni ix-.
   ============================================================================= */

/* ─── VIEWPORT ───────────────────────────────────────────────────────────────── */

/* Ocultar en desktop lo que es solo para móvil */
@media (min-width: 768px) {
    .j0ui-if-mobile     { display: none !important; }
}

/* Ocultar en móvil lo que NO es para móvil */
@media (max-width: 767px) {
    .j0ui-if-not-mobile { display: none !important; }
}

/* Ocultar en móvil y desktop lo que es solo para tablet */
@media (max-width: 767px), (min-width: 1025px) {
    .j0ui-if-tablet     { display: none !important; }
}

/* Ocultar en móvil/tablet lo que es solo para desktop */
@media (max-width: 1024px) {
    .j0ui-if-desktop    { display: none !important; }
}

/* Ocultar en desktop lo que NO es para desktop */
@media (min-width: 1025px) {
    .j0ui-if-not-desktop { display: none !important; }
}


/* ─── TEMA ───────────────────────────────────────────────────────────────────── */

/* Ocultar elementos dark cuando el tema es light */
html[data-theme="light"] .j0-show-dark  { display: none !important; }

/* Ocultar elementos light cuando el tema es dark (default) */
html:not([data-theme="light"]) .j0-show-light { display: none !important; }


/* ─── ACCESIBILIDAD GLOBAL ──────────────────────────────────────────────────── */
.j0ui-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
/* === Fuente: c0105-j0ui-theme-switch.css === */
/* =============================================================================
   c0105-j0ui-theme-switch.css
   THEME SWITCH — Toggle dark/light al estilo iOS/macOS.
   Package: 0100-j0ui-core--public-web (o 0020-j0-os--public-web)
   Problema: ACCIONAR

   Extraído de c3220-fs-theme-switch.css (producto FlowStyler).
   Agnóstico al producto — usa solo --j0ui-core-accent para el estado dark.

   Uso HTML:
     <j0-theme-switch>
       <div class="theme-pill" role="switch" aria-checked="false" tabindex="0">
         <span class="pill-icon pill-sun"  aria-hidden="true">☀️</span>
         <span class="pill-indicator"></span>
         <span class="pill-icon pill-moon" aria-hidden="true">🌙</span>
       </div>
     </j0-theme-switch>

   JS: escucha click en .theme-pill y togglea html[data-theme="light"].
   ============================================================================= */

j0-theme-switch {
    display:        inline-flex;
    align-items:    center;
    vertical-align: middle;
    width:          51px;
    height:         31px;
}

.theme-pill {
    position:   relative;
    display:    inline-flex;
    align-items: center;
    border-radius: 50px;
    padding:    2px;
    cursor:     pointer;
    user-select: none;
    width:      51px;
    height:     31px;
    box-sizing: border-box;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.theme-pill:focus-visible {
    outline:        2px solid var(--j0ui-core-accent);
    outline-offset: 2px;
}

.pill-indicator {
    position:      absolute;
    top:           1px;
    left:          1px;
    width:         27px;
    height:        27px;
    border-radius: 50%;
    z-index:       2;
    box-shadow:    0 1px 4px rgba(0, 0, 0, 0.35);
    transition:    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                   background 0.25s ease;
}

.pill-icon {
    position:        absolute;
    display:         flex;
    align-items:     center;
    justify-content: center;
    width:           24px;
    height:          24px;
    font-size:       13px;
    line-height:     1;
    z-index:         3;
    pointer-events:  none;
    transition:      opacity 0.2s ease;
}

.pill-sun  { left: 2px; }
.pill-moon { right: 2px; }


/* ─── MODO LIGHT ─────────────────────────────────────────────────────────────── */

html[data-theme="light"] .theme-pill {
    background: rgba(0, 0, 0, 0.10);
    border:     1px solid rgba(0, 0, 0, 0.10);
}

html[data-theme="light"] .pill-indicator { background: #ffffff; transform: translateX(0); }
html[data-theme="light"] .pill-sun       { opacity: 1.0; color: #FF9500; }
html[data-theme="light"] .pill-moon      { opacity: 0.3; color: rgba(0, 0, 0, 0.4); }


/* ─── MODO DARK ────────────────────────────────────────────────────── */

html:not([data-theme="light"]) .theme-pill {
    background: var(--j0ui-core-accent);
    border:     1px solid transparent;
}

html:not([data-theme="light"]) .pill-indicator { background: #ffffff; transform: translateX(20px); }
html:not([data-theme="light"]) .pill-sun       { opacity: 0.35; color: rgba(255, 255, 255, 0.8); }
html:not([data-theme="light"]) .pill-moon      { opacity: 1.0;  color: #ffffff; }

/* === Fuente: c0110-j0ui-buttons.css === */
/* =============================================================================
   c0110-j0ui-buttons.css
   BOTONES — Sistema completo de botones j0ui.
   Escala automática: web por default, compacta dentro de j0-window.
   ============================================================================= */

/* ─── BASE ───────────────────────────────────────────────────────────────────── */
.j0ui-btn {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    gap:             6px;
    height:          var(--j0ui-size-input);
    padding:         0 var(--j0ui-space-md);
    border-radius:   var(--j0ui-radius-sm);
    font-family:     var(--j0ui-font);
    font-size:       var(--j0ui-size-font-ui);
    font-weight:     500;
    cursor:          pointer;
    border:          1px solid transparent;
    transition:      background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
    white-space:     nowrap;
    box-sizing:      border-box;
	box-shadow: var(--j0ui-shadow-item);
}
.j0ui-btn:active{
	box-shadow: var(--j0ui-shadow-item-active);
	transform: translateY(1px);
}

.j0ui-btn:disabled,
.j0ui-btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* ─── VARIANTES ──────────────────────────────────────────────────────────────── */

.j0ui-btn--primary {
    background:   var(--j0ui-core-accent);
    color:        var(--j0ui-text-on-accent);
    border-color: var(--j0ui-core-accent);
}
.j0ui-btn--primary:hover {
    background:   color-mix(in srgb, var(--j0ui-core-accent) 85%, var(--j0ui-core-text-main) 15%);
    border-color: color-mix(in srgb, var(--j0ui-core-accent) 85%, var(--j0ui-core-text-main) 15%);
}

.j0ui-btn--ghost {
    background:   transparent;
    color:        var(--j0ui-text-main);
    border-color: var(--j0ui-border-input);
}
.j0ui-btn--ghost:hover {
    background:   var(--j0ui-bg-hover);
    border-color: var(--j0ui-border-window-active);
}

.j0ui-btn--danger {
    background:   var(--j0ui-danger);
    color:        var(--j0ui-text-on-danger);
    border-color: var(--j0ui-danger);
}
.j0ui-btn--danger:hover {
    background:   color-mix(in srgb, var(--j0ui-danger) 85%, #000 15%);
}

.j0ui-btn--outline {
    background:   transparent;
    color:        var(--j0ui-text-accent);
    border-color: var(--j0ui-core-accent);
}
.j0ui-btn--outline:hover {
    background: var(--j0ui-accent-bg);
}

/* ─── TAMAÑOS ────────────────────────────────────────────────────────────────── */
.j0ui-btn--sm {
    height:    calc(var(--j0ui-size-input) * 0.75);
    padding:   0 calc(var(--j0ui-space-md) * 0.7);
    font-size: var(--j0ui-size-font-sm);
}

.j0ui-btn--lg {
    height:    calc(var(--j0ui-size-input) * 1.25);
    padding:   0 calc(var(--j0ui-space-md) * 1.5);
    font-size: var(--j0ui-size-font-lg);
}

/* Ancho completo — para formularios web */
.j0ui-btn--block {
    width: 100%;
}

/* ─── LOADING STATE ──────────────────────────────────────────────────────────── */
.j0ui-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}
/* === Fuente: c0111-j0ui-primitives.css === */
/* =============================================================================
   c0110-j0ui-primitives.css
   Primer archivo del package 0110-j0ui-primitives.
   Primitivas Atómicas de UI y Carga.
   ============================================================================= */

/* ─── GRAPHIC SPINNER ───────────────────────────────────────────────────────── */
.j0ui-spinner {
    display:       inline-block;
    width:         var(--j0ui-spinner-size, 20px);
    height:        var(--j0ui-spinner-size, 20px);
    border:        2px solid var(--j0ui-border-subtle);
    border-top-color: var(--j0ui-core-accent);
    border-radius: 50%;
    animation:     j0ui-spin 0.7s linear infinite;
    flex-shrink:   0;
}

@keyframes j0ui-spin {
    to { transform: rotate(360deg); }
}

.j0ui-spinner--sm { --j0ui-spinner-size: 14px; }
.j0ui-spinner--lg { --j0ui-spinner-size: 32px; }

@media (prefers-reduced-motion: reduce) {
    .j0ui-spinner {
        animation-duration: 1.4s;
    }
}

/* ─── TEXT SPINNER (GHOST TEXT) ─────────────────────────────────────────────── */
/* Mantiene el ancho y alto del texto fallback original, animando 3 puntos por encima */
.j0ui-text-spinner {
    position: relative;
    display: inline-flex;
    align-items: center;
    /* [!] FIX: Hereda dinámicamente el color de texto del elemento padre (ej. blanco en btn primario) */
    color: currentColor; 
    opacity: 0.7; /* Opcional: lo hace ver sutilmente como "cargando" */
}

.j0ui-text-spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 2px;
    font-weight: bold;
    animation: j0ui-text-pulse 1.5s infinite steps(4, end);
}

@keyframes j0ui-text-pulse {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

/* Fallback visible ante fallo total (No CSS) -> <del> tachado nativo, pero nosotros lo ocultamos para sostener layout */
/* === Fuente: c0120-j0ui-layout.css === */
/* =============================================================================
   c0120-j0ui-layout.css
   LAYOUT — Container, Stack, Cluster, Split, Grid, Card, Panel.
   Package: 0120-j0ui-layout--public-web
   Problema: CONTENER
   ============================================================================= */

/* ─── CONTAINERS ─────────────────────────────────────────────────────────────── */

.j0ui-container {
    width:     100%;
    max-width: 680px;
    margin:    0 auto;
    padding:   0 var(--j0ui-space-md);
    box-sizing: border-box;
}

.j0ui-container-wide {
    width:     100%;
    max-width: 1024px;
    margin:    0 auto;
    padding:   0 var(--j0ui-space-md);
    box-sizing: border-box;
}

.j0ui-container-full {
    width:   100%;
    padding: 0 var(--j0ui-space-md);
    box-sizing: border-box;
}


/* ─── CONTAINER CON ASIDE RESERVADO ──────────────────────────────────────────
   Para páginas que reservan espacio a la derecha para un panel flotante
   (la paleta de FlowStyler, un inspector, lo que sea) sin centrar el
   contenido. Default: --j0-aside-width: 0 — el contenedor se comporta como
   uno neutro (login, registro, cualquier página sin panel flotante) sin que
   nadie tenga que pisar nada. El producto que sí necesita el hueco declara
   su propio ancho en su propio CSS de userland — el número mágico vive ahí,
   no acá.

   Ejemplo de uso real (reemplaza el cálculo a mano que hoy vive en
   c1721-fs-pages-2.css, .fs-article-constrained):

       :root { --j0-aside-width: 320px; }
       <div class="j0ui-container-aside">...</div>
   ────────────────────────────────────────────────────────────────────────── */

:root {
    --j0-aside-width:  0px;
    --j0-aside-gutter: 20px;
}

.j0ui-container-aside {
    width:      100%;
    max-width:  none;
    margin:     0;
    padding-left:  var(--j0ui-space-md);
    padding-right: calc(var(--j0-aside-width) + var(--j0-aside-gutter));
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .j0ui-container-aside {
        padding-left: 10vw;
    }
}


/* ─── STACK — columna con gap semántico ──────────────────────────────────────── */

.j0ui-stack {
    display:        flex;
    flex-direction: column;
    gap:            var(--j0ui-space-md);
}

.j0ui-stack-sm { gap: var(--j0ui-space-sm); }
.j0ui-stack-lg { gap: var(--j0ui-space-lg, 32px); }


/* ─── CLUSTER — fila con wrap ────────────────────────────────────────────────── */

.j0ui-cluster {
    display:   flex;
    flex-wrap: wrap;
    gap:       var(--j0ui-space-sm);
    align-items: center;
}

.j0ui-cluster-md { gap: var(--j0ui-space-md); }


/* ─── SPLIT — dos extremos ───────────────────────────────────────────────────── */

.j0ui-split {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    gap:             var(--j0ui-space-sm);
}

/* Baseline: útil para label + link "olvidé mi clave" en forms */
.j0ui-split-baseline {
    display:         flex;
    justify-content: space-between;
    align-items:     baseline;
    gap:             var(--j0ui-space-sm);
}


/* ─── GRID responsive ────────────────────────────────────────────────────────── */

.j0ui-grid {
    display:               grid;
    grid-template-columns: repeat(var(--j0ui-grid-cols, 2), 1fr);
    gap:                   var(--j0ui-space-md);
}

/* Variantes de columnas */
.j0ui-grid-1 { --j0ui-grid-cols: 1; }
.j0ui-grid-2 { --j0ui-grid-cols: 2; }
.j0ui-grid-3 { --j0ui-grid-cols: 3; }
.j0ui-grid-4 { --j0ui-grid-cols: 4; }

/* Auto-fit: columnas mínimas de 240px, tantas como quepan */
.j0ui-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Responsive: colapsa a 1 columna en mobile */
@media (max-width: 767px) {
    .j0ui-grid { --j0ui-grid-cols: 1; }
}


/* ─── CARD ───────────────────────────────────────────────────────────────────── */

.j0ui-card {
    background:    var(--j0ui-bg-window);
    border:        1px solid var(--j0ui-border-window);
    border-radius: var(--j0ui-radius);
    padding:       var(--j0ui-space-md);
    box-sizing:    border-box;
}

.j0ui-card-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    margin-bottom:   var(--j0ui-space-sm);
    padding-bottom:  var(--j0ui-space-sm);
    border-bottom:   1px solid var(--j0ui-border-subtle);
}

.j0ui-card-title {
    font-size:   var(--j0ui-size-font-lg);
    font-weight: 600;
    color:       var(--j0ui-text-main);
    margin:      0;
}

.j0ui-card-body {
    color:       var(--j0ui-text-main);
    font-size:   var(--j0ui-size-font-ui);
    line-height: 1.5;
}

.j0ui-card-footer {
    margin-top:  var(--j0ui-space-sm);
    padding-top: var(--j0ui-space-sm);
    border-top:  1px solid var(--j0ui-border-subtle);
    display:     flex;
    justify-content: flex-end;
    gap:         var(--j0ui-space-sm);
}

/* Elevada — sombra más pronunciada */
.j0ui-card-elevated {
    box-shadow: var(--j0ui-shadow-window);
}

/* Interactiva — hover con elevación */
.j0ui-card-interactive {
    cursor:     pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.j0ui-card-interactive:hover {
    border-color: var(--j0ui-border-window-active);
    box-shadow:   var(--j0ui-shadow-window);
}


/* ─── DIVIDER ────────────────────────────────────────────────────────────────── */

.j0ui-divider {
    border:     none;
    border-top: 1px solid var(--j0ui-border-subtle);
    margin:     var(--j0ui-space-sm) 0;
}

.j0ui-divider-vertical {
    border:       none;
    border-left:  1px solid var(--j0ui-border-subtle);
    align-self:   stretch;
    margin:       0 var(--j0ui-space-sm);
}


/* ─── UTILIDADES DE ESPACIADO ────────────────────────────────────────────────── */

.j0ui-mt-sm  { margin-top:    var(--j0ui-space-sm)  !important; }
.j0ui-mt-md  { margin-top:    var(--j0ui-space-md)  !important; }
.j0ui-mb-sm  { margin-bottom: var(--j0ui-space-sm)  !important; }
.j0ui-mb-md  { margin-bottom: var(--j0ui-space-md)  !important; }
.j0ui-mt-xs  { margin-top:    4px                   !important; }
.j0ui-mb-xs  { margin-bottom: 4px                   !important; }

.j0ui-p-sm   { padding: var(--j0ui-space-sm)  !important; }
.j0ui-p-md   { padding: var(--j0ui-space-md)  !important; }

.j0ui-w-full { width: 100% !important; }

/* Flex utilitarios usados en auth y otros contextos */
.j0ui-flex-col-gap-sm {
    display:        flex;
    flex-direction: column;
    gap:            var(--j0ui-space-sm);
}
.j0ui-row-split {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    gap:             var(--j0ui-space-sm);
}
.j0ui-row-center {
    display:         flex;
    justify-content: center;
    align-items:     center;
}
.j0ui-row-align-sm {
    display:     flex;
    align-items: center;
    gap:         var(--j0ui-space-sm);
}

/* === Fuente: c0121-j0-grid.css === */
/* =============================================================================
   c0121-j0-grid.css
   SISTEMA DE GRILLA UNIVERSAL — 12 Columnas CSS Grid
   Namespace .j0- para uso global (UI y CMS).

   Self-contained: define su propio gutter, no depende de que el framework
   j0ui esté cargado — .j0- es universal (UI + web/editorial), no puede
   requerir tokens de --j0ui-* para renderizar con espaciado razonable.
   Mobile-first: .j0-col-N sin prefijo aplica desde el mínimo ancho, se pisa
   hacia arriba con -md-/-lg-. Para stackear en mobile, usar j0-col-12 como
   base y agregar el prefijo que corresponda para desktop.
   ============================================================================= */

:root {
    --j0-grid-gutter: 24px;
}

.j0-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--j0-grid-gutter);
}

.j0-col-auto { grid-column: auto; }

.j0-col-1 { grid-column: span 1; }
.j0-col-2 { grid-column: span 2; }
.j0-col-3 { grid-column: span 3; }
.j0-col-4 { grid-column: span 4; }
.j0-col-5 { grid-column: span 5; }
.j0-col-6 { grid-column: span 6; }
.j0-col-7 { grid-column: span 7; }
.j0-col-8 { grid-column: span 8; }
.j0-col-9 { grid-column: span 9; }
.j0-col-10 { grid-column: span 10; }
.j0-col-11 { grid-column: span 11; }
.j0-col-12 { grid-column: span 12; }

@media (min-width: 768px) {
    .j0-col-md-1 { grid-column: span 1; }
    .j0-col-md-2 { grid-column: span 2; }
    .j0-col-md-3 { grid-column: span 3; }
    .j0-col-md-4 { grid-column: span 4; }
    .j0-col-md-5 { grid-column: span 5; }
    .j0-col-md-6 { grid-column: span 6; }
    .j0-col-md-7 { grid-column: span 7; }
    .j0-col-md-8 { grid-column: span 8; }
    .j0-col-md-9 { grid-column: span 9; }
    .j0-col-md-10 { grid-column: span 10; }
    .j0-col-md-11 { grid-column: span 11; }
    .j0-col-md-12 { grid-column: span 12; }
}

@media (min-width: 1024px) {
    .j0-col-lg-1 { grid-column: span 1; }
    .j0-col-lg-2 { grid-column: span 2; }
    .j0-col-lg-3 { grid-column: span 3; }
    .j0-col-lg-4 { grid-column: span 4; }
    .j0-col-lg-5 { grid-column: span 5; }
    .j0-col-lg-6 { grid-column: span 6; }
    .j0-col-lg-7 { grid-column: span 7; }
    .j0-col-lg-8 { grid-column: span 8; }
    .j0-col-lg-9 { grid-column: span 9; }
    .j0-col-lg-10 { grid-column: span 10; }
    .j0-col-lg-11 { grid-column: span 11; }
    .j0-col-lg-12 { grid-column: span 12; }
}
/* === Fuente: c0130-j0ui-alerts.css === */
/* ─── ALERTS INLINE ─────────────────────────────────────────────────────────── */
.j0ui-alert-inline { padding: 10px var(--j0ui-space-sm); border-radius: var(--j0ui-radius-sm); font-size: var(--j0ui-size-font-sm); line-height: 1.4; border: 1px solid transparent; background: var(--j0ui-accent-bg); color: var(--j0ui-text-main); }
.j0ui-alert-danger { background: color-mix(in srgb, var(--j0ui-danger) 12%, transparent); border-color: color-mix(in srgb, var(--j0ui-danger) 40%, transparent); color: var(--j0ui-danger); }
.j0ui-alert-success { background: color-mix(in srgb, var(--j0ui-success, var(--j0ui-core-accent)) 12%, transparent); border-color: color-mix(in srgb, var(--j0ui-success, var(--j0ui-core-accent)) 40%, transparent); color: var(--j0ui-success, var(--j0ui-text-accent)); }
.j0ui-alert-warning { background: color-mix(in srgb, var(--j0ui-warning) 12%, transparent); border-color: color-mix(in srgb, var(--j0ui-warning) 40%, transparent); color: var(--j0ui-warning); }
/* === Fuente: c0130-j0ui-form-disclosures.css === */
/* ─── NATIVE DISCLOSURE (Accordions en formularios) ─────────────────────────── */
.j0ui-form-disclosure > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
}
.j0ui-form-disclosure > summary::-webkit-details-marker {
    display: none;
}
.j0ui-form-disclosure[open] > summary .j0ui-tree-chevron {
    transform: rotate(90deg);
}
.j0ui-form-disclosure-body {
    margin-top: 8px;
}
/* === Fuente: c0130-j0ui-inputs.css === */
/* ─── FIELD GROUP & LABELS ──────────────────────────────────────────────────── */
.j0ui-field-group { display: flex; flex-direction: column; gap: var(--j0ui-space-sm); width: 100%; }
.j0ui-lbl { display: block; font-size: var(--j0ui-size-font-sm); font-weight: 500; color: var(--j0ui-text-main); margin-bottom: 4px; }
.j0ui-lbl-value-muted { display: block; font-size: var(--j0ui-size-font-sm); font-weight: 500; color: var(--j0ui-text-muted); margin-bottom: 4px; }

/* ─── INPUT TEXT (text, email, etc.) ────────────────────────────────────────── */
.j0ui-input-text {
	display: block; width: 100%; height: var(--j0ui-size-input); padding: 0 var(--j0ui-space-sm); background: var(--j0ui-bg-input); border: 1px solid var(--j0ui-border-input); border-radius: var(--j0ui-radius-sm); color: var(--j0ui-text-main); font-family: var(--j0ui-font); font-size: var(--j0ui-size-font-ui); outline: none; box-sizing: border-box; transition: border-color 0.15s, background 0.15s; appearance: none; -webkit-appearance: none; 
}

INPUT.j0ui-input-text {
	box-shadow: var(--j0ui-shadow-track);
}

SELECT.j0ui-input-text {
	box-shadow: var(--j0ui-shadow-item);
}


.j0ui-input-text::placeholder { color: var(--j0ui-text-muted); opacity: 0.6; }
.j0ui-input-text:hover { border-color: var(--j0ui-border-window-active); }
.j0ui-input-text:focus { border-color: var(--j0ui-border-input-focus); background: var(--j0ui-bg-input-focus); }
.j0ui-input-text:disabled { opacity: 0.45; cursor: not-allowed; }
.j0ui-input-text.is-invalid, .j0ui-input-text[aria-invalid="true"] { border-color: var(--j0ui-danger); }
/* === Fuente: c0130-j0ui-password.css === */
/* ─── PASSWORD WRAP & TOGGLE ────────────────────────────────────────────────── */
.j0ui-password-wrap {
	position: relative; display: flex; align-items: center;
	box-shadow: var(--j0ui-shadow-track);
}
.j0ui-password-wrap .j0ui-input-text { padding-right: 44px; }
.j0ui-password-toggle { position: absolute; right: 0; top: 0; height: 100%; width: 40px; background: transparent; border: none; color: var(--j0ui-text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: color 0.15s; }
.j0ui-password-toggle:hover { color: var(--j0ui-text-main); }

/* ─── ALAVESA: PASSWORD REQUIREMENTS LIST ───────────────────────────────────── */
.j0ui-pwd-req-list { margin-top: 8px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.j0ui-pwd-req-item { font-size: var(--j0ui-size-font-micro); color: var(--j0ui-text-muted); display: flex; align-items: center; gap: 6px; transition: color 0.2s ease; }
.j0ui-pwd-req-icon { font-size: 10px; width: 14px; text-align: center; font-weight: bold; }
.j0ui-pwd-req-item[data-met="false"] .j0ui-pwd-req-icon::before { content: "○"; opacity: 0.5; }
.j0ui-pwd-req-item[data-met="true"] { color: var(--j0ui-success, #40c057); }
.j0ui-pwd-req-item[data-met="true"] .j0ui-pwd-req-icon::before { content: "✓"; }
/* === Fuente: c0131-j0ui-forms-icons.css === */
/* ─── ICONOGRAFÍA DEL SISTEMA (Default OS) ───────────────────────────────────── */
.j0ui-icon {
    font-style: normal;
    font-variant: normal;
    font-weight: normal;
    text-transform: none;
    line-height: 1;
    display: inline-block;
}

.j0ui-icon-eye::before {
    content: "👁";
}

.j0ui-icon-eye-slash::before {
    content: "🙈";
}

.j0ui-icon[hidden] {
    display: none !important;
}
/* === Fuente: c0132-j0ui-forms-additions.css === */
/* =============================================================================
   ADICIONES A c0058-j0ui-forms-web.css — Sprint 1
   Agregar al final del archivo existente.
   ============================================================================= */


/* ─── PASSWORD STRENGTH METER ────────────────────────────────────────────────── */

.j0ui-pwd-strength {
    margin-top: 6px;
    display:    flex;
    flex-direction: column;
    gap: 4px;
}

.j0ui-pwd-strength-bar {
    height:        4px;
    background:    var(--j0ui-border-subtle);
    border-radius: 2px;
    overflow:      hidden;
}

.j0ui-pwd-strength-fill {
    height:     100%;
    width:      0;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
    background: var(--j0ui-danger);
}

.j0ui-pwd-strength-fill[data-level="1"] { background: var(--j0ui-danger); }
.j0ui-pwd-strength-fill[data-level="2"] { background: var(--j0ui-warning); }
.j0ui-pwd-strength-fill[data-level="3"] { background: var(--j0ui-warning); }
.j0ui-pwd-strength-fill[data-level="4"] { background: var(--j0ui-success); }
.j0ui-pwd-strength-fill[data-level="5"] { background: var(--j0ui-success); }

.j0ui-pwd-strength-label {
    font-size: var(--j0ui-size-font-micro);
    color:     var(--j0ui-text-muted);
}


/* ─── TEXTAREA ───────────────────────────────────────────────────────────────── */

.j0ui-textarea-wrap {
    position: relative;
}

.j0ui-textarea {
    display:       block;
    width:         100%;
    min-height:    calc(var(--j0ui-size-input) * 3);
    padding:       var(--j0ui-space-sm);
    background:    var(--j0ui-bg-input);
    border:        1px solid var(--j0ui-border-input);
    border-radius: var(--j0ui-radius-sm);
    color:         var(--j0ui-text-main);
    font-family:   var(--j0ui-font);
    font-size:     var(--j0ui-size-font-ui);
    line-height:   1.5;
    resize:        vertical;
    outline:       none;
    box-sizing:    border-box;
    transition:    border-color 0.15s, background 0.15s;
}

.j0ui-textarea::placeholder { color: var(--j0ui-text-muted); opacity: 0.6; }
.j0ui-textarea:hover { border-color: var(--j0ui-border-window-active); }
.j0ui-textarea:focus { border-color: var(--j0ui-border-input-focus); background: var(--j0ui-bg-input-focus); }
.j0ui-textarea:disabled { opacity: 0.45; cursor: not-allowed; }

.j0ui-char-count {
    display:    block;
    text-align: right;
    margin-top: 4px;
    font-size:  var(--j0ui-size-font-micro);
    color:      var(--j0ui-text-muted);
}

.j0ui-char-count.is-near-limit { color: var(--j0ui-warning); }
.j0ui-char-count.is-at-limit   { color: var(--j0ui-danger); font-weight: 600; }


/* ─── CHECKBOX ───────────────────────────────────────────────────────────────── */

.j0ui-checkbox-wrap {
    display:     flex;
    align-items: center;
    gap:         8px;
    cursor:      pointer;
    user-select: none;
}

.j0ui-checkbox-input {
    position: absolute;
    opacity:  0;
    width:    1px;
    height:   1px;
}

.j0ui-checkbox-track {
    position:        relative;
    width:           18px;
    height:          18px;
    flex-shrink:     0;
    background:      var(--j0ui-bg-input);
    border:          1px solid var(--j0ui-border-input);
    border-radius:   4px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    transition:      background 0.15s, border-color 0.15s;
	box-shadow: var(--j0ui-shadow-track);
}

.j0ui-checkbox-mark {
    width:   10px;
    height:  10px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.12s, transform 0.12s;
}

.j0ui-checkbox-mark::before {
    content: '';
    display: block;
    width:   100%;
    height:  100%;
    background: var(--j0ui-text-on-accent);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.j0ui-checkbox-input:checked ~ .j0ui-checkbox-track {
    background:   var(--j0ui-core-accent);
    border-color: var(--j0ui-core-accent);
}

.j0ui-checkbox-input:checked ~ .j0ui-checkbox-track .j0ui-checkbox-mark {
    opacity:   1;
    transform: scale(1);
}

.j0ui-checkbox-input:indeterminate ~ .j0ui-checkbox-track {
    background:   var(--j0ui-accent-bg);
    border-color: var(--j0ui-core-accent);
}

.j0ui-checkbox-input:indeterminate ~ .j0ui-checkbox-track::after {
    content:    '';
    position:   absolute;
    width:      10px;
    height:     2px;
    background: var(--j0ui-core-accent);
    border-radius: 1px;
}

.j0ui-checkbox-input:focus-visible ~ .j0ui-checkbox-track {
    outline:        2px solid var(--j0ui-core-accent);
    outline-offset: 2px;
}

.j0ui-checkbox-label {
    font-size: var(--j0ui-size-font-ui);
    color:     var(--j0ui-text-main);
}


/* ─── UTILIDAD: SCREEN READER ONLY ───────────────────────────────────────────── */

.j0ui-sr-only {
    position: absolute;
    width:    1px;
    height:   1px;
    padding:  0;
    margin:   -1px;
    overflow: hidden;
    clip:     rect(0, 0, 0, 0);
    white-space: nowrap;
    border:   0;
}

/* === Fuente: c0133-j0ui-select-radio.css === */
/* =============================================================================
   c0133-j0ui-select-radio.css
   SELECT estilizado y RADIO BUTTON.
   Package: 0130-j0ui-forms--public-web
   ============================================================================= */

/* ─── SELECT ─────────────────────────────────────────────────────────────────── */

.j0ui-select {
    display:        block;
    width:          100%;
    height:         var(--j0ui-size-input);
    padding:        0 2.5em 0 var(--j0ui-space-sm);
    background:     var(--j0ui-bg-input);
    border:         1px solid var(--j0ui-border-input);
    border-radius:  var(--j0ui-radius-sm);
    color:          var(--j0ui-text-main);
    font-family:    var(--j0ui-font);
    font-size:      var(--j0ui-size-font-ui);
    outline:        none;
    box-sizing:     border-box;
    cursor:         pointer;
    appearance:     none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat:   no-repeat;
    background-position: right var(--j0ui-space-sm) center;
    transition:     border-color 0.15s, background-color 0.15s;
	box-shadow: var(--j0ui-shadow-item);
}

.j0ui-select:hover    { border-color: var(--j0ui-border-window-active); }
.j0ui-select:focus    { border-color: var(--j0ui-border-input-focus); background-color: var(--j0ui-bg-input-focus); }
.j0ui-select:disabled { opacity: 0.45; cursor: not-allowed; }


/* ─── RADIO ──────────────────────────────────────────────────────────────────── */

.j0ui-radio-wrap {
    display:     flex;
    align-items: center;
    gap:         8px;
    cursor:      pointer;
    user-select: none;
}

.j0ui-radio-input {
    position: absolute;
    opacity:  0;
    width:    1px;
    height:   1px;
}

.j0ui-radio-track {
    width:        18px;
    height:       18px;
    flex-shrink:  0;
    background:   var(--j0ui-bg-input);
    border:       1px solid var(--j0ui-border-input);
    border-radius: 50%;
    display:      flex;
    align-items:  center;
    justify-content: center;
    transition:   background 0.15s, border-color 0.15s;
	box-shadow: var(--j0ui-shadow-item);
}

.j0ui-radio-dot {
    width:        8px;
    height:       8px;
    border-radius: 50%;
    background:   var(--j0ui-text-on-accent);
    opacity:      0;
    transform:    scale(0.4);
    transition:   opacity 0.12s, transform 0.12s;
}

.j0ui-radio-input:checked ~ .j0ui-radio-track {
    background:   var(--j0ui-core-accent);
    border-color: var(--j0ui-core-accent);
}

.j0ui-radio-input:checked ~ .j0ui-radio-track .j0ui-radio-dot {
    opacity:   1;
    transform: scale(1);
}

.j0ui-radio-input:focus-visible ~ .j0ui-radio-track {
    outline:        2px solid var(--j0ui-core-accent);
    outline-offset: 2px;
}

.j0ui-radio-label {
    font-size: var(--j0ui-size-font-ui);
    color:     var(--j0ui-text-main);
}

/* Grupo de radios — stack vertical con gap */
.j0ui-radio-group {
    display:        flex;
    flex-direction: column;
    gap:            var(--j0ui-space-sm);
}

/* === Fuente: c0134-j0ui-select-custom.css === */
/* =============================================================================
   c0134-j0ui-select-custom.css
   SELECT CUSTOM — Dropdown como control de formulario con búsqueda.
   Reemplaza <select> nativo con experiencia enriquecida.
   Serializa via <input type="hidden"> — compatible con POST nativo.
   Package: 0130-j0ui-forms--public-web
   Problema: CAPTURAR
   ============================================================================= */

.j0ui-select-custom {
    position:    relative;
    width:       100%;
    user-select: none;
}

/* Trigger — similar a j0ui-input-text pero con flecha */
.j0ui-select-custom-trigger {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    width:           100%;
    height:          var(--j0ui-size-input);
    padding:         0 var(--j0ui-space-sm);
    background:      var(--j0ui-bg-input);
    border:          1px solid var(--j0ui-border-input);
    border-radius:   var(--j0ui-radius-sm);
    color:           var(--j0ui-text-main);
    font-family:     var(--j0ui-font);
    font-size:       var(--j0ui-size-font-ui);
    cursor:          pointer;
    box-sizing:      border-box;
    transition:      border-color 0.15s;
	box-shadow: var(--j0ui-shadow-item);
}

.j0ui-select-custom-trigger:hover { border-color: var(--j0ui-border-window-active); }

.j0ui-select-custom.is-open .j0ui-select-custom-trigger {
    border-color: var(--j0ui-border-input-focus);
    border-radius: var(--j0ui-radius-sm) var(--j0ui-radius-sm) 0 0;
}

.j0ui-select-custom-label {
    flex-grow:   1;
    overflow:    hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.j0ui-select-custom-label.is-placeholder { color: var(--j0ui-text-muted); }

.j0ui-select-custom-arrow {
    flex-shrink: 0;
    font-size:   10px;
    color:       var(--j0ui-text-muted);
    transition:  transform 0.2s;
    margin-left: 6px;
}
.j0ui-select-custom.is-open .j0ui-select-custom-arrow { transform: rotate(180deg); }

/* Menú desplegable (Teleport-safe) */
.j0ui-select-custom-menu {
    position:      absolute;
    top:           100%;
    left:          0;
    right:         0;
    background:    var(--j0ui-bg-window);
    border:        1px solid var(--j0ui-border-input-focus);
    border-top:    none;
    border-radius: 0 0 var(--j0ui-radius-sm) var(--j0ui-radius-sm);
    box-shadow:    var(--j0ui-shadow-menu);
    z-index:       var(--j0ui-z-menu, 90000);
    display:       none; /* JS controla el display: block al hacer teleport */
    overflow:      hidden;
}

/* Búsqueda */
.j0ui-select-custom-search {
    display:     block;
    width:       100%;
    padding:     6px var(--j0ui-space-sm);
    background:  var(--j0ui-bg-input);
    border:      none;
    border-bottom: 1px solid var(--j0ui-border-subtle);
    color:       var(--j0ui-text-main);
    font-family: var(--j0ui-font);
    font-size:   var(--j0ui-size-font-ui);
    outline:     none;
    box-sizing:  border-box;
}

/* Lista de opciones */
.j0ui-select-custom-list {
    max-height:  200px;
    overflow-y:  auto;
    scrollbar-width: thin;
    padding:     4px;
}

.j0ui-select-custom-option {
    padding:       5px var(--j0ui-space-sm);
    border-radius: 2px;
    cursor:        pointer;
    font-size:     var(--j0ui-size-font-ui);
    color:         var(--j0ui-text-main);
    transition:    background 0.1s;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
}

.j0ui-select-custom-option:hover           { background: var(--j0ui-bg-hover); }
.j0ui-select-custom-option.is-selected     { color: var(--j0ui-core-accent); font-weight: 500; }
.j0ui-select-custom-option.is-focused      { background: var(--j0ui-bg-hover); }
.j0ui-select-custom-option.is-hidden       { display: none; }
.j0ui-select-custom-option.is-disabled     { opacity: 0.4; pointer-events: none; }

.j0ui-select-custom-empty {
    padding:   10px var(--j0ui-space-sm);
    color:     var(--j0ui-text-muted);
    font-size: var(--j0ui-size-font-sm);
    text-align: center;
}
/* === Fuente: c0135-j0ui-file-drop.css === */
/* =============================================================================
   c0135-j0ui-file-drop.css
   FILE DROP AREA — Zona de drop para archivos con input file interno.
   Package: 0130-j0ui-forms--public-web
   Problema: CAPTURAR

   Si está activa y es la única drop zone, captura drops en toda la ventana.
   ============================================================================= */

.j0ui-file-drop {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    justify-content: center;
    gap:            var(--j0ui-space-sm);
    padding:        var(--j0ui-space-lg, 32px) var(--j0ui-space-md);
    background:     var(--j0ui-bg-input);
    border:         2px dashed var(--j0ui-border-input);
    border-radius:  var(--j0ui-radius);
    cursor:         pointer;
    text-align:     center;
    transition:     border-color 0.15s, background 0.15s;
    position:       relative;
	box-shadow: var(--j0ui-shadow-track);
}

.j0ui-file-drop:hover,
.j0ui-file-drop.is-dragover {
    border-color: var(--j0ui-core-accent);
    background:   var(--j0ui-accent-bg);
}

.j0ui-file-drop.is-dragover {
    border-style: solid;
}

/* Input file oculto — el click en el área lo activa */
.j0ui-file-drop-input {
    position: absolute;
    inset:    0;
    opacity:  0;
    cursor:   pointer;
    width:    100%;
    height:   100%;
}

.j0ui-file-drop-icon {
    font-size: 32px;
    color:     var(--j0ui-text-muted);
    line-height: 1;
}

.j0ui-file-drop-label {
    font-size:   var(--j0ui-size-font-ui);
    color:       var(--j0ui-text-main);
    font-weight: 500;
}

.j0ui-file-drop-hint {
    font-size: var(--j0ui-size-font-sm);
    color:     var(--j0ui-text-muted);
}

.j0ui-file-drop-files {
    width:      100%;
    margin-top: var(--j0ui-space-sm);
    display:    flex;
    flex-direction: column;
    gap:        4px;
}

.j0ui-file-drop-file {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         4px 8px;
    background:      var(--j0ui-bg-hover);
    border-radius:   var(--j0ui-radius-sm);
    font-size:       var(--j0ui-size-font-sm);
    color:           var(--j0ui-text-main);
}

.j0ui-file-drop-file-name  { flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.j0ui-file-drop-file-size  { color: var(--j0ui-text-muted); flex-shrink: 0; margin-left: 8px; }
.j0ui-file-drop-file-remove {
    background:  transparent;
    border:      none;
    color:       var(--j0ui-text-muted);
    cursor:      pointer;
    font-size:   14px;
    flex-shrink: 0;
    padding:     0 0 0 8px;
}
.j0ui-file-drop-file-remove:hover { color: var(--j0ui-danger); }

/* === Fuente: c0136-j0ui-inputs-extra.css === */
/* =============================================================================
   c0136-j0ui-inputs-extra.css
   NUMBER STEPPER y SEARCH INPUT
   Package: 0130-j0ui-forms--public-web
   ============================================================================= */

/* ─── NUMBER STEPPER ─────────────────────────────────────────────────────────── */

.j0ui-stepper {
    display:        flex;
    align-items:    center;
    background:     var(--j0ui-bg-input);
    border:         1px solid var(--j0ui-border-input);
    border-radius:  var(--j0ui-radius-sm);
    overflow:       hidden;
    width:          fit-content;
    transition:     border-color 0.15s;
	box-shadow: var(--j0ui-shadow-item);
}

.j0ui-stepper:focus-within { border-color: var(--j0ui-border-input-focus); }

.j0ui-stepper-btn {
    width:           var(--j0ui-size-input);
    height:          var(--j0ui-size-input);
    background:      transparent;
    border:          none;
    color:           var(--j0ui-text-muted);
    font-size:       18px;
    cursor:          pointer;
    display:         flex;
    align-items:     center;
    justify-content: center;
    flex-shrink:     0;
    transition:      background 0.1s, color 0.1s;
    user-select:     none;
}

.j0ui-stepper-btn:hover    { background: var(--j0ui-bg-hover); color: var(--j0ui-text-main); }
.j0ui-stepper-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.j0ui-stepper-input {
    width:       60px;
    height:      var(--j0ui-size-input);
    background:  transparent;
    border:      none;
    border-left: 1px solid var(--j0ui-border-subtle);
    border-right: 1px solid var(--j0ui-border-subtle);
    color:       var(--j0ui-text-main);
    font-family: var(--j0ui-font-mono);
    font-size:   var(--j0ui-size-font-ui);
    text-align:  center;
    outline:     none;
    -moz-appearance: textfield;
    appearance:  textfield;
}

.j0ui-stepper-input::-webkit-inner-spin-button,
.j0ui-stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; }


/* ─── SEARCH INPUT ───────────────────────────────────────────────────────────── */

.j0ui-search-wrap {
    position:   relative;
    display:    flex;
    align-items: center;
    width:      100%;
}

.j0ui-search-icon {
    position:    absolute;
    left:        var(--j0ui-space-sm);
    /* color:       var(--j0ui-text-muted); */
    font-size:   14px;
    pointer-events: none;
    line-height: 1;
}

.j0ui-search-input {
    width:         100%;
    height:        var(--j0ui-size-input);
    padding-left:  calc(var(--j0ui-space-sm) * 2 + 14px);
    padding-right: calc(var(--j0ui-space-sm) * 2 + 14px);
    background:    var(--j0ui-bg-input);
    border:        1px solid var(--j0ui-border-input);
    border-radius: var(--j0ui-radius-sm);
    color:         var(--j0ui-text-main);
    font-family:   var(--j0ui-font);
    font-size:     var(--j0ui-size-font-ui);
    outline:       none;
    box-sizing:    border-box;
    transition:    border-color 0.15s;
	box-shadow: var(--j0ui-shadow-track);
}

.j0ui-search-input::placeholder { color: var(--j0ui-text-muted); opacity: 0.6; }
.j0ui-search-input:focus { border-color: var(--j0ui-border-input-focus); }

.j0ui-search-clear {
    position:    absolute;
    right:       var(--j0ui-space-sm);
    background:  transparent;
    border:      none;
    color:       var(--j0ui-text-muted);
    cursor:      pointer;
    font-size:   16px;
    line-height: 1;
    padding:     0;
    display:     none;
    transition:  color 0.15s;
}

.j0ui-search-clear:hover { color: var(--j0ui-text-main); }
.j0ui-search-wrap.has-value .j0ui-search-clear { display: block; }




/* =============================================================================
   Color Input Molécula
   ============================================================================= */

.j0ui-color-input-wrap {
    display: flex;
    align-items: center;
    gap: var(--j0ui-space-sm);
}

.j0ui-color-swatch-container {
    position: relative;
    width: var(--j0ui-size-input);
    height: var(--j0ui-size-input);
    border-radius: var(--j0ui-radius-sm);
    border: 1px solid var(--j0ui-border-input);
    background: var(--j0ui-bg-input);
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.j0ui-color-swatch-container:hover,
.j0ui-color-swatch-container:focus-within {
    border-color: var(--j0ui-border-window-active);
}

.j0ui-color-swatch-indicator {
    position: absolute;
    inset: 3px;
    border-radius: calc(var(--j0ui-radius-sm) - 3px);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
    pointer-events: none; /* Crítico: deja que el click pase al input nativo */
}

.j0ui-color-native-hidden {
    position: absolute;
    inset: -10px; /* Expansión para evitar bordes muertos en WebKit */
    opacity: 0;
    cursor: pointer;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    padding: 0;
    border: none;
}
/* === Fuente: c0136-search-fix.css === */
/* Agregar a c0136-j0ui-inputs-extra.css — suprimir clear nativo de Chrome/Safari */
.j0ui-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* === Fuente: c0137-j0ui-input-group.css === */
/* =============================================================================
   c0130-j0ui-input-group.css
   INPUT GROUP — input + addon de texto + botón, combinables en cualquier
   orden y cantidad (equivalente a Bootstrap input-group).
   Package: 0130-j0ui-forms

   No redefine .j0ui-input ni .j0ui-btn — solo gestiona los bordes/radios de
   contacto entre lo que sea que el grupo contenga. Por eso funciona igual
   con un addon de texto, un botón, dos botones, o dos inputs.
   ============================================================================= */

.j0ui-input-group {
    display:      flex;
    align-items:  stretch;
    width:        100%;
}

/* Todo hijo directo pierde su radio — se lo devolvemos solo a las puntas */
.j0ui-input-group > .j0ui-input,
.j0ui-input-group > .j0ui-btn,
.j0ui-input-group > .j0ui-input-group-text {
    position:      relative;
    border-radius: 0;
    margin-left:   -1px;   /* solapa el borde de 1px contra el vecino, sin doble línea */
}

.j0ui-input-group > :first-child {
    margin-left:              0;
    border-top-left-radius:   var(--j0ui-radius-sm);
    border-bottom-left-radius: var(--j0ui-radius-sm);
}

.j0ui-input-group > :last-child {
    border-top-right-radius:    var(--j0ui-radius-sm);
    border-bottom-right-radius: var(--j0ui-radius-sm);
}

/* El/los input(s) del grupo ocupan el espacio disponible; addons y botones
   se achican a su contenido */
.j0ui-input-group > .j0ui-input {
    flex:     1 1 auto;
    min-width: 0;   /* evita que un placeholder largo empuje el ancho del grupo */
}

.j0ui-input-group > .j0ui-btn,
.j0ui-input-group > .j0ui-input-group-text {
    flex:        0 0 auto;
    white-space: nowrap;
}

/* Al enfocar/hacer hover, el borde del elemento activo tiene que dibujarse
   ENCIMA del vecino — si no, el solapamiento de -1px lo tapa */
.j0ui-input-group > .j0ui-input:focus,
.j0ui-input-group > .j0ui-btn:focus,
.j0ui-input-group > .j0ui-btn:hover {
    z-index: 3;
}

/* ─── ADDON DE TEXTO — "@", "$", "https://...", etc. ────────────────────────── */

.j0ui-input-group-text {
    display:      inline-flex;
    align-items:  center;
    height:       var(--j0ui-size-input);
    padding:      0 var(--j0ui-space-sm);
    box-sizing:   border-box;
    background:   var(--j0ui-bg-field);
    border:       1px solid var(--j0ui-border-input);
    color:        var(--j0ui-text-muted);
    font-size:    var(--j0ui-size-font-ui);
}

/* ─── AYUDA FUERA DEL GRUPO — igual que Bootstrap's .form-text ──────────────── */

.j0ui-input-group + .j0ui-form-text,
.j0ui-form-text {
    display:   block;
    margin-top: 4px;
    font-size: var(--j0ui-size-font-sm);
    color:     var(--j0ui-text-muted);
}

/* === Fuente: c0140-j0ui-tabs.css === */
/* =============================================================================
   c0140-j0ui-tabs.css
   TABS — Navegación horizontal entre paneles.
   Package: 0140-j0ui-navigation--public-web
   Problema: NAVEGAR

   Variantes de presentación del tab item:
     default          → solo texto
     .has-icon        → icono + texto (horizontal)
     .has-icon-stack  → icono arriba + texto abajo (estilo paleta FlowStyler)
     .icon-only       → solo icono (sin texto)

   Overflow cuando los tabs no entran:
     .j0ui-tabs-row[data-overflow="scroll"]   → scroll horizontal silencioso
     .j0ui-tabs-row[data-overflow="menu"]     → botón … con dropdown
     default (sin atributo)                  → scroll + botón … combinados
   ============================================================================= */

/* ─── TAB ROW ────────────────────────────────────────────────────────────────── */

.j0ui-tabs-row {
    display:        flex;
    align-items:    stretch;
    border-bottom:  1px solid var(--j0ui-border-subtle);
    background:     var(--j0ui-bg-panel);
    flex-shrink:    0;
    overflow-x:     auto;
    scrollbar-width: none;
    position:       relative;
}
.j0ui-tabs-row::-webkit-scrollbar { display: none; }


/* ─── TAB ITEM — base ────────────────────────────────────────────────────────── */

.j0ui-tab-item {
    display:        flex;
    align-items:    center;
    justify-content: center;
    gap:            6px;
    padding:        0 12px;
    height:         var(--j0ui-size-input);
    font-size:      var(--j0ui-size-font-ui);
    font-weight:    500;
    color:          var(--j0ui-text-muted);
    border-bottom:  2px solid transparent;
    cursor:         pointer;
    white-space:    nowrap;
    user-select:    none;
    flex-shrink:    0;
    position:       relative;
    bottom:         -1px;
    transition:     color 0.15s, border-color 0.15s, background 0.15s;
}

.j0ui-tab-item:hover   { color: var(--j0ui-text-main); }

.j0ui-tab-item.j0ui-active {
    color:              var(--j0ui-text-main);
    border-bottom-color: var(--j0ui-tab-indicator, var(--j0ui-core-accent));
}


/* ─── VARIANTE: icono + texto horizontal ─────────────────────────────────────── */

.j0ui-tab-item.has-icon {
    gap: 6px;
}

.j0ui-tab-icon {
    font-size:   17px;
    line-height: 1;
    flex-shrink: 0;
}

.j0ui-tab-label {
    font-size: var(--j0ui-size-font-ui);
}


/* ─── VARIANTE: icono arriba + texto abajo (stack) ───────────────────────────── */

.j0ui-tab-item.has-icon-stack {
    flex-direction: column;
    height:         auto;
    padding:        6px 12px 5px;
    gap:            2px;
    border-bottom:  none;
    border-radius:  var(--j0ui-radius-sm) var(--j0ui-radius-sm) 0 0;
    min-width:      56px;
}

.j0ui-tab-item.has-icon-stack .j0ui-tab-icon  { font-size: 17px; }
.j0ui-tab-item.has-icon-stack .j0ui-tab-label {
    font-size:      9px;
    font-weight:    600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.j0ui-tab-item.has-icon-stack.j0ui-active {
    background:    var(--j0ui-accent-bg);
    color:         var(--j0ui-accent);
    border-bottom-color: transparent;
}

html[data-theme="light"] .j0ui-tab-item.has-icon-stack.j0ui-active {
    background: var(--j0ui-core-accent);
    color:      #fff;
}


/* ─── VARIANTE: solo icono ───────────────────────────────────────────────────── */

.j0ui-tab-item.icon-only {
    padding:   0;
    width:     var(--j0ui-size-input);
    min-width: var(--j0ui-size-input);
}

.j0ui-tab-item.icon-only .j0ui-tab-label { display: none; }


/* ─── OVERFLOW — botón … ─────────────────────────────────────────────────────── */

.j0ui-tabs-overflow-btn {
    display:         none;   /* JS lo muestra cuando hay overflow */
    align-items:     center;
    justify-content: center;
    width:           var(--j0ui-size-input);
    height:          var(--j0ui-size-input);
    flex-shrink:     0;
    position:        sticky;
    right:           0;
    background:      linear-gradient(to right,
                       transparent,
                       var(--j0ui-bg-panel) 40%);
    border:          none;
    color:           var(--j0ui-text-muted);
    cursor:          pointer;
    font-size:       var(--j0ui-size-font-lg);
    padding:         0 6px 0 16px;
    transition:      color 0.15s;
}

.j0ui-tabs-overflow-btn:hover { color: var(--j0ui-text-main); }

/* JS agrega .has-overflow al row cuando los items no entran */
.j0ui-tabs-row.has-overflow .j0ui-tabs-overflow-btn { display: flex; }


/* ─── TAB PANE ───────────────────────────────────────────────────────────────── */

.j0ui-tab-pane                { display: none; flex-direction: column; gap: var(--j0ui-space-sm); padding: 8px 0; }
.j0ui-tab-pane.j0ui-active    { display: flex; }

[data-j0-panel]               { display: none; }
[data-j0-panel].j0ui-active   { display: flex; flex-direction: column; gap: var(--j0ui-space-sm); padding: 8px 0; }

/* === Fuente: c0141-j0ui-lists.css === */
/* c060-j0ui-lists.css — V1.5.0 */
/* Reglas de estado del árbol movidas desde j040-j0ui-nav.js (fix arquitectónico) */
/* Todos los valores consumen tokens de c025 (o c060-theme-minimal en modo minimal). */

/* ============================================================================
   CONTENEDOR DE LISTA (el único elemento que scrollea)
   ============================================================================ */
.j0ui-list-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--j0ui-border-input) transparent;
}

/* ============================================================================
   ITEM BASE
   ============================================================================ */
.j0ui-list-item {
    display: flex;
    align-items: center;
    padding: 5px var(--j0ui-space-md);
    padding-left: calc(var(--j0ui-space-md) + (var(--j0-tree-depth, 0) * 18px));
    cursor: pointer;
    color: var(--j0ui-text-main);
    font-size: var(--j0ui-size-font-ui);
    border-bottom: 1px solid var(--j0ui-border-subtle);
    user-select: none;
    flex-shrink: 0;
    transition: background 0.12s;
}
.j0ui-list-item:hover  { background: var(--j0ui-bg-hover); }
.j0ui-list-item.j0ui-active {
    background: var(--j0ui-bg-active);
    color: var(--j0ui-text-on-accent);
}

/* ============================================================================
   CHEVRON Y ÍCONO
   ============================================================================ */
.j0ui-tree-chevron {
    width: 14px;
    font-size: 18px;
    text-align: center;
    color: var(--j0ui-text-muted);
    margin-right: 4px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.j0ui-list-item:hover .j0ui-tree-chevron { color: var(--j0ui-text-main); }
.j0ui-list-item.j0ui-active .j0ui-tree-chevron { color: var(--j0ui-text-on-accent); }

.j0ui-list-icon {
    margin-right: 7px;
    color: var(--j0ui-text-muted);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    font-size: 12px;
}
.j0ui-list-item.j0ui-active .j0ui-list-icon { color: var(--j0ui-text-on-accent); }

/* ============================================================================
   ESTADO DE ÁRBOL: OPEN / CLOSED
   Las reglas viven aquí — NO en JS (fix arquitectónico)
   ============================================================================ */

/* Chevron: 90° cuando la carpeta está abierta */
.j0ui-tree-node[data-is-open="true"] > .j0ui-list-item .j0ui-tree-chevron {
    transform: rotate(90deg);
}

/* Ícono de carpeta abierta vs cerrada */
.j0ui-tree-node[data-is-folder="true"] > .j0ui-list-item .j0ui-list-icon::before {
    content: "\f07b";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
.j0ui-tree-node[data-is-open="true"] > .j0ui-list-item .j0ui-list-icon::before {
    content: "\f07c";
}

/* Hijos ocultos */
.j0ui-tree-node.j0ui-hidden-child { display: none !important; }

/* ============================================================================
   SWATCH + LABELS (listas de colores)
   ============================================================================ */
.j0ui-swatch-preview {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.25);
    margin-right: 7px;
    flex-shrink: 0;
}

.j0ui-list-label {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.j0ui-list-value {
    font-family: var(--j0ui-font-mono);
    font-size: 10px;
    color: var(--j0ui-text-muted);
    margin-left: 8px;
    flex-shrink: 0;
}
.j0ui-list-item.j0ui-active .j0ui-list-value {
    color: color-mix(in srgb, var(--j0ui-text-on-accent) 70%, transparent);
}

/* === Fuente: c0142-j0ui-toolbar.css === */
/* =============================================================================
   c0141-j0ui-toolbar.css
   TOOLBAR — Barra de herramientas de componente o ventana.
   Package: 0140-j0ui-navigation--public-web
   Problema: CONTENER + ACCIONAR
   ============================================================================= */

.j0ui-toolbar {
    display:       flex;
    align-items:   center;
    gap:           2px;
    padding:       4px var(--j0ui-space-sm);
    background:    var(--j0ui-bg-header);
    border-bottom: 1px solid var(--j0ui-border-subtle);
    flex-shrink:   0;
}

.j0ui-toolbar-btn {
    display:         flex;
    align-items:     center;
    justify-content: center;
    width:           var(--j0ui-size-input);
    height:          var(--j0ui-size-input);
    background:      transparent;
    border:          1px solid transparent;
    border-radius:   var(--j0ui-radius-sm);
    color:           var(--j0ui-text-muted);
    cursor:          pointer;
    font-size:       var(--j0ui-size-font-sm);
    transition:      background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink:     0;
    white-space:     nowrap;
    gap:             4px;
}

.j0ui-toolbar-btn:hover {
    background:   var(--j0ui-bg-hover);
    color:        var(--j0ui-text-main);
    border-color: var(--j0ui-border-input);
}

.j0ui-toolbar-btn.j0ui-active {
    background:   var(--j0ui-accent-bg);
    color:        var(--j0ui-accent);
    border-color: var(--j0ui-accent);
}

/* Botón con texto además de icono */
.j0ui-toolbar-btn.has-label {
    width:   auto;
    padding: 0 10px;
}

/* Separador vertical */
.j0ui-toolbar-sep {
    width:      1px;
    height:     16px;
    background: var(--j0ui-border-subtle);
    margin:     0 2px;
    flex-shrink: 0;
}

/* Spacer flexible — empuja lo que sigue al extremo derecho */
.j0ui-toolbar-spacer {
    flex-grow: 1;
}

/* === Fuente: c0143-j0ui-dropdown.css === */
/* =============================================================================
   c0143-j0ui-dropdown.css
   DROPDOWN Y MENÚS — Menú flotante anclado a trigger o a coordenadas.
   Package: 0140-j0ui-navigation--public-web
   Problema: NAVEGAR + ACCIONAR

   Context menu = mismo componente, posicionamiento por coordenadas x,y.
   El JS (j0045) maneja ambos casos.
   ============================================================================= */

/* ─── TRIGGER ────────────────────────────────────────────────────────────────── */

.j0ui-dropdown { 
	position: relative;
	box-shadow: var(--j0ui-shadow-item);
}
.j0ui-dropdown:active, 
.j0ui-dropdown.active{
	box-shadow: var(--j0ui-shadow-item-active);
	transform: translateY(1px);
}

NAV .j0ui-dropdown,
.j0ui-shell-header .j0ui-dropdown{
	box-shadow: none;
}

.j0ui-dropdown-trigger {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             6px;
    height:          var(--j0ui-size-input);
    padding:         0 8px;
    background:      var(--j0ui-bg-input);
    border:          1px solid var(--j0ui-border-input);
    border-radius:   var(--j0ui-radius-sm);
    color:           var(--j0ui-text-main);
    font-family:     var(--j0ui-font);
    font-size:       var(--j0ui-size-font-ui);
    cursor:          pointer;
    user-select:     none;
    white-space:     nowrap;
    transition:      border-color 0.15s;
	/* box-shadow: var(--j0ui-shadow-item); */
}

.j0ui-dropdown-trigger:hover { border-color: var(--j0ui-border-window-active); }
.j0ui-dropdown.is-open .j0ui-dropdown-trigger { border-color: var(--j0ui-border-input-focus); }


/* ─── MENÚ FLOTANTE ──────────────────────────────────────────────────────────── */

/* display lo controla exclusivamente j0045-j0ui-dropdown.js */
.j0ui-dropdown-menu {
    position:      fixed;
    min-width:     120px;
    
    /* [!] FIX DEUDA TÉCNICA:
       Se elimina dependencia de --j0-L090.
       Uso de tokens nativos OS con mezcla de opacidad y desenfoque. */
    background:    color-mix(in srgb, var(--j0ui-bg-window) 95%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    border:        1px solid var(--j0ui-border-window-active);
    border-radius: var(--j0ui-radius);
    box-shadow:    var(--j0ui-shadow-menu);
    padding:       6px;
    z-index:       var(--j0ui-z-menu, 90000);
    display:       none;
    font-size:     var(--j0ui-size-font-ui);
    color:         var(--j0ui-text-main);
    font-family:   var(--j0ui-font);
    overflow-y:    auto;
    max-height:	50%;
		/* 320px; */
}

/* ─── ESTRUCTURA INTERNA ─────────────────────────────────────────────────────── */

.j0ui-menu-group-title {
    padding:        8px 12px 4px;
    font-size:      var(--j0ui-size-font-sm);
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color:          var(--j0ui-text-muted);
    user-select:    none;
}

.j0ui-menu-separator {
    height:     1px;
    background: var(--j0ui-border-subtle);
    margin:     4px 0;
}


/* ─── ITEM ───────────────────────────────────────────────────────────────────── */

.j0ui-menu-item {
    display:       flex;
    align-items:   center;
    gap:           10px;
    padding:       6px 12px;
    border-radius: var(--j0ui-radius-sm);
    cursor:        pointer;
    user-select:   none;
    position:      relative;
    transition:    background 0.1s;
    white-space:   nowrap;
    font-size:     var(--j0ui-size-font-ui);
}

.j0ui-menu-item:hover {
    background: var(--j0ui-bg-hover);
    color:      var(--j0ui-text-accent);
}

.j0ui-menu-item.is-disabled {
    opacity:        0.4;
    pointer-events: none;
    filter:         grayscale(100%);
}

.j0ui-menu-item-icon     { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; }
.j0ui-menu-item-label    { flex-grow: 1; }
.j0ui-menu-item-shortcut { font-size: 10px; color: var(--j0ui-text-muted); margin-left: auto; flex-shrink: 0; }
.j0ui-menu-item-arrow    { font-size: 9px; color: var(--j0ui-text-muted); flex-shrink: 0; }

/* Checkmark */
.j0ui-menu-item.has-check { padding-left: 28px; }
.j0ui-menu-item .j0ui-menu-check {
    position:   absolute;
    left:       8px;
    font-size:  10px;
    color:      var(--j0ui-core-accent);
    visibility: hidden;
}
.j0ui-menu-item.is-checked .j0ui-menu-check { visibility: visible; }

/* Submenu */
.j0ui-submenu {
    position:      absolute;
    left:          100%;
    top:           -4px;
    margin-left:   4px;
    min-width:     180px;
    background:    var(--j0ui-bg-window);
    border:        1px solid var(--j0ui-border-window-active);
    border-radius: var(--j0ui-radius-sm);
    box-shadow:    var(--j0ui-shadow-menu);
    padding:       4px;
    display:       none;
    z-index:       calc(var(--j0ui-z-menu, 90000) + 1);
}
.j0ui-menu-item:hover > .j0ui-submenu { display: block; }

/* === Fuente: c0150-j0-dialogs.css === */
/* =============================================================================
   c0080-j0-dialogs.css
   DIALOGS — Componente <dialog> nativo de j0ui.
   Depende de: c0026 (tokens), c0055 (botones via .j0ui-btn)
   ============================================================================= */

.j0ui-dialog {
    border:       none;
    border-radius: var(--j0ui-radius, 12px);
    padding:      0;
    background:   var(--j0ui-bg-window);
    color:        var(--j0ui-text-main);
    box-shadow:   var(--j0ui-shadow-window-active),
                  0 0 0 1px var(--j0ui-core-border);
    width:        90%;
    max-width:    420px;
    margin:       auto;
    /* [!] FIX DIÁLOGOS OCULTOS: Blindaje sobre el Zen Mode */
    z-index:      9999999 !important;
}

.j0ui-dialog::backdrop {
    background:            rgba(0, 0, 0, 0.5);
    backdrop-filter:       blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.j0ui-dialog-inner {
    display:        flex;
    flex-direction: column;
    gap:            var(--j0ui-space-md);
    padding:        var(--j0ui-space-md);
}

.j0ui-dialog-header {
    display:     flex;
    align-items: center;
    gap:         12px;
}

.j0ui-dialog-title {
    margin:      0;
    font-size:   var(--j0ui-size-font-xl);
    font-weight: 600;
    font-family: inherit;
}

.j0ui-dialog-content {
    font-size:   var(--j0ui-size-font-ui);
    line-height: 1.5;
    color:       var(--j0ui-text-secondary);
}

.j0ui-dialog-footer {
    display:         flex;
    justify-content: flex-end;
    gap:             12px;
    margin-top:      8px;
}

@media (max-width: 480px) {
    .j0ui-dialog-footer {
        flex-direction: column-reverse;
        align-items:    stretch;
    }
}

/* === Fuente: c0150-j0ui-feedback.css === */
/* =============================================================================
   c0150-j0ui-feedback.css
   FEEDBACK — Progress bar, Toast / columna de notificaciones.
   Package: 0150-j0ui-feedback--public-web
   Problema: COMUNICAR
   ============================================================================= */

/* ─── PROGRESS BAR ───────────────────────────────────────────────────────────── */

.j0ui-progress {
    width:         100%;
    height:        6px;
    background:    var(--j0ui-border-subtle);
    border-radius: 3px;
    overflow:      hidden;
}

.j0ui-progress-fill {
    height:        100%;
    background:    var(--j0ui-core-accent);
    border-radius: 3px;
    transition:    width 0.3s ease;
    width:         0%;
}

/* Variante indeterminada — animación de barrido */
.j0ui-progress.is-indeterminate .j0ui-progress-fill {
    width:      40%;
    animation:  j0ui-progress-sweep 1.2s ease-in-out infinite;
}

@keyframes j0ui-progress-sweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* Tamaños */
.j0ui-progress--sm { height: 3px; }
.j0ui-progress--lg { height: 10px; }

/* Semánticos */
.j0ui-progress--success .j0ui-progress-fill { background: var(--j0ui-success); }
.j0ui-progress--danger  .j0ui-progress-fill { background: var(--j0ui-danger);  }
.j0ui-progress--warning .j0ui-progress-fill { background: var(--j0ui-warning); }


/* ─── TOAST CONTAINER ────────────────────────────────────────────────────────── */

.j0ui-toast-container {
    position:       fixed;
    bottom:         var(--j0ui-space-md);
    right:          var(--j0ui-space-md);
    display:        flex;
    flex-direction: column-reverse;
    gap:            var(--j0ui-space-sm);
    z-index:        var(--j0ui-z-toast, 99000);
    pointer-events: none;
    max-width:      360px;
    width:          calc(100vw - var(--j0ui-space-md) * 2);
}


/* ─── TOAST ITEM ─────────────────────────────────────────────────────────────── */

.j0ui-toast {
    display:        flex;
    align-items:    flex-start;
    gap:            10px;
    padding:        var(--j0ui-space-sm) var(--j0ui-space-md);
    background:     var(--j0ui-bg-window);
    border:         1px solid var(--j0ui-border-window);
    border-radius:  var(--j0ui-radius);
    box-shadow:     var(--j0ui-shadow-window);
    color:          var(--j0ui-text-main);
    font-size:      var(--j0ui-size-font-ui);
    pointer-events: all;
    animation:      j0ui-toast-in 0.2s ease;
    position:       relative;
}

.j0ui-toast.is-leaving {
    animation: j0ui-toast-out 0.2s ease forwards;
}

@keyframes j0ui-toast-in {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes j0ui-toast-out {
    from { transform: translateX(0);    opacity: 1; max-height: 100px; margin-bottom: 0; }
    to   { transform: translateX(110%); opacity: 0; max-height: 0;     margin-bottom: calc(var(--j0ui-space-sm) * -1); }
}

/* Barra de progreso de auto-dismiss */
.j0ui-toast-timer {
    position:   absolute;
    bottom:     0;
    left:       0;
    height:     2px;
    background: var(--j0ui-core-accent);
    border-radius: 0 0 var(--j0ui-radius) var(--j0ui-radius);
    animation:  j0ui-toast-timer linear forwards;
}

@keyframes j0ui-toast-timer {
    from { width: 100%; }
    to   { width: 0%; }
}

.j0ui-toast-icon {
    font-size:  18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.j0ui-toast-body    { flex-grow: 1; line-height: 1.4; }
.j0ui-toast-title   { font-weight: 600; margin-bottom: 2px; }
.j0ui-toast-message { font-size: var(--j0ui-size-font-sm); color: var(--j0ui-text-secondary); }

.j0ui-toast-close {
    background:  transparent;
    border:      none;
    color:       var(--j0ui-text-muted);
    cursor:      pointer;
    font-size:   16px;
    flex-shrink: 0;
    padding:     0;
    line-height: 1;
    transition:  color 0.15s;
}
.j0ui-toast-close:hover { color: var(--j0ui-text-main); }

/* Variantes semánticas */
.j0ui-toast--success { border-left: 3px solid var(--j0ui-success); }
.j0ui-toast--danger  { border-left: 3px solid var(--j0ui-danger);  }
.j0ui-toast--warning { border-left: 3px solid var(--j0ui-warning); }

/* === Fuente: c0151-j0ui-tooltip.css === */
/* =============================================================================
   c0151-j0ui-tooltip.css
   TOOLTIP — Información contextual sobre hover/focus.
   Package: 0150-j0ui-feedback--public-web
   Problema: COMUNICAR
   ============================================================================= */

/* El tooltip se posiciona via JS (j0ui.tooltip) que agrega/mueve .j0ui-tooltip
   al body. No vive como hijo del trigger — evita clipping por overflow:hidden. */

.j0ui-tooltip {
    position:      fixed;
    z-index:       var(--j0ui-z-tooltip, 99999);
    background:    var(--j0ui-text-main);
    color:         var(--j0ui-bg-window);
    font-size:     var(--j0ui-size-font-sm);
    font-family:   var(--j0ui-font);
    line-height:   1.4;
    padding:       5px 10px;
    border-radius: var(--j0ui-radius-sm);
    max-width:     260px;
    pointer-events: none;
    white-space:   normal;
    box-shadow:    0 2px 8px rgba(0,0,0,0.3);
    opacity:       0;
    transition:    opacity 0.15s ease;
}

.j0ui-tooltip.is-visible { opacity: 1; }

/* Flecha — posición calculada por JS via data-placement */
.j0ui-tooltip::before {
    content:  '';
    position: absolute;
    width:    0;
    height:   0;
}

.j0ui-tooltip[data-placement="top"]::before {
    bottom:       -5px;
    left:         50%;
    transform:    translateX(-50%);
    border-left:  5px solid transparent;
    border-right: 5px solid transparent;
    border-top:   5px solid var(--j0ui-text-main);
}

.j0ui-tooltip[data-placement="bottom"]::before {
    top:          -5px;
    left:         50%;
    transform:    translateX(-50%);
    border-left:  5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid var(--j0ui-text-main);
}

.j0ui-tooltip[data-placement="left"]::before {
    right:        -5px;
    top:          50%;
    transform:    translateY(-50%);
    border-top:   5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left:  5px solid var(--j0ui-text-main);
}

.j0ui-tooltip[data-placement="right"]::before {
    left:         -5px;
    top:          50%;
    transform:    translateY(-50%);
    border-top:   5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid var(--j0ui-text-main);
}

/* === Fuente: c0152-j0ui-skeleton.css === */
/* =============================================================================
   c0152-j0ui-skeleton.css
   SKELETON LOADER — Placeholder animado para contenido en carga.
   Package: 0150-j0ui-feedback--public-web
   Problema: COMUNICAR
   ============================================================================= */

.j0ui-skeleton {
    background:    var(--j0ui-border-subtle);
    border-radius: var(--j0ui-radius-sm);
    position:      relative;
    overflow:      hidden;
    display:       block;
}

/* Animación de barrido */
.j0ui-skeleton::after {
    content:    '';
    position:   absolute;
    inset:      0;
    background: linear-gradient(
        90deg,
        transparent             0%,
        color-mix(in srgb, var(--j0ui-bg-window) 30%, transparent) 50%,
        transparent             100%
    );
    animation: j0ui-skeleton-sweep 1.4s ease-in-out infinite;
}

@keyframes j0ui-skeleton-sweep {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%);  }
}

/* Variantes de forma */
.j0ui-skeleton-text   { height: var(--j0ui-size-font-ui); width: 100%; margin-bottom: 6px; }
.j0ui-skeleton-text-sm { height: var(--j0ui-size-font-sm); width: 70%; }
.j0ui-skeleton-circle { border-radius: 50%; }
.j0ui-skeleton-btn    { height: var(--j0ui-size-input); width: 120px; }
.j0ui-skeleton-input  { height: var(--j0ui-size-input); width: 100%; }

/* Reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    .j0ui-skeleton::after { animation: none; opacity: 0.5; }
}

/* === Fuente: c0153-j0ui-popover.css === */
/* =============================================================================
   c0153-j0ui-popover.css
   POPOVER — Panel rico anclado a un elemento trigger.
   Package: 0150-j0ui-feedback--public-web
   Problema: COMUNICAR + CONTENER
   ============================================================================= */

.j0ui-popover {
    position:      fixed;
    z-index:       var(--j0ui-z-popover, 95000);
    background:    var(--j0ui-bg-window);
    border:        1px solid var(--j0ui-border-window-active);
    border-radius: var(--j0ui-radius);
    box-shadow:    var(--j0ui-shadow-window);
    min-width:     200px;
    max-width:     320px;
    padding:       var(--j0ui-space-sm) var(--j0ui-space-md);
    opacity:       0;
    pointer-events: none;
    transition:    opacity 0.15s ease;
    font-size:     var(--j0ui-size-font-ui);
    color:         var(--j0ui-text-main);
    font-family:   var(--j0ui-font);
}

.j0ui-popover.is-open { 
    opacity: 1; 
    pointer-events: all;
}

.j0ui-popover-title {
    font-size:     var(--j0ui-size-font-lg);
    font-weight:   600;
    margin:        0 0 var(--j0ui-space-sm) 0;
    padding-bottom: var(--j0ui-space-sm);
    border-bottom: 1px solid var(--j0ui-border-subtle);
}

.j0ui-popover-body {
    line-height: 1.5;
    color:       var(--j0ui-text-secondary);
}

.j0ui-popover-footer {
    margin-top:  var(--j0ui-space-sm);
    padding-top: var(--j0ui-space-sm);
    border-top:  1px solid var(--j0ui-border-subtle);
    display:     flex;
    justify-content: flex-end;
    gap:         var(--j0ui-space-sm);
}

/* Flecha (El "Piquito") - Posicionado absoluto respecto al popover entero */
.j0ui-popover::before {
    content:  '';
    position: absolute;
    width:    12px;
    height:   12px;
    background: var(--j0ui-bg-window);
    z-index: 2; /* Sobre el borde del popover, ocultando la línea transversal */
}

.j0ui-popover[data-placement="bottom"]::before {
    top:    -7px;
    left:   50%;
    transform: translateX(-50%) rotate(45deg);
    border-top: 1px solid var(--j0ui-border-window-active);
    border-left: 1px solid var(--j0ui-border-window-active);
    border-radius: 2px 0 0 0;
}

.j0ui-popover[data-placement="top"]::before {
    bottom: -7px;
    left:   50%;
    transform: translateX(-50%) rotate(45deg);
    border-bottom: 1px solid var(--j0ui-border-window-active);
    border-right: 1px solid var(--j0ui-border-window-active);
    border-radius: 0 0 2px 0;
}
/* === Fuente: c0154-j0ui-banner.css === */
/* =============================================================================
   c0154-j0ui-banner.css
   BANNER — Flash Message persistente en el flujo del layout.
   Package: 0150-j0ui-feedback--public-web
   Problema: COMUNICAR
   ============================================================================= */

.j0ui-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--j0ui-space-sm) var(--j0ui-space-md);
    background: var(--j0ui-bg-window);
    border-left: 4px solid var(--j0ui-core-accent);
    border-radius: var(--j0ui-radius-sm);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: var(--j0ui-text-main);
    font-family: var(--j0ui-font);
    font-size: var(--j0ui-size-font-ui);
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
    overflow: hidden;
    margin-bottom: var(--j0ui-space-sm);
}

.j0ui-banner.is-dismissed {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
}

.j0ui-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-grow: 1;
}

.j0ui-banner-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px; /* Compensación óptica para alinear con primera línea de texto */
}

.j0ui-banner-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.j0ui-banner-message {
    line-height: 1.4;
}

.j0ui-banner-action {
    display: flex;
    align-items: center;
    gap: 8px;
}

.j0ui-banner-close {
    background: transparent;
    border: none;
    color: var(--j0ui-text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 0 0 12px;
    margin-top: 2px;
    flex-shrink: 0;
    transition: color 0.15s;
}

.j0ui-banner-close:hover {
    color: var(--j0ui-text-main);
}

/* Variantes semánticas con fondos tonalizados basados en el ecosistema */
.j0ui-banner--success { 
    border-left-color: var(--j0ui-success); 
    background: color-mix(in srgb, var(--j0ui-success) 8%, var(--j0ui-bg-window));
}
.j0ui-banner--danger { 
    border-left-color: var(--j0ui-danger); 
    background: color-mix(in srgb, var(--j0ui-danger) 8%, var(--j0ui-bg-window)); 
}
.j0ui-banner--warning { 
    border-left-color: var(--j0ui-warning); 
    background: color-mix(in srgb, var(--j0ui-warning) 8%, var(--j0ui-bg-window)); 
}
.j0ui-banner--promo { 
    border-left-color: var(--j0ui-core-accent); 
    background: color-mix(in srgb, var(--j0ui-core-accent) 8%, var(--j0ui-bg-window)); 
}
/* === Fuente: c0160-j0ui-windows.css === */
/* =============================================================================
   c0030-j0ui-windows.css — V1.6.1
   LAYOUT DE VENTANAS — App shell, workspace, ventanas flotantes, resizer.
   FIX MAYOR: roles de j0-region y ejes de j0-pane (causa del bug de scroll/layout)
   ============================================================================= */

/* ─── FÍSICAS DE CAJA ────────────────────────────────────────────────────────── */
j0-app-shell, j0-viewport, j0-dock-slot, j0-workspace, j0-window,
j0-layout, j0-pane, j0-region, j0-mount, j0-icon-toggle {
    box-sizing: border-box;
}
j0-window *, j0-mount * { box-sizing: border-box; }

/* ─── BLINDAJE DE FONT AWESOME ───────────────────────────────────────────────── */
.j0ui-root .fa-solid,   .j0ui-root .fas  { font-weight: 900; font-family: "Font Awesome 6 Free"; }
.j0ui-root .fa-regular, .j0ui-root .far  { font-weight: 400; font-family: "Font Awesome 6 Free"; }
.j0ui-root .fa-solid::before,   .j0ui-root .fas::before  { font-weight: 900; font-family: "Font Awesome 6 Free"; }
.j0ui-root .fa-regular::before, .j0ui-root .far::before  { font-weight: 400; font-family: "Font Awesome 6 Free"; }

/* ─── APP SHELL & TOPOLOGY ───────────────────────────────────────────────────── */
j0-app-shell {
    display: flex; width: 100%; height: 100%;
    position: relative; overflow: hidden;
    background-color: var(--j0ui-bg-app);
    font-family: var(--j0ui-font);
    font-size: var(--j0ui-size-font-ui);
    color: var(--j0ui-text-main);
    -webkit-font-smoothing: antialiased;
}
j0-viewport  { display: block; flex-grow: 1; position: relative; z-index: 1; height: 100%; }
j0-dock-slot { display: block; flex-shrink: 0; position: relative; z-index: 2; height: 100%; transition: width 0.3s; }
j0-dock-slot[state="empty"] { width: 0; }
j0-workspace { display: block; position: absolute; inset: 0; overflow: hidden; z-index: 10; }
j0-registry  { display: none; }

/* ─── CADENA DE LAYOUT: j0-layout → j0-pane → j0-region ─────────────────────── */
/*
   PRINCIPIO: toda la cadena necesita flex-grow:1 + min-height:0 para que
   el overflow:auto en el nodo correcto funcione. Sin min-height:0, flex
   ignora el overflow y el hijo crece infinito.
*/
j0-layout[active] {
    display: flex; flex-direction: column;
    flex-grow: 1; min-height: 0;
}

j0-pane {
    display: flex; flex-direction: column;
    flex-grow: 1; min-height: 0;
}
j0-pane[axis="x"] { flex-direction: row; }

j0-pane[role="nav"] {
    flex-direction: column; flex-shrink: 0; flex-grow: 0;
    width: var(--j0ui-pane-nav-width, 160px);
    min-height: 0;
    border-right: 1px solid var(--j0ui-border-subtle);
}
j0-pane[role="main"] {
    flex-direction: column; flex-grow: 1;
    min-width: 0; min-height: 0;
}

j0-region              { display: flex; flex-direction: column; flex-shrink: 0; }
j0-region[role="head"] { flex-shrink: 0; }
j0-region[role="body"] { display: flex; flex-direction: column; flex-grow: 1; flex-shrink: 1; min-height: 0; overflow: hidden; }
j0-region[role="foot"] { flex-shrink: 0; border-top: 1px solid var(--j0ui-border-subtle); }

j0-mount { display: flex; flex-direction: column; flex-grow: 1; width: 100%; min-height: 0; }

/* ─── VENTANA ────────────────────────────────────────────────────────────────── */
j0-window {
    position: absolute;
    display: flex; flex-direction: column;
    perspective: 1000px; transform-style: preserve-3d;
    background-color: var(--j0ui-bg-window);
    border: 1px solid var(--j0ui-border-window);
    border-radius: var(--j0ui-radius);
    box-shadow: var(--j0ui-shadow-window);
    width: 320px; height: 400px;
    min-width: 180px; min-height: 80px;
    overflow: hidden;
    will-change: transform, left, top;
    transition: box-shadow 0.2s, border-color 0.2s;
}
j0-window.j0ui-window-active {
    border-color: var(--j0ui-border-window-active);
    box-shadow: var(--j0ui-shadow-window-active);
}

/* Minimizada */
j0-window.j0ui-window-minimized {
    height: auto !important;
    min-height: 1em !important;
}
j0-window.j0ui-window-minimized j0-layout,
j0-window.j0ui-window-minimized .j0ui-resizer { display: none !important; }


/* ─── FLIP 3D ────────────────────────────────────────────────────────────────── */

/* Wrapper transparente: transfiere la cáscara visual a las caras 3D */
j0-window.is-flippable {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.j0ui-window-perspective {
    position: absolute; inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.j0ui-window-face {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    
    /* La cara hereda la cáscara física del window */
    background-color: var(--j0ui-bg-window);
    border: 1px solid var(--j0ui-border-window);
    border-radius: var(--j0ui-radius);
    box-shadow: var(--j0ui-shadow-window);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Replican el estado activo sobre las caras tridimensionales */
j0-window.j0ui-window-active.is-flippable .j0ui-window-face {
    border-color: var(--j0ui-border-window-active);
    box-shadow: var(--j0ui-shadow-window-active);
}

.j0ui-window-face--front { transform: rotateY(0deg);   z-index: 2; }
.j0ui-window-face--back  { transform: rotateY(180deg); z-index: 1; }


j0-window.is-flipped .j0ui-window-perspective { 
    transform: perspective(1000px) rotateY(180deg); 
}

/* ─── ESTADOS TRANSITORIOS DE ANIMACIÓN (FLIPPING) ───────────────────────────── */
j0-window.is-flipping {
    overflow: visible !important;
}

j0-window.is-flipping .j0ui-window-face {
    box-shadow: none !important;
}

j0-window.is-flipping .j0ui-resizer { 
    opacity: 0 !important; 
    pointer-events: none !important; 
}



/* ─── HEADER DE VENTANA ──────────────────────────────────────────────────────── */
.j0ui-shell-header {
    display: flex; flex-direction: row; /* [!] FIX: Mata la herencia de columna de j0-region */
    align-items: center;
    padding: 0 var(--j0ui-space-sm);
    height: var(--j0ui-size-header);
    background-color: var(--j0ui-bg-header);
    border-bottom: 1px solid var(--j0ui-border-window);
    font-size: var(--j0ui-size-font-ui);
    font-weight: 600;
    color: var(--j0ui-text-main);
    user-select: none; flex-shrink: 0;
    /* cursor: default;  */
	cursor: move; 
	white-space: nowrap; overflow: hidden;
}

.j0ui-window-title {
    flex-grow: 1; overflow: hidden;
    text-overflow: ellipsis; padding: 0 4px;
}

.j0ui-window-icon {
    width: 18px; height: 18px; /* [!] FIX: Forzar caja estricta para contener el SVG */
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: var(--j0ui-text-muted);
    margin-right: 2px; flex-shrink: 0;
}

/* [!] FIX: Blindaje absoluto contra la explosión a 512px y el Ghost Drag */
.j0ui-window-icon img,
.j0ui-window-icon svg {
    width: 16px; height: 16px;
    display: block; object-fit: contain;
    flex-shrink: 0; pointer-events: none;
    user-select: none; -webkit-user-drag: none;
}

.j0ui-window-controls-custom {
    display: flex; align-items: center;
    gap: 4px; margin-right: 4px;
}

.j0ui-window-controls-system {
    display: flex; align-items: center;
    gap: 2px; margin-left: 8px;
}

/* ─── SCROLL AREA ────────────────────────────────────────────────────────────── */
.j0ui-scroll-area {
    flex-grow: 1; min-height: 0;
    overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--j0ui-border-input) transparent;
}
.j0ui-scroll-inner { padding: 8px var(--j0ui-space-md); display: flex; flex-direction: column; gap: 4px; }

/* ─── RESIZER ────────────────────────────────────────────────────────────────── */
.j0ui-resizer {
    position: absolute; right: 0; bottom: 0;
    width: 14px; height: 14px; cursor: nwse-resize; z-index: 100;
    background: linear-gradient(135deg, transparent 50%, var(--j0ui-text-muted) 50%);
    opacity: 0.25; clip-path: polygon(100% 0, 100% 100%, 0 100%);
    transition: opacity 0.15s;
}
.j0ui-resizer:hover { opacity: 0.85; }

/* ─── BOTÓN GHOST COMPACTO (controles de ventana) ───────────────────────────── */
/* [!] RENOMBRAR EN HTML: ix-btn-ghost → j0ui-btn-ghost
   Usar VSCode: buscar ix-btn-ghost, reemplazar con j0ui-btn-ghost */
.j0ui-btn-ghost {
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid transparent;
    color: var(--j0ui-text-secondary);
    border-radius: var(--j0ui-radius-sm);
    min-width: var(--j0ui-size-input);
    height: var(--j0ui-size-input);
    cursor: pointer; font-size: var(--j0ui-size-font-sm);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.j0ui-btn-ghost:hover {
    background: var(--j0ui-bg-hover);
    color: var(--j0ui-text-main);
    border-color: var(--j0ui-border-subtle);
}

/* ─── ICON TOGGLE ────────────────────────────────────────────────────────────── */
j0-icon-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; cursor: pointer; transition: opacity 0.2s;
}
j0-icon-toggle:hover        { opacity: 0.8; }
j0-icon-toggle[state="off"] { color: var(--j0ui-text-muted); opacity: 0.4; }

/* ─── UTILIDADES DE REGIÓN ───────────────────────────────────────────────────── */
.j0ui-region-padded { padding: var(--j0ui-space-md); }
.j0ui-region-gap    { gap: var(--j0ui-space-sm); }

/* === Fuente: c0161-j0ui-windows-controls.css === */
/* =============================================================================
   c0040-j0ui-forms.css — V1.5.1
   CONTROLES DE INSPECTOR — Sliders, inputs numéricos, hex input,
   segmented control, toggle iOS-style.
   Controles compactos para uso dentro de j0-window (escala UI).
   ============================================================================= */

/* ─── SLIDER ROW (label + track + input numérico) ────────────────────────────── */
.j0ui-slider-row {
    display: flex; align-items: center;
    gap: var(--j0ui-space-sm); flex-shrink: 0;
}

.j0ui-color-label {
    width: 14px;
    font-size: var(--j0ui-size-font-sm);
    font-weight: 700; text-transform: uppercase;
    color: var(--j0ui-text-muted);
    flex-shrink: 0; text-align: center;
}

/* ─── SLIDER SIMPLE ──────────────────────────────────────────────────────────── */
.j0ui-num-slider {
    flex-grow: 1;
    height: var(--j0ui-slider-height, 20px);
    -webkit-appearance: none; appearance: none;
    background: var(--j0ui-slider-track-bg);
    border: 1px solid var(--j0ui-border-input);
    border-radius: var(--j0ui-radius-sm);
    outline: none; cursor: pointer; padding: 0; margin: 0;
	box-shadow: var(--j0ui-shadow-track);
}
.j0ui-num-slider:focus { border-color: var(--j0ui-border-input-focus); }

.j0ui-num-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px; height: 22px;
    background: var(--j0ui-slider-thumb);
    border: 1px solid var(--j0ui-slider-thumb-border);
    border-radius: 2px; cursor: grab;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: border-color 0.15s;
}
.j0ui-num-slider::-webkit-slider-thumb:hover  { border-color: var(--j0ui-accent); }
.j0ui-num-slider::-webkit-slider-thumb:active { cursor: grabbing; }

.j0ui-num-slider.has-gradient-track {
    background: var(--j0ui-slider-gradient, var(--j0ui-slider-track-bg));
}

/* ─── SLIDER MULTI-THUMB ─────────────────────────────────────────────────────── */
.j0ui-multi-track {
    position: relative;
    height: var(--j0ui-slider-height, 20px);
    flex-grow: 1;
    border: 1px solid var(--j0ui-border-input);
    border-radius: var(--j0ui-radius-sm);
    background: var(--j0ui-slider-track-bg);
    overflow: visible;
}

.j0ui-multi-track::before {
    content: ''; position: absolute; inset: 1px;
    border-radius: calc(var(--j0ui-radius-sm) - 1px);
    background: var(--j0ui-multi-gradient, transparent);
    pointer-events: none;
}

.j0ui-multi-track input[type="range"] {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    -webkit-appearance: none; appearance: none;
    background: transparent; pointer-events: none;
    margin: 0; outline: none;
}

.j0ui-multi-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; pointer-events: auto;
    width: 10px; height: 22px;
    background: var(--j0ui-slider-thumb);
    border: 1px solid var(--j0ui-slider-thumb-border);
    border-radius: 2px; cursor: grab;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
    transition: border-color 0.15s, background 0.15s;
}
.j0ui-multi-track input[type="range"]::-webkit-slider-thumb:hover {
    border-color: var(--j0ui-accent); background: var(--j0ui-bg-window);
}
.j0ui-multi-track input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; }

/* Thumbs triangulares para Hue Range */
.j0ui-hue-thumb {
    position: absolute; width: 0; height: 0;
    cursor: ew-resize; transform: translateX(-50%); z-index: 10;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.5)) drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.j0ui-hue-thumb--top,
.j0ui-hue-thumb--bottom {
    position: relative; width: 14px; height: 11px; flex-shrink: 0;
    margin-left: -7px;
    background: var(--j0ui-text-main);
    filter: drop-shadow(0 0 1px rgba(0,0,0,0.9));
    transition: background 0.15s; border: none;
}
.j0ui-hue-thumb--top    { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.j0ui-hue-thumb--bottom { clip-path: polygon(0 0, 100% 0, 100% 100%); }

.j0ui-hue-pair:hover .j0ui-hue-thumb--top,
.j0ui-hue-pair:hover .j0ui-hue-thumb--bottom,
.j0ui-hue-pair[data-j0-drag-snapped="true"] .j0ui-hue-thumb--top,
.j0ui-hue-pair[data-j0-drag-snapped="true"] .j0ui-hue-thumb--bottom {
    background: var(--j0ui-accent);
}

/* ─── INPUT NUMÉRICO (compañero del slider) ──────────────────────────────────── */
.j0ui-num-input {
    width: 52px; height: var(--j0ui-size-input);
    background: var(--j0ui-bg-input);
    border: 1px solid var(--j0ui-border-input);
    border-radius: var(--j0ui-radius-sm);
    color: var(--j0ui-text-main);
    font-family: var(--j0ui-font-mono);
    font-size: var(--j0ui-size-font-ui);
    text-align: right; padding: 0 6px;
    outline: none; flex-shrink: 0;
    transition: border-color 0.15s;
    -moz-appearance: textfield; appearance: textfield;
	box-shadow: var(--j0ui-shadow-track);
}
.j0ui-num-input::-webkit-inner-spin-button,
.j0ui-num-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.j0ui-num-input:hover { border-color: var(--j0ui-border-window-active); }
.j0ui-num-input:focus { border-color: var(--j0ui-border-input-focus); background: var(--j0ui-bg-input-focus); }

/* ─── HEX INPUT ──────────────────────────────────────────────────────────────── */
.j0ui-hex-input-wrap { display: flex; align-items: center; gap: 4px; }

.j0ui-hex-input {
    width: 7em; height: var(--j0ui-size-input);
    background: transparent; border: none;
    border-bottom: 1px solid var(--j0ui-border-input);
    color: var(--j0ui-text-main);
    font-family: var(--j0ui-font-mono);
    font-size: var(--j0ui-size-font-xl);
    font-weight: 700; letter-spacing: 0.05em;
    text-align: center; outline: none; padding: 0 4px;
    transition: border-color 0.15s;
}
.j0ui-hex-input:focus { border-bottom-color: var(--j0ui-border-input-focus); }

/* ─── SEGMENTED CONTROL ──────────────────────────────────────────────────────── */
.j0ui-segmented-control {
    display: inline-flex;
    background: var(--j0ui-bg-input);
    border: 1px solid var(--j0ui-border-input);
    border-radius: var(--j0ui-radius-sm);
    padding: 2px; gap: 2px; flex-shrink: 0;
	box-shadow: var(--j0ui-shadow-item);
}

.j0ui-segment-btn {
    flex: 1;
    height: calc(var(--j0ui-size-input) - 6px);
    background: transparent; border: none;
    border-radius: calc(var(--j0ui-radius-sm) - 1px);
    color: var(--j0ui-text-muted);
    font-family: var(--j0ui-font);
    font-size: var(--j0ui-size-font-sm);
    font-weight: 600; cursor: pointer;
    padding: 0 8px; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.j0ui-segment-btn:hover { color: var(--j0ui-text-main); }
.j0ui-segment-btn.j0ui-active {
    background: var(--j0ui-text-main);
    color: var(--j0ui-bg-window);
}

/* ─── TOGGLE iOS-STYLE ───────────────────────────────────────────────────────── */
.j0ui-toggle-wrap {
    display: flex; align-items: center;
    justify-content: space-between;
    gap: var(--j0ui-space-sm);
    cursor: pointer; user-select: none;
}
.j0ui-toggle-label {
    font-size: var(--j0ui-size-font-ui);
    color: var(--j0ui-text-main); flex-grow: 1;
}

.j0ui-toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.j0ui-toggle input { display: none; }

.j0ui-toggle-track {
    position: absolute; inset: 0;
    background: var(--j0ui-slider-track-bg);
    border-radius: 10px; transition: background 0.2s;
	box-shadow: var(--j0ui-shadow-track);
}
.j0ui-toggle input:checked + .j0ui-toggle-track { background: var(--j0ui-core-accent); }

.j0ui-toggle-thumb {
    position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: var(--j0ui-text-main); border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.j0ui-toggle input:checked ~ .j0ui-toggle-thumb {
    transform: translateX(16px);
    background: var(--j0ui-text-on-accent);
}

/* ─── EMPTY STATE ────────────────────────────────────────────────────────────── */
.j0ui-empty-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; padding: 24px;
    color: var(--j0ui-text-muted);
    font-size: var(--j0ui-size-font-ui);
    text-align: center; flex-grow: 1;
}
.j0ui-empty-state .j0ui-empty-icon { font-size: 28px; opacity: 0.35; }

/* ─── BADGE NUMÉRICO ─────────────────────────────────────────────────────────── */
.j0ui-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--j0ui-badge-bg); color: var(--j0ui-badge-text);
    border-radius: 9px; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.j0ui-badge.j0ui-badge-accent {
    background: var(--j0ui-accent); color: var(--j0ui-text-on-accent);
}

/* === Fuente: c0162-j0ui-windows-drag-thumbs.css === */
/* ============================================================================
   THUMBS CUSTOM PARA DRAGGER
   Elementos div posicionados absolutamente sobre tracks.
   Agregar a c040-j0ui-forms.css (o temporalmente en c999-test.css para test).
   ============================================================================ */

/* Track con overflow visible para que los thumbs que sobresalen sean visibles */
.j0ui-multi-track {
    overflow: visible;
}

/* Thumb base — div posicionado absolute dentro del track */
.j0ui-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: calc(var(--j0ui-slider-height, 20px) + 4px);
    background: var(--j0ui-slider-thumb);
    border: 1px solid var(--j0ui-slider-thumb-border);
    border-radius: 2px;
    cursor: grab;
    touch-action: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: border-color 0.15s, background 0.15s;
    z-index: 10;
}
.j0ui-thumb:hover  { border-color: var(--j0ui-accent); }
.j0ui-thumb:active { cursor: grabbing; }
.j0ui-thumb:focus-visible {
    outline: 2px solid var(--j0ui-accent);
    outline-offset: 2px;
}

/* Variantes por rol (color para identificación visual en el tester) */
.j0ui-thumb--min   { background: var(--j0ui-slider-thumb); }
.j0ui-thumb--gamma { background: var(--j0ui-text-secondary); }
.j0ui-thumb--max   { background: var(--j0ui-slider-thumb); }

/* Snapped: dos thumbs unidos visualmente */
.j0ui-thumb[data-j0-drag-snapped="true"] {
    border-color: var(--j0ui-accent);
    background: var(--j0ui-accent-bg);
}

/* Thumb XY (área 2D) — circular */
.j0ui-thumb--xy {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--j0ui-text-main);
    background: transparent;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4);
}

/* ============================================================================
   HUE PAIR — contenedor de par de medios triángulos
   El par es un div draggable que contiene los dos triángulos (arriba / abajo).
   El movimiento del par mueve ambos triángulos juntos.
   ============================================================================ */
.j0ui-hue-pair {
    position: absolute;
    top: 0;
    width: 0;
    height: 100%;
    transform: translateX(-50%);
    cursor: ew-resize;
    touch-action: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* Los medios triángulos: ◢ arriba (apunta hacia abajo) y ◣ abajo (apunta hacia arriba) */
.j0ui-hue-thumb--top,
.j0ui-hue-thumb--bottom {
    position: relative;
    width: 0;
    height: 0;
    flex-shrink: 0;
    filter: drop-shadow(0 0 1px rgba(0,0,0,0.8));
    transition: filter 0.15s;
}

.j0ui-hue-thumb--top {
    border-left:   7px solid transparent;
    border-right:  7px solid transparent;
    border-top:    10px solid var(--j0ui-text-main);
}

.j0ui-hue-thumb--bottom {
    border-left:   7px solid transparent;
    border-right:  7px solid transparent;
    border-bottom: 10px solid var(--j0ui-text-main);
}

.j0ui-hue-pair:hover .j0ui-hue-thumb--top,
.j0ui-hue-pair:hover .j0ui-hue-thumb--bottom {
    filter: drop-shadow(0 0 2px var(--j0ui-accent)) drop-shadow(0 0 1px rgba(0,0,0,0.8));
}

.j0ui-hue-pair[data-j0-drag-snapped="true"] .j0ui-hue-thumb--top,
.j0ui-hue-pair[data-j0-drag-snapped="true"] .j0ui-hue-thumb--bottom {
    border-top-color: var(--j0ui-accent);
    border-bottom-color: var(--j0ui-accent);
}

/* Track específico para hue: sin padding vertical para que los triángulos
   queden exactamente en el borde superior e inferior del track */
.j0ui-multi-track--hue {
    overflow: visible;
}

/* ============================================================================
   DRAG AREA 2D
   ============================================================================ */
.j0ui-drag-area {
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}

/* === Fuente: c0163-j0ui-window-sheet.css === */
/* =============================================================================
   c0163-j0ui-window-sheet.css
   WINDOW SHEET — Panel modal asociado a j0-window, no al viewport.
   Package: 0160-j0ui-windows--public-web
   Problema: COMUNICAR + CONTENER

   A diferencia del dialog (<dialog> nativo) que bloquea el viewport entero,
   el window sheet se monta DENTRO de j0-window y bloquea solo esa ventana.
   Útil para confirmaciones, configuración contextual, onboarding dentro
   de una herramienta.

   Estructura:
     <j0-window>
       <j0-layout>...</j0-layout>
       <div class="j0ui-window-sheet">   ← se superpone sobre j0-layout
         <div class="j0ui-window-sheet-inner">
           ...contenido...
         </div>
       </div>
     </j0-window>

   JS: agregar/quitar clase .is-open en .j0ui-window-sheet
   ============================================================================= */

.j0ui-window-sheet {
    position:   absolute;
    inset:      0;
    z-index:    100;
    display:    flex;
    align-items: center;
    justify-content: center;
    background: #000000cc;
		/* color-mix(in srgb, var(--j0ui-bg-window) 85%, transparent); */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity:    0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border-radius: inherit;

    /* [!] FORZADO DE CONTRASTE:
       La sábana base siempre es oscura (#000000cc),
       independientemente del data-theme. 
       Aislamos la cascada para que el texto sea blanco. */
    /* --j0ui-text-main:      #ffffff;
    --j0ui-text-secondary: rgba(255, 255, 255, 0.8);
    --j0ui-text-muted:     rgba(255, 255, 255, 0.5);
    color:                 var(--j0ui-text-main); */
}

.j0ui-window-sheet.is-open {
    opacity:        1;
    pointer-events: all;
}

/* Redirección física de capas: El modal del administrador de overlays se ancla debajo de la barra de título */
j0-window > .j0ui-overlay-wrapper.j0ui-behavior-modal {
    position: absolute;
    top: var(--j0ui-size-header, 34px);
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--j0ui-bg-window) 85%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 0 0 var(--j0ui-radius) var(--j0ui-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Regla Maestra de OS: Máscara visual de atenuación sobre el encabezado del Shell */
j0-window.has-modal-overlay .j0ui-shell-header {
    position: relative;
}

j0-window.has-modal-overlay .j0ui-shell-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 10;
}

j0-window.has-modal-overlay .j0ui-resizer {
    z-index: 10000;
}

/* Definición de la estructura interna transparente del contenedor */
.j0ui-window-sheet-inner {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: var(--j0ui-space-sm);
    animation: j0ui-sheet-in 0.2s ease;
    text-align: center;
    align-items: center;
}

@keyframes j0ui-sheet-in {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.j0ui-window-sheet-title {
    font-family: var(--j0ui-font);
    font-size: var(--j0ui-size-font-xl);
    color: var(--j0ui-text-main);
    margin: 0 0 var(--j0ui-space-sm) 0;
    font-weight: 600;
    border: none;
}

/* Corrección de pegoteo horizontal aplicando la escala de tokens compactos del OS */
.j0ui-window-sheet-body {
    font-size: var(--j0ui-size-font-ui);
    color: var(--j0ui-text-secondary);
    line-height: 1.5;
    padding: 0 var(--j0ui-space-lg);
    width: 100%;
    box-sizing: border-box;
}

.j0ui-window-sheet-footer {
    display: flex;
    justify-content: center;
    gap: var(--j0ui-space-sm);
    margin-top: 4px;
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
}

.j0ui-window-sheet-footer .j0ui-btn--ghost {
    color: var(--j0ui-text-muted);
    background: transparent;
}

.j0ui-window-sheet-footer .j0ui-btn--ghost:hover {
    color: var(--j0ui-text-main);
    background: rgba(255, 255, 255, 0.1);
}
/* === Fuente: c0164-j0ui-slider.css === */
/* =============================================================================
   c0164-j0ui-slider.css
   SLIDER — Todos los casos de uso.
   Package: 0160-j0ui-windows--public-web
   ============================================================================= */

/* ─── CONTENEDOR BASE ────────────────────────────────────────────────────────── */

.j0ui-slider-row {
    display:     flex;
    align-items: center;
    gap:         var(--j0ui-space-sm);
    width:       100%;
}

.j0ui-slider-track {
    position:      relative;
    flex-grow:     1;
    height:        20px;
    border-radius: var(--j0ui-radius-sm);
    background:    var(--j0ui-slider-track-bg, var(--j0ui-bg-input));
    border:        1px solid var(--j0ui-border-input);
    cursor:        pointer;
    user-select:   none;
}


/* ─── RAIL ───────────────────────────────────────────────────────────────────── */

.j0ui-slider-rail {
    position:      absolute;
    inset:         0;
    border-radius: inherit;
    pointer-events: none;
}


/* ─── FILL ───────────────────────────────────────────────────────────────────── */

.j0ui-slider-fill {
    position:      absolute;
    top:           0;
    bottom:        0;
    background:    var(--j0ui-core-accent);
    border-radius: inherit;
    pointer-events: none;
    transition:    left 0.05s, width 0.05s;
}


/* ─── SEGMENTS ───────────────────────────────────────────────────────────────── */

.j0ui-slider-segment {
    position:      absolute;
    top:           0;
    bottom:        0;
    pointer-events: none;
}


/* ─── THUMB BASE ─────────────────────────────────────────────────────────────── */

.j0ui-slider-thumb {
    position:    absolute;
    top:         50%;
    transform:   translate(-50%, -50%);
    cursor:      grab;
    z-index:     2;
    transition:  border-color 0.15s;
    touch-action: none;
}

.j0ui-slider-thumb:focus-visible {
    outline:        2px solid var(--j0ui-core-accent);
    outline-offset: 2px;
}

.j0ui-slider-thumb.is-dragging { cursor: grabbing; z-index: 3; }
.j0ui-slider-thumb.is-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.j0ui-slider-thumb.is-selected { z-index: 4; }


/* ─── THUMB RECT (default) ───────────────────────────────────────────────────── */

.j0ui-slider-thumb--rect {
    width:         10px;
    height:        22px;
    background:    var(--j0ui-slider-thumb, var(--j0ui-text-main));
    border:        1px solid var(--j0ui-slider-thumb-border, rgba(0,0,0,0.3));
    border-radius: 2px;
    box-shadow:    0 1px 3px rgba(0,0,0,0.3);
}

.j0ui-slider-thumb--rect:hover {
    border-color: var(--j0ui-core-accent);
}

/* Gradient editor — thumb con color propio */
.j0ui-slider-thumb--rect[style*="--thumb-color"] {
    background:    var(--thumb-color);
    border-color:  color-mix(in srgb, var(--thumb-color) 60%, #000);
    width:         14px;
    height:        24px;
    border-radius: 3px 3px 0 0;
}

/* Remove button dentro del thumb */
.j0ui-slider-thumb-remove {
    position:    absolute;
    top:         -12px;
    left:        50%;
    transform:   translateX(-50%);
    width:       12px;
    height:      12px;
    background:  var(--j0ui-danger);
    border:      none;
    border-radius: 50%;
    color:       #fff;
    font-size:   9px;
    line-height: 12px;
    text-align:  center;
    cursor:      pointer;
    display:     none;
    padding:     0;
}

.j0ui-slider-thumb--rect:hover .j0ui-slider-thumb-remove { display: block; }


/* ─── THUMB TRIÁNGULO ────────────────────────────────────────────────────────── */

.j0ui-slider-thumb--triangle-top {
    width:       0;
    height:      0;
    background:  transparent;
    border:      none;
    box-shadow:  none;
    top:         0;
    transform:   translateX(-50%);
    /* Triángulo apuntando hacia abajo (desde arriba del track) */
    border-left:   7px solid transparent;
    border-right:  7px solid transparent;
    border-top:    11px solid var(--j0ui-text-main);
    filter:        drop-shadow(0 1px 2px rgba(0,0,0,0.5));
    transition:    border-top-color 0.15s;
}

.j0ui-slider-thumb--triangle-top:hover,
.j0ui-slider-thumb--triangle-top.is-dragging {
    border-top-color: var(--j0ui-core-accent);
}

.j0ui-slider-thumb--triangle-bottom {
    width:       0;
    height:      0;
    background:  transparent;
    border:      none;
    box-shadow:  none;
    top:         auto;
    bottom:      0;
    transform:   translateX(-50%);
    /* Triángulo apuntando hacia arriba (desde abajo del track) */
    border-left:   7px solid transparent;
    border-right:  7px solid transparent;
    border-bottom: 11px solid var(--j0ui-text-main);
    filter:        drop-shadow(0 -1px 2px rgba(0,0,0,0.5));
    transition:    border-bottom-color 0.15s;
}

.j0ui-slider-thumb--triangle-bottom:hover,
.j0ui-slider-thumb--triangle-bottom.is-dragging {
    border-bottom-color: var(--j0ui-core-accent);
}


/* ─── TOOLTIP ────────────────────────────────────────────────────────────────── */

.j0ui-slider-tooltip {
    position:      absolute;
    bottom:        calc(100% + 6px);
    left:          50%;
    transform:     translateX(-50%);
    background:    var(--j0ui-text-main);
    color:         var(--j0ui-bg-window);
    font-size:     10px;
    padding:       2px 6px;
    border-radius: 3px;
    white-space:   nowrap;
    pointer-events: none;
    opacity:       0;
    transition:    opacity 0.15s;
}

.j0ui-slider-tooltip.is-visible { opacity: 1; }

.j0ui-slider-tooltip::after {
    content:  '';
    position: absolute;
    top:      100%;
    left:     50%;
    transform: translateX(-50%);
    border-left:  4px solid transparent;
    border-right: 4px solid transparent;
    border-top:   4px solid var(--j0ui-text-main);
}


/* ─── INPUTS BELOW ───────────────────────────────────────────────────────────── */

.j0ui-slider-inputs-below {
    display:         flex;
    justify-content: space-between;
    gap:             var(--j0ui-space-sm);
    margin-top:      4px;
}

.j0ui-slider-inputs-below .j0ui-num-input {
    flex:      1;
    min-width: 0;
    text-align: center;
}


/* ─── MARKS ──────────────────────────────────────────────────────────────────── */

.j0ui-slider-mark {
    position:    absolute;
    top:         100%;
    transform:   translateX(-50%);
    font-size:   9px;
    color:       var(--j0ui-text-muted);
    margin-top:  3px;
    white-space: nowrap;
    pointer-events: none;
}

.j0ui-slider-mark::before {
    content:    '';
    position:   absolute;
    top:        -5px;
    left:       50%;
    transform:  translateX(-50%);
    width:      1px;
    height:     4px;
    background: var(--j0ui-border-input);
}

/* === Fuente: concatenado.css === */

