:root{
  --bg1:#f7f9ff;
  --g1:#8ec5ff;
  --g2:#e0c3fc;
  --accent:#6f9ef8;
  --muted:#667085;
  --ui-font-scale:1;
  --message-scale-factor:1;
  --message-width-percent:78%;
  --message-media-scale-factor:1;
  --safe-top:env(safe-area-inset-top, 0px);
  --safe-right:env(safe-area-inset-right, 0px);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
  --safe-left:env(safe-area-inset-left, 0px);
}

body.light-theme{
  color-scheme:light;
}

body.dark-theme{
  color-scheme:dark;
  --bg1:#0b1220;
  --g1:#355ea8;
  --g2:#21345f;
  --accent:#72a8ff;
  --muted:#9aa9c2;
  background:#0a101b;
  color:#e8eefc;
}

body.light-theme .profile-role-badge{
  color:#f8fbff;
  border-color:rgba(125,161,255,0.26);
  box-shadow:0 12px 24px rgba(71,113,214,0.16);
}

body.light-theme .profile-role-badge.owner{
  color:#3d2406;
  box-shadow:0 14px 26px rgba(213,155,58,0.18);
}

body.light-theme .admin-hero{
  background:
    radial-gradient(circle at top right, rgba(114,163,255,0.16), transparent 42%),
    linear-gradient(180deg, rgba(241,246,255,0.96), rgba(229,238,255,0.92));
  border-color:rgba(123,164,255,0.16);
  box-shadow:0 14px 36px rgba(93,126,181,0.12);
}

body.light-theme .admin-hero-title{
  color:#193157;
}

body.light-theme .admin-hero-text,
body.light-theme .admin-panel-note{
  color:rgba(39,60,95,0.72);
}

body.light-theme .admin-panel-note{
  background:rgba(238,244,255,0.92);
  border-color:rgba(170,193,236,0.35);
}

body.light-theme .admin-stat-card,
body.light-theme .admin-search-shell{
  background:linear-gradient(180deg, rgba(255,255,255,0.94), rgba(243,248,255,0.92));
  border-color:rgba(191,208,238,0.42);
}

body.light-theme .admin-stat-label,
body.light-theme .admin-search-icon{
  color:rgba(62,84,123,0.62);
}

body.light-theme .admin-stat-value,
body.light-theme .admin-search-input{
  color:#183253;
}

body.light-theme .admin-card{
  background:linear-gradient(180deg, rgba(255,255,255,0.94), rgba(243,248,255,0.92));
  border-color:rgba(191,208,238,0.42);
}

body.light-theme .admin-card-name{
  color:#183253;
}

body.light-theme .admin-card-meta,
body.light-theme .admin-card-handle,
body.light-theme .admin-role-lock{
  color:rgba(51,74,113,0.68);
}

body.light-theme .admin-role-tag{
  color:#31549c;
  background:rgba(85,128,235,0.12);
  border-color:rgba(101,145,247,0.18);
}

body.light-theme .admin-role-tag.owner{
  color:#8f5610;
  background:rgba(255,197,93,0.14);
  border-color:rgba(232,177,79,0.2);
}

body.light-theme .admin-ban-tag{
  color:#a43d3d;
  background:rgba(255,117,117,0.12);
  border-color:rgba(235,125,125,0.18);
}

body.light-theme .admin-filter-chip,
body.light-theme .admin-quick-btn{
  color:#31549c;
  background:rgba(85,128,235,0.08);
  border-color:rgba(101,145,247,0.16);
}

body.light-theme .admin-filter-chip.active{
  color:#fff;
}

body.light-theme .admin-role-select{
  background:#f8fbff;
  color:#193157;
  border-color:rgba(154,182,234,0.54);
}

body.light-theme .admin-log-line{
  color:#21395d;
  background:rgba(244,248,255,0.96);
  border-color:rgba(176,198,236,0.4);
}

body.light-theme .admin-role-select:focus{
  box-shadow:0 0 0 4px rgba(94,134,238,0.16);
}
/* utility */
.hidden{display:none!important}
*{box-sizing:border-box}
html,body{height:100%;min-height:100%;margin:0;font-family:Inter,system-ui,Segoe UI,Roboto,'Helvetica Neue',Arial}
body{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.app-bg{display:flex;height:100vh;min-height:100dvh}
.app-bg{display:flex;height:100vh;min-height:100dvh}
#sidebar{width:220px;padding:22px;background:linear-gradient(180deg,var(--bg1),#fbfbff);border-right:1px solid rgba(0,0,0,0.04);display:flex;flex-direction:column;gap:16px}
.brand h1{margin:0;font-size:28px;color:#123;letter-spacing:1px}
.brand .tag{margin:4px 0 0;color:var(--muted);font-size:13px}
.panel{background:linear-gradient(180deg,rgba(255,255,255,0.6),rgba(255,255,255,0.4));padding:12px;border-radius:12px;box-shadow:0 6px 18px rgba(18,52,88,0.06)}
.panel.small ul{list-style:none;padding:6px 0;margin:6px 0 0;max-height:160px;overflow:auto}
.panel select{width:100%;padding:8px;border-radius:8px;border:1px solid rgba(10,10,30,0.06)}
.app-bg #workspace{flex:1;display:flex;min-height:100vh;min-height:100dvh}

#left-panel{width:320px;padding:20px;border-right:1px solid rgba(0,0,0,0.04);display:flex;flex-direction:column;gap:16px;background:linear-gradient(180deg,rgba(255,255,255,0.6),rgba(250,250,255,1))}
.profile-bar{display:flex;align-items:center;justify-content:space-between;gap:12px}
.profile-info{display:flex;align-items:center;gap:12px}
.avatar{width:48px;height:48px;border-radius:12px;background:linear-gradient(90deg,var(--g1),var(--g2));display:flex;align-items:center;justify-content:center;color:white;font-weight:700}
.profile-meta{line-height:1}
.profile-meta #profile-name-display{font-weight:700}
.edit-btn{padding:8px 12px;border-radius:10px;border:none;background:rgba(18,60,138,0.9);color:white;cursor:pointer}

/* Profile card (left panel) */
.profile-card{padding:18px;border-radius:12px;display:flex;flex-direction:column;gap:12px;align-items:stretch}
.profile-top{display:flex;gap:12px;align-items:center}
.profile-avatar{width:72px;height:72px;border-radius:14px;background:linear-gradient(135deg,var(--g1),var(--g2));display:flex;align-items:center;justify-content:center;color:white;font-weight:800;font-size:22px;box-shadow:0 10px 24px rgba(31,110,246,0.12)}
.profile-main{display:flex;flex-direction:column}
.profile-name{font-weight:800;font-size:16px;color:#08203a}
.profile-status{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:8px}
.status-dot{width:10px;height:10px;border-radius:50%;display:inline-block}
.status-dot.offline{background:#c7ccd6}
.status-dot.online{background:#4cd964}
.profile-actions{display:flex;gap:8px}
.icon-btn{background:transparent;border:1px solid rgba(10,10,30,0.06);padding:8px;border-radius:10px;cursor:pointer}
.profile-gallery{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.profile-gallery .gal-item{width:100%;height:56px;border-radius:8px;overflow:hidden}
.profile-gallery img{width:100%;height:100%;object-fit:cover;display:block}

/* Top-right profile container */
.top-profile-container {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
}

.top-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg,#6a11cb 0%,#2575fc 100%);
  background-size: 100% 100%;
  box-shadow: 0 6px 18px rgba(37,117,252,0.18);
  border: none;
  cursor: pointer;
}

.top-avatar:active { transform: scale(0.98); }

.top-display-name {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  background: rgba(10, 20, 40, 0.6);
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-with-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-width:0;
  max-width:100%;
}

.inline-admin-badge{
  flex:0 0 auto;
  width:17px;
  height:17px;
  border-radius:50%;
  display:inline-grid;
  place-items:center;
  font-size:10px;
  font-weight:800;
  line-height:1;
  color:#fff;
  background:linear-gradient(135deg, #4f7dfc 0%, #3b68d2 100%);
  box-shadow:0 4px 10px rgba(57, 96, 192, 0.22);
}

.inline-admin-badge.owner{
  background:linear-gradient(135deg, #ffc867 0%, #ff9f4d 100%);
  color:#332007;
  box-shadow:0 4px 10px rgba(208, 142, 53, 0.24);
}

/* hidden state for top-profile-container */
.top-profile-container.hidden { display: none; }

/* Profile overlay + modal */
.profile-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12,18,32,0.78);
  z-index: 2000;
  backdrop-filter: blur(18px);
  transition: opacity 240ms ease;
}
.profile-overlay.hidden { opacity: 0; pointer-events: none; }
.profile-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }

.profile-modal {
  width: min(640px, 94vw);
  max-width: 94vw;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 28px 90px rgba(4,8,20,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
  background: linear-gradient(180deg, rgba(18,24,38,0.96), rgba(24,32,50,0.94));
  border: 1px solid rgba(255,255,255,0.1);
  transform: translateY(16px) scale(0.98) rotateX(6deg);
  opacity: 0;
  transition: transform 380ms cubic-bezier(.16,.84,.24,1), opacity 260ms ease, box-shadow 260ms ease;
  position: relative;
}
.profile-overlay:not(.hidden) .profile-modal { transform: translateY(0) scale(1); opacity: 1; }

/* subtle animated rim gradient behind modal */
.profile-modal:before{
  content: "";
  position:absolute;inset:-2px;border-radius:22px;z-index:-1;
  background: linear-gradient(90deg, rgba(106,17,203,0.12), rgba(37,117,252,0.10));
  filter: blur(18px);opacity:0.85;transition:opacity .3s ease;
}
.profile-overlay:not(.hidden) .profile-modal:before{opacity:1}

.profile-inner { text-align: center; color: #eef2ff; }
.profile-large-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 36px;
  color: white;
  background: linear-gradient(135deg,#ff7eb3 0%,#7afcff 100%);
  background-size: 100% 100%;
  box-shadow: 0 12px 40px rgba(122,252,255,0.12), 0 4px 16px rgba(10,12,20,0.25);
  border: none;
  transition: transform .28s cubic-bezier(.2,.9,.2,1), box-shadow .28s ease;
}
.profile-large-avatar.has-img { background-color: transparent; background-size: cover; background-position: center; color: transparent; }
.profile-change-row { margin-bottom: 10px; }
.profile-change-row .btn { padding:6px 10px; font-size:14px; }
.profile-large-avatar:hover{ transform: translateY(-6px) scale(1.03); box-shadow: 0 20px 60px rgba(122,252,255,0.16); }
.profile-title { margin: 0; font-size: 22px; font-weight: 700; }
.profile-username { margin: 4px 0 0; color: rgba(255,255,255,0.65); font-size: calc(14px * var(--ui-font-scale)); letter-spacing: 0.5px; }
.profile-role-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin-top:12px;
  padding:8px 14px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  letter-spacing:0.04em;
  color:#eff6ff;
  background:linear-gradient(135deg, rgba(79,125,252,0.9), rgba(61,104,210,0.84));
  border:1px solid rgba(164,192,255,0.32);
  box-shadow:0 12px 28px rgba(40,78,170,0.24);
}
.profile-role-badge::before{
  content:"";
  width:18px;
  height:18px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,0.14);
  box-shadow:inset 0 0 0 5px rgba(255,255,255,0.16);
}
.profile-role-badge.owner{
  background:linear-gradient(135deg, rgba(255,203,101,0.94), rgba(255,158,78,0.88));
  border-color:rgba(255,231,175,0.4);
  color:#1f1406;
  box-shadow:0 14px 30px rgba(229,147,43,0.26);
}
.profile-role-badge.owner::before{
  background:rgba(255,255,255,0.3);
}
.profile-section #admin-hero-btn{
  margin-top:12px;
}
.profile-section { margin: 20px 0; padding: 16px; border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); border: 1px solid rgba(255,255,255,0.04); transition: transform .3s ease, background .3s ease; }
.profile-section:hover { transform: translateX(2px); background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)); }
.profile-section-title { margin: 0 0 12px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.7); }
.avatar-controls { display: flex; gap: 8px; }
.profile-row-label { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.8); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.profile-input { flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.2); color: #fff; font-size: 14px; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.profile-input:focus { outline: none; border-color: rgba(122,252,255,0.3); background: rgba(0,0,0,0.25); box-shadow: 0 0 12px rgba(122,252,255,0.1); }
.profile-input::placeholder { color: rgba(255,255,255,0.4); }

.btn { padding: 10px 16px; border-radius: 12px; border: 0; cursor: pointer; background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)); color: #fff; transition: transform .2s cubic-bezier(.2,.9,.2,1), box-shadow .2s ease, opacity .2s ease, background .2s ease; font-weight: 500; font-size: 14px; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(122,252,255,0.08); opacity: 0.98; }
.btn:active { transform: translateY(-1px) scale(.98); }

.btn-secondary { background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03)); }
.btn-secondary:hover { background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04)); box-shadow: 0 6px 18px rgba(255,255,255,0.06); }

.btn-save { padding: 10px 12px; min-width: 40px; background: linear-gradient(135deg, rgba(122,252,255,0.1), rgba(122,252,255,0.05)); }
.btn-save:hover { background: linear-gradient(135deg, rgba(122,252,255,0.15), rgba(122,252,255,0.08)); box-shadow: 0 4px 14px rgba(122,252,255,0.12); }

.btn-action { width: 100%; margin: 6px 0; background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); text-align: left; padding-left: 14px; }
.btn-action:hover { background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)); transform: translateX(4px) translateY(-2px); }

.ui-icon{
  width:20px;
  height:20px;
  display:block;
  flex:0 0 auto;
}

.profile-avatar-icon{
  width:44px;
  height:44px;
}

.profile-actions-row { display: flex; gap: 12px; justify-content: center; }
.profile-close {
  position:absolute;
  top:16px;
  right:16px;
  width:38px;
  height:38px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.08);
  color:#ffffffcc;
  font-size:18px;
  cursor:pointer;
  z-index:5;
  box-shadow:0 10px 24px rgba(0,0,0,0.16);
  transition:transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.profile-close:hover{
  transform:translateY(-1px) scale(1.04);
  background:rgba(255,255,255,0.10);
  box-shadow:0 14px 28px rgba(0,0,0,0.20);
}

#settings-modal{
  padding-top:56px;
}

#settings-modal #settings-close{
  top:14px;
  right:14px;
}

#settings-modal .settings-inner{
  padding-top:8px;
  padding-right:12px;
  scrollbar-width:thin;
  scrollbar-color:rgba(84,132,245,0.95) transparent;
}

#settings-modal .settings-inner::-webkit-scrollbar{
  width:10px;
}

#settings-modal .settings-inner::-webkit-scrollbar-track{
  background:transparent;
}

#settings-modal .settings-inner::-webkit-scrollbar-thumb{
  border-radius:999px;
  background:linear-gradient(180deg, #79a8ff 0%, #4d84f6 100%);
}

#settings-modal .settings-inner::-webkit-scrollbar-thumb:hover{
  background:linear-gradient(180deg, #8cb4ff 0%, #5c8df2 100%);
}

.top-avatar.has-img, .profile-large-avatar.has-img { background-repeat: no-repeat; }
.top-avatar.has-img {
  background-size: cover;
  background-position: center;
  background-color: transparent;
  color: transparent;
}
.profile-large-avatar.has-img { background-size: cover; background-position: center; }

/* remembered-account small avatar */
.acc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg,#6a11cb 0%,#2575fc 100%);
  background-size: 100% 100%;
}
.acc-avatar.has-img {
  background-size: cover;
  background-position: center;
  color: transparent;
}

/* subtle animated accents for modal elements */
.profile-modal .profile-title{background:linear-gradient(90deg, rgba(255,255,255,0.9), rgba(255,255,255,0.65)); -webkit-background-clip:text; background-clip:text; color:transparent}
.profile-modal .profile-sub{opacity:.9; transform: translateY(0); transition: transform .3s ease, opacity .3s ease}
.profile-modal:not(.hidden) .profile-sub{transform: translateY(-2px)}

