/* ==========================================================================
   PULSE MESSENGER — LIQUID GLASS DESIGN SYSTEM v6.0.0
   Clean, Minimalist, High-Performance, Zero-Clutter Architecture
   ========================================================================== */

:root {
  --bg: #07090e;
  --bg-subtle: #0d121d;
  --surface: rgba(18, 24, 38, 0.7);
  --surface-elevated: rgba(24, 32, 52, 0.92);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-active: rgba(99, 102, 241, 0.16);
  --border: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-active: rgba(99, 102, 241, 0.4);
  
  --p: #6366f1;
  --p-hover: #4f46e5;
  --p-glow: rgba(99, 102, 241, 0.35);
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --cyan: #06b6d4;
  --emerald: #10b981;
  --rose: #ef4444;
  
  --tx: #f8fafc;
  --tx-sub: #94a3b8;
  --mut: #64748b;
  
  --msg-in-bg: rgba(26, 35, 56, 0.7);
  --msg-in-border: rgba(255, 255, 255, 0.08);
  --msg-out-bg: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  --msg-out-tx: #ffffff;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-subtle: #ffffff;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-elevated: #ffffff;
  --surface-hover: rgba(0, 0, 0, 0.05);
  --surface-active: rgba(99, 102, 241, 0.12);
  --border: rgba(0, 0, 0, 0.12);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-active: rgba(99, 102, 241, 0.4);
  
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  
  --tx: #0f172a;
  --tx-sub: #334155;
  --mut: #64748b;
  
  --msg-in-bg: #ffffff;
  --msg-in-border: rgba(0, 0, 0, 0.1);
  --msg-out-bg: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --msg-out-tx: #ffffff;
}

/* Base Reset & Mobile PWA Gesture Lockout */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background-color: var(--bg) !important;
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior-y: none;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
}

img, svg, button {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

input, textarea, [contenteditable="true"], .selectable, .msg-text.selectable {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  -webkit-touch-callout: default !important;
  touch-action: auto !important;
}

/* Universal SVG Constraints */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  pointer-events: none;
}
svg:not([width]):not([height]):not([class*="ic"]) {
  width: 18px;
  height: 18px;
}
.ic10 { width: 10px !important; height: 10px !important; }
.ic12 { width: 12px !important; height: 12px !important; }
.ic14 { width: 14px !important; height: 14px !important; }
.ic16 { width: 16px !important; height: 16px !important; }
.ic18 { width: 18px !important; height: 18px !important; }
.ic20 { width: 20px !important; height: 20px !important; }
.ic24 { width: 24px !important; height: 24px !important; }
.ic28 { width: 28px !important; height: 28px !important; }
.ic32 { width: 32px !important; height: 32px !important; }
svg[class*="ic"] { display: inline-block; vertical-align: middle; flex-shrink: 0; }


/* ==========================================================================
   BUTTONS, INPUTS & CONTROLS
   ========================================================================== */
button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  font-size: 15.5px;
  font-weight: 600;
  min-height: 46px;
  transition: all 0.2s var(--ease);
  width: 100%;
}
.btn.primary {
  background: linear-gradient(135deg, var(--p), var(--cyan));
  color: #ffffff;
  box-shadow: 0 4px 14px var(--p-glow);
}
.btn.primary:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--p-glow);
}
.btn.primary:active:not(:disabled) {
  transform: translateY(0);
}
.btn.ghost {
  background: var(--surface-hover);
  color: var(--tx);
  border: 1px solid var(--border);
}
.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-active);
}
.btn.danger {
  background: var(--rose);
  color: #ffffff;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Icon Buttons */
.ibtn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-sub);
  background: transparent;
  transition: all 0.18s var(--ease);
  flex-shrink: 0;
}
.ibtn:hover {
  color: var(--tx);
  background: var(--surface-hover);
}
.ibtn:active {
  transform: scale(0.94);
}
.ibtn.primary {
  background: var(--p);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--p-glow);
}
.ibtn.primary:hover {
  background: var(--p-hover);
  transform: scale(1.05);
}

