/*
 * HPC-AC global page governance.
 *
 * This layer is loaded after the legacy shell and canonical component layers.
 * It normalizes page rhythm, legacy utility-based cards/forms/tables, action
 * columns, responsive behavior, and page-header density across every web area.
 * New feature-specific rules belong in a named workspace stylesheet, not here.
 */

:root {
    --ui-page-gap: 16px;
    --ui-page-header-pad: clamp(.9rem, 1.3vw, 1.2rem);
    --ui-panel-pad: clamp(.82rem, 1.2vw, 1.05rem);
    --ui-filter-pad: .82rem;
    --ui-table-head-bg: #f7fafc;
    --ui-table-hover: #f8fbfd;
    --ui-table-selected: #eef9fd;
    --ui-danger-soft: #fff3f2;
    --ui-warning-soft: #fff8e8;
    --ui-success-soft: #effbf4;
    --ui-info-soft: #eef8fc;
}

/* --------------------------------------------------------------------------
 | Global page rhythm and primary heading normalization
 * -------------------------------------------------------------------------- */

[data-hpc-ui-contract="1"] .hpc-page-container {
    display: flow-root;
    min-width: 0;
}

[data-hpc-ui-contract="1"] .hpc-page-container > :where(
    .space-y-4,
    .space-y-5,
    .space-y-6,
    .ac-page,
    .as-page,
    .hpc-page,
    [data-ui-page-root]
) {
    min-width: 0;
}

[data-hpc-ui-contract="1"] .hpc-page-container > :where(
    .space-y-4,
    .space-y-5,
    .space-y-6,
    .ac-page,
    .as-page,
    .hpc-page,
    [data-ui-page-root]
) > * + * {
    margin-top: var(--ui-page-gap);
}

[data-hpc-ui-contract="1"] .ui-primary-page-heading {
    max-width: 72rem;
    margin: 0 !important;
    color: var(--ui-text) !important;
    font-size: var(--ui-page-title) !important;
    font-weight: 850 !important;
    letter-spacing: -.025em !important;
    line-height: 1.16 !important;
    text-wrap: balance;
}

[data-hpc-ui-contract="1"] .ui-primary-page-header {
    position: relative;
    min-width: 0;
    border-color: var(--ui-border) !important;
    border-radius: var(--ui-radius-card) !important;
    background: var(--ui-surface) !important;
    padding: var(--ui-page-header-pad) !important;
    box-shadow: var(--ui-shadow-xs) !important;
}

[data-hpc-ui-contract="1"] .ui-primary-page-header :where(
    .text-3xl,
    .text-4xl,
    .text-5xl,
    .text-6xl
) {
    font-size: var(--ui-page-title) !important;
    line-height: 1.16 !important;
}

[data-hpc-ui-contract="1"] .ui-primary-page-header :where(p, .page-description, .ac-subtitle, .hpc-page-subtitle) {
    max-width: 78rem;
    margin-top: .28rem;
    margin-bottom: 0;
    color: var(--ui-text-muted) !important;
    font-size: .88rem !important;
    line-height: 1.48 !important;
}

[data-hpc-ui-contract="1"] .ui-primary-page-header :where(.uppercase, [class*="tracking-"]) {
    letter-spacing: .045em;
}

[data-hpc-ui-contract="1"] .ui-page-header-actions,
[data-hpc-ui-contract="1"] .ui-action-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem !important;
    min-width: 0;
}

[data-hpc-ui-contract="1"] .ui-page-header-actions :where(a, button),
[data-hpc-ui-contract="1"] .ui-action-group :where(a, button) {
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
 | Legacy utility-card bridge
 * -------------------------------------------------------------------------- */

[data-hpc-ui-contract="1"] .hpc-page-container :where(
    .rounded,
    .rounded-lg,
    .rounded-xl,
    .rounded-2xl,
    .rounded-3xl
).bg-white {
    border-radius: var(--ui-radius-card) !important;
}

[data-hpc-ui-contract="1"] .hpc-page-container :where(
    .rounded-xl,
    .rounded-2xl,
    .rounded-3xl
).bg-white.border,
[data-hpc-ui-contract="1"] .hpc-page-container :where(
    .rounded-xl,
    .rounded-2xl,
    .rounded-3xl
).bg-white.shadow-sm {
    border-color: var(--ui-border) !important;
    box-shadow: var(--ui-shadow-xs) !important;
}

[data-hpc-ui-contract="1"] .hpc-page-container :where(
    .rounded-xl,
    .rounded-2xl,
    .rounded-3xl
).bg-slate-50 {
    border-color: var(--ui-border) !important;
    border-radius: var(--ui-radius-card) !important;
    background: var(--ui-surface-muted) !important;
}

[data-hpc-ui-contract="1"] .hpc-page-container :where(.p-6, .p-8, .px-8, .py-8).ui-legacy-panel,
[data-hpc-ui-contract="1"] .hpc-page-container .ui-primary-page-header:where(.p-6, .p-8) {
    padding: var(--ui-page-header-pad) !important;
}

[data-hpc-ui-contract="1"] :where(.ui-panel, .ui-section-card) {
    min-width: 0;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-card);
    background: var(--ui-surface);
    padding: var(--ui-panel-pad);
    box-shadow: var(--ui-shadow-xs);
}

