:root {
  /* Colors - Enhanced palette */
  --bg0: #030014;
  --bg1: #070320;
  --bg2: #0a0528;

  --text: rgba(255, 255, 255, 0.95);
  --muted: rgba(255, 255, 255, 0.68);
  --muted2: rgba(255, 255, 255, 0.48);

  --stroke: rgba(255, 255, 255, 0.14);
  --stroke2: rgba(255, 255, 255, 0.22);
  --stroke3: rgba(255, 255, 255, 0.08);

  --panelA: rgba(255, 255, 255, 0.09);
  --panelB: rgba(255, 255, 255, 0.05);

  /* Brand colors */
  --p1: #a855f7;
  --p2: #7c3aed;
  --p3: #6d28d9;
  --c1: #22d3ee;
  --c2: #06b6d4;
  --g1: #34d399;
  --g2: #10b981;
  --r1: #ff4d6d;
  --y1: #fbbf24;

  /* Radii */
  --r: 24px;
  --r-sm: 16px;
  --r-lg: 32px;
  --pill: 999px;

  /* Shadows - Enhanced */
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 8px 16px rgba(0, 0, 0, 0.4);
  --shadowSoft: 0 12px 24px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
  --shadowHeavy: 0 32px 64px rgba(0, 0, 0, 0.8), 0 16px 32px rgba(0, 0, 0, 0.5);
  --topEdge: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glow: 0 0 20px rgba(168, 85, 247, 0.4), 0 0 40px rgba(34, 211, 238, 0.2);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* App Container */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at top, var(--bg1), var(--bg0));
  position: relative;
  overflow: hidden;
}

/* ===============================================
   BACKGROUND - Particles, Orbs, Mesh, Grain
   =============================================== */
.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

/* Particle Canvas */
.particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.4;
}

/* Animated Orbs */
.orb {
  position: absolute;
  width: 720px;
  height: 720px;
  border-radius: 40% 60% 55% 45% / 45% 55% 50% 50%;
  filter: blur(80px);
  opacity: 0.5;
  mix-blend-mode: screen;
  animation: drift 20s ease-in-out infinite;
  will-change: transform;
}

.o1 {
  left: -280px;
  top: -260px;
  background: radial-gradient(circle at 35% 35%, rgba(168, 85, 247, 0.95), transparent 65%),
              radial-gradient(circle at 70% 70%, rgba(34, 211, 238, 0.75), transparent 65%);
  animation-delay: 0s;
}

.o2 {
  right: -320px;
  top: 60px;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle at 40% 40%, rgba(34, 211, 238, 0.9), transparent 65%),
              radial-gradient(circle at 65% 65%, rgba(124, 58, 237, 0.9), transparent 65%);
  animation-delay: -6s;
  animation-duration: 24s;
}

.o3 {
  left: 8%;
  bottom: -360px;
  width: 860px;
  height: 860px;
  background: radial-gradient(circle at 40% 40%, rgba(52, 211, 153, 0.6), transparent 65%),
              radial-gradient(circle at 70% 70%, rgba(168, 85, 247, 0.6), transparent 68%);
  opacity: 0.35;
  animation-delay: -12s;
  animation-duration: 28s;
}

@keyframes drift {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(30px, -20px) rotate(5deg) scale(1.05);
  }
  50% {
    transform: translate(-20px, 30px) rotate(-5deg) scale(0.95);
  }
  75% {
    transform: translate(20px, -30px) rotate(7deg) scale(1.02);
  }
}

/* Mesh Gradient overlay */
.meshGradient {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(at 20% 30%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(at 80% 20%, rgba(34, 211, 238, 0.12) 0%, transparent 50%),
    radial-gradient(at 40% 70%, rgba(52, 211, 153, 0.1) 0%, transparent 50%),
    radial-gradient(at 90% 80%, rgba(124, 58, 237, 0.12) 0%, transparent 50%);
  opacity: 0.6;
  animation: meshShift 15s ease-in-out infinite;
}

@keyframes meshShift {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.8; }
}

