/* ============================================================
   Дополнительные стили для PHP-страниц
   ============================================================ */

/* ── Унифицированные бейджи и теги ──────────────────────────── */
.badge, .name-card-badge, .trend-badge, .trend-pill, .breakdown-chip, .patronym-meta-chip, .tag {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 99px;
  text-decoration: none;
  transition: var(--transition);
}

.name-card-badge { font-size: 0.85rem; padding: 3px 10px; margin-top: 8px; font-weight: 600; }
.trend-badge, .trend-pill { font-size: 0.9rem; padding: 4px 12px; }
.breakdown-chip { font-size: 0.85rem; padding: 4px 12px; border: 1px solid; }
.patronym-meta-chip { background: white; border: 1px solid var(--neutral-200); color: var(--neutral-700); }
.tag { background: var(--neutral-100); border: 1px solid var(--neutral-200); color: var(--neutral-800); }
.tag:hover { background: var(--brand); color: white; border-color: var(--brand); }
.tag-male:hover { background: var(--male); border-color: var(--male); }
.tag-female:hover { background: var(--female); border-color: var(--female); }

/* Унифицированные цвета трендов и статусов */
.trend-up, .badge-trend-rising, .ncb-up, .breakdown-chip-pos, .patr-letter-good, .trend-btn-active-rising {
  background: #dcfce7; color: #15803d; border-color: #86efac;
}
.trend-down, .badge-trend-falling, .ncb-down, .breakdown-chip-neg, .patr-letter-bad, .trend-btn-active-falling {
  background: #fee2e2; color: #dc2626; border-color: #fca5a5;
}
.trend-stable, .badge-trend-stable, .breakdown-chip-neu, .trend-btn-active-stable {
  background: var(--neutral-100); color: var(--neutral-700); border-color: var(--neutral-300);
}

