html,
body {
    background: var(--psx-bg);
    color: var(--psx-text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

a {
    color: var(--psx-accent);
}

h1:focus {
    outline: none;
}

.w-100 {
    width: 100%;
}

.content {
    padding-bottom: 2rem;
}

.page-heading {
    width: 100%;
    flex-wrap: wrap !important;
    gap: 1rem;
    min-width: 0;
}

.page-title,
.section-title {
    color: var(--psx-text);
    font-weight: 700;
    margin: 0;
}

.eyebrow {
    color: var(--psx-accent);
    font-weight: 700;
    letter-spacing: 0;
    margin: 0;
    text-transform: uppercase;
}

.summary {
    color: var(--psx-muted);
    margin: 0.25rem 0 0;
    max-width: 760px;
}

.field-label {
    color: var(--psx-text);
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    font-weight: 400;
    gap: 0.35rem;
    min-width: 0;
}

.form-footer {
    border-top: 1px solid var(--psx-border);
    flex-wrap: wrap !important;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
}

/* Form layouts respond to the space inside cards and tabs, including pages with a sidebar. */
.platform-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.platform-fields > label,
.platform-fields > .field-label,
.rz-fieldset {
    min-width: 0;
}

.platform-fields > label {
    display: grid;
    gap: 0.4rem;
    font-size: 0.875rem;
}

.app-edit-form {
    container-name: edit-form;
    container-type: inline-size;
    min-width: 0;
}

@container edit-form (max-width: 1120px) {
    .app-edit-form .rz-row:not(.responsive-address-grid, .document-upload-grid) > :is(.rz-col-md-1, .rz-col-md-2, .rz-col-md-3, .rz-col-md-4, .rz-col-md-5, .rz-col-md-6, .rz-col-lg-5, .rz-col-lg-6) {
        flex: 0 0 calc(50% - 0.5rem) !important;
        max-width: calc(50% - 0.5rem) !important;
        min-width: 0;
    }

    .app-edit-form .rz-row:not(.responsive-address-grid, .document-upload-grid) > :is(.rz-col-md-7, .rz-col-md-8, .rz-col-md-9, .rz-col-md-10, .rz-col-md-11, .rz-col-md-12, .rz-col-lg-7, .rz-col-lg-8, .rz-col-lg-9, .rz-col-lg-10, .rz-col-lg-11, .rz-col-lg-12) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        min-width: 0;
    }
}

@container edit-form (max-width: 520px) {
    .app-edit-form .rz-row:not(.responsive-address-grid, .document-upload-grid) > [class*="rz-col"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        min-width: 0;
    }

    .app-edit-form .form-footer > .rz-button {
        flex: 1 1 100%;
    }
}

@container edit-form (max-width: 800px) {
    .app-edit-form .rz-tabview-nav { flex-wrap: wrap; }
    .app-edit-form .rz-tabview-nav li { min-width: 0; }
    .app-edit-form .rz-tabview-nav li button {
        padding: 0.7rem 0.65rem;
        font-size: 0.8rem;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

.document-upload-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 1rem !important;
    margin: 0 !important;
}

.document-upload-grid > [class*="rz-col"] {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    min-width: 0;
    padding: 0 !important;
}

.document-upload-grid > :first-child,
.document-upload-grid > :nth-child(5) {
    grid-column: 1 / -1;
}

.document-upload-grid > :last-child {
    grid-column: 1 / -1;
    justify-self: end;
    width: min(100%, 12rem) !important;
}

.responsive-address-layout {
    container-name: address-form;
    container-type: inline-size;
    min-width: 0;
}

.responsive-address-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem !important;
    margin: 0 !important;
}

.responsive-address-grid > .address-field {
    grid-column: 1 / -1;
    min-width: 0;
    max-width: none !important;
    width: auto !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.responsive-address-grid .rz-dropdown,
.responsive-address-grid .rz-textbox {
    min-width: 0;
    max-width: 100%;
}

.responsive-address-grid > .address-mode {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.responsive-address-grid > .address-mode .rz-button {
    max-width: 100%;
    min-height: 2.5rem;
    white-space: normal;
}

@container address-form (min-width: 560px) {
    .responsive-address-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .responsive-address-grid > .address-field { grid-column: auto; }
    .responsive-address-grid > .address-street { grid-column: span 2; }
    .responsive-address-grid > .address-mode,
    .responsive-address-grid > .address-reference { grid-column: 1 / -1; }
}

@container address-form (min-width: 1040px) {
    .responsive-address-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .responsive-address-grid > .address-neighborhood,
    .responsive-address-grid > .address-country { grid-column: span 2; }
    .responsive-address-grid > .address-reference { grid-column: span 4; }
}

@media (max-width: 520px) {
    .form-footer > .rz-button { flex: 1 1 100%; }
}

@container address-form (max-width: 559px) {
    .responsive-address-grid > .address-mode .rz-button { width: 100%; }
}

.country-option {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
    min-width: 0;
}

.country-flag {
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    display: inline-block;
    flex: 0 0 auto;
    height: 0.85rem;
    width: 1.25rem;
}

.country-flag.mx {
    background: linear-gradient(90deg, #006847 0 33.33%, #ffffff 33.33% 66.66%, #ce1126 66.66% 100%);
}

.country-flag.us {
    background: repeating-linear-gradient(180deg, #b22234 0 7.7%, #ffffff 7.7% 15.4%);
    position: relative;
}

.country-flag.us::before {
    background: #3c3b6e;
    content: "";
    height: 53%;
    left: 0;
    position: absolute;
    top: 0;
    width: 45%;
}

.country-flag.gt {
    background: linear-gradient(90deg, #4997d0 0 33.33%, #ffffff 33.33% 66.66%, #4997d0 66.66% 100%);
}

.checkbox-grid {
    flex-wrap: wrap;
}

.check-label {
    align-items: center;
    color: var(--psx-text);
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 400;
    gap: 0.45rem;
    min-height: 2rem;
}

.check-label-inline {
    min-height: 2.65rem;
}

.checklist-item {
    align-items: center;
    display: flex;
    font-size: 0.88rem;
    gap: 0.45rem;
    line-height: 1.3;
}

.checklist-item.complete {
    color: var(--psx-success);
}

.checklist-item.pending {
    color: var(--psx-warning);
}

/* Shared by platform, intermediary overview and customer billing panels. */
.platform-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; border-block: 1px solid var(--psx-border); padding: 1.5rem 0; }
.platform-metrics > div { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.platform-metrics span { font-size: .875rem; color: var(--psx-muted); }
.platform-metrics strong { font-size: 1.4rem; overflow-wrap: anywhere; }

.metric-card-rz {
    min-height: 8rem;
}

.metric-card-rz.compact {
    min-height: 5.5rem;
}

:is(.app-content-card, .metric-card-rz, .readiness-card-rz).rz-card {
    display: flex;
    flex-direction: column;
    gap: var(--psx-card-content-gap);
    height: 100%;
    padding: var(--psx-card-content-padding);
}

:is(.app-content-card, .metric-card-rz, .readiness-card-rz).rz-card > :is(.rz-text, p, h1, h2, h3, h4, h5, h6, strong),
.app-card-content > :is(.rz-text, p, h1, h2, h3, h4, h5, h6) {
    margin: 0;
}

.app-content-card > p {
    flex: 1;
    line-height: 1.6;
}

:is(.app-content-card, .metric-card-rz, .readiness-card-rz) > .rz-button {
    align-self: flex-start;
    margin-top: var(--psx-card-action-gap);
}

:is(.app-content-card, .metric-card-rz, .readiness-card-rz) > .rz-badge {
    align-self: flex-start;
}

.app-card-content {
    display: flex;
    flex-direction: column;
    gap: var(--psx-card-content-gap);
    flex: 1;
}

.app-card-actions { margin-top: var(--psx-card-action-gap); }

.metric-card-rz strong {
    color: var(--psx-text);
    display: block;
    font-size: 2rem;
    line-height: 1;
    margin: 0.25rem 0;
}

.readiness-card-rz {
    min-height: 7rem;
}

.muted-text {
    color: var(--psx-muted);
    font-size: 0.78rem;
}

.expediente-kpi-row {
    border: 1px solid var(--psx-border);
    border-radius: 8px;
    padding: 0.9rem 1rem;
}

.expediente-kpi-row strong {
    color: var(--psx-text);
    display: block;
    font-size: 1.6rem;
    line-height: 1.1;
    margin-top: 0.15rem;
}

.expediente-list-toolbar,
.expediente-section-actions {
    flex-wrap: wrap;
}

.expediente-search {
    flex: 1 1 22rem;
}

.expediente-open-header .rz-button {
    margin-bottom: 0.35rem;
}

.expediente-tab-content {
    padding-top: 1rem;
}

.api-code,
.hash-code {
    background: var(--psx-subtle);
    border-radius: 6px;
    color: var(--psx-accent);
    display: inline-flex;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 0.2rem 0.45rem;
    white-space: normal;
}

.integration-card-icon {
    align-items: center;
    background: var(--psx-accent-soft);
    border-radius: 8px;
    color: var(--psx-accent);
    display: inline-flex;
    font-size: 2rem;
    height: 3rem;
    justify-content: center;
    width: 3rem;
}

.integration-flow {
    background: var(--psx-subtle);
    border: 1px solid var(--psx-border);
    border-radius: 8px;
    padding: 0.9rem;
}

.integration-flow div,
.integration-step {
    align-items: center;
    color: var(--psx-text);
    display: flex;
    gap: 0.65rem;
}

.integration-flow .rzi {
    color: var(--psx-accent);
    font-size: 1.35rem;
}

.integration-step strong {
    align-items: center;
    background: var(--psx-accent);
    border-radius: 999px;
    color: var(--psx-on-accent);
    display: inline-flex;
    flex: 0 0 auto;
    height: 1.65rem;
    justify-content: center;
    width: 1.65rem;
}

.api-key-create-button {
    min-height: 2.75rem;
}

.api-key-create-button .rz-button-box {
    gap: 0.45rem;
    justify-content: center;
    width: 100%;
}

.api-key-create-button .rz-button-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.version-snapshot-json {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    line-height: 1.45;
}

.file-input-rz {
    min-height: 2.5rem;
    padding: 0.55rem;
}

.validation-message {
    color: var(--psx-danger);
    font-size: 0.8rem;
}

.login-shell {
    background: var(--psx-bg);
    display: grid;
    grid-template-columns: minmax(24rem, 1.1fr) minmax(24rem, 0.9fr);
    min-height: 100vh;
}

.login-identity {
    align-content: center;
    background: var(--psx-charcoal);
    color: #ffffff;
    display: grid;
    gap: 1.8rem;
    justify-items: center;
    min-height: 100vh;
    overflow: hidden;
    padding: 3.25rem 3.5rem;
    position: relative;
}

.login-identity::after {
    border: 1px solid rgba(45, 212, 191, 0.16);
    content: "";
    inset: 1.25rem;
    pointer-events: none;
    position: absolute;
}

.login-identity::before {
    display: none;
}

.login-brand-visual {
    display: grid;
    justify-items: center;
    position: relative;
    width: 100%;
    z-index: 1;
}

.login-brand-logo {
    aspect-ratio: 3 / 2;
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
    display: block;
    max-height: 24rem;
    object-fit: cover;
    width: min(100%, 40rem);
}

.login-hero-brand {
    align-items: center;
    display: flex;
    gap: 1.2rem;
    position: relative;
    z-index: 1;
}

.login-logo-mark {
    background: linear-gradient(135deg, #2dd4bf 0%, #10b981 44%, #0284c7 100%);
    border-radius: 8px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    height: 5.5rem;
    overflow: hidden;
    position: relative;
    width: 5.5rem;
}

.login-logo-mark::before {
    background: rgba(4, 47, 46, 0.35);
    border-radius: 999px;
    content: "";
    height: 1.15rem;
    left: 0.8rem;
    position: absolute;
    top: 0.75rem;
    width: 3.1rem;
}

.login-folder-icon {
    color: rgba(255, 255, 255, 0.16);
    font-size: 5.8rem;
    left: -0.35rem;
    position: absolute;
    top: 0.55rem;
}

.login-shield-icon {
    color: #ffffff;
    font-size: 3.3rem;
    left: 1.1rem;
    position: absolute;
    top: 1.45rem;
    text-shadow: 0 5px 18px rgba(2, 44, 34, 0.25);
}

.login-hero-brand strong {
    color: #ffffff;
    display: block;
    font-size: 2.35rem;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.05;
}

.login-hero-brand strong span {
    color: #2dd4bf;
}

.login-hero-brand p {
    color: var(--psx-border);
    font-size: 1.08rem;
    line-height: 1.35;
    margin: 0.7rem 0 0;
    max-width: 24rem;
}

.login-hero-message {
    border-top: 1px solid rgba(45, 212, 191, 0.42);
    margin-top: 0.75rem;
    padding-top: 1.35rem;
    position: relative;
    text-align: center;
    z-index: 1;
}

.login-hero-message p {
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1.45;
    margin: 0 auto;
    max-width: 32rem;
}

.login-evidence-strip {
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    color: #d9f99d;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    font-weight: 750;
    gap: 0.55rem;
    justify-content: center;
    letter-spacing: 0;
    padding: 0.7rem 0.85rem;
    position: relative;
    text-transform: uppercase;
    z-index: 1;
}

.login-evidence-strip span {
    align-items: center;
    display: inline-flex;
    gap: 0.55rem;
}

.login-evidence-strip span + span::before {
    background: rgba(45, 212, 191, 0.45);
    border-radius: 999px;
    content: "";
    display: inline-block;
    height: 0.35rem;
    width: 0.35rem;
}

.login-trust-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: relative;
    z-index: 1;
}

.login-trust-grid div {
    align-items: center;
    display: grid;
    gap: 0.45rem;
    justify-items: center;
    min-width: 0;
    text-align: center;
}

.login-trust-grid .rzi {
    align-items: center;
    border: 1px solid rgba(226, 232, 240, 0.72);
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 1.65rem;
    height: 2.65rem;
    justify-content: center;
    width: 2.65rem;
}

.login-trust-grid strong {
    color: #ffffff;
    display: block;
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.2;
}

.login-workspace {
    align-items: center;
    background: var(--psx-bg);
    display: flex;
    justify-content: center;
    min-width: 0;
    padding: 2rem;
}

.login-panel-header {
    display: grid;
    gap: 0.25rem;
}

.login-panel-header .rz-badge {
    justify-self: start;
    margin-bottom: 0.35rem;
}

.login-panel-header h2 {
    color: var(--psx-text);
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
}

.login-panel {
    background: var(--psx-surface);
    border: 1px solid var(--psx-border);
    box-shadow: 0 20px 55px rgba(24, 34, 53, 0.12);
    max-width: 28rem;
    padding: 1.75rem;
    width: 100%;
}

.login-form {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.25rem;
}

.login-form label {
    color: var(--psx-text);
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    font-weight: 650;
    gap: 0.35rem;
}

.login-label-text {
    display: inline-flex;
}

.login-input-shell {
    align-items: center;
    background: var(--psx-surface) !important;
    background-color: var(--psx-surface) !important;
    border: 1px solid var(--psx-input-border);
    border-radius: 6px;
    display: flex;
    gap: 0.55rem;
    min-height: 2.75rem;
    padding: 0 0.75rem;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.login-input-shell:focus-within {
    border-color: var(--psx-accent);
    box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.14);
}

.login-input-shell .rzi {
    color: var(--psx-muted);
    font-size: 1.2rem;
}

.login-control {
    appearance: none;
    background: var(--psx-surface) !important;
    background-color: var(--psx-surface) !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--psx-text);
    flex: 1;
    min-height: 2.6rem;
    outline: 0;
    padding: 0 !important;
    width: 100%;
}

.login-form input.login-control,
.login-form input.login-control.rz-inputtext,
.login-input-shell > input.rz-inputtext {
    background: var(--psx-surface) !important;
    background-color: var(--psx-surface) !important;
    border-color: transparent !important;
}

.login-control:focus {
    background: var(--psx-surface) !important;
    background-color: var(--psx-surface) !important;
    box-shadow: none !important;
    outline: 0;
}

.login-form .login-control:-webkit-autofill,
.login-form .login-control:-webkit-autofill:hover,
.login-form .login-control:-webkit-autofill:focus {
    box-shadow: 0 0 0 1000px var(--psx-surface) inset !important;
    -webkit-text-fill-color: var(--psx-text);
}

.login-form .check-row {
    align-items: center;
    flex-direction: row;
    gap: 0.55rem;
    font-weight: 500;
}

.login-checkbox {
    accent-color: var(--psx-accent);
    height: 1.05rem;
    width: 1.05rem;
}

.login-submit {
    align-items: center;
    background: var(--psx-accent) !important;
    border-radius: 6px;
    display: flex !important;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    width: 100%;
}

.login-submit:hover {
    background: var(--psx-accent-hover) !important;
}

.login-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.2rem;
}

.login-secondary-link {
    color: var(--psx-accent);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.login-secondary-link:hover {
    color: var(--psx-accent-hover);
    text-decoration: underline;
}

.login-hint {
    color: var(--psx-muted);
    font-size: 0.84rem;
    line-height: 1.35;
    margin: -0.15rem 0 0.1rem;
}

.login-alert {
    align-items: center;
    background: var(--psx-danger-bg);
    border-radius: 8px;
    color: var(--psx-danger);
    display: flex;
    font-weight: 650;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.8rem 0.9rem;
}

.login-alert-info {
    background: var(--psx-accent-soft);
    color: var(--psx-accent);
}

.login-dev-token {
    background: var(--psx-warning-bg);
    border: 1px solid var(--psx-warning);
    border-radius: 8px;
    color: var(--psx-warning);
    display: grid;
    gap: 0.35rem;
    margin-top: 1rem;
    padding: 0.8rem 0.9rem;
}

.login-dev-token span {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-dev-token a {
    color: var(--psx-warning);
    font-weight: 800;
}

.backup-command {
    background: var(--psx-subtle);
    border-radius: 8px;
    color: var(--psx-text);
    font-size: 0.83rem;
    line-height: 1.55;
    margin: 0;
    overflow-x: auto;
    padding: 0.9rem 1rem;
    white-space: pre-wrap;
}

.blazor-error-boundary {
    background: var(--psx-danger-bg);
    color: var(--psx-danger);
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "Ocurrio un error inesperado.";
}

.expediente-return-bar {
    border: 1px solid var(--psx-input-border);
    box-shadow: none;
    margin-bottom: 1rem;
}

.expediente-return-bar .rz-card-body {
    padding: 0.85rem 1rem;
}

.expediente-child-header {
    border-left: 4px solid var(--psx-accent);
}

.expediente-back-link {
    margin-bottom: 0.45rem;
}

.expediente-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1rem !important;
    align-items: stretch;
    margin: 0 !important;
    padding-top: 0.75rem;
}

.expediente-summary-grid > [class*="rz-col"] {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    min-width: 0;
    padding: 0 !important;
}

.expediente-summary-grid > .rz-col-12:not([class*="rz-col-md-"]) {
    grid-column: 1 / -1;
}

.expediente-summary-grid .summary-value {
    height: 100%;
}

.expediente-workspace-layout {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr);
}

.expediente-workspace-container {
    container-name: expediente-workspace;
    container-type: inline-size;
    min-width: 0;
}

@container expediente-workspace (max-width: 900px) {
    .expediente-workspace-layout { grid-template-columns: minmax(0, 1fr); }
    .expediente-workspace-container .expediente-section-nav { position: static; }
}

.expediente-workspace-side {
    min-width: 0;
}

.expediente-workspace-main {
    min-width: 0;
    container-name: summary-panel;
    container-type: inline-size;
}

.expediente-summary-tabs,
.expediente-summary-tabs .rz-tabview-panels {
    min-width: 0;
}

@container summary-panel (max-width: 900px) {
    .expediente-summary-tabs .rz-tabview-nav { flex-wrap: wrap; }
    .expediente-summary-tabs .rz-tabview-nav li { flex: 1 1 9rem; min-width: 0; max-width: 100%; }
    .expediente-summary-tabs .rz-tabview-nav li button { width: 100%; height: 100%; white-space: normal; overflow-wrap: break-word; line-height: 1.25; }
}

.expediente-section-nav {
    box-shadow: none;
    position: sticky;
    top: 1rem;
}

.expediente-nav-buttons .rz-button {
    justify-content: flex-start;
    min-height: 2.55rem;
    width: 100%;
}

.expediente-nav-group-title {
    color: var(--psx-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    padding: 0.45rem 0.2rem 0.1rem;
    text-transform: uppercase;
}

.expediente-nav-button.active {
    background: var(--psx-accent-soft) !important;
    border-color: #2dd4bf !important;
    color: var(--psx-accent) !important;
    font-weight: 800;
}

.summary-value {
    background: var(--psx-subtle);
    border: 1px solid var(--psx-border);
    border-radius: 8px;
    display: grid;
    gap: 0.25rem;
    min-height: 4.4rem;
    min-width: 0;
    padding: 0.75rem 0.85rem;
}

.summary-value-label {
    color: var(--psx-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.summary-value-text,
.summary-value-empty {
    color: var(--psx-text);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.summary-value-empty {
    color: var(--psx-faint);
    font-weight: 600;
}

.expediente-checklist-readonly {
    display: grid;
    gap: 0.45rem;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.expediente-checklist-item {
    align-items: flex-start;
    background: var(--psx-subtle);
    border: 1px solid var(--psx-border);
    border-radius: 8px;
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
}

.check-icon-ok {
    color: var(--psx-accent);
}

.check-icon-pending {
    color: var(--psx-warning);
}

@media (max-width: 700px) {
    .page-heading {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .expediente-return-bar .rz-stack {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .expediente-workspace-layout {
        grid-template-columns: 1fr;
    }

    .expediente-section-nav {
        position: static;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-identity {
        min-height: auto;
        padding: 1rem;
    }

    .login-identity {
        gap: 1.25rem;
    }

    .login-identity::before {
        display: none;
    }

    .login-brand-logo {
        max-height: 13.5rem;
    }

    .login-logo-mark {
        height: 4.4rem;
        width: 4.4rem;
    }

    .login-folder-icon {
        font-size: 4.6rem;
    }

    .login-shield-icon {
        font-size: 2.65rem;
        left: 0.9rem;
        top: 1.15rem;
    }

    .login-hero-brand strong {
        font-size: 1.8rem;
    }

    .login-hero-brand p {
        font-size: 0.95rem;
    }

    .login-hero-message {
        text-align: left;
    }

    .login-hero-message p {
        font-size: 1rem;
    }

    .login-evidence-strip {
        justify-content: flex-start;
    }

    .login-trust-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .login-workspace {
        align-items: flex-start;
        padding: 1rem;
    }
}
/* Feedback stays readable and receives focus after a save attempt. */
.pld-process-view {
    min-width: 0;
}

.pld-list-scroll {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
}

.pld-list-description {
    margin-bottom: 1rem;
}

.pld-sociedades-grid {
    min-width: 850px;
    width: 100%;
}

.pld-sociedades-actions-title {
    display: block;
    padding-right: 1.5rem;
    text-align: right;
    white-space: nowrap;
}

.pld-process-toolbar {
    flex-wrap: wrap;
    padding-block: 0.25rem 1rem;
}

.login-alert.validation-summary-valid {
    display: none;
}

.form-validation-feedback,
.operation-feedback {
    scroll-margin-block: 6rem;
    overflow-wrap: anywhere;
    min-width: 0;
}

.form-validation-feedback:focus-visible,
.operation-feedback:focus-visible {
    outline: 2px solid var(--rz-primary);
    outline-offset: 3px;
}

.form-validation-feedback ul {
    padding-inline-start: 1.25rem;
    margin-block: 0.5rem 0;
}

.form-validation-feedback li {
    margin-block: 0.35rem;
}

.form-validation-feedback .rz-button {
    margin-inline-start: 0.35rem;
    vertical-align: middle;
}

.form-validation-feedback .rz-button.rz-variant-text {
    color: #ffffff !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    font-size: 0.875rem;
    font-weight: 600;
}

.form-validation-feedback .rz-button.rz-variant-text .rz-button-text,
.form-validation-feedback .rz-button.rz-variant-text .rzi {
    color: inherit !important;
}

.form-validation-feedback .rz-button.rz-variant-text::before {
    content: none;
}

.form-validation-feedback .rz-button.rz-variant-text:hover,
.form-validation-feedback .rz-button.rz-variant-text:active,
.form-validation-feedback .rz-button.rz-variant-text:focus {
    color: #fff59d !important;
}

.form-validation-feedback .rz-button.rz-variant-text:focus-visible {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}
.declaration-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.declaration-hash { overflow-wrap: anywhere; font-size: .8rem; }
.declaration-document { flex-wrap: wrap; border-bottom: 1px solid var(--rz-base-300); padding-block: .75rem; }
.declaration-document > div { min-width: 0; flex: 1 1 16rem; overflow-wrap: anywhere; }
.operacion-declaracion-view { min-width: 0; }

/* Keep editor values consistent, including controls nested inside labels. */
input:not([type="button"]):not([type="submit"]):not([type="reset"]),
textarea,
select,
.rz-dropdown,
.rz-dropdown-label,
.rz-dropdown-item,
.rz-multiselect,
.rz-multiselect-label-container,
.rz-multiselect-item,
.rz-multiselect-chip,
.rz-autocomplete,
.rz-autocomplete-list-item,
.rz-listbox-item {
    font-weight: 400;
}

/* Consultation and editing only; the operations list keeps its existing layout. */
.operation-workspace { min-width: 0; container-name: operation-workspace; container-type: inline-size; }
.operation-workspace .operation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.operation-workspace .operation-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.operation-workspace .rz-fieldset { min-width: 0; margin: 0; }
.operation-workspace .operation-data-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem 1rem; margin: 0; }
.operation-workspace .operation-data-thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.operation-workspace .operation-data-wide { grid-column: span 2; }
.operation-workspace .operation-data-full { grid-column: 1 / -1; }
.operation-workspace dt { font-size: .9rem; color: var(--psx-muted); font-weight: 400; margin-bottom: .35rem; }
.operation-workspace dd { margin: 0; overflow-wrap: anywhere; }
.operation-workspace .operation-attachment-actions { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .75rem; }
.operation-workspace .operation-attachment-actions > label { flex: 1 1 20rem; min-width: 0; }
.operation-workspace .operation-file-name { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
.operation-workspace .operation-readonly-fields strong { display: block; color: var(--psx-muted); font-size: .9rem; font-weight: 400; margin-bottom: .35rem; }
.operation-workspace .operation-file-details { margin-top: .5rem; color: var(--psx-muted); font-size: .85rem; }
.operation-workspace details > summary { cursor: pointer; padding-block: .4rem; }
.operation-workspace .operation-attachment-panel > summary { color: var(--psx-text); }
.operation-workspace .operation-attachment-panel[open] > summary { margin-bottom: .65rem; }
.operation-workspace .form-footer { flex-wrap: wrap; }
@container operation-workspace (max-width: 900px) {
    .operation-workspace .operation-data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container operation-workspace (max-width: 520px) {
    .operation-workspace .operation-data-grid { grid-template-columns: minmax(0, 1fr); }
    .operation-workspace .operation-data-wide { grid-column: auto; }
    .operation-workspace .operation-actions, .operation-workspace .operation-attachment-actions > label { width: 100%; }
    .operation-workspace .operation-attachment-actions > .rz-button { flex: 1 1 auto; }
}

/* XML preparation workspace: scoped to this page, including its nested editors. */
.xml-workspace { display: flex; flex-direction: column; gap: 1rem; min-width: 0; container-name: xml-workspace; container-type: inline-size; }
.xml-workspace .xml-heading { display:flex; justify-content:space-between; align-items:start; gap:1rem; flex-wrap:wrap; margin-bottom:1rem; }
.xml-workspace h2 { font-size:1.15rem; margin:0 0 1rem; }
.xml-workspace .xml-heading h1 { margin:0; }
.xml-workspace .xml-heading .summary { margin:.4rem 0 0; }
.xml-workspace .xml-help { margin-top:1rem; font-size:.9rem; color:var(--psx-muted); }
.xml-workspace summary { cursor:pointer; padding:.4rem 0; }
.xml-workspace .xml-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1rem; padding:1rem 1.25rem; border:1px solid var(--psx-border); border-radius:6px; background:var(--psx-surface); }
.xml-workspace .xml-summary span { display:block; color:var(--psx-muted); font-size:.85rem; margin-bottom:.35rem; }
.xml-workspace .xml-summary strong { display:block; overflow-wrap:anywhere; font-size:1rem; }
.xml-workspace .xml-pending { border-left:3px solid var(--psx-warning-fill); padding:.65rem 1.15rem; background:var(--psx-warning-bg); color:var(--psx-warning); border-radius:6px; }
.xml-workspace .xml-pending ul { margin:.5rem 0; padding-left:1.3rem; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem 1.5rem; }
.xml-workspace .xml-navigation { display:flex; flex-wrap:wrap; gap:.4rem; border-bottom:1px solid var(--psx-border); padding-bottom:.5rem; }
.xml-workspace .xml-navigation button { border:1px solid transparent; border-radius:6px; padding:.75rem 1rem; background:transparent; color:var(--psx-text); font:inherit; font-weight:400; cursor:pointer; }
.xml-workspace .xml-navigation button:hover { background:var(--psx-subtle); }
.xml-workspace .xml-navigation button.active { background:var(--psx-accent); color:var(--psx-on-accent); }
.xml-workspace button:focus-visible, .xml-workspace summary:focus-visible { outline:2px solid var(--psx-accent); outline-offset:3px; }
.xml-workspace .xml-fields, .xml-workspace .rz-fieldset-content, .xml-workspace .mpc-person-fields { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem !important; align-items:start; }
.xml-workspace .xml-fields > p, .xml-workspace .rz-fieldset-content > p, .xml-workspace .mpc-person-fields > p,
.xml-workspace .rz-fieldset-content > .rz-fieldset, .xml-workspace .rz-fieldset-content > .rz-card,
.xml-workspace .rz-fieldset-content > .mpc-person-fields, .xml-workspace .mpc-person-fields > .rz-fieldset,
.xml-workspace .rz-fieldset-content > .rz-alert { grid-column:1 / -1; }
.xml-workspace .rz-fieldset { margin:1rem 0; min-width:0; }
.xml-workspace .field-label { min-width:0; margin:0; font-weight:400; }
.xml-workspace .xml-note, .xml-workspace .rz-fieldset-content > p, .xml-workspace .mpc-person-fields > p { color:var(--psx-muted); font-size:.9rem; margin-top:0; }
.xml-workspace .xml-operation-picker { display:flex; align-items:end; flex-wrap:wrap; gap:.5rem; padding:1rem; background:var(--psx-subtle); border-radius:6px; }
.xml-workspace .xml-operation-picker > label { flex:1 1 24rem; }
.xml-workspace .xml-operation-editor .rz-card { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; align-items:end; }
.xml-workspace .xml-operation-editor .rz-card > .rz-fieldset { grid-column:1 / -1; }
.xml-workspace .xml-section-footer { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; margin-top:1.5rem; padding-top:1rem; border-top:1px solid var(--psx-border); }
.xml-workspace .xml-section-footer .xml-note { margin:0 0 0 auto; }
@container xml-workspace (max-width: 900px) {
 .xml-workspace .xml-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .xml-workspace .xml-pending ul { grid-template-columns:1fr; }
 .xml-workspace .xml-operation-editor .rz-card { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@container xml-workspace (max-width: 600px) {
 .xml-workspace .xml-fields, .xml-workspace .rz-fieldset-content, .xml-workspace .mpc-person-fields, .xml-workspace .xml-operation-editor .rz-card { grid-template-columns:1fr; }
 .xml-workspace .xml-navigation button { flex:1 1 45%; padding:.6rem; }
 .xml-workspace .xml-section-footer .xml-note { width:100%; margin:0; }
}

.xml-workspace .xml-check { display:flex; align-items:flex-start; gap:.65rem; grid-column:1 / -1; font-weight:400; margin-block:.5rem 1rem; }
.xml-workspace .xml-check .rz-chkbox { flex-shrink:0; margin-top:.15rem; }
