/* ============================================================
   Testfire.ru — консультации по испытаниям систем
   противопожарной защиты (СПЗ)
   Палитра «документа»: крафт-бумага #f5f0e7,
   чернила #333, красный акцент #c0342a, экспертные пометки #c0342a
   ============================================================ */

:root {
  --bg: #f5f0e7;
  --bg-soft: #efe8da;
  --paper: #fffdf8;
  --paper-2: #faf6ec;
  --ink: #333;
  --ink-soft: #56534c;
  --muted: #7a756a;
  --accent: #c0342a;
  --accent-dark: #8f241c;
  --accent-soft: #fbe5e2;
  --red: #c0342a;
  --red-dark: #8f241c;
  --line: #d9d1c0;
  --line-strong: #c4b9a2;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "PT Sans", "Segoe UI", Arial, sans-serif;
  --shadow: 0 10px 30px rgba(51, 48, 40, 0.12);
  --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  background-image:
    linear-gradient(rgba(0,0,0,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.018) 1px, transparent 1px);
  background-size: 26px 26px;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Типографика ---------- */
h1, h2, h3, h4 { font-family: var(--sans); }

h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.12; font-weight: 700; margin: 0 0 18px; }
h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.2; margin: 0 0 14px; }
h3 { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }

p { margin: 0 0 14px; }

a { color: var(--accent); text-decoration-color: rgba(192,52,42,0.4); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

.serif { font-family: var(--serif); }

.lead {
  font-family: var(--serif);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.6;
  color: var(--ink-soft);
}

mark { background: #ffe9a8; padding: 0 4px; }

.red-mark {
  color: var(--red);
  font-family: var(--sans);
  font-weight: 700;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  padding: 13px 26px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.18s ease;
  line-height: 1.2;
}
.btn svg { flex: 0 0 auto; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); color: #fff; }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: #fff; }

.btn-light { background: #fff; color: var(--accent-dark); }
.btn-light:hover { background: var(--accent-soft); color: var(--accent-dark); }

.btn-lg { padding: 16px 34px; font-size: 17px; }

/* ---------- Шапка ---------- */
.topbar {
  background: var(--ink);
  color: #cfcabd;
  font-size: 14px;
  padding: 8px 0;
}
.topbar a { color: #cfcabd; text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar-tag { letter-spacing: 0.4px; }

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(51,48,40,0.06);
}

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 20px;
  letter-spacing: -0.5px;
}
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 30px; color: var(--ink); line-height: 1; }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; }
.brand { flex: 0 0 auto; }

.main-nav { display: flex; align-items: center; justify-content: center; gap: 4px; flex: 1 1 auto; flex-wrap: wrap; }
.main-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 15px;
  padding: 9px 12px;
  border-radius: 4px;
  white-space: nowrap;
  text-align: center;
}
.main-nav a:hover { color: var(--accent); background: var(--accent-soft); }
.main-nav a.active { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
}

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 24px 18px;
    box-shadow: 0 20px 40px rgba(51,48,40,0.15);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
}