/* floating gradient behind the avatar */
.profile-large-avatar:after{
  content:"";position:absolute;width:180px;height:180px;border-radius:50%;left:50%;top:calc(50% - 20px);transform:translate(-50%,-50%);z-index:-2;background:radial-gradient(circle at 30% 30%, rgba(122,252,255,0.12), transparent 30%), radial-gradient(circle at 70% 70%, rgba(255,126,179,0.08), transparent 35%);filter:blur(18px);opacity:0.9;transition:opacity .4s ease, transform .6s cubic-bezier(.2,.9,.2,1)}
.profile-large-avatar.has-img:after{opacity:0.75}

body.dark-theme .app-bg{
  background:
    radial-gradient(circle at top left, rgba(65,113,204,0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(58,91,160,0.16), transparent 26%),
    linear-gradient(180deg, #0a101b 0%, #0c1322 100%);
}

body.dark-theme .panel{
  background:linear-gradient(180deg, rgba(17,24,39,0.86), rgba(12,18,31,0.88));
  box-shadow:0 12px 28px rgba(0,0,0,0.22);
  border:1px solid rgba(117,146,201,0.08);
}

body.dark-theme #left-panel{
  background:linear-gradient(180deg, rgba(10,17,30,0.96), rgba(11,18,31,0.98));
  border-right:1px solid rgba(110,135,186,0.10);
}

body.dark-theme #chat-pane{
  background:linear-gradient(180deg, #0c1424 0%, #0a111f 100%);
}

body.dark-theme #chat-header{
  background:linear-gradient(180deg, rgba(14,22,38,0.96), rgba(11,18,31,0.92));
  border-bottom:1px solid rgba(113,142,196,0.10);
}

body.dark-theme #messages{
  background:linear-gradient(180deg, rgba(10,17,30,0.10), rgba(10,17,30,0.04));
  scrollbar-color:rgba(96,142,229,0.78) rgba(20,31,53,0.9);
}

body.dark-theme #messages::-webkit-scrollbar-track{
  background:linear-gradient(180deg, rgba(18,29,50,0.94), rgba(14,23,40,0.94));
  border:1px solid rgba(90,118,173,0.18);
  box-shadow:inset 0 1px 8px rgba(0,0,0,0.28);
}

body.dark-theme #messages::-webkit-scrollbar-thumb{
  border:3px solid rgba(14,22,37,0.96);
  background:linear-gradient(180deg, #3b73db 0%, #4e8fff 45%, #7db8ff 100%);
}

body.dark-theme .chats-title,
body.dark-theme #chat-title,
body.dark-theme .chat-info-name{
  color:#edf3ff;
}

body.dark-theme #chat-subtitle,
body.dark-theme .chat-info-preview,
body.dark-theme .chat-info-time{
  color:#9aa9c2;
}

body.dark-theme .chat-list li{
  background:linear-gradient(180deg, rgba(18,27,45,0.62), rgba(12,19,33,0.74));
  box-shadow:0 8px 20px rgba(0,0,0,0.16);
}

body.dark-theme .chat-list li:hover{
  background:linear-gradient(180deg, rgba(25,38,63,0.86), rgba(16,27,47,0.90));
}

body.dark-theme .chat-list li.active{
  background:linear-gradient(135deg, #2f5fb8 0%, #4784ea 100%);
  box-shadow:0 14px 30px rgba(35,80,164,0.34);
}

body.dark-theme .chat-list li.chat-list-item-unread{
  border-color:rgba(106,139,204,0.16);
}

body.dark-theme .search-input{
  background:rgba(15,23,39,0.92);
  color:#e8eefc;
  border-color:rgba(101,133,191,0.18);
  box-shadow:0 10px 24px rgba(0,0,0,0.18);
}

body.dark-theme .search-section{
  margin:10px 10px 14px;
  padding:14px;
  border-radius:20px;
  background:linear-gradient(180deg, rgba(22,30,46,0.92), rgba(16,23,37,0.96));
  border:1px solid rgba(104,132,182,0.12);
  box-shadow:0 14px 30px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.03);
}

body.dark-theme .search-input::placeholder{
  color:#7f92b2;
}

body.dark-theme .search-results{
  background:linear-gradient(180deg, rgba(16,24,39,0.98), rgba(12,19,33,0.98));
  border-color:rgba(106,139,204,0.12);
  box-shadow:0 18px 40px rgba(0,0,0,0.28);
}

body.dark-theme .search-result-item:hover{
  background:rgba(82,123,202,0.12);
}

body.dark-theme .auth-card{
  color:#e8eefc;
  background:linear-gradient(180deg, rgba(15,22,36,0.98), rgba(10,16,28,0.98));
  box-shadow:0 30px 80px rgba(0,0,0,0.30);
}

body.dark-theme .field label,
body.dark-theme .brand h1{
  color:#edf3ff;
}

body.dark-theme .note,
body.dark-theme .brand .tag{
  color:#92a2be;
}

body.dark-theme .auth-card input,
body.dark-theme .auth-card select{
  background:rgba(13,21,35,0.96);
  color:#e8eefc;
  border-color:rgba(103,133,187,0.18);
  -webkit-text-fill-color:#e8eefc;
  caret-color:#e8eefc;
}

body.dark-theme .auth-card input::placeholder,
body.dark-theme .auth-card select::placeholder{
  color:rgba(171,189,222,0.52);
  -webkit-text-fill-color:rgba(171,189,222,0.52);
}

body.dark-theme .auth-card input:-webkit-autofill,
body.dark-theme .auth-card input:-webkit-autofill:hover,
body.dark-theme .auth-card input:-webkit-autofill:focus,
body.dark-theme .auth-card input:-webkit-autofill:active{
  -webkit-text-fill-color:#e8eefc;
  caret-color:#e8eefc;
  -webkit-box-shadow:0 0 0 1000px rgba(13,21,35,0.96) inset;
  box-shadow:0 0 0 1000px rgba(13,21,35,0.96) inset;
  transition:background-color 9999s ease-in-out 0s;
}

body.dark-theme .top-display-name{
  background:rgba(8,15,27,0.84);
  color:#edf3ff;
  box-shadow:0 8px 18px rgba(0,0,0,0.22);
}

body.dark-theme .top-avatar:not(.has-img),
body.dark-theme .profile-large-avatar:not(.has-img),
body.dark-theme .profile-avatar,
body.dark-theme .acc-avatar:not(.has-img),
body.dark-theme .chat-header-avatar:not(.has-img),
body.dark-theme .chat-avatar.private,
body.dark-theme .search-result-avatar:not(.has-img){
  background:linear-gradient(135deg, #28406d 0%, #3e6ab0 45%, #6e9ee6 100%);
  box-shadow:0 10px 24px rgba(18,31,56,0.30);
}

body.dark-theme .chat-avatar.public{
  background:linear-gradient(135deg, #24344f 0%, #355078 100%);
}

body.dark-theme .top-avatar.has-img,
body.dark-theme .profile-large-avatar.has-img,
body.dark-theme .search-result-avatar.has-img,
body.dark-theme .acc-avatar.has-img,
body.dark-theme .chat-header-avatar.has-img{
  background-color:transparent;
}

body.dark-theme .chooser-card{
  color:#e8eefc;
  background:linear-gradient(180deg, rgba(15,22,36,0.98), rgba(10,16,28,0.98));
  box-shadow:0 30px 80px rgba(0,0,0,0.30);
  border:1px solid rgba(106,139,204,0.12);
}

body.dark-theme .chooser-header{
  color:#edf3ff;
}

body.dark-theme .remembered-list li{
  background:linear-gradient(180deg, rgba(19,28,46,0.92), rgba(13,20,34,0.96));
  border:1px solid rgba(104,132,182,0.10);
  box-shadow:0 10px 22px rgba(0,0,0,0.14);
}

body.dark-theme .remembered-list li:hover{
  background:linear-gradient(180deg, rgba(27,39,64,0.96), rgba(16,26,44,0.98));
}

body.dark-theme .acc-name{
  color:#edf3ff;
}

body.dark-theme .acc-remove{
  color:#9dafcc;
}

body.dark-theme .chooser-card .note{
  color:#92a2be;
}

body.dark-theme .profile-modal,
body.dark-theme .dialog{
  background:linear-gradient(180deg, rgba(12,19,31,0.98), rgba(16,24,39,0.98));
  border-color:rgba(106,139,204,0.14);
}

body.dark-theme .profile-section,
body.dark-theme .settings-group,
body.dark-theme .settings-mini-panel,
body.dark-theme .settings-preview-card{
  background:linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border-color:rgba(106,139,204,0.10);
  box-shadow:0 12px 28px rgba(0,0,0,0.12);
}

body.dark-theme .profile-section:hover{
  background:linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

body.dark-theme .profile-input,
body.dark-theme .settings-select,
body.dark-theme .composer-panel-input,
body.dark-theme #composer input[type=text],
body.dark-theme #composer textarea{
  background:rgba(10,17,29,0.92);
  color:#e8eefc;
  border-color:rgba(103,133,187,0.18);
}

body.dark-theme .profile-input::placeholder,
body.dark-theme #composer textarea::placeholder,
body.dark-theme .composer-panel-input::placeholder{
  color:#7f92b2;
}

body.dark-theme .btn-secondary,
body.dark-theme .btn-action{
  background:linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025));
}

body.dark-theme .message.incoming .message-bubble{
  background:linear-gradient(180deg, rgba(22,31,49,0.96), rgba(15,23,39,0.98));
  color:#e8eefc;
  border-color:rgba(97,126,177,0.16);
  box-shadow:0 14px 34px rgba(0,0,0,0.18);
}

body.dark-theme .message.own .message-bubble{
  background:linear-gradient(135deg, #2f5fb8 0%, #4b89ef 100%);
  border-color:rgba(180,210,255,0.16);
}

body.dark-theme .message-context-menu{
  background:linear-gradient(180deg, rgba(13,21,35,0.98), rgba(10,17,30,0.98));
  border-color:rgba(106,139,204,0.16);
  box-shadow:0 18px 44px rgba(0,0,0,0.34);
}

body.dark-theme .message-context-menu-item{
  color:#eaf1ff;
}

body.dark-theme .message-context-menu-item:hover{
  background:rgba(114,173,255,0.14);
}

body.dark-theme .message-photo,
body.dark-theme .message-gif{
  box-shadow:0 10px 24px rgba(0,0,0,0.24);
}

body.dark-theme .message.incoming .message-attachment-voice{
  background:linear-gradient(180deg, rgba(24,36,59,0.92), rgba(18,28,46,0.94));
}

body.dark-theme #composer{
  background:linear-gradient(180deg, rgba(13,21,35,0.96), rgba(11,18,31,0.98));
  border-top:1px solid rgba(106,139,204,0.10);
}

body.dark-theme .composer-input-shell{
  background:linear-gradient(180deg, rgba(15,23,39,0.96), rgba(12,19,33,0.98));
  border-color:rgba(106,139,204,0.14);
  box-shadow:0 12px 28px rgba(0,0,0,0.22);
}

body.dark-theme .composer-tool{
  background:rgba(255,255,255,0.04);
  color:#dce7ff;
}

body.dark-theme .composer-tool:hover{
  background:rgba(114,173,255,0.14);
}

body.dark-theme .composer-panel{
  background:linear-gradient(180deg, rgba(13,21,35,0.98), rgba(10,17,30,0.99));
  border-color:rgba(106,139,204,0.14);
  box-shadow:0 22px 46px rgba(0,0,0,0.32);
}

body.dark-theme .composer-media-tab{
  background:rgba(255,255,255,0.04);
  color:#b9c8e5;
}

body.dark-theme .composer-media-tab.active{
  background:rgba(87,137,232,0.18);
  color:#eef4ff;
}

body.dark-theme .composer-gif-item,
body.dark-theme .composer-sticker-item,
body.dark-theme .composer-emoji-item{
  background:rgba(255,255,255,0.04);
  border-color:rgba(104,132,182,0.12);
}

body.dark-theme .composer-empty-state,
body.dark-theme .composer-panel-note,
body.dark-theme .composer-panel-subtitle{
  color:#9dafcc;
}

body.dark-theme .toast{
  background:linear-gradient(180deg, rgba(13,21,35,0.98), rgba(10,17,30,0.98));
  border-color:rgba(106,139,204,0.16);
  box-shadow:0 12px 30px rgba(0,0,0,0.28);
}

body.dark-theme .dialog-input{
  background:rgba(10,17,30,0.92);
  color:#e8eefc;
  border-color:rgba(106,139,204,0.18);
}

body.dark-theme .profile-close{
  background:rgba(255,255,255,0.04);
  border-color:rgba(106,139,204,0.14);
  color:#eef4ff;
  box-shadow:0 12px 28px rgba(0,0,0,0.24);
}

body.dark-theme .profile-close:hover{
  background:rgba(114,173,255,0.14);
}

body.dark-theme #settings-modal .settings-inner{
  scrollbar-color:rgba(102,150,255,0.96) transparent;
}

body.dark-theme #settings-modal .settings-inner::-webkit-scrollbar-track{
  background:transparent;
}

body.dark-theme #settings-modal .settings-inner::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg, #77a7ff 0%, #5c8df2 100%);
}

@keyframes modalPop { from{opacity:0; transform:translateY(18px) scale(.98) } to{opacity:1; transform:translateY(0) scale(1)} }
.profile-overlay:not(.hidden) .profile-modal{ animation: modalPop .36s cubic-bezier(.2,.9,.2,1) }

