:root {
  --mc-bg: #050b12;
  --mc-bg-2: #071019;
  --mc-panel: rgba(16, 30, 44, 0.72);
  --mc-panel-2: rgba(10, 22, 33, 0.9);
  --mc-panel-3: #0d1a28;
  --mc-glass: rgba(18, 36, 52, 0.55);
  --mc-glass-hi: rgba(30, 58, 82, 0.6);
  --mc-line: rgba(0, 229, 255, 0.14);
  --mc-line-2: rgba(0, 229, 255, 0.26);
  --mc-cyan: #00e5ff;
  --mc-cyan-d: #2ed6ff;
  --mc-blue: #7fd0ff;
  --mc-text: #eef8ff;
  --mc-muted: #9db8c6;
  --mc-muted-2: #5c7893;
  --mc-gold: #ffd21e;
  --mc-green: #24e78e;
  --mc-red: #ff4d5e;
  --mc-amber: #ffb547;
  --mc-radius: 12px;
  --mc-radius-sm: 8px;
  --mc-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--mc-bg);
  color: var(--mc-text);
  font-family: var(--mc-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#msgr-app {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
}

.mc-app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 520px at 82% -12%, rgba(0, 229, 255, 0.07), transparent 60%),
    radial-gradient(900px 500px at -8% 108%, rgba(127, 208, 255, 0.05), transparent 55%),
    var(--mc-bg);
  color: var(--mc-text);
}

/* ══ TOP BAR ═════════════════════════════════════════ */
.mc-topbar {
  flex: 0 0 auto;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--mc-line);
  background: rgba(6, 14, 23, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 30;
}
.mc-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.mc-brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(0,229,255,.16), rgba(0,229,255,.03));
  border: 1px solid var(--mc-line-2);
}
.mc-brand-mark img { width: 24px; height: 24px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(0,229,255,.45)); }
.mc-brand-name { font-weight: 800; font-size: 14.5px; letter-spacing: .14em; white-space: nowrap; }
.mc-brand-name .dot { color: var(--mc-gold); }
.mc-brand-sub { font-size: 9.5px; letter-spacing: .3em; color: var(--mc-cyan); opacity: .85; margin-top: 1px; white-space: nowrap; }
.mc-top-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc-conn-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: .14em; color: var(--mc-muted);
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--mc-line); background: var(--mc-glass);
  white-space: nowrap;
}
.mc-conn-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mc-muted-2); }
.mc-conn-pill.live i { background: var(--mc-green); box-shadow: 0 0 8px var(--mc-green); }
.mc-icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--mc-line);
  background: var(--mc-glass);
  color: var(--mc-text);
  font-size: 16px;
  cursor: pointer;
  position: relative;
  display: grid; place-items: center;
  transition: border-color .15s, background .15s, transform .1s;
}
.mc-icon-btn:hover { border-color: var(--mc-line-2); background: var(--mc-glass-hi); }
.mc-icon-btn:active { transform: translateY(1px); }
.mc-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mc-cyan), #0aa7ff);
  color: #04121d;
  font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 0 10px rgba(0,229,255,.5);
}
.mc-user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px 5px 6px;
  border-radius: 10px;
  border: 1px solid var(--mc-line);
  background: var(--mc-glass);
  cursor: pointer;
  max-width: 200px;
}
.mc-user-chip:hover { border-color: var(--mc-line-2); }
.mc-user-chip .mc-avatar { width: 26px; height: 26px; font-size: 11px; }
.mc-user-chip > span { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ══ AVATAR ══════════════════════════════════════════ */
.mc-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  color: var(--mc-blue);
  background:
    radial-gradient(circle at 30% 25%, rgba(0,229,255,.22), transparent 55%),
    linear-gradient(150deg, #123a53, #0b2233),
    #0b2233;
  border: 1px solid var(--mc-line-2);
  position: relative;
  overflow: hidden;
}
.mc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mc-avatar.rail { border-radius: 12px; background: transparent; border: 0; }
.mc-avatar.dim { color: var(--mc-muted-2); }
.mc-avatar .mc-presence {
  position: absolute; right: -1px; bottom: -1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--mc-muted-2);
  border: 2px solid #0d1a28;
}
.mc-avatar .mc-presence.online { background: var(--mc-green); box-shadow: 0 0 7px rgba(36,231,142,.7); }

/* ══ SHELL GRID ═══════════════════════════════════════ */
.mc-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(190px, 14vw, 220px) clamp(262px, 20vw, 320px) minmax(0, 1fr) clamp(250px, 19vw, 300px);
}
.mc-shell.no-info { grid-template-columns: clamp(190px, 14vw, 220px) clamp(262px, 20vw, 320px) minmax(0, 1fr); }
.mc-col { min-height: 0; min-width: 0; display: flex; flex-direction: column; position: relative; }
.mc-col + .mc-col { border-left: 1px solid rgba(0, 229, 255, 0.08); }

/* ══ NAV RAIL (left sidebar) ══════════════════════════ */
.mc-rail {
  background:
    radial-gradient(300px 400px at 50% -10%, rgba(0, 229, 255, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(13, 26, 40, 0.92), rgba(7, 15, 24, 0.96));
  border-right: 1px solid var(--mc-line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px 0 12px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.mc-rail::-webkit-scrollbar { display: none; }
.mc-rail-top { text-align: center; margin-bottom: 10px; }
.mc-rail-logo {
  width: 40px; height: 40px;
  margin: 2px auto;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(0,229,255,.22), rgba(0,229,255,.04));
  border: 1px solid var(--mc-line-2);
}
.mc-rail-logo img { width: 27px; height: 27px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(0,229,255,.5)); }
.mc-rail-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 11px;
  padding: 10px 12px 10px 11px;
  margin: 1px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mc-muted);
  font-size: 10px;
  letter-spacing: .08em;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  max-width: none;
  white-space: nowrap;
}
.mc-rail-item .mc-glyph {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 9px;
  font-size: 16px;
  background: rgba(0,229,255,.05);
  border: 1px solid rgba(0,229,255,.08);
}
.mc-rail-item .mc-glyph img { width: 18px; height: 18px; object-fit: contain; opacity: .85; }
.mc-rail-item .mc-label { font-size: 10px; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; }
.mc-rail-item:hover { color: var(--mc-text); background: rgba(0,229,255,.05); }
.mc-rail-item.active {
  color: var(--mc-cyan);
  background: linear-gradient(180deg, rgba(0,229,255,.12), rgba(0,229,255,.02));
  border-color: rgba(0,229,255,.25);
}
.mc-rail-item.active .mc-glyph { border-color: var(--mc-line-2); background: rgba(0,229,255,.14); }
.mc-rail-item.active span { text-shadow: 0 0 12px rgba(0,229,255,.6); }
.mc-rail-spacer { flex: 1; min-height: 12px; }
.mc-rail-map {
  height: 92px;
  margin: 4px 8px 8px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--mc-line);
  background: linear-gradient(180deg, rgba(0,229,255,.05), rgba(0,229,255,.01));
}
.mc-rail-map img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.mc-rail-map::after {
  content: "MAP & DATA";
  position: absolute; left: 8px; bottom: 7px;
  font-size: 7.5px; letter-spacing: .22em;
  color: var(--mc-cyan); opacity: .75;
}
.mc-rail-byline {
  text-align: center;
  font-size: 7.5px;
  letter-spacing: .16em;
  line-height: 1.6;
  color: var(--mc-muted-2);
  padding: 0 4px;
}
.mc-rail-byline b { color: var(--mc-muted); font-weight: 700; }

/* ── Rail profile card (signed-in user) ─────────────── */
.mc-rail-user {
  width: auto;
  min-width: 0;
  max-width: none;
  margin: 8px 10px 4px;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--mc-line);
  background:
    radial-gradient(200px 140px at 30% 0%, rgba(0, 229, 255, .12), transparent 65%),
    linear-gradient(180deg, rgba(13, 26, 40, .9), rgba(7, 15, 24, .94));
  text-align: center;
  overflow: hidden;
  position: sticky;
  bottom: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.mc-rail-user:hover { border-color: var(--mc-line-2); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.mc-railp-main {
  display: block;
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.mc-railp-avatar { position: relative; width: 66px; height: 66px; margin: 0 auto 12px; }
.mc-railp-avatar .mc-railp-photo {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(0, 229, 255, .45);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, .14), 0 0 18px rgba(0, 229, 255, .28);
}
.mc-railp-initials {
  width: 100%; height: 100%;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
  color: var(--mc-blue);
  text-transform: uppercase;
  background:
    radial-gradient(circle at 30% 25%, rgba(0, 229, 255, .22), transparent 55%),
    linear-gradient(150deg, #123a53, #0b2233), #0b2233;
  border: 1px solid rgba(0, 229, 255, .45);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, .14), 0 0 18px rgba(0, 229, 255, .28);
}
.mc-railp-dot {
  position: absolute; right: 1px; bottom: 1px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--mc-muted-2);
  border: 2px solid #0d1a28;
}
.mc-railp-dot.online { background: var(--mc-green); box-shadow: 0 0 8px rgba(36, 231, 142, .8); }
.mc-railp-name {
  font-size: 15px; font-weight: 800;
  color: var(--mc-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: .01em;
  line-height: 1.25;
}
.mc-railp-handle {
  font-size: 12.5px;
  color: var(--mc-cyan);
  margin-top: 5px;
  overflow-wrap: anywhere;
  line-height: 1.35;
  min-height: 1.35em;
}
.mc-railp-status {
  font-size: 10px; letter-spacing: .16em;
  color: var(--mc-muted);
  margin-top: 11px;
}
.mc-railp-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--mc-line);
}
.mc-railp-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--mc-muted);
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.mc-railp-btn:hover, .mc-railp-btn:focus-visible {
  color: var(--mc-cyan);
  background: rgba(0, 229, 255, .08);
  border-color: var(--mc-line);
}

