:root {
  --paper: #EDEFEC;
  --card: #FFFFFF;
  --ink: #141A18;
  --muted: #67716E;
  --rule: #D6DCD8;
  --field: #F7F8F7;
  --accent: #0F6E61;
  --accent-soft: #DFEDE9;
  --danger: #9B3A2E;
  --warn: #8A6212;
  --shadow: 0 1px 2px rgba(20, 26, 24, .05), 0 12px 28px -18px rgba(20, 26, 24, .35);
  --checker: #E3E6E4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1312;
    --card: #161B1A;
    --ink: #E8ECEA;
    --muted: #939E9B;
    --rule: #28302E;
    --field: #1C2221;
    --accent: #57D8C1;
    --accent-soft: #1D2C29;
    --danger: #E58B7C;
    --warn: #D9AC5A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 32px -20px rgba(0, 0, 0, .8);
    --checker: #E3E6E4;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1312;
  --card: #161B1A;
  --ink: #E8ECEA;
  --muted: #939E9B;
  --rule: #28302E;
  --field: #1C2221;
  --accent: #57D8C1;
  --accent-soft: #1D2C29;
  --danger: #E58B7C;
  --warn: #D9AC5A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 32px -20px rgba(0, 0, 0, .8);
  --checker: #E3E6E4;
}

* { box-sizing: border-box; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Golos Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 40px 24px 72px; }

.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

header { margin-bottom: 32px; }
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 9px;
  vertical-align: 1px;
  background: var(--accent);
}
h1 {
  font-size: clamp(28px, 4.4vw, 40px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  text-wrap: balance;
  margin: 10px 0 8px;
}
header p { margin: 0; max-width: 56ch; color: var(--muted); }

.layout { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: start; }
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: 36px; }
  .proof { position: sticky; top: 32px; }
}
@media (max-width: 959px) { .proof { order: -1; } }

/* ---------- форма ---------- */

.form {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
fieldset { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 22px 24px 24px; }
fieldset:first-of-type { border-top: 0; }
legend {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
  margin-bottom: 14px;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.span2 { grid-column: 1 / -1; }

.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.fld small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.fld small.warn { color: var(--warn); }

input[type="text"], input[type="tel"], input[type="email"], input[type="url"], textarea, select {
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 9px 11px;
  width: 100%;
  transition: border-color .12s ease, background .12s ease;
}
textarea { resize: vertical; min-height: 62px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 62%, transparent); }
input:hover, textarea:hover, select:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: var(--card);
}
select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) calc(50% + 1px), calc(100% - 10px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.check input { margin: 2px 0 0; accent-color: var(--accent); width: 15px; height: 15px; }
.check span small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.filebtn {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--rule);
  background: var(--field);
  border-radius: 3px;
  padding: 8px 13px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.filebtn:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--rule)); background: var(--accent-soft); }
.sr-only:focus-visible + .filebtn { outline: 2px solid var(--accent); outline-offset: 1px; }

.file-row { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.file-row .name {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 80px;
}
.file-row button { padding: 6px 11px; font-size: 12.5px; }
.thumb {
  width: 36px; height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--rule);
  object-fit: cover;
  background-color: #FFFFFF;
  background-image:
    linear-gradient(45deg, var(--checker) 25%, transparent 25%, transparent 75%, var(--checker) 75%),
    linear-gradient(45deg, var(--checker) 25%, transparent 25%, transparent 75%, var(--checker) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
}
.thumb.square { border-radius: 3px; object-fit: contain; }
.thumb.round { border-radius: 50%; }

input[type="range"] { width: 100%; accent-color: var(--accent); margin: 2px 0 0; }
.range-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.range-row output {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- оттиск ---------- */

.proof { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.chip {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.qr-plate {
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 14px;
  align-self: center;
  width: 100%;
  max-width: 300px;
  line-height: 0;
}
.qr-plate.transparent {
  background-color: #FFFFFF;
  background-image:
    linear-gradient(45deg, var(--checker) 25%, transparent 25%, transparent 75%, var(--checker) 75%),
    linear-gradient(45deg, var(--checker) 25%, transparent 25%, transparent 75%, var(--checker) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
}
.qr-plate canvas { width: 100%; height: auto; }
.qr-plate.crisp canvas { image-rendering: pixelated; }
.qr-plate.is-error { display: none; }

.qr-error {
  display: none;
  color: var(--danger);
  font-size: 13.5px;
  border: 1px dashed currentColor;
  border-radius: 3px;
  padding: 16px;
  text-align: center;
}
.is-error + .qr-error, .qr-error.show { display: block; }

.dense {
  margin: -6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--warn);
  text-align: center;
}

.readout { display: flex; flex-direction: column; gap: 3px; text-align: center; align-items: center; }
.readout .avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--rule);
  margin-bottom: 10px;
}
.readout .name { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.readout .role { color: var(--muted); font-size: 13.5px; }
.readout .lines {
  margin-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--muted);
  word-break: break-word;
}

.meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 3px;
  padding: 9px 14px;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--field);
  color: var(--ink);
  transition: background .12s ease, border-color .12s ease;
}
button:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--rule)); background: var(--accent-soft); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--card); flex: 1 1 auto; }
button.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
button.ghost { background: transparent; }
button[hidden] { display: none !important; }

.status { min-height: 18px; font-size: 12.5px; color: var(--muted); }
.status.warn { color: var(--danger); }

details.source {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
details.source > summary {
  cursor: pointer;
  padding: 13px 18px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  list-style: none;
}
details.source > summary::-webkit-details-marker { display: none; }
details.source > summary::before { content: "+ "; }
details.source[open] > summary::before { content: "− "; }
details.source pre {
  margin: 0;
  padding: 0 18px 18px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
  max-height: 300px;
}

footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12.5px;
  max-width: 66ch;
}
footer b { font-weight: 600; color: var(--ink); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media print {
  .form, footer, .actions, details.source, header p, .meta, .status { display: none; }
  body { background: #fff; }
  .chip { border: 0; box-shadow: none; }
}

/* ---------- шапка сервиса ---------- */

.topbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
flex-wrap: wrap;
max-width: 1080px;
margin: 0 auto;
padding: 18px 24px 0;
}
.brand {
font-family: "IBM Plex Mono", ui-monospace, monospace;
font-size: 13px;
letter-spacing: .1em;
font-weight: 500;
text-transform: uppercase;
color: var(--ink);
text-decoration: none;
}
.brand span { color: var(--muted); }
.topbar-note {
font-size: 12px;
color: var(--muted);
}
