/*
 * wee.css — todos los estilos de la librería wee-*.
 * Se carga UNA vez en el layout principal, fuera del contenido que recarga el router de hash:
 *   <link rel="stylesheet" href="/wee/wee.css">
 *
 * ÍNDICE
 *   1. Tokens y temas          variables --wee-* (fuera de @layer: ver la nota de la sección)
 *   2. Base                    box-sizing, tipografía, [hidden], foco visible, movimiento reducido
 *   3. Estados is-*            una sola definición para toda la librería
 *   4. Piezas compartidas      label, control, botón, badge, ícono, spinner, estado, skeleton, panel,
 *                              opción, casilla, chip, progreso, card, encabezado
 *   5. Componentes             una sección por componente, en el orden del inventario
 *   6. Responsive
 *   7. Fuera de la capa        el borde rojo de los campos nativos con error (WeeForm)
 *   8. Escudo                  las piezas wee- no reciben estilos de elementos del proyecto (Bootstrap 3/4/5)
 *
 * TOKENS (valor del tema por defecto; el tema gmm cambia los que necesite)
 *   Colores base     --wee-navy · --wee-teal · --wee-accent · --wee-danger · --wee-warning · --wee-info · --wee-success
 *   Variantes        --wee-*-soft (fondos claros) · --wee-*-dark (texto sobre fondo claro) · --wee-navy-hover
 *   Texto            --wee-text · --wee-muted · --wee-placeholder · --wee-on-color
 *   Superficies      --wee-surface · --wee-bg · --wee-border · --wee-border-strong · --wee-divider
 *                    --wee-hover-bg · --wee-selected-bg · --wee-readonly-bg · --wee-disabled-bg · --wee-track · --wee-backdrop
 *   Visor            --wee-viewer-bg · --wee-viewer-text · --wee-on-color-hover · --wee-on-color-track
 *   Estados          --wee-disabled-opacity · --wee-busy-opacity · --wee-focus-ring · --wee-focus-ring-soft
 *   Forma            --wee-radius (campos) · --wee-radius-sm · --wee-radius-md · --wee-radius-lg · --wee-radius-pill
 *                    --wee-control-height (alto de input, combo y buscador: 44px)
 *   Sombras          --wee-shadow-sm · --wee-shadow-md · --wee-shadow-lg · --wee-shadow-float
 *   Espacios         --wee-space-1 … --wee-space-6 (4, 8, 12, 16, 20, 24 px)
 *   Letra            --wee-font · --wee-font-size-xs · -sm · -md · -lg · --wee-font-weight-semibold · -bold
 *   Tiempos          --wee-duration-fast · --wee-duration-base
 *   Capas            --wee-z-panel · --wee-z-notify · --wee-z-tooltip
 *   Encabezado       --wee-header-bg · --wee-header-color · --wee-header-border
 *   Valores en vivo  --wee-left · --wee-top (posición de paneles) · --wee-progress (ancho de barras)
 *
 * CÓMO SE USA
 *   Cambiar el diseño:   <html wee-theme="gmm">  o  WeeTheme.set('gmm')
 *   Un solo componente:  <wee-table theme="gmm">  (el componente pone la clase is-theme-gmm)
 *   Cambiar un color:    :root { --wee-navy: #003070; }  en el CSS del proyecto, o WeeTheme.tokens({ navy: '#003070' })
 *
 * ESPECIFICIDAD
 *   Todo, salvo los tokens y las secciones 7 y 8, vive en @layer wee: una regla del proyecto con clase
 *   (.hide, .d-none, .text-primary, .mi-pantalla .wee-control) gana sin !important. Los únicos !important son
 *   [hidden] (y data-wee-hidden / data-step-inactive, que ocultan igual) y .wee-visually-hidden.
 *   Las reglas de ELEMENTO del proyecto (td, label, button, p, h3… de Bootstrap) no llegan a las piezas
 *   wee-: la sección 8 las regresa al valor de la capa. Por eso wee.css va DESPUÉS de Bootstrap en el layout.
 *
 * ESTADOS Y BOOTSTRAP
 *   Las reglas de estado solo aplican a elementos que también tienen una clase wee- (una pieza o el
 *   propio componente). Así .is-invalid de Bootstrap en un .form-control no se mezcla con la librería.
 */


/* ==========================================================================
   1. TOKENS Y TEMAS
   Fuera de @layer y en :root. El CSS del proyecto puede cambiarlos con su propio :root cargado después
   de este archivo (o con WeeTheme.tokens).
   ========================================================================== */

:root {
    --wee-stylesheet: 1;

    /* Colores base */
    --wee-navy: #042d6f;
    --wee-navy-hover: #0b3f8f;
    --wee-teal: #2fc5a9;
    --wee-teal-dark: #11866c;
    --wee-teal-soft: #e3f6f1;
    --wee-accent: #6cc4b1;
    --wee-danger: #d93025;
    --wee-danger-dark: #c5221f;
    --wee-danger-soft: #fdecea;
    --wee-warning: #d18f00;
    --wee-warning-dark: #9a5b00;
    --wee-warning-soft: #fff3dc;
    --wee-info: #1a6fd1;
    --wee-info-dark: #1a5fb4;
    --wee-info-soft: #e8f1fd;
    --wee-success: #11866c;
    --wee-success-soft: #e6f8f3;
    --wee-primary-soft: #e6ecf6;
    --wee-neutral: #4a5a6a;
    --wee-neutral-soft: #eef1f4;

    /* Texto */
    --wee-text: #042d6f;
    --wee-muted: #5b6b7c;
    --wee-placeholder: #9aa7b3;
    --wee-on-color: #ffffff;

    /* Superficies */
    --wee-surface: #ffffff;
    --wee-bg: #f3f6f9;
    --wee-border: #e1e6eb;
    --wee-border-strong: #c9d3dd;
    --wee-divider: #e3e9ef;
    --wee-hover-bg: #eef3f8;
    --wee-selected-bg: #e1f5f0;
    --wee-readonly-bg: #f8fafb;
    --wee-disabled-bg: #f4f6f8;
    --wee-track: rgba(10, 37, 64, .08);
    --wee-backdrop: rgba(10, 37, 64, .6);

    /* Visor oscuro de documentos */
    --wee-viewer-bg: #2b3138;
    --wee-viewer-text: #dfe6ec;
    --wee-on-color-hover: rgba(255, 255, 255, .12);
    --wee-on-color-track: rgba(255, 255, 255, .25);

    /* Estados */
    --wee-disabled-opacity: .55;
    --wee-busy-opacity: .6;
    --wee-focus-ring: #2fc5a9;
    --wee-focus-ring-soft: rgba(47, 197, 169, .25);

    /* Forma */
    --wee-radius: 10px;
    --wee-radius-sm: 6px;
    --wee-radius-md: 8px;
    --wee-radius-lg: 12px;
    --wee-radius-pill: 999px;
    --wee-control-height: 44px;

    /* Sombras */
    --wee-shadow-sm: 0 1px 2px rgba(4, 45, 111, .08);
    --wee-shadow-md: 0 12px 30px rgba(10, 37, 64, .10);
    --wee-shadow-lg: 0 16px 32px -12px rgba(4, 45, 111, .30);
    --wee-shadow-float: 0 12px 32px rgba(10, 37, 64, .22);

    /* Espacios */
    --wee-space-1: 4px;
    --wee-space-2: 8px;
    --wee-space-3: 12px;
    --wee-space-4: 16px;
    --wee-space-5: 20px;
    --wee-space-6: 24px;

    /* Letra */
    --wee-font: inherit;
    --wee-font-size-xs: 11.5px;
    --wee-font-size-sm: 12.5px;
    --wee-font-size-md: 13.5px;
    --wee-font-size-lg: 15px;
    --wee-font-weight-semibold: 600;
    --wee-font-weight-bold: 700;

    /* Tiempos */
    --wee-duration-fast: .12s;
    --wee-duration-base: .2s;

    /* Capas */
    --wee-z-panel: 2147483000;
    --wee-z-notify: 2147483600;
    --wee-z-tooltip: 2147483640;

    /* Encabezado (summary, frame, modal…) */
    --wee-header-bg: var(--wee-navy);
    --wee-header-color: var(--wee-on-color);
    --wee-header-border: 0 solid transparent;

    /* Foco de "tip" (wee-message y ayuda de campos) */
    --wee-tip: #f2b705;

    /* Switch de wee-input */
    --wee-switch-on: var(--wee-navy);
    --wee-switch-off: #b9c2d6;
}

/* Tokens que cambian de un tema a otro. Un componente con theme="wee" dentro de una página gmm
   (o al revés) recibe la clase is-theme-* y estos valores se vuelven a poner en él. Los colores
   base no van aquí: así WeeTheme.tokens({ navy: … }) sigue llegando a todos. */
.is-theme-wee {
    --wee-header-bg: var(--wee-navy);
    --wee-header-color: var(--wee-on-color);
    --wee-header-border: 0 solid transparent;
}

/* Tema de la plataforma actual. Hoy comparte los colores del tema por defecto; lo que cambia es la
   forma (encabezados blancos con línea teal). Cada componente agrega aquí sus tokens cuando se migra. */
:root[wee-theme="gmm"],
.is-theme-gmm {
    --wee-header-bg: var(--wee-surface);
    --wee-header-color: var(--wee-navy);
    --wee-header-border: 2px solid var(--wee-teal);
}


@layer wee {

/* ==========================================================================
   2. BASE
   Solo en elementos con clase wee- y en los componentes wee-*: no toca el resto de la página.
   ========================================================================== */

:where([class*="wee-"]),
:where([class*="wee-"])::before,
:where([class*="wee-"])::after {
    box-sizing: border-box;
}

:where(.wee-root) {
    font-family: var(--wee-font);
    font-size: var(--wee-font-size-md);
    color: var(--wee-text);
}

/* [hidden] siempre esconde, aunque una regla de la librería ponga display. */
:where([class*="wee-"])[hidden],
:where(wee-input, wee-combo, wee-check-group, wee-search, wee-doc-preview, wee-message, wee-menu,
       wee-tabs, wee-frame, wee-table, wee-summary, wee-timeline, wee-comments, wee-modal, .wee-root)[hidden],
:where(wee-input, wee-combo, wee-check-group, wee-search, wee-doc-preview, wee-message, wee-menu,
       wee-tabs, wee-frame, wee-table, wee-summary, wee-timeline, wee-comments, wee-modal, .wee-root) [hidden] {
    display: none !important;
}

/* Lo que oculta visible-if (WeeConditions) se esconde igual que [hidden]. */
/* Lo que oculta WeeForm (pasos inactivos y botones de pasos con [hidden]) también. */
:where([data-wee-hidden], [data-step-inactive], [data-step][hidden]) {
    display: none !important;
}

/* Foco visible con teclado: el mismo anillo en toda la librería. */
:where([class*="wee-"]):focus-visible {
    outline: 2px solid var(--wee-focus-ring);
    outline-offset: 2px;
}

:where([class*="wee-"]):focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    :where([class*="wee-"]),
    :where([class*="wee-"])::before,
    :where([class*="wee-"])::after {
        animation-duration: .01ms;
        animation-iteration-count: 1;
        transition-duration: .01ms;
    }
}

@keyframes wee-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes wee-shimmer {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

@keyframes wee-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes wee-panel-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}


/* ==========================================================================
   3. ESTADOS is-*
   Cada estado se define una vez. Los atributos nativos equivalentes se ven igual que la clase.
   ========================================================================== */

/* 3.1 Deshabilitado: .is-disabled · [disabled] · :disabled · [aria-disabled="true"] */
:where([class*="wee-"]):where(.is-disabled, [disabled], :disabled, [aria-disabled="true"]) {
    opacity: var(--wee-disabled-opacity);
    cursor: not-allowed;
}

/* Dentro de algo ya deshabilitado no se vuelve a atenuar (la opacidad se multiplicaría). */
:where([class*="wee-"]):where(.is-disabled, [disabled], [aria-disabled="true"])
:where([class*="wee-"]):where(.is-disabled, [disabled], :disabled, [aria-disabled="true"]) {
    opacity: 1;
}

/* 3.2 Solo lectura: .is-readonly · [readonly] · [aria-readonly="true"] */
:where([class*="wee-"]):where(.is-readonly, [aria-readonly="true"]) {
    cursor: default;
}

/* 3.3 Inválido: .is-invalid · [aria-invalid="true"] (el borde rojo lo pone cada pieza) */
:where([class*="wee-"]):where(.is-invalid, [aria-invalid="true"]) {
    --wee-control-border: var(--wee-danger);
}

/* 3.4 Cargando: .is-loading · [aria-busy="true"] */
:where([class*="wee-"]):where(.is-loading, [aria-busy="true"]) {
    cursor: progress;
}

/* 3.5 Ocupado: se ve el contenido, pero no se puede usar. */
:where([class*="wee-"]).is-busy {
    opacity: var(--wee-busy-opacity);
    pointer-events: none;
}

/* 3.6 Seleccionado: .is-selected · [aria-selected="true"] */
:where([class*="wee-"]):where(.is-selected, [aria-selected="true"]) {
    background: var(--wee-selected-bg);
    color: var(--wee-text);
}

/* 3.7 Activo (pestaña, filtro, página actual): .is-active · [aria-current] */
:where([class*="wee-"]):where(.is-active, [aria-current="true"], [aria-current="page"]) {
    color: var(--wee-text);
    font-weight: var(--wee-font-weight-bold);
}

/* 3.8 Abierto / expandido / colapsado: lo que se muestra lo decide cada componente con [hidden];
   aquí solo gira el chevron del disparador. */
:where([class*="wee-"]):where(.is-open, .is-expanded, [aria-expanded="true"]) > :where(.wee-chevron) {
    transform: rotate(180deg);
}

:where([class*="wee-"]).is-collapsed > :where(.wee-chevron) {
    transform: rotate(-90deg);
}

/* 3.9 Arrastrando un archivo encima */
:where([class*="wee-"]).is-dragover {
    border-color: var(--wee-teal);
    background: var(--wee-teal-soft);
}

/* 3.10 Vacío: el contenido lo pinta .wee-state */
:where([class*="wee-"]).is-empty {
    color: var(--wee-muted);
}

/* 3.11 Hover: solo si no está deshabilitado (lo usan las piezas con .wee-hoverable) */
:where(.wee-hoverable):hover:not(.is-disabled, :disabled, [aria-disabled="true"]) {
    background: var(--wee-hover-bg);
}


/* ==========================================================================
   4. PIEZAS COMPARTIDAS
   ========================================================================== */

/* 4.1 Texto oculto que sí leen los lectores de pantalla */
.wee-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 4.2 Etiqueta de campo y asterisco de requerido */
:where(.wee-label) {
    display: block;
    margin-bottom: var(--wee-space-2);
    color: var(--wee-text);
    font-size: var(--wee-font-size-md);
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-required) {
    margin-left: 2px;
    color: var(--wee-danger);
}

/* 4.3 Caja de cualquier campo (input, combo, buscador…) */
:where(.wee-control) {
    --wee-control-border: var(--wee-border);
    width: 100%;
    min-height: var(--wee-control-height, 44px);
    padding: var(--wee-space-3) 14px;
    border: 1px solid var(--wee-control-border);
    border-radius: var(--wee-radius);
    outline: none;
    background: var(--wee-surface);
    color: var(--wee-text);
    font: inherit;
    font-size: var(--wee-font-size-md);
    transition: border-color var(--wee-duration-fast) ease, box-shadow var(--wee-duration-fast) ease;
}

:where(.wee-control)::placeholder {
    color: var(--wee-placeholder);
}

:where(.wee-control):where(:focus, :focus-within) {
    --wee-control-border: var(--wee-teal);
}

/* En un campo el foco se marca con el borde teal; sin el anillo general por fuera. */
:where(.wee-control):focus-visible {
    outline: none;
}

:where(.wee-control):where(.is-invalid, [aria-invalid="true"]) {
    --wee-control-border: var(--wee-danger);
}

:where(.wee-control):where(.is-disabled, :disabled, [aria-disabled="true"]) {
    background: var(--wee-disabled-bg);
    color: var(--wee-muted);
}

:where(.wee-control):where(.is-readonly, [readonly], [aria-readonly="true"]) {
    background: var(--wee-readonly-bg);
}

/* 4.4 Texto de error y texto de ayuda debajo de un campo */
:where(.wee-error-text) {
    display: block;
    min-height: 16px;
    margin-top: var(--wee-space-1);
    color: var(--wee-danger);
    font-size: var(--wee-font-size-xs);
}

:where(.wee-hint) {
    display: block;
    margin-top: var(--wee-space-1);
    color: var(--wee-muted);
    font-size: var(--wee-font-size-xs);
}

/* 4.5 Botones */
:where(.wee-btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--wee-space-2);
    min-height: 38px;
    padding: var(--wee-space-2) 18px;
    border: 1px solid transparent;
    border-radius: var(--wee-radius-md);
    background: var(--wee-surface);
    color: var(--wee-navy);
    font: inherit;
    font-size: var(--wee-font-size-md);
    font-weight: var(--wee-font-weight-bold);
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

:where(.wee-btn) > :where(.wee-icon) {
    --wee-icon-size: 16px;
}

:where(.wee-btn-primary) {
    border-color: var(--wee-navy);
    background: var(--wee-navy);
    color: var(--wee-on-color);
}

:where(.wee-btn-secondary) {
    border-color: var(--wee-border-strong);
    background: var(--wee-surface);
    color: var(--wee-navy);
}

:where(.wee-btn-danger) {
    border-color: var(--wee-danger);
    background: var(--wee-danger);
    color: var(--wee-on-color);
}

:where(.wee-btn-success) {
    border-color: var(--wee-teal);
    background: var(--wee-teal);
    color: var(--wee-on-color);
}

:where(.wee-btn-outline) {
    border-color: var(--wee-navy);
    background: transparent;
    color: var(--wee-navy);
}

:where(.wee-btn-link) {
    min-height: 0;
    padding: 2px;
    border: 0;
    background: none;
    color: var(--wee-teal-dark);
    text-decoration: underline;
}

:where(.wee-btn-icon) {
    width: 36px;
    min-height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: transparent;
    color: var(--wee-muted);
}

:where(.wee-btn):where(.is-small) {
    min-height: 30px;
    padding: var(--wee-space-1) var(--wee-space-3);
    font-size: var(--wee-font-size-sm);
}

:where(.wee-btn-primary):hover:not(:disabled, .is-disabled) {
    background: var(--wee-navy-hover);
    border-color: var(--wee-navy-hover);
}

:where(.wee-btn-secondary, .wee-btn-outline):hover:not(:disabled, .is-disabled) {
    background: var(--wee-hover-bg);
}

:where(.wee-btn-danger, .wee-btn-success):hover:not(:disabled, .is-disabled) {
    filter: brightness(.95);
}

:where(.wee-btn-icon):hover:not(:disabled, .is-disabled) {
    background: var(--wee-hover-bg);
    color: var(--wee-navy);
}

:where(.wee-btn)[aria-busy="true"] {
    cursor: progress;
}

/* 4.6 Badges de color: Pagado:success, Pendiente:warning… */
:where(.wee-badge) {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--wee-radius-pill);
    background: var(--wee-neutral-soft);
    color: var(--wee-neutral);
    font-size: 12px;
    font-weight: var(--wee-font-weight-bold);
    white-space: nowrap;
}

:where(.wee-badge-success) {
    background: var(--wee-success-soft);
    color: var(--wee-success);
}

:where(.wee-badge-warning) {
    background: var(--wee-warning-soft);
    color: var(--wee-warning-dark);
}

:where(.wee-badge-danger) {
    background: var(--wee-danger-soft);
    color: var(--wee-danger-dark);
}

:where(.wee-badge-info) {
    background: var(--wee-info-soft);
    color: var(--wee-info-dark);
}

:where(.wee-badge-primary) {
    background: var(--wee-primary-soft);
    color: var(--wee-navy);
}

:where(.wee-badge-neutral) {
    background: var(--wee-neutral-soft);
    color: var(--wee-neutral);
}

/* 4.7 Íconos: el tamaño llega en --wee-icon-size; el color es el del texto. */
:where(.wee-icon) {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: var(--wee-icon-size, 16px);
    height: var(--wee-icon-size, 16px);
    vertical-align: middle;
}

:where(.wee-icon) > :where(svg, img) {
    display: block;
    width: 100%;
    height: 100%;
}

:where(.wee-icon-text) {
    width: auto;
    font-size: var(--wee-font-size-sm);
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-chevron) {
    transition: transform var(--wee-duration-base) ease;
}

/* 4.8 Spinner */
:where(.wee-spinner) {
    display: inline-block;
    flex: none;
    width: var(--wee-spinner-size, 18px);
    height: var(--wee-spinner-size, 18px);
    border: 3px solid var(--wee-success-soft);
    border-top-color: var(--wee-teal);
    border-radius: 50%;
    animation: wee-spin .8s linear infinite;
}

/* 4.9 Estado vacío / cargando / error, con "Reintentar" (WeeCore.state.html) */
:where(.wee-state) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 34px var(--wee-space-4);
    color: var(--wee-muted);
    text-align: center;
}

:where(.wee-state) > :where(.wee-icon) {
    --wee-icon-size: 20px;
}

:where(.wee-state).is-error {
    color: var(--wee-danger);
}

:where(.wee-state-text) {
    max-width: 60ch;
}

/* Con imagen grande (image en WeeCore.state.html): la imagen arriba y el texto abajo. */
:where(.wee-state).is-with-image {
    flex-direction: column;
}

:where(.wee-state-image) {
    display: block;
    max-width: 100%;
    height: auto;
}

