/* Core chat component styles extracted from theme.css.
   Load before chat-clean.css. */

/* CHAT PHASE 4 UI (base) */
.ugfx-chat-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr) 260px; gap: 1.25rem; align-items: start; }
.ugfx-chat-card { border: 1px solid rgba(255,120,42,.12); border-radius: 1.35rem; background: linear-gradient(180deg, rgba(18,14,18,.86), rgba(11,10,14,.88)); backdrop-filter: blur(14px); box-shadow: 0 20px 50px rgba(0,0,0,.22); }
.ugfx-chat-side { padding: 1.25rem; }
.ugfx-chat-room-btn { width: 100%; text-align: left; padding: .95rem 1rem; border-radius: 1rem; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.05); color: #fff; margin-bottom: .75rem; transition: .18s ease; }
.ugfx-chat-room-btn:hover, .ugfx-chat-room-btn.active { background: rgba(255,124,42,.12); border-color: rgba(255,124,42,.30); box-shadow: 0 10px 22px rgba(255,124,42,.08); }
.ugfx-chat-room-type { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #f6b07c; }
.ugfx-chat-feed { display: flex; flex-direction: column; min-height: 70vh; overflow: hidden; }
.ugfx-chat-feed-head { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.25rem 0 1.25rem; }
.ugfx-chat-messages { flex: 1; overflow: auto; padding: 1.2rem; max-height: 58vh; }
.ugfx-chat-message { display: block; margin-bottom: 1rem; }
.ugfx-chat-bubble { border: 1px solid rgba(255,255,255,.055); background: rgba(19,18,23,.84); border-radius: 1.15rem; padding: .95rem 1rem; }
.ugfx-chat-meta { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: .45rem; }
.ugfx-chat-userline { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.ugfx-chat-avatar { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(180deg, #4f2a17, #25150f); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #ffd9bc; border: 1px solid rgba(255,146,67,.18); flex: 0 0 auto; }
.ugfx-chat-namewrap { display: flex; flex-direction: column; min-width: 0; }
.ugfx-chat-name { font-weight: 800; font-size: 1rem; line-height: 1.1; }
.ugfx-chat-sub { font-size: .78rem; color: #9fa7b3; line-height: 1.1; }
.ugfx-chat-time { font-size: .8rem; color: #a4a9b6; white-space: nowrap; margin-left: auto; padding-top: .15rem; }
.ugfx-chat-role { display: inline-flex; padding: .18rem .5rem; border-radius: 999px; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; width: max-content; }
.ugfx-chat-role-admin { background: rgba(255,209,102,.13); color: #ffd166; border: 1px solid rgba(255,209,102,.18); }
.ugfx-chat-role-dj { background: rgba(255,138,61,.13); color: #ff8a3d; border: 1px solid rgba(255,138,61,.18); }
.ugfx-chat-role-user { background: rgba(143,216,255,.13); color: #8fd8ff; border: 1px solid rgba(143,216,255,.18); }
.ugfx-chat-text { font-size: .98rem; line-height: 1.55; color: #eef0f5; white-space: pre-wrap; word-break: break-word; }
.ugfx-chat-composer { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid rgba(255,255,255,.055); }
.ugfx-chat-composer textarea { min-height: 84px; border-radius: 1rem !important; background: rgba(10,12,16,.9) !important; border: 1px solid rgba(255,124,42,.16) !important; color: #fff !important; }
.ugfx-chat-users .user-row { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: .75rem; align-items: start; padding: .8rem; border-radius: 1rem; background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.05); margin-bottom: .75rem; }
.ugfx-chat-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .75rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); font-size: .82rem; }
.ugfx-chat-empty { padding: 1rem; border-radius: 1rem; border: 1px dashed rgba(255,255,255,.08); color: #9fa7b3; background: rgba(255,255,255,.02); }
.ugfx-chat-title { font-size: 2rem; font-weight: 800; line-height: 1.05; }
@media (max-width: 1199px) { .ugfx-chat-shell { grid-template-columns: 1fr; } .ugfx-chat-messages { max-height: 50vh; } }

/* CHAT PHASE 4.1 FIX */
.ugfx-chat-meta { align-items: center; }
.ugfx-chat-userline { align-items: center; }
.ugfx-chat-namewrap { gap: .28rem; }
.ugfx-chat-name { position: relative; z-index: 2; }
.ugfx-chat-sub { position: relative; z-index: 1; }
.ugfx-chat-time { display: none !important; }

/* CHAT PHASE 4.2 MESSAGE STACK FIX */
.ugfx-chat-bubble { padding: 1rem 1.1rem !important; }
.ugfx-chat-meta { display: block !important; margin-bottom: .7rem !important; }
.ugfx-chat-userline { display: flex !important; align-items: center !important; gap: .85rem !important; }
.ugfx-chat-namewrap { display: flex !important; flex-direction: column !important; align-items: flex-start !important; justify-content: center !important; gap: .38rem !important; }
.ugfx-chat-name { display: block !important; font-weight: 800 !important; font-size: 1rem !important; line-height: 1.15 !important; color: #fff !important; margin: 0 !important; padding: 0 !important; }
.ugfx-chat-sub { display: block !important; margin: 0 !important; padding: 0 !important; }
.ugfx-chat-text { display: block !important; margin-top: .15rem !important; padding-top: 0 !important; font-size: 1rem !important; line-height: 1.6 !important; color: #f5f7fb !important; white-space: pre-wrap !important; word-break: break-word !important; }

/* CHAT PHASE 4.3 HARD SEPARATION */
.ugfx-chat-message { display: block !important; margin-bottom: 1rem !important; }
.ugfx-chat-bubble { display: block !important; }
.ugfx-chat-header { display: flex !important; align-items: flex-start !important; gap: .9rem !important; margin-bottom: .75rem !important; }
.ugfx-chat-header-text { display: flex !important; flex-direction: column !important; align-items: flex-start !important; gap: .35rem !important; min-width: 0 !important; }
.ugfx-chat-name { display: block !important; margin: 0 !important; line-height: 1.1 !important; }
.ugfx-chat-sub { display: block !important; margin: 0 !important; }
.ugfx-chat-body { display: block !important; clear: both !important; padding-left: 0 !important; margin-top: .2rem !important; }
.ugfx-chat-text { display: block !important; margin: 0 !important; line-height: 1.6 !important; }

/* CHAT PHASE 5 PRIVATE PANEL */
.ugfx-private-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: .2s; z-index: 1040; }
.ugfx-private-panel { position: fixed; top: 0; right: 0; width: min(420px,100%); height: 100vh; background: linear-gradient(180deg, rgba(14,12,18,.97), rgba(8,10,14,.98)); border-left: 1px solid rgba(255,120,42,.14); box-shadow: -20px 0 50px rgba(0,0,0,.35); transform: translateX(100%); transition: .24s ease; z-index: 1041; display: flex; flex-direction: column; }
body.ugfx-private-open .ugfx-private-overlay { opacity: 1; pointer-events: auto; }
body.ugfx-private-open .ugfx-private-panel { transform: translateX(0); }
.ugfx-private-head { padding: 1.1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ugfx-private-title { font-size: 1.25rem; font-weight: 800; }
.ugfx-private-close { width: 40px; height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: #fff; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.ugfx-private-messages { flex: 1; overflow: auto; padding: 1rem; }
.ugfx-private-compose { padding: 1rem; border-top: 1px solid rgba(255,255,255,.06); }
.ugfx-private-message { display: block; margin-bottom: .9rem; }
.ugfx-private-bubble { max-width: 86%; padding: .8rem .95rem; border-radius: 1rem; border: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.03); }
.ugfx-private-message.mine { display: flex; justify-content: flex-end; }
.ugfx-private-message.mine .ugfx-private-bubble { background: rgba(255,124,42,.13); border-color: rgba(255,124,42,.24); }
.ugfx-private-label { font-size: .78rem; color: #a7adb8; margin-bottom: .25rem; }
.ugfx-chat-users .user-row { cursor: pointer; transition: .18s ease; }
.ugfx-chat-users .user-row:hover { border-color: rgba(255,124,42,.22); background: rgba(255,124,42,.06); }

/* CHAT PHASE 6 MOD + PRIVATE WINDOW */
.ugfx-chat-context { position: fixed; z-index: 1050; min-width: 165px; max-width: 220px; max-height: min(56vh, 320px); overflow-y: auto; padding: .32rem; background: rgba(10,12,16,.97); border: 1px solid rgba(255,255,255,.10); border-radius: .8rem; box-shadow: 0 12px 26px rgba(0,0,0,.38); display: none; }
.ugfx-chat-context.open { display: block; }
.ugfx-chat-context button { width: 100%; text-align: left; background: transparent; border: 0; color: #fff; padding: .5rem .6rem; border-radius: .58rem; font-size: .86rem; line-height: 1.2; }
.ugfx-chat-context button:hover { background: rgba(255,124,42,.12); }
body.ugfx-private-open .ugfx-private-panel { display: none; }
#ugfxPrivateWindow { max-width: 860px; margin: 0 auto; min-height: 75vh; display: flex; flex-direction: column; }

/* CENTER DM PATCH */
.ugfx-chat-private-room .ugfx-chat-room-type { color: #8fd8ff; }

/* DISCORD-STYLE DM LIST */
.ugfx-chat-private-room { position: relative; }
.ugfx-chat-dm-badge {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff6a1a;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  margin-left: auto;
  box-shadow: 0 6px 14px rgba(255,106,26,.35);
}
.ugfx-chat-room-row { display: flex; align-items: center; gap: .75rem; }
.ugfx-chat-room-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ugfx-chat-room-meta .fw-bold { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ugfx-chat-room-preview { font-size: .78rem; color: #9fa7b3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: .15rem; }
.ugfx-chat-context button.text-danger { color: #ff9b9b; }
.ugfx-chat-context button.text-danger:hover { background: rgba(255,80,80,.12); }
.ugfx-chat-context button.text-warn { color: #f6b07c; }
.ugfx-chat-context button.text-warn:hover { background: rgba(255,180,80,.12); }
.ugfx-chat-dm-close {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: #aeb4bf;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
}
.ugfx-chat-dm-close:hover {
  background: rgba(255,124,42,.12);
  border-color: rgba(255,124,42,.22);
  color: #fff;
}

/* PREMIUM MEDIA PICKER */
.ugfx-media-overlay{position:fixed;inset:0;background:rgba(0,0,0,.56);opacity:0;pointer-events:none;transition:.18s;z-index:1100}
.ugfx-media-modal{position:fixed;left:50%;top:50%;transform:translate(-50%,-46%);width:min(980px,92vw);height:min(78vh,760px);background:linear-gradient(180deg,rgba(15,13,18,.98),rgba(10,11,15,.99));border:1px solid rgba(255,124,42,.14);border-radius:1.4rem;box-shadow:0 24px 80px rgba(0,0,0,.45);opacity:0;pointer-events:none;transition:.18s;z-index:1101;display:flex;flex-direction:column;overflow:hidden}
body.ugfx-media-open .ugfx-media-overlay{opacity:1;pointer-events:auto}
body.ugfx-media-open .ugfx-media-modal{opacity:1;pointer-events:auto;transform:translate(-50%,-50%)}
.ugfx-media-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.1rem;border-bottom:1px solid rgba(255,255,255,.06)}
.ugfx-media-title{font-size:1.25rem;font-weight:800}
.ugfx-media-close{width:40px;height:40px;border-radius:999px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08);color:#fff;font-size:1.3rem}
.ugfx-media-tabs{display:flex;gap:.5rem;padding:.8rem 1rem;border-bottom:1px solid rgba(255,255,255,.06);flex-wrap:wrap}
.ugfx-media-tab{padding:.5rem .9rem;border-radius:999px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08);color:#fff}
.ugfx-media-tab.active{background:rgba(255,124,42,.16);border-color:rgba(255,124,42,.28)}
.ugfx-media-grid-wrap{flex:1;overflow:auto;padding:1rem}
.ugfx-media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:.9rem}
.ugfx-media-item{display:flex;flex-direction:column;gap:.55rem;padding:.65rem;border-radius:1rem;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.06);cursor:pointer;transition:.16s;color:#fff}
.ugfx-media-item:hover{transform:translateY(-1px);border-color:rgba(255,124,42,.22);background:rgba(255,124,42,.06)}
.ugfx-media-thumb{width:100%;aspect-ratio:1/1;border-radius:.9rem;background:rgba(255,255,255,.03);display:flex;align-items:center;justify-content:center;overflow:hidden}
.ugfx-media-thumb img{width:100%;height:100%;object-fit:cover}
.ugfx-media-label{font-size:.84rem;font-weight:700;line-height:1.2}
.ugfx-media-sub{font-size:.72rem;color:#9fa7b3;text-transform:uppercase;letter-spacing:.08em}
.ugfx-emoji-item{font-size:2rem}

/* MEDIA PICKER POLISH */
.ugfx-media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:.7rem}
.ugfx-media-item{padding:.5rem;border-radius:.9rem}
.ugfx-media-thumb{aspect-ratio:1/1;border-radius:.75rem}
.ugfx-media-label{font-size:.76rem;font-weight:800;line-height:1.15;text-align:center}
.ugfx-media-sub{display:none}
.ugfx-emoji-item{font-size:1.75rem}
.ugfx-media-item[data-insert-emoji]{min-height:110px}
@media (max-width:900px){.ugfx-media-grid{grid-template-columns:repeat(auto-fill,minmax(78px,1fr));gap:.55rem}.ugfx-media-item[data-insert-emoji]{min-height:96px}.ugfx-emoji-item{font-size:1.5rem}}

/* CURATED PREMIUM MEDIA PICKER */
.ugfx-media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:.65rem}
.ugfx-media-item{padding:.45rem .45rem .55rem;border-radius:1rem;background:linear-gradient(180deg,rgba(23,24,30,.95),rgba(15,16,22,.98));border:1px solid rgba(255,255,255,.05)}
.ugfx-media-item:hover{border-color:rgba(255,124,42,.28);box-shadow:0 10px 22px rgba(255,124,42,.10)}
.ugfx-media-thumb{aspect-ratio:1/1;border-radius:.8rem;background:rgba(255,255,255,.025)}
.ugfx-media-label{font-size:.74rem;font-weight:800;line-height:1.15;text-align:center;margin-top:.1rem}
.ugfx-media-sub{display:none}
.ugfx-emoji-item{font-size:1.6rem}

/* CHAT ROOM OVERHAUL (migrated from theme.css) */
.ugfx-chat-shell{display:grid;grid-template-columns:360px minmax(0,1fr);gap:1.25rem;align-items:start}
.ugfx-chat-sidebar{display:grid;gap:1.2rem;position:sticky;top:92px}
.ugfx-chat-sidecard{overflow:hidden}
.ugfx-chat-onair{display:grid;grid-template-columns:92px 1fr;gap:1rem;align-items:center}
.ugfx-chat-cover{width:92px;height:92px;border-radius:22px;object-fit:cover;box-shadow:0 0 0 1px rgba(255,154,31,.2),0 0 30px rgba(255,106,0,.15)}
.ugfx-chat-live-meta{display:flex;flex-wrap:wrap;gap:.6rem}
.ugfx-chat-player-actions{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}
.ugfx-chat-feature-list{display:grid;gap:.8rem}
.ugfx-chat-feature-list div{display:flex;gap:.8rem;align-items:flex-start;padding:.85rem 1rem;border-radius:18px;background:rgba(255,255,255,.03);border:1px solid rgba(255,154,31,.12)}
.ugfx-chat-feature-list i{color:var(--ugfx-orange-2);font-size:1.05rem;margin-top:.1rem}
.ugfx-chat-stage{padding:0;overflow:hidden}
.ugfx-chat-topbar{display:flex;justify-content:space-between;gap:1rem;align-items:center;padding:1.15rem 1.2rem;border-bottom:1px solid rgba(255,255,255,.06);background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.01))}
.ugfx-chat-topstats{display:flex;gap:.65rem;flex-wrap:wrap;justify-content:flex-end}
.ugfx-chat-feed{height:560px;overflow:auto;padding:1.2rem;display:flex;flex-direction:column;gap:1rem;background:linear-gradient(180deg,rgba(255,255,255,.015),rgba(255,255,255,.025))}
.ugfx-chat-bubble{display:grid;grid-template-columns:48px minmax(0,1fr);gap:.9rem;align-items:start}
.ugfx-chat-bubble.system .ugfx-chat-bubble-main{border-color:rgba(255,106,0,.28);background:rgba(255,106,0,.08)}
.ugfx-chat-avatar{width:48px;height:48px;border-radius:16px;display:grid;place-items:center;font-weight:800;background:linear-gradient(135deg,rgba(255,154,31,.22),rgba(255,59,31,.18));border:1px solid rgba(255,154,31,.2)}
.ugfx-chat-bubble-main{padding:1rem 1.05rem;border-radius:22px;background:rgba(255,255,255,.035);border:1px solid rgba(255,154,31,.11);backdrop-filter:blur(14px)}
.ugfx-chat-bubble-head{display:flex;justify-content:space-between;gap:1rem;align-items:center;margin-bottom:.5rem;font-size:.9rem}
.ugfx-chat-bubble-head span{color:var(--ugfx-muted);font-size:.82rem}
.ugfx-chat-text{line-height:1.7;word-break:break-word}
.ugfx-chat-text a{color:var(--ugfx-warm)}
.ugfx-chat-media img{max-width:min(360px,100%);border-radius:18px;margin-top:.75rem;display:block}
.ugfx-chat-sticker{display:inline-flex;align-items:center;gap:.4rem;margin-top:.55rem;padding:.65rem .95rem;border-radius:999px;border:1px solid rgba(255,154,31,.22);background:linear-gradient(135deg,rgba(255,106,0,.14),rgba(255,255,255,.04));font-weight:800;letter-spacing:.04em}
.ugfx-chat-voice{margin-top:.75rem}
.ugfx-chat-voice audio{width:min(340px,100%)}
.ugfx-chat-composer-wrap{border-top:1px solid rgba(255,255,255,.06);padding:1rem 1.2rem 1.2rem;background:rgba(8,10,14,.82)}
.ugfx-chat-composer{display:grid;gap:.9rem}
.ugfx-chat-editor{display:grid;gap:.8rem}
.ugfx-chat-toolbar{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.ugfx-chat-toolbar .btn.recording{background:rgba(255,59,31,.18)!important;border-color:rgba(255,59,31,.45)!important;box-shadow:0 0 16px rgba(255,59,31,.18)}
.ugfx-chat-attachments{display:flex;gap:.55rem;flex-wrap:wrap}
.ugfx-attach-card{display:inline-flex;align-items:center;gap:.65rem;padding:.45rem .72rem;border-radius:999px;background:rgba(255,255,255,.04);border:1px solid rgba(255,154,31,.18)}
.ugfx-attach-card button{border:0;background:transparent;color:#fff;font-size:1.1rem;line-height:1}
.ugfx-chat-panels{display:grid;gap:.85rem}
.ugfx-chat-panel{padding:1rem;border-radius:22px;background:rgba(255,255,255,.03);border:1px solid rgba(255,154,31,.12)}
.ugfx-chat-panel-head{display:flex;justify-content:space-between;gap:1rem;align-items:center;margin-bottom:.8rem;flex-wrap:wrap}
.ugfx-chat-chip-row{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:.8rem}
.ugfx-mini-chip{border:1px solid rgba(255,154,31,.18);background:rgba(255,255,255,.03);color:#fff;padding:.36rem .7rem;border-radius:999px}
.ugfx-mini-chip.active{background:rgba(255,106,0,.16);border-color:rgba(255,154,31,.42)}
.ugfx-emoji-grid,.ugfx-sticker-grid,.ugfx-gif-grid{display:grid;gap:.7rem;grid-template-columns:repeat(auto-fill,minmax(70px,1fr))}
.ugfx-emoji-btn,.ugfx-sticker-btn,.ugfx-gif-thumb{border:1px solid rgba(255,154,31,.12);background:rgba(255,255,255,.03);border-radius:18px;color:#fff;min-height:62px;padding:.6rem;transition:.18s ease}
.ugfx-emoji-btn{font-size:1.5rem}
.ugfx-sticker-btn{font-size:.9rem;font-weight:800;letter-spacing:.03em;line-height:1.2}
.ugfx-gif-thumb{padding:0;overflow:hidden;height:90px}
.ugfx-gif-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.ugfx-emoji-btn:hover,.ugfx-sticker-btn:hover,.ugfx-gif-thumb:hover{transform:translateY(-2px);border-color:rgba(255,154,31,.34);box-shadow:0 14px 28px rgba(0,0,0,.22),0 0 22px rgba(255,106,0,.1)}
.ugfx-chat-status-row{display:flex;justify-content:space-between;gap:1rem;align-items:center;flex-wrap:wrap}

/* ADMIN + CHAT UPGRADE PACK (chat selectors only) */
.ugfx-chat-shell-admin{grid-template-columns:minmax(0,1fr)!important}
.ugfx-chat-shell-admin .ugfx-chat-main{min-width:0}
.ugfx-chat-stage{border:1px solid rgba(85,214,255,.12);background:linear-gradient(180deg, rgba(7,12,18,.92), rgba(8,10,16,.86))}
.ugfx-chat-topbar{padding:1.25rem 1.35rem;border-bottom:1px solid rgba(85,214,255,.12);background:linear-gradient(135deg, rgba(85,214,255,.08), rgba(255,154,31,.04))}
.ugfx-chat-feed{min-height:620px;max-height:620px;padding:1.35rem;background:linear-gradient(180deg, rgba(5,8,12,.15), rgba(7,8,12,.2))}
.ugfx-chat-bubble{display:grid;grid-template-columns:48px minmax(0,1fr);gap:1rem;margin-bottom:1rem;align-items:start}
.ugfx-chat-avatar{width:48px;height:48px;border-radius:16px;display:grid;place-items:center;font-weight:800;background:linear-gradient(135deg, rgba(34,168,255,.35), rgba(85,214,255,.12));border:1px solid rgba(85,214,255,.22);color:#fff;box-shadow:0 0 24px rgba(34,168,255,.12)}
.ugfx-chat-bubble-main{background:rgba(255,255,255,.03);border:1px solid rgba(85,214,255,.12);padding:1rem 1.1rem;border-radius:20px}
.ugfx-chat-bubble.system .ugfx-chat-bubble-main{background:rgba(34,168,255,.08);border-color:rgba(85,214,255,.2)}
.ugfx-chat-bubble-head{display:flex;justify-content:space-between;gap:1rem;align-items:center;margin-bottom:.55rem}
.ugfx-chat-text{line-height:1.7;font-size:1rem;word-break:break-word}
.ugfx-chat-composer-wrap{padding:1.15rem 1.25rem;border-top:1px solid rgba(85,214,255,.12);background:rgba(5,8,12,.45)}
.ugfx-chat-color-row{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;margin-bottom:.8rem}
.ugfx-chat-color-row input[type=color]{width:58px;height:42px;border:1px solid rgba(85,214,255,.22);background:transparent;border-radius:14px;padding:.25rem}
.ugfx-chat-toolbar{display:flex;gap:.65rem;flex-wrap:wrap;align-items:center;margin-top:.85rem}
.ugfx-chat-panel{margin-top:.9rem;padding:1rem;border-radius:18px;border:1px solid rgba(85,214,255,.12);background:rgba(6,9,15,.9)}
.ugfx-emoji-grid,.ugfx-sticker-grid,.ugfx-gif-grid{display:grid;gap:.65rem;grid-template-columns:repeat(auto-fill,minmax(62px,1fr));margin-top:.9rem}
.ugfx-emoji-btn,.ugfx-sticker-btn,.ugfx-gif-thumb{border:1px solid rgba(85,214,255,.14);border-radius:16px;background:rgba(255,255,255,.03);padding:.75rem;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.ugfx-emoji-btn:hover,.ugfx-sticker-btn:hover,.ugfx-gif-thumb:hover{transform:translateY(-2px);border-color:rgba(85,214,255,.3);box-shadow:0 0 24px rgba(34,168,255,.12)}
.ugfx-sticker-grid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr))}
.ugfx-sticker-btn{font-weight:800;color:#e8f7ff;font-size:.92rem;min-height:72px;display:grid;place-items:center;text-align:center}
.ugfx-gif-grid{grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}
.ugfx-gif-thumb img,.ugfx-chat-media img{width:100%;display:block;border-radius:16px;aspect-ratio:1/1;object-fit:cover}
.ugfx-mini-chip.active,.ugfx-mini-chip:hover{background:rgba(85,214,255,.16);border-color:rgba(85,214,255,.24)}
.ugfx-chat-admin-row{display:grid;grid-template-columns:minmax(0,1fr) 140px;gap:1rem;align-items:start}
@media (max-width: 991.98px){.ugfx-chat-admin-row{grid-template-columns:1fr}.ugfx-chat-feed{min-height:460px;max-height:460px}}

/* ADMIN CORRECTIVE PASS (chat selectors only) */
.ugfx-chat-stage{border:1px solid rgba(255,154,31,.14)!important;background:linear-gradient(180deg, rgba(18,20,28,.92), rgba(15,10,8,.95))!important}
.ugfx-chat-topbar{border-bottom:1px solid rgba(255,154,31,.14)!important;background:linear-gradient(135deg, rgba(255,106,0,.11), rgba(255,59,31,.08))!important}
.ugfx-chat-feed{min-height:620px;max-height:620px;background:linear-gradient(180deg, rgba(5,5,7,.15), rgba(5,5,7,.22))!important}
.ugfx-chat-bubble-main{background:rgba(255,255,255,.03)!important;border:1px solid rgba(255,154,31,.12)!important}
.ugfx-chat-bubble.system .ugfx-chat-bubble-main{background:rgba(255,106,0,.09)!important;border-color:rgba(255,154,31,.18)!important}
.ugfx-chat-avatar{background:linear-gradient(135deg, rgba(255,106,0,.28), rgba(255,59,31,.12))!important;border:1px solid rgba(255,154,31,.22)!important;box-shadow:0 0 24px rgba(255,106,0,.12)!important}
.ugfx-chat-composer-wrap{border-top:1px solid rgba(255,154,31,.14)!important;background:rgba(5,5,7,.42)!important}
.ugfx-chat-color-row input[type=color],.ugfx-chat-panel,.ugfx-emoji-btn,.ugfx-sticker-btn,.ugfx-gif-thumb,.ugfx-mini-chip.active,.ugfx-mini-chip:hover{border-color:rgba(255,154,31,.18)!important}
.ugfx-chat-panel{background:rgba(10,10,14,.90)!important}
.ugfx-mini-chip.active,.ugfx-mini-chip:hover{background:rgba(255,106,0,.12)!important}
.ugfx-emoji-btn:hover,.ugfx-sticker-btn:hover,.ugfx-gif-thumb:hover{border-color:rgba(255,154,31,.32)!important;box-shadow:0 0 24px rgba(255,106,0,.12)!important}

/* CHAT MEDIA UPGRADE + MOD PANEL */
.ugfx-chat-sticker--image{display:block;padding:.3rem;background:transparent;border:none;max-width:220px}
.ugfx-chat-sticker--image img{display:block;width:100%;max-width:180px;border-radius:18px;border:1px solid rgba(255,154,31,.22);box-shadow:0 10px 26px rgba(0,0,0,.24)}
.ugfx-sticker-btn--media{padding:.4rem;min-height:132px;align-content:start;gap:.45rem}
.ugfx-sticker-btn--media img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:14px;display:block}
.ugfx-sticker-btn--media span{font-size:.78rem;line-height:1.2;font-weight:700;color:#eef8ff}
.ugfx-chat-panel-actions{display:flex;justify-content:center;margin-top:.9rem}
.ugfx-media-empty{grid-column:1/-1;padding:1rem;border:1px dashed rgba(255,255,255,.14);border-radius:16px;text-align:center;color:rgba(255,255,255,.72)}
.ugfx-attach-card--media{padding:.38rem .6rem .38rem .38rem}
.ugfx-attach-card--media img{width:44px;height:44px;object-fit:cover;border-radius:12px;display:block}
[data-sticker-search],[data-gif-search]{background:rgba(255,255,255,.04)}
@media (max-width: 767.98px){.ugfx-sticker-grid{grid-template-columns:repeat(auto-fill,minmax(96px,1fr))}.ugfx-gif-grid{grid-template-columns:repeat(auto-fill,minmax(88px,1fr))}.ugfx-chat-sticker--image{max-width:180px}}
.ugfx-chat-rich-media img{max-width:260px;border-radius:12px;margin-top:6px;box-shadow:0 4px 14px rgba(0,0,0,0.4)}
.ugfx-chat-rich-embed iframe{width:220px;height:220px;border:0;border-radius:12px;background:#0f1116;display:block}
.ugfx-room-user-item{display:flex;align-items:center;gap:.8rem;justify-content:space-between;padding:.7rem .8rem;border-radius:.9rem;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.06)}
.ugfx-room-user-main{display:flex;align-items:center;gap:.8rem;min-width:0}
.ugfx-room-user-meta{display:flex;flex-direction:column;min-width:0}
.ugfx-room-user-name{font-weight:800;line-height:1.1}
.ugfx-room-user-sub{color:#9fa7b3;font-size:.78rem;margin-top:.15rem}
.ugfx-modpanel-overlay{position:fixed;inset:0;background:rgba(5,8,15,.72);backdrop-filter:blur(8px);z-index:1050;opacity:0;pointer-events:none;transition:opacity .18s ease}
.ugfx-modpanel-modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-48%);width:min(1100px,calc(100vw - 1.5rem));max-height:min(86vh,900px);background:linear-gradient(180deg,#111827 0%,#0b1220 100%);border:1px solid rgba(255,255,255,.08);border-radius:1.25rem;box-shadow:0 26px 80px rgba(0,0,0,.45);z-index:1051;opacity:0;pointer-events:none;display:flex;flex-direction:column;overflow:hidden;transition:opacity .18s ease,transform .18s ease}
body.ugfx-modpanel-open .ugfx-modpanel-overlay,body.ugfx-modpanel-open .ugfx-modpanel-modal{opacity:1;pointer-events:auto}
body.ugfx-modpanel-open .ugfx-modpanel-modal{transform:translate(-50%,-50%)}
.ugfx-modpanel-toolbar{padding:1rem;border-top:1px solid rgba(255,255,255,.06);border-bottom:1px solid rgba(255,255,255,.06);display:flex;gap:.75rem;align-items:center;justify-content:space-between;flex-wrap:wrap}
.ugfx-modpanel-tabs{display:flex;gap:.5rem;flex-wrap:wrap}
.ugfx-modpanel-actions{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;min-width:min(420px,100%)}
.ugfx-modpanel-actions .form-control{min-width:min(320px,100%)}
.ugfx-modpanel-grid-wrap{padding:1rem;overflow:auto}
.ugfx-modpanel-list{display:grid;gap:.85rem}
.ugfx-modpanel-card{padding:1rem;border-radius:1rem;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08)}
.ugfx-modpanel-card.is-deleted{opacity:.74}
.ugfx-modpanel-headrow{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;flex-wrap:wrap}
.ugfx-modpanel-title{font-weight:800;color:#f5f7fb}
.ugfx-modpanel-room{font-weight:600;color:#8fb8ff;margin-left:.4rem}
.ugfx-modpanel-meta,.ugfx-modpanel-muted{font-size:.8rem;color:#9fa7b3}
.ugfx-modpanel-text{margin-top:.55rem;color:#e7edf9;white-space:pre-wrap;word-break:break-word}
.ugfx-modpanel-media{margin-top:.65rem}
.ugfx-modpanel-media img{max-width:220px;max-height:180px;border-radius:.8rem;border:1px solid rgba(255,255,255,.08)}
.ugfx-modpanel-buttons{display:flex;gap:.5rem;flex-wrap:wrap}
.ugfx-modpanel-tools{margin-top:.75rem}
.ugfx-modpanel-media-grid{display:grid;grid-template-columns:minmax(180px,220px) 1fr;gap:1rem;align-items:start;margin-top:.8rem}
.ugfx-modpanel-url{display:block;word-break:break-all;color:#cfd8ea;margin-top:.2rem}
@media (max-width:700px){.ugfx-modpanel-actions{min-width:100%}.ugfx-modpanel-actions .form-control{min-width:100%}.ugfx-modpanel-modal{width:calc(100vw - .8rem);max-height:90vh}.ugfx-modpanel-media-grid{grid-template-columns:1fr}}

/* Remaining chat layout selectors */
.ugfx-chat-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:1.2rem}
.ugfx-chat-messages{max-height:540px;overflow:auto;display:flex;flex-direction:column;gap:.9rem}
.ugfx-chat-admin-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1rem;align-items:start}
.ugfx-chat-admin-row audio{max-width:260px}
