/* Layout: one calm white column on phones; A4 sheet is drawn off-screen and exported as an image. */
:root {
  --paper: #ffffff;
  --ink: #15242d;
  --muted: #5b6b75;
  --line: #d6e0e6;
  --tint: #eef7fb;
  --accent: #2a7fb5;
  --accent-ink: #ffffff;
  --mint: #c4f1e0;
  --bad: #b3261e;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px 40px;
}
.page { max-width: 640px; margin: 0 auto; }
.top { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 3px solid var(--accent); margin-bottom: 8px; }
.logo { width: 64px; height: 64px; flex: none; }
.co { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
h1 { margin: 2px 0 0; font-size: 22px; line-height: 1.2; text-wrap: balance; }
h2 { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
section { padding: 18px 0; border-bottom: 1px solid var(--line); }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; min-width: 0; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=password], textarea {
  display: block; width: 100%; min-width: 0; margin-top: 5px; padding: 12px; font: inherit; font-weight: 400;
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 480px) { .grid, .grid.two { grid-template-columns: 1fr; gap: 0; } }
.hint { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.count { margin: -6px 0 0; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (max-width: 480px) { .checks { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; padding: 8px 12px; font-weight: 500; background: var(--tint); border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; margin: 0; }
.check:has(input:checked) { border-color: var(--accent); background: #dff0f8; }
.pad { margin-bottom: 18px; }
.pad h3 { margin: 0 0 2px; font-size: 15px; }
.pad .sub { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.pad canvas { display: block; width: 100%; height: 150px; background: #fbfdfe; border: 1.5px dashed var(--accent); border-radius: 8px; touch-action: none; }
.pad .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.stamp { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; }
.stamp.on { color: var(--ink); font-weight: 600; }
.clear { padding: 8px 14px; font: inherit; font-size: 14px; color: var(--accent); background: var(--paper); border: 1.5px solid var(--accent); border-radius: 8px; }
.concur { font-size: 13px; color: var(--muted); margin: 0; }
.errors { margin: 16px 0 0; padding: 12px 14px; border: 1.5px solid var(--bad); border-radius: 8px; color: var(--bad); font-size: 14px; background: #fdf3f2; }
.errors ul { margin: 6px 0 0; padding-left: 18px; }
.actions { display: grid; gap: 10px; margin-top: 18px; }
button { font: inherit; cursor: pointer; }
.primary, .secondary { min-height: 52px; padding: 12px 16px; border-radius: 10px; font-weight: 700; font-size: 16px; }
.primary { color: var(--accent-ink); background: var(--accent); border: 0; }
.secondary { color: var(--accent); background: var(--paper); border: 1.5px solid var(--accent); }
button:disabled { opacity: .55; cursor: default; }
.status { min-height: 1.4em; margin: 12px 0 0; font-weight: 600; }
.status.ok { color: #1e7a4c; }
.status.bad { color: var(--bad); }
.out { display: block; width: 100%; height: auto; border: 1px solid var(--line); margin: 10px 0 16px; }
@media (prefers-reduced-motion: no-preference) { button { transition: opacity .15s; } }

/* A4 sheet: 210 x 297 mm at 96 dpi = 794 x 1123 px. Off-screen, white paper. */
.sheet { position: absolute; left: -10000px; top: 0; width: 794px; height: 1123px; overflow: hidden; background: #fff; color: #15242d; font-family: var(--font); font-size: 12.5px; line-height: 1.4; padding: 40px 48px 30px; }
.sheet .sh-top { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 3px solid #2a7fb5; }
.sheet .sh-top img { width: 72px; height: 72px; }
.sheet .sh-co { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: #2a7fb5; }
.sheet .sh-title { font-size: 22px; font-weight: 700; margin-top: 2px; }
.sheet .sh-ref { margin-left: auto; text-align: right; font-size: 11px; color: #5b6b75; }
.sheet .info { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin: 16px 0 12px; }
.sheet .info div { border-bottom: 1px solid #d6e0e6; padding-bottom: 4px; min-width: 0; overflow-wrap: anywhere; }
.sheet .info .full { grid-column: 1 / -1; }
.sheet .k { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #5b6b75; }
.sheet h4 { margin: 12px 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #2a7fb5; }
.sheet .tl { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 24px; }
.sheet .tl div { display: flex; gap: 8px; align-items: center; }
.sheet .box { width: 14px; height: 14px; border: 1.5px solid #2a7fb5; flex: none; position: relative; }
.sheet .box.on::after { content: ""; position: absolute; left: 3px; top: -1px; width: 5px; height: 10px; border: solid #2a7fb5; border-width: 0 2.5px 2.5px 0; transform: rotate(40deg); }
.sheet .nar { min-height: 150px; max-height: 190px; overflow: hidden; border: 1px solid #d6e0e6; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet .sigs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 14px; }
.sheet .sig { min-width: 0; }
.sheet .sig .ink { height: 84px; border-bottom: 1.5px solid #15242d; display: flex; align-items: flex-end; justify-content: center; }
.sheet .sig .ink img { max-width: 100%; max-height: 80px; }
.sheet .sig .nm { margin-top: 4px; font-weight: 700; overflow-wrap: anywhere; }
.sheet .sig .rl { font-size: 11px; color: #5b6b75; }
.sheet .sig .tm { margin-top: 3px; font-size: 10.5px; color: #15242d; }
.sheet .concur { margin: 10px 0 0; font-size: 11px; color: #5b6b75; }
.sheet .foot { position: absolute; left: 48px; right: 48px; bottom: 24px; padding-top: 6px; border-top: 1px solid #d6e0e6; font-size: 10px; color: #5b6b75; display: flex; justify-content: space-between; }
