/* ═══════════════════════════════════════════════════════
   TimeOn — Design System
   Premium dark mode with glassmorphism, gradients & motion
   ═══════════════════════════════════════════════════════ */

/* ─── CSS Variables (Liquid Glass Design Tokens) ────── */
:root {
  /* Background */
  --bg-primary: #07070e;
  --bg-secondary: #0d0d18;
  --bg-tertiary: #141424;
  --bg-elevated: rgba(24, 24, 44, 0.72);

  /* Liquid Glass — Core Surfaces & Refraction */
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.22);
  --glass-hover: rgba(255, 255, 255, 0.085);
  --glass-blur: 22px;

  /* Liquid Glass — Specular Rim & Optical Depth */
  --liquid-shell-bg: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(255, 255, 255, 0.03) 45%,
    rgba(139, 92, 246, 0.05) 100%
  );
  --liquid-plate-bg: linear-gradient(
    145deg,
    rgba(30, 30, 54, 0.72) 0%,
    rgba(16, 16, 30, 0.62) 100%
  );
  --liquid-control-bg: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.075) 0%,
    rgba(255, 255, 255, 0.025) 100%
  );
  --liquid-specular-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.28),
    inset 1px 0 0 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.06),
    0 18px 48px rgba(0, 0, 0, 0.42);
  --liquid-specular-sm:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.05),
    0 6px 20px rgba(0, 0, 0, 0.24);
  --liquid-refraction-filter: url(#liquid-refraction) blur(22px) saturate(175%);
  --liquid-refraction-subtle-filter: url(#liquid-refraction-subtle) blur(16px) saturate(160%);

  /* Accent — purple-blue liquid gradient */
  --accent-1: #8B5CF6;
  --accent-2: #6D28D9;
  --accent-3: #3B82F6;
  --gradient-accent: linear-gradient(135deg, rgba(139, 92, 246, 0.92), rgba(59, 130, 246, 0.88));
  --gradient-accent-hover: linear-gradient(135deg, #9b6ff7, #5b9df7);

  /* Text */
  --text-primary: #f4f4fa;
  --text-secondary: #a0a0ba;
  --text-muted: #666682;
  --text-accent: var(--accent-1);

  /* Surfaces (Message Bubbles) */
  --bubble-own: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(59, 130, 246, 0.14) 100%);
  --bubble-own-border: rgba(167, 139, 250, 0.32);
  --bubble-other: linear-gradient(135deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.03) 100%);
  --bubble-other-border: rgba(255, 255, 255, 0.13);

  /* Status */
  --color-online: #34D399;
  --color-danger: #EF4444;
  --color-warning: #F59E0B;

  /* Spacing */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 50%;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --header-height: 64px;
  --input-height: 72px;
  --sidebar-width: 260px;
}

.liquid-svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, button, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

ul { list-style: none; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ─── Utility ───────────────────────────────────────── */
.hidden { display: none !important; }
.accent { color: var(--accent-1); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.14); }

/* ═══════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════ */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 1000;
}

/* Animated background orbs */
.login-bg-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 12s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-2);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: var(--accent-3);
  bottom: -10%;
  right: -5%;
  animation-delay: -4s;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: #EC4899;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -8s;
  opacity: 0.2;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.1); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* Login card — Liquid Glass Plate */
.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--liquid-plate-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(175%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(175%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-xl);
  box-shadow:
    var(--liquid-specular-shadow),
    0 32px 90px rgba(0, 0, 0, 0.58);
  animation: cardEnter 0.6s var(--ease-out) both;
  overflow: hidden;
}

@supports (backdrop-filter: url(#liquid-refraction)) {
  .login-card {
    backdrop-filter: var(--liquid-refraction-filter);
  }
}

.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.14), transparent 55%);
  pointer-events: none;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
}

.login-logo {
  position: relative;
  text-align: center;
  margin-bottom: 36px;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  font-size: 36px;
  background: var(--gradient-accent);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    0 10px 34px rgba(139, 92, 246, 0.38);
}

.login-logo h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* Form */
.form-group {
  position: relative;
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--liquid-control-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--liquid-specular-sm);
  color: var(--text-primary);
  font-size: 15px;
  transition: all var(--duration-fast) ease;
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder {
  color: var(--text-muted);
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
  border-color: rgba(167, 139, 250, 0.7);
  background: rgba(139, 92, 246, 0.1);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.28),
    0 0 0 3px rgba(139, 92, 246, 0.18);
}

.form-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Color picker */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
  position: relative;
}

.color-option:hover {
  transform: scale(1.15);
}

.color-option.selected {
  border-color: #fff;
  transform: scale(1.2);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.5),
    0 0 14px rgba(255, 255, 255, 0.38);
}

/* Enter button — Liquid Glass Accent Control */
.btn-enter {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: var(--gradient-accent);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.2),
    0 8px 26px rgba(139, 92, 246, 0.28);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all var(--duration-normal) ease;
  position: relative;
  overflow: hidden;
}

