:root{
  --bg:#0b0b0b;            /* scuro */
  --card:#0f0f0f;
  --muted:#bfbfbf;
  --accent:#ffd166;        /* oro */
  --accent-strong:#ffcf33;
  --glass: rgba(255,255,255,0.03);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:#fff}
body{min-height:100dvh;overflow:auto}
.hidden{display:none !important}

/* Header */
header.app-header{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;
  padding:14px 20px;border-bottom:1px solid rgba(255,255,255,0.03);
  background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  position:sticky;top:0;z-index:20
}
.header-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.user-box{display:flex;align-items:center;gap:8px}
.user-badge{
  font-size:12px;color:var(--muted);
  padding:6px 10px;border-radius:999px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.02)
}
.brand{display:flex;gap:12px;align-items:center;min-width:0}
.brand .logo{
  width:36px;height:36px;border-radius:6px;background:var(--glass);display:flex;align-items:center;justify-content:center;color:var(--accent);font-weight:700
}
.brand h1{font-size:16px;margin:0}
.brand p{margin:0;font-size:12px;color:var(--muted)}

@media(max-width:1120px){
  header.app-header{
    align-items:flex-start;
  }
  .user-box{
    flex-wrap:wrap;
    justify-content:flex-end;
  }
}

/* three dots menu */
.menu-btn{position:relative;border:0;background:transparent;color:var(--muted);padding:8px;border-radius:8px;cursor:pointer}
.menu-btn:focus{outline:2px solid rgba(255,209,102,0.12)}
.dots{width:6px;height:6px;background:var(--muted);border-radius:50%;display:inline-block}
.menu{position:absolute;right:20px;top:60px;background:var(--card);min-width:220px;border-radius:10px;padding:10px;box-shadow:0 8px 30px rgba(0,0,0,0.6);display:none}
.menu.active{display:block}
.menu h4{margin:0 0 8px 0;color:var(--accent);font-size:13px}
.menu button{display:block;width:100%;text-align:left;padding:8px;border-radius:8px;border:0;background:transparent;color:#fff;cursor:pointer}
.menu button:hover{background:rgba(255,255,255,0.02)}

.chat-guest{
  margin:18px;
  padding:16px;
  border-radius:12px;
  border:1px solid rgba(255,209,102,0.24);
  background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.chat-guest-eyebrow{
  margin:0 0 8px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:1px;
  color:var(--muted);
}
.chat-guest h2{
  margin:0 0 10px;
  color:var(--accent);
}
.chat-guest-lead{
  margin:0 0 12px;
  color:#cfd5df;
}
.chat-guest-list{
  margin:0 0 14px;
  padding-left:18px;
  display:grid;
  gap:6px;
  color:#bcc5d3;
}
.chat-guest-cta{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.chat-guest-login{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}
.chat-guest.hidden + .app{
  padding-top:18px;
}
.guest-disabled{
  opacity:0.55;
  cursor:not-allowed !important;
}
.guest-disabled:focus{
  outline:none;
}

/* Layout */
.app{
  display:grid;grid-template-columns:290px 1fr;gap:18px;padding:18px;min-height:calc(100vh - 64px)
}
.sidebar{background:linear-gradient(180deg, rgba(255,255,255,0.01), transparent);border-radius:12px;padding:12px}
.sidebar h3{margin:0 0 8px 0;color:var(--accent)}
.profile-card{
  background:rgba(255,255,255,0.02);
  border:1px solid rgba(255,255,255,0.05);
  border-radius:12px;
  padding:12px;
  margin-bottom:12px;
}
.profile-head{display:flex;gap:10px;align-items:center;margin-bottom:10px}
.profile-head{
  width:100%;
  border:0;
  background:transparent;
  color:#fff;
  cursor:pointer;
  justify-content:space-between;
  padding:0;
}
.profile-chevron{
  width:30px;
  height:30px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
  color:var(--muted);
  flex-shrink:0;
  transition:border-color .18s ease, background .18s ease, transform .18s ease;
}

.profile-chevron svg{
  width:15px;
  height:15px;
  fill:currentColor;
}

.profile-head:hover .profile-chevron,
.profile-head[aria-expanded="true"] .profile-chevron{
  border-color:rgba(255,209,102,0.22);
  background:rgba(255,209,102,0.08);
  color:#f4ddb2;
}
.profile-edit{display:none;margin-top:8px}
.profile-edit.active{display:block}
.profile-avatar{
  width:44px;height:44px;border-radius:10px;
  background:linear-gradient(135deg,#222,#111);
  display:flex;align-items:center;justify-content:center;
  color:var(--accent);font-weight:700;
}
.profile-name{font-weight:700;font-size:14px}
.profile-code{font-size:11px;color:var(--muted)}
.profile-input{
  width:100%;
  padding:8px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.06);
  background:transparent;
  color:#fff;
  margin-bottom:8px;
}
.profile-input:focus{outline:none;border-color:rgba(255,209,102,0.5)}
.chat-insights{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:6px 0 10px;
}
.chat-status{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:11px;
  color:var(--muted);
  padding:6px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.06);
  background:rgba(255,255,255,0.02);
  margin:4px 0 6px;
  width:fit-content;
}
.chat-status .status-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:rgba(255,255,255,0.25);
  box-shadow:0 0 0 3px rgba(255,255,255,0.04);
}
.chat-status.online{
  color:#e9f7ee;
  border-color:rgba(69,201,128,0.35);
  background:rgba(69,201,128,0.08);
}
.chat-status.online .status-dot{
  background:rgba(69,201,128,0.9);
  box-shadow:0 0 0 3px rgba(69,201,128,0.18);
}
.chat-status.offline{
  color:var(--muted);
  border-color:rgba(255,255,255,0.08);
}
.filter-row{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin:0 0 10px;
}
.filter-chip{
  border:1px solid rgba(255,255,255,0.08);
  background:transparent;
  color:var(--muted);
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
  font-size:11px;
}
.filter-chip.active{
  background:rgba(255,209,102,0.14);
  color:var(--accent);
  border-color:rgba(255,209,102,0.35);
}
.insight-chip{
  border:1px solid rgba(255,255,255,0.06);
  border-radius:10px;
  padding:8px 10px;
  background:rgba(255,255,255,0.02);
  display:grid;
  gap:4px;
}
.insight-chip span{
  font-size:11px;
  color:var(--muted);
}
.insight-chip strong{
  font-size:14px;
  color:#fff;
}
.groups{margin-top:8px;display:flex;flex-direction:column;gap:8px}
.group-item{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:12px;align-items:flex-start;padding:12px;border-radius:14px;cursor:pointer;border:1px solid rgba(255,255,255,0.04);background:linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01))}
.group-item{position:relative}
.group-item:hover{background:linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));border-color:rgba(255,209,102,0.16)}
.group-item.active{background:linear-gradient(180deg, rgba(255,209,102,0.08), rgba(255,255,255,0.02));border:1px solid rgba(255,209,102,0.22)}
.avatar{width:44px;height:44px;border-radius:8px;background:linear-gradient(135deg,#222,#111);display:flex;align-items:center;justify-content:center;font-weight:700;color:var(--accent)}
.group-meta{flex:1;min-width:0}
.group-meta .name{font-size:14px}
.group-meta .name .badge{
  display:inline-flex;
  margin-left:6px;
  font-size:10px;
  padding:2px 6px;
  border-radius:999px;
  background:rgba(255,255,255,0.06);
  color:var(--muted);
  border:1px solid rgba(255,255,255,0.08);
}
.group-meta .preview{
  font-size:12px;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.group-social-row{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.group-social-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  font-size:10px;
  color:#d8deea;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
}
.group-social-chip.is-joined{
  border-color:rgba(69,201,128,0.35);
  background:rgba(69,201,128,0.12);
  color:#e5fff0;
}
.group-social-chip.is-discover{
  border-color:rgba(255,209,102,0.3);
  background:rgba(255,209,102,0.1);
  color:#fff4c9;
}
.group-social-chip.is-bot{
  border-color:rgba(121,190,255,0.32);
  background:rgba(121,190,255,0.12);
  color:#dff1ff;
}
.group-item .time{
  font-size:11px;
  color:var(--muted);
  min-width:44px;
  text-align:right;
  white-space:nowrap;
}
.group-actions{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
  min-width:68px;
}
.group-quick-action{
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
  color:#fff;
  border-radius:999px;
  padding:6px 10px;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}
.group-quick-action.is-joined{
  border-color:rgba(69,201,128,0.32);
  background:rgba(69,201,128,0.12);
  color:#dff7ea;
  cursor:default;
}
.group-quick-action.is-owner{
  border-color:rgba(255,209,102,0.32);
  background:rgba(255,209,102,0.12);
  color:#fff0b3;
  cursor:default;
}
.group-quick-action.is-discover{
  border-color:rgba(255,255,255,0.1);
}
.group-menu-btn{
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:18px;
  padding:4px 6px;
  border-radius:8px;
  cursor:pointer;
}
.group-menu{
  position:absolute;
  right:0;
  top:28px;
  background:var(--card);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px;
  padding:6px;
  display:none;
  min-width:140px;
  z-index:10;
}
.group-menu.active{display:block}
.group-menu button{
  width:100%;
  text-align:left;
  border:0;
  background:transparent;
  color:#fff;
  padding:8px;
  border-radius:8px;
  cursor:pointer;
}
.group-menu button:hover{background:rgba(255,255,255,0.05)}
.create-btn{width:100%;padding:10px;border-radius:10px;border:0;background:linear-gradient(90deg,var(--accent),var(--accent-strong));color:#000;font-weight:700;cursor:pointer}

.main{
  background:linear-gradient(180deg, rgba(255,255,255,0.01), transparent);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:12px
}
.chat-header{display:flex;align-items:center;justify-content:space-between}
.chat-title{display:flex;gap:12px;align-items:center}
.messages{flex:1;overflow:auto;padding:12px;background:linear-gradient(180deg, rgba(255,255,255,0.01), transparent);border-radius:8px}
.msg{max-width:70%;padding:10px;border-radius:10px;margin-bottom:10px}
.msg{position:relative}
.msg-name{font-size:11px;color:var(--muted);margin-bottom:4px}
.msg-name .bot-badge{
  display:inline-flex;
  align-items:center;
  margin-left:6px;
  padding:2px 6px;
  border-radius:999px;
  font-size:10px;
  color:#dff1ff;
  border:1px solid rgba(121,190,255,0.28);
  background:rgba(121,190,255,0.12);
}
.msg.me{margin-left:auto;background:linear-gradient(90deg,#1f1f1f, #151515);border:1px solid rgba(255,255,255,0.02)}
.msg.them{background:rgba(255,255,255,0.02)}
.msg.bot{
  background:linear-gradient(180deg, rgba(121,190,255,0.12), rgba(255,255,255,0.03));
  border:1px solid rgba(121,190,255,0.2);
}
.msg-footer{
  display:flex;
  justify-content:flex-end;
  margin-top:6px;
  font-size:10px;
  color:rgba(255,255,255,0.45);
}
.msg img{max-width:260px;border-radius:8px;display:block}
.msg a{color:var(--accent);text-decoration:none}
.msg a:hover{text-decoration:underline}
.msg-delete{
  position:absolute;
  right:8px;
  bottom:8px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:#fff;
  padding:4px 8px;
  border-radius:8px;
  font-size:11px;
  cursor:pointer;
  display:none;
}
.msg.show-delete .msg-delete{display:inline-flex}

/* ===== Profile Drawer ===== */
.profile-drawer{
  position:fixed;
  top:0;right:0;
  width:340px;
  max-width:86vw;
  height:100dvh;
  max-height:100dvh;
  background:#0f0f0f;
  border-left:1px solid rgba(255,255,255,0.08);
  box-shadow:-10px 0 30px rgba(0,0,0,0.5);
  padding:16px;
  transform:translateX(100%);
  transition:transform .2s ease;
  z-index:70;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
  box-sizing:border-box;
}
.profile-drawer.active{transform:translateX(0)}
.profile-drawer__backdrop{
  position:fixed;inset:0;
  background:rgba(0,0,0,0.6);
  opacity:0;pointer-events:none;
  transition:opacity .2s ease;
  z-index:69;
}
.profile-drawer__backdrop.active{opacity:1;pointer-events:auto;}
.profile-drawer__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.profile-drawer__name{font-weight:700;font-size:16px}
.profile-drawer__code{font-size:11px;color:var(--muted)}
.profile-drawer__bio{font-size:12px;color:var(--muted);margin:6px 0 12px}
.profile-drawer__section{margin-top:12px}
.profile-drawer__section h4{margin:0 0 8px 0;color:var(--accent)}
.profile-stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.profile-stat{
  padding:10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.06);
  background:rgba(255,255,255,0.02);
}
.profile-stat .label{font-size:11px;color:var(--muted)}
.profile-stat .value{font-size:14px;font-weight:700}
.composer{display:flex;gap:8px}
.composer input{flex:1;padding:10px;border-radius:10px;border:1px solid rgba(255,255,255,0.04);background:transparent;color:#fff}
.composer button{padding:10px 14px;border-radius:10px;border:0;background:var(--accent);color:#000;font-weight:700;cursor:pointer}
.composer .attach-btn{
  width:40px;
  min-width:40px;
  height:40px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.04);
  color:var(--accent);
  font-size:20px;
  line-height:1;
  cursor:pointer;
  padding:0;
}
.composer .attach-btn:hover{background:rgba(255,255,255,0.08)}

/* Modal */
.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,0.6);display:none;align-items:center;justify-content:center;z-index:40}
.modal-backdrop.active{display:flex}
.modal{
  width:100%;
  max-width:520px;
  max-height:min(88dvh,820px);
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  background:var(--card);
  padding:18px;
  border-radius:12px;
}
.modal h3{margin-top:0}
.social-modal{
  max-width:460px;
  border:1px solid rgba(255,255,255,0.08);
  background:linear-gradient(180deg, rgba(22,22,24,0.98), rgba(12,12,14,0.98));
  box-shadow:0 28px 70px rgba(0,0,0,0.55);
}
.social-modal-eyebrow{
  margin:0 0 8px;
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--accent);
}
.create-btn.danger{
  background:linear-gradient(90deg,#ff7878,#ff5f5f);
  color:#160707;
}
.form-row{display:flex;gap:8px;margin-bottom:8px}
.form-row input,
.form-row select{
  flex:1;
  padding:10px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.03);
  background:#0f0f0f;
  color:#fff;
}
.form-row select option{
  background:#0f0f0f;
  color:#fff;
}
.modal .actions{display:flex;gap:8px;justify-content:flex-end;margin-top:12px}
.hint{color:var(--muted);font-size:12px;padding:8px 4px}
.group-profile-section{
  margin-top:12px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.06);
  background:rgba(255,255,255,0.02);
}
.group-profile-section h4{
  margin:0 0 8px;
  color:var(--accent);
  font-size:13px;
}

.invite-row{display:flex;gap:8px;align-items:center;margin:10px 0}
.invite-row input{
  flex:1;
  padding:8px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.06);
  background:transparent;
  color:#fff;
  font-size:12px
}

/* ===== Toast notifications ===== */
.toast-wrap{
  position:fixed;
  right:16px;
  bottom:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  z-index:60
}
.toast{
  min-width:220px;
  max-width:320px;
  padding:12px 14px;
  border-radius:12px;
  background:rgba(15,15,15,0.95);
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:0 10px 30px rgba(0,0,0,0.5);
  color:#fff;
  font-size:13px;
  line-height:1.3;
  display:flex;
  gap:10px;
  align-items:flex-start;
  animation:toastIn .18s ease-out
}
.toast .dot{
  width:10px;height:10px;border-radius:50%;
  background:var(--accent);margin-top:3px;flex:0 0 auto
}
.toast.error .dot{background:#ff6b6b}
.toast.success .dot{background:var(--accent-strong)}
.toast .title{font-weight:700;margin-bottom:4px}
.toast .desc{color:var(--muted)}
@keyframes toastIn{
  from{opacity:0;transform:translateY(6px)}
  to{opacity:1;transform:translateY(0)}
}

/* Empty state */
.empty{padding:24px;text-align:center;color:var(--muted)}

@media(min-width:881px){
  .chat-guest-cta{
    flex-direction:row;
    flex-wrap:wrap;
  }
}

@media(max-width:880px){
  header.app-header{display:none}
  .app{grid-template-columns:1fr;}
  .sidebar{order:2}
  .main{order:1}
  .sidebar{
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  .sidebar .profile-card{
    order:-4;
    position:sticky;
    top:12px;
    z-index:4;
    padding:12px;
    border-radius:18px;
    background:linear-gradient(180deg, rgba(19,25,36,0.98), rgba(10,14,21,0.96));
    box-shadow:0 14px 32px rgba(0,0,0,0.24);
  }
  .sidebar h3{order:-3}
  .sidebar .chat-status{order:-2}
  .sidebar .search-row{order:-1}
  .sidebar .filter-row{order:0}
  .sidebar .native-promo{order:1}
  .sidebar .groups{order:2}
  body:not(.mobile-chat-open) .main{display:none;}
  body.mobile-chat-open .sidebar{display:none;}
  body.mobile-chat-open .main{display:flex;}
  .chat-insights{grid-template-columns:1fr;}
}

@media(max-width:640px){
  header.app-header{padding:10px 12px}
  .brand h1{font-size:14px}
  .brand p{font-size:11px}
  .app{
    padding:10px;
    gap:10px;
    display:flex;
    flex-direction:column;
    height:auto;
  }
  .sidebar{
    padding:10px;
    max-height:none;
    overflow:visible;
  }
  .main{
    padding:10px;
    flex:1 1 auto;
    min-height:0;
  }
  .group-item{
    grid-template-columns:38px minmax(0,1fr) auto;
    gap:10px;
    padding:11px;
  }
  .messages{padding:10px}
  .msg{max-width:85%}
  .chat-title{gap:8px}
  .avatar{width:38px;height:38px}
  .group-actions{
    min-width:54px;
    gap:6px;
  }
  .group-item .time{
    font-size:10px;
    min-width:40px;
  }
  .composer{
    gap:6px;
    position:sticky;
    bottom:0;
    background:var(--bg);
    padding:8px 6px;
    border-top:1px solid rgba(255,255,255,0.06);
  }
  .composer input{padding:9px}
  .composer button{padding:9px 12px}
  .menu{right:12px;top:52px}
  .profile-card{padding:10px}
  .profile-avatar{width:38px;height:38px}
  .sidebar .profile-card{
    top:10px;
    padding:12px 12px 10px;
    border-radius:20px;
  }
  .sidebar .profile-head{
    min-height:46px;
    margin-bottom:6px;
  }
  .sidebar .profile-avatar{
    width:44px;
    height:44px;
  }
  .sidebar .profile-name{
    font-size:14px;
  }
  .sidebar .profile-code{
    font-size:11px;
  }
}

@media(max-width:420px){
  .app{padding:10px}
  .messages{min-height:40dvh}
  .msg{max-width:92%}
  .sidebar h3{font-size:14px}
  .group-item{
    grid-template-columns:38px minmax(0,1fr);
  }
  .group-actions{
    grid-column:2;
    flex-direction:row;
    justify-content:flex-end;
    align-items:center;
    min-width:0;
  }
  .group-social-row{
    gap:4px;
  }
  .group-social-chip{
    padding:3px 7px;
    font-size:9px;
  }
  .create-btn{padding:9px}
  .menu-btn{padding:6px}
  .profile-drawer{width:100vw}
  .profile-stats-grid{grid-template-columns:1fr}
}

.mobile-back{
  display:none;
  border:0;
  background:transparent;
  color:var(--accent);
  font-size:20px;
  padding:4px 6px;
  border-radius:8px;
  cursor:pointer;
}

@media(max-width:880px){
  .mobile-back{display:inline-flex;align-items:center;justify-content:center;}
}

.drawer-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  margin-top:8px;
}

.image-btn{
  cursor:pointer;
  font-size:12px;
  display:flex;
  align-items:center;
  padding:6px 8px;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:8px;
  background:rgba(255,255,255,0.02);
}

.attach-row{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:2px;
}

section.main > label.image-btn{display:none;}

.attachment-preview{
  display:flex;
  align-items:center;
  gap:10px;
  margin:6px 0 2px;
  min-height:0;
}
.attachment-card{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.02);
  font-size:12px;
}
.attachment-card img{
  width:42px;height:42px;border-radius:8px;object-fit:cover;
}
.attachment-remove{
  border:0;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-size:12px;
}


#chatAvatar{
  cursor: pointer;
  position: relative;
  z-index: 10;
}