/* Input Fields */
input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--tx);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  outline: none;
  transition: all 0.2s var(--ease);
}
input:focus, textarea:focus {
  border-color: var(--p);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
input::placeholder, textarea::placeholder {
  color: var(--mut);
}

select {
  font-family: inherit;
  font-size: 15px;
  color: var(--tx);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  outline: none;
}
select option {
  background: var(--bg-subtle);
  color: var(--tx);
}

/* ==========================================================================
   AVATARS & STATUS
   ========================================================================== */
.aw {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.ava {
  width: 44px;
  height: 44px;
  border-radius: 50% !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  aspect-ratio: 1 / 1 !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.ava img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  display: block !important;
}
.ava.lg {
  width: 68px;
  height: 68px;
  font-size: 24px;
}
.ava.sm {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg);
}
.dot.on { background-color: var(--emerald); }
.dot.off { background-color: var(--mut); }

/* ==========================================================================
   APP SCREENS & SHELL
   ========================================================================== */
.screen {
  position: fixed;
  inset: 0;
  display: none !important;
  width: 100%;
  height: 100%;
}
.screen.active {
  display: flex !important;
}

/* Auth Screen */
#auth-screen {
  background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.18) 0%, transparent 60%), var(--bg);
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-elevated);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.3s var(--ease);
}
.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-brand h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--tx);
}
.auth-brand p {
  font-size: 13.5px;
  color: var(--tx-sub);
  margin-top: 4px;
}

/* Tabs */
.tabs {
  display: flex;
  background: var(--surface-hover);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
}
.tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mut);
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease);
}
.tab.active {
  background: var(--p);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--p-glow);
}

.aform {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ig {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ig label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tx-sub);
}
.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--tx-sub);
  cursor: pointer;
}
.chk input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--p);
}
.chk a {
  color: var(--p);
  text-decoration: none;
}
.chk a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   MAIN SHELL & TWO-COLUMN LAYOUT
   ========================================================================== */
.shell {
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: var(--visual-viewport-height, 100dvh);
  display: flex;
  overflow: hidden;
  padding: 10px;
  gap: 10px;
  background: var(--bg);
}