/* Специфичные цвета бейджей (архетипы, пласты) */
.badge-arch  { background: #fef3c7; color: #92400e; }
.badge-layer { background: #ede9fe; color: #5b21b6; }
.badge-intl  { background: #dbeafe; color: #1d4ed8; }
.badge-rare  { background: #fef3c7; color: #92400e; }
.badge-universal { background: #f3e8ff; color: #7e22ce; }
.ncb-arch    { background: #f0fdfa; color: #0f766e; }
.ncb-intl    { background: #ede9fe; color: #6d28d9; }
.ncb-layer   { background: #fdf4ff; color: #86198f; }
.ncb-universal { background: #f3e8ff; color: #7e22ce; }

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  font-size: 1rem;
  color: var(--neutral-700);
  margin-bottom: 28px;
}
.breadcrumb a { color: var(--brand); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Filters bar & Panels (Распакованный минифицированный блок) ── */
.filters-panel { background: var(--white); border: 1px solid var(--neutral-200); border-radius: var(--radius-lg); margin-bottom: 24px; overflow: hidden; box-shadow: var(--shadow-sm); }
.filters-panel-top { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--neutral-100); flex-wrap: wrap; }
.filter-gender-row { display: flex; gap: 8px; }

.filter-btn {
  padding: 10px 20px; border-radius: var(--radius-sm); border: 1.5px solid var(--neutral-200);
  background: var(--white); color: var(--neutral-700); font-size: 1.05rem; font-weight: 500;
  text-decoration: none; transition: var(--transition); cursor: pointer;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: white; }
.filter-btn.active-male { background: var(--male); border-color: var(--male); }
.filter-btn.active-female { background: var(--female); border-color: var(--female); }

.filter-search-row { display: flex; gap: 10px; flex: 1; min-width: 220px; }
.filter-search-row input { flex: 1; padding: 10px 16px; border: 1.5px solid var(--neutral-200); border-radius: var(--radius-md); font-size: 1.05rem; font-family: 'Nunito', sans-serif; outline: none; transition: border .2s; }
.filter-search-row input:focus { border-color: var(--brand); }

.filters-toggle-btn { display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--neutral-50); border: 1.5px solid var(--neutral-200); border-radius: var(--radius-md); font-size: 1.05rem; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--neutral-800); transition: var(--transition); font-family: 'Nunito', sans-serif; }
.filters-toggle-btn:hover { background: var(--neutral-100); }
.filters-toggle-btn.active { background: var(--brand); color: white; border-color: var(--brand); }
.filters-toggle-badge { background: #ef4444; color: white; font-size: 0.9rem; font-weight: 800; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.alphabet-row { padding: 14px 24px; border-bottom: 1px solid var(--neutral-100); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.alpha-reset { margin-left: 8px; font-size: 0.95rem; color: var(--neutral-700); text-decoration: none; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--neutral-200); transition: var(--transition); }
.alpha-reset:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

.filters-advanced { display: none; padding: 24px 24px 20px; border-bottom: 1px solid var(--neutral-100); background: var(--neutral-50); }
.filters-advanced.open { display: block; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }

.filter-group label { display: block; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--neutral-700); margin-bottom: 6px; }
.filter-group select { width: 100%; padding: 10px 14px; border: 1.5px solid var(--neutral-200); border-radius: var(--radius-sm); font-size: 1rem; font-family: 'Nunito', sans-serif; background: white; color: var(--neutral-900); outline: none; cursor: pointer; transition: border .2s; }
.filter-group select:focus, .filter-group select.active { border-color: var(--brand); }
.filter-group select.active { background: #eff6ff; }

.trend-buttons { display: flex; gap: 6px; }
.trend-btn { flex: 1; padding: 8px 6px; border: 1.5px solid var(--neutral-200); border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600; background: white; cursor: pointer; text-align: center; transition: var(--transition); font-family: 'Nunito', sans-serif; color: var(--neutral-700); }
.trend-btn:hover { border-color: var(--brand); color: var(--brand); }

.filter-checks { display: flex; flex-direction: column; gap: 8px; }
.filter-check { display: flex; align-items: center; gap: 8px; font-size: 1rem; cursor: pointer; color: var(--neutral-800); }
.filter-check input { accent-color: var(--brand); width: 18px; height: 18px; cursor: pointer; }

.syll-range { display: flex; align-items: center; gap: 8px; }
.syll-range input[type=number] { width: 70px; padding: 8px 10px; border: 1.5px solid var(--neutral-200); border-radius: var(--radius-sm); font-size: 1rem; text-align: center; font-family: 'Nunito', sans-serif; }

.sort-row { display: flex; align-items: center; gap: 12px; padding: 16px 24px; flex-wrap: wrap; }
.sort-row-label { font-size: 1.05rem; color: var(--neutral-700); font-weight: 600; }
.sort-btn { font-size: 1.05rem; font-weight: 600; padding: 8px 16px; border-radius: 99px; border: 1.5px solid var(--neutral-200); background: white; color: var(--neutral-700); cursor: pointer; text-decoration: none; transition: var(--transition); font-family: 'Nunito', sans-serif; }
.sort-btn:hover { border-color: var(--brand); color: var(--brand); }
.sort-btn.active { background: var(--brand); color: white; border-color: var(--brand); }

.filters-reset-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.filters-active-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-active-tag { display: flex; align-items: center; gap: 6px; font-size: 0.95rem; font-weight: 600; padding: 4px 14px; border-radius: 99px; background: #eff6ff; color: var(--brand); border: 1px solid #bfdbfe; }
.filter-active-tag a { color: inherit; text-decoration: none; margin-left: 4px; font-weight: 900; }
.filters-reset-link { font-size: 1rem; color: var(--neutral-700); text-decoration: none; padding: 6px 16px; border: 1px solid var(--neutral-200); border-radius: 99px; white-space: nowrap; transition: var(--transition); }
.filters-reset-link:hover { background: var(--neutral-100); }


/* ── Names grid ─────────────────────────────────────────────── */
.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.name-card {
  display: block;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--neutral-200);
  background: var(--white);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  cursor: pointer;
}
.name-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: transparent; }
.name-card-male:hover   { border-color: var(--male-mid); box-shadow: 0 8px 32px rgba(59, 158, 222, 0.15); }
.name-card-female:hover { border-color: var(--female-mid); box-shadow: 0 8px 32px rgba(232, 98, 138, 0.15); }

.name-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.name-card-name { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.25rem; color: var(--neutral-900); }
.name-card-meaning { font-size: 1rem; color: var(--neutral-700); margin-top: 8px; line-height: 1.4; }

.name-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ── Ethnic origin bar in name cards ───────────────────────── */
.name-card-eth {
  margin-top: 12px;
}

.name-card-eth-bar {
  display: flex;
  height: 5px;
  border-radius: 99px;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 8px;
}

.name-card-eth-segment {
  border-radius: 99px;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.name-card:hover .name-card-eth-segment {
  opacity: 0.85;
}

.name-card-eth-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.name-card-eth-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  color: var(--eth-color);
  background: var(--eth-bg, rgba(148, 163, 184, 0.12));
  border: 1px solid var(--eth-border, rgba(148, 163, 184, 0.25));
  white-space: nowrap;
  line-height: 1.5;
}


/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 48px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--neutral-200);
  background: var(--white);
  color: var(--neutral-700);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  transition: var(--transition);
}
.page-btn:hover  { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: white; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--neutral-700);
  font-size: 1.15rem;
}
.empty-state a { color: var(--brand); }

/* ── Name detail page ───────────────────────────────────────── */
.name-detail { margin-top: 12px; }

.name-detail-head {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 36px;
  border-radius: var(--radius-lg);
  margin-bottom: 36px;
}
.name-detail-head-male   { background: linear-gradient(135deg, var(--male-soft), #dbeeff); }
.name-detail-head-female { background: linear-gradient(135deg, var(--female-soft), #ffe4ef); }

.name-detail-icon {
  font-size: 2.5rem;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.name-detail-title  { font-family: 'Playfair Display', serif; font-size: 2.5rem; font-weight: 900; color: var(--neutral-900); }
.name-detail-meaning { font-size: 1.15rem; color: var(--neutral-700); margin-top: 8px; }
.name-detail-badges  { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }


/* ── Detail sections ────────────────────────────────────────── */
.detail-section { margin-bottom: 40px; }
.detail-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--neutral-100);
}

/* Ratings */
.ratings-grid { display: flex; flex-direction: column; gap: 14px; }
.rating-item  { display: flex; align-items: center; gap: 14px; }
.rating-label { width: 160px; font-size: 1.05rem; color: var(--neutral-700); flex-shrink: 0; }
.rating-bar   { flex: 1; height: 10px; background: var(--neutral-200); border-radius: 99px; overflow: hidden; }
.rating-fill  { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-light)); border-radius: 99px; }
.rating-value { font-size: 0.95rem; font-weight: 700; color: var(--neutral-700); width: 40px; text-align: right; }
.sound-label  { margin-top: 16px; font-size: 1.1rem; color: var(--neutral-700); }
.association  {
  margin-top: 20px;
  padding: 18px 24px;
  background: var(--neutral-50);
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--neutral-700);
  font-size: 1.1rem;
}

/* Tags cloud */
.tags-cloud { display: flex; flex-wrap: wrap; gap: 10px; }

/* Stats table */
.stats-table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.stats-table th, .stats-table td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--neutral-200);
}
.stats-table th { background: var(--neutral-50); font-weight: 600; color: var(--neutral-700); }
.stats-table tr:last-child td { border-bottom: none; }

/* International forms */
.intl-forms { display: flex; flex-wrap: wrap; gap: 14px; }
.intl-form-item {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  background: var(--neutral-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--neutral-200);
  min-width: 140px;
}
.intl-lang { font-size: 0.85rem; color: var(--neutral-700); text-transform: capitalize; font-weight: 600; }
.intl-form { font-size: 1.1rem; font-weight: 700; color: var(--neutral-900); margin-top: 4px; }

/* Ethnicity bars */
.eth-bars { display: flex; flex-direction: column; gap: 12px; }
.eth-bar-item { display: flex; align-items: center; gap: 14px; }
.eth-bar-label { width: 220px; font-size: 1.05rem; color: var(--neutral-700); flex-shrink: 0; }
.eth-bar-track { flex: 1; height: 10px; background: var(--neutral-200); border-radius: 99px; overflow: hidden; }
.eth-bar-fill  { height: 100%; background: linear-gradient(90deg, #8b5cf6, #6366f1); border-radius: 99px; }
.eth-bar-pct   { font-size: 0.95rem; font-weight: 700; color: var(--neutral-700); width: 44px; text-align: right; }
.eth-analysis  { margin-top: 20px; font-size: 1.05rem; color: var(--neutral-700); line-height: 1.6; }

/* ── Search page ────────────────────────────────────────────── */
.search-form-big { max-width: 740px; margin: 0 auto 36px; }
.search-form-row { display: flex; gap: 14px; }
.search-input-big { flex: 1; font-size: 1.15rem; padding: 16px 20px; border-radius: var(--radius-md); }
.btn-cta-big { padding: 16px 32px; font-size: 1.15rem; white-space: nowrap; border-radius: var(--radius-md); }
.search-gender-row {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--neutral-700);
}
.search-gender-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.search-results-header { margin-bottom: 20px; }
.search-results-header h2 { font-size: 1.25rem; color: var(--neutral-800); font-weight: 700; }
.search-hints { margin-top: 48px; }
.search-hints-title { font-size: 1.1rem; color: var(--neutral-700); margin-bottom: 16px; font-weight: 600; }

/* ============================================================
   Распространённость по регионам
   ============================================================ */

/* ── Сводка по РФ ────────────────────────────────────────── */
.rf-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}
.rf-summary-item {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 180px;
  background: var(--neutral-50);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.rf-summary-icon { font-size: 1.8rem; line-height: 1; }
.rf-summary-label { font-size: 0.9rem; font-weight: 600; color: var(--neutral-700); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.rf-summary-value { font-size: 1.35rem; font-weight: 800; color: var(--neutral-900); }

/* ── Гистограмма по годам ─────────────────────────────────── */
.region-years-chart {
  margin-bottom: 32px;
  background: var(--neutral-50);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 24px 28px;
}
.region-years-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--neutral-700);
  margin-bottom: 20px;
}
.region-years-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 120px;
}
.year-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
}
.year-bar-track {
  flex: 1;
  width: 100%;
  background: var(--neutral-200);
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: 10px;
}
.year-bar-fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  transition: height 0.6s ease;
  min-height: 4px;
}
.year-bar-fill-male   { background: linear-gradient(180deg, #60b8f0, var(--male)); }
.year-bar-fill-female { background: linear-gradient(180deg, #f48fb1, var(--female)); }
.year-bar-label { font-size: 0.9rem; color: var(--neutral-700); font-weight: 700; }
.year-bar-val   { font-size: 0.85rem; color: var(--neutral-700); text-align: center; white-space: nowrap; }

/* ── Топ регионов ─────────────────────────────────────────── */
.regions-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--neutral-700);
  margin-bottom: 16px;
}
.regions-years-hint {
  font-size: 0.95rem;
  color: var(--neutral-700);
  font-weight: 400;
  margin-left: 6px;
}

.regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.region-card {
  background: var(--white);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: var(--transition);
}
.region-card:hover { box-shadow: var(--shadow-sm); }
.region-card-male:hover   { border-color: var(--male-mid); }
.region-card-female:hover { border-color: var(--female-mid); }

.region-card-code {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neutral-700);
  background: var(--neutral-100);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 6px;
}
.region-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: 10px;
  line-height: 1.3;
}
.region-card-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.region-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neutral-200);
  display: inline-block;
  flex-shrink: 0;
}
.region-dot-active        { background: var(--neutral-400); }
.region-dot-active.region-dot-male   { background: var(--male); }
.region-dot-active.region-dot-female { background: var(--female); }

