/* chatWS — cody_layout.css
   The CodyChat look (layout, sizes, private chat, emoji picker, YouTube window, menus, status marker…)
   for EVERY theme. Colours come from each theme's own --th-* tokens, so dark themes stay dark and
   light themes stay light. Loaded after the theme's theme.css (control/head_load.php). */

/* no icon sidebar: navigation lives in the hamburger menu */
.cws-themed .side-left{display:none !important}

/* rows instead of bubbles */
.cws-themed .messages{padding:0 !important;gap:0 !important}
.cws-themed .message{gap:10px;padding:8px 12px;border-bottom:0;animation:none}
.cws-themed .message:not(.system):nth-child(even){background:var(--th-item-bg,rgba(0,0,0,.05))}
.cws-themed .message:not(.system):not(.message--bot) .message-body > .message-text,
.cws-themed .message:not(.system):not(.message--bot) > .message-text,
.cws-themed .message .message-content > .message-text{background:none !important;padding:0 !important;border-radius:0;display:block;margin-top:2px}
.cws-themed .message-avatar{width:36px;height:36px;border:2px solid var(--th-border,#e6e6e6);box-sizing:border-box}
.cws-themed .message-user{font-size:13px;font-weight:700}
.cws-themed .message-time{font-size:10px;color:var(--th-muted,#999) !important}
.cws-themed .message-text{font-size:14px}
.cws-themed .message.system{background:none !important;justify-content:flex-start;padding:6px 12px}
.cws-themed .message.system .message-text{font-size:11px;font-style:normal}

/* header / footer */
.cws-themed .topbar{background:var(--th-header-bg,#222) !important}
.cws-themed .chat-footer-bar,.cws-themed #chatFooterBar{background:var(--th-header-bg,#222) !important;min-height:38px}

/* input pill */
.cws-themed .chat-input input,.cws-themed #messageInput{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border:1px solid var(--th-border,#e6e6e6) !important;border-radius:20px !important;color:var(--th-text,#333) !important;padding:8px 14px}

/* right user list */
.cws-themed #rpanel,.cws-themed .right-panel{background:var(--th-panel-bg,#fff) !important;border-left:1px solid var(--th-border,#e6e6e6)}
.cws-themed ::-webkit-scrollbar-thumb{background:var(--th-selected,rgba(0,0,0,.09)) !important}

/* private chat window: dark header, white body, soft grey bubbles */
.cws-themed #pmBox,.cws-themed .pm-box{background:var(--th-panel-bg,#fff) !important;border:1px solid var(--th-border,#e6e6e6) !important;box-shadow:0 2px 12px rgba(0,0,0,.25) !important;border-radius:0 !important}
.cws-themed .pm-box-header,.cws-themed #pmBoxHeader{background:var(--th-header-bg,#222) !important;color:#fff !important;border:0 !important}
.cws-themed .pm-box-header .pm-box-name,.cws-themed .pm-box-header .pm-ctrl-btn{color:#fff !important}
.cws-themed .pm-msg.mine .pm-msg-text,.cws-themed .pm-msg.theirs .pm-msg-text{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;color:var(--th-text,#333) !important;border-radius:14px}
.cws-themed .pm-box-input,.cws-themed #pmInputRow{background:var(--th-panel-bg,#fff) !important;border-top:1px solid var(--th-border,#e6e6e6) !important}

/* compact bottom area (CodyChat proportions) */
.cws-themed{--footer-h:calc(38px + env(safe-area-inset-bottom,0px))}
.cws-themed .chat-input{padding:6px 10px !important;gap:6px !important;background:var(--th-panel-bg,#fff) !important;border-top:1px solid var(--th-border,#e6e6e6) !important;min-height:0 !important}
.cws-themed .chat-input input:not([type="file"]),.cws-themed .chat-input #messageInput{height:34px !important;min-height:0 !important;padding:0 14px !important;font-size:14px !important;line-height:34px;background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border:1px solid var(--th-border,#e6e6e6) !important;border-radius:18px !important;box-shadow:none !important}
.cws-themed .chat-input .chat-attach-btn,.cws-themed .chat-input .emoji-btn,.cws-themed .chat-input button:not(.send-btn){width:30px !important;height:30px !important;font-size:17px !important;color:var(--th-sub-text,#888) !important;background:none !important;padding:0 !important}
.cws-themed .chat-input .send-btn{width:30px !important;height:30px !important;font-size:17px !important;background:none !important;color:var(--th-text,#333) !important;border-radius:0 !important;box-shadow:none !important}
.cws-themed .chat-input .send-btn:hover{color:var(--th-accent,#03add8) !important;transform:none}
.cws-themed .chat-footer-bar,.cws-themed #chatFooterBar{height:var(--footer-h) !important;min-height:0 !important;padding:0 8px !important;border-top:0 !important}
.cws-themed .footer-menu-btn{width:38px !important;height:32px !important;font-size:20px !important;color:#fff !important;opacity:1 !important;background:none !important}
.cws-themed .footer-menu-btn:hover,.cws-themed .footer-menu-btn.active{color:var(--th-accent,#03add8) !important;background:none !important}

/* ── Profile card (CodyChat): dark header, centred avatar, pill tabs, label/value rows ── */
.cws-themed .profile-modal-overlay{background:rgba(0,0,0,.45) !important;backdrop-filter:none !important}
.cws-themed .profile-modal{position:relative;max-width:520px !important;background:var(--th-panel-bg,#fff) !important;color:var(--th-text,#333);border-radius:22px !important;box-shadow:0 10px 40px rgba(0,0,0,.35) !important}
.cws-themed .profile-modal-header{position:absolute !important;top:0;left:0;right:0;height:0 !important;background:none !important;z-index:5}
.cws-themed .profile-modal-cover{display:none !important}
.cws-themed .profile-modal-actions{top:14px !important;right:16px !important}
.cws-themed .profile-modal-close{background:none !important;color:#fff !important;width:32px !important;height:32px !important;font-size:20px !important}
.cws-themed .profile-modal-close:hover{color:var(--th-accent,#03add8) !important;background:none !important}
.cws-themed .profile-modal-avatar-wrap{order:1;margin:0 !important;padding:44px 20px 18px !important;background:var(--th-header-bg,#222);flex-direction:column !important;align-items:center !important;gap:10px !important;text-align:center}
.cws-themed .profile-modal-avatar{width:110px !important;height:110px !important;border-radius:50% !important;border:3px solid #fff !important;box-shadow:none !important}
.cws-themed .profile-modal-title{padding:0 !important;flex:none !important;display:flex;flex-direction:column;align-items:center;text-align:center}
.cws-themed .profile-modal-username{order:2;font-size:26px !important;font-weight:700 !important;color:#fff !important;margin:2px 0 0 !important}
.cws-themed .profile-modal-meta{order:1;font-size:14px !important;font-weight:600;color:#fff !important}
.cws-themed .profile-modal-mood{color:var(--th-muted,#999) !important}
.cws-themed .profile-extras{order:3;color:var(--th-muted,#999)}
.cws-themed .pv-stats,.cws-themed .profile-stats-grid{display:none !important}
.cws-themed .profile-tabs{order:2;justify-content:center !important;gap:6px;background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border-bottom:0 !important;padding:10px 8px !important}
.cws-themed .profile-tab-btn{flex:0 0 auto !important;border:0 !important;border-radius:8px;padding:8px 18px !important;font-size:15px !important;font-weight:700 !important;color:var(--th-text,#333) !important;background:none}
.cws-themed .profile-tab-btn.active{background:var(--th-selected,rgba(0,0,0,.09)) !important;color:var(--th-text,#333) !important}
.cws-themed .profile-modal-content{order:3;padding:22px 36px 28px !important}
.cws-themed .profile-info-row{gap:10px !important;padding:16px 0 !important;border-bottom:1px solid var(--th-border,#e6e6e6) !important}
.cws-themed .profile-info-row:last-child{border-bottom:0 !important}
.cws-themed .profile-info-icon{width:24px !important;height:auto !important;background:none !important;color:var(--th-text,#333) !important;font-size:17px !important;border-radius:0}
.cws-themed .profile-info-content{display:contents}
.cws-themed .profile-info-label{flex:0 0 38%;font-size:16px !important;font-weight:700;color:var(--th-text,#333) !important;margin:0 !important}
.cws-themed .profile-info-value{flex:1;font-size:16px !important;color:var(--th-text,#333) !important}
.cws-themed .profile-bio-text,.cws-themed .profile-bio-title{color:var(--th-text,#333) !important}

/* ── Avatar menu (CodyChat): white card, header with avatar + name + status button ── */
.cws-themed .avatar-menu{background:var(--th-panel-bg,#fff) !important;border-radius:16px !important;box-shadow:0 6px 28px rgba(0,0,0,.25) !important;border:0 !important;min-width:290px;padding:0 0 8px !important;overflow:hidden}
.cws-themed .avatar-menu .menu-header{background:var(--th-panel-bg,#fff) !important;padding:18px 18px 14px !important;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--th-border,#e6e6e6) !important}
.cws-themed .avatar-menu .menu-avatar{width:60px !important;height:60px !important;border-radius:12px !important;object-fit:cover}
.cws-themed .avatar-menu .menu-username{font-size:20px !important;font-weight:700 !important;color:var(--th-text,#333) !important}
.cws-themed .avatar-menu .menu-user-rank{font-size:14px !important;color:var(--th-text,#333) !important}
.cws-themed .avatar-menu .menu-section{padding:8px 0 !important;border:0 !important}
.cws-themed .avatar-menu .menu-section + .menu-section{border-top:1px solid var(--th-border,#e6e6e6) !important;margin-top:4px}
.cws-themed .avatar-menu .menu-item{padding:14px 24px !important;font-size:17px !important;gap:16px;color:var(--th-text,#333) !important}
.cws-themed .avatar-menu .menu-item i{color:var(--th-accent,#03add8) !important;width:22px;text-align:center;font-size:18px !important}
.cws-themed .avatar-menu .menu-item:hover{background:var(--th-item-bg,rgba(0,0,0,.05)) !important}
.cws-themed .avatar-menu .menu-item.danger,.cws-themed .avatar-menu .menu-item.danger i{color:var(--th-accent,#03add8) !important}
.cws-themed .avatar-menu .menu-item.danger{color:var(--th-text,#333) !important}
.cws-themed .avatar-menu.cws-has-edit-link .menu-item[onclick="editProfile()"]{display:none}
.cws-themed .avatar-menu .menu-guest-note{margin:8px 16px !important;background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border:0 !important;color:var(--th-sub-text,#888) !important;font-size:13px}
.cws-themed .avatar-menu .menu-guest-note *{color:var(--th-sub-text,#888) !important}

/* ── Edit profile dialog (CodyChat): dark header, pill tabs, white body, light inputs ── */
.cws-themed #editProfileOverlay{background:rgba(0,0,0,.45) !important;backdrop-filter:none !important}
.cws-themed .ep-modal{background:var(--th-panel-bg,#fff) !important;border:0 !important;border-radius:22px !important;box-shadow:0 10px 40px rgba(0,0,0,.35) !important;width:min(560px,100%) !important;color:var(--th-text,#333)}
.cws-themed .ep-header{background:var(--th-header-bg,#222) !important;border:0 !important;padding:18px 20px !important}
.cws-themed .ep-header-icon{background:none !important;color:#fff !important;font-size:20px !important;width:auto !important}
.cws-themed .ep-header-title{color:#fff !important;font-size:17px !important}
.cws-themed .ep-header-sub{color:var(--th-muted,#999) !important}
.cws-themed .ep-close-btn{background:none !important;border:0 !important;color:#fff !important;font-size:20px !important}
.cws-themed .ep-close-btn:hover{color:var(--th-accent,#03add8) !important;background:none !important}
.cws-themed .guest-banner{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;color:var(--th-sub-text,#888) !important;font-size:13px}
.cws-themed .guest-banner *{color:var(--th-sub-text,#888) !important}
.cws-themed .ep-tabs{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;justify-content:center;gap:6px !important;padding:10px 8px !important;border:0 !important}
.cws-themed .ep-tab{flex:0 0 auto !important;border-radius:8px !important;padding:8px 18px !important;font-size:14px !important;color:var(--th-text,#333) !important;background:none !important;border:0 !important}
.cws-themed .ep-tab:hover{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;color:var(--th-text,#333) !important}
.cws-themed .ep-tab.ep-tab-active,.cws-themed .ep-tab-active{background:var(--th-selected,rgba(0,0,0,.09)) !important;color:var(--th-text,#333) !important;border:0 !important;box-shadow:none !important}
.cws-themed .ep-cover-wrap{background:var(--th-header-bg,#222) !important;height:84px !important}
.cws-themed .ep-avatar-row{margin-top:-44px !important}
.cws-themed .ep-avatar-wrap{width:92px !important;height:92px !important;border:3px solid #fff !important;box-shadow:none !important}
.cws-themed .ep-upload-hint{color:var(--th-muted,#999) !important}
.cws-themed .ep-label{color:var(--th-text,#333) !important;font-size:12px !important}
.cws-themed .ep-opt,.cws-themed .ep-char-count{color:var(--th-muted,#999) !important}
.cws-themed .ep-input{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border:1px solid var(--th-border,#e6e6e6) !important;color:var(--th-text,#333) !important;border-radius:10px !important}
.cws-themed .ep-input:focus{border-color:var(--th-accent,#03add8) !important;background:var(--th-panel-bg,#fff) !important}
.cws-themed .ep-input::placeholder{color:var(--th-muted,#999) !important}
.cws-themed select.ep-input option{background:var(--th-panel-bg,#fff) !important;color:var(--th-text,#333)}
.cws-themed .ep-style-block,.cws-themed .ep-preview-card,.cws-themed .ep-security-note{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border-color:var(--th-border,#e6e6e6) !important;color:var(--th-text,#333) !important}
.cws-themed .ep-style-title,.cws-themed .ep-preview-username,.cws-themed .ep-color-row label{color:var(--th-text,#333) !important}
.cws-themed .ep-type{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;color:var(--th-text,#333) !important;border-color:var(--th-border,#e6e6e6) !important}
.cws-themed .ep-type.active{background:var(--th-accent,#03add8) !important;color:#fff !important;border-color:var(--th-accent,#03add8) !important}
.cws-themed .ep-footer{background:var(--th-panel-bg,#fff) !important;border-top:1px solid var(--th-border,#e6e6e6) !important}
.cws-themed .ep-btn-primary{background:var(--th-accent,#03add8) !important;box-shadow:none !important;color:#fff !important}
.cws-themed .ep-btn-primary:hover{background:var(--th-accent,#03add8) !important}
.cws-themed .ep-btn-ghost{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;color:var(--th-text,#333) !important;border:0 !important}
.cws-themed .ep-btn-ghost:hover{background:var(--th-selected,rgba(0,0,0,.09)) !important}
.cws-themed .ep-danger-desc{color:var(--th-sub-text,#888) !important}
.cws-themed .ep-body{scrollbar-color:#ccc transparent}

/* ── Emoji picker (CodyChat): floating card above the input, left-aligned, compact ── */
.cws-themed .emo-panel{left:8px !important;right:auto !important;bottom:52px !important;width:min(410px,calc(100% - 16px)) !important;max-height:340px !important;background:var(--th-panel-bg,#fff) !important;border:1px solid var(--th-border,#e6e6e6) !important;border-radius:16px !important;box-shadow:0 4px 22px rgba(0,0,0,.22) !important;overflow:hidden}
.cws-themed .emo-panel-tabs{padding:0 !important;gap:0 !important;background:var(--th-panel-bg,#fff);border-bottom:1px solid var(--th-border,#e6e6e6) !important}
.cws-themed .emo-tab{width:46px !important;height:44px !important;border-radius:0 !important;padding:9px !important}
.cws-themed .emo-tab:hover{background:var(--th-item-bg,rgba(0,0,0,.05)) !important}
.cws-themed .emo-tab.active{background:var(--th-item-bg,rgba(0,0,0,.05)) !important}
.cws-themed .emo-tab-lock{background:var(--th-panel-bg,#fff) !important}
.cws-themed .emo-panel-grid{padding:8px 6px !important;gap:0 !important}
.cws-themed .emo-item{width:calc(100% / 8) !important;height:44px !important;border-radius:8px}
.cws-themed .emo-item:hover{background:var(--th-item-bg,rgba(0,0,0,.05)) !important}
.cws-themed .emo-item img{max-width:30px !important;max-height:30px !important}
.cws-themed .emo-loading,.cws-themed .emo-locked{color:var(--th-muted,#999) !important}
@media (max-width:900px){.cws-themed .emo-panel{max-height:min(45vh,300px) !important}}

/* ── "+" add-on picker (YouTube, GIPHY…) as a centred CodyChat-style modal ── */
.cws-themed .plus-panel{position:fixed !important;left:50% !important;top:50% !important;right:auto !important;bottom:auto !important;transform:translate(-50%,-50%);width:min(660px,calc(100vw - 24px)) !important;height:auto !important;max-height:min(730px,88vh) !important;background:var(--th-panel-bg,#fff) !important;border:0 !important;border-radius:24px !important;box-shadow:0 0 0 100vmax rgba(0,0,0,.4),0 10px 40px rgba(0,0,0,.4) !important;z-index:9000 !important;overflow:hidden}
.cws-themed .plus-panel-head{flex-wrap:wrap;gap:14px 8px !important;padding:18px 22px 6px !important;border:0 !important}
.cws-themed .plus-panel-title{order:1;flex:1;font-size:18px !important;font-weight:700 !important;color:var(--th-text,#333) !important}
.cws-themed .plus-panel-close{order:2;width:34px !important;height:34px !important;font-size:22px;color:var(--th-text,#333) !important}
.cws-themed .plus-panel-close:hover{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;color:var(--th-text,#333) !important}
.cws-themed .plus-panel-search{order:3;flex:1 0 100%}
.cws-themed .plus-panel-search i{color:var(--th-muted,#999) !important;left:14px !important;font-size:14px !important}
.cws-themed .plus-panel-search input{height:46px !important;padding:0 14px 0 38px !important;background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border:1px solid var(--th-border,#e6e6e6) !important;border-radius:10px !important;color:var(--th-text,#333) !important;font-size:16px !important}
.cws-themed .plus-panel-search input:focus{border-color:var(--th-accent,#03add8) !important;background:var(--th-panel-bg,#fff) !important}
.cws-themed .plus-panel-tabs{padding:8px 18px 0 !important}
.cws-themed .plus-panel-tab{color:var(--th-sub-text,#888) !important}
.cws-themed .plus-panel-tab.active{background:var(--th-selected,rgba(0,0,0,.09)) !important;color:var(--th-text,#333) !important}
.cws-themed .plus-panel-body{padding:10px 18px 18px !important}
.cws-themed .plus-panel-foot{background:var(--th-panel-bg,#fff);border-color:var(--th-border,#e6e6e6) !important;color:var(--th-muted,#999) !important}
.cws-themed .plus-panel-msg{color:var(--th-muted,#999) !important}
.cws-themed .ytp-list{display:grid !important;grid-template-columns:1fr 1fr;gap:6px !important}
.cws-themed .ytp-item{flex-direction:column;align-items:stretch !important;gap:0 !important;padding:8px !important;background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border:1px solid var(--th-border,#e6e6e6) !important;border-radius:10px !important;color:var(--th-text,#333) !important;min-width:0}
.cws-themed .ytp-item:hover{background:var(--th-item-bg,rgba(0,0,0,.05)) !important}
.cws-themed .ytp-thumb{width:100% !important;border-radius:6px !important}
.cws-themed .ytp-meta{padding:8px 4px 2px}
.cws-themed .ytp-title{font-size:15px !important;font-weight:500 !important;color:var(--th-text,#333) !important}
.cws-themed .ytp-chan{color:var(--th-sub-text,#888) !important}
.cws-themed .ytp-send{display:none !important}
.cws-themed .ytp-label{color:var(--th-muted,#999) !important}
@media (max-width:520px){.cws-themed .ytp-list{grid-template-columns:1fr}}
.cws-themed .ytp-meta{display:block}.cws-themed .ytp-chan{display:block !important}

/* ── YouTube: chat thumbnail + player window (CodyChat) ── */
.cws-themed .embed-youtube{width:300px !important;border-radius:14px !important;margin:6px 0 !important}
.cws-themed .embed-yt-play{background:rgba(0,0,0,.12) !important}
.cws-themed .embed-youtube:hover .embed-yt-play{background:rgba(0,0,0,.28) !important}
.cws-themed .embed-yt-play i{width:76px !important;height:52px !important;border-radius:14px !important;background:#f00 !important;font-size:22px !important;box-shadow:none !important}
.cws-themed .cwsyt-backdrop{background:rgba(0,0,0,.18) !important;backdrop-filter:none !important}
.cws-themed .cwsyt{background:#000 !important;border:0 !important;border-radius:24px !important;box-shadow:0 10px 40px rgba(0,0,0,.45) !important}
.cws-themed .cwsyt-head{background:#1b1b1b !important;border:0 !important;height:44px !important;padding:0 10px !important}
.cws-themed .cwsyt.full{top:90px !important;transform:translateX(-50%) !important;width:min(94vw,840px) !important}
.cws-themed .cwsyt.full .cwsyt-head{height:60px !important;padding:0 24px !important;justify-content:flex-end;gap:14px !important}
.cws-themed .cwsyt.full .cwsyt-title,.cws-themed .cwsyt.full .cwsyt-logo,.cws-themed .cwsyt.full .cwsyt-ext,.cws-themed .cwsyt.full .cwsyt-play{display:none !important}
.cws-themed .cwsyt-btn{color:#fff !important;font-size:18px !important;width:34px !important;height:34px !important}
.cws-themed .cwsyt-btn:hover{background:rgba(255,255,255,.12) !important}
.cws-themed .cwsyt-close:hover{color:#fff !important}
.cws-themed .cwsyt.full .cwsyt-min i{font-size:0}
.cws-themed .cwsyt.full .cwsyt-min i::before{content:"";display:block;width:22px;height:3px;background:var(--th-panel-bg,#fff);border-radius:2px}
.cws-themed .cwsyt-title{color:#fff !important}
@media (max-width:768px){.cws-themed .cwsyt.full{top:60px !important;width:100vw !important;border-radius:0 !important;left:0 !important;transform:none !important}}

/* minimized YouTube = small round red icon on the footer bar, next to the hamburger (measured on CodyChat) */
.cws-themed .cwsyt.mini{left:auto !important;top:auto !important;right:var(--cl-yt,56px) !important;bottom:calc(7px + env(safe-area-inset-bottom,0px)) !important;width:24px !important;height:24px !important;border-radius:50% !important;background:#f00 !important;border:0 !important;box-shadow:none !important;overflow:hidden;cursor:pointer;z-index:1300}
.cws-themed .cwsyt.mini .cwsyt-head{display:none !important}
.cws-themed .cwsyt.mini .cwsyt-video{position:absolute;inset:0;opacity:0;pointer-events:none;aspect-ratio:auto}
.cws-themed .cwsyt.mini::after{content:"";position:absolute;left:50%;top:50%;transform:translate(-35%,-50%);border-left:9px solid #fff;border-top:6px solid transparent;border-bottom:6px solid transparent}

/* ── Friend-request + notification dropdowns: above the docked user list, light card ── */
.cws-themed #frPopup,.cws-themed #notifPopup{z-index:1200 !important;top:62px !important;right:10px !important;background:var(--th-panel-bg,#fff) !important;border:0 !important;border-radius:16px !important;box-shadow:0 6px 28px rgba(0,0,0,.28) !important;color:var(--th-text,#333)}
.cws-themed :is(#frPopup,#notifPopup)>div:first-child{border-bottom:1px solid var(--th-border,#e6e6e6) !important}
.cws-themed :is(#frPopup,#notifPopup) :is(span,div,p,b,strong,a,small){color:var(--th-text,#333) !important}
.cws-themed :is(#frPopup,#notifPopup) button[onclick*="Close"],.cws-themed :is(#frPopup,#notifPopup) button[onclick*="Close"] *{color:var(--th-text,#333) !important}
.cws-themed #notifPopup button[onclick*="MarkAllRead"]{color:var(--th-accent,#03add8) !important}
.cws-themed :is(#frPopupList,#notifPopupList)>*{border-color:var(--th-border,#e6e6e6) !important}
.cws-themed :is(#frPopupList,#notifPopupList)>*:hover{background:var(--th-item-bg,rgba(0,0,0,.05)) !important}

/* ── Status marker on avatars: green circle with a white check, no dark border (CodyChat) ── */
.cws-themed :is(.rp-online-dot,.pm-online-dot,.friend-online-dot,.cws-top-dot){border:0 !important;border-radius:50% !important;background-color:transparent !important;background-repeat:no-repeat !important;background-size:100% 100% !important;width:18px !important;height:18px !important;left:-3px !important;right:auto !important;bottom:-3px !important;box-shadow:0 0 0 2px #fff}
.cws-themed .cws-top-dot{box-shadow:0 0 0 2px #222 !important}
.cws-themed :is(.rp-online-dot,.pm-online-dot,.friend-online-dot).online,.cws-themed .cws-top-dot{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%2374b20e'/%3E%3Cpath d='M6.5 12.5l3.7 3.7 7.3-7.6' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important}
.cws-themed body.cws-st-away .cws-top-dot{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%23f59e0b'/%3E%3Cpath d='M12 6.5V12l3.8 2.2' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important}
.cws-themed body.cws-st-busy .cws-top-dot{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%23ef4444'/%3E%3Cpath d='M6.5 12h11' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important}
.cws-themed body.cws-st-invisible .cws-top-dot{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%239a9a9a'/%3E%3Cpath d='M7 7l10 10M17 7L7 17' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;background-color:transparent !important}
.cws-themed :is(.rp-online-dot,.pm-online-dot,.friend-online-dot):not(.online){display:none !important}

/* YouTube window proportions measured on CodyChat: width ~53vw, header ~7% of width, 16:9 video, top = 2x topbar */
.cws-themed .cwsyt.full{width:clamp(340px,53vw,1100px) !important;top:112px !important;border-radius:20px !important}
.cws-themed .cwsyt.full .cwsyt-head{height:clamp(36px,3.76vw,72px) !important;padding:0 clamp(12px,1.6vw,28px) !important}
.cws-themed .cwsyt.full .cwsyt-btn{width:clamp(28px,2.4vw,40px) !important;height:clamp(28px,2.4vw,40px) !important;font-size:clamp(14px,1.4vw,22px) !important}
@media (max-width:768px){.cws-themed .cwsyt.full{width:100vw !important;top:60px !important;border-radius:0 !important}.cws-themed .cwsyt.full .cwsyt-head{height:44px !important}}

/* ── Audio / video uploads: compact pill with a play icon, basic light player modal (CodyChat) ── */
.cws-themed .embed-file{max-width:270px !important;padding:6px 16px 6px 6px !important;background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border:0 !important;border-radius:999px !important;gap:10px !important;color:var(--th-text,#333) !important;transform:none !important}
.cws-themed .embed-file:hover{background:var(--th-selected,rgba(0,0,0,.09)) !important;border:0 !important;transform:none !important}
.cws-themed .embed-file .ef-icon{width:38px !important;height:38px !important;border-radius:50% !important;background:var(--th-accent,#03add8) !important}
.cws-themed .embed-file--audio .ef-icon,.cws-themed .embed-file--video .ef-icon{background:var(--th-accent,#03add8) !important}
.cws-themed .embed-file--audio .ef-icon i,.cws-themed .embed-file--video .ef-icon i{display:none}
.cws-themed .embed-file--audio .ef-icon,.cws-themed .embed-file--video .ef-icon{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5z' fill='white'/%3E%3C/svg%3E") !important;background-repeat:no-repeat !important;background-position:55% 50% !important;background-size:22px 22px !important}
.cws-themed .embed-file .ef-name{color:var(--th-text,#333) !important;font-size:14px !important;font-weight:600 !important}
.cws-themed .embed-file .ef-sub{color:var(--th-muted,#999) !important;font-size:11px !important}
.cws-themed .embed-file .ef-sub b{color:var(--th-muted,#999) !important}
.cws-themed .embed-file--audio .ef-act,.cws-themed .embed-file--video .ef-act{display:none !important}
.cws-themed .ipl-backdrop{background:rgba(0,0,0,.4) !important;backdrop-filter:none !important}
.cws-themed .ipl-card{background:var(--th-panel-bg,#fff) !important;border:0 !important;border-radius:24px !important;box-shadow:0 10px 40px rgba(0,0,0,.35) !important;padding:0 0 22px !important;max-width:460px !important;color:var(--th-text,#333) !important;overflow:hidden}
.cws-themed .ipl-video .ipl-card{max-width:720px !important}
.cws-themed .ipl-head{margin:0 !important;padding:18px 22px 10px !important}
.cws-themed .ipl-badge{display:none !important}
.cws-themed .ipl-title{color:var(--th-text,#333) !important;font-size:18px !important;font-weight:700 !important}
.cws-themed .ipl-btn{background:none !important;color:var(--th-text,#333) !important}
.cws-themed .ipl-btn:hover{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;color:var(--th-text,#333) !important}
.cws-themed .ipl-audio .ipl-stage,.cws-themed .ipl-audio .ipl-disc,.cws-themed .ipl-audio .ipl-eq{display:none !important}
.cws-themed .ipl-video .ipl-stage{padding:0 22px;margin:4px 0 0 !important}
.cws-themed .ipl-screen video{border-radius:12px !important}
.cws-themed .ipl-seekrow{padding:14px 22px 0 !important;color:var(--th-sub-text,#888) !important}
.cws-themed .ipl-seek{background:linear-gradient(90deg,var(--th-accent,#03add8) var(--p),var(--th-selected,rgba(0,0,0,.09)) var(--p)) !important}
.cws-themed .ipl-seek::-webkit-slider-thumb{background:var(--th-accent,#03add8) !important}
.cws-themed .ipl-seek::-moz-range-thumb{background:var(--th-accent,#03add8) !important}
.cws-themed .ipl-back,.cws-themed .ipl-fwd,.cws-themed .ipl-vol,.cws-themed .ipl-dl{display:none !important}
.cws-themed .ipl-ctrl{margin-top:10px !important}
.cws-themed .ipl-play{background:var(--th-accent,#03add8) !important;color:#fff !important;box-shadow:none !important;width:50px !important;height:50px !important}
.cws-themed .ipl-play:hover{background:var(--th-accent,#03add8) !important}

/* ── Private chat (CodyChat): dark 60px header, white body, grey bubbles, plain-icon input ── */
.cws-themed #pmBox,.cws-themed .pm-box{width:600px !important;max-width:calc(100vw - 16px) !important;border:0 !important;border-radius:0 !important;box-shadow:0 4px 24px rgba(0,0,0,.3) !important}
.cws-themed .pm-box-header,.cws-themed #pmBoxHeader{height:60px !important;padding:0 14px !important;background:var(--th-header-bg,#222) !important}
.cws-themed .pmx-av-wrap{flex:0 0 46px !important;width:46px !important;height:46px !important}
.cws-themed .pmx-av{width:46px !important;height:46px !important}
.cws-themed .pm-box-user{gap:12px !important}
.cws-themed .pm-box-name{font-size:19px !important;font-weight:400 !important;color:#fff !important}
.cws-themed .pm-box-status,.cws-themed .pmx-av-wrap .pm-status-dot{display:none !important}
.cws-themed .pm-box-header .pm-ctrl-btn{width:38px !important;height:38px !important;font-size:19px !important;color:#fff !important;background:none !important}
.cws-themed .pm-box-header .pm-ctrl-btn:hover{color:var(--th-accent,#03add8) !important}
.cws-themed .pm-messages{background:var(--th-panel-bg,#fff) !important}
.cws-themed .pm-msg-text{font-size:16px !important;padding:10px 14px !important;border-radius:16px !important}
.cws-themed .pm-msg-meta{font-size:12px !important;color:var(--th-muted,#999) !important}
.cws-themed .pm-box-input,.cws-themed #pmInputRow{padding:8px 14px !important;gap:8px !important;background:var(--th-panel-bg,#fff) !important;border-top:1px solid var(--th-border,#e6e6e6) !important;align-items:center}
.cws-themed .pm-tool-btn{background:none !important;color:var(--th-sub-text,#888) !important;font-size:20px !important;width:34px !important;height:34px !important}
.cws-themed .pm-input-field{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border:1px solid var(--th-border,#e6e6e6) !important;border-radius:20px !important;color:var(--th-text,#333) !important;font-size:17px !important;padding:8px 16px !important}
.cws-themed .pm-input-field:focus{border-color:var(--th-accent,#03add8) !important}
.cws-themed .pm-input-field::placeholder{color:var(--th-muted,#999) !important}
.cws-themed .pm-send-btn{background:none !important;color:var(--th-text,#333) !important;width:38px !important;height:38px !important;font-size:22px !important;box-shadow:none !important}
.cws-themed .pm-send-btn:hover{color:var(--th-accent,#03add8) !important;background:none !important}

/* ── Private inbox ("Privada"): dropdown card under the top bar, plain icons ── */
.cws-themed #pmInboxPanel,.cws-themed .pm-inbox-panel{top:62px !important;bottom:auto !important;right:10px !important;left:auto !important;width:380px !important;max-width:calc(100vw - 20px) !important;max-height:calc(100vh - 90px) !important;background:var(--th-panel-bg,#fff) !important;border:0 !important;border-radius:16px !important;box-shadow:0 6px 28px rgba(0,0,0,.28) !important;z-index:1250 !important}
.cws-themed .pm-inbox-header{background:var(--th-panel-bg,#fff) !important;border-bottom:1px solid var(--th-border,#e6e6e6) !important;padding:16px 20px !important}
.cws-themed .pm-inbox-title{font-size:19px !important;font-weight:700 !important;color:var(--th-text,#333) !important;gap:0 !important}
.cws-themed .pm-inbox-title>i{display:none !important}
.cws-themed .pm-inbox-panel .pm-close-btn,.cws-themed #pmInboxPanel .pm-close-btn{background:none !important;color:var(--th-text,#333) !important;font-size:19px !important}
.cws-themed #pmInboxPanel .pm-close-btn:hover{color:var(--th-accent,#03add8) !important;background:none !important}
.cws-themed .pm-inbox-search{padding:10px 16px !important}
.cws-themed .pm-search-input{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;border:1px solid var(--th-border,#e6e6e6) !important;color:var(--th-text,#333) !important;border-radius:10px !important}
.cws-themed .pmRow{border-color:var(--th-border,#e6e6e6) !important;padding:12px 20px !important;background:none !important}
.cws-themed .pmRow:hover{background:var(--th-item-bg,rgba(0,0,0,.05)) !important}
.cws-themed .pmRow.unread{background:var(--th-item-bg,rgba(0,0,0,.05)) !important}
.cws-themed .pm-avatar-wrap img,.cws-themed .pmAvatar{width:52px !important;height:52px !important;min-width:52px !important;max-width:52px !important}
.cws-themed .pmName,.cws-themed .pmName *{color:var(--th-text,#333) !important}
.cws-themed .pmInfo{color:var(--th-sub-text,#888) !important}
.cws-themed .pm-empty{color:var(--th-muted,#999) !important}

/* ── private chat v2 (needs pms.js + pms_box.php from this build) ── */
.cws-themed .pm-box-name::before{content:'@'}
.cws-themed .pm-box-controls{gap:4px !important;align-items:center}
.cws-themed .pm-ctrl-btn{font-size:16px !important;color:#fff !important;padding:6px 8px !important;opacity:.9}
.cws-themed .pm-ctrl-btn:hover{background:rgba(255,255,255,.12) !important;opacity:1}
.cws-themed #pmBox.pmx-full{width:calc(100vw - 16px) !important;height:calc(100vh - 110px) !important;right:8px !important}
.cws-themed .pm-messages,.cws-themed #pmMessages{background:var(--th-panel-bg,#fff) !important;padding:14px 16px !important;gap:14px !important}
.cws-themed .pm-msg{max-width:78% !important}
.cws-themed .pm-msg-text{padding:9px 14px !important;font-size:14px !important;line-height:1.45 !important;border-radius:16px !important}
.cws-themed .pm-msg.mine .pm-msg-text,.cws-themed .pm-msg.theirs .pm-msg-text{background:var(--th-item-bg,rgba(0,0,0,.05)) !important;color:var(--th-text,#333) !important;box-shadow:none !important}
.cws-themed .pmx-bubble-row{align-items:flex-end !important;gap:8px !important}
.cws-themed .pmx-mine-av{width:26px;height:26px;border-radius:50%;object-fit:cover;order:3;flex:0 0 26px}
.cws-themed .pm-msg.mine .pmx-bubble-row{flex-direction:row}
.cws-themed .pm-msg-meta{font-size:11px !important;color:var(--th-muted,#999) !important;margin-top:4px !important}
.cws-themed .pm-box-input{padding:10px 12px !important;gap:8px !important;align-items:center !important;background:var(--th-panel-bg,#fff) !important}
.cws-themed .pm-tool-btn{width:34px !important;height:34px !important;background:none !important;border:0 !important;color:var(--th-sub-text,#888) !important;font-size:18px !important;border-radius:50% !important}
.cws-themed .pm-send-btn{width:38px !important;height:38px !important;background:var(--th-header-bg,#222) !important;color:#fff !important;border-radius:50% !important;font-size:15px !important}
.cws-themed .pm-send-btn:hover{background:var(--th-accent,#03add8) !important}
/* inbox */
.cws-themed .pm-inbox-header{background:var(--th-panel-bg,#fff) !important;border:0 !important;padding:16px 18px 8px !important}
.cws-themed .pm-inbox-title{font-size:20px !important;font-weight:700 !important;color:var(--th-text,#333) !important}
.cws-themed .pm-inbox-header .pm-close-btn{color:var(--th-text,#333) !important;font-size:18px !important;padding:6px 8px !important}
.cws-themed .pm-inbox-header .pm-close-btn:hover{color:var(--th-accent,#03add8) !important;background:none !important}
.cws-themed .pm-inbox-search{display:none !important}
.cws-themed .pmRow{padding:10px 18px !important;min-height:0 !important;background:var(--th-panel-bg,#fff) !important;border:0 !important;gap:12px}
.cws-themed .pmRow:hover{background:var(--th-item-bg,rgba(0,0,0,.05)) !important}
.cws-themed .pmRow .pmx-name{font-size:15px;font-weight:600;color:var(--th-accent,#03add8) !important}
.cws-themed .pmRow .pmPreview,.cws-themed .pmx-time{color:var(--th-muted,#999) !important}
.cws-themed .pmRow .pm-unread-badge{background:#e53935 !important;color:#fff !important;min-width:22px;height:22px;border-radius:11px;font-size:12px;line-height:22px;text-align:center;padding:0 6px;right:48px}
.cws-themed .pmx-row-x{opacity:1 !important;color:var(--th-sub-text,#888) !important;background:none !important}
.cws-themed .pmx-row-x:hover{color:#e53935 !important}

/* ── emoji picker v2: wide + short like CodyChat (14 per row, X at right) ── */
.cws-themed .emo-panel{width:min(800px,calc(100vw - 16px)) !important;max-height:none !important;height:auto !important;border-radius:16px !important;display:flex;flex-direction:column}
.cws-themed .emo-panel.hidden{display:none !important}
.cws-themed .emo-panel-tabs{align-items:center;height:60px;overflow:hidden !important;flex:0 0 auto}
.cws-themed .emo-tab{width:60px !important;height:60px !important;padding:14px !important;flex:0 0 60px}
.cws-themed .emo-close{margin-left:auto;width:60px;height:60px;border:0;background:none;color:var(--th-text,#333);font-size:22px;cursor:pointer;flex:0 0 60px}
.cws-themed .emo-close:hover{color:var(--th-accent,#03add8)}
.cws-themed .emo-panel-grid{display:grid !important;grid-template-columns:repeat(auto-fill,minmax(51px,1fr));padding:8px 14px 12px !important;max-height:290px;overflow-y:auto;align-content:start;scrollbar-width:thin}
.cws-themed .emo-item{width:auto !important;height:51px !important}
.cws-themed .emo-item img{max-width:36px !important;max-height:36px !important}
.cws-themed .emo-item-large{height:80px !important}
.cws-themed .emo-item-large img{max-width:64px !important;max-height:64px !important}
@media (max-width:900px){.cws-themed .emo-panel{max-height:none !important}.cws-themed .emo-panel-grid{max-height:min(38vh,260px)}}
/* stacking: youtube below the private windows */
.cws-themed .cwsyt.mini,.cws-themed .cwsyt.bar{z-index:1120 !important}
/* pm input row: fixed-height pill, send button always visible */
.cws-themed #pmInput,.cws-themed .pm-input-field{min-width:0 !important;min-height:40px !important;height:40px !important;max-height:120px !important;padding:9px 16px !important;line-height:20px !important;border-radius:20px !important}
.cws-themed .pm-send-btn{flex:0 0 38px !important;display:flex !important;align-items:center;justify-content:center}
.cws-themed .pmx-mine-av{width:26px !important;height:26px !important}

/* ── minimized things live in the footer as small circles (YouTube, audio/video player, private chats) ──
   slots, counted from the right edge of the chat column: YouTube 46px · player 78px · private chats 110px → */
:root{--cl-tray:0px}
.cws-themed .ipl.ipl-mini{inset:auto var(--cl-ipl,56px) calc(7px + env(safe-area-inset-bottom,0px)) auto !important;width:24px !important;height:24px !important;padding:0 !important;z-index:1120 !important}
.cws-themed .ipl.ipl-mini .ipl-card{display:block !important;position:relative;width:24px !important;height:24px !important;min-height:0 !important;padding:0 !important;border-radius:50% !important;background:var(--th-accent,#03add8) !important;box-shadow:none !important;border:0 !important;cursor:pointer;overflow:visible !important}
.cws-themed .ipl.ipl-mini .ipl-head,.cws-themed .ipl.ipl-mini .ipl-seekrow,.cws-themed .ipl.ipl-mini .ipl-ctrl,.cws-themed .ipl.ipl-mini .ipl-disc,.cws-themed .ipl.ipl-mini .ipl-eq{display:none !important}
.cws-themed .ipl.ipl-mini .ipl-stage{position:absolute !important;inset:0;width:24px;height:24px;min-height:0 !important;margin:0 !important;padding:0 !important;opacity:0;pointer-events:none;overflow:hidden;display:block !important}
.cws-themed .ipl.ipl-mini .ipl-screen{display:block !important;width:24px;height:24px}
.cws-themed .ipl.ipl-mini .ipl-screen video{width:24px;height:24px}
.cws-themed .ipl.ipl-mini .ipl-card::after{content:"";position:absolute;inset:0;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'><path d='M9 3v11.3A3.5 3.5 0 1 0 11 17.5V7h7V3z'/></svg>") center/12px no-repeat}
.cws-themed .ipl.ipl-mini.ipl-playing .ipl-card{animation:iplRing 1.6s ease-out infinite}
@keyframes iplRing{0%{box-shadow:0 0 0 0 rgba(3,173,216,.55)}100%{box-shadow:0 0 0 8px rgba(3,173,216,0)}}
.cws-themed .ipl-video .ipl-min{display:inline-grid !important}
.cws-themed .pm-dock{left:auto !important;top:auto !important;right:var(--cl-pm,56px) !important;bottom:calc(7px + env(safe-area-inset-bottom,0px)) !important;flex-direction:row-reverse !important;gap:8px !important;z-index:1120 !important}
.cws-themed .pm-dock-chip{width:24px !important;height:24px !important;border:0 !important;box-shadow:none !important;background:var(--th-item-bg,rgba(0,0,0,.05)) !important}
.cws-themed .pm-dock-chip:hover{transform:scale(1.12)}
.cws-themed .pm-dock-chip.has-unread{box-shadow:0 0 0 2px #e53935 !important}
.cws-themed .pm-dock-dot{width:7px !important;height:7px !important;right:-1px !important;bottom:-1px !important;border:0 !important}
.cws-themed .pm-dock-badge{min-width:15px !important;height:15px !important;font-size:9px !important;line-height:15px !important;padding:0 3px !important;top:-7px !important;left:-7px !important;background:#e53935 !important;color:#fff !important}
.cws-themed .pm-dock-name,.cws-themed .pm-dock-x{display:none !important}

/* ── private chat v3: compact window like CodyChat; minimized = avatar circle in footer; maximized = docked column ── */
.cws-themed #pmBox,.cws-themed .pm-box{width:500px !important;height:500px !important;max-width:calc(100vw - 16px) !important;max-height:calc(100vh - var(--footer-h,38px) - 70px) !important;border-radius:2px !important}
@media (min-width:768px){.cws-themed #pmBox{bottom:calc(var(--footer-h,38px) + 10px)}}
.cws-themed .pm-box-header,.cws-themed #pmBoxHeader{height:50px !important;padding:0 10px 0 12px !important}
.cws-themed .pmx-av-wrap{flex:0 0 38px !important;width:38px !important;height:38px !important}
.cws-themed .pmx-av{width:38px !important;height:38px !important}
.cws-themed .pm-box-name::before{content:none !important}
.cws-themed .pm-box-name{font-size:17px !important}
.cws-themed .pm-box-user{gap:12px !important}
.cws-themed .pm-ctrl-btn{font-size:15px !important;padding:6px 9px !important}
.cws-themed .pm-ctrl-btn.close{width:28px !important;height:28px !important;padding:0 !important;margin-left:6px;border-radius:50% !important;background:#ef4f6c !important;border:2px solid #fff !important;color:#fff !important;font-size:12px !important;display:inline-flex;align-items:center;justify-content:center;opacity:1 !important}
.cws-themed .pm-ctrl-btn.close:hover{background:#d9304f !important}
.cws-themed .pm-messages,.cws-themed #pmMessages{padding:12px 14px !important;gap:12px !important}
.cws-themed .pmx-mine-av{width:32px !important;height:32px !important;flex:0 0 32px}
.cws-themed .pm-msg-text{font-size:15px !important;padding:10px 16px !important;border-radius:18px !important}
.cws-themed .pm-msg-meta{font-size:12px !important}
.cws-themed .pmx-seen{font-size:0 !important}
.cws-themed .pmx-seen i{font-size:13px !important;color:#2196f3 !important}
.cws-themed .pm-box-input{padding:8px 12px !important}
/* maximized: a full-height column beside the users panel */
.cws-themed #pmBox.pmx-full{position:fixed !important;top:56px !important;bottom:var(--footer-h,38px) !important;left:auto !important;right:0 !important;width:clamp(380px,30vw,560px) !important;height:auto !important;max-height:none !important;max-width:100vw !important;border-radius:0 !important;border:0 !important;border-left:1px solid var(--th-border,#e6e6e6) !important;box-shadow:none !important;transform:none !important}
body.rpanel-open .cws-themed #pmBox.pmx-full,.cws-themed body.rpanel-open #pmBox.pmx-full{right:var(--rpanel-w,320px) !important}
@media (max-width:767px){.cws-themed #pmBox.pmx-full{top:0 !important;bottom:0 !important;width:100vw !important;border-left:0 !important}}
/* minimized private chat = round avatar in the footer */
.cws-themed .pm-dock{bottom:calc(4px + env(safe-area-inset-bottom,0px)) !important}
.cws-themed .pm-dock-chip{width:30px !important;height:30px !important;border:2px solid #fff !important}
.cws-themed .pm-dock-dot{width:9px !important;height:9px !important;border:1.5px solid #fff !important}

/* ── reply / quote card: grey rounded box, avatar left, name + text (or picture) to its right ── */
.cws-themed .msg-quote{display:flex !important;align-items:flex-start !important;gap:12px !important;width:fit-content;max-width:min(100%,430px) !important;margin:2px 0 8px !important;padding:10px 16px 10px 12px !important;border:0 !important;border-left:0 !important;border-radius:14px !important;background:var(--th-selected,rgba(0,0,0,.08)) !important;cursor:pointer}
.cws-themed .msg-quote:hover{background:var(--th-selected,rgba(0,0,0,.11)) !important;filter:brightness(.97)}
.cws-themed .msg-quote-avatar{width:36px !important;height:36px !important;flex:0 0 36px !important;border-radius:50% !important;object-fit:cover}
.cws-themed .msg-quote-body{flex:1 1 auto !important;min-width:0}
.cws-themed .msg-quote-name{font-size:14px !important;font-weight:700 !important;line-height:1.3;color:var(--th-text,#333) !important}
.cws-themed .msg-quote-text{font-size:17px !important;line-height:1.35;color:var(--th-text,#333) !important;opacity:.85 !important;white-space:normal !important;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;word-break:break-word}
.cws-themed .msg-quote-thumb{display:block;width:210px !important;max-width:100%;height:auto !important;aspect-ratio:16/9;margin-top:6px;border-radius:10px !important;object-fit:cover}
.cws-themed .msg-quote.quote-highlight{background:var(--th-accent,#03add8) !important;opacity:.85}

/* ── private chat v4: the three CodyChat modes ──
   box  = 400px window above the footer · panel = 360px column that shrinks the room (>800px) · phones: full-width box / full screen between header and footer */
:root{--pm-w:360px}
.cws-themed #pmBox,.cws-themed .pm-box{width:400px !important;height:430px !important}
.cws-themed #pmBox.pmx-full{top:56px !important;bottom:var(--footer-h,38px) !important;width:var(--pm-w) !important;height:auto !important;right:0 !important;border-radius:0 !important}
body.rpanel-open .cws-themed #pmBox.pmx-full,.cws-themed body.rpanel-open #pmBox.pmx-full,body.rpanel-open #pmBox.pmx-full{right:var(--rpanel-w,320px) !important}
body.pm-docked .layout-shell{margin-right:var(--pm-w) !important}
body.pm-docked.rpanel-open .layout-shell{margin-right:calc(var(--rpanel-w,320px) + var(--pm-w)) !important}
@media (max-width:800px){
  .cws-themed #pmBox,.cws-themed .pm-box{left:0 !important;right:0 !important;width:100vw !important;max-width:100vw !important;height:400px !important;bottom:var(--footer-h,38px) !important;border-radius:0 !important}
  .cws-themed #pmBox.pmx-full,body.rpanel-open .cws-themed #pmBox.pmx-full,body.rpanel-open #pmBox.pmx-full{top:56px !important;bottom:var(--footer-h,38px) !important;left:0 !important;right:0 !important;width:100vw !important;height:auto !important;max-height:none !important;border:0 !important}
  body.pm-docked .layout-shell{margin-right:0 !important}
}

/* ── private chat input row like CodyChat: [photo] [+] [emoji] (field) [mic] (send) · their avatar beside their bubbles ── */
.cws-themed .pmx-their-av{order:0 !important;flex:0 0 32px;width:32px !important;height:32px !important;margin-right:2px}
.cws-themed .pm-msg.theirs .pmx-bubble-row{flex-direction:row !important}
.cws-themed .pm-box-input{gap:4px !important;position:relative}
.cws-themed .pm-box-input .pm-tool-btn{flex:0 0 34px;display:inline-flex !important;align-items:center;justify-content:center}
.cws-themed #pmMicBtn:hover,.cws-themed #pmEmoBtn:hover{color:var(--th-accent,#03add8) !important}
.cws-themed .pm-box-input .pm-input-field{flex:1 1 auto}
.cws-themed .pm-audio audio{width:min(240px,100%);height:36px;display:block}
.cws-themed .pm-msg.pm-msg-media .pm-msg-text{background:none !important;padding:0 !important}
.cws-themed .pm-msg.pm-msg-media .pm-audio{background:var(--th-item-bg,rgba(0,0,0,.05));border-radius:18px;padding:4px 6px}
/* emoji picker opened from the private chat: same look as the room's (big tabs, X, 51px cells), docked on top of the private window's input */
.cws-themed .emo-panel.emo-for-pm{max-width:calc(100vw - 16px) !important;border-radius:14px !important;box-shadow:0 8px 28px rgba(0,0,0,.28);background:var(--th-panel-bg,#fff) !important}
.cws-themed .emo-panel.emo-for-pm .emo-panel-grid{grid-template-columns:repeat(auto-fill,minmax(51px,1fr));max-height:min(290px,42vh)}

/* phone mode (<=800px): users list is an overlay opened from the footer menu, never docked */
@media (max-width:800px){
  body.rpanel-open .layout-shell{margin-right:0 !important}
  .cws-themed #rpanel{z-index:1050;box-shadow:-6px 0 24px rgba(0,0,0,.25);max-width:88vw}
  body.rpanel-open.pm-docked .layout-shell{margin-right:0 !important}
}

/* private chat input bar = same metrics as the room's message bar */
.cws-themed .pm-box-input{padding:6px 10px !important;gap:6px !important;min-height:0 !important;background:var(--th-panel-bg,#fff) !important;border-top:1px solid var(--th-border,#e6e6e6) !important;align-items:center !important}
.cws-themed .pm-box-input .pm-tool-btn{width:30px !important;height:30px !important;flex:0 0 30px !important;font-size:17px !important;padding:0 !important}
.cws-themed #pmInput,.cws-themed .pm-input-field{height:34px !important;min-height:34px !important;max-height:120px !important;padding:7px 14px !important;font-size:14px !important;line-height:20px !important;border-radius:18px !important;border:1px solid var(--th-border,#e6e6e6) !important;background:var(--th-item-bg,rgba(0,0,0,.05)) !important;box-shadow:none !important}
.cws-themed .pm-send-btn{width:34px !important;height:34px !important;flex:0 0 34px !important;font-size:15px !important}
/* voice/audio card inside a private bubble — same card as the room */
.cws-themed .pm-audio{background:none !important;padding:0 !important;min-width:210px}
.cws-themed .pm-audio .embed-block{margin:0}
.cws-themed .pm-msg.pm-msg-media .pm-audio{background:none !important;padding:0 !important}

/* your own name in a message: blue glow (room + private) */
.cws-themed .mention.mention-self,.cws-themed .pm-mention-me{background:var(--th-accent,#03add8) !important;color:#fff !important;border-radius:10px;padding:1px 7px !important;font-weight:700;box-shadow:0 0 0 2px rgba(3,173,216,.25)}

/* ── final pass: private bar is as slim as the room's; the room's Send is the dark round one from the private chat ── */
.cws-themed .pm-box-input{height:auto !important;min-height:0 !important;padding:8px 10px !important;gap:6px !important;align-items:center !important}
.cws-themed .pm-box-input #pmInput{box-sizing:border-box !important;height:38px !important;min-height:38px !important;max-height:38px !important;padding:0 16px !important;line-height:36px !important;font-size:14px !important;border-radius:19px !important;overflow:hidden !important;resize:none !important;flex:1 1 auto !important;width:auto !important;margin:0 !important}
.cws-themed .pm-box-input #pmInput::placeholder{line-height:36px}
.cws-themed .pm-box-input .pm-tool-btn{width:30px !important;height:30px !important;flex:0 0 30px !important;font-size:18px !important;color:var(--th-sub-text,#888) !important}
.cws-themed .pm-box-input .pm-send-btn,.cws-themed .chat-input .send-btn,.cws-themed #sendBtn{width:38px !important;height:38px !important;min-width:38px !important;flex:0 0 38px !important;border-radius:50% !important;background:var(--th-header-bg,#222) !important;color:#fff !important;border:0 !important;box-shadow:none !important;display:inline-flex !important;align-items:center;justify-content:center;font-size:15px !important;padding:0 !important}
.cws-themed .chat-input .send-btn:hover,.cws-themed #sendBtn:hover{background:var(--th-accent,#03add8) !important;color:#fff !important}

/* audio/video player opened from a private chat sits ABOVE the private window */
.cws-themed #cwsPlayer.ipl:not(.ipl-mini),#cwsPlayer.ipl.ipl-open:not(.ipl-mini){z-index:2147483100 !important}

/* audio player: no modal — a floating card near the top so you can keep chatting while it plays */
.cws-themed #cwsPlayer.ipl:not(.ipl-video):not(.ipl-mini){pointer-events:none !important;align-items:flex-start !important;justify-content:center !important;padding:66px 12px 0 !important}
.cws-themed #cwsPlayer.ipl:not(.ipl-video):not(.ipl-mini) .ipl-backdrop{display:none !important}
.cws-themed #cwsPlayer.ipl:not(.ipl-video):not(.ipl-mini) .ipl-card{pointer-events:auto !important;box-shadow:0 10px 34px rgba(0,0,0,.28) !important;max-width:360px}
/* audio player v2: pinned right under the top bar, nothing around it blocks the page */
html body #cwsPlayer.ipl.ipl-audio.ipl-open:not(.ipl-mini){pointer-events:none !important;background:none !important;align-items:flex-start !important;justify-content:center !important;padding:54px 12px 0 !important}
html body #cwsPlayer.ipl.ipl-audio.ipl-open:not(.ipl-mini) .ipl-backdrop{display:none !important;pointer-events:none !important}
html body #cwsPlayer.ipl.ipl-audio.ipl-open:not(.ipl-mini) .ipl-card{pointer-events:auto !important;max-width:340px !important;padding:12px 16px 14px !important;border-radius:16px !important;box-shadow:0 8px 28px rgba(0,0,0,.3) !important}
.cws-themed #cwsPlayer.ipl.ipl-audio:not(.ipl-mini) .ipl-head{cursor:grab;user-select:none}
.cws-themed #cwsPlayer.ipl.ipl-mini .ipl-card{translate:none !important}
.cws-themed .emo-panel.emo-for-pm .emo-panel-tabs{height:60px}
.cws-themed .emo-panel.emo-for-pm .emo-tab,.cws-themed .emo-panel.emo-for-pm .emo-close{width:60px !important;height:60px !important;flex:0 0 60px;padding:14px !important}

/* top-bar dropdowns (notifications, friend requests, avatar/hamburger menus) always open above private chat windows,
   whose z-index grows with every click (js/layer_stack.js) */
.menu-backdrop{z-index:2147480000 !important}
.float-menu,#frPopup,#notifPopup{z-index:2147480010 !important}