[data-hpc-ui-contract="1"] .ui-section-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .8rem;
    border-bottom: 1px solid var(--ui-border);
    padding-bottom: .68rem;
}

[data-hpc-ui-contract="1"] .ui-section-card__header h2,
[data-hpc-ui-contract="1"] .ui-section-card__header h3 {
    margin: 0;
    color: var(--ui-text);
    font-size: var(--ui-section-title);
    font-weight: 820;
}

[data-hpc-ui-contract="1"] .ui-section-card__header p {
    margin: .22rem 0 0;
    color: var(--ui-text-muted);
    font-size: .82rem;
}

/* --------------------------------------------------------------------------
 | Forms, field groups, filters, and action bars
 * -------------------------------------------------------------------------- */

[data-hpc-ui-contract="1"] .hpc-page-container :where(label, .ac-field-label, .hpc-core-label, .as-label) {
    display: block;
    margin-bottom: .28rem;
    color: var(--ui-text);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .015em;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
}

[data-hpc-ui-contract="1"] .hpc-page-container :where(
    .text-xs.text-slate-500,
    .text-xs.text-slate-600,
    .as-helper,
    .ac-field-help,
    .hpc-field-help,
    small.form-text
) {
    color: var(--ui-text-muted) !important;
    font-size: .73rem !important;
    line-height: 1.42 !important;
}

[data-hpc-ui-contract="1"] .hpc-page-container :where(
    .text-red-600,
    .text-rose-600,
    .hpc-field-error,
    .invalid-feedback
) {
    color: var(--ui-danger) !important;
    font-size: .73rem;
    line-height: 1.4;
}

[data-hpc-ui-contract="1"] .ui-filter-region {
    min-width: 0;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-card) !important;
    background: var(--ui-surface) !important;
    padding: var(--ui-filter-pad) !important;
    box-shadow: var(--ui-shadow-xs) !important;
}

[data-hpc-ui-contract="1"] .ui-filter-region :where(.grid, .flex) {
    min-width: 0;
}

[data-hpc-ui-contract="1"] .ui-filter-region > :where(.grid, .flex),
[data-hpc-ui-contract="1"] .ui-filter-region form > :where(.grid, .flex) {
    gap: .65rem !important;
}

[data-hpc-ui-contract="1"] .ui-filter-region :where(input, select, .hpc-combobox, button, a) {
    min-width: 0;
}

[data-hpc-ui-contract="1"] .ui-form-region {
    min-width: 0;
}

[data-hpc-ui-contract="1"] .ui-form-region :where(.grid) {
    gap: .8rem !important;
}

[data-hpc-ui-contract="1"] .ui-form-region :where(.space-y-4, .space-y-5, .space-y-6) > * + * {
    margin-top: .9rem !important;
}

[data-hpc-ui-contract="1"] .ui-form-actions,
[data-hpc-ui-contract="1"] .ui-sticky-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    min-width: 0;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-card);
    background: rgba(255, 255, 255, .97);
    padding: .65rem .75rem;
    box-shadow: var(--ui-shadow-sm);
}

[data-hpc-ui-contract="1"] .ui-sticky-action-bar {
    position: sticky;
    bottom: .65rem;
    z-index: 35;
}

[data-hpc-ui-contract="1"] :where(.ui-form-actions, .ui-sticky-action-bar) > :where(.flex, .inline-flex) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem !important;
}

[data-hpc-ui-contract="1"] input[type="checkbox"],
[data-hpc-ui-contract="1"] input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--ui-primary);
}

[data-hpc-ui-contract="1"] input[type="file"] {
    min-height: var(--ui-control-height);
    padding: .38rem;
}

