/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg:      #0D0D0D;
  --card:    #1C1C1E;
  --card2:   #2C2C2E;
  --text:    #FFFFFF;
  --sub:     #8E8E93;
  --amber:   #FF9F0A;
  --border:  #38383A;
  --cream:   #EDE9E3;
  --cream-tx:#1A1A1A;
  --radius:  14px;
  --dur:     .32s;
  --ease:    cubic-bezier(.25,.46,.45,.94);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  /* Антизум: фиксируем масштаб текста, отключаем pinch и тач-callout/select */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-touch-callout: none;
  touch-action: pan-y;
  /* По умолчанию — НИЧЕГО не выделяется (как в нативных iOS-приложениях).
     Иначе long-press на сообщения запускает системное выделение текста
     и конфликтует с нашим action-sheet'ом. Копирование делается через
     long-press → "📋 Копировать" — там работает clipboard-API. */
  -webkit-user-select: none;
  user-select: none;
}
/* Выделение разрешено только в полях ввода — там оно нужно для редактирования */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;  /* в инпуте — пусть iOS показывает Cut/Copy/Paste */
}
/* iOS: убираем серое подсвечивание при тапе на ссылки, картинки, кнопки */
a, button, label, img, [role="button"], .chat-bubble, .browse-card, .opt-item, .tab-btn-main {
  -webkit-tap-highlight-color: transparent;
}
/* iOS: long-press на картинки больше не показывает "Save Image / Copy" callout
   и не позволяет «утаскивать» картинку drag-n-drop'ом */
img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* ══════════════════════════════════════════════
   SCREENS & TRANSITIONS  (Идея 1)
══════════════════════════════════════════════ */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  will-change: transform;
}
.screen.active { display: flex; }
.screen.dark   { background: var(--bg); }

/* Slide animations */
@keyframes slideInR  { from { transform: translateX(100%); }   to { transform: translateX(0); } }
@keyframes slideOutL { from { transform: translateX(0); }      to { transform: translateX(-28%) scale(.97); opacity:.4; } }
@keyframes slideInL  { from { transform: translateX(-28%) scale(.97); opacity:.4; } to { transform: translateX(0); opacity:1; } }
@keyframes slideOutR { from { transform: translateX(0); }      to { transform: translateX(100%); } }

.anim-in-r  { animation: slideInR  var(--dur) var(--ease) both; z-index: 10; }
.anim-out-l { animation: slideOutL var(--dur) var(--ease) both; z-index:  5; }
.anim-in-l  { animation: slideInL  var(--dur) var(--ease) both; z-index: 10; }
.anim-out-r { animation: slideOutR var(--dur) var(--ease) both; z-index:  5; }


/* ══════════════════════════════════════════════
   WELCOME  (Идея 3 — анимации)
══════════════════════════════════════════════ */
#screen-welcome {
  background: var(--cream);
  color: var(--cream-tx);
  justify-content: space-between;
  align-items: center;
  padding: 0 28px env(safe-area-inset-bottom, 40px);
}

.welcome-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

