.mc-input{
  height:40px;border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  padding:0 12px;
  outline:none;
}
.mc-input:focus{border-color:rgba(255,255,255,.30); box-shadow:0 0 0 4px rgba(120,180,255,.12);}
.mc-chatpanel{
  flex:1;
  min-height:0;
  border-top:1px solid var(--border);
  background:rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  display:flex;
  flex-direction:column;
}

.mc-chatlist{
  flex:1; overflow:auto;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.mc-chatmsg{
  max-width:92%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  font-size:13px;
  line-height:1.25;
  word-break:break-word;
}
.mc-chatme{align-self:flex-end;background:rgba(255,255,255,.10);}
.mc-chatmeta{font-size:11px;color:var(--muted);margin-top:4px;}

.mc-chatform{
  display:flex; gap:8px;
  padding:10px;
  border-top:1px solid var(--border);
  background:rgba(0,0,0,.25);

  min-height: 52px;
}
.mc-chatinput{
  flex:1;height:40px;border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  padding:0 12px;
  outline:none;
}
.mc-chatinput:focus{border-color:rgba(255,255,255,.28);}
.mc-chatsend{
  width:74px;height:40px;border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.08);
  color:var(--text);
  cursor:pointer;
  font-weight:700;
}
.mc-chatsend:hover{background:rgba(255,255,255,.12);}

/* --- Compact Chat v2 (full width under video) --- */
.mc-callwindow.mc-chat-open{ /* height handled by JS */ }

.mc-chatpanel{
  flex: 1;
  min-height: 0;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mc-chatlist{
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.mc-chatinputwrap{
  position: relative;
}

.mc-chatform{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
}

.mc-chatinput{
  flex: 1;
  min-width: 0;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: rgba(255,255,255,.95);
  font-size: 14px;
}

.mc-chatinput::placeholder{
  color: rgba(255,255,255,.55);
}

.mc-chatsend{
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.95);
}

.mc-emojiBtn{
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.95);
}

.mc-emojitray{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 58px;
  display: flex;
  gap: 8px;
  padding: 10px 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(8,8,10,.60);
  }

.mc-emoji{
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.95);
  font-size: 18px;
}

/* --- HUD messages (up to 3, auto-hide) --- */
.mc-hud{
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 40;
}

.mc-iconbtn,.mc-headbtn,.mc-ctl,.mc-primary,.mc-ghost,.mc-chatsend,.mc-emojiBtn,.mc-emoji{
  transition: transform 110ms ease, background 140ms ease, border-color 140ms ease, filter 140ms ease;
}
.mc-iconbtn:active,.mc-headbtn:active,.mc-ctl:active,.mc-primary:active,.mc-ghost:active,.mc-chatsend:active,.mc-emojiBtn:active,.mc-emoji:active{
  transform: translateY(1px) scale(.99);
  filter: brightness(1.06);
}

/* Emoji tray pop */
.mc-emojitray{
  animation: mcTrayIn 140ms ease-out both;
}




/* Scrollbar polish (WebKit) */
.mc-chatlist::-webkit-scrollbar{ width:10px; }
.mc-chatlist::-webkit-scrollbar-track{ background: transparent; }
.mc-chatlist::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.10);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 10px;
}
.mc-chatlist::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,.16); }



html[data-theme="light"] .mc-input{
  background: rgba(255,255,255,.75);
  color: rgba(18,18,22,.96);
  border: 1px solid rgba(18,18,22,.18);
}
html[data-theme="light"] .mc-input::placeholder{ color: rgba(18,18,22,.45); }
html[data-theme="light"] .mc-chatpanel{
  background: rgba(255,255,255,.72);
}
html[data-theme="light"] .mc-chatmsg{
  background: rgba(18,18,22,.05);
  border: 1px solid rgba(18,18,22,.12);
  color: rgba(18,18,22,.92);
}
html[data-theme="light"] .mc-chatme{
  background: rgba(80,120,255,.16);
  border-color: rgba(80,120,255,.24);
}
/* Chat panel: make it clearly visible in light mode */
html[data-theme="light"] .mc-chatpanel{
  border-top-color: rgba(18,18,22,.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(250,251,255,.86));
}

html[data-theme="light"] .mc-chatlist{
  padding: 12px;
}

html[data-theme="light"] .mc-chatmsg{
  background: rgba(18,18,22,.04);
  border-color: rgba(18,18,22,.10);
  color: rgba(18,18,22,.92);
}

html[data-theme="light"] .mc-chatme{
  background: rgba(80,120,255,.18);
  border-color: rgba(80,120,255,.22);
}

html[data-theme="light"] .mc-chatform{
  border-color: rgba(18,18,22,.14);
  background: rgba(255,255,255,.70);
}

