/* PDF export: the menu under the header's "PDF" button, and how pages look when printed or saved as PDF. */
.pdfmenu { position: absolute; z-index: 60; width: min(340px, calc(100vw - 16px)); display: flex; flex-direction: column; gap: 9px; padding: 14px 16px; font-size: 0.86rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.pdfmenu[hidden] { display: none; }
.pdfmenu > b { font-family: var(--f-display); font-size: 0.95rem; }
.pdfmenu label { display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; cursor: pointer; }
.pdfmenu input { margin: 2px 0 0; accent-color: var(--band); }
.pdfmenu #pdfgo { align-self: flex-start; font: inherit; font-weight: 600; color: var(--band-ink); background: var(--band); border: 0; border-radius: 6px; padding: 7px 16px; cursor: pointer; }
.pdfmenu #pdfgo:focus-visible, .pdfmenu input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pdfmenu p { margin: 0; font-size: 0.78rem; line-height: 1.4; color: var(--muted); }
#printhead, #printall { display: none; }

/* while printing, the page is laid out at the PDF's width (A4 landscape less the margins), so charts can be fitted to it */
body.printing .wrap { width: 1047px; max-width: none; padding-left: 0; padding-right: 0; }

@media print {
  @page { size: A4 landscape; margin: 10mm 10mm 13mm;
    @bottom-left { font: 7.5pt "IBM Plex Sans", "Segoe UI", sans-serif; color: #6b7280; }
    @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 7.5pt "IBM Plex Sans", "Segoe UI", sans-serif; color: #6b7280; } }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing .wrap, .wrap { width: auto; max-width: none; padding-left: 0; padding-right: 0; }
  html, body { background: #fff !important; }
  header.app, .fbtnbar, .filters, .scrim, .vbar, .vnav, .vframe, #tip, .ceobtn, .ceodrawer, .pdfmenu, .gate, dialog, .curswitch, .back, [data-jump] { display: none !important; }
  body.print-all main.app-only { display: none !important; }
  #printhead { display: block; margin: 0 0 14px; color: #142037; }
  body.print-all #printall { display: block; }
  .ph-top { display: flex; align-items: center; gap: 16px; padding-bottom: 8px; border-bottom: 3px solid #1f3864; }
  .ph-top > div { flex: 1; display: flex; flex-direction: column; }
  .ph-top b { font-family: var(--f-display); font-size: 1.35rem; }
  .ph-top span { font-size: 1rem; color: #4a5671; }
  .ph-conf { margin: 0; text-align: right; font-size: 0.74rem; line-height: 1.35; color: #c3322f; font-weight: 600; }
  .ph-meta { margin: 6px 0 0; font-size: 0.8rem; color: #4a5671; }
  .ph-ver { color: #b86e00; font-weight: 600; }
  .psec + .psec { break-before: page; }
  .ptitle { margin: 0 0 10px; font-family: var(--f-display); font-size: 1.25rem; }
  main.app-only, #printall { padding: 0; }
  .panel, .tile { box-shadow: none !important; border: 1px solid #d5dae4; break-inside: avoid; }
  tr, svg, .tmini { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .tscroll { overflow: visible !important; }
  /* "Show table" links do nothing on paper: closed sections are left out, open ones print without the link */
  details.showmore:not([open]) { display: none !important; }
  details.showmore > summary { display: none !important; }
  a { color: inherit; text-decoration: none; }
}
