/* ===== assets/css/calc.css ===== */
/* Калькулятор лазерной резки pskapex.ru — стили блока и счёта.
   Палитра и шрифты — из боевого сайта (html[data-theme="forge"]), без внешних файлов.
   Токены префиксом --cl-*, чтобы не конфликтовать со стилями сайта. */

/* ---------- Демо-страница превью (на боевом сайте не используется) ---------- */
html.cl-demo, body.cl-demo-page {
  margin: 0;
  background: #0D0A0A;
  color: #FBF5F3;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  color-scheme: dark;
}
body.cl-demo-page { min-height: 100vh; }
body.cl-demo-page .section { border-bottom: 1px solid var(--line, #2F2426); padding: 0; }

/* ---------- Токены ---------- */
.cl-calc {
  /* Только переменные сайта (тема forge) с fallback — без хардкода палитры */
  --cl-bg: var(--bg, #0D0A0A);
  --cl-panel: var(--panel, #161112);
  --cl-panel-2: var(--panel-2, #1D1617);
  --cl-line: var(--line, #2F2426);
  --cl-line-strong: var(--line-strong, #4C3639);
  --cl-text: var(--text, #FBF5F3);
  --cl-muted: var(--muted, #C8B9B5);
  --cl-faint: var(--faint, #7F6E69);
  --cl-accent: var(--accent, #F03522);
  --cl-accent-soft: var(--accent-soft, rgba(240, 53, 34, 0.12));
  --cl-accent-ink: var(--accent-ink, #FFFFFF);
  --cl-ok: var(--ok, #6FCF97);
  --cl-warn: var(--accent, #F03522);
  --cl-err: var(--accent, #F03522);

  --cl-r-sm: var(--r-sm, 6px);
  --cl-r-md: var(--r-md, 10px);
  --cl-r-xs: var(--r-xs, 4px);

  --cl-font-display: 'Oswald', 'Arial Narrow', 'Segoe UI', sans-serif;
  --cl-font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
  --cl-font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;

  --cl-fs-xs: 12px;
  --cl-fs-sm: 13px;
  --cl-fs-base: 16px;
  --cl-fs-md: 17px;
  --cl-fs-lg: 22px;

  /* Плоский дизайн сайта: теней нет, только мягкое свечение у акцента */
  --cl-shadow: none;
  --cl-glow: var(--glow, 0 0 18px rgba(240, 53, 34, 0.25), 0 0 42px rgba(240, 53, 34, 0.10));

  display: block;
  background: var(--cl-bg);
  color: var(--cl-text);
  font-family: var(--cl-font-body);
  font-size: var(--cl-fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.cl-calc *,
.cl-calc *::before,
.cl-calc *::after { box-sizing: border-box; }

.cl-calc__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 84px 20px;
}

/* ---------- Шапка секции ---------- */
.cl-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--cl-font-mono);
  font-size: var(--cl-fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cl-muted);
}
.cl-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--cl-accent);
}
/* H2 секции: Oswald, uppercase, как .sec-title сайта */
.cl-title {
  margin: 0;
  max-width: 20ch;
  font-family: var(--cl-font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--cl-text);
}
.cl-lead {
  margin: 16px 0 0;
  max-width: 62ch;
  font-size: var(--cl-fs-md);
  line-height: 1.5;
  color: var(--cl-muted);
}

/* H3 карточек: uppercase, как на сайте */
.cl-h3 {
  margin: 0;
  font-family: var(--cl-font-display);
  font-weight: 600;
  font-size: var(--cl-fs-lg);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--cl-text);
}
.cl-note {
  margin: 6px 0 0;
  font-size: var(--cl-fs-sm);
  color: var(--cl-muted);
}

/* ---------- Сетка ---------- */
.cl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 24px;
  margin-top: 40px;
  align-items: start;
}
.cl-main { min-width: 0; }
.cl-aside { min-width: 0; }

/* ---------- Зона загрузки ---------- */
.cl-drop {
  position: relative;
  padding: 32px;
  background: var(--cl-panel);
  border: 1px dashed var(--cl-line-strong);
  border-radius: var(--cl-r-md);
  cursor: pointer;
  transition: border-color 0.18s var(--ease, ease), background-color 0.18s var(--ease, ease);
}
.cl-drop:hover { border-color: #6E4F4A; }
.cl-drop.is-drag {
  border-color: var(--cl-accent);
  background: #1A1010;
}
.cl-drop:focus-within { border-color: var(--cl-line-strong); }
.cl-drop__icon {
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  color: var(--cl-muted);
}
.cl-drop__title {
  margin: 0;
  font-family: var(--cl-font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
}
.cl-drop__sub {
  margin: 4px 0 0;
  font-size: var(--cl-fs-base);
  color: var(--cl-muted);
}
.cl-drop__hint {
  margin: 14px 0 0;
  max-width: 58ch;
  font-size: var(--cl-fs-sm);
  line-height: 1.45;
  color: var(--cl-muted);
}
.cl-drop__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* ---------- Кнопки ---------- */
/* Кнопки сайта: mono 13px uppercase, скругление 4px, без тени */
.cl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--cl-r-xs, 4px);
  font-family: var(--cl-font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s linear, border-color 0.16s linear, color 0.16s linear;
  -webkit-appearance: none;
  appearance: none;
}
.cl-btn--accent {
  background: var(--cl-accent);
  color: var(--cl-accent-ink);
}
.cl-btn--accent:hover { background: #FF4A33; box-shadow: var(--cl-glow); transform: translateY(-1px); }
.cl-btn--ghost {
  background: transparent;
  border-color: var(--cl-line-strong);
  color: var(--cl-text);
}
.cl-btn--ghost:hover {
  border-color: #71534E;
  transform: translateY(-1px);
  background: var(--cl-panel-2);
}
.cl-btn--block { width: 100%; }
.cl-btn--sm {
  min-height: 40px;
  padding: 0 14px;
  font-size: var(--cl-fs-sm);
}
.cl-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.cl-btn:focus-visible {
  outline: 2px solid var(--cl-accent);
  outline-offset: 2px;
}

/* ---------- Таблица деталей ---------- */
.cl-table-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0 12px;
}
.cl-count {
  font-family: var(--cl-font-mono);
  font-size: var(--cl-fs-sm);
  color: var(--cl-muted);
  font-variant-numeric: tabular-nums;
}
.cl-table-wrap {
  background: var(--cl-panel);
  border: 1px solid var(--cl-line);
  border-radius: var(--cl-r-md);
  overflow: hidden;
}
.cl-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.cl-table th {
  padding: 12px 12px;
  text-align: left;
  font-family: var(--cl-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cl-muted);
  background: var(--cl-panel-2);
  border-bottom: 1px solid var(--cl-line);
  white-space: nowrap;
}
.cl-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--cl-line);
  vertical-align: top;
  font-size: 14px;
}
.cl-table tbody tr:last-child td { border-bottom: 0; }
.cl-table th:first-child,
.cl-table td:first-child { padding-left: 16px; }
.cl-table th:last-child,
.cl-table td:last-child { padding-right: 16px; }

.cl-cell--file { min-width: 180px; }
.cl-cell--num { white-space: nowrap; }
.cl-num {
  font-family: var(--cl-font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cl-cell--cost { text-align: right; }
.cl-cost {
  font-family: var(--cl-font-mono);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cl-cost--none { color: var(--cl-muted); font-weight: 400; }
.cl-cell--del { width: 44px; text-align: right; }

.cl-file__name {
  display: inline;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.35;
  color: var(--cl-text);
  overflow-wrap: anywhere;
}
.cl-file__badge {
  margin-left: 8px;
  padding: 1px 5px;
  border: 1px solid var(--cl-line-strong);
  border-radius: 3px;
  font-family: var(--cl-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cl-muted);
  white-space: nowrap;
  vertical-align: 1px;
}
.cl-file__note {
  display: block;
  margin-top: 6px;
  max-width: 42ch;
  font-size: var(--cl-fs-xs);
  line-height: 1.45;
  color: var(--cl-warn);
}
.cl-file__note--err { color: var(--cl-err); }
.cl-file__note--ok { color: var(--cl-ok); }

.cl-field {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  background: #100D0D;
  border: 1px solid var(--cl-line-strong);
  border-radius: var(--cl-r-sm);
  color: var(--cl-text);
  font-family: var(--cl-font-body);
  font-size: 14px;
  line-height: 1.3;
}
.cl-field:focus-visible {
  outline: none;
  border-color: var(--cl-accent);
  box-shadow: 0 0 0 3px var(--cl-accent-soft);
}
.cl-field:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cl-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23CDBFBA' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
}
.cl-material { min-width: 172px; }
.cl-thickness { min-width: 96px; }
.cl-qty { width: 76px; }
.cl-qty::-webkit-outer-spin-button,
.cl-qty::-webkit-inner-spin-button { margin: 0; }

.cl-rowdel {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--cl-muted);
  cursor: pointer;
}
.cl-rowdel:hover {
  color: var(--cl-text);
  border-color: var(--cl-line-strong);
}
.cl-rowdel:focus-visible {
  outline: 2px solid var(--cl-accent);
  outline-offset: 2px;
}
.cl-rowdel svg { display: block; width: 14px; height: 14px; }

/* ---------- Пустое состояние ---------- */
.cl-empty {
  padding: 40px 32px;
  text-align: left;
}
.cl-empty__title {
  margin: 0;
  font-family: var(--cl-font-display);
  font-size: 19px;
  font-weight: 600;
}
.cl-empty__text {
  margin: 6px 0 0;
  max-width: 52ch;
  font-size: 14px;
  color: var(--cl-muted);
}
.cl-add { margin-top: 16px; }

/* ---------- Статус операций ---------- */
.cl-status {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: var(--cl-fs-sm);
  color: var(--cl-muted);
}
.cl-status--err { color: var(--cl-err); }

/* ---------- Итог заказа ---------- */
.cl-summary {
  position: sticky;
  top: 24px;
  padding: 24px;
  background: var(--cl-panel);
  border: 1px solid var(--cl-line);
  border-radius: var(--cl-r-md);
}
.cl-summary__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.cl-summary__badge {
  font-family: var(--cl-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cl-muted);
}
.cl-totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
.cl-totals dt {
  color: var(--cl-muted);
  align-self: baseline;
}
.cl-totals dd {
  margin: 0;
  text-align: right;
  font-family: var(--cl-font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--cl-text);
  white-space: nowrap;
}
.cl-totals__total {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--cl-line);
}
.cl-totals__total dt {
  font-size: 16px;
  font-weight: 500;
  color: var(--cl-text);
}
.cl-totals__total dd {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
}

.cl-seg {
  margin: 22px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.cl-seg legend {
  padding: 0;
  margin-bottom: 8px;
  font-family: var(--cl-font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cl-muted);
}
.cl-seg__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--cl-line-strong);
  border-radius: var(--cl-r-sm);
  overflow: hidden;
}
.cl-seg__opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cl-muted);
  cursor: pointer;
  text-align: center;
}
.cl-seg__opt + .cl-seg__opt { border-left: 1px solid var(--cl-line-strong); }
.cl-seg__opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.cl-seg__opt:has(input:checked) {
  background: #2A1512;
  color: var(--cl-text);
  box-shadow: inset 0 -2px 0 var(--cl-accent);
}
.cl-seg__opt:has(input:focus-visible) {
  outline: 2px solid var(--cl-accent);
  outline-offset: -2px;
}
.cl-seg__opt:hover { background: var(--cl-panel-2); }

.cl-warnlist {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.cl-warnlist li {
  position: relative;
  padding-left: 16px;
  font-size: var(--cl-fs-sm);
  line-height: 1.45;
  color: var(--cl-warn);
}
.cl-warnlist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.cl-notice {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--cl-accent-soft);
  border: 1px solid rgba(240, 53, 34, 0.38);
  border-radius: var(--cl-r-sm);
  font-size: var(--cl-fs-sm);
  line-height: 1.45;
  color: var(--cl-text);
}
.cl-disclaimer {
  margin: 18px 0 0;
  font-size: var(--cl-fs-xs);
  line-height: 1.5;
  color: var(--cl-muted);
}

.cl-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  font-size: var(--cl-fs-sm);
  line-height: 1.45;
  color: var(--cl-muted);
}
.cl-consent input {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
  accent-color: var(--cl-accent);
  cursor: pointer;
}
.cl-consent a {
  color: var(--cl-text);
  text-decoration: underline;
  text-decoration-color: var(--cl-accent);
  text-underline-offset: 3px;
}
.cl-consent__err {
  display: none;
  margin: 8px 0 0;
  font-size: var(--cl-fs-xs);
  color: var(--cl-err);
}
.cl-consent__err.is-on { display: block; }

.cl-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.cl-actions__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cl-actions__full { grid-column: 1 / -1; }

.cl-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Счёт ---------- */
.cl-invoice-block { margin-top: 72px; }
.cl-invoice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.cl-invoice-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cl-invoice {
  --inv-ink: #171412;
  --inv-muted: #5D5650;
  --inv-line: #C9C1B8;
  max-width: 920px;
  padding: 40px 44px;
  background: #FFFFFF;
  color: var(--inv-ink);
  border-radius: var(--cl-r-md);
  box-shadow: var(--cl-shadow);
  font-family: var(--cl-font-body);
  font-size: 12.5px;
  line-height: 1.5;
}
.cl-invoice *,
.cl-invoice *::before,
.cl-invoice *::after { box-sizing: border-box; }

.cl-invoice__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--inv-ink);
}
.cl-invoice__seller { max-width: 52ch; }
.cl-invoice__seller-name {
  margin: 0;
  font-family: var(--cl-font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.cl-invoice__seller-line {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--inv-muted);
}
.cl-invoice__requisites-note {
  margin-top: 8px;
  color: var(--inv-muted);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cl-invoice__meta { text-align: right; }
.cl-invoice__meta-title {
  margin: 0;
  font-family: var(--cl-font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}
.cl-invoice__meta-row {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--inv-muted);
}
.cl-invoice__stamp {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 8px;
  border: 1px solid var(--inv-line);
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--inv-muted);
}

.cl-invoice__row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}
.cl-invoice__row-label {
  font-size: 11.5px;
  color: var(--inv-muted);
}
.cl-inv-field {
  width: 100%;
  min-height: 26px;
  padding: 2px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--inv-line);
  border-radius: 0;
  color: var(--inv-ink);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.4;
}
.cl-inv-field:focus-visible {
  outline: 2px solid #B22A19;
  outline-offset: 1px;
}
.cl-inv-field--num { width: 96px; }
.cl-inv-field--date { width: 132px; }

.cl-invoice__buyer { margin-top: 22px; }

.cl-invoice__table {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
}
.cl-invoice__table th {
  padding: 7px 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--inv-muted);
  border-bottom: 1px solid var(--inv-ink);
  vertical-align: bottom;
}
.cl-invoice__table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--inv-line);
  vertical-align: top;
  font-size: 12px;
}
.cl-invoice__table th[data-num],
.cl-invoice__table td[data-num] {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cl-invoice__item-name { font-weight: 500; }
.cl-invoice__item-note {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--inv-muted);
}
.cl-invoice__empty {
  padding: 20px 8px;
  font-size: 12px;
  color: var(--inv-muted);
}

