/* ============ «Между нами» — дизайн-система v2 ============ */

:root {
  --bg: #FAF0EA;
  --bg-2: #F1D8CE;
  --card: #FFFDF9;
  --lav: #E6DCF1;
  --sage: #DEE7DA;

  --ink: #38272F;
  --ink-soft: #6D5A63;
  --ink-faint: #9C8890;

  --accent: #C24B6D;
  --accent-hover: #A63456;
  --accent-soft: #F6D8E1;

  --heading: #6D1C37;

  --line: #EFD6D9;
  --line-strong: #E6C4C9;

  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-sm: 14px;

  --shadow-sm: 0 1px 2px rgba(56, 39, 47, 0.05), 0 10px 28px -14px rgba(56, 39, 47, 0.18);
  --shadow-md: 0 6px 18px rgba(56, 39, 47, 0.07), 0 30px 60px -26px rgba(56, 39, 47, 0.34);

  --font-display: "Playfair Display", "Georgia", "Times New Roman", serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --maxw: 1160px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; }

::selection { background: var(--accent-soft); color: var(--accent-hover); }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E5C6CD; border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #D8B2BA; }

.icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============ Анимации ============ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.cats > .cat, .new-grid > .topic-card { animation: fadeUp .45s cubic-bezier(.2,.7,.3,1) both; }
.cats > .cat:nth-child(2), .new-grid > .topic-card:nth-child(2) { animation-delay: .05s; }
.cats > .cat:nth-child(3), .new-grid > .topic-card:nth-child(3) { animation-delay: .1s; }
.cats > .cat:nth-child(4), .new-grid > .topic-card:nth-child(4) { animation-delay: .15s; }
.cats > .cat:nth-child(5), .new-grid > .topic-card:nth-child(5) { animation-delay: .2s; }
.cats > .cat:nth-child(6), .new-grid > .topic-card:nth-child(6) { animation-delay: .25s; }
.cats > .cat:nth-child(7), .new-grid > .topic-card:nth-child(7) { animation-delay: .3s; }
.cats > .cat:nth-child(8), .new-grid > .topic-card:nth-child(8) { animation-delay: .35s; }
.cats > .cat:nth-child(9), .new-grid > .topic-card:nth-child(9) { animation-delay: .4s; }
.cats > .cat:nth-child(10), .new-grid > .topic-card:nth-child(10) { animation-delay: .45s; }
.cats > .cat:nth-child(11), .new-grid > .topic-card:nth-child(11) { animation-delay: .5s; }
.cats > .cat:nth-child(12), .new-grid > .topic-card:nth-child(12) { animation-delay: .55s; }

/* ============ Шапка ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand { display: flex; align-items: center; gap: 12px; flex: none; }

.brand-mark {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--lav);
  display: grid;
  place-items: center;
  color: var(--accent);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--ink);
  line-height: 1.05;
}

.brand-sub {
  display: block;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 2.2px;
  text-transform: uppercase;
  margin-top: 2px;
}

.search { flex: 1; max-width: 480px; position: relative; margin: 0 auto; }

.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 12px 18px 12px 46px;
  font-size: 15px;
  color: var(--ink);
  font-family: var(--font-body);
  transition: border-color .18s, box-shadow .18s;
}
.search input::placeholder { color: var(--ink-faint); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }

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

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  transition: transform .15s, background .18s, box-shadow .18s, border-color .18s, color .18s;
  will-change: transform;
}
.btn:active { transform: translateY(0) scale(.98); }

.btn-primary { background: linear-gradient(135deg, #8A1E3A, #6E1830); color: #fff; box-shadow: 0 10px 24px -10px rgba(110, 24, 48, 0.55); }
.btn-primary:hover { background: linear-gradient(135deg, #9A2242, #7A1B36); transform: translateY(-1px); }

.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { color: #C0392B; border-color: #E8C0B8; }
.btn-danger:hover { border-color: #C0392B; color: #A93226; background: #FBEDEA; }
.btn-danger:disabled { opacity: .55; cursor: default; }

.btn-light { background: #FFF9F4; color: var(--ink); }
.btn-light:hover { background: #fff; transform: translateY(-1px); }

.btn-block { width: 100%; justify-content: center; }

/* ============ Каркас ============ */

.page { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 100px; }
.page-narrow { max-width: 800px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 44px 0 20px;
  gap: 14px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  margin: 0;
  letter-spacing: .2px;
}

.section-more { font-size: 14px; color: var(--accent); font-weight: 600; }
.section-more:hover { text-decoration: underline; }

/* ============ Hero ============ */

.welcome {
  position: relative;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(130% 150% at 85% 0%, var(--lav) 0%, transparent 55%),
    radial-gradient(120% 160% at 0% 100%, var(--bg-2) 0%, transparent 52%),
    var(--card);
  border: 1px solid var(--line);
  padding: 52px 48px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 40px;
}

.welcome::before {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  border: 1.5px solid rgba(200, 63, 103, 0.12);
}
.welcome::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: 1.5px solid rgba(200, 63, 103, 0.1);
}

.welcome-copy { flex: 1; min-width: 0; position: relative; z-index: 1; }

