/* Print (ADR-0024). Everything for paper is here; on screen neither the print
 * document nor the fallback page is ever shown. The document takes NO colour
 * from the app's theme except the tag colours (--t-*), which .printdoc reads
 * from the LIGHT list in index.html. No url(), no @import, no @font-face: CSS
 * can fetch, and printing fetches nothing (SecEng P-5). */
.printdoc,#printFallback{display:none}

@page{size:auto;margin:14mm 12mm 16mm;
  @bottom-right{content:"Page " counter(page) " of " counter(pages);font:8pt system-ui,Arial,sans-serif;color:#000}
  @bottom-left{font:8pt system-ui,Arial,sans-serif;color:#000}
  /* The browser's own "Headers and footers" option is ON by default in Chrome and
     Edge and draws the print date and time, the page title, the address and the
     page number in the margin. A page that defines margin boxes on a side takes
     that side over from the browser, so the top boxes are defined EMPTY here (the
     bottom ones carry our footer): nothing the browser draws reaches the paper
     whatever the option says. Firefox and Safari keep their own option. */
  @top-left{content:""}
  @top-center{content:""}
  @top-right{content:""}
  @bottom-center{content:""}}
@page board{size:landscape;margin:12mm 12mm 16mm}
/* Export PDF of one mind map (ADR-0025 7.3): A4, landscape. */
@page mmap{size:A4 landscape;margin:12mm 12mm 16mm}

/* P-1: THE APP IS HIDDEN BY THIS STYLESHEET ALONE. Print with the browser's own
   File menu or a phone's share sheet and no script has run: every child of
   <body> but the two below is gone, so the unlock sheet, the recovery words
   and an open note can never reach paper. #printRoot shows only while the page
   has set body.mnh-printing; #printFallback only without it. A script may add
   words to the fallback and never hides anything. */
@media print{
  body > :not(#printRoot):not(#printFallback){display:none!important}
  #printRoot{display:none!important}
  body.mnh-printing #printRoot{display:block!important}
  #printFallback{display:block!important;color:#000;background:#fff;
    font:12pt/1.5 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;padding:0}
  body.mnh-printing #printFallback{display:none!important}
  #printFallback h1{font-size:18pt;margin:0 0 8pt}
  #printFallback p{margin:0;max-width:34em}
  html,body{background:#fff!important;color:#000!important;overflow:visible!important;height:auto!important;
    margin:0!important;padding:0!important;display:block!important}
}

.printdoc{color-scheme:light;color:#000;background:#fff;forced-color-adjust:none;
  font:10pt/1.4 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
.printdoc.pd-compact{font-size:9pt}
.printdoc *{box-sizing:border-box}
.printdoc h1{font-size:17pt;margin:0 0 2pt}
.printdoc .pd-head{border-bottom:1pt solid #000;padding-bottom:5pt;margin-bottom:8pt}
.printdoc .pd-meta{font-size:10pt}
/* The header's one heading is the count line, set as the meta lines are: the view's name and the print moment are in the footer. */
.printdoc .pd-head h1.pd-hcount{font-size:10pt;font-weight:700;margin:0 0 2pt}
.printdoc .pd-gh{font-size:11pt;margin:8pt 0 4pt;break-after:avoid}
/* The tag colour edge is a BORDER, so it prints without "background graphics";
   exact colour on the edge only (A11y 14b). */
.printdoc .pd-note{border-left:3pt solid var(--c,#555);padding:3pt 0 3pt 6pt;margin:0 0 6pt;
  break-inside:avoid;overflow-wrap:anywhere;box-decoration-break:clone;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.printdoc .pd-note.pd-long{break-inside:auto}
.printdoc .pd-t{display:block}
.printdoc .pd-pin{font-variant:small-caps;font-weight:700;margin-right:5pt}
.printdoc.pd-compact .pd-t{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
.printdoc .pd-w{white-space:pre-wrap}
/* /stripes (BR-31): a band behind every other line, kept on paper. */
.printdoc .pd-ln{display:block}
.printdoc .pd-ln:empty::before{content:"\a0"}
.printdoc .pd-alt{background:var(--stripe);print-color-adjust:exact;-webkit-print-color-adjust:exact}
.printdoc .pd-task,.printdoc .pd-file{margin-top:1pt}
.printdoc .pd-file{font-size:9pt}
.printdoc .pd-d{font-size:9pt;margin-top:2pt}
.printdoc .pd-tags{margin-top:2pt}
.printdoc .pd-tag{display:inline-block;border-left:3pt solid var(--c,#333);padding:0 4pt;margin:0 4pt 2pt 0;font-size:9pt;
  print-color-adjust:exact;-webkit-print-color-adjust:exact}
.printdoc .pd-none{font-style:italic}

/* wall: the column count comes from the width (2 portrait, 3 landscape) */
.printdoc .pd-wall{column-width:76mm;column-gap:8mm}

/* list: one table, a header that repeats, a category per tbody */
.printdoc .pd-list{width:100%;border-collapse:collapse;font-size:9pt}
.printdoc .pd-list thead{display:table-header-group}
.printdoc .pd-list th:nth-child(2){width:26%}
.printdoc .pd-list th:nth-child(3){width:20%}
.printdoc .pd-list th{text-align:left;border-bottom:1pt solid #000;padding:2pt 4pt}
.printdoc .pd-list td{border-bottom:.5pt solid #8a8a8a;padding:3pt 4pt;vertical-align:top;overflow-wrap:anywhere}
.printdoc .pd-list tr{break-inside:avoid}
.printdoc .pd-list td.pd-edge{border-left:3pt solid var(--c,#555);print-color-adjust:exact;-webkit-print-color-adjust:exact}
.printdoc .pd-list tr.pd-cat th{font-weight:700;font-size:10pt;border-bottom:1pt solid #000;padding-top:8pt;break-after:avoid}
.printdoc .pd-list .pd-w{font-size:9pt}

/* board: <= 4 columns side by side on landscape pages; more: one section each.
   The named page is on #printRoot itself so it wraps the header too. */
.printdoc.pd-landscape{page:board}
.printdoc.pd-object{page:mmap}
.printdoc .pd-grid{display:grid;grid-template-columns:repeat(var(--cols),1fr);gap:0 6mm;align-items:start}
.printdoc .pd-grid .pd-gh{border-bottom:1.5pt solid #000;padding-bottom:2pt;margin-top:0}
.printdoc .pd-sections .pd-col{margin-bottom:6pt}
/* The column's colour before its name: a filled circle, a border and a background (never an image), printed exact
   and kept under forced colours (the doc sets forced-color-adjust:none); the name beside it carries the meaning. */
.printdoc .pd-dot{display:inline-block;width:8pt;height:8pt;border-radius:50%;margin-right:5pt;vertical-align:-.5pt;
  background:var(--c,#4a5c77);border:1pt solid var(--c,#4a5c77);forced-color-adjust:none;
  print-color-adjust:exact;-webkit-print-color-adjust:exact}
.printdoc .pd-sectionflow{column-width:76mm;column-gap:8mm}

/* calendar: month grid, one week per row, a row never split */
.printdoc .pd-month{width:100%;border-collapse:collapse;table-layout:fixed;font-size:9pt}
.printdoc .pd-month thead{display:table-header-group}
.printdoc .pd-month th{border:.5pt solid #000;padding:2pt;text-align:left}
.printdoc .pd-month tr{break-inside:avoid}
.printdoc .pd-month tbody tr{height:20mm}
/* A day with many notes grows its row. Nothing is clipped: paper cannot expand "+3 more". */
.printdoc .pd-month td{border:.5pt solid #000;vertical-align:top;padding:2pt;overflow-wrap:anywhere}
/* The neighbouring months' days: no lighter than #595959 (A11y 14c). */
.printdoc .pd-month td.pd-out{color:#595959}
.printdoc .pd-dn{font-weight:700}
/* WP-57d: formatted words, checklists, links, pictures, files. Nothing below
 * is smaller than 9 pt (A11y 14d); a box character or the words carry a
 * checklist's state, never a strike-through or a colour. */
.printdoc .pd-r{overflow-wrap:anywhere}
.printdoc .pd-r p{margin:0 0 3pt}
.printdoc .pd-r h1,.printdoc .pd-r h2,.printdoc .pd-r h3{font-size:10.5pt;margin:4pt 0 2pt;break-after:avoid}
.printdoc .pd-r ul,.printdoc .pd-r ol{margin:0 0 3pt;padding-left:14pt}
.printdoc .pd-r blockquote{margin:0 0 3pt;padding-left:6pt;border-left:1pt solid #8a8a8a}
.printdoc .pd-r pre{white-space:pre-wrap;margin:0 0 3pt;font:9pt/1.35 ui-monospace,Consolas,Menlo,monospace}
.printdoc .pd-r code{font-family:ui-monospace,Consolas,Menlo,monospace}
.printdoc .pd-r table{border-collapse:collapse;width:100%;table-layout:fixed;margin:0 0 3pt}
.printdoc .pd-r th,.printdoc .pd-r td{border:.5pt solid #000;padding:1pt 3pt;vertical-align:top;font-size:9pt}
.printdoc .pd-r tr{break-inside:avoid}
.printdoc .pd-r hr{border:0;border-top:.5pt solid #8a8a8a;margin:3pt 0}
.printdoc .pd-r a{color:#000;text-decoration:underline}
.printdoc .pd-addr{font-size:9pt;overflow-wrap:anywhere}
.printdoc .pd-link{margin-top:2pt}
.printdoc .pd-lt{display:block}
.printdoc .pd-tasks{list-style:none;margin:2pt 0 0;padding:0}
.printdoc .pd-task{margin-top:1pt;overflow-wrap:anywhere}
.printdoc .pd-markw{font-size:9pt;font-weight:700}
.printdoc .pd-count{font-size:9pt;margin-top:1pt}
.printdoc .pd-pics{display:flex;flex-wrap:wrap;gap:2mm;margin-top:3pt}
.printdoc .pd-pic{margin:0;width:calc((100% - 4mm) / 3);max-width:40mm;break-inside:avoid}
.printdoc .pd-pic img{display:block;max-width:100%;max-height:40mm;width:auto;height:auto;object-fit:contain}
.printdoc .pd-cap{font-size:9pt;overflow-wrap:anywhere}
.printdoc .pd-ev{border-left:2.5pt solid var(--c,#555);padding-left:3pt;margin:1pt 0;overflow-wrap:anywhere;
  print-color-adjust:exact;-webkit-print-color-adjust:exact;break-inside:avoid}
.printdoc .pd-grid .pd-col{min-width:0}
.printdoc .pd-week .pd-ev{margin:2pt 0}
.printdoc .pd-daylist .pd-col{margin-bottom:6pt}
.printdoc .pd-evrow{padding:1pt 0 1pt 4pt}
/* Agenda: portrait, the wall's flow under a heading per day. */
.printdoc .pd-agenda{column-width:76mm;column-gap:8mm}
.printdoc .pd-lab{font-size:9pt;font-variant:small-caps;font-weight:700}

/* An advanced object on paper (ADR-0025 7.2, 7.3): the drawing scaled to the
   width, the topics' notes under it; Compact: the outline. The drawing's
   colours are printed as drawn. */
.printdoc .pd-obj{margin-top:4pt;break-inside:avoid}
.printdoc .pd-objname{font-size:9pt;font-weight:700}
.printdoc .pd-map{margin:2pt 0 0}
.printdoc .pd-map svg{display:block;max-width:100%;height:auto;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.printdoc .pd-mapone svg{width:100%;max-height:165mm}
/* A process map's diagram tabs, each on its own page (ADR-0027 A1.3.3). */
.printdoc .pd-pagebreak{break-before:page}
.printdoc .pd-pmap{break-inside:avoid}
.printdoc .pd-outline,.printdoc .pd-outline ul{margin:1pt 0 0;padding-left:12pt;font-size:9pt}
.printdoc .pd-onotes{margin:3pt 0 0;font-size:9pt}
.printdoc .pd-onotes dt{font-weight:700}
.printdoc .pd-onotes dd{margin:0 0 2pt 8pt;white-space:pre-wrap;overflow-wrap:anywhere}
