/* ================================================================
   PRINT — complete background, colour, and spacing reset
   Extends the variable overrides in the main print block to cover
   elements with explicit colour values that variables do not reach:
   callouts, code blocks, inline code, blockquotes, and tables.
   ================================================================ */

@media print {

  /* ── Callouts / admonitions — backgrounds and text ── */

  [data-md-color-scheme="dos-dark"] .md-typeset .admonition,
  [data-md-color-scheme="dos-light"] .md-typeset .admonition,
  [data-md-color-scheme="dos-dark"] .md-typeset details,
  [data-md-color-scheme="dos-light"] .md-typeset details {
    background-color: transparent !important;
    border-color: #555555 !important;
    margin: 0.5em 0 !important;
    padding: 0 0.75rem !important;
  }

  [data-md-color-scheme="dos-dark"] .md-typeset .admonition-title,
  [data-md-color-scheme="dos-light"] .md-typeset .admonition-title,
  [data-md-color-scheme="dos-dark"] .md-typeset details > summary,
  [data-md-color-scheme="dos-light"] .md-typeset details > summary {
    background-color: transparent !important;
    color: #000000 !important;
    padding: 0.35rem 0.75rem !important;
  }

  /* Hide admonition icons — dark mask background unprintable */
  [data-md-color-scheme="dos-dark"] .md-typeset .admonition-title::before,
  [data-md-color-scheme="dos-light"] .md-typeset .admonition-title::before,
  [data-md-color-scheme="dos-dark"] .md-typeset details > summary::before,
  [data-md-color-scheme="dos-light"] .md-typeset details > summary::before {
    display: none !important;
  }

  [data-md-color-scheme="dos-dark"] .md-typeset .admonition *,
  [data-md-color-scheme="dos-light"] .md-typeset .admonition *,
  [data-md-color-scheme="dos-dark"] .md-typeset details *,
  [data-md-color-scheme="dos-light"] .md-typeset details * {
    color: #000000 !important;
  }

  [data-md-color-scheme="dos-dark"] .md-typeset .admonition > p,
  [data-md-color-scheme="dos-light"] .md-typeset .admonition > p,
  [data-md-color-scheme="dos-dark"] .md-typeset details > p,
  [data-md-color-scheme="dos-light"] .md-typeset details > p {
    margin: 0.4em 0 !important;
  }

  /* ── Callout border colours — paper-mode equivalents ── */

  .md-typeset .admonition.note,
  .md-typeset details.note {
    border-color: #394b9a !important;
  }

  .md-typeset .admonition.info,
  .md-typeset .admonition.important,
  .md-typeset details.info,
  .md-typeset details.important {
    border-color: #005f6b !important;
  }

  .md-typeset .admonition.tip,
  .md-typeset .admonition.hint,
  .md-typeset .admonition.success,
  .md-typeset .admonition.check,
  .md-typeset .admonition.done,
  .md-typeset details.tip,
  .md-typeset details.hint,
  .md-typeset details.success,
  .md-typeset details.check,
  .md-typeset details.done {
    border-color: #006f00 !important;
  }

  .md-typeset .admonition.warning,
  .md-typeset .admonition.caution,
  .md-typeset details.warning,
  .md-typeset details.caution {
    border-color: #7a3d00 !important;
  }

  .md-typeset .admonition.danger,
  .md-typeset .admonition.error,
  .md-typeset .admonition.bug,
  .md-typeset .admonition.failure,
  .md-typeset details.danger,
  .md-typeset details.error,
  .md-typeset details.bug,
  .md-typeset details.failure {
    border-color: #aa0000 !important;
  }

  .md-typeset .admonition.question,
  .md-typeset .admonition.faq,
  .md-typeset .admonition.help,
  .md-typeset .admonition.example,
  .md-typeset details.question,
  .md-typeset details.faq,
  .md-typeset details.help,
  .md-typeset details.example {
    border-color: #7a2f8a !important;
  }

  .md-typeset .admonition.abstract,
  .md-typeset .admonition.summary,
  .md-typeset .admonition.tldr,
  .md-typeset details.abstract,
  .md-typeset details.summary,
  .md-typeset details.tldr {
    border-color: #394b9a !important;
  }

  .md-typeset .admonition.quote,
  .md-typeset details.quote {
    border-color: #7a3d00 !important;
  }

  /* ── Block code ── */

  [data-md-color-scheme="dos-dark"] .md-typeset .highlight,
  [data-md-color-scheme="dos-light"] .md-typeset .highlight,
  [data-md-color-scheme="dos-dark"] .md-typeset pre,
  [data-md-color-scheme="dos-light"] .md-typeset pre {
    background-color: #f0f0f0 !important;
  }

  [data-md-color-scheme="dos-dark"] .md-typeset .highlight *,
  [data-md-color-scheme="dos-light"] .md-typeset .highlight *,
  [data-md-color-scheme="dos-dark"] .md-typeset pre *,
  [data-md-color-scheme="dos-light"] .md-typeset pre * {
    color: #1f2430 !important;
    background-color: transparent !important;
  }

  /* Hide copy-to-clipboard controls */
  [data-md-color-scheme="dos-dark"] .md-typeset .md-code__nav,
  [data-md-color-scheme="dos-light"] .md-typeset .md-code__nav,
  [data-md-color-scheme="dos-dark"] .md-typeset .md-code__button,
  [data-md-color-scheme="dos-light"] .md-typeset .md-code__button,
  [data-md-color-scheme="dos-dark"] .md-typeset .md-clipboard,
  [data-md-color-scheme="dos-light"] .md-typeset .md-clipboard {
    display: none !important;
  }

  /* ── Inline code ── */

  [data-md-color-scheme="dos-dark"] .md-typeset code:not(pre > code),
  [data-md-color-scheme="dos-light"] .md-typeset code:not(pre > code) {
    background-color: #e8e8e8 !important;
    color: #1f2430 !important;
  }

  /* ── Blockquotes ── */

  [data-md-color-scheme="dos-dark"] .md-typeset blockquote,
  [data-md-color-scheme="dos-light"] .md-typeset blockquote {
    background-color: transparent !important;
    border-left-color: #555555 !important;
    color: #000000 !important;
  }

  /* ── Tables ── */

  [data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) th,
  [data-md-color-scheme="dos-light"] .md-typeset table:not([class]) th,
  [data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) td,
  [data-md-color-scheme="dos-light"] .md-typeset table:not([class]) td {
    background-color: transparent !important;
    color: #000000 !important;
    padding: 0.25em 0.5em !important;
  }

  [data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) tr:nth-child(even) td,
  [data-md-color-scheme="dos-light"] .md-typeset table:not([class]) tr:nth-child(even) td {
    background-color: transparent !important;
  }

  [data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) thead tr:first-child th,
  [data-md-color-scheme="dos-light"] .md-typeset table:not([class]) thead tr:first-child th {
    border-top-color: #000000 !important;
  }

  [data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) th,
  [data-md-color-scheme="dos-light"] .md-typeset table:not([class]) th {
    border-bottom-color: #555555 !important;
  }

  [data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) tbody tr:last-child td,
  [data-md-color-scheme="dos-light"] .md-typeset table:not([class]) tbody tr:last-child td {
    border-bottom-color: #000000 !important;
  }

}

