/* шрифт бланка — для canvas-предпросмотра */
@font-face { font-family: "Liberation Serif"; font-weight: normal; font-style: normal;
  src: url("/static/fonts/LiberationSerif-Regular.ttf") format("truetype"); }
@font-face { font-family: "Liberation Serif"; font-weight: bold; font-style: normal;
  src: url("/static/fonts/LiberationSerif-Bold.ttf") format("truetype"); }
@font-face { font-family: "Liberation Serif"; font-weight: normal; font-style: italic;
  src: url("/static/fonts/LiberationSerif-Italic.ttf") format("truetype"); }
@font-face { font-family: "Liberation Serif"; font-weight: bold; font-style: italic;
  src: url("/static/fonts/LiberationSerif-BoldItalic.ttf") format("truetype"); }

:root {
  --bg: #f3f4f1;  --surface: #ffffff;
  --ink: #1c2422;
  --muted: #5a6663;
  --line: #d9ddd8;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #d9f0ea;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius-panel: 12px;
  --radius-ctrl: 7px;
  --shadow: 0 1px 2px rgba(28, 36, 34, .06), 0 10px 26px rgba(28, 36, 34, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "PT Sans", Ubuntu, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Интерфейс всегда представляет собой единый макет 1440×900. Размер окна,
   полноэкранный режим и zoom браузера меняют только общий равномерный scale. */
body.app-fixed-scale {
  position: fixed;
  left: var(--app-left, 0);
  top: var(--app-top, 0);
  width: 1440px;
  height: 900px;
  min-width: 1440px;
  min-height: 900px;
  overflow: visible;
  transform: scale(var(--app-scale, 1));
  transform-origin: top left;
}

/* Модальные подложки компенсируют масштаб и горизонтальное центрирование холста,
   поэтому затемняют всё реальное окно, включая свободные поля по краям. */
body.app-fixed-scale .modal-backdrop,
body.app-fixed-scale .wizard-backdrop,
body.app-fixed-scale .img-lightbox {
  inset: auto;
  left: var(--app-cover-left);
  top: var(--app-cover-top);
  width: var(--app-cover-width);
  height: var(--app-cover-height);
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }

/* ---- предупреждение для телефонов ---- */
.phone-notice {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  background: linear-gradient(155deg, rgba(28, 36, 34, .93), rgba(15, 118, 110, .88));
  backdrop-filter: blur(6px);
}
.phone-notice.is-visible { display: flex; }
body.phone-warning-open { overflow: hidden; }
.phone-notice-card {
  width: min(100%, 430px);
  padding: 28px 24px 22px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(28, 36, 34, .38);
  text-align: center;
}
.phone-notice-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #0f766e;
  background: #d9f0ea;
}
.phone-notice-kicker {
  margin: 0 0 7px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.phone-notice h1, .phone-notice h2 {
  margin: 0 0 12px;
  color: #1c2422;
  font-family: Georgia, "PT Serif", "Times New Roman", serif;
  font-size: clamp(25px, 7vw, 32px);
  line-height: 1.12;
}
.phone-notice-card > p:not(.phone-notice-kicker):not(.phone-notice-foot) {
  margin: 0;
  color: #5a6663;
  font-size: 15px;
  line-height: 1.5;
}
.phone-notice-card .phone-notice-recommend {
  margin-top: 12px !important;
  padding: 11px 12px;
  border-radius: 10px;
  color: #1e4a44 !important;
  background: #e9f4f0;
  font-weight: 650;
}
.phone-notice-actions {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}
.phone-notice-actions .btn { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; }
.phone-notice-foot { margin: 15px 0 0; color: #6b7773; font-size: 11.5px; line-height: 1.4; }

@media (max-height: 620px) {
  .phone-notice { align-items: flex-start; }
  .phone-notice-card { padding-top: 20px; }
  .phone-notice-icon { width: 52px; height: 52px; margin-bottom: 10px; border-radius: 15px; }
  .phone-notice-icon svg { width: 27px; height: 27px; }
}

/* ---- top bar ---- */
.topbar {
  height: 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 16px 20px 0;
  padding: 0 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.btn.btn-wizard-top {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 13px 36px;
  border-radius: 12px;
  box-shadow: 0 3px 14px rgba(15, 118, 110, .5), inset 0 1px 0 rgba(255, 255, 255, .25);
  animation: wizTopPulse 2.6s ease-in-out infinite;
}
@keyframes wizTopPulse {
  0%, 100% { box-shadow: 0 3px 14px rgba(15, 118, 110, .5), 0 0 0 0 rgba(15, 118, 110, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
  50% { box-shadow: 0 3px 14px rgba(15, 118, 110, .5), 0 0 0 8px rgba(15, 118, 110, 0), inset 0 1px 0 rgba(255, 255, 255, .25); }
}
.btn.btn-wizard-top:hover { box-shadow: 0 5px 18px rgba(15, 118, 110, .55), inset 0 1px 0 rgba(255, 255, 255, .25); }
.topbar-title { font-weight: 650; font-size: 15px; color: var(--ink); letter-spacing: .01em; }
.topbar-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; justify-self: start; text-decoration: none; }
.topbar-text { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-sub { font-size: 11px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.topbar-logo { display: block; width: 42px; height: 40px; object-fit: contain; }
.topbar-wordmark { font-size: 22px; font-weight: 800; letter-spacing: .015em; color: #232b3e; white-space: nowrap; }
.topbar-wordmark em { font-style: normal; color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; justify-self: end; }
.topbar-actions a.btn { text-decoration: none; }

/* индикатор «онлайн» у кнопки поддержки: медленное «дыхание» */
.support-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex: none;
  animation: support-dot-breathe 2.6s ease-in-out infinite;
}
@keyframes support-dot-breathe {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .45);
  }
  50% {
    opacity: .45;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
  }
}

/* ---- buttons ---- */
.btn {
  font: inherit;
  font-weight: 550;
  border: 1px solid transparent;
  border-radius: var(--radius-ctrl);
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .08s ease, color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: #eef0ec; }
.btn.small { padding: 5px 10px; font-size: 13px; background: var(--accent-soft); color: var(--accent); }
.btn.small:hover { background: #b3ddd2; }
.btn-xl { padding: 12px 30px; font-size: 16px; font-weight: 650; border-radius: 10px; gap: 9px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.btn.icon-only { padding: 8px; }

/* ---- layout ---- */
.layout {
  flex: 1;
  display: grid;
  /* ширина превью-колонки дополнительно уточняется JS (fitPreview) под портрет 110×140 */
  grid-template-columns: 230px minmax(420px, 1fr) 490px;
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  padding: 12px 20px 20px;
  min-height: 0;
}
.center-col {
  display: grid;
  /* форма — по содержимому (сжимается до скролла только на очень низких окнах),
     инфо-панель — резиновая, забирает всю свободную высоту,
     панель настройки — всегда целиком, без скролла */
  grid-template-rows: minmax(0, auto) minmax(auto, 1fr) auto;
  gap: 12px;
  min-height: 0;
  min-width: 0;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.dirty-flag { font-size: 12px; color: var(--danger); font-weight: 550; }

/* ---- registry ---- */
.search { padding: 12px 16px 10px; }
.kind-sections {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
}
.kind-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.kind-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 8px 7px;
  padding: 8px 12px;
  background: #f3f4f1;
  border: 1px solid #d9ddd8;
  border-radius: var(--radius-ctrl);
}
.kind-head-title { font-size: 12.5px; font-weight: 700; color: var(--accent-hover); }
.kind-head-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.card-list {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.card-list li.li-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  cursor: default;
}
.card-list li.li-empty:hover { background: transparent; }
.card-list li {
  position: relative;
  padding: 9px 84px 9px 10px;
  border-radius: var(--radius-ctrl);
  cursor: pointer;
  line-height: 1.3;
  transition: background .15s ease;
}
.card-list li:hover { background: #eef0ec; }
.card-list li.active { background: var(--accent-soft); }
/* запись без типа (охранник/работник) — красная подсветка, печать заблокирована */
.card-list li.no-kind { background: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger); }
.card-list li.no-kind:hover { background: #fdd7d7; }
.card-list .li-name {
  font-weight: 600;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.li-date {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: opacity .15s ease;
}
.card-list li:hover .li-date { opacity: 0; }
.li-del {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.card-list li:hover .li-del { opacity: 1; }
.li-del:hover { background: var(--danger-soft); color: var(--danger); }
.empty { padding: 28px 18px; text-align: center; }
.empty p { margin: 4px 0; }
.muted { color: var(--muted); font-size: 12.5px; }

.migrate-banner {
  margin: 8px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  background: #fef3c7;
  border-radius: var(--radius-ctrl);
  font-size: 12.5px;
}
.migrate-banner p { margin: 0 0 8px; }
.migrate-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.registry-foot {
  border-top: 1px solid var(--line);
  padding: 10px 14px 12px;
  margin-top: auto;
}
.empty-import {
  font-size: 14.5px;
  padding: 12px 18px;
  margin: 12px 0;
  justify-content: center;
  width: 100%;
  white-space: normal;
  text-align: center;
}
.privacy-note {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.registry-io { display: flex; gap: 8px; }
.registry-io .btn { flex: 1; justify-content: center; }

/* ---- form ---- */
.form-panel form {
  padding: 8px 14px 8px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 3fr 2fr;
  grid-template-areas:
    "worker worker"
    "org boss"
    "issue boss"
    "actions actions";
  gap: 8px 12px;
  align-content: start;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  margin: 0;
  padding: 6px 12px 8px;
  display: grid;
  column-gap: 12px;
  align-content: start;
}
legend {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  padding: 0;
  margin-bottom: 4px;
}
.blk-worker { grid-area: worker; grid-template-columns: repeat(3, 1fr); }
.blk-org { grid-area: org; grid-template-columns: 1fr 1fr; }
/* блок «Руководитель» тянется на 2–3 строки: «Должность» сверху,
   «Инициалы и фамилия» прижаты к низу — на уровне поля «Дата выдачи» */
.blk-boss { grid-area: boss; display: flex; flex-direction: column; }
.blk-boss .field:first-of-type label {
  min-height: 30px;
  display: flex;
  align-items: flex-end;
}
.blk-boss .field:last-child { margin-top: auto; }
.blk-issue { grid-area: issue; display: flex; flex-direction: column; }
.blk-issue .field { margin-top: auto; }

/* едва заметный зеленоватый тон у блоков */
fieldset { background: #f3f4f1; border-color: #d9ddd8; }
.form-panel .panel-head { padding: 10px 16px 9px; }
.field { margin-bottom: 5px; }
.field label { display: block; font-size: 12.5px; font-weight: 550; margin-bottom: 3px; }
.field input.missing { border-color: var(--danger); background: var(--danger-soft); }
input[type="text"], input[type="search"], input[type="number"], select {
  font: inherit;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: #93a39d; }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .15);
}
.date-row { display: flex; gap: 6px; position: relative; }
/* невидимый input под кнопкой: нативный календарь открывается под ней, а не в углу экрана */
.date-pop { position: absolute; right: 0; top: 100%; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.date-row input[type="text"] { flex: 1; }
.date-row .btn { flex: none; }
.form-actions {
  grid-area: actions;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding-top: 2px;
}
.form-actions .primary { flex: 1; justify-content: center; }

/* ---- преднастройка бланка (производитель): резиновая полоса,
   занимает всю свободную высоту центральной колонки ---- */
.preset-panel {
  padding: 7px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
  container-type: size;
}
.preset-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.preset-title { font-weight: 700; font-size: 13px; white-space: nowrap; }
.preset-note { color: #828f8a; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-opts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.preset-opt {
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 3px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-ctrl);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  min-width: 0;
  min-height: 0;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.preset-opt b { font-size: 12.5px; font-weight: 650; line-height: 1.15; }
.preset-opt:hover { border-color: var(--accent); }
.preset-opt.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.preset-opt.active b { color: var(--accent-hover); }

/* переключатель типа карточки: охранник (ЛКО) / работник (ЛКР) */
.kind-switch {
  display: flex;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  background: #eef0ec;
  padding: 3px;
  gap: 3px;
}
.kind-switch.missing { border-color: var(--danger); background: var(--danger-soft); box-shadow: 0 0 0 1px var(--danger); }
.kind-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.kind-opt:hover { color: var(--ink); }
.kind-opt.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(15, 118, 110, .35);
}
.kind-opt .kind-sub {
  font-size: 10.5px;
  font-weight: 500;
  opacity: .75;
}

/* ---- preview ---- */
.preview-head { flex-wrap: wrap; }
.preview-actions { display: flex; gap: 8px; width: 100%; }
.preview-actions .btn { flex: 1; justify-content: center; white-space: nowrap; }
.preview-body {
  position: relative;
  flex: 1;
  min-height: 320px;
  background: #d9ddd8;
  display: flex;
  justify-content: center;
}
.preview-body canvas {
  height: 100%;
  width: auto;
  display: block;
}
.preview-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #d9ddd8;
  z-index: 1;
  transition: opacity .25s ease;
}
.preview-skeleton.gone { opacity: 0; pointer-events: none; }
.preview-skeleton span {
  display: block;
  width: 46%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #d9ddd8 25%, #eef0ec 50%, #d9ddd8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
.preview-skeleton span:nth-child(2) { width: 34%; }
.preview-skeleton span:nth-child(3) { width: 52%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.preview-hint {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

/* ---- панель настройки печати ---- */
.cal-panel { transition: box-shadow .3s ease; }
.cal-panel .panel-head { padding: 10px 16px 9px; }
.cal-settings-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cal-controls-zone {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cal-lockable {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  transition: filter .22s ease, opacity .22s ease, transform .22s ease;
}
.cal-panel.is-locked .cal-lockable {
  filter: blur(4px);
  opacity: .42;
  transform: scale(.995);
  pointer-events: none;
  user-select: none;
}
.cal-panel.is-locked #btnSaveSettings {
  filter: blur(2px);
  opacity: .42;
}
.cal-lock {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 10px 18px;
  background: rgba(238, 240, 236, .2);
  backdrop-filter: blur(1px);
}
.cal-lock[hidden] { display: none; }
.cal-lock-card {
  width: min(550px, 100%);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px 15px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #b3d4c8;
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(30, 74, 68, .16);
}
.cal-lock-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #0f766e;
  background: #e4efe9;
}
.cal-lock-copy { min-width: 0; }
.cal-lock-copy strong { display: block; margin: 0 0 3px; font-size: 14px; color: #173c37; }
.cal-lock-copy p { margin: 0 0 10px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.cal-lock-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-lock-actions .btn { padding: 7px 12px; font-size: 12.5px; }
.cal-panel.flash { box-shadow: 0 0 0 3px rgba(15, 118, 110, .35); }
.cal-body { flex: 1; overflow-y: auto; padding: 8px 14px; }
.cal-table { display: flex; flex-direction: column; }
.cal-foot {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 7px 18px; /* ровно по краям таблицы: текст строк и поле шрифта */
  border-top: 1px solid var(--line);
}

@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
.cal-row { margin-bottom: 18px; }
.cal-row > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.cal-row .muted { margin: 6px 0 0; }
.cal-ctrl { display: flex; align-items: center; gap: 10px; }
.cal-ctrl input[type="range"] { flex: 1; accent-color: var(--accent); }
.cal-ctrl output {
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: #eef0ec;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12.5px;
}

/* per-row calibration sliders */
.rows-cal .muted { margin: 0 0 10px; }
.row-cal {
  display: grid;
  grid-template-columns: 88px 1fr 1fr 54px;
  align-items: center;
  gap: 0 8px;
  padding: 1px 4px;
  border-radius: 6px;
}
.row-cal input[type="range"] { height: 18px; }
.row-cal-name { font-size: 12px; font-weight: 550; }
.row-cal label { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); min-width: 0; overflow: hidden; }
.row-cal input[type="range"] { flex: 1 1 0; min-width: 16px; accent-color: var(--accent); }
.row-cal output {
  flex: none;
  min-width: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: #eef0ec;
  border-radius: 6px;
  padding: 1px 3px;
  font-size: 10.5px;
}
.row-cal-head { color: var(--muted); font-size: 10px; line-height: 1.1; padding: 0 4px; }
.row-cal-head span:not(.row-cal-name) { text-align: center; }
.row-all { background: var(--accent-soft); margin-bottom: 4px; }
.row-all .row-cal-name { font-weight: 700; }
.row-size-wrap { position: relative; display: block; min-width: 0; }
.row-size { width: 100%; min-width: 0; box-sizing: border-box; padding: 3px 16px 3px 6px; font-size: 11.5px; appearance: textfield; -moz-appearance: textfield; }
.row-size::-webkit-inner-spin-button, .row-size::-webkit-outer-spin-button { display: none; }
.row-size-btns {
  position: absolute;
  right: 3px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column;
}
.row-size-btns button {
  border: 0; background: none; cursor: pointer;
  padding: 1px 3px;
  font-size: 7px; line-height: 1.2;
  color: var(--accent);
  border-radius: 3px;
}
.row-size-btns button:hover { background: var(--accent-soft); }
/* ---- окно подстройки по пробе ---- */
.modal.calib-modal.calib7 {
  width: 1382px;
  height: 846px;
  max-width: none;
  max-height: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.calib7-head { display: flex; align-items: center; gap: 12px; padding: 9px 14px 8px; flex: none; }
.calib7-head-text {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(220px, .7fr) minmax(360px, 1fr);
  align-items: center;
  gap: 12px;
}
.calib7-head h2 {
  margin: 0;
  white-space: nowrap;
  font-family: Georgia, "PT Serif", "Times New Roman", serif;
  font-size: 19px;
  color: #1e4a44;
}
.calib7-lead { margin: 0 !important; font-size: 12.5px !important; line-height: 1.3; color: var(--muted); }
.calib7-warn {
  margin: 0 !important;
  padding: 6px 10px;
  background: #e9f2ee;
  border-left: 3px solid #0f766e;
  border-radius: 7px;
  font-size: 11.5px !important;
  line-height: 1.3;
  color: #173c37;
}
.calib7-warn b { font-weight: 800; }
.calib7-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(680px, 58%) minmax(0, 1fr); /* левая колонка ещё шире: карточки-подсказки крупнее */
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  padding: 0 12px 10px;
  overflow: hidden;
}
.calib7-left {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.calib7-listcol {
  flex: none;
  min-width: 0;
  min-height: 0;
  max-height: 272px; /* при большом числе полей список скроллится, а не сжимает гайды — текст шага 2 должен помещаться */
  padding: 7px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f4f1;
}
.calib7-left .calib7-h { margin-bottom: 4px; }
.calib7-left .calib-list { gap: 4px; }
.calib7-left .calib-list li { padding: 5px 22px 5px 10px; }
.calib7-left .calib-li-name { font-size: 12.5px; }
.calib7-left .calib-li-pos { font-size: 11px; }
/* пустая строка — в одну линию: название слева, «Нет текста» справа */
.calib7-left .calib-list li.empty { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.calib7-left .calib-list li.empty .calib-li-name { display: inline; }
.calib7-left .calib-list li.sel::after { top: 5px; font-size: 14px; }
.calib7-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto; /* фото сверху во всю ширину, текст снизу */
  align-items: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px;
  background: #fff;
}
.calib7-card .calib7-how { margin: 0; }
.calib7-card .calib7-how-text p { margin: 0 0 4px; line-height: 1.3; }
.calib7-guide-img {
  display: block;
  width: 100%;   /* ровно по ширине карточки — без пустых полей по бокам */
  height: auto;  /* высота по пропорции картинки, целиком */
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0f5f1;
  cursor: zoom-in;
}
.calib7-imgwrap { position: relative; }
.calib7-zoomhint {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(28, 36, 34, .62);
  color: #fff;
  pointer-events: none; /* клик проходит к картинке */
  transition: background .15s ease;
}
.calib7-imgwrap:hover .calib7-zoomhint { background: rgba(255, 255, 255, .92); color: var(--accent); }

/* картинка-подсказка на весь экран по клику */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(28, 36, 34, .88);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.img-lightbox img {
  width: 1354px;
  height: 846px;
  object-fit: contain; /* апскейл до экрана, пропорции сохраняются */
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
}
.calib7-h { margin: 0 0 6px; font-size: 14px; font-weight: 650; color: #1e4a44; }
.calib7-how { display: flex; gap: 9px; }
.calib7-how .w1-num { width: 26px; height: 26px; font-size: 12.5px; margin-top: 2px; }
.calib7-how-text { flex: 1; min-width: 0; }
.calib7-how-text p { margin: 0 0 5px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.calib7-how-title { font-weight: 650; font-size: 13px !important; color: #1e4a44 !important; }
.calib7-left .calib7-how-text p:not(.calib7-how-title) { font-size: 12px; line-height: 1.3; }
.calib7-left .calib7-how-title { font-size: 14px !important; line-height: 1.3 !important; }
.calib7-how-em { font-weight: 650; color: #173c37 !important; }
.img-placeholder {
  aspect-ratio: 4 / 3;
  margin-top: 6px;
  background: #f0f5f1;
  border: 1.5px dashed #8dbbab;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  color: #7d9a90;
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
}
.calib7-next {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  background: #e9f2ee;
  border: 1px solid #a8cfc2;
  border-radius: 10px;
  padding: 4px 8px;
}
.calib7-next > .w1-num { width: 26px; height: 26px; font-size: 12px; }
.calib7-next-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.calib7-next-copy > strong { display: block; margin: 0; color: #173c37; font-size: 12px; line-height: 1.25; }
.calib7-next-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.modal.calib7 .calib7-next p { margin: 0; font-size: 10.5px; line-height: 1.25; color: var(--muted); }
.modal.calib7 .calib7-next p b { color: #173c37; font-weight: 750; }
.calib7-next-tag {
  display: inline-flex;
  margin-right: 3px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.calib7-next-tag.retry { color: #115e59; background: #dcf0ea; }
.calib7-next-tag.done { color: #166534; background: #dcfce7; }
.calib7-guides {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* карточки рядом, картинка во всю ширину карточки */
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: end; /* прижаты к низу левой колонки */
  gap: 6px;
}
.calib7-card { height: 100%; }
.calib7-next { grid-column: 1 / -1; }
.calib7-stage-wrap { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.calib7-stage-head { min-height: 30px; display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 5px; margin-bottom: 5px; }
.calib7-stage-head .calib7-h { margin: 0; }
.calib7-stage-tools { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calib-precision-tip {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  width: min(340px, calc(100% - 24px));
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid #a8cfc2;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: rgba(240, 247, 244, .97);
  backdrop-filter: blur(5px);
  box-shadow: 0 8px 24px rgba(30, 74, 68, .18);
  animation: precision-tip-in .22s cubic-bezier(.16, 1, .3, 1);
}
.calib-precision-tip[hidden] { display: none; }
@keyframes precision-tip-in { from { transform: translate(-50%, calc(-50% + 12px)); opacity: 0; } }
.calib-precision-mouse {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #fff;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px #c6dcd2;
}
.calib-precision-tip strong { display: block; margin-bottom: 2px; color: #173c37; font-size: 13px; }
.calib-precision-tip p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.calib-precision-tip .btn { margin-top: 9px; padding: 5px 12px; }

.calib-position-warning {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: start;
  gap: 14px;
  padding: 12px 12px 12px 16px;
  border: 2px solid #dc2626;
  border-left-width: 6px;
  border-radius: 12px;
  background: rgba(255, 247, 247, .98);
  backdrop-filter: blur(7px);
  box-shadow: 0 10px 30px rgba(220, 38, 38, .22);
  animation: position-warning-in .22s cubic-bezier(.16, 1, .3, 1);
}
.calib-position-warning[hidden] { display: none; }
@keyframes position-warning-in { from { transform: translateY(14px); opacity: 0; } }
.calib-position-warning-badge {
  display: inline-flex;
  margin-bottom: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.calib-position-warning strong { display: block; margin-bottom: 4px; color: #7f1d1d; font-size: 14px; line-height: 1.25; }
.calib-position-warning p { margin: 0; color: #3f1d1d; font-size: 12px; line-height: 1.4; }
.calib-position-warning p b { color: #991b1b; font-weight: 800; }
.calib-position-warning-avoid {
  padding: 1px 5px;
  border-radius: 5px;
  color: #b91c1c;
  background: #fee2e2;
  box-shadow: inset 0 0 0 1px #fecaca;
  font-weight: 800;
  white-space: nowrap;
}
.calib-position-warning-result {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 6px;
  color: #991b1b;
  background: #fee2e2;
  box-shadow: inset 0 0 0 1px #fecaca;
  font-weight: 750;
}
.calib-position-warning-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  background: #fff;
  color: #b91c1c;
  font: 400 29px/1 var(--font);
  cursor: pointer;
}
.calib-position-warning-close:hover { color: #fff; background: #dc2626; border-color: #dc2626; }
.calib7-zoom { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.calib7-zoom button {
  height: 26px;
  min-width: 30px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: #1e4a44;
  font: 650 12px/1 var(--font);
  cursor: pointer;
}
.calib7-zoom button:last-child { border-right: 0; }
.calib7-zoom button:hover { background: var(--accent-soft); color: var(--accent); }
#btnCalibZoomReset { min-width: 52px; font-variant-numeric: tabular-nums; }
.calib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.calib-list li {
  position: relative;
  padding: 7px 24px 7px 9px;
  border-radius: var(--radius-ctrl);
  cursor: pointer;
  line-height: 1.3;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(28, 36, 34, .05);
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease, transform .12s ease;
}
.calib-list li:hover { border-color: var(--accent); transform: translateX(2px); }
.calib-list li.sel {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.calib-list li.sel .calib-li-name { color: var(--accent); }
.calib-list li.sel::after {
  content: "\2192";
  position: absolute;
  right: 9px;
  top: 6px;
  color: var(--accent);
  font-weight: 700;
}
.calib-list li.empty { opacity: .45; }
.calib-li-name { font-weight: 600; font-size: 12.5px; display: block; }
.calib-li-pos { font-size: 11px; color: #6b7773; font-variant-numeric: tabular-nums; }
.calib-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2eae5;
  border: 1px solid #d2dcd6;
  border-radius: 10px;
  cursor: grab;
  touch-action: none;
}
.calib-stage.panning { cursor: grabbing; }
.calib-canvas {
  position: relative;
  display: inline-block;
  flex: none;
  line-height: 0;
  transform-origin: center center;
  will-change: transform;
}
#calibImg { display: block; max-width: none; max-height: none; border: 1px solid var(--line); border-radius: 6px; user-select: none; -webkit-user-drag: none; }
.calib7-legend { margin: 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.calib7-lg { display: inline-block; flex: none; width: 24px; height: 16px; border-radius: 4px; margin-left: 10px; }
.calib7-lg:first-child { margin-left: 0; }
.calib7-lg-sel { border: 2px solid #0f766e; background: rgba(15, 118, 110, .12); }
.calib7-lg-base { border: 1.5px dashed #93a39d; background: transparent; }
.calib-chip {
  position: absolute;
  background: rgba(15, 118, 110, .08);
  outline: 1px solid rgba(15, 118, 110, .5);
  border-radius: 3px;
  padding: 0;
  cursor: grab;
  overflow: visible;
  user-select: none;
  touch-action: none;
}
.calib-chip-text { display: block; }
.calib-chip.sel {
  background: rgba(15, 118, 110, .12);
  outline: 2px solid #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .25);
}
.calib-chip.drag { cursor: grabbing; opacity: .9; }
.calib-base {
  position: absolute;
  border: 1.5px dashed #93a39d;
  border-radius: 3px;
  pointer-events: none;
}
.calib7-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex: none;
}
.calib7-foot-l, .calib7-foot-r { display: flex; gap: 8px; }

body.calib-open .wizard,
body.calib-open .wizard-backdrop { visibility: hidden; }

.row-size.auto {
  color: var(--accent);
  font-weight: 700;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cal-arr { color: var(--accent); font-size: 13px; font-weight: 700; flex: none; }
.cal-axis-y { border-left: 1px dashed var(--line); padding-left: 8px; }
.row-cal-head span:nth-child(2) { color: var(--accent); }

/* ---- modal ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(28, 36, 34, .32);
  display: grid;
  place-items: center;
  z-index: 50;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
  padding: 22px;
  width: 360px;
  animation: drawer-in .18s cubic-bezier(.16, 1, .3, 1);
}
.modal p { margin: 0 0 18px; font-size: 14.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* обязательное пояснение перед шагом 7 */
.calib-intro-backdrop { z-index: 70; background: rgba(28, 36, 34, .56); }
.modal.calib-intro {
  width: 680px;
  max-height: 846px;
  padding: 0;
  overflow-y: auto;
  border: 1px solid rgba(245, 158, 11, .38);
  box-shadow: 0 28px 80px rgba(28, 36, 34, .32), 0 5px 16px rgba(28, 36, 34, .14);
}
.calib-intro-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 15px;
}
.calib-intro-icon {
  width: 50px;
  height: 50px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #b45309;
  background: #fff4d6;
}
.calib-intro-step {
  display: block;
  margin-bottom: 3px;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.calib-intro h2 { margin: 0; color: #173c37; font-size: 21px; line-height: 1.25; }
.modal.calib-intro .calib-intro-main {
  margin: 0 24px 15px;
  padding: 14px 16px;
  border: 1px solid #f3cf79;
  border-left: 5px solid #d97706;
  border-radius: 10px;
  background: #fff8e6;
  color: #66470c;
  font-size: 15.5px;
  line-height: 1.45;
}
.calib-intro-main strong { color: #8a4b08; font-weight: 800; }
.calib-intro-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0 24px;
  list-style: none;
}
.calib-intro-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; }
.calib-intro-list li > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e4efe9;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
}
.calib-intro-list b { display: block; margin-bottom: 1px; color: #173c37; font-size: 13.5px; }
.calib-intro-list small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.calib-intro-reminder {
  margin: 15px 24px 0;
  padding: 10px 13px;
  border-radius: 9px;
  background: #e9f2ee;
  color: #173c37;
  font-size: 13.5px;
  text-align: center;
}
.calib-intro-reminder em { color: #b45309; font-style: normal; font-weight: 800; }
.calib-intro-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 24px 22px;
}
.calib-intro-actions .btn { padding: 10px 17px; }

/* окно проверки настроек печати перед повторной пробой */
.modal.print-check {
  width: 580px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(147, 163, 157, .32);
  box-shadow: 0 24px 70px rgba(28, 36, 34, .2), 0 4px 12px rgba(28, 36, 34, .08);
}
.pcheck-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 21px 24px 11px;
}
.pcheck-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--accent);
  background: var(--accent-soft);
}
.modal.print-check .pcheck-step {
  margin: 0 0 3px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--accent);
}
.modal.print-check h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  color: #1e4a44;
}
.modal.print-check .pcheck-sub {
  margin: 0;
  padding: 0 24px 16px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}
.pcheck-list {
  margin: 0 24px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: #f3f4f1;
}
.pcheck-row {
  display: grid;
  grid-template-columns: 22px minmax(150px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 8px 13px;
  color: #3a4744;
  font-size: 13.5px;
}
.pcheck-row + .pcheck-row { border-top: 1px solid var(--line); }
.pcheck-row::before {
  content: "✓";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 800;
}
.pcheck-row strong {
  color: #173c37;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pcheck-kind-row { background: var(--accent-soft); }
.pcheck-kind-row strong { color: var(--accent-hover); font-weight: 700; }
.pcheck-kind-warn { color: var(--danger) !important; }
.pcheck-warn {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 24px 18px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #854d0e;
}
.pcheck-warn svg { flex: none; margin-top: 1px; }
.pcheck-actions {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line);
  background: #f3f4f1;
}
.pcheck-actions .btn {
  justify-content: center;
  min-height: 42px;
  padding-left: 12px;
  padding-right: 12px;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}

/* ---- пейволл: плашка оплаты перед печатью ---- */
.modal.paywall {
  width: 460px;
  padding: 0;
  overflow: hidden;
  max-height: 864px; /* холст 900px: с формой аккаунта контента больше — скроллится внутри */
  overflow-y: auto;
  border: 1px solid rgba(147, 163, 157, .32);
  box-shadow: 0 24px 70px rgba(28, 36, 34, .2), 0 4px 12px rgba(28, 36, 34, .08);
}
.pay-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 2px 24px 10px;
  padding: 10px 16px;
  background: var(--accent-soft);
  border-radius: 11px;
}
.pay-amount {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-hover);
  font-variant-numeric: tabular-nums;
}
.pay-period {
  font-size: 14px;
  color: var(--accent);
}
.pay-cancel {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}
.pay-benefits {
  margin: 0 24px 10px;
  padding: 0;
  list-style: none;
}
.pay-benefits li {
  position: relative;
  padding: 2px 0 2px 27px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #3a4744;
}
.pay-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dcfce7;
  color: #15803d;
  font-size: 10.5px;
  font-weight: 800;
}
.pay-methods {
  margin: 0 24px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: #f3f4f1;
}
.pay-method {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name soon" "note soon";
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 13px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: not-allowed;
}
.pay-method:first-child { border-top: 0; }
.pay-method-name {
  grid-area: name;
  font-size: 13.5px;
  font-weight: 650;
  color: #173c37;
}
.pay-method-note {
  grid-area: note;
  font-size: 12px;
  color: var(--muted);
}
.pay-soon {
  grid-area: soon;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.pay-foot {
  margin: 0;
  padding: 0 24px 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.pay-account {
  margin: 0 24px 14px;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdfb;
}
.pay-account-title {
  margin: 0 0 10px !important;
  font-size: 12px !important;
  font-weight: 650;
  color: #1e4a44;
}
.pay-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 10px;
  padding: 3px;
  border-radius: 9px;
  background: #eef2ee;
}
.pay-tab {
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.pay-tab.active { background: #fff; color: var(--accent-hover); box-shadow: 0 1px 3px rgba(28, 36, 34, .12); }
.pay-account .field { margin-bottom: 8px; }
.pay-account .field label { font-size: 12px; color: #3a4744; }
.pay-account input[type="email"],
.pay-account input[type="password"],
.pay-account input[type="text"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13.5px;
  color: inherit;
}
.pay-account input:focus { outline: 2px solid rgba(15, 118, 110, .35); border-color: var(--accent); }
.pay-auth-error {
  margin: 0 0 8px !important;
  font-size: 12.5px !important;
  color: #b91c1c;
}
.pay-auth-submit { width: 100%; margin-top: 2px; }
.pay-profile-email {
  margin: 0 0 4px !important;
  font-size: 13.5px !important;
  font-weight: 700;
  color: #173c37;
  word-break: break-all;
}
.pay-profile-sub {
  margin: 0 0 10px !important;
  font-size: 12.5px !important;
  line-height: 1.4;
  color: var(--muted);
}
.modal.paywall .pcheck-actions {
  grid-template-columns: minmax(0, 1fr);
}

/* ---- printer guide (SVG-схема лотка) ---- */
.guide-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 6px;
}
.guide-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.guide-svg { display: block; width: 100%; height: auto; padding: 0 8px; }
.guide-svg text { font-family: var(--font); }
.gd-feed { animation: gd-feed 6s ease-in-out infinite; }
@keyframes gd-feed {
  0% { transform: translateY(0); opacity: 1; }
  40% { transform: translateY(0); opacity: 1; }
  62% { transform: translateY(-340px); opacity: 1; }
  73% { transform: translateY(-340px); opacity: 1; }
  74% { transform: translateY(-340px); opacity: 0; }
  75% { transform: translateY(0); opacity: 0; }
  90% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ---- proof modal ---- */
.proof-title { margin: 0 0 6px; font-size: 15px; font-weight: 650; }
.proof-row { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.proof-row label { font-size: 13px; font-weight: 550; }
.proof-row .spin-wrap { position: relative; display: inline-block; width: 84px; }
.proof-row .spin-wrap input { width: 100%; box-sizing: border-box; padding-right: 18px; appearance: textfield; -moz-appearance: textfield; }
.proof-row .spin-wrap input::-webkit-inner-spin-button,
.proof-row .spin-wrap input::-webkit-outer-spin-button { display: none; }

/* ---- import help modal ---- */
.import-help-modal { width: 480px; padding: 0; }
.import-help-body { padding: 4px 18px 6px; }
.import-help-modal .ih-label {
  margin: 10px 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.import-help-modal .ih-label:first-child { margin-top: 2px; }
.import-help-modal .ih-formats { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0; align-items: center; }
.import-help-modal .ih-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.import-help-modal .ih-text { margin: 0 0 10px; font-size: 13px; line-height: 1.45; }
.import-help-modal .ih-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  overflow: hidden;
  margin-bottom: 10px;
}
.import-help-modal .ih-table th, .import-help-modal .ih-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.import-help-modal .ih-table th { background: #f3f4f1; color: var(--muted); font-weight: 650; }
.import-help-modal .ih-table tr:last-child td { border-bottom: 0; }
.import-help-modal .ih-table .ih-skip { color: #93a39d; font-style: italic; }
.import-help-actions { padding: 12px 18px 16px; }

/* ---- csv import modal ---- */
.csv-modal { width: 430px; max-height: 846px; overflow-y: auto; }
.csv-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  background: #fff;
  margin: 0 0 12px;
}
.csv-list-head, .csv-list-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr 0.85fr;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
}
.csv-list-head {
  font-weight: 650;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #f3f4f1;
  border-radius: var(--radius-ctrl) var(--radius-ctrl) 0 0;
}
.csv-list-body { max-height: 150px; overflow-y: auto; }
.csv-list-row:nth-child(even) { background: #f3f4f1; }
.csv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.csv-common {
  background: #f3f4f1;
  border: 1px solid #d9ddd8;
  border-radius: 10px;
  padding: 10px 12px 4px;
  margin-bottom: 12px;
}
.csv-common-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

/* ---- toast ---- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #f3f4f1;
  padding: 10px 18px;
  border-radius: var(--radius-ctrl);
  font-size: 13.5px;
  z-index: 60;
  animation: toast-in .25s cubic-bezier(.16, 1, .3, 1);
  box-shadow: 0 8px 28px rgba(28, 36, 34, .3);
}
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }

/* ---- переключатель бланка ---- */
.blank-switch select { width: 150px; }

/* ---- редактор разметки полей ---- */
.markup-modal {
  background: var(--surface);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
  width: 1120px;
  height: 846px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawer-in .18s cubic-bezier(.16, 1, .3, 1);
}
.markup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.markup-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.markup-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.markup-head-right .btn { padding: 6px 12px; font-size: 13px; }
.markup-blank-switch { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 550; }
.markup-blank-switch select { width: 120px; padding: 6px 8px; }
.markup-body {
  flex: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 0;
}
.markup-side {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.markup-side .muted { margin: 0 0 12px; line-height: 1.45; }
.markup-fields { list-style: none; margin: 0 0 12px; padding: 0; }
.markup-fields li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-ctrl);
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  border: 1px solid transparent;
}
.markup-fields li:hover { background: #eef0ec; }
.markup-fields li.armed { border-color: var(--accent); background: var(--accent-soft); }
.markup-fields li.selected { background: var(--accent-soft); }
.mk-chip { width: 16px; height: 4px; border-radius: 2px; flex: none; }
.mk-label { flex: 1; }
.mk-state { color: var(--muted); font-weight: 400; }
.markup-canvas-wrap {
  background: #d9ddd8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  min-height: 0;
}
#markupCanvas { display: block; box-shadow: 0 4px 18px rgba(28, 36, 34, .25); cursor: crosshair; margin: auto; }
.markup-canvas-wrap.zoomed { justify-content: flex-start; align-items: flex-start; }
.markup-zoom { display: flex; align-items: center; gap: 2px; }
.markup-zoom .btn { min-width: 34px; padding-left: 8px; padding-right: 8px; }
#markupZoomVal { display: inline-block; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
/* ---- responsive: внутренней перестройки нет; весь холст масштабируется целиком ---- */

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

/* ---- wizard: пошаговый мастер ---- */
.wizard {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 500px;
  max-height: 780px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: 0 12px 44px rgba(28, 36, 34, .22);
  z-index: 45;
  animation: wiz-in .25s cubic-bezier(.16, 1, .3, 1);
}
@keyframes wiz-in { from { transform: translateY(16px); opacity: 0; } }
.wiz-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 10px;
}
/* слева — название этапа, по центру — плашка «Калибровка печати»,
   справа — кнопки свернуть/закрыть; подпись переносится на 2-ю строку,
   чтобы в узком окне не сдвигать плашку от центра */
.wiz-heading {
  grid-column: 2;
  justify-self: center;
  white-space: nowrap;
}
.wiz-purpose {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid #99d5ca;
  border-radius: 9px;
  background: #d9f0ea;
  color: #115e59;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}
.wiz-purpose svg { flex: none; width: 19px; height: 19px; }
.wiz-step-label {
  grid-column: 1;
  justify-self: start;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--muted);
}
.wiz-head-btns { grid-column: 3; justify-self: end; display: flex; gap: 4px; }
.wiz-head-btns .btn { padding: 6px; }
.wiz-progress {
  height: 5px;
  margin: 0 18px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.wiz-progress div { height: 100%; background: var(--accent); transition: width .25s ease; }
.wiz-body {
  padding: 16px 18px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.5;
}
.wiz-body h3 { margin: 0 0 10px; font-size: 17px; font-weight: 650; }
.wiz-body p { margin: 0 0 10px; }
.wiz-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
}
.wiz-note { font-size: 13px; color: var(--muted); }
.wiz-choice { display: flex; flex-direction: column; gap: 8px; }
.wiz-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
}
.wiz-foot .btn { padding: 9px 18px; font-size: 14px; }
#wizBack { margin-right: auto; }
.wizard.min .wiz-progress,
.wizard.min .wiz-body,
.wizard.min .wiz-foot { display: none; }

.wiz-highlight {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-ctrl);
  animation: wiz-pulse 1.6s ease-in-out infinite;
}
@keyframes wiz-pulse { 50% { outline-color: rgba(15, 118, 110, .25); } }

/* ---- wizard: режим первого визита (по центру, остальное затемнено) ---- */
.wizard-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 36, 34, .48);
  z-index: 39;
  pointer-events: none;
}
.wizard.center {
  --wiz-scale: 1;
  left: 50%;
  top: 50%;
  bottom: auto;
  width: 680px;
  max-height: none;
  transform: translate(-50%, -50%) scale(var(--wiz-scale));
  transform-origin: center center;
  will-change: transform;
  animation: wiz-in-center .28s cubic-bezier(.16, 1, .3, 1);
}
@keyframes wiz-in-center {
  from { transform: translate(-50%, calc(-50% + 18px)) scale(var(--wiz-scale)); opacity: 0; }
}
.wizard.center .wiz-purpose { font-size: 19px; padding: 8px 16px; }
.wizard.center .wiz-purpose svg { width: 21px; height: 21px; }
.wizard.center .wiz-step-label { font-size: 13.5px; }
.wizard.center .wiz-body { font-size: 16.5px; padding: 20px 24px; }
.wizard.center .wiz-body h3 { font-size: 19px; }
.wizard.center .wiz-note { font-size: 14px; }
.wizard.center .wiz-foot { padding: 14px 24px 20px; }
.wizard.center .wiz-foot .btn { padding: 12px 22px; font-size: 15.5px; }

/* ---- wizard: широкие экраны шагов 1–6 (три карточки) ---- */
.wizard.center.wide { width: 1360px; max-height: none; }
.wizard.center.wide .wiz-head { padding: 14px 32px 10px; }
.wizard.center.wide .wiz-progress { margin: 0 32px; }
.wizard.center.wide .wiz-body { padding: 14px 32px 16px; overflow: visible; font-size: 17px; }
.wizard.center.wide .wiz-foot { padding: 12px 32px 16px; }
.wizard.center.wide .wiz-foot .btn { padding: 13px 26px; font-size: 16.5px; }
.wizard.center.wide #wizNext {
  background: #fff;
  color: #0f766e;
  border: 1.5px solid #8dbbab;
}
.wizard.center.wide #wizNext:hover { background: #eaf3ef; }
.wizard.center.wide .wiz-print { background: #0f766e; }
.wizard.center.wide .wiz-print:hover { background: #115e59; }
.wizard.center.wide.compact-bottom .wiz-body { padding-bottom: 4px; }
.wizard.center.wide.compact-bottom .wiz-foot { padding-top: 6px; padding-bottom: 10px; }

/* степпер количества пробников — больше не используется (удалён из мастера 18.09) */

.wizard .wiz-body h3.w1-title {
  margin: 2px 0 8px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .01em;
  color: #173c37;
}
.w1-sub { margin: 0 0 12px; font-size: 18px; color: var(--muted); }
/* ---- шаг 0: выбор изготовителя бланка ---- */
.w0-grid { display: grid; grid-template-columns: 5fr 6fr; gap: 28px; align-items: start; }
.w0-col-title { margin: 0 0 12px; font-size: 18px; font-weight: 750; color: var(--ink); }
.w0-fig {
  margin: 0 0 12px;
  padding: 18px 18px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f8f6;
}
.w0-fig img { display: block; width: 100%; max-width: 400px; height: auto; margin: 0 auto; border-radius: 10px; }
.w0-cap { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.w0-opts { display: flex; flex-direction: column; gap: 10px; }
.w0-opt {
  font: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.w0-opt:hover { border-color: #8dbbab; }
.w0-opt-name { flex: 1; }
.w0-radio {
  flex: none;
  position: relative;
  width: 22px;
  height: 22px;
  border: 2px solid #b9c2bd;
  border-radius: 50%;
  transition: border-color .15s ease;
}
.w0-opt.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.w0-opt.active .w0-radio { border-color: var(--accent); }
.w0-opt.active .w0-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.w0-opt[data-preset="custom"] { border-style: dashed; border-color: #8dbbab; }
.w0-opt[data-preset="custom"].active { border-style: solid; }
.w0-opt-note { margin: 2px 4px 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.w1-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.w1-cards-proof { row-gap: 12px; }
.w1-cards-proof .w1-card img { height: auto; aspect-ratio: 4 / 3; }
.w1-cards:not(.w1-cards-proof) .w1-card { min-height: 570px; }
.w1-cards:not(.w1-cards-proof) .w1-card > :last-child { margin-top: auto; }
.w1-cards:not(.w1-cards-proof) .w1-card img { height: auto; aspect-ratio: 4 / 3; }
.w1-cards-proof .w1-card:first-child { grid-row: 1 / 3; }
.w1-cards-proof .w1-memo { grid-column: 2 / 4; grid-row: 2; margin: 0; }
.w1-card {
  background: #fff;
  border: 1px solid #d3e4dc;
  border-radius: 17px;
  box-shadow: 0 2px 10px rgba(30, 74, 68, .08);
  padding: 20px 20px 14px;
  display: flex;
  flex-direction: column;
}
.w1-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.w1-head-text { display: flex; flex-direction: column; gap: 2px; }
.w1-step-cap {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7773;
}
.w1-num {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: #134e4a;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
}
.w1-card-title { font-weight: 650; font-size: 17.5px; color: #1e4a44; line-height: 1.25; }
.w1-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  margin: 0 0 8px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 1px #d3e4dc;
}
.w1-card p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.45; }

/* иллюстрация в шаге «Контрольный прогон» — как карточки мастера */
.wiz-final { margin: 14px 0; }
.wiz-final img {
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 1px #d3e4dc;
}
.w1-card-print {
  align-self: stretch;
  margin-top: auto;
  width: 100%;
  justify-content: center;
  transform: translateY(9px);
  padding: 13px 16px;
  font-size: 15px;
}
/* действия внутри карточки (шаг 5): кнопка прижата к низу и по центру */
.w1-actions { margin-top: auto; padding-top: 14px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.w1-actions .w1-print { flex: 1; justify-content: center; padding: 13px 18px; font-size: 15.5px; }
/* степпер количества макетов слева от кнопки (шаг 1) */
.w1-qty {
  flex: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}
.w1-qty input {
  width: 42px;
  border: 0;
  text-align: center;
  font: 650 15.5px/1 system-ui, sans-serif;
  color: #1e4a44;
  padding: 12px 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.w1-qty input::-webkit-outer-spin-button,
.w1-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.w1-qty-btn {
  border: 0;
  background: #e9f2ee;
  color: #0f766e;
  font-size: 17px;
  font-weight: 700;
  padding: 12px 12px;
  cursor: pointer;
}
.w1-qty-btn:hover { background: #d9f0ea; }
.w1-memo {
  margin: 16px 0 6px;
  padding: 15px 20px;
  background: #d9f0ea;
  border: 1.5px solid #5eead4;
  border-left: 5px solid #0f766e;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #173c37;
  display: flex;
  align-items: center;
  gap: 12px;
}
.w1-memo > span { min-width: 0; white-space: nowrap; }
.w1-memo svg { flex: none; color: #0f766e; width: 20px; height: 20px; }
.w1-memo b { font-weight: 800; }
.w1-memo-badge {
  display: inline-block;
  flex: none;
  background: #0f766e;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: 6px;
  padding: 5px 10px;
  margin-right: 2px;
}
.w1-memo-text { flex: 1; }

/* объединённая страница мастера «Пробная печать» (шаги 4–6) */
.w1-card p + p { margin-top: 9px; }
.w1-card-note { font-size: 14px !important; color: #828f8a !important; }
.w1-chip {
  background: #e9f2ee;
  border: 1px solid #cfe3da;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px !important;
  color: #1e4a44 !important;
}
.w1-chip b { font-weight: 800; }
.w1-warn {
  background: #fff8e6;
  border: 1px solid #f3e2b3;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px !important;
  color: #8a6d1a !important;
  line-height: 1.4 !important;
}

/* На фиксированном холсте полоса пресетов не должна превращаться в узкую
   щель. Резервируем ей полноценную высоту, а недостающие пиксели без потери
   содержимого забираем из лишних внутренних отступов формы и калибровки. */
body.app-fixed-scale .center-col {
  grid-template-rows: minmax(0, auto) minmax(110px, 1fr) auto;
}
body.app-fixed-scale .form-panel .panel-head,
body.app-fixed-scale .cal-panel .panel-head { padding: 8px 16px 7px; }
body.app-fixed-scale .form-panel form { padding: 6px 14px; gap: 7px 12px; }
body.app-fixed-scale fieldset { padding: 5px 12px 7px; }
body.app-fixed-scale legend { margin-bottom: 3px; }
body.app-fixed-scale .field { margin-bottom: 4px; }
body.app-fixed-scale input[type="text"],
body.app-fixed-scale input[type="search"],
body.app-fixed-scale input[type="number"],
body.app-fixed-scale select { padding: 6px 10px; }
body.app-fixed-scale .form-actions .btn { padding: 6px 12px; }
body.app-fixed-scale .cal-body { padding: 6px 14px; }
body.app-fixed-scale .cal-foot { padding: 5px 18px; }

/* «Свой вариант» — выделенный пресет: пунктирная акцентная рамка */
.preset-opt small { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.preset-opt[data-preset="custom"] {
  border-style: dashed;
  border-color: var(--accent);
  background: #f0f7f4;
  color: var(--accent-hover);
}
.preset-opt[data-preset="custom"]:hover { background: var(--accent-soft); }
.preset-opt[data-preset="custom"].active {
  border-style: solid;
  background: var(--accent-soft);
}

/* ---- «Свой вариант»: intro и экран обрезки скана ---- */
.custom-intro-have {
  margin: 10px 0 0;
  padding: 6px 10px;
  background: #fdf6e5;
  border-left: 3px solid #b45309;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.35;
  color: #5b3a0e;
}

/* кроп: левая колонка узкая (только подписи), сцена широкая */
.modal.calib-modal.crop7 .calib7-body {
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
}
.crop-help { margin: 0; }
.crop-help li { margin-bottom: 10px; }

/* рамка обрезки: пропорции бланка 110×140, затемнение вокруг */
.crop-rect {
  position: absolute;
  box-sizing: border-box;
  aspect-ratio: 110 / 140;
  border: 2px solid #0f766e;
  border-radius: 2px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 20, 0.55);
  cursor: move;
  outline: none;
  touch-action: none;
}
.crop-rect:focus-visible { border-color: #0d9488; }
.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid #0f766e;
  border-radius: 3px;
  touch-action: none;
}
.crop-handle[data-h="nw"] { left: -8px;  top: -8px;    cursor: nwse-resize; }
.crop-handle[data-h="ne"] { right: -8px; top: -8px;    cursor: nesw-resize; }
.crop-handle[data-h="sw"] { left: -8px;  bottom: -8px; cursor: nesw-resize; }
.crop-handle[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }

#cropImg { display: block; max-width: none; max-height: none; border: 1px solid var(--line); border-radius: 6px; user-select: none; -webkit-user-drag: none; }

/* переключатель режима ФИО в редакторе разметки (custom) */
.mk-fio-mode {
  margin: 0 0 8px;
  padding: 7px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f4f1;
  display: grid;
  gap: 5px;
  font-size: 12.5px;
}
.mk-fio-mode legend { font-size: 11px; color: var(--muted); padding: 0 4px; }
.mk-fio-mode label { display: flex; align-items: baseline; gap: 6px; cursor: pointer; line-height: 1.3; }
