/* ════════════════════════════════════════════════════════════════════════════════
   FUNNEL MODAL — S2 Need Conversation → S3 Signup → S4 Pooled Card (PHASE 0.5)
   ════════════════════════════════════════════════════════════════════════════════
   Floating panel ~360px desktop / full-width sheet mobile. Light scrim — page
   remains visible. No click-outside close.
   ════════════════════════════════════════════════════════════════════════════════ */

/* ─── Overlay (light scrim, NOT dimmed to black) ─── */
#funnel-backdrop {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
#funnel-backdrop.open { opacity: 1; pointer-events: auto; }

/* ─── Modal panel ─── */
#funnel-modal {
  position: fixed; z-index: 9600;
  top: 50%; left: 50%;
  width: 400px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  transform: translate(-50%, -50%) scale(0.94);
  opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, #0f1520 0%, #0d1117 100%);
  border: 1px solid rgba(45, 212, 191, 0.15);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(45,212,191,0.06);
  display: flex; flex-direction: column;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
#funnel-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

@media (max-width: 480px) {
  #funnel-modal {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; max-width: 100%;
    max-height: 92vh;
    transform: translateY(20px) scale(0.98);
    border-radius: 24px 24px 0 0;
    border-bottom: none;
  }
  #funnel-modal.open { transform: translateY(0) scale(1); }
}

/* ─── Top bar ─── */
.funnel-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.funnel-wordmark {
  font-size: 0.82rem; font-weight: 700;
  color: var(--teal); letter-spacing: 0.04em;
}
.funnel-beta {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: #0b1422;
  background: var(--teal); border-radius: 999px;
  padding: 2px 7px; margin-left: 6px; vertical-align: middle;
}
.funnel-close {
  background: rgba(45,212,191,0.08);
  border: 1.5px solid rgba(45,212,191,0.25);
  color: var(--teal);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; font-weight: 700;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.funnel-close:hover { background: rgba(45,212,191,0.18); border-color: var(--teal); transform: scale(1.06); }

/* ─── Step dots (B–E, 4 dots) ─── */
.funnel-dots {
  display: flex; align-items: center; gap: 6px;
}
.funnel-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.funnel-dot.active { background: var(--teal); box-shadow: 0 0 8px rgba(45,212,191,0.5); }
.funnel-dot.done { background: rgba(45,212,191,0.4); }

/* ─── Body ─── */
.funnel-body {
  flex: 1; overflow-y: auto; padding: 20px;
  scrollbar-width: thin; scrollbar-color: rgba(45,212,191,0.12) transparent;
}
.funnel-body::-webkit-scrollbar { width: 3px; }
.funnel-body::-webkit-scrollbar-thumb { background: rgba(45,212,191,0.2); border-radius: 2px; }

/* ─── Step visibility ─── */
.funnel-step { display: none; }
.funnel-step.active { display: block; animation: funnelFadeIn 0.3s ease; }
@keyframes funnelFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Clio avatar ─── */
.funnel-clio {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.funnel-clio-av {
  width: 80px; height: 80px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: #0a1520;
  box-shadow: 0 0 18px rgba(45,212,191,0.3);
}
.funnel-clio-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.funnel-clio-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--teal);
}
.funnel-clio-msg {
  font-size: 0.95rem; line-height: 1.5; color: var(--text);
}

/* ─── Clio thinking state (ring glow) ─── */
.funnel-clio-av.thinking {
  animation: clioThinking 1.2s ease-in-out infinite;
}
@keyframes clioThinking {
  0%, 100% { box-shadow: 0 0 18px rgba(45,212,191,0.3); }
  50% { box-shadow: 0 0 36px rgba(45,212,191,0.7), 0 0 60px rgba(45,212,191,0.3); }
}

/* ─── Clio avatar swap states (v2 C9 — src swapped via JS, not CSS content:url which is Firefox-broken for <img>) ─── */
/* The class names are kept for semantic state; the actual image src is set by setAvatarMood() in funnel.js */
.funnel-clio-av.curious,
.funnel-clio-av.empathetic,
.funnel-clio-av.encouraging,
.funnel-clio-av.happy,
.funnel-clio-av.resting { /* visual states driven by JS src swap */ }

/* ─── Form fields ─── */
.funnel-field { margin-bottom: 16px; }
.funnel-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px;
}
.funnel-input {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: var(--text); font-size: 0.95rem; font-family: var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.funnel-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45,212,191,0.12); }
.funnel-input::placeholder { color: var(--text-dim); }

/* ─── Account check note (Step B) ─── */
.funnel-account-note {
  font-size: 0.8rem; margin-top: 8px; min-height: 1em;
  color: var(--text-dim);
}
.funnel-account-note.returning { color: var(--teal); }
.funnel-account-note.new { color: var(--text-muted); }
.funnel-account-note.checking { color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.funnel-spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25); border-top-color: var(--teal);
  display: inline-block; animation: funnel-spin 0.7s linear infinite;
}
@keyframes funnel-spin { to { transform: rotate(360deg); } }
.funnel-input.code-input {
  font-size: 1.6rem; letter-spacing: 0.35em; text-align: center;
  font-weight: 700;
}

/* ─── Textarea ─── */
.funnel-textarea {
  width: 100%; padding: 12px 14px; resize: vertical; min-height: 80px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; color: var(--text); font-size: 0.95rem;
  font-family: var(--font); line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.funnel-textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45,212,191,0.12); }
.funnel-textarea::placeholder { color: var(--text-dim); }
.funnel-counter {
  font-size: 0.72rem; color: var(--text-dim);
  text-align: right; margin-top: 4px;
}