html[data-theme="light"] .mc-chatinput{
  color: rgba(18,18,22,.92) !important;
}
html[data-theme="light"] .mc-chatinput::placeholder{
  color: rgba(18,18,22,.48) !important;
}

html[data-theme="light"] .mc-chatsend{
  background: rgba(80,120,255,.18);
  color: rgba(18,18,22,.92);
  border: 1px solid rgba(80,120,255,.22);
}
html[data-theme="light"] .mc-chatsend:hover{
  background: rgba(80,120,255,.24);
}

html[data-theme="light"] .mc-emojiBtn{
  background: rgba(18,18,22,.05);
  color: rgba(18,18,22,.90);
  border: 1px solid rgba(18,18,22,.12);
}

html[data-theme="light"] .mc-emojitray{
  background: rgba(255,255,255,.92);
  border-color: rgba(18,18,22,.12);
}

html[data-theme="light"] .mc-emoji{
  background: rgba(18,18,22,.04);
  color: rgba(18,18,22,.92);
  border: 1px solid rgba(18,18,22,.10);
}

/* Bottom bar: Mic + Chat + Hang (L-shape) */
.mc-controls{
  position:absolute;
  left:0;
  right:0;
  top:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  z-index:20;
  pointer-events:none; /* enable only buttons */
}
/* Ensure stage has room, and controls overlay above chat when needed */
.mc-callbody{ position:relative; }
/* =========================
   UI DISTRIBUTION v1 (authoritative, 1766967554)
   Goal: clean function layout:
   - Side actions (Flip/Full) on RIGHT middle of video
   - Main controls (Mic / Chat / Hang) bottom CENTER as a compact glass bar
   - Keep joinPanel + chat panel intact
   ========================= */

.mc-stage{ position:relative; }

/* =========================
   FINAL POLISH v3 (authoritative, 1766968048)
   - Icon-only controls (Mic/Chat/Hang)
   - Side actions (Flip/Fullscreen) top-left vertical
   - Premium glass + consistent sizing
   ========================= */

.mc-stage{ position:relative; }

/* =========================
   FULLSCREEN CHAT OVERLAY v4 (authoritative, 1766968476)
   Goal: When in fullscreen, chat opens as a glass overlay on video (bottom-left).
   Works by moving #chatPanel inside #stage while fullscreen is active.
   ========================= */

.mc-chatpanel.mc-chat-overlay{
  position:absolute !important;
  left:14px !important;
  bottom:86px !important; /* above bottom controls */
  width:min(360px, 44vw) !important;
  max-height:min(46vh, 380px) !important;

  border-radius:20px !important;
  border:1px solid rgba(255,255,255,.16) !important;
  background: rgba(0,0,0,.28) !important;
  box-shadow: 0 18px 55px rgba(0,0,0,.55) !important;

  overflow:hidden !important;
  z-index:90 !important;
  pointer-events:auto !important;
}

.mc-chatpanel.mc-chat-overlay .mc-chatlist{
  padding:12px !important;
}

.mc-chatpanel.mc-chat-overlay .mc-chatmsg{
  background: rgba(255,255,255,.06) !important;
}

.mc-chatpanel.mc-chat-overlay .mc-chatform{
  margin:10px 12px 12px !important;
  border:1px solid rgba(255,255,255,.12) !important;
  border-radius:16px !important;
  background: rgba(0,0,0,.16) !important;
}

.mc-chatpanel.mc-chat-overlay .mc-emojitray{
  left:12px !important;
  right:12px !important;
  bottom:76px !important;
}

html[data-theme="light"] .mc-chatpanel.mc-chat-overlay{
  background: rgba(255,255,255,.78) !important;
  border-color: rgba(18,18,22,.14) !important;
  box-shadow: 0 18px 55px rgba(0,0,0,.16) !important;
}
html[data-theme="light"] .mc-chatpanel.mc-chat-overlay .mc-chatform{
  background: rgba(255,255,255,.70) !important;
  border-color: rgba(18,18,22,.14) !important;
}



/* =========================
   Chat input resize v5 (1767003741)
   ========================= */
.mc-chattextarea {
  resize: vertical !important;
  min-height: 44px !important;
  max-height: 160px !important;
  width: 100% !important;
  line-height: 1.4 !important;
  padding: 10px 12px !important;
  font-family: inherit !important;
  overflow: auto !important;
}

.mc-chatform, .mc-chatinputwrap {
  align-items: flex-end !important;
}


/* =========================
   AUDIO-FIRST CHAT MODE + BUBBLES (authoritative, 1767007361)
   - Audio call starts in chat-only view
   - Video enabled switches to stage+chat
   - Android fullscreen chat fills entire height with minimize button
   ========================= */

