/* ═══════════════════════════════════════════════════════════
   Сайт строителя каркасных домов — стили
   Принципы: читаемый текст 16px+, крупные кнопки под палец,
   никаких анимаций, мешающих чтению. Целевая аудитория 35+.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:        #f7f6f3;
  --surface:   #ffffff;
  --surface-2: #f0ede7;
  --ink:       #1d2129;
  --ink-soft:  #5a6270;
  --muted:     #8b93a1;
  --line:      #e2ded6;
  --brand:     #1f3864;
  --brand-2:   #2b4c85;
  --accent:    #c1741f;
  --accent-2:  #e19a45;
  --ok:        #1e7b34;
  --warn:      #9a6b00;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 2px 8px rgba(29, 33, 41, .06);
  --shadow-lg: 0 8px 28px rgba(29, 33, 41, .10);
  --maxw:      1160px;
}

* { box-sizing: border-box; }

/* Тексты приходят из админки, и владелец может вписать длинное слово —
   адрес, название посёлка в одно слово. Без этого правила такой текст
   растягивает страницу и появляется горизонтальная прокрутка на телефоне. */
body { overflow-wrap: break-word; }
img, table, pre { max-width: 100%; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.5px; }
h2 { font-size: clamp(23px, 2.6vw, 32px); }
h3 { font-size: 19px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }

/* ─────────── ШАПКА ─────────── */
.header {
  position: sticky; top: 0; z-index: 50;  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

/* Липкая шапка перекрывала заголовок при переходе по якорям
   («Строим», «Мелкие работы»): добавляем отступ прокрутки. */
section[id], div[id], h2[id] { scroll-margin-top: 96px; }

.header-inner {
  display: flex; align-items: center; gap: 22px;
  min-height: 76px;
}

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo:hover { text-decoration: none; }

.logo-mark {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  border-radius: 12px; font-weight: 800; font-size: 17px;
}

.logo-text b { display: block; font-size: 17px; line-height: 1.15; letter-spacing: -.01em; }
.logo-text small {
  display: block; font-size: 12px; color: var(--muted);
  white-space: nowrap; line-height: 1.3;
}

/* Меню: пункты не переносятся по словам, текущий раздел подчёркнут —
   видно, где находишься. */
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a {
  position: relative; color: var(--ink-soft); font-size: 15px; font-weight: 500;
  white-space: nowrap; padding: 11px 0;
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--brand); transform: scaleX(0); transition: transform .16s ease;
}
.nav a:hover { color: var(--brand); text-decoration: none; }
.nav a:hover::after { transform: scaleX(1); }
.nav a.is-active { color: var(--brand); font-weight: 600; }
.nav a.is-active::after { transform: scaleX(1); }

.header-contacts { display: flex; align-items: center; gap: 14px; }

.header-phone {
  font-weight: 600; font-size: 16.5px; color: var(--ink); white-space: nowrap;
  padding: 8px 0;               /* по такому телефону легко попасть пальцем */
}
.header-phone:hover { color: var(--brand); text-decoration: none; }

/* ─────────── КНОПКИ ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 16px;
  text-decoration: none; transition: background .15s, border-color .15s, transform .1s;
  min-height: 48px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #a96217; }

.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); background: #f4f6fa; }

.btn-small { padding: 10px 16px; font-size: 15px; min-height: 42px; }
.btn-lg { padding: 16px 28px; font-size: 17px; min-height: 54px; }
.btn-block { width: 100%; }

/* ─────────── ПЕРВЫЙ ЭКРАН ─────────── */
.hero { background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); padding: 48px 0 40px; }

.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center;
}

.badge {
  display: inline-block; padding: 7px 14px; margin-bottom: 18px;
  background: #eaf1e8; color: var(--ok);
  border-radius: 999px; font-size: 14px; font-weight: 600;
}

.hero .lead { font-size: 18.5px; color: var(--ink-soft); margin: 0 0 26px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }

.hero-points { list-style: none; margin: 0; padding: 0; }
.hero-points li {
  position: relative; padding-left: 28px; margin-bottom: 10px;
  color: var(--ink-soft); font-size: 16px;
}
.hero-points li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--ok); font-weight: 800;
}

.hero-media { position: relative; }
.hero-media img {
  border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%;
  aspect-ratio: 3 / 2; object-fit: cover;
}
.hero-media-note {
  margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center;
}