/* ─── Buttons ─── */
.funnel-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: #06101a; font-size: 0.92rem; font-weight: 700;
  border-radius: 50px; border: none; cursor: pointer;
  font-family: var(--font);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 4px 20px rgba(45,212,191,0.3);
}
.funnel-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(45,212,191,0.45); }
.funnel-btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
.funnel-btn-sm { padding: 8px 18px; font-size: 0.84rem; }
.funnel-btn-outline {
  background: transparent; color: var(--teal);
  border: 1.5px solid rgba(45,212,191,0.35);
  box-shadow: none;
}
.funnel-btn-outline:hover { background: rgba(45,212,191,0.06); box-shadow: none; transform: none; }

/* ─── Skip link ─── */
.funnel-skip {
  display: inline-block; font-size: 0.8rem; color: var(--text-dim);
  cursor: pointer; text-decoration: underline;
  margin-top: 8px;
}
.funnel-skip:hover { color: var(--teal); }

/* ─── Consent checkbox ─── */
.funnel-check-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 14px;
}
.funnel-check-row input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--teal); cursor: pointer;
}
.funnel-check-row label {
  font-size: 0.88rem; line-height: 1.45; color: var(--text-muted);
  cursor: pointer;
}

/* ─── Consent bullets ─── */
.funnel-bullets {
  margin: 12px 0 16px; padding-left: 20px;
}
.funnel-bullets li {
  font-size: 0.84rem; line-height: 1.5; color: var(--text-muted);
  margin-bottom: 6px;
}

/* ─── Privacy policy link ─── */
.funnel-policy-link {
  font-size: 0.82rem; color: var(--teal); cursor: pointer;
  text-decoration: underline; display: inline-block; margin-bottom: 14px;
}
.funnel-policy-link:hover { opacity: 0.8; }

/* ─── Privacy policy panel (in-modal scrollable) ─── */
.funnel-policy-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 14px; margin-bottom: 14px;
  max-height: 200px; overflow-y: auto;
  font-size: 0.82rem; line-height: 1.5; color: var(--text-muted);
  display: none;
}
.funnel-policy-panel.open { display: block; }
.funnel-policy-panel strong { color: var(--text); }
.funnel-policy-panel::-webkit-scrollbar { width: 3px; }
.funnel-policy-panel::-webkit-scrollbar-thumb { background: rgba(45,212,191,0.2); border-radius: 2px; }

/* ─── Gender pills ─── */
.funnel-gender-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.funnel-gender-pill {
  padding: 10px 20px; border-radius: 50px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: var(--font);
}
.funnel-gender-pill:hover { border-color: rgba(45,212,191,0.3); color: var(--text); }
.funnel-gender-pill.selected { border-color: var(--teal); background: rgba(45,212,191,0.1); color: var(--teal); }

/* ─── Error / status messages ─── */
.funnel-error {
  font-size: 0.82rem; color: #f87171;
  margin-top: 6px; display: none;
}
.funnel-error.visible { display: block; }
.funnel-success {
  font-size: 0.82rem; color: var(--teal);
  margin-top: 6px;
}

/* ─── Resend row ─── */
.funnel-resend-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px;
}
.funnel-resend {
  font-size: 0.82rem; color: var(--teal); cursor: pointer;
  background: none; border: none; font-family: var(--font);
  text-decoration: underline;
}
.funnel-resend:disabled { color: var(--text-dim); cursor: default; }
.funnel-resend-cooldown { font-size: 0.78rem; color: var(--text-dim); }
.funnel-edit-email {
  font-size: 0.82rem; color: var(--text-dim); cursor: pointer;
  text-decoration: underline;
}
.funnel-edit-email:hover { color: var(--teal); }

/* ─── YoB select ─── */
.funnel-yob-select {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; color: var(--text); font-size: 0.95rem;
  font-family: var(--font); outline: none;
  transition: border-color 0.2s;
  appearance: auto;
  color-scheme: dark;
}
.funnel-yob-select:focus { border-color: var(--teal); }
.funnel-yob-select option { color: var(--text); background: #1b1b22; }

/* ─── Immutable line ─── */
.funnel-immutable {
  font-size: 0.8rem; color: var(--text-dim);
  text-align: center; margin: 8px 0 16px;
  font-style: italic;
}

/* ─── Nickname @ prefix ─── */
.funnel-nick-row {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; transition: border-color 0.2s, box-shadow 0.2s;
}
.funnel-nick-row:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45,212,191,0.12); }
.funnel-nick-prefix {
  padding: 0 0 0 14px; font-size: 1.1rem; color: var(--text-muted);
  font-weight: 600;
}
.funnel-nick-row input {
  flex: 1; border: none; background: transparent;
  padding: 12px 14px 12px 4px; color: var(--text); font-size: 0.95rem;
  font-family: var(--font); outline: none;
}

/* ─── Real-time nickname availability status (Step E) ─── */
.funnel-nick-status {
  font-size: 0.78rem; margin-top: 6px; min-height: 1em;
  color: var(--text-dim);
}
.funnel-nick-status.ok { color: var(--teal); }
.funnel-nick-status.taken { color: #f87171; }
.funnel-nick-status.hint { color: var(--text-dim); }
.funnel-nick-status.checking { color: var(--text-muted); font-style: italic; }

/* ─── Hard stop screen ─── */
.funnel-hardstop { text-align: center; padding: 20px 0; }
.funnel-hardstop .funnel-clio { justify-content: center; }
.funnel-hardstop h2 {
  font-size: 1.2rem; font-weight: 700; color: var(--text);
  margin: 16px 0 10px; line-height: 1.4;
}
.funnel-hardstop p {
  font-size: 0.88rem; color: var(--text-muted); line-height: 1.5;
  margin-bottom: 20px;
}

/* ─── Month sub-step ─── */
.funnel-month-sub {
  display: none; margin-top: 10px;
  padding: 14px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06); border-radius: 12px;
}
.funnel-month-sub.visible { display: block; }
.funnel-month-sub p {
  font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px;
}

