/* Portal del núcleo · estilo Pitzui Lienzo (claro): superficies lisas, bordes finos, color solo en los datos. */
/* Tamaños de letra de AstrolUI en rem (guía «rem» de Modern Web Guidance): siguen el tamaño de letra que la persona elige en su
   navegador. A tamaño normal (16 px) miden lo mismo que los px de AstrolUI. */
:root {
    --aui-text-xs: 0.75rem;
    --aui-text-sm: 0.8125rem;
    --aui-text-md: 0.875rem;
    --aui-text-lg: 1rem;
    --aui-text-xl: 1.25rem;
}

.pzp-root {
    --aui-font: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --aui-bg: #F5F6F8;
    --aui-surface: #FFFFFF;
    --aui-text: #0F1419;
    --aui-text-2: #5B6573;
    --aui-border: #E3E6EB;
    --aui-brand: #334155; /* sin marca: neutro (nada del verde de Pitzui) */
    --pzp-brand-soft: color-mix(in srgb, var(--aui-brand) 12%, var(--aui-surface));
    --pzp-brand-text: color-mix(in srgb, var(--aui-brand) 80%, var(--aui-text));
    --aui-on-brand: #FFFFFF;
    /* Base visual (paso 108): sombras de dos capas apenas visibles; en oscuro, el nivel lo marca la luminosidad */
    --pzp-shadow: 0 1px 2px rgb(16 24 40 / .04), 0 2px 6px -2px rgb(16 24 40 / .06);
    --pzp-shadow-hover: 0 2px 4px rgb(16 24 40 / .05), 0 12px 28px -12px rgb(16 24 40 / .18);
    min-height: 100vh;
    background: var(--aui-bg);
    color: var(--aui-text);
    font-family: var(--aui-font);
    font-size: 0.875rem;
    letter-spacing: -.006em;
    -webkit-font-smoothing: antialiased;
}

.pzp-muted { color: var(--aui-text-2); }
.pzp-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pzp-card { width: min(380px, 100%); background: var(--aui-surface); border: 1px solid var(--aui-border); border-radius: calc(var(--pzp-radius, 10px) + 6px); padding: 28px; box-shadow: 0 1px 2px rgba(15, 20, 25, .04), 0 12px 32px rgba(15, 20, 25, .06); }
.pzp-card h1 { font-size: 1.375rem; margin: 18px 0 14px; letter-spacing: -.02em; }
.pzp-login { display: flex; flex-direction: column; gap: 6px; }
.pzp-login label { font-size: 0.75rem; font-weight: 600; color: var(--aui-text-2); margin-top: 8px; }
.pzp-login .aui-input { height: 40px; }
.pzp-button { margin-top: 18px; height: 42px; border: 0; border-radius: var(--pzp-radius, 10px); background: var(--aui-brand); color: var(--aui-on-brand); font: inherit; font-weight: 600; cursor: pointer; }
.pzp-button:disabled { opacity: .6; cursor: default; }
.pzp-ghost { border: 0; background: transparent; color: var(--aui-text-2); font: inherit; cursor: pointer; padding: 4px 0; }
.pzp-ghost:hover { color: var(--aui-text); }
.pzp-error { color: #B91C1C; font-size: 0.8125rem; margin-top: 10px; }

.pzp-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.9375rem; }
.pzp-logo { width: 30px; height: 30px; border-radius: 9px; background: var(--aui-brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }

.pzp-brand-logo { max-height: 36px; max-width: 180px; object-fit: contain; }
.pzp-logo-dark { display: none; }
.pzp-root[data-aui-mode="dark"] .pzp-logo-light { display: none; }
.pzp-root[data-aui-mode="dark"] .pzp-logo-dark { display: inline; }
.pzp-center-text { align-self: center; margin-top: 8px; }
.pzp-note { color: var(--aui-text-2); font-size: 0.8125rem; margin-top: 10px; }
.pzp-button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pzp-bell { position: relative; border: 0; background: transparent; color: var(--aui-text-2); font-size: 1rem; cursor: pointer; padding: 4px; margin-left: auto; }
.pzp-bell:hover { color: var(--aui-text); }
.pzp-badge { position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--aui-brand); color: var(--aui-on-brand); font-size: 0.625rem; font-weight: 700; line-height: 16px; }
.pzp-notices { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px 4px; border-top: 1px solid var(--aui-border); }
.pzp-notice { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--pzp-radius, 10px); background: color-mix(in srgb, var(--aui-text) 4%, transparent); font-size: 0.8125rem; }
.pzp-notice.pzp-unread { background: var(--pzp-brand-soft); }
.pzp-notice-warning strong { color: #B45309; }
.pzp-notice-error strong { color: #B91C1C; }
.pzp-notice a { color: var(--aui-brand); font-weight: 600; text-decoration: none; }
.pzp-link { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--aui-brand); font: inherit; font-weight: 600; cursor: pointer; }
/* Descargar la página (R5) */
.pzp-page-download { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin: -4px 0 8px; flex-wrap: wrap; }
.pzp-page-download .pzp-ghost { display: inline-flex; align-items: center; gap: 6px; font-size: 0.7812rem; }
/* Inicio de sesión único (R4.5) */
.pzp-sso { display: flex; flex-direction: column; gap: 8px; margin: 4px 0; }
.pzp-sso-button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: var(--pzp-radius, 10px); border: 1px solid var(--aui-border); background: var(--aui-surface); color: var(--aui-text); font-weight: 600; text-decoration: none; }
.pzp-sso-button:hover { border-color: var(--aui-brand); color: var(--aui-brand); }
button.pzp-sso-button { width: 100%; font: inherit; font-weight: 600; cursor: pointer; }
/* Passkeys en el perfil (paso 128) */
.pzp-passkey { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--aui-border); }
.pzp-ghost.pzp-danger { color: var(--aui-danger); }
.pzp-sso-or { display: flex; align-items: center; gap: 10px; color: var(--aui-text-2); font-size: 0.75rem; margin: 6px 0 2px; }
.pzp-sso-or::before, .pzp-sso-or::after { content: ""; flex: 1; border-top: 1px solid var(--aui-border); }
/* Alertas suscribibles (R4.4) */
.pzp-alert-form { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; font-size: 0.8125rem; }
.pzp-alert-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pzp-alert-save { height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; cursor: pointer; }
.pzp-alert-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--aui-border); border-radius: 8px; }
/* Compartir con un enlace (paso 185): duraciones en botones, el enlace creado y la página abierta con el enlace */
.pzp-share-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.pzp-share-chip { border: 1px solid var(--aui-border); background: transparent; color: var(--aui-text); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 0.8125rem; cursor: pointer; }
.pzp-share-chip:hover { border-color: var(--aui-brand); }
.pzp-share-chip.is-on { background: var(--aui-brand); border-color: var(--aui-brand); color: var(--aui-on-brand); font-weight: 600; }
.pzp-share-chip:focus-visible { outline: 2px solid var(--aui-brand); outline-offset: 2px; }
.pzp-share-row { display: flex; align-items: center; gap: 8px; }
.pzp-share-row > input:not(.pzp-share-hours) { flex: 1 1 auto; min-width: 0; }
.pzp-share-hours { width: 6rem; }
.pzp-share-made { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--aui-brand); border-radius: 8px; background: var(--aui-brand-soft, transparent); }
.pzp-shell.pzp-shell-shared { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.pzp-shell-shared .pzp-topbar { display: none; }
.pzp-shared-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--aui-border); border-radius: var(--pzp-radius, 10px); background: var(--aui-surface); font-size: 0.8125rem; }
.pzp-shared-banner > i { color: var(--aui-brand); }
.pzp-shared-tag { margin-left: auto; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--aui-border); color: var(--aui-text-2); }
.pzp-alert-item > span { display: flex; flex-direction: column; }
.pzp-alert-firing { border-color: #D97706; box-shadow: inset 3px 0 0 #D97706; }
/* Aprobaciones pendientes (R4.3) */
.pzp-bell.pzp-approvals-button { margin-left: auto; }
.pzp-bell.pzp-approvals-button + .pzp-bell { margin-left: 0; }
.pzp-badge-warn { background: #D97706; color: #fff; }
.pzp-approvals { max-height: 60vh; }
.pzp-approval { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--pzp-radius, 10px); border: 1px solid var(--aui-border); background: var(--aui-surface); font-size: 0.8125rem; }
.pzp-approval-data { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; }
.pzp-approval-data dt { color: var(--aui-text-2); }
.pzp-approval-data dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pzp-approval-comment { width: 100%; min-height: 0; resize: vertical; font: inherit; font-size: 0.7812rem; box-sizing: border-box; }
.pzp-approval-actions { display: flex; gap: 6px; }
.pzp-approval-actions button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 32px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.pzp-approval-actions button:disabled { opacity: .6; cursor: progress; }
.pzp-approve { border: 0; background: var(--aui-brand); color: var(--aui-on-brand); }
.pzp-reject { border: 1px solid var(--aui-border); background: transparent; color: var(--aui-text); }
.pzp-reject:hover { border-color: #B91C1C; color: #B91C1C; }
.pzp-approval-msg { padding: 6px 10px; border-radius: 8px; background: var(--pzp-brand-soft); font-size: 0.7812rem; }
.pzp-approval-done-title { margin-top: 6px; font-size: 0.7188rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--aui-text-2); }
.pzp-decision-approved strong { color: #047857; }
.pzp-decision-rejected strong, .pzp-decision-expired strong, .pzp-decision-cancelled strong { color: var(--aui-text-2); }

.pzp-shell { display: flex; min-height: 100vh; flex-wrap: wrap; }
.pzp-nav { width: 240px; flex: 0 0 240px; background: var(--aui-surface); border-right: 1px solid var(--aui-border); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; box-sizing: border-box; }
.pzp-nav .pzp-brand { padding: 0 6px 16px; }
.pzp-section { padding: 12px 10px 4px; color: #6B7480; font-size: 0.6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pzp-link { display: block; padding: 8px 10px; border-radius: 8px; color: var(--aui-text-2); text-decoration: none; font-weight: 500; }
.pzp-link:hover { background: color-mix(in srgb, var(--aui-text) 6%, transparent); color: var(--aui-text); }
.pzp-item { display: flex; align-items: center; gap: 2px; }
.pzp-item .pzp-link { flex: 1; min-width: 0; }
.pzp-toggle { flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--aui-text-2); cursor: pointer; }
.pzp-toggle:hover { background: color-mix(in srgb, var(--aui-text) 6%, transparent); }
.pzp-children { margin: 2px 0 4px 12px; padding-left: 8px; border-left: 1px solid color-mix(in srgb, var(--aui-text) 12%, transparent); }
.pzp-sublink { padding: 6px 10px; font-size: 0.8125rem; }
.pzp-separator { border: 0; border-top: 1px solid color-mix(in srgb, var(--aui-text) 12%, transparent); margin: 6px 10px; }
.pzp-link.pzp-active { background: var(--pzp-brand-soft); color: var(--pzp-brand-text); font-weight: 600; }
.pzp-grow { flex: 1; }
.pzp-user { border-top: 1px solid var(--aui-border); padding: 12px 6px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.pzp-main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 40px; box-sizing: border-box; }
.pzp-header h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.02em; }
.pzp-header p { margin: 4px 0 0; }
.pzp-filters { display: flex; flex-wrap: wrap; gap: var(--pzp-gap, 12px); margin: 18px 0 16px; }
.pzp-filter { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; font-weight: 600; color: var(--aui-text-2); min-width: 180px; }
.pzp-filter .aui-input { height: 36px; font-weight: 400; }
.pzp-range { display: flex; gap: 6px; }
.pzp-main .pzr-grid { margin-top: 16px; }

@media (max-width: 760px) {
    .pzp-nav { width: 100%; flex-basis: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--aui-border); }
    .pzp-main { padding: 18px 14px 32px; }
}