/* Film grain */
.grain {
  position: absolute;
  inset: -100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  opacity: 0.09;
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: grainMove 8s steps(10) infinite;
}

@keyframes grainMove {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -5%); }
  20% { transform: translate(-10%, 5%); }
  30% { transform: translate(5%, -10%); }
  40% { transform: translate(-5%, 15%); }
  50% { transform: translate(-15%, 5%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 15%); }
  80% { transform: translate(-10%, 10%); }
  90% { transform: translate(10%, -5%); }
}

/* ===============================================
   TOPBAR
   =============================================== */
.topbar {
  flex: 0 0 auto;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 10;
  animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--pill);
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadowSoft), var(--topEdge);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.brand:hover {
  transform: translateY(-2px);
  border-color: var(--stroke2);
  box-shadow: var(--shadow), var(--topEdge), var(--glow);
}

.brand:hover::before {
  opacity: 1;
}

.mark {
  width: 18px;
  height: 18px;
  border-radius: 9px;
  position: relative;
  background: conic-gradient(from 135deg, var(--c1), var(--p1), var(--p2), var(--c1));
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.06), 0 4px 12px rgba(168, 85, 247, 0.6);
  animation: markSpin 8s linear infinite;
}

@keyframes markSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.markInner {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.9), transparent 60%);
  animation: markPulse 2s ease-in-out infinite;
}

@keyframes markPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.name {
  font-weight: 1000;
  font-size: 15px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--text), var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pulse {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--g1);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulseRing 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

/* Top Right Controls */
.topRight {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Mini Button */
.miniBtn {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: var(--text);
  padding: 11px 16px;
  border-radius: var(--pill);
  font-weight: 950;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadowSoft), var(--topEdge);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.miniBtn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.miniBtn:hover {
  transform: translateY(-2px);
  border-color: var(--stroke2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  box-shadow: var(--shadow), var(--topEdge);
}

.miniBtn:hover::before {
  opacity: 1;
}

.miniBtn:active {
  transform: translateY(0px);
}

.miniBtn svg {
  stroke-width: 2.5;
  transition: transform 0.3s ease;
}

.miniBtn:hover svg {
  transform: scale(1.1);
}

/* Pill */
.pill {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadowSoft), var(--topEdge);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pill:hover {
  transform: translateY(-1px);
  border-color: var(--stroke2);
  box-shadow: var(--shadow), var(--topEdge);
}

.pillLabel {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 950;
  color: var(--muted2);
}

.pillValue {
  font-weight: 1000;
  font-size: 14px;
  letter-spacing: 0.3px;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  background: linear-gradient(135deg, var(--text), var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Shimmer effect for loading */
.shimmer {
  background: linear-gradient(90deg, var(--muted2) 25%, var(--muted) 50%, var(--muted2) 75%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.pillCopy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--pill);
  font-weight: 1000;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.pillCopy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pillCopy:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.pillCopy:hover::before {
  opacity: 1;
}

.pillCopy:active {
  transform: translateY(0px);
}

.pillCopy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pillCopy:disabled:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

/* Connection Status */
.conn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(20px);
  box-shadow: var(--shadowSoft), var(--topEdge);
  transition: all 0.3s ease;
}

.led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.05);
  position: relative;
  transition: all 0.4s ease;
}

.ledCore {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.9), transparent);
  opacity: 0.6;
}

.connText {
  font-weight: 950;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.3s ease;
}

/* ===============================================
   MAIN LAYOUT
   =============================================== */