/* ─── Day sub-step ─── */
.funnel-day-sub {
  display: none; margin-top: 10px;
  padding: 14px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06); border-radius: 12px;
}
.funnel-day-sub.visible { display: block; }
.funnel-day-sub p {
  font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px;
}

/* ─── S4 result card ─── */
.funnel-card {
  text-align: center; padding: 10px 0;
}
.funnel-card-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(45,212,191,0.12);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 1.5rem;
}
.funnel-card h2 {
  font-size: 1.3rem; font-weight: 800; color: var(--text);
  margin-bottom: 8px; line-height: 1.3;
}
.funnel-card .funnel-clio { justify-content: center; margin-bottom: 14px; }
.funnel-card-ref {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1); border-radius: 10px;
  font-size: 0.92rem; font-weight: 700; color: var(--teal);
  cursor: pointer; margin-bottom: 16px;
  transition: border-color 0.2s, background 0.2s, opacity 0.42s ease, transform 0.42s ease;
  user-select: all;
  opacity: 0; transform: translateY(6px);
}
.funnel-card-ref.show { opacity: 1; transform: none; }
.funnel-card-ref:hover { border-color: var(--teal); background: rgba(45,212,191,0.06); }
.funnel-card-ref.copied { border-color: var(--teal); background: rgba(45,212,191,0.1); }
.funnel-confirmation {
  font-size: 0.88rem; line-height: 1.5; color: var(--text-muted);
  margin-bottom: 16px; font-style: italic;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.42s ease, transform 0.42s ease;
}
.funnel-confirmation.show { opacity: 1; transform: none; }
.funnel-adjust {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}
.funnel-adjust-label {
  font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px;
}
.funnel-btn-ghost {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-dim); margin-top: 10px;
}
.funnel-btn-ghost:hover { border-color: rgba(255, 255, 255, 0.35); color: var(--text); }
.funnel-entry-actions {
  display: flex; flex-direction: column; gap: 10px; margin-top: 20px;
}
.funnel-entry-actions .funnel-btn { width: 100%; }
.funnel-suggest-actions {
  display: flex; gap: 10px; margin-top: 16px;
}
.funnel-suggest-actions .funnel-btn { flex: 1; }
.funnel-card-lines {
  list-style: none; padding: 0; margin: 0 0 20px;
}
.funnel-card-lines li {
  font-size: 0.84rem; color: var(--text-muted); line-height: 1.5;
  padding: 4px 0; display: flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.42s ease, transform 0.42s ease;
}
.funnel-card-lines li.show { opacity: 1; transform: none; }
.funnel-card-lines li::before { content: '✦'; color: var(--teal); font-size: 0.6rem; }
.funnel-card-lines li.funnel-recap {
  flex-direction: column; align-items: flex-start; gap: 0;
  font-style: italic; color: var(--text); opacity: 0.8;
  border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 10px;
}
.funnel-card-lines li.funnel-recap::before { content: ''; }
.funnel-card .funnel-btn { margin-top: 4px; }

.funnel-hint {
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.45;
  margin: 6px 2px 2px; opacity: 0.85;
}

/* CLIO-FX-01: bounded facilitator hints at the natural moments. Static text
   only — no animation, so the global prefers-reduced-motion rule applies by
   default. */
.clio-fx-hint {
  font-size: 0.85rem; color: var(--text-muted, #9fb0bd); font-style: italic;
  line-height: 1.5; margin-top: 8px;
}
.clio-fx-choice-hint {
  text-align: center;
}
/* Mobile-safe touch targets for the two-way forming-Room choice. */
#f-fx-enter-now, #f-fx-let-gather {
  min-height: 44px;
}
.funnel-once-note {
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.45;
  margin: 8px 2px 2px; opacity: 0.85;
}

/* ════════════════════════════════════════════════════════════════════════════════
   S5 — Signed-in waiting state card (PHASE 0.5, DISPOSABLE)
   ════════════════════════════════════════════════════════════════════════════════ */