/* ══ LIST COLUMN ══════════════════════════════════════ */
.mc-list-col { background: rgba(8, 17, 27, 0.6); }
.mc-list-head { flex: 0 0 auto; padding: 14px 14px 8px; }
.mc-list-title { font-size: 16px; font-weight: 800; letter-spacing: .06em; }
.mc-list-title .dim { color: var(--mc-muted-2); font-weight: 600; }
.mc-search {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--mc-line);
  background: rgba(0, 19, 30, 0.5);
  color: var(--mc-muted-2);
}
.mc-search:focus-within { border-color: var(--mc-line-2); box-shadow: 0 0 0 3px rgba(0,229,255,.06); }
.mc-search input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--mc-text); font-size: 13px;
}
.mc-search input::placeholder { color: var(--mc-muted-2); }
.mc-tabs { display: flex; gap: 6px; padding: 10px 14px 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.mc-tabs::-webkit-scrollbar { display: none; }
.mc-tab {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mc-muted);
  font-size: 11px;
  letter-spacing: .06em;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.mc-tab:hover { color: var(--mc-text); background: rgba(0,229,255,.05); }
.mc-tab.active {
  color: var(--mc-cyan);
  background: rgba(0,229,255,.1);
  border-color: rgba(0,229,255,.28);
  text-shadow: 0 0 10px rgba(0,229,255,.4);
}
.mc-tab .mc-tab-count { margin-left: 5px; color: var(--mc-cyan); font-weight: 800; }

.mc-list { flex: 1 1 auto; overflow-y: auto; padding: 4px 8px 16px; scrollbar-width: thin; scrollbar-color: rgba(0,229,255,.25) transparent; }
.mc-list::-webkit-scrollbar { width: 5px; }
.mc-list::-webkit-scrollbar-thumb { background: rgba(0,229,255,.25); border-radius: 99px; }

.mc-conv {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
  position: relative;
}
.mc-conv:hover { background: rgba(0,229,255,.045); }
.mc-conv.active {
  background:
    radial-gradient(220px 120px at 20% 0%, rgba(0,229,255,.07), transparent 60%),
    rgba(0, 229, 255, 0.055);
  border-color: rgba(0,229,255,.18);
}
.mc-conv-body { flex: 1; min-width: 0; }
.mc-conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-conv-name { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-conv-sub { font-size: 12px; color: var(--mc-muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-conv-sub.unread { color: var(--mc-text); }
.mc-conv-time { font-size: 10px; color: var(--mc-muted-2); white-space: nowrap; }
.mc-conv-tail { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.mc-unread {
  min-width: 19px; height: 19px; padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mc-cyan), #0aa7ff);
  color: #04121d;
  font-size: 10.5px; font-weight: 800;
  display: inline-grid; place-items: center;
}
.mc-list-empty { padding: 30px 18px; color: var(--mc-muted-2); font-size: 13px; text-align: center; line-height: 1.6; }
.mc-list-hint { padding: 6px 14px 2px; font-size: 10px; letter-spacing: .18em; color: var(--mc-muted-2); }

/* ══ CHAT COLUMN ══════════════════════════════════════ */
.mc-chat-col { background:
  radial-gradient(800px 420px at 70% 0%, rgba(0,229,255,.04), transparent 55%),
  radial-gradient(600px 400px at 0% 100%, rgba(127,208,255,.03), transparent 55%),
  var(--mc-bg-2);
}
.mc-chat-head {
  flex: 0 0 auto;
  height: 60px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--mc-line);
  background: rgba(9, 19, 29, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.mc-back { display: none; }
.mc-chat-peer { min-width: 0; overflow: hidden; }
.mc-chat-name { font-size: 14.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mc-green); box-shadow: 0 0 8px var(--mc-green); }
.mc-chat-status { font-size: 11.5px; color: var(--mc-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-chat-status .ok { color: var(--mc-green); }
.mc-chat-actions { margin-left: auto; display: flex; gap: 8px; flex: 0 0 auto; }
.mc-chat-actions .mc-icon-btn { font-size: 15px; }

.mc-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 18px 10px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,229,255,.2) transparent;
}
.mc-messages::-webkit-scrollbar { width: 5px; }
.mc-messages::-webkit-scrollbar-thumb { background: rgba(0,229,255,.2); border-radius: 99px; }
.mc-day {
  align-self: center;
  font-size: 9.5px;
  letter-spacing: .22em;
  color: var(--mc-muted-2);
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,229,255,.08);
  background: rgba(0,229,255,.03);
  margin: 8px 0 4px;
}

.mc-msg { display: flex; gap: 8px; max-width: min(560px, 86%); margin-bottom: 2px; }
.mc-msg .mc-avatar { width: 32px; height: 32px; font-size: 12px; margin-top: 2px; }
.mc-msg.out { align-self: flex-end; flex-direction: row-reverse; }
.mc-msg.in { align-self: flex-start; }
.mc-msg.system { align-self: center; max-width: 92%; }
.mc-bubble {
  position: relative;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  min-width: 0;
  border: 1px solid var(--mc-line);
  background: var(--mc-glass);
}
.mc-msg.in .mc-bubble { border-top-left-radius: 5px; }
.mc-msg.out .mc-bubble {
  background:
    radial-gradient(220px 140px at 90% -20%, rgba(0,229,255,.1), transparent 60%),
    linear-gradient(180deg, rgba(9, 37, 55, 0.95), rgba(7, 24, 38, 0.95));
  border-color: rgba(0,229,255,.22);
  border-top-right-radius: 5px;
}
.mc-msg.system .mc-bubble {
  background: rgba(0,229,255,.05);
  border-color: rgba(0,229,255,.16);
  color: var(--mc-blue);
  font-size: 12.5px;
  text-align: center;
  border-radius: 999px;
  padding: 6px 16px;
}
.mc-sender-name { font-size: 11.5px; color: var(--mc-cyan); font-weight: 700; margin-bottom: 2px; }
.mc-msg-meta {
  display: flex; align-items: center; gap: 7px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--mc-muted-2);
  justify-content: flex-end;
}
.mc-msg-meta .mc-read { color: var(--mc-green); font-weight: 800; }
.mc-msg-meta .mc-failed { color: var(--mc-red); font-weight: 800; }

/* attachments / pdf cards */
.mc-file-card {
  display: flex; align-items: center; gap: 9px;
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--mc-line-2);
  background: rgba(0,229,255,.05);
  cursor: pointer;
  max-width: 280px;
  text-decoration: none;
  color: var(--mc-text);
  transition: border-color .15s, background .15s;
}
.mc-file-card:hover { border-color: var(--mc-cyan); background: rgba(0,229,255,.09); }
.mc-file-ico {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 16px;
  background: linear-gradient(160deg, rgba(0,229,255,.2), rgba(0,229,255,.04));
  border: 1px solid var(--mc-line-2);
}
.mc-file-card.pdf .mc-file-ico { background: linear-gradient(160deg, rgba(255,77,94,.22), rgba(255,77,94,.04)); border-color: rgba(255,77,94,.3); }
.mc-file-body { flex: 1; min-width: 0; }
.mc-file-name { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mc-blue); }
.mc-file-size { font-size: 10.5px; color: var(--mc-muted-2); margin-top: 1px; }
.mc-file-card img.mc-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--mc-line-2); }