.cl-invoice__totals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  margin-top: 18px;
}
.cl-invoice__totals-rows {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  margin: 0;
  font-size: 12px;
}
.cl-invoice__totals-rows dt { color: var(--inv-muted); }
.cl-invoice__totals-rows dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cl-invoice__totals-rows .is-total {
  padding-top: 8px;
  border-top: 1px solid var(--inv-ink);
}
.cl-invoice__totals-rows .is-total dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--inv-ink);
}
.cl-invoice__totals-rows .is-total dd {
  font-size: 16px;
  font-weight: 600;
}

.cl-invoice__words {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.5;
}
.cl-invoice__words b { font-weight: 600; }
.cl-invoice__valid {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--inv-muted);
}
.cl-invoice__sign {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
}
.cl-invoice__sign-line {
  min-width: 240px;
  padding-top: 6px;
  border-top: 1px solid var(--inv-ink);
  font-size: 11px;
  color: var(--inv-muted);
}
.cl-invoice__foot {
  max-width: 92ch;
  margin: 26px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--inv-line);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--inv-muted);
}

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .cl-grid { grid-template-columns: minmax(0, 1fr); }
  .cl-summary { position: static; }
  .cl-calc__inner { padding-top: 52px; }
}

@media (max-width: 760px) {
  .cl-calc__inner { padding: 56px 16px; }
  .cl-lead { font-size: var(--cl-fs-base); }
  .cl-grid { margin-top: 28px; gap: 16px; }
  .cl-drop { padding: 24px 20px; }
  .cl-drop__actions .cl-btn { flex: 1 1 100%; }
  .cl-btn { min-height: 46px; }

  .cl-table-wrap { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .cl-table { display: block; }
  .cl-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .cl-table tbody { display: block; }
  .cl-table tr {
    position: relative;
    display: block;
    margin-bottom: 12px;
    padding: 16px 16px 10px;
    background: var(--cl-panel);
    border: 1px solid var(--cl-line);
    border-radius: var(--cl-r-md);
  }
  .cl-table td {
    display: block;
    padding: 0;
    border-bottom: 0;
  }
  .cl-table th:first-child,
  .cl-table td:first-child { padding-left: 0; }
  .cl-table td.cl-cell--field {
    display: grid;
    grid-template-columns: 42% minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin-top: 10px;
  }
  .cl-table td.cl-cell--field::before {
    content: attr(data-label);
    font-family: var(--cl-font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cl-muted);
  }
  .cl-material, .cl-thickness, .cl-qty, .cl-field { width: 100%; min-height: 44px; }
  .cl-cell--file { padding-right: 34px; }
  .cl-cell--del {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    padding: 0;
  }
  .cl-rowdel { width: 40px; height: 40px; }
  .cl-cell--cost { margin-top: 12px; text-align: left; }
  .cl-cost { font-size: 16px; }
  .cl-cell--num { margin-top: 8px; }

  .cl-summary { padding: 20px; }
  .cl-invoice-block { margin-top: 48px; }
  .cl-invoice-actions { align-items: stretch; }
  .cl-invoice-actions__btns .cl-btn { flex: 1 1 auto; }
  .cl-invoice { padding: 22px 16px; font-size: 11.5px; }
  .cl-invoice__head { gap: 16px; }
  .cl-invoice__meta { text-align: left; }
  .cl-invoice__row { grid-template-columns: 100px minmax(0, 1fr); }
  .cl-invoice__table th,
  .cl-invoice__table td { padding: 7px 4px; }
  .cl-invoice__totals { grid-template-columns: 1fr; gap: 12px; }
  .cl-invoice__totals-rows { max-width: none; }
}

/* ---------- Печать: только счёт, A4 ---------- */
@page { size: A4; margin: 14mm 12mm; }

@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
    background: #FFFFFF !important;
    color: #000000 !important;
  }

  /* ui.js на beforeprint переносит счёт в body.cl-print-root,
     поэтому печатаем ровно один документ, без сайта и интерфейса. */
  body.cl-printing-invoice > *:not(.cl-print-root) { display: none !important; }
  body.cl-printing-invoice .cl-print-root { display: block !important; }

  .cl-print-root {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #FFFFFF !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    animation: none !important;
  }
  .cl-print-root .cl-invoice-block,
  .cl-print-root .cl-invoice {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    animation: none !important;
    font-size: 10.5pt;
    line-height: 1.4;
  }
  .cl-print-root .cl-invoice-actions,
  .cl-print-root .cl-noprint { display: none !important; }

  .cl-print-root .cl-invoice__head { border-bottom: 1px solid #000000; padding-bottom: 10px; }
  .cl-print-root .cl-invoice__seller-name { font-size: 13pt; }
  .cl-print-root .cl-invoice__seller-line { font-size: 8.5pt; color: #333333 !important; }
  .cl-print-root .cl-invoice__meta { text-align: right; }
  .cl-print-root .cl-invoice__meta-title { font-size: 14pt; }
  .cl-print-root .cl-invoice__stamp { border-color: #777777; color: #333333; }

  .cl-print-root .cl-invoice__table { width: 100%; border-collapse: collapse; }
  .cl-print-root .cl-invoice__table thead { display: table-header-group; }
  .cl-print-root .cl-invoice__table tr { break-inside: avoid; page-break-inside: avoid; }
  .cl-print-root .cl-invoice__table th { font-size: 8pt; border-bottom: 1px solid #000000; }
  .cl-print-root .cl-invoice__table td { font-size: 9.5pt; border-bottom: 1px solid #BBBBBB; }

  .cl-print-root .cl-invoice__totals,
  .cl-print-root .cl-invoice__words,
  .cl-print-root .cl-invoice__valid,
  .cl-print-root .cl-invoice__sign,
  .cl-print-root .cl-invoice__foot,
  .cl-print-root .cl-inn-hint {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cl-print-root .cl-invoice__words,
  .cl-print-root .cl-invoice__valid,
  .cl-print-root .cl-invoice__foot { font-size: 9pt; color: #333333 !important; }
  .cl-print-root .cl-invoice__sign-line { border-top-color: #000000; }

  .cl-print-root .cl-inv-field {
    min-height: 0 !important;
    padding: 0 0 1px !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid #999999 !important;
    border-radius: 0 !important;
    color: #000000 !important;
    font-size: 9.5pt;
  }
  .cl-print-root .cl-inv-field::placeholder { color: transparent; }

  /* Данные источника ЕГРЮЛ на бумаге нужны */
  .cl-print-root .cl-inn-hint {
    display: block !important;
    margin: 4px 0 0;
    font-size: 8pt;
    color: #555555 !important;
  }
  .cl-print-root .cl-inn-status { display: none !important; }
}

/* ---------- Компактный режим: hero-карточка ---------- */
.cl-calc--compact {
  padding: 0;
  background: transparent;
  font-size: 14px;
}
.cl-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.cl-compact__drop {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: rgba(22, 17, 18, 0.88);
  border: 1px dashed var(--cl-line-strong);
  border-radius: var(--r-sm, 6px);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s linear, background-color 0.16s linear;
}
.cl-compact__drop:hover { border-color: #6E4F4A; }
.cl-compact__drop.is-drag {
  border-color: var(--cl-accent);
  background: #1A1010;
}
.cl-compact__drop:focus-visible {
  outline: 2px solid var(--cl-accent);
  outline-offset: 2px;
}
.cl-compact__drop-title {
  font-family: var(--cl-font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cl-text);
}
.cl-compact__drop-hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--cl-muted);
}
.cl-compact__sample {
  align-self: flex-start;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 11px;
  color: var(--cl-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.cl-compact__sample:hover { color: var(--cl-text); }
.cl-compact__sample:focus-visible { outline: 2px solid var(--cl-accent); outline-offset: 2px; }
.cl-compact__fields {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
}
.cl-compact__label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font-family: var(--cl-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cl-muted);
}
.cl-compact__select {
  min-height: 34px;
  padding: 5px 26px 5px 8px;
  font-size: 12.5px;
}
.cl-compact__calc {
  min-height: 38px;
  font-size: 12px;
}
.cl-compact__result {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding-top: 2px;
}
.cl-compact__total {
  font-family: var(--cl-font-mono);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--cl-text);
}
.cl-compact__vat {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--cl-muted);
}
.cl-compact__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cl-compact__link {
  font-family: var(--cl-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cl-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.cl-compact__link:hover { color: var(--cl-text); }
.cl-compact__status,
.cl-calc--compact .cl-status {
  margin: 0;
  min-height: 0;
  font-size: 10.5px;
}
.cl-compact__status:empty { display: none; }

/* Диалог со счётом внутри карточки */
body.cl-compact-lock { overflow: hidden; }
.cl-compact__dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
}
.cl-compact__dialog[hidden] { display: none; }
/* hidden-атрибут важнее flex-раскладки: блоки «после расчёта» не мигают до расчёта */
.cl-compact [hidden] { display: none !important; }
.cl-compact__dialog-card .cl-h3 { color: #171412; }
.cl-compact__dialog-card .cl-note { color: #5D5650; }
.cl-compact__dialog-card .cl-btn--ghost {
  color: #171412;
  border-color: #C9C1B8;
}
.cl-compact__dialog-card .cl-btn--ghost:hover {
  background: #F1ECE6;
  border-color: #A79E94;
}
.cl-compact__dialog-card {
  position: relative;
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  background: #FFFFFF;
  border-radius: var(--cl-r-md);
}
.cl-compact__dialog-card .cl-invoice {
  max-width: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
.cl-compact__dialog-card .cl-invoice-actions {
  margin-bottom: 14px;
  align-items: center;
}
.cl-compact__close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #5D5650;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.cl-compact__close:hover { border-color: #C9C1B8; color: #171412; }
.cl-compact__close:focus-visible { outline: 2px solid #B22A19; outline-offset: 2px; }

/* Карточка hero: анимация сверху + форма в потоке (без overlay).
   Раньше форма была position:absolute поверх градиента — на боевой странице
   сквозь неё просвечивал .hv-meta и сталкивался с селектами. Теперь панель
   непрозрачная, форма идёт после анимации, .hv-meta скрыт. */
.cl-hero-card {
  position: relative;
  overflow: hidden;
  height: auto;
  width: 505px;
  max-width: 100%;
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.cl-hero-card .hv-head { margin-bottom: 10px; }
.cl-hero-card .hv-plate {
  flex: 0 0 auto;
  height: 150px;
  min-height: 140px;
  max-height: 160px;
  aspect-ratio: auto;
}
/* Три факта дублируют смысл формы и просвечивали под ней — на десктопе скрыты */
.cl-hero-card .hv-meta { display: none; }
.cl-hero-form {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  margin: 12px 0 0;
  padding: 0;
  background: none;
  border-radius: 0;
}
@media (max-width: 900px) {
  .cl-hero-card { width: 100%; height: auto; }
}
@media (max-width: 760px) {
  .cl-hero-form {
    padding: 12px 12px 8px;
  }
  .cl-compact { gap: 5px; }
  .cl-compact__drop { padding: 7px 10px; }
  .cl-compact__drop-hint,
  .cl-compact__sample { display: none; }
  .cl-calc--compact .cl-status { display: none; }
  .cl-compact__fields { gap: 6px; }
  .cl-compact__label { font-size: 9px; }
  .cl-compact__select { min-height: 32px; font-size: 12px; }
  .cl-compact__calc { min-height: 36px; }
  .cl-compact__total { font-size: 15px; }
  .cl-compact__dialog { padding: 8px; }
  .cl-compact__dialog-card { padding: 16px 12px; max-height: calc(100vh - 16px); }
}

/* ---------- Доступность / движение ---------- */
@media (prefers-reduced-motion: reduce) {
  .cl-calc *,
  .cl-invoice * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Контакты в блоке заявки ---------- */
.cl-contacts {
  margin: 10px 0 0;
  font-family: var(--cl-font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--cl-muted);
}
.cl-contacts a { color: var(--cl-text); text-decoration: none; }
.cl-contacts a:hover { text-decoration: underline; }

/* Подписи к числовым ячейкам на мобиле */
@media (max-width: 760px) {
  .cl-cell--num, .cl-cell--cost {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .cl-cell--num::before, .cl-cell--cost::before {
    content: attr(data-label);
    font-family: var(--cl-font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cl-muted);
  }
  .cl-cell--cost { margin-top: 12px; }
}

/* убираем дублирующий надзаголовок сайта: у виджета свой kicker + H1 */
#calc .sec-head{display:none}

/* ===== Реквизиты заказчика по ИНН: сетка полей ===== */
.cl-inn-inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.cl-inn-inner .cl-inv-field { flex: 1 1 116px; min-width: 0; }
.cl-inn-find { border: 0; background: none; padding: 0 0 1px; font: inherit; font-size: 11px; color: #B22A19; cursor: pointer; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
.cl-inn-find:hover { color: #8C1F12; }
.cl-inn-find:focus-visible { outline: 2px solid #B22A19; outline-offset: 2px; }
.cl-inn-status { margin: 6px 0 0; font-size: 11px; color: var(--inv-muted); }
.cl-inn-hint {
  margin: 4px 0 0;
  grid-column: 1 / -1;
  font-size: 10.5px;
  color: var(--inv-muted);
}
.cl-inn-status.is-busy { color: #B22A19; }
.cl-inn-status:empty { display: none; }

@media screen and (min-width: 900px) {
  .cl-invoice__buyer { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1.15fr); align-items: baseline; column-gap: 22px; row-gap: 0; }
  .cl-invoice__row--wide { grid-column: 1 / -1; }
  .cl-invoice__row { margin-top: 6px; }
  .cl-invoice__buyer .cl-invoice__row { grid-template-columns: 74px minmax(0, 1fr); }
  .cl-invoice__buyer .cl-inn-status { grid-column: 1 / -1; }
}

/* Новые поля на телефоне не мельче 16 px, чтобы iOS не масштабировал ввод. */
@media screen and (max-width: 760px) {
  .cl-invoice__buyer .cl-inv-field { font-size: 16px; min-height: 32px; }
  .cl-invoice__buyer .cl-invoice__row { grid-template-columns: 78px minmax(0, 1fr); }
}

/* ============================================================
   HERO FORM .clh-* — компактная форма в hero-карточке
   Тема forge: панели #161112 / #1D1617, линии #2F2426 / #4C3639,
   текст #FBF5F3, muted #C8B9B5, accent #F03522.
   Плоско: без теней, радиусы 4 / 6 / 10.
   Акцентный МЕЛКИЙ текст (ошибки, hover-ссылки) — #FF6A55:
   #F03522 на панели даёт ≈3.1:1 и не проходит 4.5:1.
   ============================================================ */
.cl-hero-form .clh {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* Инструкция над дропзоной: 12–13 px, muted, не более 2 строк.
   Лежит поверх анимации — поэтому своя подложка-плашка: контраст текста
   не зависит от кадра анимации (muted #C8B9B5 на #161112 ≈ 9.9:1). */
.cl-hero-form .clh-note-top {
  align-self: flex-start;
  max-width: 100%;
  margin: 0;
  padding: 5px 9px;
  background: rgba(22, 17, 18, 0.92);
  border-radius: var(--cl-r-xs);
  font-family: var(--cl-font-body);
  font-size: 12px;
  line-height: 1.4;
  color: var(--cl-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Дропзона: клик = выбрать файл --- */
.cl-hero-form .clh-drop {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  min-height: 68px;
  padding: 10px 14px;
  background: var(--cl-panel-2);
  border: 1px dashed var(--cl-line-strong);
  border-radius: var(--cl-r-sm);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.cl-hero-form .clh-drop::before {
  content: '+';
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--cl-line-strong);
  border-radius: var(--cl-r-xs);
  font-family: var(--cl-font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  color: #FF6A55;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.cl-hero-form .clh-drop:hover {
  border-color: var(--cl-accent);
  background: #201718;
}
.cl-hero-form .clh-drop:hover::before { border-color: var(--cl-accent); }
.cl-hero-form .clh-drop.is-over {
  border-style: solid;
  border-color: var(--cl-accent);
  background: var(--cl-accent-soft);
}
.cl-hero-form .clh-drop.is-over::before { border-color: var(--cl-accent); color: #FF6A55; }
.cl-hero-form .clh-drop:focus-visible {
  outline: 2px solid #FF6A55;
  outline-offset: 2px;
}
.cl-hero-form .clh-drop-title {
  grid-column: 2;
  font-family: var(--cl-font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--cl-text);
}
.cl-hero-form .clh-drop-hint {
  grid-column: 2;
  font-size: 12px;
  line-height: 1.35;
  color: var(--cl-muted);
}

/* --- Список файлов --- */
.cl-hero-form .clh-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cl-hero-form .clh-files[hidden] { display: none; }
.cl-hero-form .clh-file {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px 6px 10px;
  background: var(--cl-panel-2);
  border: 1px solid var(--cl-line);
  border-left: 2px solid var(--cl-accent);
  border-radius: var(--cl-r-xs);
}
.cl-hero-form .clh-file-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}
.cl-hero-form .clh-file-name {
  display: block;
  font-family: var(--cl-font-mono);
  font-size: 12px;
  line-height: 1.35;
  color: var(--cl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cl-hero-form .clh-file-meters {
  display: block;
  font-family: var(--cl-font-mono);
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--cl-muted);
}
.cl-hero-form .clh-file-err {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 58%;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
  color: #FF6A55;
}
.cl-hero-form .clh-file-del {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--cl-line-strong);
  border-radius: var(--cl-r-xs);
  color: var(--cl-muted);
  font-family: var(--cl-font-body);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.cl-hero-form .clh-file-del:hover {
  border-color: var(--cl-accent);
  color: #FF6A55;
}
.cl-hero-form .clh-file-del:focus-visible {
  outline: 2px solid #FF6A55;
  outline-offset: 2px;
}

/* --- Материал / толщина --- */
.cl-hero-form .clh-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  min-width: 0;
}
.cl-hero-form .clh-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cl-hero-form .clh-field-lbl {
  font-family: var(--cl-font-mono);
  font-size: 10.5px;
  line-height: 1.2;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cl-muted);
}
.cl-hero-form .clh-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 24px 0 10px;
  font-family: var(--cl-font-body);
  font-size: 13px;
  color: var(--cl-text);
  background-color: var(--cl-panel-2);
  border: 1px solid var(--cl-line-strong);
  border-radius: var(--cl-r-xs);
  color-scheme: dark;
  cursor: pointer;
}
.cl-hero-form .clh-select:hover { border-color: var(--cl-accent); }
.cl-hero-form .clh-select:focus-visible {
  outline: 2px solid #FF6A55;
  outline-offset: 1px;
  border-color: var(--cl-accent);
}
.cl-hero-form .clh-select option {
  background-color: #161112;
  color: #FBF5F3;
}

/* --- Итог --- */
.cl-hero-form .clh-total {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--cl-panel);
  border: 1px solid var(--cl-line);
  border-left: 2px solid var(--cl-accent);
  border-radius: var(--cl-r-sm);
}
.cl-hero-form .clh-total[hidden] { display: none; }
.cl-hero-form .clh-total-sum {
  margin: 0;
  font-family: var(--cl-font-mono);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--cl-text);
}
.cl-hero-form .clh-total-vat {
  margin: 0;
  font-family: var(--cl-font-mono);
  font-size: 12px;
  line-height: 1.35;
  color: var(--cl-muted);
}
.cl-hero-form .clh-total-note {
  margin: 4px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--cl-muted);
}
.cl-hero-form .clh-total-note a {
  color: var(--cl-text);
  text-decoration: underline;
  text-decoration-color: var(--cl-line-strong);
  text-underline-offset: 2px;
}
.cl-hero-form .clh-total-note a:hover { color: #FF6A55; }

/* --- Кнопки --- */
.cl-hero-form .clh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.cl-hero-form .clh-actions[hidden] { display: none; }
.cl-hero-form .clh-add,
.cl-hero-form .clh-primary {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--cl-r-xs);
  font-family: var(--cl-font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.cl-hero-form .clh-add {
  flex: 0 1 auto;
  background: transparent;
  border-color: var(--cl-line-strong);
  color: var(--cl-text);
}
.cl-hero-form .clh-add:hover {
  border-color: var(--cl-accent);
  background: rgba(240, 53, 34, 0.07);
  color: #FF6A55;
}
.cl-hero-form .clh-primary {
  flex: 1 1 auto;
  background: var(--cl-accent);
  border-color: var(--cl-accent);
  color: var(--cl-accent-ink);
}
/* Вторичная «счёт»-кнопка, если её не объединяют с primary */
.cl-hero-form .clh-invoice:not(.clh-primary) {
  flex: 1 1 auto;
  background: transparent;
  border-color: var(--cl-accent);
  color: #FF6A55;
}
.cl-hero-form .clh-invoice:not(.clh-primary):hover {
  background: rgba(240, 53, 34, 0.10);
  border-color: #FF6A55;
}
.cl-hero-form .clh-primary:hover {
  background: #FF4A36;
  border-color: #FF4A36;
}
.cl-hero-form .clh-add:focus-visible,
.cl-hero-form .clh-primary:focus-visible {
  outline: 2px solid #FF6A55;
  outline-offset: 2px;
}

/* Статус формы (переиспользует .cl-status) */
.cl-hero-form .clh-status {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}
.cl-hero-form .clh-status:empty { display: none; }

/* Подсказка внутри диалога счёта: диалог белый — muted тёмный */
.cl-invoice-block .clh-inv-guide,
.cl-compact__dialog-card .clh-inv-guide {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #5D5650;
}
@media print {
  .clh-inv-guide { display: none; }
}

/* ============================================================
   HERO FORM — компактная мобильная версия (≤900 px)
   Карточка становится обычным потоком: анимация сверху, форма под ней.
   ============================================================ */
@media (max-width: 900px) {
  .cl-hero-card {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 14px;
    border-radius: var(--r-md, 10px);
  }
  .cl-hero-card .hv-head {
    margin-bottom: 8px;
    font-size: 11px;
    letter-spacing: 0.08em;
  }
  .cl-hero-card .hv-plate {
    flex: 0 0 auto;
    height: 112px;
    min-height: 96px;
    max-height: 120px;
  }
  .cl-hero-card .hv-meta { display: none; }

  .cl-hero-form {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    margin: 12px 0 0;
    padding: 0;
    background: none;
    border-radius: 0;
  }
  .cl-hero-form .clh { gap: 8px; }
  .cl-hero-form .clh-note-top { font-size: 12px; line-height: 1.35; }
  .cl-hero-form .clh-drop {
    min-height: 56px;
    padding: 8px 12px;
    column-gap: 10px;
  }
  .cl-hero-form .clh-drop::before { width: 30px; height: 30px; font-size: 20px; }
  .cl-hero-form .clh-drop-title { font-size: 13px; }
  .cl-hero-form .clh-drop-hint { font-size: 12px; }
  .cl-hero-form .clh-fields { gap: 8px; }
  .cl-hero-form .clh-field-lbl { font-size: 12px; letter-spacing: 0.04em; }
  .cl-hero-form .clh-select { height: 44px; font-size: 15px; }
  .cl-hero-form .clh-file { padding: 6px 6px 6px 10px; }
  .cl-hero-form .clh-file-name { font-size: 12.5px; }
  .cl-hero-form .clh-file-meters { font-size: 12px; }
  .cl-hero-form .clh-file-err { max-width: 50%; font-size: 12.5px; }
  .cl-hero-form .clh-file-del { width: 44px; height: 44px; }
  .cl-hero-form .clh-total { padding: 10px 12px; }
  .cl-hero-form .clh-total-sum { font-size: 22px; }
  .cl-hero-form .clh-total-note { font-size: 12px; }
  .cl-hero-form .clh-add,
  .cl-hero-form .clh-primary {
    min-height: 44px;
    padding: 0 14px;
    font-size: 14px;
  }
  .cl-hero-form .clh-status { font-size: 12px; }
}

/* Узкий телефон: поля в столбик, селекты 16 px (iOS не зумит ввод) */
@media (max-width: 430px) {
  .cl-hero-card { padding: 12px; }
  .cl-hero-card .hv-plate { height: 104px; min-height: 96px; max-height: 120px; }
  .cl-hero-form .clh-fields { grid-template-columns: minmax(0, 1fr); }
  .cl-hero-form .clh-select { height: 44px; font-size: 16px; padding: 0 28px 0 10px; }
  .cl-hero-form .clh-add { flex: 1 1 0; }
  .cl-hero-form .clh-primary { flex: 1 1 0; }
  /* Три действия на узком: «Рассчитать» на всю ширину, ниже два действия.
     Порядок не важен — primary выносится наверх через order. */
  .cl-hero-form .clh-actions > * {
    flex: 1 1 120px;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }
  .cl-hero-form .clh-actions .clh-primary {
    flex: 1 1 100%;
    order: -1;
  }
  .cl-hero-form .clh-total-sum { font-size: 21px; }
}
