@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);
}

#mStage .m-age-note {
    max-width: 320px;
    margin: 6px auto 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

/* 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 / connecting spinner overlay — transparent so video underneath shows through.
   A single spinner floats throughout the full wait (search → connecting → first frame). */
#mStage .m-search {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: transparent;
    z-index: 5;
    pointer-events: none;
}

/* Show during searching, matched (before video arrives), and face-gate */
body.m-on.searching #mStage .m-search,
body.m-on.matched #mStage .m-search,
body.m-on.m-gate #mStage .m-search { display: flex; }
#mStage .m-spinner {
    width: 64px;
    height: 64px;
    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 8 px stroke */
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), black 100%);
            mask: radial-gradient(farthest-side, transparent calc(100% - 8px), black 100%);
    animation: mSpin .9s linear infinite;
}

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

/* m-connecting-overlay: dark backdrop only while waiting for partner video.
   No second spinner — m-search spinner (above, z-index 5) floats on top. */
#mStage .m-connecting-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #0a0d12;
    pointer-events: none;
}
/* When a partner preview thumbnail is available, show it as a blurred ghost */
#mStage .m-connecting-overlay.has-preview { background: rgba(0, 0, 0, 0.25); }
#mStage .m-connecting-overlay .partner-preview { z-index: 0; }
/* m-ping hidden — m-spinner from m-search handles the wait animation */
#mStage .m-ping { 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 */
.m-menu-socials {
    display: flex;
    gap: 10px;
    padding: 10px 22px;
}
.m-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}
.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); }

/* Mobile filter sheet (gender / region) */
#mStage .m-filter-overlay {
    position: absolute;
    inset: 0;
    z-index: 28;
    background: rgba(0, 0, 0, 0);
    transition: background .22s ease;
}
#mStage .m-filter-overlay.open { background: rgba(0, 0, 0, .56); }

#mStage .m-filter-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 29;
    background: #1a1a2a;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -6px 40px rgba(0, 0, 0, .62);
    padding: 8px 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
    transform: translateY(100%);
    transition: transform .24s cubic-bezier(.32, 1, .28, 1);
    max-height: min(70vh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#mStage .m-filter-sheet.open { transform: translateY(0); }

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

#mStage .m-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
#mStage .m-filter-head strong {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
}

#mStage .m-filter-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

#mStage .m-filter-options {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

#mStage .m-filter-opt {
    width: 100%;
    min-height: 52px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .05);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-align: left;
    padding: 0 14px;
    -webkit-tap-highlight-color: transparent;
}

#mStage .m-filter-opt.active {
    border-color: rgba(42, 154, 165, .9);
    background: linear-gradient(135deg, rgba(34, 136, 145, .38), rgba(26, 107, 115, .34));
}

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;
}

/* 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;
}
body.m-on.m-text #mStage .m-composer input::placeholder {
    color: var(--text-2);
    opacity: 0.65;
}
body.m-on.m-text #mStage .m-composer .m-send {
    background: #228891;
    color: #fff;
    box-shadow: 0 2px 8px rgba(34,136,145,.3);
}
/* 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; }
body.m-on.m-text:not(.matched) #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.38;
    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); }
}

/* =========================================================================
 * Phase 5 — Mobile brand: image logo
 * ========================================================================= */
#mStage .m-brand-link {
    display: inline-flex; align-items: center; justify-content: center;
    pointer-events: auto; -webkit-tap-highlight-color: transparent;
    text-decoration: none; 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
 * ========================================================================= */
#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;
    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 hand
 * ========================================================================= */
#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); }

/* ============================================================
   v2 Mobile filter rail (TikTok-style top chips) + kebab menu
   ------------------------------------------------------------
   Left side: horizontal scrollable filter chips (Gender / Country / NSFW).
   Right side: Next button + 3-dot kebab menu.
   Hidden by default; revealed by .hud-on (tap anywhere on stage) or
   permanently in text mode via body.m-on.m-text below.
   ============================================================ */
