@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

/* =========================================================================
   mobile.css — STANDALONE mobile UI for /video and /text.
   Loaded only on mobile (<=979px) by mobile-chat.js.
   Scoped under `body.m-on` so it cannot affect desktop in any way.
   The desktop chat UI is hidden via `body.m-on .desktop-only { display:none }`.
   ========================================================================= */

body.m-on {
    margin: 0;
    background: #000;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

body.m-on .desktop-only,
body.m-on > header,
body.m-on > .modebar,
body.m-on main.app {
    display: none !important;
}

#mStage {
    position: fixed;
    inset: 0;
    z-index: 9999;
    color: #fff;
    font: 14px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    display: flex;
    flex-direction: column;
    overscroll-behavior: none;
    touch-action: none;          /* we handle gestures ourselves */
}

/* FaceTime-style PiP layout ====================================
   Partner fills the full stage so the user holds the phone
   normally (mic stays near mouth).
   Self camera is a small picture-in-picture tile in the
   top-right corner — tap to drag it anywhere.              */
#mStage .m-tiles {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    overflow: hidden;
    will-change: transform, opacity;
}

/* All tiles are absolutely positioned */
#mStage .m-tile {
    position: absolute;
    background: #0a0d12;
    overflow: hidden;
    will-change: transform, opacity;
}

/* Partner fills the entire stage */
#mStage .m-tile.partner {
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Self PiP — top-right corner, below the top bar */
#mStage .m-tile.self {
    top: calc(env(safe-area-inset-top, 0px) + 58px);
    right: 10px;
    width: 100px;
    aspect-ratio: 3 / 4;
    height: auto;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
    z-index: 4;
    cursor: grab;
    touch-action: none;
}
#mStage .m-tile.self:active { cursor: grabbing; }

#mStage .m-tile.dragging { transition: none; }
#mStage .m-tile.snapback { transition: transform .18s ease, opacity .18s ease; }
#mStage .m-tile.fly-out  {
    transition: transform .22s ease, opacity .22s ease;
    transform: translateY(-110%);
    opacity: 0;
}
#mStage .m-tile video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}
#mStage .m-tile.self video { transform: scaleX(-1); }
#mStage .m-tile.partner video { transform: scaleX(-1); }

/* Idle hero ===================================================== */
#mStage .m-hero {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    gap: 14px;
    background:
        radial-gradient(700px 350px at 50% 28%, rgba(34, 136, 145, .22), transparent 60%),
        linear-gradient(180deg, #0e1620 0%, #0a0d12 100%);
    z-index: 4;
    pointer-events: none;
}
#mStage .m-online {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 600;
    backdrop-filter: blur(8px);
}
#mStage .m-online .m-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 10px #4ade80;
    animation: mDot 1.6s ease-in-out infinite;
}

@keyframes mDot {
    50% { opacity: .55; }
}
#mStage .m-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 4px 0 2px;
}
#mStage .m-arrow {
    font-size: 36px;
    line-height: 1;
    animation: mArrow 1.6s ease-in-out infinite;
}

@keyframes mArrow {
    0%, 100% { transform: translateY(8px);  opacity: .35; }
    50%      { transform: translateY(-8px); opacity: 1; }
}
#mStage .m-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, .72);
}

/* Hide hero when matched / searching / face-gating */
body.m-on.matched #mStage .m-hero,
body.m-on.searching #mStage .m-hero,
body.m-on.m-gate #mStage .m-hero { display: none; }

/* Searching overlay */
#mStage .m-search {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: rgba(0, 0, 0, .35);
    z-index: 5;
    pointer-events: none;
}

body.m-on.searching #mStage .m-search,
body.m-on.m-gate #mStage .m-search { display: flex; }
#mStage .m-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: conic-gradient(
        rgba(255, 255, 255, 0)   0deg,
        rgba(255, 255, 255, .92) 270deg,
        rgba(255, 255, 255, 0)   270deg
    );
    /* Soft inner edge: tail = hairline, head = full 5 px stroke */
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), black 100%);
            mask: radial-gradient(farthest-side, transparent calc(100% - 5px), black 100%);
    animation: mSpin .9s linear infinite;
}

@keyframes mSpin {
    to { transform: rotate(360deg); }
}

/* "Connecting" overlay — matched but first video frame not yet rendered.
   Different from the searching spinner: a teal sonar-ping expands and fades,
   making it clear we're connected and just waiting for the stream. */
#mStage .m-connecting-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: #0a0d12;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
/* When a partner preview thumbnail is available, make the overlay transparent
   so the pixelated preview img (position:absolute inside) shows through.
   The spinner ring is still centered in flex flow above the img. */
#mStage .m-connecting-overlay.has-preview { background: rgba(0, 0, 0, 0.25); }
#mStage .m-connecting-overlay .partner-preview { z-index: 0; }
/* Same conic-gradient ring as desktop — spins fast (0.45s) to feel responsive.
   Replaces the sonar-ping; reuses the tileSpin keyframe from desktop/chat.css. */
