*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --bg:#0b141a;--bg2:#182229;--bg3:#1f2c34;
  --surface:#202c33;--surface2:#2a3942;
  --accent:#00b894;--accent2:#55efc4;
  --text:#e9edef;--text2:#8696a0;--text3:#aebac1;
  --danger:#e74c3c;--danger2:#ff6b6b;
  --radius:8px;--radius-lg:16px;
  --shadow:0 2px 16px rgba(0,0,0,.4);
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,sans-serif;
  --mono:"SF Mono","Fira Code","Consolas",monospace;
  --call-bg:#0a0a0f;
  --toast-bg:#323232;
}
html,body{height:100%;overflow:hidden;background:var(--bg);color:var(--text);font:14px/1.5 var(--font);}
a{color:var(--accent);text-decoration:none}
button{cursor:pointer;font:inherit;border:none;background:none;color:inherit}
input,textarea{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--surface2);border-radius:var(--radius);padding:8px 12px;outline:none;width:100%;}
input::placeholder,textarea::placeholder{color:var(--text2)}
input:focus,textarea:focus{border-color:var(--accent)}
.mono{font-family:var(--mono);letter-spacing:2px}
.hidden{display:none!important}
.status-dot{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0;transition:background .3s}
.status-dot.online{background:var(--accent);box-shadow:0 0 6px var(--accent)}
.status-dot.offline{background:var(--text2)}
/* ============================================================
   TOAST
============================================================ */
.toast{position:fixed;bottom:32px;left:50%;transform:translateX(-50%);z-index:9999;background:var(--toast-bg);color:#fff;padding:10px 24px;border-radius:24px;font-size:13px;opacity:0;pointer-events:none;transition:opacity .3s,max-width .3s;white-space:nowrap;max-width:90vw;overflow:hidden;text-overflow:ellipsis}
.toast.show{opacity:1;pointer-events:auto}
/* ============================================================
   CALL OVERLAY (shared)
============================================================ */
.call-overlay{position:fixed;inset:0;z-index:999;background:var(--call-bg);display:none;flex-direction:column;align-items:center;justify-content:center;color:#fff}
.call-overlay.open{display:flex}
.local-video{position:absolute;bottom:20px;right:20px;width:160px;height:120px;border-radius:var(--radius);background:#111;object-fit:cover}
.remote-video{width:100%;max-width:700px;max-height:70vh;border-radius:var(--radius-lg);background:#111;object-fit:contain}
.call-box{display:flex;flex-direction:column;align-items:center;gap:8px;z-index:1}
.call-avatar{width:90px;height:90px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;font-size:40px;color:#fff}
.call-name{font-size:22px;font-weight:600}
.call-sub{font-size:13px;color:var(--text2)}
.call-timer{font-size:15px;font-family:var(--mono);color:var(--accent2);margin:4px 0}
.call-actions{display:flex;gap:16px;margin-top:8px}
.call-actions button{width:48px;height:48px;border-radius:50%;font-size:20px;transition:transform .15s,background .2s}
.call-actions button:active{transform:scale(.92)}
.btn-end-call{background:var(--danger)!important}
.btn-end-call:hover{background:var(--danger2)!important}
.btn-call-toggle{background:rgba(255,255,255,.1)}
.btn-call-toggle:hover{background:rgba(255,255,255,.2)}
.btn-call-toggle.muted{background:var(--danger);color:#fff}
.btn-call-toggle.video-off{background:var(--danger);color:#fff}
/* ============================================================
   MESSAGE BUBBLES (shared)
============================================================ */
.msg-wrap{width:100%}
.msg-wrap.sent{display:flex;justify-content:flex-end}
.msg-wrap.received{display:flex;justify-content:flex-start}
.msg-bubble{max-width:75%;padding:8px 14px;border-radius:12px;word-wrap:break-word;white-space:pre-wrap;font-size:14px;line-height:1.45;margin:2px 0}
.msg-wrap.sent .msg-bubble{background:var(--accent);color:#fff;border-bottom-right-radius:4px}
.msg-wrap.received .msg-bubble{background:var(--surface);border-bottom-left-radius:4px}
.msg-time{font-size:10px;color:var(--text2);padding:0 4px 4px}
.msg-wrap.sent .msg-time{text-align:right}
.empty-msg{text-align:center;padding:60px 20px;color:var(--text2)}
.empty-msg .empty-icon{font-size:48px;margin-bottom:12px}
/* ============================================================
   RECENT ITEMS (shared between desktop & mobile)
============================================================ */
.recent-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:var(--radius);transition:background .15s;cursor:pointer}
.recent-item:hover{background:var(--surface)}
.recent-item .ri-avatar{width:36px;height:36px;border-radius:50%;background:var(--surface2);display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0}
.recent-item .ri-info{flex:1;min-width:0}
.recent-item .ri-name{font-size:14px;font-weight:500}
.recent-item .ri-preview{font-size:12px;color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* URL LIST (shared) */
.dt-url-list{background:var(--surface);border-radius:var(--radius);padding:8px;max-height:140px;overflow-y:auto;font-size:13px}
.dt-url-list .url-item{padding:6px 8px;cursor:pointer;border-radius:4px;transition:background .15s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dt-url-list .url-item:hover{background:var(--surface2)}
.empty-url{color:var(--text2);padding:8px;text-align:center;font-size:12px}
/* ============================================================
   SCROLLBAR
============================================================ */
::-webkit-scrollbar{width:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--surface2);border-radius:4px}
::-webkit-scrollbar-thumb:hover{background:var(--text2)}