/* 4.10 Renglones de carga (skeleton) */
:where(.wee-skeleton) {
    display: block;
    height: 12px;
    border-radius: var(--wee-radius-sm);
    background: linear-gradient(90deg, var(--wee-neutral-soft) 25%, #f7f9fb 50%, var(--wee-neutral-soft) 75%);
    background-size: 200% 100%;
    animation: wee-shimmer 1.2s infinite;
}

/* 4.11 Panel flotante (combo, menú, sugerencias, calendario, columnas).
   La posición llega en --wee-left / --wee-top (WeeCore.position). */
:where(.wee-panel) {
    position: fixed;
    z-index: var(--wee-z-panel);
    top: var(--wee-top, 0);
    left: var(--wee-left, 0);
    min-width: 210px;
    max-width: min(320px, calc(100vw - 16px));
    max-height: 70vh;
    margin: 0;
    padding: 6px;
    overflow: auto;
    border: 1px solid var(--wee-divider);
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
    color: var(--wee-text);
    box-shadow: var(--wee-shadow-lg);
    font-family: var(--wee-font);
    font-size: var(--wee-font-size-md);
    animation: wee-panel-in var(--wee-duration-fast) ease;
}

/* 4.12 Opción de una lista o menú */
:where(.wee-option) {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

:where(.wee-option):where(:hover, :focus):not(.is-disabled, :disabled, [aria-disabled="true"]) {
    outline: none;
    background: var(--wee-hover-bg);
}

:where(.wee-option):focus-visible {
    outline: 2px solid var(--wee-focus-ring);
    outline-offset: -2px;
}

:where(.wee-option).is-danger {
    color: var(--wee-danger);
}

:where(.wee-option-separator) {
    margin: 6px var(--wee-space-1);
    border-top: 1px solid var(--wee-divider);
}

:where(.wee-option-header) {
    padding: 6px 10px var(--wee-space-1);
    color: var(--wee-muted);
    font-size: 11px;
    font-weight: var(--wee-font-weight-bold);
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* Texto de una opción con subtexto (wee-combo, wee-check-group): título arriba y subtexto chico abajo. */
:where(.wee-option-content) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

:where(.wee-option-title) {
    display: flex;
    align-items: center;
    gap: var(--wee-space-2);
}

:where(.wee-option-subtext) {
    color: var(--wee-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
}

:where(.is-disabled) > :where(.wee-option-content) :where(.wee-option-subtext) {
    color: inherit;
}

/* Ícono de documento (<wee-doc-preview>) al inicio o al final del texto de la opción. */
:where(.wee-option-doc) {
    --wee-doc-icon-size: 18px;
    flex: none;
    cursor: default;
}

/* Espejo de <input type="hidden"> para .serialize() (wee-combo, wee-check-group). */
:where(.wee-form-mirror) {
    display: none;
}

/* 4.13 Casilla de checkbox / radio (la marca se dibuja con ::after) */
/* Tamaño y redondeo: --wee-checkbox-size / --wee-checkbox-radius (wee-check-group 22px, wee-combo 17px). */
:where(.wee-checkbox-box) {
    position: relative;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: var(--wee-checkbox-size, 20px);
    height: var(--wee-checkbox-size, 20px);
    border: 2px solid var(--wee-border-strong);
    border-radius: var(--wee-checkbox-radius, var(--wee-radius-sm));
    background: var(--wee-surface);
    transition: background var(--wee-duration-fast) ease, border-color var(--wee-duration-fast) ease;
}

:where(.wee-checkbox-box)::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid var(--wee-on-color);
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

:where(.wee-checkbox-box).is-radio {
    border-radius: 50%;
}

:where(.wee-checkbox-box).is-radio::after {
    width: 8px;
    height: 8px;
    border: 0;
    border-radius: 50%;
    background: var(--wee-on-color);
    transform: none;
}

:where(.wee-checkbox-box).is-selected,
:where(:checked) + :where(.wee-checkbox-box) {
    border-color: var(--wee-teal);
    background: var(--wee-teal);
}

:where(.wee-checkbox-box).is-selected::after,
:where(:checked) + :where(.wee-checkbox-box)::after {
    opacity: 1;
}

:where(:focus-visible) + :where(.wee-checkbox-box) {
    box-shadow: 0 0 0 3px var(--wee-focus-ring-soft);
}

:where(.wee-checkbox-box).is-invalid {
    border-color: var(--wee-danger);
}

/* 4.14 Chips (filtros, archivos cargados, opciones elegidas) */
:where(.wee-chip) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 5px var(--wee-space-3);
    border: 1px solid var(--wee-border-strong);
    border-radius: var(--wee-radius-pill);
    background: var(--wee-surface);
    color: var(--wee-text);
    font: inherit;
    font-size: var(--wee-font-size-sm);
}

:where(button.wee-chip) {
    cursor: pointer;
}

:where(.wee-chip):where(.is-active, .is-selected) {
    border-color: var(--wee-teal);
    background: var(--wee-teal-soft);
    color: var(--wee-teal-dark);
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-chip-remove) {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: none;
    color: var(--wee-muted);
    cursor: pointer;
}

/* 4.15 Barra de progreso: el ancho llega en --wee-progress (0% a 100%) */
:where(.wee-progress) {
    position: relative;
    display: block;
    height: 4px;
    overflow: hidden;
    border-radius: var(--wee-radius-pill);
    background: var(--wee-track);
}

:where(.wee-progress)::after {
    content: '';
    display: block;
    width: var(--wee-progress, 0%);
    height: 100%;
    background: var(--wee-teal);
    transition: width var(--wee-duration-base) ease;
}

/* 4.16 Tarjeta */
:where(.wee-card) {
    border: 1px solid var(--wee-border);
    border-radius: var(--wee-radius-lg);
    background: var(--wee-surface);
    box-shadow: var(--wee-shadow-sm);
}

/* 4.17 Encabezado (azul en el tema por defecto; blanco con línea teal en gmm) */
:where(.wee-header) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--wee-space-3);
    min-height: 58px;
    padding: var(--wee-space-3) 18px;
    border-bottom: var(--wee-header-border);
    background: var(--wee-header-bg);
    color: var(--wee-header-color);
}

:where(.wee-header-title) {
    margin: 0;
    font-size: var(--wee-font-size-lg);
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-header-subtitle) {
    margin: 0;
    font-size: var(--wee-font-size-sm);
    opacity: .85;
}

/* 4.18 Resaltado de búsqueda (WeeCore.text.highlight) */
:where(.wee-mark) {
    padding: 0 1px;
    border-radius: 3px;
    background: #fff1b8;
    color: inherit;
}


/* ==========================================================================
   5. COMPONENTES
   Cada componente agrega su sección aquí cuando se migra, en este orden:
   5.1 WeeTooltip · 5.2 WeeDocPreview · 5.3 WeeNotify · 5.4 WeeInput · 5.5 WeeCombo · 5.6 WeeCheckGroup
   5.7 WeeSearch · 5.8 WeeForm · 5.9 WeeMessage · 5.10 WeeMenu · 5.11 WeeModal · 5.12 WeeFrame
   5.13 WeeTabs · 5.14 WeeCard · 5.15 WeeTable · 5.16 WeeSummary · 5.17 WeeTimeline · 5.18 WeeComments
   ========================================================================== */

/* --------------------------------------------------------------------------
   5.1 WeeTooltip
   Burbuja única (.wee-tooltip) y el ícono ⓘ junto al label (.wee-tooltip-icon).
   La posición llega en --wee-left / --wee-top y la flecha en --wee-tooltip-arrow.
   -------------------------------------------------------------------------- */

:where(.wee-tooltip) {
    position: fixed;
    inset: auto;
    top: var(--wee-top, 0);
    left: var(--wee-left, 0);
    z-index: var(--wee-z-tooltip);
    display: none;
    max-width: min(280px, calc(100vw - 16px));
    margin: 0;
    padding: var(--wee-space-2) 11px;
    overflow: visible;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: var(--wee-navy);
    color: var(--wee-on-color);
    box-shadow: var(--wee-shadow-float);
    font-size: var(--wee-font-size-sm);
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    pointer-events: none;
}

:where(.wee-tooltip).is-open {
    display: block;
    animation: wee-fade-in var(--wee-duration-fast) ease-out;
}

:where(.wee-tooltip-text) {
    position: relative;
}

:where(.wee-tooltip-arrow) {
    position: absolute;
    width: 10px;
    height: 10px;
    background: inherit;
    transform: rotate(45deg);
}

:where(.wee-tooltip)[data-side="top"] > :where(.wee-tooltip-arrow) {
    bottom: -4px;
    left: calc(var(--wee-tooltip-arrow, 50%) - 5px);
}

:where(.wee-tooltip)[data-side="bottom"] > :where(.wee-tooltip-arrow) {
    top: -4px;
    left: calc(var(--wee-tooltip-arrow, 50%) - 5px);
}

:where(.wee-tooltip)[data-side="left"] > :where(.wee-tooltip-arrow) {
    right: -4px;
    top: calc(var(--wee-tooltip-arrow, 50%) - 5px);
}

:where(.wee-tooltip)[data-side="right"] > :where(.wee-tooltip-arrow) {
    left: -4px;
    top: calc(var(--wee-tooltip-arrow, 50%) - 5px);
}

:where(.wee-tooltip-icon) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--wee-tooltip-icon-size, 16px);
    height: var(--wee-tooltip-icon-size, 16px);
    margin: 0 var(--wee-space-1);
    vertical-align: -3px;
    border-radius: 50%;
    color: var(--wee-navy);
    cursor: help;
    opacity: .8;
}

:where(.wee-tooltip-icon):where(:hover, :focus-visible) {
    opacity: 1;
}

:where(.wee-tooltip-icon) > :where(.wee-icon) {
    --wee-icon-size: 100%;
}

:where(.wee-tooltip-icon) :where(img) {
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   5.2 WeeDocPreview
   Ícono (.wee-doc-button), miniatura (.wee-doc-previewer) y visor oscuro (.wee-doc-viewer).
   Tamaño del ícono: --wee-doc-icon-size. La miniatura recibe su posición y tamaño en variables.
   -------------------------------------------------------------------------- */

:where(wee-doc-preview) {
    display: inline-flex;
    vertical-align: middle;
}

:where(.wee-doc-button) {
    display: inline-flex;
    align-items: center;
    gap: var(--wee-space-2);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-sm);
    background: none;
    color: var(--wee-text);
    font: inherit;
    cursor: pointer;
    transition: opacity var(--wee-duration-base) ease;
}

:where(.wee-doc-button):hover:not(:disabled) {
    opacity: .75;
}

:where(.wee-doc-icon) {
    display: block;
    width: var(--wee-doc-icon-size, 26px);
    height: var(--wee-doc-icon-size, 26px);
    object-fit: contain;
}

:where(.wee-doc-label) {
    text-decoration: underline;
}

/* Miniatura */
:where(.wee-doc-previewer) {
    position: fixed;
    inset: auto;
    top: var(--wee-top, 0);
    left: var(--wee-left, 0);
    z-index: var(--wee-z-panel);
    display: none;
    flex-direction: column;
    width: var(--wee-doc-previewer-width, 300px);
    height: var(--wee-doc-previewer-height, 380px);
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--wee-border);
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
    box-shadow: var(--wee-shadow-float);
    pointer-events: auto;
    overscroll-behavior: contain;
}

:where(.wee-doc-previewer).is-open {
    display: flex;
    animation: wee-panel-in .15s ease-out;
}

:where(.wee-doc-previewer-title) {
    flex: 0 0 auto;
    padding: var(--wee-space-2) var(--wee-space-3);
    overflow: hidden;
    background: var(--wee-navy);
    color: var(--wee-on-color);
    font-size: var(--wee-font-size-sm);
    font-weight: var(--wee-font-weight-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

:where(.wee-doc-previewer-body) {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 0;
    background: var(--wee-neutral-soft);
}

:where(.wee-doc-previewer-body) > .wee-doc-state {
    color: var(--wee-muted);
    padding: var(--wee-space-4);
    font-size: 13px;
}

/* Visor a pantalla completa */
:where(.wee-doc-viewer) {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--wee-viewer-bg);
    color: var(--wee-on-color);
}

:where(.wee-doc-viewer)[open] {
    display: flex;
    flex-direction: column;
}

:where(.wee-doc-viewer)::backdrop {
    background: var(--wee-backdrop);
}

:where(.wee-doc-viewer).is-fallback {
    position: fixed;
    inset: 0;
    z-index: var(--wee-z-panel);
}

:where(.wee-doc-viewer-bar) {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    min-height: 56px;
    padding: var(--wee-space-2) var(--wee-space-3) var(--wee-space-2) var(--wee-space-5);
    background: var(--wee-navy);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

:where(.wee-doc-viewer-title) {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: var(--wee-font-size-lg);
    font-weight: var(--wee-font-weight-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.wee-doc-counter) {
    min-width: 56px;
    font-size: var(--wee-font-size-sm);
    text-align: center;
    opacity: .85;
}

:where(.wee-doc-tool) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0;
    padding: 0 var(--wee-space-2);
    border: 0;
    border-radius: var(--wee-radius-md);
    background: none;
    color: var(--wee-on-color);
    font: inherit;
    cursor: pointer;
}

:where(.wee-doc-tool):hover:not(:disabled) {
    background: var(--wee-on-color-hover);
}

:where(.wee-doc-tool):focus-visible {
    outline-color: var(--wee-on-color);
}

:where(.wee-doc-tool-icon) {
    width: 22px;
    height: 22px;
    background: currentColor;
    -webkit-mask: var(--wee-doc-tool-icon) center / contain no-repeat;
    mask: var(--wee-doc-tool-icon) center / contain no-repeat;
}

:where(.wee-doc-viewer-stage) {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: auto;
}

:where(.wee-doc-frame) {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--wee-surface);
}

:where(.wee-doc-image) {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

:where(.wee-doc-viewer-stage) > :where(.wee-doc-image) {
    padding: var(--wee-space-6);
}

:where(.wee-doc-viewer-stage) > .wee-doc-state {
    flex-direction: column;
    gap: 14px;
    max-width: 360px;
    padding: var(--wee-space-6);
    color: var(--wee-viewer-text);
    font-size: var(--wee-font-size-lg);
}

:where(.wee-doc-viewer-stage) :where(.wee-spinner) {
    --wee-spinner-size: 40px;
    border-color: var(--wee-on-color-track);
    border-top-color: var(--wee-on-color);
}

/* --------------------------------------------------------------------------
   5.3 WeeNotify
   Pila por posición (.wee-toast-stack) y cada notificación (.wee-toast).
   La cuenta regresiva dura --wee-toast-duration; el avance llega en --wee-progress.
   -------------------------------------------------------------------------- */

@keyframes wee-toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@keyframes wee-toast-out {
    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

@keyframes wee-toast-timer {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

:where(.wee-toast-stack) {
    position: fixed;
    z-index: var(--wee-z-notify);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

:where(.wee-toast-stack).is-top-right {
    top: var(--wee-space-4);
    right: var(--wee-space-4);
}

:where(.wee-toast-stack).is-top-left {
    top: var(--wee-space-4);
    left: var(--wee-space-4);
}

:where(.wee-toast-stack).is-top-center {
    top: var(--wee-space-4);
    left: 50%;
    transform: translateX(-50%);
}

:where(.wee-toast-stack).is-bottom-right {
    right: var(--wee-space-4);
    bottom: var(--wee-space-4);
}

:where(.wee-toast-stack).is-bottom-left {
    bottom: var(--wee-space-4);
    left: var(--wee-space-4);
}

:where(.wee-toast-stack).is-bottom-center {
    bottom: var(--wee-space-5);
    left: 50%;
    align-items: center;
    transform: translateX(-50%);
}

:where(.wee-toast-stack).is-compact {
    width: auto;
    max-width: calc(100vw - 32px);
}

:where(.wee-toast) {
    --wee-toast-color: var(--wee-navy);
    --wee-toast-ink: var(--wee-navy);
    position: relative;
    display: flex;
    gap: var(--wee-space-3);
    width: 100%;
    padding: 14px 14px var(--wee-space-4);
    overflow: hidden;
    border: 1px solid var(--wee-divider);
    border-left: 4px solid var(--wee-toast-color);
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
    color: var(--wee-text);
    box-shadow: var(--wee-shadow-lg);
    pointer-events: auto;
    animation: wee-toast-in var(--wee-duration-base) ease;
}

:where(.wee-toast).is-dismissable {
    cursor: pointer;
}

:where(.wee-toast).is-leaving {
    animation: wee-toast-out var(--wee-duration-base) ease forwards;
}

:where(.wee-toast).is-success {
    --wee-toast-color: var(--wee-teal);
    --wee-toast-ink: var(--wee-teal-dark);
}

:where(.wee-toast).is-error {
    --wee-toast-color: var(--wee-danger);
    --wee-toast-ink: var(--wee-danger);
}

:where(.wee-toast).is-warning {
    --wee-toast-color: var(--wee-warning);
    --wee-toast-ink: var(--wee-warning-dark);
}

:where(.wee-toast).is-info {
    --wee-toast-color: var(--wee-info);
    --wee-toast-ink: var(--wee-info);
}

:where(.wee-toast-icon) {
    display: inline-flex;
    flex: none;
    padding-top: 2px;
    color: var(--wee-toast-ink);
}

:where(.wee-toast-icon) > :where(.wee-icon) {
    --wee-icon-size: 24px;
}

:where(.wee-toast-spinner) {
    --wee-spinner-size: 24px;
    margin: 2px;
    border-color: var(--wee-border);
    border-top-color: var(--wee-navy);
}

:where(.wee-toast-body) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding-top: 3px;
}

:where(.wee-toast-title) {
    font-size: 14px;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-toast-message) {
    color: var(--wee-muted);
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

:where(.wee-toast-body) > :where(.wee-toast-message):first-child {
    color: var(--wee-text);
    font-size: 14px;
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-toast-count) {
    margin-left: var(--wee-space-1);
    padding: 0 6px;
    border-radius: var(--wee-radius-pill);
    background: var(--wee-hover-bg);
    color: var(--wee-muted);
    font-size: 11px;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-toast-progress) {
    margin-top: var(--wee-space-2);
}

:where(.wee-toast-actions) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wee-space-3);
    margin-top: 6px;
}

:where(.wee-toast-action) {
    padding: 0;
    border: 0;
    background: none;
    color: var(--wee-navy);
    font: inherit;
    font-size: 13px;
    font-weight: var(--wee-font-weight-bold);
    text-decoration: underline;
    cursor: pointer;
}

:where(.wee-toast-close) {
    flex: none;
    width: 26px;
    min-height: 26px;
    margin: -4px -4px 0 0;
    border-radius: var(--wee-radius-sm);
    color: var(--wee-placeholder);
}

:where(.wee-toast-close) > :where(.wee-icon) {
    --wee-icon-size: 15px;
}

:where(.wee-toast-timer) {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--wee-toast-color);
    opacity: .55;
    transform-origin: left;
    animation: wee-toast-timer var(--wee-toast-duration, 4000ms) linear forwards;
}

:where(.wee-toast).is-paused > :where(.wee-toast-timer) {
    animation-play-state: paused;
}

/* Compacta: píldora azul abajo al centro */
:where(.wee-toast).is-compact {
    align-items: center;
    width: auto;
    padding: 10px 18px;
    border: 0;
    border-radius: var(--wee-radius-pill);
    background: var(--wee-navy);
    color: var(--wee-on-color);
    box-shadow: 0 8px 18px -10px rgba(4, 45, 111, .6);
}

:where(.wee-toast).is-compact > :where(.wee-toast-body) {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 0;
}

:where(.wee-toast).is-compact :where(.wee-toast-message) {
    color: var(--wee-on-color);
    font-size: var(--wee-font-size-md);
    font-weight: 500;
}

:where(.wee-toast).is-compact :where(.wee-toast-actions) {
    margin: 0;
}

:where(.wee-toast).is-compact :where(.wee-toast-action) {
    color: var(--wee-accent);
}

:where(.wee-toast).is-compact > :where(.wee-toast-timer) {
    display: none;
}

:where(.wee-toast).is-compact > :where(.wee-toast-close) {
    margin: 0 -6px 0 0;
    color: var(--wee-on-color);
    opacity: .8;
}


/* --------------------------------------------------------------------------
   5.4 WeeInput
   Campo (.wee-control.wee-input-control) con prefix / suffix, calendario (.wee-picker), checkbox / switch
   (.wee-input-check), textarea con contador y archivos (botones, dropzone, vista de cargados y modal).
   -------------------------------------------------------------------------- */

:where(wee-input) {
    display: flex;
    flex-direction: column;
}

/* type="file": bloque, y la fila de botones como texto en línea (sigue el text-align de donde esté). */
:where(wee-input.is-file) {
    display: block;
}

:where(wee-input.is-disabled) :where(.wee-label) {
    opacity: var(--wee-disabled-opacity);
}

:where(wee-input) :where(.wee-label.text-primary, .wee-input-check-label.text-primary) {
    color: #2f567d;
}

/* error-hidden: solo el rojo; el texto queda para lectores de pantalla. En wee-search solo el error (el aviso de
   min-chars se sigue viendo). */
:where(wee-input, wee-combo, wee-check-group)[error-hidden] :where(.wee-error-text),
:where(wee-search[error-hidden]) :where(.wee-search-message.is-error) {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

:where(.wee-input-wrap) {
    position: relative;
}

:where(.wee-input-control) {
    min-height: var(--wee-control-height, 44px);
    line-height: 18px;
}

:where(wee-input.is-invalid) :where(.wee-input-control) {
    --wee-control-border: var(--wee-danger);
}

:where(.wee-input-control).is-with-suffix {
    padding-right: 56px;
}

:where(.wee-input-control).is-with-prefix {
    padding-left: 56px;
}

:where(.wee-input-control)[type="password"]::-ms-reveal,
:where(.wee-input-control)[type="password"]::-ms-clear {
    display: none;
}

:where(.wee-input-prefix, .wee-input-suffix) {
    /* !important dentro de la capa: le gana a reglas globales del proyecto (p. ej. span { position: relative }). */
    position: absolute !important;
    top: 50%;
    display: flex;
    align-items: center;
    color: var(--wee-placeholder);
    font-size: var(--wee-font-size-xs);
    font-weight: var(--wee-font-weight-semibold);
    transform: translateY(-50%);
    pointer-events: none;
}

:where(.wee-input-suffix) {
    right: 14px;
}

:where(.wee-input-prefix) {
    left: 14px;
}

/* Elemento del autor en slot (p. ej. <wee-doc-preview>): mismo lugar que un afijo, pero con clic. */
:where(.wee-input-affix-element) {
    --wee-doc-icon-size: 22px;
    font-weight: inherit;
    pointer-events: auto;
}

:where(.wee-input-label-affix) {
    --wee-doc-icon-size: 18px;
    margin: 0 6px;
    vertical-align: middle;
}

:where(.wee-input-affix-icon) {
    display: block;
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
}

:where(.wee-input-password-toggle, .wee-input-picker-toggle) {
    margin: 0;
    border: 0;
    border-radius: var(--wee-radius-sm);
    background: none;
    font: inherit;
    cursor: pointer;
    pointer-events: auto;
}

:where(.wee-input-password-toggle) {
    padding: 0;
    color: inherit;
}

:where(.wee-input-password-toggle) :where(.wee-input-affix-icon) {
    border-radius: 0;
    opacity: .75;
    transition: opacity var(--wee-duration-fast) ease;
}

:where(.wee-input-password-toggle):where(:hover, :focus-visible) :where(.wee-input-affix-icon) {
    opacity: 1;
}

:where(wee-input.is-disabled) :where(.wee-input-password-toggle) {
    pointer-events: none;
}

:where(.wee-input-picker-toggle) {
    padding: 2px;
    color: var(--wee-teal);
}

:where(.wee-input-picker-icon) {
    --wee-icon-size: 18px;
}

/* ---- Calendario (type="date" / type="month") ---- */

:where(.wee-picker) {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    width: 292px;
    padding: var(--wee-space-3);
    border: 1px solid var(--wee-border);
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
    box-shadow: var(--wee-shadow-md);
    color: var(--wee-text);
    font-size: 13px;
}

:where(.wee-picker).is-up {
    top: auto;
    bottom: calc(100% + 6px);
}

:where(.wee-picker-head) {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--wee-space-2);
}

:where(.wee-picker-head) :where(select) {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px var(--wee-space-2);
    border: 1px solid var(--wee-border);
    border-radius: var(--wee-radius-md);
    background: var(--wee-surface);
    color: var(--wee-text);
    font: inherit;
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-picker-nav, .wee-picker-cell, .wee-picker-action) {
    border: 0;
    border-radius: var(--wee-radius-md);
    background: none;
    font: inherit;
    cursor: pointer;
}

:where(.wee-picker-nav) {
    flex: none;
    width: 30px;
    height: 30px;
    color: var(--wee-teal);
    font-size: 20px;
    line-height: 1;
}

:where(.wee-picker-weekdays, .wee-picker-grid) {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

:where(.wee-picker-weekdays) {
    margin-bottom: var(--wee-space-1);
    color: var(--wee-placeholder);
    font-size: var(--wee-font-size-xs);
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-picker-grid).is-months {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

:where(.wee-picker-cell) {
    height: 34px;
    color: var(--wee-text);
}

:where(.wee-picker-grid.is-months) :where(.wee-picker-cell) {
    height: 40px;
}

:where(.wee-picker-nav, .wee-picker-cell):hover,
:where(.wee-picker-action):hover:not(:disabled) {
    background: var(--wee-hover-bg);
}

:where(.wee-picker-cell, .wee-picker-action, .wee-picker-nav):focus-visible {
    outline-offset: -2px;
}

:where(.wee-picker-cell).is-outside {
    color: var(--wee-placeholder);
}

:where(.wee-picker-cell).is-today {
    box-shadow: inset 0 0 0 1px var(--wee-teal);
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-picker-cell).is-selected {
    background: var(--wee-teal);
    color: var(--wee-on-color);
    font-weight: var(--wee-font-weight-semibold);
}

/* Día bloqueado: tachado, sin la opacidad general de deshabilitado. */
:where(.wee-picker-cell).is-disabled {
    background: none;
    color: #c4ccd4;
    text-decoration: line-through;
    opacity: 1;
    cursor: not-allowed;
}

:where(.wee-picker-foot) {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: var(--wee-space-2);
    border-top: 1px solid var(--wee-border);
}

:where(.wee-picker-action) {
    padding: 6px 10px;
    color: var(--wee-teal-dark);
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-picker-action):disabled {
    color: var(--wee-placeholder);
    opacity: 1;
}

/* ---- Calendario por default (sin picker-style="classic") ----
   Encabezado ‹ Nov ⌄ 2026 ⌄ ›, días Lu–Do, solo los días del mes y sin Hoy / Limpiar; se abre bajo el ícono
   (a la izquierda). picker-style="classic" (o WeeInput.pickerStyle = 'classic') deja el de arriba. */

:where(.wee-picker:not(.is-classic)) {
    right: auto;
    left: 0;
    width: 252px;
    padding: 12px 14px;
    border-radius: 10px;
}

:where(.wee-picker:not(.is-classic)) :where(.wee-picker-head) {
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 10px;
}

:where(.wee-picker-selects) {
    display: flex;
    align-items: center;
    gap: 10px;
}

:where(.wee-picker-select) {
    position: relative;
    display: inline-flex;
    align-items: center;
}

:where(.wee-picker:not(.is-classic)) :where(.wee-picker-select) :where(select) {
    flex: none;
    padding: 2px 22px 2px 4px;
    border: 0;
    border-radius: var(--wee-radius-sm);
    background: transparent;
    color: var(--wee-text);
    font-size: 15px;
    font-weight: var(--wee-font-weight-bold);
    cursor: pointer;
    appearance: none;
}

:where(.wee-picker-select) :where(select):hover {
    background: var(--wee-hover-bg);
}

:where(.wee-picker-select-icon) {
    --wee-icon-size: 16px;
    position: absolute;
    right: 3px;
    color: var(--wee-teal);
    pointer-events: none;
}

:where(.wee-picker-select-icon, .wee-picker-nav-icon) > :where(svg) {
    stroke-width: 3;
}

:where(.wee-picker:not(.is-classic)) :where(.wee-picker-nav) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--wee-text);
}

:where(.wee-picker-nav-icon) {
    --wee-icon-size: 16px;
}

:where(.wee-picker:not(.is-classic)) :where(.wee-picker-weekdays) {
    margin-bottom: 6px;
    color: var(--wee-text);
    font-size: 13px;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-picker:not(.is-classic)) :where(.wee-picker-grid) {
    row-gap: 4px;
}

:where(.wee-picker:not(.is-classic)) :where(.wee-picker-grid:not(.is-months)) :where(.wee-picker-cell) {
    height: 28px;
    border-radius: var(--wee-radius-sm);
    font-size: 13px;
}

:where(.wee-picker:not(.is-classic)) :where(.wee-picker-cell).is-selected {
    color: var(--wee-text);
}

:where(.wee-picker-cell).is-empty {
    pointer-events: none;
}

/* ---- curp / rfc: letras que el servicio marcó como incorrectas ---- */

:where(.wee-input-char-marks) {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid transparent;
    color: var(--wee-text);
    white-space: pre;
    pointer-events: none;
}

:where(.wee-input-char-marks) > :where(.is-wrong) {
    border-radius: 2px;
    background: var(--wee-danger-soft);
    color: var(--wee-danger);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* El texto real queda debajo (transparente) para conservar cursor, selección y teclado. */
:where(.wee-input-control).is-with-marks {
    color: transparent;
    caret-color: var(--wee-text);
}

/* ---- checkbox / switch ---- */

:where(.wee-input-check) {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

:where(.wee-input-check-visual) {
    position: relative;
    flex: none;
    width: 20px;
    height: 20px;
}

:where(.wee-input-check-visual) > :where(.wee-checkbox-box) {
    position: absolute;
    inset: 0;
}

/* La casilla nativa queda invisible encima del dibujo: conserva teclado, foco y lectores de pantalla. */
:where(.wee-input-check-input) {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: inherit;
}

:where(.wee-input-check-label) {
    color: var(--wee-text);
    font-size: var(--wee-font-size-md);
    user-select: none;
}

/* subtext="…": segunda línea, igual que en wee-combo y wee-check-group. */
:where(.wee-input-check-subtext) {
    display: block;
    margin-top: 2px;
    color: var(--wee-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
}

/* Deshabilitado: solo se atenúa el dibujo (la casilla nativa sigue invisible). */
:where(.wee-input-check-input:disabled) + :where(.wee-checkbox-box, .wee-input-switch-track) {
    opacity: var(--wee-disabled-opacity);
}

:where(wee-input.is-invalid) :where(.wee-checkbox-box) {
    border-color: var(--wee-danger);
}

:where(wee-input.is-boolean.is-disabled) :where(.wee-input-check) {
    cursor: not-allowed;
}

:where(wee-input.is-boolean.is-readonly) :where(.wee-input-check, .wee-input-check-input) {
    cursor: default;
}

:where(.wee-input-switch) {
    position: relative;
    flex: none;
    width: 48px;
    height: 26px;
}

:where(.wee-input-switch-track) {
    position: absolute;
    inset: 0;
    border-radius: var(--wee-radius-pill);
    background: var(--wee-switch-off);
    box-shadow: 0 2px 8px rgba(10, 37, 64, .12);
    transition: background var(--wee-duration-base) ease, box-shadow var(--wee-duration-base) ease;
}

:where(.wee-input-switch-knob) {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--wee-surface);
    box-shadow: 0 2px 6px rgba(10, 37, 64, .28);
    transition: transform var(--wee-duration-base) ease;
}

:where(:checked) + :where(.wee-input-switch-track) {
    background: var(--wee-switch-on);
}

:where(:checked) + :where(.wee-input-switch-track) > :where(.wee-input-switch-knob) {
    transform: translateX(22px);
}

:where(:focus-visible) + :where(.wee-input-switch-track) {
    box-shadow: 0 0 0 3px var(--wee-focus-ring-soft), 0 2px 8px rgba(10, 37, 64, .12);
}

:where(wee-input.is-switch.is-invalid) :where(.wee-input-switch-track) {
    box-shadow: 0 0 0 2px var(--wee-danger);
}

/* ---- textarea ----
   Colores: --wee-textarea-bg  --wee-textarea-border  --wee-textarea-text  --wee-textarea-placeholder
            --wee-textarea-counter  --wee-textarea-focus */

:where(.wee-input-textarea) {
    --wee-control-border: var(--wee-textarea-border, #dcdbe0);
    display: block;
    min-height: 120px;
    padding: var(--wee-space-4) var(--wee-space-5);
    border-radius: var(--wee-radius-lg);
    color: var(--wee-textarea-text, var(--wee-text));
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

:where(.wee-input-textarea):focus {
    --wee-control-border: var(--wee-textarea-focus, var(--wee-teal));
}

:where(.wee-input-textarea)::placeholder {
    color: var(--wee-textarea-placeholder, #8a8a90);
}

/* background-color="…" llega en --wee-textarea-bg; deshabilitado y solo lectura conservan su gris. */
:where(.wee-input-textarea):not(:disabled, [readonly]) {
    background: var(--wee-textarea-bg, var(--wee-surface));
}

:where(wee-input.is-invalid) :where(.wee-input-textarea),
:where(.wee-input-textarea)[aria-invalid="true"] {
    --wee-control-border: var(--wee-danger);
}

/* Espacio para que el texto no quede debajo del contador. */
:where(.wee-input-wrap.is-with-counter) :where(.wee-input-textarea) {
    padding-bottom: 36px;
}

:where(.wee-input-counter) {
    position: absolute;
    right: 18px;
    bottom: var(--wee-space-3);
    color: var(--wee-textarea-counter, #3d3d42);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

:where(.wee-input-counter).is-at-limit {
    color: var(--wee-danger);
}

:where(wee-input.is-disabled) :where(.wee-input-counter) {
    opacity: .6;
}

/* ---- type="file" ----
   Colores: --wee-file-text  --wee-file-doc  --wee-file-download  --wee-file-delete  --wee-file-card-bg
            --wee-file-badge-bg */

:where(.wee-file-actions) {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--wee-space-2);
    min-height: 28px;
    color: var(--wee-file-text, var(--wee-text));
    font-size: 14px;
    font-weight: 400;
    vertical-align: middle;
}

/* Sin error no reserva espacio: los botones quedan a la altura del resto de la fila. */
:where(wee-input.is-file) :where(.wee-error-text):empty {
    min-height: 0;
    margin-top: 0;
}

:where(.wee-file-button) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-sm);
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

/* Rutas propias (Images/*.svg): la imagen con sus colores. */
:where(.wee-file-icon) {
    display: inline-block;
    flex: none;
    width: 22px;
    height: 22px;
    background: var(--wee-file-icon) center / contain no-repeat;
}

/* Íconos de la librería (imagenes/*.svg o data:), y "Agregar" en error: la silueta del ícono con el color del texto. */
:where(.wee-file-icon).is-tinted,
:where(wee-input.is-file.is-invalid) :where(.wee-file-add) :where(.wee-file-icon) {
    background: currentColor;
    -webkit-mask: var(--wee-file-icon) center / contain no-repeat;
    mask: var(--wee-file-icon) center / contain no-repeat;
}

:where(.wee-file-view) :where(.wee-file-icon) {
    width: 25px;
    height: 25px;
}

:where(.wee-file-add) :where(.wee-file-icon) {
    width: 23px;
    height: 23px;
}

:where(.wee-file-add):disabled :where(.wee-file-icon) {
    filter: grayscale(1);
}

/* "Ver archivos" subrayado; "Agregar archivos" solo al pasar el mouse. */
:where(.wee-file-view) :where(.wee-file-text),
:where(.wee-file-add):not(:disabled):hover :where(.wee-file-text) {
    text-decoration: underline;
}

:where(.wee-file-badge) {
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--wee-file-badge-bg, #2ed5a3);
    color: var(--wee-on-color);
    font-size: 10px;
    font-weight: var(--wee-font-weight-bold);
    transition: opacity var(--wee-duration-base) ease, transform var(--wee-duration-base) ease;
}

:where(.wee-file-badge):hover {
    opacity: .7;
    transform: scale(1.1);
}

/* Línea vertical en lugar del carácter "|". */
:where(.wee-file-divider) {
    width: 0;
    height: 26px;
    margin: 0 6px;
    border-left: 2px solid var(--wee-file-text, var(--wee-text));
    font-size: 0;
}

/* Solo lectura / deshabilitado: no se puede agregar, así que no se muestra "| Agregar archivos". */
:where(wee-input.is-file:is(.is-readonly, .is-disabled)) :where(.wee-file-divider, .wee-file-add) {
    display: none;
}

:where(wee-input.is-file.is-invalid) :where(.wee-file-add) {
    color: var(--wee-danger);
}

:where(wee-input.is-file.is-disabled) :where(.wee-file-actions) {
    opacity: .85;
}

/* Sin dropzone: al arrastrar encima se marca el área de botones. */
:where(wee-input.is-file.is-dragover:not(.is-with-dropzone)) :where(.wee-file-actions),
:where(.wee-file-dialog.is-dragover) :where(.wee-file-grid) {
    border-radius: var(--wee-radius-md);
    outline: 2px dashed var(--wee-teal);
    outline-offset: 4px;
}

/* ---- dropzone ---- */

:where(.wee-dropzone) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    width: var(--wee-dropzone-width, 100%);
    max-width: 100%;
    min-height: var(--wee-dropzone-height, 72px);
    padding: var(--wee-space-3) var(--wee-space-5);
    border: 1px dashed var(--wee-dropzone-border, #5b6670);
    border-radius: var(--wee-radius);
    background: var(--wee-dropzone-bg, var(--wee-surface));
    color: var(--wee-file-text, var(--wee-text));
    cursor: pointer;
    transition: border-color var(--wee-duration-fast) ease, background-color var(--wee-duration-fast) ease;
}

:where(.wee-dropzone-icon) {
    --wee-icon-size: 28px;
    color: var(--wee-teal);
}

:where(.wee-dropzone-body) {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
}

:where(.wee-dropzone-link) {
    color: var(--wee-dropzone-link, var(--wee-teal-dark));
    text-decoration: underline;
}

:where(.wee-dropzone-hint) {
    font-size: 13px;
}

:where(.wee-dropzone-count) {
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-dropzone):not([aria-disabled="true"]):hover,
:where(wee-input.is-dragover) :where(.wee-dropzone) {
    border-color: var(--wee-teal);
    background: var(--wee-dropzone-active-bg, #f0fbf8);
}

:where(wee-input.is-file.is-invalid) :where(.wee-dropzone) {
    border-color: var(--wee-danger);
}

/* Con dropzone, "Agregar archivos" sobra: debajo solo "Ver archivos" y el contador cuando hay archivos. */
:where(wee-input.is-with-dropzone) :where(.wee-file-add, .wee-file-divider) {
    display: none;
}

:where(wee-input.is-with-dropzone) :where(.wee-file-actions) {
    margin-top: var(--wee-space-2);
}

:where(wee-input.is-with-dropzone) :where(.wee-file-actions):not(:has(> :not([hidden], .wee-file-add, .wee-file-divider, input))),
:where(wee-input.is-showing-loaded) :where(.wee-file-actions) {
    display: none;
}

/* ---- Vista de cargados (dropzone lleno) ---- */

:where(.wee-loaded) {
    width: var(--wee-dropzone-width, 100%);
    max-width: 100%;
    color: var(--wee-file-text, var(--wee-text));
    font-size: var(--wee-font-size-md);
}

:where(.wee-loaded-box, .wee-loaded-single) {
    border: 1px solid var(--wee-loaded-border, var(--wee-border-strong));
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
}

:where(.wee-loaded-box) {
    padding: var(--wee-space-3) var(--wee-space-4);
}

:where(.wee-loaded-head) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--wee-space-3);
    margin-bottom: 6px;
}

:where(.wee-loaded.is-view-thumbs) > :where(.wee-loaded-head) {
    margin-bottom: 10px;
}

:where(.wee-loaded-title) {
    font-size: 14px;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-loaded-check) {
    color: var(--wee-teal);
}

:where(.wee-loaded-badge) {
    padding: 3px 10px;
    border-radius: var(--wee-radius-pill);
    background: var(--wee-success-soft);
    color: var(--wee-success);
    font-size: 12px;
    font-weight: var(--wee-font-weight-bold);
    white-space: nowrap;
}

:where(.wee-loaded-row) {
    display: flex;
    align-items: center;
    gap: var(--wee-space-3);
    padding: 9px 0;
    border-top: 1px solid var(--wee-neutral-soft);
}

:where(.wee-loaded-head) + :where(.wee-loaded-row) {
    border-top: 0;
}

:where(.wee-loaded-preview) {
    --wee-doc-icon-size: 34px;
    flex: none;
}

:where(.wee-loaded-preview).is-small {
    --wee-doc-icon-size: 22px;
}

:where(.wee-loaded-generic) :where(.wee-file-icon) {
    width: 30px;
    height: 30px;
}

:where(.wee-loaded-info) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

:where(.wee-loaded-name) {
    overflow: hidden;
    font-weight: var(--wee-font-weight-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.wee-loaded-meta) {
    color: var(--wee-placeholder);
    font-size: 12px;
}

:where(.wee-loaded-status).is-done {
    color: var(--wee-success);
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-loaded-status).is-error {
    color: var(--wee-danger);
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-loaded-progress) {
    height: 6px;
    margin-top: var(--wee-space-1);
}

:where(.wee-loaded-actions) {
    display: flex;
    flex: none;
    gap: 14px;
}

:where(.wee-loaded-action, .wee-loaded-chip-name, .wee-loaded-small, .wee-loaded-thumb-view) {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

:where(.wee-loaded-action) {
    font-size: var(--wee-font-size-sm);
    font-weight: var(--wee-font-weight-semibold);
    text-decoration: underline;
}

:where(.wee-loaded-action, .wee-loaded-small).is-link {
    color: var(--wee-teal-dark);
}

:where(.wee-loaded-action, .wee-loaded-small).is-danger {
    color: var(--wee-danger);
}

:where(.wee-loaded-single) {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: var(--wee-dropzone-height, 72px);
    padding: var(--wee-space-3) 18px;
}

:where(.wee-loaded-single) + :where(.wee-loaded-single) {
    margin-top: var(--wee-space-2);
}

:where(.wee-loaded-single).is-done {
    border-color: var(--wee-teal);
    background: var(--wee-dropzone-active-bg, #f0fbf8);
}

:where(.wee-loaded-single, .wee-loaded-chip, .wee-loaded-thumb).is-error {
    border-color: var(--wee-danger);
}

:where(.wee-loaded-chips) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wee-space-2);
    margin-top: var(--wee-space-2);
}

:where(.wee-loaded-chip) {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--wee-space-2);
    max-width: 100%;
    padding: 6px 10px;
    overflow: hidden;
    border: 1px solid var(--wee-loaded-border, var(--wee-border-strong));
    border-radius: var(--wee-radius-md);
    background: #f7f9fb;
    font-size: var(--wee-font-size-sm);
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-loaded-chip-name) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.wee-loaded-small) {
    color: var(--wee-placeholder);
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-loaded-chip, .wee-loaded-thumb) :where(.wee-loaded-progress) {
    margin: 0;
    border-radius: 0;
}

:where(.wee-loaded-chip) :where(.wee-loaded-progress) {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
}

:where(.wee-loaded-thumb) :where(.wee-loaded-progress) {
    height: 4px;
}

:where(.wee-loaded-thumbs) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--wee-loaded-thumb-size, 150px), 1fr));
    gap: var(--wee-space-3);
}

:where(.wee-loaded-thumb) {
    overflow: hidden;
    border: 1px solid #dfe5eb;
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
}

:where(.wee-loaded-thumb-view) {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--wee-loaded-thumb-height, 104px);
    background: linear-gradient(#f3f6f9, #e8edf2);
}

:where(.wee-loaded-thumb-image) {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

:where(.wee-loaded-thumb-icon) {
    width: 44px;
    height: 55px;
}

:where(.wee-loaded-tick) {
    position: absolute;
    top: var(--wee-space-2);
    right: var(--wee-space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--wee-teal);
    color: var(--wee-on-color);
    font-size: 12px;
}

:where(.wee-loaded-thumb-foot) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--wee-space-2);
    padding: var(--wee-space-2) 10px;
    font-size: var(--wee-font-size-sm);
}

