:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #536078;
  --blue: #1749ce;
  --line: #dce3ee;
  --soft: #f5f7fb;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--soft); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
h1, p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid #3d65de; outline-offset: 3px;
}
[hidden] { display: none; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mast { background: #fff; border-bottom: 1px solid var(--line); }
.wrap { max-width: 1250px; margin: auto; padding-inline: clamp(17px, 4vw, 46px); }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 61px; gap: 12px; }
.brand, .back { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand { font-weight: 750; color: var(--ink); }
.back { font-weight: 650; font-size: .88rem; }
.bar svg, button svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex: none;
}
.brand svg { color: var(--blue); }
#workspace {
  display: grid; grid-template-columns: minmax(310px, 386px) minmax(0, 1fr);
  align-items: start; gap: clamp(20px, 4.3vw, 60px); padding: 32px 0 50px;
}
.controls {
  background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: clamp(15px, 2.7vw, 28px);
}
.intro { display: flex; align-items: center; gap: 13px; margin-bottom: 19px; }
.intro img { display: block; object-fit: contain; border-radius: 16px; padding: 6px; flex-shrink: 0; }
.section-label { color: var(--blue); font-weight: 730; font-size: .78rem; }
h1 { font-size: clamp(1.43rem, 3vw, 2.13rem); letter-spacing: -.05em; line-height: 1.08; margin-top: 4px; }
.fields { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 10px; }
label { display: block; font-weight: 660; font-size: .91rem; }
label span { font-weight: 400; font-size: .76rem; color: var(--muted); }
input:not([type=checkbox]), select {
  color: var(--ink); background: #fff; width: 100%; padding: 8px 10px;
  min-height: 44px; border: 1px solid #cdd7e6; border-radius: 10px; margin-block: 4px 13px;
}
select { cursor: pointer; }
.double { display: flex; gap: 7px; align-items: center; margin: 2px 0 13px; }
.double[hidden] { display: none; }
.double input { accent-color: var(--blue); width: 16px; height: 16px; }
fieldset { margin: 0 0 14px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
legend { font-size: .86rem; font-weight: 700; color: var(--muted); padding: 0 5px; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  background: var(--blue); color: #fff; font-weight: 700; border: 1px solid var(--blue);
  padding: 7px 12px; border-radius: 11px; min-height: 44px; white-space: nowrap;
}
button:hover { background: #113eb4; }
button:disabled { opacity: .55; cursor: default; }
.secondary, .proof, .step { color: var(--ink); background: #fff; border-color: var(--line); }
.secondary:hover, .proof:hover, .step:hover { color: var(--blue); background: #eff3ff; }
.proof { color: var(--blue); min-height: 34px; font-size: .82rem; }
.proof svg { width: 15px; height: 15px; }
.status { font-size: .83rem; color: var(--muted); margin-top: 8px; }
.status[data-error="true"] { color: #ac2d32; }
.print-help { font-size: .84rem; color: var(--muted); margin-top: 13px; border-top: 1px solid var(--line); padding-top: 11px; }
.preview-head {
  display: flex; align-items: center; justify-content: space-between; min-height: 42px;
  gap: 10px; margin: 0 0 9px; font-size: .9rem; color: var(--muted);
}
#pagination { display: flex; gap: 5px; }
#pagination[hidden] { display: none; }
.step { min-height: 35px; min-width: 39px; padding: 4px 8px; }
.step[aria-pressed="true"] { color: #143aa4; background: #eaf0ff; border-color: #c4d3fc; }
.preview { min-width: 0; }
.sheet { background: #fff; border-radius: 6px; box-shadow: 0 14px 35px #2d466518; overflow: hidden; }
.sheet svg { display: block; width: 100%; height: auto; }
@media (max-width: 780px) {
  #workspace { display: block; max-width: 560px; margin: auto; padding-top: 17px; }
  .preview { margin-top: 15px; }
  .bar { min-height: 54px; }
  .brand { font-size: .92rem; }
  .back { font-size: .81rem; }
  .intro img { width: 64px; height: 64px; border-radius: 12px; }
  .intro { margin-bottom: 12px; }
}
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { background: #fff; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .mast, .controls, .preview-head, .defs { display: none !important; }
  main.wrap, #workspace, .preview { display: block; width: 210mm; margin: 0; padding: 0; }
  #sheets .sheet { display: block !important; box-shadow: none; border-radius: 0; break-inside: avoid; }
  .sheet + .sheet { break-before: page; }
  .sheet svg { display: block; width: 210mm; height: 297mm; }
}