.welcome h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 5.4vw, 60px);
  line-height: 1.08;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: .2px;
}
.welcome h1 .accent { color: var(--heading); font-style: italic; }

.welcome p { margin: 0 0 26px; color: var(--ink-soft); max-width: 480px; font-size: 17px; }

.welcome-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }

.welcome-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.welcome-stat { display: flex; flex-direction: column; }
.welcome-stat .num { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1; }
.welcome-stat .lbl { font-size: 13px; color: var(--ink-faint); margin-top: 4px; }

.welcome-art { display: grid; grid-template-columns: repeat(2, 96px); gap: 14px; flex: none; position: relative; z-index: 1; }

.welcome-art .tile {
  width: 96px; height: 96px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  box-shadow: 0 16px 30px -16px rgba(61, 53, 64, 0.25);
  color: var(--accent);
}
.welcome-art .tile .icon { width: 34px; height: 34px; }
.welcome-art .tile.t2 { color: #8A74B8; transform: translateY(14px); }
.welcome-art .tile.t3 { color: #6F8A66; }
.welcome-art .tile.t4 { color: #D08A2E; transform: translateY(14px); }

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

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

.cat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.cat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent); }

.cat-count {
  flex: none;
  font-size: 12.5px;
  color: var(--ink-faint);
  font-weight: 500;
}

.cat-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  transition: transform .16s;
}
.cat:hover .cat-icon { transform: scale(1.05); }
.cat-icon .icon { width: 20px; height: 20px; }
.cat-icon.ti-rose { background: var(--accent-soft); color: var(--accent); }
.cat-icon.ti-lav { background: var(--lav); color: #6C5A9E; }
.cat-icon.ti-sage { background: var(--sage); color: #5D7455; }
.cat-icon.ti-berry { background: var(--bg-2); color: var(--accent-hover); }

.cat-name {
  flex: 1;
  min-width: 0;
  font-weight: 650;
  font-size: 14px;
  line-height: 1.25;
  color: var(--ink);
  overflow: hidden;
}

.cat-hidden { display: none; }

/* ============ Тема недели ============ */

.weekly {
  position: relative;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(135deg, #561F37, #6B2940);
  background-size: 20px 20px, auto;
  padding: 46px 48px;
  overflow: hidden;
  color: #FBF3F7;
}

.weekly::before {
  content: "";
  position: absolute;
  right: -60px; top: -80px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 63, 103, 0.55), transparent 70%);
}
.weekly::after {
  content: "";
  position: absolute;
  left: -80px; bottom: -100px;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(162, 138, 196, 0.45), transparent 70%);
}

.weekly-inner { position: relative; z-index: 1; max-width: 720px; }

.weekly-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #F0A9BD;
  font-weight: 700;
  margin-bottom: 16px;
}
.weekly-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.weekly h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 12px;
}
.weekly p { margin: 0 0 26px; color: #CFC4D4; font-size: 16px; max-width: 560px; }

.weekly-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }

.weekly-avatars { display: flex; }
.weekly-avatars .av {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid #3D3540;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  margin-left: -8px;
}
.weekly-avatars .av:first-child { margin-left: 0; }

.weekly-answers { font-size: 14px; color: #CFC4D4; }
.weekly-answers strong { color: #fff; font-weight: 700; }

/* ============ Новое (сетка тем) ============ */

.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-chip {
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all .16s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

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

.new-grid .topic-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.new-grid .topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }

/* ============ Карточки тем (общие) ============ */

.topic-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chip {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 4px 11px;
  border-radius: 999px;
  text-transform: uppercase;
}

.topic-title {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.28;
  font-weight: 600;
  margin: 0;
  transition: color .16s;
}
.topic-card:hover .topic-title { color: var(--accent); }

.topic-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-meta { display: flex; align-items: center; gap: 14px; color: var(--ink-faint); font-size: 13px; flex-wrap: wrap; }
.topic-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-faint); }
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item .icon { width: 16px; height: 16px; color: var(--accent); }

.open-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.open-link .icon { width: 17px; height: 17px; transition: transform .16s; }
.topic-card:hover .open-link .icon { transform: translateX(3px); }

.need-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 11px;
  border-radius: 999px;
  font-weight: 600;
}
.need-tag .icon { width: 14px; height: 14px; }

/* Тона чипов */
.tone-rose { background: var(--accent-soft); color: var(--accent); }
.tone-lav { background: var(--lav); color: #6C5A9E; }
.tone-sage { background: var(--sage); color: #5D7455; }
.tone-berry { background: var(--bg-2); color: var(--accent-hover); }

/* ============ Начать легко ============ */

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

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
}

.step-num {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 18px;
}

.step h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 0 0 6px; }
.step p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ============ Ценности ============ */

.values {
  border-radius: var(--radius-lg);
  padding: 52px 48px;
  background: linear-gradient(135deg, var(--lav), var(--bg) 55%, var(--bg-2));
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.values-text { font-family: var(--font-display); font-size: clamp(26px, 3.6vw, 38px); line-height: 1.25; font-weight: 600; margin: 0; }
.values-text .accent { color: var(--heading); font-style: italic; }

.values-tags { display: flex; gap: 10px; flex-wrap: wrap; max-width: 360px; }

.value-pill {
  border: 1px solid rgba(200, 63, 103, 0.25);
  background: rgba(255, 249, 244, 0.7);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
}

/* ============ С чего начать ============ */

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

.start-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.start-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }

.start-card .start-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--lav);
  color: #6C5A9E;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.start-card h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; margin: 0 0 6px; }
.start-card p { margin: 0 0 16px; color: var(--ink-soft); font-size: 14.5px; }
.start-card .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); font-size: 14px; }
.start-card .go .icon { width: 17px; height: 17px; transition: transform .16s; }
.start-card:hover .go .icon { transform: translateX(3px); }

/* ============ Предложить тему ============ */

.suggest-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  box-shadow: var(--shadow-sm);
}
.suggest-card p { margin: 0 0 18px; color: var(--ink-soft); font-size: 15.5px; }

.suggest-form { display: flex; gap: 12px; flex-wrap: wrap; }
.suggest-form textarea {
  flex: 1;
  min-width: 240px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  resize: vertical;
  min-height: 56px;
}
.suggest-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.suggest-form .btn { align-self: flex-end; }

/* ============ Футер ============ */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 44px 24px 120px;
  margin-top: 30px;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.footer-brand .brand-name { font-size: 22px; }
.footer-brand p { margin: 10px 0 0; color: var(--ink-soft); font-size: 14px; max-width: 320px; }

.footer-links { display: flex; gap: 32px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--ink-soft); font-size: 14px; }
.footer-col a:hover { color: var(--accent); }

.footer-disclaimer {
  max-width: var(--maxw);
  margin: 34px auto 0;
  padding: 0 24px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* ============ Обсуждение ============ */

.thread-head { padding: 6px 0 22px; }

.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); margin-bottom: 18px; font-weight: 600; }
.back-link:hover { color: var(--accent); }

.thread-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.18;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: .2px;
}

.thread-body {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  box-shadow: var(--shadow-sm);
}

.thread-author { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }

.avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  flex: none;
}

.author-name { font-weight: 700; font-size: 15px; }
.author-time { font-size: 13px; color: var(--ink-faint); }

.thread-text { font-size: 16.5px; line-height: 1.75; margin: 0 0 26px; white-space: pre-line; }

/* Реакции */
.reactions { display: flex; gap: 10px; flex-wrap: wrap; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.reaction {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 600;
  transition: all .16s;
}
.reaction:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.reaction:active { transform: scale(.97); }
.reaction .icon { width: 17px; height: 17px; }
.reaction .rcount { font-variant-numeric: tabular-nums; }
.reaction.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.thread-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Комментарии */
.comments { margin-top: 32px; }
.comments-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0 0 18px; }

.comment {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-head .avatar { width: 32px; height: 32px; font-size: 14px; }
.comment-name { font-weight: 700; font-size: 14px; }
.comment-time { font-size: 12.5px; color: var(--ink-faint); }
.comment-text { margin: 0; font-size: 15px; color: var(--ink); }

.reply-box { background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 20px; margin-top: 20px; box-shadow: var(--shadow-sm); }
.reply-box textarea { width: 100%; border: none; resize: vertical; min-height: 88px; font-family: var(--font-body); font-size: 15px; color: var(--ink); }
.reply-box textarea:focus { outline: none; }
.reply-box .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }

/* ============ Формы ============ */

.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); }

.field { margin-bottom: 22px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.field .hint { font-size: 12.5px; color: var(--ink-faint); font-weight: 400; margin-left: 4px; }

.field input[type="text"], .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.need-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.need-option { position: relative; }
.need-option input { position: absolute; opacity: 0; }
.need-option label {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  padding: 14px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all .16s; margin: 0;
}
.need-option label .icon { color: var(--ink-faint); }
.need-option input:checked + label { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.need-option input:checked + label .icon { color: var(--accent); }

.need-hint {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--lav);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.need-hint .icon { color: var(--accent); margin-top: 1px; width: 18px; height: 18px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.switch-row .info { display: flex; gap: 12px; align-items: center; }
.switch-row .info .icon { color: #6C5A9E; }
.switch-row strong { display: block; font-size: 14.5px; }
.switch-row span { font-size: 13px; color: var(--ink-faint); }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.check-row { display: flex; align-items: flex-start; gap: 11px; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 22px; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }

/* ============ Спасибо ============ */

.thanks { text-align: center; padding: 60px 24px; }
.thanks .big-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--lav); color: #6C5A9E; display: grid; place-items: center; margin: 0 auto 22px; }
.thanks .big-icon .icon { width: 36px; height: 36px; }
.thanks h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin: 0 0 10px; }
.thanks p { color: var(--ink-soft); margin: 0 0 26px; }

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

.rules-block { margin-bottom: 28px; }
.rules-block h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0 0 14px; }
.rules-block ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.rules-block li { font-size: 15px; color: var(--ink-soft); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.panel h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 0 0 14px; }

.safety { border-radius: var(--radius-lg); padding: 28px 30px; background: linear-gradient(135deg, var(--lav), var(--sage)); border: 1px solid var(--line); margin-top: 12px; }
.safety h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.safety h3 .icon { color: var(--accent); }
.safety p { margin: 0 0 8px; color: var(--ink-soft); font-size: 14.5px; }
.safety .crisis { margin-top: 14px; padding: 14px 16px; background: rgba(255,255,255,.7); border-radius: var(--radius-md); font-size: 13.5px; }

/* ============ Рецепт / гороскоп ============ */

.recipe { margin: 6px 0 26px; }
.recipe-media { border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line); }
.recipe-media svg { width: 100%; height: auto; display: block; }
.recipe-meta { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.recipe-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-soft); background: var(--bg-2); padding: 6px 13px; border-radius: 999px; font-weight: 600; }
.recipe-chip .icon { width: 16px; height: 16px; color: var(--accent); }
.recipe-h { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 0 0 12px; }
.ingredients { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.ingredients li { display: flex; gap: 11px; font-size: 15px; color: var(--ink); }
.ingredients li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5D7455; margin-top: 8px; flex: none; }
.steps { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 11px; }
.steps li { font-size: 15px; color: var(--ink-soft); }
.steps li::marker { color: var(--accent); font-weight: 700; }