/* ---- Modal con la lista de archivos ---- */

:where(.wee-file-dialog) {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
    box-shadow: var(--wee-shadow-md);
    color: var(--wee-text);
}

:where(.wee-file-dialog).is-dragover {
    background: var(--wee-surface);
}

:where(.wee-file-dialog)::backdrop {
    background: rgba(10, 37, 64, .35);
}

/* Sin showModal(): se centra a mano y la sombra hace de fondo. */
:where(.wee-file-dialog).is-fallback {
    position: fixed;
    z-index: 2000;
    inset: 0;
    box-shadow: 0 0 0 100vmax rgba(10, 37, 64, .35);
}

:where(.wee-file-dialog-body) {
    padding: var(--wee-space-6) 28px 28px;
}

:where(.wee-file-dialog-header) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--wee-space-4);
    margin-bottom: var(--wee-space-5);
    padding-bottom: var(--wee-space-3);
    border-bottom: 2px solid var(--wee-teal);
}

:where(.wee-file-dialog-title) {
    margin: 0;
    color: var(--wee-text);
    font-size: 22px;
    font-weight: var(--wee-font-weight-bold);
    line-height: 1.25;
}

:where(.wee-file-dialog-close) {
    padding: var(--wee-space-1);
    color: var(--wee-text);
}

:where(.wee-file-dialog-close) :where(.wee-file-icon) {
    width: 20px;
    height: 20px;
}

:where(.wee-file-grid) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--wee-space-3) var(--wee-space-4);
}

:where(.wee-file-card) {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 14px var(--wee-space-4);
    overflow: hidden;
    border-radius: var(--wee-radius);
    background: var(--wee-file-card-bg, #f1f4f7);
}

:where(.wee-file-open) {
    flex: 1 1 auto;
    gap: var(--wee-space-3);
    min-width: 0;
    color: var(--wee-text);
    font-size: 14px;
    font-weight: var(--wee-font-weight-semibold);
    text-align: left;
}

:where(.wee-file-open) :where(.wee-file-icon) {
    width: 26px;
    height: 26px;
    color: var(--wee-file-doc, var(--wee-teal));
}

/* <wee-doc-preview> de la tarjeta: mismo tamaño que el ícono de documento. */
:where(.wee-file-preview) {
    --wee-doc-icon-size: 26px;
    flex: none;
}

:where(.wee-file-preview) + :where(.wee-file-open) {
    gap: 0;
}

:where(.wee-file-name) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.wee-file-open):not(:disabled):hover :where(.wee-file-name) {
    text-decoration: underline;
}

:where(.wee-file-download, .wee-file-retry) {
    color: var(--wee-file-download, var(--wee-text));
}

:where(.wee-file-delete) {
    color: var(--wee-file-delete, var(--wee-danger));
}

/* Barra delgada al pie de la tarjeta; el avance llega en --wee-progress. */
:where(.wee-file-progress) {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
}

:where(.wee-file-card).is-uploading :where(.wee-file-name) {
    opacity: .7;
}

:where(.wee-file-card).is-error {
    box-shadow: inset 0 0 0 1px var(--wee-danger);
}

:where(.wee-file-card).is-error :where(.wee-file-name) {
    color: var(--wee-danger);
}

/* --------------------------------------------------------------------------
   5.5 WeeCombo
   Caja (.wee-control.wee-combo-control) o chip dentro de un input (.wee-combo-chip.is-suffix / is-prefix).
   El panel cuelga del combo (o del .wee-input-wrap en suffix/prefix) y se muestra con wee-combo.is-open.
   -------------------------------------------------------------------------- */

:where(wee-combo) {
    position: relative;
    display: block;
}

/* suffix/prefix: el chip y el panel se acomodan respecto al .wee-input-wrap que los contiene. */
:where(wee-combo.is-suffix, wee-combo.is-prefix) {
    display: contents;
}

:where(wee-combo.is-disabled) > :where(.wee-label) {
    opacity: var(--wee-disabled-opacity);
}

:where(.wee-combo-control) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: var(--wee-control-height, 44px);
    cursor: pointer;
    user-select: none;
}

:where(wee-combo.is-invalid) :where(.wee-combo-control, .wee-combo-chip) {
    --wee-control-border: var(--wee-danger);
}

:where(.wee-combo-value) {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

:where(.wee-combo-text) {
    line-height: 18px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

:where(.wee-combo-text).is-placeholder {
    color: var(--wee-placeholder);
}

:where(.wee-combo-value-icon, .wee-combo-option-icon) {
    flex: none;
    width: 36px;
    height: 18px;
    border-radius: 3px;
    object-fit: contain;
}

:where(.wee-combo-count) {
    flex: none;
    line-height: 14px;
    margin-left: auto;
    padding: 2px var(--wee-space-2);
    border-radius: var(--wee-radius-pill);
    background: var(--wee-navy);
    color: var(--wee-on-color);
    font-size: 11px;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-combo-control) > :where(.wee-chevron) {
    --wee-icon-size: 14px;
    color: var(--wee-teal);
}

/* Chip dentro de un input: a la derecha (suffix) o a la izquierda (prefix). */
:where(.wee-combo-chip) {
    --wee-control-border: var(--wee-border);
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    gap: var(--wee-space-1);
    background: var(--wee-surface);
    color: var(--wee-muted);
    font-size: 10.5px;
    font-weight: var(--wee-font-weight-semibold);
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
}

:where(.wee-combo-chip).is-suffix {
    right: 10px;
    padding-left: var(--wee-space-2);
    border-left: 1px solid var(--wee-control-border);
}

:where(.wee-combo-chip).is-prefix {
    left: 10px;
    padding-right: var(--wee-space-2);
    border-right: 1px solid var(--wee-control-border);
}

:where(.wee-combo-chip) > :where(.wee-chevron) {
    --wee-icon-size: 11px;
    color: var(--wee-teal);
}

:where(.wee-combo-chip) :where(.wee-combo-value-icon) {
    width: 43px;
    height: 16px;
}

:where(.wee-combo-panel) {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    display: none;
    overflow: hidden;
    outline: none;
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
    box-shadow: var(--wee-shadow-md);
}

:where(wee-combo.is-open) > :where(.wee-combo-panel) {
    display: block;
}

:where(wee-combo.is-suffix, wee-combo.is-prefix) > :where(.wee-combo-panel) {
    top: calc(100% + 10px);
    min-width: 190px;
}

:where(wee-combo.is-suffix) > :where(.wee-combo-panel) {
    left: auto;
}

:where(wee-combo.is-prefix) > :where(.wee-combo-panel) {
    right: auto;
}

:where(.wee-combo-search) {
    padding: var(--wee-space-2);
    border-bottom: 1px solid var(--wee-border);
}

:where(.wee-combo-search-input) {
    width: 100%;
    padding: var(--wee-space-2) 10px;
    border: 0;
    border-radius: var(--wee-radius-md);
    outline: none;
    background: var(--wee-surface);
    color: var(--wee-text);
    font: inherit;
    font-size: 13px;
}

:where(.wee-combo-search-input)::placeholder {
    color: var(--wee-placeholder);
}

:where(.wee-combo-search-input):focus-visible {
    outline: none;
}

:where(.wee-combo-list) {
    max-height: 240px;
    padding: 6px 0;
    overflow-y: auto;
}

:where(.wee-combo-list)::-webkit-scrollbar {
    width: 6px;
}

:where(.wee-combo-list)::-webkit-scrollbar-track {
    background: transparent;
}

:where(.wee-combo-list)::-webkit-scrollbar-thumb {
    border-radius: var(--wee-radius-sm);
    background: var(--wee-navy);
}

:where(.wee-combo-option) {
    --wee-checkbox-size: 17px;
    --wee-checkbox-radius: 4px;
    align-items: flex-start;
    gap: var(--wee-space-3);
    padding: 11px 14px;
    border-radius: 0;
    color: var(--wee-text);
    font-size: var(--wee-font-size-md);
    line-height: 1.35;
}

:where(.wee-combo-option).is-selected {
    background: var(--wee-selected-bg);
}

:where(.wee-combo-option).is-disabled {
    background: var(--wee-disabled-bg);
}

:where(.wee-combo-option) > :where(.wee-checkbox-box) {
    margin-top: 1px;
}

:where(.wee-combo-option) :where(.wee-option-title) > :where(.wee-option-text) {
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-combo-empty) {
    padding: 14px;
    color: var(--wee-muted);
    font-size: 13px;
    text-align: center;
}

/* Sin min-height: solo ocupa espacio cuando hay error, para no mover los layouts existentes. */
:where(wee-combo) > :where(.wee-error-text) {
    min-height: 0;
}

:where(wee-combo) > :where(.wee-error-text):empty,
:where(wee-combo.is-suffix, wee-combo.is-prefix) > :where(.wee-error-text) {
    display: none;
}


/* --------------------------------------------------------------------------
   5.6 WeeCheckGroup
   Casillas (o radios con wee-check-group.is-radio) en columna o en fila (is-horizontal).
   La casilla nativa queda invisible encima de .wee-checkbox-box: conserva teclado, foco y lectores.
   -------------------------------------------------------------------------- */

:where(wee-check-group) {
    display: block;
    margin-bottom: 14px;
}

:where(wee-check-group.is-disabled) > :where(.wee-label) {
    opacity: var(--wee-disabled-opacity);
}

:where(.wee-check-options) {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 10px 18px;
}

:where(wee-check-group.is-horizontal) > :where(.wee-check-options) {
    flex-direction: row;
}

:where(.wee-check-option) {
    --wee-checkbox-size: 22px;
    --wee-checkbox-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--wee-space-1) 6px;
    border-radius: var(--wee-radius-sm);
    color: var(--wee-text);
    font-size: 14.5px;
    cursor: pointer;
    user-select: none;
}

/* El fondo de "seleccionado" lo da la casilla, no el renglón. */
:where(.wee-check-option).is-selected {
    background: none;
}

:where(.wee-check-option):hover {
    background: var(--wee-hover-bg);
}

:where(.wee-check-option).is-disabled:hover,
:where(wee-check-group.is-readonly) :where(.wee-check-option):hover {
    background: transparent;
}

:where(wee-check-group.is-readonly) :where(.wee-check-option) {
    cursor: default;
}

:where(.wee-check-input) {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 6px;
    width: var(--wee-checkbox-size);
    height: var(--wee-checkbox-size);
    margin: 0;
    opacity: 0;
    transform: translateY(-50%);
    cursor: inherit;
}

:where(wee-check-group.is-invalid) :where(.wee-checkbox-box) {
    border-color: var(--wee-danger);
}

:where(.wee-check-option) :where(.wee-option-text) {
    color: var(--wee-text);
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-check-empty) {
    color: var(--wee-muted);
    font-size: 13px;
}


/* variant="cards": cada opción es una tarjeta; la casilla va en la esquina y la casilla nativa cubre la tarjeta. */
:where(wee-check-group.is-cards) > :where(.wee-check-options) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

:where(wee-check-group.is-cards) :where(.wee-check-option) {
    --wee-checkbox-size: 18px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 16px 12px;
    border: 1.5px solid var(--wee-border);
    border-radius: var(--wee-radius-lg);
    background: var(--wee-surface);
    text-align: center;
    transition: border-color var(--wee-duration-fast), box-shadow var(--wee-duration-fast);
}

:where(wee-check-group.is-cards) :where(.wee-check-option):hover {
    border-color: #b9c6d4;
    background: var(--wee-surface);
}

:where(wee-check-group.is-cards) :where(.wee-check-option).is-selected {
    border-color: var(--wee-teal);
    box-shadow: 0 0 0 3px var(--wee-focus-ring-soft);
}

:where(wee-check-group.is-cards) :where(.wee-check-input) {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
}

:where(wee-check-group.is-cards) :where(.wee-checkbox-box) {
    position: absolute;
    top: 8px;
    right: 8px;
}

:where(.wee-check-option-icon) {
    --wee-icon-size: 18px;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--wee-primary-soft);
    color: var(--wee-navy);
}