/* Keyframes для welcome */
@keyframes fadeDown { from { transform: translateY(-40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeUp   { from { transform: translateY(24px);  opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.logo-wrap    { animation: fadeDown .75s var(--ease) .15s both; text-align: center; }
.welcome-sub  { animation: fadeUp   .65s var(--ease) .5s  both; }
.welcome-footer { animation: fadeUp .6s  var(--ease) .72s both; width: 100%; padding-bottom: 12px; }

/* Logo — просто картинка из static/logo.png */
.logo-img {
  display: block;
  width: 280px;
  max-width: 75vw;
  height: auto;
  margin: 0 auto;
}

@media (max-width: 380px) {
  .logo-img { width: 240px; }
}

.welcome-sub {
  font-size: 16px;
  color: #6B6B6B;
  text-align: center;
  line-height: 1.55;
}

.btn-dark {
  width: 100%;
  background: var(--cream-tx);
  color: var(--cream);
  border: none;
  border-radius: 50px;
  padding: 18px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}


/* ══════════════════════════════════════════════
   TOP BAR
══════════════════════════════════════════════ */
.top-bar {
  padding: env(safe-area-inset-top, 52px) 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.progress-bar { display: flex; gap: 6px; }

.seg {
  flex: 1;
  height: 3px;
  background: var(--card2);
  border-radius: 2px;
  transition: background .4s;
}
.seg.active { background: var(--text); }

/* Идея 2 — счётчик шагов */
.step-counter {
  font-size: 12px;
  color: var(--sub);
  letter-spacing: .3px;
}


/* ══════════════════════════════════════════════
   BODY SCROLL
══════════════════════════════════════════════ */
.body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 8px;
  -webkit-overflow-scrolling: touch;
}
.body-scroll::-webkit-scrollbar { display: none; }

h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; text-align: center; }

.sub { color: var(--sub); font-size: 14px; line-height: 1.45; margin-bottom: 26px; }


/* ══════════════════════════════════════════════
   FORM
══════════════════════════════════════════════ */
.fg { margin-bottom: 22px; }

.flabel {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 8px;
}

.finput {
  width: 100%;
  background: var(--card);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  display: block;
  min-height: 52px;
  margin-bottom: 8px;
  transition: border-color .2s;
}
.finput:focus  { border-color: var(--amber); }
.finput.error  { border-color: #FF453A; }
.finput:last-child { margin-bottom: 0; }
.finput::placeholder { color: var(--sub); }

/* Кнопка «Взять из профиля» под полем телефона */
.phone-grab {
  width: 100%;
  margin-top: 4px;
  background: var(--card2);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--amber);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .2s, border-color .2s;
}
.phone-grab:active   { opacity: .65; }
.phone-grab:disabled { opacity: .5; }

input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .6; }
input[type="date"] { color-scheme: dark; }

.ftextarea {
  width: 100%;
  background: var(--card);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 110px;
  transition: border-color .2s;
}
.ftextarea:focus { border-color: var(--amber); }
.ftextarea::placeholder { color: var(--sub); }

.cnt-row { font-size: 12px; color: var(--sub); text-align: right; margin-top: 4px; }

/* Идея 4 — ошибки валидации */
.field-error {
  display: none;
  font-size: 12px;
  color: #FF453A;
  margin-top: 5px;
  padding-left: 4px;
  animation: fadeUp .2s var(--ease);
}


/* ══════════════════════════════════════════════
   TRIGGER ROWS
══════════════════════════════════════════════ */
.frow {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  margin-bottom: 8px;
  font-size: 16px;
  color: var(--text);
  transition: opacity .15s;
}
.frow.trigger { cursor: pointer; }
.frow.trigger:active { opacity: .7; }

.val-right { color: var(--amber); font-size: 15px; }
.val-right.dim { color: var(--sub); }


/* ══════════════════════════════════════════════
   GENDER
══════════════════════════════════════════════ */
.gender-row { display: flex; gap: 10px; }

.gbtn {
  flex: 1;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 14px 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .2s;
}
.gbtn.active { border-color: var(--text); }

.gcheck {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: transparent;
  flex-shrink: 0;
  transition: all .2s;
}
.gbtn.active .gcheck {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
}


/* ══════════════════════════════════════════════
   LIST ROWS
══════════════════════════════════════════════ */
.list-row { gap: 12px; }

.ficon {
  width: 34px; height: 34px;
  background: var(--card2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.ficon.ig { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color:#fff; font-size:11px; font-weight:700; }
.ficon.tg { background: #2AABEE; color: #fff; font-size: 16px; }
.ficon.vk { background: #0077FF; color: #fff; font-size: 11px; font-weight: 700; }

.list-row > span:nth-child(2) { flex: 1; }

.social-note { font-size: 12px; color: var(--sub); line-height: 1.4; margin-top: 8px; padding: 0 4px; }


/* ══════════════════════════════════════════════
   PHOTOS  (Идея 7)
══════════════════════════════════════════════ */
.photo-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 10px; }

.photo-slot {
  aspect-ratio: 3/4;
  background: var(--card);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: transform .2s;
}
.photo-slot:active { transform: scale(.96); }

.photo-slot img { width: 100%; height: 100%; object-fit: cover; }

/* анимация появления фото */
@keyframes photoIn { from { transform: scale(.75); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.photo-slot img { animation: photoIn .3s var(--ease); }

.plus { font-size: 30px; color: var(--sub); }

/* Кнопка удаления фото */
.photo-del {
  position: absolute;
  top: 7px; right: 7px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  border: none;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* Кнопка «Выбрать фото» — мульти-выбор */
.btn-add-photos {
  width: 100%;
  padding: 14px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1.5px dashed var(--sub);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: opacity .15s;
}
.btn-add-photos:active { opacity: .7; }
.btn-add-photos-icon { font-size: 20px; line-height: 1; }

.photo-hint {
  text-align: center;
  font-size: 12px;
  color: var(--sub);
  margin: 0 0 14px;
}

/* Оверлей загрузки поверх фото */
.photo-uploading {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  border-radius: inherit;
}
.photo-uploading::after {
  content: '';
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.video-slot {
  background: var(--card);
  border-radius: var(--radius);
  width: 33.3%;
  aspect-ratio: 3/4;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: var(--sub);
  font-size: 13px;
  transition: opacity .15s;
}
.video-slot:active { opacity: .7; }


/* ══════════════════════════════════════════════
   VERIFICATION
══════════════════════════════════════════════ */
.verif-body {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 30px 24px 8px;
}

.verif-list { display: flex; flex-direction: column; gap: 28px; margin-bottom: 40px; width: 100%; }

.verif-item { display: flex; align-items: flex-start; gap: 16px; text-align: left; }

.verif-icon {
  width: 44px; height: 44px;
  background: var(--card);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.verif-item h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.verif-item p  { font-size: 13px; color: var(--sub); line-height: 1.4; }


/* ══════════════════════════════════════════════
   CAMERA
══════════════════════════════════════════════ */
#screen-camera { background: #000; }

#cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.cam-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
  pointer-events: none;
}

.cam-circle {
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.85);
  box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
}

.cam-hint { color: #fff; font-size: 16px; font-weight: 500; text-shadow: 0 1px 4px rgba(0,0,0,.7); }

.cam-capture {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom,0px) + 56px);
  left: 50%; transform: translateX(-50%);
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 3px solid #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .15s;
}
.cam-capture:active { transform: translateX(-50%) scale(.9); }

.cam-capture-inner { width: 54px; height: 54px; border-radius: 50%; background: #fff; display: block; }

.cam-close {
  position: absolute;
  top: calc(env(safe-area-inset-top,0px) + 16px);
  right: 20px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  border: none; color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}


/* ══════════════════════════════════════════════
   SUCCESS + CONFETTI  (Идея 8)
══════════════════════════════════════════════ */
.success-screen { align-items: center; justify-content: center; position: relative; }

#confetti-canvas {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.success-inner { text-align: center; padding: 40px 30px; }

@keyframes successPop { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.success-emoji { font-size: 72px; margin-bottom: 24px; animation: successPop .5s var(--ease) .1s both; }


/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.footer {
  padding: 12px 20px env(safe-area-inset-bottom, 28px);
  background: var(--bg);
  flex-shrink: 0;
}

.legal { font-size: 11px; color: var(--sub); text-align: center; margin-top: 12px; line-height: 1.5; }
.legal u { cursor: pointer; }


/* ══════════════════════════════════════════════
   BUTTONS  (Идея 6 — плавная активация)
══════════════════════════════════════════════ */
.btn-white {
  width: 100%;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 18px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: block;
  transition: background .35s, color .35s, opacity .15s;
}
.btn-white:active { opacity: .8; }

.btn-white.btn-dim {
  background: var(--card2);
  color: var(--sub);
}

.btn-ghost {
  width: 100%;
  background: var(--card);
  color: var(--text);
  border: none;
  border-radius: 50px;
  padding: 16px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  display: block;
}

.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }


/* ══════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  align-items: flex-end;
  animation: fadeIn .2s;
}
.modal.open { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
  background: #1C1C1E;
  border-radius: 24px 24px 0 0;
  padding: 12px 20px env(safe-area-inset-bottom, 30px);
  width: 100%;
  animation: slideUp .25s var(--ease);
}

.modal-sheet.tall {
  max-height: 80vh;
  display: flex; flex-direction: column;
}
.modal-sheet.tall .opt-list { overflow-y: auto; flex: 1; }

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 18px; }
.modal-sheet h3 { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 16px; }
.modal-sheet .finput { margin-bottom: 8px; }


/* ══════════════════════════════════════════════
   OPTION LIST
══════════════════════════════════════════════ */
.opt-list { margin-top: 6px; }

.opt-item {
  padding: 14px 8px;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
  color: var(--text);
}
.opt-item:active { background: var(--card2); }
.opt-item.sel { color: var(--amber); }


/* ══════════════════════════════════════════════
   GOAL CARDS  (Идея 10)
══════════════════════════════════════════════ */
.goal-cards { display: flex; flex-direction: column; gap: 10px; }

.goal-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card2);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .2s, background .2s, transform .15s;
}
.goal-card:active { transform: scale(.98); }
.goal-card.selected { border-color: var(--text); background: rgba(255,255,255,.05); }

.goal-card-icon { font-size: 32px; flex-shrink: 0; }
.goal-card-title { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.goal-card-desc  { font-size: 13px; color: var(--sub); }


/* ══════════════════════════════════════════════
   DATE WHEEL PICKER  (Идея 5)
══════════════════════════════════════════════ */
.wheel-picker {
  display: flex;
  height: 220px;
  position: relative;
  overflow: hidden;
}

.wheel-highlight {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  left: 8px; right: 8px;
  height: 44px;
  background: rgba(255,255,255,.07);
  border-radius: 10px;
  pointer-events: none;
  z-index: 1;
}

.wheel-col {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 28%, black 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 28%, black 72%, transparent 100%);
}
.wheel-col::-webkit-scrollbar { display: none; }

.wheel-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: 18px;
  color: var(--text);
  user-select: none;
}


/* ══════════════════════════════════════════════
   HEIGHT RULER  (Идея 9 — тактильная вибрация в JS)
══════════════════════════════════════════════ */
.height-display {
  text-align: center;
  font-size: 52px;
  font-weight: 700;
  margin: 4px 0 20px;
  transition: transform .1s;
}
.height-display.bump { animation: hBump .12s var(--ease); }
@keyframes hBump { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.height-unit { font-size: 28px; font-weight: 400; color: var(--sub); }

.ruler-wrap { position: relative; height: 80px; overflow: hidden; }

.ruler-needle {
  position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 2px; background: var(--amber); z-index: 2; border-radius: 1px;
}

.ruler-scroll {
  overflow-x: auto; overflow-y: hidden; height: 100%; scrollbar-width: none;
}
.ruler-scroll::-webkit-scrollbar { display: none; }

.ruler-track { height: 100%; position: relative; display: flex; align-items: flex-end; }

/* ══════════════════════════════════════════════
   MAIN APP — Apple b/w
════════════════════════════════════════════════ */

:root {
  --ios-bg:        #000000;
  --ios-card:      #1C1C1E;
  --ios-card2:     #2C2C2E;
  --ios-border:    rgba(255,255,255,0.08);
  --ios-separator: rgba(255,255,255,0.12);
  --ios-text:      #FFFFFF;
  --ios-sub:       #8E8E93;
  --ios-sub2:      #AEAEB2;
  --ios-danger:    #FF453A;
  --tab-h:         62px;
  --header-h:      54px;
}

.state-screen {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--ios-bg);
}
.state-screen.active { display: flex; }
.state-inner { text-align: center; max-width: 320px; }
.state-icon { font-size: 64px; margin-bottom: 16px; }
.state-screen h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.3px; }
.state-screen .sub { color: var(--ios-sub); font-size: 15px; line-height: 1.45; }
.mt16 { margin-top: 16px; }
.mt8  { margin-top: 8px; }

/* ── FAMILY Subscription Screen ───────────────────────────────────────── */
.black-screen {
  background: #000;
  display: none;
  flex-direction: column;
}
.black-screen.active { display: flex; }
.black-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: env(safe-area-inset-top, 52px) 24px calc(env(safe-area-inset-bottom, 0px) + 28px);
}
.black-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}
.black-title {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 5px;
}
.black-meta-left {
  font-size: 12px;
  letter-spacing: 3px;
  color: #6E6E73;
  margin-top: 5px;
}
.black-price-wrap { text-align: right; }
.black-price {
  font-size: 26px;
  font-weight: 700;
  color: #C9A84C;
}
.black-meta-right {
  font-size: 12px;
  color: #6E6E73;
  margin-top: 5px;
}
.black-features {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  margin-bottom: 24px;
}
.black-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  font-size: 15px;
  color: #fff;
  border-bottom: 0.5px solid #1C1C1C;
}
.black-features li::before {
  content: '✓';
  color: #C9A84C;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.black-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-black-pay {
  width: 100%;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 18px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-black-pay:disabled { opacity: 0.55; }
.btn-black-pay:active   { opacity: 0.8; }
.btn-black-skip {
  background: transparent;
  border: none;
  color: #6E6E73;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  padding: 10px;
  text-align: center;
  width: 100%;
}

/* ── Экран оплаты (Оплатить / Проверить оплату) ───────────────────── */
.pay-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.pay-logo { font-size: 56px; margin-bottom: 10px; }
.pay-amount {
  font-size: 44px;
  font-weight: 800;
  color: #C9A84C;
  line-height: 1.1;
  margin-top: 14px;
}
.pay-duration {
  font-size: 13px;
  letter-spacing: 2px;
  color: #6E6E73;
  margin-top: 6px;
  text-transform: uppercase;
}
.pay-hint {
  font-size: 14px;
  color: #8E8E93;
  line-height: 1.5;
  margin: 22px 6px 0;
}
.pay-status {
  font-size: 14px;
  color: #C9A84C;
  line-height: 1.45;
  margin: 16px 6px 0;
  min-height: 18px;
}
.pay-status.ok { color: #34C759; font-weight: 600; }
.pay-status.wait { color: #8E8E93; }
.btn-pay-check {
  width: 100%;
  background: transparent;
  color: #C9A84C;
  border: 1.5px solid #C9A84C;
  border-radius: 50px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-pay-check:disabled { opacity: .55; }
.btn-pay-check:active { opacity: .8; }
.btn-black-inline {
  margin-top: 20px;
  background: #C9A84C;
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
}
.oferta-text {
  font-size: 12px;
  color: #6E6E73;
  text-align: center;
  margin-top: 6px;
  line-height: 1.4;
}
.oferta-text a {
  color: #C9A84C;
  text-decoration: underline;
}
.email-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
}
.email-modal-content {
  background: #1c1c1e;
  border-radius: 24px;
  width: 100%; max-width: 480px;
  padding: 28px 22px 22px;
  color: #fff;
}
.email-modal-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  text-align: center;
}
.email-modal-sub {
  font-size: 14px;
  color: #8e8e93;
  text-align: center;
  margin: 0 0 18px;
}
.email-input-wrap {
  position: relative;
  background: #000;
  border: 1.5px solid #C9A84C;
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  display: flex; align-items: center; gap: 10px;
}
.email-input-icon {
  color: #C9A84C;
  font-size: 18px;
  font-weight: 600;
}
.email-input {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  padding: 12px 0;
}
.email-input::placeholder { color: #6e6e73; }
.email-submit-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #C9A84C;
  color: #000;
  border: none;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 44px;
}
.email-submit-btn:disabled { opacity: 0.5; }
.email-cancel-btn {
  margin-top: 14px;
  background: transparent;
  border: none;
  color: #6e6e73;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  padding: 10px;
}

/* ── Main screen layout ─────────────────────────────────────────────── */
.main-screen {
  display: none;
  flex-direction: column;
  background: var(--ios-bg);
}
.main-screen.active { display: flex; }

.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}

.app-header {
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0,0,0,0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--ios-separator);
}
.app-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.icon-btn {
  background: transparent;
  border: none;
  color: var(--ios-text);
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:active { opacity: 0.5; background: rgba(255,255,255,0.06); }
/* iOS WKWebView: тап по прозрачной области SVG не доходит до кнопки.
   Перенаправляем все клики на кнопку, не на её содержимое. */
.icon-btn svg, .icon-btn span { pointer-events: none; }
button svg, label svg { pointer-events: none; }

/* Кнопки справа в шапке "Анкеты" — большие, чёткие, чтобы пальцем точно попасть */
.hdr-buttons {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.hdr-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s, transform .12s;
  -webkit-tap-highlight-color: rgba(255,255,255,0.06);
  padding: 0;
}
.hdr-btn:hover { background: rgba(255,255,255,0.06); }
.hdr-btn:active { background: rgba(255,255,255,0.12); transform: scale(0.92); }
.hdr-btn svg { width: 24px; height: 24px; pointer-events: none; }

/* Экран "Кто меня лайкнул" */
.incoming-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 14px;
  align-content: start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* Одиночная карточка — занимает всю ширину, чтобы не выглядело пустым */
.incoming-grid:has(.incoming-card:only-child) .incoming-card {
  grid-column: 1 / -1;
  max-width: 280px;
  margin: 0 auto;
  width: 100%;
}
.incoming-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--ios-card);
  cursor: pointer;
  transition: transform .12s;
}
.incoming-card:active { transform: scale(0.96); }
.incoming-photo {
  aspect-ratio: 4 / 5;
  background: #2c2c2e;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  color: rgba(255,255,255,0.4);
  overflow: hidden;
}
.incoming-photo img { width: 100%; height: 100%; object-fit: cover; }
.incoming-info { padding: 10px 12px; }
.incoming-name { font-size: 15px; font-weight: 600; color: #fff; }
.incoming-meta { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* Range-слайдер для возрастных фильтров */
.filter-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  outline: none;
  margin: 8px 0;
}
.filter-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid #0A84FF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.filter-range::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid #0A84FF;
}

/* ── Tab Bar ─────────────────────────────────────────────────────────── */
.tab-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(0,0,0,0.85);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 0.5px solid var(--ios-separator);
  display: flex;
  z-index: 50;
}
.tab-btn-main {
  flex: 1;
  position: relative;
  background: none;
  border: none;
  color: var(--ios-sub);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  cursor: pointer;
  transition: color 0.15s;
  padding-top: 6px;
}
.tab-btn-main svg { color: currentColor; }
.tab-btn-main.active { color: var(--ios-text); }
.tab-btn-main:active { opacity: 0.6; }

.tab-badge-main {
  position: absolute;
  top: 4px;
  right: 50%;
  transform: translateX(16px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--ios-danger);
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════
   TAB 1: BROWSE (swipe cards)
════════════════════════════════════════════════ */

.browse-wrap {
  flex: 1;
  position: relative;
  padding: 8px 8px 4px;
  /* overflow убран: иначе клон карточки при свайпе обрезается за пределами контейнера. */
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.browse-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 32px;
}
.browse-empty h2 { font-size: 20px; font-weight: 700; margin: 12px 0 6px; }
.browse-empty .sub { color: var(--ios-sub); font-size: 14px; }

.browse-skeleton {
  display: none;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #222 50%, #1a1a1a 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: 20px;
}

/* ══════════════════════════════════════════════
   BROWSE CARD — Tinder/Hinge редизайн
   Полноэкранное фото + frosted-glass info снизу
══════════════════════════════════════════════ */
.browse-card {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  border-radius: 22px;
  background: #1a1a1c;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 0 0 0.5px rgba(255,255,255,0.06),
    0 24px 60px rgba(0,0,0,0.55),
    0 6px 20px rgba(0,0,0,0.35);
  transition: transform 0.32s cubic-bezier(.25,.46,.45,.94), opacity 0.32s;
  isolation: isolate;
}
/* (анимации полёта карточек удалены — будут переделаны заново) */

/* Фото — на ВСЮ карточку, без отступов. Info будет absolute поверх. */
.browse-photo {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #1a1a1c;
}

.photo-stack {
  position: absolute;
  inset: 0;
  background: #1a1a1c;
}
.photo-stack img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.18s ease;
}
.photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 80px; color: rgba(255,255,255,0.25);
  background: linear-gradient(135deg, #2c2c2e 0%, #1c1c1e 100%);
}

/* Story-style progress bars — тоньше, ярче, со светящимся active */
.photo-progress {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  display: flex;
  gap: 4px;
  z-index: 4;
  pointer-events: none;
}
.pp-seg {
  flex: 1;
  height: 2.5px;
  background: rgba(255,255,255,0.32);
  border-radius: 2px;
  transition: background .25s;
}
.pp-seg.active {
  background: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,0.6);
}

