/*
Theme Name: City Portal
Theme URI: http://wp.local
Author: City Portal Team
Description: Светлая лаконичная тема городского портала: новости, организации, галерея, личный кабинет.
Version: 1.0.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cityportal
*/

:root {
  --bg: #f7f8fa;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-h: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: var(--primary);
  --accent-h: var(--primary-h);
  --accent-soft: #f3f4f6;
  --red: #d92d20;
  --green: #16a34a;
  --border: #e5e7eb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, .15);
  --ok: #16a34a;
  --ok-soft: #ecfdf3;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --err: #dc2626;
  --err-soft: #fef2f2;
  --container: 1500px;
  --header-h: 72px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .3s, color .3s;
}

img { max-width: 100%; height: auto; }
a { color: var(--text); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 12px; font-weight: 700; }
p { margin: 0 0 14px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 720px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.3;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .12s;
  text-align: center; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--primary) 50%, transparent); position: relative; overflow: hidden; }
.btn-glow { box-shadow: 0 6px 24px -6px rgba(37, 99, 235, .55); }
.btn-glow:hover { box-shadow: 0 10px 32px -8px rgba(37, 99, 235, .7); }
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.25), transparent);
  transform: translateX(-100%);
  transition: transform .5s;
}
.btn-primary:hover { background: var(--primary-h); color: #fff; box-shadow: 0 8px 24px -4px color-mix(in srgb, var(--primary) 65%, transparent); }
.btn-primary:hover::before { transform: translateX(100%); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(28, 36, 48, .05); }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 8px; }
.btn-block { width: 100%; }

.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  opacity: .9;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  color: currentColor;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Формы ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px;
}
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="url"], .field input[type="tel"], .field input[type="file"],
.field textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font: inherit; font-size: 15px; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.field input[type="file"] { padding: 8px; cursor: pointer; }
.field input[type="file"]::file-selector-button {
  border: none; background: var(--accent-soft); color: var(--accent);
  padding: 8px 14px; border-radius: 8px; margin-right: 10px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px;
}
.field .required { color: var(--err); }
.hp-field { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; width: 0; overflow: hidden; }
.hint { font-size: 13px; color: var(--muted); }

/* Кастомные checkbox */
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px;
  border: 2px solid var(--border); border-radius: 6px;
  background: var(--surface); cursor: pointer;
  position: relative; flex: 0 0 auto;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
input[type="checkbox"]:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
input[type="checkbox"]:checked {
  background: var(--primary); border-color: var(--primary);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox-inline {
  display: flex !important; align-items: center; gap: 10px;
  font-size: 14.5px; cursor: pointer;
}
.checkbox-inline input[type="checkbox"] { margin: 0; }

/* Кастомные select */
select { display: none; }
.custom-select { position: relative; display: block; }
.custom-select-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit; font-size: 15px; color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, background-color .3s;
}
.custom-select-trigger:hover { border-color: var(--primary); }
.custom-select-trigger:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.custom-select-trigger i { font-size: 12px; color: var(--muted); transition: transform .2s; }
.custom-select-options.open ~ .custom-select-trigger i { transform: rotate(180deg); }
.custom-select-options {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 260px; overflow-y: auto;
  z-index: 300;
  display: none;
}
.custom-select-options.open { display: block; animation: fadeInUp .18s ease; }
.custom-select-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14.5px;
  color: var(--text);
  transition: background-color .12s, color .12s;
}
.custom-select-option:hover { background: var(--primary-soft); color: var(--primary); }
.custom-select-option.selected { background: var(--primary); color: #fff; }
.custom-select-option.selected:hover { background: var(--primary-h); }

/* ---------- Карточки, бейджи ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background-color .3s, border-color .3s, box-shadow .3s, transform .18s;
}
.form-card { padding: 24px; }
@media (min-width: 768px) { .form-card { padding: 32px; } }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.5;
}
.badge-publish { background: var(--ok-soft); color: var(--ok); }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-draft { background: #f2f4f7; color: var(--muted); }
.badge-verified { background: var(--ok-soft); color: var(--ok); }

.chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 14px; font-weight: 500; color: var(--muted);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Шапка ---------- */
.site-header {
  position: relative;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background-color .3s, border-color .3s;
}
.header-inner {
  display: flex; align-items: center; gap: 12px;
  height: var(--header-h);
}
.site-brand { display: flex; align-items: center; min-width: 0; }
.brand-title { font-size: 19px; font-weight: 800; color: var(--text); white-space: nowrap; }
.brand-title:hover { color: var(--accent); }
.site-brand img { max-height: 40px; width: auto; }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; border: none; background: none; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 22px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav { display: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.site-nav a {
  display: block; padding: 12px 16px; border-radius: 999px;
  color: var(--text); font-weight: 600; font-size: 16px;
  transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--accent); }
.site-nav .current-menu-item > a { color: var(--accent); background: var(--accent-soft); }

body.nav-open .site-nav {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg); padding: 12px 16px 20px;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

@media (min-width: 992px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; }
  .site-nav ul { flex-direction: row; align-items: center; }
  .site-nav a { padding: 8px 14px; font-size: 15px; }
  body.nav-open .site-nav { position: static; box-shadow: none; padding: 0; border: none; background: none; }
}

/* ---------- Контент ---------- */
.site-main { flex: 1; }
.page-section { padding: 32px 0; }
@media (min-width: 768px) { .page-section { padding: 48px 0; } }

.page-title { font-size: 26px; margin: 28px 0 20px; }
@media (min-width: 768px) { .page-title { font-size: 32px; margin: 40px 0 24px; } }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.section-head h2 { font-size: 22px; margin: 0; }
@media (min-width: 768px) { .section-head h2 { font-size: 26px; } }
.section-link { font-weight: 600; font-size: 15px; }