/* ===== GROUP PROFILE MODAL ACTIONS ===== */

.group-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

/* Avatar gruppo cliccabile */
#groupPhotoPreview {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid rgba(255, 209, 102, 0.6);
  transition: transform .2s ease, box-shadow .2s ease;
}

#groupPhotoPreview:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.15);
}

/* Testo sotto avatar */
.group-photo-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.group-role-summary{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:8px 0 10px;
}

.group-role-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
}

.group-role-pill.is-owner{
  color:#ffe7ad;
  border-color:rgba(255,209,102,0.28);
  background:rgba(255,209,102,0.1);
}

.group-role-pill.is-admin{
  color:#dff1ff;
  border-color:rgba(121,190,255,0.24);
  background:rgba(121,190,255,0.1);
}

.group-role-pill.is-member{
  color:#d9e4f7;
}

.group-members-list{
  max-height:260px;
  overflow:auto;
}

.group-manage-hint{
  margin:0 0 10px;
}

/* ===== INPUTS ===== */

.group-profile-input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: #fff;
  margin-bottom: 8px;
}

.group-profile-input:focus {
  outline: none;
  border-color: rgba(255, 209, 102, 0.6);
}

/* ===== ACTION BUTTONS ===== */

.group-profile-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Annulla */
.group-btn-cancel {
  padding: 10px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--muted);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.group-btn-cancel:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