/* ── native inline video player ──────────────────────── */
.mc-video {
  position: relative;
  width: min(360px, 100%);
  max-width: 100%;
  margin-top: 7px;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--mc-line-2);
  background: #04090f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(0, 229, 255, 0.05);
  isolation: isolate;
}
.mc-video-el {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #04090f;
  aspect-ratio: 16 / 9;
}
.mc-vp-poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: #04090f;
  overflow: hidden;
}
.mc-vp-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mc-vp-fallback {
  display: grid;
  place-items: center;
  font-size: 38px;
  background:
    radial-gradient(240px 140px at 30% 10%, rgba(0, 229, 255, 0.16), transparent 62%),
    radial-gradient(180px 140px at 90% 100%, rgba(10, 167, 255, 0.12), transparent 60%),
    linear-gradient(180deg, #0b1b2a, #060d15);
  color: var(--mc-cyan);
}
.mc-vp-brand {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--mc-cyan);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  z-index: 3;
}
.mc-vp-play {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #031018;
  background: linear-gradient(135deg, var(--mc-cyan), #0aa7ff);
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding-left: 3px;
  z-index: 3;
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.4);
  animation: mcVpPulse 2.6s infinite;
}
@keyframes mcVpPulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.55); }
  70% { box-shadow: 0 0 0 16px rgba(0, 229, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}
.mc-vp-dur {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-size: 10px;
  color: #d7f4ff;
  background: rgba(2, 10, 16, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 3;
}
.mc-vp-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  background: linear-gradient(180deg, transparent, rgba(2, 8, 13, 0.92) 55%);
  opacity: 1;
  transition: opacity 0.25s;
}
.mc-vp-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(2, 10, 16, 0.55);
  color: var(--mc-text);
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.mc-vp-btn:hover,
.mc-vp-btn:focus-visible {
  border-color: var(--mc-cyan);
  background: rgba(0, 229, 255, 0.16);
  color: var(--mc-cyan);
  outline: none;
}
.mc-vp-seek {
  flex: 1 1 auto;
  min-width: 40px;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--mc-cyan), rgba(0, 229, 255, 0.28));
  border-radius: 999px;
  cursor: pointer;
  outline: none;
}
.mc-vp-seek::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mc-cyan);
  border: 2px solid #031018;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
}
.mc-vp-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mc-cyan);
  border: 2px solid #031018;
}
.mc-vp-time {
  flex: 0 0 auto;
  font-size: 10px;
  color: #cfe9f5;
  font-variant-numeric: tabular-nums;
}
.mc-vp-speed {
  font-size: 10px;
  font-weight: 700;
}
.mc-video.mc-fullscreen {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  margin: 0;
  border-radius: 0;
  border: none;
  z-index: 9999;
  aspect-ratio: auto;
}
.mc-video.mc-fullscreen .mc-video-el {
  height: 100%;
  object-fit: contain;
}
@media (max-width: 560px) {
  .mc-video { width: min(320px, calc(100vw - 64px)); }
  .mc-vp-controls { gap: 5px; padding: 7px 8px; }
  .mc-vp-time { font-size: 9.5px; }
}

/* ── inline image attachment ─────────────────────────── */
.mc-img {
  --mc-img-ar: 4 / 3;
  position: relative;
  display: block;
  margin-top: 7px;
  max-width: 100%;
  width: min(340px, 100%);
  border-radius: var(--mc-radius);
  overflow: hidden;
  border: 1px solid var(--mc-line-2);
  background: #04090f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(0, 229, 255, 0.05);
  cursor: zoom-in;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}
.mc-img:focus-visible { outline: 2px solid var(--mc-cyan); outline-offset: 2px; }
.mc-img.is-landscape { width: min(420px, 100%); }
.mc-img.is-portrait { width: min(200px, 100%); }
.mc-img-el {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  opacity: 0;
  transition: opacity .22s ease;
  background: #04090f;
}
.mc-img.is-ready .mc-img-el { opacity: 1; }
.mc-img-skel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  aspect-ratio: var(--mc-img-ar);
  background:
    linear-gradient(100deg, rgba(0,229,255,.05) 30%, rgba(0,229,255,.13) 50%, rgba(0,229,255,.05) 70%) 0 0 / 220% 100%,
    linear-gradient(180deg, #0b1b2a, #060d15);
  animation: mc-img-shimmer 1.15s linear infinite;
}
.mc-img-skel-ico { font-size: 26px; opacity: .5; }
@keyframes mc-img-shimmer {
  from { background-position: 140% 0, 0 0; }
  to { background-position: -40% 0, 0 0; }
}
/* Failed decode degrades to the normal download card — never a blank bubble. */
.mc-img.mc-img-failed { width: auto; border: none; background: none; box-shadow: none; overflow: visible; cursor: default; }
.mc-img.mc-img-failed .mc-file-card { margin-top: 0; }

