/* Podrukoi — единый слой стилей. Ориентир: LumoConnect (public resource directory). */

:root {
  color-scheme: light;

  --bg: #fffbf7;
  --surface: #ffffff;
  --surface-soft: #fff3e8;
  --ink: #241a14;
  --heading: #2b1d13;
  /* Тёмно-оранжевый — кнопки и акценты: белый текст на нём проходит контраст 4.5:1. */
  --accent: #c4460d;
  --accent-dark: #a3380a;
  --accent-soft: #fde9d9;
  /* Яркий оранжевый — только фон шапки, текст на нём тёмный. */
  --accent-bright: #f47b20;
  --link: #a3380a;
  --muted: #6d5d51;
  --line: #eadfd4;
  --line-soft: #f5ece3;
  --line-strong: #dccbbd;
  --cream: #fff6e6;
  --cream-line: #f1dfbf;

  /* Цвета маркеров заданы ТЗ и от палитры сайта не зависят. */
  --free: #1f7a4d;
  --free-soft: #e8f5ee;
  --discount: #005bcc;
  --discount-soft: #edf3ff;
  --documents: #8a5f00;
  --documents-soft: #fdf4e0;
  --documents-dot: #d99a00;
  --warning: #b45309;

  --font-sans: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-panel: 0 22px 48px rgba(70, 35, 10, 0.16), 0 2px 6px rgba(70, 35, 10, 0.06);
  --shadow-card: 0 1px 2px rgba(70, 35, 10, 0.04);

  --page: 1168px;
  --gutter: 48px;
  --header-h: 80px;
}

/* ---------- Основа ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 3px solid rgba(196, 70, 13, 0.35);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  background: var(--heading);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: none;
}

.muted {
  color: var(--muted);
}

/* ---------- Кнопки ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 7px 16px rgba(70, 35, 10, 0.18);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button-outline {
  border-color: var(--heading);
  background: #fff;
  color: var(--heading);
}

.button-outline:hover,
.button-outline[aria-pressed="true"] {
  background: var(--surface-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.button-outline[aria-pressed="true"] .icon {
  fill: currentColor;
}

.button-text {
  padding: 0 10px;
  background: transparent;
  color: var(--link);
}

.button-text:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button-small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--heading);
  font-size: 22px;
  line-height: 1;
}

.icon-box {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--accent);
}

.icon-box .icon {
  width: 22px;
  height: 22px;
}

.icon-box-gold {
  border-color: var(--cream-line);
  background: var(--cream);
  color: var(--accent);
}

.text-link {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
  padding: 0 24px;
  background: var(--accent-bright);
  box-shadow: 0 1px 0 rgba(70, 35, 10, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand-mark svg {
  display: block;
  width: 42px;
  height: 42px;
}

.brand-copy strong {
  display: block;
  color: var(--heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.3px;
}

.brand-copy small {
  display: block;
  margin-top: 3px;
  color: #4a2a12;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.topnav {
  display: flex;
  align-self: stretch;
  margin-right: auto;
}

.topnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.topnav a:hover {
  color: #fff;
}

.topnav a.is-active::after {
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 22px;
  height: 3px;
  content: "";
  border-radius: 3px;
  background: var(--ink);
}

/* В оранжевой шапке основная кнопка тёмная, иначе она сливается с фоном. */
.site-header .button-primary {
  background: var(--ink);
  box-shadow: none;
}

.site-header .button-primary:hover {
  background: #000;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--heading);
  font-size: 15px;
  font-weight: 600;
}

.header-link:hover {
  background: var(--cream);
}

.count-badge {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  text-align: center;
}

/* ---------- Полоса срочной помощи ---------- */

.urgent-bar {
  border-bottom: 1px solid var(--cream-line);
  background: var(--cream);
  color: #33270c;
  font-size: 13px;
}