:where(.wee-check-option.is-selected) > :where(.wee-check-option-icon) {
    background: var(--wee-teal-soft);
    color: var(--wee-teal-dark);
}

:where(wee-check-group.is-cards) :where(.wee-option-content) {
    align-items: center;
    min-width: 0;
    overflow-wrap: anywhere;
}

:where(wee-check-group.is-cards) :where(.wee-option-text) {
    font-size: 14px;
}

:where(wee-check-group.is-cards.is-invalid) :where(.wee-check-option) {
    border-color: #f1b3ad;
}

:where(wee-check-group.is-card-horizontal) > :where(.wee-check-options) {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

:where(wee-check-group.is-card-horizontal) :where(.wee-check-option) {
    flex-direction: row;
    justify-content: flex-start;
    padding-right: 36px;
    text-align: left;
}

:where(wee-check-group.is-card-horizontal) :where(.wee-option-content) {
    align-items: flex-start;
}

:where(wee-check-group.is-card-horizontal) :where(.wee-checkbox-box) {
    top: 50%;
    transform: translateY(-50%);
}


/* --------------------------------------------------------------------------
   5.7 WeeSearch
   Campo con lupa (.wee-control.wee-search-box), botones Buscar / Limpiar, mensaje y panel de sugerencias.
   Tema gmm (wee-search.is-theme-gmm): cuadro azul con lupa y campo con sombra.
   -------------------------------------------------------------------------- */

:where(wee-search) {
    position: relative;
    display: block;
    color: var(--wee-text);
    font-size: 14px;
}

:where(wee-search.is-disabled) > :where(.wee-label) {
    opacity: var(--wee-disabled-opacity);
}

:where(.wee-search-row) {
    display: flex;
    align-items: center;
    gap: var(--wee-space-3);
}

:where(.wee-search-box) {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    height: var(--wee-control-height, 44px);
    min-height: 0;
    padding: 0;
    font-size: inherit;
}

:where(wee-search.is-invalid) :where(.wee-search-box) {
    --wee-control-border: var(--wee-danger);
}

:where(.wee-search-icon) {
    --wee-icon-size: 18px;
    margin-left: 13px;
    color: var(--wee-muted);
}

:where(.wee-search-input) {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0 10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

:where(.wee-search-input)::placeholder {
    color: var(--wee-placeholder);
}

:where(.wee-search-input):focus-visible {
    outline: none;
}

:where(.wee-search-box) > :where(.wee-spinner) {
    --wee-spinner-size: 16px;
    margin-right: 10px;
    border-width: 2.5px;
}

:where(.wee-search-x) {
    --wee-icon-size: 15px;
    width: 28px;
    min-height: 28px;
    margin-right: var(--wee-space-2);
}

:where(wee-search.is-with-clear-button) :where(.wee-search-x) {
    display: none;
}

:where(.wee-search-button) {
    flex: none;
    height: 44px;
    padding: 0 20px;
    font-size: inherit;
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-search-message) {
    margin-top: 5px;
    font-size: var(--wee-font-size-sm);
}

:where(.wee-search-message):empty {
    display: none;
}

:where(.wee-search-message).is-hint {
    color: var(--wee-muted);
}

:where(.wee-search-message).is-error {
    color: var(--wee-danger);
}

:where(.wee-search-panel) {
    position: absolute;
    z-index: 30;
    top: 100%;
    right: 0;
    left: 0;
    max-height: 340px;
    margin-top: 6px;
    padding: 6px;
    overflow: auto;
    border: 1px solid var(--wee-divider);
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
    box-shadow: var(--wee-shadow-lg);
}

:where(.wee-search-option) {
    flex-direction: column;
    align-items: stretch;
    gap: 1px;
    border-radius: var(--wee-radius-md);
}

:where(.wee-search-option).is-active {
    background: var(--wee-hover-bg);
}

:where(.wee-search-option-text) {
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-search-option) :where(.wee-mark) {
    background: #c9f1e7;
}

:where(.wee-search-empty) {
    padding: 14px 10px;
    color: var(--wee-muted);
    text-align: center;
}

:where(.wee-search-recent) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wee-space-2);
    padding: 6px 10px 10px;
}

:where(.wee-search-recent-chip) {
    --wee-icon-size: 14px;
    border: 0;
    background: var(--wee-bg);
    color: var(--wee-navy);
}

:where(.wee-search-recent-chip):hover {
    background: #e6edf4;
}

:where(.wee-search-recent-chip) > :where(.wee-icon) {
    color: var(--wee-muted);
}

/* Tema gmm: cuadro azul con lupa, campo con sombra, botones rectos. */
:where(wee-search.is-theme-gmm) :where(.wee-search-row) {
    gap: var(--wee-space-5);
}

:where(wee-search.is-theme-gmm) :where(.wee-search-box) {
    --wee-control-border: #eef1f4;
    height: var(--wee-control-height, 44px);
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(4, 45, 111, .16);
}

:where(wee-search.is-theme-gmm) :where(.wee-search-box):focus-within {
    --wee-control-border: #eef1f4;
    box-shadow: 0 2px 6px rgba(4, 45, 111, .16), 0 0 0 2px rgba(47, 197, 169, .35);
}

:where(wee-search.is-theme-gmm.is-invalid) :where(.wee-search-box) {
    --wee-control-border: var(--wee-danger);
}

:where(wee-search.is-theme-gmm) :where(.wee-search-icon) {
    align-self: stretch;
    width: 46px;
    height: auto;
    margin: 0;
    padding: 14px;
    background: var(--wee-navy);
    color: var(--wee-teal);
}

:where(wee-search.is-theme-gmm) :where(.wee-search-input) {
    padding: 0 var(--wee-space-4);
    font-size: 15px;
}

:where(wee-search.is-theme-gmm) :where(.wee-search-button) {
    height: 42px;
    padding: 0 var(--wee-space-4);
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
}

:where(wee-search.is-theme-gmm) :where([data-search-button]) {
    margin-left: var(--wee-space-4);
}


/* --------------------------------------------------------------------------
   5.8 WeeForm
   Resumen de errores (.wee-error-summary) y barra de pasos (.wee-steps-bar). El borde rojo de los
   campos nativos (.wee-native-invalid) está en la sección 7, fuera de la capa.
   -------------------------------------------------------------------------- */

:where(.wee-error-summary) {
    margin: 0 0 var(--wee-space-4);
    padding: var(--wee-space-3) var(--wee-space-4);
    border: 1px solid var(--wee-danger);
    border-radius: var(--wee-radius);
    background: var(--wee-danger-soft);
    color: var(--wee-navy);
    font-size: var(--wee-font-size-md);
}

:where(.wee-error-summary-title) {
    margin: 0 0 6px;
    color: var(--wee-danger);
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-error-summary) :where(ul) {
    margin: 0;
    padding-left: 18px;
}

:where(.wee-error-summary) :where(li) {
    margin: 2px 0;
}

:where(.wee-error-summary-link) {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: var(--wee-font-weight-semibold);
    text-decoration: underline;
    cursor: pointer;
}

:where([data-validate].is-validating) {
    opacity: .7;
    cursor: progress;
}

:where(.wee-steps-bar) {
    margin: 0 0 28px;
    font-family: inherit;
}

:where(.wee-steps-bar) > :where(ol) {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

:where(.wee-step) {
    position: relative;
}

:where(.wee-step-button) {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--wee-space-3);
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--wee-navy);
    font: inherit;
    cursor: pointer;
}

/* El paso actual y los brincados son botones deshabilitados, pero se ven completos. */
:where(.wee-step-button):disabled {
    opacity: 1;
    cursor: default;
}

/* El foco se marca en el círculo, no en todo el botón. */
:where(.wee-step-button):focus-visible {
    outline: none;
}

:where(.wee-step-button):focus-visible > :where(.wee-step-icon) {
    outline: 2px solid var(--wee-focus-ring);
    outline-offset: 3px;
}

:where(.wee-step-icon) {
    display: flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--wee-surface);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    color: var(--wee-navy);
    transition: background-color .25s ease, box-shadow .25s ease;
}

:where(.wee-step-icon) > :where(svg) {
    width: 14px;
    height: 14px;
    stroke-width: 3;
}

:where(.wee-step-label) {
    color: var(--wee-navy);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

:where(.wee-step):where(.is-done, .is-current) :where(.wee-step-icon) {
    background: var(--wee-navy);
    box-shadow: none;
    color: var(--wee-on-color);
}

:where(.wee-step.is-current) :where(.wee-step-label) {
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-step.is-skipped) :where(.wee-step-icon) {
    background: #e0e0e0;
    box-shadow: none;
    color: #9e9e9e;
}

:where(.wee-step.is-skipped) :where(.wee-step-label) {
    color: #9e9e9e;
}

/* Barra horizontal: pasos repartidos a lo ancho, unidos por una línea teal. */
:where(.wee-steps-bar.is-horizontal) :where(.wee-step) {
    display: flex;
    flex: 1 1 0;
    justify-content: center;
}

:where(.wee-steps-bar.is-horizontal) :where(.wee-step-button) {
    flex-direction: column;
    text-align: center;
}

:where(.wee-steps-bar.is-horizontal) :where(.wee-step + .wee-step)::before {
    content: '';
    position: absolute;
    top: 14px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--wee-teal);
}

/* Barra vertical: a la izquierda del form, en columna. */
:where(.wee-steps-bar.is-vertical) > :where(ol) {
    flex-direction: column;
}

:where(.wee-steps-bar.is-vertical) :where(.wee-step) {
    padding-bottom: 28px;
}

:where(.wee-steps-bar.is-vertical) :where(.wee-step):last-child {
    padding-bottom: 0;
}

:where(.wee-steps-bar.is-vertical) :where(.wee-step):not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    bottom: -15px;
    left: 14px;
    width: 2px;
    background: var(--wee-teal);
}

:where(.wee-steps-bar.is-vertical) :where(.wee-step-button) {
    text-align: left;
}

:where(.wee-steps.is-vertical) {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    column-gap: 32px;
    align-items: start;
}

:where(.wee-steps.is-vertical) > :where(.wee-steps-bar) {
    position: sticky;
    top: var(--wee-space-4);
    grid-column: 1;
    grid-row: 1 / span 60;
}

:where(.wee-steps.is-vertical) > :where(:not(.wee-steps-bar)) {
    grid-column: 2;
}

/* steps-display="all": los pasos que siguen después del actual se ven, pero bloqueados. */
:where([steps-display="all"]) :where([step][data-step-locked]) {
    opacity: .55;
    cursor: not-allowed;
}


/* --------------------------------------------------------------------------
   5.9 WeeMessage
   <wee-message> (tipos tip · info · success · warning · error) y la ayuda debajo de los campos (hint).
   Tema wee: info, success, warning y error con fondo de color. Tema gmm: todos en blanco.
   -------------------------------------------------------------------------- */

:where(wee-message) {
    --wee-message-border: #bfeee3;
    --wee-message-bg: var(--wee-surface);
    --wee-message-icon: var(--wee-tip);
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    margin: 0 0 var(--wee-space-4);
    padding: var(--wee-space-3) 18px;
    border: 1px solid var(--wee-message-border);
    border-radius: var(--wee-radius);
    background: var(--wee-message-bg);
    color: var(--wee-text);
    font-family: var(--wee-font);
    font-size: 14px;
    line-height: 1.45;
}

:where(wee-message) :where(*),
:where(wee-message) :where(*)::before,
:where(wee-message) :where(*)::after {
    box-sizing: border-box;
}

:where(wee-message.is-info) {
    --wee-message-border: #c7dcf7;
    --wee-message-icon: var(--wee-info);
}

:where(wee-message.is-success) {
    --wee-message-border: #bfeee3;
    --wee-message-icon: var(--wee-success);
}

:where(wee-message.is-warning) {
    --wee-message-border: #f6dc9c;
    --wee-message-icon: var(--wee-warning);
}

:where(wee-message.is-error) {
    --wee-message-border: #f5c2bd;
    --wee-message-icon: var(--wee-danger);
}

:where(wee-message.is-theme-wee.is-success) {
    --wee-message-bg: #f3fbf9;
}

:where(wee-message.is-theme-wee.is-warning) {
    --wee-message-bg: #fffbf1;
}

:where(wee-message.is-theme-wee.is-error) {
    --wee-message-bg: #fef6f5;
}

:where(wee-message.is-theme-gmm) {
    --wee-message-bg: var(--wee-surface);
}

:where(.wee-message-icon) {
    --wee-icon-size: 22px;
    display: inline-flex;
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--wee-message-icon);
}

:where(.wee-message-icon) :where(img) {
    object-fit: contain;
}

:where(.wee-message-icon) :where(i) {
    font-size: 18px;
    line-height: 22px;
}

:where(.wee-message-body) {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 1px;
}

:where(.wee-message-title) {
    display: block;
    margin-bottom: 2px;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-message-text) > :first-child {
    margin-top: 0;
}

:where(.wee-message-text) > :last-child {
    margin-bottom: 0;
}

:where(.wee-message-text) :where(ol, ul) {
    margin: 6px 0 0;
    padding-left: 20px;
    color: var(--wee-muted);
}

:where(.wee-message-text) :where(li + li) {
    margin-top: 2px;
}

:where(.wee-message-text) :where(a) {
    color: var(--wee-success);
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-message-more) {
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--wee-success);
    font: inherit;
    font-weight: var(--wee-font-weight-bold);
    cursor: pointer;
}

/* collapsible: una línea hasta "Ver más". */
:where(wee-message.is-collapsible:not(.is-expanded)) :where(.wee-message-text) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

:where(.wee-message-close) {
    --wee-icon-size: 15px;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: -4px -8px -4px 0;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: none;
    color: #9aa6b2;
    cursor: pointer;
}

:where(.wee-message-close):hover {
    background: rgba(4, 45, 111, .06);
    color: var(--wee-navy);
}

/* Ayuda debajo de un campo */
:where(.wee-field-hint) {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    color: var(--wee-muted);
    font-family: var(--wee-font);
    font-size: var(--wee-font-size-sm);
    line-height: 1.4;
}

:where(.wee-field-hint-icon) {
    --wee-icon-size: 15px;
    display: inline-flex;
    flex: none;
    width: 15px;
    height: 15px;
    margin-top: 1px;
    color: var(--wee-tip);
}

/* Con ayuda, el espacio vacío del error no se reserva; cuando hay error, sale el error y se oculta la ayuda. */
:where(wee-input, wee-combo, wee-check-group, wee-search):has(> .wee-field-hint) > :where(.wee-error-text:empty) {
    display: none;
}

:where(.wee-error-text, .wee-search-message):not(:empty) ~ :where(.wee-field-hint) {
    display: none;
}

:where(wee-input, wee-combo, wee-check-group, wee-search)[error-hidden] > :where(.wee-field-hint) {
    display: flex;
}


/* --------------------------------------------------------------------------
   5.10 WeeMenu
   Disparador ⋮ (.wee-menu-kebab), botón con texto o dividido (.wee-menu-button) y la lista flotante:
   .wee-panel.wee-menu-panel con opciones .wee-option.wee-menu-item.
   -------------------------------------------------------------------------- */

:where(wee-menu) {
    display: inline-flex;
    vertical-align: middle;
}

/* Las etiquetas de las opciones solo guardan datos. */
:where(wee-menu) > :where(wee-menu-item, wee-menu-separator, wee-menu-header) {
    display: none;
}

:where(.wee-menu-trigger) {
    display: inline-flex;
}

:where(.wee-menu-kebab) {
    --wee-icon-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: transparent;
    color: var(--wee-navy);
    cursor: pointer;
}

:where(.wee-menu-kebab):where(:hover, [aria-expanded="true"]):not(:disabled) {
    background: var(--wee-hover-bg);
}

:where(.wee-menu-button) {
    --wee-icon-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: var(--wee-space-2);
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--wee-navy);
    border-radius: var(--wee-radius-sm);
    background: var(--wee-surface);
    color: var(--wee-navy);
    font: inherit;
    font-family: var(--wee-font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

:where(.wee-menu-button):not(.is-primary):hover:not(:disabled) {
    background: var(--wee-hover-bg);
}

:where(.wee-menu-button.is-primary) {
    background: var(--wee-navy);
    color: var(--wee-on-color);
}

:where(.wee-menu-button.is-primary):hover:not(:disabled) {
    background: var(--wee-navy-hover);
}

:where(wee-menu.is-split) :where(.wee-menu-button):first-child {
    border-radius: var(--wee-radius-sm) 0 0 var(--wee-radius-sm);
}

:where(wee-menu.is-split) :where(.wee-menu-button.is-arrow) {
    padding: 0 10px;
    border-left-color: rgba(255, 255, 255, .3);
    border-radius: 0 var(--wee-radius-sm) var(--wee-radius-sm) 0;
}

:where(.wee-menu-icon) {
    --wee-icon-size: 18px;
    display: inline-flex;
    flex: none;
    width: 18px;
    height: 18px;
}

:where(.wee-menu-icon):empty {
    display: none;
}

:where(.wee-menu-icon) :where(img) {
    object-fit: contain;
}

:where(.wee-menu-item.is-danger):where(:hover, :focus):not([aria-disabled="true"]) {
    background: var(--wee-danger-soft);
}

/* Deshabilitada: gris y sin el cursor de "prohibido" (el motivo va a la derecha). */
:where(.wee-menu-item)[aria-disabled="true"] {
    opacity: 1;
    background: none;
    color: #aab4bf;
    cursor: default;
}

:where(.wee-menu-text) {
    flex: 1 1 auto;
    min-width: 0;
}

:where(.wee-menu-reason) {
    margin-left: auto;
    color: #9aa6b2;
    font-size: var(--wee-font-size-xs);
    white-space: nowrap;
}


/* --------------------------------------------------------------------------
   5.11 WeeModal
   <dialog class="wee-modal"> con .wee-modal-panel (head · body · state · foot). Centrado (is-center) o
   panel lateral (is-side is-right | is-left). Variantes: wee-modal-confirm, wee-modal-loader,
   wee-modal-signature, wee-modal-contact, wee-modal-contacts. Botones: .wee-btn (sección 4.5).
   -------------------------------------------------------------------------- */

:where(html.is-modal-open) {
    overflow: hidden;
}

/* <wee-modal> escrito en la página solo guarda el contenido: se ve dentro del modal al abrirlo. */
:where(wee-modal) {
    display: none;
}

:where(.wee-modal) {
    width: min(var(--wee-modal-width, 640px), calc(100vw - 32px));
    max-width: none;
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--wee-navy);
    font-family: inherit;
    overflow: visible;
}

:where(.wee-modal)[open] {
    display: flex;
}

:where(.wee-modal)::backdrop {
    background: rgba(10, 37, 64, .45);
}

:where(.wee-modal-panel) {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: var(--wee-modal-height, auto);
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border-radius: 14px;
    background: var(--wee-surface);
    box-shadow: 0 20px 50px rgba(4, 45, 111, .25);
}

:where(.wee-modal.is-full) {
    height: calc(100vh - 32px);
}

:where(.wee-modal.is-full) > :where(.wee-modal-panel) {
    height: 100%;
}

:where(.wee-modal-head) {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--wee-space-4);
    padding: var(--wee-space-4) var(--wee-space-5);
    border-bottom: 1px solid #e6ebf0;
}

:where(.wee-modal-title) {
    margin: 0;
    color: inherit;
    font-size: 17px;
    font-weight: var(--wee-font-weight-bold);
    line-height: 1.35;
}

:where(.wee-modal-subtitle) {
    margin: 2px 0 0;
    color: var(--wee-muted);
    font-size: var(--wee-font-size-sm);
}

:where(.wee-modal-close) {
    --wee-icon-size: 16px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: -4px -6px 0 0;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: none;
    color: var(--wee-muted);
    cursor: pointer;
}

:where(.wee-modal-close):hover {
    background: #f1f4f7;
    color: var(--wee-navy);
}

/* Tema gmm (plataforma): título azul, subtítulo verde agua grande y línea verde agua abajo */
:where(.wee-modal.is-theme-gmm) :where(.wee-modal-head) {
    margin: 0 44px;
    padding: 26px 0 12px;
    border-bottom: 2px solid var(--wee-teal);
    background: var(--wee-surface);
}

:where(.wee-modal.is-theme-gmm) :where(.wee-modal-title) {
    color: var(--wee-navy);
    font-size: 21px;
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-modal.is-theme-gmm) :where(.wee-modal-subtitle) {
    margin-top: 10px;
    color: var(--wee-teal);
    font-size: 21px;
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-modal.is-theme-gmm) :where(.wee-modal-close) {
    --wee-icon-size: 20px;
    margin: -6px -26px 0 0;
    color: var(--wee-navy);
}

:where(.wee-modal.is-theme-gmm) :where(.wee-modal-close) :where(svg) {
    stroke-width: 3;
}

:where(.wee-modal-body) {
    flex: 1 1 auto;
    min-height: 0;
    padding: 18px var(--wee-space-5);
    overflow: auto;
    font-size: var(--wee-font-size-md);
}

/* Cargando y error dentro del modal */
:where(.wee-modal-state) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

:where(.wee-modal-state) > :where(.wee-state) {
    --wee-spinner-size: 34px;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 180px;
    padding: 28px var(--wee-space-5);
    font-size: var(--wee-font-size-md);
}

/* También el error va en gris (.wee-state.is-error lo pondría rojo): el rojo lo lleva el ícono. */
:where(.wee-modal-state) > .wee-state {
    color: var(--wee-muted);
}

:where(.wee-modal-state) :where(.wee-spinner) {
    border-width: 4px;
}

:where(.wee-modal-state-title) {
    color: var(--wee-navy);
    font-size: 14.5px;
}