.btn-enter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-accent-hover);
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
}

.btn-enter:hover::before {
  opacity: 1;
}

.btn-enter:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.48),
    0 12px 36px rgba(139, 92, 246, 0.42);
}

.btn-enter:active {
  transform: translateY(0);
}

.btn-enter span,
.btn-enter svg {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════
   CHAT SCREEN
   ═══════════════════════════════════════════════════════ */
.chat-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-primary);
  isolation: isolate;
}

.chat-bg-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb-chat-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(109, 40, 217, 0.32), transparent 70%);
  top: -15%;
  left: -8%;
  filter: blur(70px);
  opacity: 0.55;
  animation: orbFloat 16s ease-in-out infinite;
}

.orb-chat-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.28), transparent 70%);
  bottom: -14%;
  right: -6%;
  filter: blur(75px);
  opacity: 0.5;
  animation: orbFloat 18s ease-in-out infinite reverse;
}

.orb-chat-3 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.2), transparent 70%);
  top: 38%;
  left: 46%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 22s ease-in-out infinite;
}

/* ─── Header (Liquid Glass Bar) ─────────────────────── */
.chat-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 20px;
  background: var(--liquid-shell-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(175%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(175%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.16),
    0 8px 30px rgba(0, 0, 0, 0.26);
  z-index: 20;
  flex-shrink: 0;
}

@supports (backdrop-filter: url(#liquid-refraction-subtle)) {
  .chat-header {
    backdrop-filter: var(--liquid-refraction-subtle-filter);
  }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 18px;
  background: var(--gradient-accent);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 14px rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-sm);
}

.chat-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.active-group-name {
  display: block;
  margin-top: -2px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-warning);
  transition: background var(--duration-normal) ease;
}

.status-dot.connected {
  background: var(--color-online);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}

.status-dot.disconnected {
  background: var(--color-danger);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.online-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.14), rgba(52, 211, 153, 0.05));
  border: 1px solid rgba(52, 211, 153, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-online);
}

.online-pulse {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-online);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.btn-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.btn-header:hover {
  background: var(--liquid-control-bg);
  border-color: var(--glass-border);
  box-shadow: var(--liquid-specular-sm);
  color: var(--text-primary);
}

.btn-header-danger:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.32);
  color: var(--color-danger);
}

/* ─── Notification Settings (Liquid Glass Popover) ──── */
.popup-settings {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  right: 104px;
  width: min(360px, calc(100vw - 32px));
  padding: 16px;
  background: var(--liquid-plate-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--liquid-specular-shadow);
  z-index: 60;
}

@supports (backdrop-filter: url(#liquid-refraction)) {
  .popup-settings {
    backdrop-filter: var(--liquid-refraction-filter);
  }
}

.popup-settings-title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
}

.group-notification-settings {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
}
.group-notification-settings label { color: var(--text-secondary); font-size: 12px; }
.group-notification-settings strong { color: var(--text-primary); }
.group-notification-settings select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: rgba(20, 20, 38, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.popup-setting-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.popup-setting-option strong,
.popup-setting-option small {
  display: block;
}

.popup-setting-option strong {
  font-size: 13px;
  font-weight: 600;
}

.popup-setting-option small {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.popup-setting-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-switch {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 100px;
  transition: background var(--duration-fast) ease;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: #fff;
  transition: transform var(--duration-fast) ease;
}

.popup-setting-option input:checked + .toggle-switch {
  background: var(--accent-1);
}

.popup-setting-option input:checked + .toggle-switch::after {
  transform: translateX(18px);
}

.popup-setting-option input:focus-visible + .toggle-switch {
  outline: 2px solid var(--accent-3);
  outline-offset: 3px;
}

.popup-setting-status {
  display: block;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

/* ─── Body ──────────────────────────────────────────── */
.chat-body {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
}

/* ─── Sidebar (Liquid Glass Shell) ──────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(15, 15, 28, 0.48) 100%);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  border-right: 1px solid var(--glass-border);
  box-shadow: inset -1px 0 0 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  transition: all var(--duration-slow) var(--ease-out);
  overflow: hidden;
}

@supports (backdrop-filter: url(#liquid-refraction-subtle)) {
  .sidebar {
    backdrop-filter: var(--liquid-refraction-subtle-filter);
  }
}

.sidebar.collapsed {
  width: 0;
  border-right: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  flex-shrink: 0;
}

.sidebar-header h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.sidebar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--gradient-accent);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.groups-header {
  padding-bottom: 8px;
}

.btn-create-group {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--text-secondary);
  background: var(--liquid-control-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all var(--duration-fast) ease;
}

.btn-create-group:hover {
  color: #fff;
  background: var(--gradient-accent);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 14px rgba(139, 92, 246, 0.35);
}

.groups-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 0 12px 4px;
}

.group-list-item { display: flex; align-items: center; gap: 2px; }

.group-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 8px 10px;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast) ease;
}
.group-list-item .group-item { flex: 1; min-width: 0; }
.group-manage-button,
.group-notification-button {
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.group-manage-button:hover,
.group-notification-button:hover { color: #fff; background: var(--glass-hover); }

.group-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.09);
}

.group-item.active {
  color: #e9d5ff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(59, 130, 246, 0.1));
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 14px rgba(0, 0, 0, 0.18);
}
.group-item-icon { color: var(--accent-1); font-weight: 700; }
.group-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-private-icon { font-size: 11px; }
.group-unread-badge {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 99px;
  color: #fff;
  background: var(--gradient-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.users-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) ease;
  animation: userEnter 0.3s var(--ease-out) both;
}

.user-item:hover {
  background: var(--liquid-control-bg);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.user-avatar::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: var(--color-online);
  border: 2px solid var(--bg-primary);
  border-radius: var(--radius-full);
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-you {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

@keyframes userEnter {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}

/* ─── Messages Container ────────────────────────────── */
.messages-container {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}

.pinned-messages {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.14), rgba(59, 130, 246, 0.08));
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pinned-messages button {
  min-width: 0;
  max-width: 360px;
  overflow: hidden;
  padding: 6px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--liquid-control-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all var(--duration-fast) ease;
}

.pinned-messages button:hover {
  color: var(--text-primary);
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(139, 92, 246, 0.16);
}

/* Scroll to bottom button — Floating Liquid Glass Orb */
.btn-scroll-bottom {
  position: absolute;
  bottom: 14px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--liquid-plate-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border-strong);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-spring);
  z-index: 10;
  box-shadow: var(--liquid-specular-shadow);
}