/* ---------- Герой ---------- */
.hero {
  background: linear-gradient(135deg, #eef4ff 0%, #f7fafd 55%, #eefaf5 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
}
.hero h1 { font-size: 28px; margin-bottom: 10px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 560px; margin: 0 auto 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-stats { display: flex; gap: 24px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-size: 22px; }
.hero-stat span { font-size: 13px; color: var(--muted); }
@media (min-width: 768px) {
  .hero { padding: 72px 0; }
  .hero h1 { font-size: 38px; }
}

/* ---------- Сетки ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1024px) {
  .grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Карточка новости */
.news-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.news-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--accent-soft); }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card .thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 34px; font-weight: 800;
}
.news-card .body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-card .meta { font-size: 13px; color: var(--muted); }
.news-card h3 { font-size: 16.5px; margin: 0; }
.news-card h3 a { color: var(--text); }
.news-card h3 a:hover { color: var(--accent); }
.news-card .excerpt { font-size: 14.5px; color: var(--muted); margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Карточка организации */
.org-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; transition: transform .18s, box-shadow .18s; }
.org-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.org-card .org-top { display: flex; align-items: center; gap: 14px; }
.org-logo {
  width: 56px; height: 56px; border-radius: 14px; flex: 0 0 auto; overflow: hidden;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 800; font-size: 20px;
}
.org-logo img { width: 100%; height: 100%; object-fit: cover; }
.org-card h3 { font-size: 16.5px; margin: 0; }
.org-card h3 a { color: var(--text); }
.org-card h3 a:hover { color: var(--accent); }
.org-card .org-info { font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.org-card .org-info span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.org-card .org-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Карточка фото */
.photo-card { position: relative; overflow: hidden; border-radius: var(--radius); display: block; }
.photo-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform .25s; }
.photo-card:hover img { transform: scale(1.05); }
.photo-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px;
  background: linear-gradient(to top, rgba(12, 18, 30, .8), transparent);
  color: #fff; font-size: 14px; line-height: 1.4;
}
.photo-caption .photo-author { font-size: 12.5px; opacity: .8; display: block; }

/* ---------- Фильтр категорий ---------- */
.filter-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 24px; -webkit-overflow-scrolling: touch; }
.filter-bar .chip { white-space: nowrap; flex: 0 0 auto; }

/* ---------- Страница организации ---------- */
.org-header { padding: 24px; display: flex; gap: 20px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.org-header .org-logo { width: 88px; height: 88px; font-size: 30px; border-radius: 18px; }
.org-header h1 { font-size: 24px; margin: 0 0 4px; }
@media (min-width: 768px) { .org-header { padding: 32px; } .org-header h1 { font-size: 30px; } }
.org-header .org-title-block { flex: 1; min-width: 220px; }
.org-verified { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; vertical-align: middle; }

.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.info-list li { display: flex; gap: 12px; align-items: flex-start; }
.info-list .info-icon {
  width: 32px; height: 32px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 9px; font-size: 13px; margin-top: -4px;
}
.info-list .label { min-width: 90px; color: var(--muted); font-size: 14px; font-weight: 600; padding-top: 3px; }
.info-list .value { word-break: break-word; flex: 1; padding-top: 2px; }
.info-list .value a { color: var(--primary); font-weight: 500; }
.org-content { padding: 24px; }
@media (min-width: 768px) { .org-content { padding: 32px; } }
.claim-box { margin-top: 20px; padding: 20px; border-radius: var(--radius); background: var(--accent-soft); }
.org-map { margin-top: 24px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--border); }
.org-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.claim-status { margin: 10px 0 0; font-size: 14.5px; }
.claim-status.ok { color: var(--ok); }
.claim-status.err { color: var(--err); }