[data-hpc-ui-contract="1"] input[type="file"]::file-selector-button {
    min-height: 30px;
    margin-right: .55rem;
    border: 1px solid var(--ui-border-strong);
    border-radius: 7px;
    background: var(--ui-surface-muted);
    padding: .32rem .62rem;
    color: var(--ui-text);
    font-weight: 750;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
 | Tables and action-column governance
 * -------------------------------------------------------------------------- */

[data-hpc-ui-contract="1"] .ui-table-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-card);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-xs);
    scrollbar-width: thin;
}

[data-hpc-ui-contract="1"] table.ui-data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--ui-surface);
    color: var(--ui-text);
    font-size: .81rem;
}

[data-hpc-ui-contract="1"] table.ui-data-table th,
[data-hpc-ui-contract="1"] table.ui-data-table td {
    min-width: 0;
    border-bottom: 1px solid var(--ui-border);
    padding: .68rem .72rem !important;
    line-height: 1.38;
    text-align: left;
    vertical-align: middle;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

[data-hpc-ui-contract="1"] table.ui-data-table th {
    position: relative;
    background: var(--ui-table-head-bg);
    color: #30475d;
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: normal;
}

[data-hpc-ui-contract="1"] table.ui-data-table tbody tr:last-child td {
    border-bottom: 0;
}

[data-hpc-ui-contract="1"] table.ui-data-table tbody tr:hover td {
    background: var(--ui-table-hover);
}

[data-hpc-ui-contract="1"] table.ui-data-table tbody tr:is(.is-selected, [aria-selected="true"]) td {
    background: var(--ui-table-selected);
}

[data-hpc-ui-contract="1"] table.ui-data-table td > :where(strong, .font-semibold, .font-bold, .font-black) {
    color: var(--ui-text);
}

[data-hpc-ui-contract="1"] table.ui-data-table td > :where(small, .text-xs, .text-slate-500, .text-slate-600) {
    display: block;
    margin-top: .12rem;
    color: var(--ui-text-muted) !important;
    line-height: 1.35;
}

[data-hpc-ui-contract="1"] table.ui-data-table :where(th.ui-action-cell, td.ui-action-cell) {
    width: 1%;
    min-width: 160px;
    text-align: right;
    white-space: nowrap;
}

[data-hpc-ui-contract="1"] table.ui-data-table td.ui-action-cell > :where(
    .flex,
    .inline-flex,
    .grid,
    .space-y-1,
    .space-y-2,
    .as-actions,
    .ac-actions,
    .row-actions
) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .35rem !important;
    margin: 0 !important;
}

[data-hpc-ui-contract="1"] table.ui-data-table td.ui-action-cell :where(a, button) {
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    white-space: nowrap;
}

[data-hpc-ui-contract="1"] table.ui-data-table :where(.rounded-full, .badge, .as-badge, .hpc-ui-badge) {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
 | Disclosure panels, tabs, pagination, alerts, and empty states
 * -------------------------------------------------------------------------- */

[data-hpc-ui-contract="1"] details.ui-disclosure {
    min-width: 0;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-card);
    background: var(--ui-surface-muted);
    overflow: clip;
}

[data-hpc-ui-contract="1"] details.ui-disclosure > summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 40px;
    padding: .58rem .78rem;
    color: var(--ui-text);
    font-size: .8rem;
    font-weight: 780;
    cursor: pointer;
    list-style: none;
}

[data-hpc-ui-contract="1"] details.ui-disclosure > summary::-webkit-details-marker {
    display: none;
}

[data-hpc-ui-contract="1"] details.ui-disclosure > summary::before {
    content: "";
    width: .46rem;
    height: .46rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .15s ease;
}

[data-hpc-ui-contract="1"] details.ui-disclosure[open] > summary::before {
    transform: rotate(45deg);
}

[data-hpc-ui-contract="1"] details.ui-disclosure[open] > summary {
    border-bottom: 1px solid var(--ui-border);
    background: var(--ui-surface);
}

[data-hpc-ui-contract="1"] details.ui-disclosure > :not(summary) {
    padding: .78rem;
}

[data-hpc-ui-contract="1"] :where(.ui-empty-state, .empty-state, .ac-empty, .as-empty) {
    display: grid;
    min-height: 150px;
    place-items: center;
    gap: .35rem;
    border: 1px dashed var(--ui-border-strong);
    border-radius: var(--ui-radius-card) !important;
    background: var(--ui-surface-subtle);
    padding: 1.2rem;
    color: var(--ui-text-muted);
    text-align: center;
}

[data-hpc-ui-contract="1"] :where(.ui-empty-state, .empty-state, .ac-empty, .as-empty) :where(h2, h3, strong) {
    margin: 0;
    color: var(--ui-text);
}