/* profile modal additional controls */
.profile-row { margin: 14px 0; text-align: left; }
.profile-row label { display:block; color: rgba(255,255,255,0.85); margin-bottom:6px; font-weight:600; }
.profile-row-controls { display:flex; gap:8px; align-items:center; }
.profile-row-controls input[type="text"] { flex:1; padding:8px 10px; border-radius:8px; border:1px solid rgba(255,255,255,0.06); background: rgba(0,0,0,0.15); color:#fff; }
.profile-textarea{
  width:100%;
  min-height:96px;
  resize:vertical;
  font:inherit;
  line-height:1.5;
}
.profile-actions-list { display:flex; flex-direction:column; gap:8px; margin-top:12px; align-items:center; }
.profile-actions-list .btn { width:80%; }

@media (prefers-reduced-motion: no-preference) {
  .profile-modal { will-change: transform, opacity; }
}

.chats-panel{flex:1;overflow:auto}

#chat-pane{flex:1;display:flex;flex-direction:column}
#chat-header{padding:18px;border-bottom:1px solid rgba(0,0,0,0.04);background:linear-gradient(90deg,rgba(255,255,255,0.6),rgba(255,255,255,0.3));font-weight:700}
#messages{flex:1;padding:24px;overflow:auto;background:linear-gradient(180deg,rgba(255,255,255,0.6),rgba(250,250,255,1))}
.message{padding:10px 12px;border-radius:10px;margin-bottom:10px;background:linear-gradient(90deg,#ffffff,#f0f7ff);box-shadow:0 6px 12px rgba(15,39,73,0.04)}
.private{background:linear-gradient(90deg,#fff0f0,#fff6f6)}
#composer{display:flex;padding:18px;border-top:1px solid rgba(0,0,0,0.04);gap:12px;align-items:center}
#composer input[type=text],#composer textarea{flex:1;padding:12px;border-radius:12px;border:1px solid rgba(10,10,30,0.06)}
#composer button{padding:10px 16px;border-radius:10px;border:none;background:linear-gradient(90deg,var(--g1),var(--g2));color:white;font-weight:600;cursor:pointer;box-shadow:0 8px 18px rgba(137,175,255,0.18);transition:transform .18s ease}
#composer button:hover{transform:translateY(-3px)}

/* Auth modal */
.modal{position:fixed;inset:0;align-items:center;justify-content:center;z-index:40;pointer-events:none;display:none}
.modal.show{pointer-events:auto;display:flex}

/* hide app background while auth modal is visible */
.app-bg.hidden{display:none}
.auth-card{width:420px;color:#08203a;padding:28px;border-radius:18px;box-shadow:0 30px 80px rgba(18,52,88,0.10);position:relative;overflow:hidden;transform:translateY(0);animation:cardEnter .6s cubic-bezier(.2,.9,.3,1);background:linear-gradient(180deg,#ffffff,#fbfbff)}
.auth-card .logo{font-size:28px;font-weight:700;color:var(--accent);margin-bottom:6px}
.auth-decor{
  position:absolute;
  right:-34px;
  top:-34px;
  width:304px;
  height:176px;
  pointer-events:none;
  opacity:0.92;
  border-radius:999px;
  background:
    radial-gradient(circle at 28% 34%, rgba(142,197,255,0.78), rgba(142,197,255,0) 38%),
    radial-gradient(circle at 68% 40%, rgba(224,195,252,0.72), rgba(224,195,252,0) 42%),
    radial-gradient(circle at 88% 52%, rgba(255,209,255,0.56), rgba(255,209,255,0) 34%);
  filter:blur(18px);
  transform:rotate(8deg);
  animation:decorFloat 8s ease-in-out infinite;
}
.decor-svg{display:none}
.auth-card:before{content:"";position:absolute;inset:0;background:linear-gradient(120deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));pointer-events:none}
.tabs{display:flex;gap:8px;margin:12px 0}
.tab{flex:1;padding:10px;border-radius:10px;background:transparent;border:none;color:var(--muted);cursor:pointer;font-weight:600}
.tab.active{background:linear-gradient(90deg,var(--g1),var(--g2));color:#fff;box-shadow:0 10px 26px rgba(50,80,200,0.08);transform:translateY(-3px)}
.field{margin:12px 0}
.field label{display:block;color:#08203a;font-size:13px;margin-bottom:6px}
.field input{width:100%;padding:12px;border-radius:12px;border:1px solid rgba(10,10,30,0.06);background:transparent;color:#08203a}
.field input::placeholder{color:rgba(8,32,58,0.35)}
.field input:focus{outline:none;box-shadow:0 10px 30px rgba(34,94,255,0.06);transform:translateY(-2px)}
.actions{margin-top:14px}
.actions button{width:100%;padding:12px;border-radius:14px;border:none;background:linear-gradient(90deg,#1f6ef6,#8f6bff);color:white;font-weight:800;cursor:pointer;box-shadow:0 14px 32px rgba(50,80,200,0.12);transition:transform .18s cubic-bezier(.2,.9,.3,1), box-shadow .18s}
.actions button:hover{transform:translateY(-3px);box-shadow:0 22px 44px rgba(60,100,220,0.16)}
.actions button:active{transform:translateY(-1px)}
.actions #btn-reset-cancel{width:48%;align-self:flex-start;margin-top:8px}

/* Reset-form specific layout: make reset and cancel same size
  - when reset button is visible, it becomes 48% and centered
  - cancel is 48% and aligned to the left below reset */
#reset-form .actions{display:flex;flex-direction:column;align-items:center;gap:8px}
#reset-form .actions #btn-reset{width:48%;margin:0 auto}
#reset-form .actions #btn-request-code{width:100%}
#reset-form .actions #btn-reset-cancel{width:100%;align-self:flex-start}
/* Slight nudge left by 0.5cm as requested */
#reset-form .actions #btn-reset-cancel{transform:translateX(-0.2cm)}
.note{margin-top:10px;color:var(--muted);font-size:12px}

.forgot-row{margin-top:10px;text-align:center}
.link-like{background:none;border:none;color:var(--accent);cursor:pointer;padding:6px 8px;border-radius:8px;font-weight:600}
.link-like:hover{text-decoration:underline}
.muted{background:transparent;color:var(--muted);box-shadow:none;border:1px solid rgba(0,0,0,0.04);margin-left:8px}

.small-row{margin-top:6px}
.hidden{display:none!important}

.bg-shapes .s{position:absolute;border-radius:50%;filter:blur(30px);opacity:0.9}
.bg-shapes .s1{width:380px;height:380px;background:linear-gradient(180deg, rgba(142,197,255,0.22), rgba(224,195,252,0.18));left:-100px;top:-90px}
.bg-shapes .s2{width:240px;height:240px;background:linear-gradient(180deg, rgba(255,210,240,0.14), rgba(142,197,255,0.12));right:-80px;bottom:-80px}
.bg-shapes .s3{width:160px;height:160px;background:linear-gradient(180deg, rgba(200,240,255,0.12), rgba(255,230,240,0.08));left:40%;bottom:-40px}

@keyframes cardEnter{from{opacity:0;transform:translateY(18px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}

/* subtle gradient background animation */
body:before{content:"";position:fixed;inset:0;z-index:-1;background:linear-gradient(45deg,#f0f7ff,#fdf0ff);background-size:400% 400%;animation:grad 12s ease infinite}
@keyframes grad{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}

@keyframes decorFloat{0%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(10px) rotate(3deg)}100%{transform:translateY(0) rotate(-3deg)}}

/* small animated accent lines behind inputs */
.field{position:relative}
.field:after{content:"";position:absolute;left:-10px;right:-10px;bottom:-8px;height:2px;background:linear-gradient(90deg, rgba(255,255,255,0.6), rgba(255,255,255,0));transform:translateX(-6px);opacity:0.6;transition:transform .3s ease}
.field input:focus + .field:after{}
.auth-card .field:after{display:none}

/* subtle modal backdrop */
.modal{background: linear-gradient(180deg, rgba(6,10,22,0.28), rgba(6,10,22,0.48));backdrop-filter: blur(6px)}

/* shimmer overlay for richer effect */
.app-bg.hidden + .modal .bg-shapes .s{opacity:0.9}
.auth-card{backdrop-filter: blur(6px)}
.tab{transition:transform .22s ease, box-shadow .18s ease}
.tab:hover{transform:translateY(-4px);box-shadow:0 12px 30px rgba(10,40,100,0.12)}
.field input{transition:box-shadow .18s ease, transform .12s ease}
.field input:focus{outline:none;transform:translateY(-2px);box-shadow:0 8px 30px rgba(105,125,255,0.15)}
.actions button{background:linear-gradient(90deg,#2446f2,#8f6bff)}

/* Header shown while reset form is active */
.reset-header{padding:10px 12px;margin-bottom:8px;border-radius:10px;text-align:center;color:#08203a;background:linear-gradient(90deg,rgba(142,197,255,0.08),rgba(224,195,252,0.06));font-weight:600}

/* Remembered accounts chooser */
.chooser{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:45}
.chooser-card{width:420px;color:#08203a;padding:18px;border-radius:14px;background:linear-gradient(180deg,#fff,#fbfbff);box-shadow:0 30px 80px rgba(18,52,88,0.08)}
.chooser-header{display:flex;justify-content:space-between;align-items:center;font-weight:700;margin-bottom:10px}
.add-btn{background:linear-gradient(90deg,var(--g1),var(--g2));border:none;color:white;width:36px;height:36px;border-radius:9px;font-size:20px;cursor:pointer}
.link-like.hidden{display:none}
.link-like{background:none;border:none;color:var(--accent);cursor:pointer;padding:6px 8px;border-radius:8px;font-weight:600}
.remembered-list{list-style:none;padding:0;margin:6px 0 12px;display:flex;flex-direction:column;gap:8px}
.remembered-list li{display:flex;align-items:center;gap:10px;padding:10px;border-radius:10px;background:linear-gradient(90deg,#fff,#f7fbff);cursor:pointer}
.acc-avatar{width:40px;height:40px;border-radius:10px;background:linear-gradient(90deg,var(--g1),var(--g2));display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700}
.acc-name{font-weight:700}
.acc-remove{margin-left:auto;background:transparent;border:none;color:var(--muted);font-size:18px;cursor:pointer}

/* floating subtle shapes animation */
.bg-shapes .s1{animation:floatA 8s ease-in-out infinite}
.bg-shapes .s2{animation:floatB 10s ease-in-out infinite}
.bg-shapes .s3{animation:floatC 12s ease-in-out infinite}
@keyframes floatA{0%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(10px) rotate(6deg)}100%{transform:translateY(0) rotate(0deg)}}
@keyframes floatB{0%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(-8px) rotate(-6deg)}100%{transform:translateY(0) rotate(0deg)}}
@keyframes floatC{0%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(6px) rotate(4deg)}100%{transform:translateY(0) rotate(0deg)}}

/* make background more colorful and shimmering */
body:after{content:"";position:fixed;inset:0;z-index:-2;background:radial-gradient(circle at 10% 20%, rgba(142,197,255,0.12), transparent 8%),
  radial-gradient(circle at 80% 80%, rgba(224,195,252,0.12), transparent 12%);
  pointer-events:none;mix-blend-mode:overlay;opacity:0.9;animation:slowPulse 14s ease-in-out infinite}
@keyframes slowPulse{0%{opacity:0.85}50%{opacity:1}100%{opacity:0.85}}

@media(max-width:800px){.auth-card{width:92vw}}

@media(max-width:720px){
  .modal.show{
    align-items:flex-start;
    overflow:auto;
    padding:calc(16px + var(--safe-top)) calc(12px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(12px + var(--safe-left));
  }

  .auth-card,
  .chooser-card{
    width:100%;
    max-width:none;
  }

  .auth-card{
    max-height:calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));
    overflow-y:auto;
    padding:20px 18px 18px;
    overflow-x:hidden;
  }

  .tabs{
    position:relative;
    z-index:1;
    padding:0;
    margin:8px 0 12px;
    background:transparent;
  }

  .tab{
    min-height:44px;
    font-size:15px;
  }

  #back-to-chooser,
  .tabs,
  .tab,
  #chooser-add-btn,
  .chooser-card,
  .remembered-list,
  .remembered-list li,
  .acc-remove{
    position:relative;
    z-index:3;
    pointer-events:auto;
  }
}

/* remember-me checkbox tweaks */
#remember-me{width:16px;height:16px}
#remember-me + span{vertical-align:middle}

/* ============ SEARCH SECTION STYLES ============ */
.search-section {
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0.2));
  border-bottom: 1px solid rgba(0,0,0,0.04);
  margin-bottom: 12px;
  animation: slideDown 0.3s ease-out;
}

.search-section.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-container {
  position: relative;
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  transition: transform 0.24s ease, filter 0.24s ease;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border-radius: 14px;
  border: 2px solid rgba(111, 158, 248, 0.3);
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(248,250,255,0.9));
  color: #08203a;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(111, 158, 248, 0.08);
}

.search-input-wrapper:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 10px 22px rgba(111, 158, 248, 0.12));
}

.search-input-wrapper:hover .search-input {
  box-shadow: 0 8px 24px rgba(111, 158, 248, 0.14);
}

.search-input:focus {
  outline: none;
  border-color: #6f9ef8;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,252,255,0.95));
  box-shadow: 0 8px 28px rgba(111, 158, 248, 0.16);
  transform: translateY(-2px);
}

.search-input::placeholder {
  color: rgba(8, 32, 58, 0.5);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  font-size: 17px;
  line-height: 1;
  color: #6f9ef8;
  pointer-events: none;
  transform: translateY(-52%);
  transform-origin: center;
  transition: transform 0.24s ease, color 0.24s ease;
}

.search-input-wrapper:hover .search-icon,
.search-input:focus + .search-icon {
  transform: translateY(calc(-52% - 1px));
  color: #4f84ef;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,255,0.96));
  border-radius: 14px;
  border: 1px solid rgba(111, 158, 248, 0.2);
  box-shadow: 0 12px 48px rgba(18, 52, 88, 0.15), inset 0 1px 0 rgba(255,255,255,0.6);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1001;
  animation: slideDown 0.25s ease-out;
}

.search-results.hidden {
  display: none !important;
}

.search-results-header {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  background: rgba(255,255,255,0.4);
}

.search-no-results {
  padding: 20px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0,0,0,0.02);
}

.search-result-item:hover {
  background: linear-gradient(90deg, rgba(111, 158, 248, 0.08), rgba(224, 195, 252, 0.06));
  transform: translateX(4px);
}

.search-result-item:active {
  transform: translateX(2px) scale(0.98);
}

.search-result-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6f9ef8, #8ec5ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(111, 158, 248, 0.15);
  transition: all 0.2s ease;
}

.search-result-avatar.has-img {
  background-size: cover;
  background-position: center;
  color: transparent;
}

.search-result-item:hover .search-result-avatar {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(111, 158, 248, 0.25);
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-username {
  font-weight: 700;
  color: #08203a;
  font-size: 14px;
  margin-bottom: 2px;
}

.search-result-display-name {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-arrow {
  flex-shrink: 0;
  color: #6f9ef8;
  font-weight: 600;
  opacity: 0;
  transition: all 0.2s ease;
  font-size: 16px;
}

.search-result-item:hover .search-result-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* Search result actions - buttons container */
.search-result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Message button */
.search-result-message-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  opacity: 0;
  transform: scale(0.8);
}

.search-result-item:hover .search-result-message-btn {
  opacity: 1;
  transform: scale(1);
}

.search-result-message-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.search-result-message-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

@media (hover:none) and (pointer:coarse) {
  .search-result-message-btn {
    opacity: 1;
    transform: none;
  }

  .search-result-arrow {
    opacity: 1;
  }
}

/* Scrollbar styling for search results */
.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
  background: rgba(111, 158, 248, 0.3);
  border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: rgba(111, 158, 248, 0.5);
}

/* Other user profile modal styles */
.profile-modal.other-profile-modal {
  width: min(620px, 94vw);
}

.other-profile-hero{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  padding:10px 0 4px;
}

.other-profile-status-pill{
  padding:6px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  letter-spacing:0.04em;
  color:#fff;
  background:linear-gradient(135deg, rgba(148,163,184,0.7), rgba(100,116,139,0.85));
  box-shadow:0 8px 20px rgba(15,23,42,0.14);
}

.other-profile-status-pill.online{
  background:linear-gradient(135deg, rgba(16,185,129,0.92), rgba(52,211,153,0.82));
}

.other-profile-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.profile-info-card{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:6px;
  padding:14px 16px;
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.018));
  border:1px solid rgba(255,255,255,0.06);
  text-align:left;
  min-width:0;
}

.other-profile-actions{
  display:flex;
  justify-content:center;
  gap:12px;
}

.other-profile-actions .btn{
  width:auto;
  min-width:180px;
  text-align:center;
}

.call-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(8,14,28,0.58);
  backdrop-filter:blur(12px);
  z-index:2600;
}

.call-overlay.hidden{
  display:none !important;
}

.call-modal{
  width:min(460px, 94vw);
  padding:28px 24px 24px;
  border-radius:28px;
  text-align:center;
  background:
    radial-gradient(circle at top, rgba(118,169,255,0.22), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(237,244,255,0.96));
  border:1px solid rgba(127,163,232,0.24);
  box-shadow:0 30px 70px rgba(15,37,70,0.24);
}

.call-modal.with-screen{
  width:min(860px, 96vw);
}

.call-modal.screen-expanded{
  width:min(1220px, 98vw);
}

.call-avatar{
  width:92px;
  height:92px;
  margin:0 auto 14px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#1f6ef6 0%,#7db8ff 100%);
  background-size:cover;
  background-position:center;
  color:#fff;
  font-size:34px;
  font-weight:800;
  box-shadow:0 18px 36px rgba(31,110,246,0.24);
}

.call-avatar.has-img{
  color:transparent;
}

.call-status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  margin-bottom:14px;
  font-size:12px;
  font-weight:800;
  color:#2954b7;
  background:rgba(77,129,240,0.12);
}

.call-title{
  margin:0;
  font-size:28px;
  color:#102847;
}

.call-peer{
  margin-top:8px;
  font-size:18px;
  font-weight:700;
  color:#1f3c66;
}

.call-subtitle{
  margin-top:10px;
  min-height:22px;
  color:#5f7598;
  font-size:14px;
}

.call-meta{
  margin-top:8px;
  font-size:12px;
  font-weight:700;
  color:#4f6f9f;
}

.call-screen-wrap{
  margin-top:18px;
  border-radius:20px;
  overflow:hidden;
  background:rgba(18,39,76,0.08);
  border:1px solid rgba(110,151,233,0.16);
}

.call-screen-wrap.hidden{
  display:none;
}

.call-screen-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  background:rgba(255,255,255,0.46);
  border-bottom:1px solid rgba(110,151,233,0.14);
}

.call-screen-toolbar.hidden{
  display:none;
}

.call-screen-toolbar-label{
  font-size:12px;
  font-weight:800;
  color:#4f6f9f;
  letter-spacing:0.04em;
  text-transform:uppercase;
}

.call-screen-size-group{
  display:flex;
  gap:8px;
}

.call-screen-size-btn{
  min-width:42px;
  padding:8px 10px;
  border:none;
  border-radius:12px;
  background:rgba(95,132,210,0.12);
  color:#2b4d8e;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  transition:transform .18s ease, background .18s ease, color .18s ease;
}

.call-screen-size-btn:hover{
  transform:translateY(-1px);
}

.call-screen-size-btn.active{
  background:linear-gradient(135deg, #1f6ef6 0%, #78a7ff 100%);
  color:#fff;
}

.call-remote-screen{
  display:block;
  width:100%;
  min-height:280px;
  max-height:460px;
  background:#0f1729;
  object-fit:contain;
}

.call-modal[data-screen-size="lg"] .call-remote-screen{
  min-height:360px;
  max-height:62vh;
}

.call-modal[data-screen-size="xl"] .call-remote-screen{
  min-height:460px;
  max-height:72vh;
}

.call-modal.screen-expanded .call-remote-screen{
  min-height:420px;
  max-height:76vh;
}

.call-actions{
  display:flex;
  justify-content:center;
  gap:12px;
  margin-top:24px;
  flex-wrap:wrap;
}

.call-action-btn{
  min-width:128px;
  padding:12px 18px;
  border-radius:16px;
  border:none;
  color:#fff;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.call-action-btn:hover{
  transform:translateY(-1px);
}

.call-action-accept{
  background:linear-gradient(135deg, #21b86c 0%, #4fd995 100%);
  box-shadow:0 14px 28px rgba(33,184,108,0.24);
}

.call-action-decline{
  background:linear-gradient(135deg, #f05767 0%, #d9364d 100%);
  box-shadow:0 14px 28px rgba(217,54,77,0.22);
}

.call-action-muted{
  background:linear-gradient(135deg, #1f6ef6 0%, #78a7ff 100%);
  box-shadow:0 14px 28px rgba(31,110,246,0.22);
}

.call-action-secondary{
  background:linear-gradient(135deg, #6b7ea4 0%, #8da7da 100%);
  box-shadow:0 14px 28px rgba(82,104,149,0.20);
}

#call-remote-audio{
  display:none;
}

body.dark-theme .chat-header-call{
  background:
    radial-gradient(circle at 28% 18%, rgba(255,255,255,0.26), rgba(255,255,255,0) 34%),
    linear-gradient(135deg, #276cf2 0%, #63b4ff 100%);
  border-color:rgba(142,197,255,0.34);
  color:#fff;
  box-shadow:0 14px 30px rgba(42,116,255,0.25), inset 0 1px 0 rgba(255,255,255,0.22);
}

body.dark-theme .call-modal{
  background:
    radial-gradient(circle at top, rgba(97,146,255,0.18), transparent 42%),
    linear-gradient(180deg, rgba(15,24,43,0.96), rgba(12,19,35,0.98));
  border-color:rgba(103,142,225,0.16);
}

body.dark-theme .call-title{
  color:#eef4ff;
}

body.dark-theme .call-peer{
  color:#cfe0ff;
}

body.dark-theme .call-subtitle{
  color:#9eb2d8;
}

body.dark-theme .call-status-badge{
  color:#d8e6ff;
  background:rgba(89,132,230,0.18);
}

body.dark-theme .call-meta{
  color:#aac1e8;
}

body.dark-theme .call-screen-wrap{
  background:rgba(255,255,255,0.04);
  border-color:rgba(103,142,225,0.16);
}

body.dark-theme .call-screen-toolbar{
  background:rgba(255,255,255,0.04);
  border-color:rgba(103,142,225,0.16);
}

body.dark-theme .call-screen-toolbar-label{
  color:#aac1e8;
}

body.dark-theme .call-screen-size-btn{
  background:rgba(103,142,225,0.14);
  color:#dce8ff;
}

.profile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.profile-info-label {
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

.profile-info-value {
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .other-profile-grid{
    grid-template-columns:1fr;
  }
  .admin-stats{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .admin-card{
    grid-template-columns:1fr;
    justify-items:start;
  }
  .admin-card-controls{
    width:100%;
    justify-items:stretch;
  }
  .admin-card-actions{
    justify-content:flex-start;
  }
  .admin-role-select{
    width:100%;
  }
}
/* Settings modal styles */
.settings-inner{
  text-align:left;
  color:#eef2ff;
  max-height:70vh;
  overflow-y:auto;
  overflow-x:hidden;
  padding:4px 14px 0 0;
}

.admin-modal{
  width:min(760px, 96vw);
  padding-top:56px;
}

.admin-inner{
  max-height:74vh;
  padding-top:6px;
  padding-right:10px;
  scrollbar-width:thin;
  scrollbar-color:rgba(96,144,255,0.78) rgba(17,29,52,0.18);
}

.admin-inner::-webkit-scrollbar{
  width:12px;
}

.admin-inner::-webkit-scrollbar-track{
  margin:8px 0;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(15,25,45,0.16), rgba(15,25,45,0.06));
}

.admin-inner::-webkit-scrollbar-thumb{
  border-radius:999px;
  border:3px solid transparent;
  background:
    linear-gradient(180deg, rgba(126,173,255,0.98), rgba(74,117,235,0.92)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.04)) border-box;
  box-shadow:0 8px 18px rgba(58,97,193,0.22);
}

.admin-inner::-webkit-scrollbar-thumb:hover{
  background:
    linear-gradient(180deg, rgba(145,186,255,1), rgba(90,131,240,0.96)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0.08)) border-box;
}

.admin-inner::-webkit-scrollbar-thumb:active{
  background:
    linear-gradient(180deg, rgba(102,156,255,1), rgba(63,108,231,0.98)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0.08)) border-box;
}

body.light-theme .admin-inner{
  scrollbar-color:rgba(93,141,247,0.82) rgba(207,221,247,0.72);
}

body.light-theme .admin-inner::-webkit-scrollbar-track{
  background:linear-gradient(180deg, rgba(214,226,247,0.92), rgba(236,243,255,0.88));
}

body.light-theme .admin-inner::-webkit-scrollbar-thumb{
  background:
    linear-gradient(180deg, rgba(107,152,255,0.98), rgba(75,118,232,0.94)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.85), rgba(225,236,255,0.72)) border-box;
  box-shadow:0 8px 18px rgba(79,115,194,0.18);
}

body.light-theme .admin-inner::-webkit-scrollbar-thumb:hover{
  background:
    linear-gradient(180deg, rgba(124,166,255,1), rgba(90,131,238,0.96)) padding-box,
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(227,238,255,0.76)) border-box;
}

.admin-hero{
  display:flex;
  gap:14px;
  align-items:flex-start;
  padding:18px 20px;
  border-radius:20px;
  background:
    radial-gradient(circle at top right, rgba(113,160,255,0.18), transparent 42%),
    linear-gradient(180deg, rgba(16,31,58,0.96), rgba(11,22,43,0.92));
  border:1px solid rgba(126,170,255,0.16);
  box-shadow:0 18px 40px rgba(8,16,32,0.24);
}

.admin-hero-badge{
  min-width:54px;
  height:54px;
  border-radius:18px;
  display:grid;
  place-items:center;
  font-size:11px;
  font-weight:800;
  letter-spacing:1.2px;
  color:#f8fbff;
  background:linear-gradient(135deg, rgba(91,143,255,0.96), rgba(60,105,220,0.88));
  box-shadow:0 12px 28px rgba(63,98,180,0.3);
}

.admin-hero-copy{
  display:grid;
  gap:6px;
}

.admin-hero-title{
  font-size:18px;
  font-weight:700;
  color:#f8fbff;
}

.admin-hero-text{
  font-size:13px;
  line-height:1.5;
  color:rgba(226,234,255,0.76);
}

.admin-panel-note{
  margin:16px 0 12px;
  padding:10px 14px;
  border-radius:14px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.05);
  font-size:13px;
  color:rgba(231,238,255,0.78);
}

.admin-stats{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
  margin-top:16px;
}

.admin-stat-card{
  padding:12px 14px;
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
  border:1px solid rgba(255,255,255,0.06);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.03);
}

.admin-stat-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:rgba(211,224,255,0.64);
}

.admin-stat-value{
  margin-top:6px;
  font-size:22px;
  font-weight:800;
  color:#f8fbff;
}

.admin-toolbar{
  display:grid;
  gap:12px;
  margin-top:16px;
}

.admin-search-shell{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:18px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.06);
}

