/* ════════════════════════════════════════════════════════
   Chat page — wizard + chat UI
   Brand: Flame (#2563EB → #3B82F6 on #FFFFFF)
   ════════════════════════════════════════════════════════ */

:root {
  --bg:        #FFFFFF;
  --bg-card:   #F8FAFC;
  --bg-card-2: #F1F5F9;
  --border:    rgba(37,99,235, 0.18);
  --border-strong: rgba(37,99,235, 0.45);
  --text:      #0F172A;
  --text-soft: #334155;
  --text-mute: #64748B;
  --red:       #2563EB;
  --red-deep:  #1E40AF;
  --orange:    #3B82F6;
  --orange-deep: #1E40AF;
  --green:     #16A34A;
  --pink:      #2563EB;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.chat-body {
  background:
    radial-gradient(circle at 50% -10%, rgba(37, 99, 235, 0.06) 0%, transparent 45%),
    radial-gradient(circle at -10% 110%, rgba(14, 165, 233, 0.06) 0%, transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ── Header (slim) ──────────────────────────────────── */
.chat-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(59,130,246, 0.12);
}

.chat-header-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.logo-circle {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--red) 0%, var(--orange) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px -4px rgba(230, 57, 70, 0.5);
}
.logo-glyph {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  letter-spacing: -0.5px;
}
.logo-text { font-weight: 600; font-size: 16px; letter-spacing: -0.3px; }
.logo-text strong { color: var(--orange); font-weight: 800; }

.chat-header-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: all .15s;
}
.chat-header-back:hover { color: var(--text); border-color: var(--border-strong); }
.chat-header-back svg { width: 16px; height: 16px; }

/* ── Step container ─────────────────────────────────── */
.chat-step {
  display: none;
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
  padding: 24px 22px 60px;
}
.chat-step-active { display: block; }
.chat-step-inner {
  max-width: 480px;
  margin: 24px auto 0;
}
.chat-step-full { padding: 0; }

/* Chat room — fills the viewport, only messages scroll.
   Header + safe pill + input bar stay fixed at top/bottom.
   On iOS Safari, the browser's transient toolbars can obscure content
   sized at 100vh — `100dvh` accounts for the dynamic viewport,
   `100svh` is the conservative fallback (small viewport, always-visible). */
.chat-step.chat-step-full.chat-step-active {
  display: flex;
  flex-direction: column;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.step-tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(59,130,246, 0.12);
  border: 1px solid var(--border);
  color: var(--orange);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}
.step-title {
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.05;
  margin: 0 0 10px;
  background: linear-gradient(120deg, var(--red), var(--orange-deep), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.step-sub {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 26px;
}

/* ── Field block ─────────────────────────────────── */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-soft);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.text-input {
  width: 100%;
  height: 56px;
  border-radius: 14px;
  background: rgba(15,23,42,0.04);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  padding: 0 16px;
  outline: none;
  transition: border-color .15s, background .15s;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.text-input::placeholder { color: var(--text-mute); font-weight: 500; }
.text-input:focus {
  border-color: var(--orange);
  background: rgba(59,130,246, 0.05);
}
.text-input[type="number"]::-webkit-outer-spin-button,
.text-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.text-input[type="number"] { -moz-appearance: textfield; }

.username-row { display: flex; align-items: stretch; gap: 0; }
.at-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  width: 44px;
  border-radius: 14px 0 0 14px;
  background: rgba(59,130,246, 0.1);
  border: 1.5px solid var(--border);
  border-right: none;
  color: var(--orange);
  font-size: 18px;
  font-weight: 800;
}
.username-row .text-input {
  border-radius: 0 14px 14px 0;
  flex: 1;
}

.field-hint {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 6px;
}
.field-error {
  font-size: 13px;
  color: #DC2626;
  font-weight: 600;
  margin-top: 6px;
  min-height: 1.2em;
}

/* ── Gender / partner cards ─────────────────────────── */
.gender-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.gender-grid.gender-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.gender-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 22px 16px;
  cursor: pointer;
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  transition: all .15s;
}
.gender-card svg {
  width: 28px;
  height: 28px;
  color: var(--text-soft);
}
.gender-card:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.gender-card:hover svg { color: var(--orange); }
.gender-card.is-selected {
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.12) 0%, rgba(59,130,246, 0.12) 100%);
  border-color: var(--orange);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--orange), 0 12px 28px -10px rgba(59,130,246, 0.5);
}
.gender-card.is-selected svg { color: var(--orange); }

/* ── Section card (slider + preferences) ────────────── */
.section-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 22px;
  margin-bottom: 16px;
}
.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.section-card-label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-soft);
}
.section-card-hint {
  font-size: 14px;
  font-weight: 700;
  color: var(--orange);
}
.section-card-hint.muted { color: var(--text-mute); }