/* Icono delante del nombre de la página en el menú */
.pzp-link-icon { display: inline-block; width: 18px; margin-right: 8px; text-align: center; opacity: .85; }

/* ===== Portal 2026: menú lateral fijo (se desplaza solo), páginas con aire y adaptado a móviles ===== */
.pzp-shell { display: grid; grid-template-columns: var(--pzp-nav-width, 264px) minmax(0, 1fr); height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; flex-wrap: nowrap; }
.pzp-nav { position: relative; top: auto; width: auto; flex: none; height: 100%; min-height: 0; overflow: hidden; padding: 14px 12px 12px; gap: 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--aui-brand) 6%, var(--aui-surface)) 0, var(--aui-surface) 160px); }
.pzp-nav > .pzp-brand { padding: 8px 8px 18px; margin: 0 0 8px; border-bottom: 1px solid var(--aui-border); }
.pzp-nav-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 2px; padding: 2px 2px 12px; scrollbar-width: thin; }
.pzp-main { height: 100%; min-height: 0; overflow-y: auto; padding: 28px clamp(16px, 3vw, 40px) 48px; scroll-behavior: smooth; }

/* Logotipo: alineado y del tamaño que diga la marca */
.pzp-brand-left { justify-content: flex-start; }
.pzp-brand-center { justify-content: center; text-align: center; }
.pzp-brand-right { justify-content: flex-end; }
.pzp-brand .pzp-brand-logo { max-width: 100%; }
.pzp-logo-small .pzp-brand-logo { max-height: 26px; }
.pzp-logo-medium .pzp-brand-logo { max-height: 40px; }
.pzp-logo-large .pzp-brand-logo { max-height: 60px; }

/* Enlaces del menú: pastilla con barra de la marca en la página actual */
.pzp-link { display: flex; align-items: center; gap: 2px; padding: 9px 12px; border-radius: calc(var(--pzp-radius, 10px) - 2px); position: relative; transition: background .15s, color .15s; }
.pzp-link.pzp-active::before { content: ""; position: absolute; left: -2px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--aui-brand); }
.pzp-link-icon { flex: none; }
.pzp-section { padding: 16px 12px 6px; }
.pzp-user { flex: none; margin-top: 8px; }