/* ── full-screen image viewer ────────────────────────── */
body.mc-lb-open { overflow: hidden; }
.mc-lb {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  grid-template-rows: 1fr auto auto;
  background: rgba(3, 7, 12, .93);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mc-lb-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 56px 16px 12px;
  touch-action: pinch-zoom;
}
.mc-lb-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--mc-radius-sm);
  transform-origin: center center;
  transition: transform .12s ease-out;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  -webkit-user-select: none;
  user-select: none;
}
.mc-lb-img.is-zoomed { cursor: grab; }
.mc-lb-fail { color: var(--mc-muted-2); font-size: 13px; }
.mc-lb-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
}
.mc-lb-btn {
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border-radius: var(--mc-radius-sm);
  border: 1px solid var(--mc-line-2);
  background: rgba(0, 229, 255, .07);
  color: var(--mc-text);
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mc-lb-btn:hover { border-color: var(--mc-cyan); background: rgba(0, 229, 255, .14); }
.mc-lb-zoom {
  min-width: 54px;
  text-align: center;
  font-size: 11px;
  color: var(--mc-muted-2);
  font-variant-numeric: tabular-nums;
}
.mc-lb-cap {
  padding: 0 16px 14px;
  text-align: center;
  font-size: 11px;
  color: var(--mc-muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-lb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

@media (max-width: 560px) {
  .mc-img { width: min(300px, 100%); }
  .mc-img.is-landscape { width: 100%; }
  .mc-img-el { max-height: 300px; }
  .mc-lb-stage { padding: 52px 10px 8px; }
  .mc-lb-btn { min-width: 42px; height: 42px; }
}

.mc-email-chip {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--mc-blue);
  background: rgba(0,229,255,.06);
  border: 1px solid rgba(0,229,255,.18);
  padding: 3px 9px;
  border-radius: 999px;
}
.mc-email-chip.fail { color: var(--mc-red); background: rgba(255,77,94,.08); border-color: rgba(255,77,94,.3); }
.mc-retry-btn {
  background: transparent;
  border: 1px solid var(--mc-red);
  color: var(--mc-red);
  border-radius: 6px;
  font-size: 9px;
  padding: 2px 8px;
  margin-left: 6px;
  cursor: pointer;
}
.mc-retry-btn:hover { background: rgba(255,77,94,.1); }
.mc-typing { padding: 2px 14px 6px; font-size: 11.5px; color: var(--mc-blue); min-height: 16px; }
.mc-typing b { font-weight: 700; }
.mc-typing .mc-typing-dots span { animation: mcBlink 1.2s infinite; }
.mc-typing .mc-typing-dots span:nth-child(2) { animation-delay: .2s; }
.mc-typing .mc-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes mcBlink { 0%{opacity:.2} 50%{opacity:1} 100%{opacity:.2} }

/* ══ COMPOSER ═════════════════════════════════════════ */
.mc-composer {
  flex: 0 0 auto;
  border-top: 1px solid var(--mc-line);
  background: rgba(9, 19, 29, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mc-sendas {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.mc-sendas-label { font-size: 9.5px; letter-spacing: .2em; color: var(--mc-muted-2); font-weight: 700; }
.mc-mode {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--mc-line);
  background: var(--mc-glass);
  color: var(--mc-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: all .15s;
}
.mc-mode .mc-mode-dot {
  width: 7px; height: 7px; border-radius: 50%;
  border: 2px solid var(--mc-muted-2);
}
.mc-mode:hover { color: var(--mc-text); border-color: var(--mc-line-2); }
.mc-mode.active {
  color: var(--mc-cyan);
  background:
    radial-gradient(120px 40px at 20% 0%, rgba(0,229,255,.15), transparent 70%),
    rgba(0, 229, 255, 0.07);
  border-color: rgba(0,229,255,.4);
  box-shadow: 0 0 14px rgba(0,229,255,.12);
  text-shadow: 0 0 8px rgba(0,229,255,.3);
}
.mc-mode.active .mc-mode-dot {
  border-color: var(--mc-cyan);
  background: var(--mc-cyan);
  box-shadow: 0 0 8px var(--mc-cyan);
}
.mc-mode .mc-mode-note { font-size: 8px; color: var(--mc-muted-2); letter-spacing: .04em; font-weight: 600; display: block; }

.mc-email-box {
  border: 1px solid var(--mc-line);
  border-radius: 12px;
  background: rgba(0, 19, 30, 0.45);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: mcFadeIn .18s ease;
}
@keyframes mcFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mc-email-title { font-size: 9.5px; letter-spacing: .2em; color: var(--mc-cyan); font-weight: 800; }
.mc-email-row { display: flex; gap: 8px; }
.mc-email-row input {
  flex: 1; min-width: 0;
  background: rgba(4, 13, 21, 0.7);
  border: 1px solid var(--mc-line);
  border-radius: 9px;
  color: var(--mc-text);
  padding: 9px 11px;
  font-size: 13px;
  outline: 0;
}
.mc-email-row input:focus { border-color: var(--mc-cyan); box-shadow: 0 0 0 3px rgba(0,229,255,.06); }
.mc-email-row input::placeholder { color: var(--mc-muted-2); }

.mc-input-row { display: flex; align-items: flex-end; gap: 8px; }
.mc-input {
  flex: 1; min-width: 0;
  background: rgba(4, 13, 21, 0.7);
  border: 1px solid var(--mc-line);
  border-radius: 12px;
  color: var(--mc-text);
  padding: 10px 13px;
  font-size: 13.5px;
  outline: 0;
  resize: none;
  min-height: 42px;
  max-height: 130px;
  line-height: 1.45;
  font-family: inherit;
}
.mc-input:focus { border-color: var(--mc-cyan); box-shadow: 0 0 0 3px rgba(0,229,255,.06); }
.mc-input::placeholder { color: var(--mc-muted-2); }
.mc-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.mc-tool {
  width: 40px; height: 40px;
  border-radius: 11px;
  border: 1px solid var(--mc-line);
  background: var(--mc-glass);
  color: var(--mc-muted);
  font-size: 16px;
  cursor: pointer;
  display: grid; place-items: center;
  position: relative;
}
.mc-tool:hover { color: var(--mc-cyan); border-color: var(--mc-line-2); }
.mc-tool[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); right: 0;
  background: #0c1f30; color: var(--mc-text);
  font-size: 10px; padding: 5px 9px; border-radius: 7px;
  white-space: nowrap; z-index: 40;
  border: 1px solid var(--mc-line-2);
  pointer-events: none;
}
.mc-send {
  height: 42px;
  padding: 0 20px;
  border-radius: 11px;
  border: 0;
  background: linear-gradient(135deg, var(--mc-cyan), #0aa7ff);
  color: #04121d;
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,229,255,.22);
  transition: filter .15s, transform .1s;
  white-space: nowrap;
}
.mc-send:hover { filter: brightness(1.08); }
.mc-send:active { transform: translateY(1px); }
.mc-send:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.mc-attach-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--mc-line-2);
  background: rgba(0,229,255,.05);
  font-size: 12px;
}
.mc-attach-chip .x { cursor: pointer; color: var(--mc-red); font-weight: 800; }

/* ══ INFO / PROFILE COLUMN ════════════════════════════ */
.mc-info-col { background: rgba(8, 17, 27, 0.6); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(0,229,255,.2) transparent; }
.mc-info-inner { padding: 18px 16px; }
.mc-info-label { font-size: 10px; letter-spacing: .2em; color: var(--mc-muted-2); font-weight: 800; margin: 20px 0 10px; }
.mc-info-label:first-child { margin-top: 0; }
.mc-profile-card { text-align: center; padding: 6px 0 4px; }
.mc-profile-card .msgr-avatar { width: 74px; height: 74px; font-size: 28px; margin: 0 auto; }
.mc-profile-card .mc-name { font-size: 17px; font-weight: 800; margin-top: 10px; }
.mc-profile-card .mc-handle { color: var(--mc-cyan); font-size: 12.5px; margin-top: 4px; }
.mc-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 10px; letter-spacing: .12em;
  color: var(--mc-green);
  background: rgba(36,231,142,.08);
  border: 1px solid rgba(36,231,142,.25);
}
.mc-status-pill.off { color: var(--mc-muted-2); background: rgba(0,0,0,.2); border-color: var(--mc-line); }
.mc-status-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--mc-green); box-shadow: 0 0 8px var(--mc-green); }
.mc-status-pill.off i { background: var(--mc-muted-2); box-shadow: none; }
.mc-profile-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.mc-profile-actions .mc-mini { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 11px; border: 1px solid var(--mc-line); background: var(--mc-glass); color: var(--mc-text); font-size: 9.5px; letter-spacing: .04em; cursor: pointer; text-decoration: none; }
.mc-profile-actions .mc-mini span { font-size: 17px; }
.mc-profile-actions .mc-mini:hover { border-color: var(--mc-line-2); background: var(--mc-glass-hi); }
.mc-profile-actions .mc-mini.primary { border-color: rgba(0,229,255,.35); background: rgba(0,229,255,.08); }
.mc-profile-actions .mc-mini.primary span { color: var(--mc-cyan); }
.mc-kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 12.5px; border-bottom: 1px solid rgba(0,229,255,.07); }
.mc-kv:last-child { border-bottom: 0; }
.mc-kv span { color: var(--mc-muted-2); flex: 0 0 auto; }
.mc-kv b { color: var(--mc-text); font-weight: 600; text-align: right; word-break: break-word; min-width: 0; }
.mc-kv .mc-mail { color: var(--mc-blue); }
.mc-kv .mc-mail span { color: var(--mc-muted-2); font-size: 10px; display: block; margin-top: 2px; }
.mc-tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-tag {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--mc-line);
  background: var(--mc-glass);
  color: var(--mc-muted);
  cursor: pointer;
}
.mc-tag:hover { color: var(--mc-cyan); border-color: var(--mc-line-2); }
.mc-tag.c { color: var(--mc-cyan); border-color: rgba(0,229,255,.3); }
.mc-shared-item { display: flex; align-items: center; gap: 9px; padding: 7px 0; cursor: pointer; border-radius: 9px; }
.mc-shared-item:hover { background: rgba(0,229,255,.04); }
.mc-shared-item .mc-avatar { width: 34px; height: 34px; font-size: 13px; }
.mc-shared-name { font-size: 12px; color: var(--mc-blue); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-shared-sub { font-size: 10.5px; color: var(--mc-muted-2); margin-top: 1px; }

.mc-screen { padding: 16px; overflow-y: auto; }
.mc-screen h2 { font-size: 10px; letter-spacing: .2em; color: var(--mc-muted-2); margin: 0 0 12px; font-weight: 800; }
.mc-user-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--mc-line); border-radius: 12px; margin-bottom: 8px; background: var(--mc-glass); }
.mc-user-row .info { flex: 1; min-width: 0; }
.mc-user-row .info b { display: block; }
.mc-user-row .info small { color: var(--mc-cyan); }
.mc-user-row .info p { margin: 2px 0 0; font-size: 12px; color: var(--mc-muted); }
.mc-mini-btn { background: var(--mc-glass); border: 1px solid var(--mc-line); color: var(--mc-text); border-radius: 8px; padding: 6px 11px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.mc-mini-btn:hover { border-color: var(--mc-line-2); }
.mc-mini-btn.gold { background: linear-gradient(135deg, var(--mc-cyan), #0aa7ff); color: #04121d; border: 0; font-weight: 800; }
.mc-mini-btn.solid { background: rgba(0,229,255,.1); border-color: rgba(0,229,255,.3); color: var(--mc-cyan); font-weight: 700; }

/* ══ AUTH ═════════════════════════════════════════════ */
.mc-auth {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 22px;
  background:
    radial-gradient(900px 500px at 15% 8%, rgba(0,229,255,.09), transparent 55%),
    radial-gradient(700px 460px at 90% 92%, rgba(127,208,255,.06), transparent 55%),
    var(--mc-bg);
}
.mc-auth-card {
  width: min(400px, 100%);
  border-radius: 18px;
  border: 1px solid var(--mc-line-2);
  background:
    linear-gradient(180deg, rgba(13, 28, 42, .85), rgba(8, 18, 28, .9));
  padding: 26px 24px 20px;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(0,229,255,.08);
}
.mc-auth-card .logo { width: 56px; height: 56px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(160deg, rgba(0,229,255,.2), rgba(0,229,255,.04)); border: 1px solid var(--mc-line-2); }
.mc-auth-card .logo img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(0,229,255,.5)); }
.mc-auth-title { font-weight: 800; letter-spacing: .14em; font-size: 19px; }
.mc-auth-title .dot { color: var(--mc-gold); }
.mc-auth-sub { color: var(--mc-cyan); font-size: 11px; margin-top: 5px; letter-spacing: .3em; }
.mc-auth-card h3 { margin: 20px 0 2px; font-size: 12px; letter-spacing: .2em; color: var(--mc-muted); font-weight: 800; }
.mc-auth input {
  width: 100%;
  margin-top: 9px;
  background: rgba(4, 13, 21, 0.7);
  border: 1px solid var(--mc-line);
  border-radius: 10px;
  color: var(--mc-text);
  padding: 12px 13px;
  font-size: 14px;
  outline: 0;
  text-align: left;
}
.mc-auth input:focus { border-color: var(--mc-cyan); box-shadow: 0 0 0 3px rgba(0,229,255,.06); }
.mc-auth .mc-btn { width: 100%; margin-top: 14px; }
.mc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid var(--mc-line);
  background: var(--mc-glass);
  color: var(--mc-text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.mc-btn:hover { border-color: var(--mc-line-2); }
.mc-btn.gold { background: linear-gradient(135deg, var(--mc-cyan), #0aa7ff); color: #04121d; border: 0; box-shadow: 0 6px 20px rgba(0,229,255,.2); }
.mc-btn.danger { color: var(--mc-red); border-color: rgba(255,77,94,.35); }
.mc-auth-switch { margin-top: 14px; font-size: 12.5px; color: var(--mc-muted); }
.mc-auth-switch .link { color: var(--mc-cyan); cursor: pointer; font-weight: 700; }
.mc-auth-err { color: var(--mc-red); font-size: 12px; margin-top: 10px; min-height: 15px; text-align: left; }
.mc-foot-auth { margin-top: 16px; font-size: 9px; color: var(--mc-muted-2); letter-spacing: .18em; }
.mc-foot-abs { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 9px; color: var(--mc-muted-2); letter-spacing: .18em; padding: 2px; }

/* ══ DRAWER / OVERLAY ═════════════════════════════════ */
.mc-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 8, 13, .72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.mc-overlay.open { opacity: 1; pointer-events: auto; }
.mc-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(380px, 94vw);
  background: linear-gradient(180deg, rgba(11, 23, 36, .97), rgba(6, 14, 22, .99));
  border-left: 1px solid var(--mc-line);
  z-index: 80;
  transform: translateX(102%);
  transition: transform .22s ease;
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
}
.mc-drawer.open { transform: translateX(0); }
.mc-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--mc-line); font-weight: 800; font-size: 13px; letter-spacing: .06em; }
.mc-notif { padding: 13px 16px; border-bottom: 1px solid rgba(0,229,255,.07); cursor: pointer; }
.mc-notif:hover { background: rgba(0,229,255,.05); }
.mc-notif.unread { border-left: 3px solid var(--mc-cyan); }
.mc-notif-title { font-size: 13px; font-weight: 700; }
.mc-notif-body { font-size: 12px; color: var(--mc-muted); margin-top: 3px; }
.mc-notif-time { font-size: 10px; color: var(--mc-muted-2); margin-top: 4px; }
.mc-notif-list { flex: 1; overflow-y: auto; }

/* ══ TOAST ════════════════════════════════════════════ */
.mc-toast {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: rgba(10, 28, 42, .96);
  color: var(--mc-text);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--mc-line-2);
  font-size: 13px;
  z-index: 100;
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
  transition: transform .24s ease;
  max-width: min(92vw, 460px);
  text-align: center;
}
.mc-toast.show { transform: translateX(-50%) translateY(0); }
.mc-toast .link { color: var(--mc-cyan); cursor: pointer; font-weight: 800; margin-left: 10px; }

.spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(0,229,255,.12);
  border-top-color: var(--mc-cyan);
  margin: 44px auto;
  animation: mcSpin .8s linear infinite;
}
@keyframes mcSpin { to { transform: rotate(360deg); } }
.mc-center { flex: 1; display: grid; place-items: center; color: var(--mc-muted); text-align: center; padding: 0 20px; }

.mc-badge-gold {
  position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mc-gold);
  box-shadow: 0 0 8px rgba(255,210,30,.8);
}

/* ══ RESPONSIVE ═══════════════════════════════════════ */
@media (max-width: 1180px) {
  .mc-shell { grid-template-columns: 72px minmax(240px, 20vw) minmax(0, 1fr); }
  .mc-info-col { display: none; }
}
@media (max-width: 860px) {
  .mc-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .mc-list-col { position: fixed; top: var(--mc-topbar-h); left: 64px; right: 0; bottom: 0; z-index: 40; transform: translateX(-110%); transition: transform .22s ease; background: var(--mc-bg-2); border-left: 1px solid var(--mc-line); }
  .mc-list-col.show { transform: translateX(0); }
  .mc-chat-col { grid-column: 2; }
  .mc-back { display: inline-grid; }
}
@media (max-width: 560px) {
  .mc-shell { grid-template-columns: 56px minmax(0, 1fr); }
  .mc-list-col { left: 56px; }
  .mc-topbar { padding: 0 10px; }
  .mc-brand-sub { display: none; }
  .mc-brand-name { font-size: 13px; }
  .mc-user-chip > span { max-width: 88px; }
  .mc-conn-pill { display: none; }
  .mc-rail { padding: 8px 0 10px; }
  .mc-rail-item { margin: 1px 4px; padding: 10px 0 8px; }
  .mc-rail-item span.mc-label { font-size: 7.5px; }
  .mc-msg { max-width: 92%; }
  .mc-sendas { gap: 6px; }
  .mc-mode { padding: 5px 10px; font-size: 10.5px; }
  .mc-mode .mc-mode-note { display: none; }
  .mc-messages { padding: 12px 10px 8px; }
  .mc-composer { padding: 8px 10px 10px; }
  .mc-tool { width: 38px; height: 38px; }
  .mc-send { padding: 0 14px; }
}
@media (max-width: 360px) {
  .mc-mode::after { content: ""; }
  .mc-mode span.mc-mode-txt { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ════════════════════════════════════════════════════════════════
   NATIVE AVATAR + TOAST (used by messenger-ui.js UI.avatar / toast)
   ════════════════════════════════════════════════════════════════ */
.msgr-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  color: var(--mc-blue);
  background:
    radial-gradient(circle at 30% 25%, rgba(0, 229, 255, .22), transparent 55%),
    linear-gradient(150deg, #123a53, #0b2233), #0b2233;
  border: 1px solid var(--mc-line-2);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}
.msgr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msgr-avatar .msgr-presence {
  position: absolute; right: -1px; bottom: -1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--mc-muted-2);
  border: 2px solid #0d1a28;
}
.msgr-avatar .msgr-presence.online { background: var(--mc-green); box-shadow: 0 0 7px rgba(36, 231, 142, .7); }
.msgr-toast {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: rgba(10, 28, 42, .96);
  color: var(--mc-text);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--mc-line-2);
  font-size: 13px;
  z-index: 100;
  line-height: 1.5;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
  transition: transform .24s ease;
  max-width: min(92vw, 460px);
  text-align: center;
}
.msgr-toast.show { transform: translateX(-50%) translateY(0); }
.msgr-toast .link { color: var(--mc-cyan); cursor: pointer; font-weight: 800; margin-left: 10px; }
@media (max-width: 768px) {
  .msgr-toast { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE-FIRST PREMIUM LAYOUT  (≤ 768px) · iPhone / Android
   Single-column viewport · iOS safe areas · bottom tab navigation
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --mc-topbar-h: calc(52px + env(safe-area-inset-top)); }

  html, body,
  #msgr-app, .mc-app {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  #msgr-app, .mc-app { overflow: hidden; }
  .mc-app { height: 100dvh; }
  button, a, .mc-conv, .mc-rail-item, .mc-tab, .mc-tool { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

  /* ── Header ─────────────────────────────────────────── */
  .mc-topbar {
    height: var(--mc-topbar-h);
    padding: env(safe-area-inset-top) 10px 0;
    gap: 8px;
  }
  .mc-brand { flex: 1 1 auto; flex-wrap: nowrap; gap: 8px; overflow: hidden; }
  .mc-brand-mark { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; }
  .mc-brand-mark img { width: 20px; height: 20px; }
  .mc-brand-name { font-size: clamp(11px, 3.5vw, 15px); letter-spacing: .05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mc-top-right { flex: 0 0 auto; gap: 6px; min-width: 0; }
  .mc-conn-pill { display: none; }
  .mc-icon-btn { width: 44px; height: 44px; border-radius: 12px; font-size: 17px; }
  .mc-user-chip {
    padding: 4px;
    border: 0;
    background: transparent;
    max-width: 44px; min-width: 44px; min-height: 44px;
    justify-content: center;
  }
  .mc-user-chip > span { display: none; }
  .mc-user-chip .msgr-avatar { width: 34px; height: 34px; font-size: 12px; }
  .mc-user-chip:hover, .mc-user-chip:focus-visible { background: transparent; border: 0; }
  .mc-badge { min-width: 18px; height: 18px; font-size: 10px; }

  /* ── Shell: single-column stage ─────────────────────── */
  .mc-shell, .mc-shell.no-info { grid-template-columns: minmax(0, 1fr); }
  .mc-chat-col { grid-column: 1 / -1; }

  /* ── Conversation list: full-width panel ────────────── */
  .mc-list-col {
    position: fixed;
    top: var(--mc-topbar-h);
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    transform: translateX(-103%);
    transition: transform .24s ease;
    background: rgba(5, 11, 18, .98);
    border-left: 0;
    box-shadow: 14px 0 48px rgba(0, 0, 0, .5);
    -webkit-overflow-scrolling: touch;
  }
  .mc-list-col.show { transform: translateX(0); }
  .mc-list-title { font-size: 20px; letter-spacing: .04em; }
  .mc-search { width: 100%; max-width: none; min-height: 48px; margin-top: 12px; padding: 12px 13px; border-radius: 14px; }
  .mc-search input { font-size: 16px; }
  .mc-tabs { padding: 10px 14px 6px; }
  .mc-tab { min-height: 44px; padding: 9px 13px; font-size: 11.5px; }
  .mc-list { padding: 4px 10px calc(92px + env(safe-area-inset-bottom) + 8px); -webkit-overflow-scrolling: touch; }
  .mc-conv { min-height: 60px; gap: 12px; padding: 10px 12px; border-radius: 14px; }
  .mc-conv-name { font-size: 15px; }
  .mc-conv-sub { font-size: 13px; }
  .mc-conv-time { font-size: 10.5px; }
  .mc-list .msgr-avatar { width: 44px; height: 44px; font-size: 14px; }
  .mc-list-empty { padding: 28px 16px; font-size: 14px; }
  .mc-user-row { gap: 12px; padding: 12px; border-radius: 14px; }
  .mc-user-row .info b { font-size: 15px; }
  .mc-user-row .info p { font-size: 13px; }
  .mc-mini-btn { min-height: 44px; padding: 8px 14px; font-size: 12.5px; }

  /* ── Chat column ────────────────────────────────────── */
  .mc-chat-head { height: 58px; padding: 0 8px; gap: 10px; }
  .mc-back { display: inline-grid; }
  .mc-chat-peer { min-width: 0; }
  .mc-chat-name { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mc-chat-status { font-size: 11.5px; }
  .mc-chat-actions { gap: 6px; }
  .mc-chat-actions .mc-icon-btn { width: 40px; height: 40px; }
  .mc-chat-actions .mc-icon-btn[title^="Call"],
  .mc-chat-actions .mc-icon-btn[title^="Video"] { display: none; }
  .mc-messages { padding: 12px 8px 6px; -webkit-overflow-scrolling: touch; }
  .mc-msg { max-width: 92%; }
  .mc-bubble { font-size: 15px; padding: 10px 13px; }
  .mc-sender-name { font-size: 12px; }
  .mc-msg-meta { font-size: 10.5px; }
  .mc-day { font-size: 10px; letter-spacing: .18em; }
  .mc-file-card { max-width: 100%; }

  /* ── Video never overflows the message bubble ───────── */
  .mc-video { width: 100%; max-width: 100%; }
  .mc-video-el { width: 100%; max-width: 100%; }
  .mc-vp-controls { padding: 8px 8px; gap: 5px; }
  .mc-vp-btn { width: 30px; height: 30px; font-size: 12px; }
  .mc-vp-seek { height: 6px; }
  .mc-vp-seek::-webkit-slider-thumb { width: 16px; height: 16px; }

  /* ── Composer: iOS Messages feel ────────────────────── */
  .mc-composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  .mc-sendas { gap: 6px; }
  .mc-sendas-label { font-size: 9px; }
  .mc-mode { min-height: 44px; padding: 8px 12px; font-size: 12px; }
  .mc-mode .mc-mode-note { display: none; }
  .mc-email-box { padding: 10px; }
  .mc-email-title { font-size: 9px; }
  .mc-email-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .mc-email-row input { font-size: 16px; min-height: 46px; padding: 11px 12px; border-radius: 12px; width: 100%; }
  .mc-email-row input::placeholder { font-size: 15px; }
  .mc-input { font-size: 16px; min-height: 46px; padding: 12px 13px; border-radius: 16px; }
  .mc-tools { gap: 8px; }
  .mc-tool { width: 46px; height: 46px; }
  .mc-send { height: 46px; padding: 0 18px; font-size: 13px; border-radius: 14px; }
  .mc-attach-chip { font-size: 12.5px; padding: 8px 12px; max-width: 100%; }

  /* ── Bottom navigation (existing rail → tab bar) ────── */
  .mc-rail {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--mc-line);
    border-right: 0;
    background: rgba(6, 14, 23, .94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    display: none;
  }
  .mc-rail::-webkit-scrollbar { display: none; }
  body.msgr-navbar .mc-rail { display: flex; }
  body.msgr-conv .mc-rail { display: none; }
  .mc-rail-item {
    flex: 0 1 auto;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 54px;
    margin: 0 2px;
    padding: 7px 4px 5px;
    border-radius: 12px;
    white-space: normal;
  }
  .mc-rail-item .mc-glyph { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
  .mc-rail-item .mc-label { font-size: 8px; letter-spacing: .02em; }
  .mc-rail-top, .mc-rail-spacer, .mc-rail-map, .mc-rail-byline, .mc-rail-user { display: none; }
  #rail-contacts, #rail-files, #rail-mapdata { display: none; }

  /* ── Screens sit above the bottom bar ───────────────── */
  .mc-screen { padding: 12px; padding-bottom: calc(76px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
  .mc-center { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .mc-profile-card .mc-name { font-size: 20px; }

  /* ── Auth ───────────────────────────────────────────── */
  .mc-auth { padding: calc(16px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom)); }
  .mc-auth input { font-size: 16px; min-height: 48px; padding: 13px 14px; }
  .mc-btn { min-height: 48px; font-size: 13.5px; }
  .mc-auth-card { padding: 22px 18px 18px; }

  /* ── Overlays ───────────────────────────────────────── */
  .mc-drawer { width: 100%; max-width: 100%; padding-bottom: env(safe-area-inset-bottom); }
  .mc-drawer-head { min-height: 52px; padding: 12px 14px; }
  .mc-notif-list { -webkit-overflow-scrolling: touch; }
}

/* ══ Small phones ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .mc-brand-mark { width: 28px; height: 28px; }
  .mc-brand-name { font-size: clamp(11px, 4vw, 14px); }
  .mc-brand-name > span:not(.dot) { display: none; }
  .mc-msg { max-width: 96%; }
  .mc-sendas-label { display: none; }
  .mc-mode { flex: 1 1 0; justify-content: center; text-align: left; }
  .mc-tool { width: 44px; height: 44px; }
  .mc-send { padding: 0 14px; }
  .mc-rail-item { min-width: 48px; }
  .mc-rail-item .mc-label { font-size: 7.5px; letter-spacing: 0; }
}

/* ══ Tiny screens ────────────────────────────────────────────── */
@media (max-width: 360px) {
  .mc-topbar { padding: env(safe-area-inset-top) 6px 0; gap: 6px; }
  .mc-icon-btn { width: 40px; height: 40px; }
  .mc-user-chip { max-width: 40px; min-width: 40px; min-height: 40px; }
  .mc-user-chip .msgr-avatar { width: 32px; height: 32px; }
  .mc-composer { padding-right: 8px; padding-left: 8px; }
}

:root {
  --mc-nav-width: clamp(188px, 16vw, 220px);
  --mc-conversation-width: clamp(280px, 24vw, 340px);
  --mc-profile-width: clamp(300px, 25vw, 360px);
  --mc-topbar-h: 72px;
}

.mc-topbar {
  height: var(--mc-topbar-h);
  padding: 0 22px;
  gap: 20px;
  border-bottom-color: rgba(0,229,255,.18);
  background: linear-gradient(180deg, rgba(7,18,29,.96), rgba(5,13,21,.84));
}
.mc-brand { flex: 0 1 286px; gap: 12px; }
.mc-brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.mc-brand-mark img { width: 27px; height: 27px; }
.mc-brand-name { font-size: 15px; letter-spacing: .16em; }
.mc-brand-sub { font-size: 9px; letter-spacing: .28em; }
.mc-global-search-wrap { flex: 1 1 520px; max-width: 650px; min-width: 180px; position: relative; z-index: 50; }
.mc-global-search {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid rgba(0,229,255,.15);
  border-radius: 12px;
  background: rgba(4,13,21,.68);
  color: var(--mc-muted-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.mc-global-search:focus-within { border-color: var(--mc-cyan); background: rgba(4,16,25,.92); box-shadow: 0 0 0 3px rgba(0,229,255,.07), 0 10px 28px rgba(0,0,0,.18); }
.mc-global-search-icon { font-size: 22px; line-height: 1; color: var(--mc-cyan); }
.mc-global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--mc-text); font-size: 13px; }
.mc-global-search input::placeholder { color: #6e8ba1; }
.mc-search-shortcut { min-width: 24px; padding: 3px 6px; border: 1px solid rgba(0,229,255,.18); border-radius: 5px; color: var(--mc-muted-2); font: 10px var(--mc-sans); text-align: center; }
.mc-global-results { display: none; position: absolute; top: calc(100% + 9px); left: 0; right: 0; max-height: min(440px, 55vh); overflow-y: auto; padding: 7px; border: 1px solid var(--mc-line-2); border-radius: 14px; background: rgba(7,18,29,.98); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.mc-global-results.open { display: block; }
.mc-global-result { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--mc-text); text-align: left; cursor: pointer; }
.mc-global-result:hover, .mc-global-result:focus-visible { border-color: var(--mc-line); background: rgba(0,229,255,.07); outline: none; }
.mc-global-result .msgr-avatar { width: 38px; height: 38px; font-size: 12px; }
.mc-global-result-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mc-global-result-top { display: flex; align-items: center; gap: 8px; }
.mc-global-result-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.mc-global-result-top em { margin-left: auto; color: var(--mc-cyan); font-size: 9px; font-style: normal; letter-spacing: .12em; }
.mc-global-result-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mc-cyan); font-size: 10px; }
.mc-global-result-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mc-muted-2); font-size: 11px; }
.mc-global-result-arrow { color: var(--mc-muted-2); font-size: 17px; }
.mc-global-empty, .mc-global-loading { display: flex; align-items: center; gap: 9px; padding: 15px 12px; color: var(--mc-muted); font-size: 12px; }
.mc-global-loading .spinner { width: 18px; height: 18px; margin: 0; border-width: 2px; }
.mc-header-tools, .mc-top-right { display: flex; align-items: center; gap: 8px; }
.mc-top-right { flex: 0 0 auto; }
.mc-icon-btn { width: 40px; height: 40px; border-radius: 11px; }
.mc-user-wrap { position: relative; }
.mc-user-chip { max-width: 224px; min-height: 46px; padding: 4px 9px 4px 5px; border-radius: 13px; }
.mc-user-chip > .msgr-avatar { width: 34px; height: 34px; font-size: 12px; }
.mc-user-chip .mc-user-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.mc-user-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.mc-user-address { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mc-cyan); font-size: 9.5px; font-weight: 500; }
.mc-user-caret { margin-left: 2px; color: var(--mc-muted-2); font-size: 16px; }
.mc-user-dropdown { display: none; position: absolute; top: calc(100% + 8px); right: 0; width: 210px; padding: 6px; border: 1px solid var(--mc-line-2); border-radius: 13px; background: rgba(7,18,29,.98); box-shadow: 0 20px 48px rgba(0,0,0,.48); }
.mc-user-dropdown.open { display: block; }
.mc-user-menu-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--mc-text); font: 600 12px var(--mc-sans); text-align: left; text-decoration: none; cursor: pointer; }
.mc-user-menu-item:hover, .mc-user-menu-item:focus-visible { background: rgba(0,229,255,.08); outline: none; }
.mc-user-menu-item.danger { color: var(--mc-red); }
.mc-user-menu-glyph { width: 18px; color: var(--mc-cyan); text-align: center; }