/* Sidebar */
.side {
  width: 350px;
  min-width: 300px;
  max-width: 400px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  backdrop-filter: blur(35px) saturate(180%);
  -webkit-backdrop-filter: blur(35px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

/* Sidebar Top */
.side-head {
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-brand h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--tx);
}

/* Search Bar */
.side-search {
  padding: 10px 14px;
  flex-shrink: 0;
}
.side-search input {
  padding: 9px 14px;
  font-size: 13.5px;
  border-radius: 999px;
}

/* Chat List */
.clist {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.citem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s var(--ease);
  position: relative;
}
.citem:hover {
  background: var(--surface-hover);
}
.citem.active {
  background: var(--surface-active);
  border: 1px solid var(--border-active);
}
.cinfo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ctop {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cname {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ctime {
  font-size: 12.5px;
  color: var(--mut);
  flex-shrink: 0;
}
.cbot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.cprev {
  font-size: 14px;
  color: var(--tx-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.unread-badge {
  background: var(--p);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* User Profile Chip (Bottom of Sidebar) */
.side-user {
  margin-top: auto;
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.user-chip:hover {
  background: var(--surface-hover);
}
.user-info {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-status {
  font-size: 11.5px;
  color: var(--emerald);
}

/* ==========================================================================
   CHAT AREA & ACTIVE CONVERSATION
   ========================================================================== */
.area {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  backdrop-filter: blur(35px) saturate(180%);
  -webkit-backdrop-filter: blur(35px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-width: 0;
}

/* Placeholder */
.empty-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--mut);
  text-align: center;
  padding: 24px;
}
.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--p);
}
.empty-view h3 {
  font-size: 18px;
  color: var(--tx);
}
.empty-view p {
  font-size: 13.5px;
  max-width: 280px;
}

/* Active Chat View */
.cview {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Chat Header */
.chead {
  padding: 12px 18px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
  gap: 12px;
}
.chead-left {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.chead-meta {
  flex: 1;
  min-width: 0;
}
.chead-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chead-status {
  font-size: 12px;
  color: var(--mut);
}
.chead-acts {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Message Feed */
.msgs {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Date Divider */
.date-sep {
  align-self: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-weight: 600;
  color: var(--mut);
  margin: 8px 0;
}

/* Message Rows */
.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 72%;
  position: relative;
  animation: fadeIn 0.15s var(--ease);
}
.msg-row.out {
  align-self: flex-end;
  align-items: flex-end;
}
.msg-row.in {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-sender {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 4px;
  margin-left: 6px;
  cursor: pointer;
}

.msg-bubble {
  padding: 11px 16px;
  font-size: 15.5px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}
.msg-text {
  font-size: 15.5px;
  line-height: 1.5;
}
.msg-row.in .msg-bubble {
  background: var(--msg-in-bg);
  border: 1px solid var(--msg-in-border);
  color: var(--tx);
  border-radius: 18px 18px 18px 4px;
}
.msg-row.out .msg-bubble {
  background: var(--msg-out-bg);
  color: var(--msg-out-tx);
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 14px var(--p-glow);
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 12px;
  opacity: 0.75;
  margin-top: 4px;
}

/* Quoted Reply */
.msg-reply {
  padding: 6px 10px;
  border-left: 3px solid var(--cyan);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 12px;
}
.msg-reply-sender {
  font-weight: 700;
  color: var(--cyan);
}
.msg-reply-text {
  color: var(--tx-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Image Attachment inside Bubble */
.msg-img-box {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 6px;
  max-width: 320px;
  cursor: pointer;
}
.msg-img-box img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

/* File Attachment inside Bubble */
.msg-file-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 4px;
}

/* Typing Indicator */
.typing-bar {
  padding: 4px 20px;
  font-size: 12px;
  color: var(--cyan);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Reply Preview Bar above Composer */
.reply-preview-bar {
  padding: 8px 18px;
  background: var(--surface-hover);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Chat Composer */
.composer {
  padding: 10px 14px;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: auto;
}
.composer input#message-input {
  flex: 1;
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 15.5px;
}

/* ==========================================================================
   MODALS & FLOATING PANELS
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s var(--ease);
}
.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-elevated);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: slideUp 0.25s var(--ease);
}
.modal-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-head h3 {
  font-size: 17px;
  font-weight: 700;
}
.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Context Menu */
.ctx-menu {
  position: fixed;
  z-index: 10000;
  background: var(--surface-elevated);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
  animation: fadeIn 0.15s var(--ease);
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--tx);
  cursor: pointer;
  transition: background 0.12s;
}
.ctx-item:hover {
  background: var(--surface-hover);
}
.ctx-item.danger {
  color: var(--rose);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  object-fit: contain;
}

/* Call Modal */
.call-card {
  text-align: center;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.call-ava-pulse {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  animation: pulseGlow 2s infinite;
}
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6); }
  70% { box-shadow: 0 0 0 20px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Toast System */
#toasts {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(18, 24, 38, 0.92);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: slideDownToast 0.25s var(--ease);
}
.toast.success { border-color: rgba(16, 185, 129, 0.5); }
.toast.error { border-color: rgba(239, 68, 68, 0.5); }

/* Helpers */
.hidden { display: none !important; }

/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideDownToast {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .shell {
    padding: 0;
    gap: 0;
  }
  .side, .area {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    height: 100% !important;
  }
  .shell:not(.show-chat) .side {
    display: flex !important;
  }
  .shell:not(.show-chat) .area {
    display: none !important;
  }
  .shell.show-chat .side {
    display: none !important;
  }
  .shell.show-chat .area {
    display: flex !important;
  }
  .mobile-back-btn {
    display: inline-flex !important;
  }
}

@media (min-width: 769px) {
  .mobile-back-btn {
    display: none !important;
  }
}

/* ==========================================================================
   SWITCH TOGGLE, ROLE BADGES & CHIPS
   ========================================================================== */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--surface-hover);
  border: 1px solid var(--border);
  transition: 0.2s ease;
  border-radius: 999px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: 0.2s ease;
  border-radius: 50%;
}
.switch input:checked + .slider {
  background-color: var(--p);
  border-color: var(--p);
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
}

.role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}
.role-badge.owner {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.role-badge.admin {
  background: rgba(6, 182, 212, 0.18);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
}
.role-badge.member {
  background: rgba(255, 255, 255, 0.06);
  color: var(--mut);
}

.user-chip-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--tx);
}
.user-chip-mini span.chip-remove {
  cursor: pointer;
  color: var(--mut);
  font-weight: 700;
}
.user-chip-mini span.chip-remove:hover {
  color: var(--rose);
}

/* ==========================================================================
   PINNED MESSAGES BAR
   ========================================================================== */
.pinned-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.08);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(16px);
  z-index: 10;
  transition: all 0.2s ease;
}

/* ==========================================================================
   VOICE RECORDING LIVE BAR
   ========================================================================== */
.voice-record-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(25px);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.voice-record-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rose);
  animation: recPulse 1.2s infinite ease-in-out;
}

@keyframes recPulse {
  0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6); }
  70% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 0 8px rgba(244, 63, 94, 0); }
  100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.voice-timer {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  min-width: 44px;
}