/* Bloques de la página: tarjetas con sombra suave */
.pzp-main .pzr-widget { border-radius: calc(var(--pzp-radius, 10px) + 2px); box-shadow: var(--pzp-shadow); transition: box-shadow .2s, border-color .2s; }
.pzp-main .pzr-widget:hover { box-shadow: var(--pzp-shadow-hover); }
.pzp-root[data-aui-mode="dark"] { --pzp-shadow: inset 0 1px 0 rgb(255 255 255 / .03); --pzp-shadow-hover: inset 0 1px 0 rgb(255 255 255 / .05), 0 12px 28px -12px rgb(0 0 0 / .6); }
/* Cifras con la fuente de la marca y columnas alineadas (en el Engine siguen en monoespaciada) */
.pzp-main .pzr-num { font-family: inherit; }
/* Cabecera de la página con más jerarquía */
.pzp-main .pzr-heading h1, .pzp-header h1 { font-size: 1.625rem; font-weight: 650; letter-spacing: -.022em; text-wrap: balance; }
.pzp-header p { max-width: 72ch; color: var(--aui-text-2); }

/* ===== Cabecera de la página y filtros en píldoras (paso 111) ===== */
.pzp-pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pzp-pagehead-title { flex: 1 1 320px; min-width: 0; }
.pzp-pagehead-title .pzr-heading { margin: 0; }
/* Sin título, la barra va sola a la derecha; con título, dentro de él (ReportHeading.Actions, paso 162) */
.pzp-pagehead-actions { display: flex; align-items: center; margin-left: auto; }
.pzp-pagehead-title:empty { display: none; }
.pzp-toolbar { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 4px; border: 1px solid var(--aui-border); border-radius: 999px;
    background: var(--aui-surface); box-shadow: 0 1px 2px rgba(15, 20, 25, .04); }
.pzp-toolbar-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--aui-border); }
.pzp-tool-btn { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 999px; background: transparent; color: var(--aui-text-2);
    font-size: 0.9375rem; cursor: pointer; transition: color .15s, background .15s; }
.pzp-tool-btn:hover:not(:disabled) { color: var(--aui-text); background: color-mix(in srgb, var(--aui-text) 7%, transparent); }
.pzp-tool-btn:disabled { opacity: .5; cursor: default; }
.pzp-tool-btn:focus-visible { outline: 2px solid var(--aui-brand); outline-offset: 1px; }
.pzp-updated { display: inline-flex; align-items: center; gap: 7px; padding: 0 8px; font-size: 0.75rem; color: var(--aui-text-2); white-space: nowrap; }
.pzp-updated-short { display: none; }
/* Dentro de la franja de color del título: la barra transparente con el color de su texto (paso 162) */
.pzr-heading-band .pzp-toolbar { background: color-mix(in srgb, currentColor 12%, transparent); border-color: color-mix(in srgb, currentColor 28%, transparent); box-shadow: none; }
.pzr-heading-band .pzp-updated, .pzr-heading-band .pzp-tool-btn { color: inherit; }
.pzr-heading-band .pzp-tool-btn:hover:not(:disabled) { color: inherit; background: color-mix(in srgb, currentColor 16%, transparent); }
.pzr-heading-band .pzp-toolbar-sep { background: color-mix(in srgb, currentColor 30%, transparent); }
.pzr-heading-band .pzp-tool-btn:focus-visible { outline-color: currentColor; }
.pzp-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--aui-success, #16A34A); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aui-success, #16A34A) 20%, transparent); }

.pzp-filterbar { position: relative; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.pzp-fpill { position: relative; display: inline-flex; align-items: center; height: 34px; border-radius: 999px; border: 1px solid var(--aui-border); background: var(--aui-surface);
    color: var(--aui-text-2); transition: border-color .15s, background .15s; }
.pzp-fpill:hover { border-color: color-mix(in srgb, var(--aui-text) 22%, var(--aui-border)); }
.pzp-fpill-main { display: inline-flex; align-items: center; gap: 5px; height: 100%; padding: 0 12px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 0.8125rem; cursor: pointer; border-radius: 999px; max-width: 340px; }
.pzp-fpill-main b { color: var(--aui-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pzp-fpill-main i { font-size: 0.625rem; opacity: .7; transition: transform .15s; }
.pzp-fpill-open .pzp-fpill-main i { transform: rotate(180deg); }
.pzp-fpill-main:focus-visible, .pzp-fpill-x:focus-visible { outline: 2px solid var(--aui-brand); outline-offset: 2px; }
.pzp-fpill-on { border-color: color-mix(in srgb, var(--aui-brand) 45%, var(--aui-border)); background: var(--pzp-brand-soft); }
.pzp-fpill-on .pzp-fpill-main b { color: var(--pzp-brand-text); }
.pzp-fpill-on .pzp-fpill-main { padding-right: 4px; }
.pzp-fpill-x { width: 24px; height: 24px; margin-right: 5px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--pzp-brand-text); font-size: 0.5625rem; cursor: pointer; }
.pzp-fpill-x:hover { background: color-mix(in srgb, var(--aui-brand) 16%, transparent); }
.pzp-fpill-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 8; min-width: 260px; max-width: min(380px, 86vw); padding: 12px;
    border-radius: calc(var(--pzp-radius, 10px) + 2px); border: 1px solid var(--aui-border); background: var(--aui-surface);
    box-shadow: 0 16px 40px -10px rgb(16 24 40 / .28), 0 2px 6px rgb(16 24 40 / .08); animation: pzp-pop-in .14s ease-out; }
.pzp-fpill-pop .pzr-filter { min-width: 0; width: 100%; }
.pzp-fpill-backdrop { position: fixed; inset: 0; z-index: 5; }
@keyframes pzp-pop-in { from { opacity: 0; transform: translateY(-4px); } }
.pzp-fpill-inline .pzr-filter { min-width: 0; flex-direction: row; align-items: center; gap: 8px; }
.pzp-fpill-inline .pzr-filter > span:first-child { white-space: nowrap; }
.pzp-filterbar-clear { margin-left: 2px; text-decoration: underline; text-underline-offset: 3px; }
.pzp-filters-mobile { display: none; }

/* Filtros en móvil: un botón y un panel desde abajo */
.pzp-sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgb(8 10 14 / .45); }
.pzp-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 82dvh; display: flex; flex-direction: column; gap: 12px;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); border-radius: 18px 18px 0 0; background: var(--aui-surface); color: var(--aui-text);
    box-shadow: 0 -12px 40px rgb(0 0 0 / .25); animation: pzp-sheet-in .22s ease-out; }