.main {
  flex: 1 1 auto;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 16px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  min-height: 0;
  height: 100%;
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===============================================
   SIDEBAR - Online Users
   =============================================== */
.side {
  border-radius: var(--r);
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, #0c0c1a, #080814);
  box-shadow: var(--shadow), var(--topEdge);
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.side::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.side:hover {
  transform: translateY(-3px);
  border-color: var(--stroke2);
  box-shadow: var(--shadowHeavy), var(--topEdge), 0 0 40px rgba(168, 85, 247, 0.15);
}

.side:hover::before {
  opacity: 1;
}

/* Side Header */
.sideHead {
  padding: 18px 18px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}

.sideTitle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 1000;
  font-size: 17px;
  color: var(--text);
}

.sideTitle svg {
  color: var(--p1);
  filter: drop-shadow(0 2px 4px rgba(168, 85, 247, 0.4));
}

.sideStats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 11px;
  border-radius: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 900;
  font-size: 11.5px;
  transition: all 0.3s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.chip svg {
  opacity: 0.7;
}

/* Side List */
.sideList {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sideEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--r-sm);
  color: var(--muted2);
  font-weight: 950;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  animation: fadeIn 0.5s ease;
}

.sideEmpty svg {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.sideEmpty p {
  font-size: 13px;
  line-height: 1.4;
}

/* User Pill */
.userPill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), var(--topEdge);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  animation: slideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.userPill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.userPill:hover {
  transform: translateY(-2px) translateX(2px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(34, 211, 238, 0.2);
}

.userPill:hover::before {
  opacity: 1;
}

.userLeft {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

/* User Flag */
.userFlag {
  width: 20px;
  height: 14px;
  flex: 0 0 auto;
  display: block;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  opacity: 0.95;
}

.userPill:hover .userFlag {
  transform: translateY(-2px) scale(1.05);
  filter: saturate(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.userFlag.isLoading {
  opacity: 0.5;
  filter: grayscale(0.4) blur(1px);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.7; }
}

.userFlag.isMissing {
  opacity: 0.2;
  filter: grayscale(1);
}

.userIp {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 1000;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.userDev {
  color: var(--muted2);
  font-weight: 850;
  font-size: 11px;
  text-align: right;
  max-width: 65%;
  white-space: normal;
  line-height: 1.3;
  overflow: visible;
}

/* ===============================================
   CHAT SECTION
   =============================================== */
.chat {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chatCard {
  height: 100%;
  min-height: 0;
  border-radius: var(--r);
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow), var(--topEdge);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.chatCard::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.chatCard:hover {
  transform: translateY(-3px);
  border-color: var(--stroke2);
  box-shadow: var(--shadowHeavy), var(--topEdge), 0 0 40px rgba(168, 85, 247, 0.15);
}

.chatCard:hover::before {
  opacity: 1;
}

/* Chat Header */
.chatHead {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}

.chatTitleWrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chatTitle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 1000;
  font-size: 17px;
  color: var(--text);
}

.chatTitle svg {
  color: var(--c1);
  filter: drop-shadow(0 2px 4px rgba(34, 211, 238, 0.4));
}

.chatSub {
  color: var(--muted2);
  font-weight: 900;
  font-size: 12px;
}

.adminBadgeWrap {
  flex-shrink: 0;
}

.adminBadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--pill);
  border: 1px solid rgba(255, 77, 109, 0.4);
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.2), rgba(255, 77, 109, 0.08));
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.95);
  font-weight: 1000;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(255, 77, 109, 0.3), var(--topEdge);
  animation: adminPulse 2s ease-in-out infinite;
}

@keyframes adminPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(255, 77, 109, 0.3), var(--topEdge);
  }
  50% {
    box-shadow: 0 4px 20px rgba(255, 77, 109, 0.5), var(--topEdge), 0 0 20px rgba(255, 77, 109, 0.3);
  }
}

.adminBadge::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 50%),
              linear-gradient(135deg, rgba(255, 77, 109, 0.95), rgba(168, 85, 247, 0.8));
  box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.15);
  transform: rotate(15deg);
  animation: adminBadgeSpin 8s linear infinite;
}