#mStage .m-ping {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: conic-gradient(
        rgba(255,255,255,0)  0deg,
        rgba(255,255,255,.9) 270deg,
        rgba(255,255,255,0)  270deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), black 100%);
            mask: radial-gradient(farthest-side, transparent calc(100% - 9px), black 100%);
    animation: tileSpin 0.45s linear infinite;
}
#mStage .m-ping::before, #mStage .m-ping::after { display: none; }

/* Top bar (status + hamburger) */
/* Top bar: hidden by default; tap anywhere to reveal (.hud-on on #mStage).
   In text mode it stays permanently visible (overridden below). */
#mStage .m-top {
    position: absolute;
    top: env(safe-area-inset-top, 0);
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease;
}
#mStage.hud-on .m-top {
    opacity: 1;
    pointer-events: none;   /* container stays none; interactive children use auto */
}
#mStage .m-brand {
    pointer-events: none;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
    background: rgba(0, 0, 0, .35);
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

/* Hamburger button — tappable when HUD is revealed */
#mStage .m-ham {
    pointer-events: auto;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
}
#mStage .m-ham:active { background: rgba(255,255,255,.15); }

/* ── Mobile menu overlay ── */
#mStage .m-menu-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(0,0,0,0);
    transition: background .25s ease;
    touch-action: none;
}
#mStage .m-menu-overlay.open { background: rgba(0,0,0,.55); }

/* ── Mobile menu bottom sheet ── */
#mStage .m-menu-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 21;
    background: #1a1a2a;
    border-radius: 20px 20px 0 0;
    padding: 8px 0 calc(env(safe-area-inset-bottom, 0px) + 20px);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.32,1,.28,1);
    box-shadow: 0 -4px 40px rgba(0,0,0,.6);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#mStage .m-menu-sheet.open { transform: translateY(0); }

.m-menu-handle {
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 99px;
    margin: 4px auto 16px;
}

/* Report item — shown only when matched (toggled by JS) */
.m-menu-report {
    width: 100%;
    display: none; /* JS sets to flex when matched */
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    background: none;
    border: none;
    color: #ff6b6b;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.m-menu-report:active { background: rgba(255,107,107,.1); }

.m-menu-sep {
    height: 1px;
    background: rgba(255,255,255,.07);
    margin: 6px 0;
}

.m-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 22px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s;
}
.m-menu-item:active { background: rgba(255,255,255,.07); }

/* Social row — compact icon-only buttons tucked at the bottom of the sheet.
   Treated as secondary nav (not primary menu items). */
.m-menu-socials {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 8px 22px 14px;
}
.m-social-btn {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0;        /* hide the text label, leave the icon */
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}
.m-social-btn svg { width: 16px; height: 16px; display: block; }
.m-social-btn:active { opacity: .8; }
.m-social-btn.ig { background: linear-gradient(135deg,#833ab4 0%,#fd1d1d 50%,#fcb045 100%); }
.m-social-btn.wa { background: #25d366; }

/* Google Play store row */
.m-menu-store {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 22px;
    text-decoration: none;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}
.m-menu-store:active { background: rgba(255,255,255,.06); }
.m-menu-store span { display: flex; flex-direction: column; line-height: 1.3; }
.m-menu-store strong { font-size: 14px; }
.m-menu-store span span { font-size: 12px; color: rgba(255,255,255,.5); }

body.m-on.matched #mStage .m-report { display: inline-flex; }

/* Bottom action bar removed — composer is always visible. */
#mStage .m-bottom { display: none; }

/* Msgs sit above the composer */
#mStage .m-msgs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    max-height: 38dvh;
    overflow-y: auto;
    padding: 10px 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 6;
    pointer-events: auto;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
    mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
    scrollbar-width: none;
}
#mStage .m-msgs::-webkit-scrollbar { display: none; }
#mStage .m-msgs .m-msg {
    max-width: 84%;
    padding: 7px 11px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.35;
    word-wrap: break-word;
    backdrop-filter: blur(6px);
}
#mStage .m-msgs .m-msg.them {
    align-self: flex-start;
    background: rgba(0, 0, 0, .55);
    border-bottom-left-radius: 4px;
    color: #fff;
}
#mStage .m-msgs .m-msg.me {
    align-self: flex-end;
    background: rgba(34, 136, 145, .85);
    border-bottom-right-radius: 4px;
    color: #fff;
}
#mStage .m-msgs .m-msg.sys {
    align-self: center;
    background: rgba(0, 0, 0, .45);
    color: rgba(255, 255, 255, .92);
    font-size: 12px;
    border-radius: 999px;
    padding: 4px 10px;
}

body.m-on:not(.matched) #mStage .m-msgs { display: none; }

/* Composer (always visible, transparent floating bar) ============ */
#mStage .m-composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.45) 60%);
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    transition: transform .15s ease;
    will-change: transform;
}
#mStage .m-composer input {
    pointer-events: auto;
    flex: 1 1 auto;
    min-width: 0;
    background: rgba(0, 0, 0, .42);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    padding: 11px 14px;
    border-radius: 999px;
    /* 16px prevents iOS Safari from zooming on focus. */
    font-size: 16px;
    line-height: 1.2;
    outline: none;
    backdrop-filter: blur(10px);
    -webkit-appearance: none;
    appearance: none;
}
#mStage .m-composer input::placeholder { color: rgba(255, 255, 255, .55); }
#mStage .m-composer .m-send {
    pointer-events: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(34, 136, 145, .92);
    color: #fff;
    border: none;
    font-size: 16px;
    flex: 0 0 auto;
    backdrop-filter: blur(10px);
}

