html:root {
    --portal-canvas: #f5f7fb;
    --portal-border: color-mix(in srgb, var(--rz-text-color) 14%, transparent);
    --portal-shadow-sm: 0 1px 2px rgb(15 23 42 / 5%);
    --portal-shadow-md: 0 8px 28px rgb(15 23 42 / 9%);
    --portal-radius: .75rem;
    --rz-primary: #2457a7;
    --rz-primary-light: #eaf1fc;
    --rz-link-color: #175ea8;
    --rz-link-hover-color: #0f477f;
    --rz-info: #0b5cad;
    --rz-on-info: #ffffff;
    --rz-info-lighter: #dbeafe;
    --rz-on-info-lighter: #164e83;
    --rz-success: #20733f;
    --rz-on-success: #ffffff;
    --rz-success-lighter: #dcfce7;
    --rz-on-success-lighter: #166534;
    --rz-warning: #8a4b00;
    --rz-on-warning: #ffffff;
    --rz-warning-lighter: #fef3c7;
    --rz-on-warning-lighter: #78350f;
    --rz-input-placeholder-color: #5b6472;
    --rz-input-disabled-color: #5b6472;
    --rz-border-radius: .55rem;
}

html, body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--rz-text-color);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2000;
    padding: 0.75rem 1.25rem;
    background: #fff3cd;
    color: #664d03;
    border-top: 1px solid #ffecb5;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.12);
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 0.75rem;
    cursor: pointer;
}


/* Account and Identity */
.account-page {
    min-height: calc(100vh - 8rem);
    display: grid;
    place-items: center;
    padding: 2.5rem 1rem;
}
.account-card {
    width: min(100%, 36rem);
    padding: clamp(1.25rem, 3vw, 2.25rem);
    border-radius: 1rem;
}
.account-heading {
    text-align: center;
}
.account-heading-icon {
    font-size: 2.75rem;
    color: var(--rz-primary);
}
.account-title {
    margin: 0;
}
.account-subtitle {
    color: var(--rz-text-secondary-color);
}
.account-heading .account-subtitle {
    text-align: center;
}
.account-form {
    width: 100%;
}
.account-validation,
.account-field-error {
    color: var(--rz-danger);
}
.account-field-error {
    display: block;
    margin-top: -0.75rem;
    font-size: 0.875rem;
}
.account-links {
    text-align: center;
}
.account-external-button,
.account-button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}
.account-external-button {
    width: 100%;
    min-height: 2.5rem;
    color: var(--rz-primary);
    border-color: var(--rz-primary);
    background: transparent;
}

.account-external-button .rz-button-text,
.account-external-button-icon {
    color: inherit;
}

.account-external-button:hover,
.account-external-button:focus-visible,
.account-external-button:active {
    color: var(--rz-on-primary, #fff);
    border-color: var(--rz-primary);
    background: var(--rz-primary);
}

.account-external-button:focus-visible {
    outline: 2px solid var(--rz-primary);
    outline-offset: 2px;
}
.account-manage-page {
    padding: 1rem 0 2rem;
}
.account-manage-nav-card,
.account-manage-content {
    height: 100%;
}
.account-manage-menu {
    width: 100%;
}
.account-manage-content {
    padding: clamp(1rem, 2.5vw, 2rem);
}
.account-manage-content h1,
.account-manage-content h2,
.account-manage-content h3 {
    margin-top: 0;
}
.account-secret-card {
    overflow-wrap: anywhere;
    font-size: 1.05rem;
}
.account-security-icon {
    font-size: 2rem;
    color: var(--rz-primary);
}
.account-recovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.75rem;
}
.account-recovery-code {
    display: block;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--rz-base-300);
    border-radius: var(--rz-border-radius);
    background: var(--rz-base-100);
    font-size: 1rem;
}
@media (max-width: 767px) {
    .account-page {
        padding: 1rem 0.25rem;
    }
    .account-card {
        border-radius: 0.75rem;
    }
    .account-manage-content {
        padding: 1rem;
    }
}


.account-divider {
    border-top: 1px solid var(--rz-base-300);
    margin: 0.5rem 0;
    width: 100%;
}

.account-divider-with-text {
    align-items: center;
    border-top: 0;
    display: flex;
    gap: 0.75rem;
    margin: 0.25rem 0;
}

.account-divider-with-text::before,
.account-divider-with-text::after {
    border-top: 1px solid var(--rz-base-300);
    content: "";
    flex: 1;
}

.account-divider-with-text span {
    color: var(--rz-text-secondary-color);
    font-size: 0.875rem;
    white-space: nowrap;
}


/* Portal responsive design system */
:root {
    --portal-page-max-width: 1600px;
    --portal-page-gutter: clamp(0.75rem, 2vw, 1.75rem);
    --portal-surface-radius: 0.875rem;
    --portal-control-min-height: 2.75rem;
}

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

html {
    min-width: 320px;
    background: var(--rz-body-background-color);
}

body {
    margin: 0;
    color: var(--rz-text-color);
    background: var(--rz-body-background-color);
    overflow-x: hidden;
}

main,
.content,
.rz-body {
    min-width: 0;
}

/* Third-party controls often carry an intrinsic minimum width. Allow every
   control and layout child to shrink inside its responsive parent. */
:where(.rz-stack, .rz-row, .rz-column, .rz-card, .rz-fieldset, .rz-form-field,
       .rz-dialog-content, .rz-tabview-panel, .rz-accordion-content) > * {
    min-width: 0;
}

:where(.rz-textbox, .rz-textarea, .rz-password, .rz-dropdown, .rz-multiselect,
       .rz-numeric, .rz-datepicker, .rz-autocomplete, .rz-fileupload) {
    max-width: 100%;
}

:where(.rz-label, .rz-form-field-label, .rz-dropdown-label,
       .rz-multiselect-label, .rz-menuitem-text) {
    overflow-wrap: anywhere;
}

:where(.rz-button-text, .rz-button-label) {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
    white-space: normal;
}