.region-card-count {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--neutral-700);
}

.regions-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--neutral-700);
  margin-top: 8px;
}


/* ============================================================
   Страница с результатами по отчеству
   ============================================================ */

.patronym-search-wrap {
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-sm);
}
.patronym-search-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.patronym-search-row .search-input {
  flex: 1;
  font-size: 1.15rem;
  padding: 14px 20px;
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-md);
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: var(--transition);
  color: var(--neutral-900);
  background: var(--neutral-50);
}
.patronym-search-row .search-input:focus {
  border-color: var(--brand);
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}
.patronym-search-row .search-btn {
  white-space: nowrap;
  padding: 14px 32px;
  font-size: 1.15rem;
  border-radius: var(--radius-md);
}
.gender-switcher {
  display: flex;
  gap: 24px;
  font-size: 1.05rem;
  color: var(--neutral-700);
}
.gender-switcher label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
}
.gender-switcher input[type="radio"] { accent-color: var(--brand); width: 18px; height: 18px; }

/* ── Заголовок страницы с результатами ───────────────────────── */
.patronym-page-head {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 36px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
.patronym-page-head-male   { background: linear-gradient(135deg, var(--male-soft), #dbeeff); border: 1px solid var(--male-mid); }
.patronym-page-head-female { background: linear-gradient(135deg, var(--female-soft), #ffe4ef); border: 1px solid var(--female-mid); }

.patronym-page-icon {
  font-size: 2.2rem;
  width: 68px; height: 68px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.patronym-page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 900;
  color: var(--neutral-900);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.patronym-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

/* ── Краткая сводка ──────────────────────────────────────────── */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.summary-card {
  background: var(--white);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.summary-card-icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.summary-card-label { font-size: 0.78rem; font-weight: 700; color: var(--neutral-700); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; line-height: 1.3; }
.summary-card-value { font-size: 1.2rem; font-weight: 800; color: var(--neutral-900); line-height: 1.3; }

/* ── Быстрая навигация ───────────────────────────────────────── */
.name-index-wrap {
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 36px;
}
.name-index-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neutral-700);
  margin-bottom: 14px;
}
.name-index-links {
  line-height: 2.2;
  font-size: 1.05rem;
}
.name-index-links a {
  display: inline-block;
  color: var(--brand);
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 6px;
  transition: var(--transition);
  font-weight: 600;
}
.name-index-links a:hover { background: var(--brand); color: white; }
.name-index-links .idx-score { font-size: 0.9rem; color: #94a3b8; font-weight: 400; }
.name-index-links a:hover .idx-score { color: rgba(255,255,255,0.85); }

/* ── Карточка отчества из БД ────────────────────────────────── */
.patr-db-card {
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  border: 1px solid;
}
.patr-db-card-male   { background: linear-gradient(135deg,#f0f8ff,#e8f4fd); border-color: var(--male-mid); }
.patr-db-card-female { background: linear-gradient(135deg,#fff5f8,#fde8f0); border-color: var(--female-mid); }

.patr-db-meaning {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 600;
  color: var(--neutral-800);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.patr-db-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.patr-db-item {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 140px;
}
.patr-db-item-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-700);
  margin-bottom: 4px;
}
.patr-db-item-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--neutral-900);
}
.patr-rhythm {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.1em;
  font-size: 1.1rem;
}

.patr-db-compat { margin-top: 8px; }
.patr-db-compat-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-700);
  margin-bottom: 14px;
}
.patr-db-compat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.patr-compat-label {
  font-size: 1.05rem;
  font-weight: 700;
  flex-shrink: 0;
}
.patr-compat-good { color: #15803d; }
.patr-compat-bad  { color: #dc2626; }
.patr-compat-letters { display: flex; flex-wrap: wrap; gap: 8px; }

/* Буквы в блоке рекомендаций */
.patr-letter {
  font-size: 1.15rem;
  font-weight: 800;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-family: 'Playfair Display', serif;
}

.patr-db-compat-advice {
  font-size: 1.05rem;
  color: var(--neutral-800);
  font-style: italic;
  margin-top: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--brand);
}

/* ── Блок «Идеальное имя» ────────────────────────────────────── */
.ideal-name-block {
  margin-top: 20px;
  background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 20px 22px;
}
.ideal-name-title {
  font-size: 1rem;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 6px;
}
.ideal-name-desc {
  font-size: 0.88rem;
  color: #a16207;
  margin-bottom: 16px;
  font-style: italic;
}
.ideal-name-rows { display: flex; flex-direction: column; gap: 12px; }
.ideal-name-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  border-left: 3px solid #fbbf24;
}
.ideal-name-icon { font-size: 1.15rem; line-height: 1.4; flex-shrink: 0; }
.ideal-name-content { display: flex; flex-direction: column; gap: 1px; }
.ideal-name-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a16207;
}
.ideal-name-text {
  font-size: 0.97rem;
  color: var(--neutral-900);
  line-height: 1.5;
}
.ideal-name-text strong { color: #92400e; }

/* ── Карточки имён ───────────────────────────────────────────── */
.name-entry {
  background: var(--white);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
  transition: var(--transition);
  scroll-margin-top: 90px;
}
.name-entry:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: transparent; }

/* Шапка карточки */
.name-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 32px 20px;
  border-bottom: 1px solid var(--neutral-100);
}
.name-entry-head-male   { background: linear-gradient(135deg, var(--male-soft), #f0f8ff); }
.name-entry-head-female { background: linear-gradient(135deg, var(--female-soft), #fff5f8); }

.name-entry-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--neutral-900);
  letter-spacing: -0.02em;
}
.name-entry-title .patronym-part { color: var(--neutral-700); font-weight: 400; }

/* Шкала оценки */
.score-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.score-stars { font-size: 1.1rem; line-height: 1; }
.score-num {
  font-size: 1.8rem;
  font-weight: 900;
  font-family: 'Playfair Display', serif;
  line-height: 1;
}
.score-num.high    { color: #15803d; }
.score-num.neutral { color: var(--brand); }
.score-num.low     { color: #dc2626; }
.score-label { font-size: 0.95rem; font-weight: 600; color: var(--neutral-700); }

/* Тело карточки */
.name-entry-body { padding: 28px 32px; }

/* breakdown полоски в карточке имени */
.breakdown-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

/* Детализация оценки */
.details-block {
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.details-block-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-700);
  margin-bottom: 14px;
}
.details-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.details-list li {
  font-size: 1.05rem;
  color: var(--neutral-800);
  line-height: 1.6;
}

/* Инициалы */
.initials-block {
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.initials-block-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-700);
  margin-bottom: 16px;
}
.initials-rows { display: flex; flex-direction: column; gap: 10px; }
.initials-row { display: flex; align-items: center; gap: 14px; font-size: 1.05rem; }
.initials-badge {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: white;
  border: 1.5px solid var(--neutral-200);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--neutral-900);
  flex-shrink: 0;
}
.initials-placeholder { color: #94a3b8; font-style: italic; font-weight: 400; }
.initials-warn { color: #dc2626; font-size: 0.95rem; font-weight: 700; }
.initials-hint { font-size: 0.95rem; color: #94a3b8; margin-top: 10px; }

/* Блоки анализа — сетка 2 колонки */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.analysis-card {
  border-radius: var(--radius-md);
  padding: 22px 24px;
  border: 1px solid;
}
.analysis-card-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}
.analysis-card-value {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.analysis-card-desc { font-size: 1.05rem; color: var(--neutral-700); line-height: 1.6; }

/* Нумерология */
.card-numerology { background: #fffbeb; border-color: #fde68a; }
.card-numerology .analysis-card-title { color: #92400e; }
.numerology-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: #b45309;
  line-height: 1;
  margin-bottom: 10px;
}

/* Цвет */
.card-color-num { background: #fdf2f8; border-color: #f9a8d4; }
.card-color-num .analysis-card-title { color: #9d174d; }
.color-swatch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.color-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
}

/* Буквенный цвет */
.card-color-letters { background: #f0fdfa; border-color: #99f6e4; }
.card-color-letters .analysis-card-title { color: #0f766e; }

/* Карьера */
.career-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 24px;
}
.career-card-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1d4ed8;
  margin-bottom: 12px;
}
.career-explanation { font-size: 1.05rem; color: var(--neutral-800); line-height: 1.6; margin-bottom: 14px; }
.career-professions { display: flex; flex-wrap: wrap; gap: 8px; }
.career-tag {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 4px 12px;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 99px;
}

/* Инфо об имени из БД */
.name-info-card {
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.name-info-card-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-700);
  margin-bottom: 16px;
}
.name-info-row {
  display: flex;
  gap: 12px;
  font-size: 1.05rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--neutral-200);
  line-height: 1.5;
}
.name-info-row:last-child { border-bottom: none; }
.name-info-key { color: var(--neutral-700); flex-shrink: 0; width: 180px; font-weight: 600; }
.name-info-val { color: var(--neutral-900); font-weight: 700; }

.name-detail-link {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  gap: 4px;
  transition: opacity 0.15s;
}
.name-detail-link:hover { opacity: 0.75; text-decoration: underline; }

/* ── Пустое состояние ────────────────────────────────────────── */
.popular-hints { margin-top: 36px; }
.popular-hints-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--neutral-700);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Адаптив ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .names-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .name-detail-head { flex-direction: column; gap: 20px; padding: 24px; }
  .name-detail-title { font-size: 2rem; }
  .rating-label { width: 120px; font-size: 0.95rem; }
  .eth-bar-label { width: 160px; font-size: 0.95rem; }
  .search-form-row { flex-direction: column; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  
  /* Stats & Region overrides for tablet/mobile */
  .rf-summary        { flex-direction: column; }
  .rf-summary-item   { min-width: unset; }
  .regions-grid      { grid-template-columns: 1fr 1fr; }
  .region-years-bars { gap: 8px; }
}

@media (max-width: 640px) {
  /* ── Панель фильтров ── */

  /* Строка пола: кнопки на всю ширину в 3 колонки */
  .filter-gender-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }
  .filter-gender-row .filter-btn {
    text-align: center;
    padding: 10px 6px;
    font-size: 0.9rem;
    white-space: nowrap;
    justify-content: center;
  }

  /* Строка поиска + кнопка фильтров в одну строку */
  .filter-search-row {
    min-width: unset;
    flex: 1 1 0;
    order: 2;
  }
  .filter-search-row input { font-size: 0.95rem; padding: 9px 12px; }

  .filters-toggle-btn {
    order: 2;
    padding: 9px 12px;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Алфавит — компактные кнопки */
  .alphabet-row { padding: 12px 14px; gap: 5px; }
  .alpha-btn {
    width: 33px; height: 33px;
    font-size: 0.88rem;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
  }

  /* Расширенные фильтры */
  .filters-advanced { padding: 16px 14px 14px; }
  .filters-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .filters-panel-top { padding: 14px 14px; gap: 10px; }

  /* Тренд — компактнее */
  .trend-btn { padding: 7px 4px; font-size: 0.85rem; }

  /* Слоги */
  .syll-range input[type=number] { width: 54px; padding: 7px 6px; font-size: 0.9rem; }

  /* Чекбоксы */
  .filter-check { font-size: 0.9rem; }

  /* Сортировка */
  .sort-row { padding: 12px 14px; gap: 8px; }
  .sort-btn { font-size: 0.9rem; padding: 7px 12px; }
  .sort-row-label { font-size: 0.9rem; width: 100%; }

  /* Активные теги */
  .filters-reset-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .filter-active-tag { font-size: 0.85rem; padding: 4px 10px; }
  .patronym-search-row { flex-direction: column; }
  .patronym-page-head  { flex-direction: column; gap: 16px; padding: 24px; }
  .patronym-page-title { font-size: 1.6rem; }
  .name-entry-head     { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
  .name-entry-body     { padding: 20px; }
  .name-entry-title    { font-size: 1.4rem; }
  .score-block         { align-items: flex-start; }
  .name-index-wrap     { padding: 18px; }
  .patronym-search-wrap{ padding: 24px; }
  .analysis-grid       { grid-template-columns: 1fr; }

  /* Таблица инфо об имени — переводим в колонку на мобильных */
  .name-info-card { padding: 16px; }
  .name-info-row  { flex-direction: column; gap: 2px; padding: 10px 0; }
  .name-info-key  { width: auto; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--neutral-500); font-weight: 600; }
  .name-info-val  { font-size: 1rem; }
  .year-bar-val        { display: none; }
  .regions-grid        { grid-template-columns: 1fr; }
}
.region-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.region-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  padding: 8px 36px 8px 14px;
  font-size: 0.88rem;
  color: var(--neutral-800);
  cursor: pointer;
  min-width: 220px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.region-select:hover  { border-color: var(--brand); }
.region-select:focus  { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,86,179,.12); }

.region-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.region-loading {
  font-size: 0.82rem;
  color: var(--neutral-700);
  animation: pulse-opacity 1s infinite;
}

.region-error {
  font-size: 0.82rem;
  color: #dc2626;
}

.region-loading-state .region-select {
  opacity: 0.6;
  pointer-events: none;
}

.region-loading-state::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--neutral-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

/* Региональный бонус-бейдж внутри карточки */
.region-badge {
  display: inline-flex;
  align-items: center;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  white-space: nowrap;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* Анимация пересортировки карточек */
.name-entry {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity  0.25s ease;
}

@media (max-width: 640px) {
  .region-filter-row  { flex-direction: column; align-items: flex-start; gap: 8px; }
  .region-select      { min-width: 100%; }
}

/* ── Новые элементы карточек имён (patronymic page) ─────────────────────── */

/* Бейджи в заголовке карточки */
.name-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 6px;
  white-space: nowrap;
}
.name-badge-intl    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.name-badge-rising  { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.name-badge-falling { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Главная ассоциация */
.main-assoc-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, #fafaf5, #f0f9ff);
  border: 1px solid #e0f0e8;
  border-left: 4px solid #22c55e;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 14px;
}
.main-assoc-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.main-assoc-text {
  font-size: 0.92rem;
  color: var(--neutral-800);
  font-style: italic;
  line-height: 1.5;
}

/* Быстрые теги */
.name-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}
.name-qtag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 20px;
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid;
}
.name-qtag.tag-archetype { background: #faf5ff; color: #7c3aed; border-color: #e9d5ff; }
.name-qtag.tag-layer     { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.name-qtag.tag-sound     { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }

/* Психо-векторы */
.name-vectors {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 14px;
}
.name-vector {
  display: flex;
  align-items: center;
  gap: 10px;
}
.name-vector-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--neutral-700);
  min-width: 130px;
}
.name-vector-bar {
  display: flex;
  gap: 4px;
}
.name-vector-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--neutral-200);
  transition: background 0.2s;
}
.name-vector-dot.active { background: var(--brand); }
.name-vector-num {
  font-size: 0.75rem;
  color: var(--neutral-700);
  font-weight: 600;
  min-width: 24px;
}

/* Длины — компактная строка */
.name-lengths-hint {
  font-size: 0.8rem;
  color: var(--neutral-700);
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .name-vector-label { min-width: 110px; }
  .name-badge        { font-size: 0.66rem; padding: 2px 7px; }
  .main-assoc-text   { font-size: 0.87rem; }
}

.patr-vector {
  display: flex;
  align-items: center;
  gap: 10px;
}
.patr-vector-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neutral-700);
  min-width: 140px;
}
.patr-vector-bar   { display: flex; gap: 5px; }
.patr-vector-dot   { width: 13px; height: 13px; border-radius: 50%; background: var(--neutral-200); }
.patr-vector-dot.active { background: var(--brand); }
.patr-vector-num   { font-size: 0.75rem; color: var(--neutral-700); font-weight: 600; }