/* Salva */
.group-btn-save {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(
    90deg,
    var(--accent),
    var(--accent-strong)
  );
  color: #000;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.group-btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 209, 102, 0.35);
}

/* Stato disabilitato (opzionale) */
.group-btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.member-row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding:8px 6px;
  border-radius:10px;
  cursor:pointer;
}
.member-row:hover{background:rgba(255,255,255,0.03)}
.member-avatar{
  width:34px;height:34px;border-radius:8px;
  background:linear-gradient(135deg,#222,#111);
  display:flex;align-items:center;justify-content:center;
  color:var(--accent);font-weight:700;font-size:13px;
}
.member-meta{min-width:0}
.member-name{font-size:12px;font-weight:700}
.member-bio{
  font-size:11px;color:var(--muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  max-width:220px;
}
.member-role{
  font-size:10px;
  padding:3px 7px;
  margin-left:6px;
  border-radius:999px;
  background:rgba(255,255,255,0.06);
  color:var(--muted);
  border:1px solid rgba(255,255,255,0.08);
}

.member-role.is-owner{
  color:#ffe7ad;
  border-color:rgba(255,209,102,0.3);
  background:rgba(255,209,102,0.12);
}

.member-role.is-admin{
  color:#dff1ff;
  border-color:rgba(121,190,255,0.26);
  background:rgba(121,190,255,0.12);
}

.member-role.is-member,
.member-role.is-self{
  color:#d4ddec;
}

.member-actions{
  margin-left:auto;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
}

.member-action-btn{
  min-height:30px;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.1);
  background:rgba(255,255,255,0.04);
  color:#fff;
  font-size:11px;
  cursor:pointer;
}

.member-action-btn.danger{
  border-color:rgba(255,107,107,0.24);
  color:#ffd6d6;
  background:rgba(255,107,107,0.08);
}

.member-action-placeholder{
  font-size:12px;
  color:var(--muted);
  padding:4px 6px;
}
mark{
  background:rgba(255,209,102,0.25);
  color:#fff;
  padding:0 2px;
  border-radius:4px;
}

/* ===== Signal Room ===== */
.signal-room-layout{
  display:flex;
  gap:12px;
  flex:1;
  min-height:0;
}
.signal-room-stream{
  display:flex;
  flex-direction:column;
  gap:10px;
  flex:1;
  min-width:0;
}
.signal-room-stats{
  display:none;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  gap:8px;
}
.stat-card{
  padding:10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.06);
  background:rgba(255,255,255,0.02);
}
.stat-card .label{font-size:11px;color:var(--muted)}
.stat-card .value{font-size:16px;font-weight:700}