/* ---------- Одиночные записи ---------- */
.single-wrap { padding: 24px 0 48px; }
.single-card { padding: 24px; }
@media (min-width: 768px) { .single-card { padding: 36px; } }
.single-card .entry-meta { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.single-card h1 { font-size: 26px; }
@media (min-width: 768px) { .single-card h1 { font-size: 32px; } }
.single-card .featured { margin: 16px -24px 20px; }
@media (min-width: 768px) { .single-card .featured { margin: 16px -36px 20px; } }
.single-card .featured img { width: 100%; max-height: 480px; object-fit: cover; display: block; }
.photo-single { text-align: center; padding: 24px; }
.photo-single img { max-height: 72vh; border-radius: var(--radius); }
.photo-single figcaption { margin-top: 14px; color: var(--muted); font-size: 15px; }
.back-link { display: inline-block; margin-bottom: 18px; font-weight: 600; font-size: 15px; }

/* ---------- Пустые состояния ---------- */
.empty-state { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty-state p { margin-bottom: 18px; }
.empty-state-icon {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 28px;
}
.empty-state .btn { margin-top: 6px; }

/* ---------- Пагинация ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px;
  padding: 0 12px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 14.5px;
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .page-numbers:hover:not(.current) { border-color: var(--accent); color: var(--accent); }

/* ---------- Личный кабинет ---------- */
.account-tabs {
  display: flex; gap: 4px; overflow-x: auto; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); -webkit-overflow-scrolling: touch;
}
.account-tabs button {
  border: none; background: none; padding: 12px 16px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 15px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.account-tabs button:hover { color: var(--text); }
.account-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.account-panel { padding: 24px; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

.my-list { list-style: none; margin: 0; padding: 0; }
.my-list li {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.my-list li:last-child { border-bottom: none; }
.my-list .my-title { font-weight: 600; color: var(--text); }
.my-list .my-title:hover { color: var(--accent); }
.my-list .my-meta { font-size: 13.5px; color: var(--muted); }
.my-list .my-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.my-list .my-left a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ---------- Модальное окно ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .18s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  position: relative; width: 100%; max-width: 430px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 24px; animation: slideUp .22s ease;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } }
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px;
  border: none; background: none; font-size: 24px; line-height: 1; cursor: pointer;
  color: var(--muted); border-radius: 50%;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal h2 { font-size: 21px; margin-bottom: 16px; padding-right: 30px; }

.auth-tabs {
  display: flex; background: var(--bg); border-radius: var(--radius-sm);
  padding: 4px; margin-bottom: 20px; gap: 2px;
}
.auth-tabs button {
  flex: 1; border: none; background: none; padding: 9px 8px; border-radius: 8px;
  cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted);
  white-space: nowrap;
}
.auth-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-message { font-size: 14px; margin: 12px 0 0; min-height: 20px; }
.auth-message.ok { color: var(--ok); }
.auth-message.err { color: var(--err); }
.submit-message { font-size: 14.5px; margin: 14px 0 0; min-height: 20px; }
.submit-message.ok { color: var(--ok); }
.submit-message.err { color: var(--err); }
.auth-sub { font-size: 13.5px; color: var(--muted); margin-top: 12px; }
.auth-sub a { font-weight: 600; }

body.modal-open { overflow: hidden; }

/* ---------- Лайтбокс ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 400; background: rgba(10, 14, 22, .92);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 24px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 78vh; border-radius: 12px; box-shadow: var(--shadow-lg); cursor: zoom-out; }
.lightbox-caption { color: #fff; margin-top: 16px; font-size: 15px; text-align: center; max-width: 720px; }
.lightbox-counter {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.75); font-size: 14px; font-weight: 600;
  background: rgba(255,255,255,.12); padding: 6px 14px; border-radius: 999px;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  width: 48px; height: 48px;
  border: none; background: rgba(255, 255, 255, .12); color: #fff; font-size: 22px;
  border-radius: 50%; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
}
.lightbox-close { top: 16px; right: 20px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255, 255, 255, .25); }
.lightbox-prev:active,
.lightbox-next:active { transform: translateY(-50%) scale(.94); }
@media (max-width: 767px) {
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox img { max-height: 70vh; }
}

/* ---------- Подвал ---------- */
.site-footer {
  position: relative;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  margin-top: 64px;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .6), transparent);
}
.site-footer a { color: #cbd5e1; text-decoration: none; transition: color .15s; }
.site-footer a:hover { color: #fff; }
.site-footer h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #94a3b8;
  margin-bottom: 16px;
}

.footer-cta {
  position: relative;
  padding: 52px 0;
  background:
    radial-gradient(ellipse 70% 80% at 20% 50%, rgba(37, 99, 235, .18) 0%, transparent 50%),
    radial-gradient(ellipse 60% 70% at 80% 20%, rgba(124, 58, 237, .12) 0%, transparent 50%);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.footer-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer-cta-text h2 {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: -.5px;
}
.footer-cta-text p { font-size: 16px; color: #94a3b8; margin: 0; }
.footer-cta-search { flex: 0 0 auto; }
@media (max-width: 767px) {
  .footer-cta-inner { flex-direction: column; text-align: center; }
  .footer-cta-search { width: 100%; }
}

.footer-main { padding: 56px 0 40px; }
.footer-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.2fr; }
}

.footer-brand .site-brand { margin-bottom: 14px; }
.footer-brand .brand-title { font-size: 22px; color: #fff; }
.footer-brand .brand-title:hover { color: #60a5fa; }
.footer-desc { color: #94a3b8; font-size: 14.5px; max-width: 340px; line-height: 1.55; margin-bottom: 20px; }

.footer-socials { display: flex; gap: 10px; margin-bottom: 26px; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #cbd5e1;
  font-size: 17px;
  transition: all .15s;
}
.social-link:hover {
  transform: translateY(-2px);
  color: #fff;
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .35);
}
.social-link.vk:hover { background: #07f; border-color: #07f; }
.social-link.tg:hover { background: #08c; border-color: #08c; }
.social-link.ok:hover { background: #f80; border-color: #f80; }

.footer-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.footer-stat {
  padding: 14px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
  text-align: center;
}
.footer-stat strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}
.footer-stat span { font-size: 12px; color: #94a3b8; text-transform: lowercase; }

.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col ul li a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 14.5px;
  font-weight: 500;
}
.footer-col ul li a:hover { color: #fff; transform: translateX(3px); }
.footer-col ul li a i { color: #60a5fa; font-size: 13px; width: 18px; }

.footer-contacts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #cbd5e1;
  font-size: 14.5px;
  margin-bottom: 10px;
}
.footer-contacts li i { color: #60a5fa; margin-top: 3px; flex: 0 0 auto; }

.footer-subscribe { margin-top: 20px; }
.footer-subscribe-title { font-size: 13px; font-weight: 600; color: #94a3b8; margin-bottom: 10px; }
.footer-subscribe-form {
  display: flex;
  gap: 8px;
}
.footer-subscribe-form input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .05);
  color: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.footer-subscribe-form input::placeholder { color: #94a3b8; }
.footer-subscribe-form input:focus { border-color: #2563eb; background: rgba(255, 255, 255, .08); }
.footer-subscribe-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.footer-subscribe-form button:hover { background: var(--primary-h); transform: translateY(-1px); }
.footer-subscribe-message { font-size: 13px; margin: 8px 0 0; min-height: 18px; }
.footer-subscribe-message.is-success { color: #4ade80; }
.footer-subscribe-message.is-error { color: #f87171; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 22px 0;
  background: rgba(0, 0, 0, .15);
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copyright { color: #94a3b8; font-size: 13.5px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { font-size: 13.5px; color: #94a3b8; }
.footer-links a:hover { color: #fff; }
@media (max-width: 767px) {
  .footer-bottom-inner { flex-direction: column; text-align: center; }
  .footer-stats { grid-template-columns: repeat(4, 1fr); }
  .footer-stat { padding: 10px 6px; }
  .footer-stat strong { font-size: 16px; }
}

/* ================= Главная: жилой топ ================= */
.home-top { padding: 24px 0 8px; }
.home-top-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.home-top-main { display: flex; flex-direction: column; gap: 20px; }
.home-top-greeting h1 {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.8px;
  margin: 0 0 8px;
  color: var(--text);
}
.home-top-greeting p {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}
.home-top-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .home-top-categories { grid-template-columns: repeat(3, 1fr); }
}
.home-top-cat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}
.home-top-cat:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, .18);
}
.home-top-cat i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 16px;
}

.home-top-side { display: flex; }
.emergency-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.emergency-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.emergency-bar-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}
.emergency-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}
.emergency-pill:hover {
  background: color-mix(in srgb, var(--em-color) 8%, transparent);
  border-color: var(--em-color);
  color: var(--em-color);
  transform: translateY(-1px);
}
.emergency-pill i {
  color: var(--em-color);
  font-size: 12px;
}
.emergency-pill-phone { font-weight: 800; letter-spacing: .3px; }
.emergency-pill-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.emergency-pill:hover .emergency-pill-label { color: var(--em-color); }
@media (max-width: 767px) {
  .emergency-bar { flex-direction: column; align-items: flex-start; }
  .emergency-bar-list { width: 100%; }
}

/* ================= Компактные заголовки архивов ================= */
.page-section-sm { padding: 20px 0 8px; }
.archive-head { margin-bottom: 18px; }
.archive-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 0 0 6px;
  color: var(--text);
}
.archive-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}
.archive-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ================= Карта города ================= */
.city-map { padding: 16px 0 8px; }
.map-panel {
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.map-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin-bottom: 14px;
}
.map-search > i {
  position: absolute;
  left: 16px;
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
}
.map-search input {
  flex: 1;
  padding: 12px 86px 12px 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .2s;
}
.map-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.map-search-voice,
.map-search-clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.map-search-voice { right: 74px; }
.map-search-clear { right: 74px; }
.map-search-clear[hidden] + .map-search-voice { right: 74px; }
.map-search-voice:hover { background: var(--accent-soft); color: var(--primary); }
.map-search-voice.is-recording {
  background: #dc2626;
  color: #fff;
  animation: voice-pulse 1.2s infinite;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .4); }
  50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
}
.map-search-clear:hover { background: var(--accent-soft); color: var(--primary); }
.map-search-clear[hidden] { display: none; }

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.map-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.map-cats::-webkit-scrollbar { display: none; }
.map-cats .chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.map-cats .chip:hover { border-color: var(--primary); color: var(--primary); }
.map-cats .chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.map-actions { display: flex; gap: 6px; }
.map-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.map-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--accent-soft); }
.map-btn.is-loading { animation: spin 1s linear infinite; }