/* Этнический блок */
.patr-eth-block {
  margin: 14px 0;
  padding: 12px 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
}
.patr-eth-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.patr-eth-dominant {
  font-size: 0.9rem;
  color: var(--neutral-800);
  margin-bottom: 5px;
}
.patr-eth-pct {
  display: inline-block;
  background: #0369a1;
  color: #fff;
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 0.73rem;
  font-weight: 700;
  margin-left: 6px;
}
.patr-eth-analysis {
  font-size: 0.83rem;
  color: var(--neutral-700);
  line-height: 1.5;
  margin-top: 5px;
}

@media (max-width: 640px) {
  .patr-vector-label { min-width: 110px; }
  .patr-db-grid      { grid-template-columns: 1fr 1fr; }
}

/* ─── Кнопка «Мне нравится» ────────────────────────────────────────────────── */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 10px 20px;
  border: 2px solid #e8628a;
  border-radius: 40px;
  background: #fff;
  color: #e8628a;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform 0.15s ease,
              box-shadow var(--transition);
  user-select: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.like-btn:hover {
  background: #fdf0f4;
  box-shadow: 0 4px 20px rgba(232, 98, 138, 0.25);
  transform: translateY(-1px);
}

.like-btn:active {
  transform: scale(0.96);
}

/* Активное состояние — лайк поставлен */
.like-btn.liked {
  background: linear-gradient(135deg, #e8628a 0%, #d4507a 100%);
  border-color: #d4507a;
  color: #fff;
  box-shadow: 0 4px 18px rgba(212, 80, 122, 0.38);
}

.like-btn.liked:hover {
  background: linear-gradient(135deg, #d4507a 0%, #bf3d66 100%);
  box-shadow: 0 6px 24px rgba(212, 80, 122, 0.45);
}

/* Иконка сердечка внутри кнопки */
.like-btn-heart {
  font-size: 1.1em;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
  line-height: 1;
}

.like-btn.liked .like-btn-heart {
  transform: scale(1.25);
}

/* Счётчик лайков */
.like-btn-count {
  font-size: 0.83rem;
  font-weight: 600;
  opacity: 0.85;
  min-width: 14px;
  text-align: center;
}

/* Состояние загрузки */
.like-btn.loading {
  pointer-events: none;
  opacity: 0.65;
}

/* Анимация «пульс» при клике */
@keyframes like-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232, 98, 138, 0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(232, 98, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 98, 138, 0); }
}