@supports (backdrop-filter: url(#liquid-refraction)) {
  .btn-scroll-bottom {
    backdrop-filter: var(--liquid-refraction-filter);
  }
}

.btn-scroll-bottom:hover {
  background: var(--gradient-accent);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px) scale(1.05);
}

.scroll-unread-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--bg-primary);
  border-radius: var(--radius-full);
  color: #fff;
  background: #ef4444;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ─── Messages ──────────────────────────────────────── */

.unread-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 14px 0 10px;
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  scroll-margin-top: 12px;
}

.unread-divider::before,
.unread-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, .72));
}

.unread-divider::after { background: linear-gradient(90deg, rgba(139, 92, 246, .72), transparent); }
.unread-divider span { flex: 0 0 auto; }

/* System messages */
.message-system {
  text-align: center;
  padding: 8px 0;
}

.message-system span {
  display: inline-block;
  padding: 5px 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* User messages */
.message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 70%;
  padding: 2px 0;
}

.message-own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-other {
  align-self: flex-start;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.22);
}

/* Liquid Glass Message Bubbles (Specular rim + lightweight translucency) */
.message-bubble {
  padding: 11px 15px;
  border-radius: var(--radius-lg);
  position: relative;
  min-width: 80px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.04),
    0 6px 20px rgba(0, 0, 0, 0.2);
}

.bubble-own {
  background: var(--bubble-own);
  border: 1px solid var(--bubble-own-border);
  border-bottom-right-radius: 4px;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 0 rgba(139, 92, 246, 0.15),
    0 8px 24px rgba(109, 40, 217, 0.16);
}

.bubble-other {
  background: var(--bubble-other);
  border: 1px solid var(--bubble-other-border);
  border-bottom-left-radius: 4px;
}