/* Центрирование через auto-отступы: при переполнении полоса прокручивается с начала, а не обрезается слева. */
.urgent-track {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.urgent-track::-webkit-scrollbar {
  display: none;
}

.urgent-track > * {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  border-left: 1px solid #ead8a8;
  white-space: nowrap;
}

.urgent-track > :first-child {
  margin-left: auto;
  border-left: 0;
}

.urgent-track > :last-child {
  margin-right: auto;
}

.urgent-track strong {
  color: #7a4e13;
  font-weight: 700;
}

.urgent-track a {
  margin-left: 6px;
  color: var(--heading);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  min-height: 420px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: start;
  padding: 56px 0 120px max(var(--gutter), calc((100vw - var(--page)) / 2));
}

.hero h1 {
  max-width: 600px;
  margin-bottom: 20px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -1px;
}

.hero h1 em {
  display: block;
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}

.hero-lead {
  max-width: 560px;
  margin-bottom: 16px;
  color: #5e4d40;
  font-size: 18px;
  line-height: 1.55;
}

.trust-line {
  color: #5e4d40;
  font-size: 13px;
  font-weight: 600;
}

.hero-art {
  position: relative;
  margin: 0;
  overflow: hidden;
}

.hero-art::before {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 1;
  width: 40%;
  content: "";
  background: linear-gradient(90deg, var(--bg), rgba(255, 251, 247, 0));
}

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

/* ---------- Поисковая панель ---------- */

.search-panel {
  position: relative;
  z-index: 4;
  width: min(var(--page), calc(100% - 2 * var(--gutter)));
  margin: -72px auto 0;
  padding: 22px 24px 16px;
  border: 1px solid #efe2d6;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-panel);
}

.search-row {
  display: grid;
  gap: 16px;
  align-items: end;
}

.search-row-main {
  grid-template-columns: minmax(0, 1fr) 260px auto;
}

.search-row-extra {
  grid-template-columns: 220px 240px minmax(0, 1fr) auto;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.field-label .icon {
  width: 28px;
  height: 28px;
  padding: 5px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--link);
}

.field-label small {
  color: var(--muted);
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

input,
select {
  min-height: 56px;
  padding: 0 16px;
  font-weight: 600;
}

select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23001b4d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 18px;
}

textarea {
  min-height: 120px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9a8a7d;
  font-weight: 400;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(196, 70, 13, 0.16);
  outline-offset: 0;
}

.button-search {
  min-height: 56px;
  padding: 0 26px;
  border-radius: var(--radius-md);
}

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.switch-track {
  position: relative;
  width: 44px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #dccfc4;
  transition: background-color 140ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  content: "";
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(70, 35, 10, 0.25);
  transition: transform 140ms ease;
}

.switch input:checked + .switch-track {
  background: var(--accent);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(196, 70, 13, 0.35);
  outline-offset: 2px;
}

.switch-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.switch-text small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: #4a3b30;
  font-size: 14px;
}

.search-note .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--heading);
}

/* ---------- Секции ---------- */

.overview,
.section,
.footer-inner {
  width: min(var(--page), calc(100% - 2 * var(--gutter)));
  margin-left: auto;
  margin-right: auto;
}

.section {
  margin-top: 96px;
}

.section-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-head > p:not(.eyebrow) {
  margin-top: 10px;
  color: var(--muted);
  font-size: 17px;
}

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
}

.section-head-center {
  max-width: none;
  text-align: center;
}