.like-btn.pulse {
  animation: like-pulse 0.5s ease-out;
}

/* Обёртка в карточке — правое выравнивание внутри шапки */
.name-entry-like-wrap {
  display: flex;
  align-items: center;
}

/* Адаптив */
@media (max-width: 480px) {
  .like-btn {
    font-size: 0.84rem;
    padding: 8px 16px;
  }
  /* Очень узкие экраны: фильтры в одну колонку */
  .filters-grid { grid-template-columns: 1fr; }
  .filter-gender-row { grid-template-columns: 1fr 1fr 1fr; }
  .trend-btn { font-size: 0.8rem; padding: 6px 2px; }
  .sort-btn { font-size: 0.82rem; padding: 6px 10px; }
  .filters-panel-top { gap: 8px; }
}

/* ─── Панель фильтров имён ──────────────────────────────────────────────────── */
.name-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.name-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 2px solid var(--neutral-200);
  border-radius: 30px;
  background: var(--white);
  color: var(--neutral-700);
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition),
              color var(--transition), box-shadow var(--transition),
              transform 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.name-filter-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: #f0f6ff;
  box-shadow: 0 2px 10px rgba(0, 86, 179, 0.12);
}

.name-filter-btn:active {
  transform: scale(0.97);
}

/* Активная кнопка */
.name-filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(0, 86, 179, 0.3);
}