/* Телефон прямо в первом экране: часть людей не листает, а звонит сразу */
.hero-phone { margin-top: 22px; font-size: 16px; color: var(--ink-soft); }
.hero-phone a { font-size: 21px; font-weight: 800; color: var(--ink); white-space: nowrap; }

/* ─────────── ЦИФРЫ ─────────── */
.stats { background: var(--brand); color: #fff; padding: 30px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat b { display: block; font-size: clamp(24px, 3vw, 34px); font-weight: 800; }
.stat span { font-size: 14.5px; opacity: .85; }

/* Честная оговорка к ценам: снимает спор «вы обещали дешевле» */
.price-note {
  max-width: 720px; margin: 0 auto 26px; padding: 14px 18px;
  background: #fff8e6; border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); color: var(--ink-soft); font-size: 15px;
}

/* ─────────── СТРАНИЦЫ ОШИБОК ─────────── */
.error-page { text-align: center; padding: 20px 0 40px; }
.error-code {
  font-size: clamp(64px, 14vw, 120px); font-weight: 800; line-height: 1;
  color: var(--line); margin-bottom: 8px;
}
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 26px 0; }
.error-phone { font-size: 16px; color: var(--ink-soft); }
.error-phone a { font-size: 20px; font-weight: 800; color: var(--ink); }

/* ─────────── ПОМЕТКА «ЭТО ПРИМЕР» ─────────── */
/* Работа из демонстрационного набора: фото не от этого объекта. Показываем
   честно, чтобы не было претензии по закону о рекламе. Владелец удаляет
   такие работы одной кнопкой, когда заливает свои. */
.demo-note {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 8px 0 0; padding: 8px 14px;
  background: #fff4e0; border: 1px dashed var(--accent);
  border-radius: var(--radius-sm); color: #7a4a05; font-size: 14px;
}
.work .demo-note, .project-desc .demo-note { margin-top: 12px; }

/* ─────────── СЕКЦИИ ─────────── */
.section { padding: 60px 0; }
/* Заголовок страницы с переходами по разделам: нижний отступ меньше,
   иначе до первого раздела остаётся пустая полоса в пол-экрана. */
.section-title { padding-bottom: 12px; }
.section-alt { background: var(--surface-2); }
.section-cta { background: var(--brand); color: #fff; }
.section-cta h2, .section-cta .section-lead { color: #fff; }

.section-lead { color: var(--ink-soft); max-width: 680px; margin: 0 0 32px; font-size: 17px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.link-more { font-weight: 600; white-space: nowrap; }

/* ─────────── КАРТОЧКИ УСЛУГ ─────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-soft); margin: 0 0 16px; font-size: 15.5px; }
.card-price { font-size: 21px; font-weight: 800; color: var(--brand); }
.card-price small { font-size: 14px; font-weight: 500; color: var(--muted); }

/* ─────────── ГАЛЕРЕЯ РАБОТ ─────────── */
.works { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.work {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}

.work-photo { display: block; background: var(--surface-2); }
.work-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.work-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.work-body h3 { margin: 0; font-size: 18px; }

.work-specs {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ink-soft);
}
.work-specs li {
  background: var(--surface-2); padding: 4px 10px; border-radius: 6px;
}

.work-price { font-weight: 800; color: var(--brand); font-size: 18px; }
.work-want { margin-top: auto; }

.empty-state {
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 32px; text-align: center; color: var(--ink-soft);
}
.empty-state code { background: var(--surface-2); padding: 2px 7px; border-radius: 5px; font-size: 14px; }

/* Метка мастера вместо портрета: пока фото нет, блок не должен пустовать. */
.about-photo-text {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: var(--radius); min-height: 320px; padding: 28px;
}
.about-initials {
  font-size: 72px; font-weight: 800; color: var(--brand); line-height: 1;
  letter-spacing: 2px; margin-bottom: 8px;
}
.about-photo-text b { font-size: 20px; }
.about-photo-text .muted { font-size: 15px; }

/* ─────────── СТРАНИЦА УСЛУГИ ─────────── */
.crumbs { font-size: 14.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; }
.crumbs b { color: var(--ink); font-weight: 600; }

.svc-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow);
}
.svc-price span { font-size: 26px; font-weight: 800; color: var(--brand); }
.svc-price small { display: block; color: var(--muted); font-size: 14.5px; }
.svc-term { color: var(--ink-soft); font-size: 16px; }
.svc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }

.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li {
  position: relative; padding: 10px 0 10px 32px; border-bottom: 1px dashed var(--line);
  color: var(--ink-soft); font-size: 16.5px;
}
.check-list li:last-child { border-bottom: none; }
.check-list li::before {
  content: "✓"; position: absolute; left: 4px; top: 10px;
  color: var(--ok); font-weight: 800;
}
/* Строка «НЕ входит» — граница комплектации, её видно сразу. */
.check-list li.is-exclude {
  color: #8a5a12; background: #fff8ee; border-radius: var(--radius-sm);
  padding-left: 32px; padding-right: 12px; border-bottom: none; margin-top: 8px;
}
.check-list li.is-exclude::before { content: "—"; color: #b8860b; }

/* ─────────── СРАВНЕНИЕ КОМПЛЕКТАЦИЙ ─────────── */
.cmp-wrap { overflow-x: auto; }
.cmp-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  min-width: 720px;
}
.cmp-table th, .cmp-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left;
  vertical-align: top;
}
.cmp-table thead th { background: var(--surface-2); font-size: 15px; }
.cmp-table thead th.is-current { background: #fff3e2; box-shadow: inset 0 3px 0 var(--accent); }
.cmp-title { display: block; font-weight: 700; color: var(--brand); }
.cmp-price { display: block; margin-top: 4px; font-weight: 800; color: var(--accent); }
.cmp-price small { font-weight: 500; color: var(--muted); }
.cmp-table tbody tr:hover td { background: #fafbfd; }
.cmp-cell { text-align: center; font-weight: 800; font-size: 18px; width: 130px; }
.cmp-cell.is-yes { color: var(--ok); }
.cmp-cell.is-no { color: #c9ced8; }
.cmp-table td:first-child { color: var(--ink-soft); }
.cmp-next td { background: #f6f8fc; font-size: 14.5px; color: var(--ink-soft); border-bottom: none; }
.cmp-next td:first-child { font-weight: 700; color: var(--ink); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.photo-cell {
  display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2);
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .18s; }
.photo-cell:hover img { transform: scale(1.05); }

.link-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Карточка услуги с фотографией-обложкой */
.card-svc { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.card-svc h3, .card-svc p, .card-svc .card-price, .card-svc .card-actions { margin-left: 22px; margin-right: 22px; }
.card-svc h3 { margin-top: 18px; }
.card-svc h3 a { color: var(--brand); }
.card-cover { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .18s; }
.card-cover:hover img { transform: scale(1.05); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; padding-bottom: 22px; }
.card-actions .btn { flex: 1 1 auto; }


/* ─────────── СТРАНИЦА МАСТЕРОВ ─────────── */
.master-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); margin-bottom: 26px;
}
.master-head { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.master-avatar {
  flex: 0 0 auto; width: 132px; height: 132px; border-radius: 50%; overflow: hidden;
  background: var(--surface-2); border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.master-avatar img { width: 100%; height: 100%; object-fit: cover; }
.master-avatar span { font-size: 52px; font-weight: 800; color: var(--brand); }
.master-info { flex: 1 1 320px; }
.master-info h2 { margin: 0 0 4px; }
.master-role { color: var(--accent); font-weight: 600; margin: 0 0 12px; }
.master-about { color: var(--ink-soft); margin: 0 0 12px; }
.master-stats { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.master-stats b { color: var(--brand); }
.master-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.master-groups { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.master-groups > b { display: block; margin-bottom: 10px; }
.master-works { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.master-works > b { display: block; margin-bottom: 14px; }
.works-compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.works-compact .work-body h3 { font-size: 16px; }


/* Строка вместо карточки: у услуг разная длина текста, и сетка карточек
   неизбежно получается рваной. Строки выравниваются сами. */
/* ─────────── СПИСОК УСЛУГ ─────────── */
/* Строка вместо карточки: у услуг разная длина текста, и сетка карточек
   неизбежно получается рваной. Строки выравниваются сами. */
.svc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.svc-row { border-bottom: 1px solid var(--line); }
.svc-row-link {
  display: flex; align-items: center; gap: 18px; padding: 16px 12px;
  color: var(--ink); border-radius: var(--radius-sm);
}
.svc-row-link:hover { background: #f7f9fc; text-decoration: none; }
.svc-row-photo {
  flex: 0 0 auto; width: 96px; height: 72px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
}
.svc-row-nophoto {
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; opacity: .55; border-style: dashed;
}
.svc-row-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.svc-row-body b { font-size: 17.5px; color: var(--brand); }
.svc-row-lead { color: var(--ink-soft); font-size: 15px; }
.svc-row-price {
  flex: 0 0 auto; text-align: right; font-weight: 800; font-size: 17px;
  color: var(--brand); white-space: nowrap;
}
.svc-row-price small { display: block; font-weight: 500; font-size: 13.5px; color: var(--muted); }

@media (max-width: 640px) {
  .svc-row-link { flex-wrap: wrap; gap: 12px; }
  .svc-row-photo { width: 64px; height: 56px; }
  .svc-row-price { text-align: left; width: 100%; }
}

/* ─────────── НАПРАВЛЕНИЯ РАБОТ И ПРАЙС ─────────── */
/* Плитки направлений на главной: пять плиток вместо двадцати карточек,
   чтобы человек за секунду понял «тут делают всё». */
.dir-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px;
}
.dir-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); color: var(--ink);
}
.dir-card:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); text-decoration: none; }
.dir-icon { font-size: 30px; line-height: 1; }
.dir-card b { font-size: 18px; color: var(--brand); }
.dir-lead { color: var(--ink-soft); font-size: 15.5px; flex: 1; }
.dir-count { color: var(--accent); font-weight: 600; font-size: 14.5px; }
.dir-card-accent { border-color: var(--accent); border-width: 2px; background: #fffaf4; }
.dir-more { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }


/* Плитки-переходы: человек с задачей «сварить навес» попадает в свой раздел
   сразу, не листая страницу целиком. */
.chip-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px; font-size: 15.5px; font-weight: 600; color: var(--brand);
}
.chip:hover { border-color: var(--brand); background: #f4f6fa; text-decoration: none; }
.chip-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-accent:hover { background: #a96217; border-color: #a96217; color: #fff; }

.price-table-wrap { margin-top: 26px; overflow-x: auto; }
.price-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  min-width: 560px;
}
.price-table caption {
  text-align: left; font-weight: 700; font-size: 17px; padding: 0 0 12px; color: var(--ink);
}
.price-table th {
  text-align: left; padding: 14px 18px; background: var(--surface-2);
  font-size: 14.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.price-table td { padding: 14px 18px; border-top: 1px solid var(--line); vertical-align: top; }
.price-table tr:hover td { background: #fafbfd; }
.price-cell { white-space: nowrap; font-weight: 700; color: var(--brand); }
.price-cell small { font-weight: 500; color: var(--muted); }
.price-cell .free { color: var(--ok); }

/* ─────────── ЧЕМ БЕРЁМ (страница мелких работ) ─────────── */
.usp-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; margin-top: 8px;
}
.usp {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 18px 20px; box-shadow: var(--shadow);
}
.usp b { display: block; font-size: 16.5px; margin-bottom: 6px; color: var(--brand); }
.usp span { color: var(--ink-soft); font-size: 15px; }

.steps { margin: 0; padding-left: 22px; }
.steps li { margin-bottom: 14px; color: var(--ink-soft); font-size: 16.5px; }
.steps li b { color: var(--ink); }

/* ─────────── ФОТО К ЗАЯВКЕ ─────────── */
.file-input {
  width: 100%; padding: 12px 15px; font: inherit; font-size: 15.5px;
  background: #fff; border: 2px dashed var(--line); border-radius: var(--radius-sm);
  cursor: pointer;
}
.file-input:hover { border-color: var(--brand); }
.file-input::file-selector-button {
  font: inherit; font-weight: 600; margin-right: 14px; padding: 9px 16px;
  border: 0; border-radius: 8px; background: var(--brand); color: #fff; cursor: pointer;
}
.photo-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.photo-thumb {
  position: relative; width: 92px; height: 92px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--line); background: var(--surface-2);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb.is-loading { display: flex; align-items: center; justify-content: center; }
.photo-spinner { color: var(--muted); font-size: 22px; }
.photo-del {
  position: absolute; top: 3px; right: 3px; width: 24px; height: 24px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .62); color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0;
}
.photo-del:hover { background: #c0392b; }

/* ─────────── ОТЗЫВЫ: ПУБЛИЧНАЯ СТРАНИЦА ─────────── */
/* Только для чтения с экрана: подписи звёзд и служебные надписи. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.reviews-summary { margin: 0 0 28px; }
.reviews-score {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 22px; box-shadow: var(--shadow);
}
.reviews-score b { font-size: 34px; line-height: 1; color: var(--brand); }
.reviews-score .stars { color: var(--accent); letter-spacing: 3px; font-size: 19px; }

/* Оценка звёздами в форме: сами переключатели скрыты, кликаем по подписи. */
.rate-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; padding: 4px 0; }
.rate-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.rate-input label {
  font-size: 32px; line-height: 1; color: #d7dbe4; cursor: pointer;
  transition: color .12s; margin: 0; padding: 0 2px;
}
.rate-input label:hover,
.rate-input label:hover ~ label,
.rate-input input:checked ~ label { color: var(--accent); }
/* Клавиатурная навигация: звёзды должны быть видны при фокусе. */
.rate-input input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 3px; }

/* Ловушка для роботов: поле есть в разметке, но человек его не видит. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ─────────── КНОПКА МЕССЕНДЖЕРА ─────────── */
.btn-wa { background: #25d366; color: #fff; border-color: #25d366; }
.btn-wa:hover { background: #1eb455; border-color: #1eb455; color: #fff; }
.wa-icon { font-size: 17px; line-height: 1; }

/* Мессенджеры в шапке: MAX и Telegram — узнаваемые цвета, без ярких заливок,
   чтобы не спорить с главной кнопкой «Оставить заявку». */
.btn-max { border-color: #7b61ff; color: #5b3fd6; }
.btn-max:hover { background: #7b61ff; border-color: #7b61ff; color: #fff; }
.btn-tg { border-color: #2aabee; color: #1d8fc7; }
.btn-tg:hover { background: #2aabee; border-color: #2aabee; color: #fff; }

.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--brand); color: #fff; font-weight: 700;
  padding: 14px 20px; border-radius: 999px; box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.wa-float:hover { background: var(--brand-700, #1b3a75); color: #fff; text-decoration: none; }

/* Голосовой отзыв: плеер в карточке и запись в форме. */
.review-audio { margin: 10px 0 6px; }
.review-audio audio { width: 100%; max-width: 420px; height: 38px; }
.audio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.audio-row label.btn { cursor: pointer; }
.audio-preview {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px;
}
.audio-preview audio { max-width: 320px; height: 38px; }
.wa-float .wa-icon { font-size: 21px; }

@media (max-width: 640px) {
  .wa-float { right: 14px; bottom: 14px; padding: 15px 17px; }
  .wa-float-text { display: none; }
  .header-contacts .btn-wa { display: none; }  /* на телефоне хватит плавающей */
}

/* ─────────── КАЛЬКУЛЯТОР ─────────── */
/* Вкладки режимов: дом и ремонт считаются в одном блоке. */
.calc-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.calc-tab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font: inherit; font-size: 15.5px; font-weight: 600; line-height: 1.2; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--brand);
}
.calc-tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Мелкие работы считаются на своей странице: здесь только ссылка,
   отдельно от двух вкладок расчёта. */
.calc-other { margin: 16px 0 24px; font-size: 15px; }
.calc-other a { color: var(--muted); }
.calc-other a:hover { color: var(--brand); }

/* Чипы ступеней дома: три варианта стоят в одну строку и делят ширину
   поровну — так видно, что это выбор из трёх, а не список.
   Два класса в селекторе: общее правило .chips ниже по файлу задаёт flex
   и при равной специфичности перебивало бы раскладку. */
.chips.chips-packages {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.chips-packages .chip {
  flex-direction: column; align-items: flex-start; gap: 3px;
  text-align: left; width: 100%; max-width: none; padding: 12px 14px;
  border-radius: var(--radius-sm); white-space: normal;
}
.chips-packages .chip b { font-size: 15px; line-height: 1.25; }
.chips-packages .chip small { font-size: 13px; color: var(--muted); font-weight: 500; }
.chips-packages .chip.is-active small { color: rgba(255, 255, 255, .85); }
.chips-packages .chip-hint { font-size: 12.5px; line-height: 1.3; }

@media (max-width: 900px) {
  .chips.chips-packages { grid-template-columns: 1fr; }
}

/* Галочки в расчёте ремонта: стоят в ряд, а не столбиком —
   занимают одну строку вместо двух. */
.checks-row {
  display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 4px 0 18px;
}
.checks-row .checkbox { margin: 0; }

/* Три коротких числовых поля в одну строку: площадь, точки, точки. */
.lead-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .lead-grid.cols-3 { grid-template-columns: 1fr; }
}

/* Формы расчёта: подписи и поля ровно по сетке, без разъезжающихся отступов. */
.calc-panel .field + .field, .calc-panel .lead-grid + .lead-grid { margin-top: 0; }
.calc-panel .lead-grid { gap: 14px 16px; }
.calc-panel .field { margin-bottom: 14px; }

/* Состав выбранной ступени дома: что входит и что нет. */
.pkg-spec {
  margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.pkg-spec-head {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline;
  margin-bottom: 10px; font-size: 15px;
}
.pkg-spec-head b { font-size: 16px; }
.pkg-spec-head span { color: var(--muted); }
.pkg-spec-list { margin: 0; padding-left: 20px; }
.pkg-spec-list li { margin-bottom: 4px; font-size: 15px; line-height: 1.45; }
.pkg-spec-list li:last-child { color: var(--muted); }

.calc-wrap { display: grid; grid-template-columns: 1.3fr .7fr; gap: 26px; align-items: start; }

.calc-panel, .calc-result {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}

.field { margin-bottom: 22px; }
.field label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15.5px; }

input[type="text"], input[type="tel"], input[type="number"],
input[type="email"], input[type="password"], select, textarea {
  width: 100%; padding: 13px 15px; font: inherit; font-size: 16px;
  color: var(--ink); background: #fff;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  min-height: 50px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-2);
}
textarea { resize: vertical; min-height: 90px; }

.range-row { display: grid; grid-template-columns: 1fr 110px; gap: 14px; align-items: center; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border-radius: 4px;
  background: var(--line); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 3px solid #fff;
  box-shadow: var(--shadow);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 3px solid #fff;
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  padding: 12px 16px; font: inherit; font-size: 15px; font-weight: 500;
  background: #fff; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; line-height: 1.3;
  min-height: 48px;
}
.chip small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.chip:hover { border-color: var(--brand-2); }
.chip.is-active { border-color: var(--accent); background: #fdf6ee; color: var(--brand); }

.calc-more { margin: 6px 0 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.calc-more summary {
  cursor: pointer; font-weight: 600; color: var(--brand-2);
  font-size: 15.5px; padding: 6px 0; list-style: none;
}
.calc-more summary::-webkit-details-marker { display: none; }
.calc-more summary::before { content: "＋ "; font-weight: 700; }
.calc-more[open] summary::before { content: "− "; }
.calc-more-body { padding-top: 18px; }

/* результат */
.result-head { font-size: 14.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.result-sum {
  font-size: clamp(26px, 3.4vw, 38px); font-weight: 800;
  color: var(--brand); margin: 6px 0 8px; line-height: 1.15;
}
.result-note { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 20px; }

.result-table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 16px; }
.result-table td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.result-table td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.result-table tr:last-child td { border-bottom: none; }

.result-warnings { font-size: 14.5px; color: var(--warn); margin-bottom: 16px; }
.result-warnings p { margin: 0 0 6px; padding-left: 20px; position: relative; }
.result-warnings p::before { content: "!⃝"; position: absolute; left: 0; }

.result-cta { border-top: 1px solid var(--line); padding-top: 20px; }
.result-cta p { margin: 0 0 6px; }
.result-cta .small { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 16px; }

/* ─────────── ПРОЦЕСС ─────────── */
/* Слева шаги, справа фото со стройки: текст читается, а кадр подтверждает,
   что человек действительно строит, а не пересказывает чужой опыт. */
.process-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; align-items: start; }
.process { display: grid; gap: 16px; }

.process-step {
  display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.process-num {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 18px;
}
.process-step p { margin: 8px 0 0; color: var(--ink-soft); }

.process-photo img {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  position: sticky; top: 96px;
}

/* ─────────── О МАСТЕРЕ ─────────── */
.about-grid { display: grid; grid-template-columns: 380px 1fr; gap: 44px; align-items: start; }
.about-photo img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.about-text p { color: var(--ink-soft); }
.about-signature { margin-top: 20px; color: var(--ink); }
.guarantee { background: #eaf1e8; border-left: 4px solid var(--ok); padding: 14px 18px; border-radius: var(--radius-sm); color: var(--ink); }

/* ─────────── ОТЗЫВЫ ─────────── */
.review .stars { color: var(--accent); font-size: 18px; letter-spacing: 2px; margin-bottom: 10px; }
.review-author { font-weight: 600; color: var(--ink); margin-top: 12px; }

/* ─────────── FAQ ─────────── */
.faq { display: grid; gap: 10px; }

.faq-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 18px 20px; font-weight: 600; font-size: 16.5px;
  list-style: none; position: relative; padding-right: 48px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 22px; font-weight: 400; color: var(--brand-2);
}
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 20px 20px; color: var(--ink-soft); }

/* ─────────── ФОРМА ЗАЯВКИ ─────────── */
.lead-form { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-lg); color: var(--ink); }
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.req { color: var(--accent); }

.checkbox { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 22px; font-size: 14.5px; color: var(--ink-soft); cursor: pointer; }
.checkbox input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--accent); }

.form-note { font-size: 14px; color: var(--muted); text-align: center; margin: 14px 0 0; }

.form-msg { margin-top: 16px; padding: 14px 18px; border-radius: var(--radius-sm); font-size: 15.5px; }
.form-msg.ok { background: #eaf1e8; color: #14571f; border-left: 4px solid var(--ok); }
.form-msg.err { background: #fdeceb; color: #8a1f16; border-left: 4px solid #c0392b; }

/* ─────────── ПОДВАЛ ─────────── */
.footer { background: #14181f; color: #c9cfd8; padding: 44px 0 24px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.footer b { color: #fff; display: block; margin-bottom: 10px; }
.footer p { margin: 0 0 8px; font-size: 15px; }
.footer a { color: #c9cfd8; }
.footer a:hover { color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.footer-bottom {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid #262c36;
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  align-items: baseline; justify-content: space-between;
}
/* Сноска о поддержке: тише основного текста, но кликабельная */
.footer-credit { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.footer-credit a { color: #9aa4b2; border-bottom: 1px solid #3a4250; }
.footer-credit a:hover { color: #fff; }

/* Временно: вход мастера в галерею с оценкой фото. Убрать вместе с блоком
   в base.html, когда кнопка станет не нужна. */
.footer-login {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  padding: 6px 12px; border: 1px solid #3a4250; border-radius: 999px;
  color: #c7cdd6; font-size: 13px; text-decoration: none;
}
.footer-login:hover { color: #fff; border-color: #6b7686; }

/* ─────────── COOKIE ─────────── */
.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(0,0,0,.08); }
.cookie-inner { max-width: var(--maxw); margin: 0 auto; padding: 16px 20px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.cookie p { margin: 0; flex: 1 1 380px; font-size: 14.5px; color: var(--ink-soft); }
.cookie-actions { display: flex; gap: 10px; }

/* ─────────── АДАПТИВ ─────────── */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-media { order: -1; }
  .calc-wrap { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 26px; }
  .about-photo { max-width: 380px; }
  .process-grid { grid-template-columns: 1fr; gap: 26px; }
  .process-photo img { position: static; }

  /* Меню не прячем: на телефоне оно уходит во вторую строку шапки
     и прокручивается пальцем вбок — разделы остаются доступны. */
  .header-inner { flex-wrap: wrap; gap: 8px 14px; padding: 10px 0; }
  .header-contacts { margin-left: auto; }
  .nav {
    order: 3; width: 100%; margin-left: 0; gap: 20px;
    overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: 15.5px; padding: 4px 0; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .section { padding: 44px 0; }
  .header-inner { min-height: 64px; gap: 12px; }
  .logo-text small { display: none; }
  .header-contacts { gap: 10px; margin-left: auto; }
  .header-phone { font-size: 15.5px; }
  .header-contacts .btn { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .lead-grid { grid-template-columns: 1fr; }
  .range-row { grid-template-columns: 1fr 86px; gap: 10px; }
  .hero-actions .btn { width: 100%; }
  .calc-panel, .calc-result, .lead-form { padding: 20px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .cookie-inner { padding: 14px 16px; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}

@media print {
  .header, .footer, .cookie, .calc-panel { display: none; }
}