.admin-search-icon{
  font-size:14px;
  color:rgba(216,228,255,0.65);
}

.admin-search-input{
  flex:1;
  min-width:0;
  border:none;
  outline:none;
  background:transparent;
  color:#f8fbff;
  font-size:14px;
}

.admin-search-input::placeholder{
  color:rgba(216,228,255,0.46);
}

.admin-filter-chips{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.admin-filter-chip{
  padding:9px 12px;
  border-radius:999px;
  border:1px solid rgba(126,170,255,0.14);
  background:rgba(255,255,255,0.03);
  color:rgba(223,233,255,0.78);
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  transition:transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.admin-filter-chip:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,0.06);
}

.admin-filter-chip.active{
  color:#f8fbff;
  background:linear-gradient(135deg, rgba(92,139,255,0.92), rgba(63,105,220,0.82));
  border-color:rgba(145,182,255,0.28);
  box-shadow:0 10px 22px rgba(47,82,173,0.2);
}

.admin-list{
  display:grid;
  gap:12px;
  margin-top:12px;
}

.admin-card{
  display:grid;
  grid-template-columns:auto minmax(0, 1fr) auto;
  gap:14px;
  align-items:center;
  padding:14px 16px;
  border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,0.038), rgba(255,255,255,0.018));
  border:1px solid rgba(255,255,255,0.05);
}

.admin-card-avatar{
  width:50px;
  height:50px;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-size:18px;
  font-weight:800;
  color:#fff;
  background:linear-gradient(135deg,#5f8fff 0%,#406dd1 100%);
  background-size:cover;
  background-position:center;
}

.admin-card-avatar.has-img{
  color:transparent;
}

.admin-card-main{
  min-width:0;
  display:grid;
  gap:4px;
}

.admin-card-name{
  font-size:15px;
  font-weight:700;
  color:#f8fbff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.admin-card-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  color:rgba(217,227,255,0.72);
  font-size:12px;
}

.admin-card-handle{
  color:rgba(217,227,255,0.62);
}

.admin-status-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#7d8ca6;
  box-shadow:0 0 0 4px rgba(125,140,166,0.12);
}

.admin-status-dot.online{
  background:#21c680;
  box-shadow:0 0 0 4px rgba(33,198,128,0.14);
}

.admin-role-tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(87,127,233,0.16);
  border:1px solid rgba(121,161,255,0.2);
  color:#dce8ff;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.04em;
}

.admin-role-tag.owner{
  background:rgba(255,186,78,0.16);
  border-color:rgba(255,202,107,0.28);
  color:#ffe8bc;
}

.admin-ban-tag{
  background:rgba(255,103,103,0.14);
  border-color:rgba(255,123,123,0.2);
  color:#ffd2d2;
}

.admin-card-controls{
  display:grid;
  justify-items:end;
  align-content:start;
  gap:6px;
}

.admin-card-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
  max-width:260px;
}

.admin-quick-btn{
  padding:6px 9px;
  border-radius:10px;
  border:1px solid rgba(132,166,255,0.14);
  background:rgba(255,255,255,0.035);
  color:#e5eeff;
  font-size:11px;
  line-height:1.15;
  font-weight:700;
  cursor:pointer;
  transition:transform .18s ease, background .18s ease, border-color .18s ease;
}

.admin-quick-btn:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,0.08);
  border-color:rgba(160,188,255,0.24);
}

.admin-role-select{
  min-width:142px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(132,166,255,0.16);
  background:rgba(8,16,32,0.48);
  color:#f7fbff;
  font-size:13px;
  font-weight:600;
  outline:none;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.03);
}

.admin-role-select:focus{
  border-color:rgba(137,178,255,0.34);
  box-shadow:0 0 0 4px rgba(98,142,245,0.14);
}

.admin-role-lock{
  font-size:12px;
  color:rgba(215,227,255,0.62);
}

.admin-empty{
  padding:24px 18px;
  border-radius:18px;
  text-align:center;
  color:rgba(223,233,255,0.7);
  background:linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border:1px dashed rgba(140,170,230,0.18);
}

.admin-log-view{
  max-height:56vh;
  overflow:auto;
  padding-right:6px;
  display:grid;
  gap:8px;
}

.admin-log-line{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(10,18,36,0.6);
  border:1px solid rgba(126,170,255,0.1);
  font-size:12px;
  line-height:1.55;
  color:#e8f0ff;
  word-break:break-word;
}

.admin-log-empty{
  color:rgba(227,236,255,0.72);
}

.settings-hero{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:16px 18px;
  margin-top:0;
  border-radius:18px;
  background:
    radial-gradient(circle at top right, rgba(93,148,255,0.24), transparent 38%),
    linear-gradient(180deg, rgba(16,31,58,0.96), rgba(11,22,43,0.92));
  border:1px solid rgba(126,170,255,0.18);
  box-shadow:0 18px 40px rgba(8,16,32,0.28), inset 0 1px 0 rgba(255,255,255,0.05);
  animation:settingsHeroIn .34s cubic-bezier(.22,.88,.32,1);
}

.settings-hero-badge{
  min-width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-size:12px;
  font-weight:800;
  letter-spacing:1.3px;
  color:#dfeaff;
  background:linear-gradient(135deg, rgba(90,144,255,0.92), rgba(41,103,231,0.88));
  box-shadow:0 10px 22px rgba(38,98,214,0.28);
}

.settings-hero-copy{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.settings-hero-title{
  font-size:17px;
  font-weight:800;
  color:#f4f8ff;
}

.settings-hero-text{
  font-size:13px;
  line-height:1.55;
  color:rgba(227,236,255,0.72);
}

#settings-back:hover{
  transform:translateY(-2px);
}

.settings-group{
  margin:18px 0 0;
  padding:16px;
  border-radius:18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
  border:1px solid rgba(255,255,255,0.06);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.03), 0 16px 30px rgba(7,17,34,0.10);
}

.settings-group-title{
  margin:0 0 14px;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:1.2px;
  color:rgba(178,199,239,0.74);
}

.danger-title{
  color:rgba(255,141,141,0.82);
}

.settings-toggle,
.settings-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:13px 0;
  position:relative;
}

.settings-toggle + .settings-toggle,
.settings-toggle + .settings-row,
.settings-row + .settings-toggle,
.settings-row + .settings-row{
  border-top:1px solid rgba(255,255,255,0.05);
}

.toggle-label{
  color:rgba(255,255,255,0.88);
  cursor:pointer;
  flex:1;
}

.settings-label-stack{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}

.settings-label,
.settings-label-title{
  font-size:14px;
  font-weight:700;
  color:#eef4ff;
}

