:root{font-family:system-ui,-apple-system,Segoe UI,sans-serif;background:var(--bg);color:var(--text)}*{box-sizing:border-box}body{margin:0;border-top:3px solid #f59e0b}.shell{max-width:1000px;margin:auto;padding:22px}header,.head,.controls{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}header{margin-bottom:26px}h1{font-size:clamp(24px,5vw,38px);margin:4px 0}h1 span,small{color:var(--accent-text)}h2{margin:0 0 6px}p{color:var(--text-3)}.identity{background:var(--btn-2);padding:12px;border-radius:24px;font-size:13px}.panel{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:clamp(18px,4vw,30px);margin:14px 0}form{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:24px 0}label{width:100%;font-weight:650}label span{font-weight:400;color:var(--muted)}input{flex:1;min-width:min(200px,100%);border:1px solid var(--line-6);background:var(--surface-2);color:var(--text);border-radius:12px;padding:14px;font:inherit}button,a.btn,a.secondary,a.danger{background:#803cf4;color:#fff;border:0;border-radius:12px;padding:13px 17px;font:inherit;font-weight:650;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;line-height:1.2}a{color:var(--accent-text-2)}button:disabled{opacity:.6}.secondary{background:var(--btn-hover);color:var(--text)}.danger{background:#9c304d}.rooms{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}.room{display:flex;flex-direction:column;gap:10px;background:var(--btn);border-radius:14px;padding:18px}.room span,.hint{color:var(--text-4);font-size:14px}.room button{align-self:start}.stage{text-align:center;padding:45px 10px}.avatar{font-size:52px;background:var(--line-2);width:120px;height:120px;display:grid;place-items:center;margin:auto;border-radius:50%}.livepill{background:#922b4a;color:#fff;padding:7px 12px;border-radius:20px;font-size:12px;font-weight:700}.controls{justify-content:center}#notice{margin:18px 0;color:var(--warn-text);min-height:24px}footer{text-align:center;color:var(--muted-2);font-size:12px;margin-top:24px}[hidden]{display:none!important}@media(max-width:600px){.shell{padding:14px}form button{width:100%}.panel{border-radius:16px}.controls button{flex:1}}

.actions{display:flex;gap:8px;flex-wrap:wrap}#diagnostics{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--btn-2);padding:16px;border-radius:12px;color:var(--accent-text-4);font-size:13px}button:focus-visible{outline:2px solid var(--accent-text-3);outline-offset:2px}

/* Keep audio elements in DOM and playable; visually hide only */
.remote-audio{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.remote-audio audio{display:block}

.hands-panel{margin:16px 0;padding:16px;background:var(--btn);border-radius:14px}
.hands-panel h3{margin:0 0 12px;font-size:15px;color:var(--accent-text)}
.hands-list{display:flex;flex-direction:column;gap:10px}
.hand-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;background:var(--surface);padding:12px 14px;border-radius:12px}
.hand-row span{color:var(--text-2);font-size:14px}
.hand-row .tag{font-size:11px;color:var(--muted);margin-left:8px}
.hand-row button{padding:8px 12px;font-size:13px}

.chat-panel{margin:16px 0;padding:16px;background:var(--btn);border-radius:14px;display:flex;flex-direction:column;gap:12px;max-height:340px}
.chat-panel h3{margin:0;font-size:15px;color:var(--accent-text)}
.chat-messages{flex:1;overflow-y:auto;min-height:120px;max-height:220px;display:flex;flex-direction:column;gap:8px;padding:4px 2px}
.chat-msg{background:var(--surface);border-radius:10px;padding:8px 12px;font-size:14px;line-height:1.35}
.chat-msg .who{font-weight:650;color:var(--accent-text);margin-right:6px}
.chat-msg .when{font-size:11px;color:var(--muted-3);margin-left:6px}
.chat-msg.mine{border-left:3px solid #803cf4}
.chat-msg.host-msg .who{color:#f59e0b}
.chat-form{display:flex;gap:8px;margin:0}
.chat-form input{flex:1;min-width:0;border:1px solid var(--line-6);background:var(--surface-2);color:var(--text);border-radius:12px;padding:12px;font:inherit}
.chat-form button{flex-shrink:0}
.chat-empty{color:var(--muted-3);font-size:13px;padding:8px;text-align:center}

.presence-bar{margin:12px 0;padding:10px 14px;background:var(--btn);border-radius:12px;display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.presence-bar #presenceCount{font-size:13px;font-weight:650;color:var(--accent-text)}
.presence-list{display:flex;flex-wrap:wrap;gap:6px}
.presence-chip{font-size:12px;background:var(--surface);color:var(--text-2);padding:4px 10px;border-radius:20px}
.presence-chip.host{border:1px solid #f59e0b;color:#f59e0b}
.presence-chip.speaking{border:1px solid #803cf4}
.react-bar{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:12px 0}
.react-btn,.love-btn{background:var(--btn-hover);padding:10px 14px;font-size:16px;line-height:1;color:var(--text)}
.love-btn{background:#5b2d8e;font-size:14px}
.love-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#5b2d8e;color:#fff;padding:12px 20px;border-radius:24px;font-weight:650;z-index:50;box-shadow:0 8px 24px rgba(0,0,0,.4)}
.chat-msg .del{float:right;background:transparent;color:var(--muted-2);padding:2px 8px;font-size:12px;font-weight:400}
.chat-msg .del:hover{color:var(--danger-text)}
.react-float{position:fixed;pointer-events:none;font-size:28px;animation:floatUp 1.6s ease-out forwards;z-index:40}
@keyframes floatUp{0%{opacity:1;transform:translateY(0) scale(1)}100%{opacity:0;transform:translateY(-120px) scale(1.4)}}

.typing-indicator{margin:0;min-height:18px;font-size:12px;color:var(--muted);font-style:italic}
.typing-indicator:not([hidden]){display:block}

.stream-badge{text-align:center;color:var(--danger-text);font-size:13px;font-weight:650;margin:8px 0}
.record-status{text-align:center;color:#f59e0b;font-size:13px;margin:8px 0}
.record-dl{display:block;text-align:center;margin:8px auto;max-width:240px}
button.recording{background:#9c304d;animation:pulseRec 1.2s infinite}
@keyframes pulseRec{0%,100%{opacity:1}50%{opacity:.7}}

.local-video{width:min(280px,80vw);border-radius:16px;background:#000;margin:12px auto;display:block}
.remote-videos{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:8px 0}
.remote-videos video{width:140px;border-radius:12px;background:#000}
.gateway-panel{margin:16px 0;padding:16px;background:var(--btn);border-radius:14px}
.gateway-panel input{width:100%;margin:6px 0 12px}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.65);display:grid;place-items:center;z-index:100;padding:16px}
.modal[hidden]{display:none!important}
.modal-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:22px;width:min(400px,100%);box-shadow:0 16px 48px rgba(0,0,0,.5)}
.modal-card h3{margin:0 0 8px}
.modal-card label{display:block;margin:12px 0 4px;font-size:13px;color:var(--muted)}
.modal-card input{width:100%}
.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:18px}

.identity{display:flex;align-items:center;gap:10px}
.id-avatar{width:32px;height:32px;border-radius:50%;object-fit:cover;background:var(--line-2)}
.create-house .topics-block{width:100%;margin:8px 0 4px}
.topics-head{display:flex;justify-content:space-between;align-items:center;color:var(--muted);font-size:13px}
.topics-head em{font-style:normal;opacity:.7}
.linkish{background:transparent;color:var(--accent-text-2);padding:4px 8px;font-size:13px}
.topic-chips,.topic-badges{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.topic-chip,.topic-badge{background:var(--line-2);color:var(--text-2);padding:6px 12px;border-radius:20px;font-size:12px;font-weight:650}
.topic-badge{background:var(--chip);border:1px solid var(--line-5)}
.topics-grid{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0;max-height:240px;overflow:auto}
.topics-grid button{background:var(--btn);color:var(--text-2);border:1px solid var(--line-3);border-radius:20px;padding:8px 14px;font-size:13px}
.topics-grid button.on{background:#803cf4;border-color:#803cf4}
.house-stage{text-align:center;padding:20px 10px 10px}
.avatar-ring{display:flex;flex-wrap:wrap;gap:14px;justify-content:center;align-items:flex-start;min-height:100px}
.person{width:88px;text-align:center}
.person .cycle{width:72px;height:72px;border-radius:50%;margin:0 auto 6px;position:relative;background:var(--line-2);overflow:hidden;border:3px solid var(--line-4)}
.person.host .cycle{border-color:#f59e0b;box-shadow:0 0 0 2px rgba(245,158,11,.35)}
.person.speaking .cycle{border-color:#803cf4}
.person .cycle img{width:100%;height:100%;object-fit:cover}
.person .cycle .fallback{width:100%;height:100%;display:grid;place-items:center;font-weight:700;font-size:22px;color:var(--accent-text)}
.person .badge{position:absolute;bottom:-2px;left:50%;transform:translateX(-50%);background:#f59e0b;color:#1a1020;font-size:9px;font-weight:800;padding:2px 6px;border-radius:8px;letter-spacing:.02em}
.person .name{font-size:12px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.house-host-line{color:var(--accent-text);font-size:13px}
.topics-modal{width:min(440px,100%)}

.video-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin:12px 0;max-width:720px;margin-left:auto;margin-right:auto}
.video-tile{position:relative;aspect-ratio:3/4;background:#0a0812;border-radius:16px;overflow:hidden;border:1px solid var(--line)}
.video-tile video{width:100%;height:100%;object-fit:cover;display:block;background:#000}
.video-tile .v-meta{position:absolute;top:8px;left:8px;right:8px;display:flex;align-items:center;gap:8px;z-index:2}
.video-tile .v-avatar{width:28px;height:28px;border-radius:50%;object-fit:cover;border:2px solid #fff;background:var(--line-2)}
.video-tile .v-name{font-size:12px;font-weight:700;color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.8);background:rgba(0,0,0,.35);padding:3px 8px;border-radius:12px}
.video-tile .v-host{background:#f59e0b;color:#1a1020}
.media-toggles{display:flex;justify-content:center;gap:10px;margin:10px 0}
.toggle-btn{min-width:110px}
.toggle-btn.off{opacity:.55;background:var(--danger-bg)}
.house-live .controls{gap:8px;margin-top:12px}
.house-live .controls button{padding:11px 14px;font-size:13px}
.gift-card{width:min(420px,100%)}
.gift-sub{color:var(--muted);font-size:13px;margin:0 0 10px}
.wallet-bal{font-weight:700;color:var(--ok-text);margin:0 0 12px}
.gift-presets{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}
.gift-presets button{background:var(--btn);border:1px solid var(--line-3);border-radius:12px;padding:12px 8px;color:var(--text-2);font-weight:700}
.gift-presets button.on{border-color:#803cf4;background:var(--chip-on);color:var(--text)}
.modal-actions.stack{flex-direction:column}
.modal-actions.stack button{width:100%}
.bank-box{background:var(--surface-2);border-radius:12px;padding:12px;font-size:13px;margin:12px 0}
.bank-box p{margin:4px 0;color:var(--text-2)}
.profile-card{text-align:center;position:relative}
.modal-x{position:absolute;right:12px;top:8px;background:transparent;color:var(--muted);font-size:22px;padding:4px 10px}
.profile-avatar-wrap{position:relative;width:96px;height:96px;margin:8px auto 12px}
.profile-avatar,.profile-avatar.fb{width:96px;height:96px;border-radius:50%;object-fit:cover;background:var(--line-2)}
.profile-avatar.fb{display:grid;place-items:center;font-size:32px;font-weight:700;color:var(--accent-text)}
.profile-live{position:absolute;bottom:-4px;left:50%;transform:translateX(-50%);background:#e11d48;color:#fff;font-size:10px;font-weight:800;padding:3px 8px;border-radius:10px}
.profile-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0}
.profile-stats div{background:var(--btn);border-radius:12px;padding:10px 6px}
.profile-stats strong{display:block;font-size:16px}
.profile-stats span{font-size:11px;color:var(--muted)}
.profile-bio{font-size:13px;color:var(--text-3);min-height:1em}
.avatar-ring{margin-top:8px}
.person{cursor:pointer}
.react-bar{margin:14px 0 6px}
.chat-panel{margin-top:12px}

.show-love-bar{display:flex;justify-content:center;margin:8px 0 14px;padding:0 8px}
.love-btn-lg{width:min(320px,100%);padding:14px 18px;font-size:15px;border-radius:14px}
.love-btn-gift{background:linear-gradient(180deg,#f5e6c8,#e8d4a8);color:#5c3d0a;width:100%;padding:14px;border-radius:14px;font-weight:700}
.profile-ring{width:104px;height:104px;border-radius:50%;padding:3px;background:linear-gradient(135deg,#f59e0b,#e11d48,#803cf4);margin:0 auto}
.profile-ring .profile-avatar,.profile-ring .fb{width:100%;height:100%;border:3px solid #fff;box-sizing:border-box}
.profile-house{font-weight:650;color:#1a1020;background:#f3f0f8;display:inline-block;padding:4px 10px;border-radius:12px;font-size:13px}
.profile-card{background:#fff;color:#1a1020}
.profile-card h3{color:#111}
.profile-card .hint{color:#6b7280}
.profile-card .profile-stats div{background:#f3f4f6}
.profile-card .profile-stats span{color:#6b7280}
.profile-card .profile-bio{color:#4b5563}
.profile-card .modal-x{color:#6b7280}
.profile-actions{margin-top:8px}
.house-live .panel,.house-live{padding-bottom:20px}
.chat-panel{margin:12px 0}
.hands-panel{margin:12px 0}
.video-grid{gap:12px;padding:4px 0 8px}
.media-toggles{margin:12px 0 4px}
.wallet-bal{font-size:15px;padding:10px 12px;background:var(--ok-bg);border-radius:12px;color:var(--ok-text)}
.gift-presets{margin:8px 0 14px}
.gift-card label{margin-top:10px}

/* ===== V7.3 theme: follows the device (or the member's saved Haske247 preference); no toggle ===== */
:root{color-scheme:dark;--bg:#0e0b19;--text:#f6f4fa;--surface:#1d192c;--surface-2:#151221;--btn:#292338;--btn-2:#252036;--chip:#2a2140;--btn-hover:#353045;--line:#393149;--line-2:#342c4b;--line-3:#3d3550;--line-4:#4a3f63;--line-5:#5a4a7a;--line-6:#625975;--text-2:#e8e4f0;--text-3:#c7c1d5;--text-4:#bcb4cd;--muted:#b6aaca;--muted-2:#9f94b5;--muted-3:#8a809c;--accent-text:#c5a9ff;--accent-text-2:#9b7dff;--accent-text-3:#d8c3ff;--accent-text-4:#e8d9ff;--danger-text:#ff8a9a;--danger-bg:#4a3040;--ok-text:#a7f3d0;--warn-text:#ffcf89;--sheet-bg:#1d192c;--sheet-text:#f6f4fa;--sheet-muted:#b6aaca;--sheet-soft:#292338;--sheet-soft-2:#322b46;--sheet-x:#322b46;--sheet-grab:#4a3f63;--gift-bg:#3a2f1a;--gift-line:#8a6d2f;--gift-text:#ffe3a3;--chip-ok-bg:#16382a;--chip-ok-text:#7be0a8;--chip-love-bg:#4a1d2c;--chip-love-text:#ff9bb5;--ring-gap:#1d192c;--glass-a:rgba(44,37,68,.82);--glass-b:rgba(30,25,48,.66);--glass-line:rgba(255,255,255,.14);--glass-hi:rgba(255,255,255,.12);--gh-title:#ffffff;--gh-text:#f2eefb;--gh-muted:#c1b9d6;--gh-fallback:#26203a;--gh-face-bg:#3a3253;--gh-face-text:#e4dcff;--gh-more:#58516f;--cap-a:rgba(245,158,11,.24);--cap-b:rgba(52,211,153,.22);--cap-c:rgba(139,92,246,.28);--cap-d:rgba(244,114,182,.24);--cap-text:#f3effc;--cap-line:rgba(255,255,255,.14);--glow-o:.9;--shadow:rgba(0,0,0,.5);--chip-on:#3a2a5c;--ok-bg:#0f2e22;}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]){color-scheme:light;--bg:#f4f2f9;--text:#16131f;--surface:#ffffff;--surface-2:#f1eef7;--btn:#ebe7f4;--btn-2:#e6e1f1;--chip:#ece5fa;--btn-hover:#ddd6ec;--line:#ddd7ea;--line-2:#d6cfe6;--line-3:#d0c8e1;--line-4:#c4bad9;--line-5:#b5a8d1;--line-6:#bdb3d2;--text-2:#2a2538;--text-3:#4a4458;--text-4:#514a62;--muted:#5b5470;--muted-2:#6b6482;--muted-3:#7a7390;--accent-text:#6a27d6;--accent-text-2:#5b21b6;--accent-text-3:#6a27d6;--accent-text-4:#5b21b6;--danger-text:#be123c;--danger-bg:#fde4ea;--ok-text:#047857;--warn-text:#b45309;--sheet-bg:#ffffff;--sheet-text:#14121a;--sheet-muted:#6b6b76;--sheet-soft:#f2f2f3;--sheet-soft-2:#ececee;--sheet-x:#ececee;--sheet-grab:#d4d4d8;--gift-bg:#f2eadb;--gift-line:#c9a45c;--gift-text:#3a2a08;--chip-ok-bg:#e0f0e5;--chip-ok-text:#17703d;--chip-love-bg:#fde3ea;--chip-love-text:#c0204a;--ring-gap:#ffffff;--glass-a:rgba(255,255,255,.88);--glass-b:rgba(255,255,255,.68);--glass-line:rgba(255,255,255,.75);--glass-hi:rgba(255,255,255,.9);--gh-title:#0c0a12;--gh-text:#14121a;--gh-muted:#55525f;--gh-fallback:#f4f1ea;--gh-face-bg:#cfc8e0;--gh-face-text:#4a3d6b;--gh-more:#6f7482;--cap-a:rgba(253,236,200,.95);--cap-b:rgba(220,243,228,.95);--cap-c:rgba(228,222,252,.95);--cap-d:rgba(253,224,232,.95);--cap-text:#3a3447;--cap-line:rgba(255,255,255,.7);--glow-o:.5;--shadow:rgba(40,30,80,.22);--chip-on:#e3d6fb;--ok-bg:#dcf3e6;}}
:root[data-theme="light"]{color-scheme:light;--bg:#f4f2f9;--text:#16131f;--surface:#ffffff;--surface-2:#f1eef7;--btn:#ebe7f4;--btn-2:#e6e1f1;--chip:#ece5fa;--btn-hover:#ddd6ec;--line:#ddd7ea;--line-2:#d6cfe6;--line-3:#d0c8e1;--line-4:#c4bad9;--line-5:#b5a8d1;--line-6:#bdb3d2;--text-2:#2a2538;--text-3:#4a4458;--text-4:#514a62;--muted:#5b5470;--muted-2:#6b6482;--muted-3:#7a7390;--accent-text:#6a27d6;--accent-text-2:#5b21b6;--accent-text-3:#6a27d6;--accent-text-4:#5b21b6;--danger-text:#be123c;--danger-bg:#fde4ea;--ok-text:#047857;--warn-text:#b45309;--sheet-bg:#ffffff;--sheet-text:#14121a;--sheet-muted:#6b6b76;--sheet-soft:#f2f2f3;--sheet-soft-2:#ececee;--sheet-x:#ececee;--sheet-grab:#d4d4d8;--gift-bg:#f2eadb;--gift-line:#c9a45c;--gift-text:#3a2a08;--chip-ok-bg:#e0f0e5;--chip-ok-text:#17703d;--chip-love-bg:#fde3ea;--chip-love-text:#c0204a;--ring-gap:#ffffff;--glass-a:rgba(255,255,255,.88);--glass-b:rgba(255,255,255,.68);--glass-line:rgba(255,255,255,.75);--glass-hi:rgba(255,255,255,.9);--gh-title:#0c0a12;--gh-text:#14121a;--gh-muted:#55525f;--gh-fallback:#f4f1ea;--gh-face-bg:#cfc8e0;--gh-face-text:#4a3d6b;--gh-more:#6f7482;--cap-a:rgba(253,236,200,.95);--cap-b:rgba(220,243,228,.95);--cap-c:rgba(228,222,252,.95);--cap-d:rgba(253,224,232,.95);--cap-text:#3a3447;--cap-line:rgba(255,255,255,.7);--glow-o:.5;--shadow:rgba(40,30,80,.22);--chip-on:#e3d6fb;--ok-bg:#dcf3e6;}
:root[data-theme="dark"]{color-scheme:dark;--bg:#0e0b19;--text:#f6f4fa;--surface:#1d192c;--surface-2:#151221;--btn:#292338;--btn-2:#252036;--chip:#2a2140;--btn-hover:#353045;--line:#393149;--line-2:#342c4b;--line-3:#3d3550;--line-4:#4a3f63;--line-5:#5a4a7a;--line-6:#625975;--text-2:#e8e4f0;--text-3:#c7c1d5;--text-4:#bcb4cd;--muted:#b6aaca;--muted-2:#9f94b5;--muted-3:#8a809c;--accent-text:#c5a9ff;--accent-text-2:#9b7dff;--accent-text-3:#d8c3ff;--accent-text-4:#e8d9ff;--danger-text:#ff8a9a;--danger-bg:#4a3040;--ok-text:#a7f3d0;--warn-text:#ffcf89;--sheet-bg:#1d192c;--sheet-text:#f6f4fa;--sheet-muted:#b6aaca;--sheet-soft:#292338;--sheet-soft-2:#322b46;--sheet-x:#322b46;--sheet-grab:#4a3f63;--gift-bg:#3a2f1a;--gift-line:#8a6d2f;--gift-text:#ffe3a3;--chip-ok-bg:#16382a;--chip-ok-text:#7be0a8;--chip-love-bg:#4a1d2c;--chip-love-text:#ff9bb5;--ring-gap:#1d192c;--glass-a:rgba(44,37,68,.82);--glass-b:rgba(30,25,48,.66);--glass-line:rgba(255,255,255,.14);--glass-hi:rgba(255,255,255,.12);--gh-title:#ffffff;--gh-text:#f2eefb;--gh-muted:#c1b9d6;--gh-fallback:#26203a;--gh-face-bg:#3a3253;--gh-face-text:#e4dcff;--gh-more:#58516f;--cap-a:rgba(245,158,11,.24);--cap-b:rgba(52,211,153,.22);--cap-c:rgba(139,92,246,.28);--cap-d:rgba(244,114,182,.24);--cap-text:#f3effc;--cap-line:rgba(255,255,255,.14);--glow-o:.9;--shadow:rgba(0,0,0,.5);--chip-on:#3a2a5c;--ok-bg:#0f2e22;}

/* ===== mini profile sheet ===== */
.tap{cursor:pointer}
.sheet-modal{place-items:end center;padding:0}
.profile-sheet{width:min(520px,100%);max-height:94vh;max-height:94dvh;overflow:auto;border-radius:28px 28px 0 0;border:0;padding:12px 20px calc(22px + env(safe-area-inset-bottom));background:var(--sheet-bg);color:var(--sheet-text);text-align:center;position:relative}
@media(min-width:700px){.sheet-modal{place-items:center;padding:16px}.profile-sheet{border-radius:28px}}
.sheet-grab{display:block;width:40px;height:5px;border-radius:3px;background:var(--sheet-grab);margin:0 auto 8px}
.profile-sheet .modal-x{position:absolute;top:14px;right:14px;width:44px;height:44px;border-radius:50%;background:var(--sheet-x);color:var(--sheet-muted);font-size:22px;line-height:1;padding:0;display:grid;place-items:center}
.ps-avatar-wrap{position:relative;width:104px;height:104px;margin:34px auto 22px}
.ps-avatar,.ps-avatar.fb{width:100%;height:100%;border-radius:34px;object-fit:cover;background:#e4def2;display:grid;place-items:center;font-size:36px;font-weight:800;color:#5b3fa8}
.ps-crown{position:absolute;top:-30px;left:50%;transform:translateX(-50%) rotate(-6deg);font-size:34px;filter:drop-shadow(0 2px 2px rgba(0,0,0,.25));z-index:2}
.ps-live{position:absolute;left:50%;bottom:-12px;transform:translateX(-50%);width:max-content;white-space:nowrap;line-height:1.2;background:#e5302f;color:#fff;font-size:12px;font-weight:800;letter-spacing:.04em;padding:4px 14px;border-radius:999px;border:3px solid var(--ring-gap)}
.profile-sheet h3{margin:6px 0 10px;font-size:25px;color:var(--sheet-text);overflow-wrap:anywhere}
.ps-badges{display:flex;flex-wrap:wrap;gap:7px;justify-content:center;min-height:6px}
.ps-chip{padding:6px 13px;border-radius:999px;font-size:13px;font-weight:800}
.ps-verified{background:var(--chip-ok-bg);color:var(--chip-ok-text)}
.ps-role{background:#0f7a68;color:#fff}
.ps-love{background:var(--chip-love-bg);color:var(--chip-love-text)}
.ps-meta{margin:10px 0 0;color:var(--sheet-muted);font-size:13px;font-weight:600}
.ps-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0 14px}
.ps-stats div{background:var(--sheet-soft);border-radius:18px;padding:14px 6px}
.ps-stats strong{display:block;font-size:20px;color:var(--sheet-text)}
.ps-stats span{font-size:13px;color:var(--sheet-muted)}
.ps-mutuals{display:flex;align-items:center;justify-content:center;gap:10px;margin:6px 0 12px;font-size:13px;color:var(--sheet-muted);text-align:left}
.ps-mstack{display:inline-flex;flex:none}
.ps-mface{width:28px;height:28px;border-radius:50%;object-fit:cover;border:2px solid var(--ring-gap);margin-left:-8px;background:#cfc8e0;display:grid;place-items:center;font-size:11px;font-weight:800;color:#4a3d6b}
.ps-mface:first-child{margin-left:0}
.ps-mtext b{color:var(--sheet-text)}
.ps-bio{margin:6px 0 10px;color:var(--sheet-muted);font-size:14px}
.ps-social{display:inline-flex;background:var(--sheet-soft);color:var(--sheet-text);border-radius:999px;padding:11px 22px;font-size:14px;font-weight:700;margin:4px 0 16px}
.ps-actions{display:flex;flex-direction:column;gap:12px;margin-top:4px}
.ps-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:54px;padding:17px;border-radius:999px;font-size:17px;font-weight:800;border:2px solid transparent;text-align:center}
.ps-join{background:#1a6df0;color:#fff}
.ps-gift{background:var(--gift-bg);color:var(--gift-text);border-color:var(--gift-line)}
.ps-gift.is-off{opacity:.45;cursor:not-allowed}
.ps-soft{background:var(--sheet-soft-2);color:var(--sheet-text)}
.ps-hint{margin:10px 0 0;font-size:12px;color:var(--sheet-muted)}
.ps-safety{display:flex;justify-content:center;gap:26px;margin-top:18px}
.ps-safety .linkish{background:none;color:var(--sheet-muted);font-size:14px;font-weight:600;min-height:44px;min-width:44px;display:inline-flex;align-items:center;gap:6px;padding:8px 10px}
.ps-safety .linkish:first-child{color:#d6402f}

/* ===== V7.2.5 device polish ===== */
html{-webkit-text-size-adjust:100%}
body.modal-open{overflow:hidden}
.modal{overflow-y:auto;overscroll-behavior:contain;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
.modal-card{max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow-y:auto;overflow-wrap:anywhere}
.profile-sheet{max-height:94vh;max-height:94dvh;padding-bottom:calc(22px + env(safe-area-inset-bottom))}
.sheet-modal{padding:0}
@media(min-width:700px){.sheet-modal{padding:16px}}
.modal-x,.profile-sheet .modal-x{min-width:44px;min-height:44px}
.profile-sheet .modal-x{width:44px;height:44px}
.profile-sheet h3{overflow-wrap:anywhere}
input,select,textarea{font-size:16px}
.ps-btn{min-height:54px}
@media(max-width:360px){
  .profile-sheet{padding-left:14px;padding-right:14px}
  .ps-stats{gap:8px}.ps-stats div{padding:12px 4px}.ps-stats strong{font-size:18px}
  .ps-btn{font-size:16px}
}
@media(max-height:520px) and (orientation:landscape){
  .ps-avatar-wrap{width:72px;height:72px;margin:26px auto 16px}
  .ps-avatar,.ps-avatar.fb{border-radius:24px}
  .ps-stats{margin:12px 0}
  .ps-btn{min-height:46px;padding:12px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.ps-live{width:max-content;white-space:nowrap;line-height:1.2}
.ps-safety .linkish{min-height:44px;min-width:44px;display:inline-flex;align-items:center;gap:6px;padding:8px 10px}
.gift-presets button{white-space:nowrap;font-size:14px;padding:12px 4px;min-height:44px}
@media(max-width:360px){.gift-presets{gap:6px}.gift-presets button{font-size:13px}}

/* ===== glass house cards (lobby) ===== */
.rooms{position:relative;isolation:isolate;display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));padding:4px}
.rooms::before{content:"";position:absolute;inset:-14px;z-index:-1;pointer-events:none;border-radius:28px;filter:blur(26px);opacity:var(--glow-o);
  background:radial-gradient(60% 70% at 12% 18%,rgba(124,58,237,.55),transparent 70%),radial-gradient(55% 65% at 88% 30%,rgba(37,99,235,.5),transparent 70%),radial-gradient(60% 60% at 55% 95%,rgba(236,72,153,.4),transparent 70%)}
.gh-cell{container-type:inline-size;min-width:0}
.glass-house{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:16px;row-gap:8px;align-items:center;padding:18px;border-radius:28px;cursor:pointer;color:var(--gh-text);
  background:linear-gradient(160deg,var(--glass-a),var(--glass-b));
  -webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5);
  border:1px solid var(--glass-line);
  box-shadow:0 10px 30px var(--shadow),inset 0 1px 0 var(--glass-hi);
  transition:transform .15s ease,box-shadow .15s ease;outline-offset:3px}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.glass-house{background:var(--gh-fallback)}}
.glass-house:hover{transform:translateY(-2px)}
.glass-house:focus-visible{outline:3px solid #a46bff}
.gh-ring{grid-column:1;grid-row:1 / span 3;align-self:center;width:84px;height:84px;border-radius:50%;padding:3px;background:conic-gradient(from 200deg,#3b82f6,#ef4444,#3b82f6)}
.gh-head{grid-column:2;grid-row:1;min-width:0}
.gh-caps{grid-column:2;grid-row:2}
.gh-meta{grid-column:2;grid-row:3}
.gh-foot{grid-column:1 / -1;grid-row:4;margin-top:6px}
.gh-avatar,.gh-ring .fb{display:grid;place-items:center;width:100%;height:100%;border-radius:50%;object-fit:cover;border:3px solid var(--ring-gap);background:#d9d4e6;color:#4a3d6b;font-weight:800;font-size:28px}
.gh-title{margin:0;font-size:22px;line-height:1.15;font-weight:800;color:var(--gh-title);letter-spacing:-.01em;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.gh-handle{margin:2px 0 0;font-size:14px;color:var(--gh-muted);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-caps{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;padding:7px 12px;border-radius:18px;font-size:12px;font-weight:700;color:var(--cap-text);justify-self:start;max-width:100%;
  background:linear-gradient(90deg,var(--cap-a),var(--cap-b) 35%,var(--cap-c) 70%,var(--cap-d));box-shadow:inset 0 0 0 1px var(--cap-line)}
.gh-seg{display:inline-flex;align-items:center;gap:3px;white-space:nowrap}
.gh-dot{color:var(--gh-muted);font-size:10px}
.gh-meta{margin:0;font-size:13.5px;color:var(--gh-muted);font-weight:500;overflow-wrap:anywhere}
.gh-foot{display:flex;align-items:center;justify-content:space-between;gap:12px}
.gh-cta{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 26px;border-radius:999px;border:0;color:#fff;font-size:17px;font-weight:800;white-space:nowrap;flex:0 0 auto;
  background:linear-gradient(180deg,#2b7bf7,#1a62e6);box-shadow:0 6px 16px rgba(26,98,230,.4),inset 0 1px 0 rgba(255,255,255,.35)}
.gh-cta:hover{filter:brightness(1.06)}.gh-cta:active{transform:translateY(1px)}
.gh-heart{font-size:18px;line-height:1}
.gh-pile{display:flex;align-items:center;flex:none}
.gh-face{position:relative;width:44px;height:44px;border-radius:50%;border:3px solid var(--ring-gap);background:var(--gh-face-bg);margin-left:-12px;box-shadow:0 2px 8px rgba(0,0,0,.18)}
.gh-face:first-child{margin-left:0}
.gh-face-img{display:grid;place-items:center;width:100%;height:100%;border-radius:50%;object-fit:cover;background:var(--gh-face-bg);color:var(--gh-face-text);font-weight:800;font-size:15px}
.gh-more{display:grid;place-items:center;background:var(--gh-more);color:#fff;font-size:13px;font-weight:800}
.gh-badge{position:absolute;right:-6px;top:-8px;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:12px;background:#6b46d9;border:2px solid var(--ring-gap)}
@container (max-width:470px){
  .glass-house{padding:16px;column-gap:14px;row-gap:10px;border-radius:26px}
  .gh-ring{grid-row:1;width:68px;height:68px}
  .gh-caps{grid-column:1 / -1;grid-row:2;justify-self:stretch;justify-content:space-between;gap:4px 8px;font-size:clamp(10.5px,2.9cqw,12.5px);padding:8px 12px}
  .gh-dot{display:none}
  .gh-meta{grid-column:1 / -1;grid-row:3;font-size:clamp(12.5px,3.4cqw,13.5px)}
  .gh-foot{grid-row:4;margin-top:2px}
  .gh-title{font-size:clamp(18px,5.4cqw,22px)}
}
@container (max-width:400px){.gh-seg-love{display:none}}
@container (max-width:340px){
  .glass-house{padding:14px;column-gap:12px;border-radius:24px}
  .gh-ring{width:58px;height:58px}
  .gh-cta{padding:0 18px;font-size:16px}
  .gh-face{width:38px;height:38px;margin-left:-10px}
  .gh-pile .gh-face:not(:first-child){display:none}
}
@media(max-width:600px){
  .shell{padding:12px 8px}
  #lobby.panel{margin-inline:-8px;border-inline:0;border-radius:0;padding:14px 10px;overflow-x:clip}
  #lobby .head,#lobby .create-house{padding-inline:6px}
  .rooms{grid-template-columns:1fr;gap:14px;padding:0}
  .rooms::before{inset:-6px}
}
@media(min-width:1100px){.rooms{grid-template-columns:repeat(auto-fill,minmax(420px,1fr))}}
html,body{overflow-x:clip}

/* top-up: payment method buttons */
.gw-list{display:flex;flex-direction:column;gap:10px}
.gw-btn{width:100%;min-height:52px;font-size:16px;font-weight:800}
.host-locked{margin:8px 0 12px}
/* permissions: hide controls the member is not allowed to use (the server enforces these too) */
body.no-host #createForm,body.no-record #recordBtn,body.no-react #reactBar,body.no-speak #raiseHand,body.no-open-floor #openFloor,body.no-love-send #showLoveBar{display:none!important}
body.no-chat #chatInput,body.no-chat #chatSend{display:none!important}

/* V7.3.1 room interaction enhancements */
.v7-chat-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.v7-chat-head h3{margin:0}.v7-chat-head button,.v7-chat-show{border:1px solid rgba(128,128,128,.3);border-radius:999px;padding:8px 12px;background:var(--card,#202436);color:inherit;cursor:pointer}.v7-chat-show{margin:8px 0}.react-bar{display:flex;flex-wrap:wrap;gap:6px;max-height:130px;overflow:auto}.react-btn{min-width:42px;min-height:42px}.v7-msg-reply{border:0;background:transparent;color:inherit;opacity:.7;cursor:pointer;font-size:.75rem;padding:3px 5px}.chat-msg{cursor:pointer}.v7-reply-preview{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px;background:rgba(127,127,127,.12);border-left:3px solid #ff9c35;border-radius:6px;font-size:.8rem}.v7-reply-preview[hidden],.v7-chat-show[hidden]{display:none!important}.v7-reply-preview button{border:0;background:transparent;color:inherit;font-size:20px;cursor:pointer}

/* =====================================================================
   V7.4 UI/UX + mobile layer
   Fixes: link-buttons, chat composer, reaction popover, sticky action dock,
   toasts, bottom-sheet modals, touch targets, lighter effects on weak phones.
   ===================================================================== */
html{scroll-padding-bottom:140px;-webkit-tap-highlight-color:transparent}
body{min-height:100vh;min-height:100dvh;line-height:1.5;font-size:16px;overscroll-behavior-y:none}
button,[role=button],a.btn,a.secondary,a.danger,.person,.chat-msg,.tap{touch-action:manipulation}
button,a.btn,a.secondary,a.danger,.record-dl{min-height:44px;transition:filter .12s,background-color .12s,transform .08s}
button:active,a.btn:active,a.secondary:active{transform:scale(.98)}
@media(hover:hover){button:hover:not(:disabled),a.btn:hover,a.secondary:hover{filter:brightness(1.08)}}
a.secondary{background:var(--btn-hover);color:var(--text)}
a.danger{background:#9c304d;color:#fff}
.record-dl{display:flex;background:#803cf4;color:#fff;border-radius:12px;padding:12px 17px;font-weight:650;text-decoration:none;justify-content:center;align-items:center}
button:focus-visible,a:focus-visible,input:focus-visible,[role=button]:focus-visible{outline:3px solid var(--accent-text-3);outline-offset:2px}
input:focus{border-color:var(--accent-text-2);outline:0;box-shadow:0 0 0 3px rgba(128,60,244,.28)}
button:disabled{cursor:not-allowed}
.shell{padding-left:max(22px,env(safe-area-inset-left));padding-right:max(22px,env(safe-area-inset-right));padding-bottom:max(22px,env(safe-area-inset-bottom))}

/* header */
header{align-items:flex-start;margin-bottom:18px}
.identity{max-width:100%;padding:8px 14px 8px 8px}
.identity span{max-width:46vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.id-avatar{flex:none}

/* lobby */
.head>div:first-child{min-width:0}
.head p{margin:4px 0 0}
.create-house{padding:16px;margin:18px 0;background:var(--surface-2);border:1px solid var(--line);border-radius:16px}
.create-house label{margin-bottom:-4px}
.create-house #title{flex:1 1 100%}
.create-house>button[type=submit]{flex:1 1 100%;min-height:50px;font-size:17px}
.linkish{min-height:44px;padding:8px 12px;border-radius:10px}
.rooms:not(:has(*)){display:block;padding:36px 16px;text-align:center;color:var(--text-3);border:1px dashed var(--line-4);border-radius:18px;background:var(--surface-2)}
.rooms:not(:has(*))::before{display:none}
#notice:empty{display:none}

/* ---- toast: errors/status float in view instead of hiding at page bottom ---- */
#notice{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(16px + env(safe-area-inset-bottom));z-index:120;width:max-content;max-width:min(520px,calc(100vw - 24px));margin:0;padding:12px 16px;background:var(--surface);color:var(--warn-text);border:1px solid var(--line-4);border-radius:14px;box-shadow:0 10px 30px var(--shadow);font-size:14px;line-height:1.35;pointer-events:none;animation:toastIn .18s ease-out}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}
.love-toast{bottom:calc(120px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px);text-align:center}

/* ---- live room header ---- */
.house-live .head{flex-wrap:nowrap;align-items:flex-start}
.house-live h2{overflow-wrap:anywhere;line-height:1.2}
.house-live .livepill{flex:none;margin-top:2px}
.house-stage{padding:12px 0 4px}
.person{width:84px}
.person .name{margin-top:2px}
.person .badge{font-size:10px}
.person:focus-visible{outline:3px solid var(--accent-text-3);border-radius:14px}
.video-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr))}
.video-tile{max-height:min(68vh,560px);max-height:min(68dvh,560px)}
.video-grid>.video-tile:only-child{justify-self:center;width:min(100%,360px)}
.video-tile .v-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---- chat ---- */
.chat-panel{max-height:none;padding:14px;gap:10px}
.v7-chat-head button,.v7-chat-show{background:var(--btn-hover);color:var(--text);border:1px solid var(--line-4);min-height:40px}
.v7-chat-show{display:block;width:100%;margin:10px 0}
.chat-messages{min-height:96px;max-height:min(36vh,320px);max-height:min(36dvh,320px);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scroll-behavior:smooth}
.chat-msg{overflow-wrap:anywhere;word-break:break-word;padding:9px 12px}
.chat-msg .when{color:var(--muted-2)}
.chat-msg .del{min-width:36px;min-height:28px}
.v7-reply-preview{background:var(--surface);color:var(--text-2)}
.v7-reply-preview #replyLabel{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.v7-reply-preview button{min-width:44px;min-height:44px;padding:0;margin:-8px -8px -8px 0}
.v7-chat-composer{position:relative;display:flex;flex-wrap:wrap;gap:8px;align-items:stretch}
.v7-chat-composer #chatInput{flex:1 1 100%;min-width:0;min-height:48px}
.v7-react-wrap{position:static;display:flex}
.v7-icon-btn{width:48px;min-width:48px;height:48px;padding:0;font-size:20px;line-height:1;background:var(--btn-hover);color:var(--text);border-radius:12px}
.v7-icon-btn.active,.v7-icon-btn[aria-expanded=true]{background:var(--chip-on);box-shadow:inset 0 0 0 2px var(--accent-text-2)}
.love-btn-inline{flex:1 1 auto;min-height:48px;white-space:nowrap}
#chatSend{min-width:88px;min-height:48px}
body.no-react .v7-react-wrap{display:none!important}
body.no-love-send #showLove{display:none!important}
.react-popover{position:absolute;left:0;right:0;bottom:calc(100% + 8px);z-index:25;display:grid;grid-template-columns:repeat(auto-fit,minmax(46px,1fr));gap:6px;max-height:none;overflow:visible;margin:0;padding:10px;background:var(--surface);border:1px solid var(--line-4);border-radius:18px;box-shadow:0 14px 36px var(--shadow);animation:popIn .14s ease-out;transform-origin:bottom left}
@keyframes popIn{from{opacity:0;transform:translateY(6px) scale(.97)}to{opacity:1;transform:none}}
.react-popover .react-btn{min-width:0;min-height:46px;padding:0;font-size:22px;background:var(--btn)}
@media(min-width:700px){.v7-chat-composer #chatInput{flex:1 1 220px}.react-popover{left:auto;width:340px}}

/* ---- hands / presence ---- */
.hand-row button{min-height:40px}
.hands-panel,.presence-bar{margin:12px 0}

/* ---- host tools + sticky action dock ---- */
.host-tools{margin-top:14px;gap:8px}
.host-tools button{flex:1 1 140px}
.house-live .controls button{font-size:14px}
.gateway-panel input{min-height:46px}
.dock{position:sticky;bottom:0;z-index:30;margin:16px calc(-1 * clamp(18px,4vw,30px)) calc(-1 * clamp(18px,4vw,30px));padding:12px clamp(18px,4vw,30px) calc(12px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line);border-radius:0 0 20px 20px;box-shadow:0 -10px 24px var(--shadow)}
.dock .media-toggles{margin:0 0 10px}
.dock .toggle-btn{flex:1 1 0;min-width:0}
.dock-actions{flex-wrap:nowrap;gap:8px;justify-content:stretch}
.dock-actions button{flex:1 1 0;min-width:0;padding:12px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dock-actions #leave{flex:0 1 auto;min-width:96px}
.toggle-btn.off{background:var(--danger-bg);color:var(--danger-text);opacity:1}
.stream-badge{margin:10px 0 0}

/* ---- modals: bottom sheets on phones (thumb reach, keyboard friendly) ---- */
.modal-card{overscroll-behavior:contain}
.modal-actions button{min-height:48px;flex:1 1 auto}
.modal-actions:not(.stack) button{flex:1 1 0}
.modal-card input{min-height:48px}
.gift-presets button.on{box-shadow:inset 0 0 0 1px #803cf4}
.topics-grid button{min-height:40px}
@media(max-width:600px){
  .modal:not(.sheet-modal){place-items:end center;padding:0}
  .modal:not(.sheet-modal) .modal-card{width:100%;max-height:92vh;max-height:92dvh;border-radius:24px 24px 0 0;border-bottom:0;padding:22px 18px calc(22px + env(safe-area-inset-bottom));animation:sheetUp .22s ease-out}
  .modal:not(.sheet-modal) .modal-card::before{content:"";display:block;width:40px;height:5px;border-radius:3px;background:var(--line-5);margin:-10px auto 14px}
  .profile-sheet{animation:sheetUp .22s ease-out}
}
@keyframes sheetUp{from{transform:translateY(40px);opacity:.6}to{transform:none;opacity:1}}

/* ---- phones ---- */
@media(max-width:600px){
  .shell{padding-top:10px;padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
  header{padding:0 6px;margin-bottom:12px}
  header small{font-size:11px;letter-spacing:.04em}
  h1{font-size:26px}
  .identity{font-size:12.5px}
  #lobby .head{align-items:flex-start}
  #lobby .actions{width:100%}
  #lobby .actions>*{flex:1}
  .house-live{border-radius:16px;padding:16px 12px;margin-inline:0}
  .dock{margin-inline:-12px;margin-bottom:-16px;padding-inline:12px;border-radius:0 0 16px 16px}
  .love-toast{left:12px;right:12px;transform:none;width:auto}
  .controls button{flex:1 1 calc(50% - 8px)}
  .dock-actions button{flex:1 1 0}
  .ps-btn{font-size:16px}
}
@media(max-width:360px){
  .person{width:76px}
  .person .cycle{width:64px;height:64px}
  .v7-icon-btn{width:44px;min-width:44px;height:44px}
  .dock-actions #leave{min-width:80px}
}
/* short landscape phones: a sticky dock would eat the screen */
@media(max-height:480px) and (orientation:landscape){
  .dock{position:static;box-shadow:none;margin-top:12px}
  .chat-messages{max-height:40vh;max-height:40dvh}
  .video-tile{max-height:80vh;max-height:80dvh}
}

/* ---- performance on budget phones: soften glass + drop the blurred glow layer ---- */
.rooms::before{filter:none;opacity:calc(var(--glow-o) * .55)}
@media(max-width:600px),(pointer:coarse){
  .glass-house{-webkit-backdrop-filter:none;backdrop-filter:none;background:linear-gradient(160deg,var(--gh-fallback),var(--glass-a))}
  .glass-house:active{transform:scale(.985)}
}
@media(hover:none){.glass-house:hover{transform:none}}
@media(prefers-reduced-transparency:reduce){.glass-house{-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--gh-fallback)}}
.glass-house:focus-visible{outline-offset:2px}
.gh-face-img,.gh-avatar,.ps-avatar,.id-avatar{background-color:var(--gh-face-bg)}

/* ---- V7.4 refinements: no dead gaps, compact room on phones, toast clears the dock ---- */
.video-grid:empty{display:none}
#connectionDetail:empty,#roomStatus:empty,.house-host-line:empty,.topic-badges:empty{display:none}
#connectionDetail{font-size:13px;margin:6px 0 0}
#notice{pointer-events:auto;cursor:pointer}
body:has(#live:not([hidden])) #notice{bottom:calc(112px + env(safe-area-inset-bottom))}
@media(max-width:600px){
  .person{width:72px}
  .person .cycle{width:60px;height:60px}
  .person .cycle .fallback{font-size:20px}
  .avatar-ring{gap:10px 8px}
  .person .name{font-size:11.5px}
  body:has(#live:not([hidden])) header{margin-bottom:8px}
  body:has(#live:not([hidden])) header small{display:none}
  body:has(#live:not([hidden])) h1{font-size:20px;margin:0}
  .house-live .head h2{font-size:20px}
}
@media(max-width:360px){
  .person{width:64px}
  .person .cycle{width:54px;height:54px}
}

/* ---- V7.4 composer: grid (row 1: message + Send, row 2: tools + Show Love) ---- */
.v7-chat-composer{display:grid;grid-template-columns:48px 48px minmax(0,1fr) auto;grid-template-areas:"input input input send" "hide react love love";gap:8px}
.v7-chat-composer #chatInput{grid-area:input;flex:none}
.v7-chat-composer #chatSend{grid-area:send}
.v7-chat-composer #chatHideInline{grid-area:hide}
.v7-chat-composer .v7-react-wrap{grid-area:react}
.v7-chat-composer #showLove{grid-area:love;width:100%;min-width:0}
.v7-chat-composer .v7-icon-btn{width:100%;min-width:0}
body.no-react .v7-chat-composer{grid-template-areas:"input input input send" "hide love love love"}
@media(min-width:700px){
  .v7-chat-composer{grid-template-columns:minmax(0,1fr) 48px 48px auto auto;grid-template-areas:"input hide react love send"}
  body.no-react .v7-chat-composer{grid-template-columns:minmax(0,1fr) 48px auto auto;grid-template-areas:"input hide love send"}
  .v7-chat-composer #showLove{width:auto}
}
@media(max-width:600px){body:has(#live:not([hidden])) footer{display:none}}

/* ---- V7.4 contrast fixes (light theme) ---- */
.love-btn,.love-btn:hover{color:#fff}
.chat-msg.host-msg .who,.presence-chip.host,.record-status{color:var(--warn-text)}
.presence-chip.host{border-color:var(--warn-text)}
body:has(#live:not([hidden])) #notice{bottom:calc(140px + env(safe-area-inset-bottom))}

/* topics picker: legacy `form button{width:100%}` was stretching "Pick" across the row */
form .topics-head button,form .topics-head .linkish{width:auto;flex:none}
#topicsPick{border:1px solid var(--line-5);color:var(--accent-text-2);padding:8px 18px;border-radius:999px;font-weight:700}
.topics-head{gap:12px;min-height:44px}
.topic-chips:empty{display:none}
.rooms{margin-top:22px}


/* === v801: borderless messaging area, reaction cooldown, brand link === */
.chat-panel,.chat-messages,.chat-msg,.chat-msg.mine,.chat-form,.chat-form input,
.v7-chat-composer,.v7-chat-composer #chatInput,.v7-chat-head button,.v7-chat-show,
.v7-reply-preview,.v7-reply-preview button,.v7-icon-btn,.react-popover,.react-bar,
.chat-msg .del{border:0!important;border-left:0!important;outline-color:transparent;box-shadow:none}
.chat-form input:focus,.v7-chat-composer #chatInput:focus{outline:0;box-shadow:0 0 0 2px rgba(128,60,244,.35)}
.react-popover{box-shadow:0 8px 24px rgba(0,0,0,.35)!important}
h1 a.v7-brand{color:inherit;text-decoration:none;display:inline-block;padding:4px 0;cursor:pointer;-webkit-tap-highlight-color:transparent}
h1 a.v7-brand span{color:var(--accent-text)}
h1 a.v7-brand:focus-visible{outline:2px solid #803cf4;outline-offset:4px;border-radius:6px}

/* === v802: long floating reactions, picker feel === */
.react-float{position:fixed;pointer-events:none;font-size:30px;line-height:1;z-index:60;will-change:transform,opacity;
  text-shadow:0 2px 8px rgba(0,0,0,.35);animation:floatUpLong 6s ease-out forwards}
@keyframes floatUpLong{
  0%{opacity:0;transform:translate3d(0,0,0) scale(.7)}
  8%{opacity:1;transform:translate3d(0,calc(var(--rise,-600px)*.04),0) scale(1)}
  35%{transform:translate3d(var(--sway,0px),calc(var(--rise,-600px)*.4),0) scale(1.1)}
  70%{opacity:1}
  100%{opacity:0;transform:translate3d(calc(var(--sway,0px)*-1),var(--rise,-600px),0) scale(1.3)}}
.react-btn{touch-action:manipulation;transition:transform .08s}
.react-btn:active{transform:scale(1.35)}
@media (prefers-reduced-motion:reduce){.react-float{animation-duration:3s!important}}

/* === v802: dark / night mode (dark is the default; light overrides below) === */
:root{--gl-chat-bg:#130f20;--gl-msg:#1f1a30;--gl-msg-mine:#2b2146;--gl-pop:#1b1630;--gl-input:#100c1c;--gl-scroll:#3a3150}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]){--gl-chat-bg:#faf8ff;--gl-msg:#fff;--gl-msg-mine:#efe6ff;--gl-pop:#fff;--gl-input:#f1eef7;--gl-scroll:#cfc6e3}}
:root[data-theme="light"]{--gl-chat-bg:#faf8ff;--gl-msg:#fff;--gl-msg-mine:#efe6ff;--gl-pop:#fff;--gl-input:#f1eef7;--gl-scroll:#cfc6e3}
.chat-panel{background:var(--gl-chat-bg)}
.chat-msg{background:var(--gl-msg)}
.chat-msg.mine{background:var(--gl-msg-mine)}
.chat-form input,.v7-chat-composer #chatInput{background:var(--gl-input);color:var(--text)}
.chat-form input::placeholder{color:var(--muted-2);opacity:.9}
.react-popover,.react-bar{background:var(--gl-pop)}
.chat-messages{scrollbar-width:thin;scrollbar-color:var(--gl-scroll) transparent}
.chat-messages::-webkit-scrollbar{width:6px}.chat-messages::-webkit-scrollbar-thumb{background:var(--gl-scroll);border-radius:6px}
body{background:var(--bg)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) img.id-avatar,:root:not([data-theme="light"]) .avatar img{filter:brightness(.92)}}
:root[data-theme="dark"] img.id-avatar{filter:brightness(.92)}


/* === v803: compact mobile form factor === */
@media (max-width:700px){
  body{border-top-width:2px}
  .shell{padding:10px 12px}
  header{margin-bottom:8px;gap:8px;flex-wrap:nowrap;align-items:center}
  h1{font-size:19px;line-height:1.1;margin:0;letter-spacing:-.2px;font-weight:800}
  h1 a.v7-brand{padding:2px 0}
  .identity{padding:5px 10px;font-size:11px;border-radius:16px;display:flex;align-items:center;gap:6px;max-width:48vw}
  .identity span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .id-avatar{width:20px!important;height:20px!important}
  .panel{padding:12px;margin:8px 0;border-radius:14px}
  h2{font-size:16px;margin:0 0 2px;font-weight:700}
  p,.hint{font-size:12.5px;line-height:1.4;margin:2px 0}
  form{margin:10px 0 6px;gap:8px}
  label{font-size:12.5px}
  input,.chat-form input{padding:9px 11px;font-size:14px;border-radius:10px;min-height:38px}
  button,a.btn,a.secondary,a.danger{padding:9px 13px;font-size:13px;border-radius:10px;min-height:38px;font-weight:600}
  .create-house{gap:6px}
  .create-house>button[type=submit]{width:100%;min-height:40px}
  .topics-block{margin:0}
  .topics-head{font-size:11px;gap:8px}
  .topics-head em{font-size:10.5px}
  .topics-head button,.linkish{padding:5px 12px!important;min-height:30px!important;font-size:12px!important;border-radius:999px}
  .topic-chips{gap:4px}.topic-chips>*{font-size:11px;padding:3px 8px}
  .rooms{gap:8px;grid-template-columns:1fr}
  .glass-house{padding:10px 12px!important;border-radius:14px!important;gap:6px!important}
  .gh-ring{width:42px!important;height:42px!important;padding:2px!important}
  .gh-ring .gh-avatar,.gh-avatar{width:100%!important;height:100%!important;font-size:15px!important}
  .gh-title{font-size:14.5px!important;line-height:1.2!important;margin:0!important}
  .gh-handle{font-size:11.5px!important;margin:0!important}
  .gh-caps{padding:5px 9px!important;font-size:10.5px!important;gap:5px!important;border-radius:10px!important}
  .gh-meta{font-size:11px!important;margin:0!important}
  .gh-cta{padding:8px 12px!important;min-height:34px!important;font-size:12.5px!important}
  .livepill{padding:4px 9px;font-size:10px}
  .house-live .head h2{font-size:15px}
  .avatar-ring{transform-origin:top center}
  .controls{gap:8px}.controls button{padding:8px 10px;font-size:12.5px}
  .react-btn{min-width:36px;min-height:36px;padding:4px;font-size:20px}
  .chat-panel{padding:10px;gap:8px;border-radius:12px}
  .chat-msg{font-size:13px;padding:7px 10px}
  footer{margin-top:12px;font-size:11px}
}
@media (max-width:380px){h1{font-size:17px}.identity{max-width:44vw}.panel{padding:10px}}

.community-note{margin:8px 0 2px;padding:8px 10px;border-radius:10px;background:var(--chip);color:var(--accent-text);font-size:12.5px}