.message-user {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.message-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.message-link {
  color: #a78bfa;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.message-link:hover { color: #c4b5fd; }

.message-time {
  font-size: 10px;
  color: var(--text-muted);
}

.message-reply-reference {
  display: grid;
  gap: 2px;
  width: 100%;
  margin: 0 0 8px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--accent-1);
  border-radius: 6px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: left;
  cursor: pointer;
}

.message-reply-reference strong { font-size: 11px; color: var(--text-primary); }
.message-reply-reference span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.message-actions { display: flex; align-items: center; gap: 4px; margin-top: 7px; opacity: 0; transition: opacity var(--duration-fast) ease; }
.message:hover .message-actions, .message:focus-within .message-actions { opacity: 1; }
.message-action, .reaction-pill {
  padding: 3px 7px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--liquid-control-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}
.message-action:hover, .reaction-pill:hover, .reaction-pill.is-selected {
  color: var(--text-primary);
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(139, 92, 246, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.message-action-danger:hover { color: #fca5a5; border-color: #ef4444; background: rgba(239, 68, 68, 0.18); }
.message-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.message-more {
  position: relative;
}

.message-more > summary {
  display: grid;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  place-items: center;
  color: var(--text-secondary);
  background: var(--liquid-control-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  list-style: none;
}

.message-more > summary::-webkit-details-marker,
.message-viewers > summary::-webkit-details-marker { display: none; }
.message-more[open] > summary { color: var(--text-primary); border-color: var(--accent-1); background: rgba(139, 92, 246, .22); }

.message-more-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: grid;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-md);
  background: var(--liquid-plate-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--liquid-specular-shadow);
}

@supports (backdrop-filter: url(#liquid-refraction)) {
  .message-more-menu {
    backdrop-filter: var(--liquid-refraction-filter);
  }
}

.message-own .message-more-menu { right: 0; left: auto; }
.message-more-menu .message-action { width: 100%; padding: 7px 9px; border-color: transparent; background: transparent; box-shadow: none; text-align: left; white-space: nowrap; }
.message-more-menu .message-action:hover { background: rgba(139, 92, 246, 0.2); border-color: rgba(167, 139, 250, 0.35); }

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-height: 15px;
  margin-top: 4px;
}

.message-viewers {
  position: relative;
  color: var(--text-muted);
  font-size: 10px;
}

.message-viewers > summary {
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.message-viewers > summary:hover { color: #c4b5fd; }

.message-viewers-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  display: grid;
  min-width: 170px;
  max-height: 180px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--liquid-plate-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--liquid-specular-shadow);
}

@supports (backdrop-filter: url(#liquid-refraction)) {
  .message-viewers-popover {
    backdrop-filter: var(--liquid-refraction-filter);
  }
}

.message-viewers-popover span { display: flex; justify-content: space-between; gap: 12px; padding: 5px 6px; }
.message-viewers-popover small { color: var(--text-muted); font-size: 10px; font-weight: 400; }

.poll-card { display: grid; gap: 8px; min-width: min(340px, 70vw); }
.poll-question { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; }
.poll-options-list { display: grid; gap: 7px; }
.poll-option {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: rgba(15, 23, 42, .32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  text-align: left;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}
.poll-option:disabled { cursor: default; opacity: .85; }
.poll-option.is-selected { border-color: var(--accent-1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 12px rgba(139, 92, 246, 0.2); }
.poll-option-progress { position: absolute; inset: 0 auto 0 0; width: var(--poll-percent); background: linear-gradient(90deg, rgba(139, 92, 246, .28), rgba(59, 130, 246, .2)); pointer-events: none; transition: width .25s ease; }
.poll-option-content { position: relative; display: flex; justify-content: space-between; gap: 12px; }
.poll-option-content strong { flex: 0 0 auto; }
.poll-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--text-muted); font-size: 12px; }
.poll-close { justify-self: start; }
.reaction-pill span { font-size: 10px; }
.message-reply-reference.is-deleted { opacity: 0.65; cursor: default; }
.message-highlight .message-bubble { animation: messageHighlight 1.2s ease; }
@keyframes messageHighlight { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.55); } }
@media (hover: none) { .message-actions { opacity: 1; } }

/* Image messages */
.message-image {
  border-radius: var(--radius-sm);
  max-width: 320px;
  max-height: 300px;
  object-fit: cover;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.message-image:hover {
  opacity: 0.9;
  transform: scale(1.01);
}

/* Audio messages */
.message-audio {
  width: 250px;
  max-width: 100%;
  height: 40px;
  border-radius: var(--radius-sm);
  filter: invert(1) hue-rotate(180deg) brightness(0.8) contrast(0.9);
}

/* Animation */
.animate-in {
  animation: messageIn 0.35s var(--ease-out) both;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

/* ─── Input Bar (Liquid Glass Dock) ─────────────────── */
.input-bar {
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--liquid-shell-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(175%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(175%);
  border-top: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.18),
    0 -8px 30px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

@supports (backdrop-filter: url(#liquid-refraction-subtle)) {
  .input-bar {
    backdrop-filter: var(--liquid-refraction-subtle-filter);
  }
}

.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  flex-shrink: 0;
}

.btn-action:hover {
  background: var(--liquid-control-bg);
  border-color: var(--glass-border);
  box-shadow: var(--liquid-specular-sm);
  color: var(--text-primary);
}

.btn-action:active {
  transform: scale(0.92);
}

.input-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
}

.mention-suggestions {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  width: min(360px, 100%);
  max-height: 190px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-md);
  background: var(--liquid-plate-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--liquid-specular-shadow);
  z-index: 30;
}

@supports (backdrop-filter: url(#liquid-refraction)) {
  .mention-suggestions {
    backdrop-filter: var(--liquid-refraction-filter);
  }
}
.mention-suggestion {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background var(--duration-fast) ease;
}
.mention-suggestion:hover { background: var(--glass-hover); }
.mention-suggestion-avatar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.message-mention { padding: 1px 4px; border-radius: 5px; color: #ddd6fe; background: rgba(139, 92, 246, .26); border: 1px solid rgba(167, 139, 250, 0.25); font-weight: 600; }

.typing-indicator {
  min-height: 18px;
  padding: 0 4px 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-style: italic;
}

.typing-indicator::after {
  content: '…';
  display: inline-block;
  width: 1em;
  overflow: hidden;
  vertical-align: bottom;
  animation: typingDots 1.2s steps(4, end) infinite;
}

@keyframes typingDots { to { width: 0; } }

.reply-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-left: 3px solid var(--accent-1);
  border-radius: 6px;
  color: var(--text-secondary);
  background: rgba(139, 92, 246, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-size: 12px;
}
.reply-preview span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-preview button { padding: 0 3px; border: 0; color: var(--text-secondary); background: transparent; font-size: 18px; line-height: 1; cursor: pointer; }
.reply-preview button:hover { color: var(--text-primary); }

.input-wrapper .message-input {
  width: 100%;
  min-height: 42px;
  max-height: 122px;
  padding: 12px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--liquid-control-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--liquid-specular-sm);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 16px;
  outline: none;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  transition: all var(--duration-fast) ease;
}

.input-wrapper .message-input:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper .message-input:focus {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(139, 92, 246, 0.08);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
    0 0 0 3px rgba(139, 92, 246, 0.15);
}

.btn-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--gradient-accent);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 4px 16px rgba(139, 92, 246, 0.28);
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  flex-shrink: 0;
}

.btn-send:hover {
  transform: scale(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 6px 22px rgba(139, 92, 246, 0.42);
}

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

/* ─── Recording Overlay ─────────────────────────────── */
.recording-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 15, 0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  z-index: 100;
  animation: fadeIn 0.25s ease;
}

@supports (backdrop-filter: url(#liquid-refraction)) {
  .recording-overlay {
    backdrop-filter: var(--liquid-refraction-filter);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
}

.recording-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 36px 44px;
  background: var(--liquid-plate-bg);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--liquid-specular-shadow);
}

.recording-visual {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recording-ring {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-danger);
  animation: ringPulse 2s ease-in-out infinite;
}

.ring-1 { animation-delay: 0s; }
.ring-2 { animation-delay: 0.4s; opacity: 0.6; }
.ring-3 { animation-delay: 0.8s; opacity: 0.3; }

@keyframes ringPulse {
  0%, 100% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.2); opacity: 0.6; }
}