.city-map-wrap {
  position: relative;
  height: 420px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.city-map-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.map-results {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.map-results[hidden] { display: none; }
.map-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.map-results-head h3 { font-size: 15px; font-weight: 700; margin: 0; }
.map-results-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.map-results-close:hover { background: var(--accent-soft); color: var(--primary); }
.map-results-list { display: grid; gap: 8px; }
.map-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: all .15s;
}
.map-result-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.map-result-item strong { font-size: 14.5px; font-weight: 600; }
.map-result-item span { font-size: 13px; color: var(--muted); }
.map-result-open { color: var(--green); font-weight: 600; }
.map-result-open i { margin-right: 4px; }

@media (max-width: 767px) {
  .city-map-wrap { height: 320px; border-radius: 14px; }
  .map-panel { padding: 12px; border-radius: 16px; }
  .map-search input { padding: 11px 76px 11px 40px; font-size: 14.5px; }
  .map-search > i { left: 14px; }
  .map-search-voice,
  .map-search-clear { right: 66px; width: 30px; height: 30px; }
  .map-toolbar { flex-wrap: wrap; }
  .map-actions { margin-left: auto; }
}

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 80px 0; }
.error-page h1 { font-size: 64px; margin-bottom: 8px; color: var(--accent); }

/* ---------- Служебные страницы ---------- */
.entry-content img { border-radius: var(--radius); }
.entry-content { font-size: 16.5px; }
.entry-content h2 { margin-top: 28px; font-size: 22px; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }

/* ================= Шапка: инфо-бар ================= */

.header-topbar {
  background: var(--text);
  color: #fff;
  font-size: 13.5px;
}
.header-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 34px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.header-topbar-inner::-webkit-scrollbar { display: none; }
.topbar-left, .topbar-right { display: flex; align-items: center; }
.topbar-item { display: inline-flex; align-items: center; gap: 7px; padding: 0 16px; border-left: 1px solid rgba(255, 255, 255, .22); }
.topbar-item:first-child { border-left: none; padding-left: 0; }
.topbar-right .topbar-item:last-child { padding-right: 0; }
.topbar-item > i:first-child { font-size: 13px; opacity: .85; }
.topbar-time { font-weight: 700; letter-spacing: .3px; }
.topbar-weather { font-weight: 500; }
.weather-icon { color: #ffd76a; opacity: 1 !important; }

@media (max-width: 767px) {
  .header-topbar { font-size: 12.5px; }
  .topbar-left, .topbar-right { gap: 14px; }
  .header-topbar-inner { gap: 14px; }
  .topbar-hide-mobile { display: none !important; }
}

/* ================= Шапка: основная строка ================= */

.header-main {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background-color .3s, border-color .3s;
}
.header-inner { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
.site-brand { flex: 0 0 auto; display: flex; align-items: center; }
.site-brand img { height: 44px; width: auto; display: block; }

/* Меню по центру (на десктопе) */
.site-nav { flex: 1; }
.site-nav ul { justify-content: center; }
.site-nav a {
  position: relative;
  display: block;
  padding: 10px 14px;
  border-radius: 0;
  color: var(--text);
  font-weight: 500;
  font-size: 15.5px;
  letter-spacing: .1px;
}
.site-nav a::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease;
}
.site-nav a:hover { background: none; color: var(--text); }
.site-nav a:hover::after,
.site-nav .current-menu-item > a::after { transform: scaleX(1); }
.site-nav .current-menu-item > a { color: var(--text); font-weight: 600; background: none; }

/* Поиск на всю доступную ширину */
.header-search-row { padding: 0 16px 16px; }
.header-search { position: relative; width: 100%; }
.header-search-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 0 10px 0 18px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .15s, box-shadow .2s, transform .2s;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.header-search-trigger:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 28px -10px rgba(37, 99, 235, .22);
  transform: translateY(-1px);
}
.header-search-trigger:active { transform: translateY(0); }
.header-search-trigger > i { color: var(--muted); font-size: 18px; flex: 0 0 auto; }
.header-search-placeholder {
  flex: 1;
  text-align: left;
  font-size: 15.5px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-family: inherit;
  letter-spacing: .5px;
}
@media (max-width: 767px) {
  .header-search-trigger { height: 52px; padding-left: 16px; }
  .header-search-placeholder { font-size: 14.5px; }
  .header-search-kbd { display: none; }
}