/* ─── Header chip ─── */
.s5-header-chip {
  position: fixed; top: 16px; right: 20px; z-index: 9400;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  background: rgba(15,21,32,0.85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(45,212,191,0.2);
  border-radius: 50px;
  font-size: 0.82rem;
}
.s5-chip-status {
  color: var(--teal); font-weight: 600;
}
.s5-chip-signout {
  color: var(--text-dim); cursor: pointer; text-decoration: underline;
}
.s5-chip-signout:hover { color: var(--teal); }

/* ─── S5 card ─── */
.s5-card {
  margin-top: 16px;
  padding: 20px;
  background: rgba(15,21,32,0.6);
  border: 1px solid rgba(45,212,191,0.12);
  border-radius: 16px;
}
.s5-clio-row {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 14px;
}
.s5-clio-av {
  width: 80px; height: 80px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: #0a1520;
  box-shadow: 0 0 18px rgba(45,212,191,0.3);
}
.s5-clio-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.s5-clio-text {
  flex: 1; min-width: 0;
}
.s5-status-line {
  font-size: 0.95rem; line-height: 1.5; color: var(--text);
  margin-bottom: 8px;
}
.s5-ref-line {
  font-size: 0.84rem; font-weight: 700; color: var(--teal);
  margin-bottom: 4px; cursor: pointer; user-select: all;
}
.s5-email-note {
  font-size: 0.8rem; color: var(--text-muted); font-style: italic;
}
.s5-extra-line {
  font-size: 0.8rem; color: var(--text-dim); margin-top: 6px;
}
.s5-actions {
  margin-top: 12px; text-align: center;
}
.s5-something-else {
  display: inline-block; font-size: 0.88rem; color: var(--teal);
  cursor: pointer; text-decoration: underline; margin-bottom: 6px;
}
.s5-something-else:hover { opacity: 0.8; }
.s5-fd45-note {
  font-size: 0.78rem; color: var(--text-dim); font-style: italic;
}

/* ─── S5 timeline (honest stage progress) ─── */
.s5-timeline { display: flex; align-items: center; margin: 14px 0 4px; }
.s5-tl-step { display: flex; align-items: center; gap: 6px; }
.s5-tl-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.s5-tl-step.done .s5-tl-dot { background: var(--teal); border-color: var(--teal); }
.s5-tl-step.current .s5-tl-dot {
  background: var(--teal); border-color: var(--teal);
  box-shadow: 0 0 8px rgba(45,212,191,0.6);
  animation: clioThinking 1.2s ease-in-out infinite;
}
.s5-tl-label { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.s5-tl-step.done .s5-tl-label, .s5-tl-step.current .s5-tl-label { color: var(--text-muted); }
.s5-tl-bar { flex: 1; height: 2px; background: rgba(255,255,255,0.12); margin: 0 6px; min-width: 8px; }
.s5-started { font-size: 0.76rem; color: var(--text-dim); font-style: italic; margin-top: 6px; }

/* ─── S5 multi-request list (all pending clusters, live) ─── */
.s5-needs { margin-top: 4px; display: flex; flex-direction: column; gap: 12px; }
.s5-need-item {
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.s5-need-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 6px;
}
.s5-need-count { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; }
.s5-need-status { font-size: 0.88rem; line-height: 1.45; color: var(--text); margin-bottom: 6px; }
.s5-room-name {
  font-size: 1rem; font-weight: 700; color: var(--text);
  margin-bottom: 6px; line-height: 1.3;
}
.s5-room-desc {
  font-size: 0.85rem; line-height: 1.5; color: var(--text-muted);
  margin-bottom: 6px;
}
.s5-open-link {
  display: inline-block; margin-top: 4px;
  font-size: 0.85rem; font-weight: 600; text-decoration: none;
  color: var(--teal); border: 1px solid rgba(45,212,191,0.35);
  border-radius: 999px; padding: 6px 14px;
}
.s5-open-link:hover { background: rgba(45,212,191,0.12); }

/* Pooling working indicator */
.s5-pooling { border-color: rgba(45,212,191,0.25); }
.s5-pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); margin-right: 8px; vertical-align: middle;
  animation: s5Pulse 1.3s ease-in-out infinite;
}
@keyframes s5Pulse {
  0%   { transform: scale(0.7); opacity: 0.5; }
  50%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.7); opacity: 0.5; }
}

.s5-beta {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: #0b1422;
  background: var(--teal); border-radius: 999px;
  padding: 2px 7px; margin-left: 8px; vertical-align: middle;
}

/* ─── S5 status modal (signed-in cluster list) ─── */
.s5-modal-backdrop {
  position: fixed; inset: 0; z-index: 9600;
  background: rgba(4,9,16,0.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.s5-modal {
  position: fixed; inset: 0; z-index: 9700;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.s5-modal-inner {
  width: 100%; max-width: 520px; max-height: 86vh;
  display: flex; flex-direction: column;
  background: #0b1422;
  border: 1px solid rgba(45,212,191,0.18);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  overflow: hidden;
}
.s5-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.s5-modal-title { margin: 0; font-size: 1.15rem; color: var(--text); font-weight: 700; }
.s5-modal-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 8px;
}
.s5-modal-close:hover { color: var(--teal); background: rgba(255,255,255,0.05); }
.s5-modal-body { padding: 18px 20px; overflow-y: auto; }
.s5-intro { font-size: 0.95rem; color: var(--text); margin-bottom: 14px; }
.s5-empty { font-size: 0.9rem; color: var(--text-dim); padding: 12px 0; }
.s5-modal-foot {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.s5-new-room {
  align-self: stretch; text-align: center;
  padding: 12px 18px; border: none; border-radius: 12px;
  background: var(--teal); color: #04121a; font-weight: 700; font-size: 0.95rem; cursor: pointer;
}
.s5-new-room:hover { filter: brightness(1.06); }

/* ─── ML6-R4: read-only policy display inside the My Rooms card ─── */
.s5-policy {
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  overflow: hidden;
}
.s5-policy-summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  user-select: none;
  min-height: 44px; box-sizing: border-box;
}
.s5-policy-summary::-webkit-details-marker { display: none; }
.s5-policy-summary-label { pointer-events: none; }
.s5-policy-summary-chevron {
  font-size: 0.7rem; opacity: 0.7; transition: transform 0.15s ease;
  pointer-events: none;
}
.s5-policy[open] .s5-policy-summary-chevron { transform: rotate(180deg); }
.s5-policy-body {
  padding: 0 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.s5-policy-section { padding: 4px 0; }
.s5-policy-section + .s5-policy-section {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 10px;
}
.s5-policy-title {
  margin: 0 0 6px;
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-dim); letter-spacing: 0.02em;
}
.s5-policy-list { margin: 0; padding: 0; list-style: none; }
.s5-policy-li {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 0.85rem; line-height: 1.45; color: var(--text);
  margin: 2px 0;
}
.s5-policy-text { flex: 1 1 auto; min-width: 0; }
.s5-policy-attr {
  flex: 0 0 auto;
  font-size: 0.7rem; padding: 2px 8px;
  border-radius: 999px; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-dim);
}
.s5-policy-attr-you {
  background: rgba(45,212,191,0.10);
  border-color: rgba(45,212,191,0.32);
  color: var(--teal);
}
.s5-policy-attr-clio {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}
.s5-policy-review {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(251,191,36,0.45);
  border-radius: 10px;
  background: rgba(251,191,36,0.06);
  color: #ffe6a3;
  font-size: 0.85rem; line-height: 1.5;
}


/* ─── Need textarea wrap (gear overlay) ─── */
.funnel-need-wrap { position: relative; }
.funnel-need-wrap .funnel-textarea { padding-right: 46px; }
.funnel-need-a2 { margin-top: 14px; }
.funnel-textarea-sm { min-height: 54px; }

/* ─── Back link ─── */
.funnel-back {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 8px 14px;
  border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--text); font-size: 0.85rem; font-weight: 500;
  text-decoration: none;
}
.funnel-back::before { content: '\2190'; font-size: 1rem; line-height: 1; }
.funnel-back:hover { background: rgba(45,212,191,0.12); border-color: var(--teal); color: var(--teal); }

