/* Print stylesheet (feature 009 T079, research R11). Linked by the base layout with
   media="print", so it costs nothing on screen.

   - Pages: A4 by default, A5 for documents that ask for it (`.doc[data-size="a5"]`, named page
     `a5`), 15 mm margins.
   - Light tokens: tokens.css forces the light values in `@media print` whatever the device
     theme, so nothing here sets a colour apart from tokens.
   - Hidden: everything that is not the document (the reference chrome, skip link, toasts, any
     control). A printed page has no interactive controls.
   - Greyscale: lines are at least 1 px (0.75 pt, above the 0.5 pt floor) and text at least 9 pt.
   Logical properties only, no colour literals. */
@page {
  size: A4;
  margin: 15mm;
}

@page a4 {
  size: A4;
  margin: 15mm;
}

@page a5 {
  size: A5;
  margin: 15mm;
}

@media print {
  html {
    background: none;
    font-size: 10.5pt;
  }

  body {
    min-block-size: 0;
    background: none;
  }

  /* The signed-in shell prints as the page alone: no navigation column. */
  .app-shell {
    display: block;
  }

  .app-main {
    min-block-size: 0;
    padding-block-end: 0;
  }

  /* Not part of the document. */
  .skip-link,
  .ref-header,
  .ref-switches,
  .snapshot-bar,
  .no-print,
  [data-toast-region],
  nav,
  button,
  input,
  select,
  textarea,
  [role="button"],
  [role="tab"],
  dialog:not([open]) {
    display: none !important;
  }

  .ref-page,
  .ref-page .demo {
    max-inline-size: none;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
  }

  .doc {
    max-inline-size: none;
    padding: 0;
    border: 0;
    break-after: page;
    break-inside: avoid-page;
    orphans: 3;
    widows: 3;
  }

  /* Links in a printed page are plain text. */
  a {
    color: inherit;
    text-decoration: none;
  }

  /* Never below 9 pt, whatever a token says. */
  .doc,
  .doc * {
    font-size: max(9pt, 1em);
  }

  .doc {
    font-size: 10.5pt;
  }

  .doc .doc-title {
    font-size: 16pt;
  }

  .doc .doc-school-name {
    font-size: 13pt;
  }

  .doc .doc-foot {
    font-size: 9pt;
  }

  .doc-table thead {
    display: table-header-group;
  }

  .doc-table tfoot {
    display: table-footer-group;
  }
}
