/* ============================================================
   SHIFTSIMPLE — PRINT (styles/print.css)
   ============================================================
   Print isolation for the customer's Simple Deal receipt and the admin
   Dealer Deal Sheet: everything else is hidden, blocks never split across
   pages. Global on purpose — the rules are inert until the user prints. */
  /* ---- Print — Page 2 (customer receipt) and the admin lead print record
  share the same isolation technique: on-screen navigation/actions never
  belong on a printed page, sections must stay readable, and cards must
  never split awkwardly across a page break. ---- */
  @media print{
    @page{ size: letter; margin: 0.35in 0.45in; }
    body *{visibility:hidden;}
    .sd-receipt, .sd-receipt *, .lead-print-receipt, .lead-print-receipt *{visibility:visible;}
    .sd-receipt{position:absolute;left:0;top:0;width:100%;max-width:none;padding:0 24px;}
    /* !important is required here: the base .lead-print-receipt{display:none}
    rule below (which keeps this element off-screen the rest of the time)
    comes later in the stylesheet than this @media print block, so without
    !important it would win the cascade during printing too — visibility
    alone can't undo display:none, which is exactly why Print/Save as PDF
    used to produce a blank page. Preserved exactly as fixed (commit 23cc55f)
    — the dealer print report below only changed what renders INSIDE this
    element, never how it's made visible. */
    /* Every declaration here needs !important, not just display: the
    non-media .lead-print-receipt{...} base rule (below, later in the
    stylesheet) sets position:relative and no width/padding, and — being
    later — silently wins the cascade over any of these non-!important
    print-only declarations too, the same reason display needed it. */
    /* Scoped to html.printing-lead-sheet (set by printLeadRecord() for the
    duration of its print): outside an admin sheet print this container must
    stay display:none, or its empty box — and its gold "/" watermark — is all
    a customer's Print produces. */
    html.printing-lead-sheet .lead-print-receipt{position:absolute !important;left:0 !important;top:0 !important;width:100% !important;max-width:none !important;padding:0 !important;display:block !important;}
    .no-print{display:none !important;}
    /* visibility:hidden (above) hides everything visually but — unlike
    display:none — leaves its layout height intact, so the surrounding
    admin chrome (nav, footer, the leads list/filters, the on-screen lead
    detail sections) was still contributing real page height and producing
    extra blank pages after the actual print content. These rules remove
    that residual flow height with display:none so a normal Full Lead
    report fits the required single page; the display:block !important
    rule above (the actual blank-page fix) is untouched. */
    nav, footer{display:none !important;}
    html.printing-lead-sheet #view-admin-leads > .wrap > *:not(.lead-print-receipt){display:none !important;}
    .sd-receipt .card, .sd-receipt .results-big, .sd-avoid-break, .sd-match-card{
      break-inside:avoid;page-break-inside:avoid;border:1px solid #ccc;background:#fff !important;color:#111 !important;
    }
    .sd-receipt .results-big{background:#fff !important;border:2px solid var(--pine);}
    .sd-receipt .results-big *, .sd-receipt .eyebrow{color:#111 !important;}
    .sd-receipt .amt-big{color:#111 !important;}
    .lead-print-receipt .dpr-section{break-inside:avoid;page-break-inside:avoid;}
    .lead-print-receipt, .lead-print-receipt *{-webkit-print-color-adjust:exact;print-color-adjust:exact;color-adjust:exact;}
    a[href]::after{content:'';}
    /* ONE Letter page for the Dealer Deal Sheet: nothing outside the sheet
    may contribute flow height (a hidden view, a helper overlay, a fixed
    button or the theme picker each used to leave an empty trailing page),
    the sheet itself never forces a break after it, and its blocks stay
    whole. Font sizes are untouched — this is spacing and flow only. */
    html, body{height:auto !important;min-height:0 !important;overflow:visible !important;}
    /* Since the on-demand domains refactor (0fc45cc) the admin views live
    inside the shell's #portal-views host, not directly under the body: the
    host must stay laid out and only its OTHER views are removed, or the
    body-level rule hides the host — and the whole sheet with it (a blank
    printed page). */
    html.printing-lead-sheet body > *:not(#view-admin-leads):not(#portal-views){display:none !important;}
    html.printing-lead-sheet #portal-views{display:block !important;}
    html.printing-lead-sheet #portal-views > *:not(#view-admin-leads){display:none !important;}
    html.printing-lead-sheet #view-admin-leads{display:block !important;}
    /* The dealer portal prints the SAME canonical sheet for one of its own
    delivered leads (printDealerLead(), src/dealer/dealer.js) with
    html.printing-dealer-sheet set: the same isolation, scoped to the
    dealer view's own #dealer-lead-print-receipt. */
    html.printing-dealer-sheet .lead-print-receipt{position:absolute !important;left:0 !important;top:0 !important;width:100% !important;max-width:none !important;padding:0 !important;display:block !important;}
    html.printing-dealer-sheet body > *:not(#portal-views){display:none !important;}
    html.printing-dealer-sheet #portal-views{display:block !important;}
    html.printing-dealer-sheet #portal-views > *:not(#view-dealers){display:none !important;}
    html.printing-dealer-sheet #view-dealers{display:block !important;}
    html.printing-dealer-sheet #view-dealers > .wrap > *:not(#dealer-lead-print-receipt){display:none !important;}
    .shift-helper-slot, .shift-helper, .theme-fab, .lang-fab, #theme-picker-backdrop, .nav-avatar, iframe{display:none !important;}
    #ss-test-mode-badge{display:none !important;}
    /* The customer's own printable document (PRINT MY SIMPLE DEAL / Print /
    Save): printCustomerReceipt() renders it into #customer-print-doc and
    prints THIS page with html.printing-customer-doc set — the same
    in-document isolation the admin sheet uses, never a hidden iframe. */
    html.printing-customer-doc body > *:not(#customer-print-doc){display:none !important;}
    html.printing-customer-doc #customer-print-doc{display:block !important;position:static !important;visibility:visible !important;}
    html.printing-customer-doc #customer-print-doc *{visibility:visible !important;}
    .lead-print-receipt{break-after:auto;page-break-after:auto;break-before:avoid;page-break-before:avoid;}
    .lead-print-receipt .dpr-keynums, .lead-print-receipt .dpr-facts-grid, .lead-print-receipt .dpr-grid2, .lead-print-receipt .dpr-ops, .lead-print-receipt .dpr-disclaimer, .lead-print-receipt table.dpr-table, .lead-print-receipt .dpe-list{break-inside:avoid;page-break-inside:avoid;}
    .lead-print-receipt .dpr-h, .lead-print-receipt .dpr-explain-h{break-after:avoid;page-break-after:avoid;}
  }
