:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #1c1c1e);
  --hint: var(--tg-theme-hint-color, #8e8e93);
  --link: var(--tg-theme-link-color, #2481cc);
  --button: var(--tg-theme-button-color, #2481cc);
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #f2f2f7);
  --card-bg: #ffffff;
  --border: #e5e5ea;
  --danger: #e0245e;
  --success: #34c759;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  height: 100%;
  overscroll-behavior-y: contain;
}

.hidden { display: none !important; }

.fullscreen-error, .fullscreen-loading {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 9999;
  padding: 24px;
}

.fullscreen-error__box { text-align: center; max-width: 320px; }
.fullscreen-error__icon { font-size: 48px; margin-bottom: 12px; }
.fullscreen-error__box h1 { font-size: 20px; margin: 0 0 8px; }
.fullscreen-error__box p { color: var(--hint); font-size: 14px; margin: 0; }

.spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--button);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.page {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px;
  -webkit-overflow-scrolling: touch;
}

.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  padding: 14px 16px 8px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 20px; margin: 0; }
.topbar--with-back { padding-left: 8px; }
.back-btn {
  background: none; border: none; font-size: 22px; color: var(--link);
  padding: 4px 8px; cursor: pointer;
}

.filters-bar {
  display: flex; gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
}
.filter-select {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--secondary-bg);
  color: var(--text);
  font-size: 14px;
}

.profiles-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 16px;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
}

.profile-card {
  background: var(--tg-theme-bg-color, #ffffff);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--tg-theme-hint-color, #e5e5ea);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.profile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.profile-card__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--secondary-bg);
  display: block;
}
.profile-card__body { padding: 12px 14px; }
.profile-card__header {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 18px; font-weight: 600;
  margin-bottom: 4px;
}
.profile-card__meta {
  font-size: 13px; color: var(--hint);
  margin-bottom: 8px;
  display: flex; flex-wrap: wrap; gap: 6px 10px;
}
.profile-card__tag {
  display: inline-block;
  background: var(--secondary-bg);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
}
.profile-card__about {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.profile-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.profile-card__actions { display: flex; gap: 8px; align-items: center; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--button); color: var(--button-text); }
.btn-secondary { background: var(--secondary-bg); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; display: block; }
.btn:disabled { opacity: 0.5; }

.like-btn {
  border: none; background: none; cursor: pointer;
  font-size: 15px; display: flex; align-items: center; gap: 4px;
  color: var(--hint);
}
.like-btn.liked { color: var(--danger); }

.load-more-btn {
  display: block; margin: 8px auto 20px;
  background: var(--secondary-bg); color: var(--text);
  border: none; border-radius: 12px; padding: 10px 24px; cursor: pointer;
}

.empty-state { text-align: center; color: var(--hint); padding: 40px 20px; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 10;
}
.bottom-nav__item {
  flex: 1;
  background: none; border: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px;
  font-size: 11px;
  color: var(--hint);
  cursor: pointer;
  position: relative;
}
.bottom-nav__item.active { color: var(--link); }
.bottom-nav__icon { font-size: 20px; }
.badge {
  position: absolute; top: 2px; right: calc(50% - 26px);
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 8px; padding: 1px 5px;
  min-width: 14px; text-align: center;
}

/* ============= ЧАТЫ (список) ============= */
.chats-list {
  display: flex;
  flex-direction: column;
  padding: 8px 16px;
  gap: 4px;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--tg-theme-bg-color, #ffffff);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  border: 1px solid var(--tg-theme-hint-color, #e5e5ea);
}

.chat-list-item:active {
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
}

.chat-list-item__photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
}

.chat-list-item__body {
  flex: 1;
  min-width: 0;
}

.chat-list-item__name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 2px;
  color: var(--tg-theme-text-color, #1c1c1e);
}