.signal-room-panel{
  display:none;
  width:320px;
  min-width:280px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.06);
  background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  padding:12px;
  flex-direction:column;
  gap:12px;
}
.panel-header{display:flex;flex-direction:column;gap:4px}
.panel-title{font-weight:700;font-size:14px;color:var(--accent)}
.panel-sub{font-size:12px;color:var(--muted)}
.signal-chart{
  border-radius:10px;
  border:1px dashed rgba(255,255,255,0.08);
  padding:10px;
  min-height:160px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.chart-placeholder{
  height:120px;
  border-radius:8px;
  background:linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  color:var(--muted);
}
.chart-meta{font-size:12px;color:var(--muted)}
.signal-details{
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.06);
  padding:10px;
  min-height:140px;
  background:rgba(255,255,255,0.02);
}

.signal-composer{display:none;flex-direction:column;gap:8px}
.signal-tabs{
  display:flex;
  gap:8px;
}
.signal-tab{
  border:1px solid rgba(255,255,255,0.08);
  background:transparent;
  color:var(--muted);
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
  font-size:12px;
}
.signal-tab.active{
  background:rgba(255,209,102,0.14);
  color:var(--accent);
  border-color:rgba(255,209,102,0.35);
}
.signal-panel{display:none;gap:8px;flex-direction:column}
.signal-panel.active{display:flex}
.signal-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:8px;
}
.signal-grid .field,
.signal-panel .field{display:flex;flex-direction:column;gap:6px}
.signal-panel label{font-size:11px;color:var(--muted)}
.signal-panel input,
.signal-panel textarea,
.signal-panel select{
  padding:8px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.06);
  background:transparent;
  color:#fff;
}
.signal-actions{display:flex;justify-content:flex-end}

.signal-card{
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.015);
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
  box-shadow:0 2px 8px rgba(0,0,0,0.18);
  aspect-ratio:15 / 9;
  min-height:0;
}
.signal-card .signal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.signal-badge{
  font-size:11px;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(255,255,255,0.05);
  color:#fff;
  letter-spacing:0.2px;
}
.signal-badge.buy{background:rgba(69, 201, 128, 0.18); color:#dff7ea; border:1px solid rgba(69,201,128,0.25)}
.signal-badge.sell{background:rgba(255, 107, 107, 0.18); color:#ffe3e3; border:1px solid rgba(255,107,107,0.25)}
.signal-status{
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(255,255,255,0.08);
  color:#fff;
}
.signal-status.closed{background:rgba(255,255,255,0.14)}
.signal-status.tp{background:rgba(69,201,128,0.18); color:#dff7ea}
.signal-status.sl{background:rgba(255,107,107,0.18); color:#ffe3e3}
.signal-values{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:6px;
}
.signal-values .item{
  font-size:11px;
  color:var(--muted);
  padding:6px 8px;
  border-radius:8px;
  background:rgba(255,255,255,0.015);
  border:1px solid rgba(255,255,255,0.06);
}
.signal-values .item strong{color:#fff}
.signal-actions-row{display:flex;flex-wrap:wrap;gap:6px}
.signal-actions-row button{
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.02);
  color:#fff;
  padding:5px 10px;
  border-radius:8px;
  cursor:pointer;
  font-size:11px;
}
.signal-actions-row button.primary{
  background:linear-gradient(90deg,var(--accent),var(--accent-strong));
  color:#000;
  border:0;
}
.signal-proof{
  display:inline-flex;
  align-items:center;
  width:fit-content;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid rgba(121,190,255,0.22);
  background:rgba(121,190,255,0.08);
  color:#dff1ff;
  font-size:11px;
}

/* Signal card refined (FTMO-like, lighter) */
.signal-card{
  position:relative;
  overflow:hidden;
}
.signal-card::before{content:none;}
.signal-values .item strong{
  font-weight:700;
  letter-spacing:0.2px;
}
.signal-actions-row button{
  transition:background .15s ease, border-color .15s ease, transform .15s ease;
}
.signal-actions-row button:hover{
  border-color:rgba(255,255,255,0.2);
  transform:translateY(-1px);
}
.analysis-card{
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.02);
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.analysis-card h4{margin:0;font-size:14px}
.analysis-card p{margin:0;font-size:12px;color:var(--muted);line-height:1.4}
.analysis-images{display:flex;flex-wrap:wrap;gap:8px}
.analysis-images img{width:120px;height:90px;object-fit:cover;border-radius:8px}

.signal-room-enabled #signalStats{display:grid}
.signal-room-enabled #signalComposer{display:flex}
.signal-room-enabled #composerNormal{display:none}
.signal-room-enabled #signalPanel{display:flex}
.signal-room-enabled .messages{border:1px solid rgba(255,209,102,0.06)}

@media(max-width:1080px){
  .signal-room-layout{flex-direction:column}
  .signal-room-panel{width:100%}
}

/* ===== Social Premium Upgrade ===== */
:root{
  --bg:#06080d;
  --card:#0b1017;
  --card-strong:#101722;
  --card-soft:#111a27;
  --text-soft:#e8eef8;
  --muted:#9aa6bc;
  --accent:#ffd166;
  --accent-strong:#ffbc42;
  --accent-soft:rgba(255,209,102,0.12);
  --line:rgba(255,255,255,0.07);
  --line-strong:rgba(255,255,255,0.12);
  --success:#45c980;
  --danger:#ff6b6b;
  --info:#79beff;
}

html,body{
  background:
    radial-gradient(circle at top left, rgba(255,209,102,0.08), transparent 26%),
    radial-gradient(circle at top right, rgba(82,143,255,0.12), transparent 28%),
    linear-gradient(180deg, #09101a 0%, #05070b 48%, #050609 100%);
  color:var(--text-soft);
}
body{
  color:var(--text-soft);
}

.app{
  grid-template-columns:minmax(300px,340px) minmax(0,1fr) minmax(250px,290px);
  gap:18px;
  align-items:start;
  min-height:calc(100vh - 76px);
}

.sidebar,
.main,
.promo-rail__stack{
  border:1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015)),
    rgba(8,12,19,0.88);
  box-shadow:0 24px 70px rgba(0,0,0,0.32);
  backdrop-filter:blur(14px);
}

.sidebar{
  position:sticky;
  top:88px;
  max-height:calc(100vh - 106px);
  overflow:auto;
  padding:16px;
}

.main{
  min-width:0;
  min-height:calc(100vh - 106px);
  padding:14px;
  border-radius:20px;
}

.profile-card,
.sidebar-panel,
.chat-status,
.chat-insights .insight-chip,
.group-item,
.signal-room-onboarding,
.signal-room-stats .stat-card,
.signal-room-panel,
.composer-context,
.composer-hint,
.pinned-banner,
.top-room-card,
.trend-card,
.activity-item{
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  box-shadow:none;
}

.profile-card{
  padding:14px;
  border-radius:18px;
}

.profile-head{
  align-items:flex-start;
}

.profile-avatar,
.avatar,
.member-avatar,
.msg-avatar{
  border-radius:14px;
  background:
    linear-gradient(135deg, rgba(255,209,102,0.18), rgba(121,190,255,0.14)),
    rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
}

.profile-avatar{
  width:48px;
  height:48px;
}

.sidebar h3{
  font-size:13px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#f4ddb2;
  margin:0 0 10px;
}

.chat-insights{
  margin:10px 0 12px;
}

.chat-insights .insight-chip{
  padding:12px 10px;
  border-radius:14px;
}

.chat-insights .insight-chip span{
  display:block;
  font-size:10px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:6px;
}

.chat-insights .insight-chip strong{
  font-size:14px;
  color:#fff;
}

.sidebar-search-row{
  display:flex;
  gap:10px;
  margin-bottom:10px;
}

.sidebar-search-row input,
.chat-toolbar-search input{
  width:100%;
  padding:11px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
  color:#fff;
  outline:none;
}

.sidebar-search-row input:focus,
.chat-toolbar-search input:focus{
  border-color:rgba(255,209,102,0.36);
  box-shadow:0 0 0 4px rgba(255,209,102,0.08);
}

.create-group-inline{
  width:auto;
  flex:0 0 auto;
  padding-inline:14px;
}

.filter-row,
.message-filter-row{
  display:flex;
  gap:8px;
  flex-wrap:nowrap;
  overflow:auto;
  scrollbar-width:none;
}

.filter-row::-webkit-scrollbar,
.message-filter-row::-webkit-scrollbar{
  display:none;
}

.filter-chip,
.message-filter{
  flex:0 0 auto;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.02);
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  transition:transform .16s ease, background .16s ease, border-color .16s ease;
}

.filter-chip:hover,
.message-filter:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,0.14);
}