.pzp-sheet-head { display: flex; align-items: center; gap: 10px; }
.pzp-sheet-head strong { flex: 1; font-size: 1rem; }
.pzp-sheet-done { height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--aui-brand); color: var(--aui-on-brand); font: inherit; font-weight: 600; cursor: pointer; }
.pzp-sheet-body { overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding-bottom: 4px; }
.pzp-sheet-body .pzr-filter { min-width: 0; width: 100%; }
@keyframes pzp-sheet-in { from { transform: translateY(100%); } }
@media (max-width: 900px) {
    .pzp-filterbar > .pzp-fpill, .pzp-filterbar > .pzp-fpill-inline, .pzp-filterbar > .pzp-apply, .pzp-filterbar > .pzp-apply-hint { display: none; }
    .pzp-filters-mobile { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--aui-border);
        background: var(--aui-surface); color: var(--aui-text); font: inherit; font-weight: 600; cursor: pointer; }
    .pzp-pagehead-actions { padding-top: 0; }
    .pzp-updated-long { display: none; }
    .pzp-updated-short { display: inline; }
}
@media (prefers-reduced-motion: reduce) { .pzp-fpill-pop, .pzp-sheet { animation: none; } }
.pzp-filters { padding: 12px; border-radius: calc(var(--pzp-radius, 10px) + 4px); background: var(--aui-surface); border: 1px solid var(--aui-border); }

/* Filtros activos: un chip por filtro elegido (pulsarlo lo quita) y «Quitar todo» */
/* Fila de filtros activos (no usar .pzp-active: es la página activa del menú) */
.pzp-filters-on { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 14px; }
.pzp-active-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 0; border-radius: 999px; font: inherit; font-size: 0.75rem; cursor: pointer;
                   background: var(--aui-brand); color: var(--aui-on-brand); animation: pzp-chip-in .18s ease-out; }
.pzp-active-chip:hover { filter: brightness(1.12); }
.pzp-active-chip i { font-size: 0.625rem; opacity: .8; }
.pzp-active-label { font-weight: 600; }
.pzp-active-label::after { content: ":"; }
.pzp-active-clear { border: 0; background: transparent; color: var(--aui-text-2); font: inherit; font-size: 0.75rem; cursor: pointer; padding: 3px 6px; }
.pzp-active-clear:hover { color: var(--aui-text); }
.pzp-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 4px 10px 4px 6px; border: 0; border-radius: 8px; background: transparent;
  color: var(--aui-text-2); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
.pzp-back:hover { color: var(--aui-text); background: color-mix(in srgb, var(--aui-text) 6%, transparent); }
.pzp-back:focus-visible { outline: 2px solid var(--aui-brand); outline-offset: 2px; }
.pzp-apply { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border: 1px solid var(--aui-border); border-radius: 999px; background: transparent;
  color: var(--aui-text-2); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: default; }
.pzp-apply-on { background: var(--aui-brand); border-color: var(--aui-brand); color: var(--aui-on-brand); cursor: pointer; }
.pzp-apply-on:hover { filter: brightness(1.08); }
.pzp-apply-hint { font-size: 0.75rem; color: var(--aui-text-2); }
@keyframes pzp-chip-in { from { opacity: 0; transform: scale(.9); } }
@media (prefers-reduced-motion: reduce) { .pzp-active-chip { animation: none; } }

/* Barra de arriba y fondo del menú: solo en pantallas estrechas */
.pzp-topbar, .pzp-backdrop { display: none; }

@media (max-width: 900px) {
    .pzp-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .pzp-topbar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; background: var(--aui-surface); border-bottom: 1px solid var(--aui-border); position: relative; z-index: 30; }
    .pzp-topbar .pzp-brand { flex: none; padding: 0; border: 0; margin: 0; }
    .pzp-topbar .pzp-brand-logo { max-height: 30px; max-width: 120px; }
    .pzp-topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--aui-text-2); }
    .pzp-burger { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--aui-text) 6%, transparent); color: var(--aui-text); font-size: 1.125rem; cursor: pointer; }
    .pzp-nav { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-104%); transition: transform .25s ease; border-right: 1px solid var(--aui-border); box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
    .pzp-nav-open .pzp-nav { transform: none; }
    .pzp-nav-open .pzp-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8, 10, 14, .45); backdrop-filter: blur(2px); }
    .pzp-main { grid-row: 2; padding: 16px 12px 32px; }
    .pzp-filters { flex-direction: column; }
    .pzp-filter { min-width: 0; width: 100%; }
}

/* Menú: nunca subrayado (ni al pasar ni con el foco), submenús que se pliegan con suavidad y grupos sin contenido */
.pzp-root a.pzp-link, .pzp-root a.pzp-link:hover, .pzp-root a.pzp-link:focus, .pzp-root a.pzp-link:visited, .pzp-root a.pzp-brand-link, .pzp-root a.pzp-brand-link:hover { text-decoration: none; }
.pzp-root a.pzp-link:focus-visible, .pzp-group:focus-visible, .pzp-toggle:focus-visible { outline: 2px solid color-mix(in srgb, var(--aui-brand) 60%, transparent); outline-offset: 1px; }
.pzp-brand-link { color: inherit; border-radius: var(--pzp-radius, 10px); transition: opacity .15s; }
.pzp-brand-link:hover { opacity: .85; }
.pzp-group { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.pzp-group-open { color: var(--aui-text); }
.pzp-toggle { display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.pzp-toggle i { display: inline-block; transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.pzp-toggle-open i { transform: rotate(90deg); }
.pzp-children-wrap { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .24s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
.pzp-children-wrap.pzp-open { grid-template-rows: 1fr; opacity: 1; }
.pzp-children-wrap > .pzp-children { overflow: hidden; min-height: 0; }
.pzp-children-wrap:not(.pzp-open) > .pzp-children { margin-top: 0; margin-bottom: 0; }
.pzp-link { transition: background .18s ease, color .18s ease, transform .18s ease; }
.pzp-link:active { transform: scale(.985); }

/* Cambio de página: el contenido entra con un fundido corto */
.pzp-main { animation: pzp-page-in .28s ease-out; }
@keyframes pzp-page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Entrada: fondo con la marca en movimiento lento, tarjeta que aparece, campos y botón con respuesta */
.pzp-entry { position: relative; overflow: hidden; isolation: isolate; }
.pzp-entry-glow::before, .pzp-entry-glow::after { content: ""; position: absolute; z-index: -1; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(70px); opacity: .35; pointer-events: none; }
.pzp-entry-glow::before { background: radial-gradient(circle, var(--aui-brand) 0, transparent 65%); top: -25vmax; left: -15vmax; animation: pzp-drift 18s ease-in-out infinite alternate; }
.pzp-entry-glow::after { background: radial-gradient(circle, var(--pzp-accent, var(--aui-brand)) 0, transparent 65%); bottom: -30vmax; right: -20vmax; opacity: .25; animation: pzp-drift 22s ease-in-out infinite alternate-reverse; }
@keyframes pzp-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vmax, 4vmax) scale(1.12); } }
.pzp-entry .pzp-card { position: relative; animation: pzp-card-in .45s cubic-bezier(.2, .8, .2, 1); backdrop-filter: blur(14px); background: color-mix(in srgb, var(--aui-surface) 88%, transparent);
    box-shadow: 0 1px 2px rgba(15, 20, 25, .05), 0 24px 60px -20px rgba(15, 20, 25, .35); }
@keyframes pzp-card-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.pzp-entry .pzp-brand { animation: pzp-card-in .5s .05s cubic-bezier(.2, .8, .2, 1) both; }
.pzp-login .aui-input { transition: border-color .15s, box-shadow .15s, background .15s; }
.pzp-login .aui-input:focus { border-color: var(--aui-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aui-brand) 22%, transparent); outline: none; }
.pzp-button { transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
.pzp-button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--aui-brand) 70%, transparent); filter: brightness(1.05); }
.pzp-button:not(:disabled):active { transform: none; box-shadow: none; }
.pzp-error { animation: pzp-shake .3s ease; }
@keyframes pzp-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.pzp-entry-theme { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 1px solid var(--aui-border); border-radius: 12px; background: color-mix(in srgb, var(--aui-surface) 80%, transparent);
    color: var(--aui-text-2); font-size: 1rem; cursor: pointer; backdrop-filter: blur(8px); transition: color .15s, transform .2s; }