/* ---------- Герой (первый экран) ---------- */
.hero {
  position: relative;
  background: #201e1a;
  color: #eee7d8;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(245,240,231,0.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,240,231,0.6) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 120% at 30% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(120% 120% at 30% 0%, #000 40%, transparent 100%);
}
.hero-content {
  position: relative;
  padding: 90px 0 100px;
  max-width: 760px;
}
.hero-kicker {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f2c94c;
  border: 1px solid rgba(242,201,76,0.5);
  padding: 6px 14px;
  border-radius: 40px;
  margin-bottom: 22px;
}
.hero h1 { color: #f6f1e5; }
.hero h1 .serif-accent { color: #f2c94c; }
.hero .lead { color: #d8d0bd; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.hero-note { margin-top: 22px; font-size: 14px; color: #b3ab95; }

/* ---------- Секции ---------- */
.section { padding: 70px 0; }
.section-alt { background: var(--bg-soft); }
.section-paper { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 820px; margin-bottom: 40px; }
.section-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.section-head.light .section-eyebrow { color: #f2c94c; }

/* ---------- Карточки и сетки ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card-flat { box-shadow: none; }

.icon-badge {
  width: 48px; height: 48px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 16px;
}

.step-arrow { color: var(--line-strong); }

/* ---------- Блок боля ---------- */
.pain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .pain-grid { grid-template-columns: 1fr; } }

.doc-mock {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 18px 44px rgba(51,48,40,0.2);
  padding: 22px 22px 26px;
  font-family: var(--serif);
  position: relative;
  transform: rotate(-1.2deg);
}
.doc-mock::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 44px;
  border-left: 1px solid rgba(192,52,42,0.18);
}
.doc-mock .doc-meta { font-size: 12.5px; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 10px; display:flex; justify-content: space-between; }
.doc-mock .doc-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.doc-lines { color: var(--muted); font-size: 14px; line-height: 1.9; margin-left: 16px; }
.doc-lines .ok { color: #4c7a3d; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; font-family: var(--sans); }
.doc-table th, .doc-table td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; }
.doc-table th { background: var(--bg-soft); }
.doc-mark {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  transform: rotate(1.5deg);
  display: inline-block;
  background: rgba(192,52,42,0.06);
  margin-top: 12px;
}

/* ---------- Чек-лист (раздел «Что проверяем») ---------- */
.check-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 22px;
}
.check-item h3 { display: flex; align-items: center; gap: 12px; }
.chip {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 40px; background: var(--accent-soft); color: var(--accent);
  white-space: nowrap;
}
.chip.chip-gray { background: var(--bg-soft); color: var(--muted); }

.check-list { margin: 8px 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding: 7px 0 7px 34px; }
.check-list li::before {
  content: "";
  position: absolute; left: 0; top: 12px;
  width: 18px; height: 18px;
  border: 2px solid var(--line-strong);
  border-radius: 3px;
  background: var(--paper);
}
.check-list li.kross::before {
  content: "✓";
  font-size: 12px; font-weight: 700; line-height: 15px;
  text-align: center; color: var(--red);
  border-color: var(--red);
}
.check-list li.kross strong { color: var(--red); }

.doc-list { list-style: none; margin: 6px 0 0; padding: 0; }
.doc-list li { padding: 4px 0 4px 26px; position: relative; font-size: 15px; color: var(--ink-soft); }
.doc-list li::before {
  content: "📄";
  position: absolute; left: 0; top: 3px; font-size: 14px;
}

/* ---------- Библиотека нормативов ---------- */
.acc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.acc-head {
  width: 100%; text-align: left; background: none; border: none;
  font-family: var(--sans); font-weight: 700; font-size: 17px; color: var(--ink);
  padding: 18px 22px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.acc-head:hover { background: var(--paper-2); }
.acc-head .arrow { transition: transform 0.2s; color: var(--muted); flex: 0 0 auto; }
.acc.open .acc-head .arrow { transform: rotate(180deg); }
.acc-body { display: none; padding: 0 22px 22px; border-top: 1px dashed var(--line); padding-top: 16px; }
.acc.open .acc-body { display: block; }

.reg-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: var(--accent);
}
.status-badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 40px;
}
.status-active { background: #e2f0e4; color: #2e7d32; }
.status-changed { background: #fdeee0; color: #c05621; }
.status-new { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- Таймлайн ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line-strong); }
.tl-item { position: relative; margin-bottom: 26px; }
.tl-item::before {
  content: ""; position: absolute; left: -32px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--accent);
}
.tl-year { font-family: var(--sans); font-weight: 700; color: var(--accent); letter-spacing: 1px; }
.tl-item .serif { color: var(--ink-soft); }

/* ---------- Калькуляторы ---------- */
.calc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.calc h3 { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 5px; color: var(--ink-soft); }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%;
  font-size: 16px;
  font-family: var(--sans);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input-with-prefix {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}
.input-with-prefix .input-prefix {
  padding-left: 12px;
  font-size: 16px;
  font-family: var(--sans);
  color: var(--muted);
  white-space: nowrap;
  user-select: none;
}
.field .input-with-prefix input {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 10px 12px 10px 4px;
  background: transparent;
}
.field .input-with-prefix input:focus { outline: none; }
.input-with-prefix:focus-within { outline: 2px solid var(--accent); border-color: var(--accent); }
.calc-result {
  background: var(--bg-soft);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 16px 18px;
  margin-top: 18px;
  min-height: 20px;
}
.calc-result .big { font-family: var(--serif); font-weight: 700; font-size: 26px; color: var(--accent-dark); }
.calc-result .size { font-size: 14px; color: var(--muted); margin-top: 6px; }
.calc-formula {
  font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--muted); background: var(--accent-soft); border-radius: 4px;
  padding: 4px 12px; display: inline-block; margin-bottom: 14px;
}

/* ---------- ПДЗ · дымоудаление: действия и таблица результатов ---------- */
.calc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.calc-actions-group { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 10px; max-width: 100%; }
.calc-actions .btn { padding: 11px 20px; font-size: 15px; }
.calc-actions-secondary { margin-top: 10px; padding-top: 14px; border-top: 1px dashed var(--line); }
.calc-actions .btn:disabled { opacity: 0.6; cursor: wait; }