.filter-chip.active,
.message-filter.active{
  color:#fff0c6;
  border-color:rgba(255,209,102,0.34);
  background:linear-gradient(180deg, rgba(255,209,102,0.22), rgba(255,209,102,0.08));
}

.native-promo{
  display:none;
  width:100%;
  margin:12px 0 0;
  padding:14px;
  border-radius:18px;
  text-align:left;
  cursor:pointer;
}

.native-promo[hidden]{
  display:none !important;
}

.native-promo:not([hidden]){
  display:none;
}

.sidebar-panel{
  margin-top:12px;
  padding:14px;
  border-radius:18px;
}

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

.section-head span{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#f3ddae;
}

.section-head strong{
  font-size:11px;
  color:var(--muted);
}

.text-btn{
  border:0;
  background:transparent;
  color:var(--accent);
  font-size:12px;
  cursor:pointer;
  padding:0;
}

.top-room-card{
  padding:14px;
  border-radius:16px;
  cursor:pointer;
}

.top-room-kicker,
.trend-card__meta,
.activity-item__meta{
  font-size:11px;
  color:var(--muted);
}

.top-room-title,
.trend-card__name{
  font-size:15px;
  font-weight:700;
  color:#fff;
}

.top-room-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.top-room-meta span,
.trend-card__footer span{
  padding:6px 8px;
  border-radius:999px;
  font-size:11px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
}

.discovery-list,
.activity-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.trend-card,
.activity-item{
  width:100%;
  border-radius:16px;
  padding:12px;
  cursor:pointer;
  text-align:left;
  color:#fff;
  transition:transform .16s ease, border-color .16s ease;
}

.trend-card:hover,
.activity-item:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,0.14);
}

.trend-card__desc{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
}

.trend-card__footer{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.activity-item{
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.activity-dot{
  width:10px;
  height:10px;
  margin-top:6px;
  border-radius:50%;
  background:linear-gradient(180deg, var(--accent), #fff2b8);
  box-shadow:0 0 0 4px rgba(255,209,102,0.08);
}

.groups{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:12px;
}

.group-item{
  position:relative;
  grid-template-columns:52px minmax(0,1fr) auto;
  gap:12px;
  padding:14px;
  border-radius:18px;
  cursor:pointer;
  transition:transform .18s ease, border-color .18s ease, background .18s ease;
}

.group-item:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,0.14);
}

.group-item.active{
  border-color:rgba(255,209,102,0.32);
  background:
    linear-gradient(180deg, rgba(255,209,102,0.14), rgba(255,255,255,0.02)),
    rgba(15,17,23,0.92);
}

.group-item .avatar{
  width:52px;
  height:52px;
  font-size:17px;
}

.group-meta{
  min-width:0;
}

.group-item__top,
.group-title-row,
.group-footer,
.group-trailing{
  display:flex;
  align-items:center;
  gap:8px;
}

.group-item__top{
  justify-content:space-between;
  margin-bottom:4px;
}

.group-title-row{
  min-width:0;
}

.group-type-icon{
  width:24px;
  height:24px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  background:rgba(255,255,255,0.05);
  color:var(--accent);
  border:1px solid rgba(255,255,255,0.07);
}

.group-meta .name{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  font-size:14px;
  font-weight:700;
}

.group-meta .preview{
  margin-top:2px;
  font-size:12px;
  color:#c7d1e3;
  line-height:1.45;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.group-preview-author{
  font-size:11px;
  color:var(--muted);
}

.group-badges,
.group-footer{
  flex-wrap:wrap;
}

.group-footer{
  margin-top:10px;
  justify-content:space-between;
}

.group-member-pill,
.group-score-chip,
.group-type-pill,
.group-unread-badge,
.group-new-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:5px 9px;
  border-radius:999px;
  font-size:11px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
}

.group-type-pill{
  color:#ffeab5;
  border-color:rgba(255,209,102,0.22);
}

.group-score-chip{
  color:#dff3ff;
  border-color:rgba(121,190,255,0.26);
}

.group-unread-badge{
  min-width:24px;
  color:#041018;
  font-weight:800;
  background:linear-gradient(180deg, #8cd8ff, #79beff);
  border-color:transparent;
}

.group-new-pill{
  color:#e8fff2;
  background:rgba(69,201,128,0.18);
  border-color:rgba(69,201,128,0.26);
}

.group-actions{
  min-width:84px;
  align-items:flex-end;
  gap:10px;
}

.group-item .time{
  font-size:11px;
  color:var(--muted);
}

.group-quick-action{
  min-height:34px;
  padding:7px 12px;
  border-radius:999px;
}

.chat-header{
  align-items:flex-start;
  gap:12px;
  padding:2px 2px 4px;
}

.chat-title{
  min-width:0;
  align-items:flex-start;
}

.chat-heading{
  min-width:0;
}

.chat-header-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.chat-heading-top{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.chat-name{
  font-size:20px;
  font-weight:800;
  line-height:1.1;
}

.chat-sub{
  margin-top:5px;
  font-size:13px;
  color:var(--muted);
  line-height:1.4;
}

.chat-meta-pills{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}

.header-pill,
.live-badge,
.panel-pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
}

.live-badge{
  color:#e5fff0;
  border-color:rgba(69,201,128,0.28);
  background:rgba(69,201,128,0.16);
}

.panel-pill{
  color:#e9f4ff;
  border-color:rgba(121,190,255,0.24);
  background:rgba(121,190,255,0.12);
}

.chat-toolbar{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:10px;
}

.chat-toolbar-search{
  width:100%;
}

.pinned-banner{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  margin:0 0 12px;
  padding:12px 14px;
  border-radius:16px;
  color:#fff;
  text-align:left;
  cursor:pointer;
}

.pinned-banner.hidden{
  display:none !important;
}

.pinned-label{
  padding:6px 8px;
  border-radius:999px;
  background:rgba(255,209,102,0.18);
  color:#fff1bd;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.pinned-banner strong{
  font-size:13px;
}

.pinned-banner span:last-child{
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.signal-room-layout{
  gap:14px;
}

.signal-room-stream{
  gap:12px;
}

.signal-room-onboarding{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px;
  border-radius:18px;
}

.signal-room-onboarding h3{
  margin:4px 0 6px;
  font-size:18px;
}

.signal-room-onboarding p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.signal-room-eyebrow{
  margin:0;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.14em;
  color:#f3ddb0;
}

.ghost-btn{
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
  color:#fff;
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  min-height:42px;
}

.signal-room-stats{
  gap:10px;
}

.stat-card{
  padding:14px;
  border-radius:16px;
  min-height:84px;
}

.stat-card .label{
  text-transform:uppercase;
  letter-spacing:.08em;
}

.stat-card .value{
  margin-top:8px;
  font-size:20px;
  letter-spacing:-0.02em;
}

.messages{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height:48vh;
  padding:18px;
  border-radius:20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01)),
    radial-gradient(circle at top, rgba(255,209,102,0.04), transparent 34%);
  border:1px solid rgba(255,255,255,0.04);
  scroll-behavior:smooth;
}

.msg-day-separator{
  display:flex;
  align-items:center;
  justify-content:center;
  margin:8px 0;
}

.msg-day-separator span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,0.04);
  border:1px solid var(--line);
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}