/* Поисковый оверлей */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
}
.search-overlay[hidden] { display: none; }
body.search-open { overflow: hidden; }
.search-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: search-fade-in .2s ease;
}
@keyframes search-fade-in { from { opacity: 0; } to { opacity: 1; } }
.search-overlay-content {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 8vh);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35);
  overflow: hidden;
  animation: search-pop-in .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes search-pop-in {
  from { opacity: 0; transform: translateY(-16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.search-overlay-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex: 0 0 auto;
}
.search-overlay-close:hover { background: var(--accent-soft); color: var(--primary); }

.search-overlay-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.search-overlay-input-wrap > i { color: var(--muted); font-size: 20px; flex: 0 0 auto; }
.search-overlay-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
}
.search-overlay-input-wrap input::placeholder { color: #9ca3af; }
.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.search-clear:hover { background: var(--accent-soft); color: var(--primary); }
.search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-family: inherit;
}
@media (max-width: 767px) {
  .search-overlay { padding: 4vh 10px 10px; }
  .search-overlay-content { border-radius: 20px; }
  .search-overlay-input-wrap { padding: 18px 16px 16px; }
  .search-overlay-input-wrap input { font-size: 17px; }
  .search-kbd { display: none; }
}

/* Табы с бегающим индикатором */
.search-overlay-filters {
  padding: 14px 20px 4px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.search-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border-radius: 14px;
  padding: 4px;
}
.search-tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 12px;
  background: var(--primary);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), width .25s cubic-bezier(.2, .8, .2, 1);
  z-index: 0;
}
.sf-tab {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
}
.sf-tab:hover { color: var(--text); }
.sf-tab.active { color: #fff; }

/* Чипы категорий */
.search-cats-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 14px;
  margin: 0 -4px;
  scrollbar-width: none;
}
.search-cats-bar::-webkit-scrollbar { display: none; }
.search-cats-bar .chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.search-cats-bar .chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.search-cats-bar .chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, .35);
}
.search-cats-bar[hidden] { display: none; }

/* Тело оверлея */
.search-overlay-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 20px 20px;
}
.search-overlay-body::-webkit-scrollbar { width: 6px; }
.search-overlay-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
.search-recent { margin-bottom: 10px; }
.search-recent h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin: 12px 4px 8px;
}
.search-recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.search-recent-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.search-recent-item:hover { border-color: var(--primary); color: var(--primary); background: var(--accent-soft); }

/* Группированные результаты */
.search-group { margin-bottom: 18px; }
.search-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin: 16px 4px 8px;
}
.search-group-title i { font-size: 14px; color: var(--accent); }
.search-group-list { display: grid; gap: 2px; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: background .12s, transform .12s;
}
.search-result-item:hover,
.search-result-item.is-selected,
.search-group-all.is-selected {
  background: var(--accent-soft);
  transform: translateX(4px);
}
.search-result-item .sr-body { min-width: 0; flex: 1; }
.search-result-item .sr-title {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
}
.search-result-item .sr-extra {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.search-group-all {
  display: inline-flex;
  justify-content: center;
  margin: 8px auto 4px;
}
.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
}
.search-empty-state i { font-size: 42px; opacity: .5; }
.search-empty-state p { font-size: 15px; margin: 0; }

.search-overlay-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 auto;
}
.search-ai-result { padding: 8px 0 12px; }
.search-ai-result[hidden] { display: none; }
.search-ai-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}
.search-ai-head i { font-size: 12px; }
.search-ai-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}
.search-ai-answer br { margin-bottom: 8px; }
.search-ai-hint {
  color: var(--muted);
  text-align: center;
  margin: 0;
  padding: 20px 10px;
  font-size: 15px;
  line-height: 1.5;
}
.search-ai-hint::before {
  content: '✨';
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
}
.search-ai-error { color: #dc2626; text-align: center; margin: 0; }
.search-ai-loading {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 0;
}
.search-ai-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: ai-pulse 1s infinite ease-in-out;
}
.search-ai-loading span:nth-child(2) { animation-delay: .15s; }
.search-ai-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-pulse {
  0%, 80%, 100% { transform: scale(.7); opacity: .5; }
  40% { transform: scale(1); opacity: 1; }
}
.search-ai-sources { margin-top: 18px; text-align: left; }
.search-ai-sources h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin: 0 0 10px;
}
.search-ai-source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 8px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}
.search-ai-source:hover { border-color: var(--primary); color: var(--primary); background: var(--accent-soft); }
.sf-tab-ai { color: #7c3aed; }
.sf-tab-ai.active { color: #fff; }
.search-overlay-footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
}
@media (max-width: 767px) {
  .search-overlay-filters { padding: 12px 14px 4px; }
  .sf-tab { padding: 7px 12px; font-size: 13px; }
  .search-overlay-body { padding: 6px 14px 14px; }
  .search-overlay-footer { display: none; }
}

/* ================= Поисковый хаб (главная) ================= */
.search-hub {
  position: relative;
  padding: 64px 0 56px;
  margin-top: -16px;
  overflow: hidden;
}
.search-hub-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 10%, rgba(37, 99, 235, .10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(14, 165, 233, .08) 0%, transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  z-index: 0;
}
.search-hub-inner { position: relative; z-index: 1; text-align: center; }
.search-hub-head { max-width: 720px; margin: 0 auto 32px; }
.search-hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 18px;
}
.search-hub-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin: 0 0 14px;
  color: var(--text);
}
.search-hub-subtitle {
  font-size: 18px;
  color: var(--muted);
  margin: 0;
}