.pdz-note { margin-top: 8px; font-size: 14px; font-weight: 700; color: #2e7d32; }
.pdz-status { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

.btn-danger-outline { background: transparent; color: var(--red); border-color: rgba(192, 52, 42, 0.45); }
.btn-danger-outline:hover { background: var(--red); border-color: var(--red); color: #fff; }

.pdz-table { min-width: 900px; font-size: 14px; }
.pdz-table th, .pdz-table td { border: 1px solid var(--line-strong); padding: 8px 10px; vertical-align: middle; }
.pdz-table thead th { background: var(--bg-soft); text-align: center; font-size: 12.5px; line-height: 1.35; color: var(--ink-soft); }
.pdz-table thead .pdz-num-row th { background: var(--paper-2); font-size: 12px; color: var(--muted); padding: 4px 6px; }
.pdz-table tbody tr:nth-child(even) td { background: var(--paper-2); }
.pdz-table td.center { text-align: center; }
.pdz-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pdz-table td.verdict { text-align: center; white-space: nowrap; }
.pdz-table .pdz-x { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.pdz-table .pdz-verdict {
  display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700;
  padding: 2px 9px; border-radius: 40px;
}
.pdz-table .pdz-verdict.ok { background: #e2f0e4; color: #2e7d32; }
.pdz-table .pdz-verdict.over { background: #e2f0e4; color: #2e7d32; }
.pdz-table .pdz-verdict.bad { background: var(--accent-soft); color: var(--accent-dark); }
.pdz-table .vpv-object-row td { font-weight: 700; text-align: center; }

/* Контейнер для рендера PDF (вне экрана) */
.pdz-pdf-stage { position: fixed; left: -10000px; top: 0; z-index: -1; }
.pdz-pdf-holder {
  position: relative;
  width: 720px; padding: 24px 26px; background: #fff; color: #222;
  font-family: "PT Sans", "Segoe UI", Arial, sans-serif; font-size: 11px;
}
.pdz-pdf-holder h1 { font-size: 17px; margin: 0 0 6px; line-height: 1.3; }
.pdz-pdf-holder .pdz-pdf-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: #555; margin-bottom: 10px; }
.pdz-pdf-holder table { width: 100%; min-width: 0; border-collapse: collapse; }
.pdz-pdf-holder th, .pdz-pdf-holder td { border: 1px solid #666; padding: 5px 6px; vertical-align: middle; }
.pdz-pdf-holder thead th { background: #eee; text-align: center; font-size: 10px; line-height: 1.3; }
.pdz-pdf-holder thead tr.pdz-num-row th { background: #f5f5f5; font-size: 9px; padding: 2px 4px; }
.pdz-pdf-holder td.center { text-align: center; }
.pdz-pdf-holder td.num { text-align: right; white-space: nowrap; }
.pdz-pdf-holder td.verdict { text-align: center; white-space: nowrap; }
.pdz-pdf-holder .pdz-x { display: block; font-weight: 700; }
.pdz-pdf-holder .pdz-verdict { display: inline-block; margin-top: 3px; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.pdz-pdf-holder .pdz-verdict.ok { background: #e2f0e4; color: #2e7d32; }
.pdz-pdf-holder .pdz-verdict.over { background: #e2f0e4; color: #2e7d32; }
.pdz-pdf-holder .pdz-verdict.bad { background: #fbe5e2; color: #8f241c; }
.pdz-pdf-holder p { margin: 0 0 6px; line-height: 1.35; }
.pdz-pdf-holder .vpv-object-row td { font-weight: 700; text-align: center; }
.doc-watermark { pointer-events: none; background-repeat: repeat; background-position: center; }
.pdz-pdf-holder .doc-watermark.embed { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 5; }

/* ПДЗ · подпор воздуха: таблица документа — данные 11 pt, названия столбцов 8 pt */
.pdz-pdf-holder.pod2-doc { font-size: 22px; }
.pdz-pdf-holder.pod2-doc h1 { font-size: 20px; line-height: 1.25; margin: 0 0 8px; }
.pdz-pdf-holder.pod2-doc .pdz-pdf-meta { font-size: 12px; margin-bottom: 10px; }
.pdz-pdf-holder.pod2-doc table { table-layout: fixed; }
.pdz-pdf-holder.pod2-doc th,
.pdz-pdf-holder.pod2-doc td { font-size: 22px; line-height: 1.2; padding: 3px 3px; overflow-wrap: break-word; }
.pdz-pdf-holder.pod2-doc thead th { font-size: 16px; }
.pdz-pdf-holder.pod2-doc thead tr.pdz-num-row th { font-size: 16px; padding: 3px 3px; }
.pdz-pdf-holder.pod2-doc td.num,
.pdz-pdf-holder.pod2-doc td.verdict { white-space: normal; }
.pdz-pdf-holder.pod2-doc .pod2-v { white-space: normal; }

/* ПДЗ · подпор воздуха: динамические поля и заключение */
.pod2-params { margin-top: 2px; margin-bottom: 2px; }
.pod2-params .field { margin-bottom: 12px; }
.pod2-pair { display: flex; align-items: center; gap: 8px; }
.pod2-pair input { flex: 1 1 0; min-width: 0; }
.pod2-static {
  padding: 10px 12px;
  font-size: 16px;
  font-family: var(--sans);
  font-weight: 700;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--ink-soft);
}
.pod2-pair .pod2-sep { color: var(--muted); font-weight: 700; line-height: 1; }
.pod2-v { font-weight: 700; white-space: nowrap; }
.pod2-v.ok { color: #2e7d32; }
.pod2-v.bad { color: var(--accent-dark); }
.pod2-note { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }

/* ---------- ЛО: испытания лестниц и ограждений ---------- */
.lon-kinds {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  margin: 16px 0 4px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-soft);
}
.lon-kind { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.lon-kind input { width: 18px; height: 18px; accent-color: var(--red); cursor: pointer; }
.lon-block { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.lon-block[hidden] { display: none; }
.lon-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.lon-block-head h4 { margin: 0; font-size: 17px; }
.lon-row {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 14px; margin-bottom: 14px; background: var(--paper-2);
}
.lon-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.lon-row-head strong { font-size: 15px; }
.lon-row .field { margin-bottom: 10px; }
.lon-row .grid { gap: 0 16px; }
.lon-del {
  padding: 0; border: 0; background: transparent; color: var(--red);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.lon-del:hover { text-decoration: underline; }
.lon-add {
  padding: 5px 12px; border: 1px dashed rgba(192, 52, 42, 0.55); border-radius: 6px;
  background: transparent; color: var(--red); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.lon-add:hover { background: var(--accent-soft); }
.lon-sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 6px; }
.lon-sub-head > span { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.lon-sub { border-top: 1px solid var(--line); }
.lon-subrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; }
.lon-subrow + .lon-subrow { border-top: 1px solid var(--line); }
.lon-sub-label { flex: 0 0 92px; font-size: 13px; font-weight: 700; color: var(--muted); }
.lon-subrow input, .lon-subrow select {
  flex: 1 1 130px; min-width: 0;
  padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 4px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
.lon-subrow input:focus, .lon-subrow select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.lon-hint { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* Документ ЛО: данные 11 pt, названия столбцов 8 pt */
.pdz-pdf-holder.lon-doc { font-size: 22px; }
.pdz-pdf-holder.lon-doc .lon-h { margin: 0 0 12px; font-size: 24px; font-weight: 700; line-height: 1.25; }
.pdz-pdf-holder.lon-doc .lon-label { margin: 14px 0 6px; font-size: 22px; font-weight: 700; }
.pdz-pdf-holder.lon-doc .lon-text { margin: 0 0 10px; font-size: 22px; line-height: 1.3; }
.pdz-pdf-holder.lon-doc .lon-caption { margin: 18px 0 6px; text-align: right; font-size: 22px; font-weight: 700; }
.pdz-pdf-holder.lon-doc table { width: 100%; table-layout: fixed; }
.pdz-pdf-holder.lon-doc th,
.pdz-pdf-holder.lon-doc td { padding: 4px 5px; font-size: 22px; line-height: 1.2; overflow-wrap: break-word; }
.pdz-pdf-holder.lon-doc thead th { font-size: 16px; }
.pdz-pdf-holder.lon-doc thead tr.pdz-num-row th { font-size: 16px; padding: 2px 4px; }
.pdz-pdf-holder.lon-doc td.center { text-align: center; }

@media (max-width: 640px) {
  .lon-sub-label { flex: 1 1 100%; }
  .lon-subrow input, .lon-subrow select { flex: 1 1 100%; }
}

/* ---------- ОЗО ДК: огнезащитная обработка деревянных конструкций ---------- */
.ozo-count { display: flex; flex-direction: column; gap: 2px; padding: 9px 0 0; }
.ozo-count strong { font-size: 20px; line-height: 1.1; color: var(--ink); }
.ozo-count-hint { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.ozo-neg { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ozo-neg[hidden] { display: none; }
.ozo-neg-hint-note { display: block; margin-top: 5px; font-size: 12.5px; line-height: 1.4; font-weight: 400; color: var(--muted); }
.ozo-neg-warn { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: #c0342a; }
.ozo-neg-warn[hidden] { display: none; }
.ozo-samples-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 6px; }
.ozo-samples-head[hidden] { display: none; }
.ozo-samples-head > span:first-child { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.ozo-samples-hint { font-size: 12.5px; color: var(--muted); }
.ozo-sample { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 7px 0; border-top: 1px solid var(--line); }
.ozo-sample-no { flex: 0 0 34px; font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; }
.ozo-sample input[type="text"] {
  flex: 0 1 170px; min-width: 0;
  padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 4px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
.ozo-sample input[type="text"]:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.ozo-check { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.ozo-check input { width: 17px; height: 17px; accent-color: var(--red); cursor: pointer; }

/* Документ ОЗО ДК: содержимое таблицы 11 pt (22px), названия столбцов 8 pt */
.pdz-pdf-holder.ozo-doc { font-size: 22px; }
.pdz-pdf-holder.ozo-doc .ozo-title { margin: 0 0 12px; font-size: 24px; line-height: 1.3; }
.pdz-pdf-holder.ozo-doc table { width: 100%; min-width: 0; table-layout: fixed; }
.pdz-pdf-holder.ozo-doc th,
.pdz-pdf-holder.ozo-doc td { padding: 4px 5px; font-size: 22px; line-height: 1.2; overflow-wrap: break-word; }
.pdz-pdf-holder.ozo-doc thead th { font-size: 16px; }
.pdz-pdf-holder.ozo-doc td.center { text-align: center; }
.pdz-pdf-holder.ozo-doc td.ozo-no { text-align: left; white-space: nowrap; }
.pdz-pdf-holder.ozo-doc td.ozo-place { text-align: center; }
.pdz-pdf-holder.ozo-doc .ozo-place-note { display: block; margin-top: 6px; font-size: 22px; line-height: 1.25; }
.pdz-pdf-holder.ozo-doc .ozo-criteria { margin: 14px 0 0; }
.pdz-pdf-holder.ozo-doc .ozo-criteria p { margin: 0 0 3px; font-size: 18px; line-height: 1.3; }

/* ---------- ОЗО МК: огнезащитная обработка металлических конструкций ---------- */
.omk-group-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.omk-elements { margin-top: 4px; }
.omk-element { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.omk-element:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.omk-element-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.omk-element-head strong { font-size: 14px; color: var(--ink-soft); }
.omk-hint { display: block; margin-top: 5px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.omk-cert-fields { gap: 0 16px; margin-bottom: 4px; }
.omk-cert-fields .field { margin-bottom: 0; }
.omk-cert-warn { margin: 0; font-size: 13.5px; line-height: 1.4; }
.omk-cert-warn:not(:empty) { margin-top: 6px; }
.omk-cert-warn.is-warn { color: #c0342a; }
.omk-known-fields { gap: 0 16px; margin-bottom: 0; }
.omk-known-fields[hidden] { display: none; }
.omk-known-fields .field { margin-bottom: 0; }
.omk-live { min-height: 1.45em; margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.omk-live.is-ok strong { color: #1a7f37; }
.omk-live.is-bad strong { color: #c0342a; }
.omk-live.is-warn { color: #c0342a; }
.omk-table { min-width: 860px; }
.omk-table tbody tr:nth-child(even) td { background: transparent; }
.omk-table tr.omk-group-row td { background: var(--bg-soft); font-weight: 700; text-align: center; }
.omk-table td.omk-ok { color: #1a7f37; }
.omk-table td.omk-bad { color: #c0342a; }
.omk-table td.omk-view { text-align: left; }

/* Документ ОЗО МК: содержимое таблицы 11 pt (22px), названия столбцов 9 pt */
.pdz-pdf-holder.omk-doc { font-size: 22px; }
.pdz-pdf-holder.omk-doc .omk-title { margin: 0 0 6px; font-size: 24px; line-height: 1.3; }
.pdz-pdf-holder.omk-doc .omk-cert { margin: 0 0 8px; }
.pdz-pdf-holder.omk-doc .omk-cert p { margin: 0 0 4px; font-size: 22px; line-height: 1.3; }
.pdz-pdf-holder.omk-doc .omk-cert p.is-bad { color: #c0342a; }
.pdz-pdf-holder.omk-doc .omk-subtitle { margin: 0 0 4px; font-size: 22px; line-height: 1.3; }
.pdz-pdf-holder.omk-doc .omk-caption { margin: 0 0 10px; text-align: right; font-size: 22px; font-style: italic; }
.pdz-pdf-holder.omk-doc table { width: 100%; min-width: 0; table-layout: fixed; }
.pdz-pdf-holder.omk-doc th,
.pdz-pdf-holder.omk-doc td { padding: 4px 5px; font-size: 22px; line-height: 1.2; overflow-wrap: break-word; }
.pdz-pdf-holder.omk-doc thead th { font-size: 18px; }
.pdz-pdf-holder.omk-doc thead tr.omk-num-row th { font-size: 18px; padding: 2px 4px; }
.pdz-pdf-holder.omk-doc tbody tr:nth-child(even) td { background: transparent; }
.pdz-pdf-holder.omk-doc td.center { text-align: center; }
.pdz-pdf-holder.omk-doc tr.omk-group-row td { font-weight: 700; text-align: center; background: #f5f5f5; }
.pdz-pdf-holder.omk-doc td.omk-ok { color: #1a7f37; }
.pdz-pdf-holder.omk-doc td.omk-bad { color: #c0342a; }
.pdz-pdf-holder.omk-doc .omk-note { margin: 14px 0 0; font-size: 18px; line-height: 1.3; }

/* Модальное окно предпросмотра таблицы результатов */
.table-preview-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(20, 20, 20, 0.65);
}
.table-preview-dialog {
  display: flex; flex-direction: column;
  width: min(1100px, 100%); max-height: calc(100vh - 48px);
  background: #fff; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.table-preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border-bottom: 1px solid #e5e5e5;
}
.table-preview-head strong { font-size: 16px; }
.table-preview-close {
  padding: 0 4px; border: 0; background: transparent;
  font-size: 26px; line-height: 1; color: #666; cursor: pointer;
}
.table-preview-close:hover { color: #222; }
.table-preview-body { padding: 16px 18px; overflow: auto; }
.table-preview-body .pdz-table { min-width: 0; }
.table-preview-img { display: block; width: 100%; height: auto; }
body.table-preview-open { overflow: hidden; }
@media (max-width: 640px) {
  .table-preview-overlay { padding: 10px; }
  .table-preview-dialog { max-height: calc(100vh - 20px); }
  .table-preview-body { padding: 10px; }
}

@media (max-width: 640px) {
  .calc-actions { width: 100%; }
  .calc-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* ---------- Оборудование ---------- */
.equip-card { text-align: left; }
.equip-card .icon-badge svg { width: 26px; height: 26px; }
.equip-tag { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }

/* ---------- Таблицы ---------- */
.tbl { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 15px; }
.tbl th, .tbl td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { background: var(--bg-soft); font-weight: 700; color: var(--ink-soft); }
.tbl tr:last-child td { border-bottom: none; }

/* ---------- Блог ---------- */
.post-card { display: block; text-decoration: none; color: inherit; }
.post-card .card { transition: transform 0.18s, box-shadow 0.18s; height: 100%; }
.post-card:hover .card { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(51,48,40,0.16); }
.post-card:hover h3 { color: var(--accent); }
.post-meta { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.post-cat { font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.8px; font-size: 12px; }
.post-card { scroll-margin-top: 96px; }
.calc { scroll-margin-top: 96px; }

/* ---------- Указатель статей в блоге ---------- */
.post-index {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 40px; box-shadow: var(--shadow);
}
.post-index h2 { font-size: 18px; margin: 0 0 12px; }
.post-index ol { margin: 0; padding: 0; list-style: none; counter-reset: pi; }
.post-index li {
  counter-increment: pi; position: relative;
  padding: 8px 0 8px 42px; border-bottom: 1px dashed var(--line);
}
.post-index li:last-child { border-bottom: none; }
.post-index li::before {
  content: counter(pi); position: absolute; left: 0; top: 9px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.post-index a { font-weight: 700; }
.post-index .pi-meta { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ---------- Шаблоны документов ---------- */
.tpl-card { display: flex; flex-direction: column; gap: 6px; }
.tpl-file {
  margin-top: auto; padding-top: 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; color: var(--accent);
}

/* ---------- Формы ---------- */
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-success {
  display: none;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 16px 18px;
  line-height: 1.55;
}
.form-success.show { display: block; }
.form-success a { color: var(--accent-dark); }

/* ---------- Уведомление о недоступности формы обратной связи ---------- */
.form-notice {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 12px 14px; margin: 0 0 18px;
  font-size: 14.5px; line-height: 1.55; color: var(--ink-soft);
}
.form-notice a { color: var(--accent-dark); font-weight: 700; }
.fb-notice-modal .tf-modal-card { max-width: 520px; padding-bottom: 28px; }
.fb-notice-modal .tf-modal-text {
  margin: 0 0 22px; font-size: 16px; line-height: 1.65; color: var(--ink-soft);
}
.fb-notice-modal .tf-modal-text a { color: var(--accent-dark); font-weight: 700; }
.tf-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@keyframes fbModalIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.fb-notice-modal.open .tf-modal-card { animation: fbModalIn 0.18s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .fb-notice-modal.open .tf-modal-card { animation: none; }
}
@media (max-width: 480px) {
  .fb-notice-modal .tf-modal-card { padding: 26px 20px 22px; }
  .fb-notice-modal .tf-modal-title { font-size: 21px; }
  .fb-notice-modal .tf-modal-text { font-size: 15px; margin-bottom: 18px; }
  .fb-notice-modal .btn { width: 100%; justify-content: center; }
}

/* Чекбокс согласия на обработку персональных данных */
.check-field {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 4px 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.check-field input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.check-field a { color: var(--accent-dark); }

/* Уведомление об использовании cookie */
.cookie-note {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 300;
  width: calc(100% - 32px);
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(51, 48, 40, 0.22);
}
.cookie-note p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.cookie-note a { color: var(--accent-dark); }
.cookie-note .btn { flex: 0 0 auto; }
@media (max-width: 640px) {
  .cookie-note { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
}

/* ---------- CTA ---------- */
.cta-band {
  background: var(--accent);
  color: #fff;
}
.cta-band .section-eyebrow { color: #ffd978; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #dcecfa; }
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Подвал ---------- */
.site-footer { background: #201e1a; color: #bdb6a4; padding: 54px 0 0; margin-top: 0; }
.site-footer h4 { color: #f0ead9; margin-bottom: 14px; font-size: 15px; letter-spacing: 1px; text-transform: uppercase; }
.site-footer a { color: #cfcabd; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 32px; padding-bottom: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-nav { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid #3a372f;
  padding: 20px 0;
  font-size: 13.5px;
  color: #8a8474;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-brand-name { font-family: var(--serif); font-weight: 700; font-size: 22px; color: #f0ead9; }
.footer-desc { font-size: 15px; line-height: 1.7; }

/* ---------- Бейджи/пункты признаков ---------- */
.marker-list { list-style: none; margin: 0; padding: 0; }
.marker-list li { padding: 6px 0 6px 32px; position: relative; }
.marker-list li::before {
  content: "✓";
  position: absolute; left: 0; top: 7px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.marker-list li.red::before { background: #fbe3e1; color: var(--red); content: "✕"; }

/* ---------- Хлебные крошки ---------- */
.crumbs { font-size: 14px; color: var(--muted); padding: 16px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 6px; color: var(--line-strong); }

/* ---------- Прочие ---------- */
.quote {
  font-family: var(--serif);
  font-size: 21px; line-height: 1.5;
  border-left: 4px solid var(--accent);
  background: var(--paper-2);
  padding: 20px 26px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 26px 0;
}
.divider { border: none; border-top: 1px solid var(--line); margin: 30px 0; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.nowrap { white-space: nowrap; }

.mr-1 { margin-right: 8px; }
.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }

/* Скан-баннер поверхность */
.paperclip-line {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex; gap: 18px; align-items: flex-start;
}
.paperclip-line svg { flex: 0 0 auto; margin-top: 4px; }

/* ---------- Иллюстрации и плейсхолдеры ---------- */
.photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.photo-frame {
  border: 1px solid var(--line);
  padding: 7px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.fig { margin: 22px 0; }
.fig img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.fig.small { margin: 16px 0 22px; }
.fig.small img { max-width: 440px; border-radius: var(--radius); }
/* Портретное фото в блоке чек-листа: ограничиваем высоту, чтобы блок не вытягивался */
.fig.portrait img { width: auto; max-height: 330px; }
.fig.xs { margin: 14px 0 20px; }
.fig.xs img { max-width: 250px; border-radius: var(--radius); }
.fig figcaption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
}

.card-img {
  margin: -26px -26px 18px;
  width: calc(100% + 52px);
  max-width: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Обложка статьи: уменьшенная в 2 раза, кадр — от верха до середины изображения */
.fig-crop {
  width: 50%;
  aspect-ratio: 513 / 366;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.fig-crop img { width: 100%; height: auto; display: block; }

/* Обложка в карточке блога: та же вырезка, на всю ширину карточки */
.card-img-crop {
  margin: -26px -26px 18px;
  aspect-ratio: 513 / 366;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-img-crop img { width: 100%; height: auto; display: block; }

/* Обложки статей в блоке «Статьи в этом разделе»: компактный кадр одинаковой высоты */
.post-card .card-img,
.post-card .card-img-crop { height: 210px; }
.post-card .card-img-crop {
  width: calc(100% + 52px);
  max-width: none;
}
.post-card .card-img {
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.post-card .card-img-crop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

@media (max-width: 560px) {
  .fig-crop { width: 100%; }
}

/* ---------- Адаптивные колонки внутри карточек чек-листа ---------- */
.check-cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}
@media (max-width: 800px) { .check-cols { grid-template-columns: 1fr; } }

/* ---------- Каталог инженерных расчётов ---------- */
.calc-catalog {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.calc-catalog-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.calc-catalog-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(51, 48, 40, 0.16);
  border-color: var(--line-strong);
  color: inherit;
}
.calc-catalog-icon {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  padding: 10px;
}
.calc-catalog-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.calc-catalog-body { flex: 1 1 auto; min-width: 0; }
.calc-catalog-title {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  transition: color 0.18s;
}
.calc-catalog-desc {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.calc-catalog-arrow {
  flex: 0 0 auto;
  color: var(--accent);
  display: grid;
  place-items: center;
  transition: transform 0.18s;
}
.calc-catalog-item:hover .calc-catalog-title { color: var(--accent); }
.calc-catalog-item:hover .calc-catalog-arrow { transform: translateX(4px); }
.calc-single { max-width: 820px; }
@media (max-width: 800px) {
  .calc-catalog { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .calc-catalog-item { gap: 14px; padding: 16px; }
  .calc-catalog-icon { flex-basis: 60px; width: 60px; height: 60px; padding: 8px; }
  .calc-catalog-title { font-size: 16px; }
}

/* ---------- Нумерованный список с бейджами ---------- */
.num-list { list-style: none; margin: 0; padding: 0; counter-reset: qi; }
.num-list li {
  counter-increment: qi;
  margin: 0 0 4px;
  position: relative;
  padding: 6px 0 6px 44px;
}
.num-list li::before {
  content: counter(qi);
  position: absolute; left: 0; top: 6px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--sans); font-weight: 700; font-size: 15px;
  display: grid; place-items: center;
}

/* ---------- Аккаунт в шапке ---------- */
.header-account { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.header-account-name {
  font-size: 14px; font-weight: 700; color: var(--ink);
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-account-login {
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  padding: 8px 16px; border-radius: var(--radius);
  border: 2px solid var(--line-strong); background: transparent;
  color: var(--ink); cursor: pointer; white-space: nowrap;
}
.header-account-login:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.header-account-link {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  background: none; border: none; padding: 4px 2px; cursor: pointer;
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.header-account-link:hover { color: var(--accent); }
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; row-gap: 10px; }
  .header-account { order: 3; flex: 1 1 100%; justify-content: flex-end; }
}

/* ---------- Окно входа и регистрации ---------- */
body.tf-modal-open { overflow: hidden; }
.tf-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.tf-modal.open { display: flex; }
.tf-modal-backdrop { position: absolute; inset: 0; background: rgba(32,30,26,0.55); }
.tf-modal-card {
  position: relative; width: 100%; max-width: 430px;
  background: var(--paper); border-radius: 10px; box-shadow: var(--shadow);
  padding: 30px 30px 24px;
  max-height: calc(100vh - 40px); overflow-y: auto;
}
.tf-modal-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--muted); cursor: pointer;
}
.tf-modal-close:hover { color: var(--accent); }
.tf-modal-title { font-size: 24px; margin: 0 0 8px; }
.tf-modal-note {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 10px 12px; font-size: 14px; color: var(--ink-soft);
  border-radius: 4px; margin: 0 0 16px;
}
.tf-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tf-tabs button {
  flex: 1 1 50%; background: none; border: none; padding: 9px 6px;
  font-family: var(--sans); font-size: 14px; font-weight: 700; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent;
}
.tf-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tf-form { display: flex; flex-direction: column; gap: 12px; }
.tf-field {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--muted);
}
.tf-field[hidden] { display: none; }
.tf-field input {
  font-family: var(--sans); font-size: 16px; font-weight: 400;
  text-transform: none; letter-spacing: 0; color: var(--ink);
  padding: 11px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: #fff;
}
.tf-field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.tf-error { margin: 0; min-height: 18px; font-size: 14px; color: var(--red-dark); }
.tf-submit { justify-content: center; width: 100%; }
.tf-hint { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* ---------- Панель проекта расчёта ---------- */
.project-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  background: var(--paper-2); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); padding: 14px 18px; margin: 18px 0 26px;
}
.project-bar-text { flex: 1 1 320px; font-size: 14.5px; color: var(--ink-soft); }
.project-bar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.project-bar-status { flex: 1 1 100%; margin: 0; font-size: 14px; }
.project-bar-status.is-ok { color: #2f6b3a; }
.project-bar-status.is-err { color: var(--red-dark); }
.btn-sm { padding: 9px 16px; font-size: 14px; }

/* Копии кнопок проекта внутри калькулятора */
.calc-project-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.calc-project-label {
  flex: 0 0 100%;
  font-size: 12px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--muted); margin: 0;
}
.calc-project-actions .btn { padding: 8px 12px; font-size: 13.5px; }
.calc-project-status { margin: 8px 0 0; }
@media (max-width: 640px) {
  .calc-project-actions .btn { flex: 1 1 100%; justify-content: center; }
}