.msg{
  position:relative;
  max-width:min(72%, 620px);
  margin-bottom:0;
  padding:12px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.06);
  background:rgba(255,255,255,0.03);
}

.msg.them{
  border-top-left-radius:8px;
}

.msg.me{
  border-top-right-radius:8px;
  background:
    linear-gradient(180deg, rgba(255,209,102,0.12), rgba(255,255,255,0.02)),
    rgba(18,19,24,0.95);
}

.msg.bot{
  border-color:rgba(121,190,255,0.2);
  background:
    linear-gradient(180deg, rgba(121,190,255,0.14), rgba(255,255,255,0.03)),
    rgba(10,14,22,0.95);
}

.msg.signal-message{
  border-color:rgba(255,209,102,0.18);
  background:
    linear-gradient(180deg, rgba(255,209,102,0.08), rgba(255,255,255,0.02)),
    rgba(10,13,18,0.96);
}

.msg.analysis-message{
  border-color:rgba(121,190,255,0.2);
}

.msg.reactions-open{
  border-color:rgba(255,209,102,0.22);
  box-shadow:0 0 0 1px rgba(255,209,102,0.08);
}

.msg-row{
  display:flex;
  align-items:flex-end;
  gap:10px;
  margin-bottom:10px;
}

.msg-row.me{
  justify-content:flex-end;
  flex-direction:row-reverse;
}

.msg-avatar{
  width:36px;
  height:36px;
  border-radius:50%;
  align-self:flex-end;
  cursor:pointer;
}

.msg .msg-name{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:8px;
  font-size:12px;
  color:#dce5f4;
}

.msg-name .bot-badge,
.msg-type-badge{
  display:inline-flex;
  align-items:center;
  padding:3px 7px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.msg-name .bot-badge{
  color:#dff1ff;
  border:1px solid rgba(121,190,255,0.28);
  background:rgba(121,190,255,0.12);
}

.msg-type-badge{
  border:1px solid rgba(255,255,255,0.1);
  background:rgba(255,255,255,0.06);
  color:#f4ddb0;
}

.msg-reply{
  padding:10px 12px;
  border-radius:14px;
  margin-bottom:10px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
  cursor:pointer;
}

.msg-reply-label{
  display:block;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.1em;
  color:var(--muted);
  margin-bottom:4px;
}

.msg-reply strong{
  display:block;
  font-size:12px;
  color:#fff;
}

.msg-reply p{
  margin:4px 0 0;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.msg-body,
.msg-text{
  font-size:14px;
  line-height:1.5;
  color:#f3f6fc;
  word-break:break-word;
}

.msg-meta-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.msg-context-trigger{
  position:absolute;
  top:10px;
  right:10px;
  width:28px;
  height:28px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
  color:var(--muted);
  cursor:pointer;
  opacity:0;
  transition:opacity .16s ease, border-color .16s ease;
}

.msg:hover .msg-context-trigger,
.msg:focus-within .msg-context-trigger{
  opacity:1;
}

.msg-context-trigger:hover{
  border-color:rgba(255,255,255,0.16);
}

.msg-footer{
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
  font-size:11px;
}

.msg-reactions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,0.06);
  animation:reactionTrayIn .16s ease;
}

.msg-reactions-summary{
  margin-top:8px;
  padding-top:0;
  border-top:0;
}

.msg-reactions-summary .reaction-chip{
  background:rgba(255,255,255,0.05);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.02);
}

.msg-reactions-picker{
  margin-top:12px;
}

.msg-reactions-label{
  width:100%;
  font-size:10px;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--muted);
}

.reaction-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
  color:#fff;
  padding:6px 9px;
  font-size:12px;
  cursor:pointer;
  transition:border-color .18s ease, background .18s ease, transform .18s ease;
}

.msg-reactions-picker .reaction-chip{
  min-width:42px;
  justify-content:center;
}

.reaction-chip.active{
  border-color:rgba(255,209,102,0.3);
  background:rgba(255,209,102,0.14);
  color:#fff1be;
}

.reaction-chip:hover{
  border-color:rgba(255,255,255,0.16);
  background:rgba(255,255,255,0.07);
  transform:translateY(-1px);
}

.reaction-add{
  color:var(--muted);
}

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

.msg img{
  max-width:min(100%, 280px);
  border-radius:14px;
}

.msg a{
  color:#8cd8ff;
}

.msg-link-preview{
  display:block;
  margin-top:10px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
  text-decoration:none;
}

.msg-link-preview__host{
  display:block;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#8cd8ff;
}

.msg-link-preview__title{
  display:block;
  margin-top:6px;
  font-size:13px;
  color:#fff;
}

.msg-link-preview__hint{
  display:block;
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}

.msg-jump-highlight{
  box-shadow:0 0 0 2px rgba(255,209,102,0.25), 0 0 0 8px rgba(255,209,102,0.08);
}

.new-messages-indicator{
  position:sticky;
  bottom:12px;
  align-self:center;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(121,190,255,0.3);
  background:rgba(9,18,29,0.94);
  color:#dff1ff;
  font-weight:700;
  cursor:pointer;
  z-index:2;
}

.new-messages-indicator.hidden{
  display:none !important;
}

.composer-context,
.composer-hint{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-radius:16px;
  padding:12px 14px;
}

.composer-context.hidden{
  display:none !important;
}

.composer-context-copy{
  min-width:0;
}

.composer-context-label{
  display:block;
  font-size:10px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:4px;
}

.composer-context strong{
  display:block;
  font-size:13px;
  color:#fff;
}