.search-hub-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 680px;
  margin: 0 auto 34px;
  gap: 14px;
  padding: 0 12px 0 26px;
  height: 70px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 30px -10px rgba(15, 23, 42, .12), var(--shadow);
  cursor: pointer;
  transition: border-color .15s, box-shadow .2s, transform .2s;
}
.search-hub-trigger:hover {
  border-color: var(--primary);
  box-shadow: 0 14px 40px -12px rgba(37, 99, 235, .22);
  transform: translateY(-2px);
}
.search-hub-trigger > i {
  color: var(--primary);
  font-size: 22px;
  flex: 0 0 auto;
}
.search-hub-trigger-text {
  flex: 1;
  text-align: left;
  font-size: 17px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-hub-trigger-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-family: inherit;
  letter-spacing: .5px;
}

.search-hub-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 800px;
  margin: 0 auto 30px;
}
.search-hub-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, box-shadow .2s, transform .2s;
}
.search-hub-tile:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 28px -10px rgba(37, 99, 235, .18);
  transform: translateY(-3px);
}
.search-hub-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 22px;
}
.search-hub-tile-label { font-size: 15px; font-weight: 700; color: var(--text); }
.search-hub-tile-count { font-size: 13px; font-weight: 600; color: var(--muted); }

.search-hub-cats,
.search-hub-trending {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.search-hub-cats-label,
.search-hub-trending-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.search-hub-trending-label i { color: #f59e0b; margin-right: 5px; }
.search-hub-cats-list,
.search-hub-trending-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.search-hub-cats-list .chip,
.search-hub-trending-list .chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}
.search-hub-cats-list .chip:hover,
.search-hub-trending-list .chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--accent-soft);
}
.search-hub-trending-list .chip-ghost {
  background: transparent;
  color: var(--muted);
}
.search-hub-trending-list .chip-ghost:hover { color: var(--primary); }

@media (max-width: 767px) {
  .search-hub { padding: 44px 0 40px; }
  .search-hub-title { font-size: 30px; }
  .search-hub-subtitle { font-size: 15.5px; }
  .search-hub-trigger { height: 60px; padding-left: 18px; }
  .search-hub-trigger-text { font-size: 15px; }
  .search-hub-trigger-kbd { display: none; }
  .search-hub-quick { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .search-hub-tile { padding: 18px 10px; }
  .search-hub-tile-icon { width: 46px; height: 46px; font-size: 19px; }
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
  font-size: 23px;
  border-radius: 50%;
  transition: background .15s, transform .15s;
  text-decoration: none;
}
.btn-icon:hover { background: var(--accent-soft); color: var(--primary); }
.btn-icon:active { transform: scale(.94); }

/* Меню пользователя */
.user-menu { position: relative; flex: 0 0 auto; }
.user-menu-btn-desktop { display: inline-flex; align-items: center; gap: 8px; width: auto; padding: 0 6px 0 12px; font-size: 15px; font-weight: 600; }
.user-menu-btn-desktop .user-menu-label { display: none; }
@media (min-width: 1200px) {
  .user-menu-btn-desktop .user-menu-label { display: inline; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 250;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.user-dropdown[hidden] { display: none; }
.user-dropdown-name {
  padding: 8px 12px 11px;
  font-weight: 700;
  font-size: 14.5px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dropdown a {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 14.5px;
  transition: background .12s, color .12s;
}
.user-dropdown a i { color: var(--accent); width: 18px; text-align: center; }
.user-dropdown a:hover { background: var(--accent-soft); color: var(--accent); }

/* Поиск + иконка профиля справа */
@media (max-width: 1199px) {
  .site-brand { flex: 1; }
  .site-brand img { height: 38px; }
  .header-search-row { padding: 0 16px 12px; }
  .header-inner { gap: 10px; }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; }
  body.nav-open .site-nav {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 12px 16px 20px;
  }
  body.nav-open .site-nav ul { flex-direction: column; }
}

@media (min-width: 1200px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex; flex: 1; justify-content: center; }
  .site-nav ul { flex-direction: row; align-items: center; }
  body.nav-open .site-nav { position: static; box-shadow: none; padding: 0; border: none; background: none; }
}

/* ================= Главная: сетка ================= */

.section-head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0, 2.15fr) minmax(320px, 1fr); align-items: start; }
}

/* ================= Организации на главной ================= */

.org-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.org-cats { flex: 1; min-width: 0; cursor: grab; touch-action: pan-y; }
.org-cats:active { cursor: grabbing; }
.org-cats .swiper-wrapper { align-items: center; }
.org-cats .swiper-slide { width: auto; user-select: none; -webkit-user-drag: none; }
.org-cats .chip { user-select: none; -webkit-user-drag: none; }
.org-cats .chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .18s;
}
.org-cats .chip:hover { border-color: var(--text); color: var(--text); }
.org-cats .chip.active { background: var(--text); border-color: var(--text); color: #fff; }
.org-cats .chip:active { transform: scale(.96); }

.org-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

.toggle-open {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color .15s;
}
.toggle-open:hover { border-color: var(--text); }
.toggle-open input { display: none; }
.toggle-track {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background .2s;
  flex: 0 0 auto;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .2s;
}
.toggle-open input:checked + .toggle-track { background: var(--green); }
.toggle-open input:checked + .toggle-track::after { transform: translateX(15px); }

.select-slim {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 8px 14px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.select-slim:hover { border-color: var(--text); }

.org-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.org-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .org-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .org-grid { grid-template-columns: repeat(3, 1fr); } }

.org-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  animation: fadeInUp .35s ease both;
}
.org-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #d3dde8; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.org-card-link { display: flex; align-items: flex-start; gap: 14px; flex: 1; min-width: 0; }
.org-card .org-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--accent-soft);
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
}
.org-card .org-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.org-logo-letters {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-weight: 800;
  letter-spacing: .5px;
}
.org-card-info { min-width: 0; padding-top: 2px; }
.org-card-info h3 {
  font-size: 15.5px;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
  color: var(--text);
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.org-verified-mark { color: var(--accent); font-size: 13px; margin-left: 5px; }
.org-card-cat { font-size: 13px; color: var(--muted); display: block; margin-top: 3px; }
.org-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.4;
  margin-top: 2px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; }