.name-filter-btn.active:hover {
  background: var(--brand-light);
  border-color: var(--brand-light);
}

/* Счётчик у кнопки «Выбор пользователей» */
.name-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.name-filter-btn.active .name-filter-badge {
  background: rgba(255, 255, 255, 0.35);
  color: var(--white);
}

.name-filter-btn:not(.active) .name-filter-badge {
  background: var(--brand);
  color: var(--white);
}

/* Этнические фильтры — чуть отличаются визуально */
.name-filter-btn-eth {
  border-color: #d97706;
  color: #92400e;
}
.name-filter-btn-eth:hover {
  background: #fef3c7;
  border-color: #b45309;
}
.name-filter-btn-eth.active {
  background: #d97706;
  border-color: #d97706;
  color: var(--white);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}
.name-filter-btn-eth:not(.active) .name-filter-badge {
  background: #d97706;
  color: var(--white);
}

/* Скрытые карточки */
.name-entry.filter-hidden {
  display: none;
}

/* Ссылки в быстром переходе — скрытые при фильтрации */
.name-index-links a.filter-hidden {
  display: none;
}

/* Заглушка когда нет результатов */
.filter-empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--neutral-700);
  font-size: 0.95rem;
  display: none;
}

.filter-empty-state.visible {
  display: block;
}