.content {
    width: min(100%, var(--portal-page-max-width));
    margin-inline: auto;
    padding: var(--portal-page-gutter);
}

.rz-card {
    border-radius: var(--portal-surface-radius);
    box-shadow: var(--rz-card-shadow, 0 1px 3px rgba(0, 0, 0, 0.12));
}

.rz-button,
.rz-textbox,
.rz-dropdown,
.rz-multiselect,
.rz-numeric,
.rz-datepicker,
.rz-password {
    min-height: var(--portal-control-min-height);
}

.rz-button {
    border-radius: 0.625rem;
    touch-action: manipulation;
    max-width: 100%;
    height: auto;
    min-height: 2.75rem;
    font-weight: 600;
    line-height: 1.25;
    text-transform: none;
    transition: background-color .15s ease, border-color .15s ease,
                color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.rz-button:not(:disabled):active {
    transform: translateY(1px);
}

.rz-button .rzi {
    flex: 0 0 auto;
}

.rz-fieldset {
    min-width: 0;
    border-radius: var(--portal-surface-radius);
}

.rz-data-grid {
    width: 100%;
    border-radius: var(--portal-surface-radius);
    overflow: visible;
}

.rz-data-grid-data {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    max-width: 100%;
    scrollbar-gutter: stable;
}

.rz-dialog-wrapper {
    padding: clamp(0.5rem, 2vw, 1.5rem);
}

.rz-dialog {
    width: min(var(--rz-dialog-width, 720px), calc(100vw - 1rem)) !important;
    max-height: calc(100dvh - 1rem);
    border-radius: var(--portal-surface-radius);
}

.rz-dialog-content {
    max-height: calc(100dvh - 8rem);
    overflow: auto;
}

.rz-notification {
    max-width: min(28rem, calc(100vw - 1rem));
}

.rz-panel-menu,
.rz-navigation-item-link {
    touch-action: manipulation;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

.portal-page-actions,
.page-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
}

.portal-form-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.portal-form-grid > *,
.form-grid > * {
    min-width: 0;
}

@media (max-width: 991.98px) {
    :root {
        --portal-page-gutter: 1rem;
    }

    .rz-dialog {
        width: calc(100vw - 1rem) !important;
    }

    .portal-form-grid,
    .form-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    :root {
        --portal-page-gutter: 0.75rem;
        --portal-control-min-height: 3rem;
    }

    .content {
        padding-top: 0.75rem;
    }

    .rz-card,
    .rz-fieldset {
        border-radius: 0.75rem;
    }

    .rz-data-grid {
        font-size: 0.9375rem;
    }

    .rz-data-grid:not(.portal-responsive-grid) .rz-grid-table {
        width: 100%;
        min-width: 0;
    }

    .rz-paginator {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    .rz-dialog-wrapper {
        align-items: flex-end;
        padding: 0;
    }

    .rz-dialog {
        width: 100vw !important;
        max-width: none !important;
        max-height: 92dvh;
        margin: 0;
        border-radius: 1rem 1rem 0 0;
    }

    .rz-dialog-content {
        max-height: calc(92dvh - 7rem);
    }

    .portal-page-actions,
    .page-actions,
    .form-actions {
        align-items: stretch;
    }

    .portal-page-actions > .rz-button,
    .page-actions > .rz-button,
    .form-actions > .rz-button {
        flex: 1 1 10rem;
        min-width: 0;
    }

    .portal-form-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .portal-form-grid > *,
    .form-grid > * {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 479.98px) {
    .rz-notification {
        inset-inline: 0.5rem !important;
        width: auto !important;
    }

    .rz-button {
        white-space: normal;
    }

    .rz-button .rz-button-text,
    .rz-button .rz-button-label {
        white-space: normal;
        line-height: 1.25;
    }

    .account-card {
        box-shadow: none;
    }
}

.public-equipment-card {
    height: 100%;
    border: 1px solid var(--rz-base-300);
    border-radius: .875rem;
    box-shadow: 0 1px 3px rgb(15 23 42 / 7%);
}

.public-equipment-card__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.public-equipment-card__heading .rz-text {
    margin: 0;
    overflow-wrap: anywhere;
}

.public-equipment-card__meta {
    color: var(--rz-text-secondary-color);
}

.public-equipment-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    margin-top: auto;
    border-radius: .65rem;
    font-weight: 600;
    text-decoration: none;
}

.public-equipment-request-card {
    width: min(100%, 46rem);
    margin-inline: auto;
    padding: clamp(1rem, 3vw, 1.75rem);
    border: 1px solid var(--rz-base-300);
    border-radius: 1rem;
}

.public-equipment-request-card .rz-label {
    display: inline-block;
    margin-bottom: .35rem;
    font-weight: 600;
}

.public-equipment-request-submit {
    align-self: flex-end;
    min-width: 12rem;
}

@media (max-width: 600px) {
    .public-equipment-request-submit {
        align-self: stretch;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.work-hub-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: .75rem;
}

.work-hub-summary__tile {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: .2rem .65rem;
    padding: .8rem;
    border: 1px solid var(--rz-base-300);
    border-radius: .65rem;
    color: inherit;
    text-decoration: none;
    min-height: 5.2rem;
}

.work-hub-summary__tile:hover,
.work-hub-summary__tile:focus-visible { border-color: var(--rz-primary); }
.work-hub-summary__tile .rzi { grid-row: 1 / span 2; font-size: 1.6rem; }
.work-hub-summary__tile strong { font-size: 1.35rem; }
.work-hub-summary__tile span { font-size: .85rem; }

/* Portal-wide production visual system ----------------------------------- */
/* Disabled after field verification showed that broad Radzen overrides can
   interfere with component-managed sizing/visibility. Keep future styling
   scoped to an explicit page or shared component class. */
@media not all {
:root {
    --portal-border: var(--rz-base-300);
    --portal-surface: var(--rz-base-background-color);
    --portal-surface-muted: var(--rz-base-50);
    --portal-shadow-sm: 0 1px 2px rgb(15 23 42 / 5%);
    --portal-shadow-md: 0 8px 24px rgb(15 23 42 / 8%);
}

body {
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

:where(h1, h2, h3, h4, h5, h6) {
    text-wrap: balance;
}

:where(p, .rz-text) {
    overflow-wrap: anywhere;
}

/* Surfaces */
.rz-card {
    border: 1px solid var(--portal-border);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-sm);
}

.rz-fieldset {
    border-color: var(--portal-border);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-sm);
}

.rz-fieldset-legend-text {
    font-weight: 700;
}

/* Forms */
.rz-form-field {
    min-width: 0;
}

.rz-form-field-label,
.rz-label {
    color: var(--rz-text-color);
    font-weight: 600;
}

:where(.rz-inputtext, .rz-textarea, .rz-dropdown, .rz-multiselect,
       .rz-numeric, .rz-datepicker, .rz-autocomplete, .rz-password) {
    border-radius: .625rem;
}

:where(.rz-inputtext, .rz-textarea)::placeholder {
    color: var(--rz-text-secondary-color);
    opacity: .78;
}

.validation-message,
.rz-message-error {
    font-size: .875rem;
    font-weight: 550;
}

/* Buttons and action regions */
.rz-button {
    gap: .4rem;
    min-height: 2.5rem;
    padding-inline: .9rem;
    box-shadow: none;
}

.rz-button.rz-primary:not(.rz-variant-text) {
    box-shadow: 0 1px 2px color-mix(in srgb, var(--rz-primary) 25%, transparent);
}

.rz-button:not(:disabled):hover {
    box-shadow: 0 3px 10px rgb(15 23 42 / 10%);
}

.responsive-form-actions,
.form-actions,
.page-actions,
.portal-page-actions {
    justify-content: flex-end;
    margin-top: .25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--portal-border);
}

/* Tabs */
.rz-tabview {
    min-width: 0;
}

.rz-tabview-nav {
    gap: .2rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.rz-tabview-nav-link {
    min-height: 2.75rem;
    padding: .7rem .9rem;
    border-radius: .65rem .65rem 0 0;
    font-weight: 600;
    white-space: nowrap;
}

.rz-tabview-panel {
    min-width: 0;
    padding-top: 1rem;
}

/* Data-heavy surfaces */
.rz-data-grid {
    border: 1px solid var(--portal-border);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow-sm);
}

.rz-grid-table thead th {
    background: var(--portal-surface-muted);
    color: var(--rz-text-color);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.rz-grid-table tbody tr {
    transition: background-color .12s ease;
}

.rz-grid-table tbody tr:hover td {
    background: color-mix(in srgb, var(--rz-primary) 4%, var(--portal-surface));
}

.rz-paginator {
    min-height: 3rem;
    border-top: 1px solid var(--portal-border);
    background: var(--portal-surface-muted);
}

.rz-cell-data {
    line-height: 1.4;
}

/* Feedback */
.rz-alert {
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    border-radius: .75rem;
    line-height: 1.45;
}

.rz-badge {
    max-width: 100%;
    padding: .3rem .55rem;
    border-radius: 999px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.loading-state {
    min-height: 12rem;
    padding: 2rem 1rem;
    color: var(--rz-text-secondary-color);
}

.state-card {
    width: min(100%, 48rem);
    min-height: 12rem;
    margin-inline: auto;
    border-style: dashed;
    background: color-mix(in srgb, var(--portal-surface) 92%, var(--portal-surface-muted));
}

.state-card-content {
    min-height: 12rem;
    padding: clamp(1rem, 3vw, 2rem);
    text-align: center;
}

.state-card-icon-wrap {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: var(--rz-base-100);
    color: var(--rz-primary);
}

.state-card-icon {
    font-size: 2.25rem;
}

.error-state .state-card-icon-wrap {
    background: color-mix(in srgb, var(--rz-danger) 10%, var(--portal-surface));
    color: var(--rz-danger);
}

.state-card-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .5rem;
}

/* Dialogs, overlays and menus */
.rz-dialog {
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow-md);
}

.rz-dialog-titlebar {
    border-bottom: 1px solid var(--portal-border);
    background: var(--portal-surface-muted);
}

.rz-dialog-title {
    font-weight: 700;
}

.rz-popup,
.rz-dropdown-panel,
.rz-context-menu,
.rz-profile-menu {
    border: 1px solid var(--portal-border);
    border-radius: .65rem;
    box-shadow: var(--portal-shadow-md);
}

@media (max-width: 767.98px) {
    .rz-card {
        padding: 1rem;
    }

    .rz-tabview-panel {
        padding-top: .75rem;
    }

    .responsive-form-actions,
    .form-actions,
    .page-actions,
    .portal-page-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .responsive-form-actions > *,
    .form-actions > *,
    .page-actions > *,
    .portal-page-actions > * {
        width: 100%;
    }

    .rz-dialog-content {
        padding: 1rem;
    }
}
}

/* Equipment workspace -----------------------------------------------------
   Equipment is an operational area, so it uses a quieter surface hierarchy,
   compact data tables and clearly separated primary/destructive actions. */
.equipment-page {
    --equipment-surface: var(--rz-base-background-color);
    --equipment-muted-surface: var(--rz-base-50);
    --equipment-border: var(--rz-base-300);
    display: block;
    min-width: 0;
}

.equipment-page .rz-tabs {
    overflow: hidden;
    border: 1px solid var(--equipment-border);
    border-radius: 1rem;
    background: var(--equipment-surface);
    box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
}

.equipment-page .rz-tabview-nav {
    gap: .25rem;
    padding: .5rem .5rem 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    background: var(--equipment-muted-surface);
    scrollbar-width: thin;
}

.equipment-page .rz-tabview-nav-link {
    min-height: 2.75rem;
    padding: .7rem .9rem;
    border-radius: .7rem .7rem 0 0;
    white-space: nowrap;
}

.equipment-page .rz-tabview-panel {
    padding: clamp(1rem, 2.5vw, 1.5rem);
}

.equipment-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: .25rem 0 1rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--equipment-border);
}

