@media print {
  /* ──────────────────────────────────────────────────────────────
     Proven cover page – unchanged & stable
  ─────────────────────────────────────────────────────────────── */
  body::before {
    content: "TrafficTorch.net ⚖️\A\A SEO UX 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: 2.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 (no :not breakage)
  ─────────────────────────────────────────────────────────────── */
  .max-w-4xl.mx-auto.my-20 details,               /* how/why accordions */
  section.py-20.bg-gray-50.dark\:bg-gray-900,     /* deep dive modules */
  #seo-ux-checklist,                              /* SEO & UX checklist */
  .tools-grid,
  section.max-w-5xl.mx-auto.my-24,                /* author bio */
  div[style*="display: flex; justify-content: center; margin: 30px 0;"],  /* share blocks */
  .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;
  }
  
  /* Hide upgrade modal and share section in print */
  #upgradeModal,
  .py-8.text-center,
  .a2a_kit,
  .a2a_default_style,
  .a2a_kit_size_32,
  [class*="a2a_"] {
    display: none !important;
  }

  /* Extra insurance for modal visibility tricks */
  #upgradeModal[style*="display: block"],
  #upgradeModal:not(.hidden) {
    display: none !important;
  }

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

/* Only force-show report-related hidden elements, not promo */
.fixes-panel,
.full-details,
.expand-content,
.score-card .hidden.mt-6,
.score-card .hidden.mt-4,
#priority-gains-section .hidden,
#priority-cards-container .hidden {
  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 + share/feedback + AI Content Audit explanation section */
#author-bio,
#promo-high-impact-cards,
#promo-old-vs-modern-seo,
#share-form-container,
#feedback-form-container,
#share-message,
#feedback-message,
#share-report-btn ~ div[id*="form"],
#feedback-btn ~ div[id*="form"],
.max-w-4xl.mx-auto.mt-12.mb-12.px-4.sm\:px-6.lg\:px-8,  /* the entire What is Modern SEO section */
.max-w-4xl.mx-auto.mt-12.mb-12.px-4.sm\:px-6.lg\:px-8 h2,  /* title */
.max-w-4xl.mx-auto.mt-12.mb-12.px-4.sm\:px-6.lg\:px-8 p,     /* paragraphs */
.max-w-4xl.mx-auto.mt-12.mb-12.px-4.sm\:px-6.lg\:px-8 div.text-xl.leading-relaxed.text-center {
  display: none !important;
}

/* Force-hide entire Plugin Solutions section in print — it's promo only */
#plugin-solutions-section,
#plugin-solutions-section * {
  display: none !important;
}

/* Extra targeted kill-switch for the specific promo paragraphs (in case section shows partially) */
#plugin-solutions-section p:text-contains("critical areas need improvement"),
#plugin-solutions-section p:text-contains("Check your theme or template"),
#plugin-solutions-section p:text-contains("All recommendations are current"),
#plugin-solutions-section h2:text-contains("Plugin Solutions"),
#plugin-solutions-section div.gradient-to-r,
#plugin-solutions-section .text-center.text-lg,
#plugin-solutions-section .text-center.text-xl,
#plugin-solutions-section .text-center.text-sm.text-gray-500,
#plugin-solutions-section .text-center.text-sm.dark\:text-gray-400 {
  display: none !important;
}


/* EACH MODULE ON ITS OWN NEW PAGE (no more squashing) */
.max-w-5xl.mx-auto.my-16,            /* Radar Chart */
.space-y-8 > div,                    
  page-break-before: always !important;
  break-before: page !important;
}

/* Keep important content together but never split cards */
.score-card,
.metric-card,
.bg-white.dark\:bg-gray-800.rounded-2xl,
.bg-orange-50.dark\:bg-orange-900\/20 {
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}

/* ──────────────────────────────────────────────────────────────
   Firefox grid + page-break fix: force stack + reliable breaks
─────────────────────────────────────────────────────────────── */

/* In print: override grid → make cards full-width stack (column) */
#results.grid {
  display: block !important;           /* or flex; block is safest */
  column-count: 1 !important;
}

/* Ensure each card behaves as a block-level full-page unit */
#results .score-card {
  display: block !important;
  width: 100% !important;
  min-height: 95vh !important;         /* fills most of page, prevents tiny remnants */
  margin: 1cm 0 0 0 !important;        /* top margin for breathing room */
  padding: 1cm 0.8cm !important;
  box-sizing: border-box !important;
  page-break-before: always !important;
  break-before: page !important;
  page-break-inside: avoid !important;
  break-inside: avoid-page !important;
}

/* NO forced break before the very first card (starts right after cover) */
#results .score-card:first-child {
  page-break-before: auto !important;
  break-before: auto !important;
  margin-top: 0 !important;
}

/* Extra safety: avoid breaks after last card if needed */
#results .score-card:last-child {
  page-break-after: avoid !important;
}

/* Force each major module/score-card onto its own page in print */
#results .score-card {
  page-break-before: always !important;
  break-before: page !important;
  margin-top: 1cm !important;     /* breathing room at top of new page */
  padding-top: 0.5cm !important;
}

/* But cancel the forced break on the VERY FIRST card so it starts immediately after cover */
#results .score-card:first-child {
  page-break-before: auto !important;
  break-before: auto !important;
  margin-top: 0 !important;
}

/* ──────────────────────────────────────────────────────────────
   FORCE “Show Fixes” expanded + “More Details”  */
button[onclick*="More Details"] + .hidden,
.hidden.mt-6.space-y-6,
.hidden.mt-4.space-y-6 {
  display: block !important;
}

button[onclick*="Show Fixes"] + .hidden,
.hidden.mt-6.space-y-8,
.hidden.mt-4.space-y-8 {
  display: block !important;
}

/* Hide the toggle buttons themselves in print */
button[onclick*="toggle('hidden')"] {
  display: none !important;
}
}