.chat-list-item__preview {
  font-size: 14px;
  color: var(--tg-theme-hint-color, #8e8e93);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.chat-list-item__time {
  font-size: 12px;
  color: var(--tg-theme-hint-color, #8e8e93);
}

.chat-list-item__badge {
  background: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #ffffff);
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ============= ОКНО ЧАТА ============= */
.chat-window-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.chat-window-peer__photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
}

.chat-window-peer__name {
  font-weight: 600;
  font-size: 16px;
  color: var(--tg-theme-text-color, #1c1c1e);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#page-chat-window {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--tg-theme-bg-color, #ffffff);
  padding-bottom: 80px;
}

.chat-messages .empty-state {
  text-align: center;
  color: var(--tg-theme-hint-color, #8e8e93);
  padding: 40px 20px;
  font-size: 14px;
}

/* Сообщения */
.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 15px;
  animation: msgAppear 0.2s ease;
  position: relative;
}

@keyframes msgAppear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg--in {
  align-self: flex-start;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
  color: var(--tg-theme-text-color, #1c1c1e);
  border-bottom-left-radius: 4px;
}

.msg--out {
  align-self: flex-end;
  background: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #ffffff);
  border-bottom-right-radius: 4px;
}

.msg__text {
  white-space: pre-wrap;
  word-break: break-word;
}

.msg__meta {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.msg--out .msg__meta {
  color: rgba(255, 255, 255, 0.7);
}

.msg--in .msg__meta {
  color: var(--tg-theme-hint-color, #8e8e93);
}

/* ============= ВВОД СООБЩЕНИЯ ============= */
.chat-input-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
  background: var(--tg-theme-bg-color, #ffffff);
  border-top: 1px solid var(--tg-theme-hint-color, #e5e5ea);
  z-index: 20;
  align-items: flex-end;
}

.chat-input-bar textarea {
  flex: 1;
  border: 1px solid var(--tg-theme-hint-color, #e5e5ea);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 15px;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
  color: var(--tg-theme-text-color, #1c1c1e);
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  max-height: 120px;
  min-height: 40px;
  overflow-y: auto;
  transition: border-color 0.2s ease;
}

.chat-input-bar textarea:focus {
  outline: none;
  border-color: var(--tg-theme-button-color, #2481cc);
}

.chat-input-bar textarea::placeholder {
  color: var(--tg-theme-hint-color, #8e8e93);
}

.chat-input-bar button {
  background: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #ffffff);
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  height: 40px;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.chat-input-bar button:disabled {
  opacity: 0.5;
  cursor: default;
}

.chat-input-bar button:not(:disabled):active {
  opacity: 0.8;
}

/* ---------------- Профиль / форма ---------------- */
#profile-content { padding: 16px; }
.profile-form { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; color: var(--hint); }
.form-group input, .form-group select, .form-group textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  background: var(--secondary-bg);
  color: var(--text);
  font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 90px; }

.city-autocomplete { position: relative; }
.city-suggestions {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
}
.city-suggestions__item {
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
}
.city-suggestions__item:not(:last-child) { border-bottom: 1px solid var(--border); }
.city-suggestions__item:active,
.city-suggestions__item:hover { background: var(--secondary-bg); }
.city-suggestions__empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--hint);
}
.photo-upload {
  display: flex; align-items: center; gap: 12px;
}
.photo-upload img {
  width: 72px; height: 72px; border-radius: 12px; object-fit: cover;
  background: var(--secondary-bg);
}

.notice-box {
  background: var(--secondary-bg);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  margin: 16px;
}
.notice-box h3 { margin: 0 0 6px; font-size: 16px; }
.notice-box p { margin: 0 0 12px; color: var(--hint); font-size: 14px; }

.status-pill {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  border-radius: 8px;
  padding: 3px 10px;
  margin-bottom: 10px;
}
.status-pill--pending { background: #fff4d6; color: #a06b00; }
.status-pill--approved { background: #dcf7dc; color: #1e7e1e; }
.status-pill--rejected { background: #fde2e2; color: #b3261e; }
.status-pill--hidden { background: var(--secondary-bg); color: var(--hint); }

/* ============= МОДАЛЬНОЕ ОКНО АНКЕТЫ ============= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content {
  background: var(--tg-theme-bg-color, #ffffff);
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-close {
  position: sticky;
  top: 0;
  right: 0;
  float: right;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--tg-theme-hint-color, #8e8e93);
  padding: 12px 16px;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s ease;
}

.modal-close:active {
  transform: scale(0.9);
}

.modal-body {
  padding: 0 20px 24px;
}

.modal-body .profile-card {
  border: none;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
}

.modal-body .profile-card:hover {
  transform: none;
  box-shadow: none;
}

.modal-body .profile-card__photo {
  border-radius: 16px 16px 0 0;
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
}

.modal-body .profile-card__footer {
  flex-direction: column;
  gap: 12px;
}

.modal-body .profile-card__actions {
  width: 100%;
}

.modal-body .profile-card__actions .btn {
  flex: 1;
}

.modal-body .profile-card__actions .write-btn {
  width: 100%;
}

.modal-body .profile-card__actions .like-btn {
  font-size: 18px;
  padding: 10px;
  justify-content: center;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
  border-radius: 10px;
  width: 100%;
}

.modal-body .profile-card__actions .like-btn .like-count {
  font-size: 16px;
}

.modal-loading {
  padding: 40px 20px;
  text-align: center;
  color: var(--tg-theme-hint-color, #8e8e93);
}

.modal-error {
  padding: 40px 20px;
  text-align: center;
  color: var(--tg-theme-hint-color, #8e8e93);
}

.modal-error .btn {
  margin-top: 12px;
}

/* Анимация для появления модалки */
.modal-overlay.closing {
  animation: modalFadeOut 0.2s ease forwards;
}

@keyframes modalFadeOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(0.95) translateY(10px); }
}

/* В секции модального окна */
.modal-error {
  padding: 40px 20px;
  text-align: center;
  color: var(--tg-theme-text-color, #1c1c1e);
}

.modal-error p {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--tg-theme-hint-color, #8e8e93);
}

.modal-error .btn {
  margin-top: 4px;
}

/* Стиль для сообщения "нет анкеты" */
.modal-no-profile {
  padding: 40px 20px;
  text-align: center;
}

.modal-no-profile__icon {
  font-size: 56px;
  margin-bottom: 16px;
  display: block;
}

.modal-no-profile__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.modal-no-profile__text {
  color: var(--tg-theme-hint-color, #8e8e93);
  font-size: 14px;
  margin: 0 0 20px;
}

/* ============= ОНБОРДИНГ - КРАСИВЫЙ ДИЗАЙН ============= */

.onboarding-page {
  background: var(--tg-theme-bg-color, #ffffff);
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.onboarding-wrapper {
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 24px;
  position: relative;
}

/* ===== ХЕДЕР ===== */
.onboarding-header {
  padding-top: 12px;
  margin-bottom: 8px;
}

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

.onboarding-progress-track {
  width: 100%;
  height: 4px;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.onboarding-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--tg-theme-button-color, #2481cc), #6c5ce7);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  position: relative;
}

.onboarding-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.onboarding-step-counter {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--tg-theme-hint-color, #8e8e93);
  letter-spacing: 0.5px;
}

/* ===== КОНТЕНТ ===== */
.onboarding-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 8px 0 16px;
  animation: onboardingSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 0;
}

@keyframes onboardingSlideIn {
  from {
      opacity: 0;
      transform: translateY(20px) scale(0.98);
  }
  to {
      opacity: 1;
      transform: translateY(0) scale(1);
  }
}

.onboarding-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 16px;
  animation: onboardingIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes onboardingIconPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.onboarding-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--tg-theme-text-color, #1c1c1e);
  text-align: center;
  letter-spacing: -0.5px;
}

.onboarding-description {
  font-size: 15px;
  color: var(--tg-theme-hint-color, #8e8e93);
  margin: 0 0 28px;
  text-align: center;
  line-height: 1.5;
}

/* ===== ПОЛЯ ВВОДА ===== */
.onboarding-field {
  width: 100%;
}

.onboarding-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--tg-theme-secondary-bg-color, #f2f2f7);
  border-radius: 14px;
  font-size: 17px;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
  color: var(--tg-theme-text-color, #1c1c1e);
  transition: all 0.3s ease;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

/* При активном поле ввода - кнопки всегда видны */
.onboarding-input:focus {
  border-color: var(--tg-theme-button-color, #2481cc);
  background: var(--tg-theme-bg-color, #ffffff);
  box-shadow: 0 0 0 4px rgba(36, 129, 204, 0.1);
}

.onboarding-input::placeholder {
  color: var(--tg-theme-hint-color, #8e8e93);
  opacity: 0.6;
}

.onboarding-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.onboarding-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238e8e93' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.onboarding-char-counter {
  text-align: right;
  font-size: 12px;
  color: var(--tg-theme-hint-color, #8e8e93);
  margin-top: 6px;
  padding-right: 4px;
}

/* ===== ФОТО ===== */
.onboarding-photo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.onboarding-photo-preview {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 3px dashed var(--tg-theme-hint-color, #e5e5ea);
  position: relative;
  flex-shrink: 0;
}

.onboarding-photo-preview:hover {
  border-color: var(--tg-theme-button-color, #2481cc);
  transform: scale(1.02);
}

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

.onboarding-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--tg-theme-hint-color, #8e8e93);
}

.placeholder-icon {
  font-size: 40px;
}

.placeholder-text {
  font-size: 13px;
  opacity: 0.7;
}

.onboarding-photo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.onboarding-photo-actions .btn {
  padding: 10px 20px;
  font-size: 14px;
}

.onboarding-hint {
  font-size: 13px;
  color: var(--tg-theme-hint-color, #8e8e93);
  margin: 0;
  text-align: center;
  opacity: 0.7;
}

/* ===== ЛОКАЦИЯ ===== */
.onboarding-location {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboarding-location .city-autocomplete {
  position: relative;
}

.city-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--tg-theme-bg-color, #ffffff);
  border: 1px solid var(--tg-theme-hint-color, #e5e5ea);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  padding: 4px;
}

.city-suggestions__item {
  padding: 12px 14px;
  font-size: 15px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.city-suggestions__item:hover,
.city-suggestions__item:active {
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
}

.city-icon {
  font-size: 16px;
}

.city-suggestions__empty {
  padding: 16px;
  text-align: center;
  color: var(--tg-theme-hint-color, #8e8e93);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.city-suggestions__empty span {
  font-size: 24px;
}

/* ===== ПРЕФЕРЕНСЫ ===== */
.onboarding-preferences {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.onboarding-pref-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onboarding-pref-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--tg-theme-text-color, #1c1c1e);
}

.onboarding-pref-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onboarding-pref-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid var(--tg-theme-secondary-bg-color, #f2f2f7);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
  color: var(--tg-theme-text-color, #1c1c1e);
  user-select: none;
  flex: 1;
  min-width: 80px;
  justify-content: center;
}

.onboarding-pref-option input {
  display: none;
}

.onboarding-pref-option .option-emoji {
  font-size: 18px;
}

.onboarding-pref-option .option-label {
  font-size: 14px;
  font-weight: 500;
}

.onboarding-pref-option.selected {
  border-color: var(--tg-theme-button-color, #2481cc);
  background: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #ffffff);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(36, 129, 204, 0.3);
}

.onboarding-pref-option:active {
  transform: scale(0.95);
}

/* ===== ФУТЕР С КНОПКАМИ ===== */
.onboarding-footer {
  flex-shrink: 0;
  padding-top: 16px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  border-top: 1px solid var(--tg-theme-secondary-bg-color, #f2f2f7);
  margin-top: auto;
  background: var(--tg-theme-bg-color, #ffffff);
  position: sticky;
  bottom: 0;
}

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

.onboarding-actions .btn {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 14px;
  transition: all 0.25s ease;
  flex: 1;
}

.btn-large {
  padding: 14px 24px;
  font-size: 16px;
}

.btn-ghost {
  background: transparent;
  color: var(--tg-theme-hint-color, #8e8e93);
  border: none;
  flex: 0.5;
  min-width: 80px;
}

.btn-ghost:hover {
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
}

.btn-ghost:active {
  transform: scale(0.95);
}

/* ===== ЭКРАН УСПЕХА ===== */
.onboarding-success {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  animation: onboardingSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-animation {
  margin-bottom: 24px;
}

.success-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34c759, #28a745);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: successPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 30px rgba(52, 199, 89, 0.3);
}

@keyframes successPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.success-check {
  font-size: 40px;
  color: white;
  font-weight: 700;
}

.onboarding-success h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--tg-theme-text-color, #1c1c1e);
}

.onboarding-success p {
  color: var(--tg-theme-hint-color, #8e8e93);
  margin: 0 0 4px;
  font-size: 16px;
}

.success-hint {
  font-size: 14px !important;
  opacity: 0.7;
  margin-bottom: 20px !important;
}

.success-spinner {
  display: flex;
  gap: 8px;
  margin: 16px 0 24px;
}

.spinner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tg-theme-button-color, #2481cc);
  animation: dotBounce 1.4s infinite ease-in-out both;
}

.spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.spinner-dot:nth-child(2) { animation-delay: -0.16s; }
.spinner-dot:nth-child(3) { animation-delay: 0; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.onboarding-success .btn {
  padding: 14px 48px;
  font-size: 16px;
  border-radius: 14px;
  margin-top: 8px;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 380px) {
  .onboarding-wrapper {
      padding: 16px 16px 20px;
  }
  
  .onboarding-title {
      font-size: 22px;
  }
  
  .onboarding-icon {
      font-size: 40px;
  }
  
  .onboarding-pref-option {
      padding: 8px 12px;
      font-size: 13px;
      min-width: 60px;
  }
  
  .onboarding-photo-preview {
      width: 130px;
      height: 130px;
  }
}

@media (min-width: 600px) {
  .onboarding-wrapper {
      padding: 32px 40px 32px;
  }
}

/* ===== КНОПКИ В ОНБОРДИНГЕ ===== */
.onboarding-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.onboarding-actions-left {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.onboarding-actions-right {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.onboarding-actions .btn {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 14px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-small {
  padding: 10px 16px !important;
  font-size: 14px !important;
}

.btn-ghost {
  background: transparent;
  color: var(--tg-theme-hint-color, #8e8e93);
  border: none;
}

.btn-ghost:hover {
  background: var(--tg-theme-secondary-bg-color, #f2f2f7);
}

.btn-ghost:active {
  transform: scale(0.95);
}

/* ===== ПРЕФЕРЕНСЫ - СЕТКА ===== */
.onboarding-pref-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.onboarding-pref-options-grid .onboarding-pref-option {
  flex: 1;
  min-width: 0;
  padding: 12px 8px;
  font-size: 13px;
}

/* ===== ПАРАМЕТРЫ ТЕЛА (РОСТ И ВЕС) ===== */
.onboarding-body-params {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.onboarding-body-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.onboarding-body-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--tg-theme-text-color, #1c1c1e);
}

.onboarding-body-row .onboarding-input {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  padding: 14px;
}

/* ===== АДАПТИВ ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ ===== */
@media (max-width: 380px) {
  .onboarding-pref-options-grid {
      grid-template-columns: 1fr 1fr;
      gap: 6px;
  }
  
  .onboarding-pref-options-grid .onboarding-pref-option {
      padding: 10px 6px;
      font-size: 12px;
  }
  
  .onboarding-pref-options-grid .option-emoji {
      font-size: 16px;
  }
  
  .onboarding-actions .btn {
      padding: 10px 14px;
      font-size: 13px;
  }
  
  .btn-small {
      padding: 8px 12px !important;
      font-size: 12px !important;
  }
}

@media (min-width: 600px) {
  .onboarding-pref-options-grid {
      grid-template-columns: repeat(3, 1fr);
  }
  
  .onboarding-pref-options-grid .onboarding-pref-option {
      padding: 14px 12px;
      font-size: 14px;
  }
}

/* ===== ФОТО - ИСПРАВЛЕНИЕ КНОПОК ===== */
.onboarding-photo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.onboarding-photo-actions .btn {
  flex: 0 1 auto;
  min-width: 120px;
}

/* ===== КНОПКА ЗАГРУЗКИ ФОТО С СОСТОЯНИЕМ ===== */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Дополнительный отступ для клавиатуры */
@media (max-height: 700px) {
  .onboarding-content {
      padding: 4px 0 8px;
  }
  
  .onboarding-icon {
      font-size: 36px;
      margin-bottom: 8px;
  }
  
  .onboarding-title {
      font-size: 22px;
      margin-bottom: 4px;
  }
  
  .onboarding-description {
      font-size: 14px;
      margin-bottom: 16px;
  }
  
  .onboarding-footer {
      padding-top: 12px;
  }
}

/* ===== СТАТУС ОНЛАЙН/ОФФЛАЙН ===== */
.chat-list-item__avatar-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.chat-list-item__photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--tg-theme-secondary-bg-color, #f2f2f7);
    display: block;
}

.chat-list-item__status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--tg-theme-bg-color, #ffffff);
    transition: all 0.3s ease;
}

.chat-list-item__status.online {
    background: #34c759;
    box-shadow: 0 0 8px rgba(52, 199, 89, 0.5);
}

.chat-list-item__status.offline {
    background: #8e8e93;
}

/* Анимация для онлайн статуса */
.chat-list-item__status.online {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(52, 199, 89, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
    }
}

/* Стили для модального окна причины отклонения */
.modal-overlay .modal-content textarea:focus {
  outline: none;
  border-color: var(--tg-theme-button-color, #2481cc);
}

/* ===== МОДАЛЬНОЕ ОКНО ТРЕБОВАНИЙ К ФОТО ===== */
.photo-requirements-modal .modal-content {
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.photo-requirements-modal .modal-close-btn {
    transition: transform 0.2s ease;
}

.photo-requirements-modal .modal-close-btn:hover {
    transform: scale(1.1);
}

.photo-requirements-modal .modal-close-btn:active {
    transform: scale(0.9);
}