/* Composer disabled in idle (no partner to message) */
body.m-on:not(.matched) #mStage .m-composer { opacity: .45; }
body.m-on:not(.matched) #mStage .m-composer input { pointer-events: none; }
body.m-on:not(.matched) #mStage .m-composer .m-send { pointer-events: none; }

/* ── Mobile Hero Promo — story-driven app CTA below swipe hint ───────────
   Visible in idle state (before first swipe). Hidden when searching/matched
   since the hero is hidden. Tells brand story with stats + Play Store badge.
   ─────────────────────────────────────────────────────────────────────── */
#mStage .m-hero-promo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 0;
    pointer-events: auto;
}
#mStage .m-hp-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255,255,255,.72);
    font-weight: 500;
}
#mStage .m-hp-stats strong { color: #4dd0e1; font-weight: 800; }
#mStage .m-hp-dot { opacity: .45; }
#mStage .m-hp-copy {
    margin: 0;
    font-size: 13px;
    color: rgba(255,255,255,.65);
    line-height: 1.55;
    text-align: center;
    max-width: 260px;
}
#mStage .m-hp-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 9px 16px;
    border-radius: 10px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
}
#mStage .m-hp-badge:active { background: rgba(34,136,145,.45); }
#mStage .m-hp-small {
    display: block;
    font-size: 9px;
    opacity: .7;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}
#mStage .m-hp-big {
    display: block;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.01em;
}

/* ── Play Store icon in top-bar — shown on opposite side to brand ─────────
   Always present in DOM; hidden when hero is visible (idle, no partner).
   Becomes visible once matched so both brand + store icon bookend the bar.
   ─────────────────────────────────────────────────────────────────────── */
/* ── Play Store button in top-bar — full pill, Google Play green, always visible ── */
#mStage .m-ps-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 11px 6px 9px;
    border-radius: 999px;
    background: #01875f;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    font-family: 'Nunito', sans-serif;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
    pointer-events: auto;
    white-space: nowrap;
}
#mStage .m-ps-icon:active { background: #016d4c; }
#mStage .m-ps-label { font-size: 12px; font-weight: 800; }

/* Old whole-stack swipe classes removed — swipe now animates only the
   partner tile (see .m-tile.dragging/.snapback/.fly-out above). */

/* Toast ========================================================== */
#mStage .m-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, .75);
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}
#mStage .m-toast.show { opacity: 1; }

/* Typing dots in mobile chat overlay ============================== */
#mStage .m-msg.m-typing {
    display: inline-flex;
    gap: 4px;
    padding: 9px 12px;
    align-items: center;
}
#mStage .m-msg.m-typing > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    animation: m-tdot 1.2s infinite ease-in-out;
}
#mStage .m-msg.m-typing > span:nth-child(2) { animation-delay: .15s; }
#mStage .m-msg.m-typing > span:nth-child(3) { animation-delay: .3s; }
@keyframes m-tdot {
    0%, 80%, 100% { transform: translateY(0);    opacity: .4; }
    40%           { transform: translateY(-4px); opacity: 1; }
}

/* Keep messages above the keyboard when it's open */
body.m-on.kb-open #mStage .m-msgs {
    bottom: calc(64px + env(safe-area-inset-bottom));
    max-height: 28dvh;
}

/* Hide the welcome card on mobile entirely (mobile UI replaces it) */
body.m-on #welcome { display: none !important; }

/* Report modal must sit above #mStage on mobile */
body.m-on #reportModal.active { z-index: 10001; }

/* Leave-call confirmation dialog ================================== */
#mLeaveDlg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    z-index: 10002;
    background: rgba(0, 0, 0, 0);
    transition: background .2s ease;
    pointer-events: none;
}
#mLeaveDlg.open {
    background: rgba(0, 0, 0, .55);
    pointer-events: auto;
}
#mLeaveDlg .mld-card {
    width: 100%;
    background: #1a1d24;
    border-radius: 20px 20px 0 0;
    padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.32,1,.38,1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#mLeaveDlg.open .mld-card {
    transform: translateY(0);
}
#mLeaveDlg .mld-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
#mLeaveDlg .mld-sub {
    margin: 0 0 8px;
    font-size: 14px;
    color: rgba(255,255,255,.65);
    line-height: 1.45;
}
#mLeaveDlg .mld-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#mLeaveDlg .mld-stay {
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: #228891;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
#mLeaveDlg .mld-leave {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.15);
    background: transparent;
    color: rgba(255,255,255,.8);
    font-size: 16px;
    cursor: pointer;
}

/* ================================================================
   TEXT MODE — full-screen themed chat layout
   Active when body.m-on.m-text (WEB_RC_MODE === 'text')
   JS resizes #mStage height/top to match visualViewport so the
   keyboard never covers content — no per-element offset math needed.
   ================================================================ */

/* Stage: themed, flex column */
body.m-on.m-text #mStage {
    background: var(--bg);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    /* Establish a containing block for the position:fixed composer so that
       shrinking the stage to the visual viewport (JS) pins the composer
       flush above the keyboard — no gap, native feel. */
    transform: translateZ(0);
}

