/* Marco de escritorio. Los paneles largos conservan su propio desplazamiento.
   En móvil o ventanas muy bajas se vuelve al flujo normal, sin recortar datos. */
@media (min-width: 861px) and (min-height: 700px) {
    .portal-theme .app-main {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        display: grid;
        grid-template-rows: auto auto minmax(0, 1fr) auto;
    }
    .portal-theme .app-content {min-height: 0; overflow: auto;}
    .portal-theme .app-content:has([data-stage="receipts"]:not([hidden])) {padding-bottom: var(--receipts-bottom-space);}
    .portal-theme .app-content:has([data-stage="checkout"]:not([hidden])) {padding-bottom: 0;}
    .portal-theme #policyJourney {height: 100%; min-height: 0; display: flex; flex-direction: column;}
    .portal-theme #policyJourney > .payment-steps {flex: 0 0 auto;}
    .portal-theme #policyJourney > [data-stage] {flex: 1 1 auto; min-height: 0;}
    .portal-theme #policyJourney > .ui-scroll-region {overflow: auto;}
    .portal-theme [data-stage="receipts"] .results-card {height: 100%; min-height: 0; display: flex; flex-direction: column;}
    .portal-theme [data-stage="receipts"] .results-card__head,
    .portal-theme [data-stage="receipts"] .receipt-payment-toolbar {flex: 0 0 auto;}
    .portal-theme [data-stage="receipts"] .policy-results-table-wrap {flex: 1 1 auto; min-height: 0; max-height: var(--receipt-table-height); overflow: auto;}
    .portal-theme [data-stage="receipts"] .policy-results-table thead {position: sticky; top: 0; z-index: 1; background: var(--color-bg);}
    .portal-theme [data-stage="checkout"] .checkout-grid {height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch;}
    .portal-theme [data-stage="checkout"] .checkout-panel {
        overflow: auto;
        padding-inline-end: var(--checkout-scroll-gap);
        padding-bottom: var(--space-4);
        scrollbar-gutter: stable;
        scrollbar-color: var(--brand-primary) transparent;
    }
    .portal-theme .app-footer {margin-top: 0;}
}