.eyebrow,
.mono-label {
  margin-bottom: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section h2,
.service-detail h2 {
  color: var(--heading);
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.4px;
}

/* ---------- Цифры и ситуации ---------- */

.overview {
  margin-top: 56px;
}

.trust-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.trust-counts div {
  padding: 0 28px;
  border-left: 1px solid var(--line);
}

.trust-counts div:first-child {
  padding-left: 0;
  border-left: 0;
}

.trust-counts dt {
  color: var(--heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.trust-counts dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.situations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
}

.situations-title {
  margin-right: 6px;
  color: var(--muted);
  font-size: 14px;
}

.chip {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #efe2d6;
  border-radius: 999px;
  background: #fff;
  color: #2e221a;
  font-size: 15px;
  box-shadow: 0 2px 7px rgba(70, 35, 10, 0.03);
}

.chip:hover,
.chip.is-active {
  border-color: var(--accent);
  background: var(--surface-soft);
  color: var(--heading);
}

/* ---------- Категории ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 172px;
  padding: 22px;
  border: 1px solid #efe2d6;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.category-card .icon-box {
  margin-bottom: auto;
}

.category-card strong {
  margin-top: 20px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
}

.category-card > span:not(.icon-box) {
  color: var(--muted);
  font-size: 14px;
}

button.category-card:hover,
.category-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 18px 36px -28px rgba(70, 35, 10, 0.35);
}

.category-card.is-active .icon-box {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.category-unsure {
  justify-content: flex-end;
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}

.category-unsure strong {
  margin-top: 0;
}

.category-unsure .button {
  margin-top: 12px;
}

/* ---------- Карта и список ---------- */

.ranking-note {
  max-width: 420px;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.active-filters:empty {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #f3c7a5;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--heading);
  font-size: 14px;
  font-weight: 600;
}

.filter-chip span {
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}

.directory {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 20px;
}

.map-panel,
.results,
.service-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.map-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 600px;
  overflow: hidden;
}

.map-canvas {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 520px;
  background: #f6efe8;
}

/* Яндекс.Карты сами заполняют контейнер — до этого показываем подпись. */
.map-canvas:empty {
  align-items: center;
  justify-content: center;
}

.map-canvas:empty::before {
  content: "Загружаем карту…";
  color: var(--muted);
  font-size: 15px;
}

.map-fallback {
  display: grid;
  flex: 1 1 auto;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.map-fallback .icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.map-fallback strong {
  color: var(--heading);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: #4a3b30;
  font-size: 13px;
  font-weight: 500;
}

.map-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-free {
  background: var(--free);
}

.dot-discount {
  background: var(--discount);
}

.dot-documents {
  background: var(--documents-dot);
}

.results {
  display: flex;
  flex-direction: column;
  max-height: 600px;
  overflow: hidden;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.results-head h3 {
  color: var(--heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.results-head p {
  color: var(--muted);
  font-size: 13px;
}

.result-list {
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.result-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.result-card:hover {
  border-color: #f0c9a8;
}

.result-card.is-active {
  border-color: #f0c9a8;
  background: var(--surface-soft);
  box-shadow: inset 4px 0 0 var(--accent);
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.result-category {
  color: var(--accent);
  font-weight: 600;
}

.result-title {
  color: var(--heading);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.result-benefit {
  font-size: 14px;
}

.result-address {
  color: var(--muted);
  font-size: 13px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #2e221a;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-free {
  border-color: #c4e5d2;
  background: var(--free-soft);
  color: var(--free);
}

.tag-discount {
  border-color: #cbdcff;
  background: var(--discount-soft);
  color: var(--discount);
}

.tag-documents {
  border-color: #f0d9a0;
  background: var(--documents-soft);
  color: var(--documents);
}

.tag-stale {
  border-color: #f5c9a8;
  background: #fff3ea;
  color: var(--warning);
}

.tag-for-you {
  border-color: var(--heading);
  background: var(--heading);
  color: #fff;
}

.tag-plain {
  color: var(--muted);
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 20px 8px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--heading);
}

/* Балун на карте */

.balloon {
  display: grid;
  gap: 3px;
  max-width: 260px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.balloon strong {
  color: var(--heading);
  font-size: 15px;
}

.balloon p {
  margin: 0;
}

.balloon-kind {
  font-size: 12px;
  font-weight: 600;
}

.balloon-free {
  color: var(--free);
}

.balloon-discount {
  color: var(--discount);
}

.balloon-documents {
  color: var(--documents);
}

.balloon-muted {
  color: var(--muted);
}

.balloon-button {
  justify-self: start;
  margin-top: 6px;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Карточка услуги ---------- */

.service-detail {
  margin-top: 20px;
  padding: 32px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.service-detail:focus {
  outline: none;
}

.service-detail h2 {
  font-size: 32px;
}

.detail-lead {
  max-width: 640px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 17px;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.detail-benefit {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid;
  border-radius: var(--radius-md);
}

.detail-benefit span {
  font-size: 13px;
  font-weight: 600;
}

.detail-benefit strong {
  color: var(--heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.detail-benefit-free {
  border-color: #c4e5d2;
  background: var(--free-soft);
  color: var(--free);
}

.detail-benefit-discount {
  border-color: #cbdcff;
  background: var(--discount-soft);
  color: var(--discount);
}

.detail-benefit-documents {
  border-color: #f0d9a0;
  background: var(--documents-soft);
  color: var(--documents);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 28px 0;
  border-top: 1px solid var(--line);
}

.detail-grid section {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 20px 20px 20px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.detail-grid section:not(:nth-child(3n + 1)) {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.detail-grid h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--heading);
  font-size: 15px;
  font-weight: 600;
}

.detail-grid h3 .icon {
  color: var(--accent);
}

.detail-grid h4 {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.plain-list {
  display: grid;
  gap: 4px;
}

.plain-list li {
  position: relative;
  padding-left: 14px;
}

.plain-list li::before {
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: var(--line-strong);
}

.contact-link {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

/* Оценка организации в карточке */

.rate {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.rate-label {
  color: var(--muted);
  font-size: 13px;
}

.rate-stars {
  display: flex;
  gap: 2px;
}

.rate-star {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--line-strong);
  font-size: 26px;
  line-height: 1;
  transition: color 120ms ease, background-color 120ms ease;
}

.rate-star.is-on {
  color: var(--accent-bright);
}

.rate-star:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
}

.rate-star:disabled {
  cursor: progress;
  opacity: 0.6;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Как это работает ---------- */

.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 12px;
}

.how-steps,
.how-principles {
  display: grid;
  gap: 32px;
  padding: 8px 48px;
}

.how-steps {
  border-right: 1px solid var(--line);
}

.how-steps li,
.how-principles li {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.how-steps li {
  flex-direction: row-reverse;
  text-align: right;
}

.how-grid h3 {
  color: var(--heading);
  font-size: 19px;
  font-weight: 600;
}

.how-grid p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}

.disclaimer {
  max-width: 720px;
  margin: 40px auto 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- Проверка данных ---------- */

.verification {
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.verification-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 56px;
  margin-top: 24px;
}

.verification-text p:not(.mono-label) {
  margin-bottom: 22px;
  color: #4a3b30;
}

.verification-text .mono-label {
  margin-bottom: 6px;
  color: var(--accent);
}

.verification-stats {
  display: grid;
  align-content: start;
  gap: 0;
}

.stat-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.stat-row:first-child {
  border-top: 1px solid var(--line);
}

.stat-value {
  color: var(--heading);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-value.is-warning {
  color: var(--warning);
}

.verification-stats .text-link {
  margin-top: 16px;
}

/* ---------- Помочь справочнику ---------- */

.improve {
  margin-top: 72px;
}

.improve-band {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.improve-copy {
  margin-right: auto;
}

.improve-band h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.improve-copy p {
  color: var(--muted);
  font-size: 15px;
}

.improve-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.surveys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.surveys p {
  flex: 1 1 100%;
}

.surveys a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.surveys .icon {
  width: 16px;
  height: 16px;
}

/* ---------- Подвал ---------- */

.site-footer {
  margin-top: 96px;
  padding: 56px 0 48px;
  background: var(--heading);
  color: #eadccf;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.footer-brand {
  display: block;
  margin-bottom: 10px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.footer-about p {
  max-width: 380px;
  font-size: 15px;
}

.footer-muted {
  margin-top: 12px;
  color: #b9a594;
  font-size: 13px !important;
}

.site-footer nav {
  display: grid;
  align-content: start;
  gap: 10px;
}

.site-footer h2 {
  margin-bottom: 4px;
  color: #ffc48f;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer nav a,
.site-footer nav button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
}

.site-footer nav a:hover,
.site-footer nav button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Модальное окно и уведомления ---------- */

.modal {
  width: min(560px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(36, 26, 20, 0.24);
}

.modal::backdrop {
  background: rgba(36, 26, 20, 0.45);
}

.modal form {
  display: grid;
  gap: 16px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal h2 {
  color: var(--heading);
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
}

.modal-subject {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--heading);
  font-size: 14px;
  font-weight: 600;
}

.modal input {
  min-height: 48px;
  font-weight: 400;
}

.form-error {
  color: #b42318;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--heading);
  color: #fff;
  font-size: 15px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Адаптив ---------- */

@media (max-width: 1180px) {
  .topnav a {
    padding: 0 8px;
    font-size: 14px;
  }

  .topnav a.is-active::after {
    left: 8px;
    right: 8px;
  }

  .search-row-extra {
    grid-template-columns: 1fr 1fr;
  }

  .search-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 1023px) {
  :root {
    --gutter: 24px;
    --header-h: 68px;
  }

  .topnav {
    display: none;
  }

  .site-header {
    justify-content: space-between;
    padding: 0 var(--gutter);
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy {
    padding: 40px var(--gutter) 32px;
  }

  .hero h1 {
    font-size: 46px;
  }

  .hero-art {
    height: 300px;
  }

  .hero-art::before {
    inset: 0 0 auto 0;
    width: auto;
    height: 30%;
    background: linear-gradient(180deg, var(--bg), rgba(255, 251, 247, 0));
  }

  .search-panel {
    margin-top: -56px;
  }

  .search-row-main {
    grid-template-columns: 1fr 1fr;
  }

  .field-query {
    grid-column: 1 / -1;
  }

  .trust-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 0;
  }

  .trust-counts div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .directory {
    grid-template-columns: 1fr;
  }

  .map-panel {
    min-height: 0;
  }

  .map-canvas {
    min-height: 420px;
  }

  .results {
    max-height: 560px;
  }

  .detail-head,
  .verification-grid {
    grid-template-columns: 1fr;
  }

  .verification-grid {
    gap: 24px;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid section:not(:nth-child(3n + 1)) {
    padding-left: 0;
    border-left: 0;
  }

  .detail-grid section:nth-child(2n) {
    padding-left: 20px;
    border-left: 1px solid var(--line);
  }

  .how-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .how-steps,
  .how-principles {
    padding: 0;
  }

  .how-steps {
    border-right: 0;
  }

  .how-steps li {
    flex-direction: row;
    text-align: left;
  }

  .improve-band {
    flex-wrap: wrap;
  }

  .improve-copy {
    flex: 1 1 calc(100% - 70px);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .brand-mark svg {
    width: 36px;
    height: 36px;
  }

  .brand-copy strong {
    font-size: 20px;
  }

  .header-actions .button {
    display: none;
  }

  /* Текст скрыт визуально, но остаётся для экранных дикторов. */
  .header-link-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .header-link {
    padding: 0 10px;
  }

  /* На телефоне первым экраном остаются заголовок и поиск — фото убираем. */
  .hero-art {
    display: none;
  }

  .hero-copy {
    padding: 24px var(--gutter) 20px;
  }

  .hero h1 {
    margin-bottom: 14px;
    font-size: 38px;
    letter-spacing: -0.6px;
  }

  .hero-lead {
    margin-bottom: 12px;
    font-size: 16px;
  }

  .search-panel {
    margin-top: 0;
    padding: 16px;
  }

  .search-row-main,
  .search-row-extra {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .button-search {
    width: 100%;
  }

  .switch {
    min-height: 0;
  }

  .search-actions {
    justify-content: stretch;
  }

  .search-actions .button-outline {
    flex: 1 1 auto;
  }

  .section {
    margin-top: 64px;
  }

  .section h2 {
    font-size: 29px;
  }

  .section-head-row {
    display: block;
  }

  .ranking-note {
    margin-top: 10px;
    text-align: left;
  }

  .overview {
    margin-top: 40px;
  }

  .trust-counts dt {
    font-size: 26px;
  }

  .trust-counts div {
    padding: 0 16px;
  }

  .trust-counts div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .category-grid {
    gap: 10px;
  }

  .category-card {
    min-height: 140px;
    padding: 16px;
  }

  .category-card strong {
    margin-top: 14px;
    font-size: 16px;
  }

  .map-canvas {
    min-height: 360px;
  }

  .results {
    max-height: 520px;
  }

  .results-head {
    padding: 14px;
  }

  .result-list {
    padding: 10px;
  }

  .service-detail {
    padding: 20px 16px;
  }

  .service-detail h2 {
    font-size: 26px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid section,
  .detail-grid section:nth-child(2n) {
    padding: 16px 0;
    border-left: 0;
  }

  .detail-actions .button {
    flex: 1 1 100%;
  }

  .stat-row {
    grid-template-columns: 110px 1fr;
  }

  .improve-actions {
    width: 100%;
  }

  .improve-actions .button {
    flex: 1 1 100%;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