/* Hide video tiles */
body.m-on.m-text #mTiles { display: none !important; }

/* Allow scroll in the message area (base CSS sets touch-action:none on stage) */
body.m-on.m-text #mMsgs {
    touch-action: pan-y;
    overscroll-behavior: contain;
}

/* ---- Header ---- */
body.m-on.m-text .m-top {
    position: relative;          /* flex item, not absolute */
    flex-shrink: 0;
    height: 54px;
    box-sizing: border-box;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0 16px;
    pointer-events: auto;
    z-index: 6;
    /* Text mode: always visible, ignore the video-mode tap-to-show */
    opacity: 1 !important;
}
body.m-on.m-text .m-brand {
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    text-shadow: none;
    color: var(--text);
    padding: 0;
    font-size: 15px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    letter-spacing: -0.01em;
}

/* Top-right container (Next btn + Report btn) */
#mStage .m-top-right {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none; /* container passthrough; buttons set their own */
}

/* Report button in text mode */
body.m-on.m-text .m-report {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-2);
    width: 34px;
    height: 34px;
    font-size: 14px;
    pointer-events: auto;
}

/* "Next" button (text mode, shown only when matched) */
.m-next-btn {
    pointer-events: auto;
    padding: 10px 28px;
    border-radius: 12px;
    background: #228891;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    display: none;
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
}
body.m-on.m-text.matched .m-next-btn { display: inline-block; }

/* ---- Messages (matched only — avoids z-index pointer-event blockage) ---- */
body.m-on.m-text.matched #mMsgs {
    position: absolute;
    top: 54px;
    left: 0; right: 0;
    /* bottom = composer height + small gap.
       #mStage is resized by JS to vv.height, so this bottom is always
       measured from the TOP of the keyboard, never behind it. */
    bottom: calc(64px + env(safe-area-inset-bottom));
    max-height: none;
    padding: 14px 16px 10px;
    -webkit-mask-image: none;
    mask-image: none;
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Message bubbles — #mMsgs ID needed to beat base specificity (#mStage .m-msgs .m-msg) */
body.m-on.m-text #mMsgs .m-msg {
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    line-height: 1.45;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 18px;
    max-width: 80%;
}
body.m-on.m-text #mMsgs .m-msg.them {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 5px;
}
body.m-on.m-text #mMsgs .m-msg.me {
    background: #228891;
    color: #fff;
    border: none;
    border-bottom-right-radius: 5px;
}
body.m-on.m-text #mMsgs .m-msg.sys {
    background: transparent;
    color: var(--text-2);
    font-size: 12px;
    border-radius: 999px;
    border: none;
    padding: 4px 12px;
    font-weight: 600;
}
/* Typing dots in text mode */
body.m-on.m-text #mMsgs .m-msg.m-typing > span {
    background: var(--text-2);
}

/* ---- Composer: solid themed bar ---- */
/* Use #mStage to beat base opacity rule: body.m-on:not(.matched) #mStage .m-composer */
body.m-on.m-text #mStage .m-composer {
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    /* position: fixed + bottom: 0 from base CSS, contained within #mStage,
       which JS shrinks to vv.height — so composer stays above keyboard. */
}
body.m-on.m-text #mStage .m-composer input {
    background: var(--panel-2);
    border: 1.5px solid var(--border);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    /* Lock height so the unified button never shifts up/down on focus. */
    height: 48px;
}
body.m-on.m-text #mStage .m-composer input::placeholder {
    color: var(--text-2);
    opacity: 0.65;
}
/* =============================================================
 * Unified skip → sure? → send button (text mode only)
 * Three faces controlled by data-action="skip|armed|send".
 * ============================================================= */

/* Video mode: faces hidden, classic plane icon visible. */
.ms-face { display: none; }
body.m-on.m-text .ms-video-plane { display: none !important; }

/* Base button — morphs shape and colour between states.
   #mStage included so these outrank the video-mode #mStage .m-send base. */
body.m-on.m-text #mStage .m-send {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    -webkit-tap-highlight-color: transparent;
    transition:
        min-width .26s cubic-bezier(.34,1.56,.64,1),
        width     .26s cubic-bezier(.34,1.56,.64,1),
        border-radius .22s ease,
        background .22s ease,
        box-shadow .22s ease,
        color .16s ease,
        border-color .16s ease;
}
/* SKIP: neutral rounded square */
body.m-on.m-text #mStage .m-send[data-action="skip"] {
    min-width: 84px; width: auto;
    height: 48px; padding: 0 16px;
    border-radius: 14px;
    background: var(--panel-2);
    color: var(--text-2);
    border: 1.5px solid var(--border);
    box-shadow: none;
    font-size: 13px;
}
/* ARMED: orange tint + countdown drain bar */
body.m-on.m-text #mStage .m-send[data-action="armed"] {
    min-width: 84px; width: auto;
    height: 48px; padding: 0 16px;
    border-radius: 14px;
    background: rgba(249,115,22,.11);
    color: #f97316;
    border: 1.5px solid rgba(249,115,22,.50);
    box-shadow: 0 0 0 3px rgba(249,115,22,.13);
    font-size: 13px;
    animation: ms-jiggle .32s ease-out;
}
body.m-on.m-text #mStage .m-send[data-action="armed"]::after {
    content: '';
    position: absolute; bottom: 0; left: 0;
    height: 2.5px; width: 100%;
    background: #f97316;
    border-radius: 0 0 14px 14px;
    transform-origin: left center;
    animation: ms-drain 3s linear forwards;
}
/* SEND: teal rounded square */
body.m-on.m-text #mStage .m-send[data-action="send"] {
    min-width: 48px; width: 48px;
    height: 48px; padding: 0;
    border-radius: 14px;
    background: linear-gradient(145deg, #2aa0ab, #1d757d);
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(34,136,145,.45);
}
/* Press feedback */
body.m-on.m-text #mStage .m-send:active { transform: scale(.90); }
body.m-on.m-text #mStage .m-send[data-action="send"]:active {
    box-shadow: 0 2px 8px rgba(34,136,145,.35);
}