.equipment-section-title {
    min-width: 0;
    margin: 0 !important;
    color: var(--rz-text-color);
    font-weight: 650;
}

.equipment-page-actions,
.equipment-footer-actions,
.equipment-form-actions,
.equipment-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
}

.equipment-page-actions,
.equipment-form-actions {
    justify-content: flex-end;
}

.equipment-footer-actions {
    padding-top: .25rem;
}

.equipment-form-actions {
    margin-top: .25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--equipment-border);
}

.equipment-row-actions {
    flex-wrap: nowrap;
}

.equipment-page .rz-button,
.equipment-row-actions .rz-button,
.equipment-form-actions .rz-button,
.equipment-section-header .rz-button {
    min-height: 2.5rem;
    padding-inline: .9rem;
    border-radius: .65rem;
    font-weight: 600;
    box-shadow: none;
}

.equipment-page .rz-button.rz-primary,
.equipment-add-button.rz-primary,
.equipment-form-actions .rz-button.rz-primary {
    box-shadow: 0 1px 2px color-mix(in srgb, var(--rz-primary) 24%, transparent);
}

.equipment-page .rz-button:not(:disabled):hover,
.equipment-row-actions .rz-button:not(:disabled):hover,
.equipment-form-actions .rz-button:not(:disabled):hover,
.equipment-section-header .rz-button:not(:disabled):hover {
    transform: translateY(-1px);
}