@keyframes adminBadgeSpin {
  from { transform: rotate(15deg); }
  to { transform: rotate(375deg); }
}

/* Messages Container */
.msgs {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 20px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.msgsEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  padding: 40px 20px;
  color: var(--muted2);
  text-align: center;
  animation: fadeIn 0.6s ease;
}

.msgsEmpty svg {
  animation: float 3s ease-in-out infinite;
}

.msgsEmpty p {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
  max-width: 300px;
}

/* Message */
.msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 100%;
  animation: messageSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bubble {
  flex: 1 1 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), var(--topEdge);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.bubble::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bubble:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.3);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(34, 211, 238, 0.15);
}

.bubble:hover::before {
  opacity: 1;
}

/* Message Meta */
.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.sender {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

/* Presence Dot */
.presDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 77, 109, 0.95);
  box-shadow: 0 0 0 6px rgba(255, 77, 109, 0.2);
  flex: 0 0 auto;
  transition: all 0.4s ease;
  position: relative;
}

.presDot::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 77, 109, 0.6);
  animation: presencePing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0;
}

@keyframes presencePing {
  75%, 100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.presDot.online {
  background: rgba(52, 211, 153, 0.95);
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.2), 0 0 12px rgba(52, 211, 153, 0.4);
}

.presDot.online::after {
  border-color: rgba(52, 211, 153, 0.6);
}

.senderIp {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 1000;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.senderDev {
  color: var(--muted2);
  font-weight: 850;
  font-size: 10.5px;
  white-space: normal;
  line-height: 1.3;
  max-width: 60%;
  text-align: right;
  overflow: visible;
}

/* Message Text */
.text {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 850;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  position: relative;
  z-index: 1;
}

/* Delete Button */
.delBtn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 11px;
  border-radius: 12px;
  font-weight: 1000;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.delBtn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.delBtn:hover {
  opacity: 1;
  transform: translateY(-1px);
  background: rgba(255, 77, 109, 0.15);
  border-color: rgba(255, 77, 109, 0.4);
  box-shadow: 0 4px 12px rgba(255, 77, 109, 0.3);
}

.delBtn:hover::before {
  opacity: 1;
}

.delBtn:active {
  transform: translateY(0px);
}

/* ===============================================
   COMPOSER
   =============================================== */
.composer {
  flex: 0 0 auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(10px);
}

.composerInner {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

/* Input */
.input {
  flex: 1 1 auto;
  min-width: 0;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 20px;
  padding: 13px 16px;
  font-weight: 900;
  font-size: 14px;
  line-height: 1.5;
  max-height: 180px;
  overflow-y: auto;
  outline: none;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.input::placeholder {
  color: var(--muted2);
}

.input:focus {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.2), var(--topEdge);
}

/* Send Button */
.send {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  border-radius: var(--pill);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), var(--topEdge);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.sendFace {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--pill);
  color: rgba(10, 10, 20, 0.98);
  font-weight: 1000;
  font-size: 14px;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(168, 85, 247, 0.85), rgba(34, 211, 238, 0.75));
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.sendFace svg {
  transition: transform 0.3s ease;
}

.send:hover .sendFace svg {
  transform: translateX(2px) rotate(-10deg);
}

.sendGlow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.4), transparent 55%),
              radial-gradient(circle at 60% 70%, rgba(34, 211, 238, 0.35), transparent 60%),
              radial-gradient(circle at 30% 80%, rgba(168, 85, 247, 0.3), transparent 65%);
  filter: blur(20px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.sendRipple {
  position: absolute;
  inset: 0;
  border-radius: var(--pill);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3), transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: all 0.5s ease;
  pointer-events: none;
  z-index: 1;
}

