@media print {

  header,
  footer,
  .header-actions,
  .search-container,
  .theme-toggle,
  .mobile-menu-toggle,
  .sandbox-container,
  .toc {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  main {
    max-width: 100%;
    padding: 0;
  }

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

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  pre {
    page-break-inside: avoid;
    border: 1px solid #ccc;
    padding: 1em;
  }

  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }

  .card {
    page-break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 1em;
  }
}
