:root {
  --bg: #060b16;
  --bg2: #0a1325;
  --panel: rgba(10,19,37,0.88);
  --panel2: rgba(13,25,48,0.70);
  --text: #eaf2ff;
  --muted: #7f8fa8;
  --line: rgba(148,163,184,0.12);
  --line2: rgba(99,102,241,0.25);
  --primary: #1e3a8a;
  --accent: #6366f1;
  --accent2: #38bdf8;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0,0,0,0.3);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: "Vazirmatn", system-ui, sans-serif; }
body {
  background:
    radial-gradient(800px 500px at 5% -5%, rgba(99,102,241,0.12), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(56,189,248,0.08), transparent 60%),
    linear-gradient(180deg, #060b16, #0a1325 62%, #060b16);
}
button, input, textarea { font: inherit; background: none; border: none; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
::selection { background: rgba(99,102,241,0.35); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.25); border-radius: 999px; }

.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}
.topbar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(6,11,22,0.78);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
}
.brandRow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brandLogo {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1e3a8a, #6366f1 55%, #38bdf8);
  font-weight: 900; color: #fff; font-size: 18px;
  box-shadow: 0 6px 24px rgba(99,102,241,0.3);
}
.brandTitle { font-size: 15px; font-weight: 900; }
.brandSub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.userGreeting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.userGreeting b { color: #fff; font-weight: 900; }
.userGreeting .rankBadge { font-size: 10px; }
.topActions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  flex-wrap: wrap;
}
.btn-sm, .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(13,25,48,0.7);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  transition: 0.2s;
}
.btn-sm:hover, .btn-icon:hover {
  transform: translateY(-1px);
  border-color: rgba(99,102,241,0.4);
  background: rgba(18,31,58,0.9);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.btn-icon { width: 38px; height: 38px; padding: 0; font-size: 17px; }
.btn-sm .label { display: inline; }
@media (max-width: 700px) {
  .btn-sm .label { display: none; }
  .brandSub { display: none; }
  .topbar { padding: 6px 10px; }
}
.announcement {
  margin-top: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(14,24,47,0.6), rgba(10,19,39,0.4));
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}
.announcementTrack {
  display: block;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  color: #cdd8ed;
  animation: marquee 20s linear infinite;
}
.announcementTrack:hover { animation-play-state: paused; }
@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.app::before{content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;background:radial-gradient(500px 260px at 50% 15%,rgba(99,102,241,.07),transparent 70%)}
.topbar{box-shadow:0 8px 30px rgba(0,0,0,.12)}
.btn-sm,.btn-icon,.emojiBtn,.sendBtn,.uBtn,.ghostBtn,.primaryBtn{transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,background .18s ease}
.btn-sm:active,.btn-icon:active,.emojiBtn:active,.sendBtn:active,.uBtn:active,.ghostBtn:active,.primaryBtn:active{transform:scale(.97)}
.chatHead{min-height:54px}
.messages{padding-bottom:18px}
.main{position:relative;display:grid;grid-template-rows:auto auto minmax(0,1fr);overflow:hidden}
.composer{position:absolute!important;left:0;right:0;bottom:0;grid-row:auto!important;min-height:76px;padding:9px 12px calc(9px + env(safe-area-inset-bottom));border-top:1px solid rgba(99,102,241,.18);background:linear-gradient(180deg,rgba(5,10,21,.78),rgba(5,11,23,.97));box-shadow:0 -14px 40px rgba(0,0,0,.18)}
.composerGlow{position:absolute;inset:0 0 auto 0;height:1px;background:linear-gradient(90deg,transparent,rgba(99,102,241,.65),rgba(56,189,248,.45),transparent);opacity:.7}
.composerBar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;min-height:16px}
.composerHint{font-size:9px;color:#71839d}.charCounter{font-size:9px;color:#7e91ae}.charCounter.warn{color:#f59e0b}.charCounter.danger{color:#ef4444}
.composerTools{display:flex;align-items:center;gap:5px}
.composerTool{width:30px;height:30px;border-radius:10px;border:1px solid var(--line);background:rgba(13,25,48,.72);display:inline-grid;place-items:center;color:#a8b7ce}
.composerTool:hover{border-color:rgba(99,102,241,.35);color:#fff;box-shadow:0 5px 18px rgba(0,0,0,.15)}
.messageInputWrap{position:relative}.messageInput{padding-left:52px;min-height:46px;border-radius:14px!important;background:linear-gradient(180deg,rgba(9,20,39,.92),rgba(7,16,31,.92));box-shadow:inset 0 1px 0 rgba(255,255,255,.02)}
.inputStatusDot{position:absolute;left:12px;bottom:11px;width:7px;height:7px;border-radius:50%;background:#22c55e;box-shadow:0 0 9px rgba(34,197,94,.55)}
.sendBtn{height:46px;border-radius:14px;min-width:92px;box-shadow:0 8px 22px rgba(99,102,241,.16)}
.bookmarkBtn.active{color:#fbbf24!important;border-color:rgba(251,191,36,.28)!important;background:rgba(120,85,8,.12)!important}
.reportBtn{color:#fca5a5!important}
.msg{position:relative;overflow:hidden}.msg:hover{border-color:rgba(99,102,241,.18);box-shadow:0 8px 28px rgba(0,0,0,.13)}
.msg::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(120deg,transparent 0%,rgba(255,255,255,.015) 45%,transparent 60%);opacity:0;transition:.25s}.msg:hover::after{opacity:1}
.msgQuick{display:flex;gap:5px;margin-top:7px;flex-wrap:wrap}.msgQuick button{font-size:10px;padding:4px 7px;border-radius:9px;border:1px solid var(--line);background:rgba(11,24,45,.56);color:#8194b0}.msgQuick button:hover{color:#fff;border-color:rgba(99,102,241,.3)}
.adminStatGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.adminStat{padding:9px;border:1px solid var(--line);border-radius:12px;background:rgba(5,12,25,.38);text-align:center}.adminStat b{display:block;font-size:15px}.adminStat span{font-size:8px;color:var(--muted)}
.quickSelect{height:34px;padding:0 8px;border-radius:9px;border:1px solid var(--line);background:#0a162b;color:#fff;font-size:10px}
.toggleRow{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:11px;background:rgba(4,10,21,.25);margin-top:6px}.toggleRow label{font-size:11px;color:#cad5e8}.switch{position:relative;width:42px;height:22px;display:inline-block}.switch input{display:none}.switch span{position:absolute;inset:0;border-radius:999px;background:#24324b;border:1px solid var(--line);transition:.2s}.switch span:after{content:"";position:absolute;width:16px;height:16px;top:2px;right:2px;border-radius:50%;background:#9aa9be;transition:.2s}.switch input:checked+span{background:rgba(99,102,241,.35);border-color:rgba(99,102,241,.45)}.switch input:checked+span:after{right:22px;background:#fff}
.bookmarkPaneHint{padding:10px;border-radius:11px;border:1px dashed rgba(99,102,241,.22);color:#7f90aa;font-size:10px;line-height:1.8}
@media (max-width:900px){.messages{padding-bottom:16px}.composer{padding:7px 8px calc(7px + env(safe-area-inset-bottom));}.sendRow{display:grid;grid-template-columns:1fr auto;gap:7px}.fileSide{grid-column:1/-1;justify-content:flex-start}.textSide{grid-column:1}.sendSide{grid-column:2;align-self:end}.sendBtn{width:50px;min-width:50px;height:46px;padding:0;font-size:0}.sendBtn i{font-size:18px}.messageInput{min-height:46px;max-height:120px;padding:9px 11px 9px 44px}.composerTool{width:32px;height:32px}.composerHint{max-width:70%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media (max-width:480px){.messages{padding:7px 7px 170px}.msg{padding:10px;border-radius:14px}.msgUser .authorName{max-width:62%}.msgText{font-size:12px;line-height:1.75;padding:9px}.composer{padding:6px 6px calc(6px + env(safe-area-inset-bottom));border-radius:0}.composerBar{margin-bottom:4px}.composerHint{font-size:8px}.charCounter{font-size:8px}.fileSide{gap:4px}.composerTool{width:30px;height:30px;border-radius:9px}.emojiPicker{left:0;right:auto;bottom:70px;max-width:calc(100vw - 20px)}.replyPreview{margin-bottom:5px}.selectedFileName{font-size:8px}}
body.compact .msg{margin-bottom:5px;padding:8px 10px}.compact .msgText{margin-top:5px;padding:6px 8px}.compact .msgMeta{margin-top:5px}.compact .reactionsRow{margin-top:5px}

.main {
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr) auto;
  min-width: 0;
  min-height: 0;
  background: rgba(5,9,19,0.25);
  height: 100%;
  position: relative;
}
.side {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7,12,24,0.9), rgba(8,16,31,0.8));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chatHead {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,15,29,0.4);
  flex-shrink: 0;
}
.chatMeta { display: flex; align-items: center; gap: 10px; }
.chatLive {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px rgba(34,197,94,0.6);
}
.connectionStatus { display:inline-flex; align-items:center; gap:5px; margin-right:8px; padding:4px 8px; border-radius:999px; font-size:9px; color:#a8b6cf; background:rgba(34,197,94,.08); border:1px solid rgba(34,197,94,.12); }
.connectionStatus i { color:var(--success); }
.connectionStatus.offline { background:rgba(239,68,68,.08); border-color:rgba(239,68,68,.14); }
.connectionStatus.offline i { color:#ef4444; }
.newMessagesBtn { position:absolute; left:50%; bottom:88px; transform:translateX(-50%) translateY(10px); opacity:0; pointer-events:none; z-index:40; padding:8px 14px; border-radius:999px; border:1px solid rgba(99,102,241,.25); background:linear-gradient(135deg,rgba(30,58,138,.96),rgba(99,102,241,.96)); color:#fff; box-shadow:0 10px 30px rgba(0,0,0,.3); font-size:10px; font-weight:900; transition:.2s; }
.newMessagesBtn.show { opacity:1; pointer-events:auto; transform:translateX(-50%) translateY(0); }

.chatTitle { font-weight: 900; font-size: 13px; }
.chatSubtitle { font-size: 10px; color: var(--muted); }
.chatSearch {
  display: flex;
  gap: 6px;
  align-items: center;
}
.chatSearch input {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10,20,40,0.6);
  color: var(--text);
  outline: none;
  font-size: 11px;
  width: 120px;
}
.chatSearch input:focus { border-color: rgba(99,102,241,0.4); }

.pinnedBar {
  margin: 8px 12px 0;
  padding: 7px 12px;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(49,46,129,0.15), rgba(14,25,50,0.3));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pinnedInfo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pinnedInfo i { color: #818cf8; }
.pinnedText { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#unpinBtn { font-size: 10px; padding: 4px 10px; border-radius: var(--radius-sm); }

.messages {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 14px;
  scroll-behavior: smooth;
  min-height: 0;
  max-height: 100%;
  overscroll-behavior: contain;
  position: relative;
  background-size: cover !important;
  background-position: center !important;
  background-attachment: scroll !important;
}

.messages.has-theme::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 21, 0.75);
  z-index: 0;
  pointer-events: none;
}

.messages.has-theme > * {
  position: relative;
  z-index: 1;
}

.msg {
  position: relative;
  z-index: 1;
  contain: layout style paint;
  content-visibility: auto;
  contain-intrinsic-size: 0 110px;
  margin-bottom: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(12,23,43,0.85), rgba(9,18,34,0.7));
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  animation: fadeInUp 0.25s ease;
}

.msg.themed-msg {
  background-image: var(--msg-bg);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.msg.themed-msg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 21, 0.78);
  border-radius: inherit;
  z-index: 0;
}

.msg.themed-msg > * {
  position: relative;
  z-index: 1;
}
.emptyState {
  height: 100%;
  display: grid;
  place-items: center;
  color: #6e7e97;
}
.emptyIcon {
  width: 60px; height: 60px; border-radius: var(--radius);
  display: grid; place-items: center;
  background: rgba(99,102,241,0.12);
  border: 1px solid var(--line);
  font-size: 26px;
  margin: 0 auto 10px;
}
.emptyState h3 { font-size: 14px; color: #dce7f8; margin-bottom: 4px; }
.emptyState p { font-size: 11px; line-height: 1.8; }

.msg {
  max-width: 900px;
  margin: 0 auto 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(12,23,43,0.85), rgba(9,18,34,0.7));
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  animation: fadeInUp 0.25s ease;
}

.msg.themed-msg {
  background-image: var(--msg-bg);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
}
.msg.themed-msg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 21, 0.75);
  border-radius: inherit;
  z-index: -1;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.msgUser {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-weight: 900;
  font-size: 12px;
}
.msgUser .authorName { display: inline-flex; align-items: center; gap: 4px; max-width: 70%; overflow-wrap: anywhere; }
.msgText {
  margin-top: 8px;
  padding: 8px 10px;
  border-right: 2px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-sm);
  background: rgba(5,11,23,0.2);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}
.msgMeta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: #7687a0;
  font-size: 10px;
}

.msgMeta .metaBtn {
  font-size: 0;
  padding: 4px 6px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msgMeta .metaBtn i {
  font-size: 15px;
  line-height: 1;
}

.msgMeta .bookmarkBtn i {
  font-size: 17px;
}

.msgMeta .metaBtn:hover {
  background: rgba(99,102,241,0.08);
  color: #d9e5f8;
  border-color: rgba(99,102,241,0.12);
}
.deleteBtn { color: #fca5a5 !important; }
.pinBtn { color: #c7d2fe !important; }
.editBtn { color: #93c5fd !important; }
.msgReply {
  margin-bottom: 6px;
  padding: 6px 10px;
  border-right: 3px solid #6366f1;
  background: rgba(99,102,241,0.06);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: #b7c5db;
}
.reactionsRow, .reactMenu {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.reactionItem, .reactBtn {
  border: 1px solid var(--line);
  background: rgba(15,29,53,0.7);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
}
.reactionItem.mine { background: rgba(49,46,129,0.5); border-color: rgba(99,102,241,0.4); }
.fileBox {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(6,13,26,0.4);
}
.fileBox img { max-width: 100%; max-height: 400px; border-radius: var(--radius-sm); display: block; }
.fileLink { color: #9ecbff; font-size: 12px; }
.pollBox {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius-sm);
  background: rgba(24,28,74,0.15);
}
.pollTitle { font-weight: 900; font-size: 12px; }
.pollOption {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(148,163,184,0.1);
  background: rgba(14,27,50,0.7);
  border-radius: var(--radius-sm);
  text-align: right;
  font-size: 11px;
}
.pollOption:hover { border-color: rgba(99,102,241,0.3); }
.pollOption.mine { border-color: rgba(99,102,241,0.5); background: rgba(49,46,129,0.25); }
.pollMeta { margin-top: 6px; color: #7f90a9; font-size: 10px; }

.neonAdminName {
  background: linear-gradient(90deg, #38bdf8, #a78bfa, #38bdf8);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  animation: gradientMove 3s linear infinite;
}
@keyframes gradientMove {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.neonAdminText { text-shadow: 0 0 10px rgba(99,102,241,0.1); }
.systemMsg { margin-left:0 !important; margin-right:auto !important; border-color:rgba(239,68,68,.24); background:linear-gradient(180deg,rgba(40,12,24,.34),rgba(9,18,34,.72)); }
.systemMsg .botBadge { color:#fecaca; border-color:rgba(239,68,68,.26); background:rgba(127,29,29,.18); }
.systemMsg .systemText { border-right-color:rgba(239,68,68,.42); }
.botAvatar{font-size:22px;background:linear-gradient(135deg,#301321,#243d69)!important}.systemName { color:#ff5a5f; font-weight:900; text-shadow:0 0 12px rgba(239,68,68,.16); }

.edited-badge { color: #a0b0cc; font-size: 9px; margin-right: 6px; }

.composer {
  grid-row: 4;
  position: relative;
  z-index: 30;
  min-height: 68px;
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(6,13,26,0.75), rgba(7,15,29,0.9));
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.replyPreview {
  display: none;
  margin-bottom: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-sm);
  background: rgba(49,46,129,0.08);
}
.replyPreview.show { display: block; }
.replyPreviewTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.replyClose {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(99,102,241,0.15);
  color: #fff;
}
.sendRow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: end;
}
.messageInput {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10,22,42,0.8);
  color: #fff;
  outline: none;
  line-height: 1.5;
}
.messageInput:focus { border-color: rgba(99,102,241,0.4); box-shadow: 0 0 0 3px rgba(99,102,241,0.08); }
.selectedFileName { margin-top: 4px; color: #7788a2; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sendBtn {
  min-width: 80px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1e3a8a, #6366f1 65%, #38bdf8);
  border: 1px solid rgba(129,140,248,0.3);
  font-weight: 900;
}
.sendBtn:hover { transform: scale(1.02); box-shadow: 0 6px 24px rgba(99,102,241,0.25); }
.sendBtn:disabled { opacity: 0.5; cursor: not-allowed; }
.fileSide { display: flex; gap: 6px; align-items: center; }
.emojiBtn { font-size: 20px; padding: 6px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(13,25,48,0.7); }
.emojiPicker {
  display: none;
  position: absolute;
  bottom: 60px;
  left: 0;
  background: rgba(10,20,40,0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  max-width: 260px;
  max-height: 200px;
  overflow-y: auto;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  z-index: 50;
}
.emojiPicker.show { display: grid; }
.emojiPicker button {
  font-size: 20px;
  padding: 4px;
  border-radius: 6px;
  background: transparent;
  transition: 0.1s;
}
.emojiPicker button:hover { background: rgba(99,102,241,0.2); }

.utilityBar {
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.searchBox { position: relative; flex: 1; }
.searchBox i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #7f91ad; }
.searchInput {
  width: 100%;
  height: 36px;
  padding: 0 36px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10,20,40,0.6);
  color: var(--text);
  outline: none;
}
.searchInput:focus { border-color: rgba(99,102,241,0.4); }
.usersHeader {
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.usersHeader h3 { font-size: 13px; margin: 0; }
.usersCount { font-size: 10px; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; }
.usersList {
  padding: 4px 10px 12px;
  overflow: auto;
  flex: 1;
}
.userBox {
  padding: 8px 10px;
  margin: 4px 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(13,25,48,0.3);
  transition: 0.15s;
  position: relative;
}
.userBox:hover {
  transform: translateY(-1px);
  border-color: rgba(99,102,241,0.15);
  background: rgba(17,32,60,0.5);
}

.userBox.themed-user-card {
  background-image: url('var(--user-bg)');
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.userBox.themed-user-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 21, 0.8);
  border-radius: inherit;
  z-index: -1;
}
.userTop {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.userName {
  font-weight: 900;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.userSub { font-size: 10px; color: var(--muted); margin-top: 4px; }
.uActions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.uBtn {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(19,32,56,0.6);
  font-size: 9px;
}
.uBtn:hover { border-color: rgba(99,102,241,0.4); }
.rankSelect {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0b172c;
  color: #fff;
  font-size: 9px;
}
.avatarCircle, .userMiniAvatar {
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #21345a, #475b7f);
  font-weight: 900;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}
.avatarCircle { width: 34px; height: 34px; font-size: 13px; }
.userMiniAvatar { width: 28px; height: 28px; font-size: 11px; }
.avatarCircle img, .userMiniAvatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge, .rankBadge, .badgeBan {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}
.badge { background: rgba(30,58,138,0.3); color: #c8ddff; border: 1px solid rgba(59,130,246,0.12); }
.rankBadge { background: rgba(99,102,241,0.08); color: #bfc6ff; border: 1px solid rgba(99,102,241,0.12); }
.badgeBan { background: rgba(127,29,29,0.2); color: #fecaca; border: 1px solid rgba(239,68,68,0.08); }
.statusDot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.statusOnline { background: var(--success); box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.statusOffline { background: #64748b; }
.verifiedBadge {
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d9bf0, #38bdf8);
  color: #fff;
  font-size: 10px;
}
.verifyIcon { width: 15px; height: 15px; object-fit: contain; }

.drawerShade {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 90;
}
.drawerShade.show { display: block; }
.drawer {
  position: fixed;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: min(480px, calc(100vw - 20px));
  z-index: 100;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(10,18,37,0.96), rgba(7,14,28,0.96));
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
  transform: translateX(30px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer.show { transform: translateX(0); opacity: 1; pointer-events: auto; }
.drawerHeader {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawerHeader h3 { font-size: 14px; margin: 0; }
.drawerBody { overflow: auto; padding: 12px; }
.tabBar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(4,10,21,0.4);
  margin-bottom: 10px;
}
.tabBtn {
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: #788aa4;
  font-weight: 800;
  font-size: 11px;
}
.tabBtn.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(56,189,248,0.06));
  color: #edf3ff;
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.1);
}
.tabPane { display: none; }
.tabPane.active { display: block; animation: fadeIn 0.2s ease; }
.sectionCard {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(14,26,49,0.4);
  margin-bottom: 8px;
}
.sectionTitle { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sectionTitle strong { font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fieldLabel { font-size: 10px; color: #8ea0b8; display: block; margin-bottom: 4px; }
.colorRow { display: grid; grid-template-columns: 50px 1fr; gap: 6px; align-items: center; }
.colorPicker { width: 50px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #091324; }
.textInput, .textareaInput {
  width: 100%;
  border: 1px solid var(--line);
  background: #091427;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  outline: none;
}
.textInput { height: 36px; }
.textareaInput { min-height: 80px; padding: 8px; resize: vertical; }
.textInput:focus, .textareaInput:focus { border-color: rgba(99,102,241,0.4); }
.actionRow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.primaryBtn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99,102,241,0.25);
  background: linear-gradient(135deg, rgba(30,58,138,0.8), rgba(99,102,241,0.8));
  font-weight: 800;
  font-size: 11px;
  color: #fff;
}
.ghostBtn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(14,27,50,0.6);
  color: #dce7f8;
  font-size: 11px;
}
.dangerBtn { border-color: rgba(239,68,68,0.2); background: rgba(127,29,29,0.15); color: #fecaca; }
.profileHero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(99,102,241,0.12);
  border-radius: var(--radius-sm);
  background: rgba(99,102,241,0.04);
}
.profilePreview {
  width: 70px; height: 70px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1f3153, #312e81);
  border: 1px solid rgba(129,140,248,0.2);
  font-size: 22px;
  font-weight: 900;
  overflow: hidden;
}
.profilePreview img { width: 100%; height: 100%; object-fit: cover; }
.profileInfo strong { display: block; font-size: 13px; }
.profileInfo small { font-size: 10px; color: var(--muted); line-height: 1.6; }
.uploadPick {
  display: inline-flex;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99,102,241,0.2);
  background: rgba(99,102,241,0.08);
  font-size: 11px;
  font-weight: 800;
}
.fileHint { font-size: 10px; color: #72839d; margin-top: 4px; }
.ownerLock {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56,189,248,0.15);
  background: linear-gradient(135deg, rgba(56,189,248,0.05), rgba(99,102,241,0.05));
}
.ownerLock i { font-size: 20px; color: #38bdf8; }
.ownerLock strong { font-size: 12px; }
.ownerLock small { display: block; color: var(--muted); font-size: 10px; }
.adminGrid { display: grid; gap: 6px; }
.adminItem { display: grid; gap: 4px; }
.profileUserCard {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(11,22,41,0.4);
}
.profileIdentity { display: flex; align-items: center; gap: 10px; }
.largeAvatar {
  width: 56px; height: 56px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: linear-gradient(135deg, #203459, #4a5f86);
  font-size: 20px;
  font-weight: 900;
  overflow: hidden;
}
.largeAvatar img { width: 100%; height: 100%; object-fit: cover; }
.statsGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.stat {
  padding: 6px;
  border-radius: var(--radius-sm);
  background: rgba(4,10,21,0.3);
  border: 1px solid var(--line);
  text-align: center;
}
.stat b { display: block; font-size: 12px; }
.stat small { font-size: 9px; color: var(--muted); }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  place-items: center;
  padding: 16px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
}
.modal.show { display: grid; }
.modalCard {
  width: min(480px, 100%);
  max-height: 80dvh;
  overflow: auto;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0b1830, #081223);
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
  padding: 14px;
}
.modalTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.modalTop h3 { font-size: 14px; margin: 0; }
.profilePanel { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(10,19,36,0.4); }

.loginWrap {
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.loginCard {
  width: min(400px, 100%);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius);
  padding: 20px;
  background: linear-gradient(180deg, rgba(12,22,43,0.9), rgba(8,16,31,0.95));
  box-shadow: 0 20px 80px rgba(0,0,0,0.4);
}
.loginLogo {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1e3a8a, #6366f1 55%, #38bdf8);
  font-size: 20px;
  margin-bottom: 12px;
}
.loginCard h1 { font-size: 20px; margin: 0 0 4px; }
.loginCard p { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.form { display: grid; gap: 10px; }
.inputWrap { position: relative; }
.inputWrap i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #7286a2; }
.loginInput {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #091427;
  color: #fff;
  padding: 0 38px 0 12px;
  outline: none;
}
.loginInput:focus { border-color: rgba(99,102,241,0.4); }
.passToggle {
  position: absolute;
  left: 6px;
  top: 6px;
  height: 32px;
  width: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #8495ad;
}
.loginBtn {
  height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1e3a8a, #6366f1 60%, #38bdf8);
  font-weight: 900;
  color: #fff;
}
.checkLine {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #90a2bb;
  font-size: 11px;
}
.checkLine label { display: flex; gap: 6px; align-items: center; }
.formError { display: none; color: #fca5a5; font-size: 11px; }
.loginFoot { text-align: center; color: #62728a; font-size: 10px; margin-top: 12px; }
.loginFoot a { color: #aebdf3; }

.toastWrap {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 999;
  display: grid;
  gap: 6px;
}
.toast {
  min-width: 200px;
  max-width: 320px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8,17,32,0.9);
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: slideUp 0.2s ease;
}
.toast i { font-size: 16px; color: #9eb7ff; }
.toast.danger i { color: #fca5a5; }
.toast strong { font-size: 11px; }
.toast small { display: block; color: #7c8ea7; font-size: 9px; margin-top: 2px; }
@keyframes slideUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 80vw);
    z-index: 80;
    transform: translateX(105%);
    transition: 0.2s ease;
    border-left: 1px solid var(--line);
    border-right: 0;
  }
  .side.open { transform: translateX(0); }
  .main { height: 100%; min-height: 0; }
  .newMessagesBtn { bottom: 104px; }
  .connectionStatus span { display:none; }
  .connectionStatus { width:24px; height:24px; justify-content:center; padding:0; margin-right:4px; }
  .topbar { padding: 6px 10px; }
  .brandLogo { width: 32px; height: 32px; font-size: 15px; }
  .brandTitle { font-size: 13px; }
  .brandSub { display: none; }
  .userGreeting { font-size: 12px; }
  .btn-sm .label { display: none; }
  .btn-sm { padding: 6px 8px; }
  .btn-icon { width: 32px; height: 32px; font-size: 14px; }
  .announcement { padding: 5px 8px; }
  .announcementTrack { font-size: 10px; }
  .chatHead { padding: 6px 10px; }
  .messages { padding: 8px 10px; }
  .msg { padding: 8px 10px; }
  .composer { padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); min-height: 72px; }
  .sendRow { grid-template-columns: auto 1fr; }
  .sendSide { grid-column: 1 / -1; }
  .sendBtn { width: 100%; }
  .messageInput { min-height: 38px; padding: 6px 10px; }
  .btn-icon { height: 36px; }
  .chatSearch input { width: 80px; }
}
@media (max-width: 480px) {
  .grid2 { grid-template-columns: 1fr; }
  .tabBtn { font-size: 10px; }
  .drawer { width: calc(100vw - 12px); right: 6px; top: 6px; bottom: 6px; border-radius: var(--radius-sm); }
  .modalCard { border-radius: var(--radius-sm); }
  .loginCard { padding: 16px; }
  .stat b { font-size: 11px; }
}

.userBox {
  position: relative;
  padding: 8px 10px;
  margin: 4px 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(13,25,48,0.3);
  transition: 0.15s;
  overflow: hidden;
}

.userBox:hover {
  transform: translateY(-1px);
  border-color: rgba(99,102,241,0.15);
  background: rgba(17,32,60,0.5);
}

.userBox.themed-user-card {
  background-image: var(--user-bg);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.userBox.themed-user-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 21, 0.78);
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
}

.userBox.themed-user-card > * {
  position: relative;
  z-index: 1;
}

.topbar .verifiedBadge{margin-inline:2px}.verifiedBadge{flex:0 0 auto}.ownerLock{box-shadow:inset 0 0 26px rgba(56,189,248,.035),0 10px 30px rgba(30,58,138,.08)}
.profileHero,.sectionCard,.userBox,.msg{box-shadow:inset 0 1px 0 rgba(255,255,255,.018),0 10px 30px rgba(0,0,0,.06)}

.securityPill{font-size:9px;padding:4px 8px;border-radius:999px;color:#a7f3d0;background:rgba(34,197,94,.08);border:1px solid rgba(34,197,94,.16)}
.securityBox{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 11px;margin-bottom:9px;border:1px solid rgba(56,189,248,.13);border-radius:12px;background:linear-gradient(135deg,rgba(56,189,248,.06),rgba(99,102,241,.04))}
.securityBox b{display:block;font-size:11px}.securityBox small{display:block;color:#7f90a8;font-size:9px;margin-top:3px;line-height:1.7}.securityBox i{font-size:21px;color:#60a5fa}
.accountGrid .textInput{height:40px}.userName .verifiedBadge,.msgUser .verifiedBadge{display:inline-grid;place-items:center;width:15px;height:15px;border-radius:50%;font-size:9px;font-weight:900;color:#fff;background:linear-gradient(135deg,#2563eb,#38bdf8);box-shadow:0 0 10px rgba(56,189,248,.32);vertical-align:middle}
.systemName{color:#ff4d4d!important;font-weight:900;text-shadow:0 0 8px rgba(255,77,77,.13)}
body.largeText .msgText{font-size:14px!important;line-height:2!important}body.largeText .userName{font-size:13px!important}
body.noMotion *{animation:none!important;transition:none!important;scroll-behavior:auto!important}
.securityBox + .accountGrid{margin-top:2px}
@media(max-width:600px){.accountGrid{grid-template-columns:1fr!important}.securityBox{padding:9px}.securityBox small{font-size:8px}.securityBox i{font-size:19px}.settingsDrawer{width:calc(100vw - 10px)!important;right:5px!important;top:5px!important;bottom:5px!important}}

:root{
  --composer-h: 86px;
  --focus-ring: rgba(99,102,241,.28);
}
.main{grid-template-rows:auto auto minmax(0,1fr) auto!important;min-height:0;overflow:hidden!important}
.messages{min-height:0!important;overflow-y:auto!important;padding:10px 14px!important;scroll-behavior:smooth}
.composer{
  grid-row:4!important;position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;
  min-height:var(--composer-h)!important;height:auto!important;padding:7px 12px!important;
  border-top:1px solid rgba(99,102,241,.22);border-radius:0!important;
  background:linear-gradient(180deg,rgba(5,10,21,.86),rgba(7,14,29,.98));
  box-shadow:0 -10px 34px rgba(0,0,0,.2);backdrop-filter:blur(18px);overflow:visible!important;
}
.composerBar{margin:0 0 5px!important;min-height:13px!important}
.composerHint{font-size:9px!important}
.sendRow{display:flex!important;align-items:flex-end!important;gap:7px!important;width:100%}
.fileSide{display:flex!important;align-items:center!important;gap:5px!important;flex:0 0 auto!important}
.textSide{flex:1 1 auto!important;min-width:0!important}
.sendSide{flex:0 0 auto!important}
.messageInputWrap{min-width:0!important;flex:1 1 auto!important;width:auto!important}
.messageInput{
  box-sizing:border-box!important;width:100%!important;min-height:42px!important;height:42px!important;
  max-height:84px!important;padding:9px 12px!important;line-height:1.5!important;
  border-radius:13px!important;overflow-y:auto!important;min-width:0!important;
  transition:border-color .18s,box-shadow .18s,height .12s!important;
}
.messageInput:focus{border-color:rgba(99,102,241,.55)!important;box-shadow:0 0 0 3px var(--focus-ring),0 8px 24px rgba(0,0,0,.08)!important}
.inputStatusDot{left:8px!important;bottom:10px!important;width:6px!important;height:6px!important}
.selectedFileName{position:absolute!important;left:14px!important;bottom:-15px!important;margin:0!important;max-width:60%!important;z-index:2!important}
.sendBtn{height:42px!important;min-width:86px!important;border-radius:13px!important}
.composerTool{width:32px!important;height:32px!important;border-radius:10px!important}
.replyPreview{
  position:relative!important;margin:0 0 5px!important;padding:6px 10px 7px 12px!important;
  border:1px solid rgba(99,102,241,.22)!important;border-right:3px solid #6366f1!important;
  border-radius:10px!important;background:linear-gradient(90deg,rgba(49,46,129,.10),rgba(9,18,36,.65))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02)!important;
}
.replyPreviewTop{gap:8px!important}.replyPreviewTop small{font-size:9px!important;color:#9cacbf}
.replyPreviewTop{min-width:0;}
.replyPreviewTop small{flex:1 1 auto;overflow:hidden;}
.replyPreviewTop small b,.replyPreviewTop small span{overflow-wrap:anywhere;word-break:break-word;}

.replyPreviewTop small b{color:#aebcff}.replyClose{font-size:9px!important;padding:3px 7px!important;border:1px solid rgba(99,102,241,.18)!important}
#replyText{font-size:10px!important;line-height:1.6!important;display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:#c5d0e2!important}

.msg{border-radius:16px!important;padding:10px 12px!important}
.msgReply{margin:6px 0 8px!important;padding:7px 9px!important;border-right:3px solid rgba(99,102,241,.65)!important;border-left:0!important;border-radius:10px!important;background:rgba(39,48,91,.16)!important}
.msgReply b{color:#9db3ff!important;display:block!important;min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important;word-break:break-word!important;white-space:normal!important}
.msgReply div{color:#aebbd1!important;font-size:10px!important;min-width:0!important;max-width:100%!important;white-space:pre-wrap!important;overflow-wrap:anywhere!important;word-break:break-word!important;overflow:hidden!important}
.msgText{line-height:1.85!important;word-break:break-word!important;overflow-wrap:anywhere!important;max-width:100%!important}
.systemMsg .msgText{border-right:2px solid rgba(239,68,68,.42)!important;padding-right:8px!important}

.msgMeta{display:flex!important;align-items:center!important;gap:4px!important;flex-wrap:wrap!important}
.metaBtn{border-radius:8px!important;padding:3px 7px!important;transition:.15s!important}
.metaBtn:hover{transform:translateY(-1px);background:rgba(99,102,241,.10)!important}

body.focusMode .side,body.focusMode .topActions{display:none!important}
body.focusMode .shell{grid-template-columns:1fr!important}
body.focusMode .chatSearch{display:flex!important}
body.focusMode .main{width:100%!important}

.featureDock{position:absolute;left:10px;bottom:calc(var(--composer-h) + 10px);display:flex;gap:5px;align-items:center;flex-wrap:wrap;margin-top:6px;z-index:45}
.featureChip{border:1px solid var(--line);background:rgba(11,24,45,.66);color:#8fa2bd;border-radius:999px;padding:4px 8px;font-size:9px;cursor:pointer}
.featureChip:hover{color:#fff;border-color:rgba(99,102,241,.38);background:rgba(24,36,68,.86)}
.featureChip.active{color:#fff;border-color:rgba(99,102,241,.5);background:rgba(99,102,241,.12);box-shadow:0 0 18px rgba(99,102,241,.08)}
.mentionHint{position:absolute;z-index:80;right:0;bottom:48px;width:min(260px,calc(100vw - 30px));background:rgba(6,13,26,.98);border:1px solid var(--line);border-radius:12px;padding:5px;box-shadow:0 18px 40px rgba(0,0,0,.35);display:none}
.mentionHint.show{display:block}.mentionItem{padding:7px 9px;border-radius:8px;cursor:pointer;color:#dbe6f6;font-size:10px}.mentionItem:hover{background:rgba(99,102,241,.12)}
.scrollLock{position:absolute;left:14px;bottom:12px;z-index:25}

@media (max-width:900px){
  .messages{padding:8px 9px!important}
  .composer{padding:6px 8px calc(6px + env(safe-area-inset-bottom))!important;min-height:72px!important}
  .composerBar{margin-bottom:4px!important}
  .sendRow{display:flex!important;gap:5px!important;align-items:center!important}
  .fileSide{order:1;flex:0 0 auto!important;gap:3px!important}
  .textSide{order:2;flex:1 1 auto!important}
  .sendSide{order:3;flex:0 0 auto!important}
  .composerTool{width:30px!important;height:30px!important;border-radius:9px!important}
  .messageInput{height:40px!important;min-height:40px!important;max-height:72px!important;padding:8px 9px!important;font-size:12px!important;border-radius:12px!important}
  .sendBtn{width:42px!important;min-width:42px!important;height:40px!important;padding:0!important;font-size:0!important;border-radius:12px!important}
  .sendBtn i{font-size:17px!important;transform:rotate(180deg);display:block;line-height:1;flex:0 0 auto}
  .inputStatusDot{display:none!important}
  .selectedFileName{left:3px!important;bottom:-14px!important;max-width:48%!important;font-size:8px!important}
  .replyPreview{padding:5px 8px 6px 10px!important;margin-bottom:4px!important}
  #replyText{font-size:9px!important}
  .featureDock{bottom:calc(72px + env(safe-area-inset-bottom) + 10px)}
}
@media (max-width:480px){
  .topbar{padding:5px 7px!important}.brandLogo{width:30px;height:30px;border-radius:10px}.brandTitle{font-size:12px!important}
  .chatHead{padding:5px 7px!important}.chatSearch input{width:105px!important}
  .composer{padding:5px 6px calc(5px + env(safe-area-inset-bottom))!important;min-height:68px!important}
  .composerHint{font-size:8px!important}.charCounter{font-size:8px!important}
  .composerTool{width:28px!important;height:28px!important}.fileSide{gap:2px!important}
  .messageInput{height:38px!important;min-height:38px!important;font-size:12px!important;padding:7px 8px!important}
  .sendBtn{height:38px!important;width:40px!important;min-width:40px!important}
  .msg{padding:9px!important;border-radius:13px!important}.msgText{font-size:12px!important}
  .featureDock{bottom:calc(68px + env(safe-area-inset-bottom) + 10px);gap:3px}
  .featureChip{font-size:8px;padding:3px 6px}
}
@media (max-width:360px){.composerHint{display:none!important}.fileSide #clearDraftBtn{display:none!important}.chatSearch input{width:82px!important}}

.ownerLock{position:relative;overflow:hidden}.ownerSeal{margin-right:auto;padding:5px 8px;border-radius:999px;font-size:8px;font-weight:900;color:#93c5fd;border:1px solid rgba(56,189,248,.22);background:rgba(56,189,248,.07)}
.ownerActions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:10px}.ownerActions button{min-height:38px}
.verifiedBadge{display:inline-grid;place-items:center;width:17px;height:17px;border-radius:50%;font-size:10px;font-weight:1000;color:#fff;background:linear-gradient(135deg,#2997ff,#6366f1);box-shadow:0 0 0 2px rgba(41,151,255,.12),0 0 14px rgba(41,151,255,.24);font-style:normal}
.msg{transition:transform .22s ease,opacity .22s ease,max-height .22s ease,margin .22s ease,padding .22s ease}.msg.deleting{opacity:0;transform:translateX(28px) scale(.985);max-height:0!important;margin-bottom:0!important;padding-top:0!important;padding-bottom:0!important;overflow:hidden}
.mediaPreview{position:relative;display:block;overflow:hidden;border-radius:12px;background:#050b16}.mediaPreview img,.mediaPreview video{display:block;width:100%;max-height:420px;object-fit:contain;background:#050b16}.mediaPreview .playBadge{position:absolute;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:rgba(6,11,22,.72);border:1px solid rgba(255,255,255,.12);font-size:20px;color:#fff;backdrop-filter:blur(8px)}
.mediaActions{display:flex;gap:6px;align-items:center;justify-content:flex-end;margin-top:6px}.mediaOpenBtn,.mediaDownloadBtn{padding:5px 9px;border-radius:9px;border:1px solid var(--line);background:rgba(13,25,48,.72);font-size:10px;color:#b7c8e0}.mediaOpenBtn:hover,.mediaDownloadBtn:hover{border-color:rgba(99,102,241,.35);color:#fff}.audioPlayer{width:100%;height:42px;filter:none}.fileMeta{display:flex;align-items:center;gap:8px}.fileIcon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:rgba(99,102,241,.1);color:#9eb8ff;font-size:17px}.fileInfo{min-width:0}.fileInfo strong{display:block;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.fileInfo small{display:block;color:#71839d;font-size:9px;margin-top:2px}.mediaViewer{position:fixed;inset:0;z-index:1000;display:none}.mediaViewer.show{display:block;animation:viewerIn .18s ease}.mediaViewerShade{position:absolute;inset:0;background:rgba(1,5,12,.82);backdrop-filter:blur(10px)}.mediaViewerCard{position:absolute;inset:5vh 5vw;display:grid;grid-template-rows:auto 1fr;border:1px solid rgba(99,102,241,.2);border-radius:20px;background:linear-gradient(180deg,rgba(10,18,35,.98),rgba(6,12,24,.98));box-shadow:0 30px 80px rgba(0,0,0,.55);overflow:hidden}.mediaViewerTop{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid var(--line)}.mediaViewerTop>div:first-child{font-size:11px;font-weight:900;color:#dbe7fa;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mediaViewerActions{display:flex;gap:6px;align-items:center}.mediaViewerBody{display:grid;place-items:center;padding:18px;overflow:auto}.mediaViewerBody img,.mediaViewerBody video{max-width:100%;max-height:calc(90vh - 95px);border-radius:14px;object-fit:contain;box-shadow:0 20px 50px rgba(0,0,0,.35)}.mediaViewerBody audio{width:min(720px,100%)}@keyframes viewerIn{from{opacity:0}to{opacity:1}}@keyframes reactionPop{0%{transform:scale(1)}45%{transform:scale(1.012)}100%{transform:scale(1)}}
.reactionPop{animation:reactionPop .26s ease}.systemMsg .systemText .systemName{font-weight:1000;color:#ff4d55;text-shadow:0 0 12px rgba(239,68,68,.18)}
@media(max-width:600px){.ownerActions{grid-template-columns:1fr}.ownerSeal{display:none}.mediaViewerCard{inset:10px;border-radius:16px}.mediaViewerBody{padding:10px}.mediaViewerTop{padding:8px}.mediaViewerTop .label{display:none}}

@font-face { font-family: 'Chaerili'; src: url('/fonts/chaerili.ttf') format('truetype'); }
@font-face { font-family: 'Goliath'; src: url('/fonts/goliath.otf') format('opentype'); }
@font-face { font-family: 'Harlow'; src: url('/fonts/harlow.ttf') format('truetype'); }
@font-face { font-family: 'Klondike'; src: url('/fonts/klondike.ttf') format('truetype'); }
@font-face { font-family: 'LetterOMatic'; src: url('/fonts/letteromatic.ttf') format('truetype'); }

.font-chaerili { font-family: 'Chaerili', sans-serif !important; }
.font-goliath { font-family: 'Goliath', serif !important; }
.font-harlow { font-family: 'Harlow', cursive !important; }
.font-klondike { font-family: 'Klondike', fantasy !important; }
.font-letteromatic { font-family: 'LetterOMatic', monospace !important; }
.font-goliath_text { font-family: 'Goliath', serif !important; }
.font-harlow_text { font-family: 'Harlow', cursive !important; }
.font-klondike_text { font-family: 'Klondike', fantasy !important; }
.font-letteromatic_text { font-family: 'LetterOMatic', monospace !important; }

.themeShopGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.themeCard { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: linear-gradient(180deg, rgba(13,25,48,0.5), rgba(8,16,30,0.8)); position: relative; overflow: hidden; }
.themeCard::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(99,102,241,0.4), transparent); }
.themeCard img { width: 100%; height: auto; border-radius: 8px; margin-bottom: 8px; object-fit: cover; border: 1px solid rgba(255,255,255,0.05); }
.themeCard span { display: block; font-size: 11px; font-weight: 900; margin-bottom: 4px; color: #e2e8f0; }
.shopPreviewBox { padding: 8px; border-radius: 8px; background: #020a18; margin-bottom: 6px; border: 1px dashed rgba(99,102,241,0.3); color: #f8fafc; text-align: center; }
.themeCard button { width: 100%; margin-top: 4px; padding: 6px 0 !important; font-weight: 900; border-radius: 8px !important; }
.themeCard .primaryBtn { background: linear-gradient(135deg, #1e3a8a, #6366f1 70%, #38bdf8); }
.themeCard .ghostBtn { background: rgba(14,27,50,0.8); }

.msg{
  width:fit-content;
  max-width:min(84%,900px);
  margin-left:0;
  margin-right:auto;
  overflow:hidden;
  overflow-wrap:anywhere;
  word-break:break-word;
  box-sizing:border-box;
  contain:layout paint;
}
.msg.mine{margin-left:auto;margin-right:0;}
.msg.other{margin-left:0;margin-right:auto;}
.msg.systemMsg{margin-left:0;margin-right:auto;max-width:min(84%,900px);}
.msg > *{min-width:0;max-width:100%;box-sizing:border-box;}
.msgText{
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
  white-space:pre-wrap;
}
.msgReply{
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  max-height:150px;
  overflow-x:hidden;
  overflow-y:auto;
  overflow-wrap:anywhere;
  word-break:break-word;
  white-space:normal;
  box-sizing:border-box;
  contain:content;
}
.msgReply b,.msgReply div{
  display:block;
  width:100%;
  min-width:0;
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
  white-space:pre-wrap;
  box-sizing:border-box;
}
.messageInput{
  max-height:180px;
  overflow-y:auto;
  resize:none;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
  box-sizing:border-box;
}

.stylePreviewCard{overflow:hidden;}
.stylePreviewMsg{width:100%;max-width:100%;min-width:0;box-sizing:border-box;padding:10px 13px;border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(180deg,rgba(12,23,43,.85),rgba(9,18,34,.7));box-shadow:0 4px 20px rgba(0,0,0,.1);}
.stylePreviewUser{min-width:0;max-width:100%;}
.stylePreviewText{width:100%;max-width:100%;min-width:0;box-sizing:border-box;overflow-wrap:anywhere;word-break:break-word;white-space:pre-wrap;}
.pinnedBar{align-items:flex-start;}
.pinnedInfo{flex:1 1 auto;min-width:0;align-items:flex-start;}
.pinnedText{display:block;min-width:0;max-width:100%;max-height:92px;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;line-height:1.65;text-overflow:clip;overflow:auto;padding-left:2px;}
.pinnedCopyBtn{width:34px;min-width:34px;height:34px;padding:0;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;}
.replyPreviewTop small{min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:break-word;}
#replyText{max-width:100%;max-height:72px;overflow:auto;overflow-wrap:anywhere;word-break:break-word;white-space:pre-wrap;}
.msgText[dir="ltr"]{border-right:0;border-left:2px solid rgba(99,102,241,.3);text-align:left;}
.msgText[dir="rtl"]{text-align:right;}
.msgReply[dir="ltr"]{border-right:0;border-left:3px solid rgba(99,102,241,.65);text-align:left;}
.msgReply[dir="rtl"]{border-right:3px solid rgba(99,102,241,.65);border-left:0;text-align:right;}
@media(max-width:600px){
  .stylePreviewMsg{padding:9px;}
  .pinnedBar{margin-left:7px;margin-right:7px;}
  .pinnedText{line-height:1.7;max-height:80px;}
  .pinnedCopyBtn{width:32px;min-width:32px;height:32px;}
}

.sideRankPreview{margin-top:10px;padding:10px;border-top:1px solid var(--line);}
.sideRankTitle{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;font-size:11px;font-weight:900;}
.sideRankTitle i{margin-left:4px;}
.top10Row{display:flex;align-items:center;gap:8px;padding:7px;border:1px solid var(--line);border-radius:10px;background:rgba(15,25,44,.42);margin-bottom:6px;min-width:0;}
.top10Pos{width:22px;height:22px;border-radius:7px;display:grid;place-items:center;background:rgba(99,102,241,.12);font-size:10px;font-weight:1000;flex:0 0 auto;}
.top10Info{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px;position:relative;z-index:2;}
.top10Info b{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}
.top10Info small{font-size:8px;color:#8192aa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}
.top10Themed{position:relative;overflow:hidden;background-image:var(--top10-bg);background-size:cover;background-position:center;border-color:rgba(255,255,255,.2);box-shadow:0 4px 20px rgba(0,0,0,.28);}
.top10Themed::before{content:"";position:absolute;inset:0;background:rgba(5,10,21,.76);border-radius:inherit;z-index:0;pointer-events:none;}
.top10Themed>*{position:relative;z-index:2;}
.top10Name{display:block;max-width:100%;min-width:0;}
.rankChip{font-size:8px;color:#9ab7ff;border:1px solid rgba(99,102,241,.18);padding:2px 6px;border-radius:999px;}
.rankProgress{display:grid;gap:5px;max-height:440px;overflow:auto;padding-right:2px;}
.rankLine{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;border:1px solid var(--line);border-radius:9px;background:rgba(7,14,28,.4);}
.rankLine.current{border-color:rgba(99,102,241,.35);background:rgba(99,102,241,.08);}
.rankLine>div{display:flex;flex-direction:column;gap:2px;min-width:0;}.rankLine b{font-size:10px;}.rankLine small{font-size:8px;color:#8392a8;}.rankLine>span{font-size:9px;font-weight:900;color:#91a7ff;}
.rankEditor{display:grid;gap:6px;max-height:520px;overflow:auto;}
.rankEditRow{display:grid;grid-template-columns:32px minmax(0,1fr) 110px;gap:6px;align-items:center;}.rankEditLevel{font-size:9px;text-align:center;color:#8da1bd;font-weight:900;}.rankEditRow .textInput{min-width:0;}.rankEditRow .textInput{height:34px;}
.swiping{transition:none!important;box-shadow:0 10px 30px rgba(0,0,0,.18);}
@media(max-width:700px){.messages{touch-action:pan-y!important;}.msg{touch-action:pan-y!important;min-width:0!important;}.msgReply{max-width:100%!important;max-height:130px!important;overflow-x:hidden!important;overflow-y:auto!important;}.msgReply b,.msgReply div{min-width:0!important;max-width:100%!important;}.sendSide{align-self:center!important;}.sendBtn{align-self:center!important;margin:0!important;}}
@media(max-width:700px){
  .msg{width:fit-content;max-width:97%;}
  .msg.systemMsg{max-width:97%;}
  .msgMeta .metaReplyBtn{display:none!important;}
  .messageInput{max-height:170px;line-height:1.6;padding-top:10px;padding-bottom:10px;}
  .rankEditRow{grid-template-columns:28px minmax(0,1fr) 92px;}
  .sideRankPreview{display:none;}
}
@media(prefers-reduced-motion:reduce){.swiping,.msg,.toast,.tabPane.active{animation:none!important;transition:none!important;}}

@media (max-width: 700px){
  .messages{padding-left:8px!important;padding-right:8px!important;}
  .msg, .msg.mine, .msg.other, .msg.systemMsg{
    width: 93%!important;
    max-width: 93%!important;
    min-width: 0!important;
    box-sizing: border-box!important;
  }
  .msg.mine{
    margin-left: auto!important;
    margin-right: 0!important;
  }
  .msg.other{
    margin-left: 0!important;
    margin-right: auto!important;
  }
  .msg.systemMsg{
    margin-left: auto!important;
    margin-right: auto!important;
  }
  .msgReply{
    width: 100%!important;
    max-width: 100%!important;
    box-sizing: border-box!important;
  }
  .replyPreview{
    width: 100%!important;
    max-width: none!important;
    box-sizing: border-box!important;
    margin-left: 0!important;
    margin-right: 0!important;
    padding: 9px 12px 10px!important;
  }
  #replyText{
    width: 100%!important;
    max-width: 100%!important;
    min-height: 32px!important;
    white-space: normal!important;
    display: -webkit-box!important;
    -webkit-box-orient: vertical!important;
    -webkit-line-clamp: 3!important;
    overflow: hidden!important;
    overflow-wrap: anywhere!important;
    word-break: break-word!important;
    line-height: 1.7!important;
  }
}
@media (max-width: 480px){
  .msg, .msg.mine, .msg.other, .msg.systemMsg{
    width: calc(100vw - 42px)!important;
    max-width: calc(100vw - 42px)!important;
  }
  .msg.mine{margin-right: 0!important;}
  .msg.other{margin-left: 0!important;}
  .replyPreview{
    width: 100%!important;
    max-width: 100%!important;
    padding: 9px 12px 11px!important;
  }
  #replyText{font-size:10px!important;line-height:1.72!important;min-height:34px!important;}
}

.msg.themed-msg {
  background-color: #0b1425;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: local;
  border-color: rgba(255,255,255,.24);
}
.msg.themed-msg::before {
  background: linear-gradient(180deg, rgba(5,10,21,.34), rgba(5,10,21,.58));
}
.msg.themed-msg::after {
  opacity: 0;
}
.msg.themed-msg .msgText,
.msg.themed-msg .msgReply,
.msg.themed-msg .msgUser,
.msg.themed-msg .msgMeta,
.msg.themed-msg .reactionsRow,
.msg.themed-msg .msgQuick {
  position: relative;
  z-index: 2;
}
@media (max-width: 700px) {
  .msg.themed-msg {
    width: 88% !important;
    max-width: 88% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    align-self: flex-start;
    box-sizing: border-box !important;
  }
  .msg.mine.themed-msg {
    margin-left: auto !important;
    margin-right: 0 !important;
  }
  .msg.other.themed-msg {
    margin-left: 0 !important;
    margin-right: auto !important;
  }
  .msg.themed-msg {
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-attachment: local !important;
  }
}
@media (max-width: 480px) {
  .msg.themed-msg {
    width: calc(100vw - 42px) !important;
    max-width: calc(100vw - 42px) !important;
    padding: 10px 11px !important;
  }
  .msg.themed-msg::before {
    background: linear-gradient(180deg, rgba(5,10,21,.20), rgba(5,10,21,.40));
  }
}

.sendRow{
  display:flex!important;
  align-items:center!important;
  gap:0!important;
  width:100%!important;
  padding:5px!important;
  border:1px solid rgba(255,255,255,.10)!important;
  border-radius:18px!important;
  background:linear-gradient(180deg,rgba(15,27,49,.96),rgba(9,19,36,.98))!important;
  box-shadow:0 8px 28px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.025)!important;
  transition:border-color .18s ease,box-shadow .18s ease!important;
}
.sendRow:focus-within{
  border-color:rgba(99,102,241,.38)!important;
  box-shadow:0 0 0 3px rgba(99,102,241,.08),0 10px 30px rgba(0,0,0,.20)!important;
}
.fileSide{
  display:flex!important;
  align-items:center!important;
  gap:2px!important;
  flex:0 0 auto!important;
  padding:0 2px!important;
}
.textSide{
  min-width:0!important;
  flex:1 1 auto!important;
}
.sendSide{
  flex:0 0 auto!important;
  display:flex!important;
  align-items:center!important;
  align-self:center!important;
  height:40px!important;
  padding:0 1px!important;
}
.composerTool{
  width:34px!important;
  height:34px!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  background:transparent!important;
  color:#91a3bb!important;
  box-shadow:none!important;
}
.composerTool:hover{
  color:#fff!important;
  background:rgba(255,255,255,.07)!important;
  box-shadow:none!important;
}
.messageInputWrap{position:relative!important;width:auto!important;display:flex!important;align-items:center!important;min-height:40px!important;}
.messageInput{
  width:100%!important;
  min-height:40px!important;
  height:40px!important;
  max-height:120px!important;
  padding:8px 9px!important;
  border:0!important;
  border-radius:13px!important;
  background:transparent!important;
  box-shadow:none!important;
  outline:none!important;
  color:#f7f9ff!important;
  font-size:13px!important;
}
.messageInput:focus{
  border:0!important;
  box-shadow:none!important;
}
.messageInput::placeholder{color:#71819a!important;opacity:1}
.inputStatusDot{display:none!important}
.sendBtn{
  width:40px!important;
  min-width:40px!important;
  height:40px!important;
  margin:0!important;
  align-self:center!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  font-size:0!important;
  background:linear-gradient(135deg,#4f46e5,#6366f1 55%,#38bdf8)!important;
  box-shadow:0 5px 16px rgba(99,102,241,.28)!important;
}
.sendBtn i{font-size:17px!important;transform:rotate(180deg);display:block;line-height:1;flex:0 0 auto}
.sendBtn:hover{transform:scale(1.04)!important;box-shadow:0 7px 20px rgba(99,102,241,.34)!important}
.sendBtn:active{transform:scale(.96)!important}
.composerBar{margin:0 2px 5px!important}
.selectedFileName{
  display:none!important;
}
.replyPreview{border-radius:12px!important}

@media(max-width:900px){
  .composer{padding-left:10px!important;padding-right:10px!important}
  .sendRow{
    width:100%!important;
    max-width:720px!important;
    margin:0 auto!important;
    padding:4px!important;
    gap:2px!important;
    border-radius:18px!important;
  }
  .fileSide{gap:0!important;padding:0!important}
  .composerTool{width:32px!important;height:32px!important}
  .messageInputWrap{flex:1 1 0!important;min-width:0!important}
  .messageInput{width:100%!important;height:40px!important;min-height:40px!important;padding:8px 7px!important;font-size:12px!important}
  .sendBtn{width:38px!important;min-width:38px!important;height:38px!important}
  .sendBtn i{font-size:16px!important}
}
@media(max-width:600px){
  .composer{padding:7px 8px calc(7px + env(safe-area-inset-bottom))!important}
  .composerBar{display:none!important}
  .sendRow{max-width:100%!important;padding:3px!important;border-radius:17px!important}
  .fileSide{flex:0 0 auto!important}
  .composerTool{width:32px!important;height:32px!important;font-size:17px!important}
  .messageInput{height:38px!important;min-height:38px!important;max-height:110px!important;font-size:12px!important;line-height:1.55!important;padding:7px 6px!important}
  .sendBtn{width:36px!important;min-width:36px!important;height:36px!important}
  .sendBtn i{font-size:15px!important}
}
@media(max-width:390px){
  .composer{padding-left:5px!important;padding-right:5px!important}
  .sendRow{gap:1px!important}
  .composerTool{width:29px!important;height:29px!important;font-size:16px!important}
  .messageInput{font-size:11.5px!important;padding-left:5px!important;padding-right:5px!important}
  .sendBtn{width:34px!important;min-width:34px!important;height:34px!important}
  .sendBtn i{font-size:14px!important}
}

.messageInput{contain:layout style;will-change:height;}
.sendRow,.messageInputWrap,.fileSide,.sendSide{align-items:center!important;}
.userName{color:var(--user-name-color,#fff);}
@media(max-width:700px){.messageInput{will-change:auto;}}

.msg{min-width:0;box-sizing:border-box;}
.msgUser{min-width:0;max-width:100%;}
.msgReply{min-width:0;max-width:100%;box-sizing:border-box;overflow:hidden;overflow-wrap:anywhere;word-break:break-word;white-space:normal;}
.msgReply b,.msgReply div{display:block;min-width:0;max-width:100%;box-sizing:border-box;overflow-wrap:anywhere;word-break:break-word;white-space:pre-wrap;}
@media(min-width:701px){.msgReply{width:100%;}.msgReply div{max-height:150px;overflow:auto;padding-right:2px;}.msgReply[dir="ltr"] div{padding-right:0;padding-left:2px;}}
.msg.systemMsg{margin-left:0!important;margin-right:auto!important;align-self:flex-start!important;}
@media(max-width:700px){.msg.systemMsg{margin-left:0!important;margin-right:auto!important;align-self:flex-start!important;}}
.reportBtn.active{color:#f87171!important;border-color:rgba(239,68,68,.35)!important;}
.msg{min-width:0!important;}
.msgReply{min-width:0!important;max-width:100%!important;overflow-x:hidden!important;overflow-y:auto!important;box-sizing:border-box!important;}
.msgReply b,.msgReply div{min-width:0!important;max-width:100%!important;width:100%!important;box-sizing:border-box!important;overflow-wrap:anywhere!important;word-break:break-word!important;}
.top10Row{min-width:0!important;position:relative;overflow:hidden;}
.top10Themed{background-image:var(--top10-bg)!important;background-size:cover!important;background-position:center!important;}
.top10Themed::before{z-index:0!important;}
.top10Themed>*{position:relative;z-index:2;}
.top10Name{min-width:0!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
.sendSide{align-self:center!important;justify-content:center!important;}
.sendBtn{align-self:center!important;margin:0!important;}
@media(max-width:700px){
  .msg{min-width:0!important;}
  .msgReply{max-height:128px!important;}
  .sendSide{height:100%!important;align-self:center!important;}
  .sendBtn{align-self:center!important;margin:auto 0!important;}
}
@media(max-width:480px){
  .msgReply{max-height:112px!important;}
}
.msg,.msgReply,.msgReply b,.msgReply div,.replyPreview,.replyPreviewTop,#replyText{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;}
.msg{overflow-x:hidden!important;overflow-wrap:anywhere!important;word-break:break-word!important;}
.msgReply{display:block!important;width:100%!important;max-width:100%!important;overflow-x:hidden!important;overflow-y:auto!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:break-word!important;}
.msgReply b,.msgReply div{width:100%!important;overflow-wrap:anywhere!important;word-break:break-word!important;}
.msgReply div{white-space:pre-wrap!important;}
.replyPreview{width:100%!important;overflow:hidden!important;}
.replyPreviewTop{width:100%!important;}
.replyPreviewTop small{min-width:0!important;max-width:calc(100% - 52px)!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
#replyText{width:100%!important;max-height:120px!important;overflow-x:hidden!important;overflow-y:auto!important;white-space:pre-wrap!important;overflow-wrap:anywhere!important;word-break:break-word!important;}
.pinnedBar{position:relative!important;z-index:40!important;min-width:0!important;overflow:hidden!important;}
.pinnedInfo{min-width:0!important;flex:1 1 auto!important;}
.pinnedText{min-width:0!important;width:100%!important;max-width:100%!important;max-height:120px!important;overflow-x:hidden!important;overflow-y:auto!important;white-space:pre-wrap!important;overflow-wrap:anywhere!important;word-break:break-word!important;text-overflow:clip!important;}
.pinnedBar .ghostBtn{flex:0 0 auto!important;}
.pinnedFlash{animation:pinnedFlashAnim 1.2s ease!important;}
@keyframes pinnedFlashAnim{0%{box-shadow:0 0 0 0 rgba(99,102,241,0)}25%{box-shadow:0 0 0 4px rgba(99,102,241,.32),0 0 28px rgba(99,102,241,.22)}100%{box-shadow:0 0 0 0 rgba(99,102,241,0)}}
@media(min-width:701px){
  .msg{max-width:min(84%,900px)!important;width:fit-content!important;}
  .msgReply{inline-size:100%!important;}
  .replyPreview{max-width:100%!important;}
}
@media(max-width:700px){
  .composer{bottom:14px!important;padding-bottom:calc(7px + env(safe-area-inset-bottom))!important;}
  .messages{padding-bottom:14px!important;}
  .replyPreview{width:100%!important;max-width:100%!important;}
  .msgReply{max-height:120px!important;}
}
@media(max-width:480px){
  .composer{bottom:14px!important;padding-bottom:calc(6px + env(safe-area-inset-bottom))!important;}
  .messages{padding-bottom:12px!important;}
  .pinnedText{max-height:120px!important;}
}