.equipment-page .rz-button:disabled {
    opacity: .55;
}

.equipment-form-card,
.equipment-page .rz-fieldset,
.equipment-page > .rz-card,
.equipment-page .rz-tabview-panel > .rz-card {
    border: 1px solid var(--equipment-border);
    border-radius: .875rem;
    background: var(--equipment-surface);
    box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
}

.equipment-page .rz-form-field {
    min-width: 0;
}

.equipment-page :where(.rz-inputtext, .rz-dropdown, .rz-multiselect,
                       .rz-numeric, .rz-datepicker, textarea) {
    width: 100%;
    border-radius: .625rem;
}

.equipment-grid,
.equipment-page .rz-data-grid {
    border: 1px solid var(--equipment-border);
    border-radius: .8rem;
    overflow: hidden;
    background: var(--equipment-surface);
}

.equipment-page .rz-grid-table thead th {
    background: var(--equipment-muted-surface);
    color: var(--rz-text-color);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.equipment-page .rz-grid-table tbody tr:hover td {
    background: color-mix(in srgb, var(--rz-primary) 5%, var(--equipment-surface));
}

.equipment-page .rz-cell-data {
    line-height: 1.4;
}

.equipment-page .rz-badge {
    padding: .35rem .6rem;
    border-radius: 999px;
    font-weight: 650;
}

.equipment-page .rz-alert {
    border-radius: .75rem;
}

@media (max-width: 767.98px) {
    .equipment-page .rz-tabview-panel {
        padding: .85rem;
    }

    .equipment-section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .equipment-add-button,
    .equipment-page-actions > .rz-button,
    .equipment-footer-actions > .rz-button,
    .equipment-form-actions > .rz-button {
        width: 100%;
    }

    .equipment-page-actions {
        align-items: stretch;
    }

    .equipment-page-actions .rz-badge {
        align-self: flex-start;
    }

    .equipment-form-actions {
        flex-direction: column-reverse;
    }

    .equipment-row-actions {
        flex-wrap: wrap;
    }

    .equipment-row-actions .rz-button {
        flex: 1 1 7rem;
    }
}

@media (max-width: 479.98px) {
    .equipment-page .rz-tabs {
        border-inline: 0;
        border-radius: .75rem;
    }

    .equipment-page .rz-tabview-panel {
        padding: .75rem .5rem 1rem;
    }
}


/* Release accessibility and resilient error states */
.portal-error-card {
    width: min(100%, 42rem);
    margin: clamp(2rem, 8vh, 6rem) auto;
    padding: clamp(1.25rem, 4vw, 2.5rem);
}
.portal-error-icon {
    color: var(--rz-danger);
    font-size: 3rem;
}
:focus-visible {
    outline: 3px solid var(--rz-primary);
    outline-offset: 2px;
}
.rz-button:focus-visible,
.rz-inputtext:focus-visible,
.rz-dropdown:focus-within,
.rz-checkbox:focus-within {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rz-primary) 35%, transparent);
}
.rz-button[disabled],
.rz-state-disabled {
    cursor: not-allowed;
}
iframe {
    max-width: 100%;
}
@media (max-width: 767.98px) {
    .portal-error-card {
        margin: 1rem auto;
    }
    .rz-data-grid .rz-column-title {
        white-space: normal;
    }
    .rz-dialog-titlebar {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--rz-dialog-background-color);
    }
}


/* Release-ready theme, density, recovery and responsive states */
[data-portal-theme="dark"] {
    color-scheme: dark;
    --rz-body-background-color: #111827;
    --rz-base-background-color: #182235;
    --rz-base-50: #111827;
    --rz-base-100: #182235;
    --rz-base-200: #233047;
    --rz-base-300: #344258;
    --rz-text-color: #f3f4f6;
    --rz-text-secondary-color: #cbd5e1;
    --rz-card-background-color: #182235;
    --rz-panel-menu-item-color: #e5e7eb;
    --rz-grid-cell-color: #e5e7eb;
    --rz-grid-header-color: #f8fafc;
    --rz-input-background-color: #111827;
    --rz-input-value-color: #f3f4f6;
}