:where(.wee-modal-foot) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px var(--wee-space-5);
    border-top: 1px solid #e6ebf0;
    background: #fafbfc;
}

:where(.wee-modal-foot) > :where(div) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

:where(.wee-modal-foot) > :where(div):empty {
    display: none;
}

:where(.wee-modal-foot-center) {
    margin-inline: auto;
}

:where(.wee-modal-foot-right) {
    justify-content: flex-end;
    margin-left: auto;
}

:where(.wee-modal.is-overflow-visible) :where(.wee-modal-panel, .wee-modal-body) {
    overflow: visible;
}

:where(.wee-modal.is-overflow-visible) :where(.wee-modal-foot) {
    border-radius: 0 0 14px 14px;
}

:where(.wee-modal-btn-icon) {
    width: 16px;
    height: 16px;
}

/* Confirmación / alerta: ícono, título y texto centrados, sin encabezado */
:where(.wee-modal-confirm) :where(.wee-modal-head) {
    display: none;
}

:where(.wee-modal-confirm) :where(.wee-modal-body) {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 26px var(--wee-space-6) var(--wee-space-2);
    text-align: center;
}

:where(.wee-modal-confirm) :where(.wee-modal-foot) {
    padding-bottom: 22px;
    border-top: 0;
    background: var(--wee-surface);
}

:where(.wee-modal-message) {
    display: contents;
}

/* El ícono va arriba del título aunque en el HTML esté después. */
:where(.wee-modal-confirm) :where(.wee-modal-icon) {
    order: 1;
}

:where(.wee-modal-message-title) {
    order: 2;
    margin: 0 0 var(--wee-space-2);
    color: var(--wee-navy);
    font-size: 16px;
}

:where(.wee-modal-message-text) {
    order: 3;
    color: var(--wee-muted);
    line-height: 1.45;
}

:where(.wee-modal-icon) {
    --wee-icon-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto var(--wee-space-3);
    border-radius: 50%;
}

:where(.wee-modal-icon) :where(svg) {
    stroke-width: 2.5;
}

:where(.wee-modal-icon):where(.is-warning, .is-question) {
    background: #fff4e5;
    color: #e08a00;
}

:where(.wee-modal-icon):where(.is-danger, .is-error) {
    background: var(--wee-danger-soft);
    color: var(--wee-danger);
}

:where(.wee-modal-icon.is-success) {
    background: var(--wee-success-soft);
    color: var(--wee-success);
}

:where(.wee-modal-icon.is-info) {
    background: #e8f0fb;
    color: #2b5797;
}

:where(.wee-modal-state) :where(.wee-modal-icon) {
    margin-bottom: var(--wee-space-1);
}

/* Variantes: texto de introducción, firma y campos de contacto */
:where(.wee-modal-lead) {
    margin: 0 0 var(--wee-space-4);
    color: var(--wee-navy);
    line-height: 1.5;
}

:where(.wee-modal-signature-field) {
    display: flex;
    justify-content: center;
}

:where(.wee-modal-signature-field) > :where(wee-input) {
    width: min(380px, 100%);
}

:where(.wee-modal-fields) {
    display: grid;
    gap: var(--wee-space-1) var(--wee-space-4);
}

:where(.wee-modal-fields.is-column) {
    grid-template-columns: 1fr;
}

:where(.wee-modal-fields.is-row) {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: start;
}

:where(.wee-modal-contacts-form.is-horizontal) :where(.wee-modal-fields.is-row) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

:where(.wee-modal-contacts-add) {
    align-self: start;
    margin-top: 27px;
}

:where(.wee-modal-contacts-form.is-vertical) :where(.wee-modal-contacts-add) {
    justify-self: end;
    margin-top: var(--wee-space-1);
}

:where(.wee-modal-contacts-table) {
    margin-top: 18px;
    transition: opacity .15s ease;
}

/* Tabla de contactos sin WeeTable.js */
:where(.wee-modal-table) {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

:where(.wee-modal-table) :where(th) {
    padding: var(--wee-space-2) 10px;
    border-bottom: 2px solid #e6ebf0;
    color: var(--wee-muted);
    font-size: 12px;
    font-weight: var(--wee-font-weight-bold);
    letter-spacing: .03em;
    text-align: left;
    text-transform: uppercase;
}

:where(.wee-modal-table) :where(td) {
    padding: 10px;
    border-bottom: 1px solid #eef1f4;
    vertical-align: middle;
    word-break: break-word;
}

:where(.wee-modal-table) :where(tr):hover > :where(td) {
    background: #fafbfc;
}

:where(.wee-modal-table) :where(.wee-modal-table-actions) {
    width: 1%;
    text-align: center;
    white-space: nowrap;
}

:where(.wee-modal-tag) {
    display: inline-block;
    margin-right: 6px;
    padding: 1px var(--wee-space-2);
    border-radius: 10px;
    background: var(--wee-success-soft);
    color: var(--wee-success);
    font-size: 11px;
    font-weight: var(--wee-font-weight-bold);
    vertical-align: 1px;
}

:where(.wee-modal-icon-btn) {
    --wee-icon-size: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: none;
    color: var(--wee-navy);
    cursor: pointer;
}

:where(.wee-modal-icon-btn):hover {
    background: #f1f4f7;
}

:where(.wee-modal-icon-btn.is-danger) {
    color: var(--wee-danger);
}

:where(.wee-modal-icon-btn.is-danger):hover {
    background: var(--wee-danger-soft);
}

:where(.wee-modal-empty) {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--wee-border-strong);
    border-radius: var(--wee-radius);
    color: var(--wee-muted);
    text-align: center;
}

/* Firma no configurada (WeeModal.signature.missing): triángulo rojo y el texto a la derecha. */
:where(.wee-modal-signature-alert) {
    display: flex;
    align-items: flex-start;
    gap: var(--wee-space-4);
}

:where(.wee-modal-signature-alert-icon) {
    --wee-icon-size: 44px;
    flex: none;
    color: var(--wee-check-missing, #e0245e);
}

:where(.wee-modal-signature-alert-text) {
    padding-top: 4px;
    color: var(--wee-navy);
    font-size: 16px;
    line-height: 1.5;
}

/* Lista de verificación (checklist) */
:where(.wee-modal-checklist) {
    margin: 0;
    padding: 0;
    list-style: none;
}

:where(.wee-modal-check-heading) {
    margin: 0 0 var(--wee-space-3);
    color: #0b1f33;
    font-size: 15px;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-modal-check-group + .wee-modal-check-group) {
    margin-top: 14px;
}

:where(.wee-modal-check-group-title) {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: var(--wee-font-weight-bold);
    letter-spacing: .06em;
    text-transform: uppercase;
}

:where(.wee-modal-check-group-title.is-missing) {
    color: var(--wee-danger);
}

:where(.wee-modal-check-group-title.is-ok) {
    color: var(--wee-success);
}

:where(.wee-modal-check) {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--wee-space-2) 0;
    border-top: 1px solid #eef1f4;
}

:where(.wee-modal-check):first-child {
    border-top: 0;
}

:where(.wee-modal-check-icon) {
    --wee-icon-size: 12px;
    display: inline-flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

:where(.wee-modal-check-icon) :where(svg) {
    stroke-width: 3;
}

:where(.wee-modal-check.is-ok) :where(.wee-modal-check-icon) {
    background: var(--wee-success-soft);
    color: var(--wee-success);
}

:where(.wee-modal-check.is-missing) :where(.wee-modal-check-icon) {
    background: var(--wee-danger-soft);
    color: var(--wee-danger);
}

:where(.wee-modal-check-button) {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 10px;
    margin: -4px -6px;
    padding: var(--wee-space-1) 6px;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

:where(.wee-modal-check-button):hover {
    background: #fdf3f2;
}

:where(.wee-modal-check-text) {
    flex: 1 1 auto;
}

:where(.wee-modal-check-go) {
    color: var(--wee-danger);
    font-size: 12px;
    font-weight: var(--wee-font-weight-bold);
    white-space: nowrap;
}

/* Lista por default (sin style: 'classic'): títulos de sección en negritas, círculos de color con el ícono
   blanco y renglones sin líneas. style: 'classic' (o WeeModal.checklist.style = 'classic') deja la de arriba. */
:where(.wee-modal-checks:not(.is-classic)) :where(.wee-modal-lead) {
    margin-bottom: var(--wee-space-3);
    font-size: 13px;
}

:where(.wee-modal-checks:not(.is-classic)) :where(.wee-modal-check-group + .wee-modal-check-group) {
    margin-top: var(--wee-space-2);
}

:where(.wee-modal-checks:not(.is-classic)) :where(.wee-modal-check-group-title) {
    margin: 0 0 var(--wee-space-1);
    color: #0b1f33;
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}

:where(.wee-modal-checks:not(.is-classic)) :where(.wee-modal-check) {
    gap: var(--wee-space-3);
    padding: 7px 0;
    border-top: 0;
    color: var(--wee-navy);
    font-size: 13px;
}

:where(.wee-modal-checks:not(.is-classic)) :where(.wee-modal-check-button) {
    gap: var(--wee-space-3);
}

:where(.wee-modal-checks:not(.is-classic)) :where(.wee-modal-check-icon) {
    --wee-icon-size: 11px;
    flex-basis: 20px;
    width: 20px;
    height: 20px;
    color: #fff;
}

:where(.wee-modal-checks:not(.is-classic)) :where(.wee-modal-check.is-missing) :where(.wee-modal-check-icon) {
    background: var(--wee-check-missing, #e0245e);
}

:where(.wee-modal-checks:not(.is-classic)) :where(.wee-modal-check.is-ok) :where(.wee-modal-check-icon) {
    background: var(--wee-check-ok, #2fbf8f);
}

/* Cargando (WeeModal.loading) */
:where(.wee-modal.wee-modal-loader) {
    width: min(320px, calc(100vw - 32px));
}

:where(.wee-modal-loader) :where(.wee-modal-head) {
    display: none;
}

:where(.wee-modal-loader) :where(.wee-modal-body) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--wee-space-3);
    padding: 28px var(--wee-space-6);
    text-align: center;
}

:where(.wee-modal-loader) :where(.wee-spinner) {
    --wee-spinner-size: 34px;
    border-width: 4px;
}

:where(.wee-modal-loading-text) {
    color: var(--wee-navy);
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-modal-loading-bar) {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e6edf3;
}

/* Panel lateral */
:where(.wee-modal.is-side) {
    width: min(var(--wee-modal-width, 420px), 100vw);
    height: 100vh;
    max-height: 100vh;
    margin: 0;
}

:where(.wee-modal.is-right) {
    margin-left: auto;
}

:where(.wee-modal.is-left) {
    margin-right: auto;
}

:where(.wee-modal.is-side) > :where(.wee-modal-panel) {
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
}

:where(.wee-modal.is-right) > :where(.wee-modal-panel) {
    border-radius: 14px 0 0 14px;
    animation: wee-modal-in-right .22s ease;
}

:where(.wee-modal.is-left) > :where(.wee-modal-panel) {
    border-radius: 0 14px 14px 0;
    animation: wee-modal-in-left .22s ease;
}

:where(.wee-modal.is-center) > :where(.wee-modal-panel) {
    animation: wee-modal-in .18s ease;
}

@keyframes wee-modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }
}

@keyframes wee-modal-in-right {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
}

@keyframes wee-modal-in-left {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
}


/* --------------------------------------------------------------------------
   5.12 WeeFrame
   Visor de PDF o página: barra propia (toolbar="wee"), cuerpo con iframe y estados vacío / cargando / error.
   Tema gmm: marco simple y fondo gris oscuro, como el visor de la plataforma.
   -------------------------------------------------------------------------- */

:where(wee-frame) {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid var(--wee-divider);
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
    color: var(--wee-text);
    font-family: var(--wee-font);
}

:where(wee-frame):fullscreen {
    border-radius: 0;
}

:where(.wee-frame-bar) {
    display: flex;
    align-items: center;
    gap: var(--wee-space-3);
    min-height: 52px;
    padding: var(--wee-space-2) 10px var(--wee-space-2) 18px;
    background: var(--wee-navy);
    color: var(--wee-on-color);
}

:where(.wee-frame-title) {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: var(--wee-font-size-lg);
    font-weight: var(--wee-font-weight-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.wee-frame-tools) {
    display: inline-flex;
    gap: var(--wee-space-1);
}

:where(.wee-frame-tool) {
    --wee-icon-size: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: none;
    color: var(--wee-on-color);
    cursor: pointer;
}

:where(.wee-frame-tool):hover:not(:disabled) {
    background: var(--wee-on-color-hover);
}

:where(.wee-frame-body) {
    position: relative;
    height: 600px;
    background: var(--wee-bg);
}

:where(.wee-frame-iframe) {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--wee-surface);
}

:where(.wee-frame-state) {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--wee-space-3);
    padding: var(--wee-space-6);
    color: var(--wee-muted);
    font-size: 14px;
    text-align: center;
}

:where(.wee-frame-state) > :where(.wee-spinner) {
    --wee-spinner-size: 34px;
    border-width: 4px;
}

/* "Reintentar" con fondo blanco: también se lee sobre el fondo oscuro del tema gmm. */
:where(.wee-frame-state) > :where(.wee-btn-outline) {
    background: var(--wee-surface);
}

:where(.wee-frame-state-icon) {
    --wee-icon-size: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--wee-primary-soft);
    color: var(--wee-navy);
}

:where(.wee-frame-state-icon.is-error) {
    background: var(--wee-danger-soft);
    color: var(--wee-danger);
}

:where(wee-frame.is-theme-gmm) {
    border: 0;
    border-radius: 0;
    box-shadow: 0 0 0 1px #d9dee4;
}

:where(wee-frame.is-theme-gmm) :where(.wee-frame-body) {
    background: #525659;
}

:where(wee-frame.is-theme-gmm) :where(.wee-frame-state) {
    color: #e8eaed;
}

:where(wee-frame.is-theme-gmm) :where(.wee-frame-state-icon) {
    background: var(--wee-on-color-hover);
    color: var(--wee-on-color);
}


/* --------------------------------------------------------------------------
   5.13 WeeTabs
   Barra .wee-tabs-nav con botones .wee-tab-button (is-active, is-error) y paneles <wee-tab>.
   Temas: wee (subrayado) · gmm-line · gmm-cards · pills · header · vertical.
   -------------------------------------------------------------------------- */

:where(wee-tabs) {
    display: block;
    color: var(--wee-text);
    font-family: var(--wee-font);
}

:where(wee-tab) {
    display: block;
}

:where(.wee-tabs-nav) {
    display: flex;
    align-items: stretch;
    gap: 26px;
    margin-bottom: var(--wee-space-5);
    overflow-x: auto;
    scrollbar-width: none;
}

:where(.wee-tabs-nav)::-webkit-scrollbar {
    display: none;
}

/* Base de cada pestaña. Va después de los estados generales: el fondo de aria-selected y la negrita de
   is-active los decide cada tema. */
:where(.wee-tab-button) {
    position: relative;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 2px 12px;
    border: 0;
    background: none;
    color: var(--wee-muted);
    font: inherit;
    font-size: 14.5px;
    font-weight: var(--wee-font-weight-semibold);
    white-space: nowrap;
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
}

:where(.wee-tab-button):hover:not(:disabled) {
    color: var(--wee-navy);
}

:where(.wee-tab-icon) {
    --wee-icon-size: 20px;
    display: inline-flex;
    width: 20px;
    height: 20px;
}

:where(.wee-tab-icon) :where(img) {
    object-fit: contain;
}

:where(.wee-tab-icon) :where(i) {
    font-size: 18px;
    line-height: 20px;
}

:where(.wee-tab-count) {
    min-width: 22px;
    padding: 1px var(--wee-space-2);
    border-radius: var(--wee-radius-pill);
    background: var(--wee-neutral-soft);
    color: var(--wee-muted);
    font-size: var(--wee-font-size-xs);
    font-weight: var(--wee-font-weight-bold);
    text-align: center;
}

:where(.wee-tab-dot) {
    --wee-icon-size: 16px;
    display: inline-flex;
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--wee-danger);
}

:where(wee-tabs.is-stretch) :where(.wee-tab-button) {
    flex: 1 1 0;
}

/* wee: subrayado */
:where(wee-tabs.is-theme-wee) > :where(.wee-tabs-nav) {
    border-bottom: 1px solid var(--wee-divider);
}

:where(wee-tabs.is-theme-wee) :where(.wee-tab-button.is-active) {
    color: var(--wee-navy);
}

:where(wee-tabs.is-theme-wee) :where(.wee-tab-button.is-active)::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--wee-teal);
}

:where(wee-tabs.is-theme-wee) :where(.wee-tab-button.is-active) :where(.wee-tab-count) {
    background: var(--wee-teal-soft);
    color: var(--wee-teal-dark);
}

/* gmm-line: barra blanca con sombra, pestañas a lo ancho (plataforma) */
:where(wee-tabs.is-theme-gmm-line) > :where(.wee-tabs-nav) {
    gap: 0;
    background: var(--wee-surface);
    box-shadow: 0 3px 8px rgba(4, 45, 111, .12);
}

:where(wee-tabs.is-theme-gmm-line) :where(.wee-tab-button) {
    flex: 1 1 0;
    min-width: max-content;
    padding: 18px var(--wee-space-5) var(--wee-space-5);
    color: #8a919b;
    font-size: var(--wee-font-size-lg);
    font-weight: 400;
}

:where(wee-tabs.is-theme-gmm-line) :where(.wee-tab-button.is-active) {
    color: var(--wee-navy);
    font-weight: var(--wee-font-weight-semibold);
}

:where(wee-tabs.is-theme-gmm-line) :where(.wee-tab-button.is-active)::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--wee-teal);
}

/* gmm-cards: tarjetas con ícono, la activa con borde verde agua (plataforma) */
:where(wee-tabs.is-theme-gmm-cards) > :where(.wee-tabs-nav) {
    gap: var(--wee-space-5);
    margin: -6px -6px 14px;
    padding: 6px 6px 10px;
}

:where(wee-tabs.is-theme-gmm-cards) :where(.wee-tab-button) {
    --wee-icon-size: 22px;
    gap: 14px;
    padding: 18px 36px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--wee-surface);
    box-shadow: 0 4px 14px rgba(4, 45, 111, .09);
    color: var(--wee-navy);
    font-size: 16px;
    font-weight: var(--wee-font-weight-bold);
}

:where(wee-tabs.is-theme-gmm-cards) :where(.wee-tab-button):hover:not(:disabled) {
    box-shadow: 0 6px 18px rgba(4, 45, 111, .14);
}

:where(wee-tabs.is-theme-gmm-cards) :where(.wee-tab-button.is-active) {
    border-color: var(--wee-teal);
    box-shadow: 0 2px 8px rgba(47, 197, 169, .12);
}

:where(wee-tabs.is-theme-gmm-cards) :where(.wee-tab-icon) {
    width: 22px;
    height: 22px;
}

/* pills: botones, la activa rellena */
:where(wee-tabs.is-theme-pills) > :where(.wee-tabs-nav) {
    gap: var(--wee-space-2);
}

:where(wee-tabs.is-theme-pills) :where(.wee-tab-button) {
    height: 42px;
    padding: 0 18px;
    border: 1px solid #d4dce4;
    border-radius: var(--wee-radius-md);
    background: var(--wee-surface);
    color: var(--wee-navy);
    font-weight: 500;
}

:where(wee-tabs.is-theme-pills) :where(.wee-tab-button.is-active) {
    border-color: var(--wee-teal);
    background: var(--wee-teal);
    color: var(--wee-on-color);
}

:where(wee-tabs.is-theme-pills) :where(.wee-tab-button.is-active) :where(.wee-tab-count) {
    background: rgba(255, 255, 255, .25);
    color: var(--wee-on-color);
}

:where(wee-tabs.is-theme-pills) :where(.wee-tab-button.is-active) :where(.wee-tab-dot) {
    --wee-tab-error-mark: var(--wee-danger);
    color: var(--wee-on-color);
}

/* header: encabezado azul */
:where(wee-tabs.is-theme-header) > :where(.wee-tabs-nav) {
    gap: 0;
    margin-bottom: 0;
    border-radius: var(--wee-radius-md) var(--wee-radius-md) 0 0;
    background: var(--wee-navy);
}

:where(wee-tabs.is-theme-header) :where(.wee-tab-button) {
    padding: 13px var(--wee-space-5);
    color: #c9d6e8;
    font-weight: 500;
}

:where(wee-tabs.is-theme-header) :where(.wee-tab-button):not(.is-active):hover:not(:disabled) {
    background: rgba(255, 255, 255, .08);
    color: var(--wee-on-color);
}

:where(wee-tabs.is-theme-header) :where(.wee-tab-button.is-active) {
    border-radius: var(--wee-radius-md) var(--wee-radius-md) 0 0;
    background: var(--wee-surface);
    color: var(--wee-navy);
    font-weight: var(--wee-font-weight-semibold);
}

:where(wee-tabs.is-theme-header) :where(.wee-tab-count) {
    background: rgba(255, 255, 255, .18);
    color: inherit;
}

:where(wee-tabs.is-theme-header) :where(.wee-tab-button.is-active) :where(.wee-tab-count) {
    background: var(--wee-neutral-soft);
}

:where(wee-tabs.is-theme-header) > :where(wee-tab) {
    padding: var(--wee-space-4);
    border: 1px solid var(--wee-divider);
    border-top: 0;
    border-radius: 0 0 var(--wee-radius-md) var(--wee-radius-md);
}

/* vertical: lista a la izquierda */
:where(wee-tabs.is-theme-vertical) {
    display: grid;
    grid-template-columns: minmax(170px, 220px) 1fr;
    overflow: hidden;
    border: 1px solid var(--wee-divider);
    border-radius: var(--wee-radius);
}

:where(wee-tabs.is-theme-vertical) > :where(.wee-tabs-nav) {
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: var(--wee-space-2);
    overflow: visible;
    background: var(--wee-bg);
}

:where(wee-tabs.is-theme-vertical) :where(.wee-tab-button) {
    justify-content: flex-start;
    padding: 10px var(--wee-space-3);
    border-radius: var(--wee-radius-md);
    text-align: left;
    white-space: normal;
}

:where(wee-tabs.is-theme-vertical) :where(.wee-tab-button.is-active) {
    background: var(--wee-surface);
    box-shadow: inset 3px 0 0 var(--wee-teal);
    color: var(--wee-navy);
}

:where(wee-tabs.is-theme-vertical) :where(.wee-tab-count, .wee-tab-dot) {
    margin-left: auto;
}

:where(wee-tabs.is-theme-vertical) :where(.wee-tab-count + .wee-tab-dot) {
    margin-left: 0;
}

:where(wee-tabs.is-theme-vertical) > :where(wee-tab) {
    grid-column: 2;
    min-width: 0;
    padding: 18px;
}


/* ==========================================================================
   5.14 WeeCard
   <wee-card> (sin clase wee-: solo is-*) con .wee-card-header / -body / -footer. <wee-cards>: cuadrícula.
   ========================================================================== */

:where(wee-card) {
    --wee-card-pad: 18px;
    --wee-card-error-border: #f5c2bd;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--wee-border);
    border-radius: var(--wee-radius-lg);
    background: var(--wee-surface);
    box-shadow: var(--wee-shadow-sm);
    color: var(--wee-text);
}

:where(:not(wee-cards, .wee-cards)) > :where(wee-card + wee-card) {
    margin-top: var(--wee-space-4);
}

:where(wee-card.is-error) {
    border-color: var(--wee-card-error-border);
}

:where(.wee-card-header) {
    display: flex;
    align-items: center;
    gap: var(--wee-space-3);
    padding: 14px var(--wee-card-pad);
}

:where(wee-card.is-collapsible) > :where(.wee-card-header) {
    cursor: pointer;
}

:where(.wee-card-icon) {
    --wee-icon-size: 20px;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wee-primary-soft);
    color: var(--wee-navy);
}

:where(.wee-card-titles) {
    flex: 1 1 auto;
    min-width: 0;
}

:where(.wee-card-title) {
    margin: 0;
    color: var(--wee-navy);
    font-size: var(--wee-font-size-lg);
    font-weight: var(--wee-font-weight-bold);
    line-height: 1.3;
}

:where(.wee-card-subtitle) {
    margin-top: 2px;
    color: var(--wee-muted);
    font-size: var(--wee-font-size-sm);
}

:where(.wee-card-badge, .wee-card-actions) {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
}

:where(.wee-card-mark) {
    --wee-icon-size: 18px;
    display: inline-flex;
    flex: none;
    color: var(--wee-danger);
}

:where(.wee-card-toggle) {
    --wee-icon-size: 18px;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: -6px;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-sm);
    background: transparent;
    color: var(--wee-muted);
    cursor: pointer;
}

:where(.wee-card-toggle):hover {
    background: var(--wee-hover-bg);
    color: var(--wee-navy);
}

/* Abierta: chevron hacia abajo; cerrada: hacia la derecha (gana a la regla general de 3.8). */
:where(.wee-card-toggle)[aria-expanded="true"] > :where(.wee-chevron) {
    transform: none;
}

