@media print {
    :root {
        color: #000;
    }

    @page {
        margin: 0.5in 0.6in;
    }

    *,
    *::before,
    *::after {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    html,
    body {
        background: #fff !important;
        font-family: "Georgia", "Times New Roman", serif;
        font-size: 11pt;
        line-height: 1.4;
        color: #000;
        height: auto;
    }

    /* Hide UI and non-print elements */
    #ppHeader,
    #geFooter,
    #left,
    #menu,
    nav,
    .g-recaptcha,
    .validation-summary-errors,
    .field-validation-error,
    .print-hide {
        display: none !important;
    }

    /* Main layout containers */
    #unit-content,
    #right,
    #layout,
    #main {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Let the form flow across pages (no giant unbreakable box) */
    form.gov-form {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-before: auto !important;
        page-break-after: auto !important;
        page-break-inside: auto !important;
        break-inside: auto;
    }

    /* Typography */
    h1 {
        font-size: 20pt;
        margin: 0 0 10pt;
        text-align: center;
        letter-spacing: 0.4pt;
        page-break-after: avoid;
        page-break-inside: avoid;
        break-after: avoid-page;
        break-inside: avoid-page;
    }

    h2,
    h3,
    h4 {
        margin: 12pt 0 8pt;
        page-break-after: avoid;
        break-after: avoid-page;
    }

    p,
    label,
    .form-text,
    .form-check-label,
    .text-muted {
        color: #000 !important;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

        a[href]::after {
            content: " (" attr(href) ")";
            font-size: 9pt;
        }

    hr {
        border: 0;
        border-top: 1px solid #000;
        margin: 10pt 0;
    }

    /* Cards and containers */
    .card {
        background: #fff !important;
        border: 1px solid #000;
        box-shadow: none !important;
        border-radius: 0;
        margin-top: 0 !important;
        /* Allow cards to break if they are tall */
        page-break-inside: auto;
        break-inside: auto;
    }

    .card-body {
        padding: 12pt 16pt !important;
    }

    /* Form controls */
    .row {
        margin-bottom: 6pt;
    }

    /* Keep a single row together on one page if possible */
    form.gov-form .row {
        page-break-inside: avoid;
        break-inside: avoid-page;
    }

    .form-label,
    label {
        font-weight: 700;
        margin-bottom: 3pt;
    }

    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        padding: 6pt 8pt;
        min-height: 28pt;
    }

    textarea {
        border: 1px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }

    .form-check {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6pt;
        /* Try to keep checkbox + label together */
        page-break-inside: avoid;
        break-inside: avoid-page;
    }

    .form-check-input {
        width: 14px;
        height: 14px;
        margin-top: 0;
        border: 1px solid #000;
        background: #fff;
    }

        .form-check-input:checked {
            background: #000;
            box-shadow: inset 0 0 0 2px #fff;
        }

    .form-check-label {
        font-weight: 600;
    }

    /* Optional: hide form buttons on print */
    button,
    .btn {
        display: none !important;
    }

    /* Helper for explicit manual breaks if you add them in markup */
    .page-break {
        page-break-before: always;
        break-before: page;
    }
}