/* ── Age range pills ────────────────────────────────── */
.age-range-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 18px;
}
.age-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.age-pill-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-mute);
  margin-bottom: 2px;
}
.age-pill-num {
  font-size: 38px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--red), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.age-pill-sep {
  font-size: 28px;
  color: var(--text-mute);
  font-weight: 300;
  padding: 0 8px;
}

/* ── Dual slider ────────────────────────────────────── */
.dual-slider {
  position: relative;
  height: 36px;
  margin: 8px 0 4px;
}
.dual-slider-track {
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 6px;
  border-radius: 3px;
  background: rgba(15,23,42,0.08);
  transform: translateY(-50%);
}
.dual-slider-range {
  position: absolute;
  top: 50%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--orange));
  transform: translateY(-50%);
  pointer-events: none;
}
.dual-slider-input {
  position: absolute;
  top: 50%;
  width: 100%;
  height: 36px;
  margin: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  transform: translateY(-50%);
  outline: none;
}
.dual-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: all;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  cursor: grab;
  border: 0;
  box-shadow: 0 0 0 4px rgba(59,130,246, 0.25), 0 4px 12px rgba(230, 57, 70, 0.4);
}
.dual-slider-input::-moz-range-thumb {
  pointer-events: all;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  cursor: grab;
  border: 0;
  box-shadow: 0 0 0 4px rgba(59,130,246, 0.25), 0 4px 12px rgba(230, 57, 70, 0.4);
}
.dual-slider-input::-webkit-slider-runnable-track { background: transparent; border: 0; }
.dual-slider-input::-moz-range-track { background: transparent; border: 0; }
.dual-slider-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-mute);
  font-weight: 600;
}

/* ── Primary CTA ────────────────────────────────────── */
.btn-primary-flame {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 60px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--red) 0%, var(--orange) 100%);
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.2px;
  text-decoration: none;
  box-shadow:
    0 16px 36px -10px rgba(230, 57, 70, 0.6),
    0 8px 18px -4px rgba(59,130,246, 0.5),
    inset 0 1px 0 rgba(15,23,42,0.2);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  margin-top: 22px;
}
.btn-primary-flame:hover { transform: translateY(-1px); }
.btn-primary-flame:active { transform: translateY(0); }
.btn-primary-flame:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary-flame svg { width: 20px; height: 20px; }

.btn-link-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 14px;
  margin-top: 6px;
  width: 100%;
}
.btn-link-back:hover { color: var(--orange); }
.btn-link-back svg { width: 16px; height: 16px; }

.btn-cancel {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 32px;
  transition: all .15s;
}
.btn-cancel:hover {
  background: rgba(37,99,235, 0.08);
  border-color: var(--red);
  color: var(--red);
}

/* ── Searching screen ───────────────────────────────── */
.searching-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 40px;
}
.search-rings {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--orange);
  opacity: 0;
  animation: ringPulse 2.4s ease-out infinite;
}
.ring.r1 { width: 80px; height: 80px; animation-delay: 0s; }
.ring.r2 { width: 80px; height: 80px; animation-delay: 0.8s; }
.ring.r3 { width: 80px; height: 80px; animation-delay: 1.6s; }
@keyframes ringPulse {
  0%   { width: 80px;  height: 80px;  opacity: 0.7; }
  100% { width: 220px; height: 220px; opacity: 0; }
}
.search-heart {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--orange));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  box-shadow: 0 0 30px rgba(230, 57, 70, 0.5);
  animation: heartBeat 1.1s ease-in-out infinite;
}
.search-heart svg { width: 42px; height: 42px; }
@keyframes heartBeat {
  0%,30% { transform: scale(1); }
  15% { transform: scale(1.18); }
  45% { transform: scale(1.12); }
  70%,100% { transform: scale(1); }
}
.search-timer {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--red), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
  margin-top: 16px;
}