:where(.wee-card-toggle)[aria-expanded="false"] > :where(.wee-chevron) {
    transform: rotate(-90deg);
}

:where(.wee-card-body) {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px var(--wee-card-pad) var(--wee-card-pad);
}

:where(.wee-card-header)[hidden] + :where(.wee-card-body) {
    padding-top: var(--wee-card-pad);
}

:where(.wee-card-body) > :where(.wee-state) {
    padding-block: 24px;
}

:where(.wee-card-footer) {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: var(--wee-space-3) var(--wee-card-pad);
    border-top: 1px solid var(--wee-divider);
    border-radius: 0 0 var(--wee-radius-lg) var(--wee-radius-lg);
    background: #fafbfc;
}

:where(.wee-card-skeleton) {
    display: grid;
    gap: 10px;
    padding-block: 6px;
}

:where(.wee-card-skeleton) > :where(.wee-skeleton:nth-child(1)) { width: 70%; }
:where(.wee-card-skeleton) > :where(.wee-skeleton:nth-child(2)) { width: 45%; }
:where(.wee-card-skeleton) > :where(.wee-skeleton:nth-child(3)) { width: 60%; }

/* Tema gmm: encabezado blanco con la línea verde agua de la plataforma. */
:where(wee-card.is-theme-gmm) {
    border-color: #e6ebf0;
    border-radius: var(--wee-radius);
    box-shadow: 0 2px 10px rgba(4, 45, 111, .08);
}

:where(wee-card.is-theme-gmm) > :where(.wee-card-header) {
    margin: 0 var(--wee-card-pad);
    padding: 16px 0 12px;
    border-bottom: 2px solid var(--wee-teal);
}

:where(wee-card.is-theme-gmm.is-error) {
    border-color: var(--wee-card-error-border);
}

:where(wee-card.is-theme-gmm.is-collapsed) > :where(.wee-card-header) {
    border-bottom-color: transparent;
}

:where(wee-card.is-theme-gmm) :where(.wee-card-title) {
    font-size: 17px;
    font-weight: var(--wee-font-weight-semibold);
}

:where(wee-card.is-theme-gmm) :where(.wee-card-icon) {
    width: 44px;
    height: 44px;
    background: var(--wee-success-soft);
    color: var(--wee-teal-dark);
}

:where(wee-card.is-theme-gmm) > :where(.wee-card-body) {
    padding-top: 16px;
}

:where(wee-card.is-theme-gmm) > :where(.wee-card-footer) {
    border-radius: 0 0 var(--wee-radius) var(--wee-radius);
}

/* slot="prefix" (p. ej. una casilla) y el punto de estatus del encabezado */
:where(.wee-card-prefix) {
    display: inline-flex;
    flex: none;
    align-items: center;
}

:where(.wee-card-prefix) > :where(wee-input, wee-check-group) {
    margin: 0;
}

:where(.wee-card-status) {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--wee-neutral);
}

:where(.wee-card-status.is-success) {
    background: var(--wee-teal);
}

:where(.wee-card-status.is-warning) {
    background: #f0a400;
}

:where(.wee-card-status.is-danger) {
    background: var(--wee-danger);
}

:where(.wee-card-status.is-info) {
    background: var(--wee-info);
}

:where(.wee-card-status.is-primary) {
    background: var(--wee-navy);
}

/* variant="item": compacta, para listas (el detalle se alinea con el título, después de la casilla) */
:where(wee-card.is-item) > :where(.wee-card-header) {
    gap: 10px;
    margin: 0;
    padding: 12px 16px;
    border-bottom: 0;
}

:where(wee-card.is-item) :where(.wee-card-title) {
    font-size: var(--wee-font-size-md);
}

:where(wee-card.is-item) :where(.wee-card-icon) {
    --wee-icon-size: 16px;
    width: 32px;
    height: 32px;
}

:where(wee-card.is-item) > :where(.wee-card-body) {
    padding: 0 16px 14px 48px;
}

/* En una lista, las tarjetas item van más juntas. */
:where(:not(wee-cards, .wee-cards)) > :where(wee-card.is-item + wee-card.is-item) {
    margin-top: var(--wee-space-2);
}

/* variant="stat": indicador con número grande */
:where(.wee-card-stat) {
    padding: 16px 18px;
}

:where(wee-card.is-stat) > :where(.wee-card-body:empty) {
    display: none;
}

:where(.wee-card-stat-top) {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--wee-muted);
    font-size: var(--wee-font-size-sm);
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-card-stat-top) > :where(.wee-card-icon) {
    --wee-icon-size: 16px;
    width: 32px;
    height: 32px;
}

:where(.wee-card-stat-value) {
    margin-top: 10px;
    color: var(--wee-navy);
    font-size: 26px;
    font-weight: var(--wee-font-weight-bold);
    letter-spacing: -.01em;
}

:where(.wee-card-stat-trend) {
    margin-top: 2px;
    color: var(--wee-muted);
    font-size: 12px;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-card-stat-trend.is-good) {
    color: var(--wee-teal-dark);
}

:where(.wee-card-stat-trend.is-bad) {
    color: var(--wee-danger);
}

/* variant="panel": bloque gris dentro de una pantalla u otra tarjeta ("Agregar médico"). Sin borde, sombra ni línea
   en el encabezado, en los dos temas (va después de las reglas de gmm e item para ganarles por orden). */
:where(wee-card.is-panel) {
    --wee-card-pad: 20px;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: var(--wee-bg);
    box-shadow: none;
}

:where(wee-card.is-panel) > :where(.wee-card-header) {
    margin: 0;
    padding: 16px var(--wee-card-pad) 12px;
    border-bottom: 0;
}

:where(wee-card.is-panel) > :where(.wee-card-header) :where(.wee-card-title) {
    font-size: 16px;
    font-weight: var(--wee-font-weight-semibold);
}

:where(wee-card.is-panel) > :where(.wee-card-body) {
    padding: 0 var(--wee-card-pad) var(--wee-card-pad);
}

:where(wee-card.is-panel) > :where(.wee-card-header)[hidden] + :where(.wee-card-body) {
    padding-top: var(--wee-card-pad);
}

:where(wee-card.is-panel) > :where(.wee-card-footer) {
    border-top-color: var(--wee-border);
    border-radius: 0 0 var(--wee-radius-md) var(--wee-radius-md);
    background: transparent;
}

/* <wee-cards>: hasta --wee-cards-columns columnas de al menos --wee-cards-min; menos si no caben. */
:where(wee-cards, .wee-cards) {
    --wee-cards-columns: 3;
    --wee-cards-min: 240px;
    --wee-cards-gap: var(--wee-space-4);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--wee-cards-min),
        (100% - (var(--wee-cards-columns) - 1) * var(--wee-cards-gap)) / var(--wee-cards-columns))), 1fr));
    gap: var(--wee-cards-gap);
}

:where(wee-cards, .wee-cards) > :where(*) {
    min-width: 0;
}


/* ==========================================================================
   5.15 WeeTable
   <wee-table> (sin clase wee-: is-theme-*, is-striped, is-hover, is-dense, is-bordered, is-sticky-header,
   is-responsive-cards, is-row-click, is-loading, is-nested) con .wee-table-container dentro.
   Orden: base → temas → renglones especiales y estados (ganan a los temas) → tarjetas en celular.
   ========================================================================== */

:where(wee-table) {
    --wee-table-line: #e6ebf0;
    --wee-table-line-soft: #eef1f4;
    --wee-table-head-bg: #f7f9fb;
    --wee-table-pager-border: #9aa2ac;
    --wee-table-pager-text: #2b3036;
    display: block;
}

:where(wee-table) > :where(wee-column, wee-detail, template, [slot]) {
    display: none;
}

:where(.wee-table-container) {
    position: relative;
    container: weetable / inline-size;
    color: var(--wee-navy);
    font-size: 13px;
}

:where(.wee-table-container),
:where(.wee-table-container) * {
    box-sizing: border-box;
}

/* Barra: búsqueda, seleccionados, slot toolbar, columnas y exportar */
:where(.wee-table-toolbar) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

:where(.wee-table-search) {
    position: relative;
    display: flex;
    flex: 0 1 300px;
    align-items: center;
    min-width: 180px;
}

:where(.wee-table-search) > :where(.wee-icon) {
    position: absolute;
    left: 11px;
    color: var(--wee-muted);
    pointer-events: none;
}

:where(.wee-table-search-input) {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--wee-border-strong);
    border-radius: var(--wee-radius);
    outline: none;
    background: var(--wee-surface);
    color: inherit;
    font: inherit;
    transition: border-color var(--wee-duration-fast), box-shadow var(--wee-duration-fast);
}

:where(.wee-table-search-input):focus {
    border-color: var(--wee-teal);
    box-shadow: 0 0 0 3px var(--wee-focus-ring-soft);
}

:where(.wee-table-toolbar-end) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

:where(.wee-table-toolbar-slot) {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

:where(.wee-table-toolbar-slot):empty {
    display: none;
}

:where(.wee-table-tool) {
    min-height: 36px;
    padding: 0 12px;
    gap: 6px;
}

:where(.wee-table-bulk) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 4px 12px;
    border-radius: var(--wee-radius);
    background: var(--wee-success-soft);
}

:where(.wee-table-bulk-count) {
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-table-bulk-actions) {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

:where(.wee-table-bulk-actions):empty {
    display: none;
}

:where(.wee-table-picker) {
    position: relative;
}

:where(.wee-table-popover) {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 0;
    min-width: 210px;
    max-height: 320px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--wee-border);
    border-radius: var(--wee-radius-lg);
    background: var(--wee-surface);
    box-shadow: 0 12px 28px rgba(4, 45, 111, .14);
}

:where(.wee-table-popover-item) {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: var(--wee-radius-md);
    cursor: pointer;
}

:where(.wee-table-popover-item):hover {
    background: var(--wee-hover-bg);
}

:where(.wee-table-sort, .wee-table-page, .wee-table-action, .wee-table-expand, .wee-table-check, .wee-table-row[tabindex]):focus-visible {
    outline: 2px solid var(--wee-teal);
    outline-offset: 2px;
}

/* Tabla */
/* empty-image sin registros: no se ven encabezado, borde ni paginador; solo la imagen y el texto. */
:where(wee-table.is-empty-image) :where(.wee-table-head, .wee-table-pager) {
    display: none;
}

:where(wee-table.is-empty-image) :where(.wee-table-scroll) {
    border: 0;
    background: transparent;
}

:where(wee-table.is-empty-image) :where(.wee-table-state) > :where(.wee-table-td) {
    border-bottom: 0;
    background: transparent;
}

:where(.wee-table-scroll) {
    position: relative;
    max-height: var(--wee-table-height, none);
    overflow: auto;
    border: 1px solid var(--wee-table-line);
    border-radius: var(--wee-radius-lg);
    background: var(--wee-surface);
}

:where(.wee-table-grid) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

:where(.wee-table-th) {
    padding: 10px 12px;
    border-bottom: 2px solid var(--wee-table-line);
    background: var(--wee-table-head-bg);
    color: var(--wee-muted);
    font-size: 12px;
    font-weight: var(--wee-font-weight-bold);
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

:where(.wee-table-td) {
    padding: 10px 12px;
    border-bottom: 1px solid var(--wee-table-line-soft);
    background: var(--wee-surface);
    vertical-align: middle;
    word-break: break-word;
}

:where(.wee-table-grid) > :where(tbody) > :where(tr:last-child) > :where(.wee-table-td) {
    border-bottom: 0;
}

:where(.wee-table-th, .wee-table-td, .wee-table-cell-inline).is-align-left {
    text-align: left;
}

:where(.wee-table-th, .wee-table-td, .wee-table-cell-inline).is-align-center {
    text-align: center;
}

:where(.wee-table-th, .wee-table-td, .wee-table-cell-inline).is-align-right {
    text-align: right;
}

:where(.wee-table-td).is-valign-top {
    vertical-align: top;
}

:where(.wee-table-td).is-valign-bottom {
    vertical-align: bottom;
}

:where(.wee-table-td.is-keep) {
    white-space: nowrap;
}

:where(.wee-table-td.is-nowrap) {
    max-width: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.wee-table-td.is-actions) {
    width: 1%;
    white-space: nowrap;
}

:where(.wee-table-td.is-nowrap) :where(.wee-table-file, .wee-table-cell-inline) {
    display: flex;
    min-width: 0;
}

:where(.wee-table-td.is-nowrap) :where(.wee-table-file) > :where(span:last-child),
:where(.wee-table-td.is-nowrap) :where(.wee-table-cell-value) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

:where(wee-table.is-striped) :where(.wee-table-row:nth-child(even of .wee-table-row)) > :where(.wee-table-td) {
    background: #fafbfc;
}

:where(wee-table.is-hover) :where(.wee-table-row):hover > :where(.wee-table-td) {
    background: #f2f9f7;
}

:where(wee-table.is-row-click) :where(.wee-table-row) {
    cursor: pointer;
}

:where(wee-table.is-dense) :where(.wee-table-td) {
    padding: 6px 10px;
}

:where(wee-table.is-dense) :where(.wee-table-th) {
    padding: 7px 10px;
}

:where(wee-table.is-bordered) :where(.wee-table-td, .wee-table-th) {
    border-right: 1px solid var(--wee-table-line-soft);
}

:where(wee-table.is-bordered) :where(.wee-table-td, .wee-table-th):last-child {
    border-right: 0;
}

:where(.wee-table-grid) > :where(tfoot) :where(.wee-table-td) {
    border-top: 2px solid var(--wee-table-line);
    border-bottom: 0;
    background: var(--wee-table-head-bg);
    font-weight: var(--wee-font-weight-bold);
    white-space: nowrap;
}

:where(.wee-table-total-label) {
    color: var(--wee-muted);
    font-weight: var(--wee-font-weight-semibold);
}

/* Encabezado fijo y columnas fijas */
:where(wee-table.is-sticky-header) :where(thead) :where(.wee-table-th) {
    position: sticky;
    z-index: 3;
    top: 0;
}

:where(wee-table.is-sticky-header) :where(thead) :where(.wee-table-filters) :where(.wee-table-th) {
    top: 39px;
}

:where(.wee-table-td)[data-sticky] {
    position: sticky;
    z-index: 2;
}

:where(.wee-table-th)[data-sticky] {
    position: sticky;
    z-index: 4;
}

:where(wee-table.is-sticky-header) :where(thead) :where(.wee-table-th)[data-sticky] {
    z-index: 5;
}

:where(.wee-table-th, .wee-table-td).is-sticky-last {
    box-shadow: 6px 0 8px -6px rgba(4, 45, 111, .18);
}

/* Orden */
:where(.wee-table-sort) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

:where(.wee-table-sort):hover {
    color: var(--wee-navy);
}

:where(.wee-table-sort-icon) {
    position: relative;
    width: 8px;
    height: 12px;
    opacity: .45;
}

:where(.wee-table-sort-icon)::before,
:where(.wee-table-sort-icon)::after {
    content: '';
    position: absolute;
    left: 0;
    border: 4px solid transparent;
}

:where(.wee-table-sort-icon)::before {
    top: -3px;
    border-bottom-color: currentColor;
}

:where(.wee-table-sort-icon)::after {
    bottom: -3px;
    border-top-color: currentColor;
}

:where(th[aria-sort="ascending"], th[aria-sort="descending"]) :where(.wee-table-sort-icon) {
    color: var(--wee-teal);
    opacity: 1;
}

:where(th[aria-sort="ascending"]) :where(.wee-table-sort-icon)::after,
:where(th[aria-sort="descending"]) :where(.wee-table-sort-icon)::before {
    opacity: 0;
}

:where(.wee-table-th.is-sorted) {
    color: var(--wee-navy);
}

:where(.wee-table-sort-order) {
    min-width: 0;
    color: var(--wee-teal);
    font-size: 10px;
}

:where(.wee-table-th.is-align-right) :where(.wee-table-sort) {
    flex-direction: row-reverse;
}

/* Filtros bajo el encabezado */
:where(.wee-table-filters) :where(.wee-table-th) {
    padding: 6px 8px;
    border-bottom: 1px solid var(--wee-table-line);
    background: #fbfcfd;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

:where(.wee-table-filter) {
    width: 100%;
    min-width: 90px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--wee-border-strong);
    border-radius: var(--wee-radius-md);
    background: var(--wee-surface);
    color: var(--wee-navy);
    font: inherit;
    font-size: var(--wee-font-size-sm);
}

:where(.wee-table-filter):focus {
    border-color: var(--wee-teal);
    outline: none;
    box-shadow: 0 0 0 3px var(--wee-focus-ring-soft);
}

:where(.wee-table-filters) :where(wee-input, wee-combo) {
    display: block;
    min-width: 110px;
    margin: 0;
    font-size: var(--wee-font-size-sm);
    text-align: left;
}

:where(.wee-table-filters) :where(.wee-label, .wee-error-text) {
    display: none;
}

:where(.wee-table-filters) :where(.wee-input-control, .wee-control) {
    min-height: 0;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: var(--wee-font-size-sm);
}

/* Selección y detalle */
:where(.wee-table-cell-select, .wee-table-cell-expand) {
    width: 44px;
    text-align: center;
}

:where(.wee-table-select-all) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

:where(.wee-table-select-all-text) {
    display: none;
}

:where(.wee-table-check) {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--wee-teal);
    vertical-align: middle;
    cursor: pointer;
}

:where(.wee-table-expand) {
    --wee-icon-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: none;
    color: var(--wee-muted);
    cursor: pointer;
}

:where(.wee-table-expand):hover {
    background: var(--wee-hover-bg);
    color: var(--wee-navy);
}

:where(.wee-table-expand) > :where(.wee-icon) {
    transition: transform var(--wee-duration-fast) ease;
}

:where(.wee-table-expand)[aria-expanded="true"] > :where(.wee-icon) {
    transform: rotate(90deg);
}

:where(.wee-table-row.is-expanded) > :where(.wee-table-td) {
    border-bottom-color: transparent;
}

:where(.wee-table-detail) > :where(.wee-table-td) {
    padding: 4px 16px 16px 56px;
}

:where(.wee-table-detail-body) {
    display: block;
    width: 100%;
}

:where(.wee-table-detail-body) > :where(.wee-state) {
    justify-content: flex-start;
    padding: 10px 0;
}

:where(wee-table.is-nested) {
    width: 100%;
}

:where(wee-table.is-nested) :where(.wee-table-scroll) {
    border-radius: var(--wee-radius);
}

:where(wee-table.is-nested) :where(.wee-table-th) {
    background: #f2f5f8;
    font-size: 11px;
}

/* Grupos */
:where(.wee-table-group) > :where(.wee-table-td) {
    padding: 8px 12px;
    border-bottom: 1px solid var(--wee-table-line);
}

:where(.wee-table-group-head) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

:where(.wee-table-group-label, .wee-table-group-continues, .wee-table-group-total) {
    color: var(--wee-muted);
}

:where(.wee-table-group-count) {
    min-width: 22px;
    padding: 1px 8px;
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
    color: var(--wee-muted);
    font-size: var(--wee-font-size-xs);
    font-weight: var(--wee-font-weight-bold);
    text-align: center;
}

:where(.wee-table-group-continues) {
    font-size: 12px;
    font-style: italic;
}

:where(.wee-table-group-total) {
    margin-left: auto;
    font-size: var(--wee-font-size-sm);
}

:where(.wee-table-group-total + .wee-table-group-total) {
    margin-left: 12px;
}

:where(.wee-table-group-total) :where(strong) {
    color: var(--wee-navy);
}

/* Contenido de celdas: íconos, acciones, badge, sí / no, archivo */
:where(.wee-table-td) {
    --wee-icon-size: 18px;
}

:where(.wee-table-td) :where(.wee-icon) > :where(img) {
    object-fit: contain;
}

:where(.wee-table-td) :where(.wee-icon) > :where(i) {
    font-size: 16px;
}

:where(.wee-icon.is-file) {
    --wee-icon-size: 22px;
}

:where(.wee-table-cell-inline) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    vertical-align: middle;
}

:where(.wee-table-cell-inline.is-align-center) {
    justify-content: center;
}

:where(.wee-table-cell-inline.is-align-right) {
    justify-content: flex-end;
}

:where(.wee-table-cell-value) {
    min-width: 0;
}

:where(.wee-table-cell-inline) :where(.wee-table-cell-content) {
    display: inline;
}

:where(.wee-table-icons) {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}

:where(.wee-table-action) {
    --wee-icon-size: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: none;
    color: var(--wee-navy);
    font: inherit;
    font-size: var(--wee-font-size-sm);
    font-weight: var(--wee-font-weight-semibold);
    text-decoration: none;
    cursor: pointer;
}

:where(.wee-table-action):hover:not(:disabled) {
    background: var(--wee-hover-bg);
}

:where(.wee-table-indicator) {
    --wee-icon-size: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 26px;
    height: 26px;
    color: var(--wee-muted);
}

:where(.wee-table-container) :where(.wee-table-action, .wee-table-indicator, .wee-table-bool).is-success {
    color: var(--wee-success);
}

:where(.wee-table-container) :where(.wee-table-action, .wee-table-indicator, .wee-table-bool).is-warning {
    color: #b26a00;
}

:where(.wee-table-container) :where(.wee-table-action, .wee-table-indicator, .wee-table-bool).is-danger {
    color: var(--wee-danger);
}

:where(.wee-table-container) :where(.wee-table-action, .wee-table-indicator, .wee-table-bool).is-info {
    color: var(--wee-info);
}

:where(.wee-table-container) :where(.wee-table-action, .wee-table-indicator, .wee-table-bool).is-muted {
    color: #8a98a8;
}

:where(.wee-table-container) :where(.wee-table-action, .wee-table-indicator, .wee-table-bool).is-primary {
    color: var(--wee-navy);
}

:where(.wee-table-action.is-danger):hover:not(:disabled) {
    background: var(--wee-danger-soft);
}

:where(.wee-table-action.is-success):hover:not(:disabled) {
    background: var(--wee-success-soft);
}

/* variant: outline · solid · link */
:where(.wee-table-action.is-variant-outline, .wee-table-action.is-variant-solid) {
    --wee-icon-size: 15px;
    height: 34px;
    padding: 0 16px;
    border: 1px solid var(--wee-navy);
    border-radius: var(--wee-radius-sm);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

:where(.wee-table-action.is-variant-outline) {
    background: var(--wee-surface);
    color: var(--wee-navy);
}

:where(.wee-table-action.is-variant-outline):hover:not(:disabled) {
    background: var(--wee-hover-bg);
}

:where(.wee-table-action.is-variant-solid) {
    background: var(--wee-navy);
    color: var(--wee-on-color);
}

:where(.wee-table-action.is-variant-solid):hover:not(:disabled) {
    background: var(--wee-navy-hover);
}

:where(.wee-table-container) :where(.wee-table-action.is-variant-outline).is-danger {
    border-color: var(--wee-danger);
    color: var(--wee-danger);
}

:where(.wee-table-container) :where(.wee-table-action.is-variant-solid).is-danger {
    border-color: var(--wee-danger);
    background: var(--wee-danger);
    color: var(--wee-on-color);
}

:where(.wee-table-container) :where(.wee-table-action.is-variant-outline).is-success {
    border-color: var(--wee-success);
    color: var(--wee-success);
}

:where(.wee-table-container) :where(.wee-table-action.is-variant-solid).is-success {
    border-color: var(--wee-teal);
    background: var(--wee-teal);
    color: var(--wee-on-color);
}

:where(.wee-table-action.is-variant-link) {
    min-width: 0;
    height: auto;
    padding: 2px 4px;
    color: var(--wee-teal-dark);
    text-decoration: underline;
}

:where(.wee-table-action.is-variant-link):hover:not(:disabled) {
    background: none;
    color: var(--wee-navy);
}

:where(.wee-table-action):disabled {
    background: none;
}

:where(.wee-table-bool) {
    display: inline-flex;
    vertical-align: middle;
}

:where(.wee-table-file) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

:where(.wee-table-empty-cell) {
    color: #a3afbb;
}

/* Estados: cargando (skeleton y barra), vacío y error (WeeCore.state) */
:where(.wee-table-state) > :where(.wee-table-td) {
    padding: 0;
}

:where(.wee-table-skeleton) :where(.wee-skeleton) {
    width: 100%;
}

:where(.wee-table-skeleton) > :where(.wee-table-td:nth-child(3n)) :where(.wee-skeleton) {
    width: 60%;
}

:where(.wee-table-skeleton) > :where(.wee-table-td:nth-child(3n+1)) :where(.wee-skeleton) {
    width: 85%;
}

:where(.wee-table-progress) {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--wee-duration-fast);
}

:where(.wee-table-progress) > :where(i) {
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: var(--wee-teal);
    animation: wee-table-progress 1s ease-in-out infinite;
}

:where(wee-table.is-loading) :where(.wee-table-progress) {
    opacity: 1;
}