.horo-intro { margin: 0 0 20px; font-size: 15.5px; color: var(--ink-soft); }
.signs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.sign { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 13px 15px; background: var(--bg-2); transition: transform .14s, box-shadow .14s; }
.sign:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.sign-name { display: block; font-weight: 700; font-size: 14.5px; color: var(--accent); margin-bottom: 4px; }
.sign-text { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

/* ============ Баннер категории ============ */

.cat-banner { margin-top: 0; padding: 26px 28px; background: var(--lav); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.cat-banner-title { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 8px 0 6px; color: var(--ink); }
.cat-banner-desc { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ============ Пустое / бейджи / прочее ============ */

.empty { text-align: center; padding: 48px 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--card); }
.empty-art { width: 70px; height: 70px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--lav); color: #6C5A9E; }
.empty-art .icon { width: 32px; height: 32px; }
.empty h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.empty p { margin: 0 0 18px; color: var(--ink-faint); font-size: 14.5px; }

.cat.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.badge-editor { background: var(--lav); color: #6C5A9E; }
.badge-moder { background: var(--sage); color: #5D7455; }

.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 45; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink-soft); display: grid; place-items: center; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .25s, transform .25s, color .16s, border-color .16s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

@keyframes heartbeat { 0%,100% { transform: scale(1); } 25% { transform: scale(1.22); } 40% { transform: scale(1); } 60% { transform: scale(1.14); } }
.reaction .icon { transition: transform .2s; }
.reaction:hover .icon { transform: scale(1.15); }
.reaction[data-reaction="Обнимаю"]:hover .icon { animation: heartbeat .7s ease; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(16px); background: var(--ink); color: #fff; display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow-md); opacity: 0; transition: opacity .28s, transform .28s; z-index: 99; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .icon { width: 18px; height: 18px; color: #F0A9BD; }

/* ============ Параллакс-фон ============ */

.bg-art { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; will-change: transform; }
.bg-photo { position: absolute; top: -20%; left: -10%; width: 120%; height: 140%; will-change: transform; }
.bg-photo svg { width: 100%; height: 100%; display: block; }

/* Зернистая текстура по всему экрану */
.texture {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ============ FAB ============ */

.fab {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 50;
  display: none; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #8A1E3A, #6E1830); color: #fff; border: none; border-radius: 999px;
  padding: 15px 28px; font-size: 15px; font-weight: 700; font-family: var(--font-body);
  box-shadow: 0 14px 32px -10px rgba(110, 24, 48, 0.6);
}

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

@media (max-width: 1000px) {
  .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .new-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .welcome { flex-direction: column; align-items: flex-start; padding: 40px 28px; }
  .welcome-art { grid-template-columns: repeat(4, 76px); }
  .welcome-art .tile { width: 76px; height: 76px; }
  .welcome-art .tile.t2, .welcome-art .tile.t4 { transform: translateY(8px); }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .start-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner { padding: 12px 16px; gap: 12px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 20px; }
  .search { display: none; }
  .header-actions .btn-primary { display: none; }

  .page { padding: 20px 16px 120px; }

  .welcome { padding: 30px 22px; }
  .welcome h1 { font-size: 34px; }
  .welcome-art { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 18px; }
  .welcome-art .tile { width: 100%; height: 64px; border-radius: 18px; }
  .welcome-art .tile.t2, .welcome-art .tile.t4 { transform: translateY(6px); }

  .section-title { font-size: 25px; }
  .section-head { margin-top: 32px; }

  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cat { padding: 13px 12px; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
  .cat-icon { width: 34px; height: 34px; border-radius: 11px; flex: none; }
  .cat-icon .icon { width: 17px; height: 17px; }
  .cat-count { font-size: 11.5px; flex: none; width: 100%; order: 3; margin-top: -4px; padding-left: 44px; }
  .cat-name { flex: 1 1 calc(100% - 44px); }

  .new-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

  .weekly { padding: 32px 24px; }
  .values { padding: 32px 24px; }

  .need-options { grid-template-columns: 1fr; }
  .thread-title { font-size: 26px; }
  .thread-body { padding: 22px 18px; }
  .signs { grid-template-columns: 1fr; }

  .to-top { right: 16px; bottom: 82px; }
  .fab { display: inline-flex; }
}

@media (min-width: 641px) {
  .fab { display: none; }
}

/* ============ Сохранённые / поиск-подсказки ============ */

.topic-card { position: relative; }

.save-btn {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-faint);
  display: grid;
  place-items: center;
  padding: 0;
  transition: all .16s;
}
.save-btn .icon { width: 17px; height: 17px; }
.save-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.save-btn.saved { background: var(--accent); border-color: var(--accent); color: #fff; }

.saved-nav span { display: inline; }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 60;
  display: none;
}
.search-results.open { display: block; }

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--accent-soft); }
.search-result.no-hover { cursor: default; color: var(--ink-faint); }
.search-result.no-hover:hover { background: transparent; }
.search-result .icon { width: 16px; height: 16px; color: var(--ink-faint); flex: none; }
.search-result .r-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result .r-cat { font-size: 12px; color: var(--ink-faint); flex: none; }

mark { background: transparent; color: var(--accent); font-weight: 700; }

@media (max-width: 640px) {
  .saved-nav span { display: none; }
  .saved-nav { padding: 11px 13px; }
}

.chip-room { background: var(--lav); color: #6C5A9E; }

/* ============ Ответы на комментарии ============ */

.comment-actions { display: flex; gap: 16px; margin-top: 10px; }
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 4px 0;
  transition: color .16s;
}
.act-btn:hover { color: var(--accent); }
.act-btn .icon { width: 15px; height: 15px; }

.replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment.reply {
  background: #FBF1F3;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 0;
}

.inline-reply { margin-top: 12px; display: flex; gap: 8px; }
.inline-reply textarea {
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  resize: vertical;
  min-height: 40px;
}
.inline-reply textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inline-reply .btn { padding: 9px 16px; font-size: 14px; }

/* ============ Личка ============ */

.dm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 53, 64, 0.28);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 16px;
}
.dm-panel {
  width: 360px;
  max-width: 100%;
  height: min(520px, calc(100vh - 40px));
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dm-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dm-head .avatar { width: 34px; height: 34px; font-size: 14px; }
.dm-name { flex: 1; font-weight: 700; font-size: 15px; }
.dm-close { border: none; background: none; font-size: 22px; line-height: 1; color: var(--ink-faint); cursor: pointer; padding: 0 4px; }
.dm-close:hover { color: var(--ink); }
.dm-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dm-msg { max-width: 80%; align-self: flex-start; }
.dm-msg.mine { align-self: flex-end; }
.dm-msg-text { background: var(--lav); padding: 10px 14px; border-radius: 16px 16px 16px 4px; font-size: 14px; color: var(--ink); }
.dm-msg.mine .dm-msg-text { background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; }
.dm-msg-time { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }
.dm-msg.mine .dm-msg-time { text-align: right; }
.dm-empty { text-align: center; color: var(--ink-faint); font-size: 13.5px; padding: 22px; }
.dm-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.dm-input textarea {
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  resize: none;
  min-height: 42px;
  max-height: 90px;
}
.dm-input textarea:focus { outline: none; border-color: var(--accent); }
.dm-input .btn { padding: 10px 16px; font-size: 14px; }
.dm-inbox-list { overflow-y: auto; }
.dm-inbox-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; border-bottom: 1px solid var(--line); }
.dm-inbox-item:hover { background: var(--accent-soft); }
.dm-inbox-meta { flex: 1; min-width: 0; }
.dm-inbox-name { font-weight: 700; font-size: 14px; }
.dm-inbox-last { font-size: 13px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-label { display: inline; }

@media (max-width: 640px) {
  .dm-label { display: none; }
  .dm-inbox-btn { padding: 11px 13px; }
  .dm-panel { width: 100%; }
}

/* ============ Онлайн + переходы ============ */

body.page-in { animation: pageIn .45s ease both; }
body.page-out { animation: pageOut .22s ease both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pageOut { to { opacity: 0; } }

/* ============ Теги / модерация / тёмный режим ============ */

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 13px;
  transition: all .16s;
}
.tag-chip:hover { color: var(--accent); border-color: var(--accent); }
.tag-chip::before { content: "#"; color: var(--accent); margin-right: 3px; }

.moderation-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--lav);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #6C5A9E;
}
.moderation-note .icon { width: 17px; height: 17px; }