/* ── Chat room ───────────────────────────────────────── */
.chat-room-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  /* Include iOS notch / Dynamic Island safe area at the top */
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(59,130,246, 0.12);
  flex-shrink: 0;
}
.chat-room-back, .chat-room-report {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.chat-room-back:hover { border-color: var(--orange); color: var(--orange); }
.chat-room-report { border-color: rgba(230, 57, 70, 0.3); color: rgba(230, 57, 70, 0.7); }
.chat-room-report:hover { color: var(--red); border-color: var(--red); background: rgba(230, 57, 70, 0.08); }
.chat-room-back svg, .chat-room-report svg { width: 18px; height: 18px; }

.chat-room-partner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.chat-room-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red) 0%, var(--orange) 100%);
  flex-shrink: 0;
  box-shadow: 0 6px 16px -4px rgba(230, 57, 70, 0.4);
}
.dot-online {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
}
.chat-room-meta { min-width: 0; }
.chat-room-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-room-info {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}
.chat-room-info .badge-female,
.chat-room-info .badge-male {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  vertical-align: 1px;
  margin-right: 2px;
}
.badge-female { background: rgba(217, 59, 107, 0.18); color: var(--pink); }
.badge-male   { background: rgba(38, 116, 217, 0.18); color: #5b9aff; }

.chat-safe-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px auto 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(59,130,246, 0.08);
  border: 1px solid rgba(59,130,246, 0.25);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--flame);
  width: max-content;
  max-width: 90%;
}
.chat-safe-pill svg { width: 14px; height: 15px; color: var(--flame); }
.chat-safe-pill .pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0 rgba(59,130,246,0.7);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(59,130,246,0.7); }
  70% { box-shadow: 0 0 0 8px rgba(59,130,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

.chat-messages {
  flex: 1 1 0;
  min-height: 0;        /* allow flex child to shrink so internal scroll engages */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-day-divider {
  display: flex;
  justify-content: center;
  margin: 4px 0 8px;
}
.chat-day-divider span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-mute);
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(15,23,42,0.04);
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}
.msg-row.them { align-self: flex-start; }
.msg-row.me { align-self: flex-end; align-items: flex-end; }
.msg-bubble {
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-row.them .msg-bubble {
  background: rgba(15,23,42,0.05);
  border-bottom-left-radius: 6px;
  color: var(--text);
}
.msg-row.me .msg-bubble {
  background: linear-gradient(135deg, var(--red), var(--orange));
  border-bottom-right-radius: 6px;
  color: var(--text);
  box-shadow: 0 6px 14px -4px rgba(230, 57, 70, 0.4);
}
.msg-time {
  font-size: 10.5px;
  color: var(--text-mute);
  margin-top: 3px;
  padding: 0 6px;
}

.typing-indicator {
  align-self: flex-start;
  background: rgba(15,23,42,0.05);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  padding: 13px 18px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.typing-indicator span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-soft);
  display: inline-block;
  animation: typingDot 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.chat-input-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  /* iOS home indicator + Safari's bottom toolbar overlay sit beneath this padding */
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(59,130,246, 0.12);
  flex-shrink: 0;
}
.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  border: 1.5px solid var(--border);
  background: rgba(15,23,42,0.04);
  color: var(--text);
  padding: 0 18px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.chat-input::placeholder { color: var(--text-mute); }
.chat-input:focus { border-color: var(--orange); }
.send-btn {
  background: linear-gradient(135deg, var(--red), var(--orange));
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.5);
  transition: transform .12s;
}
.send-btn:hover { transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.send-btn svg { width: 20px; height: 20px; }

/* ── Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  animation: fadeIn .25s ease-out;
}
.modal-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: linear-gradient(180deg, var(--bg-card-2) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  position: relative;
  text-align: center;
  box-shadow: 0 40px 80px -20px rgba(230, 57, 70, 0.3);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15,23,42,0.05);
  border: 0;
  color: var(--text-soft);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.modal-icon {
  width: 64px;
  height: 64px;
  margin: 6px auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--orange));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.modal-icon svg { width: 36px; height: 36px; }
.modal-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}
.modal-sub {
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 20px;
}
.modal-android {
  width: 22px;
  height: 22px;
}

/* ── Reconnecting banner (own socket dropped) ──────── */
.conn-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(255, 165, 0, 0.18) 0%, rgba(59,130,246, 0.1) 100%);
  border-top: 1px solid rgba(59,130,246, 0.35);
  border-bottom: 1px solid rgba(59,130,246, 0.35);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  animation: connPulse 1.1s ease-in-out infinite;
}
@keyframes connPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50%      { opacity: 1;    transform: scale(1.1); }
}