/* ================================================================
   TABLE — booktabs-inspired web style
   Centred. No vertical or inter-row borders.
   Strong top/bottom frame. Light midrule under header.
   ================================================================ */

/* Centre and reset frame */
[data-md-color-scheme="dos-dark"] .md-typeset table:not([class]),
[data-md-color-scheme="dos-light"] .md-typeset table:not([class]) {
  width: auto !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-collapse: collapse !important;
  border: none !important;
}

/* Clear all cell borders — rebuilt selectively below */
[data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) th,
[data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) td,
[data-md-color-scheme="dos-light"] .md-typeset table:not([class]) th,
[data-md-color-scheme="dos-light"] .md-typeset table:not([class]) td {
  border: none !important;
}

/* ── Dark mode ── */

[data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) thead tr:first-child th {
  border-top: 2px solid var(--dos-light-gray) !important;
}

[data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) th {
  border-bottom: 1px solid var(--dos-md-muted) !important;
}

[data-md-color-scheme="dos-dark"] .md-typeset table:not([class]) tbody tr:last-child td {
  border-bottom: 2px solid var(--dos-light-gray) !important;
}

/* ── Light mode ── */

[data-md-color-scheme="dos-light"] .md-typeset table:not([class]) thead tr:first-child th {
  border-top: 2px solid var(--borland-paper-ink) !important;
}

[data-md-color-scheme="dos-light"] .md-typeset table:not([class]) th {
  border-bottom: 1px solid var(--borland-paper-rule) !important;
}

[data-md-color-scheme="dos-light"] .md-typeset table:not([class]) tbody tr:last-child td {
  border-bottom: 2px solid var(--borland-paper-ink) !important;
}

/* Accessible body/prose links only — subtle DOS-style cue */

.md-content .md-typeset p a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref),
.md-content .md-typeset li a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref),
.md-content .md-typeset blockquote a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref),
.md-content .md-typeset dd a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref),
.md-content .md-typeset td a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref),
.md-content .md-typeset th a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref) {
  text-decoration: none !important;
  border-bottom: 1px dotted currentColor !important;
}

.md-content .md-typeset p a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):hover,
.md-content .md-typeset li a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):hover,
.md-content .md-typeset blockquote a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):hover,
.md-content .md-typeset dd a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):hover,
.md-content .md-typeset td a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):hover,
.md-content .md-typeset th a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):hover,
.md-content .md-typeset p a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):focus,
.md-content .md-typeset li a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):focus,
.md-content .md-typeset blockquote a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):focus,
.md-content .md-typeset dd a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):focus,
.md-content .md-typeset td a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):focus,
.md-content .md-typeset th a:not(.md-button):not(.headerlink):not(.footnote-ref):not(.footnote-backref):focus {
  border-bottom-style: solid !important;
}

/* Footer copyright name link — same DOS dotted cue */

[data-md-color-scheme="dos-dark"] .md-footer .md-copyright__highlight > a,
[data-md-color-scheme="dos-light"] .md-footer .md-copyright__highlight > a {
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: 1px dotted currentColor !important;
  box-shadow: none !important;
  background-image: none !important;
}

[data-md-color-scheme="dos-dark"] .md-footer .md-copyright__highlight > a:hover,
[data-md-color-scheme="dos-dark"] .md-footer .md-copyright__highlight > a:focus,
[data-md-color-scheme="dos-light"] .md-footer .md-copyright__highlight > a:hover,
[data-md-color-scheme="dos-light"] .md-footer .md-copyright__highlight > a:focus {
  border-bottom: 1px solid currentColor !important;
}