.theme-btn { padding: 11px 13px; }
.theme-btn .icon { width: 18px; height: 18px; }

[data-theme="dark"] {
  --bg: #241F24;
  --bg-2: #3B2F35;
  --card: #2E2830;
  --lav: #3A3349;
  --sage: #35402F;
  --ink: #F1E7EB;
  --ink-soft: #BCAFB5;
  --ink-faint: #8F8289;
  --accent: #E05A7E;
  --accent-hover: #EF7194;
  --accent-soft: #4A2633;
  --line: #443943;
  --line-strong: #54444E;
}
[data-theme="dark"] .bg-art { display: none; }
[data-theme="dark"] .weekly { background: #1B1720; }
[data-theme="dark"] .cat.cbg-rose { background: #462838; }
[data-theme="dark"] .cat.cbg-lav { background: #37304A; }
[data-theme="dark"] .cat.cbg-sage { background: #33402F; }
[data-theme="dark"] .cat.cbg-berry { background: #46322A; }
[data-theme="dark"] .cat-icon { background: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .cat-banner { background: linear-gradient(135deg, #3A3349, #3B2F35); }
[data-theme="dark"] .cat-banner-title { color: #E9A9C4; }
[data-theme="dark"] .comment.reply { background: #332C33; }
[data-theme="dark"] .btn-light { color: #3D3540; }
[data-theme="dark"] .toast { background: #3B2F35; color: #fff; }
[data-theme="dark"] .value-pill { background: rgba(46, 40, 48, 0.7); }
[data-theme="dark"] .need-hint, [data-theme="dark"] .moderation-note { color: #CBB8E8; }
[data-theme="dark"] .field input[type="text"],
[data-theme="dark"] .field textarea,
[data-theme="dark"] .field select,
[data-theme="dark"] .search input,
[data-theme="dark"] .reply-box textarea,
[data-theme="dark"] .inline-reply textarea,
[data-theme="dark"] .dm-input textarea,
[data-theme="dark"] .suggest-form textarea { background: #241F24; }

.rules-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.rule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 260px;
}
.rule-list li {
  display: flex;
  gap: 11px;
  font-size: 15px;
  color: var(--ink-soft);
  align-items: center;
}
.rule-list .icon { color: var(--accent); width: 19px; height: 19px; flex: none; }

.avatar-icon .icon { width: 22px; height: 22px; color: #fff; }

.avatar-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.avatar-option {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  padding: 0;
  transition: all .16s;
}
.avatar-option .icon { width: 21px; height: 21px; }
.avatar-option:hover { border-color: var(--accent); color: var(--accent); }
.avatar-option.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ============ Тесты и квиз ============ */

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

/* Каталог всех тестов — горизонтальные карточки в одну колонку */
.tests-catalog { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.tests-catalog .test-card { flex-direction: row; align-items: flex-start; padding: 20px 22px; }
.tests-catalog .test-icon { width: 52px; height: 52px; border-radius: 16px; flex: none; }
.tests-catalog .test-icon .icon { width: 26px; height: 26px; }
.tests-catalog .test-body { gap: 7px; }
.test-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.test-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.test-icon {
  width: 48px; height: 48px;
  border-radius: 15px;
  display: grid; place-items: center; flex: none;
}
.test-icon .icon { width: 24px; height: 24px; }
.test-icon.ti-rose { background: var(--accent-soft); color: var(--accent); }
.test-icon.ti-lav { background: var(--lav); color: #6C5A9E; }
.test-icon.ti-sage { background: var(--sage); color: #5D7455; }
.test-icon.ti-berry { background: var(--bg-2); color: var(--accent-hover); }
.test-body { display: flex; flex-direction: column; gap: 6px; }
.test-cat { font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-faint); }
.test-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.25; }
.test-desc { font-size: 13.5px; color: var(--ink-soft); }
.test-card .go { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); font-size: 14px; margin-top: 4px; }
.test-card .go .icon { width: 16px; height: 16px; }

.quiz { max-width: 640px; margin: 0 auto; }
.quiz-head .chip { display: inline-flex; margin-bottom: 14px; }
.quiz-sub { color: var(--ink-soft); margin: -6px 0 0; }
.quiz-intro-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.quiz-intro-icon {
  width: 72px; height: 72px;
  border-radius: 22px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  margin: 0 auto 16px;
}
.quiz-intro-icon .icon { width: 34px; height: 34px; }
.quiz-intro-card p { color: var(--ink-soft); margin: 0 0 22px; }

.quiz-date-input {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  text-align: center;
}
.quiz-date-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.quiz-progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 8px 0 10px; }
.quiz-progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.quiz-count { font-size: 13px; color: var(--ink-faint); margin-bottom: 18px; }
.quiz-question { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.3; margin: 0 0 22px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  transition: all .16s;
}
.quiz-option:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.quiz-result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 30px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.quiz-result-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--lav);
  color: #6C5A9E;
  display: grid; place-items: center;
  margin: 0 auto 14px;
}
.quiz-result-icon .icon { width: 34px; height: 34px; }
.quiz-result-label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
.quiz-result-title { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin: 8px 0 14px; }
.quiz-result-text { color: var(--ink-soft); font-size: 16px; line-height: 1.6; margin: 0 0 24px; }
.quiz-result-section {
  margin: 0 0 20px;
  text-align: left;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.quiz-result-sec-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
.quiz-result-sec-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 6px 0 8px; }
.quiz-result-sec-text { color: var(--ink-soft); font-size: 15px; line-height: 1.65; margin: 0; }
.quiz-disclaimer { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin-top: 18px; }

@media (max-width: 820px) {
  .tests-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .tests-grid { gap: 12px; }
  /* Вертикальные карточки тестов — как карточки тем на главной */
  .test-card { flex-direction: column; align-items: stretch; padding: 18px; gap: 14px; }
  .test-icon { width: 52px; height: 52px; border-radius: 16px; }
  .test-icon .icon { width: 26px; height: 26px; }
  .test-title { font-size: 17px; }
  .test-desc { font-size: 13.5px; line-height: 1.55; }
}

[data-theme="dark"] .cat-count { background: rgba(255, 255, 255, 0.12); color: var(--ink-soft); }

/* ============ Читаемость заголовков ============ */
.section-title, .thread-title, .topic-title, .quiz-question, .quiz-result-title,
.step h3, .start-card h3, .cat-banner-title, .values-text, .thanks h2,
.panel h3, .recipe-h, .comments-title, .test-title, .brand-name,
.welcome h1, .weekly h2 {
  letter-spacing: 0.4px;
  line-height: 1.4;
}
.welcome h1 { letter-spacing: 0.3px; line-height: 1.18; }
.weekly h2 { letter-spacing: 0.3px; line-height: 1.25; }
.values-text { line-height: 1.35; }

/* ============ Бордовый цвет заголовков ============ */

.section-title, .thread-title, .topic-title, .quiz-question, .quiz-result-title,
.step h3, .start-card h3, .cat-banner-title, .values-text, .thanks h2,
.panel h3, .recipe-h, .comments-title, .test-title, .welcome h1 {
  color: var(--heading);
}

[data-theme="dark"] { --heading: #F1E7EB; }

/* ============ Появление секций при скролле ============ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.revealed { opacity: 1; transform: none; }

/* Компактные иконки в шапке */
.icon-btn { padding: 11px 13px; }
.icon-btn .icon { width: 19px; height: 19px; }

/* ============ Бегущая строка ============ */
.ticker {
  margin: 26px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(200, 63, 103, 0.10), rgba(138, 116, 184, 0.12), rgba(111, 138, 102, 0.10));
  border: 1px solid var(--line);
  position: relative;
}
.ticker::before, .ticker::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 52px;
  z-index: 2;
  pointer-events: none;
}
.ticker::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.ticker::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.ticker-inner {
  display: flex;
  gap: 34px;
  width: max-content;
  padding: 10px 26px;
  animation: tickerMove 38s linear infinite;
  white-space: nowrap;
}
/* На наведении строка замирает, чтобы по ссылке можно было попасть; курсор убран — снова крутится */
.ticker:hover .ticker-inner { animation-play-state: paused; }
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
}
.ticker-item:hover { color: var(--accent); }
.ticker-item .icon { width: 16px; height: 16px; color: var(--accent); flex: none; }
.ticker-item .t-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--lav);
  flex: none;
}
.ticker-tests .ticker-inner { animation-duration: 52s; }
@keyframes tickerMove {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (max-width: 640px) {
  .ticker { margin: 20px 0 4px; }
  .ticker::before, .ticker::after { width: 28px; }
  .ticker-inner { gap: 24px; padding: 9px 18px; animation-duration: 42s; }
  .ticker-tests .ticker-inner { animation-duration: 46s; }
}

/* ============ Личный кабинет ============ */

.cab-head { padding: 6px 0 20px; }
.cab-sub { color: var(--ink-soft); margin: -6px 0 0; }
.cab-section { margin-bottom: 18px; }
.cab-section h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 0 0 14px; }
.cab-list { display: flex; flex-direction: column; gap: 12px; }
.cab-list .topic-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.cab-list .topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--accent); }
.cab-empty { color: var(--ink-faint); font-size: 14px; padding: 8px 0; }
.notif-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color .16s, box-shadow .16s;
}
.notif-item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.notif-item .icon { color: var(--accent); flex: none; margin-top: 3px; }
.notif-text { display: block; font-size: 14.5px; color: var(--ink); }
.notif-time { display: block; font-size: 12px; color: var(--ink-faint); margin-top: 3px; }

/* ============ Чаты по городам ============ */

.dm-inbox-scroll { flex: 1; overflow-y: auto; }
.dm-inbox-scroll .dm-inbox-list { overflow: visible; }
.dm-inbox-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  padding: 14px 16px 6px;
}
.dm-city-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--lav);
  color: #6C5A9E;
  display: grid;
  place-items: center;
  flex: none;
}
.dm-city-icon .icon { width: 17px; height: 17px; }
.dm-msg-author { font-size: 11.5px; color: var(--ink-faint); margin-bottom: 2px; }

/* ============ Визуальные акценты ============ */

/* Точка-акцент у заголовков секций */
.section-title::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--heading);
  margin-right: 11px;
  vertical-align: 3px;
}

