/* ===== Темы (ТЗ п.7): все цвета только через переменные ===== */
:root,
[data-theme="dark"] {
  --bg: #0f0d14;
  --surface: #1a1622;
  --surface-2: #241e2f;
  --text: #f2eef7;
  --text-muted: #a99fb8;
  --accent: #e0457b;
  --accent-hover: #f05a8d;
  --danger: #ef4444;
  --danger-hover: #f87171;
  --success: #34d399;
  --border: #2f2840;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #faf7fc;
  --surface: #ffffff;
  --surface-2: #f1ebf6;
  --text: #1d1824;
  --text-muted: #6b6178;
  --accent: #c92f66;
  --accent-hover: #b0265a;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --success: #059669;
  --border: #e3dbea;
  --shadow: 0 10px 30px rgba(60, 30, 80, 0.12);
  color-scheme: light;
}

/* ===== Базовые стили ===== */
/* Флаги стран (эмодзи 🇦🇹): Windows их не рисует — шрифт только с флагами (Twemoji, CC BY 4.0, через country-flag-emoji-polyfill, MIT).
   unicode-range — браузер скачает его, только когда на странице встретится флаг. */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("/fonts/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: "Twemoji Country Flags", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

main {
  flex: 1;
}

a {
  color: inherit;
}

p a,
label a,
.form__aside a,
.auth__switch a,
.dev-hint a,
.legal a {
  color: var(--accent);
}

[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.page {
  padding-block: 48px 72px;
}

.muted {
  color: var(--text-muted);
}

/* ===== Кнопки ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--accent);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--surface-2);
  color: var(--text);
}

.btn--lg {
  padding: 14px 28px;
  font-size: 1.05rem;
}

.btn--block {
  width: 100%;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}

.link-button:disabled {
  color: var(--text-muted);
  cursor: default;
}

/* ===== Шапка ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 65px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* Шапка во всю ширину: логотип у левого края, разделы — у правого */
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 24px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  text-decoration: none;
}

.logo span {
  margin-left: 6px;
  font-size: 0.75rem;
  color: var(--accent);
  vertical-align: super;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Переключатель языка */
.lang-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 999px;
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.lang-switch__btn img {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.lang-switch__btn:hover {
  color: var(--text);
}

.lang-switch__btn.is-active {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--text);
}

/* ===== Hero ===== */
.hero {
  padding: 96px 0 72px;
  text-align: center;
}

.hero__inner h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
}

.hero__lead {
  max-width: 620px;
  margin: 0 auto 32px;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ===== Преимущества ===== */
.features {
  padding-bottom: 96px;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.feature {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.feature__icon {
  font-size: 2rem;
}

.feature h3 {
  margin: 12px 0 8px;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
}

/* ===== Страницы входа/регистрации ===== */
.auth {
  display: flex;
  justify-content: center;
  padding: 48px 20px 72px;
}

.auth__card {
  width: 100%;
  max-width: 440px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.auth__card h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
}

.auth__switch {
  margin: 20px 0 0;
  text-align: center;
  color: var(--text-muted);
}

/* ===== Формы ===== */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > label {
  font-weight: 600;
  font-size: 0.95rem;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

.field__label {
  font-weight: 600;
  font-size: 0.95rem;
}

.field__hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.field__error {
  color: var(--danger);
  font-size: 0.85rem;
}

.field__warning {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.field input[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}

.field__error:empty {
  display: none;
}

.field--invalid input:not([type="checkbox"]) {
  border-color: var(--danger);
}

.field--check > label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  cursor: pointer;
}

.field--check input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.input--code {
  font-size: 1.5rem !important;
  letter-spacing: 0.5em;
  text-align: center;
}

.form__alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.form__alert--error {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  color: var(--danger);
}

.form__alert--success {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
}

.form__alert--info {
  background: var(--surface-2);
  color: var(--text-muted);
}

.form__aside {
  margin: -4px 0 0;
  text-align: right;
  font-size: 0.9rem;
}

.form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Переключатель Email / Phone */
.segmented {
  display: flex;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 999px;
}

.segmented label {
  flex: 1;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  padding: 8px;
  border-radius: 999px;
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.segmented input:checked + span {
  background: var(--accent);
  color: #fff;
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dev-hint {
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== Личный кабинет ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.card--danger {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0 0 20px;
}

.details dt {
  color: var(--text-muted);
}

.details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Баннер-призыв (например, «Заполните профиль») */
.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 20px;
  padding: 16px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.banner p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.banner--cta {
  padding: 24px;
}

.banner--cta strong {
  font-size: 1.3rem;
}

/* Обязательные поля — звёздочка после подписи */
.field--required > label::after,
.field--required > .field__label::after,
.is-required::after {
  content: " *";
  color: var(--accent);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.9rem;
}

/* Страна + город (профиль): на широком экране рядом, на узком — друг под другом */
.place-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.city-picker {
  position: relative;
}

.city-picker[hidden] {
  display: none;
}

.city-picker__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.field .city-picker input {
  padding-left: 40px;
}

.city-picker__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.city-picker__list li {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.city-picker__list li:hover,
.city-picker__list li.is-active {
  background: var(--surface-2);
}

.city-picker__list li[aria-selected="true"] {
  color: var(--accent);
  font-weight: 600;
}

.city-picker__list .city-picker__empty {
  color: var(--text-muted);
  cursor: default;
}

.geo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.geo__status {
  color: var(--success);
  font-size: 0.9rem;
}

.card--accent {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.note {
  margin: 12px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.note--warning {
  color: var(--danger);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== Профиль ===== */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

.profile-main,
.profile-main form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
}

.profile-main .card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-main .card h2,
.profile-main .card > p {
  margin: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.label-button.is-disabled,
label.btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Чипы с выбором (checkbox) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chip-static {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.82rem;
}

.chip input:disabled + span {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Интересы и «Подробнее» */
.interest-count {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.interest-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.interest-group h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.interest-answers {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.interest-answer {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.interest-answer label {
  font-weight: 600;
}

.preview__more {
  border: 1px solid var(--border);
  border-radius: 12px;
}

.preview__more summary {
  padding: 8px 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.preview__more dl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0 12px 12px;
}

.preview__more dt {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.preview__more dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Цвета */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
  transition: transform 0.15s;
}

.swatch[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--accent);
  transform: scale(1.1);
}

/* Фетиши */
.card--kinks {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.kinks {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.kinks:disabled {
  opacity: 0.45;
}

/* Переключатель */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch__track {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.15s;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.switch input:checked + .switch__track {
  background: var(--accent);
}

.switch input:checked + .switch__track::after {
  transform: translateX(20px);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Сетка фото */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.photo-grid.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.photo {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface-2);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Перетаскивание фото (смена порядка): мышью или долгим нажатием пальцем */
.photo:not(.photo--empty) {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none; /* долгое нажатие не открывает меню картинки */
}

.photo-grid.is-sorting,
.photo-grid.is-sorting .photo {
  cursor: grabbing;
}

.photo.is-dragging {
  z-index: 5;
  transform: translate(var(--drag-x, 0), var(--drag-y, 0)) scale(1.06);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  opacity: 0.9;
  pointer-events: none; /* чтобы под ним находилась ячейка-цель */
}

.photo.is-drop-target {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.photo--empty button {
  width: 100%;
  height: 100%;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: transparent;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
}

.photo--empty button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.photo__badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Анонимный режим: 🛡 — ИИ-версия готова, ⏳ — ещё нет */
.photo__ai {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  font-size: 0.85rem;
}

/* Выбор «Оригиналы / Анонимные фото» в профиле */
.photo-mode {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.photo-mode h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.photo-mode__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.photo-mode__option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
}

.photo-mode__option:has(input:checked) {
  border-color: var(--accent);
}

.photo-mode__option input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.photo-mode__option span {
  display: flex;
  flex-direction: column;
}

.photo-mode__option small {
  color: var(--text-muted);
}

/* «Лицо скрыто» недоступно без открытых фетишей */
.photo-mode__option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.photo__actions {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  gap: 4px;
}

.photo__actions button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}

.photo__actions button:hover {
  background: var(--accent);
}

/* Панель сохранения прилипает к низу экрана */
.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.save-bar .form__alert {
  flex-basis: 100%;
}

.save-bar__status {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.save-bar__status--ok {
  color: var(--success);
}

/* Предпросмотр */
.profile-preview {
  position: sticky;
  top: 88px;
}

.profile-preview h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--text-muted);
}

.preview-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.preview__photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  color: var(--text-muted);
}

.preview__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-count {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--danger);
}

.photo-count--ok {
  color: var(--success);
}

/* ===== Карусель фото (js/photo-carousel.js) ===== */
.carousel {
  position: relative;
  overflow: hidden;
  user-select: none;
}

.carousel__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__bars {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
  pointer-events: none;
}

.carousel__bars span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}

.carousel__bars span.is-active {
  background: #fff;
}

/* Невидимые половины фото: левая — назад, правая — вперёд */
.carousel__nav {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 50%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.carousel__nav--prev {
  left: 0;
}

.carousel__nav--next {
  right: 0;
}

.carousel__nav.is-edge {
  cursor: default;
}

/* Стрелка-подсказка при наведении */
.carousel__nav::after {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.2rem;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.15s;
}

.carousel__nav--prev::after {
  content: "‹";
  left: 10px;
}

.carousel__nav--next::after {
  content: "›";
  right: 10px;
}

.carousel__nav:hover:not(.is-edge)::after,
.carousel__nav:focus-visible:not(.is-edge)::after {
  opacity: 1;
}

.preview__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
}

.preview__body h3,
.preview__body h4,
.preview__body p {
  margin: 0;
}

.preview__body h3 {
  font-size: 1.4rem;
}

.preview__body h4 {
  margin-top: 6px;
  font-size: 0.9rem;
}

.preview__bio {
  white-space: pre-line;
}

.preview__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Камера */
.camera {
  width: min(560px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
}

.camera::backdrop {
  background: rgba(5, 3, 8, 0.8);
}

.camera h2 {
  margin: 0 0 16px;
}

.camera__frame {
  overflow: hidden;
  border-radius: 16px;
  background: #000;
}

.camera__frame video,
.camera__frame canvas {
  display: block;
  width: 100%;
  height: auto;
}

.camera__actions {
  margin-top: 16px;
}

@media (max-width: 960px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-preview {
    position: static;
    max-width: 400px;
  }
}

@media (max-width: 560px) {
  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===== Правовые страницы ===== */
.legal {
  max-width: 760px;
}

.legal h2 {
  margin-top: 32px;
  font-size: 1.2rem;
}

.legal li {
  margin-bottom: 6px;
}

/* Показываем только версию документа на текущем языке */
.legal-doc {
  display: none;
}

html[lang="en"] .legal-doc[lang="en"],
html[lang="ru"] .legal-doc[lang="ru"],
html[lang="de"] .legal-doc[lang="de"],
html[lang="fr"] .legal-doc[lang="fr"],
html[lang="es"] .legal-doc[lang="es"] {
  display: block;
}

.legal__draft {
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-weight: 600;
}

/* ===== Dev outbox ===== */
.outbox__item {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.outbox__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.outbox__subject {
  margin: 4px 0 8px;
  font-weight: 700;
}

.outbox__body {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.95rem;
}

/* ===== Подвал ===== */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

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

.footer__links a {
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--accent);
}

/* Источники данных (лицензия CC BY требует указать) — мелко, на всю ширину подвала */
.footer__credits {
  flex-basis: 100%;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.footer__credits a:hover {
  color: var(--accent);
}

/* Пока js/i18n.js не перевёл страницу — не показываем её (см. js/boot.js) */
.i18n-pending body {
  visibility: hidden;
}

/* ===== 18+ барьер ===== */
/* Пока возраст не подтверждён, контент страницы скрыт полностью (см. js/boot.js). */
.age-locked body {
  overflow: hidden;
}

.age-locked body > :not(.age-gate) {
  visibility: hidden;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: var(--bg);
}

.age-gate__card {
  max-width: 520px;
  padding: 40px 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.age-gate__lang {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.age-gate__lang .lang-switch {
  flex-wrap: wrap;
  justify-content: center;
}

.age-gate__badge {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
}

.age-gate__card h2 {
  margin: 16px 0 12px;
  font-size: 1.6rem;
}

.age-gate__card p {
  color: var(--text-muted);
}

.age-gate__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.age-gate__legal {
  margin: 20px 0 0;
  font-size: 0.85rem;
}

.age-gate__legal a {
  color: var(--text-muted);
}

/* На узких экранах шапка может переноситься на вторую строку; .lang-switch здесь — переключатель на 18+ барьере */
@media (max-width: 860px) {
  .header__inner {
    flex-wrap: wrap;
    height: auto;
    padding-block: 10px;
    row-gap: 10px;
  }

  .lang-switch {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .nav {
    gap: 6px;
  }

  .nav .btn:not(.btn--icon) {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .auth__card {
    padding: 24px 20px;
  }
}

/* ===== Навигация залогиненного пользователя (js/main.js) ===== */
.nav__link {
  position: relative;
  gap: 6px;
}

.nav__link.is-active {
  border-color: var(--accent);
}

.nav__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* ===== Окна (dialog) ===== */
/* Отступы — у .modal__body, чтобы клик по самому dialog означал клик по фону (закрытие). */
.modal {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(5, 3, 8, 0.75);
}

.modal__body {
  position: relative;
  max-height: calc(100dvh - 34px);
  padding: 24px;
  overflow-y: auto;
}

.modal h2 {
  margin: 0 0 16px;
}

.modal__body > .form__row {
  margin-top: 20px;
}

.modal__close {
  position: absolute;
  top: 34px;
  right: 34px;
  z-index: 5;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* ===== Лента знакомств ===== */
.discover__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.discover__head h1 {
  margin: 0;
}

.discover__stage {
  max-width: 440px;
  margin: 24px auto 0;
}

.swipe-card {
  position: relative;
  transform: translateX(var(--dx, 0)) rotate(var(--rot, 0deg));
  transition: transform 0.25s ease, opacity 0.25s ease;
  touch-action: pan-y;
  user-select: none;
}

.swipe-card.is-dragging {
  transition: none;
  cursor: grabbing;
}

.swipe-card.is-leaving-right {
  transform: translateX(140%) rotate(18deg);
  opacity: 0;
}

.swipe-card.is-leaving-left {
  transform: translateX(-140%) rotate(-18deg);
  opacity: 0;
}

/* Значок ♥ / ✕ при перетаскивании; прозрачность растёт по мере приближения к порогу свайпа */
.swipe-card.is-liking::after,
.swipe-card.is-passing::after {
  position: absolute;
  top: 28px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 4px solid;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  font-size: 2.2rem;
  font-weight: 800;
  opacity: var(--progress, 0);
  pointer-events: none;
}

.swipe-card.is-liking::after {
  content: "♥";
  left: 24px;
  color: var(--accent);
}

.swipe-card.is-passing::after {
  content: "✕";
  right: 24px;
  color: var(--danger);
}

.swipe-actions {
  position: sticky;
  bottom: 16px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 16px;
}

.swipe-btn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.swipe-btn:hover {
  transform: scale(1.08);
}

.swipe-btn--pass {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
}

.swipe-btn--like {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.discover__hint {
  text-align: center;
}

.discover__empty {
  max-width: 520px;
  margin: 32px auto 0;
  text-align: center;
}

.discover__empty .form__row {
  justify-content: center;
  margin-top: 16px;
}

.discover__empty-icon {
  font-size: 2.5rem;
}

/* Окно мэтча */
.match-dialog {
  text-align: center;
}

.match-dialog__photo {
  display: block;
  width: 140px;
  height: 140px;
  margin: 8px auto 16px;
  border: 4px solid var(--accent);
  border-radius: 50%;
  object-fit: cover;
}

.match-dialog h2 {
  color: var(--accent);
  font-size: 1.8rem;
}

.match-dialog__actions {
  justify-content: center;
}

/* ===== Мэтчи ===== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 16px;
}

.tab {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tab__count {
  opacity: 0.8;
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.person-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-2);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s;
}

.person-tile:hover {
  transform: translateY(-2px);
}

.person-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-tile__info {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
}

.person-tile__info small {
  opacity: 0.85;
}

.empty-state {
  padding: 32px 0;
  text-align: center;
}

.empty-state .btn {
  margin-top: 8px;
}

.profile-dialog {
  width: min(440px, calc(100vw - 32px));
}

.profile-dialog__actions {
  justify-content: center;
  align-items: center;
}

.btn--danger-text {
  color: var(--danger);
}

@media (max-width: 860px) {
  .nav__label {
    display: none;
  }

  .nav .nav__link {
    padding: 8px 12px;
  }
}

@media (max-width: 560px) {
  .discover__hint {
    display: none;
  }
}

/* ===== Настройки: одна колонка разделов, страница прокручивается ===== */
.settings {
  max-width: 760px;
}

.settings__sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 28px;
}

.settings__section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Колокольчик уведомлений (js/main.js) ===== */
.notif {
  position: relative;
}

.notif__btn {
  position: relative;
}

.notif__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
  max-height: 70vh;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notif__title {
  margin: 6px 8px 8px;
  font-size: 1rem;
}

.notif__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}

.notif__item:hover {
  background: var(--surface-2);
}

.notif__item.is-unread {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.notif__item img,
.notif__noimg {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.notif__item small {
  display: block;
  color: var(--text-muted);
}

.notif__empty {
  margin: 12px 8px;
  color: var(--text-muted);
}

/* ===== Всплывающие подсказки ===== */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(340px, calc(100vw - 32px));
}

.toast {
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ===== Чат ===== */
/* Страница чата занимает ровно экран: шапка + чат на всю оставшуюся высоту (высота шапки бывает разной) */
body:has(.chat-page) {
  height: 100dvh;
  min-height: 0;
}

.chat-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-block: 20px;
}

.chat {
  display: grid;
  flex: 1;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.chat__list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.chat__title {
  margin: 0;
  padding: 16px 16px 8px;
  font-size: 1.3rem;
}

.chat__empty {
  padding: 16px;
}

.conv {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.conv:hover,
.conv.is-active {
  background: var(--surface-2);
}

.conv__avatar {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.conv__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.conv__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.conv__top time {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.conv__preview {
  overflow: hidden;
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.conv.has-unread .conv__preview {
  color: var(--text);
  font-weight: 600;
}

.conv__unread {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.chat__thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat__thread[hidden] {
  display: none;
}

.chat__placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  font-size: 2.5rem;
}

.chat__placeholder p {
  font-size: 1rem;
}

.chat__placeholder[hidden] {
  display: none;
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.chat__back {
  display: none;
}

.chat__peer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chat__peer img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.chat__peer span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat__typing {
  color: var(--accent);
}

.chat__menu {
  position: relative;
  margin-left: auto;
}

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.menu button:hover {
  background: var(--surface-2);
}

.menu .menu__danger {
  color: var(--danger);
}

.chat__messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.chat__more {
  align-self: center;
}

.chat__day,
.chat__start {
  align-self: center;
  margin: 10px 0 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.msg {
  display: flex;
}

.msg--mine {
  justify-content: flex-end;
}

.msg__bubble {
  max-width: min(75%, 480px);
  padding: 8px 12px;
  border-radius: 18px 18px 18px 6px;
  background: var(--surface-2);
}

.msg--mine .msg__bubble {
  border-radius: 18px 18px 6px 18px;
  background: var(--accent);
  color: #fff;
}

.msg__text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg__meta {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.7rem;
  opacity: 0.75;
}

.msg__image {
  position: relative;
  display: block;
  overflow: hidden;
  max-width: 260px;
  margin-bottom: 4px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: default;
}

.msg__image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.msg__reveal {
  display: none;
}

/* Безопасный чат: входящие фото размыты до нажатия */
.msg__image.is-blurred {
  cursor: pointer;
}

.msg__image.is-blurred img {
  filter: blur(28px);
  transform: scale(1.1);
}

.msg__image.is-blurred .msg__reveal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.chat__alert {
  margin: 0 16px 8px;
}

.chat__composer {
  display: flex;
  flex-direction: row; /* общий стиль form — колонка */
  align-items: flex-end;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

.chat__composer.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.chat__composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.4;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  resize: none;
}

.chat__composer textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.chat__attach {
  flex-shrink: 0;
  cursor: pointer;
}

/* Фото ещё нельзя (мало сообщений): кнопка приглушена, но нажатие показывает объяснение */
.chat__attach.is-locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat__send {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
}

/* Узкие экраны: либо список, либо переписка */
@media (max-width: 760px) {
  .chat-page {
    padding: 0;
  }

  .chat {
    grid-template-columns: 1fr;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .chat.is-thread-open .chat__list,
  .chat:not(.is-thread-open) .chat__thread,
  .chat__placeholder {
    display: none;
  }

  .chat__list {
    border-right: 0;
  }

  .chat__back {
    display: inline-flex;
  }
}

/* ===== Жалобы и блокировка ===== */
.report-reasons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.discover__report {
  margin: 4px 0 0;
  text-align: center;
  font-size: 0.85rem;
}

.discover__report .link-button {
  color: var(--text-muted);
}

.profile-dialog__safety {
  flex-basis: 100%;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-dialog__safety .link-button {
  color: var(--text-muted);
}

/* ===== Настройки: безопасный чат и заблокированные ===== */
.settings__section .switch {
  display: flex;
  margin-bottom: 12px;
}

.settings__status {
  min-height: 1.4em;
  margin: 0;
  font-size: 0.9rem;
  color: var(--danger);
}

.settings__status--ok {
  color: var(--success);
}

.blocked-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.blocked-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.blocked-list__item img,
.blocked-list__noimg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.blocked-list__item .btn {
  margin-left: auto;
}

/* В шапке 5 разделов + колокольчик — на узких экранах остаются только иконки */
@media (max-width: 1000px) {
  .nav__label {
    display: none;
  }

  .nav .nav__link {
    padding: 8px 12px;
  }
}

@media (max-width: 560px) {
  .nav {
    gap: 4px;
  }

  .nav .nav__link {
    padding: 8px;
  }

  .notif__panel {
    position: fixed;
    top: 70px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}

/* ===== Выбор языка: плавающая кнопка в левом нижнем углу (js/main.js) ===== */
.lang-picker {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 60;
}

.lang-picker__current,
.lang-picker__item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lang-picker__current {
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
}

.lang-picker__current:hover,
.lang-picker.is-open .lang-picker__current {
  border-color: var(--accent);
}

.lang-picker img {
  width: 24px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* Список выезжает вверх; padding-bottom — «мостик», чтобы при движении курсора к списку он не закрывался */
.lang-picker__menu {
  position: absolute;
  left: 0;
  bottom: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
  padding-bottom: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.lang-picker:hover .lang-picker__menu,
.lang-picker:focus-within .lang-picker__menu,
.lang-picker.is-open .lang-picker__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-picker__item {
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.lang-picker__item:hover {
  border-color: var(--accent);
}

.lang-picker__item.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
}

/* В чате нижний левый угол занят полем ввода — на узких экранах кнопку языка прячем (язык меняется на любой другой странице) */
@media (max-width: 1240px) {
  body:has(.chat-page) .lang-picker {
    display: none;
  }
}

/* ===== Галочка «реальный человек» ===== */
.verified-badge {
  display: inline-grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: #1d9bf0;
  color: #fff;
  font-size: 0.75em;
  font-weight: 800;
  line-height: 1;
  vertical-align: 0.15em;
}

/* ===== Верификация видео-кружком (профиль) ===== */
.verification__status {
  margin: 0;
  font-weight: 600;
}

.verification__status--ok {
  color: var(--success);
}

.verification__status--bad {
  color: var(--danger);
}

.verification-dialog {
  text-align: center;
}

.verification__task {
  font-size: 1.1rem;
  font-weight: 600;
}

.verification__circle {
  position: relative;
  width: min(280px, 70vw);
  aspect-ratio: 1;
  margin: 8px auto 16px;
  overflow: hidden;
  border: 4px solid var(--accent);
  border-radius: 50%;
  background: #000;
}

.verification__circle video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* как в зеркале — привычнее для селфи */
}

.verification__countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 4rem;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.verification__actions {
  justify-content: center;
}

/* ===== Админ-панель ===== */
.admin h1 {
  margin-bottom: 0;
}

.admin__filter {
  margin-bottom: 12px;
}

.admin__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-row:hover {
  border-color: var(--accent);
}

.admin-row__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.admin-row__main small {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill--ok {
  background: color-mix(in srgb, var(--success) 18%, transparent);
  color: var(--success);
}

.pill--warn {
  background: color-mix(in srgb, #f59e0b 20%, transparent);
  color: #d97706;
}

.pill--bad {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  color: var(--danger);
}

.pill--info {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

.pill--muted {
  background: var(--surface-2);
  color: var(--text-muted);
}

.admin__search {
  flex-direction: row;
  gap: 8px;
  margin: 0 0 16px;
}

.admin__search input,
.admin__inline input,
.admin__inline select {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

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

.admin-dialog {
  width: min(640px, calc(100vw - 32px));
}

.admin-dialog h3 {
  margin: 20px 0 8px;
  font-size: 1rem;
}

.admin__text {
  white-space: pre-wrap;
}

.admin__profile {
  max-width: 340px;
}

.admin__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.admin__actions .field {
  width: 100%;
}

.admin__photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.admin__photo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin__photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  object-fit: cover;
}

.admin__log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin__log small {
  display: block;
  color: var(--text-muted);
}

/* Переписка, приложенная к жалобе */
.evidence {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.evidence__msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--surface-2);
  overflow-wrap: anywhere;
}

.evidence__msg small {
  color: var(--text-muted);
}

/* Сообщения нарушителя — справа и с красной полосой, чтобы сразу было видно, кто что писал */
.evidence__msg--target {
  align-self: flex-end;
  border-right: 3px solid var(--danger);
}

/* Очередь верификации */
.verification-queue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.vq-item__media {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
}

.vq-item__media video {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
  transform: scaleX(-1);
}

.vq-item__photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.vq-item__photos img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  object-fit: cover;
}

.vq-item__gesture {
  margin: 12px 0 4px;
}

/* ===== Статистика ===== */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.stat-tile__label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-tile__value {
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-tile small {
  color: var(--text-muted);
}

.admin__charts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.chart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.chart__head h2 {
  margin: 0;
  font-size: 1rem;
}

.chart__total {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.chart__plot {
  position: relative;
  margin-top: 12px;
  padding-top: 18px;
  border-bottom: 1px solid var(--border);
}

.chart__max {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Столбики: один ряд, высота через --h (CSSOM); 2px зазор, скруглённый верх */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
}

.bar {
  position: relative;
  flex: 1;
  height: var(--h, 0%);
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
  cursor: default;
}

.bar.is-zero {
  background: var(--border);
}

.bar:hover,
.bar:focus-visible {
  background: var(--accent-hover);
  outline: none;
}

/* Подсказка при наведении: дата и число */
.bar:hover::after,
.bar:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 5;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.78rem;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.chart__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin__breakdowns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.admin__breakdowns h2 {
  font-size: 1rem;
}

.hbars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hbar {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.hbar__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hbar__track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
}

.hbar__fill {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.hbar__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

@media (max-width: 560px) {
  .vq-item__media {
    grid-template-columns: 1fr;
  }

  .vq-item__media video {
    margin: 0 auto;
  }

  .hbar {
    grid-template-columns: 90px 1fr 40px;
  }
}

/* ===== ↺ Вернуть анкету (лента) ===== */
.swipe-actions {
  align-items: center;
}

.swipe-btn--rewind {
  position: relative;
  width: 48px;
  height: 48px;
  color: #d97706;
  border-color: color-mix(in srgb, #f59e0b 50%, var(--border));
  font-size: 1.3rem;
}

/* Сколько бесплатных возвратов осталось */
.swipe-btn__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 18px;
}

[data-rewind].is-locked {
  opacity: 0.45;
}

.swipe-btn--rewind.is-locked .swipe-btn__count {
  background: var(--text-muted);
}

/* Возвращённая анкета «прилетает» обратно слева */
.swipe-card.is-returning {
  animation: card-return 0.3s ease;
}

@keyframes card-return {
  from {
    transform: translateX(-140%) rotate(-18deg);
    opacity: 0;
  }
}

/* ===== Предупреждение модерации (окно у пользователя) ===== */
.warning-dialog {
  width: min(460px, calc(100vw - 32px));
  text-align: center;
}

.warning-dialog__icon {
  font-size: 2.6rem;
}

.warning-dialog__text {
  padding: 12px 14px;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  background: var(--surface-2);
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ===== Админка: группы действий (предупреждение, бан/отстранение) ===== */
.admin__group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.admin__group legend {
  padding: 0 6px;
  font-weight: 700;
}

.admin__group .field,
.admin__group .admin__inline {
  width: 100%;
}

.admin__group textarea,
.admin__group input {
  width: 100%;
}

.admin__group .admin__inline select {
  flex: 0 1 auto;
}

/* Узкий телефон: у модераторов в шапке на одну иконку больше («Админка») — ужимаем кнопки, чтобы колокольчик не обрезался */
@media (max-width: 420px) {
  .nav {
    gap: 2px;
  }

  .nav .nav__link {
    padding: 6px;
  }

  .nav .btn--icon {
    width: 36px;
    height: 36px;
  }
}

/* В ленте внизу кнопки ↺ ✕ ♥ — на телефоне кнопку языка прячем, чтобы не наезжала (язык меняется на любой другой странице) */
@media (max-width: 560px) {
  body:has(.discover) .lang-picker {
    display: none;
  }
}

/* ===== Спринт 6: акцентный цвет (Настройки → Оформление; коды — ACCENTS в shared/profile-options.js) ===== */
/* Правила идут после тем: [data-accent] на <html> перекрывает --accent тёмной темы, [data-theme][data-accent] — светлой */
[data-accent="violet"] { --accent: #8b5cf6; --accent-hover: #a78bfa; }
[data-accent="blue"] { --accent: #3b82f6; --accent-hover: #60a5fa; }
[data-accent="teal"] { --accent: #14b8a6; --accent-hover: #2dd4bf; }
[data-accent="orange"] { --accent: #f97316; --accent-hover: #fb923c; }
[data-accent="red"] { --accent: #ef4444; --accent-hover: #f87171; }
[data-theme="light"][data-accent="violet"] { --accent: #7c3aed; --accent-hover: #6d28d9; }
[data-theme="light"][data-accent="blue"] { --accent: #2563eb; --accent-hover: #1d4ed8; }
[data-theme="light"][data-accent="teal"] { --accent: #0f766e; --accent-hover: #115e59; }
[data-theme="light"][data-accent="orange"] { --accent: #c2410c; --accent-hover: #9a3412; }
[data-theme="light"][data-accent="red"] { --accent: #dc2626; --accent-hover: #b91c1c; }

/* Кружки выбора цвета */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  cursor: pointer;
}

.swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.swatch__dot {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--swatch);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  transition: box-shadow 0.15s, transform 0.15s;
}

.swatch input:checked + .swatch__dot {
  box-shadow: 0 0 0 2px var(--text);
  transform: scale(1.08);
}

.swatch input:focus-visible + .swatch__dot {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Настройки: подсказка под переключателем, вложенная форма (смена пароля) */
.switch__hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.settings__subform {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.settings__section select {
  max-width: 280px;
}

/* ===== Обзор (/explore) ===== */
/* Поля вне .field (поиск в Обзоре, подпись истории) — тот же вид, что у полей форм */
.explore__search,
.explore__answers input,
.story-add input[type="text"] {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.explore__search:focus,
.explore__answers input:focus,
.story-add input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.explore__search {
  width: 100%;
  margin: 8px 0 16px;
}

.explore__cats {
  margin-bottom: 20px;
}

.explore__cats.is-dimmed {
  opacity: 0.5;
}

.explore__topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.topic-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.topic-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.topic-tile__emoji {
  font-size: 1.6rem;
  line-height: 1.2;
}

.topic-tile strong {
  line-height: 1.3;
}

.topic-tile small {
  color: var(--text-muted);
}

.topic-tile.is-empty {
  opacity: 0.45;
}

.explore__back {
  margin-bottom: 8px;
  color: var(--text-muted);
}

.explore__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
}

.explore__answers {
  flex-direction: row;
  gap: 8px;
  max-width: 480px;
  margin: 0;
}

.explore__answers input {
  flex: 1;
  min-width: 0;
}

.explore__more {
  margin-top: 20px;
  text-align: center;
}

/* Плашки на карточках людей: «мэтч / вы лайкнули», ответ на вопрос интереса, точка «есть истории» */
.person-tile__state {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 0.75rem;
}

.person-tile__story {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
}

.person-tile__info .person-tile__answer {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

/* ===== Истории (js/stories.js) ===== */
/* Кнопка на фото анкеты; .is-new — есть непросмотренные (яркое кольцо) */
.story-chip {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.story-chip__ring {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

.story-chip.is-new .story-chip__ring {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

/* Полноэкранный просмотр */
.story-viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.story-viewer::backdrop {
  background: rgba(0, 0, 0, 0.92);
}

.story-viewer__frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100vw, calc(100dvh * 9 / 16));
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
  user-select: none;
}

.story-viewer__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.15s;
}

.story-viewer__frame.is-loading .story-viewer__img {
  opacity: 0.4;
}

.story-viewer__bars {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  gap: 4px;
}

.story-viewer__bars span {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.story-viewer__bars i {
  display: block;
  width: 0;
  height: 100%;
  background: #fff;
}

.story-viewer__bars .is-done i {
  width: 100%;
}

.story-viewer__bars .is-active i {
  animation: story-progress var(--story-duration, 5s) linear forwards;
}

.story-viewer__frame.is-paused .story-viewer__bars i {
  animation-play-state: paused;
}

@keyframes story-progress {
  from { width: 0; }
  to { width: 100%; }
}

.story-viewer__head {
  position: absolute;
  top: 22px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.story-viewer__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.story-viewer__time {
  opacity: 0.8;
}

.story-viewer__close {
  margin-left: auto;
  border: 0;
  background: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.story-viewer__caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 32px;
  z-index: 3;
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  text-align: center;
  overflow-wrap: anywhere;
}

/* Невидимые зоны нажатия: левая треть — назад, остальное — вперёд */
.story-viewer__nav {
  position: absolute;
  top: 60px;
  bottom: 0;
  z-index: 2;
  border: 0;
  background: none;
  cursor: pointer;
}

.story-viewer__nav--prev {
  left: 0;
  width: 33%;
}

.story-viewer__nav--next {
  right: 0;
  width: 67%;
}

/* Свои истории в профиле */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.story-tile {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface-2);
}

.story-tile__open {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.story-tile__open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-tile__meta {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 8px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: #fff;
  font-size: 0.75rem;
  pointer-events: none;
}

.story-tile__delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.story-add {
  display: flex;
  gap: 8px;
}

.story-add input[type="text"] {
  flex: 1;
  min-width: 0;
}

.story-add .is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Истории мэтчей — полоска кружков над списком */
.stories-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  margin-top: 16px;
  padding-bottom: 6px;
}

.stories-strip__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  width: 72px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.stories-strip__ring {
  width: 64px;
  height: 64px;
  padding: 3px;
  border: 2px solid var(--border);
  border-radius: 50%;
}

.stories-strip__item.is-new .stories-strip__ring {
  border-color: var(--accent);
}

.stories-strip__ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.stories-strip__name {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* С «Обзором» в шапке стало на раздел больше: на телефоне тема меняется в «Настройках», кнопку ◐ прячем */
@media (max-width: 480px) {
  .nav:has(.nav__link) [data-action="theme"] {
    display: none;
  }
}

/* Обзор на телефоне: категории — одной прокручиваемой строкой, чтобы темы были видны сразу */
@media (max-width: 560px) {
  .explore__cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .explore__cats .chip span {
    white-space: nowrap;
  }

  .explore__topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Поля в разделах настроек вне <form> — отступ между ними, как в формах */
.settings__section .field + .field {
  margin-top: 16px;
}

/* ===== Кристаллы (спринт 8) ===== */
/* Баланс в шапке */
.crystal-chip {
  gap: 4px;
  font-weight: 700;
  white-space: nowrap;
}

.crystals__balance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crystals__balance > div {
  display: grid;
  gap: 2px;
}

.crystals__amount {
  font-size: 2rem;
}

.crystals .card + .card,
.crystals .note + .card,
.crystals .form__alert + .card {
  margin-top: 16px;
}

.crystals .note {
  margin-top: 16px;
}

.crystals__perks {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.crystals__sub-status {
  font-weight: 600;
}

.crystal-packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.crystal-pack {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 18px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.crystal-pack:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.crystal-pack:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.crystal-pack__amount {
  font-size: 1.4rem;
  font-weight: 800;
}

.crystal-pack__name {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.crystal-pack__price {
  margin-top: 6px;
  color: var(--accent);
  font-weight: 700;
}

.crystal-history {
  margin: 0;
  padding: 0;
  list-style: none;
}

.crystal-history__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.crystal-history__item:last-child {
  border-bottom: 0;
}

.crystal-history__item small {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.crystal-history__item .is-plus {
  color: var(--success);
}

.crystal-history__item .is-minus {
  color: var(--text-muted);
}

/* Тестовая реклама: экран + полоска прогресса (--progress 0…1 задаётся через CSSOM) */
.ad-dialog__screen {
  display: grid;
  place-items: center;
  height: 160px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: var(--surface-2);
  font-size: 3rem;
}

.ad-dialog__progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.ad-dialog__progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  transition: transform 0.25s linear;
}

/* Открыть оригиналы фото за кристаллы (в карточке анкеты) */
.unlock-btn {
  margin-top: 8px;
}

.note .unlock-btn {
  display: flex;
}

/* ↺ сверх бесплатных — за кристаллы */
.swipe-btn--rewind.is-paid .swipe-btn__count {
  background: var(--accent);
}

/* 😉 подмигивание */
.swipe-btn--wink {
  width: 52px;
  height: 52px;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  font-size: 1.4rem;
}

#wink-text {
  width: 100%;
  resize: vertical;
}

/* Текст подмигивания над анкетой во вкладке «Запросы» */
.wink-quote {
  margin: 0 48px 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--surface-2);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

@media (max-width: 480px) {
  .swipe-actions {
    gap: 16px;
  }
}

/* ===== Подписки Лайт / Премиум, приглашение, промокод, ежедневная награда (спринт 8а, правки) ===== */
.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}

.plan-card h3 {
  margin: 0;
}

.plan-card--top {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.plan-card.is-current {
  border-color: var(--success);
}

.plan-card__price {
  margin: 0;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 800;
}

.plan-card .crystals__perks {
  flex: 1;
  align-content: start;
}

.ref-link {
  display: flex;
  gap: 8px;
}

.ref-link input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.promo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.promo-form .form__alert {
  grid-column: 1 / -1;
}

.promo-form .field {
  margin: 0;
}

.promo-form .btn {
  min-height: 46px;
}

.promo-form input {
  text-transform: uppercase;
}

.daily-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.daily-days__item {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 8px 2px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.8rem;
}

.daily-days__item small {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.daily-days__item.is-done {
  opacity: 0.5;
}

.daily-days__item.is-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Буст и «Путешествие» в ленте */
.discover__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.travel-fields {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.travel-fields legend {
  float: left;
  width: 100%;
  padding: 0;
}

.promo-admin {
  margin-bottom: 16px;
}

.promo-admin .field-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.daily-claim {
  margin-top: 16px;
}

.crystals .daily-days {
  margin-top: 8px;
}

.daily-days__item.is-done strong {
  color: var(--success);
}

/* ===== Поддержка и FAQ (спринт 8б) ===== */
.support .card + .card,
.support .card + form,
.support form + .card {
  margin-top: 16px;
}

.support__form textarea,
.support-reply textarea {
  width: 100%;
}

.support-dialog {
  width: min(640px, calc(100vw - 32px));
}

.support-thread {
  display: grid;
  gap: 10px;
  max-height: 50vh;
  margin: 16px 0;
  overflow-y: auto;
}

.support-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-2);
}

.support-msg.is-staff {
  justify-self: end;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
}

.support-msg small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.support-msg p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.faq__section + .faq__section {
  margin-top: 28px;
}

.faq__item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.faq__item + .faq__item {
  margin-top: 8px;
}

.faq__item summary {
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
}

.faq__item p {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--text-muted);
  line-height: 1.55;
}

.faq__item a {
  color: var(--accent);
}

.faq__more {
  margin-top: 28px;
}

.faq__more p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
}

/* ===== Техподдержка: плавающая кнопка в правом нижнем углу (js/main.js, renderSupportButton) ===== */
.support-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s;
}

.support-fab:hover,
.support-fab:focus-visible {
  border-color: var(--accent);
  transform: scale(1.06);
}

/* Микрофон — маленьким значком на наушниках */
.support-fab__mic {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 0.8rem;
}

/* Подпись «Техническая поддержка» — слева от кнопки при наведении / фокусе */
.support-fab__tip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(6px, -50%);
  transition: opacity 0.15s, transform 0.15s;
}

.support-fab:hover .support-fab__tip,
.support-fab:focus-visible .support-fab__tip {
  opacity: 1;
  transform: translate(0, -50%);
}

/* Всплывающие подсказки — над кнопкой поддержки */
.toasts {
  bottom: 80px;
}

/* В чате и ленте на узких экранах угол занят полем ввода / кнопками — прячем, как и выбор языка */
@media (max-width: 1240px) {
  body:has(.chat-page) .support-fab {
    display: none;
  }
}

@media (max-width: 560px) {
  body:has(.discover) .support-fab {
    display: none;
  }
}

/* Фото в обращениях в поддержку */
.support__attach {
  align-self: flex-start;
  justify-self: start;
  width: auto;
  cursor: pointer;
}

.support__files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.support__files:empty {
  display: none;
}

.support-msg__image {
  display: block;
  max-width: 100%;
  max-height: 260px;
  width: auto;
  height: auto;
  margin-top: 6px;
  border-radius: 10px;
}

.support-reply label.btn {
  cursor: pointer;
}

/* ===== Двухфакторная защита (Настройки) ===== */
.twofa__status {
  font-weight: 600;
}

.twofa__steps {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding-left: 20px;
}

/* QR — всегда на белом: тёмная тема не должна мешать камере */
.twofa__qr {
  display: block;
  width: max-content;
  margin: 10px 0 8px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
}

.twofa__qr img {
  display: block;
}

.twofa__secret {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 1rem;
  letter-spacing: 0.08em;
  user-select: all;
  word-break: break-all;
}

.twofa__backup {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.twofa__backup h3 {
  margin-top: 0;
}

.twofa__codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
}

.twofa__codes code {
  display: block;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.twofa__lost {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* ===== Цены (/pricing) и превью до запуска ===== */
.pricing .card {
  margin-top: 16px;
}

.crystal-pack--static {
  cursor: default;
}

.crystal-pack--static:hover:not(:disabled) {
  border-color: var(--border);
  transform: none;
}

.pricing__note {
  margin-top: 24px;
}

.pricing__note a {
  color: var(--accent);
}

.preview-banner {
  flex-basis: 100%;
  margin: 0 0 8px;
  color: var(--text-muted);
}

.preview-banner strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 1.2rem;
}

.pricing__lead {
  max-width: 640px;
  font-size: 1.05rem;
}