.pzp-entry-theme:hover { color: var(--aui-text); transform: rotate(-12deg); }
.pzp-root, .pzp-card, .pzp-nav, .pzp-main .pzr-widget { transition: background-color .25s ease, color .25s ease, border-color .25s ease; }

@media (prefers-reduced-motion: reduce) {
    .pzp-root *, .pzp-root *::before, .pzp-root *::after { animation: none !important; transition: none !important; }
}

/* Usuario del menú: avatar con iniciales que abre el perfil */
.pzp-me { display: flex; align-items: center; gap: 8px; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 4px 6px 4px 2px; border-radius: 999px; transition: background .15s; }
.pzp-me:hover { background: color-mix(in srgb, var(--aui-text) 6%, transparent); }
.pzp-me strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pzp-avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--aui-brand); color: var(--aui-on-brand); font-size: 0.6875rem; font-weight: 700; letter-spacing: .02em; }
.pzp-avatar-lg { width: 48px; height: 48px; font-size: 1.0625rem; }

/* Perfil: modal centrado con secciones */
.pzp-modal-veil { position: fixed; inset: 0; z-index: 70; background: rgba(8, 10, 14, .45); backdrop-filter: blur(3px); animation: pzp-fade .2s ease; }
@keyframes pzp-fade { from { opacity: 0; } to { opacity: 1; } }
.pzp-modal { position: fixed; z-index: 71; top: 50%; left: 50%; width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; transform: translate(-50%, -50%);
    background: var(--aui-surface); border: 1px solid var(--aui-border); border-radius: calc(var(--pzp-radius, 10px) + 8px); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); animation: pzp-modal-in .26s cubic-bezier(.2, .8, .2, 1); overflow: hidden; }
@keyframes pzp-modal-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%); } }
.pzp-modal-head { display: flex; align-items: center; gap: 14px; padding: 20px 20px 16px; border-bottom: 1px solid var(--aui-border); background: linear-gradient(135deg, color-mix(in srgb, var(--aui-brand) 10%, var(--aui-surface)), var(--aui-surface)); }
.pzp-modal-head h2 { margin: 0; font-size: 1.125rem; letter-spacing: -.01em; }
.pzp-modal-close { margin-left: auto; display: inline-flex !important; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--aui-text) 6%, transparent); color: var(--aui-text); cursor: pointer; }
.pzp-modal-body { overflow-y: auto; padding: 6px 20px 20px; }
.pzp-modal-section { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--aui-border); }
.pzp-modal-section:last-child { border-bottom: 0; }
.pzp-modal-section label, .pzp-label { font-size: 0.75rem; font-weight: 600; color: var(--aui-text-2); margin-top: 6px; }
.pzp-modal-section .aui-input { height: 38px; transition: border-color .15s, box-shadow .15s; }
.pzp-modal-section .aui-input:focus { border-color: var(--aui-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aui-brand) 22%, transparent); outline: none; }
.pzp-modal-section .aui-input:disabled { opacity: .7; }
.pzp-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.pzp-modal-actions .pzp-button { margin-top: 0; padding: 0 18px; height: 38px; flex: none; white-space: nowrap; }
.pzp-ok { color: #047857; font-size: 0.8125rem; }
.pzp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pzp-chips span { padding: 3px 10px; border-radius: 999px; background: var(--pzp-brand-soft); color: var(--pzp-brand-text); font-size: 0.75rem; font-weight: 600; }
.pzp-fold summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; list-style: none; padding: 2px 0; }
.pzp-fold summary::-webkit-details-marker { display: none; }
.pzp-fold summary::after { content: "›"; margin-left: auto; transition: transform .2s; font-size: 1.125rem; color: var(--aui-text-2); }
.pzp-fold[open] summary::after { transform: rotate(90deg); }
.pzp-fold form { display: flex; flex-direction: column; gap: 6px; animation: pzp-card-in .22s ease; }
.pzp-2fa { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.pzp-2fa p { margin: 4px 0 0; font-size: 0.8125rem; }
.pzp-switch { flex: none; position: relative; width: 44px; height: 26px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--aui-text) 18%, transparent); cursor: pointer; transition: background .2s; }
.pzp-switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.pzp-switch.pzp-on { background: var(--aui-brand); }
.pzp-switch.pzp-on span { transform: translateX(18px); }
.pzp-pill { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: color-mix(in srgb, var(--aui-text) 8%, transparent); color: var(--aui-text-2); }
.pzp-pill.pzp-on { background: var(--pzp-brand-soft); color: var(--pzp-brand-text); }
.pzp-code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 1.375rem !important; letter-spacing: .4em; text-align: center; height: 52px !important; }

/* Detalle de un dato pulsado: panel a la derecha (a todo el ancho en el móvil) */
.pzp-detail-veil { position: fixed; inset: 0; z-index: 60; background: rgba(8, 10, 14, .35); backdrop-filter: blur(1px); }
.pzp-detail { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(760px, 92vw); display: flex; flex-direction: column; background: var(--aui-bg); border-left: 1px solid var(--aui-border); box-shadow: -20px 0 50px rgba(0, 0, 0, .2); animation: pzp-detail-in .2s ease; }
@keyframes pzp-detail-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.pzp-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; background: var(--aui-surface); border-bottom: 1px solid var(--aui-border); border-top: 4px solid var(--aui-brand); }
.pzp-detail-head h2 { margin: 2px 0; font-size: 1.25rem; letter-spacing: -.02em; }
.pzp-detail-head .pzp-burger { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--aui-text) 6%, transparent); color: var(--aui-text); cursor: pointer; }
.pzp-detail-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px 24px; }
.pzp-detail-body .pzr-widget { height: auto; }
@media (max-width: 900px) { .pzp-detail { width: 100vw; } }
.pzp-count { margin-left: 6px; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--aui-brand-soft, rgba(0,0,0,.06)); color: var(--aui-text-2); font-size: 0.6875rem; font-weight: 600; text-align: center; }
.pzp-fold .pzp-alert-item { margin-top: 8px; }
.pzp-alert-item > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pzp-mine-page { align-self: flex-start; padding: 0; font-size: 0.75rem; }