:where(wee-table.is-loading) :where(.wee-table-grid) > :where(tbody) {
    opacity: .55;
    transition: opacity var(--wee-duration-fast);
}

@keyframes wee-table-progress {
    to {
        left: 100%;
    }
}

/* Paginador (piezas en líneas: paginator-layout) */
:where(.wee-table-pager) {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    color: #8a919b;
}

:where(.wee-table-pager.is-top) {
    margin: 0 0 16px;
}

:where(.wee-table-pager-line) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 12px;
}

:where(.wee-table-pager.is-align-left) :where(.wee-table-pager-line) {
    justify-content: flex-start;
}

:where(.wee-table-pager.is-align-right) :where(.wee-table-pager-line) {
    justify-content: flex-end;
}

:where(.wee-table-pager-spacer) {
    flex: 1 1 auto;
}

:where(.wee-table-pager-pages) {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

:where(.wee-table-pager-info) {
    font-size: 14px;
}

:where(.wee-table-pager-current) {
    padding: 0 6px;
    color: var(--wee-navy);
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-table-pager-size, .wee-table-pager-goto) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

:where(.wee-table-pager-size, .wee-table-pager-goto) > :where(select, input) {
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--wee-table-pager-border);
    border-radius: var(--wee-radius-sm);
    background: var(--wee-surface);
    color: var(--wee-table-pager-text);
    font: inherit;
}

:where(.wee-table-pager-goto) > :where(input) {
    width: 72px;
}

:where(.wee-table-pager-size, .wee-table-pager-goto) > :where(select, input):focus {
    border-color: var(--wee-navy);
    outline: none;
    box-shadow: 0 0 0 3px rgba(4, 45, 111, .12);
}

:where(.wee-table-page) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--wee-table-pager-border);
    border-radius: var(--wee-radius-sm);
    background: var(--wee-surface);
    color: var(--wee-table-pager-text);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: border-color var(--wee-duration-fast), background var(--wee-duration-fast);
}

:where(.wee-table-page.is-nav) {
    min-width: 132px;
    padding: 0 18px;
}

:where(.wee-table-page) :where(.wee-icon.is-chevron) {
    --wee-icon-size: 18px;
    color: var(--wee-accent);
}

:where(.wee-table-page) :where(.wee-icon.is-chevron) > :where(svg) {
    stroke-width: 3;
}

:where(.wee-table-page):hover:not(:disabled, .is-current) {
    border-color: var(--wee-navy);
    background: #f6f9fb;
}

/* La página actual: gana a la regla general de [aria-current] (3.7). */
:where(.wee-table-page).is-current {
    border-color: var(--wee-accent);
    background: var(--wee-accent);
    color: var(--wee-on-color);
    font-weight: inherit;
    cursor: default;
}

:where(.wee-table-ellipsis) {
    min-width: 16px;
    color: var(--wee-table-pager-text);
    letter-spacing: 1px;
    text-align: center;
}

/* ---- Tema wee (default): encabezado azul, renglones alternados, redondeados y separados ---- */
:where(wee-table.is-theme-wee) :where(.wee-table-scroll) {
    padding: 0 6px;
    border: 0;
    border-radius: 0;
    background: #f3f6f9;
}

:where(wee-table.is-theme-wee) :where(.wee-table-grid) {
    border-spacing: 0 6px;
}

:where(wee-table.is-theme-wee) :where(.wee-table-th) {
    padding: 14px 16px;
    border-bottom: 0;
    background: var(--wee-navy);
    color: var(--wee-on-color);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

:where(wee-table.is-theme-wee) :where(.wee-table-sort):hover,
:where(wee-table.is-theme-wee) :where(.wee-table-th.is-sorted) {
    color: var(--wee-on-color);
}

:where(wee-table.is-theme-wee) :where(.wee-table-sort-icon) {
    opacity: .6;
}

:where(wee-table.is-theme-wee) :where(th[aria-sort="ascending"], th[aria-sort="descending"]) :where(.wee-table-sort-icon) {
    color: var(--wee-accent);
    opacity: 1;
}

:where(wee-table.is-theme-wee) :where(thead) :where(.wee-table-check) {
    accent-color: var(--wee-accent);
}

:where(wee-table.is-theme-wee) :where(.wee-table-filters) :where(.wee-table-th) {
    padding: 8px 10px;
    background: #e3eaf2;
}

:where(wee-table.is-theme-wee) :where(.wee-table-td) {
    padding: 16px;
    border-bottom: 0;
    background: var(--wee-surface);
    color: var(--wee-navy);
    font-size: 14px;
}

:where(wee-table.is-theme-wee.is-striped) :where(.wee-table-row:nth-child(odd of .wee-table-row)) > :where(.wee-table-td) {
    background: #e9eff5;
}

:where(wee-table.is-theme-wee.is-striped) :where(.wee-table-row:nth-child(even of .wee-table-row)) > :where(.wee-table-td) {
    background: var(--wee-surface);
}

:where(wee-table.is-theme-wee.is-hover) :where(.wee-table-row):hover > :where(.wee-table-td) {
    background: #dde7f1;
}

:where(wee-table.is-theme-wee) :where(tbody, tfoot) > :where(tr) > :where(.wee-table-td:first-child) {
    border-radius: 6px 0 0 6px;
}

:where(wee-table.is-theme-wee) :where(tbody, tfoot) > :where(tr) > :where(.wee-table-td:last-child) {
    border-radius: 0 6px 6px 0;
}

:where(wee-table.is-theme-wee) :where(tbody) > :where(tr) > :where(.wee-table-td:only-child) {
    border-radius: 6px;
}

:where(wee-table.is-theme-wee.is-dense) :where(.wee-table-td) {
    padding: 9px 12px;
}

:where(wee-table.is-theme-wee.is-dense) :where(.wee-table-th) {
    padding: 10px 12px;
}

:where(wee-table.is-theme-wee) :where(.wee-table-row.is-expanded) > :where(.wee-table-td) {
    border-radius: 0;
}

:where(wee-table.is-theme-wee) :where(.wee-table-grid) > :where(tfoot) :where(.wee-table-td) {
    border-top: 0;
    background: var(--wee-surface);
    box-shadow: inset 0 2px 0 var(--wee-navy);
}

:where(wee-table.is-theme-wee) :where(.wee-table-expand) {
    color: var(--wee-navy);
}

:where(wee-table.is-theme-wee) :where(.wee-table-expand):hover {
    background: rgba(4, 45, 111, .08);
}

:where(wee-table.is-theme-wee) :where(wee-table.is-nested) :where(.wee-table-scroll) {
    background: #f3f6f9;
}

:where(wee-table.is-theme-wee) :where(wee-table.is-nested) :where(.wee-table-th) {
    padding: 9px 12px;
    font-size: var(--wee-font-size-sm);
}

/* ---- Tema minimal: sin fondos, solo líneas ---- */
:where(wee-table.is-theme-minimal) :where(.wee-table-scroll) {
    border: 0;
    border-radius: 0;
    background: transparent;
}

:where(wee-table.is-theme-minimal) :where(.wee-table-th) {
    border-bottom: 2px solid var(--wee-navy);
    background: transparent;
    color: var(--wee-navy);
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}

:where(wee-table.is-theme-minimal) :where(.wee-table-td),
:where(wee-table.is-theme-minimal.is-striped) :where(.wee-table-row:nth-child(even of .wee-table-row)) > :where(.wee-table-td),
:where(wee-table.is-theme-minimal) :where(.wee-table-grid) > :where(tfoot) :where(.wee-table-td) {
    background: transparent;
}

:where(wee-table.is-theme-minimal.is-hover) :where(.wee-table-row):hover > :where(.wee-table-td) {
    background: #f4f7fa;
}

:where(wee-table.is-theme-minimal) :where(.wee-table-filters) :where(.wee-table-th) {
    border-bottom: 1px solid var(--wee-table-line);
}

/* ---- Tema grid: cuadrícula tipo Excel ---- */
:where(wee-table.is-theme-grid) :where(.wee-table-scroll) {
    border: 1px solid #cfd8e1;
    border-radius: 4px;
}

:where(wee-table.is-theme-grid) :where(.wee-table-th, .wee-table-td) {
    padding: 8px 10px;
    border-right: 1px solid #dde4eb;
    border-bottom: 1px solid #dde4eb;
}

:where(wee-table.is-theme-grid) :where(.wee-table-th) {
    border-bottom-color: #cfd8e1;
    background: #e9eef4;
    color: var(--wee-navy);
    font-size: var(--wee-font-size-sm);
    letter-spacing: 0;
    text-transform: none;
}

:where(wee-table.is-theme-grid) :where(.wee-table-th, .wee-table-td):last-child {
    border-right: 0;
}

:where(wee-table.is-theme-grid.is-striped) :where(.wee-table-row:nth-child(even of .wee-table-row)) > :where(.wee-table-td) {
    background: #f6f8fa;
}

/* ---- Tema cards: cada renglón es una tarjeta ---- */
:where(wee-table.is-theme-cards) :where(.wee-table-scroll) {
    padding: 0 4px 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

:where(wee-table.is-theme-cards) :where(.wee-table-grid) {
    border-spacing: 0 10px;
}

:where(wee-table.is-theme-cards) :where(.wee-table-th) {
    padding: 2px 18px 0;
    border-bottom: 0;
    background: transparent;
    font-size: var(--wee-font-size-sm);
    letter-spacing: 0;
    text-transform: none;
}

:where(wee-table.is-theme-cards) :where(.wee-table-td) {
    padding: 16px 18px;
    border-top: 1px solid var(--wee-divider);
    border-bottom: 1px solid var(--wee-divider);
    background: var(--wee-surface);
    box-shadow: 0 6px 12px -10px rgba(4, 45, 111, .35);
}

:where(wee-table.is-theme-cards) :where(tbody) > :where(tr) > :where(.wee-table-td:first-child) {
    border-left: 1px solid var(--wee-divider);
    border-radius: 12px 0 0 12px;
}

:where(wee-table.is-theme-cards) :where(tbody) > :where(tr) > :where(.wee-table-td:last-child) {
    border-right: 1px solid var(--wee-divider);
    border-radius: 0 12px 12px 0;
}

:where(wee-table.is-theme-cards) :where(tbody) > :where(tr) > :where(.wee-table-td:only-child) {
    border-radius: 12px;
}

:where(wee-table.is-theme-cards.is-striped) :where(.wee-table-row:nth-child(even of .wee-table-row)) > :where(.wee-table-td) {
    background: var(--wee-surface);
}

:where(wee-table.is-theme-cards.is-hover) :where(.wee-table-row):hover > :where(.wee-table-td) {
    border-color: #c9d6e2;
    background: #f7fafc;
}

:where(wee-table.is-theme-cards) :where(.wee-table-grid) > :where(tfoot) :where(.wee-table-td) {
    border: 0;
    background: transparent;
    box-shadow: none;
}

:where(wee-table.is-theme-cards) :where(.wee-table-row.is-expanded) > :where(.wee-table-td) {
    border-radius: 0;
}

/* ---- Después de los temas: renglones especiales, estados del renglón y celdas de seleccionar ---- */
:where(.wee-table-state) > :where(.wee-table-td) {
    background: var(--wee-surface);
}

:where(.wee-table-group) > :where(.wee-table-td) {
    background: #f2f6f9;
}

:where(.wee-table-detail) > :where(.wee-table-td) {
    background: #fbfcfd;
}

:where(wee-table.is-theme-wee) :where(.wee-table-group) > :where(.wee-table-td) {
    background: #d7e2ee;
    color: var(--wee-navy);
}

:where(wee-table.is-theme-wee) :where(.wee-table-detail) > :where(.wee-table-td) {
    margin-top: -6px;
    background: var(--wee-surface);
}

:where(.wee-table-row.is-danger) > :where(.wee-table-td) {
    background-color: #fdf1f0;
}

:where(.wee-table-row.is-warning) > :where(.wee-table-td) {
    background-color: #fff7e6;
}

:where(.wee-table-row.is-success) > :where(.wee-table-td) {
    background-color: #ecf9f4;
}

:where(.wee-table-row.is-muted) > :where(.wee-table-td) {
    color: var(--wee-muted);
}

/* Seleccionado gana al hover (los dos con una clase de peso). El renglón no toma el fondo general de 3.6:
   lo pintan sus celdas. */
:where(.wee-table-row).is-selected {
    background: transparent;
}

:where(.wee-table-row).is-selected > :where(.wee-table-td) {
    background: var(--wee-selected-bg);
}

:where(.wee-table-cell-select, .wee-table-cell-expand) {
    padding-right: 4px;
    padding-left: 12px;
}

/* ---- Celular: cada renglón es una tarjeta (responsive="cards", por el ancho de la tabla) ---- */
@container weetable (max-width: 640px) {
    :where(wee-table.is-responsive-cards) :where(.wee-table-scroll) {
        max-height: none;
        overflow: visible;
        padding: 0;
        border: 0;
        background: none;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-grid),
    :where(wee-table.is-responsive-cards) :where(.wee-table-grid) > :where(tbody, tfoot, thead) {
        display: block;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-grid) > :where(thead) {
        margin-bottom: 8px;
    }

    :where(wee-table.is-responsive-cards) :where(thead) > :where(tr:first-child) {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    :where(wee-table.is-responsive-cards) :where(thead) :where(.wee-table-th),
    :where(wee-table.is-responsive-cards) :where(.wee-table-filters) {
        display: none;
    }

    :where(wee-table.is-responsive-cards) :where(thead) :where(.wee-table-cell-select) {
        display: block;
        width: auto;
        padding: 0 0 0 4px;
        border: 0;
        background: none;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-select-all-text) {
        display: inline;
        color: var(--wee-muted);
        font-size: var(--wee-font-size-sm);
        font-weight: var(--wee-font-weight-semibold);
        letter-spacing: 0;
        text-transform: none;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-row) {
        display: block;
        margin-bottom: 10px;
        padding: 4px 14px;
        border: 1px solid var(--wee-table-line);
        border-radius: var(--wee-radius-lg);
        background: var(--wee-surface);
    }

    /* .wee-table-td fuera de :where: la tarjeta pinta el fondo, no sus celdas (ni con hover ni seleccionada). */
    :where(wee-table.is-responsive-cards) :where(.wee-table-row) > .wee-table-td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        max-width: none;
        padding: 8px 0;
        border-bottom: 1px dashed var(--wee-table-line-soft);
        border-radius: 0;
        background: none;
        text-align: right;
        white-space: normal;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-row) > :where(.wee-table-td:last-child) {
        border-bottom: 0;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-row) > :where(.wee-table-td.is-actions) {
        width: auto;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-row) > :where(.wee-table-td) > * {
        min-width: 0;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-row) > :where(.wee-table-td)[data-label]::before {
        content: attr(data-label);
        flex: none;
        max-width: 45%;
        color: var(--wee-muted);
        font-size: var(--wee-font-size-xs);
        font-weight: var(--wee-font-weight-bold);
        letter-spacing: .03em;
        text-align: left;
        text-transform: uppercase;
    }

    /* Mismo peso que la regla de las celdas de arriba (que tiene .wee-table-td fuera de :where). */
    :where(wee-table.is-responsive-cards) :where(.wee-table-row) > :where(.wee-table-cell-select, .wee-table-cell-expand).wee-table-td {
        display: inline-flex;
        width: auto;
        padding: 8px 10px 4px 0;
        border: 0;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-row).is-selected {
        border-color: var(--wee-teal);
        background: #f3fbf9;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-detail, .wee-table-group, .wee-table-state, .wee-table-skeleton),
    :where(wee-table.is-responsive-cards) :where(tfoot) > :where(tr) {
        display: block;
        margin-bottom: 10px;
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-detail, .wee-table-group, .wee-table-state, .wee-table-skeleton) > :where(.wee-table-td) {
        display: block;
        border-radius: var(--wee-radius-lg);
    }

    :where(wee-table.is-responsive-cards) :where(.wee-table-detail) > :where(.wee-table-td) {
        margin-top: -8px;
        padding: 10px;
        border: 1px solid var(--wee-table-line);
    }

    :where(wee-table.is-responsive-cards) :where(tfoot) > :where(tr) {
        display: grid;
        grid-template-columns: 1fr auto;
        padding: 8px 12px;
        border-radius: var(--wee-radius-lg);
        background: var(--wee-table-head-bg);
    }

    :where(wee-table.is-responsive-cards) :where(tfoot) :where(.wee-table-td) {
        display: block;
        padding: 4px 0;
        border: 0;
        background: none;
        box-shadow: none;
    }

    :where(wee-table.is-responsive-cards) :where(tfoot) :where(.wee-table-td):empty {
        display: none;
    }

    :where(.wee-table-page-text) {
        display: none;
    }

    :where(.wee-table-page) {
        min-width: 38px;
        height: 38px;
    }

    :where(.wee-table-page.is-nav) {
        min-width: 42px;
        padding: 0 10px;
    }

    :where(.wee-table-pager-pages, .wee-table-pager-line) {
        gap: 6px;
    }

    :where(.wee-table-search) {
        flex: 1 1 100%;
    }

    :where(.wee-table-toolbar-end) {
        margin-left: 0;
    }
}


/* ==========================================================================
   5.16 WeeSummary
   <wee-summary> (sin clase wee-: is-card | is-band, is-theme-*, is-editing) con .wee-summary-container dentro.
   El encabezado es la pieza .wee-header (azul en wee; blanco con línea verde agua en gmm).
   ========================================================================== */

:where(wee-summary) {
    display: block;
    color: var(--wee-text);
    font-family: var(--wee-font);
    font-size: 14px;
}

:where(wee-summary) > :where(wee-field, wee-summary-section) {
    display: none;
}

:where(.wee-summary-container),
:where(.wee-summary-container) * {
    box-sizing: border-box;
}

:where(wee-summary.is-card) > :where(.wee-summary-container) {
    overflow: hidden;
    border: 1px solid var(--wee-divider);
    border-radius: var(--wee-radius-lg);
    background: var(--wee-surface);
}

:where(.wee-summary-title) {
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-summary-tag) {
    padding: 2px 10px;
    border-radius: var(--wee-radius-pill);
    background: rgba(255, 255, 255, .18);
    font-size: 12px;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-summary-tools) {
    display: inline-flex;
    gap: 8px;
    margin-left: auto;
}

:where(.wee-summary-tools) > :where(.wee-btn) {
    min-height: 34px;
    padding: 0 14px;
    border-radius: var(--wee-radius-sm);
    font-size: var(--wee-font-size-md);
    font-weight: var(--wee-font-weight-semibold);
}

/* Tema wee: botones blancos sobre el encabezado azul. */
:where(wee-summary.is-theme-wee) :where(.wee-summary-tools) > :where(.wee-btn-outline) {
    border-color: rgba(255, 255, 255, .55);
    background: transparent;
    color: var(--wee-on-color);
}

:where(wee-summary.is-theme-wee) :where(.wee-summary-tools) > :where(.wee-btn-outline):hover:not(:disabled) {
    background: rgba(255, 255, 255, .12);
}

:where(wee-summary.is-theme-wee) :where(.wee-summary-tools) > :where(.wee-btn-primary) {
    border-color: var(--wee-surface);
    background: var(--wee-surface);
    color: var(--wee-navy);
}

:where(wee-summary.is-theme-wee) :where(.wee-summary-tools) > :where(.wee-btn-primary):hover:not(:disabled) {
    border-color: #e9eff6;
    background: #e9eff6;
}

:where(wee-summary.is-theme-gmm) :where(.wee-summary-tag) {
    background: var(--wee-teal-soft);
    color: var(--wee-teal-dark);
}

:where(.wee-summary-copy, .wee-summary-section-head):focus-visible {
    outline: 2px solid var(--wee-teal);
    outline-offset: 2px;
}

:where(.wee-summary-grid) {
    display: grid;
    grid-template-columns: repeat(var(--wee-summary-columns, 3), minmax(0, 1fr));
    gap: 16px 24px;
    margin: 0;
    padding: 18px;
}

:where(.wee-summary-item) {
    grid-column: span var(--wee-summary-span, 1);
}

:where(.wee-summary-item) > :where(dt) {
    color: var(--wee-muted);
    font-size: 12px;
}

:where(.wee-summary-item) > :where(dd) {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 3px 0 0;
    font-size: 14px;
    font-weight: var(--wee-font-weight-semibold);
    overflow-wrap: anywhere;
}

:where(.wee-summary-item.is-edit) > :where(wee-input) {
    margin: 0;
}

:where(.wee-summary-empty) {
    color: #aab4bf;
    font-weight: 400;
}

:where(.wee-summary-copy) {
    --wee-icon-size: 15px;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-sm);
    background: none;
    color: #9aa6b2;
    cursor: pointer;
}

:where(.wee-summary-copy):hover {
    background: var(--wee-hover-bg);
    color: var(--wee-navy);
}

:where(.wee-summary-copy.is-copied) {
    color: var(--wee-success);
}

:where(.wee-summary-section) {
    border-top: 1px solid var(--wee-divider);
}

:where(.wee-summary-section-head) {
    --wee-icon-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    border: 0;
    background: var(--wee-bg);
    color: inherit;
    font: inherit;
    font-weight: var(--wee-font-weight-semibold);
    text-align: left;
    cursor: pointer;
}

:where(.wee-summary-section-head) > :where(.wee-icon) {
    transition: transform var(--wee-duration-base);
}

:where(.wee-summary-section.is-collapsed) > :where(.wee-summary-section-head) > :where(.wee-icon) {
    transform: rotate(-90deg);
}

:where(.wee-summary-band) {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--wee-divider);
    border-radius: var(--wee-radius-lg);
    background: var(--wee-surface);
}

:where(.wee-summary-cell) {
    flex: 1 1 140px;
    min-width: 0;
    padding: 12px 18px;
    border-right: 1px solid var(--wee-divider);
}

:where(.wee-summary-cell:last-child) {
    border-right: 0;
}

:where(.wee-summary-cell) > :where(small) {
    display: block;
    color: var(--wee-muted);
    font-size: 12px;
}

:where(.wee-summary-cell) > :where(b) {
    display: block;
    font-size: 15px;
    font-weight: var(--wee-font-weight-bold);
    overflow-wrap: anywhere;
}


/* ==========================================================================
   5.17 WeeTimeline
   <wee-timeline> (sin clase wee-: is-theme-gmm | is-theme-wee | is-theme-compact). La base es el tema gmm
   (línea negra, círculos azules con palomita); wee y compact cambian lo que necesitan.
   ========================================================================== */

:where(wee-timeline) {
    display: block;
    color: var(--wee-text);
    font-family: var(--wee-font);
}

:where(wee-timeline),
:where(wee-timeline) * {
    box-sizing: border-box;
}

:where(.wee-timeline-scroll.is-scrollable) {
    max-height: var(--wee-timeline-height, none);
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-color: var(--wee-navy) #dfe6ee;
    scrollbar-width: thin;
}

:where(.wee-timeline-scroll.is-scrollable)::-webkit-scrollbar {
    width: 10px;
}

:where(.wee-timeline-scroll.is-scrollable)::-webkit-scrollbar-track {
    background: #dfe6ee;
}

:where(.wee-timeline-scroll.is-scrollable)::-webkit-scrollbar-thumb {
    border: 2px solid #dfe6ee;
    border-radius: var(--wee-radius-sm);
    background: var(--wee-navy);
}

:where(.wee-timeline-item) {
    position: relative;
    display: grid;
    grid-template-columns: 56px 1fr;
}

:where(.wee-timeline-rail) {
    position: relative;
    display: flex;
    justify-content: center;
}

:where(.wee-timeline-rail)::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-1px);
    background: #1d1d1f;
}

:where(.wee-timeline-dot) {
    --wee-icon-size: 14px;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-top: 30px;
    border-radius: 50%;
    background: var(--wee-navy);
    color: var(--wee-on-color);
}

:where(.wee-timeline-dot) :where(svg) {
    stroke-width: 3;
}

:where(.wee-timeline-body) {
    min-width: 0;
    padding: 26px 0 26px 30px;
}

:where(.wee-timeline-title) {
    color: var(--wee-navy);
    font-size: 19px;
    font-weight: var(--wee-font-weight-semibold);
    line-height: 1.3;
}

:where(.wee-timeline-subtitle) {
    margin-top: 12px;
    color: var(--wee-navy);
    font-size: 16px;
    font-weight: var(--wee-font-weight-semibold);
}

:where(.wee-timeline-user) {
    margin-top: 12px;
    font-size: 16px;
}

:where(.wee-timeline-when) {
    display: grid;
    grid-template-columns: minmax(130px, 180px) auto;
    margin-top: 12px;
    font-size: 14.5px;
}

:where(.wee-timeline-docs) {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 430px;
    margin-top: 16px;
    margin-left: -18px;
}

:where(.wee-timeline-doc) {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 16px 12px 24px;
    border-radius: var(--wee-radius-sm);
    background: var(--wee-surface);
    box-shadow: 0 2px 6px rgba(4, 45, 111, .2);
}