.settings-label-note{
  font-size:12px;
  line-height:1.45;
  color:rgba(181,196,225,0.68);
}

.toggle-input{
  display:none;
}

.toggle-switch{
  position:relative;
  width:48px;
  height:28px;
  background:rgba(255,255,255,0.12);
  border-radius:999px;
  transition:background .25s ease, box-shadow .25s ease, transform .25s ease;
  cursor:pointer;
  flex-shrink:0;
  box-shadow:inset 0 1px 2px rgba(0,0,0,0.16);
}

.toggle-switch:after{
  content:"";
  position:absolute;
  left:3px;
  top:3px;
  width:22px;
  height:22px;
  background:linear-gradient(180deg, #ffffff, #dce7ff);
  border-radius:50%;
  transition:left .25s ease, transform .25s ease;
  box-shadow:0 4px 10px rgba(7,17,34,0.22);
}

.settings-toggle:hover .toggle-switch{
  transform:translateY(-1px);
}

.settings-toggle > input:checked ~ .toggle-switch{
  background:linear-gradient(90deg, rgba(42,92,194,0.95), rgba(74,146,255,0.95));
  box-shadow:0 0 0 4px rgba(79,141,255,0.12);
}

.settings-toggle > input:checked ~ .toggle-switch:after{
  left:23px;
}

.settings-select{
  flex:0 0 170px;
  max-width:170px;
  padding:11px 13px;
  border-radius:12px;
  border:1px solid rgba(157,187,255,0.16);
  background:rgba(6,13,28,0.34);
  color:#fff;
  font-size:13px;
  cursor:pointer;
  outline:none;
  transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.settings-select:hover,
.settings-select:focus{
  border-color:rgba(114,173,255,0.34);
  box-shadow:0 0 0 3px rgba(114,173,255,0.10);
  transform:translateY(-1px);
}

.settings-select option{
  background:#16233d;
  color:#fff;
}

.settings-button-row{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  margin-top:12px;
}

.settings-button-row .btn{
  margin:0;
  min-height:44px;
}

.settings-danger{
  border-color:rgba(255,100,100,0.14);
  background:linear-gradient(180deg, rgba(255,100,100,0.055), rgba(255,100,100,0.018));
}

.settings-danger-note{
  margin:-4px 0 14px;
  font-size:12px;
  line-height:1.45;
  color:rgba(255,201,201,0.72);
}

.settings-back-button{
  margin-top:18px;
}

.settings-inline-summary{
  font-size:12px;
  color:rgba(143,176,233,0.88);
  font-weight:700;
  letter-spacing:.02em;
}

.settings-mini-trigger{
  min-width:116px;
  min-height:42px;
  padding:0 14px;
  border:none;
  border-radius:12px;
  cursor:pointer;
  color:#eff5ff;
  background:linear-gradient(180deg, rgba(56,104,206,0.92), rgba(42,86,179,0.92));
  box-shadow:0 10px 22px rgba(29,67,147,0.22);
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.settings-mini-trigger:hover,
.settings-mini-trigger.active{
  transform:translateY(-1px);
  box-shadow:0 14px 28px rgba(29,67,147,0.26);
  filter:saturate(1.05);
}

.settings-mini-panel{
  margin-top:-2px;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(126,170,255,0.14);
  background:linear-gradient(180deg, rgba(10,21,43,0.44), rgba(8,17,34,0.24));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 30px rgba(8,16,32,0.16);
  animation:settingsPanelReveal .24s ease;
}

.settings-slider-block + .settings-slider-block{
  margin-top:14px;
}

.settings-slider-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}

.settings-slider-label{
  font-size:13px;
  font-weight:700;
  color:#eef4ff;
}

.settings-slider-value{
  font-size:12px;
  font-weight:700;
  color:rgba(143,176,233,0.92);
}

.settings-range{
  width:100%;
  height:6px;
  appearance:none;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(227,236,251,0.95), rgba(214,227,248,0.95));
  border:none;
  box-shadow:none;
  outline:none;
  transition:filter .18s ease, opacity .18s ease;
}

.settings-range:hover{
  filter:brightness(0.99);
}

.settings-range::-webkit-slider-thumb{
  appearance:none;
  width:12px;
  height:44px;
  margin-top:-19px;
  border-radius:50%;
  border:none;
  background:linear-gradient(180deg, #78a8ff 0%, #4d84f6 100%);
  box-shadow:none;
  cursor:pointer;
}

.settings-range::-moz-range-thumb{
  width:12px;
  height:44px;
  border-radius:50%;
  border:none;
  background:linear-gradient(180deg, #78a8ff 0%, #4d84f6 100%);
  box-shadow:none;
  cursor:pointer;
}

.settings-range::-moz-range-track{
  height:6px;
  border:none;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(227,236,251,0.95), rgba(214,227,248,0.95));
}

body.dark-theme .settings-range{
  background:linear-gradient(180deg, rgba(52,65,91,0.96), rgba(44,56,80,0.96));
}

body.dark-theme .settings-range::-moz-range-track{
  background:linear-gradient(180deg, rgba(52,65,91,0.96), rgba(44,56,80,0.96));
}

body.dark-theme .settings-range::-webkit-slider-thumb,
body.dark-theme .settings-range::-moz-range-thumb{
  background:linear-gradient(180deg, #77a7ff 0%, #5c8df2 100%);
}

.settings-mini-actions{
  margin-top:14px;
  display:flex;
  justify-content:flex-end;
}

.settings-preview-card{
  margin-top:14px;
  padding:14px;
  border-radius:15px;
  border:1px solid rgba(146,181,242,0.12);
  background:linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.settings-preview-title{
  margin-bottom:10px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:rgba(185,206,243,0.72);
}

.settings-font-preview-line-title{
  font-size:calc(18px * var(--ui-font-scale));
  font-weight:800;
  color:#f2f7ff;
}

.settings-font-preview-line-body{
  margin-top:6px;
  font-size:calc(14px * var(--ui-font-scale));
  line-height:1.55;
  color:rgba(235,242,255,0.92);
}

.settings-font-preview-line-note{
  margin-top:6px;
  font-size:calc(12px * var(--ui-font-scale));
  color:rgba(181,196,225,0.72);
}

.settings-message-preview{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.settings-preview-bubble{
  max-width:min(var(--message-width-percent), calc(360px * var(--message-scale-factor)));
  padding:calc(11px * var(--message-scale-factor)) calc(13px * var(--message-scale-factor));
  border-radius:calc(18px * var(--message-scale-factor));
  box-shadow:0 10px 24px rgba(13,27,53,0.12);
}

.settings-preview-bubble-incoming{
  align-self:flex-start;
  background:linear-gradient(180deg, rgba(255,255,255,0.94), rgba(244,249,255,0.98));
  color:#162742;
}

.settings-preview-bubble-own{
  align-self:flex-end;
  background:linear-gradient(135deg, #215cf3 0%, #7fb0ff 100%);
  color:#fff;
}

.settings-preview-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:calc(6px * var(--message-scale-factor));
  font-size:calc(11px * var(--ui-font-scale));
  opacity:.78;
}

.settings-preview-text{
  font-size:calc(14px * var(--ui-font-scale));
  line-height:calc(1.48 * var(--message-scale-factor));
}

.settings-preview-voice{
  display:flex;
  align-items:center;
  gap:calc(12px * var(--message-scale-factor));
  width:min(calc(360px * var(--message-media-scale-factor)), 100%);
  padding:calc(10px * var(--message-scale-factor)) calc(12px * var(--message-scale-factor));
  border-radius:calc(18px * var(--message-scale-factor));
  align-self:flex-start;
  background:linear-gradient(135deg, #215cf3 0%, #7fb0ff 100%);
  color:#fff;
  box-shadow:0 10px 24px rgba(13,27,53,0.12);
}

.settings-preview-voice-play{
  width:calc(42px * var(--message-media-scale-factor));
  height:calc(42px * var(--message-media-scale-factor));
  border:none;
  border-radius:50%;
  flex-shrink:0;
  background:rgba(255,255,255,0.18);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.14);
  display:grid;
  place-items:center;
}

.settings-preview-voice-play-icon{
  width:0;
  height:0;
  border-top:calc(8px * var(--message-media-scale-factor)) solid transparent;
  border-bottom:calc(8px * var(--message-media-scale-factor)) solid transparent;
  border-left:calc(12px * var(--message-media-scale-factor)) solid rgba(255,255,255,0.96);
  margin-left:calc(3px * var(--message-media-scale-factor));
}

.settings-preview-voice-body{
  min-width:0;
  flex:1;
}

.settings-preview-voice-wave{
  height:calc(26px * var(--message-media-scale-factor));
  display:flex;
  align-items:center;
  gap:calc(2px * var(--message-media-scale-factor));
}

.settings-preview-voice-wave span{
  width:calc(3px * var(--message-media-scale-factor));
  height:100%;
  border-radius:999px;
  background:rgba(255,255,255,0.36);
  transform:scaleY(var(--preview-bar-scale, .4));
  transform-origin:center;
}

.settings-preview-voice-footer{
  margin-top:calc(6px * var(--message-scale-factor));
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:calc(11px * var(--ui-font-scale));
  color:rgba(255,255,255,0.82);
}

.btn-danger{
  background:linear-gradient(180deg, rgba(255,100,100,0.14), rgba(255,100,100,0.07));
}

.btn-danger:hover{
  background:linear-gradient(180deg, rgba(255,100,100,0.18), rgba(255,100,100,0.10));
  box-shadow:0 10px 24px rgba(255,100,100,0.12);
}

@keyframes settingsHeroIn{
  from{
    opacity:0;
    transform:translateY(10px) scale(.985);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

@keyframes settingsPanelReveal{
  from{
    opacity:0;
    transform:translateY(-6px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

body.hide-online-status .chat-status-dot,
body.hide-online-status .status-dot,
body.hide-online-status .other-profile-status-pill{
  display:none !important;
}

body.hide-online-status #chat-subtitle,
body.hide-online-status #other-profile-last-seen{
  color:rgba(181,196,225,0.72);
}

body #chat-title{
  font-size:calc(20px * var(--ui-font-scale));
}

body #chat-subtitle{
  font-size:calc(13px * var(--ui-font-scale));
}

body .chat-info-name,
body .message-author,
body .toggle-label,
body .settings-label,
body .settings-label-title,
body .profile-input,
body .btn,
body .search-input,
body #text{
  font-size:calc(14px * var(--ui-font-scale));
}

body .chat-info-preview,
body .message-time,
body .message-attachment-caption,
body .settings-label-note,
body .profile-username{
  font-size:calc(12px * var(--ui-font-scale));
}

body.compact-mode #left-panel{
  gap:12px;
  padding:16px 14px;
}

body.compact-mode .chat-list{
  gap:6px;
}

body.compact-mode .chat-list li{
  gap:10px;
  padding:9px 10px;
  min-height:54px;
}

body.compact-mode .chat-avatar{
  width:36px;
  height:36px;
  font-size:14px;
}

body.compact-mode #messages{
  padding:18px 18px 14px;
  gap:9px;
}

body.compact-mode .message-row{
  margin-bottom:6px;
}

body.compact-mode .message-bubble{
  box-shadow:0 10px 22px rgba(16,40,71,0.07);
}

body.compact-mode #composer{
  padding:12px 14px 12px;
}

body.compact-mode .composer-input-shell{
  padding:8px 9px;
}

body.compact-mode .composer-tool{
  width:34px;
  height:34px;
}

body.compact-mode .composer-send{
  width:42px;
  height:42px;
}

body.compact-mode .chat-header-profile{
  padding:10px 12px;
}

body.compact-mode .chat-header-avatar{
  width:40px;
  height:40px;
}

body.compact-mode .chat-header-main{
  gap:4px;
}

body.compact-mode .chat-info-preview{
  line-height:1.25;
}

@media (max-width: 640px){
  .settings-hero{
    padding:14px;
  }

  .settings-toggle,
  .settings-row{
    align-items:flex-start;
  }

  .settings-button-row{
    grid-template-columns:1fr;
  }

  .settings-select{
    flex:1;
    max-width:none;
  }
}

/* Toast Notifications */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; max-width: 400px; }

.toast { 
  background: linear-gradient(180deg, rgba(30,30,50,0.95), rgba(20,20,40,0.95)); 
  border: 1px solid rgba(100,200,255,0.2); 
  border-radius: 12px; 
  padding: 16px 20px; 
  border-left: 4px solid rgba(100,200,255,0.6);
  display: flex; 
  align-items: center; 
  gap: 12px;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: slideInRight 0.3s ease-out, slideOutRight 0.3s ease-in 2.7s forwards;
  backdrop-filter: blur(10px);
}

.toast.success { border-left-color: rgba(100,255,100,0.6); }
.toast.error { border-left-color: rgba(255,100,100,0.6); }
.toast.info { border-left-color: rgba(100,200,255,0.6); }
.toast.warning { border-left-color: rgba(255,200,100,0.6); }

.toast-icon { width: 22px; height:22px; flex-shrink: 0; display:grid; place-items:center; }
.toast-icon .ui-icon{ width:22px; height:22px; }
.toast.success .toast-icon { color: #64ff64; }
.toast.error .toast-icon { color: #ff6464; }
.toast.info .toast-icon { color: #64c8ff; }
.toast.warning .toast-icon { color: #ffc864; }

@keyframes slideInRight {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(400px); opacity: 0; }
}

/* Modal Dialog */
.dialog-overlay { 
  position: fixed; 
  top: 0; left: 0; 
  width: 100%; height: 100%; 
  background: rgba(0,0,0,0.5); 
  backdrop-filter: blur(3px);
  display: flex; 
  align-items: center; 
  justify-content: center; 
  z-index: 10001;
  animation: fadeIn 0.2s ease-out;
}

.dialog { 
  background: linear-gradient(180deg, rgba(30,30,50,0.98), rgba(20,20,40,0.98)); 
  border: 1px solid rgba(100,200,255,0.2); 
  border-radius: 16px; 
  padding: 32px; 
  max-width: 450px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
}

.dialog-title { 
  font-size: 18px; 
  font-weight: 600; 
  color: rgba(255,255,255,0.95); 
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-title-icon { width: 26px; height: 26px; display:grid; place-items:center; flex:0 0 auto; }
.dialog-title-icon .ui-icon{ width:26px; height:26px; }

.dialog-body { 
  font-size: 14px; 
  color: rgba(255,255,255,0.8); 
  margin-bottom: 24px; 
  line-height: 1.6;
}

.dialog-input { 
  width: 100%; 
  padding: 10px 14px; 
  border-radius: 8px; 
  border: 1px solid rgba(255,255,255,0.1); 
  background: rgba(0,0,0,0.3); 
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  margin-bottom: 20px;
  transition: all 0.2s;
}

.dialog-input:focus { 
  outline: none; 
  border-color: rgba(100,200,255,0.4); 
  background: rgba(0,0,0,0.4);
  box-shadow: 0 0 10px rgba(100,200,255,0.2);
}

.dialog-buttons { 
  display: flex; 
  gap: 12px; 
  justify-content: flex-end;
}

.dialog-btn { 
  padding: 10px 20px; 
  border-radius: 8px; 
  border: none; 
  cursor: pointer; 
  font-size: 14px; 
  font-weight: 500;
  transition: all 0.2s;
  flex: 0 1 auto;
}

.dialog-btn-primary { 
  background: linear-gradient(135deg, #2575fc, #0d47a1); 
  color: #fff;
}

.dialog-btn-primary:hover { 
  box-shadow: 0 4px 14px rgba(37,117,252,0.4); 
  transform: translateY(-2px);
}

.dialog-btn-secondary { 
  background: rgba(255,255,255,0.1); 
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
}

.dialog-btn-secondary:hover { 
  background: rgba(255,255,255,0.15); 
  transform: translateY(-2px);
}

.dialog-btn-danger { 
  background: linear-gradient(135deg, rgba(255,100,100,0.3), rgba(255,50,50,0.2)); 
  color: rgba(255,100,100,0.9);
  border: 1px solid rgba(255,100,100,0.3);
}

.dialog-btn-danger:hover { 
  background: linear-gradient(135deg, rgba(255,100,100,0.4), rgba(255,50,50,0.3)); 
  box-shadow: 0 4px 14px rgba(255,100,100,0.2);
  transform: translateY(-2px);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { 
    opacity: 0; 
    transform: scale(0.9);
  }
  to { 
    opacity: 1; 
    transform: scale(1);
  }
}
/* Beautiful Chat System */
.chats-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #0f2749;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chats-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}

.chats-title-row .chats-title{
  margin-bottom:0;
}

.chat-create-btn{
  width:34px;
  height:34px;
  border:0;
  border-radius:10px;
  cursor:pointer;
  color:#fff;
  font-size:22px;
  line-height:1;
  background:linear-gradient(135deg, #1f6ef6 0%, #78a7ff 100%);
  box-shadow:0 10px 22px rgba(31,110,246,0.24);
}

.chat-create-btn:hover{
  transform:translateY(-1px);
}

.space-modal{
  width:min(680px, 94vw);
  padding-top:56px;
}

.space-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:10px 0 14px;
}

.space-tab{
  border:1px solid rgba(255,255,255,0.10);
  border-radius:12px;
  padding:10px 12px;
  background:rgba(255,255,255,0.05);
  color:#fff;
  cursor:pointer;
  font-weight:700;
}

.space-tab.active{
  background:linear-gradient(135deg, #1f6ef6 0%, #78a7ff 100%);
  border-color:transparent;
}

.space-check{
  display:flex;
  align-items:center;
  gap:10px;
  margin:12px 0;
  color:rgba(255,255,255,0.85);
  font-size:14px;
}

.space-check input{
  width:18px;
  height:18px;
}

.space-manage{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,0.10);
}

.space-manage-title{
  margin-bottom:12px;
  color:#eef2ff;
  font-weight:800;
}

.space-member-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:12px;
}

.space-member-row{
  display:grid;
  grid-template-columns:1fr 128px auto;
  gap:8px;
  align-items:center;
  padding:10px;
  border-radius:12px;
  background:rgba(255,255,255,0.06);
}

.space-member-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#fff;
  font-weight:700;
}

.space-member-role{
  width:100%;
  border:1px solid rgba(255,255,255,0.10);
  border-radius:10px;
  padding:8px;
  background:#111827;
  color:#fff;
}

.space-member-remove{
  border:0;
  border-radius:10px;
  padding:8px 10px;
  color:#fff;
  background:rgba(255,90,90,0.20);
  cursor:pointer;
}

.chat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.chat-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: 0 4px 12px rgba(15, 39, 73, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(10, 50, 100, 0.04);
  min-height: 66px;
  flex: 0 0 auto;
  touch-action: manipulation;
}

.chat-list li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.chat-list li:hover {
  transform: translateX(4px);
  background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 100%);
  box-shadow: 0 6px 20px rgba(15, 39, 73, 0.12);
}

.chat-list li:hover::before {
  opacity: 1;
}

.chat-list li.active {
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(15, 39, 73, 0.25);
  border-color: rgba(255, 255, 255, 0.2);
}

.chat-list li.chat-list-item-unread {
  background: linear-gradient(135deg, #f2f8ff 0%, #e5f0ff 100%);
  border-color: rgba(31, 110, 246, 0.28);
  box-shadow: 0 12px 28px rgba(31, 110, 246, 0.16);
  animation: unreadNudge 1.8s ease-in-out infinite, unreadGlow 2s ease-in-out infinite;
}

.chat-list li.chat-list-item-unread::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  width: 6px;
  height: 28px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #1f6ef6 0%, #72adff 100%);
  box-shadow: 0 0 14px rgba(31, 110, 246, 0.35);
}

.chat-list li.chat-list-item-unread .chat-info-name {
  color: #0f3f87;
  font-weight: 800;
}

.chat-list li.chat-list-item-unread .chat-info-preview {
  color: #32527c;
  font-weight: 700;
}

.chat-list li.chat-list-item-unread .chat-info-time {
  color: #1f6ef6;
  font-weight: 700;
}

.chat-list li.active.chat-list-item-unread::after {
  background: rgba(255,255,255,0.9);
  box-shadow: none;
}

.chat-list li.active.chat-list-item-unread {
  animation: none;
}

.chat-list li.active .chat-info-name {
  font-weight: 700;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.chat-avatar.public {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chat-avatar.private {
  background: linear-gradient(135deg, #ff7eb3 0%, #7afcff 100%);
  background-size: 100% 100%;
}

.chat-avatar-text {
  position: relative;
  z-index: 2;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-status-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  bottom: 2px;
  right: 2px;
  border: 2px solid rgba(255,255,255,0.92);
  box-shadow: 0 2px 8px rgba(15, 39, 73, 0.16);
}

.chat-status-dot.online {
  background: #10b981;
}

.chat-status-dot.offline {
  background: #94a3b8;
}

.chat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.chat-info-name {
  font-weight: 600;
  color: #0f2749;
  font-size: calc(14px * var(--ui-font-scale));
  transition: all 0.3s ease;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list li.active .chat-info-name {
  color: #fff;
}

.chat-info-time {
  font-size: 10px;
  color: #7a89a0;
  flex-shrink: 0;
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.chat-list li.active .chat-info-time {
  color: rgba(255, 255, 255, 0.8);
}

.chat-info-preview {
  font-size: calc(13px * var(--ui-font-scale));
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.chat-list li.active .chat-info-preview {
  color: rgba(255, 255, 255, 0.85);
}

.chat-unread-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1f6ef6 0%, #72adff 100%);
  color: white;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(31, 110, 246, 0.28);
  animation: pulseBadge 1.2s ease-in-out infinite;
}

.chat-list li.active .chat-unread-badge {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  animation: none;
}

@keyframes pulseBadge {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.16);
  }
}

@keyframes unreadNudge {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(2px);
  }
  40% {
    transform: translateX(-1px);
  }
  60% {
    transform: translateX(2px);
  }
}

@keyframes unreadGlow {
  0%, 100% {
    box-shadow: 0 12px 28px rgba(31, 110, 246, 0.14);
  }
  50% {
    box-shadow: 0 16px 34px rgba(31, 110, 246, 0.24);
  }
}

@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat refresh */
#chat-pane{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
  background:
    radial-gradient(circle at top right, rgba(142,197,255,0.22), transparent 30%),
    linear-gradient(180deg, #f7fbff 0%, #eef4ff 100%);
}

#chat-header{
  padding:20px 24px 18px;
  border-bottom:1px solid rgba(80,110,170,0.12);
  background:rgba(255,255,255,0.72);
  backdrop-filter:blur(12px);
  animation:chatHeaderReveal .45s cubic-bezier(.2,.9,.2,1);
}

.chat-header-row{
  display:flex;
  align-items:center;
  gap:14px;
}

.chat-header-back{
  flex:0 0 44px;
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(110,151,233,0.18);
  background:linear-gradient(180deg, rgba(255,255,255,0.95), rgba(229,239,255,0.92));
  color:#1f6ef6;
  display:grid;
  place-items:center;
  font-size:20px;
  cursor:pointer;
  box-shadow:0 8px 20px rgba(31,110,246,0.10);
}

.chat-header-profile{
  flex:1;
  min-width:0;
  display:flex;
  align-items:center;
  gap:14px;
  padding:0;
  border:0;
  background:transparent;
  text-align:left;
  color:inherit;
  cursor:pointer;
}

.chat-header-profile.chat-header-profile-idle{
  gap:0;
}

.chat-header-profile.chat-header-profile-idle .chat-header-avatar{
  display:none;
}

.chat-header-profile:disabled{
  cursor:default;
}

.chat-header-call{
  flex:0 0 48px;
  width:48px;
  height:48px;
  border-radius:16px;
  border:1px solid rgba(122,164,255,0.28);
  background:
    radial-gradient(circle at 28% 18%, rgba(255,255,255,0.95), rgba(255,255,255,0) 34%),
    linear-gradient(135deg, #1f6ef6 0%, #5fa8ff 100%);
  color:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 12px 26px rgba(31,110,246,0.24), inset 0 1px 0 rgba(255,255,255,0.36);
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease, filter .18s ease;
  margin-right:2px;
  position:relative;
  overflow:hidden;
}

.chat-header-call::after{
  content:"";
  position:absolute;
  inset:8px 9px auto auto;
  width:7px;
  height:7px;
  border-radius:50%;
  background:rgba(255,255,255,0.62);
  box-shadow:0 0 14px rgba(255,255,255,0.54);
}

.chat-call-icon-wrap{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  position:relative;
  z-index:1;
}

.chat-call-icon{
  width:28px;
  height:28px;
  display:block;
}

.chat-header-call:hover:not(:disabled){
  transform:translateY(-1px);
  filter:saturate(1.08);
  box-shadow:0 16px 32px rgba(31,110,246,0.30), inset 0 1px 0 rgba(255,255,255,0.42);
}

.chat-header-call:disabled{
  opacity:.5;
  cursor:not-allowed;
  filter:grayscale(.2);
  box-shadow:0 8px 18px rgba(31,110,246,0.12), inset 0 1px 0 rgba(255,255,255,0.26);
}

.chat-header-avatar{
  width:46px;
  height:46px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  font-size:18px;
  font-weight:800;
  color:#fff;
  background:linear-gradient(135deg,#ff7eb3 0%,#7afcff 100%);
  background-size:100% 100%;
  background-position:center;
  box-shadow:0 10px 24px rgba(34,74,140,0.18);
}

.chat-header-avatar.has-img{
  color:transparent;
}

.chat-header-main{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}

#chat-title{
  font-size:calc(20px * var(--ui-font-scale));
  font-weight:800;
  color:#102847;
  letter-spacing:-0.02em;
}

#chat-subtitle{
  font-size:calc(13px * var(--ui-font-scale));
  color:#667a96;
}

#messages{
  flex:1;
  overflow:auto;
  padding:24px;
  display:flex;
  flex-direction:column;
  gap:12px;
  scroll-behavior:smooth;
  scrollbar-width:auto;
  scrollbar-color:rgba(31,110,246,0.78) rgba(214,227,250,0.75);
}

#messages::-webkit-scrollbar{
  width:16px;
}

#messages::-webkit-scrollbar-track{
  background:linear-gradient(180deg, rgba(246,250,255,0.92), rgba(220,232,250,0.92));
  border-radius:999px;
  border:1px solid rgba(162,186,228,0.28);
  box-shadow:inset 0 1px 8px rgba(102,130,184,0.10);
}

#messages::-webkit-scrollbar-thumb{
  border:3px solid rgba(245,248,255,0.95);
  border-radius:999px;
  background:linear-gradient(180deg, #1f6ef6 0%, #4e8fff 45%, #7db8ff 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.42),
    0 4px 12px rgba(31,110,246,0.22);
}

#messages::-webkit-scrollbar-thumb:hover{
  background:linear-gradient(180deg, #1564ef 0%, #3f84fb 45%, #6dafff 100%);
}

#messages::-webkit-scrollbar-thumb:active{
  background:linear-gradient(180deg, #1259d4 0%, #3578ef 45%, #5ca3fb 100%);
}

.messages-unread-divider{
  display:flex;
  align-items:center;
  gap:12px;
  margin:4px 0 2px;
  color:#d84d57;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.08em;
}

.messages-unread-divider::before,
.messages-unread-divider::after{
  content:"";
  flex:1;
  height:1px;
  background:linear-gradient(90deg, rgba(216,77,87,0.16), rgba(216,77,87,0.5), rgba(216,77,87,0.16));
}

.message{
  display:flex;
  width:100%;
  padding:0;
  margin:0;
  background:transparent;
  box-shadow:none;
  border:none;
  animation:messageIn .28s cubic-bezier(.22,.88,.32,1);
  transform-origin:bottom left;
}

.message.message-no-animate{
  animation:none;
}

.message.own{
  justify-content:flex-end;
  transform-origin:bottom right;
}

.message-bubble{
  max-width:min(var(--message-width-percent), calc(640px * var(--message-scale-factor)));
  border-radius:22px;
  padding:calc(14px * var(--message-scale-factor)) calc(16px * var(--message-scale-factor));
  border-radius:calc(22px * var(--message-scale-factor));
  box-shadow:0 14px 34px rgba(16,40,71,0.08);
  border:1px solid rgba(99,128,180,0.12);
  position:relative;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.message:hover .message-bubble{
  transform:translateY(-1px);
  box-shadow:0 18px 38px rgba(16,40,71,0.12);
}

.message.incoming .message-bubble{
  background:linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,249,255,0.98));
  color:#14253f;
}

.message.own .message-bubble{
  background:linear-gradient(135deg, #1f6ef6 0%, #6ca6ff 100%);
  color:#fff;
  border-color:rgba(255,255,255,0.18);
}

.message.private.own .message-bubble{
  background:linear-gradient(135deg, #215cf3 0%, #7fb0ff 100%);
}

.message-unread .message-bubble{
  border-color:rgba(99,128,180,0.12);
  box-shadow:0 14px 34px rgba(16,40,71,0.08);
}

.message-unread .message-bubble::before{
  content:"";
  position:absolute;
  top:12px;
  bottom:12px;
  width:3px;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(226,86,96,0.92), rgba(216,77,87,0.55));
}

.message.incoming.message-unread .message-bubble::before{
  left:-10px;
}

.message.own.message-unread .message-bubble::before{
  right:-10px;
}

.message-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:calc(8px * var(--message-scale-factor));
  font-size:calc(12px * var(--ui-font-scale));
}

.message-author{
  font-weight:700;
}

.message-time{
  opacity:0.72;
  white-space:nowrap;
}

.message-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:14px;
  margin-left:8px;
  opacity:.88;
  position:relative;
  vertical-align:-2px;
}