.org-status.is-open { background: var(--ok-soft); color: var(--ok); }
.org-status.is-open .status-dot { background: var(--green); animation: pulse 2s infinite; }
.org-status.is-closed { background: var(--err-soft); color: var(--err); }
.org-status.is-closed .status-dot { background: var(--err); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .3); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ================= Боковая лента новостей ================= */

.home-news { overflow: hidden; }
@media (min-width: 1100px) {
  .home-news { position: sticky; top: calc(var(--header-h) + 50px); }
}
.news-tabs {
  position: relative;
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin: 14px 14px 0;
  user-select: none;
}
.news-tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--surface);
  border-radius: 9px;
  box-shadow: var(--shadow);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  z-index: 0;
}
.news-tabs[data-active="popular"] .news-tab-indicator { transform: translateX(100%); }
.news-tabs button {
  position: relative;
  z-index: 1;
  flex: 1;
  border: none;
  background: none;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color .2s;
}
.news-tabs button:hover { color: var(--text); }
.news-tabs button.active { color: var(--text); }
.news-panel { padding: 6px 18px; }
.news-panel[hidden] { display: none; }
.news-row { padding: 13px 0; border-bottom: 1px dashed var(--border); }
.news-row:last-child { border-bottom: none; }
.news-row-date { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 3px; }
.news-row h4 { font-size: 15.5px; font-weight: 600; line-height: 1.4; margin: 0; }
.news-row h4 a { color: var(--text); }
.news-row h4 a:hover { color: var(--accent); }
.news-more { padding: 12px 18px 16px; border-top: 1px solid var(--border); }
.news-more a { font-weight: 600; font-size: 14.5px; }

/* ================= Галерея-мозаика ================= */

.gallery-section { padding-top: 0; }
.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 150px;
  gap: 10px;
}
.gallery-mosaic .m-item { position: relative; overflow: hidden; border-radius: var(--radius); display: block; }
.gallery-mosaic .m-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.gallery-mosaic .m-item:hover img { transform: scale(1.05); }
@media (min-width: 768px) {
  .gallery-mosaic { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 12px; }
  .gallery-mosaic .m-item:nth-child(1) { grid-column: span 2; grid-row: span 2; }
  .gallery-mosaic .m-item:nth-child(4) { grid-row: span 2; }
}

/* ================= Scroll reveal ================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s cubic-bezier(.4, 0, .2, 1), transform .7s cubic-bezier(.4, 0, .2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ================= Spotlight hover ================= */
.spotlight-card {
  position: relative;
  overflow: hidden;
}
.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    color-mix(in srgb, var(--primary) 18%, transparent),
    transparent 40%
  );
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
  z-index: 1;
}
.spotlight-card:hover::before { opacity: 1; }
.spotlight-card > * { position: relative; z-index: 2; }

/* ================= Архив организаций ================= */
.org-archive-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  margin-top: 16px;
}
.org-archive-search > i {
  position: absolute; left: 18px; color: var(--muted); font-size: 17px; pointer-events: none;
}
.org-archive-search input {
  flex: 1;
  padding: 14px 42px 14px 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit; font-size: 16px; color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .2s, background-color .3s;
}
.org-archive-search input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.org-search-clear {
  position: absolute;
  right: 110px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.org-search-clear:hover { background: var(--accent-soft); color: var(--primary); }
.org-search-clear[hidden] { display: none; }
.org-search-active {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}
@media (max-width: 767px) {
  .org-archive-search { flex-wrap: wrap; }
  .org-archive-search input { width: 100%; padding-right: 42px; }
  .org-archive-search .btn { flex: 1; }
  .org-search-clear { right: 18px; top: 50%; transform: translateY(-50%); }
}

.org-archive-wrap { padding-top: 28px; }
.org-archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
@media (min-width: 1100px) {
  .org-archive-grid { grid-template-columns: minmax(0, 1fr) 340px; }
}

.org-archive-main { display: flex; flex-direction: column; gap: 18px; }
.org-archive-sidebar { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 1100px) {
  .org-archive-sidebar { position: sticky; top: calc(var(--header-h) + 24px); }
}

.org-archive-controls {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px 18px;
}
.org-archive-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.org-archive-cats .chip { cursor: pointer; }
.org-archive-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.org-archive-count {
  font-size: 15px; font-weight: 600; color: var(--muted);
}
.org-archive-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .org-archive-list { grid-template-columns: repeat(2, 1fr); }
}
.org-archive-more {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap; margin-top: 8px;
}

.org-archive-map { padding: 18px; }
.org-archive-map h3 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.org-archive-map h3 i { color: var(--primary); }
.org-archive-cta { padding: 20px; }
.org-archive-cta h3 { margin: 0 0 8px; font-size: 17px; }

/* Дополнительные поля в карточке организации */
.org-card-address,
.org-card-phone {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); margin-top: 4px;
  line-height: 1.35;
}
.org-card-address i,
.org-card-phone i { color: var(--primary); font-size: 11px; width: 14px; }

/* ================= Архив галереи ================= */
.gallery-masonry {
  column-count: 2;
  column-gap: 16px;
}
@media (min-width: 640px) { .gallery-masonry { column-count: 3; } }
@media (min-width: 1100px) { .gallery-masonry { column-gap: 20px; } }

.photo-card-masonry {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  break-inside: avoid;
  box-shadow: var(--shadow);
  transition: box-shadow .25s, transform .25s;
}
.photo-card-masonry:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.photo-card-masonry img {
  width: 100%; height: auto; display: block;
  transition: transform .4s ease;
}
.photo-card-masonry:hover img { transform: scale(1.06); }
.photo-card-masonry .photo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.72), transparent 65%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
  opacity: 0; transition: opacity .25s;
  pointer-events: none;
}
.photo-card-masonry:hover .photo-overlay { opacity: 1; }
.photo-card-masonry .photo-title {
  color: #fff; font-weight: 600; font-size: 15px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.photo-card-masonry .photo-author {
  color: rgba(255,255,255,.82); font-size: 13px; margin-top: 4px;
}
.photo-card-masonry .photo-author i { margin-right: 4px; }