/* Zui en el portal (Fase 4.3b): botón en el menú y panel lateral de conversación, con los colores de la marca */
.pzp-zui-launch { display: flex; align-items: center; gap: 10px; width: calc(100% - 16px); margin: 8px; padding: 8px 12px; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
    background: linear-gradient(var(--aui-surface), var(--aui-surface)) padding-box, linear-gradient(120deg, var(--aui-brand), #A855F7, #22D3EE) border-box;
    color: var(--aui-text); font: inherit; font-weight: 600; box-shadow: 0 4px 16px color-mix(in srgb, var(--aui-brand) 22%, transparent); transition: transform .2s, box-shadow .2s; }
.pzp-zui-launch:hover { transform: translateY(-1px); box-shadow: 0 8px 22px color-mix(in srgb, var(--aui-brand) 32%, transparent); }
.pzp-zui-orb { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff;
    background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.55), transparent 45%), linear-gradient(135deg, var(--aui-brand), #A855F7 70%, #22D3EE); }
.pzp-zui-orb-lg { width: 52px; height: 52px; font-size: 1.375rem; }
.pzp-zui { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(440px, 100vw); display: flex; flex-direction: column; background: var(--aui-surface);
    border-left: 1px solid var(--aui-border); box-shadow: -12px 0 40px rgba(0,0,0,.18); transform: translateX(105%); transition: transform .3s cubic-bezier(.2,.9,.3,1); }
.pzp-zui.pzp-zui-open { transform: none; }
.pzp-zui-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--aui-border); }
.pzp-zui-head .pzp-bell { margin-left: 0; }
.pzp-zui-name { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.pzp-zui-name small { color: var(--aui-text-2); font-size: 0.75rem; }
.pzp-zui-body { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
/* La conversación es AstrolChat (AstrolUI Basic 10.0.13.23): aquí, la marca del cliente, burbujas con pico e ideas en píldoras */
.pzp-zui-chat { flex: 1; gap: 0; min-height: 0; }
.pzp-zui-chat .aui-chat__log { padding: 14px; gap: 10px; }
.pzp-zui-chat .aui-chat__hello { margin: auto 0; gap: 12px; }
.pzp-zui-chat .aui-chat__ideas { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.pzp-zui-chat .aui-chat__idea { border-radius: 999px; background: var(--aui-bg); font-size: 0.8125rem; }
.pzp-zui-chat .aui-chat__idea:hover:not(:disabled) { background: var(--aui-bg); }
.pzp-zui-chat .aui-chat__msg { max-width: 88%; border-radius: 14px; font-size: 0.875rem; }
.pzp-zui-chat .aui-chat__msg--user { background: var(--aui-brand); color: var(--aui-on-brand); border-bottom-right-radius: 4px; }
.pzp-zui-chat .aui-chat__msg--assistant { background: var(--aui-bg); border-bottom-left-radius: 4px; }
.pzp-zui-chat .aui-chat__notice { border: 0; padding: 2px 0; }
.pzp-zui-chat .aui-chat__busy { background: transparent; border: 0; padding: 10px 12px; }
.pzp-zui-chat .aui-chat__busy > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.pzp-zui-chat .aui-chat__dots span { width: 7px; height: 7px; }
/* Caja de una línea y el botón al lado (44 px); la caja crece con lo que se escribe hasta 140 px */
.pzp-zui-chat .aui-chat__input { flex-direction: row; align-items: flex-end; gap: 8px; padding: 10px 12px; }
.pzp-zui-chat .aui-chat__box { flex: 1; min-height: 44px; max-height: 140px; line-height: 20px; padding-top: 11px; padding-bottom: 11px; overflow-y: auto; }
.pzp-zui-chat .aui-chat__grow { display: none; }
.pzp-zui-chat .aui-chat__actions .aui-btn, .pzp-zui-chat .aui-chat__actions button { width: 44px; height: 44px; min-width: 44px; padding: 0; justify-content: center; }
.pzp-zui-error { margin: 0 12px 8px; }
.pzp-zui-answer { border: 1px solid var(--aui-border); border-radius: 12px; padding: 8px; background: var(--aui-bg); }
.pzp-zui-how { font-size: 0.75rem; color: var(--aui-text-2); margin-top: 4px; }
.pzp-zui-how summary { cursor: pointer; }
.pzp-zui-action { align-self: stretch; border: 1px solid var(--aui-border, rgba(127,127,127,.25)); border-radius: var(--pzp-radius, 10px); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.pzp-zui-action-detail { font-size: 0.8125rem; color: var(--aui-text-2); }
.pzp-zui-action-buttons { display: flex; gap: 8px; margin-top: 6px; }
.pzp-zui-action-buttons .pzp-button { margin-top: 0; height: 32px; padding: 0 14px; }
.pzp-button-ghost { background: transparent; color: var(--aui-text); border: 1px solid var(--aui-border, rgba(127,127,127,.35)); }
.pzp-zui-feedback { align-self: flex-start; font-size: 0.6875rem; color: var(--aui-text-2); margin: -4px 0 4px 4px; }
.pzp-zui-thumb { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; opacity: .75; }
.pzp-zui-thumb:hover, .pzp-zui-thumb:focus-visible { opacity: 1; color: var(--aui-text); }
.pzp-zui-open-page { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--aui-brand);
    background: color-mix(in srgb, var(--aui-brand) 10%, transparent); color: var(--aui-text); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.pzp-zui-history { display: flex; flex-direction: column; gap: 4px; }
.pzp-zui-hitem { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--aui-border); }
.pzp-zui-hitem .pzp-link:first-child { text-align: left; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .pzp-zui, .pzp-zui-launch { transition: none; } }

/* Pantalla de carga con la marca del cliente (index.html): la del Engine, con el logotipo o el nombre encima del aro y su color */
.pzp-boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
            background: #F5F6F8; font-family: Inter, system-ui, sans-serif; --pzp-boot-track: #E3E6EB; --pzp-boot-text: #5B6573; --pzp-boot-bar: #475569; }
.pzp-boot[data-mode="dark"] { background: #0B0D10; --pzp-boot-track: rgba(255, 255, 255, .10); --pzp-boot-text: #8A93A0; --pzp-boot-bar: #94A3B8; }
.pzp-boot[data-mode="dark"][style*="--pzp-boot-bar"] { --pzp-boot-track: rgba(255, 255, 255, .12); }
/* En oscuro, el nombre algo más claro que el color de la marca (un color oscuro apenas se leería sobre el fondo) */
.pzp-boot[data-mode="dark"] .pzp-boot-name { color: color-mix(in srgb, var(--pzp-boot-bar) 55%, #E8EAED); }
.pzp-boot-logo { max-width: min(240px, 70vw); max-height: 64px; object-fit: contain; animation: pzp-boot-in .4s ease-out both; }
.pzp-boot-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; color: var(--pzp-boot-bar); text-align: center; padding: 0 24px; animation: pzp-boot-in .4s ease-out both; }
.pzp-boot .loading-progress { position: static; width: 44px; height: 44px; margin: 0; display: block; }
.pzp-boot .loading-progress circle { fill: none; stroke: var(--pzp-boot-track); stroke-width: 8; transform-origin: 50% 50%; transform: rotate(-90deg); }
.pzp-boot .loading-progress circle:last-child { stroke: var(--pzp-boot-bar); stroke-linecap: round; stroke-dasharray: calc(2.765 * var(--blazor-load-percentage, 0%)), 500%; transition: stroke-dasharray .1s ease-out; }
.pzp-boot .loading-progress-text { position: static; inset: auto; margin: 0; text-align: center; font-size: 0.75rem; font-weight: 600; letter-spacing: .02em; color: var(--pzp-boot-text); }
.pzp-boot .loading-progress-text::after { content: var(--blazor-load-percentage-text, "Cargando"); }
.pzp-boot[data-lang="en"] .loading-progress-text::after { content: var(--blazor-load-percentage-text, "Loading"); }
/* Ya descargada la app, mientras pide los datos del portal: sin porcentaje, un arco que gira */
.pzp-boot-wait .loading-progress { animation: pzp-boot-spin .9s linear infinite; }
.pzp-boot-wait .loading-progress circle:last-child { stroke-dasharray: 70, 500; transition: none; }
.pzp-boot-wait .loading-progress-text::after, .pzp-boot-wait[data-lang="en"] .loading-progress-text::after { content: none; }
.pzp-boot-wait .loading-progress-text::before { content: "Cargando…"; }
.pzp-boot-wait[data-lang="en"] .loading-progress-text::before { content: "Loading…"; }
@keyframes pzp-boot-spin { to { transform: rotate(360deg); } }
@keyframes pzp-boot-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pzp-boot-logo, .pzp-boot-name, .pzp-boot-wait .loading-progress { animation: none; } }

/* ===== Menú (paso 112): plegable a solo iconos, cuenta en un menú y opción de menú arriba ===== */
.pzp-entry { display: flex; flex-direction: column; gap: 2px; }
.pzp-tip { display: flex; flex: 1; min-width: 0; }
.pzp-tip > .pzp-link { flex: 1; min-width: 0; }
.pzp-root .pzp-shell:not(.pzp-nav-mini) .pzp-tip > .aui-tooltip__bubble { display: none !important; }
.pzp-link-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Cada página con su marca a la izquierda: su icono o, si no tiene, su inicial; al plegar el menú se quedan en su sitio (paso 114) */
.pzp-root .pzp-nav .pzp-link-icon { flex: none; width: 26px; margin: 0 8px 0 0; text-align: center; font-size: 1rem; }
.pzp-link-initial { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 8px; font-size: 0.75rem; font-weight: 700;
    background: color-mix(in srgb, var(--aui-text) 7%, transparent); color: var(--aui-text-2); transition: background .2s, color .2s; }
.pzp-link.pzp-active .pzp-link-initial { background: var(--aui-brand); color: var(--aui-on-brand); }
.pzp-mini-toggle { display: none; }
.pzp-me-wrap { position: relative; flex: 1; min-width: 0; }
.pzp-me { width: 100%; }
/* Nombre largo: se corta con puntos suspensivos en el botón y se lee entero en la cabecera del menú (paso 183) */
.pzp-me-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-align: left; }
.pzp-user-menu { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; width: 230px; padding: 6px; border-radius: calc(var(--pzp-radius, 10px) + 2px);
    border: 1px solid var(--aui-border); background: var(--aui-surface); box-shadow: 0 16px 40px -10px rgb(16 24 40 / .28), 0 2px 6px rgb(16 24 40 / .08); animation: pzp-pop-in .14s ease-out; }
.pzp-user-menu-head { display: flex; flex-direction: column; padding: 6px 10px 8px; font-size: 0.8125rem; overflow-wrap: anywhere; }
.pzp-user-menu-head span { font-size: 0.75rem; }
.pzp-user-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--aui-text); font: inherit; font-size: 0.8125rem; text-align: left; cursor: pointer; }
.pzp-user-menu button:hover, .pzp-user-menu button:focus-visible { background: color-mix(in srgb, var(--aui-text) 6%, transparent); outline: none; }
.pzp-user-menu button i { width: 16px; color: var(--aui-text-2); }
.pzp-user-menu hr { border: 0; border-top: 1px solid var(--aui-border); margin: 4px 6px; }
.pzp-user-backdrop { z-index: 20; }

@media (min-width: 901px) {
    /* Botón para plegar o desplegar, en el borde del menú y con la flecha centrada */
    .pzp-mini-toggle { display: grid; place-items: center; position: absolute; top: 24px; right: -12px; z-index: 12; width: 24px; height: 24px; padding: 0; border-radius: 50%;
        border: 1px solid var(--aui-border); background: var(--aui-surface); color: var(--aui-text-2); font-size: 0.6875rem; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgb(16 24 40 / .12);
        opacity: 0; transition: opacity .15s, color .15s, transform .15s; }
    .pzp-mini-toggle i { display: block; width: 1em; height: 1em; line-height: 1; }
    .pzp-mini-toggle i::before { display: block; margin: 0 !important; width: 1em; line-height: 1; text-align: center; }
    .pzp-nav:hover .pzp-mini-toggle, .pzp-mini-toggle:focus-visible, .pzp-nav-mini .pzp-mini-toggle { opacity: 1; }
    .pzp-mini-toggle:hover { color: var(--aui-text); transform: scale(1.08); }
    .pzp-nav { overflow: visible; container: pzpnav / inline-size; }

    /* Plegado sin saltos (paso 114): el ancho se anima, los textos se desvanecen y se recortan, y los iconos no se mueven */
    .pzp-shell { transition: grid-template-columns .26s cubic-bezier(.2, .7, .2, 1); }
    .pzp-shell.pzp-nav-mini { grid-template-columns: 72px minmax(0, 1fr); }
    .pzp-nav .pzp-link { padding-left: 9px; padding-right: 9px; }
    .pzp-nav .pzp-link-text, .pzp-nav .pzp-section, .pzp-nav .pzp-brand-name, .pzp-nav .pzp-toggle, .pzp-nav .pzp-zui-launch span:not(.pzp-zui-orb) { transition: opacity .18s ease; }
    .pzp-nav .pzp-section, .pzp-nav .pzp-zui-launch, .pzp-nav > .pzp-brand { white-space: nowrap; overflow: hidden; }
    .pzp-nav .pzp-link { white-space: nowrap; }
    .pzp-nav-mini .pzp-link-text, .pzp-nav-mini .pzp-section, .pzp-nav-mini .pzp-brand-name, .pzp-nav-mini .pzp-zui-launch span:not(.pzp-zui-orb) { opacity: 0; }
    /* Plegado: la flecha de submenú deja de ocupar sitio (si no, estrechaba la página con submenú), los títulos de sección se encogen
       a un hueco pequeño y Zui queda como un círculo centrado (paso 115) */
    .pzp-nav .pzp-toggle { overflow: hidden; transition: opacity .18s ease, width .26s ease, padding .26s ease; }
    .pzp-nav-mini .pzp-toggle { opacity: 0; pointer-events: none; width: 0; min-width: 0; padding: 0; flex-basis: 0; }
    .pzp-nav-mini .pzp-item { gap: 0; }
    .pzp-nav .pzp-section { max-height: 48px; transition: opacity .18s ease, max-height .26s ease, padding .26s ease; }
    .pzp-nav-mini .pzp-section { max-height: 10px; padding-top: 5px; padding-bottom: 5px; }
    .pzp-nav .pzp-zui-launch { transition: width .26s ease, padding .26s ease, gap .26s ease, margin .26s ease, transform .2s, box-shadow .2s; }
    .pzp-nav .pzp-zui-launch span:not(.pzp-zui-orb) { min-width: 0; overflow: hidden; }
    .pzp-nav-mini .pzp-zui-launch { width: 44px; padding: 7px; gap: 0; margin: 8px 2px; justify-content: center; }
    .pzp-nav-mini .pzp-zui-launch span:not(.pzp-zui-orb) { max-width: 0; }
    .pzp-nav .pzp-children { transition: margin .26s, padding .26s, border-color .26s; }
    .pzp-nav-mini .pzp-children { margin-left: 0; padding-left: 0; border-left-color: transparent; }
    .pzp-nav .pzp-brand-logo { transition: max-width .26s, max-height .26s; }
    .pzp-nav-mini .pzp-brand-logo { max-width: 44px; max-height: 32px; object-fit: contain; }
    /* El pie se recoloca en columna cuando ya no cabe en fila (a mitad de la animación, no de golpe al empezar) */
    @container pzpnav (max-width: 150px) {
        .pzp-user { flex-direction: column; gap: 6px; }
        .pzp-user .pzp-bell { margin: 0; }
        .pzp-me-name { display: none; }
        .pzp-me { justify-content: center; padding: 2px; }
        .pzp-nav > .pzp-brand { justify-content: center; padding-left: 0; padding-right: 0; }
        .pzp-nav > .pzp-brand .pzp-brand-name { display: none; }
    }

    /* Con el menú plegado, lo que se abre desde él (avisos, aprobaciones y la cuenta) flota a su derecha, con su ancho normal */
    .pzp-nav-mini .pzp-notices { position: absolute; left: calc(100% + 10px); bottom: 14px; z-index: 40; width: 340px; max-height: min(70vh, 560px); padding: 10px;
        border: 1px solid var(--aui-border); border-radius: calc(var(--pzp-radius, 10px) + 2px); background: var(--aui-surface);
        box-shadow: 0 16px 40px -10px rgb(16 24 40 / .28), 0 2px 6px rgb(16 24 40 / .08); animation: pzp-pop-in .14s ease-out; }
    .pzp-nav-mini .pzp-user-menu { left: calc(100% + 14px); bottom: -4px; }

    /* Menú arriba: marca, páginas en una fila (los submenús cuelgan) y la cuenta a la derecha */
    .pzp-shell.pzp-nav-top { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .pzp-nav-top .pzp-nav { flex-direction: row; align-items: center; gap: 18px; height: 60px; padding: 0 clamp(16px, 3vw, 32px); border-right: 0; border-bottom: 1px solid var(--aui-border);
        background: var(--aui-surface); z-index: 15; }
    .pzp-nav-top .pzp-nav > .pzp-brand { flex: none; padding: 0; margin: 0; border: 0; }
    .pzp-nav-top .pzp-logo-small .pzp-brand-logo, .pzp-nav-top .pzp-logo-medium .pzp-brand-logo, .pzp-nav-top .pzp-logo-large .pzp-brand-logo { max-height: 34px; }
    .pzp-nav-top .pzp-nav-scroll { flex: 1; min-width: 0; flex-direction: row; align-items: center; gap: 2px; padding: 0; overflow: visible; }
    .pzp-nav-top .pzp-section, .pzp-nav-top .pzp-separator { display: none; }
    /* .pzp-entry es también la pantalla de entrada (login), con overflow: hidden: en el menú recortaba el desplegable del submenú
   del menú superior, que cuelga fuera de la entrada (paso 164) */
.pzp-nav .pzp-entry { overflow: visible; isolation: auto; }
/* Cada subpágina va dentro del contenedor del tooltip (inline-flex) y se ponían en fila: en columna, a todo el ancho (paso 164) */
.pzp-children { display: flex; flex-direction: column; gap: 2px; }
.pzp-children > .aui-tooltip { display: flex; width: 100%; }
.pzp-children > .aui-tooltip > .pzp-link { flex: 1; min-width: 0; }
.pzp-nav-top .pzp-entry { position: relative; }
.pzp-nav-backdrop { display: none; }
.pzp-nav-top .pzp-nav-backdrop { display: block; position: fixed; inset: 0; z-index: 19; }
.pzp-nav-top .pzp-entry-open { z-index: 21; }
    .pzp-nav-top .pzp-link { padding: 8px 12px; white-space: nowrap; }
    .pzp-nav-top .pzp-link.pzp-active::before { left: 12px; right: 12px; top: auto; bottom: -12px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
    .pzp-nav-top .pzp-toggle i { transform: rotate(90deg); }
    .pzp-nav-top .pzp-children-wrap { position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; min-width: 220px; display: none; }
    .pzp-nav-top .pzp-children-wrap.pzp-open { display: block; }
    .pzp-nav-top .pzp-children { margin: 0; padding: 6px; border: 1px solid var(--aui-border); border-radius: calc(var(--pzp-radius, 10px) + 2px); background: var(--aui-surface);
        box-shadow: 0 16px 40px -10px rgb(16 24 40 / .28), 0 2px 6px rgb(16 24 40 / .08); display: flex; flex-direction: column; gap: 2px; }
    .pzp-nav-top .pzp-user { margin: 0; padding: 0; border: 0; flex: none; }
    .pzp-nav-top .pzp-me-wrap { flex: none; }
    .pzp-nav-top .pzp-me-name { display: none; }
    .pzp-nav-top .pzp-user-menu { left: auto; right: 0; bottom: auto; top: calc(100% + 10px); }
    .pzp-nav-top .pzp-zui-launch { width: auto; margin: 0; flex: none; }
    .pzp-nav-top .pzp-notices { position: absolute; top: calc(100% + 6px); right: 16px; z-index: 25; width: 360px; max-height: 70vh; border: 1px solid var(--aui-border);
        border-radius: calc(var(--pzp-radius, 10px) + 2px); background: var(--aui-surface); padding: 10px; box-shadow: 0 16px 40px -10px rgb(16 24 40 / .28); }
    .pzp-nav-top .pzp-main { grid-row: 2; }
}