.mc-shell { grid-template-columns: var(--mc-nav-width) var(--mc-conversation-width) minmax(0, 1fr) var(--mc-profile-width); }
.mc-rail { padding: 18px 12px 14px; background: linear-gradient(180deg, rgba(10,24,37,.96), rgba(5,13,21,.98)); }
.mc-rail-top { display: flex; align-items: center; gap: 9px; margin: 0 2px 18px; text-align: left; }
.mc-rail-logo { width: 38px; height: 38px; margin: 0; flex: 0 0 auto; }
.mc-rail-eyebrow { color: var(--mc-muted-2); font-size: 8px; font-weight: 800; letter-spacing: .22em; }
.mc-rail-item { min-height: 52px; margin: 2px 0; padding: 9px 11px; border-radius: 11px; gap: 10px; }
.mc-rail-item .mc-glyph { width: 32px; height: 32px; }
.mc-rail-item .mc-label { font-size: 10px; letter-spacing: .07em; }
.mc-rail-item.active::before { content: ""; width: 3px; height: 25px; position: absolute; left: -12px; border-radius: 0 4px 4px 0; background: var(--mc-cyan); box-shadow: 0 0 12px rgba(0,229,255,.75); }
.mc-rail-item { position: relative; }
/* PAN-AFRICAN NETWORK panel.
   height 116px -> 212px (+96px / ~1in).
   flex:0 0 auto stops the column flexbox from shrinking the panel back down on
   short viewports (it was already collapsing to 76px at 1200x760); when the rail
   genuinely runs out of room it scrolls instead (.mc-rail has overflow-y:auto).
   align-items:center keeps the 52px mark optically centred in the taller box;
   the caption stays absolutely pinned to the bottom exactly as before. */