.gallery-archive-more {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap; margin-top: 28px;
}

/* ================= Афиша ================= */

.event-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .event-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .event-grid { grid-template-columns: repeat(3, 1fr); } }

.event-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; animation: fadeInUp .35s ease both; }
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.event-card .event-thumb { aspect-ratio: 16 / 9; overflow: hidden; display: block; }
.event-card .event-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.event-card:hover .event-thumb img { transform: scale(1.05); }
.event-card .event-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.event-card .event-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--muted); }
.event-card .event-meta i { color: var(--primary); }
.event-card h3 { font-size: 17px; margin: 0; line-height: 1.35; }
.event-card h3 a { color: var(--text); }
.event-card h3 a:hover { color: var(--primary); }
.event-card .event-cat { font-size: 13px; color: var(--primary); font-weight: 600; }
.event-card .event-place { font-size: 14px; color: var(--muted); }
.event-card .event-place i { color: var(--primary); margin-right: 4px; }
.event-card .event-price { font-size: 15px; font-weight: 700; color: var(--text); margin-top: auto; padding-top: 6px; }

/* ================= Страница поиска ================= */

.search-results { display: grid; gap: 12px; }
.search-result { padding: 18px 20px; }
.search-result-link { display: flex; gap: 16px; align-items: center; color: inherit; }
.search-result .org-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}
.search-result .org-logo img { width: 100%; height: 100%; object-fit: cover; }
.search-result-body { min-width: 0; flex: 1; }
.search-type {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent);
}
.search-type i { margin-right: 5px; }
.search-result h3 { margin: 4px 0 6px; font-size: 18px; line-height: 1.3; }
.search-result h3:hover { color: var(--accent); }
.search-result-excerpt { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; }

/* ================= Skeleton loading ================= */
.skeleton {
  background: linear-gradient(90deg, var(--accent-soft) 25%, color-mix(in srgb, var(--surface) 80%, var(--accent-soft)) 50%, var(--accent-soft) 75%);
  background-size: 200% 100%;
  animation: skeletonMove 1.2s infinite;
  border-radius: 8px;
}
@keyframes skeletonMove {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  pointer-events: none;
}
.skeleton-logo {
  width: 48px; height: 48px; border-radius: 12px;
  flex: 0 0 auto;
  background: var(--accent-soft);
  animation: skeletonMove 1.2s infinite;
  background: linear-gradient(90deg, var(--accent-soft) 25%, color-mix(in srgb, var(--surface) 80%, var(--accent-soft)) 50%, var(--accent-soft) 75%);
  background-size: 200% 100%;
}
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 12px; background: var(--accent-soft); border-radius: 6px; animation: skeletonMove 1.2s infinite; background: linear-gradient(90deg, var(--accent-soft) 25%, color-mix(in srgb, var(--surface) 80%, var(--accent-soft)) 50%, var(--accent-soft) 75%); background-size: 200% 100%; }

/* ================= Floating Action Button ================= */
.fab-wrap {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 350;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.fab-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 24px -4px color-mix(in srgb, var(--primary) 55%, transparent);
  transition: transform .25s, box-shadow .25s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fab-toggle:hover { transform: scale(1.08) rotate(90deg); box-shadow: 0 12px 32px -4px color-mix(in srgb, var(--primary) 65%, transparent); }
.fab-toggle[aria-expanded="true"] { transform: rotate(45deg); }
.fab-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  animation: slideUp .25s ease;
}
.fab-menu[hidden] { display: none; }
.fab-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform .15s, background-color .3s, border-color .3s;
  white-space: nowrap;
}
.fab-item:hover { transform: translateX(-4px); color: var(--primary); background: var(--surface-solid); }
.fab-item i { color: var(--primary); }
@media (min-width: 992px) {
  .fab-wrap { display: none; }
}

/* ================= Полировка ================= */

::selection { background: var(--primary); color: #fff; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

html { scrollbar-color: #c3ccd8 var(--bg); }

/* Новости: строки */
.news-row { transition: transform .15s; }
.news-row h4 a { transition: color .15s; }
.news-row:hover h4 a { color: var(--accent); }
.news-row-date { letter-spacing: .2px; }
.news-panel { padding-top: 10px; }
.news-more a i { transition: transform .15s; }
.news-more a:hover i { transform: translateX(4px); }
.section-link i { transition: transform .15s; }
.section-link:hover i { transform: translateX(4px); }

/* Заголовки секций */
.section-head { margin-bottom: 24px; }
@media (min-width: 768px) { .section-head h2 { font-size: 24px; } }

/* Галерея-мозаика */
.gallery-mosaic .m-item { border-radius: 16px; }
.gallery-mosaic .m-item:hover { box-shadow: var(--shadow-lg); }
.gallery-mosaic .m-item img { transition: transform .35s ease; }
.gallery-mosaic .m-item:hover img { transform: scale(1.06); }

/* Категории-чипы */
.org-cats .chip { transition: all .18s; }
.org-cats .chip:active { transform: scale(.96); }
.org-cats .chip.active { box-shadow: 0 4px 12px -2px rgba(57, 113, 165, .45); }

/* Поиск: скроллбар выпадашки */
.search-dropdown::-webkit-scrollbar { width: 5px; }
.search-dropdown::-webkit-scrollbar-thumb { background: #c3ccd8; border-radius: 5px; }

/* Кнопки */
.btn { border-radius: 12px; letter-spacing: .2px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--primary) 45%, transparent); }
.btn-primary:hover { background: var(--primary-h); color: #fff; box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--primary) 50%, transparent); }
.btn-outline { color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* Чипы категорий */
.org-cats .chip.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--primary) 45%, transparent); }
.filter-bar .chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Пустые состояния и карточки */
.card { border-radius: var(--radius); }
.form-card { border-radius: 18px; }

/* Пагинация */
.pagination .page-numbers { border-radius: 10px; transition: all .15s; }
.pagination .page-numbers:not(.current):hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* Логотип в шапке организации */
.org-header .org-logo { border-radius: 18px; }
.org-header .org-logo .org-logo-letters { letter-spacing: 1px; }