/* ---- Three faces ---- */
body.m-on.m-text .ms-face {
    display: inline-flex;
    position: absolute; inset: 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transform: scale(.76);
    transition: opacity .18s ease, transform .22s cubic-bezier(.34,1.56,.64,1);
    pointer-events: none;
    white-space: nowrap;
}
body.m-on.m-text .m-send[data-action="skip"]  .ms-skip-face,
body.m-on.m-text .m-send[data-action="armed"] .ms-armed-face,
body.m-on.m-text .m-send[data-action="send"]  .ms-plane-face {
    opacity: 1; transform: scale(1);
}
/* Skip face labels */
.ms-skip-face svg  { flex-shrink: 0; }
.ms-skip-face span { font-size: 13px; font-weight: 800; }
/* Armed face text */
.ms-armed-face { font-size: 13px; font-weight: 800; }
/* Send face: plane icon */
.ms-plane-face { width: 100%; height: 100%; }
.ms-plane-face svg { width: 22px; height: 22px; display: block; transform: translateX(1px); }

/* Fly animation on send tap */
.m-send.flying .ms-plane-face svg {
    animation: ms-fly .42s cubic-bezier(.4,0,.2,1) forwards;
}
/* Video mode fallback: animate the classic plane icon directly */
.m-send.flying .ms-video-plane {
    animation: ms-fly .42s cubic-bezier(.4,0,.2,1) forwards;
}
.ms-video-plane {
    width: 22px; height: 22px; display: block; transform: translateX(1px);
}

/* ---- Keyframes ---- */
@keyframes ms-jiggle {
    0%   { transform: rotate(0) scale(1); }
    18%  { transform: rotate(-4deg) scale(1.06); }
    36%  { transform: rotate(4deg)  scale(1.06); }
    54%  { transform: rotate(-2deg) scale(1.02); }
    72%  { transform: rotate(2deg)  scale(1.02); }
    100% { transform: rotate(0)     scale(1); }
}
@keyframes ms-drain {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}
@keyframes ms-fly {
    0%   { opacity: 1; transform: translateX(1px) scale(1); }
    35%  { opacity: 1; transform: translate(-2px,2px) scale(.92); }
    100% { opacity: 0; transform: translate(26px,-26px) scale(.82); }
}

/* Disable state when not matched — must use #mStage to override base ID rule */
body.m-on.m-text:not(.matched) #mStage .m-composer       { opacity: 1; }
/* Input stays live + focused during searching so the keyboard never drops
   between skips; only the idle (pre-start) state greys it out. */
body.m-on.m-text:not(.matched):not(.searching) #mStage .m-composer input { pointer-events: none; opacity: 0.38; }
body.m-on.m-text:not(.matched) #mStage .m-composer .m-send {
    pointer-events: none;
    opacity: 0.5;
    box-shadow: none;
}

/* ---- Idle panel ---- */
.m-text-idle {
    display: none;
    position: absolute;
    top: 54px; left: 0; right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    z-index: 5;
    background: var(--bg);
    text-align: center;
    padding: 32px 28px;
    box-sizing: border-box;
}
body.m-on.m-text:not(.searching):not(.matched):not(.m-gate) .m-text-idle { display: flex; }

.m-text-idle .m-online {
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 6px 16px;
}
.m-text-idle .m-online .m-dot {
    box-shadow: 0 0 6px #4ade80;
}
.m-text-idle-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.m-text-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    font-family: 'Nunito', sans-serif;
    line-height: 1.15;
}
.m-text-sub {
    font-size: 14px;
    color: var(--text-2);
    font-family: 'Nunito', sans-serif;
    line-height: 1.55;
    max-width: 240px;
    font-weight: 500;
}
.m-text-start {
    padding: 18px 52px;
    border-radius: 18px;
    background: #228891;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    border: none;
    cursor: pointer;
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 20px rgba(34,136,145,.38);
    transition: transform .1s ease, opacity .12s;
}
.m-text-start:active { transform: scale(0.96); opacity: .88; }

/* ---- Finding panel ---- */
.m-text-finding {
    display: none;
    position: absolute;
    top: 54px; left: 0; right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 5;
    background: var(--bg);
    text-align: center;
}
body.m-on.m-text.searching .m-text-finding,
body.m-on.m-text.m-gate .m-text-finding { display: flex; }