#mStage .m-filter-rail {
    pointer-events: auto;
    display: flex; align-items: center; gap: 7px;
    overflow-x: auto;
    max-width: calc(100% - 110px);
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 4px;
}
#mStage .m-filter-rail::-webkit-scrollbar { display: none; }
#mStage .m-fchip {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 11px;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 12px; font-weight: 700;
    -webkit-tap-highlight-color: transparent;
    transition: all .15s;
    cursor: pointer;
    white-space: nowrap;
}
#mStage .m-fchip:active { transform: scale(.96); }
#mStage .m-fchip .m-fchip-ico { font-size: 13px; line-height: 1; }
#mStage .m-fchip.is-locked { color: rgba(230,230,230,.85); }
#mStage .m-fchip.is-locked .m-fchip-lock {
    margin-left: 2px; font-size: 10px; opacity: .85;
}
#mStage .m-fchip.is-active {
    background: linear-gradient(135deg, #2a9aa5, #228891);
    border-color: rgba(255,255,255,.4);
    color: #fff;
}
#mStage .m-fchip-nsfw[aria-pressed="true"] {
    background: linear-gradient(135deg, #2a9aa5, #228891);
    border-color: rgba(255,255,255,.4);
}
#mStage .m-fchip-nsfw[aria-pressed="false"] {
    background: linear-gradient(135deg, #ff4d6d, #c1144d);
    border-color: rgba(255,255,255,.4);
}
#mStage .m-fchip-state { font-weight: 900; letter-spacing: .04em; margin-left: 3px; }

/* Text mode: rail always visible (mirrors m-top text-mode rule below) */
body.m-on.m-text #mStage .m-filter-rail { display: flex; }

/* Mobile bottom-sheet paywall: brand-themed (overrides /css/desktop/chat.css
   variables loaded by /js/shared/premium.js — those use teal already, this
   just ensures the chrome edges hug the safe area properly). */
@media (max-width: 640px) {
    .modal.premium-modal.open .premium-card {
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
}

/* ============================================================
   v3 Mobile responsive polish
   - Filter chips: compact, never overflow viewport, room for Next + kebab
   - Quick-report button on partner tile (matched state only)
   - Store row: Play CTA + icon-only IG/WA chips
   ============================================================ */
#mStage .m-filter-rail {
    flex: 1 1 auto;
    min-width: 0;          /* allow flex shrink */
    max-width: none;       /* let right side claim its own space */
    gap: 5px;
}
#mStage .m-fchip {
    padding: 5px 9px;
    font-size: 11px;
    gap: 4px;
    line-height: 1;
}
#mStage .m-fchip .m-fchip-lbl { max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
#mStage .m-fchip-state { font-size: 10px; padding: 0 4px; border-radius: 4px; background: rgba(255,255,255,.18); }
#mStage .m-fchip-nsfw[aria-pressed="false"] .m-fchip-state { background: rgba(255,255,255,.25); }
@media (max-width: 360px) {
    #mStage .m-fchip { padding: 4px 7px; font-size: 10.5px; }
    #mStage .m-fchip .m-fchip-lbl { max-width: 50px; }
}

/* Top-right cluster wider on very narrow screens too */
#mStage .m-top-right {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 6px;
}

/* Quick report button (visible only when matched). Round red pill,
   matches the TikTok-style "danger" affordance. */
#mStage .m-quick-report {
    pointer-events: auto;
    background: linear-gradient(135deg, #ff4d6d, #c1144d);
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(193,20,77,.35);
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s;
}
#mStage .m-quick-report[hidden] { display: none; }
#mStage .m-quick-report:active { transform: scale(.92); }

/* Store row: Play CTA grows; IG/WA are 40px circles */
#mStage .m-store-row {
    display: flex; gap: 10px; align-items: stretch;
}
#mStage .m-store-row .m-menu-store {
    flex: 1 1 auto;
}
#mStage .m-social-icon {
    flex: 0 0 auto;
    width: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    transition: transform .12s, filter .15s;
}
#mStage .m-social-icon:active { transform: scale(.94); }
#mStage .m-social-icon.ig {
    background: linear-gradient(135deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888);
}
#mStage .m-social-icon.wa {
    background: linear-gradient(135deg, #25d366, #128c7e);
}