/* Тап-зоны: левая/правая трети — переключают фото; средняя оставлена для жестов.
   Высота — на всю карточку, чтобы тап в области info-блока тоже листал фото.
   Чтобы info-кнопки оставались кликабельными — у .browse-info стоит
   pointer-events:none, а у её button'ов pointer-events:auto (см. ниже). */
.photo-nav {
  position: absolute;
  top: 0; bottom: 0;
  width: 33%;
  background: transparent;
  border: none;
  z-index: 3;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.photo-nav.left  { left: 0; }
.photo-nav.right { right: 0; }

/* Многослойный градиент-overlay снизу для читаемости текста на любом фото.
   Высота 50% (было 65%) — иначе при компактном info-блоке тёмная подложка
   уходит сильно выше текста и создаёт ощущение, что половина фото залита. */
.browse-gradient {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 50%;
  background:
    linear-gradient(180deg,
      transparent 0%,
      rgba(0,0,0,0.0) 20%,
      rgba(0,0,0,0.45) 55%,
      rgba(0,0,0,0.85) 88%,
      rgba(0,0,0,0.95) 100%);
  pointer-events: none;
  z-index: 2;
}

/* Info — большая зона снизу карточки, поверх градиента.
   pointer-events:none пропускает тапы вниз к .photo-nav, чтобы можно
   было листать фото тапом в любой части карточки, включая область info.
   Кнопки внутри (.expand-btn, .browse-pill) явно получают auto.
   Прижато ближе к низу + компактные gap'ы — иначе при длинном ФИО
   и био на 2 строки info-блок поднимается в центр карточки и закрывает
   лицо человека на фото. */
.browse-info {
  position: absolute;
  left: 18px; right: 18px; bottom: 16px;
  color: #fff;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}
.browse-info button { pointer-events: auto; }
.browse-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.browse-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.browse-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.browse-verified svg { width: 24px; height: 24px; }

/* Био на тёмной подложке с лёгким frosted-glass — премиум */
.browse-bio {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.32;
  color: rgba(255,255,255,0.96);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.1px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Stats — горизонтальные чипы с иконками, frosted-glass */
.browse-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.browse-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.95);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 0.5px solid rgba(255,255,255,0.12);
  padding: 3px 9px;
  border-radius: 11px;
  letter-spacing: -0.1px;
}
.browse-stat svg {
  width: 13px; height: 13px;
  stroke: rgba(255,255,255,0.85);
}

/* Цветные «теговые» чипы — для goal/activity, более яркие чем stats */
.browse-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.browse-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 11px;
  letter-spacing: -0.1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.browse-tag-goal     { background: linear-gradient(135deg, rgba(255,69,58,0.85), rgba(255,159,10,0.85)); color: #fff; }
.browse-tag-activity { background: linear-gradient(135deg, rgba(10,132,255,0.85), rgba(94,92,230,0.85));  color: #fff; }

/* Pill — Apple-style: белый круг с blur, для основного действия */
.browse-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #000;
  border: none;
  padding: 11px 20px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: transform .15s, background .15s;
  white-space: nowrap;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.browse-pill:active { transform: scale(0.94); background: rgba(255,255,255,1); }
.browse-pill svg { width: 14px; height: 14px; color: #FF453A; }

.browse-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}
/* Когда expand-btn скрыта (например, в собственном профиле) — pill ставим
   к правому краю, чтобы не висел в начале как одинокий flex-item. */
.browse-row-bottom-end { justify-content: flex-end; }

/* Кнопка раскрытия деталей — frosted-glass круг */
.expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  transition: transform .15s, background .15s;
  flex-shrink: 0;
}
.expand-btn:active { transform: scale(0.92); background: rgba(255,255,255,0.3); }

/* Browse-details — pull-up sheet с полной инфой о профиле */
.browse-details {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(20,20,22,0.96);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(.4,0,.2,1);
  z-index: 6;
  padding: 0 22px;
}
.browse-details.open {
  max-height: 75%;
  overflow-y: auto;
  padding: 0 22px 24px;
}

/* Drag-handle — серая полоска сверху, тап = закрыть.
   touch-action: none — чтобы не конфликтовать со скроллом панели. */
.bd-handle {
  position: sticky;
  top: 0;
  left: 0; right: 0;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20,20,22,0.96);
  margin: 0 -22px;
  padding: 0 22px;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}
.bd-handle::before {
  content: '';
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.3);
  transition: background .15s, width .15s;
}
.bd-handle:active::before {
  background: rgba(255,255,255,0.55);
  width: 50px;
}
.browse-details:not(.open) .bd-handle { display: none; }