[data-hpc-ui-contract="1"] :where(.ui-alert, .alert, .ac-alert, .as-alert) {
    min-width: 0;
    border-radius: var(--ui-radius-card) !important;
    padding: .72rem .82rem;
    line-height: 1.45;
}

[data-hpc-ui-contract="1"] :where(.alert-success, .ui-alert-success) {
    border-color: #b8e8ca !important;
    background: var(--ui-success-soft) !important;
    color: #126734 !important;
}

[data-hpc-ui-contract="1"] :where(.alert-warning, .ui-alert-warning) {
    border-color: #f1d593 !important;
    background: var(--ui-warning-soft) !important;
    color: #815000 !important;
}

[data-hpc-ui-contract="1"] :where(.alert-danger, .alert-error, .ui-alert-danger) {
    border-color: #efc0bc !important;
    background: var(--ui-danger-soft) !important;
    color: #8f241d !important;
}

[data-hpc-ui-contract="1"] :where(.alert-info, .ui-alert-info) {
    border-color: #bee0ed !important;
    background: var(--ui-info-soft) !important;
    color: #165b77 !important;
}

[data-hpc-ui-contract="1"] :where(nav[aria-label*="Pagination"], .pagination, .hpc-pagination) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    min-width: 0;
}

[data-hpc-ui-contract="1"] :where(.pagination, .hpc-pagination) :where(a, button, span) {
    min-width: 34px;
    min-height: 34px;
    border-radius: 8px !important;
}

/* --------------------------------------------------------------------------
 | Modal, dialog, dashboard, and builder consistency
 * -------------------------------------------------------------------------- */

[data-hpc-ui-contract="1"] :where(dialog, [role="dialog"], .hpc-modal-panel, .modal-content) {
    border-radius: var(--ui-radius-modal) !important;
}

[data-hpc-ui-contract="1"] :where(.ui-modal-header, .hpc-modal-header, .modal-header) {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .7rem;
    border-bottom: 1px solid var(--ui-border);
    padding-bottom: .7rem;
}

[data-hpc-ui-contract="1"] :where(.ui-modal-footer, .hpc-modal-footer, .modal-footer) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
    border-top: 1px solid var(--ui-border);
    padding-top: .7rem;
}

[data-hpc-ui-contract="1"] :where(.ui-stat-grid, .ac-stat-grid, .as-stat-grid, .dashboard-grid) {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    min-width: 0;
}

[data-hpc-ui-contract="1"] :where(.ui-stat-card, .ac-stat-card, .as-stat-card) {
    min-width: 0;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-card) !important;
    background: var(--ui-surface);
    padding: .78rem;
    box-shadow: var(--ui-shadow-xs);
}

[data-hpc-ui-contract="1"] :where(.ui-stat-card, .ac-stat-card, .as-stat-card) :where(.text-3xl, .text-4xl) {
    font-size: 1.55rem !important;
    line-height: 1.1 !important;
}

[data-hpc-ui-contract="1"] :where(.ui-builder-shell, .builder-shell, .report-builder-shell, .form-builder-shell) {
    min-width: 0;
}

[data-hpc-ui-contract="1"] :where(.ui-builder-sidebar, .builder-sidebar, .report-builder-sidebar) {
    min-width: 0;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-card) !important;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-xs);
}

[data-hpc-ui-contract="1"] :where(.ui-builder-canvas, .builder-canvas, .report-builder-canvas) {
    min-width: 0;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-card) !important;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-xs);
}

/* --------------------------------------------------------------------------
 | Rich content and technical values
 * -------------------------------------------------------------------------- */

[data-hpc-ui-contract="1"] :where(.prose, .ql-editor, .hpc-richtext-editor, [data-richtext-editor]) {
    color: var(--ui-text);
    line-height: 1.58;
    word-break: normal;
    overflow-wrap: break-word;
}

[data-hpc-ui-contract="1"] :where(.prose, .ql-editor, .hpc-richtext-editor, [data-richtext-editor]) :where(p, ul, ol, blockquote) {
    margin-block: .5rem;
}

[data-hpc-ui-contract="1"] :where(.prose, .ql-editor, .hpc-richtext-editor, [data-richtext-editor]) :where(h1, h2, h3) {
    margin-top: .85rem;
    margin-bottom: .4rem;
}

[data-hpc-ui-contract="1"] :where(.font-mono, code, pre, [data-technical-value]) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* --------------------------------------------------------------------------
 | Public/authenticated shared responsive behavior
 * -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
    [data-hpc-ui-contract="1"] :where(.ui-stat-grid, .ac-stat-grid, .as-stat-grid, .dashboard-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    [data-hpc-ui-contract="1"] .ui-primary-page-header {
        padding: .9rem !important;
    }
}

