:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #24201b;
  --muted: #7a7166;
  --line: #e7dfd3;
  --accent: #2f6b3a;
  --accent-dark: #24542d;
  --wood: #b8814a;
  --error: #c0392b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.15; margin: 0 0 16px; }
h2 { font-size: 24px; margin: 0 0 12px; }
h3 { margin: 0 0 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 18px; color: #4a433b; }

/* Шапка и подвал */
.header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; display: flex; gap: 8px; align-items: center; }
.logo__mark { color: var(--wood); }
.nav { display: flex; gap: 20px; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--accent); }
.footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0; color: var(--muted); font-size: 14px; }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* Блоки */
.hero { padding: 48px 0; background: linear-gradient(180deg, #f3ece1 0%, var(--bg) 100%); }
.hero--compact { text-align: center; }
.hero__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.steps { padding-left: 20px; margin: 24px 0; }
.steps li { margin-bottom: 10px; }
.section { padding: 40px 0; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.section--accent { background: var(--accent); color: #fff; }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta p { margin: 0; opacity: .9; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
details.card { padding: 16px 20px; margin-bottom: 10px; }
details summary { cursor: pointer; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.big-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 32px; line-height: 64px; margin: 0 auto 16px; }
.prose h2 { font-size: 20px; margin-top: 24px; }

/* Кнопки */
.btn {
  display: inline-block; border: 0; border-radius: 10px; background: var(--accent); color: #fff;
  padding: 14px 22px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn--wide { width: 100%; margin-top: 8px; }
.btn--small { padding: 8px 12px; font-size: 14px; }
.btn--light { background: #fff; color: var(--accent); }
.btn--light:hover { background: #eef5ef; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn--ghost:hover { background: #f4efe7; }

/* Форма */
.form h2 { margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; flex: 1; }
.field > span { font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea, .filters select {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #cfe3d2; border-color: var(--accent); }
.field--unit { flex: 0 0 110px; }
.field small, .error-text { color: var(--error); font-size: 13px; display: block; margin-bottom: 8px; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--error); }
.row { display: flex; gap: 12px; }
.radios { display: flex; gap: 20px; padding: 10px 0; }
.radios label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.field .radios input { width: auto; margin: 0; accent-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 8px; }
.check input { margin-top: 4px; }
.check.field--error { color: var(--error); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.alert { background: #fdecea; color: #8a2b20; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }

/* Карточка заявки */
.req { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.req__top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; align-items: center; }
.tag { background: #f3ece1; color: #7a5326; border-radius: 999px; padding: 3px 10px; font-weight: 600; font-size: 13px; }
.req__desc { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.req__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; font-size: 14px; }
.req__meta dt { color: var(--muted); font-size: 12px; }
.req__meta dd { margin: 0; }
.req__bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.filters { display: flex; gap: 12px; margin: 20px 0; flex-wrap: wrap; }
.filters select { width: auto; min-width: 220px; }

/* Админка */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--text); background: #fff; border: 1px solid var(--line); }
.tabs a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #faf6ef; font-weight: 600; }
.table td.small { max-width: 220px; }
.actions form { display: inline-block; margin: 0 4px 4px 0; }

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .nav { gap: 12px; font-size: 14px; }
}
@media (max-width: 520px) {
  .row { flex-direction: column; gap: 0; }
  .field--unit { flex: 1; }
  .card { padding: 18px; }
}
.nowrap { white-space: nowrap; }

/* Доска «Куплю / Продам» */
.badge { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; vertical-align: middle; }
.badge--buy { background: #e3eefc; color: #1f4f8f; }
.badge--sell { background: #e4f2e6; color: var(--accent-dark); }
.board-tabs { display: flex; gap: 8px; margin: 8px 0 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.board-tab { display: flex; align-items: center; gap: 8px; padding: 12px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.board-tab:hover { color: var(--text); }
.board-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.board-tab .count { background: #efe8dc; color: var(--text); border-radius: 999px; padding: 1px 9px; font-size: 13px; }
.board-intro { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.board-intro p { margin: 0; color: #4a433b; }
.offer__price { font-size: 22px; font-weight: 800; color: var(--accent-dark); }
.phone-slot { display: inline-flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.phone-link { font-weight: 700; font-size: 16px; text-decoration: none; }
.nav { align-items: center; }
.nav__cta { color: #fff !important; }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.section__head--gap { margin-top: 40px; }
.section__head h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .nav__cta { display: none; }
}
.tag { display: inline-block; white-space: nowrap; }
.req__top > span:first-child { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.req__top > span.muted { white-space: nowrap; }
@media (max-width: 520px) {
  .filters select { width: 100%; min-width: 0; }
  .header__inner { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.checklist { padding-left: 20px; margin: 8px 0 0; }
.checklist li { margin-bottom: 6px; }
@media (max-width: 1000px) { .nav { gap: 14px; font-size: 15px; } }
@media (max-width: 520px) { .nav { gap: 10px; font-size: 14px; flex-wrap: wrap; } }

/* Продвижение */
.badge--top { background: #fff1dc; color: #a14d00; margin-right: 4px; }
.badge--pro { background: #2f6b3a; color: #fff; font-size: 11px; padding: 1px 6px; }
.offer--top { border: 2px solid #f0b261; box-shadow: 0 4px 18px rgba(240, 160, 60, .18); background: #fffdf8; }
.promo__card { position: relative; }
.promo__card .badge { margin-bottom: 10px; }
.promo__price { font-size: 28px; font-weight: 800; margin: 6px 0 10px; }
.promo__price span { font-size: 15px; font-weight: 500; color: var(--muted); }
.req__top { flex-wrap: wrap; align-items: flex-start; }
.req__top > span.muted { margin-left: auto; }

/* ===== Аккаунты и кабинет ===== */
.h2 { font-size: 26px; margin: 0 0 14px; }
.h3 { font-size: 19px; margin: 24px 0 12px; }
.section--tight { padding-top: 24px; }
.flash { background: #e4f2e6; color: var(--accent-dark); border-radius: 10px; padding: 12px 16px; margin-top: 16px; font-weight: 600; }
.notice { background: #fff6e5; border: 1px solid #f3d9a4; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.notice form.inline { display: inline; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.nav__account { font-weight: 700 !important; }
.auth-wrap { max-width: 720px; }
.auth-wrap--narrow { max-width: 440px; }
.form--guest .checklist { margin-bottom: 16px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.role-option { position: relative; display: block; cursor: pointer; }
.role-option input { position: absolute; opacity: 0; }
.role-option span { display: block; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; height: 100%; }
.role-option small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.role-option input:checked + span { border-color: var(--accent); background: #f1f8f2; }
.check--big { font-size: 15px; margin-bottom: 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; margin-bottom: 8px; }
.checks .check { margin: 4px 0; }
.districts { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 18px; transition: opacity .2s; }
.district { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; }
.district summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.district summary .link-button { margin-left: auto; font-weight: 400; font-size: 13px; }
.district .count { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; }
.district .checks { margin-top: 8px; }
.contact-note { background: #faf6ef; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 6px 0 12px; }

.cabinet { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; }
.cabinet__nav { position: sticky; top: 84px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cabinet__who { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.cabinet__nav nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.cabinet__nav nav a { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 15px; }
.cabinet__nav nav a:hover { background: #f4efe7; }
.cabinet__nav nav a.active { background: #e4f2e6; color: var(--accent-dark); font-weight: 600; }
.cabinet__main { min-width: 0; }
.cabinet__main > .card { margin-bottom: 18px; }
.cabinet__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cabinet__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.items { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 16px; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.item--off { background: #faf8f4; }
.item--off .item__desc, .item--off .item__title { color: #7d756b; }
.item__main { min-width: 0; flex: 1; }
.item__title { margin-bottom: 4px; }
.item__desc { font-size: 14px; color: #4a433b; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item__meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; align-items: center; }
.item__responders { font-size: 13px; margin-top: 6px; }
.item__actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 130px; }
.item__actions form { margin: 0; }
.item__actions .btn { width: 100%; text-align: center; }
.st { font-weight: 600; font-size: 13px; }
.st--active { color: var(--accent); }
.st--pending { color: #a46a00; }
.st--off { color: #8a8076; }
.st--bad { color: var(--error); }
.empty { color: #4a433b; }
.btn--top { background: #e88a1a; }
.btn--top:hover { background: #c97412; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.status-line { padding: 14px 18px; }
.how { margin-top: 18px; }

.profile-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.profile-head__avatar { flex: 0 0 64px; height: 64px; border-radius: 16px; background: var(--accent); color: #fff; font-size: 30px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.profile-head__tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.profile-head__about { white-space: pre-line; margin: 12px 0; }

@media (max-width: 860px) {
  .cabinet { grid-template-columns: 1fr; }
  .cabinet__nav { position: static; }
  .cabinet__nav nav { flex-direction: row; flex-wrap: wrap; }
  .item { flex-direction: column; }
  .item__actions { flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .item__actions .btn { width: auto; }
  .role-switch { grid-template-columns: 1fr; }
}
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }

/* ===== Форма заявки с аккаунтом ===== */
.account-box { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 14px; }
.account-box__title { font-weight: 700; margin-bottom: 2px; }
.zayavka { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .zayavka { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .nav__extra { display: none; } }

/* ===== Фото, цены, отзывы, калькулятор, каталог ===== */
.offer__photo { position: relative; display: block; margin: -4px 0 4px; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 10; background: #efe8dc; }
.offer__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.offer__photo-count { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; padding: 2px 7px; font-size: 12px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.gallery--edit .gallery__item { position: relative; text-align: center; font-size: 13px; }
.gallery__main { position: absolute; left: 6px; top: 6px; background: var(--accent); color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 11px; }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.file-input { font: inherit; }
.inn-input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; width: 200px; }
.item__thumb { flex: 0 0 84px; height: 64px; border-radius: 8px; overflow: hidden; background: #f4efe7; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: var(--muted); text-decoration: none; }
.item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge--ok { background: #e4f2e6; color: var(--accent-dark); font-size: 11px; padding: 1px 6px; text-transform: none; }
.stars { color: #e8a317; font-weight: 700; letter-spacing: 1px; }
.stars--big { font-size: 18px; }
.flash--inline { margin: 0 0 10px; }
.quotes td { vertical-align: top; }
.quotes__best { background: #f3faf4; }
.rating-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; margin: 6px 0 14px; }
.rating-input input { display: none; }
.rating-input label { font-size: 36px; color: #ddd3c4; cursor: pointer; line-height: 1; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: #e8a317; }
.calc { margin: 20px 0; }
.calc__result { background: #f3faf4; border-radius: 10px; padding: 14px 16px; font-size: 17px; line-height: 1.7; }
.calc-cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.catalog-grid .h3 { margin: 0 0 6px; }
.region-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; margin-top: 8px; }
.catalog-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.catalog-layout aside .form .row { flex-direction: column; gap: 0; }
@media (max-width: 960px) { .catalog-layout { grid-template-columns: 1fr; } }
.gallery--big { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Удаление из админки */
.wrap--narrow { max-width: 640px; }
.btn--danger { background: #c0392b; color: #fff; border: 1px solid #c0392b; }
.btn--danger:hover { background: #a93226; }
.btn--danger-ghost { background: transparent; color: #c0392b; border: 1px solid #e6b0aa; }
.btn--danger-ghost:hover { background: #fdecea; }

/* Плашка про cookie */
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 640px; margin: 0 auto;
  background: #24201b; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cookie-bar a { color: #f3d9a4; }
.cookie-bar .btn { margin-left: auto; }

/* Посещаемость в админке */
.visits-chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 8px 0 0; border-bottom: 1px solid #e7dfd3; margin-bottom: 24px; overflow-x: auto; }
.visits-chart__col { flex: 1 0 18px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.visits-chart__bar { width: 100%; min-height: 2px; background: #2f6b3a; border-radius: 4px 4px 0 0; }
.visits-chart__num { font-size: 11px; color: #7a7166; margin-bottom: 2px; }
.visits-chart__day { font-size: 11px; color: #7a7166; margin-top: 4px; }
.visits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