/* ─── Gear / refine button (inside textarea, top-right) ─── */
.funnel-gear-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim, #9fb0bd); font-size: 0.9rem; line-height: 1;
  cursor: pointer; flex-shrink: 0; opacity: 0.45;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.funnel-gear-btn:hover { background: rgba(45,212,191,0.12); opacity: 0.8; }

/* ═══════════════════════════════ SHARED GEAR MODAL ═══════════════════════════════
   Ported from conversation.css so the single #gearModal (in index.html) is styled
   without loading the dead conversation stylesheet. z-index raised above the
   funnel modal; contrast nudged up on the dim helper text.
   ════════════════════════════════════════════════════════════════════════════════ */
.gear-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10001; display: none;
}
.gear-modal {
  position: fixed; inset: 0;
  z-index: 10002;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.gear-modal[style*="flex"] { display: flex; }
.gear-modal-inner {
  background: #0f1a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: funnelFadeIn 0.3s ease;
}
.gear-modal-header {
  position: relative;
  margin-bottom: 20px;
  padding-right: 32px;
}
.gear-modal-title {
  font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 0 0 6px;
}
.gear-modal-sub {
  font-size: 0.84rem; color: var(--text-muted); line-height: 1.5; margin: 0;
}
.gear-modal-close {
  position: absolute; top: 0; right: 0;
  background: none; border: none; color: var(--text-dim);
  font-size: 1.2rem; cursor: pointer; padding: 4px;
}
.gear-modal-body {
  display: flex; flex-direction: column; gap: 20px;
}
.gear-field {
  display: flex; flex-direction: column; gap: 8px;
}
.gear-label {
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
}
.gear-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.25s;
  width: 100%;
  box-sizing: border-box;
}
.gear-input:focus { border-color: rgba(45, 212, 191, 0.5); }
.gear-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.gear-input:disabled { opacity: 0.4; cursor: not-allowed; }
.gear-input-sm { width: 90px; }
.gear-input-row { display: flex; align-items: center; gap: 8px; }
.gear-age-row { display: flex; align-items: center; gap: 8px; }
.gear-range-sep { color: var(--text-dim); font-size: 0.85rem; }

/* Dual-range age slider */
.gear-age-slider { position: relative; padding: 6px 2px 2px; }
.gear-range-track {
  position: relative; height: 4px; margin: 10px 0;
  background: rgba(255, 255, 255, 0.14); border-radius: 4px;
}
.gear-range-fill {
  position: absolute; top: 0; height: 100%;
  background: var(--teal); border-radius: 4px;
}
.gear-age-youdot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--teal); border: 2px solid #0e0e12;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.25);
  z-index: 3; pointer-events: none;
}
.gear-field.is-deciding .gear-age-youdot { opacity: 0.4; }
.gear-range {
  position: absolute; left: 0; width: 100%; top: 10px; height: 4px;
  margin: 0; background: transparent; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.gear-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--teal); border: 2px solid #0e0e12; cursor: pointer;
}
.gear-range::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
  background: var(--teal); border: 2px solid #0e0e12; cursor: pointer;
}
.gear-range:disabled { opacity: 0.4; }