.recording-mic {
  width: 64px;
  height: 64px;
  background: var(--color-danger);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
  animation: micPulse 1s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.recording-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-danger);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.recording-time {
  font-size: 36px;
  font-weight: 300;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.recording-actions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.btn-rec-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.btn-rec-cancel {
  background: var(--liquid-control-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--liquid-specular-sm);
  color: var(--text-secondary);
}

.btn-rec-cancel:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--color-danger);
}

.btn-rec-send {
  background: var(--gradient-accent);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
}

.btn-rec-send:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 4px 20px rgba(139, 92, 246, 0.35);
}

/* ─── Lightbox ──────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 10, 0.86);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  z-index: 200;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  cursor: default;
}

.btn-close-lightbox {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--liquid-control-bg);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--liquid-specular-sm);
  border-radius: var(--radius-full);
  color: #fff;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.btn-close-lightbox:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.1);
}

/* ─── Quick Reply PopUp (Liquid Glass Floating Card) ── */
.quick-reply-popup {
  position: fixed;
  right: 24px;
  bottom: 88px;
  width: min(390px, calc(100vw - 32px));
  padding: 15px;
  background: var(--liquid-plate-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid rgba(167, 139, 250, 0.42);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--liquid-specular-shadow),
    0 0 32px rgba(139, 92, 246, 0.16);
  z-index: 150;
  animation: quickReplyEnter 0.3s var(--ease-out) both;
}

@supports (backdrop-filter: url(#liquid-refraction)) {
  .quick-reply-popup {
    backdrop-filter: var(--liquid-refraction-filter);
  }
}

@keyframes quickReplyEnter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
}

.quick-reply-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-reply-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.quick-reply-heading {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-primary);
}

.quick-reply-heading strong {
  font-weight: 700;
}