/* Подсветка карточек тем при наведении — тёплый бордовый отблеск */
.new-grid .topic-card:hover,
.cab-list .topic-card:hover {
  border-color: #D9A4B4;
  box-shadow: 0 6px 18px rgba(61, 53, 64, 0.07), 0 22px 44px -20px rgba(126, 28, 53, 0.42);
}

/* Пройденные тесты в кабинете */
.test-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color .16s, box-shadow .16s;
}
.test-result-item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.test-result-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--lav);
  color: #6C5A9E;
  display: grid;
  place-items: center;
  flex: none;
}
.test-result-icon .icon { width: 20px; height: 20px; }
.test-result-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.test-result-title { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.test-result-sub { font-size: 13px; color: var(--ink-soft); }
.test-result-date { font-size: 12px; color: var(--ink-faint); flex: none; }

.cab-hint { margin: -6px 0 14px; font-size: 13px; color: var(--ink-faint); }

/* Бегущая строка тестов */
.ticker-tests { margin-top: 26px; margin-bottom: 6px; }

/* Кнопка «Показать ещё» в тестах — по центру, как в «Новое в Между нами» */
.tests-more { text-align: center; margin-top: 20px; }

/* Компактная вкладка-ссылка в кабинете */
.cab-link-row {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  padding: 4px 0;
  transition: opacity .16s;
}
.cab-link-row:hover { opacity: 0.75; }
.cab-link-icon {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--rose-soft, #F8E1E6);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: none;
}
.cab-link-icon .icon { width: 20px; height: 20px; }
.cab-link-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cab-link-title { font-weight: 700; font-size: 15.5px; }
.cab-link-sub { font-size: 13px; color: var(--ink-faint); }
.cab-link-count {
  min-width: 28px; height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--lav);
  color: #6C5A9E;
  font-size: 12.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}
