/* Notes only: prescriptions keep their separate A4 landscape stylesheet. */
@page { size: A4 portrait; margin: 12mm; }

@media print {
  :root, :root[data-theme="dark"] { color-scheme: light; --text: #000; --muted: #444; --blue: #1d4c91; --highlight: #fff2a8; --highlight-blue: #bfdbfe; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; color: #000 !important; }
  body > :not(#notebook-view),
  #notebook-view > :not(.notebook-main),
  .notebook-main > :not(#note-sheet),
  #note-sheet > :not(#editor) { display: none !important; }
  #notebook-view, .notebook-main, #note-sheet {
    display: block;
    position: static;
    height: auto !important;
    min-height: 0;
    max-height: none;
    overflow: visible !important;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }
  #editor {
    display: block;
    min-height: 0;
    margin: 0;
    padding: 0;
    color: #000;
    caret-color: transparent;
    font-size: 10pt;
    line-height: 1.2;
    overflow: visible;
    orphans: 3;
    widows: 3;
  }
  #editor:empty::before { content: none; }
  #editor p, #editor div { margin: 0 0 2pt; }
  #editor h1, #editor h2, #editor h3 { color: #000; margin: 6pt 0 3pt; line-height: 1.2; letter-spacing: 0; break-after: avoid; page-break-after: avoid; }
  #editor > :first-child { margin-top: 0; }
  #editor h1 { font-size: 12pt; }
  #editor h2 { font-size: 11pt; }
  #editor h3 { font-size: 10.5pt; }
  #editor ul, #editor ol { margin: 3pt 0; }
  #editor li p { margin-bottom: 2pt; }
  #editor blockquote { margin-top: 3pt; margin-bottom: 3pt; }
  #editor img { max-width: 100%; max-height: 260mm; height: auto; margin: 4pt 0; object-fit: contain; break-inside: avoid; page-break-inside: avoid; }
  #editor mark { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
