@media print {
  /* ──────────────────────────────────────────────────────────────
     Proven cover page – unchanged & stable
  ─────────────────────────────────────────────────────────────── */
  body::before {
    content: "TrafficTorch.net ⚖️\A\A Local SEO Audit Tool 📝\A\A Report:\A " attr(data-url);
    display: block;
    height: 100vh;
    min-height: 100vh;
    page-break-after: always;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #4b5563;
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 900;
    text-align: center;
    padding-top: 20vh;
    line-height: 1.4;
    white-space: pre;
    font-size: 3.5rem;
    text-shadow:
      -2px -2px 0 #fb923c,
      2px -2px 0 #fb923c,
      -2px 2px 0 #fb923c,
      2px 2px 0 #fb923c,
      -2px 0 0 #fb923c,
      2px 0 0 #fb923c,
      0 -2px 0 #fb923c,
      0 2px 0 #fb923c,
      0 10px 30px rgba(0,0,0,0.5);
  }

  /* Report starts cleanly on next page */
  #results-wrapper {
    page-break-before: always;
    margin-top: 0 !important;
  }

  /* Full-width content inside results */
  #results-wrapper,
  #results-wrapper .container,
  #results-wrapper .max-w-*,
  #results-wrapper .mx-auto {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 1cm 1.2cm !important;
    box-sizing: border-box;
  }

  /* Prevent ugly page breaks inside modules */
  .score-card,
  .fixes-panel,
  .full-details,
  section > div,
  .grid,
  .flex {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Better text flow */
  p, li, div {
    orphans: 3;
    widows: 3;
  }

  /* Print safety basics */
  body {
    background: white !important;
    color: black !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 11pt;
  }

  /* Clean print – no shadows */
  .shadow-lg,
  .shadow-xl,
  [class*="shadow"] {
    box-shadow: none !important;
  }

  /* ──────────────────────────────────────────────────────────────
     TARGETED HIDING – safe & specific for ALL tools (no :not breakage)
  ─────────────────────────────────────────────────────────────── */
  .max-w-4xl.mx-auto.my-16 details,               /* how/why accordions */
  .max-w-4xl.mx-auto.my-20 details,
  section.py-20.bg-gray-50.dark\:bg-gray-900,     /* deep dive modules */
  section.py-16.px-3.max-w-6xl.mx-auto,           /* checklists */
  section.py-16.px-1.max-w-6xl.mx-auto,
  #seo-ux-checklist,
  #quit-risk-seo-checklist,
  #keyword-gap-checklist,
  #ai-audit-seo-checklist,
  #ai-search-seo-checklist,
  .tools-grid,
  section.max-w-5xl.mx-auto.my-24,                /* author bios */
  section.max-w-4xl.mx-auto.my-20,
  div[style*="display: flex; justify-content: center; margin: 30px 0;"],  /* share */
  .a2a_kit,
  div.max-w-5xl.mx-auto.px-6.py-4.text-center,    /* breadcrumbs */
  section.bottom-banner,
  .checklist-card,
  .max-w-7xl.mx-auto,
  .max-w-6xl.mx-auto {
    display: none !important;
  }

  /* Extra safety: hide top-level details not in report */
  details:not(.fixes-panel details, .full-details details) {
    display: none !important;
  }

  /* ──────────────────────────────────────────────────────────────
     Always show important report content
  ─────────────────────────────────────────────────────────────── */
  .fixes-panel,
  .full-details,
  .expand-content,
  .hidden.mt-4,
  .hidden.mt-6,
  .hidden.mt-8 {
    display: block !important;
  }

  /* Original form/header/footer hiding */
  #keyword-form,
  #analysis-progress,
  header,
  footer,
  nav,
  aside,
  .no-print,
  button,
  details > summary {
    display: none !important;
  }
  
/* Hide promotional / educational blocks via unique IDs – safe from JS class changes */
#author-bio,
#promo-high-impact-cards,
#promo-old-vs-modern-seo {
  display: none !important;
}
}