.voice-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  height: 24px;
}

.voice-waveform span {
  display: block;
  width: 3px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: waveAnim 1s ease-in-out infinite alternate;
}

.voice-waveform span:nth-child(2) { animation-delay: 0.15s; }
.voice-waveform span:nth-child(3) { animation-delay: 0.3s; }
.voice-waveform span:nth-child(4) { animation-delay: 0.45s; }
.voice-waveform span:nth-child(5) { animation-delay: 0.6s; }
.voice-waveform span:nth-child(6) { animation-delay: 0.4s; }
.voice-waveform span:nth-child(7) { animation-delay: 0.25s; }
.voice-waveform span:nth-child(8) { animation-delay: 0.1s; }

@keyframes waveAnim {
  0% { height: 6px; opacity: 0.4; }
  100% { height: 22px; opacity: 1; }
}

.voice-send-action-btn {
  padding: 8px 18px !important;
  font-size: 13px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* ==========================================================================
   VOICE MESSAGE PLAYER IN FEED
   ========================================================================== */
.voice-msg-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
  min-width: 220px;
  max-width: 320px;
}

.voice-play-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--accent, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.voice-play-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transform: translateX(1px);
}

.voice-play-btn:hover {
  transform: scale(1.06);
  background: var(--accent-hover, #1d4ed8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.voice-play-btn:active {
  transform: scale(0.95);
}

.voice-track-bar {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

[data-theme="dark"] .voice-track-bar {
  background: rgba(255, 255, 255, 0.22);
}

.voice-track-progress {
  height: 100%;
  width: 0%;
  background: #38bdf8;
  border-radius: 999px;
  transition: width 0.1s linear;
}

.voice-duration {
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--tx);
  flex-shrink: 0;
}

/* ==========================================================================
   BLUE THEME FOR VOICE MESSAGES (ALL THEMES - 100% VISIBLE & HIGH CONTRAST)
   ========================================================================== */
.msg-bubble.is-voice {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 18px rgba(30, 64, 175, 0.38) !important;
}

.msg-row.out .msg-bubble.is-voice {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 60%, #60a5fa 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.42) !important;
}

.msg-bubble.is-voice .voice-play-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  color: #1d4ed8 !important;
  border: none !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28), 0 1px 4px rgba(0, 0, 0, 0.12) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease !important;
  flex-shrink: 0 !important;
}

.msg-bubble.is-voice .voice-play-btn svg {
  width: 20px !important;
  height: 20px !important;
  fill: #1d4ed8 !important;
  color: #1d4ed8 !important;
  transform: translateX(1px);
}

.msg-bubble.is-voice .voice-play-btn:hover {
  transform: scale(1.08) !important;
  background: #eff6ff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

.msg-bubble.is-voice .voice-play-btn:active {
  transform: scale(0.95) !important;
}

.msg-bubble.is-voice .voice-track-bar {
  flex: 1 !important;
  height: 8px !important;
  background: rgba(255, 255, 255, 0.32) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 999px !important;
  position: relative !important;
  cursor: pointer !important;
  overflow: hidden !important;
}

.msg-bubble.is-voice .voice-track-progress {
  height: 100% !important;
  background: #38bdf8 !important;
  border-radius: 999px !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.9) !important;
  transition: width 0.1s linear !important;
}