.composer-context p{
  margin:4px 0 0;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.composer-hint{
  font-size:12px;
  color:var(--muted);
}

.text-link{
  color:var(--accent);
  text-decoration:none;
  white-space:nowrap;
}

.composer{
  align-items:center;
  padding:10px;
  border-radius:18px;
  border:1px solid var(--line);
  background:rgba(7,11,17,0.9);
}

.composer input{
  border-radius:14px;
  border-color:rgba(255,255,255,0.06);
  background:rgba(255,255,255,0.03);
  min-height:44px;
}

.composer button{
  width:auto;
  min-height:44px;
}

.signal-composer{
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(7,11,17,0.9);
  padding:12px;
}

.signal-tab{
  min-height:40px;
  padding:8px 12px;
}

.signal-grid{
  gap:10px;
}

.signal-panel input,
.signal-panel textarea,
.signal-panel select{
  min-height:42px;
  border-radius:12px;
  border-color:rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
}

.signal-panel textarea{
  min-height:90px;
}

.signal-room-panel{
  width:340px;
  min-width:320px;
  padding:14px;
  border-radius:20px;
}

.panel-header{
  flex-direction:row;
  justify-content:space-between;
  align-items:flex-start;
}

.signal-confirm-strip{
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(121,190,255,0.16);
  background:rgba(121,190,255,0.08);
  color:#dff1ff;
  font-size:12px;
  line-height:1.45;
}

.signal-chart,
.signal-details,
.signal-history{
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
}

.signal-history{
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height:120px;
}

.signal-history-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.06);
  background:rgba(255,255,255,0.03);
  cursor:pointer;
}

.signal-history-item strong{
  display:block;
  font-size:13px;
}

.signal-history-item span{
  font-size:11px;
  color:var(--muted);
}

.signal-card{
  padding:14px;
  border-radius:18px;
  gap:10px;
  aspect-ratio:auto;
}

.signal-card .signal-head{
  align-items:flex-start;
}

.signal-values{
  grid-template-columns:repeat(auto-fit,minmax(110px,1fr));
  gap:8px;
}

.signal-values .item{
  min-height:56px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  padding:10px;
  border-radius:14px;
}

.analysis-card{
  border-radius:18px;
  padding:14px;
}

.analysis-card h4{
  font-size:16px;
}

.analysis-card p{
  font-size:13px;
}

.promo-rail{
  position:sticky;
  top:88px;
  align-self:start;
}

.promo-rail__stack{
  border-radius:20px;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.promo-card{
  padding:16px;
  border-radius:18px;
  border:1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,209,102,0.1), rgba(255,255,255,0.02)),
    rgba(9,13,20,0.96);
}

.promo-card__eyebrow{
  font-size:10px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#f4ddb0;
}

.promo-card h4{
  margin:8px 0 6px;
  font-size:16px;
}

.promo-card p{
  margin:0 0 12px;
  font-size:13px;
  color:var(--muted);
  line-height:1.45;
}

.promo-card__cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid rgba(255,209,102,0.26);
  color:#fff1bd;
  text-decoration:none;
  font-size:12px;
  font-weight:700;
  background:rgba(255,209,102,0.12);
}

.promo-card__meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.promo-card__meta span{
  padding:6px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
  font-size:11px;
  color:var(--muted);
}

.message-actions-modal{
  max-width:420px;
}

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

.message-action-btn{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
  min-height:48px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
  color:#fff;
  cursor:pointer;
  text-align:left;
}

.message-action-btn span:last-child{
  color:var(--muted);
  font-size:12px;
}

.message-action-btn.danger{
  border-color:rgba(255,107,107,0.22);
  color:#ffd8d8;
}

.profile-drawer{
  width:380px;
  background:
    linear-gradient(180deg, rgba(15,22,33,0.98), rgba(7,11,17,0.98));
  border-left:1px solid var(--line);
  border-top-left-radius:20px;
  border-bottom-left-radius:20px;
  padding-bottom:24px;
}

.profile-drawer__header,
.drawer-actions{
  gap:10px;
}

.profile-drawer__section{
  padding:14px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.025);
}

.profile-drawer__section h4{
  font-size:12px;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:#f4ddb0;
}

.profile-stat{
  border-radius:14px;
  padding:12px;
}

.profile-stat .value{
  margin-top:4px;
  font-size:16px;
}

.empty{
  padding:28px 16px;
  border-radius:16px;
  color:var(--muted);
}

.empty.rich-empty{
  text-align:left;
  background:rgba(255,255,255,0.03);
  border:1px dashed rgba(255,255,255,0.08);
}

.empty.rich-empty h4{
  margin:0 0 8px;
  font-size:16px;
  color:#fff;
}

.empty.rich-empty p{
  margin:0 0 12px;
  line-height:1.45;
}

.empty-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.profile-avatar,
.avatar,
.member-avatar,
.msg-avatar{
  position:relative;
  overflow:hidden;
  flex-shrink:0;
}

.profile-avatar img,
.avatar img,
.member-avatar img,
.msg-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.profile-avatar.has-photo,
.avatar.has-photo,
.member-avatar.has-photo,
.msg-avatar.has-photo{
  background:#10161f;
  color:transparent;
  border-color:rgba(255,255,255,0.14);
}

.profile-photo-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:8px;
}

.profile-photo-actions .menu-btn{
  flex:1 1 0;
  min-height:38px;
}

.profile-photo-actions .menu-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.profile-drawer__identity{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.profile-drawer__header{
  align-items:flex-start;
  position:sticky;
  top:0;
  z-index:3;
  padding-bottom:10px;
  background:linear-gradient(180deg, rgba(15,22,33,0.98), rgba(15,22,33,0.92) 72%, rgba(15,22,33,0));
  backdrop-filter:blur(8px);
}

.profile-avatar--drawer{
  width:64px;
  height:64px;
  border-radius:18px;
}

#groupProfileModal .modal{
  max-height:min(88dvh,860px);
  padding-bottom:20px;
}

#groupProfileModal .actions{
  position:sticky;
  bottom:0;
  padding-top:12px;
  background:linear-gradient(180deg, rgba(12,16,22,0), rgba(12,16,22,0.94) 30%, rgba(12,16,22,0.98));
}

.profile-avatar{
  cursor:pointer;
}

.sidebar .profile-card{
  padding:9px 10px;
  margin-bottom:10px;
  border-radius:14px;
}

.sidebar .profile-head{
  gap:8px;
  margin-bottom:4px;
  min-height:40px;
}

.sidebar .profile-avatar{
  width:40px;
  height:40px;
  border-radius:12px;
}

.sidebar .profile-name{
  font-size:13px;
  line-height:1.1;
}

.sidebar .profile-code{
  margin-top:2px;
  font-size:10px;
  line-height:1;
}

.sidebar .profile-edit{
  margin-top:6px;
}

.sidebar-search-row{
  margin-top:6px;
}

.profile-avatar,
.profile-avatar--drawer,
.sidebar .profile-avatar{
  border-radius:50%;
}

.avatar,
.group-item .avatar,
.group-item--compact .avatar,
#chatAvatar{
  border-radius:50%;
}

#chatAvatar,
#chatName{
  cursor:pointer;
}

.groups{
  gap:8px;
}

.group-item{
  display:grid;
  grid-template-columns:56px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-height:90px;
  padding:12px 14px;
  border-radius:22px;
  border:1px solid rgba(255,255,255,0.08);
  background:linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
}

.group-item .avatar{
  width:56px;
  height:56px;
  border-radius:18px;
}

.group-meta{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:0;
}

.group-item__top{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
  gap:12px;
  margin-bottom:0;
}

.group-title-row{
  min-width:0;
}

.group-meta .name{
  gap:9px;
  min-width:0;
  font-size:15px;
  font-weight:800;
}

