:root{--blue:#2563eb;--pink:#ec4899;--green:#22c55e;--dark:#111827}
body{margin:0;font-family:Arial,Helvetica,sans-serif;color:#111827;background:linear-gradient(135deg,#fef3c7,#dbeafe,#fce7f3);min-height:100vh}
body.dark{background:#111827;color:#f9fafb}
body.ocean{background:linear-gradient(135deg,#cffafe,#dbeafe,#e0f2fe)}
body.space{background:radial-gradient(circle at top,#1e1b4b,#020617);color:#f9fafb}
header{background:#111827;color:white;padding:12px 14px;display:flex;align-items:center;gap:12px;position:sticky;top:0;z-index:10}
.logo{font-size:30px;background:white;color:#111827;border-radius:50%;width:46px;height:46px;display:flex;align-items:center;justify-content:center}
nav{margin-left:auto}
nav a{color:white;margin-left:10px;text-decoration:none;font-weight:bold}
main{max-width:1050px;margin:auto;padding:14px}
.card{background:rgba(255,255,255,.94);border-radius:20px;padding:16px;margin:12px 0;box-shadow:0 6px 18px #0001;border:1px solid #ffffffaa}
.dark .card,.space .card{background:#1f2937;color:#f9fafb;border-color:#374151}
input,select,textarea,button{font-size:16px;padding:10px;border-radius:12px;border:1px solid #d1d5db}
textarea{width:100%;min-height:75px;box-sizing:border-box}
button,.btn{background:var(--blue);color:white;border:0;cursor:pointer;border-radius:12px;padding:10px 14px;display:inline-block;text-decoration:none;font-weight:bold}
.pink{background:var(--pink)}.gray{background:#6b7280}.red{background:#dc2626}
a{color:#2563eb;text-decoration:none;font-weight:bold}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
.hero{background:linear-gradient(135deg,#fff,#fef3c7,#dbeafe);border:3px solid white;color:#111827}
.small{font-size:12px;color:#6b7280}.dark .small,.space .small{color:#d1d5db}
.error{color:#dc2626;font-weight:bold}.success{color:#16a34a;font-weight:bold}

.chat-list{background:rgba(255,255,255,.94);border-radius:22px;overflow:hidden;box-shadow:0 6px 18px #0001}
.dark .chat-list,.space .chat-list{background:#1f2937}
.chat-item{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid #e5e7eb;color:inherit;text-decoration:none}
.chat-item:last-child{border-bottom:0}
.chat-item:hover{background:#f3f4f6}
.dark .chat-item:hover,.space .chat-item:hover{background:#374151}
.chat-avatar{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:30px;overflow:hidden;flex:0 0 48px;background:#f3f4f6}
.chat-avatar.center{margin:auto}
.chat-avatar img{width:48px;height:48px;border-radius:50%;object-fit:cover}
.inline-avatar{width:42px;height:42px;border-radius:50%;object-fit:cover;vertical-align:middle}
.chat-main{flex:1;min-width:0}
.chat-title{font-weight:bold;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-preview{font-size:14px;color:#6b7280;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}
.dark .chat-preview,.space .chat-preview{color:#d1d5db}
.chat-time{font-size:12px;color:#6b7280;white-space:nowrap}
.empty{padding:16px}

.friend-card{text-align:center}
.status-dot{display:inline-block;width:10px;height:10px;border-radius:50%;background:#9ca3af;margin-right:5px}
.status-dot.online{background:#22c55e}

.room-title{display:flex;align-items:center;gap:12px}
.chatbox{height:55vh;overflow-y:auto;padding:12px}
.typing{font-style:italic;color:#6b7280;padding:4px 8px}
.bubble-row{display:flex;align-items:flex-end;gap:8px;margin:10px 0}
.bubble-row.me-row{justify-content:flex-end}
.bubble-avatar{width:34px;height:34px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:24px;flex:0 0 34px;background:#f3f4f6}
.bubble-avatar img{width:34px;height:34px;border-radius:50%;object-fit:cover}
.bubble-wrap{max-width:76%}
.bubble-name{font-size:12px;color:#6b7280;margin:0 0 3px 3px}
.dark .bubble-name,.space .bubble-name{color:#d1d5db}
.msg{padding:12px 14px;border-radius:20px;margin:0;max-width:100%;word-wrap:break-word;box-shadow:0 2px 8px #0001}
.me{background:#2563eb;color:white;border-bottom-right-radius:6px}
.them{background:white;color:#111827;border-bottom-left-radius:6px}
.dark .them,.space .them{background:#374151;color:#f9fafb}
.emoji-picker{margin:10px 0}
.emoji-picker button{background:white;color:#111827;border:1px solid #ddd;margin:3px;padding:8px;font-size:20px}
.attachment{margin-top:8px}
.attachment img{max-width:260px;border-radius:14px;display:block;cursor:pointer}
.attachment video,.attachment audio{max-width:280px;display:block;margin-top:6px}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.86);display:none;align-items:center;justify-content:center;z-index:9999;padding:20px}
.lightbox img{max-width:95vw;max-height:90vh;border-radius:16px}
.lightbox.show{display:flex}

.profile-preview img{width:90px;height:90px;border-radius:50%;object-fit:cover}
.profile-preview span{font-size:80px}
.badge{display:inline-block;background:#fef3c7;color:#111827;border-radius:999px;padding:5px 9px;margin:3px}
.admin-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

@media(max-width:650px){
  main{padding:10px}
  nav a{font-size:14px;margin-left:6px}
  .chatbox{height:58vh}
  .bubble-wrap{max-width:88%}
}

/* Compact chat layout override */
.chatbox{
  height:58vh;
  overflow-y:auto;
  padding:14px;
}

.bubble-row{
  margin:6px 0;
  align-items:flex-end;
}

.bubble-row.me-row{
  justify-content:flex-end;
}

.bubble-wrap{
  max-width:68%;
}

.bubble-name{
  font-size:11px;
  margin:0 0 2px 6px;
  opacity:.75;
}

.me-row .bubble-name{
  margin:0 6px 2px 0;
}

.msg{
  padding:9px 13px;
  border-radius:18px;
  line-height:1.35;
  box-shadow:0 1px 4px #0001;
}

.me{
  border-bottom-right-radius:5px;
}

.them{
  border-bottom-left-radius:5px;
}

.bubble-avatar{
  width:30px;
  height:30px;
  flex-basis:30px;
  font-size:20px;
}

.bubble-avatar img{
  width:30px;
  height:30px;
}

.room-title{
  margin-bottom:8px;
}

.composer{
  margin-top:10px;
}

@media(max-width:650px){
  .bubble-wrap{
    max-width:82%;
  }

  .chatbox{
    height:60vh;
    padding:10px;
  }
}

/* Hard override: tight Messenger-style chat */
.chatbox{
  height:62vh !important;
  padding:12px !important;
  display:flex !important;
  flex-direction:column !important;
  gap:4px !important;
  background:#f8fafc !important;
}

.bubble-row{
  margin:2px 0 !important;
  padding:0 !important;
  display:flex !important;
  gap:6px !important;
  align-items:flex-end !important;
}

.bubble-row.me-row{
  justify-content:flex-end !important;
}

.bubble-wrap{
  max-width:55% !important;
}

.bubble-name{
  font-size:10px !important;
  margin:0 0 1px 6px !important;
  line-height:1.1 !important;
  opacity:.65 !important;
}

.me-row .bubble-name{
  text-align:right !important;
  margin:0 6px 1px 0 !important;
}

.msg{
  padding:8px 12px !important;
  margin:0 !important;
  line-height:1.25 !important;
  border-radius:17px !important;
  box-shadow:0 1px 3px rgba(0,0,0,.08) !important;
  max-width:100% !important;
}

.me{
  background:#2563eb !important;
  color:white !important;
  border-bottom-right-radius:4px !important;
}

.them{
  background:white !important;
  color:#111827 !important;
  border-bottom-left-radius:4px !important;
}

.bubble-avatar{
  width:28px !important;
  height:28px !important;
  flex:0 0 28px !important;
  font-size:18px !important;
}

.bubble-avatar img{
  width:28px !important;
  height:28px !important;
}

.composer{
  margin-top:8px !important;
}

.composer textarea{
  min-height:54px !important;
}

@media(max-width:650px){
  .bubble-wrap{
    max-width:78% !important;
  }

  .chatbox{
    height:62vh !important;
    padding:8px !important;
  }
}


/* Chat column redesign */
.room-title,
#typing,
#chatbox,
#sendform{
  max-width:760px !important;
  margin-left:auto !important;
  margin-right:auto !important;
}

.chatbox{
  height:60vh !important;
  background:#f8fafc !important;
  border-radius:22px !important;
  padding:14px !important;
  overflow-y:auto !important;
}

.bubble-row{
  width:100% !important;
  margin:5px 0 !important;
}

.bubble-wrap{
  max-width:72% !important;
}

.msg{
  display:inline-block !important;
  padding:9px 13px !important;
  border-radius:18px !important;
}

.me-row .bubble-wrap{
  text-align:right !important;
}

.me-row .msg{
  text-align:left !important;
}

.bubble-name{
  font-size:11px !important;
  margin-bottom:2px !important;
}

.composer textarea{
  min-height:60px !important;
}

@media(max-width:650px){
  .room-title,
  #typing,
  #chatbox,
  #sendform{
    max-width:100% !important;
  }

  .bubble-wrap{
    max-width:82% !important;
  }
}

/* Two-pane messenger layout */
main{
  max-width:none !important;
  padding:0 !important;
}

.app-shell{
  display:grid;
  grid-template-columns:340px minmax(0,1fr);
  height:calc(100vh - 70px);
  overflow:hidden;
}

.messenger-sidebar{
  background:rgba(255,255,255,.96);
  border-right:1px solid #e5e7eb;
  overflow-y:auto;
  padding:14px;
}

.dark .messenger-sidebar,
.space .messenger-sidebar{
  background:#111827;
  border-right-color:#374151;
}

.sidebar-header{
  padding:6px 8px 12px;
}

.sidebar-header h2{
  margin:0;
}

.sidebar-header p{
  margin:4px 0 0;
  color:#6b7280;
}

.sidebar-list{
  border-radius:18px;
  overflow:hidden;
}

.side-chat{
  display:grid;
  grid-template-columns:48px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:11px 8px;
  border-radius:14px;
  color:inherit;
  text-decoration:none;
  margin-bottom:3px;
}

.side-chat:hover,
.side-chat.active{
  background:#e0f2fe;
}

.dark .side-chat:hover,
.dark .side-chat.active,
.space .side-chat:hover,
.space .side-chat.active{
  background:#1f2937;
}

.side-chat.compact{
  grid-template-columns:42px minmax(0,1fr);
}

.side-avatar{
  width:44px;
  height:44px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  background:#f3f4f6;
  overflow:hidden;
}

.side-avatar img{
  width:44px;
  height:44px;
  border-radius:50%;
  object-fit:cover;
}

.side-main{
  min-width:0;
}

.side-title{
  font-weight:bold;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.side-preview{
  color:#6b7280;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.dark .side-preview,
.space .side-preview{
  color:#d1d5db;
}

.side-time{
  color:#6b7280;
  font-size:11px;
  white-space:nowrap;
}

.sidebar-friends{
  margin-top:22px;
}

.sidebar-friends h3{
  margin:8px;
}

.messenger-main{
  display:flex;
  flex-direction:column;
  min-width:0;
  background:#f8fafc;
}

.dark .messenger-main,
.space .messenger-main{
  background:#0f172a;
}

.chat-header{
  height:70px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 18px;
  background:rgba(255,255,255,.95);
  border-bottom:1px solid #e5e7eb;
}

.dark .chat-header,
.space .chat-header{
  background:#111827;
  border-bottom-color:#374151;
}

.chat-header h2{
  margin:0;
  font-size:20px;
}

.pane-chatbox{
  flex:1;
  height:auto !important;
  max-width:none !important;
  margin:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  border:0 !important;
  padding:18px 22px !important;
  background:#f8fafc !important;
}

.dark .pane-chatbox,
.space .pane-chatbox{
  background:#0f172a !important;
}

.pane-composer{
  max-width:none !important;
  margin:0 !important;
  border-radius:0 !important;
  border-left:0 !important;
  border-right:0 !important;
  border-bottom:0 !important;
  box-shadow:none !important;
  padding:12px 18px !important;
}

.pane-composer textarea{
  min-height:52px !important;
  resize:none;
}

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

.empty-chat{
  align-items:center;
  justify-content:center;
}

.empty-chat-card{
  text-align:center;
  color:#6b7280;
}

.big-logo{
  width:90px;
  height:90px;
  border-radius:50%;
  background:#111827;
  color:white;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:54px;
  margin:0 auto 18px;
}

.bubble-wrap{
  max-width:58% !important;
}

@media(max-width:800px){
  .app-shell{
    grid-template-columns:1fr;
    height:auto;
    min-height:calc(100vh - 70px);
  }

  .messenger-sidebar{
    border-right:0;
    border-bottom:1px solid #e5e7eb;
    max-height:42vh;
  }

  .messenger-main{
    min-height:58vh;
  }

  .pane-chatbox{
    min-height:42vh;
  }

  .bubble-wrap{
    max-width:82% !important;
  }
}

/* Left-weighted chat layout with per-user colored bubbles */
.pane-chatbox{
  padding-left:28px !important;
  padding-right:28px !important;
}

.bubble-row{
  justify-content:flex-start !important;
  margin:6px 0 !important;
}

.bubble-row.me-row{
  justify-content:flex-start !important;
  margin-left:70px !important;
}

.bubble-wrap{
  max-width:520px !important;
}

.bubble-row.me-row .bubble-wrap{
  max-width:520px !important;
}

.msg{
  display:inline-block !important;
  width:auto !important;
  max-width:520px !important;
}

.me{
  background:#2563eb !important;
  color:white !important;
  border-bottom-left-radius:18px !important;
  border-bottom-right-radius:5px !important;
}

.them{
  background:#e7f5d8 !important;
  color:#111827 !important;
}

.user-color-0 .them{background:#e7f5d8 !important;}
.user-color-1 .them{background:#fde2e4 !important;}
.user-color-2 .them{background:#dbeafe !important;}
.user-color-3 .them{background:#fef3c7 !important;}
.user-color-4 .them{background:#ede9fe !important;}
.user-color-5 .them{background:#ccfbf1 !important;}

.bubble-name{
  text-align:left !important;
}

@media(max-width:650px){
  .bubble-row.me-row{
    margin-left:35px !important;
  }

  .bubble-wrap,
  .bubble-row.me-row .bubble-wrap,
  .msg{
    max-width:82vw !important;
  }
}


/* FORCE LEFT CHAT LAYOUT */
.room-title,
#typing,
#chatbox,
#sendform{
  max-width:none !important;
  width:auto !important;
  margin-left:0 !important;
  margin-right:0 !important;
}

.messenger-main{
  align-items:stretch !important;
}

.pane-chatbox,
#chatbox{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:18px 24px !important;
  box-sizing:border-box !important;
}

.bubble-row{
  display:flex !important;
  justify-content:flex-start !important;
  width:100% !important;
  max-width:none !important;
  margin:6px 0 !important;
  padding:0 !important;
}

.bubble-row.me-row{
  justify-content:flex-start !important;
  margin-left:52px !important;
}

.bubble-wrap,
.bubble-row.me-row .bubble-wrap{
  max-width:620px !important;
  width:auto !important;
}

.msg{
  display:inline-block !important;
  width:auto !important;
  max-width:620px !important;
}

.me{
  background:#2563eb !important;
  color:#fff !important;
}

.them{
  background:#e7f5d8 !important;
  color:#111827 !important;
}

.user-color-0 .them{background:#e7f5d8 !important;}
.user-color-1 .them{background:#fde2e4 !important;}
.user-color-2 .them{background:#dbeafe !important;}
.user-color-3 .them{background:#fef3c7 !important;}
.user-color-4 .them{background:#ede9fe !important;}
.user-color-5 .them{background:#ccfbf1 !important;}

.pane-composer,
#sendform{
  max-width:none !important;
  width:auto !important;
  margin:0 !important;
}

@media(max-width:650px){
  .bubble-row.me-row{
    margin-left:30px !important;
  }

  .bubble-wrap,
  .bubble-row.me-row .bubble-wrap,
  .msg{
    max-width:82vw !important;
  }
}

/* Larger, easier-to-read chat */

.msg{
    font-size:20px !important;
    line-height:1.45 !important;
    padding:14px 18px !important;
    border-radius:22px !important;
}

.bubble-name{
    font-size:13px !important;
    font-weight:600 !important;
    margin-bottom:4px !important;
}

.bubble-avatar{
    width:42px !important;
    height:42px !important;
    flex:0 0 42px !important;
    margin-right:8px !important;
}

.bubble-avatar img{
    width:42px !important;
    height:42px !important;
}

.side-avatar{
    width:54px !important;
    height:54px !important;
    font-size:32px !important;
}

.side-avatar img{
    width:54px !important;
    height:54px !important;
}

.side-title{
    font-size:18px !important;
}

.side-preview{
    font-size:15px !important;
}

.chat-header h2{
    font-size:28px !important;
}

.pane-composer textarea{
    font-size:18px !important;
    min-height:70px !important;
}

.emoji-picker button{
    font-size:28px !important;
    padding:10px !important;
}

.composer button{
    font-size:18px !important;
    padding:12px 24px !important;
}


/* Slightly more vertical spacing between messages */

.bubble-row{
    margin:12px 0 !important;
    align-items:flex-end !important;
}

.bubble-name{
    margin-bottom:5px !important;
}

.msg{
    padding:14px 18px !important;
    line-height:1.45 !important;
    border-radius:22px !important;
}

.bubble-avatar{
    margin-right:10px !important;
}

.me-row{
    margin-left:60px !important;
}

@media(max-width:650px){
    .bubble-row{
        margin:10px 0 !important;
    }

    .me-row{
        margin-left:35px !important;
    }
}


/* V4.1 media and memories */
.dropzone{
  border:2px dashed #cbd5e1;
  border-radius:18px;
  padding:10px 14px;
  margin:8px 0;
  color:#64748b;
  background:#f8fafc;
  text-align:center;
}

.dropzone.active{
  background:#dbeafe;
  border-color:#2563eb;
  color:#1e40af;
}

.memory-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
  gap:12px;
  margin-bottom:20px;
}

.memory-grid img,
.memory-grid video{
  width:100%;
  max-height:180px;
  object-fit:cover;
  border-radius:16px;
  background:#111827;
}

/* V4.2 replies, reactions, polls, stickers, voice */
.message-actions{
  margin-top:8px;
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  align-items:center;
}

.message-actions button{
  font-size:12px !important;
  padding:4px 7px !important;
  background:rgba(255,255,255,.8) !important;
  color:#111827 !important;
  border:1px solid rgba(0,0,0,.08) !important;
}

.reaction{
  background:rgba(255,255,255,.8);
  color:#111827;
  padding:3px 8px;
  border-radius:999px;
}

.quoted-reply{
  border-left:4px solid rgba(0,0,0,.25);
  padding:6px 8px;
  margin-bottom:8px;
  background:rgba(255,255,255,.45);
  border-radius:8px;
  font-size:.85em;
}

.reply-preview{
  border-left:4px solid #2563eb;
  background:#dbeafe;
  color:#111827;
  padding:8px 10px;
  border-radius:10px;
  margin-bottom:8px;
}

.sticker-picker{
  margin:8px 0;
}

.sticker-picker button{
  background:#fff7ed;
  color:#111827;
  border:1px solid #fed7aa;
  margin:3px;
  padding:8px 10px;
  font-size:15px;
}

.poll-helper{
  color:#64748b;
  margin:6px 0;
}

.poll{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin-top:4px;
}

.poll button{
  background:#fff !important;
  color:#111827 !important;
  border:1px solid #cbd5e1 !important;
  text-align:left;
  padding:8px 10px !important;
}

.poll button span{
  float:right;
  background:#e0f2fe;
  border-radius:999px;
  padding:2px 7px;
}

.voice-row{
  margin:8px 0;
}

#recordStatus{
  margin-left:10px;
  color:#64748b;
}

/* Clean V4.2 layout fix */

.dropzone{
  padding:5px 10px !important;
  margin:4px 0 !important;
  font-size:12px !important;
  opacity:.75 !important;
}

.pane-chatbox{
  padding-top:12px !important;
}

.bubble-row{
  margin:14px 0 !important;
}

.msg{
  font-size:18px !important;
  line-height:1.35 !important;
  padding:12px 16px !important;
}

.message-actions{
  margin-top:6px !important;
  gap:3px !important;
  opacity:0 !important;
  max-height:0 !important;
  overflow:hidden !important;
  transition:opacity .15s ease, max-height .15s ease !important;
}

.msg:hover .message-actions{
  opacity:1 !important;
  max-height:40px !important;
}

.message-actions button{
  font-size:10px !important;
  padding:2px 6px !important;
  border-radius:999px !important;
}

.reaction{
  font-size:12px !important;
  padding:2px 6px !important;
}

.pane-composer{
  padding:8px 14px !important;
}

.pane-composer textarea{
  min-height:46px !important;
  font-size:16px !important;
}

.emoji-picker{
  margin:6px 0 !important;
  display:flex !important;
  gap:5px !important;
  flex-wrap:wrap !important;
  align-items:center !important;
}

.emoji-picker button{
  font-size:18px !important;
  padding:5px 8px !important;
  min-width:34px !important;
}

.emoji-picker .btn{
  font-size:13px !important;
  padding:6px 10px !important;
}

.more-tools{
  margin:4px 0 !important;
  font-size:13px !important;
}

.more-tools summary{
  cursor:pointer !important;
  color:#2563eb !important;
  font-weight:bold !important;
  margin-bottom:4px !important;
}

.sticker-picker{
  margin:5px 0 !important;
}

.sticker-picker button{
  font-size:13px !important;
  padding:5px 8px !important;
}

.poll-helper{
  margin:4px 0 !important;
  font-size:12px !important;
}

.voice-row{
  margin:5px 0 !important;
}

.voice-row button{
  font-size:13px !important;
  padding:6px 10px !important;
}

.composer-row{
  gap:8px !important;
}

.composer-row input[type="file"]{
  font-size:13px !important;
}

.composer-row button{
  padding:9px 18px !important;
  font-size:15px !important;
}

.quoted-reply{
  font-size:13px !important;
  padding:5px 7px !important;
}

.poll button{
  font-size:14px !important;
  padding:6px 9px !important;
}

@media(max-width:650px){
  .message-actions{
    opacity:1 !important;
    max-height:40px !important;
  }

  .emoji-picker button{
    font-size:17px !important;
    padding:5px 7px !important;
  }
}

/* Fix chat area growing and pushing composer off screen */

.app-shell{
  height:calc(100vh - 70px) !important;
  max-height:calc(100vh - 70px) !important;
  overflow:hidden !important;
}

.messenger-main{
  height:100% !important;
  max-height:100% !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
}

.chat-header{
  flex:0 0 70px !important;
}

.dropzone{
  flex:0 0 auto !important;
}

.pane-chatbox,
#chatbox{
  flex:1 1 auto !important;
  min-height:0 !important;
  height:auto !important;
  max-height:none !important;
  overflow-y:auto !important;
}

.pane-composer,
#sendform{
  flex:0 0 auto !important;
  max-height:260px !important;
  overflow-y:auto !important;
}

body{
  overflow:hidden !important;
}

@media(max-width:800px){
  body{
    overflow:auto !important;
  }

  .app-shell{
    height:auto !important;
    max-height:none !important;
    overflow:visible !important;
  }

  .messenger-main{
    min-height:60vh !important;
  }

  .pane-chatbox,
  #chatbox{
    height:48vh !important;
    max-height:48vh !important;
  }
}

/* Clean composer redesign */
.pane-composer,
#sendform{
  max-height:none !important;
  overflow:visible !important;
  padding:10px 14px !important;
  background:#fff !important;
  border-top:1px solid #e5e7eb !important;
}

.composer-main-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:end;
}

.composer-main-row textarea{
  min-height:48px !important;
  max-height:110px !important;
  resize:vertical;
  font-size:16px !important;
}

.send-main{
  align-self:stretch;
  min-width:90px;
  font-size:16px !important;
}

.composer-toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:8px;
  flex-wrap:wrap;
}

.composer-toolbar button,
.tool-link{
  border:1px solid #d1d5db !important;
  background:#f8fafc !important;
  color:#111827 !important;
  border-radius:12px !important;
  padding:7px 10px !important;
  font-size:15px !important;
  text-decoration:none;
}

#recordStatus,
#fileStatus{
  font-size:13px;
  color:#64748b;
}

.tool-panel{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:8px;
  padding:8px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:14px;
}

.tool-panel button{
  background:white !important;
  color:#111827 !important;
  border:1px solid #d1d5db !important;
  border-radius:12px !important;
  padding:7px 10px !important;
  font-size:15px !important;
}

.poll-panel{
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:8px;
  padding:10px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:14px;
}

.poll-panel #pollQuestion{
  grid-column:1 / -1;
}

.poll-panel button{
  grid-column:1 / -1;
}

.dropzone{
  max-height:28px !important;
  overflow:hidden !important;
}

.message-actions{
  opacity:0 !important;
  max-height:0 !important;
}

.msg:hover .message-actions{
  opacity:1 !important;
  max-height:40px !important;
}

@media(max-width:650px){
  .composer-main-row{
    grid-template-columns:1fr;
  }

  .send-main{
    width:100%;
  }

  .poll-panel{
    grid-template-columns:1fr;
  }

  .message-actions{
    opacity:1 !important;
    max-height:44px !important;
  }
}