.message-status::before,
.message-status.read::after{
  content:"";
  position:absolute;
  width:9px;
  height:5px;
  border-left:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(-45deg);
  left:2px;
  top:3px;
}

.message-status.pending{
  opacity:.72;
  border:2px solid currentColor;
  border-left-color:transparent;
  border-radius:50%;
  animation:messageStatusSpin .9s linear infinite;
}

.message-status.pending::before,
.message-status.pending::after{
  display:none;
}

.message-status.read::after{
  left:8px;
}

.message-status.read{
  color:#dff7ff;
  text-shadow:0 0 10px rgba(255,255,255,.22);
}

@keyframes messageStatusSpin{
  to{ transform:rotate(360deg); }
}

.message-text{
  font-size:calc(14px * var(--ui-font-scale));
  line-height:calc(1.5 * var(--message-scale-factor));
  word-break:break-word;
}

.message-reply-context{
  margin-bottom:10px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(14,37,72,0.06);
  border-left:3px solid rgba(54,118,230,0.78);
}

.message.own .message-reply-context{
  background:rgba(255,255,255,0.14);
  border-left-color:rgba(255,255,255,0.86);
}

.message-reply-author{
  font-size:12px;
  font-weight:800;
  line-height:1.2;
  margin-bottom:3px;
}

.message-reply-text{
  font-size:12px;
  line-height:1.35;
  opacity:.84;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.message-context-menu{
  position:fixed;
  z-index:1400;
  min-width:170px;
  padding:8px;
  border-radius:16px;
  border:1px solid rgba(92,127,188,0.16);
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,248,255,0.98));
  box-shadow:0 18px 44px rgba(16,40,71,0.18);
  backdrop-filter:blur(14px);
}

.message-context-menu-item{
  width:100%;
  padding:10px 12px;
  border:none;
  border-radius:12px;
  background:transparent;
  color:#18365e;
  text-align:left;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  transition:background .18s ease, transform .18s ease;
}

.message-context-menu-item:hover{
  background:rgba(54,118,230,0.10);
  transform:translateY(-1px);
}