/* Spinner — use #mStage to beat base ID specificity */
body.m-on.m-text #mStage .m-spinner {
    width: 44px;
    height: 44px;
    border-color: var(--border);
    border-top-color: #228891;
}
.m-text-finding-label {
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    letter-spacing: 0.01em;
}
.m-text-stop {
    padding: 18px 52px;
    border-radius: 18px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-2);
    font-size: 18px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .12s;
}
.m-text-stop:active { opacity: .6; }

/* ── Think-head: girl + boy SVG icons (mobile, idle + finding) ── */
.m-think-head { display: flex; flex-direction: column; align-items: center; gap: 12px; user-select: none; }
.m-th-duo { display: flex; align-items: flex-end; }
.m-th-char { width: 44px; height: 60px; flex-shrink: 0; }
.m-th-char svg { width: 100%; height: 100%; display: block; }
.m-th-girl { animation: mThNodGirl 3.8s ease-in-out infinite;     transform-origin: 50% 100%; }
.m-th-boy  { animation: mThNodBoy  3.8s ease-in-out infinite .5s; transform-origin: 50% 100%; }
@keyframes mThNodGirl { 0%,100% { transform: rotate(0deg); } 30% { transform: rotate(4deg); } 65% { transform: rotate(-2deg); } }
@keyframes mThNodBoy  { 0%,100% { transform: rotate(0deg); } 30% { transform: rotate(-4deg); } 65% { transform: rotate(2deg); } }
.m-th-mid { position: relative; width: 28px; height: 60px; flex-shrink: 0; }
.m-th-b { position: absolute; border-radius: 50%; background: #228891; opacity: 0; left: 50%; }
.m-th-b1 { width: 6px;  height: 6px;  margin-left: -3px;   bottom: 22px; animation: mThBubC 2.8s ease-in-out infinite 0s; }
.m-th-b2 { width: 9px;  height: 9px;  margin-left: -4.5px; bottom: 34px; animation: mThBubC 2.8s ease-in-out infinite .42s; }
.m-th-b3 { width: 13px; height: 13px; margin-left: -6.5px; bottom: 48px; animation: mThBubC 2.8s ease-in-out infinite .84s; }
@keyframes mThBubC { 0%,5% { opacity:0; transform:scale(.45) translateY(6px); } 28% { opacity:.9; transform:scale(1) translateY(0); } 68% { opacity:.8; transform:scale(1) translateY(-5px); } 92%,100% { opacity:0; transform:scale(.6) translateY(-10px); } }
.m-th-tell { margin: 0; font-size: 12px; font-weight: 300; letter-spacing: .05em; color: var(--text-2); font-style: italic; font-family: 'Nunito', sans-serif; }
.m-th-d1, .m-th-d2, .m-th-d3 { display: inline-block; animation: mThDot 1.5s ease-in-out infinite; }
.m-th-d2 { animation-delay: .24s; } .m-th-d3 { animation-delay: .48s; }
@keyframes mThDot { 0%,100% { opacity:.15; transform:translateY(0); } 50% { opacity:1; transform:translateY(-2px); } }

/* ============================================================
   MESSAGE INTERACTIONS — Reply + Emoji Reactions (mobile)
   ============================================================ */

.msg-row {
    display: flex; flex-direction: column;
    max-width: 80%; position: relative;
}
.msg-row.me   { align-self: flex-end;  align-items: flex-end; }
.msg-row.them { align-self: flex-start; align-items: flex-start; }
.msg-row.sys  { align-self: center; max-width: 100%; }
.msg-row .msg { align-self: unset; max-width: 100%; }

.msg-reply-quote {
    display: flex; align-items: stretch; gap: 0;
    margin-bottom: 5px; border-radius: 8px; overflow: hidden;
    cursor: pointer;
}
.msg-reply-quote .rq-bar {
    width: 3px; flex-shrink: 0; background: var(--primary);
    border-radius: 2px 0 0 2px;
}
.msg-row.me .msg-reply-quote .rq-bar { background: rgba(255,255,255,.6); }
.msg-reply-quote .rq-body {
    flex: 1; min-width: 0; padding: 5px 9px; border-radius: 0 8px 8px 0;
    background: rgba(34,136,145,.1);
}
.msg-row.me .msg-reply-quote .rq-body { background: rgba(0,0,0,.18); }
.rq-who {
    font-size: 10px; font-weight: 800; margin-bottom: 2px; color: var(--primary);
    font-family: 'Nunito', sans-serif;
}
.msg-row.me .rq-who { color: rgba(255,255,255,.85); }
.rq-text {
    font-size: 11px; color: var(--text-2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: 'Nunito', sans-serif;
}
.msg-row.me .rq-text { color: rgba(255,255,255,.72); }

/* Action bar — mobile tap toggled */
.msg-actions {
    position: absolute; top: 50%; transform: translateY(-50%);
    display: flex; gap: 2px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 999px; padding: 3px 5px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    z-index: 10; opacity: 0; pointer-events: none;
    transition: opacity .14s;
    white-space: nowrap;
}
.msg-row.me   .msg-actions { right: calc(100% + 6px); }
.msg-row.them .msg-actions { left:  calc(100% + 6px); }
.msg-row.actions-open .msg-actions { opacity: 1; pointer-events: auto; }

.msg-action-btn {
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: transparent;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-2); font-size: 17px;
    -webkit-tap-highlight-color: transparent; padding: 0;
}

/* Emoji picker — bottom-fixed sheet on mobile */
.emoji-picker-popup {
    position: fixed;
    bottom: 72px; left: 50%; transform: translateX(-50%);
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 16px; padding: 10px 12px;
    display: flex; gap: 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
    z-index: 300;
    animation: mEpIn .18s ease both;
}
@keyframes mEpIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.9); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0)   scale(1); }
}
.ep-emoji-btn {
    width: 40px; height: 40px; border-radius: 8px;
    border: none; background: transparent;
    font-size: 22px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent; padding: 0;
}

