@layer print{@page {
    size: auto;
    margin: 18mm 16mm;
  }

  
  .print-only {
    display: none;
  }

  @media print {
    html,
    body {
      background: var(--print-paper);
      color: var(--print-ink);
      font-size: 11pt;
      line-height: 1.5;
    }

    body {
      padding: 0;
    }

    .site-header,
    .site-footer,
    .ecosystem-bar,
    .skip-link,
    .search-dialog,
    .site-menu,
    .theme-toggle,
    .header-actions,
    .hero-actions,
    .store-cta,
    .copy-code {
      display: none;
    }

    .site-main {
      padding: 0;
    }

    .container {
      width: auto;
      max-width: none;
      margin: 0;
    }

    a {
      color: var(--print-ink);
      text-decoration: underline;
    }

    a[href^="http"]::after {
      content: " (" attr(href) ")";
      font-family: var(--font-accent);
      font-size: 0.8em;
      color: var(--print-rule);
      overflow-wrap: anywhere;
    }

    h1,
    h2,
    h3,
    h4 {
      break-after: avoid;
      color: var(--print-ink);
      text-shadow: none;
    }

    p,
    li,
    blockquote {
      orphans: 3;
      widows: 3;
    }

    img,
    figure,
    table,
    pre,
    .callout,
    .card {
      break-inside: avoid;
    }

    img {
      box-shadow: none;
      filter: none;
    }

    .prose {
      max-width: none;
    }

    .prose a {
      text-decoration: underline;
    }

    .card {
      border: 1px solid var(--print-rule);
      background: transparent;
    }

    .print-running-head {
      display: block;
      position: fixed;
      inset: 0 0 auto;
      font-family: var(--font-accent);
      font-size: 9pt;
      color: var(--print-rule);
      border-bottom: 1px solid var(--print-rule);
      padding-bottom: 2mm;
    }

    .print-only {
      display: block;
    }
  }
}