#mcCallBody.mc-mode-audio #stage{ display:none !important; }
#mcCallBody.mc-mode-audio #chatPanel{ display:flex !important; }
/* Chat top bar (controls when stage is hidden / audio-first) */
.mc-chatbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
}
.mc-chatbar-left{ display:flex; flex-direction:column; line-height:1.1; }
.mc-chatbar-title{ font-weight:800; letter-spacing:.2px; }
.mc-chatbar-hint{ font-size:12px; color:var(--muted); }

.mc-chatbar-actions{ display:flex; gap:8px; align-items:center; }
.mc-chatbar-btn{
  width:40px;height:40px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.95);
  cursor:pointer;
  display:grid;
  place-items:center;
  font-size:16px;
}
.mc-chatbar-btn:hover{ background:rgba(255,255,255,.10); }
.mc-chatbar-danger{ background:rgba(255,0,0,.14); border-color:rgba(255,0,0,.24); }
.mc-chatbar-danger:hover{ background:rgba(255,0,0,.20); }

/* Fullscreen chat mode (Android/webview friendly) */
html.mc-fs-chat #mcCallWindow{
  left:0 !important; top:0 !important; right:0 !important; bottom:0 !important;
  width:100vw !important; height:100vh !important;
  max-width:none !important; max-height:none !important;
  border-radius:0 !important;
}
html.mc-fs-chat #mcCallHeader{ display:none !important; }
html.mc-fs-chat #mcCallBody{ height:100vh !important; }
html.mc-fs-chat #chatPanel{
  height:100vh !important;
  border-top:0 !important;
}
html.mc-fs-chat #btnChatMin{ display:grid !important; }
html.mc-fs-chat #stage{ display:none !important; }

/* Bubble messages with demo names */
.mc-chatlist{ padding:12px; }

.mc-bubble{
  max-width:86%;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color: rgba(255,255,255,.95);
  font-size:14px;
  line-height:1.25;
  word-break:break-word;
  display:flex;
  flex-direction:column;
  gap:6px;
  align-self:flex-start;
}

.mc-bubble.me{
  align-self:flex-end;
  background:rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}

.mc-bubbleName{
  font-size:12px;
  font-weight:600;
  opacity:.80;
  text-align:left;
}

.mc-bubble.me .mc-bubbleName{
  text-align:right;
}

.mc-bubbleText{
  font-size:14px;
  line-height:1.25;
}

.mc-bubbleTime{
  font-size:11px;
  opacity:.65;
  margin-top:2px;
  text-align:left;
  align-self:flex-start;
}

.mc-bubble.me .mc-bubbleTime{
  text-align:right;
  align-self:flex-end;
}

html[data-theme="light"] .mc-bubble{
  background: rgba(18,18,22,.04);
  border-color: rgba(18,18,22,.10);
  color: rgba(18,18,22,.92);
}

html[data-theme="light"] .mc-bubble.me{
  background: rgba(80,120,255,.16);
  border-color: rgba(80,120,255,.22);
}


/* =========================
   PRESENCE MODE (authoritative, 2025-12-29)
   Goal:
   - After login, user lands on a "brugerside" (presence)
   - Chat UI hidden by default (no message list + no input)
   - User list is primary surface
   - Chat becomes visible only in mc-mode-chat / mc-mode-audio / mc-mode-video
   ========================= */

/* Presence (brugerside): hide chat list + input; keep user list visible */
#mcCallBody.mc-mode-presence #stage{ display:none !important; }
#mcCallBody.mc-mode-presence #chatPanel{ display:flex !important; }
#mcCallBody.mc-mode-presence #chatList{ display:none !important; }
#mcCallBody.mc-mode-presence #chatForm{ display:none !important; }
#mcCallBody.mc-mode-presence .mc-chatform{ display:none !important; }
#mcCallBody.mc-mode-presence .mc-chatinputwrap{ display:none !important; }

/* Chat page: show chat list + input (no stage unless video mode) */
#mcCallBody.mc-mode-chat #stage{ display:none !important; }
#mcCallBody.mc-mode-chat #chatPanel{ display:flex !important; }
#mcCallBody.mc-mode-chat #chatList{ display:flex !important; }
#mcCallBody.mc-mode-chat #chatForm{ display:flex !important; }

/* Audio call: enforce chat visible */
#mcCallBody.mc-mode-audio #chatList{ display:flex !important; }
#mcCallBody.mc-mode-audio #chatForm{ display:flex !important; }

/* Video call: stage visible; chat behavior controlled elsewhere */
#mcCallBody.mc-mode-video #stage{ display:block !important; }