.msg-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.msg-reaction-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--panel); border: 1.5px solid var(--border);
    border-radius: 999px; padding: 2px 8px;
    font-size: 13px; cursor: pointer; user-select: none;
    font-family: 'Nunito', sans-serif;
    -webkit-tap-highlight-color: transparent;
}
.msg-reaction-badge.mine {
    border-color: #228891;
    background: rgba(34,136,145,.12);
}
.rc-count { font-size: 11px; font-weight: 700; color: var(--text-2); }
.msg-reaction-badge.mine .rc-count { color: #228891; }

.reply-preview-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    background: rgba(34,136,145,.08);
    border-top: 1px solid rgba(34,136,145,.2);
    border-left: 3px solid #228891;
    animation: mRpIn .15s ease both;
}
@keyframes mRpIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rp-content { flex: 1; min-width: 0; }
.rp-label { font-size: 11px; font-weight: 800; color: #228891; margin-bottom: 2px; font-family: 'Nunito', sans-serif; }
.rp-text  { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Nunito', sans-serif; }
.rp-cancel {
    width: 24px; height: 24px; border-radius: 50%;
    border: none; background: transparent; color: var(--text-2);
    font-size: 18px; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

/* ── Smooth opacity transition for msgs + composer ───────────────────────── */
/* Used by the unified auto-hide system and the kb-open state. */
#mStage .m-msgs,
#mStage .m-composer {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* ── Unified auto-hide (video mode, matched only) ─────────────────────────
   When NOT in `hud-on` state, the msgs + composer fully fade out and stop
   receiving touches so the partner video gets the full screen. The top bar
   is already controlled by `#mStage.hud-on .m-top` above.
   Tapping the stage (or new message arriving) toggles `hud-on` back. */
body.m-on.matched:not(.m-text) #mStage:not(.hud-on) .m-msgs {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}
body.m-on.matched:not(.m-text) #mStage:not(.hud-on) .m-composer {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}
/* While composer input is focused or menu is open, force everything visible. */
body.m-on.matched:not(.m-text) #mStage.hud-lock .m-msgs,
body.m-on.matched:not(.m-text) #mStage.hud-lock .m-composer {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
}
body.m-on.matched:not(.m-text) #mStage.hud-lock .m-top {
    opacity: 1 !important;
}

/* ── Centered "Connected with stranger" banner ──────────────────────────── */
/* Top-center glassmorphism toast that appears on match + auto-dismisses. */
.m-connect-banner {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 70px);
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(20, 24, 32, 0.78);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
    max-width: 90vw;
    white-space: nowrap;
}
.m-connect-banner.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.m-connect-banner .m-cb-flag {
    font-size: 20px;
    line-height: 1;
}
.m-connect-banner .m-cb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 12px #22c55e;
    animation: mCbPulse 1.4s ease-in-out infinite;
}
@keyframes mCbPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* ============================================================
   Premium / pre-start additions for /text on mobile.
   ============================================================ */
.m-brand .m-brand-img {
    width: 32px; height: 32px; border-radius: 7px;
    display: block;
}
.m-brand { padding: 0 !important; font-size: 0 !important; }

/* Hide the (now relocated) top-bar Google Play pill. */
.m-ps-icon[hidden] { display: none !important; }

/* Pre-start variant inside .m-text-idle: stack tight. */
.m-text-idle .ot-prestart.m-prestart {
    padding: 6px 18px 0;
    gap: 10px;
}
.m-text-idle .ot-prestart.m-prestart .ot-gender { gap: 8px; }
.m-text-idle .ot-prestart.m-prestart .ot-gender-opt {
    padding: 9px 13px; font-size: 13px;
}
.m-text-idle .ot-prestart.m-prestart .ot-gender-warn {
    font-size: 11.5px; padding: 8px 10px;
}
.m-text-start:disabled { opacity: .5; }
/* #mTextNext is only used in video mode; in text mode the unified #mSend handles it. */
body.m-on.m-text #mTextNext { display: none !important; }