.send:hover {
  transform: translateY(-3px);
  filter: saturate(1.1) brightness(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 40px rgba(168, 85, 247, 0.3);
}

.send:hover .sendGlow {
  opacity: 1;
}

.send:active {
  transform: translateY(0px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), var(--topEdge);
}

.send:active .sendRipple {
  opacity: 1;
  transform: scale(1);
  transition: all 0.3s ease;
}

.send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.send:disabled:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), var(--topEdge);
}

/* ===============================================
   FOOTER
   =============================================== */
.footer {
  flex: 0 0 auto;
  padding: 12px 20px 20px;
  display: flex;
  justify-content: center;
}

.footerInner {
  max-width: 1320px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted2);
  font-weight: 900;
  font-size: 12.5px;
}

.footerDot {
  opacity: 0.5;
}

/* ===============================================
   TOAST NOTIFICATION
   =============================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 12, 28, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), var(--topEdge), 0 0 30px rgba(168, 85, 247, 0.2);
  color: rgba(255, 255, 255, 0.95);
  font-weight: 1000;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  min-width: 200px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toastIcon {
  flex-shrink: 0;
  color: var(--g1);
  filter: drop-shadow(0 2px 4px rgba(52, 211, 153, 0.5));
  animation: toastIconPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIconPop {
  0% {
    transform: scale(0.5) rotate(-45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.toastText {
  flex: 1;
}

/* ===============================================
   BACKDROP (Mobile Drawer)
   =============================================== */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
  z-index: 15;
}

.backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* ===============================================
   RESPONSIVE - MOBILE & TABLET
   =============================================== */

/* Tablet */
@media (max-width: 1200px) {
  .main {
    grid-template-columns: 340px 1fr;
    gap: 14px;
  }
}

/* Mobile */
@media (max-width: 980px) {
  .topbar {
    padding: 14px 16px;
    flex-wrap: wrap;
  }

  .topRight {
    gap: 10px;
  }

  .pill {
    order: 3;
    width: 100%;
  }

  .main {
    grid-template-columns: 1fr;
    padding: 0 16px 12px;
    gap: 12px;
  }

  .miniBtn {
    display: inline-flex;
  }

  .side {
    position: fixed;
    top: 80px;
    bottom: 90px;
    left: 16px;
    width: min(360px, calc(100vw - 32px));
    z-index: 20;
    transform: translateX(-110%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    /* Completely solid background - NO blur, NO transparency */
    background: linear-gradient(135deg, #0f0f1f, #0a0a16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .side.open {
    transform: translateX(0);
  }

  .chatCard {
    height: 100%;
  }

  .composer {
    padding: 14px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .msgs {
    padding: 14px 16px;
  }

  .chatHead {
    padding: 16px 16px 12px;
  }

  .sideHead {
    padding: 16px 16px 12px;
  }

  .footer {
    padding: 10px 16px 16px;
  }
}

@media (max-width: 640px) {
  .brand {
    padding: 10px 14px;
    gap: 10px;
  }

  .mark {
    width: 16px;
    height: 16px;
  }

  .name {
    font-size: 14px;
  }

  .pill {
    padding: 10px 14px;
  }

  .pillValue {
    font-size: 13px;
  }

  .conn {
    padding: 10px 14px;
  }

  .miniBtn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .chatTitle,
  .sideTitle {
    font-size: 16px;
  }

  .chatSub {
    font-size: 11px;
  }

  .input {
    font-size: 13.5px;
    padding: 12px 14px;
  }

  .sendFace {
    padding: 12px 18px;
    font-size: 13px;
  }

  .bubble {
    padding: 12px 14px;
  }

  .text {
    font-size: 13.5px;
  }

  .userPill {
    padding: 11px 12px;
  }

  .footerInner {
    font-size: 11.5px;
  }
}

/* Landscape mobile */
@media (max-width: 980px) and (max-height: 600px) {
  .side {
    top: 70px;
    bottom: 10px;
  }

  .orb {
    opacity: 0.3;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .grain {
    animation: none;
  }

  .orb {
    animation: none;
  }
}