.mc-rail-visual { display: flex; align-items: center; position: relative; height: 212px; flex: 0 0 auto; margin: 16px 2px 12px; padding: 12px; overflow: hidden; border: 1px solid var(--mc-line); border-radius: 14px; background: radial-gradient(120px 90px at 80% 20%, rgba(0,229,255,.12), transparent 70%), linear-gradient(145deg, rgba(16,41,58,.72), rgba(4,14,23,.92)); color: var(--mc-text); text-decoration: none; }
.mc-rail-visual::after { content: ""; position: absolute; right: -28px; bottom: -44px; width: 150px; height: 150px; border: 1px solid rgba(0,229,255,.16); border-radius: 50%; box-shadow: 0 0 0 18px rgba(0,229,255,.025), 0 0 0 36px rgba(0,229,255,.02); }
.mc-rail-visual img { position: relative; z-index: 1; width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 0 13px rgba(0,229,255,.45)); }
.mc-rail-visual-glow { position: absolute; top: 17px; right: 22px; width: 80px; height: 80px; border-radius: 50%; background: rgba(0,229,255,.1); filter: blur(16px); }
.mc-rail-visual-copy { position: absolute; left: 12px; right: 10px; bottom: 11px; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.mc-rail-visual-copy b { font-size: 8px; letter-spacing: .14em; }
.mc-rail-visual-copy small { color: var(--mc-muted-2); font-size: 7px; letter-spacing: .1em; }
.mc-rail-byline { font-size: 7px; line-height: 1.5; }

.mc-list-col { background: linear-gradient(180deg, rgba(8,19,30,.9), rgba(6,14,23,.86)); }
.mc-list-head { padding: 20px 17px 9px; }
.mc-list-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-list-title { font-size: 17px; letter-spacing: .05em; }
.mc-list-compose { width: 34px; height: 34px; border: 1px solid var(--mc-line); border-radius: 9px; background: var(--mc-glass); color: var(--mc-cyan); font-size: 17px; cursor: pointer; }
.mc-list-compose:hover { border-color: var(--mc-cyan); background: rgba(0,229,255,.1); }
.mc-search { margin-top: 15px; min-height: 42px; border-radius: 11px; }
.mc-tabs { gap: 5px; padding: 9px 13px 7px; }
.mc-tab { min-height: 32px; padding: 7px 9px; font-size: 9px; letter-spacing: .06em; }
.mc-tab-count { display: inline-grid; min-width: 17px; height: 17px; margin-left: 4px; padding: 0 4px; place-items: center; border-radius: 99px; background: rgba(0,229,255,.12); font-size: 9px; }
.mc-list { padding: 3px 8px 18px; }
.mc-conv { min-height: 72px; gap: 11px; padding: 11px 10px; border-radius: 12px; outline: none; }
.mc-conv:focus-visible { border-color: var(--mc-cyan); box-shadow: 0 0 0 3px rgba(0,229,255,.08); }
.mc-conv .msgr-avatar { width: 48px; height: 48px; font-size: 14px; }
.mc-conv-name { font-size: 13px; }
.mc-conv-sub { margin-top: 4px; font-size: 11px; }
.mc-conv-meta { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 8px; letter-spacing: .12em; }
.mc-conv-secure { color: var(--mc-green); }
.mc-conv-kind { color: var(--mc-muted-2); }

.mc-chat-col { background: radial-gradient(720px 500px at 68% 0%, rgba(0,229,255,.055), transparent 62%), linear-gradient(180deg, #07131e, #050d16); }
.mc-chat-head { height: 76px; padding: 0 22px; gap: 12px; background: linear-gradient(180deg, rgba(9,22,34,.9), rgba(7,17,27,.74)); }
.mc-chat-head .msgr-avatar { width: 44px; height: 44px; font-size: 14px; }
.mc-chat-name { font-size: 15px; }
.mc-chat-status { margin-top: 3px; font-size: 11px; }
.mc-chat-actions .mc-icon-btn { width: 40px; height: 40px; }
.mc-messages { padding: 22px 28px 12px; }
.mc-msg { max-width: min(640px, 88%); gap: 9px; }
.mc-msg .msgr-avatar { width: 36px; height: 36px; font-size: 12px; }
.mc-bubble { padding: 11px 14px; border-radius: 16px; font-size: 14px; line-height: 1.52; }
.mc-msg.in .mc-bubble { border-top-left-radius: 6px; }
.mc-msg.out .mc-bubble { border-top-right-radius: 6px; }
.mc-msg-meta { margin-top: 6px; }
.mc-composer { padding: 13px 22px 18px; gap: 9px; background: linear-gradient(180deg, rgba(7,17,27,.78), rgba(4,11,18,.96)); }
.mc-sendas { gap: 6px; }
.mc-mode { padding: 7px 12px; }
.mc-email-box { padding: 12px 14px; }
.mc-input-row { gap: 9px; }
.mc-input { min-height: 46px; padding: 12px 14px; border-radius: 14px; }
.mc-tool { width: 44px; height: 44px; border-radius: 12px; }
.mc-send { height: 46px; border-radius: 13px; }

.mc-info-col { display: flex; flex-direction: column; overflow: hidden; background: linear-gradient(180deg, rgba(10,23,36,.96), rgba(6,14,23,.97)); }
.mc-context-head { min-height: 76px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 13px 17px; border-bottom: 1px solid var(--mc-line); position: relative; }
.mc-context-eyebrow { color: var(--mc-cyan); font-size: 8px; font-weight: 800; letter-spacing: .24em; }
.mc-context-head strong { max-width: calc(100% - 36px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mc-text); font-size: 12px; letter-spacing: .1em; }
.mc-context-close { position: absolute; top: 17px; right: 13px; width: 34px; height: 34px; font-size: 13px; }
.mc-info-inner { flex: 1; min-height: 0; overflow-y: auto; padding: 15px 17px 28px; scrollbar-width: thin; scrollbar-color: rgba(0,229,255,.25) transparent; }
.mc-context-tabs { display: flex; gap: 3px; margin: -2px -3px 16px; overflow-x: auto; scrollbar-width: none; }
.mc-context-tabs::-webkit-scrollbar { display: none; }
.mc-context-tab { flex: 0 0 auto; min-height: 31px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--mc-muted-2); font: 800 8px var(--mc-sans); letter-spacing: .09em; cursor: pointer; }
.mc-context-tab:hover:not(:disabled), .mc-context-tab.active { border-color: rgba(0,229,255,.25); background: rgba(0,229,255,.09); color: var(--mc-cyan); }
.mc-context-tab:disabled { opacity: .38; cursor: not-allowed; }
.mc-context-profile { padding-top: 3px; }
.mc-context-profile .msgr-avatar { width: 82px; height: 82px; font-size: 27px; box-shadow: 0 0 0 5px rgba(0,229,255,.05), 0 0 28px rgba(0,229,255,.18); }
.mc-context-profile .mc-name { font-size: 19px; }
.mc-context-profile .mc-handle { max-width: 100%; overflow-wrap: anywhere; }
.mc-profile-actions { gap: 6px; margin-top: 15px; }
.mc-profile-actions .mc-mini { min-height: 58px; padding: 8px 3px; }
.mc-profile-actions .mc-mini span { font-size: 18px; }
.mc-security-value { color: var(--mc-green) !important; font-size: 10px; letter-spacing: .04em; }
.mc-context-empty { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 20px 12px; color: var(--mc-muted-2); text-align: center; }
.mc-context-empty-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--mc-line-2); border-radius: 12px; color: var(--mc-cyan); font-size: 19px; }
.mc-context-empty strong { color: var(--mc-text); font-size: 12px; }
.mc-context-empty span { max-width: 230px; font-size: 11px; line-height: 1.5; }
.mc-context-section-title { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 10px; color: var(--mc-muted-2); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.mc-context-section-title small { color: var(--mc-cyan); font-size: 10px; }
.mc-context-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.mc-context-stats > div { display: flex; flex-direction: column; gap: 5px; padding: 10px 5px; border: 1px solid var(--mc-line); border-radius: 10px; background: rgba(0,229,255,.035); text-align: center; }
.mc-context-stats b { color: var(--mc-cyan); font-size: 17px; }
.mc-context-stats span { color: var(--mc-muted-2); font-size: 7px; letter-spacing: .1em; }
.mc-info-inner > .mc-file-card { width: 100%; max-width: none; margin-top: 8px; }
.mc-info-inner > .mc-file-card .mc-file-name { font-size: 11px; }
.mc-delivery-row { display: flex; flex-direction: column; gap: 3px; padding: 9px 0; border-bottom: 1px solid rgba(0,229,255,.08); }
.mc-delivery-row b { color: var(--mc-blue); font-size: 11px; font-weight: 700; }
.mc-delivery-row span { color: var(--mc-muted-2); font-size: 10px; }
.mc-context-overlay { display: none; position: fixed; inset: 0; z-index: 69; background: rgba(2,8,13,.64); opacity: 0; pointer-events: none; transition: opacity .2s; }
.mc-context-overlay.open { opacity: 1; pointer-events: auto; }

@media (min-width: 1181px) {
  .mc-context-close { display: none; }
}

@media (max-width: 1180px) {
  :root { --mc-topbar-h: 68px; }
  .mc-topbar { height: var(--mc-topbar-h); padding: 0 14px; gap: 12px; }
  .mc-brand { flex: 0 1 230px; }
  .mc-brand-name { font-size: 13px; }
  .mc-brand-sub { font-size: 8px; letter-spacing: .2em; }
  .mc-global-search-wrap { max-width: none; }
  .mc-user-copy { display: none; }
  .mc-user-chip { max-width: 48px; min-width: 48px; }
  .mc-user-caret { display: none; }
  .mc-shell { grid-template-columns: 72px var(--mc-conversation-width) minmax(0, 1fr); }
  .mc-rail { padding: 12px 8px; }
  .mc-rail-top { justify-content: center; margin-bottom: 12px; }
  .mc-rail-eyebrow, .mc-rail-visual, .mc-rail-byline { display: none; }
  .mc-rail-item { justify-content: center; margin: 2px 0; padding: 8px 0; }
  .mc-rail-item .mc-label { display: none; }
  .mc-rail-item.active::before { left: -8px; }
  .mc-info-col { display: none; position: fixed; top: 0; right: 0; bottom: 0; width: min(370px, 92vw); z-index: 85; border-left: 1px solid var(--mc-line-2); box-shadow: -18px 0 55px rgba(0,0,0,.5); transform: translateX(105%); transition: transform .22s ease; }
  .mc-info-col.open { display: flex; transform: translateX(0); }
  .mc-context-overlay.open { display: block; }
}

@media (min-width: 1100px) and (max-width: 1180px) {
  .mc-shell { grid-template-columns: var(--mc-nav-width) var(--mc-conversation-width) minmax(0, 1fr) var(--mc-profile-width); }
  .mc-rail { padding: 18px 12px 14px; }
  .mc-rail-top { justify-content: flex-start; }
  .mc-rail-eyebrow, .mc-rail-visual, .mc-rail-byline { display: block; }
  .mc-rail-item { justify-content: flex-start; padding: 9px 11px; }
  .mc-rail-item .mc-label { display: block; }
  .mc-rail-item.active::before { left: -12px; }
  .mc-info-col { display: flex; position: static; width: auto; z-index: auto; border-left: 1px solid rgba(0, 229, 255, .08); box-shadow: none; transform: none; }
  .mc-context-close, .mc-context-overlay, .mc-context-overlay.open { display: none; }
}

@media (max-width: 860px) {
  .mc-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .mc-list-col { left: 64px; }
  .mc-topbar { gap: 8px; }
  .mc-global-search-wrap { min-width: 130px; }
  .mc-header-tools .mc-globe-btn, .mc-header-settings { display: none; }
}

@media (max-width: 768px) {
  :root { --mc-topbar-h: calc(58px + env(safe-area-inset-top)); }
  .mc-topbar { height: var(--mc-topbar-h); padding: env(safe-area-inset-top) 10px 0; gap: 8px; }
  .mc-brand { flex: 1 1 auto; }
  .mc-brand-mark { width: 30px; height: 30px; }
  .mc-brand-name { font-size: 12px; }
  .mc-global-search-wrap { display: none; }
  .mc-header-tools { gap: 3px; }
  .mc-header-tools .mc-conn-pill, .mc-header-tools .mc-globe-btn, .mc-header-settings { display: none; }
  .mc-icon-btn { width: 44px; height: 44px; }
  .mc-user-chip { width: 44px; min-width: 44px; min-height: 44px; padding: 4px; border: 0; background: transparent; }
  .mc-user-chip .mc-user-copy { display: none; }
  .mc-user-chip > .msgr-avatar { width: 34px; height: 34px; }
  .mc-user-dropdown { right: -4px; }
  .mc-shell, .mc-shell.no-info { grid-template-columns: minmax(0, 1fr); }
  .mc-chat-col { grid-column: 1 / -1; }
  .mc-list-col { left: 0; right: 0; top: var(--mc-topbar-h); bottom: 0; }
  .mc-list-head { padding: 16px 14px 8px; }
  .mc-list-title { font-size: 19px; }
  .mc-list .mc-conv { min-height: 66px; }
  .mc-chat-head { height: 62px; padding: 0 8px; gap: 9px; }
  .mc-chat-head .msgr-avatar { width: 38px; height: 38px; }
  .mc-chat-name { font-size: 14px; }
  .mc-chat-actions .mc-context-open-btn { display: inline-grid; }
  .mc-chat-actions .mc-icon-btn { width: 40px; height: 40px; }
  .mc-chat-actions .mc-icon-btn[title^="Call"], .mc-chat-actions .mc-icon-btn[title^="Video"] { display: none; }
  .mc-messages { padding: 14px 8px 8px; }
  .mc-msg { max-width: 94%; }
  .mc-bubble { font-size: 15px; padding: 10px 12px; }
  .mc-composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .mc-sendas { gap: 5px; }
  .mc-mode { min-height: 42px; padding: 7px 9px; }
  .mc-mode .mc-mode-note { display: none; }
  .mc-input { min-height: 46px; font-size: 16px; }
  .mc-tool { width: 44px; height: 44px; }
  .mc-send { height: 46px; }
  .mc-info-col { top: 0; width: min(100vw, 380px); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .mc-context-head { min-height: 66px; padding: 11px 14px; }
  .mc-info-inner { padding: 13px 14px calc(28px + env(safe-area-inset-bottom)); }
  .mc-context-tabs { margin-left: -2px; margin-right: -2px; }
  .mc-context-tab { min-height: 40px; padding: 8px 9px; }
}

@media (max-width: 480px) {
  .mc-brand-copy { min-width: 0; }
  .mc-brand-name { max-width: 150px; }
  .mc-top-right { gap: 2px; }
  .mc-header-tools .mc-icon-btn { width: 40px; height: 40px; }
  .mc-user-chip { width: 40px; min-width: 40px; min-height: 40px; }
  .mc-chat-head { padding-left: 5px; padding-right: 5px; }
  .mc-chat-actions { gap: 3px; }
  .mc-chat-actions .mc-icon-btn { width: 38px; height: 38px; }
  .mc-mode { flex: 1 1 0; justify-content: center; }
  .mc-mode .mc-mode-txt { max-width: 100%; }
  .mc-mode .mc-mode-txt > span:first-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mc-context-tabs { margin-bottom: 12px; }
}

@media (max-width: 360px) {
  .mc-topbar { padding-left: 6px; padding-right: 6px; }
  .mc-brand-name { max-width: 116px; font-size: 10px; }
  .mc-header-tools .mc-icon-btn { width: 38px; height: 38px; }
  .mc-user-chip { width: 38px; min-width: 38px; min-height: 38px; }
  .mc-user-chip > .msgr-avatar { width: 30px; height: 30px; }
  .mc-chat-actions .mc-icon-btn { width: 36px; height: 36px; }
  .mc-composer { padding-left: 7px; padding-right: 7px; }
}
