:root {
  --sheet-w: 297mm;
  --sheet-h: 210mm;
  --sheet-pad: 12mm;
}

.sheets {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 16px 18px 32px;
}

.sheet-frame {
  position: relative;
  overflow: hidden;
}

.sheet-caption {
  margin: 0 0 -10px;
  font-size: 12px;
  color: var(--muted);
}

.sheet {
  display: flex;
  flex-direction: column;
  width: var(--sheet-w);
  height: var(--sheet-h);
  padding: var(--sheet-pad);
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  box-shadow: 0 10px 30px rgba(60, 50, 30, 0.18);
  transform-origin: top left;
  overflow: hidden;
  color: var(--ink);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.sheet-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8mm;
  flex: none;
  padding-bottom: 3mm;
  font-size: 4.2mm;
}

.sheet-title {
  font-size: 5.6mm;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sheet-fields {
  display: flex;
  align-items: flex-end;
  gap: 6mm;
}

.sheet-field {
  display: flex;
  align-items: flex-end;
  gap: 1.5mm;
  white-space: nowrap;
}

.sheet-blank {
  display: inline-block;
  border-bottom: 0.3mm solid var(--ink);
  height: 6mm;
}

.sheet-body {
  flex: 1;
  min-height: 0;
}

@media print {
  html,
  body {
    background: #fff !important;
  }

  .sheets {
    display: block;
    padding: 0;
  }

  .sheet-caption {
    display: none;
  }

  .sheet-frame {
    width: auto !important;
    height: auto !important;
    overflow: visible;
    break-after: page;
    page-break-after: always;
  }

  .sheet-frame:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .sheet {
    height: calc(var(--sheet-h) - 1mm);
    border: none;
    box-shadow: none;
    background: #fff;
    transform: none !important;
  }
}
