/* Screen-only report filter density; printed document layout is untouched. */
@media screen {
    .erp-report-compact { --erp-report-gap: .5rem; }
    .erp-report-compact > .report-no-print + .report-no-print,
    .erp-report-compact > .report-no-print + :not(.report-no-print) { margin-block-start: .5rem; }
    .erp-report-compact .report-no-print:has([data-flux-field], [data-flux-checkbox-group], [data-flux-select], input, select) {
        row-gap: .5rem;
    }
    .erp-report-compact .report-no-print .grid:not(:where(dialog *, [data-flux-modal] *)),
    .erp-report-filter-grid {
        gap: .375rem .625rem !important;
        align-items: end;
    }
    .erp-report-compact .report-no-print .grid > *,
    .erp-report-filter-grid > * { min-width: 0; }
    .erp-report-compact .report-no-print .grid > [data-flux-field],
    .erp-report-filter-grid > [data-flux-field] { align-self: end; }
    .erp-report-compact .report-no-print [data-flux-field],
    .erp-report-filter-grid [data-flux-field] { gap: .125rem !important; }
    .erp-report-compact .report-no-print [data-flux-label],
    .erp-report-filter-grid [data-flux-label] { margin-bottom: .125rem !important; }
    .erp-report-compact .report-no-print :is(.p-4,.p-5,.p-6):not(:where(dialog *, [data-flux-modal] *)) { padding: .5rem !important; }
    .erp-report-compact .report-no-print :is(.py-3,.py-4,.py-2\.5):not(:where(dialog *, [data-flux-modal] *)) { padding-block: .375rem !important; }
    .erp-report-pill-list {
        max-height: 4.5rem;
        overflow-y: auto;
        align-content: flex-start;
        gap: .25rem !important;
        scrollbar-width: thin;
    }
    .erp-order-report-filters { display: grid; gap: .5rem; }
    .erp-order-report-grid, .erp-order-date-grid {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: .375rem .625rem;
        align-items: end;
    }
    .erp-order-report-grid > *, .erp-order-date-grid > * { min-width: 0; }
    .erp-order-date-grid > div:last-child > button { width: 100%; }
    .erp-report-style-field > [data-flux-heading] { margin-bottom: .125rem; }
    .erp-report-style-picker { position: relative; }
    .erp-report-style-picker summary {
        cursor: pointer;
        border: 1px solid var(--color-zinc-300, #d4d4d8);
        border-radius: .375rem;
        padding: .375rem .5rem;
        min-height: 1.875rem;
        font-size: .75rem;
        line-height: 1rem;
        background: var(--color-white, #fff);
    }
    .dark .erp-report-style-picker summary { background: var(--color-zinc-800, #27272a); border-color: var(--color-zinc-600, #52525b); }
    .erp-report-style-picker[open] .erp-report-style-options {
        padding: .5rem;
        margin-top: .25rem;
        border: 1px solid var(--color-zinc-300, #d4d4d8);
        border-radius: .375rem;
        background: var(--color-white, #fff);
    }
    .dark .erp-report-style-picker[open] .erp-report-style-options { background: var(--color-zinc-800, #27272a); border-color: var(--color-zinc-600, #52525b); }
    .erp-report-style-options .erp-report-pill-list { max-height: 10rem; margin-bottom: .375rem; }
    @media (min-width: 768px) {
        .erp-order-report-grid, .erp-order-date-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
    }
    @media (min-width: 1280px) {
        .erp-order-report-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
        .erp-order-date-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
    }
}
@media screen {
    .erp-report-compact .report-no-print.grid { gap: .375rem .625rem !important; align-items: end; }
    .erp-report-compact .report-no-print :is(.space-y-3,.space-y-4,.space-y-5,.space-y-6):not(:where(dialog *, [data-flux-modal] *)) > :not([hidden]) ~ :not([hidden]) {
        margin-block-start: .5rem !important;
        margin-block-end: 0 !important;
    }
    .erp-report-compact .report-no-print :is(.mt-3,.mt-4,.mt-5):not(:where(dialog *, [data-flux-modal] *)) { margin-top: .5rem !important; }
    .erp-report-compact .report-no-print :is(.p-3):not(:where(dialog *, [data-flux-modal] *)) { padding: .5rem !important; }
}

/* Remaining standalone PPC/DC criteria cards. No changes to generated tables. */
@media screen {
    .erp-report-filter-card { padding: .625rem !important; }
    .erp-report-filter-card .grid { gap: .375rem .625rem !important; align-items: end; }
    .erp-report-filter-card .grid > * { min-width: 0; }
    .erp-report-filter-card [data-flux-field] { gap: .125rem !important; }
    .erp-report-filter-card :is(.p-3,.p-4,.p-5) { padding: .5rem !important; }
    .erp-report-filter-card :is(.py-3,.py-4,.py-2\.5) { padding-block: .375rem !important; }
    .erp-report-filter-card > :not([hidden]) ~ :not([hidden]) { margin-block-start: .5rem !important; margin-block-end: 0 !important; }
    .erp-report-compact :is(.erp-order-report-grid,.erp-order-date-grid) { grid-auto-rows: min-content; }
    .erp-order-report-grid .erp-report-style-field { align-self: end; }
    .erp-report-style-picker[open] .erp-report-style-options {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}

/* Compact T & A report context and action rows. */
@media screen {
    .erp-report-compact .erp-ta-context {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: .25rem 1rem;
        font-size: .75rem;
        line-height: 1.25rem;
        padding: .25rem .5rem;
        border-radius: .375rem;
        background: color-mix(in srgb, currentColor 5%, transparent);
    }
    .erp-report-compact .erp-ta-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .375rem .75rem;
    }
}