[data-portal-theme="dark"] body,
[data-portal-theme="dark"] .rz-body,
[data-portal-theme="dark"] .rz-layout,
[data-portal-theme="dark"] .rz-sidebar,
[data-portal-theme="dark"] .rz-header,
[data-portal-theme="dark"] .rz-card,
[data-portal-theme="dark"] .rz-dialog {
    background-color: var(--rz-body-background-color);
    color: var(--rz-text-color);
}

[data-portal-theme="dark"] .rz-card,
[data-portal-theme="dark"] .rz-dialog,
[data-portal-theme="dark"] .rz-data-grid,
[data-portal-theme="dark"] .rz-panel-menu {
    border-color: var(--rz-base-300);
}

[data-portal-density="compact"] {
    --portal-control-min-height: 2.25rem;
}

[data-portal-density="compact"] .rz-cell-data,
[data-portal-density="compact"] .rz-grid-table td,
[data-portal-density="compact"] .rz-grid-table th {
    padding-block: .4rem;
}

.impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    min-height: 2.75rem;
    padding: .5rem var(--portal-page-gutter);
    background: #7c2d12;
    color: #fff;
    box-shadow: 0 2px 8px rgb(0 0 0 / 20%);
}

.impersonation-banner form {
    margin: 0;
}

.portal-state-card {
    display: grid;
    place-items: center;
    min-height: 12rem;
    padding: clamp(1rem, 4vw, 2.5rem);
    text-align: center;
}

.portal-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .625rem;
}

.portal-toolbar > .rz-button:last-child {
    margin-inline-start: auto;
}

.rz-data-grid .rz-button {
    white-space: normal;
}

/* Grid actions must be sized by their controls, not by the cell's ellipsis box. */
.rz-data-grid .portal-grid-action-cell {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}

.portal-grid-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    min-width: 0;
    padding: .25rem;
    overflow: visible;
}

.portal-grid-actions > *,
.portal-grid-actions .rz-button {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
}

.portal-grid-actions .rz-button-label,
.portal-grid-actions .rz-button-text {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.rz-data-grid td:has(.rz-button),
.rz-data-grid td:has(.rz-menu-button) {
    min-width: 0;
    overflow: visible !important;
    text-overflow: clip !important;
}

.rz-data-grid td:has(.rz-button) > .rz-stack,
.rz-data-grid td:has(.rz-menu-button) > .rz-stack {
    min-width: 0;
    flex-wrap: wrap;
    overflow: visible;
    padding: .25rem;
}

.rz-data-grid td .rz-button,
.rz-data-grid td .rz-menu-button {
    flex-shrink: 0;
    max-width: none;
}

.portal-job-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
    gap: .75rem;
}

.portal-job-field {
    display: grid;
    gap: .2rem;
    min-width: 0;
    padding: .75rem;
    border: 1px solid var(--rz-base-300);
    border-radius: .625rem;
}

.portal-job-field__label {
    color: var(--rz-text-secondary-color);
    font-size: .8125rem;
    font-weight: 600;
}

.portal-job-field__value {
    overflow-wrap: anywhere;
}

.portal-job-field__value--monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 767.98px) {
    .impersonation-banner {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .portal-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-toolbar > *,
    .portal-toolbar .rz-button,
    .form-actions > .rz-button {
        width: 100%;
    }

    .rz-data-grid {
        font-size: .875rem;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* Release architecture and productivity additions */
.entity-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.entity-toolbar-start,
.entity-toolbar-end,
.responsive-form-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.entity-toolbar-start {
    flex: 1 1 24rem;
}

.entity-toolbar-end {
    justify-content: flex-end;
}

.notification-bell {
    position: relative;
    display: inline-flex;
}

.notification-bell-badge {
    position: absolute;
    top: -.25rem;
    right: -.35rem;
    pointer-events: none;
    min-width: 1.25rem;
    justify-content: center;
}

.notification-card {
    border-inline-start: .25rem solid transparent;
}

.notification-card.is-unread {
    border-inline-start-color: var(--rz-info);
}

.notification-card.is-read {
    opacity: .78;
}

.search-result,
.settings-area {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: start;
    cursor: pointer;
    border-radius: var(--rz-border-radius);
    transition: background-color .15s ease, transform .15s ease;
}

.search-result {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
}

.search-result:hover,
.search-result:focus-visible,
.settings-area:hover,
.settings-area:focus-visible {
    background: var(--rz-base-200);
}

.search-result:focus-visible,
.settings-area:focus-visible {
    outline: 2px solid var(--rz-primary);
    outline-offset: 2px;
}

.search-result-content {
    display: grid;
    min-width: 0;
}

.search-result-content span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--rz-text-secondary-color);
}

.search-result-icon,
.operation-area-icon {
    font-size: 1.75rem;
    color: var(--rz-primary);
}

.activity-feed {
    display: grid;
    gap: .75rem;
}

.activity-feed-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    border: 1px solid var(--rz-base-300);
    border-radius: var(--rz-border-radius);
    background: var(--rz-panel-background-color);
}

.activity-feed-icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--rz-base-200);
    color: var(--rz-primary);
}

.activity-feed-content {
    min-width: 0;
}

.operation-area-card {
    height: 100%;
}

.settings-area {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    min-height: 5rem;
    padding: .85rem;
    border: 1px solid var(--rz-base-300);
}

.settings-area > span {
    display: grid;
    gap: .2rem;
}

.settings-area small {
    color: var(--rz-text-secondary-color);
}

.section-card {
    height: 100%;
    border: 1px solid var(--rz-base-300);
    border-radius: .875rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
}

.section-card-heading {
    min-width: 0;
}

.section-card-heading .rz-text {
    overflow-wrap: anywhere;
}

.section-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
}

.state-card {
    max-width: 48rem;
    margin-inline: auto;
}

.state-card-icon {
    font-size: 2.5rem;
}

.error-state .state-card-icon {
    color: var(--rz-danger);
}