.msg-bubble.is-voice .voice-duration {
  font-size: 13px !important;
  font-weight: 700 !important;
  font-family: var(--font-mono) !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
  flex-shrink: 0 !important;
}

.msg-bubble.is-voice .btn-transcribe {
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
  font-weight: 600 !important;
}

.msg-bubble.is-voice .btn-transcribe:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

.msg-bubble.is-voice .btn-transcribe svg {
  fill: #ffffff !important;
  color: #ffffff !important;
}

.msg-bubble.is-voice .msg-reply {
  background: rgba(0, 0, 0, 0.25) !important;
  border-left: 3px solid #67e8f9 !important;
  color: #ffffff !important;
}

.msg-bubble.is-voice .msg-reply-sender {
  color: #67e8f9 !important;
}

.msg-bubble.is-voice .msg-reply-text {
  color: rgba(255, 255, 255, 0.92) !important;
}

.msg-bubble.is-voice .msg-meta {
  color: rgba(255, 255, 255, 0.88) !important;
}

.msg-bubble.is-voice .msg-meta svg {
  fill: rgba(255, 255, 255, 0.88) !important;
  color: rgba(255, 255, 255, 0.88) !important;
}

.msg-bubble.is-voice .msg-transcription {
  background: rgba(0, 0, 0, 0.26) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-left: 3px solid #38bdf8 !important;
  color: #ffffff !important;
}

.msg-bubble.is-voice .msg-transcription div:first-child {
  color: #67e8f9 !important;
}

.msg-bubble.is-voice .transcription-empty {
  background: rgba(0, 0, 0, 0.32) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #fef08a !important;
}

.msg-bubble.is-voice .transcription-empty .transcribe-retry-btn {
  color: #38bdf8 !important;
}

/* ==========================================================================
   VIDEO CIRCLE NOTE MESSAGE IN FEED
   ========================================================================== */
.video-note-bubble {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  border: 3px solid #2563eb;
  cursor: pointer;
  background: #000;
}

.video-note-bubble video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.video-note-overlay-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.video-note-bubble.playing .video-note-overlay-btn {
  opacity: 0;
}

/* ==========================================================================
   TRANSCRIPTION UI
   ========================================================================== */
.btn-transcribe {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--tx-sub);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-transcribe:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}

.msg-bubble.is-video-note {
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.msg-transcription {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--tx);
  animation: fadeIn 0.2s ease;
}

.msg-row.out .msg-transcription {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 3px solid #ffffff;
  color: #ffffff;
}

.transcription-empty {
  font-size: 12.5px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 6px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================================================
   MESSAGE REACTIONS
   ========================================================================== */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.reaction-pill:hover {
  background: rgba(255, 255, 255, 0.12);
}

.reaction-pill.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
}

.reaction-quick-bar {
  display: none;
  position: absolute;
  top: -36px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  border-radius: 999px;
  padding: 4px 8px;
  gap: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  z-index: 25;
}

.msg:hover .reaction-quick-bar {
  display: flex;
}

.react-emoji-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  transition: transform 0.15s;
}

.react-emoji-btn:hover {
  transform: scale(1.3);
}

/* ==========================================================================
   VIDEO NOTE RECORDER MODAL
   ========================================================================== */
.video-note-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.video-circle-ring {
  width: 250px;
  height: 250px;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.4);
}

.video-circle-ring video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.video-circle-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.circle-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 4;
}

.circle-progress {
  fill: none;
  stroke: var(--rose);
  stroke-width: 4;
  stroke-dasharray: 295.3;
  stroke-dashoffset: 295.3;
  transition: stroke-dashoffset 0.1s linear;
}

.video-note-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.video-note-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.circle-act-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--tx);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.circle-act-btn:hover {
  transform: scale(1.08);
}