.message-attachment{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.message-photo,
.message-gif{
  display:block;
  width:min(calc(320px * var(--message-media-scale-factor)), 100%);
  max-width:100%;
  border-radius:calc(16px * var(--message-media-scale-factor));
  object-fit:cover;
  box-shadow:0 10px 24px rgba(15,38,70,0.12);
}

.message-sticker{
  width:calc(84px * var(--message-media-scale-factor));
  height:calc(84px * var(--message-media-scale-factor));
  display:grid;
  place-items:center;
  border-radius:22px;
  background:linear-gradient(180deg, rgba(255,255,255,0.86), rgba(230,240,255,0.74));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.52), 0 12px 24px rgba(24,70,130,0.12);
}

.message-attachment-caption{
  font-size:calc(12px * var(--ui-font-scale));
  line-height:1.4;
  opacity:0.76;
}

.message-attachment-voice{
  flex-direction:row;
  align-items:center;
  gap:calc(14px * var(--message-scale-factor));
  min-width:min(calc(320px * var(--message-media-scale-factor)), 100%);
  margin-top:2px;
}

.message-voice-play{
  width:calc(46px * var(--message-media-scale-factor));
  height:calc(46px * var(--message-media-scale-factor));
  flex-shrink:0;
  border:none;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,0.18);
  color:inherit;
  cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.12);
}

.message-voice-play:hover{
  transform:scale(1.04);
}

.message-voice-play-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.message-voice-play-icon-play{
  width:0;
  height:0;
  border-top:9px solid transparent;
  border-bottom:9px solid transparent;
  border-left:13px solid currentColor;
  transform:translateX(2px);
}

.message-voice-play-icon-pause{
  display:none;
  gap:4px;
}

.message-voice-play-icon-pause span{
  width:4px;
  height:16px;
  border-radius:999px;
  background:currentColor;
}

.message-attachment-voice.is-playing .message-voice-play-icon-play{
  display:none;
}

.message-attachment-voice.is-playing .message-voice-play-icon-pause{
  display:inline-flex;
}

.message-voice-body{
  min-width:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:7px;
}

.message-voice-wave{
  display:flex;
  align-items:center;
  gap:2px;
  height:28px;
  width:100%;
}

.message-voice-bar{
  flex:1 1 0;
  min-width:2px;
  height:calc(8px + 20px * var(--voice-bar-scale, 0.4));
  border-radius:999px;
  align-self:center;
  background:rgba(255,255,255,0.2);
  transition:background-color .08s linear, transform .14s ease, opacity .08s linear, box-shadow .12s linear;
  opacity:.72;
}

.message-attachment-voice.is-playing .message-voice-bar{
  background:rgba(255,255,255,0.22);
}

.message-attachment-voice.is-playing .message-voice-bar.is-active,
.message-voice-bar.is-active{
  background:rgba(255,255,255,0.96);
  opacity:1;
  box-shadow:0 0 10px rgba(255,255,255,0.12);
}

.message-voice-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:12px;
  opacity:.86;
}

.message-voice-meta{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

.message-voice-size{
  opacity:.78;
}

.message-voice-message-time{
  flex-shrink:0;
  opacity:.78;
}

.message-voice-audio{
  display:none;
}

.message.own .message-attachment-voice{
  color:#f7fbff;
}

.message.incoming .message-attachment-voice{
  color:#23456f;
}

.message.incoming .message-voice-play{
  background:linear-gradient(135deg, #4d96ff 0%, #78b5ff 100%);
  color:#fff;
}

.message.incoming .message-voice-bar{
  background:rgba(61,113,178,0.18);
}

.message.incoming .message-attachment-voice.is-playing .message-voice-bar.is-active,
.message.incoming .message-voice-bar.is-active{
  background:#3f86e8;
}

.message.incoming .message-voice-footer{
  color:#56739a;
}

.message-collapsible.message-collapsed .message-text{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:6;
  overflow:hidden;
}

.message-toggle{
  margin-top:10px;
  padding:0;
  border:none;
  background:transparent;
  color:#d84d57;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}

.message.own .message-toggle{
  color:rgba(255,255,255,0.92);
}

#composer{
  display:none;
  gap:12px;
  align-items:flex-end;
  position:relative;
  flex-wrap:nowrap;
  padding:18px 24px 24px;
  border-top:1px solid rgba(80,110,170,0.12);
  background:rgba(255,255,255,0.7);
  backdrop-filter:blur(12px);
  animation:composerLift .35s cubic-bezier(.2,.9,.2,1);
}

#composer.composer-recording{
  gap:14px;
  animation:composerLift .35s cubic-bezier(.2,.9,.2,1), recordingComposerGlow 2.2s ease-in-out infinite;
  overflow:hidden;
}

.composer-input-shell{
  flex:1;
  min-width:0;
  display:flex;
  align-items:flex-end;
  gap:10px;
  padding:8px 10px;
  border-radius:22px;
  border:1px solid rgba(86,116,170,0.18);
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,249,255,0.98));
  box-shadow:0 16px 32px rgba(24,55,104,0.08);
}

.composer-main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.composer-tools{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}

.composer-tool{
  width:40px;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border-radius:999px !important;
  border:1px solid rgba(83,116,177,0.16) !important;
  background:linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,247,255,0.96)) !important;
  color:#19467f !important;
  font-size:13px;
  font-weight:800;
  box-shadow:0 10px 24px rgba(24,55,104,0.08) !important;
}

.composer-symbol{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1em;
  line-height:1;
  font-size:20px;
  font-weight:700;
  color:currentColor;
}

.composer-tool-gif-badge{
  font-size:11px;
  line-height:1;
  letter-spacing:0.08em;
  font-weight:900;
}

.composer-icon-svg{
  display:block;
  width:18px;
  height:18px;
}

.composer-icon-mic{
  overflow:visible;
}

.composer-tool-icon-recording{
  display:none;
}

.composer-tool:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 30px rgba(24,55,104,0.12) !important;
  border-color:rgba(53,103,190,0.24) !important;
}

.composer-tool.recording{
  color:#fff !important;
  background:linear-gradient(135deg, #ef5350 0%, #ff867c 100%) !important;
  border-color:rgba(239,83,80,0.35) !important;
}

.composer-tool.recording .composer-tool-icon-default{
  display:none;
}

.composer-tool.recording .composer-tool-icon-recording{
  display:inline-flex;
}

.composer-tool-media{
  background:linear-gradient(135deg, rgba(255,255,255,0.98), rgba(236,244,255,0.98)) !important;
}

.composer-reply{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  min-width:0;
  padding:10px 14px 10px 12px;
  border-radius:16px;
  border:1px solid rgba(79,141,255,0.10);
  background:linear-gradient(180deg, rgba(18,29,46,0.98), rgba(15,25,40,0.98));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.03), 0 10px 24px rgba(10,18,32,0.18);
}

.composer-reply-icon{
  flex:0 0 auto;
  color:#62a5ff;
  font-size:18px;
  line-height:1;
  transform:translateY(-1px);
}

.composer-reply-body{
  min-width:0;
  flex:1;
  position:relative;
  padding-left:12px;
}

.composer-reply-body::before{
  content:"";
  position:absolute;
  left:0;
  top:2px;
  bottom:2px;
  width:3px;
  border-radius:999px;
  background:linear-gradient(180deg, #5fa3ff 0%, #3778f2 100%);
}

.composer-reply-author{
  font-size:12px;
  font-weight:800;
  color:#62a5ff;
  margin-bottom:4px;
}

.composer-reply-text{
  font-size:13px;
  color:rgba(232,240,255,0.88);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.composer-reply-cancel{
  width:26px;
  height:26px;
  padding:0;
  border:none;
  border-radius:999px;
  background:transparent;
  color:rgba(220,232,255,0.72);
  font-size:20px;
  line-height:1;
  cursor:pointer;
  transition:transform .18s ease, background .18s ease;
}

.composer-reply-cancel:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,0.06);
}

.voice-recording-status{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex:1;
  min-width:0;
  min-height:48px;
  padding:0 18px;
  border-radius:18px;
  background:
    radial-gradient(circle at 12% 50%, rgba(216,77,87,0.14), transparent 18%),
    linear-gradient(180deg, rgba(19,31,48,0.985), rgba(14,24,39,0.985));
  color:#f3f8ff;
  border:1px solid rgba(101,135,191,0.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 16px 34px rgba(10,18,32,0.24);
  animation:recordingBarIn .28s cubic-bezier(.22,.88,.32,1), recordingBarGlow 2.4s ease-in-out infinite;
  overflow:hidden;
}

.voice-recording-status::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:linear-gradient(90deg, transparent 0%, rgba(114,173,255,0.08) 35%, transparent 70%);
  transform:translateX(-100%);
  animation:recordingShine 2.8s ease-in-out infinite;
  pointer-events:none;
}

.voice-recording-indicator{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
  min-width:120px;
  position:relative;
  overflow:hidden;
}

.voice-recording-indicator::after{
  content:"";
  width:34px;
  height:16px;
  border-radius:999px;
  background:
    linear-gradient(90deg,
      rgba(114,173,255,0.2) 0 12%,
      transparent 12% 18%,
      rgba(114,173,255,0.52) 18% 30%,
      transparent 30% 36%,
      rgba(114,173,255,0.3) 36% 48%,
      transparent 48% 54%,
      rgba(114,173,255,0.68) 54% 66%,
      transparent 66% 72%,
      rgba(114,173,255,0.38) 72% 84%,
      transparent 84% 100%);
  opacity:.9;
  animation:recordingWave 1.2s ease-in-out infinite;
}

.voice-recording-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:#e25660;
  animation:voicePulse 1.1s ease-in-out infinite;
  flex-shrink:0;
  box-shadow:0 0 0 6px rgba(226,86,96,0.14);
}

#voice-recording-text{
  font-size:17px;
  font-variant-numeric:tabular-nums;
  letter-spacing:0.04em;
  text-shadow:0 0 18px rgba(255,255,255,0.06);
  animation:recordingDigits 1.4s ease-in-out infinite;
}

.voice-recording-cancel{
  padding:0 !important;
  border:none !important;
  background:transparent !important;
  color:#69a7ff !important;
  font-size:15px;
  font-weight:600;
  box-shadow:none !important;
  transition:color .18s ease, opacity .18s ease !important;
}

.voice-recording-cancel:hover{
  transform:none !important;
  color:#8abcff !important;
}

@keyframes voicePulse{
  0%, 100% { transform:scale(1); opacity:1; }
  50% { transform:scale(1.25); opacity:.72; }
}

.composer-panel{
  position:absolute;
  left:18px;
  bottom:calc(100% + 12px);
  width:min(420px, calc(100% - 36px));
  padding:14px;
  border-radius:20px;
  background:rgba(255,255,255,0.96);
  border:1px solid rgba(101,131,184,0.14);
  box-shadow:0 20px 40px rgba(17,42,78,0.16);
  backdrop-filter:blur(14px);
  z-index:20;
}

.composer-panel-title{
  margin-bottom:12px;
  font-size:13px;
  font-weight:800;
  color:#18365d;
  letter-spacing:0.04em;
  text-transform:uppercase;
}

.composer-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.composer-media-tabs{
  display:flex;
  gap:8px;
  padding:4px;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(236,243,255,0.98), rgba(226,237,255,0.98));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.72);
}

.composer-media-tab{
  padding:8px 14px !important;
  border:none !important;
  border-radius:999px !important;
  background:transparent !important;
  color:#4f6f9f !important;
  box-shadow:none !important;
  font-size:12px;
  font-weight:800;
  letter-spacing:0.04em;
}

.composer-media-tab.active{
  background:linear-gradient(135deg, #1f6ef6 0%, #77b4ff 100%) !important;
  color:#fff !important;
  box-shadow:0 10px 22px rgba(31,110,246,0.22) !important;
}

.composer-panel-subtitle{
  margin-bottom:8px;
  color:#49688f;
  font-size:11px;
  font-weight:800;
  letter-spacing:0.08em;
  text-transform:uppercase;
}

.composer-gif-recents{
  margin-bottom:12px;
}

.composer-gif-grid-recents{
  grid-template-columns:repeat(4, minmax(0, 1fr));
}

.composer-emoji-recents{
  margin-bottom:14px;
}

.composer-emoji-grid-recents{
  grid-template-columns:repeat(6, minmax(0, 1fr));
  margin-bottom:6px;
}

.composer-empty-state{
  grid-column:1 / -1;
  padding:14px 12px;
  border-radius:14px;
  background:linear-gradient(180deg, rgba(244,248,255,0.92), rgba(235,242,255,0.92));
  color:#5f7aa3;
  font-size:12px;
  font-weight:600;
  text-align:center;
}

.composer-media-content{
  position:relative;
  min-height:0;
}

.composer-media-pane{
  display:none;
  animation:mediaPaneIn .24s cubic-bezier(.22,.88,.32,1);
  max-height:min(44vh, 330px);
  overflow-y:auto;
  padding-right:6px;
  scrollbar-width:thin;
  scrollbar-color:rgba(31,110,246,0.72) rgba(220,232,250,0.92);
}

.composer-media-pane.active{
  display:block;
}

.composer-media-pane[data-media-pane="sticker"]{
  min-height:min(44vh, 330px);
}

.composer-media-pane::-webkit-scrollbar{
  width:12px;
}

.composer-media-pane::-webkit-scrollbar-track{
  border-radius:999px;
  background:linear-gradient(180deg, rgba(238,244,255,0.96), rgba(222,233,250,0.96));
}

.composer-media-pane::-webkit-scrollbar-thumb{
  border:3px solid rgba(241,246,255,0.96);
  border-radius:999px;
  background:linear-gradient(180deg, #2e7af7 0%, #78b7ff 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.42);
}

.composer-gif-grid,
.composer-sticker-grid,
.composer-emoji-grid{
  display:grid;
  gap:10px;
}

.composer-gif-grid{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

.composer-sticker-grid{
  grid-template-columns:repeat(4, minmax(0, 1fr));
  align-content:start;
}

.composer-emoji-grid{
  grid-template-columns:repeat(6, minmax(0, 1fr));
}

.composer-sticker-recents{
  margin-bottom:14px;
}

.composer-sticker-grid-recents{
  grid-template-columns:repeat(4, minmax(0, 1fr));
}

.composer-media-pane[data-media-pane="sticker"] .composer-sticker-grid{
  min-height:220px;
}

.composer-media-pane[data-media-pane="sticker"] .composer-sticker-item{
  min-height:82px;
  font-size:12px;
}

.composer-gif-item,
.composer-sticker-item,
.composer-emoji-item{
  border:none;
  padding:0;
  cursor:pointer;
  border-radius:16px;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(244,248,255,0.98), rgba(234,242,255,0.98));
  box-shadow:0 10px 22px rgba(20,49,90,0.08);
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.composer-gif-item:hover,
.composer-sticker-item:hover,
.composer-emoji-item:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 26px rgba(20,49,90,0.12);
}

.composer-gif-item img{
  display:block;
  width:100%;
  height:110px;
  object-fit:cover;
}

.composer-sticker-item{
  min-height:74px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:7px;
  padding:10px;
  color:#2264b2;
  font-size:12px;
  font-weight:800;
  letter-spacing:0;
}

.ui-sticker-icon{
  width:28px;
  height:28px;
  display:block;
}

.message-sticker-icon{
  width:58px;
  height:58px;
  display:block;
  color:#2264b2;
}

.chat-avatar-icon{
  width:22px;
  height:22px;
  display:block;
}

.composer-emoji-item{
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 12px;
  font-size:13px;
  font-weight:800;
  letter-spacing:0;
  text-transform:uppercase;
}

.composer-media-panel{
  width:min(390px, calc(100vw - 28px));
  max-height:min(68vh, 480px);
  transform-origin:left bottom;
  animation:mediaPanelPop .26s cubic-bezier(.22,.88,.32,1);
  overflow:hidden;
}

.composer-gif-search-row{
  margin-top:0;
  margin-bottom:10px;
}

.composer-panel-note{
  margin-bottom:12px;
  color:#5f7aa3;
  font-size:12px;
  font-weight:600;
}

.composer-panel-row{
  margin-top:12px;
  display:flex;
  gap:10px;
}

.composer-panel-input{
  flex:1;
  min-width:0;
  border:1px solid rgba(86,117,170,0.14);
  border-radius:14px;
  padding:12px 14px;
  font:inherit;
  background:rgba(246,250,255,0.95);
  color:#17365c;
}

.composer-panel-send{
  padding:12px 16px !important;
  border:none !important;
  border-radius:14px !important;
  background:linear-gradient(135deg, #2367f5 0%, #6ca7ff 100%) !important;
  color:#fff !important;
  font-weight:700;
}

#composer input[type=text],
#composer textarea{
  flex:1;
  min-width:0;
  min-height:42px;
  max-height:160px;
  padding:10px 4px;
  border-radius:0;
  border:none;
  background:transparent;
  box-shadow:none;
  transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  resize:none;
  overflow:auto;
  font:inherit;
  line-height:1.45;
  color:#17365c;
  scrollbar-width:none;
  -ms-overflow-style:none;
}

#composer textarea::placeholder{
  color:rgba(23,54,92,0.52);
}

#composer textarea::-webkit-scrollbar{
  width:0;
  height:0;
}