@media (max-width: 767px) {
    .entity-toolbar,
    .entity-toolbar-start,
    .entity-toolbar-end,
    .responsive-form-actions {
        align-items: stretch;
        width: 100%;
    }

    .entity-toolbar-start > *,
    .entity-toolbar-end > *,
    .responsive-form-actions > * {
        flex: 1 1 100%;
        width: 100%;
    }

    .activity-feed-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .activity-feed-item > :last-child {
        grid-column: 1 / -1;
        width: 100%;
    }

    .notification-bell .rz-button {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    .section-card > .rz-stack > .rz-stack:first-child {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .section-card-actions,
    .section-card-actions > .rz-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .search-result,
    .settings-area {
        transition: none;
    }
}


/* Final pre-release operational and mobile refinements */
.portal-responsive-grid {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.portal-responsive-grid .rz-data-grid-data,
.portal-responsive-grid .rz-grid-table-container {
    overflow-x: auto;
}

.portal-card-action {
    float: inline-end;
}

.portal-inline-actions,
.portal-sticky-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.portal-diagnostic-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: .625rem;
    border-bottom: 1px solid var(--rz-base-300);
}

.portal-diagnostic-row:last-child {
    border-bottom: 0;
}

.portal-diagnostic-path {
    color: var(--rz-text-secondary-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .8125rem;
    overflow-wrap: anywhere;
}

.portal-diagnostic-list {
    margin: 0;
    padding-inline-start: 1.25rem;
    overflow-wrap: anywhere;
}

.portal-settings-tabs .rz-tabview-nav {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.portal-settings-tabs .rz-tabview-nav li {
    flex: 0 0 auto;
}

.portal-dialog-form {
    min-width: 0;
}

.notification-card-header > div {
    min-width: 0;
}

.notification-card-header .rz-text {
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .portal-card-action {
        float: none;
        width: 100%;
        margin-top: .75rem;
    }

    .portal-inline-actions,
    .portal-sticky-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .portal-inline-actions > *,
    .portal-sticky-actions > *,
    .portal-sticky-actions .rz-button {
        width: 100%;
    }

    .portal-sticky-actions {
        position: sticky;
        bottom: 0;
        z-index: 10;
        margin-inline: calc(var(--portal-page-gutter) * -1);
        padding: .75rem var(--portal-page-gutter);
        border-top: 1px solid var(--rz-base-300);
        background: var(--rz-body-background-color);
        box-shadow: 0 -.25rem .75rem rgb(0 0 0 / 8%);
    }

    .portal-diagnostic-row {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-responsive-grid .rz-grid-table {
        min-width: 44rem;
    }

    .portal-settings-tabs .rz-tabview-panels {
        padding-inline: 0;
    }

    .notification-card-header {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .search-result-content span {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .rz-dialog {
        inset: auto 0 0 !important;
        width: 100vw !important;
        max-width: none !important;
        max-height: 94dvh;
        margin: 0 !important;
        border-radius: 1rem 1rem 0 0;
    }

    .rz-dialog-content {
        max-height: calc(94dvh - 4.5rem);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

@media (max-width: 399.98px) {
    .search-result {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .search-result > :last-child {
        display: none;
    }
}


/* Installation and reconfiguration wizard */
.portal-installation-steps .rz-steps-content {
    min-width: 0;
    max-width: 100%;
    padding-inline: 0;
}

.portal-installation-steps {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.portal-installation-setting {
    overflow-wrap: anywhere;
}

.portal-installation-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.portal-compact-list {
    margin: .5rem 0 0;
    padding-inline-start: 1.25rem;
}

@media (max-width: 700px) {
    .portal-installation-admin-grid {
        grid-template-columns: 1fr;
    }

    .portal-installation-steps .rz-steps-header {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    .portal-installation-steps .rz-steps-title {
        white-space: nowrap;
    }
}


/* Platform studio and productivity */
.quick-create-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: .75rem;
}
.productivity-favorite {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .75rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--rz-base-300);
}
.productivity-favorite a { overflow-wrap: anywhere; font-weight: 600; }
.productivity-favorite span { color: var(--rz-text-secondary-color); font-size: .85rem; }
.entity-comment { margin-block: .5rem; }
.entity-comment__meta { color: var(--rz-text-secondary-color); font-size: .8rem; margin-bottom: .35rem; }
.entity-comment__body { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .productivity-favorite { grid-template-columns: auto minmax(0, 1fr) auto; }
    .productivity-favorite span { display: none; }
    .quick-create-grid { grid-template-columns: 1fr; }
}


/* Platform Studio visual designers */
.automation-canvas {
    position: relative;
    width: 1000px;
    height: 720px;
    transform: scale(var(--automation-zoom, 1));
    transform-origin: top left;
    border: 1px dashed var(--rz-base-400);
    border-radius: .75rem;
    background: var(--rz-base-50);
    background-image: radial-gradient(var(--rz-base-300) 1px, transparent 1px);
    background-size: 1rem 1rem;
}
.automation-canvas__viewport {
    min-height: 16rem;
    max-height: 42rem;
    overflow: auto;
    border: 1px solid var(--rz-base-300);
    border-radius: .75rem;
    background: var(--rz-base-50);
}
.automation-canvas__connections {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.automation-canvas__edge {
    fill: none;
    stroke: var(--rz-primary);
    stroke-width: 3;
}
.automation-canvas__edge--conditional { stroke-dasharray: 8 6; }
.automation-canvas__connections marker path { fill: var(--rz-primary); }
.automation-canvas__zoom { color: var(--rz-text-secondary-color); font-size: .875rem; }
.automation-node-palette { display: flex; gap: .5rem; overflow-x: auto; padding: .25rem 0 .75rem; }
.automation-node-palette__item { display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto; min-height: 2.75rem; padding: .5rem .7rem; border: 1px solid var(--rz-base-300); border-radius: .5rem; color: var(--rz-text-color); background: var(--rz-base-100); cursor: grab; }
.automation-node-palette__item:focus-visible { outline: 3px solid var(--rz-primary); outline-offset: 2px; }
.automation-canvas__accessible-list { margin-top: .75rem; }
.automation-canvas__accessible-list > div { display: grid; gap: .25rem; padding: .5rem 0; }
.automation-canvas__accessible-list summary { cursor: pointer; }
.automation-canvas .automation-node {
    position: absolute;
    width: 220px;
    min-height: 96px;
    z-index: 1;
}
.automation-node {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    border: 1px solid var(--rz-base-300);
    border-radius: .65rem;
    background: var(--rz-base-background-color);
    cursor: grab;
}
.automation-node:active { cursor: grabbing; }
.automation-node__handle,
.report-layout-item__handle,
.dashboard-editor-widget__handle {
    font-weight: 700;
    color: var(--rz-text-secondary-color);
    cursor: grab;
}
.automation-node__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.automation-node__content span {
    color: var(--rz-text-secondary-color);
    overflow-wrap: anywhere;
}
@media (max-width: 700px) {
    .automation-canvas__viewport { max-height: 27rem; }
    .automation-canvas { transform-origin: top left; }
}
.automation-edge {
    align-self: center;
    font-size: 1.5rem;
    color: var(--rz-primary);
}
.report-field-list,
.report-layout-zone {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: 12rem;
}
.section-card.report-designer-section {
    height: auto;
}
.report-field,
.report-layout-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid var(--rz-base-300);
    border-radius: .55rem;
    background: var(--rz-base-background-color);
    text-align: left;
}
.report-layout-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
}
.dashboard-layout-editor {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
.dashboard-editor-widget {
    display: grid;
    grid-template-columns: auto auto minmax(10rem, 1fr) minmax(8rem, auto) minmax(7rem, auto);
    align-items: center;
    gap: .65rem;
    padding: .75rem;
    border: 1px solid var(--rz-base-300);
    border-radius: .65rem;
    background: var(--rz-base-background-color);
}
.dashboard-editor-widget--small { grid-column: span 3; }
.dashboard-editor-widget--medium { grid-column: span 6; }
.dashboard-editor-widget--large { grid-column: span 9; }
.dashboard-editor-widget--full { grid-column: 1 / -1; }
[data-dashboard-widget][data-widget-size="small"] { grid-column: span 3; }
[data-dashboard-widget][data-widget-size="medium"] { grid-column: span 6; }
[data-dashboard-widget][data-widget-size="large"] { grid-column: span 9; }
[data-dashboard-widget][data-widget-size="full"] { grid-column: 1 / -1; }
.markdown-content {
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.markdown-content > :last-child { margin-bottom: 0; }
.markdown-content pre {
    overflow-x: auto;
    padding: .75rem;
    border-radius: .5rem;
    background: var(--rz-base-100);
}
.comment-file-list,
.comment-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.comment-attachment {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .65rem;
    border: 1px solid var(--rz-base-300);
    border-radius: .5rem;
    text-decoration: none;
}
.comment-attachment small { color: var(--rz-text-secondary-color); }

@media (max-width: 767px) {
    .dashboard-layout-editor { grid-template-columns: 1fr; }
    .dashboard-editor-widget,
    .dashboard-editor-widget--small,
    .dashboard-editor-widget--medium,
    .dashboard-editor-widget--large,
    .dashboard-editor-widget--full {
        grid-column: 1;
        grid-template-columns: auto auto 1fr;
    }
    .dashboard-editor-widget .rz-dropdown,
    .dashboard-editor-widget .rz-numeric {
        grid-column: 2 / -1;
        width: 100% !important;
    }
    [data-dashboard-widget][data-widget-size] { grid-column: 1 / -1; }
}


/* Organisation-wide finance */
.finance-kpi-positive { color: var(--rz-success); }
.finance-kpi-negative { color: var(--rz-danger); }
@media (max-width: 600px) {
  .portal-responsive-grid .rz-cell-data { overflow-wrap: anywhere; }
  .rz-dialog-wrapper .rz-dialog { width: calc(100vw - 1rem) !important; max-height: calc(100vh - 1rem); }
}

.portal-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0,0,0,.35);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.portal-editor-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
}
/* Clear, inline explanations for unfamiliar fields and workflows. */
.portal-field-help {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    margin-top: .35rem;
    color: var(--rz-text-secondary-color);
    font-size: .875rem;
    line-height: 1.4;
}
.portal-field-help .rzi {
    flex: 0 0 auto;
    margin-top: .1rem;
    font-size: 1rem;
}
.portal-workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .75rem;
    border: 1px solid var(--rz-base-300);
    border-radius: var(--rz-border-radius);
    background: var(--rz-base-50);
}
.portal-readonly-value {
    padding: .65rem .75rem;
    border: 1px solid var(--rz-base-300);
    border-radius: var(--rz-border-radius);
    background: var(--rz-base-100);
}

/* Keyboard, screen-reader and reduced-motion support shared by every portal screen. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--rz-primary);
    outline-offset: 2px;
}

.rz-button:focus-visible,
.rz-inputtext:focus-visible,
.rz-dropdown:focus-within,
.rz-multiselect:focus-within,
.rz-datepicker:focus-within {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rz-primary) 30%, transparent);
}

.rz-button:disabled,
.rz-state-disabled {
    cursor: not-allowed;
}

/* Portal button contrast: light actions must stay visible on cards, dialogs and dark themes. */
.rz-button.rz-light:not(.rz-variant-text):not(.rz-variant-flat) {
    color: var(--rz-text-color) !important;
    background-color: var(--rz-base-100) !important;
    border-color: var(--rz-base-400) !important;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--rz-text-color) 10%, transparent);
}

.rz-button.rz-light:not(.rz-variant-text):not(.rz-variant-flat):not(:disabled):not(.rz-state-disabled):hover {
    color: var(--rz-primary) !important;
    background-color: var(--rz-base-200) !important;
    border-color: var(--rz-primary) !important;
}

.rz-button.rz-light:not(.rz-variant-text):not(.rz-variant-flat):focus-visible {
    border-color: var(--rz-primary) !important;
}

.rz-button.rz-light:not(.rz-variant-text):not(.rz-variant-flat):disabled,
.rz-button.rz-light.rz-state-disabled:not(.rz-variant-text):not(.rz-variant-flat) {
    color: var(--rz-text-secondary-color) !important;
    background-color: var(--rz-base-100) !important;
    border-color: var(--rz-base-300) !important;
    opacity: .72 !important;
}

.rz-button.rz-light:not(.rz-variant-text):not(.rz-variant-flat) .rzi {
    color: inherit;
}

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

@media (pointer: coarse) {
    .rz-button {
        min-height: 2.75rem;
    }
}

/* Authenticated mobile pages use the browser document as their only vertical
   scroller. The root is locked briefly only while the navigation drawer is open. */
.app-shell {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--portal-border);
    background: color-mix(in srgb, var(--rz-base-background-color) 96%, transparent);
    box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
    backdrop-filter: blur(12px);
}

.app-header-inner {
    height: 100%;
    min-width: 0;
    padding-inline: clamp(.55rem, 2vw, 1rem);
}

.app-header-tools {
    min-width: 0;
}

.app-sidebar {
    border-right: 1px solid var(--portal-border);
    background: var(--rz-base-background-color);
}

.app-body {
    min-height: 0;
    overflow: auto hidden;
    background: var(--portal-canvas);
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        height: auto;
        min-height: 100%;
        overflow-x: clip;
        overflow-y: visible;
    }

    html.portal-mobile-nav-open,
    html.portal-mobile-nav-open body {
        overflow-y: hidden;
    }

    .rz-button {
        height: auto !important;
        min-height: 2.75rem !important;
        white-space: normal !important;
    }

    .rz-button :where(.rz-button-text, .rz-button-label) {
        overflow-wrap: normal !important;
        word-break: normal !important;
        hyphens: auto;
        white-space: normal !important;
    }

    .app-shell {
        position: relative !important;
        inset: auto !important;
        display: block !important;
        grid-template: none !important;
        grid-template-areas: none !important;
        width: 100%;
        height: auto !important;
        min-height: 100svh;
        overflow: visible !important;
    }

    .app-header {
        position: sticky !important;
        inset: 0 0 auto !important;
        height: 3.75rem;
    }

    .app-header-inner {
        width: 100%;
        gap: .2rem !important;
    }

    .app-header-tools {
        flex: 0 0 auto;
        gap: .1rem !important;
    }

    .app-header-tools > * {
        flex: 0 0 auto;
    }

    .app-brand > span:last-child,
    .app-header-help .rz-button-text,
    .app-header-search .rz-button-text,
    .app-user-summary {
        display: none !important;
    }

    .app-header-help,
    .app-header-search,
    .app-header-tools .rz-profile-menu > button {
        width: 2.75rem;
        min-width: 2.75rem;
        padding-inline: .55rem !important;
    }

    .app-body {
        position: static !important;
        display: block !important;
        width: 100%;
        height: auto !important;
        min-height: calc(100svh - 3.75rem);
        max-height: none !important;
        margin-inline-start: 0 !important;
        overflow: visible !important;
        transform: none !important;
    }

    .app-sidebar {
        position: fixed !important;
        inset: 3.75rem auto 0 0 !important;
        z-index: 1200;
        display: none !important;
        width: min(20rem, calc(100vw - 3rem)) !important;
        height: calc(100dvh - 3.75rem) !important;
        overflow-y: auto !important;
        visibility: hidden;
        transform: none;
        box-shadow: .75rem 0 2rem rgb(15 23 42 / 20%);
    }

    .app-sidebar.app-sidebar--open {
        display: block !important;
        visibility: visible;
        transform: none;
    }

    .rz-data-grid:not(.portal-responsive-grid),
    .rz-data-grid:not(.portal-responsive-grid) .rz-data-grid-data,
    .rz-data-grid:not(.portal-responsive-grid) .rz-grid-table-container {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .rz-data-grid:not(.portal-responsive-grid) .rz-grid-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .rz-data-grid:not(.portal-responsive-grid) :where(th, td, .rz-cell-data) {
        min-width: 0;
        white-space: normal;
        overflow-wrap: break-word;
        text-overflow: clip;
    }

    :where(.responsive-form-actions, .form-actions, .page-actions, .portal-page-actions,
           .portal-inline-actions, .portal-sticky-actions, .section-card-actions) {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
        align-items: stretch !important;
        width: 100%;
        gap: .625rem;
    }

    :where(.responsive-form-actions, .form-actions, .page-actions, .portal-page-actions,
           .portal-inline-actions, .portal-sticky-actions, .section-card-actions) > *,
    :where(.responsive-form-actions, .form-actions, .page-actions, .portal-page-actions,
           .portal-inline-actions, .portal-sticky-actions, .section-card-actions) .rz-button {
        width: 100%;
        min-width: 0;
    }

    :where(.responsive-form-actions, .form-actions, .page-actions, .portal-page-actions,
           .portal-inline-actions, .portal-sticky-actions, .section-card-actions) > .rz-primary,
    :where(.responsive-form-actions, .form-actions, .page-actions, .portal-page-actions,
           .portal-inline-actions, .portal-sticky-actions, .section-card-actions) > .rz-danger {
        grid-column: 1 / -1;
    }

    :where(.responsive-form-actions, .form-actions, .page-actions, .portal-page-actions,
           .portal-inline-actions, .portal-sticky-actions, .section-card-actions) > .rz-danger {
        margin-top: .375rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
.access-review-chip-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.access-review-chip-list code {
    overflow-wrap: anywhere;
}
.review-attachment-list {
    display: grid;
    gap: .5rem;
    max-height: 14rem;
    overflow: auto;
    padding: .5rem;
    border: 1px solid var(--rz-base-300);
    border-radius: .5rem;
}

.review-attachment-list > div {
    display: flex;
    align-items: center;
    gap: .5rem;
}