/* ── CAPTCHA modal ──────────────────────────────────── */
.captcha-icon {
  background: linear-gradient(135deg, #2e9e4a, #1a6f30) !important;
}
.captcha-block {
  margin-top: 8px;
  padding: 18px 16px 6px;
  background: rgba(15,23,42,0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.captcha-question {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  text-align: center;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.captcha-input {
  width: 100%;
  height: 52px;
  border-radius: 12px;
  background: rgba(15,23,42,0.04);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 0 16px;
  outline: none;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  font-variant-numeric: tabular-nums;
}
.captcha-input:focus {
  border-color: var(--orange);
  background: rgba(59,130,246, 0.05);
}
.captcha-input::-webkit-outer-spin-button,
.captcha-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.captcha-input { -moz-appearance: textfield; }
.captcha-error {
  text-align: center;
  font-size: 13px;
  color: #DC2626;
  font-weight: 600;
  margin-top: 8px;
  min-height: 1.2em;
}
.captcha-verify-btn {
  margin-top: 10px !important;
  height: 50px !important;
  font-size: 15px !important;
}
.captcha-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
}
.captcha-divider::before,
.captcha-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(59,130,246, 0.18);
}
.captcha-divider span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-mute);
}
.captcha-app-pitch {
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.08) 0%, rgba(59,130,246, 0.08) 100%);
  border: 1px solid rgba(59,130,246, 0.3);
  border-radius: 16px;
  padding: 14px 16px 16px;
  text-align: center;
}
.captcha-pitch-text {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}
.captcha-pitch-text strong {
  color: var(--orange);
  font-weight: 800;
}
.btn-mega-app-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border-radius: 999px;
  background: #F2F2F2;
  color: #0F172A;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.2px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform .15s, box-shadow .15s;
}
.btn-mega-app-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(0,0,0,0.4); }
.btn-mega-app-cta .modal-android { width: 18px; height: 18px; }

/* ── Mobile tweaks ───────────────────────────────────── */
@media (max-width: 480px) {
  .chat-header { padding: 12px 16px; }
  .chat-step { padding: 16px 16px 40px; }
  .step-title { font-size: 28px; }
  .age-pill-num { font-size: 32px; }
  .chat-step-inner { margin-top: 14px; }
}

/* ════════════════════════════════════════════════════════════════
   Compact preferences (Step 2) — fit-without-scroll on all devices
   ════════════════════════════════════════════════════════════════ */
#step-preferences.chat-step {
  padding: 14px 16px 20px;
}
#step-preferences .chat-step-inner {
  margin-top: 10px;
  max-width: 460px;
}
#step-preferences .step-tag {
  margin-bottom: 8px;
  padding: 4px 10px;
  font-size: 10.5px;
}
#step-preferences .step-title {
  font-size: clamp(20px, 5.4vw, 26px);
  letter-spacing: -0.6px;
  margin: 0 0 4px;
}
#step-preferences .step-sub {
  font-size: 13px;
  line-height: 1.35;
  margin: 0 0 14px;
}
#step-preferences .section-card {
  padding: 12px 14px 14px;
  margin-bottom: 10px;
  border-radius: 14px;
}
#step-preferences .section-card-header {
  margin-bottom: 8px;
}
#step-preferences .section-card-label { font-size: 10.5px; }
#step-preferences .section-card-hint  { font-size: 13px; }
#step-preferences .age-range-display { margin: 4px 0 8px; }
#step-preferences .age-pill-num { font-size: 26px; }
#step-preferences .age-pill-sep { font-size: 20px; padding: 0 4px; }
#step-preferences .age-pill-label { font-size: 10px; margin-bottom: 0; }
#step-preferences .dual-slider { height: 28px; margin: 4px 0 2px; }
#step-preferences .dual-slider-ticks { font-size: 10.5px; margin-top: 2px; }
#step-preferences .gender-grid { gap: 8px; margin-top: 2px; }
#step-preferences .gender-card {
  padding: 12px 10px;
  font-size: 13px;
  gap: 6px;
  border-radius: 12px;
}
#step-preferences .gender-card svg { width: 22px; height: 22px; }
#step-preferences .btn-primary-flame {
  padding: 12px 18px;
  font-size: 14px;
  margin-top: 4px;
}
#step-preferences .btn-link-back { font-size: 12px; padding: 4px; }
#step-preferences .interest-select {
  padding: 10px 38px 10px 14px;
  font-size: 14px;
  border-radius: 12px;
}

@media (max-width: 480px) {
  #step-preferences.chat-step {
    padding: 10px 14px 14px;
    min-height: auto;
  }
  #step-preferences .chat-step-inner { margin-top: 6px; }
  #step-preferences .step-title { font-size: 20px; margin: 0 0 2px; }
  #step-preferences .step-sub { font-size: 12px; margin: 0 0 8px; }
  #step-preferences .section-card { padding: 10px 12px 12px; margin-bottom: 8px; }
  #step-preferences .age-pill-num { font-size: 22px; }
  #step-preferences .gender-card { padding: 10px 8px; }
}

/* ── Interest dropdown (native <select>) ─────────────────────────── */
.interest-select {
  width: 100%;
  margin-top: 4px;
  padding: 14px 40px 14px 16px;
  background: rgba(15,23,42,0.04);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23FF7A1A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  transition: border-color 0.18s, background-color 0.18s;
}
.interest-select:hover { border-color: rgba(59,130,246, 0.45); }
.interest-select:focus {
  outline: none;
  border-color: var(--orange, #3B82F6);
  background-color: rgba(59,130,246, 0.06);
}
.interest-select option {
  background: #F1F5F9;
  color: var(--text);
}