@media (max-width: 600px) {
  .name-filter-bar {
    gap: 8px;
    padding: 12px 14px;
  }
  .name-filter-btn {
    font-size: 0.82rem;
    padding: 7px 14px;
  }
}
/* ═══════════════════════════════════════════════════════
   Блок «Все имена» (details/summary)
   ═══════════════════════════════════════════════════════ */

.all-names-details {
  margin-top: 32px;
  border: 1.5px solid var(--neutral-200);
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
}

.all-names-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--neutral-50, #f8fafc);
  border-bottom: 1.5px solid transparent;
  transition: background .15s;
}

.all-names-details[open] .all-names-summary {
  border-bottom-color: var(--neutral-200);
  background: #fff;
}

.all-names-summary::-webkit-details-marker { display: none; }

.all-names-summary:hover {
  background: var(--neutral-100);
}

.all-names-summary-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.all-names-summary-text {
  font-weight: 600;
  font-size: 1rem;
  color: var(--neutral-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.all-names-summary-count {
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  line-height: 1.4;
}

.all-names-summary-hint {
  font-size: 0.8rem;
  color: var(--neutral-500);
  font-style: italic;
  margin-left: 4px;
}

.all-names-chevron {
  margin-left: auto;
  font-size: 1.4rem;
  color: var(--neutral-400);
  transition: transform .2s;
  font-weight: 300;
  line-height: 1;
}

.all-names-details[open] .all-names-chevron {
  transform: rotate(90deg);
}

/* ── Легенда ── */
.all-names-body {
  padding: 20px 22px 24px;
}

.all-names-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--neutral-600);
  margin-bottom: 18px;
  padding: 10px 14px;
  background: var(--neutral-50, #f8fafc);
  border-radius: 8px;
}

.all-names-legend-note {
  color: var(--neutral-400);
  margin-left: 4px;
}

/* ── Светофор-точка ── */
.euph-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.euph-green  { background: #22c55e; }
.euph-yellow { background: #f59e0b; }
.euph-red    { background: #ef4444; }

/* ── Сетка имён ── */
.all-names-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.all-names-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--neutral-200);
  text-decoration: none;
  color: var(--neutral-800);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color .15s, background .15s, transform .1s;
  background: #fff;
}

.all-names-item:hover {
  border-color: var(--brand);
  background: #f0f5ff;
  transform: translateY(-1px);
}

.all-names-item.euph-green  { border-left: 3px solid #22c55e; }
.all-names-item.euph-yellow { border-left: 3px solid #f59e0b; }
.all-names-item.euph-red    { border-left: 3px solid #ef4444; }

.all-names-item-name {
  font-weight: 600;
}

.all-names-item-score {
  font-size: 0.75rem;
  color: var(--neutral-400);
  margin-left: 2px;
}

.trend-up   { color: #22c55e; font-size: 0.8rem; }
.trend-down { color: #ef4444; font-size: 0.8rem; }
.trend-flat { color: var(--neutral-400); font-size: 0.8rem; }

.intl-badge { font-size: 0.75rem; }

/* ── Якорная ссылка в быстром переходе ── */
.idx-all-names-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--brand);
  color: #fff !important;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
  margin-left: 4px;
}

.idx-all-names-link:hover {
  background: var(--brand-light);
}

.idx-all-count {
  opacity: 0.85;
  font-weight: 400;
}

@media (max-width: 600px) {
  .all-names-summary {
    flex-wrap: wrap;
    padding: 14px 16px;
    gap: 6px;
  }
  .all-names-summary-hint { display: none; }
  .all-names-body { padding: 16px; }
  .all-names-item { font-size: 0.85rem; padding: 6px 10px; }
}

/* ── Фильтр по этносу в блоке «Все имена» ── */
.all-names-eth-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.all-names-eth-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1.5px solid var(--neutral-200);
  border-radius: 20px;
  background: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--neutral-700);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.all-names-eth-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.all-names-eth-btn.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.all-names-eth-cnt {
  background: rgba(255,255,255,.25);
  border-radius: 10px;
  padding: 0 5px;
  font-size: 0.75rem;
}

.all-names-eth-btn.active .all-names-eth-cnt {
  background: rgba(255,255,255,.3);
}

/* ── Кнопка «Показать ещё» ── */
.all-names-more-wrap {
  margin-top: 20px;
  text-align: center;
}

.all-names-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  background: var(--neutral-100);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--neutral-700);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.all-names-more-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
/* ============================================================
   ОЦЕНКА ИМЕНИ (10-балльная звёздная шкала)
   ============================================================ */

.name-user-rating-section {}

.rating-hint {
  font-size: 0.97rem;
  color: var(--neutral-600);
  margin-bottom: 18px;
}

.star-rating-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.star-rating-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.star-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--neutral-300);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, transform .12s;
}

.star-btn svg {
  width: 28px;
  height: 28px;
}

.star-btn:hover,
.star-btn.hovered {
  color: #f59e0b;
  transform: scale(1.18);
}

.star-btn.active {
  color: #f59e0b;
}

.star-btn.active svg path {
  fill: #f59e0b;
  stroke: #f59e0b;
}

.star-btn.hovered svg path {
  fill: #fde68a;
  stroke: #f59e0b;
}

.star-rating-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.star-rating-avg {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neutral-900);
}

