/* Пульс 5 — вариант «Заключение»: одна цифра, три дела, остальное ниже и спокойно. */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-soft: #f5f3f0;
  --ink: #17181c;
  --text: #17181c;
  --body: #3d3b38;
  --muted: #625e58;
  --line: #ebe8e3;
  --border: #e2ded8;
  --rose: #c8243f;
  --rose-dark: #a51d34;
  --rose-soft: #fdf0f2;
  --primary: #17181c;
  --primary-soft: #efede9;
  --success: #157347;
  --success-soft: #e3f4ea;
  --warn: #9a5a06;
  --warn-soft: #fbf1df;
  --danger: #b4233c;
  --danger-soft: #fdecef;
  --shadow: none;
  --shadow-sm: none;
  --radius: 20px;
  --font-head: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--rose-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.is-hidden { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 248, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none !important;
}
.logo__pulse, .logo__heart, .logo__five { color: var(--rose); }
.logo__domain { font-size: 13px; font-weight: 500; color: var(--muted); font-family: var(--font-body); }
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}
.header-admin-link { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) { .header-maps { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #33353c; }
.btn-rose { background: var(--rose); color: #fff; }
.btn-rose:hover { background: var(--rose-dark); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: #c8c2b9; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; }
.link-btn {
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--rose-dark);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; }
.hero__center { max-width: 760px; }
.hero__eyebrow { margin: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--rose-dark); }
.hero__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(36px, 5.4vw, 60px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.hero__subtitle { margin: 20px 0 0; font-size: 19px; line-height: 1.6; color: var(--body); max-width: 620px; }

.search-wrap { margin-top: 32px; }
.search-form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-input-box { position: relative; flex: 1 1 360px; }
.search-input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}
.search-input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.search-form .btn { height: 56px; padding: 0 26px; font-size: 16px; border-radius: 14px; }

.suggest-list {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(23, 24, 28, 0.1);
  overflow: hidden;
}
.suggest-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover { background: var(--surface-soft); }
.suggest-item__name { font-weight: 600; }
.suggest-item__meta { font-size: 13px; color: var(--muted); }

.examples-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.chip-btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.chip-btn:hover { background: var(--surface); border-color: #c8c2b9; }

.progress-box { margin-top: 24px; }
.progress-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.progress-step {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 14px;
  color: var(--muted);
}
.progress-step.is-active { background: var(--ink); color: #fff; }
.progress-step.is-done { background: var(--success-soft); color: var(--success); }

.error-banner {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 15px;
}

/* Landing preview */
.preview {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
  align-items: center;
}
.preview__label { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.preview__text { margin: 10px 0 0; color: var(--body); max-width: 420px; }
.preview__todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; font-size: 17px; }
.preview__todo li { display: flex; align-items: center; gap: 16px; }

/* Report mode: hero folds into a compact search bar */
body.has-report .hero { padding: 28px 0 0; }
body.has-report .hero__eyebrow,
body.has-report .hero__title,
body.has-report .hero__subtitle,
body.has-report .examples-row { display: none; }
body.has-report .search-wrap { margin-top: 0; }
body.has-report .search-input,
body.has-report .search-form .btn { height: 48px; }

/* ---------- Score ---------- */
.score-line { display: flex; align-items: baseline; gap: 14px; }
.score-num {
  font-family: var(--font-head);
  font-size: clamp(96px, 13vw, 148px);
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -0.05em;
}
.score-num--md { font-size: 96px; }
.score-of { font-size: 18px; color: var(--muted); }
.pulse-word { margin: 16px 0 0; font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--success); }
.pulse-word--warn { color: var(--warn); }
.pulse-word--danger { color: var(--danger); }

.todo-num {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
}
.todo-num--accent { background: transparent; border: 2px solid var(--rose); color: var(--rose); }

/* ---------- Report ---------- */
.report { padding: 48px 0 96px; }
.report-meta { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.company-name {
  margin: 0 0 44px;
  font-family: var(--font-head);
  font-size: clamp(32px, 4.4vw, 44px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 56px;
  align-items: start;
}
.diagnosis { margin: 10px 0 0; font-size: 17px; line-height: 1.6; color: var(--body); max-width: 460px; }
.alerts-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.alert-line { font-size: 15px; color: var(--body); }
.alert-line--warn, .alert-line--danger { color: var(--danger); }

.platform-rows { margin-top: 32px; border-top: 1px solid var(--line); }
.platform-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.platform-row__name { color: var(--ink); }
a.platform-row__name:hover { color: var(--rose-dark); }
.platform-row__val { color: var(--muted); text-align: right; }
.platform-row__val strong { color: var(--ink); font-size: 16px; }
.platform-row__val .is-low { color: var(--danger); font-weight: 600; }

.breakdown-box { margin-top: 20px; }
.breakdown-box summary { cursor: pointer; font-size: 15px; color: var(--muted); }
.breakdown-box summary:hover { color: var(--ink); }
.breakdown { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.break-row__top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.break-row__top span:last-child { color: var(--muted); }
.break-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.break-bar span { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.break-row.is-weak .break-bar span { background: var(--rose); }
.break-row.is-weak .break-row__top span:last-child { color: var(--danger); font-weight: 600; }

.todo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
}
.todo-card h3 { margin: 0; font-family: var(--font-head); font-size: 26px; font-weight: 800; line-height: 1.2; }
.todo-card__sub { margin: 6px 0 28px; color: var(--muted); font-size: 15px; }
.todo-list { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.todo-list li { display: flex; gap: 16px; font-size: 16px; line-height: 1.5; color: var(--ink); }
.todo-list li > span:last-child { padding-top: 6px; }
.todo-card .btn { width: 100%; white-space: normal; }
.todo-card__hint { margin: 12px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
@media (max-width: 640px) { .todo-card { padding: 26px 22px; } }

.block { margin-top: 88px; }
.block__title { margin: 0; font-family: var(--font-head); font-size: 26px; font-weight: 800; }
.block__sub { margin: 6px 0 24px; color: var(--muted); font-size: 15px; }

/* Rivals */
.rival {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 56px minmax(120px, 280px);
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.rival:last-child { border-bottom: 1px solid var(--line); }
.rival__rank { color: var(--muted); }
.rival__name { min-width: 0; }
.rival__name a { color: var(--ink); }
.rival__addr { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rival__rating { font-weight: 700; }
.rival__vol { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.rival__bar { height: 8px; min-width: 2px; border-radius: 4px; background: #cfc9c0; }
.rival.is-self { background: var(--rose-soft); border-radius: 12px; border-top-color: transparent; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.rival.is-self + .rival { border-top-color: transparent; }
.rival.is-self .rival__rank { color: var(--rose); font-weight: 700; }
.rival.is-self .rival__name { font-weight: 600; }
.rival.is-self .rival__bar { background: var(--rose); }
.rival.is-self .rival__vol { color: var(--ink); }
@media (max-width: 640px) {
  .rival { grid-template-columns: 24px minmax(0, 1fr) 44px; }
  .rival__vol { grid-column: 2 / -1; }
}

/* Tabs */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  padding: 0 0 14px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tab-panel { padding-top: 20px; }

.filters-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filter-pill {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--body);
  cursor: pointer;
}
.filter-pill.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.review-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px 28px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.review-item:last-child { border-bottom: 0; }
.review-item__head { font-size: 14px; color: var(--muted); }
.review-item__author { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.review-item__meta { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.review-item__body { min-width: 0; }
.review-item__text { margin: 0; font-size: 16px; line-height: 1.6; max-width: 700px; white-space: pre-line; }
.review-item--neg .review-item__meta .stars { color: var(--danger); }
.stars { color: #b97f0f; letter-spacing: 1px; }
.reply-existing {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 14px;
  color: var(--body);
}
.review-item__footer { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; }
.ai-reply-box { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-reply-box textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
}
@media (max-width: 640px) { .review-item { grid-template-columns: 1fr; } }

.insight-list { list-style: none; margin: 0; padding: 0; }
.insight-list li { padding: 18px 0; border-bottom: 1px solid var(--line); max-width: 760px; }
.insight-list li:last-child { border-bottom: 0; }
.insight-list strong { display: block; font-size: 17px; font-weight: 600; }
.insight-list span { display: block; margin-top: 4px; color: var(--body); font-size: 15px; }

/* Guardian */
.guardian {
  margin-top: 96px;
  padding: 48px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
  align-items: center;
}
.guardian h3 { margin: 0; font-family: var(--font-head); font-size: 30px; line-height: 1.15; font-weight: 800; }
.guardian p { margin: 12px 0 24px; color: var(--body); font-size: 16px; }
@media (max-width: 640px) { .guardian { padding: 28px 22px; } }

.messenger-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-soft); margin-bottom: 14px; }
.msg-tab {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  cursor: pointer;
}
.msg-tab.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(23, 24, 28, 0.12); }

.lead-form { display: flex; flex-direction: column; gap: 12px; }
.lead-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.lead-input {
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  font-size: 16px;
}
.lead-input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.lead-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--body); cursor: pointer; }
.lead-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ink); }
.lead-success { padding: 12px 16px; border-radius: 12px; background: var(--success-soft); color: var(--success); font-size: 15px; }

.phone-mock {
  max-width: 340px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 14px;
  border-radius: 32px;
  background: #e9ece6;
  border: 10px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.phone-mock__head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 0 4px 6px; }
.phone-mock__head strong { color: var(--ink); }
.phone-bubble {
  background: #fff;
  border-radius: 16px 16px 16px 4px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.bubble-tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}
.bubble-reply { display: block; margin-top: 8px; color: var(--body); }
.phone-bubble--comp { color: var(--body); }

/* Dialog */
.lead-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(23, 24, 28, 0.25);
}
.lead-dialog::backdrop { background: rgba(23, 24, 28, 0.45); }
.dialog-inner { padding: 28px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dialog-head h3 { margin: 0; font-family: var(--font-head); font-size: 22px; font-weight: 800; }
.dialog-close {
  width: 40px; height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 22px;
  cursor: pointer;
}
.dialog-text { margin: 0 0 16px; font-size: 15px; color: var(--body); }

/* ---------- Shared with admin page ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.card__title { margin: 0; font-family: var(--font-head); font-size: 20px; font-weight: 800; }
.card__sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr.is-self td { background: var(--rose-soft); }