.cab-link-arrow { color: var(--ink-faint); flex: none; display: grid; place-items: center; }
.cab-link-arrow .icon { width: 18px; height: 18px; }

/* ============ Живые микро-эффекты ============ */

/* Подпрыгивание иконки категории при наведении */
.cat:hover .cat-icon { animation: iconBounce .4s ease; }
@keyframes iconBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1.05); }
}

/* Блеск на основных кнопках */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -110%;
  width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
}
.btn-primary:hover::after { left: 140%; }

/* ============ Живой hero ============ */

.welcome-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: floatParticle 6s ease-in-out infinite;
}
.p1 { width: 9px; height: 9px; background: var(--lav); left: 15%; top: 22%; }
.p2 { width: 6px; height: 6px; background: var(--accent); left: 57%; top: 12%; animation-delay: 1.2s; }
.p3 { width: 11px; height: 11px; background: var(--sage); right: 32%; bottom: 18%; animation-delay: 2.1s; }
.p4 { width: 7px; height: 7px; background: var(--bg-2); left: 46%; bottom: 28%; animation-delay: 3s; }
.p5 { width: 5px; height: 5px; background: var(--accent); right: 11%; top: 38%; animation-delay: 1.7s; }

@keyframes floatParticle {
  0%, 100% { transform: translateY(0); opacity: .45; }
  50% { transform: translateY(-15px); opacity: .9; }
}

