﻿@media print {
    /* Print only the active module. Its container is tagged .pl-focused-module
       (see PlModule.FocusCssClass). Remove from layout every element that is
       neither the module, one of its descendants, nor one of its ancestors.
       Using display:none (not visibility:hidden) reclaims the space, so the
       module renders at the page origin with no gap from the hidden chrome. */
    body *:not(.pl-focused-module):not(.pl-focused-module *):not(:has(.pl-focused-module)) {
        display: none !important;
    }

    /* The module's action bar and in-content controls are UI, not content. */
    .pl-focused-module .pl-action-bar,
    .mud-button,
    .pl-bottom-docked-button,
    .pl-right-docked-button,
    .pl-popover-icon,
    .pl-collapse-expand,
    .pl-sort-icon {
        display: none !important;
    }

    .pl-module-container {
        overflow-y: visible !important;
    }

    [class*="pl-symbol-"].pl-print-borderless {
        border: none !important;
    }

    .title {
        font-weight: 700 !important;
    }

    @page {
        size: letter;
    }

    /* Add these new rules */
    html, body {
        height: auto !important;
        overflow: visible !important;
        width: 100% !important;
    }

    * {
        overflow: visible !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    .pl-datafield-block {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        position: relative !important;
        display: block !important;
        overflow: visible !important;
        height: auto !important;
    }
}
