: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: 980px;
  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(2, 1fr); gap: 14px; margin-top: 14px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; 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 { aspect-ratio: 3/4; background-size: cover; background-position: center; background-color: var(--accent-soft); }
.card-body { padding: 10px 12px 12px; }
.card-name { font-weight: 700; }
.card-desc { color: var(--muted); font-size: .9rem; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 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; }