.circle-act-btn.danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.circle-send-btn {
  padding: 10px 22px !important;
  border-radius: 999px !important;
  font-size: 13.5px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* ==========================================================================
   INCOMING CALL MODAL
   ========================================================================== */
.incoming-call-card {
  max-width: 360px;
  text-align: center;
  padding: 32px 24px;
  background: var(--surface);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.incoming-call-buttons {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-top: 28px;
}

.incoming-call-action-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.call-action-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tx);
  letter-spacing: -0.2px;
}

.call-btn-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.call-btn-circle svg {
  width: 28px !important;
  height: 28px !important;
  fill: #ffffff !important;
  color: #ffffff !important;
}

.call-btn-circle:hover {
  transform: scale(1.08);
}

.call-btn-circle.success {
  background: var(--emerald);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.5);
}

.call-btn-circle.danger {
  background: var(--rose);
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.5);
}

/* ==========================================================================
   WEBRTC CALL 16:9 WIDESCREEN
   ========================================================================== */
.call-modal-container {
  width: 100%;
  max-width: 860px;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
  transition: max-width 0.3s ease;
}

.call-modal-container.portrait-mode {
  max-width: 440px !important;
}

.call-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.call-status-pill {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--cyan);
}

.call-video-widescreen {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  background: #020408;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: aspect-ratio 0.3s ease, max-height 0.3s ease;
}

.call-video-widescreen.portrait {
  aspect-ratio: 9 / 16 !important;
  max-height: 72vh;
}

.call-video-widescreen.landscape {
  aspect-ratio: 16 / 9 !important;
  max-height: 72vh;
}

.call-video-widescreen video#remote-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.call-video-widescreen video#local-video {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 160px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  z-index: 5;
  transition: all 0.3s ease;
}

.call-video-widescreen video#local-video.portrait {
  width: 90px;
  aspect-ratio: 9 / 16;
}

.call-audio-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.call-pulse-rings span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, 0.35);
  animation: ringPulse 2s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.call-pulse-rings span:nth-child(2) { animation-delay: 0.6s; }
.call-pulse-rings span:nth-child(3) { animation-delay: 1.2s; }

@keyframes ringPulse {
  0% { width: 100px; height: 100px; opacity: 0.8; }
  100% { width: 280px; height: 280px; opacity: 0; }
}

.call-controls-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.call-dock-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.call-dock-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.08);
}

.call-dock-btn.active {
  background: var(--accent);
  border-color: var(--accent);
}

.call-dock-btn.danger {
  background: var(--rose);
  border-color: var(--rose);
}

/* ==========================================================================
   MULTI-DEVICE SESSIONS UI
   ========================================================================== */
.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  gap: 12px;
}

.session-badge-current {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.session-kick-btn {
  background: none;
  border: none;
  color: var(--rose);
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.15s;
}

.session-kick-btn:hover {
  opacity: 0.8;
}

.e2ee-shield {
  display: inline-flex;
  align-items: center;
  color: var(--emerald);
}

.typing-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 6px;
  animation: typingGlow 1s infinite alternate;
}

@keyframes typingGlow {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* ==========================================================================
   PERSISTENT SHIMMERING ACTIVE CALL BAR (TOP OF SCREEN)
   ========================================================================== */
.call-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #8b5cf6, #ec4899, #4f46e5);
  background-size: 300% 100%;
  animation: iridescentShift 5s linear infinite;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  color: #ffffff;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.call-banner.hidden {
  display: none !important;
}
@keyframes iridescentShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
.call-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.call-banner-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseDot 1.5s infinite;
  flex-shrink: 0;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}
.call-banner-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.call-banner-name {
  font-weight: 700;
  font-size: 14.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.call-banner-timer {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
}
.call-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.call-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.call-banner-btn:hover {
  background: rgba(0, 0, 0, 0.4);
}
.call-banner-btn.primary {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
}
.call-banner-btn.primary:hover {
  background: rgba(255, 255, 255, 0.35);
}
.call-banner-btn.danger {
  background: #ef4444;
}
.call-banner-btn.danger:hover {
  background: #dc2626;
}

