:root{--bg:#f6f8fb;--card:#fff;--text:#172033;--muted:#667085;--brand:#19a463;--brand2:#0d7f4b;--danger:#c62828;--border:#e5e7eb}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:15px/1.6 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
a{color:var(--brand2);text-decoration:none}a:hover{text-decoration:underline}.topbar{height:68px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 4%;position:sticky;top:0;z-index:10}.brand img{height:42px;max-width:180px;object-fit:contain}.topbar nav{display:flex;gap:18px;align-items:center}.container{max-width:1100px;margin:0 auto;padding:32px 18px;min-height:calc(100vh - 140px)}
.footer{background:#fff;border-top:1px solid var(--border);padding:24px 4%;display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;color:var(--muted);font-size:13px}.footer-links{display:flex;gap:14px;flex-wrap:wrap}
.hero{padding:80px 20px;text-align:center;background:linear-gradient(135deg,#effcf5,#fff);border-radius:24px}.hero h1{font-size:clamp(34px,6vw,60px);line-height:1.05;margin:12px auto;max-width:800px}.hero p{font-size:18px;color:var(--muted);max-width:720px;margin:16px auto 28px}.btn{display:inline-block;border:0;border-radius:12px;background:var(--brand);color:#fff;padding:12px 18px;font-weight:700;cursor:pointer}.btn:hover{background:var(--brand2);text-decoration:none}.btn.secondary{background:#fff;color:var(--brand2);border:1px solid var(--brand)}.btn.danger{background:var(--danger)}.btn.small{padding:8px 12px}
.actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}.card{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:20px;box-shadow:0 3px 16px rgba(0,0,0,.04)}.card h2,.card h3{margin-top:0}.form{max-width:650px;margin:auto}.field{margin-bottom:14px}.field label{display:block;font-weight:650;margin-bottom:6px}.field input,.field select,.field textarea{width:100%;padding:11px 12px;border:1px solid #d5d9e0;border-radius:10px;background:#fff}.field textarea{min-height:120px}.help,.muted{color:var(--muted);font-size:13px}.alert{padding:12px 14px;border-radius:10px;margin-bottom:14px;background:#eef5ff}.alert.error{background:#fff0f0;color:#8f1d1d}.alert.success{background:#effcf5;color:#12683f}.alert.warning{background:#fff8e6;color:#7a5700}
.stat{font-size:28px;font-weight:800}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse;background:#fff}.table th,.table td{padding:10px;border-bottom:1px solid var(--border);text-align:left;white-space:nowrap}.badge{display:inline-block;padding:3px 8px;border-radius:999px;background:#eef2f6;font-size:12px}.badge.ok{background:#e8f7ef;color:#12683f}.badge.bad{background:#ffebeb;color:#8f1d1d}
.chatbox{height:60vh;background:#fff;border:1px solid var(--border);border-radius:16px;display:flex;flex-direction:column}.messages{flex:1;overflow:auto;padding:18px}.msg{max-width:75%;margin:8px 0;padding:9px 12px;border-radius:14px;background:#f1f4f7}.msg.me{margin-left:auto;background:#dff8eb}.composer{display:flex;gap:8px;padding:12px;border-top:1px solid var(--border)}.composer input{flex:1}
.video-grid{display:grid;grid-template-columns:2fr 1fr;gap:14px}.video-grid video{width:100%;background:#101318;border-radius:16px;aspect-ratio:16/9;object-fit:cover}.video-controls{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
@media(max-width:700px){.topbar{padding:0 14px}.topbar nav{gap:9px;font-size:13px}.video-grid{grid-template-columns:1fr}.footer{flex-direction:column}.hero{padding:55px 15px}}

.nav-icon{position:relative;white-space:nowrap}.icon-button{position:relative;border:0;background:transparent;font-size:20px;cursor:pointer;padding:6px}.notification-count{position:absolute;top:-2px;right:-4px;background:#c62828;color:#fff;border-radius:999px;min-width:17px;height:17px;padding:0 4px;font-size:10px;line-height:17px;font-weight:800}.notification-wrap{position:relative}.notification-panel{position:absolute;right:0;top:42px;width:min(390px,90vw);background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 12px 30px rgba(0,0,0,.12);overflow:hidden;z-index:50}.notification-head{display:flex;justify-content:space-between;align-items:center;padding:12px;border-bottom:1px solid var(--border)}.link-button{border:0;background:none;color:var(--brand2);cursor:pointer}.notification-list{max-height:420px;overflow:auto}.notification-item{padding:12px;border-bottom:1px solid var(--border);display:flex;gap:10px;justify-content:space-between;font-size:13px}.notification-item.unread{background:#f2fbf6}.notification-item small{color:var(--muted)}.notification-actions{display:flex;gap:5px;align-items:center}.search-results{display:grid;gap:10px;margin-top:15px}.user-result{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px;border:1px solid var(--border);border-radius:12px;background:#fff}.user-result .actions{justify-content:flex-end}.status-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#aaa;margin-right:5px}.status-dot.online{background:#19a463}.message-inbox{display:grid;gap:10px}.conversation-row{display:flex;justify-content:space-between;gap:12px;padding:14px;border:1px solid var(--border);border-radius:12px;background:#fff}.conversation-row:hover{border-color:var(--brand)}.chat-toolbar{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;border-bottom:1px solid var(--border)}.chatbox .messages{scroll-behavior:smooth}.message-empty{padding:30px;text-align:center;color:var(--muted)}

.nav-count{top:-5px;right:-9px}.unread-badge{display:inline-flex;align-items:center;justify-content:center;background:#c62828;color:#fff;border-radius:999px;min-width:20px;height:20px;padding:0 6px;font-size:11px;line-height:20px;font-weight:800;margin-left:5px}.call-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}.call-credit-pill{padding:7px 10px;border-radius:999px;background:#f1f4f7;color:var(--muted);font-size:12px}.portrait-video-stage{position:relative;width:min(100%,520px);margin:0 auto;background:#090b10;border-radius:20px;overflow:hidden;aspect-ratio:9/16;max-height:72vh}.portrait-video-stage>#remote{width:100%;height:100%;object-fit:cover;display:block}.local-preview{position:absolute;right:14px;top:14px;width:28%;max-width:145px;aspect-ratio:9/16;border:2px solid #fff;border-radius:12px;overflow:hidden;background:#111;box-shadow:0 5px 20px rgba(0,0,0,.35)}.local-preview video{width:100%;height:100%;object-fit:cover;display:block}.local-preview span{position:absolute;left:6px;bottom:5px;background:rgba(0,0,0,.55);color:#fff;padding:2px 6px;border-radius:6px;font-size:10px}.remote-label{position:absolute;left:12px;top:12px;background:rgba(0,0,0,.55);color:#fff;padding:4px 8px;border-radius:8px;font-size:12px}.video-call-card{max-width:760px;margin:auto}.video-controls{justify-content:center}.notification-actions .btn{white-space:nowrap}
@media(max-width:700px){.call-heading{flex-direction:column}.portrait-video-stage{width:min(100%,420px);max-height:68vh}.local-preview{width:30%}}

/* Compact logged-in navigation and unread badges */
.topbar nav{gap:12px;font-size:13px}
.compact-nav{font-size:13px;line-height:1.2;white-space:nowrap}
.nav-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;font-size:21px;position:relative;white-space:nowrap}
.icon-button{width:30px;height:30px;padding:2px;display:inline-flex;align-items:center;justify-content:center;font-size:20px}
.nav-count{top:-5px;right:-8px}
@media(max-width:700px){
  .topbar nav{gap:7px;font-size:12px}
  .compact-nav{font-size:12px}
  .nav-icon,.icon-button{width:28px;height:28px}
}

.page-title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:12px}
.search-summary{margin:4px 0 12px}
.user-main{min-width:0}
@media(max-width:700px){.page-title-row{flex-direction:column}.user-result{align-items:flex-start;flex-direction:column}.user-result .actions{width:100%;justify-content:flex-start}}

.search-box{display:flex;align-items:stretch;width:100%}
.search-box input{flex:1;min-width:0;border-radius:10px 0 0 10px}
.search-button{width:58px;border:1px solid #cfd6df;border-left:0;border-radius:0 10px 10px 0;background:#16a36a;color:#fff;font-size:22px;cursor:pointer}
.search-button:hover{filter:brightness(.96)}
.search-button:active{transform:scale(.98)}

/* BiliBili.rent modern dark interface */
:root{
 --bg:#0b1117;--card:#121b24;--text:#eef5f2;--muted:#94a5b5;--brand:#19c47a;--brand2:#0f9b5e;
 --danger:#ff5f67;--border:#263544;
}
html{background:var(--bg)}
body{background:radial-gradient(circle at 15% -10%,#143124 0,#0b1117 36%,#080d12 100%);color:var(--text);min-height:100vh}
.topbar{height:56px;background:rgba(10,16,22,.94);border-bottom:1px solid #1e2a35;padding:0 3%;backdrop-filter:blur(12px)}
.brand img{height:34px;max-width:150px}
.topbar nav{gap:7px;font-size:11px}
.compact-nav{font-size:11px;color:#c7d4de;padding:5px 5px}
.compact-nav:hover{color:#fff}
.nav-icon{width:28px;height:28px;font-size:17px;color:#d8e3ea}
.icon-button{width:28px;height:28px;font-size:17px;color:#d8e3ea}
.container{max-width:1120px;padding:26px 18px;min-height:calc(100vh - 120px)}
.card{background:rgba(18,27,36,.94);border-color:#263544;box-shadow:0 12px 35px rgba(0,0,0,.24)}
.card h1,.card h2,.card h3,.card strong{color:#f4f8f7}
.field input,.field select,.field textarea{background:#0d151d;color:#eef5f2;border-color:#304150}
.field input::placeholder{color:#718395}
.search-box input{border-color:#304150;background:#0d151d;color:#eef5f2}
.search-button{background:var(--brand2);border-color:var(--brand2)}
.user-result,.conversation-row,.table,.chatbox{background:#101923;border-color:#263544}
.user-result:hover{border-color:#1bba70;box-shadow:0 5px 20px rgba(0,0,0,.18)}
.notification-panel{background:#111b24;border-color:#2a3947}
.notification-head,.notification-item{border-color:#263544}
.notification-item.unread{background:#10281e}
.footer{background:#090f14;border-color:#1e2a35}
.footer,.muted,.help{color:#8fa1b1}
.btn.secondary{background:transparent;color:#55dda0;border-color:#239f6a}
.message-empty{color:#8fa1b1}
.badge{background:#1c2934;color:#b8c6d1}
.badge.ok{background:#103a29;color:#65e0a2}
.alert{background:#132b3e;color:#dceaf4}
.alert.error{background:#3a171b;color:#ffb7bb}
.alert.success{background:#103a29;color:#8ee5b7}
.chat-toolbar{border-color:#263544}
.messages{background:#0c141c}
.msg{background:#18232d}
.msg.me{background:#0e3b29}
@media(max-width:700px){
 .topbar{height:52px;padding:0 10px}.brand img{height:30px;max-width:125px}
 .topbar nav{gap:3px}.compact-nav{font-size:10px;padding:4px 2px}.nav-icon,.icon-button{width:25px;height:25px;font-size:16px}
 .container{padding:18px 10px}
}

.people-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(300px,1fr);gap:18px;align-items:start}
.people-card,.suggestions-card{min-width:0}
.suggestions-card{position:sticky;top:72px}
.suggestions-title{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:10px}
.suggestions-title h2{margin:0 0 5px;font-size:20px}
.suggested-list .user-result{padding:12px 10px;margin-bottom:8px}
.suggested-list .user-result .actions{margin-top:7px}
.suggested-list .user-result .btn{font-size:11px;padding:7px 9px}
.people-card .search-results .user-result{margin-bottom:9px}
@media(max-width:900px){
 .people-layout{grid-template-columns:1fr}
 .suggestions-card{position:static}
}
@media(max-width:600px){
 .suggestions-title{flex-direction:column}
 .suggestions-title .btn{width:100%}
 .search-button{width:52px}
}

/* =========================
   BiliBili.rent dark homepage
   ========================= */
.home-hero{
  position:relative;overflow:hidden;min-height:500px;display:flex;align-items:center;
  justify-content:center;text-align:center;border:1px solid #20302d;border-radius:30px;
  background:
    radial-gradient(circle at 50% 0%,rgba(25,196,122,.16),transparent 35%),
    radial-gradient(circle at 10% 80%,rgba(20,116,83,.13),transparent 35%),
    linear-gradient(145deg,#0d1a18 0%,#0a1218 48%,#071016 100%);
  box-shadow:0 24px 70px rgba(0,0,0,.42),inset 0 1px rgba(255,255,255,.025);
}
.hero-content{position:relative;z-index:2;max-width:900px;padding:58px 25px}
.hero-badge{display:inline-flex;margin-bottom:18px;padding:7px 13px}
.home-hero h1{
  margin:0;font-size:clamp(42px,7vw,76px);line-height:1.02;letter-spacing:-2.5px;
  color:#f3faf7;text-shadow:0 8px 30px rgba(0,0,0,.35)
}
.home-hero h1 span{
  background:linear-gradient(90deg,#61e9ac,#19c47a,#7be9bc);
  -webkit-background-clip:text;background-clip:text;color:transparent
}
.hero-lead{
  max-width:750px;margin:24px auto 0;font-size:18px;line-height:1.7;color:#a6b8c2
}
.hero-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:11px;margin-top:30px}
.hero-primary{box-shadow:0 10px 28px rgba(25,196,122,.2)}
.hero-secondary{background:rgba(8,17,22,.72)!important}
.hero-note{
  display:flex;justify-content:center;flex-wrap:wrap;gap:20px;margin-top:25px;
  color:#78908d;font-size:13px
}
.hero-glow{position:absolute;border-radius:50%;filter:blur(5px);pointer-events:none}
.hero-glow-one{width:260px;height:260px;left:-130px;top:-100px;background:rgba(25,196,122,.10)}
.hero-glow-two{width:330px;height:330px;right:-170px;bottom:-180px;background:rgba(31,121,92,.10)}

.home-features{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:18px
}
.feature-card{
  position:relative;padding:24px 20px;border:1px solid #22333b;border-radius:18px;
  background:linear-gradient(150deg,rgba(18,31,37,.96),rgba(11,20,27,.96));
  box-shadow:0 14px 35px rgba(0,0,0,.2);transition:transform .2s,border-color .2s
}
.feature-card:hover{transform:translateY(-3px);border-color:#238e67}
.feature-icon{
  width:43px;height:43px;display:flex;align-items:center;justify-content:center;
  border-radius:13px;background:#102b22;border:1px solid #1b6c4d;font-size:21px;margin-bottom:14px
}
.feature-card h3{margin:0 0 9px;font-size:17px;color:#f0f7f4}
.feature-card p{margin:0;color:#8ea1ad;font-size:13px;line-height:1.6}
.earning-highlight{margin-top:14px;color:#59dda0;font-size:12px;font-weight:700}

.home-earning{
  display:grid;grid-template-columns:minmax(0,1.4fr) minmax(300px,.8fr);gap:20px;margin-top:18px;
  padding:34px;border:1px solid #1d4b39;border-radius:22px;
  background:
    radial-gradient(circle at 80% 30%,rgba(25,196,122,.13),transparent 35%),
    linear-gradient(135deg,#10231d,#0c171e)
}
.earning-copy h2{margin:12px 0 10px;font-size:31px;color:#f2faf7}
.earning-copy p{max-width:720px;color:#94a8b3;line-height:1.7}
.earning-stats{display:grid;gap:10px;align-content:center}
.earning-stats div{
  display:flex;align-items:center;gap:15px;padding:13px 15px;border:1px solid #244038;
  border-radius:13px;background:rgba(5,13,17,.42)
}
.earning-stats strong{font-size:13px;color:#5be0a1}
.earning-stats span{font-size:13px;color:#bdcbd0}

.home-cta{
  margin-top:18px;padding:40px 20px;text-align:center;border:1px solid #24343d;border-radius:22px;
  background:linear-gradient(145deg,#101c24,#0b131a)
}
.home-cta h2{margin:0 0 8px;font-size:30px;color:#f1f7f5}
.home-cta p{margin:0 0 20px;color:#8fa2ad}

@media(max-width:950px){
 .home-features{grid-template-columns:repeat(2,minmax(0,1fr))}
 .home-earning{grid-template-columns:1fr}
}
@media(max-width:600px){
 .home-hero{min-height:0;border-radius:22px}
 .hero-content{padding:45px 17px}
 .home-hero h1{font-size:42px;letter-spacing:-1.5px}
 .hero-lead{font-size:15px}
 .hero-actions .btn{width:100%}
 .hero-note{gap:10px;flex-direction:column}
 .home-features{grid-template-columns:1fr}
 .home-earning{padding:25px 18px}
 .earning-copy h2,.home-cta h2{font-size:25px}
}

.people-card,.suggestions-card{border-radius:22px}
.user-result{display:flex;justify-content:space-between;gap:15px;align-items:center}
.user-main strong{font-size:15px}
.status-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#66737d;margin-right:5px}
.status-dot.online{background:#21d879;box-shadow:0 0 9px rgba(33,216,121,.7)}

.profile-card{max-width:820px;margin:auto}.profile-avatar-row{display:flex;align-items:center;gap:16px}.profile-avatar{width:92px;height:92px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#123629;border:2px solid #20c47a;color:#72e7b0;font-size:27px;font-weight:800}.profile-avatar img{width:100%;height:100%;object-fit:cover}.avatar-editor{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:18px 0}.upload-label{display:inline-flex;padding:10px 14px;border:1px solid #20b878;border-radius:10px;background:#0f3527;color:#6ce2a8;font-weight:700;cursor:pointer}.directory-person{display:flex;align-items:center;gap:11px}.mini-avatar{width:42px;height:42px;flex:0 0 42px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#123629;border:1px solid #295946;color:#68dfa6;font-weight:800}.mini-avatar img{width:100%;height:100%;object-fit:cover}.status-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#68757d;margin-right:5px}.status-dot.online{background:#20d47b;box-shadow:0 0 8px rgba(32,212,123,.7)}
.user-result{display:flex;align-items:center;justify-content:space-between;gap:12px}.user-result .actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}


/* Social profile / gallery */
.profile-avatar-link{display:block;text-decoration:none}.profile-avatar-link img{cursor:zoom-in}.photo-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:14px}.photo-tile{display:flex;flex-direction:column;gap:8px}.photo-tile img{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:12px;border:1px solid var(--border,#263442);background:#0b1219}.photo-tile>a{display:block}.own-gallery .photo-tile{min-width:0}.conversation-person,.chat-peer{display:flex;align-items:center;gap:10px}.directory-person .mini-avatar,.conversation-person .mini-avatar,.chat-peer .mini-avatar{flex:0 0 auto}.mini-avatar{width:44px;height:44px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#17232d}.mini-avatar img{width:100%;height:100%;object-fit:cover}.chat-peer strong a,.directory-person strong a{color:inherit;text-decoration:none}.chat-peer strong a:hover,.directory-person strong a:hover{text-decoration:underline}
@media(max-width:600px){.photo-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Incoming call prompt */
.incoming-call-overlay{position:fixed;inset:0;background:rgba(0,0,0,.72);display:flex;align-items:center;justify-content:center;z-index:9999;padding:18px}.incoming-call-box{width:min(440px,100%);background:#101922;border:1px solid #2b4352;border-radius:20px;padding:24px;box-shadow:0 20px 70px rgba(0,0,0,.45)}.incoming-call-box h2{margin:0 0 8px}.incoming-call-box p{margin:6px 0 18px}.incoming-call-actions{display:flex;gap:10px;justify-content:flex-end}.incoming-call-actions .btn{min-width:110px}


/* =========================
   v15: Chat room redesign
   ========================= */
.chat-room{
  width:100%;
  height:min(760px,calc(100vh - 150px));
  min-height:520px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #263544;
  border-radius:20px;
  background:#0b141c;
  box-shadow:0 18px 55px rgba(0,0,0,.28);
}
.chat-room-header{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border-bottom:1px solid #263544;
  background:#101b25;
}
.chat-room-person{display:flex;align-items:center;gap:12px;min-width:0}
.chat-avatar{
  width:48px;height:48px;flex:0 0 48px;border-radius:50%;overflow:hidden;
  display:flex;align-items:center;justify-content:center;
  background:#123629;border:1px solid #2a644c;color:#75e5af;font-weight:800;
  text-decoration:none;
}
.chat-avatar img{width:100%;height:100%;object-fit:cover}
.chat-room-identity{min-width:0;display:flex;flex-direction:column}
.chat-room-identity strong{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-room-identity strong a{color:#f5faf8}
.chat-room-identity span{font-size:12px;color:#8fa1af;margin-top:2px}
.chat-room-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.chat-room-actions .btn{white-space:nowrap}
.chat-room-messages{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding:22px clamp(14px,4vw,42px);
  background:
    radial-gradient(circle at 50% 0%,rgba(28,115,82,.07),transparent 40%),
    #0b141c;
  scroll-behavior:smooth;
}
.message-row{display:flex;flex-direction:column;max-width:min(78%,680px);margin:0 0 13px}
.message-row.mine{margin-left:auto;align-items:flex-end}
.message-row.theirs{margin-right:auto;align-items:flex-start}
.message-bubble{
  padding:11px 14px;border-radius:17px;
  color:#f0f6f4;line-height:1.45;word-break:break-word;white-space:pre-wrap;
  font-size:15px;box-shadow:0 4px 14px rgba(0,0,0,.12);
}
.message-row.mine .message-bubble{
  background:#0e5138;border-bottom-right-radius:5px;
}
.message-row.theirs .message-bubble{
  background:#192632;border-bottom-left-radius:5px;
}
.message-time{font-size:10px;color:#718493;margin:4px 5px 0}
.chat-composer{
  flex:0 0 auto;
  display:flex;align-items:flex-end;gap:9px;
  padding:12px 14px 7px;
  border-top:1px solid #263544;
  background:#101b25;
}
.composer-input-wrap{flex:1;min-width:0}
.chat-composer textarea{
  width:100%;resize:none;max-height:130px;min-height:44px;
  padding:11px 13px;border:1px solid #304150;border-radius:12px;
  background:#0b141c;color:#eef5f2;outline:none;font:inherit;line-height:1.4;
}
.chat-composer textarea:focus{border-color:#20c47a;box-shadow:0 0 0 2px rgba(32,196,122,.10)}
.chat-composer textarea::placeholder{color:#728493}
.send-message-btn{height:44px;white-space:nowrap}
.chat-hint{flex:0 0 auto;text-align:right;padding:0 16px 9px;background:#101b25;color:#6f8190;font-size:10px}
.chat-loading,.chat-empty,.chat-error{
  padding:45px 18px;text-align:center;color:#8295a3;
}
.chat-error{color:#ffb3b7}

@media(max-width:700px){
  .chat-room{
    height:calc(100vh - 95px);min-height:0;border-radius:14px;
  }
  .chat-room-header{align-items:flex-start;padding:11px;gap:9px}
  .chat-room-actions{width:100%;justify-content:flex-end}
  .chat-room-actions .btn{padding:7px 9px;font-size:11px}
  .chat-avatar{width:42px;height:42px;flex-basis:42px}
  .chat-room-identity strong{font-size:14px}
  .chat-room-messages{padding:16px 11px}
  .message-row{max-width:88%}
  .message-bubble{font-size:14px}
  .chat-composer{padding:9px 9px 5px;gap:7px}
  .send-message-btn{padding:10px 12px}
  .send-message-btn span{display:none}
  .chat-hint{font-size:9px;padding:0 10px 7px}
}

/* v15: video call stage works better on desktop and phones */
.portrait-video-stage{
  width:min(100%,560px);
  height:min(72vh,720px);
  max-height:none;
  aspect-ratio:9/16;
}
.portrait-video-stage>#remote{
  background:#05080b;
}
@media(min-width:701px){
  .video-call-card{max-width:820px}
}
@media(max-width:700px){
  .portrait-video-stage{width:min(100%,420px);height:min(68vh,680px)}
}

/* v16: chat UI based on supplied dark-mode HTML reference */
.chat-app-v16{width:100%;max-width:1000px;height:85vh;min-height:560px;margin:0 auto;background:#111827;color:#F3F4F6;display:flex;flex-direction:column;box-shadow:0 25px 50px -12px rgba(0,0,0,.5);border-radius:16px;border:1px solid #374151;overflow:hidden}
.chat-header-v16{padding:20px;background:#1F2937;border-bottom:1px solid #374151;display:flex;justify-content:space-between;align-items:center;gap:16px}
.chat-user-info-v16{display:flex;align-items:center;gap:12px;min-width:0}.chat-user-info-v16 h2{font-size:1.25rem;font-weight:600;letter-spacing:.5px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-user-avatar-v16{width:48px;height:48px;border-radius:50%;overflow:hidden;background:#374151;border:1px solid #4B5563;display:flex;align-items:center;justify-content:center;color:#93C5FD;font-weight:800;text-decoration:none;flex:0 0 48px}.chat-user-avatar-v16 img{width:100%;height:100%;object-fit:cover}.chat-status-v16{font-size:.85rem;color:#34D399;display:flex;align-items:center;gap:6px;margin-top:4px}.status-dot-v16{width:8px;height:8px;background:#34D399;border-radius:50%;box-shadow:0 0 8px #34D399}
.chat-controls-v16{display:flex;gap:12px}.chat-icon-btn-v16{background:transparent;border:1px solid #374151;color:#F3F4F6;padding:8px 16px;border-radius:20px;cursor:pointer;font-size:.9rem;font-weight:500;display:flex;align-items:center;gap:8px;transition:.3s}.chat-icon-btn-v16:hover{background:#374151}.chat-icon-btn-v16.call{border-color:#3B82F6;color:#3B82F6}.chat-icon-btn-v16.call:hover{background:#3B82F6;color:#fff;box-shadow:0 0 15px rgba(59,130,246,.4)}.chat-icon-btn-v16.end{border-color:#EF4444;color:#EF4444}.chat-icon-btn-v16.end:hover{background:#EF4444;color:#fff;box-shadow:0 0 15px rgba(239,68,68,.4)}
.chat-window-v16{flex:1;padding:25px;overflow-y:auto;display:flex;flex-direction:column;gap:20px;background-image:radial-gradient(circle at center,#111827 0%,#0B0F19 100%)}.bubble-v16{max-width:70%;padding:12px 18px;border-radius:20px;font-size:.95rem;line-height:1.5;word-wrap:break-word;white-space:pre-wrap;overflow-wrap:anywhere;animation:chatFadeV16 .3s ease}.bubble-v16.received-v16{align-self:flex-start;background:#374151;border-bottom-left-radius:4px}.bubble-v16.sent-v16{align-self:flex-end;background:#3B82F6;color:#fff;border-bottom-right-radius:4px;box-shadow:0 4px 15px rgba(59,130,246,.2)}.chat-system-v16{align-self:center;font-size:.8rem;color:#9CA3AF;background:rgba(255,255,255,.05);padding:6px 14px;border-radius:12px;letter-spacing:.5px}.chat-loading-v16{align-self:center;color:#9CA3AF;font-size:.9rem}@keyframes chatFadeV16{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.chat-composer-v16{padding:20px;background:#1F2937;border-top:1px solid #374151;display:flex;gap:15px}.chat-input-v16{flex:1;background:#0B0F19;border:1px solid #374151;color:#F3F4F6;padding:14px 20px;border-radius:30px;outline:none;font-size:.95rem;transition:.3s;resize:none;min-height:48px;max-height:140px;line-height:1.35}.chat-input-v16:focus{border-color:#3B82F6;box-shadow:0 0 0 3px rgba(59,130,246,.15)}.chat-input-v16::placeholder{color:#9CA3AF}.chat-send-v16{background:#3B82F6;color:#fff;border:none;padding:0 25px;border-radius:30px;cursor:pointer;font-weight:600;transition:.3s;min-width:90px}.chat-send-v16:hover{background:#2563EB;transform:scale(1.05)}.chat-send-v16:disabled{background:#374151;color:#9CA3AF;cursor:not-allowed;transform:none}
@media(max-width:767px){.chat-app-v16{height:calc(100vh - 82px);min-height:0;border-radius:0;border-left:0;border-right:0}.chat-header-v16{padding:14px}.chat-controls-v16{gap:8px}.chat-icon-btn-v16{padding:10px;border-radius:50%}.chat-icon-btn-v16 span{display:none}.chat-window-v16{padding:18px 14px;gap:14px}.bubble-v16{max-width:82%}.chat-composer-v16{padding:12px;gap:8px}.chat-input-v16{padding:12px 16px}.chat-send-v16{padding:0 18px}}

/* ========================= v17 Messenger ========================= */
.messenger-v17{width:100%;max-width:1080px;height:calc(100vh - 132px);min-height:610px;margin:0 auto;display:flex;flex-direction:column;overflow:hidden;border:1px solid #273442;border-radius:22px;background:#0b1119;box-shadow:0 24px 80px rgba(0,0,0,.38)}
.messenger-header-v17{flex:0 0 78px;display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 18px;background:linear-gradient(180deg,#182331,#131c27);border-bottom:1px solid #273442}
.messenger-person-v17{display:flex;align-items:center;gap:12px;min-width:0}.messenger-avatar-v17{position:relative;display:flex;align-items:center;justify-content:center;width:50px;height:50px;flex:0 0 50px;border-radius:50%;overflow:visible;background:#172633;border:2px solid #33485b;color:#8dd7ff;font-weight:800;text-decoration:none}.messenger-avatar-v17 img{width:100%;height:100%;object-fit:cover;border-radius:50%}.messenger-avatar-v17>i{position:absolute;right:-1px;bottom:0;width:12px;height:12px;border-radius:50%;background:#31d58a;border:2px solid #182331;box-shadow:0 0 9px rgba(49,213,138,.55)}.messenger-name-v17{min-width:0;display:flex;flex-direction:column;gap:5px}.messenger-name-v17>a{font-size:16px;font-weight:700;color:#f4f7fa;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.messenger-name-v17>span{display:flex;align-items:center;gap:6px;color:#8191a1;font-size:11px}.messenger-name-v17 b{width:7px;height:7px;border-radius:50%;background:#31d58a;box-shadow:0 0 7px rgba(49,213,138,.6)}.messenger-name-v17 em{font-style:normal}.messenger-actions-v17{display:flex;gap:8px}.m-action-v17{height:40px;padding:0 14px;display:inline-flex;align-items:center;gap:7px;border:1px solid #334454;border-radius:12px;background:#111b26;color:#d9e2e9;font-weight:600;cursor:pointer;transition:.2s}.m-action-v17:hover{background:#1d2a37;border-color:#4a5e70;transform:translateY(-1px)}.m-action-v17.call{border-color:#2777b8;color:#66bfff}.m-action-v17.end{border-color:#7b3640;color:#ff8e99}.m-action-v17:disabled{opacity:.55;cursor:wait;transform:none}
.messenger-body-v17{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:26px clamp(16px,5vw,54px);display:flex;flex-direction:column;gap:8px;background:radial-gradient(ellipse at 50% 0%,rgba(42,74,105,.16),transparent 45%),linear-gradient(180deg,#0c141e,#0a1017);scroll-behavior:smooth}.messenger-body-v17::-webkit-scrollbar{width:8px}.messenger-body-v17::-webkit-scrollbar-thumb{background:#293744;border-radius:10px}.conversation-start-v17{align-self:center;margin:3px 0 18px;color:#718293;font-size:10px}.conversation-start-v17 span{padding:6px 12px;border:1px solid #273541;border-radius:20px;background:#111a23}.msg-row-v17{max-width:min(70%,620px);display:flex;flex-direction:column;margin:3px 0}.msg-row-v17.mine{align-self:flex-end;align-items:flex-end}.msg-row-v17.received{align-self:flex-start;align-items:flex-start}.msg-bubble-v17{padding:11px 15px;border-radius:18px;color:#edf3f7;font-size:14px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;box-shadow:0 7px 20px rgba(0,0,0,.13);animation:msgInV17 .2s ease}.msg-row-v17.received .msg-bubble-v17{background:#1c2835;border:1px solid #293846;border-bottom-left-radius:5px}.msg-row-v17.mine .msg-bubble-v17{background:linear-gradient(135deg,#287ee8,#1767cc);border:1px solid #3289ec;color:white;border-bottom-right-radius:5px;box-shadow:0 7px 20px rgba(24,103,204,.2)}.msg-meta-v17{display:flex;gap:6px;align-items:center;margin:4px 5px 0;color:#667787;font-size:9px}.ticks-v17{color:#5faeff;letter-spacing:-2px}.message-loading-v17{align-self:center;display:flex;gap:5px;margin-top:auto;margin-bottom:auto}.message-loading-v17 span{width:7px;height:7px;border-radius:50%;background:#557087;animation:typingV17 1s infinite}.message-loading-v17 span:nth-child(2){animation-delay:.15s}.message-loading-v17 span:nth-child(3){animation-delay:.3s}@keyframes typingV17{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}@keyframes msgInV17{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
.messenger-compose-v17{flex:0 0 auto;padding:12px 16px 10px;background:#141e29;border-top:1px solid #273442}.compose-form-v17{display:flex;align-items:flex-end;gap:10px}.compose-form-v17 textarea{flex:1;min-height:46px;max-height:130px;resize:none;padding:12px 17px;border:1px solid #344453;border-radius:16px;background:#0b131c;color:#eef4f8;outline:none;font:inherit;line-height:1.4;transition:.2s}.compose-form-v17 textarea:focus{border-color:#398ee7;box-shadow:0 0 0 3px rgba(57,142,231,.12)}.compose-form-v17 textarea::placeholder{color:#657687}.compose-form-v17 button{width:48px;height:46px;border:0;border-radius:15px;background:linear-gradient(135deg,#398feb,#1d6fd3);color:#fff;font-size:19px;cursor:pointer;box-shadow:0 8px 20px rgba(29,111,211,.25);transition:.2s}.compose-form-v17 button:hover{transform:translateY(-1px);filter:brightness(1.08)}.compose-form-v17 button.sending{opacity:.55;cursor:wait}.compose-meta-v17{display:flex;justify-content:flex-end;gap:6px;margin-top:5px;padding-right:60px;color:#647585;font-size:9px}
@media(max-width:700px){.messenger-v17{height:calc(100vh - 72px);min-height:0;border-radius:0;border-left:0;border-right:0}.messenger-header-v17{flex-basis:68px;padding:10px 11px}.messenger-avatar-v17{width:42px;height:42px;flex-basis:42px}.messenger-actions-v17{gap:5px}.m-action-v17{width:40px;padding:0;justify-content:center;border-radius:12px}.m-action-v17 label{display:none}.messenger-body-v17{padding:18px 11px}.msg-row-v17{max-width:88%}.msg-bubble-v17{font-size:14px}.messenger-compose-v17{padding:9px 9px 7px}.compose-form-v17 textarea{min-height:44px;border-radius:14px}.compose-meta-v17{padding-right:55px;font-size:8px}}

/* v18: always-on incoming call overlay */
.v18-incoming{position:fixed!important;inset:0!important;z-index:99999!important;display:flex!important;align-items:center;justify-content:center;padding:20px;background:rgba(3,8,14,.82);backdrop-filter:blur(12px)}
.v18-incoming-box{width:min(410px,94vw)!important;padding:30px 26px!important;border:1px solid #2d4559!important;border-radius:24px!important;background:linear-gradient(145deg,#14202b,#0b121a)!important;box-shadow:0 30px 100px rgba(0,0,0,.55)!important;text-align:center!important}
.incoming-call-ring{width:64px;height:64px;margin:0 auto 14px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#123b2c;border:1px solid #20c47a;font-size:29px;animation:v18ring 1.4s infinite}
.incoming-large-avatar{width:86px;height:86px;margin:0 auto 13px;border-radius:50%;overflow:hidden;border:3px solid #20c47a;box-shadow:0 0 0 7px rgba(32,196,122,.10)}
.incoming-large-avatar img{width:100%;height:100%;object-fit:cover}
.incoming-call-title{font-size:23px;font-weight:800;color:#f3f7f6}
.incoming-call-name{font-size:18px;font-weight:700;color:#20c47a;margin-top:9px}
.incoming-call-subtitle{font-size:13px;color:#899aa7;margin-top:3px}
.v18-incoming .incoming-call-actions{display:flex!important;gap:12px!important;margin-top:25px!important;justify-content:center!important}
.v18-incoming .incoming-call-actions .btn{min-width:125px!important;padding:12px 18px!important;border-radius:14px!important}
@keyframes v18ring{0%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(32,196,122,.25)}50%{transform:scale(1.06);box-shadow:0 0 0 12px rgba(32,196,122,0)}}