#composer input[type=text]:focus,
#composer textarea:focus{
  outline:none;
  border-color:transparent;
  box-shadow:none;
}

#composer button{
  padding:14px 20px;
  border-radius:16px;
  border:none;
  background:linear-gradient(135deg, #1f6ef6 0%, #72adff 100%);
  color:#fff;
  font-weight:700;
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  box-shadow:0 16px 30px rgba(31,110,246,0.22);
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

#composer button:hover{
  transform:translateY(-1px);
}

#composer button:disabled{
  opacity:0.55;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

.composer-send{
  width:48px;
  height:48px;
  padding:0 !important;
  border-radius:18px !important;
  flex-shrink:0;
}

#composer.composer-recording .composer-input-shell{
  display:none;
}

#composer.composer-recording .composer-send{
  width:54px;
  height:54px;
  min-width:54px;
  box-shadow:0 0 0 4px rgba(114,173,255,0.18), 0 18px 34px rgba(31,110,246,0.28);
  animation:recordingSendPulse 1.5s ease-in-out infinite;
}

#composer.composer-recording .composer-send:hover{
  transform:translateY(-1px) scale(1.04);
}

@keyframes recordingBarIn{
  from{
    opacity:0;
    transform:translateY(8px) scale(.985);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

@keyframes recordingBarGlow{
  0%, 100%{
    border-color:rgba(101,135,191,0.18);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.04),
      0 16px 34px rgba(10,18,32,0.22);
  }
  50%{
    border-color:rgba(114,173,255,0.28);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.05),
      0 18px 38px rgba(10,18,32,0.28),
      0 0 0 1px rgba(114,173,255,0.08);
  }
}

@keyframes recordingShine{
  0%, 100%{
    transform:translateX(-110%);
    opacity:0;
  }
  20%{
    opacity:1;
  }
  55%{
    transform:translateX(110%);
    opacity:.7;
  }
  100%{
    opacity:0;
  }
}

@keyframes recordingWave{
  0%, 100%{
    transform:scaleY(.82);
    opacity:.72;
  }
  50%{
    transform:scaleY(1.08);
    opacity:1;
  }
}

@keyframes recordingDigits{
  0%, 100%{
    opacity:.94;
  }
  50%{
    opacity:1;
  }
}

@keyframes recordingSendPulse{
  0%, 100%{
    box-shadow:0 0 0 4px rgba(114,173,255,0.16), 0 18px 34px rgba(31,110,246,0.24);
  }
  50%{
    box-shadow:0 0 0 7px rgba(114,173,255,0.18), 0 20px 36px rgba(31,110,246,0.32);
  }
}

@keyframes recordingComposerGlow{
  0%, 100%{
    filter:none;
  }
  50%{
    filter:saturate(1.04);
  }
}

@keyframes mediaPanelPop{
  from{
    opacity:0;
    transform:translateY(10px) scale(.98);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

@keyframes mediaPaneIn{
  from{
    opacity:0;
    transform:translateY(6px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

.composer-send-symbol{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transform:translateX(1px);
}

.composer-icon-send{
  width:19px;
  height:19px;
  transform:translateX(1px) scale(1);
  filter:drop-shadow(0 1px 0 rgba(255,255,255,0.10));
}

@media (max-width: 720px){
  #composer{
    gap:10px;
    padding:14px 16px 18px;
  }

  .composer-input-shell{
    gap:8px;
    padding:7px 8px;
  }

  .composer-tools{
    gap:6px;
  }

  .composer-tool{
    width:36px;
    height:36px;
    border-radius:999px !important;
  }

  .composer-send{
    width:44px;
    height:44px;
    border-radius:16px !important;
  }
}

.chat-empty{
  margin:auto;
  max-width:360px;
  padding:32px 28px;
  text-align:center;
  border-radius:28px;
  background:rgba(255,255,255,0.76);
  border:1px solid rgba(95,125,180,0.12);
  box-shadow:0 28px 50px rgba(16,40,71,0.08);
  animation:emptyStateFloat .45s cubic-bezier(.2,.9,.2,1);
}

.chat-empty-badge{
  width:48px;
  height:48px;
  margin:0 auto 14px;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-size:22px;
  color:#1f6ef6;
  background:linear-gradient(135deg, rgba(31,110,246,0.14), rgba(114,173,255,0.20));
}

.chat-empty-title{
  font-size:20px;
  font-weight:800;
  color:#102847;
  margin-bottom:8px;
}

.chat-empty-text,
.chat-list-empty{
  font-size:14px;
  line-height:1.5;
  color:#667a96;
}

.chat-list-empty{
  padding:18px 12px;
  text-align:center;
}

.chat-list li.chat-list-item-new{
  animation:chatItemIn .34s cubic-bezier(.22,.88,.32,1) both;
  animation-delay:calc(var(--chat-index, 0) * 40ms);
}

@keyframes chatHeaderReveal{
  from{
    opacity:0;
    transform:translateY(-10px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

@keyframes messageIn{
  from{
    opacity:0;
    transform:translateY(10px) scale(.98);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

@keyframes composerLift{
  from{
    opacity:0;
    transform:translateY(12px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

@keyframes emptyStateFloat{
  from{
    opacity:0;
    transform:translateY(18px) scale(.98);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

@keyframes chatItemIn{
  from{
    opacity:0;
    transform:translateX(-10px) scale(.985);
  }
  to{
    opacity:1;
    transform:translateX(0) scale(1);
  }
}

@media (max-width: 900px){
  #left-panel{
    width:290px;
  }

  #messages{
    padding:18px;
  }

  .message-bubble{
    max-width:88%;
  }
}

@media (max-width: 720px){
  html,
  body{
    min-height:100dvh;
    overflow:hidden;
  }

  .app-bg{
    min-height:100dvh;
    height:100dvh;
  }

  #sidebar{
    display:none;
  }

  .app-bg #workspace{
    flex-direction:column;
    min-height:100dvh;
    height:100dvh;
  }

  #left-panel{
    width:100%;
    height:100%;
    min-height:0;
    border-right:none;
    border-bottom:none;
    padding:calc(92px + var(--safe-top)) calc(12px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(12px + var(--safe-left));
  }

  .top-profile-container{
    top:calc(10px + var(--safe-top));
    left:12px;
    right:12px;
    width:auto;
    justify-content:space-between;
    gap:12px;
    padding:10px 12px;
    border-radius:22px;
    background:linear-gradient(180deg, rgba(20,30,48,0.92), rgba(13,20,33,0.96));
    border:1px solid rgba(104,132,182,0.14);
    box-shadow:0 18px 36px rgba(0,0,0,0.22);
    backdrop-filter:blur(16px);
  }

  body.mobile-chat-open .top-profile-container{
    display:none;
  }

  .top-avatar{
    order:2;
    width:46px;
    height:46px;
    flex:0 0 46px;
  }

  .top-display-name{
    order:1;
    flex:1;
    display:flex;
    align-items:center;
    min-width:0;
    max-width:none;
    padding:0;
    background:none;
    background-image:none;
    box-shadow:none;
    border:none;
    font-size:clamp(16px, 4.2vw, 18px);
    line-height:1.2;
  }

  body.dark-theme .top-profile-container .top-display-name{
    background:none;
    background-image:none;
    box-shadow:none;
    border:none;
  }

  .search-section{
    flex:0 0 auto;
    margin:0 0 14px;
    padding:0;
    background:transparent;
    border:none;
    box-shadow:none;
  }

  .chats-panel{
    flex:1;
    min-height:0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    padding:14px;
    border-radius:22px;
    background:linear-gradient(180deg, rgba(17,25,40,0.88), rgba(10,16,28,0.96));
    border:1px solid rgba(104,132,182,0.12);
    box-shadow:0 18px 36px rgba(0,0,0,0.20);
  }

  .chat-list{
    flex:1;
    min-height:0;
    overflow:auto;
    gap:8px;
  }

  .chats-title{
    margin-bottom:14px;
    font-size:13px;
    letter-spacing:0.08em;
  }

  .chat-list li{
    align-items:center;
    gap:10px;
    padding:12px;
    border-radius:18px;
    width:100%;
    min-height:68px;
  }

  .chat-avatar{
    width:44px;
    height:44px;
    flex-basis:44px;
  }

  .chat-info{
    gap:6px;
    min-width:0;
    overflow:hidden;
  }

  .chat-info-header{
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    align-items:start;
    column-gap:8px;
  }

  .chat-info-name{
    min-width:0;
    font-size:15px;
    line-height:1.25;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .chat-info-name .name-with-badge{
    display:inline-flex;
    align-items:center;
    max-width:100%;
    min-width:0;
    flex-wrap:nowrap;
    gap:6px;
  }

  .chat-info-time{
    max-width:72px;
    font-size:11px;
    line-height:1.2;
    text-align:right;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .chat-info-preview{
    font-size:13px;
    line-height:1.35;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    white-space:normal;
  }

  #chat-pane{
    display:none;
    height:100%;
    min-height:0;
    max-width:100vw;
    overflow-x:hidden;
  }

  body.mobile-chat-open #left-panel{
    display:none;
  }

  body.mobile-chat-open #chat-pane{
    display:flex;
  }

  #chat-header{
    padding:calc(14px + var(--safe-top)) calc(14px + var(--safe-right)) 14px calc(14px + var(--safe-left));
    background:linear-gradient(180deg, rgba(15,22,37,0.96), rgba(10,17,30,0.94));
    border-bottom:1px solid rgba(104,132,182,0.12);
  }

  .chat-header-row{
    gap:10px;
  }

  .chat-header-back{
    flex-basis:40px;
    width:40px;
    height:40px;
    font-size:18px;
  }

  .chat-header-call{
    flex-basis:42px;
    width:42px;
    height:42px;
    border-radius:14px;
  }

  .chat-call-icon-wrap,
  .chat-call-icon{
    width:24px;
    height:24px;
  }

  .chat-header-avatar{
    width:40px;
    height:40px;
    font-size:16px;
  }

  #chat-title{
    font-size:17px;
  }

  #chat-subtitle{
    font-size:12px;
  }

  #messages{
    padding:12px 10px 14px;
    gap:10px;
    overflow-x:hidden;
  }

  #composer{
    padding:12px calc(12px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(12px + var(--safe-left));
    gap:10px;
    background:linear-gradient(180deg, rgba(12,19,33,0.96), rgba(10,16,28,0.98));
  }

  .composer-input-shell{
    align-items:center;
    gap:6px;
    padding:6px 7px;
  }

  #composer textarea{
    min-height:36px;
    max-height:112px;
    font-size:16px;
  }

  .composer-panel{
    left:0;
    right:0;
    width:auto;
    max-height:min(52vh, 420px);
    bottom:calc(100% + 8px);
  }

  .profile-overlay,
  .call-overlay{
    align-items:flex-end;
    padding:12px;
    padding-top:calc(12px + var(--safe-top));
    padding-right:calc(12px + var(--safe-right));
    padding-bottom:calc(12px + var(--safe-bottom));
    padding-left:calc(12px + var(--safe-left));
  }

  .profile-modal,
  .profile-modal.other-profile-modal,
  .call-modal,
  .call-modal.with-screen,
  .call-modal.screen-expanded,
  .admin-modal{
    width:100%;
    max-width:none;
    max-height:calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom));
    overflow:auto;
    border-radius:24px;
  }

  .settings-inner,
  .admin-inner{
    max-height:none;
  }

  .search-results{
    position:fixed;
    left:12px;
    right:12px;
    top:calc(138px + var(--safe-top));
    max-height:min(50dvh, 420px);
    z-index:2100;
  }

  .message{
    max-width:100%;
  }

  .message-bubble{
    width:fit-content;
    max-width:min(82vw, calc(100% - 16px));
    padding:12px 14px;
    border-radius:20px;
    box-shadow:0 12px 26px rgba(7,14,28,0.18);
  }

  .message.incoming .message-bubble{
    background:linear-gradient(180deg, rgba(23,31,49,0.98), rgba(17,24,38,0.98));
    border-color:rgba(96,121,170,0.16);
    color:#edf3ff;
  }

  .message.own .message-bubble{
    background:linear-gradient(135deg, #366fd9 0%, #5f90ea 100%);
    border-color:rgba(173,205,255,0.16);
  }

  .message-meta{
    gap:10px;
    margin-bottom:7px;
  }

  .message-author{
    min-width:0;
    font-size:13px;
    line-height:1.2;
  }

  .message-time{
    font-size:11px;
    line-height:1.2;
  }

  .message-text,
  .message-attachment-caption{
    font-size:14px;
    line-height:1.42;
    overflow-wrap:anywhere;
    word-break:break-word;
  }

  .message-reply-context{
    max-width:100%;
    padding:9px 11px;
    border-radius:13px;
  }

  .message-reply-author,
  .message-reply-text{
    overflow-wrap:anywhere;
    word-break:break-word;
    white-space:normal;
  }

  .message-photo,
  .message-gif,
  .message-attachment-voice{
    width:min(100%, 280px);
    min-width:0;
  }

  .message-attachment-voice{
    gap:10px;
    padding-right:2px;
  }

  .message-voice-body,
  .message-voice-meta,
  .message-voice-footer{
    min-width:0;
  }

  .message-voice-footer{
    gap:8px;
    flex-wrap:wrap;
  }

  .message-sticker{
    width:68px;
    height:68px;
    border-radius:18px;
  }

  #chat-title{
    font-size:16px;
    line-height:1.15;
  }

  #chat-subtitle{
    line-height:1.2;
  }

  .chat-header-main{
    gap:4px;
  }

  .composer-input-shell{
    padding:6px 7px;
    border-radius:20px;
    background:linear-gradient(180deg, rgba(16,24,39,0.98), rgba(12,19,33,0.98));
    border:1px solid rgba(96,121,170,0.16);
    box-shadow:0 10px 24px rgba(0,0,0,0.18);
  }

  #composer textarea{
    min-height:34px;
    max-height:104px;
    padding:7px 1px;
    font-size:16px;
    line-height:1.35;
  }

  .composer-tools{
    gap:5px;
  }

  .composer-tool{
    width:32px;
    height:32px;
    min-width:32px;
  }

  .composer-symbol{
    font-size:16px;
  }

  .composer-icon-svg{
    width:15px;
    height:15px;
  }

  .composer-send{
    width:40px;
    height:40px;
    min-width:40px;
    border-radius:15px !important;
  }

  .composer-send-symbol .composer-icon-send{
    width:17px;
    height:17px;
  }

  .composer-tool,
  .composer-send{
    box-shadow:none !important;
  }
}
