@page {
  size: A4;
  margin: 0;
}

/* VCEdump printable document layout. Screen components remain in demos.css;
   this file owns only paper typography, density, and repeated page furniture. */
@media print {
  html,
  body,
  .vd-main,
  .vd-print,
  .vd-print-stage,
  .vd-print-pages {
    min-height: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .vd-print-noprint {
    display: none !important;
  }

  .vd-print-pages {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .vd-print-page {
    width: auto !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .vd-print-page + .vd-print-page {
    margin-top: 0 !important;
  }

  .vd-print-cover {
    min-height: 297mm;
    padding: 18mm 14mm 17mm !important;
    background: #fff !important;
    break-after: page;
  }

  .vd-print-body-table {
    width: 100%;
    border: 0;
    border-spacing: 0;
    border-collapse: collapse;
  }

  .vd-print-body-table > thead {
    display: table-header-group;
  }

  .vd-print-body-table > tfoot {
    display: table-footer-group;
  }

  .vd-print-body-table > thead > tr > td,
  .vd-print-body-table > tfoot > tr > td {
    padding: 0 14mm;
    border: 0;
  }

  .vd-print-body-table > thead > tr > td {
    height: 18mm;
  }

  .vd-print-body-table > tfoot > tr > td {
    height: 17mm;
  }

  .vd-print-body-table > tbody > tr > td {
    padding: 0 14mm;
    border: 0;
    vertical-align: top;
  }

  .vd-print-body-table > thead span,
  .vd-print-body-table > tfoot span {
    display: block;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  .vd-print-cover__footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding-top: 6mm;
  }

  .vd-print-cover__footer-block {
    min-width: 0;
    align-content: start;
    gap: 1.6mm !important;
    padding-right: 10mm;
  }

  .vd-print-cover__footer-block--order {
    padding-right: 0;
    padding-left: 10mm;
    border-left: 0.25mm solid #d5ddd8;
    text-align: right;
  }

  .vd-print-cover__footer .vd-overline {
    font-size: 7pt;
    letter-spacing: 0.06em;
  }

  .vd-print-cover__footer strong {
    font-size: 8.5pt;
    line-height: 1.4;
  }

  .vd-print-cover__footer small,
  .vd-print-cover__footer a {
    display: block;
    margin-top: 1.5mm;
    color: #56665e;
    font-size: 7.5pt;
    line-height: 1.4;
  }

  .vd-print-cover__footer a span {
    display: block;
    margin-bottom: 0.6mm;
    color: #69776f;
    font-size: 6.5pt;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .vd-pdf-list {
    display: block;
  }

  .vd-pdf-question {
    gap: 4mm !important;
    padding: 0 0 7mm !important;
    border-bottom: 0.25mm solid #e0e6e2;
    color: #18201c;
    font-size: 9.5pt;
    line-height: 1.45;
  }

  .vd-pdf-question + .vd-pdf-question {
    padding-top: 7mm !important;
  }

  .vd-pdf-question > header {
    align-items: center;
    gap: 2.5mm !important;
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .vd-question__no {
    color: #1a6e46;
    font-size: 8.5pt;
    line-height: 1.2;
    font-weight: 700;
  }

  .vd-pdf-question__badges {
    gap: 1.5mm !important;
  }

  .vd-question__type,
  .vd-pdf-question__badges .vd-badge {
    padding: 1.1mm 1.8mm;
    border: 0.2mm solid #d7e4dc;
    border-radius: 0.8mm;
    background: #f1f7f3;
    color: #4b5d54;
    font-size: 7pt;
    line-height: 1.1;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .vd-richtext {
    overflow-wrap: anywhere;
    orphans: 3;
    widows: 3;
  }

  .vd-richtext p,
  .vd-richtext ul,
  .vd-richtext ol,
  .vd-richtext pre,
  .vd-richtext table {
    margin-block: 2.5mm;
  }

  .vd-question__stem {
    max-width: none;
    color: #111814;
    font-size: 10.5pt;
    line-height: 1.48;
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .vd-question__stem img,
  .vd-demo-figure img {
    display: block;
    width: auto;
    height: auto;
    max-width: 160mm;
    max-height: 160mm;
    margin-inline: auto;
    object-fit: contain;
  }

  .vd-demo-figure {
    max-width: 164mm;
    margin: 4mm auto;
    padding: 2mm;
    border: 0.25mm solid #d5ddd8;
    border-radius: 0;
    background: #fff;
  }

  .vd-question__options {
    max-width: none;
    gap: 2mm;
    margin: 0;
  }

  .vd-question__option {
    min-height: 10mm;
    align-items: flex-start;
    gap: 2.5mm;
    padding: 2.2mm 2.6mm;
    border: 0.2mm solid #d4ddd8;
    border-radius: 0.8mm;
    background: #fbfcfb;
    font-size: 9.5pt;
    line-height: 1.35;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .vd-option-row__letter {
    width: 6mm;
    height: 6mm;
    flex: 0 0 6mm;
    display: grid;
    place-items: center;
    border: 0.25mm solid #7aa88f;
    border-radius: 0.6mm;
    background: #fff;
    color: #176c43;
    font-size: 8pt;
    line-height: 1;
    font-weight: 700;
  }

  .vd-pdf-options li > .vd-richtext {
    padding-top: 0.6mm;
  }

  .vd-richtext pre {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 8.5pt;
    line-height: 1.4;
  }

  .vd-richtext table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
  }

  .vd-richtext th,
  .vd-richtext td {
    padding: 2mm;
    border: 0.2mm solid #d4ddd8;
    text-align: left;
    vertical-align: top;
  }

  .vd-pdf-answer {
    gap: 2.5mm;
  }

  .vd-answer-block {
    padding: 3.5mm 4mm;
    border-left-width: 1mm;
    border-radius: 0;
  }

  .vd-pdf-explanation {
    gap: 2mm !important;
  }

  .vd-pdf-question a {
    color: inherit;
  }

  .vd-pdf-question a,
  .vd-print-cover__footer a {
    text-decoration: none;
    overflow-wrap: anywhere;
  }
}