/* ─── "Require this language" confirmation modal ─── */
.lang-strict-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 8, 12, 0.62); backdrop-filter: blur(2px);
}
.lang-strict-card {
  background: #161619; border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px; max-width: 380px; width: calc(100% - 40px);
  padding: 22px 22px 18px; text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.lang-strict-card h3 {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  margin: 0 0 8px; line-height: 1.4;
}
.lang-strict-card p {
  font-size: 0.86rem; color: var(--text-muted); line-height: 1.5; margin: 0 0 18px;
}
.lang-strict-card .lang-strict-actions { display: flex; gap: 10px; justify-content: center; }
.lang-strict-card .funnel-btn { min-width: 120px; }
.lang-strict-card .funnel-btn-outline {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.18); color: var(--text-muted);
}
.gear-range-values {
  display: flex; justify-content: space-between;
  font-size: 0.82rem; color: var(--text-muted); margin-top: 4px;
}
.gear-field.is-deciding .gear-range,
.gear-field.is-deciding .gear-range-track { opacity: 0.4; pointer-events: none; }
.gear-checkbox-row { display: flex; flex-wrap: wrap; gap: 12px; }
.gear-checkbox {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.9rem; color: var(--text); cursor: pointer;
}
.gear-checkbox input[type="checkbox"] { accent-color: var(--teal); width: 16px; height: 16px; }
.gear-checkbox input[type="checkbox"]:disabled { opacity: 0.4; }
/* ML6-R1: radio button row for singleton gender selection */
.gear-radio-row { display: flex; flex-wrap: wrap; gap: 12px; }
.gear-radio {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.9rem; color: var(--text); cursor: pointer;
}
.gear-radio input[type="radio"] { accent-color: var(--teal); width: 16px; height: 16px; }
.gear-radio input[type="radio"]:disabled { opacity: 0.4; }
.gear-leave-it {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.84rem; color: var(--text-muted); cursor: pointer; margin-top: 4px;
}
.gear-leave-it input[type="checkbox"] { accent-color: var(--teal); width: 14px; height: 14px; }
.gear-gps-btn {
  background: rgba(45, 212, 191, 0.1);
  border: 1.5px solid rgba(45, 212, 191, 0.2);
  border-radius: 10px;
  color: var(--teal);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.gear-gps-btn:hover { background: rgba(45, 212, 191, 0.2); border-color: var(--teal); }
.gear-gps-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.gear-modal-footer { margin-top: 24px; display: flex; justify-content: flex-end; }

/* ─── Gear toggle switch (replaces "let Weya decide" checkbox) ─── */
.gear-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 10px; cursor: pointer; user-select: none;
}
.gear-toggle-label { font-size: 0.82rem; color: var(--text-dim, #9fb0bd); }
.gear-switch {
  position: relative; width: 42px; height: 24px; flex-shrink: 0;
  display: inline-block;
}
.gear-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.gear-slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(255,255,255,0.16);
  transition: background 0.18s ease;
}
.gear-slider::before {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.18s ease;
}
.gear-switch input:checked + .gear-slider { background: var(--teal, #2dd4bf); }
.gear-switch input:checked + .gear-slider::before { transform: translateX(18px); }
.gear-switch input:focus-visible + .gear-slider { box-shadow: 0 0 0 2px rgba(45,212,191,0.5); }

/* When "Let Weya decide" is ON, visibly deactivate the field */
.gear-field.is-deciding .gear-age-row,
.gear-field.is-deciding .gear-checkbox-row,
.gear-field.is-deciding .gear-radio-row,
.gear-field.is-deciding .gear-input-row {
  opacity: 0.4; pointer-events: none; filter: grayscale(0.6);
  transition: opacity 0.2s ease;
}
.gear-field.is-deciding .gear-input:disabled { opacity: 1; }
.gear-toggle-label { font-weight: 600; transition: color 0.2s; }
.gear-field.is-deciding .gear-toggle-label { color: var(--teal, #2dd4bf); }
.gear-field:not(.is-deciding) .gear-toggle-label { color: var(--text-dim, #9fb0bd); }
.gear-field-note {
  margin: 8px 0 0; font-size: 0.76rem; line-height: 1.45;
  color: var(--text-dim, #9fb0bd);
}

/* ─── Gear language: saved-profile checkboxes + add-to-profile prompt ─── */
.gear-saved-langs { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.gear-saved-lang {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 0.8rem; color: var(--text, #e8eef3); cursor: pointer;
  background: rgba(255,255,255,0.03);
}
.gear-saved-lang input { accent-color: var(--teal, #2dd4bf); }
.gear-lang-prompt {
  margin-top: 10px; padding: 10px 12px;
  border: 1px solid rgba(45,212,191,0.35);
  background: rgba(45,212,191,0.08); border-radius: 10px;
  font-size: 0.82rem; color: var(--text, #e8eef3);
}
.gear-lang-prompt .gear-lang-prompt-actions { margin-top: 8px; display: flex; gap: 8px; }
.gear-lang-prompt button {
  padding: 6px 12px; border-radius: 8px; border: none; cursor: pointer; font-size: 0.8rem; font-weight: 600;
}
.gear-lang-add { background: var(--teal, #2dd4bf); color: #04121a; }
.gear-lang-cancel { background: rgba(255,255,255,0.1); color: var(--text, #e8eef3); }

/* ─── ML-3: Per-language role rows ─── */
.gear-lang-rows { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.gear-lang-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}
.gear-lang-name {
  font-size: 0.88rem; color: var(--text, #e8eef3);
  min-width: 90px; font-weight: 500;
}
.gear-lang-role-select {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text, #e8eef3);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  flex: 1;
}
.gear-lang-role-select:focus { border-color: rgba(45,212,191,0.5); }
.gear-lang-status {
  font-size: 0.78rem; white-space: nowrap;
}
.gear-lang-pending { color: var(--text-dim, #9fb0bd); }
.gear-lang-error { color: #f87171; }

/* ML-3: Required-All hint (hidden by default) */
.gear-lang-required-hint {
  margin-top: 8px; padding: 8px 12px;
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.15);
  border-radius: 8px;
}
.gear-lang-hint-text {
  font-size: 0.8rem; color: var(--text-dim, #9fb0bd);
  line-height: 1.5;
}

/* ML-3: Profile confirmation overlay */
.ml3-confirm-lang-row {
  margin: 6px 0; font-size: 0.88rem;
  color: var(--text, #e8eef3);
}
.ml3-confirm-status {
  margin: 8px 0; font-size: 0.84rem;
}

/* ─── Dev OTP code hint (dev mode only; server returns devCode) ─── */
.funnel-dev-code {
  margin: 10px 0 2px; padding: 10px 12px;
  border: 1px dashed var(--teal, #2dd4bf);
  background: rgba(45, 212, 191, 0.10);
  border-radius: 10px;
  font-size: 1.05rem; font-weight: 700; letter-spacing: 2px;
  color: var(--teal, #2dd4bf); text-align: center;
}
.funnel-dev-note {
  display: block; margin-top: 4px; font-size: 0.7rem; font-weight: 400;
  letter-spacing: normal; color: var(--text-dim, #9fb0bd);
}

/* ─── Location capture + scope ladder (FD-50 / FD-22) ─── */
.funnel-loc-capture { text-align: center; }
.funnel-loc-capture h2 { margin: 4px 0 6px; }
.funnel-loc-capture .funnel-btn { width: 100%; margin-top: 10px; }
.funnel-loc-capture .funnel-input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.04);
  color: var(--text, #e8eef3); font-size: 0.95rem; margin-top: 8px;
}
.funnel-loc-tags {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 14px 0 6px;
}
.funnel-loc-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid rgba(45,212,191,0.4);
  background: rgba(45,212,191,0.10);
  font-size: 0.85rem; color: var(--text, #e8eef3);
}
.funnel-loc-x {
  border: none; background: transparent; color: var(--teal, #2dd4bf);
  font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 2px;
}
.funnel-loc-x:disabled { color: rgba(159,176,189,0.4); cursor: not-allowed; }
.funnel-loc-global { color: var(--text-dim, #9fb0bd); font-size: 0.85rem; margin: 8px 0; }
.funnel-loc-note {
  color: var(--text-dim, #9fb0bd); font-size: 0.82rem; line-height: 1.4;
  margin: 12px 2px 4px; text-align: left;
  border-left: 2px solid rgba(45,212,191,0.45); padding-left: 10px;
}

/* ─── Gear: Clio's re-inferred perspective (Edit preferences) ─── */
.gear-perspective {
  background: rgba(45,212,191,0.08);
  border: 1px solid rgba(45,212,191,0.3);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.gear-persp-label {
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--teal, #2dd4bf); margin-bottom: 4px;
}
.gear-persp-text { font-size: 0.92rem; line-height: 1.45; color: var(--text, #e8eef3); }
.gear-persp-thinking { font-size: 0.9rem; color: var(--text-dim, #9fb0bd); font-style: italic; }

/* Living-wait (S30): one gentle highlight when the REAL count grows.
   Fires only on a genuine server-side increase — never decorative. */
.s5-count-grew {
  animation: s5CountGrew 2.4s ease-out 1;
  border-radius: 6px;
}
@keyframes s5CountGrew {
  0%   { background: rgba(45,212,191,0.35); }
  100% { background: transparent; }
}

/* ════════════════════════════════════════════════════════════════════════════════
   DISTILL CONFIRMATION (D2) — side-by-side edit before submit
   ════════════════════════════════════════════════════════════════════════════════ */
.funnel-distill-confirm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
@media (max-width: 480px) {
  .funnel-distill-confirm { grid-template-columns: 1fr; }
}
.funnel-distill-col {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
}
.funnel-distill-col-label {
  font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted, #9fb0bd); margin-bottom: 8px; font-weight: 600;
}
.funnel-distill-textarea {
  width: 100%; min-height: 100px; resize: vertical;
  background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 10px; font-size: 0.88rem;
  color: var(--text, #e8eef3); line-height: 1.5;
  font-family: inherit;
}
.funnel-distill-textarea:focus {
  outline: none; border-color: var(--teal, #2dd4bf);
  box-shadow: 0 0 0 2px rgba(45,212,191,0.15);
}
.funnel-distill-clio {
  font-size: 0.9rem; line-height: 1.55; color: var(--text, #e8eef3);
  min-height: 80px;
}
.funnel-distill-room {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.funnel-distill-room-name {
  font-size: 0.88rem; font-weight: 700; color: var(--teal, #2dd4bf);
  margin-bottom: 4px;
}
.funnel-distill-room-desc {
  font-size: 0.82rem; color: var(--text-muted, #9fb0bd); line-height: 1.45;
}
.funnel-distill-actions {
  display: flex; gap: 8px; margin-top: 12px;
}
.funnel-btn-primary {
  background: var(--teal, #2dd4bf); color: #0b1422; font-weight: 700;
  border: none; border-radius: 10px; padding: 10px 16px;
  cursor: pointer; font-size: 0.88rem;
  transition: background 0.2s, transform 0.15s;
}
.funnel-btn-primary:hover { background: #5eead4; transform: scale(1.02); }
.funnel-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ════════════════════════════════════════════════════════════════════════════════
   NARRATION ROTATOR — rotating lines during thinking phase (Phase 2)
   ════════════════════════════════════════════════════════════════════════════════ */
.funnel-narration {
  position: relative;
  padding: 14px 0 6px;
  text-align: center;
}
.funnel-narration-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal, #2dd4bf);
  margin: 0 auto 10px;
  animation: narrPulse 2s ease-in-out infinite;
}
@keyframes narrPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.2); }
}
.funnel-narration-line {
  font-size: 0.92rem; line-height: 1.55;
  color: var(--text-muted, #9fb0bd);
  margin: 0;
  transition: opacity 0.2s ease;
}

/* ════════════════════════════════════════════════════════════════════════════════
   POOL DISPLAY — reference number + demand count (Phase 3)
   ════════════════════════════════════════════════════════════════════════════════ */
.funnel-pool-ref {
  font-size: 0.8rem; letter-spacing: 0.04em;
  color: var(--teal, #2dd4bf); font-weight: 600;
  margin-top: 8px; text-align: center;
}
.funnel-pool-gathering {
  font-size: 0.92rem; color: var(--text, #e8eef3);
  text-align: center; margin: 10px 0 4px;
  font-style: italic;
}
.funnel-pool-demand {
  font-size: 0.82rem; color: var(--text-muted, #9fb0bd);
  text-align: center; margin: 0 0 8px;
}

/* ML6-LJ2: truthful existing-match continuation card. */
.ml6-lj2-card { overflow-wrap: anywhere; word-break: break-word; }
.ml6-lj2-copy { line-height: 1.55; margin: 12px 0; text-align: center; }
.ml6-lj2-progress { color: var(--text-muted, #9fb0bd); font-size: 0.88rem; margin: 10px 0; text-align: center; }
.ml6-lj2-details { margin: 14px 0; text-align: start; }
.ml6-lj2-details summary { cursor: pointer; min-height: 44px; padding: 10px 0; }
.ml6-lj2-details p { margin: 8px 0; white-space: pre-wrap; }
.ml6-lj2-open { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ─── D2 edit mode controls ─── */
.funnel-distill-edit-controls {
  display: flex; gap: 8px; margin-top: 8px;
}
.funnel-distill-textarea[readonly] {
  opacity: 0.75; cursor: default;
  border-color: rgba(255,255,255,0.05);
}
.funnel-distill-textarea:not([readonly]) {
  border-color: var(--teal, #2dd4bf);
  box-shadow: 0 0 0 2px rgba(45,212,191,0.12);
}
.funnel-link {
  background: none; border: none; padding: 0;
  cursor: pointer; font-family: inherit;
}
.funnel-link:hover { color: var(--teal, #2dd4bf) !important; }

/* H-A4 (FD-130): Cloudflare Turnstile widget container. Minimal — the widget
   is managed/invisible for most users. Centered, theme-matched, with a little
   breathing room above the primary button. */
.funnel-turnstile {
  display: flex;
  justify-content: center;
  margin: 12px 0 4px;
  min-height: 0;
}
.funnel-turnstile:empty { display: none; }
.funnel-turnstile iframe { border: 0; }

/* F1/F2: Room demographics line — shown on similar_exists and suggested_preview cards.
   Subtle, muted, center-aligned. Gender is shown as "hard" (this room is FOR X only),
   age/location as guidance. */
.funnel-room-demographics {
  text-align: center;
  font-size: 0.85rem;
  color: var(--clio-muted, #8a8a8a);
  margin: 8px 0;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.03);
}

/* F4: Discoverability note — "When people look for similar interests..." */
.funnel-discover-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--clio-muted, #8a8a8a);
  margin: 4px 0 12px;
  font-style: italic;
}

/* F2: Inline adjust controls for suggested preview demographics */
.funnel-adjust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 8px 0;
}
.funnel-adjust-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.82rem;
  color: var(--clio-muted, #8a8a8a);
}
.funnel-adjust-field span {
  margin-bottom: 3px;
  font-weight: 500;
}
.funnel-adjust-field select,
.funnel-adjust-field input {
  width: 120px;
  padding: 5px 8px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: center;
  background: #fff;
}
.funnel-adjust-field select:focus,
.funnel-adjust-field input:focus {
  border-color: var(--teal, #2dd4bf);
  outline: none;
}

/* D2: Demographics reference box — sits below the distill-confirm columns */
.funnel-d2-params {
  margin: 12px 0 4px;
  padding: 10px 14px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}
.funnel-d2-params-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--clio-muted, #8a8a8a);
  margin-bottom: 6px;
}
.funnel-d2-params-values {
  font-size: 0.88rem;
  color: var(--text, #333);
  margin-bottom: 4px;
}
.funnel-d2-params-note {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--clio-muted, #8a8a8a);
  margin-bottom: 8px;
}
.funnel-d2-params-rationale {
  font-size: 0.8rem;
  color: var(--teal, #2dd4bf);
  margin: 4px 0 8px;
  line-height: 1.45;
}
.funnel-final-review-note {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-muted, #8a8a8a);
  background: rgba(45, 212, 191, 0.08);
  border-left: 2px solid var(--teal, #2dd4bf);
  padding: 8px 10px;
  border-radius: 6px;
  margin: 6px 0 10px;
}

/* D2: Edit panel — gear-modal-style demographics, hidden until "Change" clicked */
.funnel-d2-edit {
  margin: 12px 0 8px;
  padding: 14px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}
.funnel-d2-edit .gear-field {
  margin-bottom: 14px;
}
.funnel-d2-edit .gear-field:last-of-type {
  margin-bottom: 10px;
}

/* ─── G3: Outer admission modal (gateway-gated guest entry) ─── */
#adm-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 8, 14, 0.72);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10400;
}
#adm-backdrop.open { opacity: 1; pointer-events: auto; }

#adm-modal {
  position: fixed; left: 50%; top: 50%;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -50%) scale(0.96);
  background: var(--bg2, #0d141c);
  border: 1px solid var(--border, #1f2a38);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10401;
}
#adm-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.adm-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #1f2a38);
}
.adm-body { padding: 20px 18px 22px; }

.adm-line {
  font-size: 0.95rem; line-height: 1.55;
  color: var(--text, #e6edf5);
  margin-bottom: 8px;
}
.adm-line.adm-blocked { color: var(--text-muted, #9fb0c3); }
/* LAUNCH-PREP-01 TASK C: pre-launch state — calm neutral line, not an error. */
.adm-line.adm-prelaunch { color: var(--text, #e6edf5); }
.adm-line.adm-approved {
  font-size: 1.08rem; font-weight: 600; margin-bottom: 4px;
}
.adm-line.adm-approved-sub { color: var(--text-muted, #9fb0c3); }

.adm-field { margin-bottom: 10px; }
.adm-label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted, #9fb0c3); margin-bottom: 6px;
}
.adm-input {
  width: 100%; padding: 11px 14px;
  background: var(--bg3, #101822);
  color: var(--text, #e6edf5);
  border: 1px solid var(--border, #1f2a38);
  border-radius: 10px;
  font-family: var(--font); font-size: 0.92rem;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.adm-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12); outline: none; }
.adm-hint { font-size: 0.74rem; color: var(--text-dim, #6b7f95); margin-top: 6px; line-height: 1.45; }

.adm-error {
  display: none;
  font-size: 0.84rem; color: var(--warn, #fbbf24);
  margin: 4px 0 10px; line-height: 1.5;
}
.adm-error.visible { display: block; }

.adm-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; }
.adm-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: #06101a; font-size: 0.88rem; font-weight: 700;
  border-radius: 50px; border: none; cursor: pointer;
  font-family: var(--font);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 4px 16px rgba(45, 212, 191, 0.28);
}
.adm-btn:hover { transform: translateY(-1px); }
.adm-btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
.adm-btn-ghost {
  background: transparent; color: var(--teal);
  border: 1.5px solid rgba(45, 212, 191, 0.35);
  box-shadow: none;
}
.adm-btn-ghost:hover { background: rgba(45, 212, 191, 0.06); transform: none; }