.quick-reply-preview {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-dismiss-quick-reply {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.btn-dismiss-quick-reply:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.quick-reply-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.quick-reply-popup--idle .quick-reply-form {
  display: none;
}

.quick-reply-popup--idle .quick-reply-preview {
  white-space: normal;
}

.quick-reply-form input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  color: var(--text-primary);
  background: var(--liquid-control-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.quick-reply-form input:focus {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(167, 139, 250, 0.65);
}

.btn-quick-reply {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: #fff;
  background: var(--gradient-accent);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.btn-quick-reply:hover {
  transform: scale(1.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 4px 16px rgba(139, 92, 246, 0.35);
}

.quick-reply-floating-body {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.24), transparent 60%), var(--bg-secondary);
}

.quick-reply-floating-body .quick-reply-popup {
  position: static;
  width: 100%;
  min-width: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: none;
}

/* ─── Group & Action Modals (Liquid Glass Dialogs) ──── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 5, 12, 0.62);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.group-modal-card {
  position: relative;
  width: min(460px, 100%);
  padding: 26px;
  background: var(--liquid-plate-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-xl);
  box-shadow:
    var(--liquid-specular-shadow),
    0 28px 90px rgba(0, 0, 0, 0.55);
}

@supports (backdrop-filter: url(#liquid-refraction)) {
  .group-modal-card {
    backdrop-filter: var(--liquid-refraction-filter);
  }
}

.group-modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.group-modal-heading h2 { font-size: 20px; }
.group-modal-heading p { margin-top: 4px; color: var(--text-secondary); font-size: 13px; }

.modal-close {
  width: 30px;
  height: 30px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover { background: var(--glass-hover); color: #fff; }

.group-modal-card .form-group { display: block; margin-bottom: 18px; }
.group-modal-card .form-group > span { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; }
.group-modal-card input[type="text"],
.group-modal-card textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--text-primary);
  background: var(--liquid-control-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--liquid-specular-sm);
  border-radius: var(--radius-sm);
  resize: vertical;
}
.group-modal-card input[type="text"]:focus,
.group-modal-card textarea:focus {
  border-color: rgba(167, 139, 250, 0.7);
  background: rgba(139, 92, 246, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 0 3px rgba(139, 92, 246, 0.16);
}
.group-modal-card small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 12px; }

.privacy-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  background: var(--liquid-control-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.privacy-option input { margin-top: 3px; accent-color: var(--accent-1); }
.privacy-option strong { display: block; font-size: 13px; }
.privacy-option small { color: var(--text-secondary); font-size: 12px; }

.user-select-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 8px;
  background: rgba(12, 12, 24, 0.42);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
}

.user-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.user-select-item:hover {
  background: var(--glass-hover);
}

.user-select-item.is-selected {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.user-select-item input[type="checkbox"] {
  accent-color: var(--accent-1);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.user-select-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-select-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-primary);
}

.user-select-badge {
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
  font-size: 11px;
  font-weight: 600;
}

.user-select-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.group-form-error { margin: -4px 0 14px; color: #fca5a5; font-size: 13px; }
.group-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.poll-options { display: grid; gap: 8px; }
.poll-option-editor { display: flex; gap: 8px; }
.poll-option-editor input { flex: 1; }
.poll-remove-option { flex: 0 0 36px; border: 1px solid rgba(239, 68, 68, .35); border-radius: 8px; color: #fca5a5; background: rgba(239, 68, 68, .08); cursor: pointer; }
.poll-add-option { margin-top: 10px; }
.emoji-suggestions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 0 0 20px; }
.emoji-suggestions button {
  padding: 9px 4px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: var(--liquid-control-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  cursor: pointer;
  font-size: 20px;
  transition: all var(--duration-fast) ease;
}
.emoji-suggestions button:hover {
  border-color: var(--accent-1);
  background: rgba(139, 92, 246, 0.2);
  transform: translateY(-1px);
}
.btn-modal-secondary,
.btn-modal-primary {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--duration-fast) ease;
}
.btn-modal-secondary {
  color: var(--text-secondary);
  background: var(--liquid-control-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-modal-secondary:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}
.btn-modal-primary {
  color: #fff;
  background: var(--gradient-accent);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 4px 16px rgba(139, 92, 246, 0.28);
}
.btn-modal-primary:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
  }

  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 15;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease-out);
    border-right: 1px solid var(--glass-border);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    width: 280px;
    transform: translateX(-100%);
  }

  .header-center {
    display: none;
  }

  .message {
    max-width: 85%;
  }

  .login-card {
    margin: 16px;
    padding: 32px 24px;
  }

  .message-image {
    max-width: 240px;
  }

  .message-audio {
    width: 200px;
  }

  .popup-settings {
    right: 16px;
  }

  .quick-reply-popup {
    right: 16px;
    bottom: 82px;
  }
}

@media (max-width: 480px) {
  .online-badge {
    display: none;
  }

  .message {
    max-width: 90%;
  }

  .messages {
    padding: 16px 12px;
  }

  .input-bar {
    padding: 10px 10px;
    gap: 4px;
  }

  .btn-action {
    width: 38px;
    height: 38px;
  }

  .btn-send {
    width: 38px;
    height: 38px;
  }
}

/* ═══════════════════════════════════════════════════════
   THEME SELECTOR & ADDITIONAL THEMES (Web / Desktop)
   ═══════════════════════════════════════════════════════ */
.login-theme-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.btn-login-theme {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.btn-login-theme:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.btn-modal-danger {
  margin-right: auto;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.btn-modal-danger:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.65);
}

.theme-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

@media (max-width: 480px) {
  .theme-options-grid {
    grid-template-columns: 1fr;
  }
}

.theme-option-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--liquid-control-bg);
  box-shadow: var(--liquid-specular-sm);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.theme-option-card:hover {
  border-color: var(--glass-border-strong);
  transform: translateY(-1px);
}

.theme-option-card.is-selected {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 1px var(--accent-1), var(--liquid-specular-sm);
  background: rgba(139, 92, 246, 0.14);
}

.theme-swatches {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.theme-swatch + .theme-swatch {
  margin-left: -6px;
}

.theme-option-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.theme-option-info strong {
  font-size: 13px;
  color: var(--text-primary);
}

.theme-option-info small {
  margin: 0 !important;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-secondary);
}

/* ─── 1. Dark Discreto (Grafite Translúcido) ─── */
html[data-theme="dark"] {
  --bg-primary: #0d1017;
  --bg-secondary: #121620;
  --bg-tertiary: #181d2a;
  --bg-elevated: rgba(24, 29, 42, 0.88);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(148, 163, 184, 0.14);
  --glass-border-strong: rgba(148, 163, 184, 0.24);
  --glass-hover: rgba(148, 163, 184, 0.08);
  --liquid-shell-bg: rgba(18, 22, 32, 0.84);
  --liquid-plate-bg: rgba(22, 27, 39, 0.94);
  --liquid-control-bg: rgba(30, 36, 51, 0.72);
  --accent-1: #6366f1;
  --accent-2: #4f46e5;
  --accent-3: #475569;
  --gradient-accent: linear-gradient(135deg, #4f46e5, #4338ca);
  --gradient-accent-hover: linear-gradient(135deg, #6366f1, #4f46e5);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --bubble-own: linear-gradient(135deg, rgba(79, 70, 229, 0.22), rgba(51, 65, 85, 0.35));
  --bubble-own-border: rgba(99, 102, 241, 0.35);
  --bubble-other: rgba(24, 29, 42, 0.78);
  --bubble-other-border: rgba(148, 163, 184, 0.14);
  --liquid-refraction-filter: blur(16px) saturate(120%);
  --liquid-refraction-subtle-filter: blur(12px) saturate(115%);
}
html[data-theme="dark"] .chat-bg-orbs,
html[data-theme="dark"] .login-bg-orbs {
  opacity: 0.12;
}

/* ─── 2. Modo Claro (Cristal Pérola Translúcido) ─── */
html[data-theme="light"] {
  --bg-primary: #e8eef6;
  --bg-secondary: #dbe4f0;
  --bg-tertiary: #cbd5e1;
  --bg-elevated: rgba(255, 255, 255, 0.92);
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(15, 23, 42, 0.16);
  --glass-border-strong: rgba(79, 70, 229, 0.34);
  --glass-hover: rgba(15, 23, 42, 0.06);
  --liquid-shell-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.84));
  --liquid-plate-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.95));
  --liquid-control-bg: rgba(241, 245, 249, 0.92);
  --liquid-specular-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.95),
    0 14px 36px rgba(15, 23, 42, 0.12);
  --liquid-specular-sm:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
    0 4px 12px rgba(15, 23, 42, 0.08);
  --accent-1: #4f46e5;
  --accent-2: #4338ca;
  --accent-3: #0284c7;
  --gradient-accent: linear-gradient(135deg, #4f46e5, #3b82f6);
  --gradient-accent-hover: linear-gradient(135deg, #4338ca, #2563eb);
  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --bubble-own: linear-gradient(135deg, rgba(224, 231, 255, 0.95), rgba(219, 234, 254, 0.92));
  --bubble-own-border: rgba(79, 70, 229, 0.42);
  --bubble-other: rgba(255, 255, 255, 0.92);
  --bubble-other-border: rgba(15, 23, 42, 0.16);
  --liquid-refraction-filter: blur(16px) saturate(140%);
  --liquid-refraction-subtle-filter: blur(12px) saturate(130%);
}
html[data-theme="light"] .chat-bg-orbs,
html[data-theme="light"] .login-bg-orbs {
  opacity: 0.2;
}
html[data-theme="light"] .message-text { color: #0f172a; font-weight: 450; }
html[data-theme="light"] .message-user { filter: brightness(0.62) saturate(1.3); }
html[data-theme="light"] .message-reply-reference {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(15, 23, 42, 0.16);
  border-left-color: #4f46e5;
  color: #334155;
}
html[data-theme="light"] .message-reply-reference strong { color: #1e1b4b; }
html[data-theme="light"] .message-link { color: #4338ca; }
html[data-theme="light"] .message-mention { color: #312e81; background: rgba(79, 70, 229, 0.15); border-color: rgba(79, 70, 229, 0.3); }
html[data-theme="light"] .unread-divider { color: #4338ca; }
html[data-theme="light"] .user-select-list { background: rgba(241, 245, 249, 0.92); }
html[data-theme="light"] .user-select-badge { color: #312e81; background: rgba(79, 70, 229, 0.15); }
html[data-theme="light"] .modal-close:hover { color: #0f172a; }
html[data-theme="light"] .poll-option { background: rgba(241, 245, 249, 0.92); border-color: rgba(15, 23, 42, 0.18); }

/* ─── 3. Oceano (Azul Profundo & Ciano) ─── */
html[data-theme="ocean"] {
  --bg-primary: #06131f;
  --bg-secondary: #0a1b2a;
  --bg-tertiary: #0f2538;
  --bg-elevated: rgba(12, 31, 48, 0.82);
  --glass-border: rgba(56, 189, 248, 0.16);
  --glass-border-strong: rgba(6, 182, 212, 0.34);
  --liquid-shell-bg: linear-gradient(135deg, rgba(12, 34, 52, 0.78), rgba(8, 22, 36, 0.72));
  --liquid-plate-bg: linear-gradient(145deg, rgba(14, 38, 58, 0.92), rgba(9, 24, 38, 0.88));
  --liquid-control-bg: rgba(16, 43, 66, 0.65);
  --accent-1: #06b6d4;
  --accent-2: #0284c7;
  --accent-3: #38bdf8;
  --gradient-accent: linear-gradient(135deg, #0284c7, #06b6d4);
  --gradient-accent-hover: linear-gradient(135deg, #0369a1, #0891b2);
  --text-primary: #f0f9ff;
  --text-secondary: #93c5fd;
  --text-muted: #60a5fa;
  --bubble-own: linear-gradient(135deg, rgba(2, 132, 199, 0.28), rgba(6, 182, 212, 0.18));
  --bubble-own-border: rgba(56, 189, 248, 0.38);
  --bubble-other: linear-gradient(135deg, rgba(14, 38, 58, 0.72), rgba(10, 27, 42, 0.62));
  --bubble-other-border: rgba(56, 189, 248, 0.16);
}
html[data-theme="ocean"] .chat-bg-orbs,
html[data-theme="ocean"] .login-bg-orbs {
  filter: hue-rotate(-40deg);
  opacity: 0.45;
}

/* ─── 4. Floresta (Esmeralda & Pinho) ─── */
html[data-theme="forest"] {
  --bg-primary: #061510;
  --bg-secondary: #0a1f18;
  --bg-tertiary: #0f2b22;
  --bg-elevated: rgba(12, 36, 28, 0.82);
  --glass-border: rgba(52, 211, 153, 0.16);
  --glass-border-strong: rgba(16, 185, 129, 0.34);
  --liquid-shell-bg: linear-gradient(135deg, rgba(12, 38, 29, 0.78), rgba(8, 25, 19, 0.72));
  --liquid-plate-bg: linear-gradient(145deg, rgba(14, 43, 33, 0.92), rgba(9, 28, 21, 0.88));
  --liquid-control-bg: rgba(16, 49, 37, 0.65);
  --accent-1: #10b981;
  --accent-2: #059669;
  --accent-3: #14b8a6;
  --gradient-accent: linear-gradient(135deg, #059669, #10b981);
  --gradient-accent-hover: linear-gradient(135deg, #047857, #059669);
  --text-primary: #ecfdf5;
  --text-secondary: #a7f3d0;
  --text-muted: #6ee7b7;
  --bubble-own: linear-gradient(135deg, rgba(5, 150, 105, 0.28), rgba(20, 184, 166, 0.18));
  --bubble-own-border: rgba(52, 211, 153, 0.38);
  --bubble-other: linear-gradient(135deg, rgba(14, 43, 33, 0.72), rgba(10, 31, 24, 0.62));
  --bubble-other-border: rgba(52, 211, 153, 0.16);
}
html[data-theme="forest"] .chat-bg-orbs,
html[data-theme="forest"] .login-bg-orbs {
  filter: hue-rotate(-95deg);
  opacity: 0.4;
}

/* ─── 5. Âmbar (Terracota & Dourado Suave) ─── */
html[data-theme="sunset"] {
  --bg-primary: #160c08;
  --bg-secondary: #20120c;
  --bg-tertiary: #2b1810;
  --bg-elevated: rgba(36, 20, 14, 0.82);
  --glass-border: rgba(251, 146, 60, 0.16);
  --glass-border-strong: rgba(245, 158, 11, 0.34);
  --liquid-shell-bg: linear-gradient(135deg, rgba(38, 21, 15, 0.78), rgba(24, 13, 9, 0.72));
  --liquid-plate-bg: linear-gradient(145deg, rgba(45, 25, 18, 0.92), rgba(28, 16, 11, 0.88));
  --liquid-control-bg: rgba(52, 29, 21, 0.65);
  --accent-1: #f59e0b;
  --accent-2: #d97706;
  --accent-3: #f97316;
  --gradient-accent: linear-gradient(135deg, #d97706, #f97316);
  --gradient-accent-hover: linear-gradient(135deg, #b45309, #ea580c);
  --text-primary: #fff7ed;
  --text-secondary: #fed7aa;
  --text-muted: #fdba74;
  --bubble-own: linear-gradient(135deg, rgba(217, 119, 6, 0.28), rgba(249, 115, 22, 0.18));
  --bubble-own-border: rgba(251, 146, 60, 0.38);
  --bubble-other: linear-gradient(135deg, rgba(45, 25, 18, 0.72), rgba(32, 18, 12, 0.62));
  --bubble-other-border: rgba(251, 146, 60, 0.16);
}
html[data-theme="sunset"] .chat-bg-orbs,
html[data-theme="sunset"] .login-bg-orbs {
  filter: hue-rotate(85deg);
  opacity: 0.4;
}