/* Когда панель открыта — фото "затемняется" + тап по нему закрывает */
.browse-card.details-open .photo-stack { filter: brightness(0.55); }
.browse-card.details-open .photo-nav   { pointer-events: none; }
.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.detail-val {
  font-size: 16px;
  color: #fff;
  line-height: 1.45;
  letter-spacing: -0.1px;
}

.browse-details {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(20,20,20,0.96);
  backdrop-filter: blur(20px);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
  z-index: 5;
}
.browse-details.open {
  max-height: 70%;
  overflow-y: auto;
  padding: 20px 18px;
}
.detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--ios-separator);
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  font-size: 11px;
  color: var(--ios-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.detail-val {
  font-size: 15px;
  color: #fff;
  line-height: 1.4;
}

.browse-actions {
  display: none;
  justify-content: space-evenly;
  align-items: center;
  gap: 0;
  padding: 14px 16px 16px;
}
.swipe-btn {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 0.5px solid rgba(255,255,255,0.08);
  background: rgba(28,28,30,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(.4,0,.2,1), box-shadow .18s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.swipe-btn:active { transform: scale(0.9); }
.swipe-btn:hover  { box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
.swipe-rewind                { color: #FF9F0A; }
.swipe-rewind:active         { background: rgba(255,159,10,0.95); color: #fff; }
.swipe-pass                  { color: #FF453A; }
.swipe-pass:active           { background: rgba(255,69,58,0.95); color: #fff; }
.swipe-like                  { color: #30D158; }
.swipe-like:active           { background: rgba(48,209,88,0.95); color: #fff; }
.swipe-btn svg               { width: 26px; height: 26px; }
.swipe-rewind svg            { width: 22px; height: 22px; }

/* ══════════════════════════════════════════════
   TAB 2: CHATS
════════════════════════════════════════════════ */

.new-matches-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 12px 16px 8px;
  scrollbar-width: none;
  border-bottom: 0.5px solid var(--ios-separator);
}
.new-matches-strip::-webkit-scrollbar { display: none; }
.nm-avatar {
  flex-shrink: 0;
  width: 64px;
  text-align: center;
  cursor: pointer;
}
.nm-avatar img {
  width: 60px; height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  display: block;
  margin: 0 auto 4px;
}
.nm-fallback {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--ios-card2);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  margin: 0 auto 4px;
  font-size: 26px;
}
.nm-name {
  font-size: 11px;
  color: var(--ios-sub2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chats-list {
  flex: 1;
  overflow-y: auto;
}
.chat-row {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 0.5px solid var(--ios-separator);
}
.chat-row:active { background: rgba(255,255,255,0.04); }
.chat-row-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ios-card2);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.chat-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.chat-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.chat-row-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-row-time {
  font-size: 12px;
  color: var(--ios-sub);
  flex-shrink: 0;
}
.chat-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.chat-row-preview {
  font-size: 14px;
  color: var(--ios-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.chat-row-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #fff;
  color: #000;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chats-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 32px;
  flex: 1;
}
.chats-empty h2 { font-size: 18px; font-weight: 700; margin: 10px 0 6px; }
.chats-empty .sub { color: var(--ios-sub); font-size: 14px; line-height: 1.45; }

/* ══════════════════════════════════════════════
   CHAT DETAIL (messenger)
════════════════════════════════════════════════ */

.chat-screen {
  display: none;
  flex-direction: column;
  background: var(--ios-bg);
}
.chat-screen.active { display: flex; }

.chat-header {
  height: var(--header-h);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky; top: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--ios-separator);
  z-index: 10;
  flex-shrink: 0;
}
.chat-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  min-width: 0;
  transition: opacity .15s;
}
.chat-peer:active { opacity: 0.55; }
.chat-peer-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ios-card2);
}
.chat-peer-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-peer-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  line-height: 1.1;
}
.chat-peer-status {
  font-size: 12px;
  color: var(--ios-sub);
  line-height: 1.1;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-date {
  align-self: center;
  font-size: 11px;
  color: var(--ios-sub);
  padding: 8px 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.chat-bubble {
  max-width: 78%;
  padding: 7px 11px 6px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.32;
  word-wrap: break-word;
  position: relative;
  animation: bubble-in 0.18s ease-out;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.chat-bubble.mine {
  align-self: flex-end;
  background: #fff;
  color: #000;
  border-bottom-right-radius: 4px;
}
.chat-bubble.theirs {
  align-self: flex-start;
  background: var(--ios-card2);
  color: #fff;
  border-bottom-left-radius: 4px;
}
.chat-msg-text { white-space: pre-wrap; }
.chat-img {
  max-width: 240px;
  border-radius: 12px;
  display: block;
  margin-bottom: 4px;
  cursor: pointer;
}
.chat-msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  float: right;
  margin-left: 8px;
  margin-top: 2px;
  font-size: 10px;
  opacity: 0.65;
}
.chat-bubble.mine   .chat-msg-meta { color: #333; }
.chat-bubble.theirs .chat-msg-meta { color: var(--ios-sub); }
.chat-tick { vertical-align: middle; }
.chat-tick.read { color: #000; }
.chat-bubble.mine .chat-tick.read { color: #007AFF; /* единственный синий акцент — галочки прочитано, как в iMessage */ }

.typing-indicator {
  align-self: flex-start;
  padding: 8px 14px;
  margin: 0 10px 6px;
  background: var(--ios-card2);
  border-radius: 18px;
  display: flex;
  gap: 3px;
}
.typing-indicator span {
  width: 6px; height: 6px;
  background: var(--ios-sub);
  border-radius: 50%;
  animation: typing 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%,60%,100% { opacity: 0.3; transform: translateY(0); }
  30%         { opacity: 1;   transform: translateY(-3px); }
}

/* ══ Sheet (action menu) ══ */
.sheet {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sheet-inner {
  background: var(--ios-card); color: #fff;
  width: 100%; max-width: 420px;
  border-radius: 18px 18px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 6px;
  animation: sheetUp .25s ease-out;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet-title {
  font-size: 12px; color: var(--ios-sub);
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 6px 0 4px; text-align: center;
}
.sheet-btn {
  background: var(--ios-card2); color: #fff;
  border: none; border-radius: 12px;
  padding: 14px; font-size: 15px;
  cursor: pointer; text-align: center;
}
.sheet-btn:active { opacity: .7; }
.sheet-btn.danger { color: #FF453A; font-weight: 600; }

.chat-input-wrap {
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--ios-bg);
  border-top: 0.5px solid var(--ios-separator);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--ios-card);
  border: 0.5px solid var(--ios-border);
  border-radius: 20px;
  padding: 9px 14px;
  color: #fff;
  font-size: 15px;
  min-height: 38px;
  max-height: 120px;
  resize: none;
  font-family: inherit;
  outline: none;
}
.chat-input::placeholder { color: var(--ios-sub); }
.chat-send {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
  flex-shrink: 0;
}
.chat-send:active { transform: scale(0.88); }

.photo-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }
.photo-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.pv-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* ══════════════════════════════════════════════
   MATCH POPUP
════════════════════════════════════════════════ */

.match-screen {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
}
.match-screen.active { display: flex; }
.match-inner {
  text-align: center;
  max-width: 360px;
  width: 100%;
}
.match-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #fff 0%, #888 50%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 2.5s linear infinite;
  background-size: 200% auto;
  margin-bottom: 28px;
}
@keyframes shine { to { background-position: 200% center; } }

.match-photos {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
}
.match-photo {
  width: 130px; height: 160px;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid #fff;
  background: var(--ios-card2);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.match-photo:first-child { transform: rotate(-8deg) translateX(10px); }
.match-photo:last-child  { transform: rotate(8deg)  translateX(-10px); }
.match-photo img { width: 100%; height: 100%; object-fit: cover; }

.match-sub {
  color: var(--ios-sub);
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.4;
}

/* ══════════════════════════════════════════════
   TAB 3: NOTIFICATIONS
════════════════════════════════════════════════ */

.notif-list {
  flex: 1;
  overflow-y: auto;
}
.notif-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--ios-separator);
  position: relative;
}
.notif-row.unread::before {
  content: '';
  position: absolute;
  left: 6px; top: 50%;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  transform: translateY(-50%);
}
.notif-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ios-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.notif-sub {
  font-size: 13px;
  color: var(--ios-sub);
  margin-top: 2px;
}
.notif-time {
  font-size: 12px;
  color: var(--ios-sub);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   TAB 4: PROFILE
════════════════════════════════════════════════ */

/* Профиль рендерит карточку как в browse, плюс iOS-меню действий снизу */
.profile-wrap {
  flex: 1;
  position: relative;
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.profile-wrap > .browse-card {
  flex: 0 0 auto;
  width: 100%;
  /* высота карточки = фото (aspect-ratio 4/5) + info, без явного aspect-ratio */
}

/* "+" в углу фото-вкладки — frosted glass, добавить фото */
.browse-photo .pf-add-photo {
  position: absolute;
  top: 12px; left: 12px;
  width: 64px; height: 64px;
  border-radius: 18px;
  background: rgba(48,209,88,0.92);
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  cursor: pointer;
  z-index: 4;
  transition: transform .15s, background .15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.browse-photo .pf-add-photo:active { transform: scale(0.93); background: rgba(30,180,60,0.95); }
.browse-photo .pf-add-photo svg { width: 26px; height: 26px; }
.browse-photo .pf-add-photo::after {
  content: 'Фото';
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}

/* Корзина — frosted glass, удалить текущее фото */
.browse-photo .pf-trash {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 0.5px solid rgba(255,255,255,0.18);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 4;
  transition: transform .15s, background .15s;
}
.browse-photo .pf-trash:active { transform: scale(0.92); background: rgba(255,69,58,0.7); }
.browse-photo .pf-trash svg { width: 17px; height: 17px; }

/* iOS-grouped-list под карточкой */
.pf-menu {
  margin-top: 14px;
  background: var(--ios-card);
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.pf-menu-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 0.5px solid var(--ios-separator);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  gap: 12px;
  font-family: inherit;
  transition: background .12s;
}
.pf-menu-row:last-child { border-bottom: none; }
.pf-menu-row:active { background: rgba(255,255,255,0.05); }

.pf-menu-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.pf-menu-icon svg { width: 18px; height: 18px; }

.pf-mi-edit    { background: #0A84FF; }
.pf-mi-history { background: #FF9F0A; }
.pf-mi-help    { background: #5E5CE6; }
.pf-mi-danger  { background: #FF453A; }

.pf-menu-label {
  flex: 1;
  font-size: 15px;
  color: #fff;
}
.pf-menu-row-danger .pf-menu-label { color: #FF453A; font-weight: 600; }

.pf-menu-chev {
  font-size: 22px;
  color: rgba(255,255,255,0.32);
  line-height: 1;
  flex-shrink: 0;
}

/* ── Hero carousel ──────────────────────────────────────────────────── */
.pf-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #111;
  overflow: hidden;
  border-radius: 0 0 22px 22px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.pf-slides {
  position: absolute; inset: 0;
}
.pf-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity .32s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.pf-slide.active { opacity: 1; }

/* Touch zones for tap-to-nav */
.pf-tap {
  position: absolute; top: 60px; bottom: 100px;
  width: 33%;
  z-index: 3;
}
.pf-tap-l { left: 0; }
.pf-tap-r { right: 0; }

/* Story-style progress bars at top */
.pf-progress {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  display: flex;
  gap: 4px;
  z-index: 4;
  pointer-events: none;
}
.pf-seg {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.28);
  border-radius: 2px;
  overflow: hidden;
  transition: background .2s;
}
.pf-seg.active { background: rgba(255,255,255,0.95); }

/* Bottom gradient overlay */
.pf-grad {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
  z-index: 2;
}

.pf-overlay {
  position: absolute;
  left: 20px; right: 20px; bottom: 22px;
  z-index: 3;
  pointer-events: none;
}
.pf-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.pf-meta {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.1px;
}

/* Trash button (frosted-glass) */
.pf-trash {
  position: absolute;
  top: 32px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 0.5px solid rgba(255,255,255,0.18);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: transform .15s, background .15s;
}
.pf-trash:active { transform: scale(0.92); background: rgba(255,69,58,0.7); }
.pf-trash svg { width: 17px; height: 17px; }

/* Empty state */
.pf-hero.pf-empty {
  background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
  display: flex; align-items: center; justify-content: center;
}
.pf-empty-add {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  cursor: pointer;
  z-index: 3;
}
.pf-empty-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px dashed rgba(255,255,255,0.3);
  font-size: 36px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85);
}
.pf-empty-text {
  font-size: 15px; font-weight: 500;
  color: rgba(255,255,255,0.85);
}

/* ── Body / cards ───────────────────────────────────────────────────── */
.pf-body {
  padding: 18px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pf-card {
  background: var(--ios-card);
  border-radius: 16px;
  padding: 14px 16px;
}
.pf-card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ios-sub);
  margin-bottom: 8px;
}
.pf-about {
  font-size: 15px;
  line-height: 1.45;
  color: #fff;
  white-space: pre-wrap;
}

.pf-list { padding: 4px 16px; }
.pf-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 0.5px solid var(--ios-separator);
  gap: 12px;
}
.pf-row:last-child { border-bottom: none; }
.pf-row-label {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.pf-row-val {
  font-size: 15px;
  color: #fff;
  text-align: right;
  word-break: break-word;
}
.pf-row-mute { color: rgba(255,255,255,0.55); }

.pf-soc {
  display: inline-block;
  width: 18px; height: 18px;
  border-radius: 5px;
  flex-shrink: 0;
}
.pf-soc-ig { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.pf-soc-tg { background: #2AABEE; }
.pf-soc-vk { background: #0077FF; }

/* ── Actions ────────────────────────────────────────────────────────── */
.pf-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.pf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  border: none;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}
.pf-btn:active { transform: scale(0.98); opacity: 0.85; }
.pf-btn-primary {
  background: #fff;
  color: #000;
}
.pf-btn-ghost {
  background: var(--ios-card);
  color: #fff;
}

.file-btn {
  display: flex;
  text-align: center;
  cursor: pointer;
}

/* ══════════════════════════════════════════════
   CHAT — Phase 1 telegram-like
══════════════════════════════════════════════ */

/* Закреплённое сообщение — полоска под header */
.chat-pinned-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(28,28,30,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--ios-separator);
  cursor: pointer;
  flex-shrink: 0;
}
.chat-pin-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.chat-pin-content {
  flex: 1;
  min-width: 0;
  border-left: 2px solid #0A84FF;
  padding-left: 8px;
}
.chat-pin-label {
  font-size: 11px;
  color: #0A84FF;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.chat-pin-preview {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.chat-pin-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-pin-close:active { color: #fff; }

/* Реплай-quote внутри bubble */
.chat-quote {
  border-left: 3px solid currentColor;
  padding: 4px 8px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  cursor: pointer;
  max-width: 100%;
}
/* Цитата на тёмных bubble (theirs) — синий border + светло-серый текст */
.chat-bubble.theirs .chat-quote {
  color: #0A84FF;
  background: rgba(255,255,255,0.06);
}
.chat-bubble.theirs .chat-quote-text { color: rgba(255,255,255,0.85); }

/* Цитата на белых bubble (mine) — синий border + почти-чёрный текст
   Раньше тут был белый-на-белом, и quote был не виден. */
.chat-bubble.mine .chat-quote {
  color: #0A84FF;
  background: rgba(0,0,0,0.05);
}
.chat-bubble.mine .chat-quote-text { color: rgba(0,0,0,0.7); }

.chat-quote-author {
  font-size: 12px;
  font-weight: 600;
  color: currentColor;
}
.chat-quote-text {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.chat-quote-deleted { font-style: italic; opacity: 0.6; }

/* Удалённое сообщение */
.chat-msg-deleted {
  font-style: italic;
  opacity: 0.55;
}
.chat-bubble-deleted { opacity: 0.7; }

/* Метка "изм." */
.chat-msg-edited {
  font-size: 11px;
  opacity: 0.55;
  margin-right: 4px;
  font-style: italic;
}

/* Подсветка при scrollToMessage */
@keyframes chatBubbleFlash {
  0%   { background-color: rgba(10,132,255,0.4); }
  100% { background-color: transparent; }
}
.chat-bubble-flash {
  animation: chatBubbleFlash 1.5s ease-out;
  border-radius: 14px;
}

/* Compose-bar (reply/edit над инпутом) */
.chat-compose-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(28,28,30,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--ios-separator);
  flex-shrink: 0;
}
.chat-compose-icon {
  font-size: 16px;
  color: #0A84FF;
  flex-shrink: 0;
}
.chat-compose-content {
  flex: 1;
  min-width: 0;
  border-left: 2px solid #0A84FF;
  padding-left: 8px;
}
.chat-compose-label {
  font-size: 11px;
  color: #0A84FF;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.chat-compose-preview {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.chat-compose-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Action-sheet для long-press */
.msg-actions-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
.msg-actions-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: auto;
}
.msg-actions-sheet.open .msg-actions-backdrop { opacity: 1; }
.msg-actions-inner {
  position: absolute;
  left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(40,40,42,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 14px;
  overflow: hidden;
  pointer-events: auto;
  transform: translateY(20px);
  opacity: 0;
  transition: transform .25s, opacity .25s;
}
.msg-actions-sheet.open .msg-actions-inner {
  transform: translateY(0);
  opacity: 1;
}
.msg-action-btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 0.33px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 17px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.msg-action-btn:last-child { border-bottom: none; }
.msg-action-btn:active { background: rgba(255,255,255,0.08); }
.msg-action-btn.danger { color: #FF453A; }
.msg-action-btn.cancel {
  margin-top: 8px;
  border-radius: 14px;
  background: rgba(40,40,42,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-weight: 600;
  border-bottom: none;
}
@media (min-width: 768px) {
  /* На desktop модалка тоже внутри телефонной рамки */
  .msg-actions-sheet { position: absolute !important; }
  .msg-actions-inner { left: 12px; right: 12px; bottom: 80px; }
}

/* Peer-profile модалка */
.peer-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .25s;
}
.peer-profile-modal.open { opacity: 1; }
.pp-content {
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform .25s;
}
.peer-profile-modal.open .pp-content { transform: translateY(0); }
.pp-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 0.5px solid rgba(255,255,255,0.18);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 10;
}
.pp-close:active { transform: scale(0.92); }
.pp-card {
  /* В модалке нет родителя с фиксированной высотой, поэтому переопределяем
     height:100% от .browse-card на aspect-ratio — карточка получит
     пропорции 4:5 как у фото в browse, без растяжения. */
  height: auto;
  aspect-ratio: 4 / 5;
  flex: 0 0 auto;
}
.pp-details {
  margin-top: 12px;
  background: var(--ios-card);
  border-radius: 14px;
  padding: 4px 16px;
}
.pp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 0.5px solid var(--ios-separator);
  gap: 12px;
}
.pp-row:last-child { border-bottom: none; }
.pp-row-label {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  flex-shrink: 0;
}
.pp-row-val {
  font-size: 15px;
  color: #fff;
  text-align: right;
  word-break: break-word;
}
@media (min-width: 768px) {
  .peer-profile-modal { position: absolute !important; }
}

/* ══════════════════════════════════════════════
   VOICE MESSAGES (Phase 2)
══════════════════════════════════════════════ */

/* Голосовая bubble — фиксированная ширина с кнопкой+волной+таймером */
.chat-bubble-voice {
  min-width: 220px;
}
.voice-msg-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.voice-play {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.95);
  color: #0A84FF;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .12s;
  padding: 0;
}
.chat-bubble.theirs .voice-play { background: #0A84FF; color: #fff; }
.voice-play:active { transform: scale(0.92); }
.voice-play svg { width: 16px; height: 16px; }

.voice-wave {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  min-width: 0;
}
.vbar {
  display: block;
  flex: 1;
  background: rgba(255,255,255,0.4);
  border-radius: 1.5px;
  transition: background .15s;
  min-width: 2px;
}
.chat-bubble.theirs .vbar { background: rgba(10,132,255,0.35); }
.vbar.played { background: #fff; }
.chat-bubble.theirs .vbar.played { background: #0A84FF; }

.voice-duration {
  flex-shrink: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.2px;
}
.chat-bubble.theirs .voice-duration { color: rgba(255,255,255,0.7); }

/* Mic-кнопка */
.chat-mic {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ios-sub, #8e8e93);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .15s, background .15s, color .15s;
}
.chat-mic:active { transform: scale(0.92); }
.chat-mic.recording {
  background: #FF3B30;
  color: #fff;
  transform: scale(1.15);
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,48,0.5); }
  50%      { box-shadow: 0 0 0 12px rgba(255,59,48,0); }
}

/* Полоска поверх инпута во время записи */
.chat-recording-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(28,28,30,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--ios-separator, rgba(255,255,255,0.08));
  flex-shrink: 0;
}
.rec-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #FF3B30;
  animation: recPulse 1s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes recPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.rec-timer {
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #fff;
  flex-shrink: 0;
}
.rec-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  flex: 1;
  text-align: right;
}

/* ══════════════════════════════════════════════
   STICKERS / EMOJI PICKER (Phase 3)
══════════════════════════════════════════════ */

/* Стикер — большой эмодзи без bubble-фона */
.chat-sticker-wrap {
  display: flex;
  flex-direction: column;
  margin: 4px 12px;
  max-width: 200px;
  cursor: default;
}
.chat-sticker-wrap.mine   { align-self: flex-end; align-items: flex-end; }
.chat-sticker-wrap.theirs { align-self: flex-start; align-items: flex-start; }
.chat-sticker {
  font-size: 80px;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
}
.chat-msg-meta-sticker {
  margin-top: 4px;
  padding: 2px 8px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  color: rgba(255,255,255,0.95) !important;
}
.chat-sticker-fwd { width: 100%; }

/* Forwarded label */
.chat-fwd-label {
  font-size: 12px;
  color: #0A84FF;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-bubble.mine .chat-fwd-label { color: #0A84FF; }

/* Sticker picker bottom sheet */
.sticker-picker {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s;
}
.sticker-picker.open { opacity: 1; }
.sp-sheet {
  width: 100%;
  max-width: 480px;
  background: rgba(28,28,30,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 8px 12px max(16px, env(safe-area-inset-bottom));
  transform: translateY(20px);
  transition: transform .25s;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
}
.sticker-picker.open .sp-sheet { transform: translateY(0); }
.sp-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  margin: 0 auto 8px;
}
.sp-tabs {
  display: flex;
  gap: 24px;
  padding: 4px 8px 12px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
}
.sp-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  position: relative;
}
.sp-tab.active { color: #fff; font-weight: 600; }
.sp-tab.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -12px;
  height: 2px;
  background: #0A84FF;
  border-radius: 2px;
}
.sp-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 4px;
  padding: 14px 4px 10px;
}
.sp-grid.sp-grid-emoji {
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
}
.sp-item {
  background: none;
  border: none;
  font-size: 36px;
  line-height: 1;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s, transform .1s;
  font-family: inherit;
}
.sp-grid.sp-grid-emoji .sp-item { font-size: 24px; padding: 4px; }
.sp-item:active { background: rgba(255,255,255,0.12); transform: scale(0.94); }
.sp-item:hover  { background: rgba(255,255,255,0.06); }

/* Forward modal */
.forward-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s;
}
.forward-modal.open { opacity: 1; }
.fwd-sheet {
  width: 100%;
  max-width: 480px;
  background: rgba(28,28,30,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 8px 12px max(16px, env(safe-area-inset-bottom));
  transform: translateY(20px);
  transition: transform .25s;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.forward-modal.open .fwd-sheet { transform: translateY(0); }
.fwd-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  padding: 4px 0 12px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
}
.fwd-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.fwd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .12s;
}
.fwd-row:active { background: rgba(255,255,255,0.06); }
.fwd-row:hover  { background: rgba(255,255,255,0.04); }
.fwd-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ios-card2, #2c2c2e);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}
.fwd-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.fwd-name {
  font-size: 16px;
  color: #fff;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .sticker-picker, .forward-modal { position: absolute !important; }
}

/* ══════════════════════════════════════════════
   REACTIONS, MUTE, SEARCH, BLOCK (Sprint 2)
══════════════════════════════════════════════ */

/* Bubble-wrapper нужен чтобы реакции лежали ПОД bubble, но в той же колонке */
.chat-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}
.chat-bubble-wrap.mine   { align-self: flex-end;   align-items: flex-end; }
.chat-bubble-wrap.theirs { align-self: flex-start; align-items: flex-start; }
.chat-bubble-wrap > .chat-bubble { max-width: 100%; align-self: stretch; }

/* Реакции под bubble */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
  padding: 0 4px;
}
.msg-reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(60,60,67,0.5);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.msg-reaction:active { transform: scale(0.92); }
.msg-reaction.mine {
  background: rgba(10,132,255,0.25);
  border-color: rgba(10,132,255,0.55);
}
.msg-reaction span {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  opacity: 0.85;
}

/* Стикер-wrap уже flex-column — реакции тоже встанут */
.chat-sticker-wrap .msg-reactions { padding: 0; }

/* Muted чат в списке — приглушаем preview-текст и unread-бейджик */
.chat-row.muted .chat-row-preview { opacity: 0.6; }
.chat-row-muted-icon {
  font-size: 13px;
  margin-left: 6px;
  opacity: 0.55;
}
.chat-row-unread.muted {
  background: var(--ios-sub, #8e8e93) !important;
  color: rgba(255,255,255,0.8);
}

/* Search bar в чате */
.chat-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(28,28,30,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--ios-separator, rgba(255,255,255,0.08));
  flex-shrink: 0;
}
.chat-search-input {
  flex: 1;
  background: var(--ios-card2, #2c2c2e);
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.chat-search-input::placeholder { color: rgba(255,255,255,0.45); }

.chat-search-results {
  background: rgba(20,20,22,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-height: 50vh;
  overflow-y: auto;
}
.chat-search-results:empty { display: none; }
.search-row {
  padding: 10px 14px;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: background .12s;
}
.search-row:active { background: rgba(255,255,255,0.06); }
.search-author {
  font-size: 12px;
  color: var(--ios-sub, #8e8e93);
  margin-bottom: 3px;
}
.search-text {
  font-size: 14px;
  color: #fff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-text mark {
  background: rgba(255,159,10,0.45);
  color: #fff;
  border-radius: 2px;
  padding: 0 2px;
}
.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--ios-sub, #8e8e93);
  font-size: 14px;
}

/* ══════════════════════════════════════════════
   SPRINT 3 — Tinder фичи
══════════════════════════════════════════════ */

/* "Этот человек уже лайкнул тебя" */
.browse-likedme {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  background: linear-gradient(90deg, #FF9F0A, #FF453A);
  color: #fff;
  border-radius: 10px;
  margin-bottom: 4px;
  align-self: flex-start;
}
.browse-likedme.super {
  background: linear-gradient(90deg, #0A84FF, #BF5AF2);
}

/* (swipe-кнопки определены выше в основном блоке .browse-actions) */

/* (filter-range, badge-mini, incoming-likes-grid и связанные стили удалены —
    будут переделаны заново при возвращении соответствующих фич) */

/* ── Match popup — confetti + super glow ─────────────────────────── */
.match-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.confetti-piece {
  position: absolute;
  border-radius: 1px;
  will-change: transform;
}
@keyframes confettiFall {
  to {
    transform: translate(calc(var(--x-end) - 50vw), 110vh) rotate(var(--rot));
    opacity: 0.6;
  }
}

.match-screen.match-super .match-photo {
  box-shadow: 0 0 0 3px #0A84FF, 0 0 24px rgba(10,132,255,0.7);
}
.match-screen.match-super .match-title::before { content: '⭐ '; }

.match-inner { position: relative; z-index: 2; }

@media (min-width: 768px) {
  .match-confetti { position: absolute !important; }
}

/* ══════════════════════════════════════════════
   SPRINT 4 — POLISH
══════════════════════════════════════════════ */

/* Apple-style toast */
.app-toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: rgba(40,40,42,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 10px 14px 10px 12px;
  border-radius: 14px;
  z-index: 5000;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.1px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2,.9,.3,1.2), opacity .2s;
}
.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.app-toast-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-toast-icon svg { width: 20px; height: 20px; }
.app-toast-text {
  flex: 1;
  line-height: 1.3;
}
@media (min-width: 768px) {
  .app-toast { position: absolute !important; }
}

/* Skeleton loaders */
@keyframes skShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.chat-row-skeleton, .notif-row-skeleton {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  pointer-events: none;
}
.sk-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 100%);
  background-size: 200% 100%;
  animation: skShimmer 1.4s linear infinite;
  flex-shrink: 0;
}
.sk-avatar.small { width: 40px; height: 40px; }
.sk-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sk-line {
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 100%);
  background-size: 200% 100%;
  animation: skShimmer 1.4s linear infinite;
}
.sk-line-short { width: 35%; }
.sk-line-long  { width: 75%; }

/* Pull-to-refresh spinner */
.ptr-spinner {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%) translateY(-40px);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(40,40,42,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}
.ptr-spinner svg { width: 18px; height: 18px; }
.ptr-spinner.refreshing svg {
  animation: ptrRotate 1s linear infinite;
}
@keyframes ptrRotate {
  to { transform: rotate(360deg); }
}

/* Browse card fade-in при смене анкеты — поднимается снизу, как новая карта в стопке */
@keyframes cardFadeIn {
  0%   { opacity: 0; transform: translateY(40px) scale(0.92); }
  100% { opacity: 1; transform: none; }
}
.browse-card.card-fade-in {
  animation: cardFadeIn .42s cubic-bezier(.34,1.4,.64,1) both;
}

/* Empty state иллюстрации */
.state-illust {
  width: 120px;
  height: 120px;
  margin-bottom: 8px;
  opacity: 0.95;
}
.state-illust svg {
  width: 100%; height: 100%;
}

/* ══════════════════════════════════════════════
   PROFILE EDIT — iOS-grouped style
══════════════════════════════════════════════ */
#screen-profile-edit { background: #000; }

.ed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 10px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--ios-separator, rgba(255,255,255,0.08));
  flex-shrink: 0;
}
.ed-cancel, .ed-save {
  background: none;
  border: none;
  color: #0A84FF;
  font-size: 16px;
  font-weight: 400;
  padding: 4px 6px;
  cursor: pointer;
  min-width: 64px;
}
.ed-save { font-weight: 600; text-align: right; }
.ed-cancel { text-align: left; }
.ed-cancel:active, .ed-save:active { opacity: 0.55; }
.ed-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
}

.ed-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 40px;
  -webkit-overflow-scrolling: touch;
}

.ed-section-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--ios-sub, rgba(235,235,245,0.55));
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 18px 4px 8px;
}
.ed-section-title:first-child { padding-top: 4px; }

.ed-card {
  background: var(--ios-card, #1c1c1e);
  border-radius: 14px;
  overflow: hidden;
}

.ed-row {
  display: flex;
  align-items: center;
  padding: 0 14px;
  min-height: 50px;
  border-bottom: 0.5px solid var(--ios-separator, rgba(255,255,255,0.07));
  gap: 12px;
}
.ed-card .ed-row:last-child { border-bottom: none; }

.ed-row-input {
  padding: 8px 14px;
}
.ed-row-input .ed-row-label {
  flex-shrink: 0;
  width: 110px;
  font-size: 15px;
  color: rgba(255,255,255,0.95);
}
.ed-row-input .ed-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  font-size: 15px;
  color: #fff;
  padding: 10px 0;
  min-width: 0;
}
.ed-row-input .ed-input::placeholder { color: rgba(255,255,255,0.32); }

.ed-row-textarea {
  flex-direction: column;
  align-items: stretch;
  padding: 12px 14px;
  gap: 6px;
}
.ed-row-textarea .ed-row-label {
  font-size: 12px;
  color: var(--ios-sub, rgba(235,235,245,0.55));
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ed-textarea {
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  font-size: 15px;
  color: #fff;
  resize: vertical;
  min-height: 70px;
  width: 100%;
  padding: 0;
  line-height: 1.4;
}
.ed-textarea::placeholder { color: rgba(255,255,255,0.32); }

.ed-row-pick {
  cursor: pointer;
  transition: background .12s;
}
.ed-row-pick:active { background: rgba(255,255,255,0.04); }
.ed-row-pick .ed-row-label {
  font-size: 15px;
  color: rgba(255,255,255,0.95);
  flex-shrink: 0;
}
.ed-row-pick .ed-row-value {
  flex: 1;
  text-align: right;
  font-size: 15px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ed-row-value-empty { color: rgba(255,255,255,0.32) !important; }
.ed-chevron {
  font-size: 20px;
  color: rgba(255,255,255,0.32);
  flex-shrink: 0;
  line-height: 1;
}

.ed-row-label-icon {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

/* iOS segmented control */
.ed-row-segmented {
  justify-content: space-between;
  padding: 8px 14px;
}
.ed-row-segmented .ed-row-label {
  font-size: 15px;
  color: rgba(255,255,255,0.95);
  flex-shrink: 0;
}
.ed-segmented {
  display: inline-flex;
  background: rgba(120,120,128,0.24);
  border-radius: 9px;
  padding: 2px;
  gap: 0;
}
.ed-seg {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .18s, color .18s, transform .12s;
  min-width: 78px;
}
.ed-seg:active { transform: scale(0.97); }
.ed-seg.active {
  background: rgba(120,120,128,0.55);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.ed-foot-hint {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.32);
  padding: 18px 16px 0;
}

/* ══════════════════════════════════════════════
   DESKTOP / WIDE: phone-frame layout
   Срабатывает на ПК и в MAX desktop, оставляет
   мобильный fullscreen на телефонах.
══════════════════════════════════════════════ */
@media (min-width: 768px) {
  html {
    background: radial-gradient(circle at 30% 20%, #1a1a1c 0%, #050507 70%);
    height: 100vh;
    overflow: hidden;
  }
  body {
    position: relative;
    width: 440px;
    height: 96vh;
    max-height: 940px;
    margin: 0 auto;
    top: 50%;
    transform: translateY(-50%);
    background: #000;
    border-radius: 38px;
    overflow: hidden;
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.06),
      0 30px 90px rgba(0,0,0,0.75),
      0 8px 24px rgba(0,0,0,0.45);
  }
  /* Все экраны и модалки — внутри тела, не во viewport */
  .screen { position: absolute !important; }
  .modal  { position: absolute !important; }
  /* Hover-эффекты для PC */
  .pf-tap, .pf-trash, .pf-btn, .ed-row-pick, .ed-cancel, .ed-save,
  .tab-btn, .goal-card, .opt-item, .my-photo-del, .pf-manage {
    cursor: pointer;
  }
  .pf-trash:hover { background: rgba(255,69,58,0.55); }
  .pf-btn-primary:hover { opacity: 0.9; }
  .pf-btn-ghost:hover { background: rgba(255,255,255,0.08); }
  .ed-row-pick:hover { background: rgba(255,255,255,0.04); }
  /* Кастомный скроллбар, чтобы не выглядел как в Excel */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
}

/* ── Settings modal ──────────────────────────────────────────────────── */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--ios-separator);
  color: #fff;
  font-size: 15px;
}
.settings-action {
  margin-top: 14px;
  background: transparent;
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
}
.settings-action.danger { color: var(--ios-danger); }

.switch {
  position: relative;
  width: 51px; height: 31px;
  display: inline-block;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: #39393D;
  border-radius: 16px;
  transition: background 0.2s;
  cursor: pointer;
}
.slider::before {
  content: '';
  position: absolute;
  width: 27px; height: 27px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.switch input:checked + .slider { background: #fff; }
.switch input:checked + .slider::before { transform: translateX(20px); background: #000; }