.star-rating-count {
  font-size: 0.9rem;
  color: var(--neutral-500);
}

.star-rating-thanks {
  font-size: 0.97rem;
  color: #16a34a;
  font-weight: 600;
}

/* ============================================================
   ПОДЕЛИТЬСЯ В СОЦСЕТЯХ
   ============================================================ */

.share-section {}

.share-hint {
  font-size: 0.97rem;
  color: var(--neutral-600);
  margin-bottom: 18px;
}

.share-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: 'Nunito', sans-serif;
  font-size: 0.97rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter .15s, transform .12s, box-shadow .15s;
  white-space: nowrap;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.share-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.13);
}

.share-btn:active {
  transform: translateY(0);
}

/* ВКонтакте — синий */
.share-btn-vk {
  background: #0077ff;
  color: #fff;
}

/* Telegram — небесный */
.share-btn-tg {
  background: #2CA5E0;
  color: #fff;
}

/* Одноклассники — оранжевый */
.share-btn-ok {
  background: #EE8208;
  color: #fff;
}

/* Копировать — нейтральный */
.share-btn-copy {
  background: var(--neutral-100);
  color: var(--neutral-800);
  border: 1.5px solid var(--neutral-200);
}

.share-btn-copy:hover {
  background: var(--neutral-200);
}

/* Мобильная адаптация */
@media (max-width: 640px) {
  .star-btn { width: 32px; height: 32px; }
  .star-btn svg { width: 22px; height: 22px; }
  .share-btns { gap: 10px; }
  .share-btn { padding: 9px 14px; font-size: 0.92rem; }
}

/* ============================================================
   РЕЙТИНГ ПОЛЬЗОВАТЕЛЕЙ В ПЛИТКЕ ИМЕНИ
   ============================================================ */

.name-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,.06);
  font-size: 0.88rem;
  line-height: 1;
}

.name-card-rating-star {
  color: #f59e0b;
  font-size: 1rem;
  line-height: 1;
}

.name-card-rating-val {
  font-weight: 700;
  color: var(--neutral-800);
  font-size: 0.92rem;
}

.name-card-rating-count {
  color: var(--neutral-500);
  font-size: 0.82rem;
}

/* ============================================================
   ПОХОЖИЕ ИМЕНА — блок перелинковки
   ============================================================ */

.similar-names-section {}

.similar-names-hint {
  font-size: 0.98rem;
  color: var(--neutral-700);
  margin-top: -12px;
  margin-bottom: 22px;
}

/* Сетка карточек */
.similar-names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

/* Карточка одного похожего имени */
.similar-name-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 12px;
  background: var(--neutral-50);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color .18s, box-shadow .18s, transform .15s;
  overflow: hidden;
}

/* Hover для мужских имён */
.similar-names-grid--male .similar-name-card:hover {
  border-color: var(--male-mid);
  box-shadow: 0 6px 24px rgba(59, 158, 222, 0.13);
  transform: translateY(-2px);
}

/* Hover для женских имён */
.similar-names-grid--female .similar-name-card:hover {
  border-color: var(--female-mid);
  box-shadow: 0 6px 24px rgba(232, 98, 138, 0.12);
  transform: translateY(-2px);
}

/* Имя */
.similar-name-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--neutral-900);
  line-height: 1.2;
  word-break: break-word;
}

/* Строка с тегами */
.similar-name-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
}

/* Теги архетипа и пласта */
.similar-name-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.5;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.similar-name-tag.tag-arch  { background: #fef3c7; color: #92400e; }
.similar-name-tag.tag-layer { background: #ede9fe; color: #5b21b6; }

/* Иконка тренда */
.similar-name-trend {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #16a34a;
  line-height: 1;
}

.similar-name-trend--down {
  color: #dc2626;
}

/* Индекс сходства (скрыт визуально, виден при hover как tooltip через title) */
.similar-name-score {
  display: none; /* раскомментируйте для отладки: display: block */
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.68rem;
  color: var(--neutral-500, #64748b);
}

/* ── Мобильная адаптация ─────────────────────────────────── */
@media (max-width: 640px) {
  .similar-names-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .similar-name-card {
    padding: 11px 11px 10px;
  }

  .similar-name-title {
    font-size: 1.05rem;
  }
}

@media (max-width: 400px) {
  .similar-names-grid {
    grid-template-columns: 1fr 1fr;
  }
}