/* Video mode Next button — inline in composer */
.m-composer .m-next-inline {
    margin-right: 6px;
    background: rgba(255,255,255,.10);
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    width: 42px; height: 42px;
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.m-composer .m-next-inline svg { display: block; pointer-events: none; }
.m-composer .m-next-inline:active { transform: scale(.90); background: rgba(255,255,255,.18); }

/* Gender filter chip above the composer. */
.m-gf-wrap {
    display: flex; justify-content: flex-end;
    padding: 4px 12px 0;
}
.m-gf-wrap .ot-gf-chip {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.20);
    color: #fff;
}
.m-gf-wrap .ot-gf-chip.is-active {
    background: rgba(34,136,145,.32);
    border-color: #4dd0e1;
    color: #fff;
}

/* =========================================================================
 * Phase 5 — Mobile brand: image logo (replaces "opentalk.club" text)
 * Overrides the prior .m-brand pill above.
 * ========================================================================= */
#mStage .m-brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    /* sit inside the same 36-px row as the hamburger button */
    width: 36px; height: 36px;
}
#mStage .m-brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
    background: #006c74;
}

/* =========================================================================
 * Phase 6 — "Get the App" pill below online count (replaces top-bar PS icon)
 * ========================================================================= */
#mStage .m-get-app {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    pointer-events: auto;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.12s ease;
}
#mStage .m-get-app:active {
    background: rgba(34, 136, 145, 0.55);
    transform: scale(0.96);
}
#mStage .m-get-app svg { opacity: 0.9; }

/* =========================================================================
 * Phase 9 — TikTok-style swipe-up gesture hint (replaces plain ↑ arrow)
 * ========================================================================= */
#mStage .m-swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 76px;
    margin-top: 4px;
}
#mStage .m-swipe-hand {
    animation: m-swipe-hint 1.6s ease-in-out infinite;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
    transform-origin: 50% 80%;
}
@keyframes m-swipe-hint {
    0%   { transform: translateY(8px)   scale(1);    opacity: 0.75; }
    35%  { transform: translateY(-22px) scale(1.05); opacity: 1;    }
    65%  { transform: translateY(-22px) scale(1.05); opacity: 0.7;  }
    100% { transform: translateY(8px)   scale(1);    opacity: 0.75; }
}

/* =========================================================================
 * Phase 4 — Mobile send-button tap animation
 * ========================================================================= */
@keyframes m-btn-tap {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.88); }
    100% { transform: scale(1); }
}
#mStage .m-composer .m-send:active,
#mStage .m-next-btn:active,
#mStage .m-text-start:active,
#mStage .m-text-stop:active {
    animation: m-btn-tap 0.18s ease;
}
#mStage .m-composer .m-send:active {
    filter: brightness(1.18);
}

/* =========================================================================
 * Gender filter chip — centred inside the text-mode appbar (m-top).
 * m-top in text mode is position:relative (flex item in mStage column),
 * so we can use position:absolute to pin the chip to the horizontal centre
 * without disrupting the logo (left) or the Next/Hamburger (right).
 * ========================================================================= */
body.m-on.m-text .m-top-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    display: flex;
    align-items: center;
    height: 100%;
}
body.m-on.m-text .m-top-center .ot-gf-chip {
    font-size: 12px;
    padding: 5px 10px;
    gap: 5px;
    height: 32px;
    background: rgba(0,0,0,.06);
    border: 1.5px solid var(--border);
    color: var(--text-2);
}
/* The base .ot-gf-chip.is-locked::after appends a lock emoji; we use .gf-badge instead */
body.m-on.m-text .m-top-center .ot-gf-chip.is-locked::after { content: none; }
body.dark.m-on.m-text .m-top-center .ot-gf-chip {
    background: rgba(255,255,255,.07);
}
body.m-on.m-text .m-top-center .ot-gf-chip .gf-badge {
    font-size: 11px;
    opacity: .75;
}
body.m-on.m-text .m-top-center .ot-gf-chip .gf-icon {
    flex-shrink: 0;
}
body.m-on.m-text .m-top-center .ot-gf-chip.is-locked {
    opacity: .7;
}
body.m-on.m-text .m-top-center .ot-gf-chip.is-active {
    background: rgba(34,136,145,.14);
    border-color: #228891;
    color: #228891;
    opacity: 1;
}

/* =========================================================================
 * Mobile onboarding overrides — hide the m-text-idle illustration so the
 * chat bubbles take centre stage; pad #mMsgs so it sits above the composer.
 * ========================================================================= */
body.ot-onb-active.m-on .m-text-idle { display: none !important; }
/* Bubble host — must beat `body.m-on:not(.matched) #mStage .m-msgs { display:none }`
 * (specificity 0,3,1) so we override with !important plus the #mStage qualifier. */
body.ot-onb-active.m-on #mStage #mMsgs {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  position: absolute;
  top: 54px;
  left: 0; right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom));
  overflow-y: auto;
  padding: 18px 14px calc(20px + env(safe-area-inset-bottom));
  z-index: 6;
  pointer-events: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}
body.ot-onb-active.m-on #mStage #mMsgs::-webkit-scrollbar { display: none; }
body.ot-onb-active.m-on #mMsgs .ot-onb-bubble { font-size: 14.5px; }
body.ot-onb-active.m-on #mMsgs .ot-onb-action { padding: 9px 14px; font-size: 13.5px; }
body.ot-onb-active.m-on #mMsgs .ot-onb-action.is-primary { padding: 12px 22px; font-size: 15px; }