:where(.wee-timeline-doc-icon) {
    --wee-icon-size: 32px;
    display: inline-flex;
    flex: none;
    color: var(--wee-teal);
}

:where(.wee-timeline-doc-info) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    padding-left: 28px;
}

:where(.wee-timeline-doc-name) {
    overflow: hidden;
    color: var(--wee-navy);
    font-size: 17px;
    font-weight: var(--wee-font-weight-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.wee-timeline-doc-meta) {
    color: #8a919b;
    font-size: 14px;
}

:where(.wee-timeline-doc-size.is-sized)::after {
    content: ' --- ';
}

:where(.wee-timeline-doc-ready) {
    color: var(--wee-teal);
}

:where(.wee-timeline-doc-view) {
    --wee-icon-size: 24px;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--wee-radius-md);
    background: none;
    color: var(--wee-navy);
    cursor: pointer;
}

:where(.wee-timeline-doc-view):hover {
    background: var(--wee-hover-bg);
}

:where(.wee-timeline-doc-view, .wee-timeline-detail-toggle):focus-visible {
    outline: 2px solid var(--wee-teal);
    outline-offset: 2px;
}

:where(.wee-timeline-detail-toggle) {
    --wee-icon-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--wee-success);
    font: inherit;
    font-size: 13px;
    font-weight: var(--wee-font-weight-bold);
    cursor: pointer;
}

:where(.wee-timeline-detail-toggle) > :where(.wee-icon) {
    transition: transform var(--wee-duration-fast);
}

:where(.wee-timeline-detail-toggle)[aria-expanded="true"] > :where(.wee-icon) {
    transform: rotate(180deg);
}

:where(.wee-timeline-detail) {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: var(--wee-radius-md);
    background: var(--wee-bg);
    color: var(--wee-muted);
    font-size: 13px;
    white-space: pre-line;
}

:where(.wee-timeline-list) > :where(.wee-state) {
    padding: 40px 16px;
}

:where(.wee-timeline-more) {
    padding: 12px;
    color: var(--wee-muted);
    font-size: 13px;
    text-align: center;
}

:where(.wee-timeline-skeleton) {
    display: grid;
    grid-template-columns: 56px 1fr;
    padding: 22px 0;
}

:where(.wee-timeline-skeleton-dot) {
    justify-self: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e6ecf2;
}

:where(.wee-timeline-skeleton-lines) {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 30px;
}

:where(.wee-timeline-skeleton-lines) > :where(.wee-skeleton) {
    width: 60%;
}

:where(.wee-timeline-skeleton-lines) > :where(.wee-skeleton:nth-child(2)) {
    width: 40%;
}

:where(.wee-timeline-skeleton-lines) > :where(.wee-skeleton:nth-child(3)) {
    width: 30%;
}

/* Puntos por tipo (types): fondo claro y el color del tipo. */
:where(.wee-timeline-dot.is-success) {
    background: var(--wee-teal-soft);
    color: var(--wee-teal-dark);
}

:where(.wee-timeline-dot.is-danger) {
    background: var(--wee-danger-soft);
    color: var(--wee-danger);
}

:where(.wee-timeline-dot.is-warning) {
    background: var(--wee-warning-soft);
    color: #b26a00;
}

:where(.wee-timeline-dot.is-info) {
    background: var(--wee-info-soft);
    color: var(--wee-info);
}

/* ---- Tema wee: tarjetas agrupadas por día, ícono y color por tipo ---- */
:where(wee-timeline.is-theme-wee) :where(.wee-timeline-item) {
    grid-template-columns: 40px 1fr;
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-rail)::before {
    top: 46px;
    background: var(--wee-divider);
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-item:last-child) :where(.wee-timeline-rail)::before {
    display: none;
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-dot) {
    --wee-icon-size: 16px;
    width: 32px;
    height: 32px;
    margin-top: 8px;
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-dot.is-primary) {
    background: var(--wee-primary-soft);
    color: var(--wee-navy);
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-body) {
    margin: 0 0 16px 12px;
    padding: 10px 14px;
    border: 1px solid var(--wee-divider);
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-head) {
    display: flex;
    align-items: center;
    gap: 8px;
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-title) {
    font-size: 14.5px;
    font-weight: var(--wee-font-weight-bold);
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-time) {
    margin-left: auto;
    color: var(--wee-muted);
    font-size: 12px;
}

:where(wee-timeline.is-theme-wee, wee-timeline.is-theme-compact) :where(.wee-timeline-meta) {
    margin-top: 3px;
    color: var(--wee-muted);
    font-size: var(--wee-font-size-sm);
}

:where(wee-timeline.is-theme-wee, wee-timeline.is-theme-compact) :where(.wee-timeline-docs) {
    max-width: none;
    margin: 10px 0 0;
}

:where(wee-timeline.is-theme-wee, wee-timeline.is-theme-compact) :where(.wee-timeline-doc) {
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--wee-divider);
    box-shadow: none;
}

:where(wee-timeline.is-theme-wee, wee-timeline.is-theme-compact) :where(.wee-timeline-doc-info) {
    padding-left: 0;
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-doc-icon) {
    --wee-icon-size: 26px;
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-doc-name) {
    font-size: var(--wee-font-size-md);
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-doc-meta) {
    font-size: 12px;
}

:where(wee-timeline.is-theme-wee) :where(.wee-timeline-doc-view) {
    --wee-icon-size: 20px;
}

:where(.wee-timeline-day) {
    margin: 4px 0 12px 52px;
    color: var(--wee-muted);
    font-size: 12px;
    font-weight: var(--wee-font-weight-bold);
    letter-spacing: .04em;
    text-transform: uppercase;
}

:where(.wee-timeline-filters) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

/* ---- Tema compact: para paneles laterales o modales chicos ---- */
:where(wee-timeline.is-theme-compact) :where(.wee-timeline-item) {
    grid-template-columns: 22px 1fr;
}

:where(wee-timeline.is-theme-compact) :where(.wee-timeline-rail)::before {
    top: 0;
    background: var(--wee-divider);
}

:where(wee-timeline.is-theme-compact) :where(.wee-timeline-dot) {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border: 2px solid var(--wee-teal);
    background: var(--wee-surface);
}

:where(wee-timeline.is-theme-compact) :where(.wee-timeline-body) {
    padding: 0 0 16px 10px;
}

:where(wee-timeline.is-theme-compact) :where(.wee-timeline-title) {
    display: block;
    font-size: var(--wee-font-size-md);
    font-weight: var(--wee-font-weight-bold);
}

:where(wee-timeline.is-theme-compact) :where(.wee-timeline-meta) {
    display: block;
    margin-top: 0;
    font-size: 12px;
}

:where(wee-timeline.is-theme-compact) :where(.wee-timeline-docs) {
    margin-top: 8px;
}

:where(wee-timeline.is-theme-compact) :where(.wee-timeline-doc) {
    gap: 10px;
    padding: 6px 8px;
}

:where(wee-timeline.is-theme-compact) :where(.wee-timeline-doc-name) {
    font-size: 13px;
}

:where(wee-timeline.is-theme-compact) :where(.wee-timeline-doc-icon) {
    --wee-icon-size: 22px;
}


/* ==========================================================================
   5.18 WeeComments
   <wee-comments> (sin clase wee-: is-theme-wee | is-theme-gmm, is-writing-internal).
   ========================================================================== */

:where(wee-comments) {
    display: block;
    color: var(--wee-text);
    font-family: var(--wee-font);
    font-size: 14px;
}

:where(wee-comments),
:where(wee-comments) * {
    box-sizing: border-box;
}

:where(.wee-comments-list.is-scrollable) {
    max-height: var(--wee-comments-height, none);
    overflow-y: auto;
    padding-right: 6px;
}

:where(.wee-comments-list) > :where(.wee-state) {
    padding: 30px 16px;
}

:where(.wee-comments-item) {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

:where(.wee-comments-item.is-mine) {
    flex-direction: row-reverse;
}

:where(.wee-comments-avatar) {
    display: grid;
    flex: none;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--wee-primary-soft);
    color: var(--wee-navy);
    font-size: 12px;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-comments-avatar.is-small) {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

:where(.wee-comments-item.is-mine) > :where(.wee-comments-avatar) {
    background: var(--wee-navy);
    color: var(--wee-on-color);
}

:where(.wee-comments-item.is-internal:not(.is-mine)) > :where(.wee-comments-avatar) {
    background: var(--wee-warning-soft);
    color: var(--wee-warning-dark);
}

:where(.wee-comments-content) {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: min(620px, 82%);
}

:where(.wee-comments-item.is-mine) :where(.wee-comments-content) {
    align-items: flex-end;
}

:where(.wee-comments-head) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

:where(.wee-comments-head) > :where(b) {
    font-size: var(--wee-font-size-md);
}

:where(.wee-comments-head) > :where(time),
:where(.wee-comments-role) {
    color: var(--wee-muted);
    font-size: 12px;
}

:where(.wee-comments-item.is-mine) :where(.wee-comments-head) {
    flex-direction: row-reverse;
}

:where(.wee-comments-tag) {
    padding: 1px 8px;
    font-size: var(--wee-font-size-xs);
}

:where(.wee-comments-bubble) {
    margin-top: 6px;
    padding: 10px 14px;
    border-radius: 4px 12px 12px 12px;
    background: var(--wee-bg);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

:where(.wee-comments-item.is-mine) :where(.wee-comments-bubble) {
    border-radius: 12px 4px 12px 12px;
    background: var(--wee-navy);
    color: var(--wee-on-color);
}

:where(.wee-comments-item.is-internal) :where(.wee-comments-bubble) {
    border: 1px dashed #f0c766;
    background: #fff8e6;
    color: var(--wee-text);
}

:where(.wee-comments-mention) {
    color: var(--wee-success);
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-comments-item.is-mine:not(.is-internal)) :where(.wee-comments-mention) {
    color: var(--wee-accent);
}

:where(.wee-comments-atts) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

:where(.wee-comments-att) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--wee-divider);
    border-radius: var(--wee-radius-md);
    background: var(--wee-surface);
    color: var(--wee-navy);
    font: inherit;
    font-size: var(--wee-font-size-sm);
    cursor: pointer;
}

:where(.wee-comments-att):hover {
    border-color: #c9d6e2;
    background: #f7fafc;
}

:where(.wee-comments-att-type) {
    display: grid;
    flex: none;
    place-items: center;
    width: 24px;
    height: 28px;
    border-radius: 3px;
    color: var(--wee-on-color);
    font-size: 7px;
    font-style: normal;
    font-weight: var(--wee-font-weight-bold);
}

:where(.wee-comments-att) > :where(span) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:where(.wee-comments-att, .wee-comments-switch > button):focus-visible {
    outline: 2px solid var(--wee-teal);
    outline-offset: 2px;
}

/* Campo para escribir */
:where(.wee-comments-composer) {
    margin-top: 8px;
    border: 1px solid var(--wee-border-strong);
    border-radius: var(--wee-radius-lg);
    background: var(--wee-surface);
    transition: border-color var(--wee-duration-fast), box-shadow var(--wee-duration-fast);
}

:where(.wee-comments-composer):focus-within {
    border-color: var(--wee-teal);
    box-shadow: 0 0 0 3px var(--wee-focus-ring-soft);
}

/* Interno: borde amarillo también con el foco (gana a :focus-within). */
:where(wee-comments).is-writing-internal :where(.wee-comments-composer) {
    border-color: #f0c766;
    background: #fffdf5;
}

:where(.wee-comments-input-wrap) {
    position: relative;
}

:where(.wee-comments-input) {
    display: block;
    width: 100%;
    min-height: 72px;
    padding: 12px 14px;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.45;
    resize: vertical;
}

/* El foco se ve en el borde del campo completo (:focus-within), no en el textarea. */
:where(.wee-comments-input):focus-visible {
    outline: none;
}

:where(.wee-comments-mentions) {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 12px;
    width: 260px;
    margin-top: -8px;
    padding: 6px;
    border: 1px solid var(--wee-divider);
    border-radius: var(--wee-radius);
    background: var(--wee-surface);
    box-shadow: 0 16px 32px -14px rgba(4, 45, 111, .3);
}

:where(.wee-comments-option) {
    padding: 7px 8px;
}

/* La opción elegida con flechas: fondo de hover (sin el negrita general de .is-active). */
:where(.wee-comments-option).is-active {
    background: var(--wee-hover-bg);
    font-weight: inherit;
}

:where(.wee-comments-option) :where(b) {
    display: block;
    font-size: 13px;
}

:where(.wee-comments-option) :where(small) {
    color: var(--wee-muted);
    font-size: var(--wee-font-size-xs);
}

:where(.wee-comments-files) {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
}

:where(.wee-comments-files) > :where(.wee-chip) {
    --wee-icon-size: 13px;
    padding: 4px 6px 4px 10px;
    border-color: transparent;
    background: var(--wee-bg);
}

:where(.wee-comments-tools) {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 8px 12px;
    border-top: 1px solid var(--wee-divider);
    color: var(--wee-muted);
}

:where(.wee-comments-tool) {
    width: 34px;
    min-height: 34px;
}

:where(.wee-comments-tool) > :where(.wee-icon) {
    --wee-icon-size: 18px;
}

:where(.wee-comments-switch) {
    display: inline-flex;
    padding: 3px;
    border-radius: var(--wee-radius-md);
    background: var(--wee-bg);
}

:where(.wee-comments-switch) > :where(button) {
    padding: 4px 10px;
    border: 0;
    border-radius: var(--wee-radius-sm);
    background: none;
    color: var(--wee-muted);
    font: inherit;
    font-size: var(--wee-font-size-sm);
    cursor: pointer;
}

:where(.wee-comments-switch) > :where(button).is-active {
    background: var(--wee-surface);
    color: var(--wee-navy);
    font-weight: var(--wee-font-weight-semibold);
    box-shadow: 0 1px 2px rgba(4, 45, 111, .12);
}

:where(wee-comments.is-writing-internal) :where(.wee-comments-switch) > :where(button).is-active {
    color: var(--wee-warning-dark);
}

:where(.wee-comments-send) {
    min-height: 36px;
    margin-left: auto;
    padding: 0 16px;
    border-radius: var(--wee-radius-sm);
    font-weight: var(--wee-font-weight-semibold);
}

:where(wee-comments.is-theme-gmm) :where(.wee-comments-composer) {
    border-radius: var(--wee-radius-sm);
}

:where(wee-comments.is-theme-gmm) :where(.wee-comments-send) {
    border-radius: 4px;
}


/* ==========================================================================
   6. RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
    :where(wee-timeline.is-theme-gmm) :where(.wee-timeline-item) {
        grid-template-columns: 40px 1fr;
    }

    :where(wee-timeline.is-theme-gmm) :where(.wee-timeline-body) {
        padding-left: 12px;
    }

    :where(.wee-timeline-docs) {
        margin-left: 0;
    }

    :where(.wee-timeline-doc-info) {
        padding-left: 0;
    }

    :where(.wee-summary-grid) {
        grid-template-columns: 1fr;
    }

    :where(.wee-summary-item) {
        grid-column: auto;
    }

    :where(.wee-summary-cell) {
        flex-basis: 50%;
        border-right: 0;
        border-bottom: 1px solid var(--wee-divider);
    }

    :where(wee-card) {
        --wee-card-pad: 14px;
    }

    /* El estatus y las acciones pasan a otro renglón para no partir el título. */
    :where(.wee-card-header) {
        flex-wrap: wrap;
        row-gap: var(--wee-space-2);
    }

    :where(.wee-card-titles) {
        flex-basis: 150px;
    }

    :where(.wee-header) {
        padding: var(--wee-space-3) var(--wee-space-4);
    }

    :where(.wee-state) {
        padding: var(--wee-space-6) var(--wee-space-3);
    }

    :where(.wee-panel) {
        max-width: calc(100vw - 16px);
    }

    :where(.wee-file-grid) {
        grid-template-columns: minmax(0, 1fr);
    }

    :where(.wee-search-row) {
        flex-wrap: wrap;
    }

    :where(.wee-search-box) {
        flex-basis: 100%;
    }

    :where(.wee-search-button) {
        flex: 1 1 0;
    }

    :where(wee-search.is-theme-gmm) :where([data-search-button]) {
        margin-left: 0;
    }
}


/* Pasos verticales en pantallas angostas: la barra va arriba, en fila. */
@media (max-width: 768px) {
    :where(.wee-steps.is-vertical) {
        display: block;
    }

    :where(.wee-steps-bar.is-vertical) > :where(ol) {
        flex-direction: row;
    }

    :where(.wee-steps-bar.is-vertical) :where(.wee-step) {
        display: flex;
        flex: 1 1 0;
        justify-content: center;
        padding-bottom: 0;
    }

    :where(.wee-steps-bar.is-vertical) :where(.wee-step):not(:last-child)::after {
        display: none;
    }

    :where(.wee-steps-bar.is-vertical) :where(.wee-step + .wee-step)::before {
        content: '';
        position: absolute;
        top: 14px;
        right: 50%;
        width: 100%;
        height: 2px;
        background: var(--wee-teal);
    }

    :where(.wee-steps-bar.is-vertical) :where(.wee-step-button) {
        flex-direction: column;
        text-align: center;
    }
}

/* WeeModal: contactos en una columna en pantallas medianas. */
@media (max-width: 760px) {
    :where(.wee-modal-contacts-form.is-horizontal) :where(.wee-modal-fields.is-row) {
        grid-template-columns: 1fr;
    }

    :where(.wee-modal-contacts-add) {
        justify-self: end;
        margin-top: 0;
    }
}

/* WeeModal en celular: pantalla completa (salvo "Cargando"), botones a lo ancho. */
@media (max-width: 640px) {
    :where(.wee-modal.is-theme-gmm) :where(.wee-modal-head) {
        margin: 0 var(--wee-space-4);
    }

    :where(.wee-modal.is-theme-gmm) :where(.wee-modal-close) {
        margin-right: 0;
    }

    :where(.wee-modal),
    :where(.wee-modal.is-side) {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
    }

    :where(.wee-modal) > :where(.wee-modal-panel) {
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    :where(.wee-modal-foot) > :where(div) {
        flex: 1 1 100%;
        justify-content: stretch;
        margin: 0;
    }

    :where(.wee-modal-foot) :where(.wee-btn) {
        flex: 1 1 auto;
    }

    :where(.wee-modal.wee-modal-loader) {
        width: min(320px, calc(100vw - 32px));
        height: auto;
        margin: auto;
    }

    :where(.wee-modal-loader) > :where(.wee-modal-panel) {
        height: auto;
        border-radius: 14px;
    }
}

/* WeeTabs en celular: la vertical pasa a fila; las tarjetas se compactan. */
@media (max-width: 640px) {
    :where(wee-tabs.is-theme-vertical) {
        grid-template-columns: 1fr;
    }

    :where(wee-tabs.is-theme-vertical) > :where(.wee-tabs-nav) {
        flex-direction: row;
        overflow-x: auto;
    }

    :where(wee-tabs.is-theme-vertical) > :where(wee-tab) {
        grid-column: 1;
    }

    :where(wee-tabs.is-theme-gmm-cards) :where(.wee-tab-button) {
        padding: 14px var(--wee-space-5);
    }
}

} /* fin de @layer wee */


/* ==========================================================================
   7. FUERA DE LA CAPA
   Reglas que deben ganarle al CSS de la página sin !important: van fuera de @layer y con más
   especificidad que las reglas comunes de campos (.form-control:focus, .has-error .form-control,
   .mi-form input). Una regla con #id en la página sí les gana.
   ========================================================================== */

/* Campo nativo con error (WeeForm): borde rojo en lugar de la burbuja del navegador. */
:is(input, select, textarea).wee-native-invalid[aria-invalid="true"],
:is(input, select, textarea).wee-native-invalid[aria-invalid="true"]:focus {
    border-color: var(--wee-danger);
    outline-color: var(--wee-danger);
}


/* ==========================================================================
   8. ESCUDO
   Bootstrap (3, 4 y 5) y otros reset ponen estilos a ELEMENTOS: td, th { padding: 0 }, label { font-weight:
   bold }, button { font: inherit; color: inherit }, p { margin-bottom }, h3, dl, a, b, img, svg…
   Como el CSS sin capa siempre le gana a @layer, esos estilos le pegaban a las piezas de la librería.
   revert-layer regresa cada propiedad al valor que pone @layer wee (o al del navegador si la capa no pone
   nada): la pieza se ve igual con o sin Bootstrap.
   - Solo en piezas (elementos con clase wee-). No toca el contenido que el proyecto pone dentro de un
     componente (el cuerpo de un wee-card, un wee-message), ni el elemento del componente (<wee-input> no lleva
     clase wee-), ni los elementos del proyecto que la librería marca: el campo nativo con error
     (.wee-native-invalid), el contenedor del resumen (.wee-error-summary) y de los pasos (.wee-steps), y lo
     que se pone en un slot de wee-input (.wee-input-affix-element, .wee-input-label-affix).
   - 8.1 pesa (0,0,1), igual que una regla de elemento (td, label): le gana por orden, así que wee.css va
     DESPUÉS de Bootstrap. Cualquier regla con clase gana (label-class="text-primary", .mi-pantalla .wee-control).
   - 8.2 y 8.3 cubren las reglas de Bootstrap que pesan más que un elemento: input[type="checkbox"],
     [type="search"], button[disabled], button:not(:disabled), a:hover, button:focus, svg:not(:root).
   - 8.4 cubre las reglas de campos de Materialize (pesan hasta (0,4,1)).
   ========================================================================== */

/* 8.1 Reglas de elemento: td, th, label, button, input, p, h1–h6, dl, ol, a, b, small, img, table, nav… */
:not(html):where([class*="wee-"]):where(:not(.wee-native-invalid, .wee-error-summary, .wee-steps, .wee-input-affix-element,
    .wee-input-label-affix)),
:where([class*="wee-"]:not(.wee-input-affix-element, .wee-input-label-affix)) > svg:not(:root) {
    all: revert-layer;
}

/* 8.2 input[type="…"] y [type="search"] (pesan (0,1,1) y (0,1,0)). */
input:where([class*="wee-"]):where(:not(.wee-native-invalid))[type] {
    all: revert-layer;
}

/* 8.3 Estados de los controles (button[disabled], button:not(:disabled), a:hover, button:focus): solo lo de
   interacción, para que una clase del proyecto en la pieza (.btn-lg, .text-primary) siga funcionando. */
:is(a, button, input, select, textarea, summary):where([class*="wee-"]):where(:not(.wee-native-invalid))[class][class] {
    color: revert-layer;
    cursor: revert-layer;
    outline: revert-layer;
    outline-offset: revert-layer;
    text-decoration: revert-layer;
    appearance: revert-layer;
    background-color: revert-layer;
    border-color: revert-layer;
    box-shadow: revert-layer;
}

/* 8.4 Campos con Materialize (0.98 y 1.0). Sus reglas de campos pesan más que 8.2 y 8.3:
   input:not([type]) e input[type=text]:not(.browser-default) (0,1,1)/(0,2,1), los :disabled (0,2,1)/(0,3,1),
   los :focus:not([readonly]) (0,3,1)/(0,4,1) y [type="checkbox"]:not(:checked) (0,2,0), que esconde la casilla.
   Solo regresa las propiedades que pone Materialize. Con estas, una regla del proyecto sobre el campo de una pieza
   necesita el mismo peso (.mi-pantalla input.wee-control); lo normal es cambiarlo con las variables --wee-*. */
:is(input, textarea, select):where([class*="wee-"]):where(:not(.wee-native-invalid))[class][class],
:is(input, textarea, select):where([class*="wee-"]):where(:not(.wee-native-invalid))[class][class]:disabled {
    background-color: revert-layer;
    border: revert-layer;
    border-radius: revert-layer;
    outline: revert-layer;
    height: revert-layer;
    width: revert-layer;
    font: revert-layer;
    color: revert-layer;
    margin: revert-layer;
    padding: revert-layer;
    box-shadow: revert-layer;
    box-sizing: revert-layer;
    transition: revert-layer;
    position: revert-layer;
    top: revert-layer;
    left: revert-layer;
    opacity: revert-layer;
    pointer-events: revert-layer;
    resize: revert-layer;
    overflow: revert-layer;
    display: revert-layer;
}

:is(input, textarea, select):where([class*="wee-"]):where(:not(.wee-native-invalid))[class][class][class]:focus {
    border: revert-layer;
    outline: revert-layer;
    box-shadow: revert-layer;
}

/* [type="checkbox"]:not(:checked) y [type="radio"]:not(:checked) de Materialize 0.98 no piden input: también
   esconden <wee-input type="checkbox"> y <wee-check-group type="radio"> (position: absolute; left: -9999px).
   position queda en relative, como lo deja .col-md-* de Bootstrap. */
:is(wee-input, wee-check-group):is([type="checkbox"], [type="radio"])[type] {
    position: relative;
    left: revert-layer;
    opacity: revert-layer;
}
