/* Overlay values use coordinates from the supplied landscape A4 result sheet. */
#print-area { display: none; }
.sheet {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 841.89 / 595.276;
  width: 100%;
  background: #fff;
  color: #071117;
  font-family: "Microsoft YaHei", "Noto Sans CJK SC", "PingFang SC", sans-serif;
}
.sheet > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.sheet-cell {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  max-width: var(--slot);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-size: .96cqw;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sheet-raw, .sheet-final, .sheet-grade, .sheet-coefficient { font-weight: 750; }
.sheet-ink {
  position: absolute;
  left: 17.39%;
  top: 96.19%;
  width: 7.98%;
  height: 2.85%;
  fill: none;
  stroke: #0d2831;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sheet-ink polyline { vector-effect: non-scaling-stroke; stroke-width: 1.1px; }
.sheet-staff-section, .sheet-staff-status { position: absolute; display: grid; align-content: center; line-height: 1; font-size: .9cqw; font-weight: 700; }
.sheet-staff-section { left: 6.16%; top: 82.94%; width: 14%; height: 1.68%; padding-left: .05cqw; color: #fff; background: #006185; }
.sheet-staff-status { left: 39%; top: 88.49%; width: 7.25%; height: 1.81%; text-align: center; background: #d9f3fd; }

.sheet-employee { --x: 21.369%; --slot: 8.315%; --y: 4.858%; }
.sheet-team { --x: 51.242%; --slot: 16.986%; --y: 4.858%; }
.sheet-month { --x: 69.344%; --slot: 5.701%; --y: 4.858%; }
.sheet-position { --x: 21.369%; --slot: 8.315%; --y: 8.840%; }
.sheet-date { --x: 51.242%; --slot: 16.986%; --y: 8.840%; }
.sheet-attendance { --x: 69.344%; --slot: 5.701%; --y: 8.840%; }
.sheet-self { --x: 66.256%; --slot: 10.690%; }
.sheet-lead { --x: 75.770%; --slot: 6.058%; }
.sheet-blend { --x: 81.923%; --slot: 4.870%; }
.sheet-raw { --x: 69.688%; --slot: 11.878%; --y: 81.935%; }
.sheet-final { --x: 81.923%; --slot: 5.226%; --y: 85.675%; }
.sheet-grade { --x: 81.923%; --slot: 5.226%; --y: 87.529%; }
.sheet-coefficient { --x: 81.923%; --slot: 5.226%; --y: 89.384%; }
.sheet-leader { --x: 51.242%; --slot: 16.986%; --y: 97.629%; }
.sheet-signed-day { --x: 69.344%; --slot: 5.701%; --y: 97.629%; }
.sheet-business-0 { --y: 19.020%; }
.sheet-business-1 { --y: 29.522%; }
.sheet-business-2 { --y: 40.196%; }
.sheet-business-3 { --y: 52.584%; }
.sheet-business-4 { --y: 65.032%; }
.sheet-prof-0 { --y: 74.527%; }
.sheet-prof-1 { --y: 77.289%; }
.sheet-prof-2 { --y: 80.050%; }

.result-paper { margin-bottom: 15px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.paper-hint { display: none; }
.paper-dialog, .signature-dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  max-height: 93dvh;
}
.paper-dialog { width: min(1140px, calc(100% - 20px)); }
.paper-dialog::backdrop, .signature-dialog::backdrop { background: rgb(9 31 27 / .56); }
.paper-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.paper-head h2 { margin-right: auto; }
.paper-scroll { overflow: auto; background: #fff; }
.paper-scroll .sheet { min-width: 780px; }
.paper-error { padding: 0 16px 12px; }
.signature-dialog { width: min(550px, calc(100% - 24px)); }
.signature-content { padding: clamp(15px, 4vw, 25px); }
.signature-content .row-actions { margin-bottom: 0; }
.signature-content .row-actions button { flex-basis: auto; }
.sign-guide { margin-top: 14px; margin-bottom: 7px; }
.sign-pad {
  display: block;
  width: 100%;
  height: auto;
  border: 1px dashed #609983;
  border-radius: 11px;
  background: #f5faf8;
  touch-action: none;
  cursor: crosshair;
}
@media (max-width: 714px) {
  .final-review { display: flex; flex-direction: column; }
  .final-review .result { order: -1; }
  .paper-hint { display: block; padding: 9px 12px; border-bottom: 1px solid var(--line); }
}
@page { size: A4 landscape; margin: 0; }
@media print {
  html, body { margin: 0; padding: 0; background: #fff; }
  body.has-print-sheet .topbar, body.has-print-sheet main, .paper-dialog, .signature-dialog { display: none !important; }
  body.has-print-sheet #print-area { display: block; padding-top: 5.1mm; }
  #print-area .sheet { width: 283mm; margin: 0 auto; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
