:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #ececf1;
  --accent: #ff5a6e;
  --accent-deep: #e23e58;
  --accent-soft: #fff0f2;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 3px rgba(20,24,40,.06), 0 8px 24px rgba(20,24,40,.05);
  --maxw: 1180px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 .6rem; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; margin: 1.4rem 0 .6rem; letter-spacing: -.01em; }
.muted { color: var(--muted); }
small.muted { font-weight: 400; font-size: .8em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.main { padding-top: 18px; padding-bottom: 48px; min-height: 60vh; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(251,251,253,.85);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -.03em; }
.brand-dot { color: var(--accent); }
.header-nav { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font: inherit; font-weight: 600; border-radius: 999px;
  padding: 10px 18px; min-height: 44px; transition: transform .04s ease, background .15s ease; }
.btn:active { transform: scale(.98); }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-soft { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-soft:hover { border-color: #d9d9e2; }
.btn-ghost { background: transparent; color: var(--ink); padding: 8px 12px; min-height: 40px; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: #fff; color: var(--accent-deep); border: 1px solid #f3c5cd; }
.btn-danger:hover { background: var(--accent-soft); }
.btn.full { width: 100%; }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.linklike { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }

/* Hero */
.hero { text-align: center; padding: 36px 8px 8px; }
.hero h1 { font-size: 2.1rem; }
.hero-sub { color: var(--muted); max-width: 560px; margin: 0 auto 20px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head a { color: var(--accent-deep); font-weight: 600; }

/* Grid of cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 14px; margin-top: 14px; align-items: stretch; }

/* Карточка — горизонтальная: фото слева, текст справа. Единый блок, перепутать нельзя. */
.card { display: flex; flex-direction: row; align-items: stretch; min-height: 168px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(20,24,40,.10); }
.card-photo { flex: 0 0 42%; max-width: 160px; align-self: stretch;
  background-size: cover; background-position: center top; background-color: var(--accent-soft); }
.card-photo.no-photo { position: relative; }
.card-photo.no-photo::after { content: 'фото скоро'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; color: var(--accent-deep); opacity: .55; font-size: .82rem; }
.card-body { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; }
.card-name { font-weight: 700; font-size: 1.02rem; }
.card-desc { color: var(--muted); font-size: .9rem; margin-top: 4px; word-wrap: break-word; overflow-wrap: anywhere; }
.card-meta { font-size: .82rem; color: var(--accent-deep); margin-top: 6px; line-height: 1.35; }
.card .chips { margin-top: auto; padding-top: 10px; }

/* Contact chips — фирменный элемент */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent-deep); border: 1px solid #fbdde2; }
.chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip-lg { width: 52px; height: 52px; border-radius: 16px; }
.chip-lg svg { width: 26px; height: 26px; }

/* Profile page */
.back { display: inline-block; color: var(--muted); margin-bottom: 12px; }
.profile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.gallery { display: grid; grid-template-columns: 1fr; gap: 2px; background: var(--line); }
.gallery .main { aspect-ratio: 4/5; }
.gallery-img { aspect-ratio: 1/1; background-size: cover; background-position: center; background-color: var(--accent-soft); }
@media (min-width: 620px) { .gallery { grid-template-columns: repeat(2,1fr); } .gallery .main { grid-column: 1 / -1; aspect-ratio: 16/9; } }
.profile-head, .lead, .prose, .contacts-block { padding: 0 18px; }
.profile-head { padding-top: 16px; }
.lead { font-size: 1.05rem; }
.prose p { margin: .6rem 0; }
.contacts-block { padding-bottom: 22px; }

/* Panels & forms */
.card-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; }
.card-panel.narrow { max-width: 440px; margin: 0 auto; }
.sub { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 22px; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
input, textarea, select { width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer; background: #fff; }
.pill:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }

.alert { background: var(--accent-soft); border: 1px solid #f3c5cd; color: var(--accent-deep);
  padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.pager { display: flex; justify-content: space-between; margin-top: 24px; }

/* Photos editor */
.photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.photo-thumb { position: relative; width: 100px; height: 100px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; font-size: 16px; }
.danger-zone { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }

/* Centered (auth, gate) */
body.centered .main { display: flex; align-items: center; justify-content: center; }
.gate { text-align: center; max-width: 420px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 22px 0; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Admin */
.admin-wrap { max-width: 820px; margin: 0 auto; }
.admin-title { margin-top: 6px; }
.admin-nav { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 12px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.admin-nav a { color: var(--accent-deep); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
@media (min-width: 620px) { .stats { grid-template-columns: repeat(5,1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: .85rem; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; }
.table th { background: #f6f6f9; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.badge { padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-active { background: #e7f7ec; color: #1b8a4b; }
.badge-hidden { background: #fff3e0; color: #b26a00; }
.badge-deleted { background: #f1f1f4; color: var(--muted); }
code { background: #f1f1f4; padding: 1px 6px; border-radius: 6px; font-size: .9em; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Возрастной оверлей 18+ (контент остаётся в DOM для индексации) */.age-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(20,24,40,.55); backdrop-filter: blur(6px); }
html.age-ok .age-overlay { display: none; }
html:not(.age-ok) { overflow: hidden; }
.age-box { background: var(--surface); border-radius: var(--radius); padding: 28px 24px; max-width: 420px;
  width: 100%; text-align: center; box-shadow: var(--shadow); }
.age-box h2 { margin-top: 0; }

/* ── Логотип в шапке ── */
.brand-logo { height: 72px; max-height: 18vw; width: auto; display: block; }
.site-header .header-row { min-height: 96px; }

/* ── Брендовые цвета иконок в чипах ── */
.chip svg { width: 20px; height: 20px; }
.chip-lg svg { width: 26px; height: 26px; }
.chip--phone { color: var(--accent-deep); }
.chip--whatsapp { color: #25D366; }
.chip--telegram { color: #229ED9; }
.chip--instagram { color: #E1306C; }

/* ── Карусель фото на странице анкеты (без обрезки) ── */
.carousel { position: relative; background: #111; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center;
  height: min(72vh, 560px); background: #111; }
.slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 24px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; }
.carousel-btn:hover { background: rgba(0,0,0,.65); }
.carousel-btn.prev { left: 10px; } .carousel-btn.next { right: 10px; }
.carousel-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; gap: 7px; justify-content: center; }
.carousel-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.45); }
.carousel-dots .dot.active { background: #fff; }
.carousel.single .carousel-btn, .carousel.single .carousel-dots { display: none; }

/* ── Рекламный баннер в ленте ── */
.card-banner { position: relative; min-height: 172px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.banner { display: block; width: 100%; height: 100%; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-label { position: absolute; top: 8px; left: 8px; z-index: 1; font-size: 11px; color: #fff;
  background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 999px; }

/* ── Список баннеров в админке ── */
.banners-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.banner-admin { display: flex; gap: 12px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.banner-admin img { width: 120px; height: 60px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.banner-admin-info { flex: 1; min-width: 0; font-size: .9rem; word-break: break-all; }

/* ── Honeypot (скрытое поле-ловушка для ботов) ── */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ── Параметры на странице анкеты ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px; margin: 14px 0; }
.sg-item { background: var(--accent-soft); border-radius: 12px; padding: 8px 12px; }
.sg-k { display: block; font-size: .75rem; color: var(--muted); }
.sg-v { font-weight: 700; }

/* ── Выбор главного фото ── */
.photo-thumb.is-main { outline: 2px solid var(--accent); outline-offset: 1px; }
.photo-thumb .main-badge { position: absolute; left: 4px; bottom: 4px; font-size: 10px;
  background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 999px; }
.photo-thumb .make-main { position: absolute; left: 4px; bottom: 4px; margin: 0; }
.photo-thumb .make-main button { border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer;
  width: 24px; height: 24px; border-radius: 50%; font-size: 14px; line-height: 1; }
.photo-thumb .make-main button:hover { background: var(--accent); }

/* ── Подгрузка ленты ── */
.feed-loading { text-align: center; color: var(--muted); padding: 18px 0; }

/* select как обычное поле */
.field select, select[name="district"] { width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); font: inherit; color: inherit; }

/* ── Корона у закреплённых анкет ── */
.crown { position: absolute; top: 8px; left: 8px; z-index: 2; font-size: 18px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.crown-inline { font-size: .8em; }

/* ── Лайтбокс (фото на весь экран) ── */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lb-img { max-width: 94vw; max-height: 94vh; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0;
  cursor: pointer; border-radius: 50%; width: 46px; height: 46px; font-size: 26px; line-height: 1; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ── Жалоба на анкету ── */
.report-block { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.report-toggle { cursor: pointer; color: var(--muted); font-size: .9rem; }
.report-form { margin-top: 10px; max-width: 460px; }

/* ── Поднятие анкеты ── */
.bump-block { margin-top: 18px; padding: 14px; background: var(--accent-soft); border-radius: var(--radius); }
.gender-row { margin-top: 6px; }
.hero-compact { padding: 18px 0 6px; }

/* ── Редактирование баннера в админке ── */
.banner-edit { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.banner-edit input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .85rem; }
.banner-edit input[name="link_url"] { flex: 1 1 200px; }
.banner-edit input[name="title"] { flex: 1 1 140px; }