@media (max-width: 900px) {
    [data-hpc-ui-contract="1"] .ui-primary-page-header :where(.flex, .lg\:flex-row) {
        align-items: stretch;
    }

    [data-hpc-ui-contract="1"] .ui-page-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    [data-hpc-ui-contract="1"] .ui-filter-region :where(.grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    [data-hpc-ui-contract="1"] .ui-sticky-action-bar {
        bottom: .4rem;
    }
}

@media (max-width: 680px) {
    [data-hpc-ui-contract="1"] .hpc-page-container {
        padding-inline: 10px;
    }

    [data-hpc-ui-contract="1"] .ui-primary-page-heading {
        font-size: 1.3rem !important;
    }

    [data-hpc-ui-contract="1"] .ui-primary-page-header,
    [data-hpc-ui-contract="1"] :where(.ui-panel, .ui-section-card, .ui-filter-region) {
        border-radius: 9px !important;
        padding: .75rem !important;
    }

    [data-hpc-ui-contract="1"] .ui-filter-region :where(.grid) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    [data-hpc-ui-contract="1"] :where(.ui-stat-grid, .ac-stat-grid, .as-stat-grid, .dashboard-grid) {
        grid-template-columns: minmax(0, 1fr);
    }

    [data-hpc-ui-contract="1"] table.ui-data-table :where(th.ui-action-cell, td.ui-action-cell) {
        min-width: 190px;
        text-align: left;
    }

    [data-hpc-ui-contract="1"] table.ui-data-table td.ui-action-cell > :where(
        .flex,
        .inline-flex,
        .grid,
        .space-y-1,
        .space-y-2,
        .as-actions,
        .ac-actions,
        .row-actions
    ) {
        justify-content: flex-start !important;
    }

    [data-hpc-ui-contract="1"] :where(.ui-form-actions, .ui-sticky-action-bar) {
        align-items: stretch;
    }

    [data-hpc-ui-contract="1"] :where(.ui-form-actions, .ui-sticky-action-bar) > :where(.flex, .inline-flex) {
        width: 100%;
    }
}

@media print {
    [data-hpc-ui-contract="1"] :where(
        .hpc-sidebar,
        .hpc-topbar,
        .hpc-workspace-bar,
        .hpc-footer,
        .ui-page-header-actions,
        .ui-form-actions,
        .ui-sticky-action-bar,
        .hpc-toast-region
    ) {
        display: none !important;
    }

    [data-hpc-ui-contract="1"] .hpc-app-main,
    [data-hpc-ui-contract="1"] .hpc-main-content,
    [data-hpc-ui-contract="1"] .hpc-page-container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    [data-hpc-ui-contract="1"] :where(.ui-primary-page-header, .ui-panel, .ui-section-card, .ui-table-scroll) {
        box-shadow: none !important;
    }
}


/* --------------------------------------------------------------------------
 | Table action wrapping integrity
 * -------------------------------------------------------------------------- */

[data-hpc-ui-contract="1"] table.ui-data-table :where(th.ui-action-cell, td.ui-action-cell) {
    width: auto !important;
    min-width: 250px;
    max-width: 460px;
    white-space: normal !important;
    vertical-align: top;
}

[data-hpc-ui-contract="1"] table.ui-data-table td.ui-action-cell > :where(
    .ui-row-actions,
    .flex,
    .inline-flex,
    .grid,
    .as-actions,
    .ac-actions,
    .row-actions
) {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center;
    justify-content: flex-end !important;
    gap: .42rem !important;
    inline-size: clamp(250px, 28vw, 440px);
    max-inline-size: 100%;
    white-space: normal !important;
}

[data-hpc-ui-contract="1"] table.ui-data-table td.ui-action-cell.ui-row-actions {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .42rem;
}

[data-hpc-ui-contract="1"] table.ui-data-table td.ui-action-cell :where(a, button, [role="button"]) {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: nowrap;
}

@media (max-width: 900px) {
    [data-hpc-ui-contract="1"] table.ui-data-table :where(th.ui-action-cell, td.ui-action-cell) {
        min-width: 230px;
        max-width: 360px;
    }

    [data-hpc-ui-contract="1"] table.ui-data-table td.ui-action-cell > :where(
        .ui-row-actions,
        .flex,
        .inline-flex,
        .grid,
        .as-actions,
        .ac-actions,
        .row-actions
    ) {
        inline-size: clamp(230px, 42vw, 340px);
    }
}