.group-name-text{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.group-type-icon{
  width:26px;
  height:26px;
  border-radius:11px;
  flex:0 0 auto;
}

.group-trailing{
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}

.group-preview-line{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}

.group-preview-avatar{
  width:20px;
  height:20px;
  flex:0 0 20px;
  border-radius:50%;
  overflow:hidden;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#212936,#0f1520);
  border:1px solid rgba(255,255,255,0.08);
  color:#cdd8ea;
  font-size:10px;
  font-weight:700;
  cursor:pointer;
}

.group-preview-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.group-preview-avatar.has-photo{
  background:#10161f;
  color:transparent;
}

.group-preview-author{
  max-width:84px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  flex-shrink:0;
  font-size:12px;
  font-weight:700;
  color:#90a1bc;
}

.group-preview-author::after{
  content: ":";
  margin-left:2px;
  color:rgba(255,255,255,0.28);
}

.group-preview-line .preview{
  margin-top:0;
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  display:block;
  color:#d8e3f4;
  font-size:13px;
  line-height:1.35;
  -webkit-line-clamp:unset;
}

.group-footer{
  margin-top:4px;
  justify-content:flex-start;
  align-items:center;
  gap:10px;
}

.group-badges{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.group-member-pill,
.group-type-pill,
.group-social-chip,
.group-new-pill{
  padding:4px 8px;
  font-size:10px;
}

.group-score-chip{
  display:none;
}

.group-actions{
  position:relative;
  min-width:54px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:center;
  gap:8px;
}

.group-item .time{
  font-size:11px;
}

.group-unread-badge{
  min-width:26px;
  height:26px;
  padding:0 8px;
}

.group-quick-action{
  min-height:30px;
  padding:6px 10px;
  font-size:11px;
  white-space:nowrap;
}

.group-menu-btn{
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.03);
}

.group-item--compact{
  min-height:68px;
  padding:8px 12px;
  border-radius:18px;
  grid-template-columns:50px minmax(0,1fr) auto;
}

.group-item--compact .avatar{
  width:50px;
  height:50px;
  border-radius:16px;
}

.group-item--compact .group-meta{
  justify-content:center;
  gap:3px;
}

.group-item--compact .group-meta .name{
  font-size:14px;
}

.group-item--compact.has-unread .group-name-text{
  color:#fff2c2;
}

.group-item--compact.has-unread .group-preview-line .preview{
  color:#eef5ff;
}

.group-item--compact .group-item__top{
  align-items:center;
  gap:10px;
}

.group-item--compact .group-trailing{
  gap:4px;
}

.group-item--compact .group-preview-line{
  display:flex;
  align-items:center;
  gap:5px;
  min-width:0;
}

.group-item--compact .group-preview-avatar{
  width:18px;
  height:18px;
  flex-basis:18px;
  font-size:9px;
}

.group-item--compact .group-preview-line .preview{
  font-size:12px;
}

.group-item--compact .group-preview-author{
  max-width:74px;
  font-size:11px;
}

.group-item--compact .group-actions{
  min-width:38px;
  gap:0;
}

.group-item--compact .group-menu-btn{
  width:30px;
  height:30px;
  border-color:transparent;
  background:transparent;
  color:#8797b3;
}

@media(max-width:1440px){
  .app{
    grid-template-columns:minmax(300px,340px) minmax(0,1fr);
  }
  .promo-rail{
    display:none;
  }
}

@media(max-width:1080px){
  .main{
    min-height:0;
  }
  .signal-room-layout{
    flex-direction:column;
  }
  .signal-room-panel{
    order:-1;
    width:100%;
    min-width:0;
  }
  body.signal-panel-collapsed .signal-room-panel{
    display:none !important;
  }
}

@media(max-width:880px){
  .app{
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
    padding:12px;
    min-height:auto;
  }
  .sidebar,
  .main{
    position:relative;
    top:auto;
    max-height:none;
  }
  .sidebar{
    padding:14px;
  }
  .main{
    padding:12px;
    min-height:calc(100dvh - 24px);
  }
  .native-promo:not([hidden]){
    display:block;
  }
  .chat-header{
    position:sticky;
    top:0;
    z-index:5;
    padding:4px 0 8px;
    background:linear-gradient(180deg, rgba(6,8,13,0.96), rgba(6,8,13,0.78), transparent);
    backdrop-filter:blur(10px);
  }
  .chat-name{
    font-size:18px;
  }
  .messages{
    min-height:52dvh;
    padding:14px;
    border-radius:18px;
  }
  .msg{
    max-width:calc(100% - 48px);
  }
  .msg-avatar{
    width:34px;
    height:34px;
  }
  .signal-room-onboarding{
    flex-direction:column;
    align-items:flex-start;
  }
}

@media(max-width:640px){
  .sidebar-panel{
    padding:12px;
  }
  .group-item{
    grid-template-columns:48px minmax(0,1fr) auto;
    min-height:82px;
    padding:11px 12px;
    gap:10px;
    border-radius:20px;
  }
  .group-item .avatar{
    width:48px;
    height:48px;
    border-radius:16px;
  }
  .group-actions{
    min-width:44px;
    gap:6px;
  }
  .group-preview-author{
    max-width:72px;
  }
  .member-row{
    align-items:flex-start;
  }
  .member-actions{
    max-width:160px;
  }
  .group-quick-action{
    padding:6px 9px;
    font-size:10px;
  }
  .group-item--compact{
    min-height:64px;
    grid-template-columns:46px minmax(0,1fr) auto;
    padding:8px 10px;
  }
  .group-item--compact .avatar{
    width:46px;
    height:46px;
    border-radius:14px;
  }
  .chat-meta-pills{
    margin-top:8px;
    gap:6px;
  }
  .header-pill,
  .live-badge{
    padding:5px 8px;
    font-size:10px;
  }
  .chat-toolbar{
    margin-bottom:8px;
  }
  .pinned-banner{
    padding:10px 12px;
    border-radius:14px;
  }
  .composer,
  .signal-composer{
    position:sticky;
    bottom:0;
    z-index:4;
    box-shadow:0 -10px 30px rgba(0,0,0,0.28);
  }
  .composer{
    padding:8px;
  }
  .composer-hint,
  .composer-context{
    padding:10px 12px;
  }
  .msg{
    max-width:calc(100% - 42px);
    border-radius:16px;
  }
  .msg-avatar{
    width:32px;
    height:32px;
  }
  .msg-context-trigger{
    opacity:1;
  }
}

@media(max-width:420px){
  .main{
    padding:10px;
  }
  .sidebar{
    padding:12px;
  }
  .chat-title{
    gap:10px;
  }
  .avatar{
    width:42px;
    height:42px;
  }
  .chat-name{
    font-size:17px;
  }
  .group-item{
    grid-template-columns:44px minmax(0,1fr) auto;
    gap:10px;
  }
  .group-actions{
    grid-column:auto;
    flex-direction:column;
    justify-content:center;
    align-items:flex-end;
    min-width:40px;
  }
  .group-item .avatar{
    width:44px;
    height:44px;
    border-radius:14px;
  }
  .group-item--compact{
    min-height:60px;
    grid-template-columns:42px minmax(0,1fr) auto;
    padding:7px 8px 7px 10px;
  }
  .group-item--compact .avatar{
    width:42px;
    height:42px;
    border-radius:12px;
  }
  .group-item--compact .group-preview-author{
    max-width:62px;
  }
  .group-meta .name{
    font-size:14px;
  }
  .group-preview-line .preview{
    font-size:12px;
  }
  .profile-photo-actions{
    flex-direction:column;
  }
  .profile-photo-actions .menu-btn{
    width:100%;
  }
  .member-row{
    flex-wrap:wrap;
  }
  .member-meta{
    flex:1 1 calc(100% - 52px);
  }
  .member-actions{
    width:100%;
    margin-left:44px;
    justify-content:flex-start;
  }
  .msg{
    max-width:100%;
  }
  .msg-avatar{
    width:30px;
    height:30px;
  }
  .signal-values{
    grid-template-columns:1fr 1fr;
  }
  .profile-drawer{
    width:100dvw;
    border-radius:0;
  }
}