/* Градиентное акцентное слово в hero */
.welcome h1 .accent {
  background: linear-gradient(135deg, #7E1C35, #C83F67);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Свечение кнопок при наведении */
.btn-primary:hover {
  box-shadow: 0 14px 34px -10px rgba(126, 28, 53, 0.6), 0 0 22px -4px rgba(200, 63, 103, 0.35);
}

@media (max-width: 640px) {
  .p1, .p2, .p4 { display: none; }
}

/* ============ Анимация перехода в тестах ============ */
.quiz { animation: quizIn .32s ease; }
@keyframes quizIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ============ Скелетоны ============ */
.skeleton {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sk-line {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #F1E5E8 25%, #FBF3F5 40%, #F1E5E8 60%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.sk-line.short { width: 40%; }
.sk-line.title { width: 72%; height: 18px; }
.sk-line.mid { width: 92%; height: 10px; }
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Бейдж непрочитанных сообщений */
.dm-inbox-btn { position: relative; }
.cabinet-btn { position: relative; }
.dm-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

/* Вход / регистрация */
.auth-panel { height: auto; max-height: 90vh; }
.auth-body { padding: 16px; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--ink-soft); margin-top: 14px; }
.auth-switch a { color: var(--accent); font-weight: 600; cursor: pointer; }
.auth-msg { color: #C0392B; font-size: 13px; margin-top: 10px; text-align: center; }
.auth-btn { display: inline-flex; align-items: center; gap: 7px; }
.auth-btn .icon { width: 18px; height: 18px; }
.auth-label { display: inline; }
@media (max-width: 640px) { .auth-label { display: none; } .auth-btn { padding: 11px 13px; } }

/* ============ Компактная шапка на мобильных ============ */
@media (max-width: 640px) {
  .header-inner { gap: 6px; padding: 10px 10px; }
  .brand { gap: 7px; max-width: 44%; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .brand-mark .icon { width: 17px; height: 17px; }
  .brand-name { font-size: 15px; }
  .header-actions { gap: 4px; margin-left: auto; }
  .header-actions .icon-btn,
  .header-actions .theme-btn,
  .header-actions .auth-btn,
  .header-actions .saved-nav,
  .header-actions .btn-back { padding: 10px; min-height: 40px; display: inline-flex; align-items: center; }
  .header-actions .icon-btn .icon,
  .header-actions .theme-btn .icon,
  .header-actions .auth-btn .icon { width: 17px; height: 17px; }
  .header-actions .btn { flex: none; }
  .header-actions .btn-cancel { display: none; } /* на мобиле кнопку «Отмена» прячет FAB */
  .header-actions .btn-back { padding: 11px; }
  .header-actions .btn-back .btn-label { display: none; }
}

/* Фото в теме */
.image-preview { margin-top: 10px; }
.image-preview img { max-width: 100%; max-height: 200px; border-radius: var(--radius-sm); }
.thread-image { margin: 0 0 20px; }
.thread-image img { max-width: 100%; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
