[data-theme="ocean"],
[data-theme="sunset"] {
  --text-inverse: #ffffff;
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);
}
:root,
[data-theme="midnight"] {
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .modal {
  background: var(--bg-surface);
  color: var(--text-main);
}
#the-box,
body {
  display: flex;
  justify-content: center;
}
#login-screen::after,
#login-screen::before {
  inset: -50%;
  z-index: 0;
  position: absolute;
  content: "";
  pointer-events: none;
}
.brand,
.login-box h2 {
  letter-spacing: -0.5px;
}
.brand,
.nav-item {
  text-decoration: none;
}
.auth-tab,
.btn,
.login-box,
.nav-item,
.toggle-switch,
.twemoji-wrap {
  position: relative;
}
#the-box .svg-box {
  object-fit: contain;
  object-fit: contain;
}
.member-role,
.report-cat-group-header,
.streak-card-day,
.streak-card-status {
  text-transform: uppercase;
}
.editor-size-slider,
.tg-slider {
  -webkit-appearance: none;
  outline: 0;
}
*,
.message-button,
body,
html {
  -webkit-tap-highlight-color: transparent;
}
body,
html {
  background-color: var(--bg-body);
}
.call-bar-duration,
.call-ping-text,
.call-timer,
.reaction-badge-count {
  font-variant-numeric: tabular-nums;
}
#chat-input-area,
*,
.auth-method label,
.login-box,
.login-box *,
.login-box input:not(.login-input),
.login-input-wrapper,
.message-buttons,
.platform-electron #title-bar,
.poll-bubble-container,
.poll-selector-circle,
.profile-input,
.reaction-selector-row,
.tg-settings-row {
  box-sizing: border-box;
}
body,
html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
}
#the-box {
  width: 250px;
  height: 250px;
  align-items: center;
  margin-top: 40px;
  transform-origin: center center;
  line-height: 0;
  align-items: center;
  perspective: 1000px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}
#the-box .svg-box {
  transform: translateY(0);
}
#box-glow {
  top: -20px !important;
}
.list-box-icon .svg-box {
  width: 40px;
  height: 40px;
  vertical-align: middle;
  display: inline-block;
}
:root {
  --bg-body: #f0f2f5;
  --bg-surface: #ffffff;
  --bg-sidebar: #f8f9fa;
  --primary: #1d4554;
  --primary-light: #2d6a7e;
  --primary-hover: #2a5a6a;
  --primary-glow: rgba(29, 69, 84, 0.15);
  --primary-soft: rgba(29, 69, 84, 0.06);
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.2);
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #6b7780;
  --text-inverse: #ffffff;
  --border-light: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.1);
  --success-soft: rgba(16, 185, 129, 0.1);
  --warning-soft: rgba(245, 158, 11, 0.1);
  --danger-soft: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.1);
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.16);
  --shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  --motion-fast: 150ms;
  --motion-medium: 250ms;
  --motion-slow: 400ms;
  --motion-spring: cubic-bezier(0.25, 1, 0.5, 1);
  --motion-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --motion-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;
  --header-height: 70px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
.lucide {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.12em;
  stroke: currentColor;
}
.brand .lucide {
  width: 1.35em;
  height: 1.35em;
}
.nav-item .lucide {
  width: 1.15rem;
  height: 1.15rem;
}
[data-theme="dark"] {
  --bg-body: #0a0b10;
  --bg-surface: #12131a;
  --bg-sidebar: #0e0f15;
  --primary: #7f9cf5;
  --primary-light: #a3bffa;
  --primary-hover: #93adf7;
  --primary-glow: rgba(127, 156, 245, 0.18);
  --primary-soft: rgba(127, 156, 245, 0.06);
  --accent: #818cf8;
  --accent-glow: rgba(129, 140, 248, 0.2);
  --text-main: #f1f3f8;
  --text-secondary: #c8cdd8;
  --text-muted: #9098a8;
  --text-inverse: #0a0b10;
  --border-light: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --success-soft: rgba(16, 185, 129, 0.12);
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger-soft: rgba(239, 68, 68, 0.12);
  --info-soft: rgba(59, 130, 246, 0.12);
  --gray-50: #1a1b23;
  --gray-100: #1e1f27;
  --gray-200: #2a2b35;
  --gray-300: #3a3b47;
  --gray-400: #6b7280;
  --gray-500: #9098a8;
  --gray-600: #a8b1c8;
  --gray-700: #c8cdd8;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.4);
  --glass-bg: rgba(18, 19, 26, 0.78);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
[data-theme="classic"] {
  --bg-body: #e8e8e8;
  --bg-surface: #f5f5f5;
  --bg-sidebar: #d4d4d4;
  --primary: #004a99;
  --primary-light: #1a6bb5;
  --primary-hover: #003d80;
  --primary-glow: rgba(0, 74, 153, 0.15);
  --primary-soft: rgba(0, 74, 153, 0.06);
  --accent: #004a99;
  --accent-glow: rgba(0, 74, 153, 0.2);
  --text-main: #1a1a1a;
  --text-secondary: #3a3a3a;
  --text-muted: #666666;
  --text-inverse: #ffffff;
  --border-light: rgba(0, 0, 0, 0.12);
  --border-medium: rgba(0, 0, 0, 0.2);
  --success-soft: rgba(16, 185, 129, 0.08);
  --warning-soft: rgba(245, 158, 11, 0.08);
  --danger-soft: rgba(239, 68, 68, 0.08);
  --info-soft: rgba(59, 130, 246, 0.08);
  --gray-50: #f0f0f0;
  --gray-100: #e0e0e0;
  --gray-200: #cccccc;
  --gray-300: #b3b3b3;
  --gray-400: #999999;
  --gray-500: #808080;
  --gray-600: #666666;
  --gray-700: #4d4d4d;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.25);
  --glass-bg: rgba(245, 245, 245, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
[data-theme="ocean"] {
  --bg-body: #e8f4f8;
  --bg-surface: #f0fafd;
  --bg-sidebar: #dceef5;
  --primary: #0e7c9e;
  --primary-light: #2a9dbf;
  --primary-hover: #0c6b89;
  --primary-glow: rgba(14, 124, 158, 0.18);
  --primary-soft: rgba(14, 124, 158, 0.08);
  --accent: #0891b2;
  --accent-glow: rgba(8, 145, 178, 0.22);
  --text-main: #0c2230;
  --text-secondary: #1f4a5e;
  --text-muted: #5a7f8e;
  --border-light: rgba(14, 124, 158, 0.1);
  --border-medium: rgba(14, 124, 158, 0.18);
  --success: #0d9488;
  --success-soft: rgba(13, 148, 136, 0.12);
  --info: #0284c7;
  --info-soft: rgba(2, 132, 199, 0.12);
}
[data-theme="sunset"] {
  --bg-body: #fef1e6;
  --bg-surface: #fff7f0;
  --bg-sidebar: #fdede0;
  --primary: #c2410c;
  --primary-light: #ea580c;
  --primary-hover: #9a3412;
  --primary-glow: rgba(194, 65, 12, 0.18);
  --primary-soft: rgba(194, 65, 12, 0.08);
  --accent: #d97706;
  --accent-glow: rgba(217, 119, 6, 0.22);
  --text-main: #2d1a0e;
  --text-secondary: #5c3a1e;
  --text-muted: #8c6b4a;
  --border-light: rgba(194, 65, 12, 0.1);
  --border-medium: rgba(194, 65, 12, 0.18);
  --success: #b45309;
  --success-soft: rgba(180, 83, 9, 0.12);
  --info: #0369a1;
  --info-soft: rgba(3, 105, 161, 0.12);
}
[data-theme="midnight"] {
  --bg-body: #090d1a;
  --bg-surface: #141b2f;
  --bg-sidebar: #0e1324;
  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-hover: #6366f1;
  --primary-glow: rgba(129, 140, 248, 0.15);
  --primary-soft: rgba(129, 140, 248, 0.06);
  --accent: #c084fc;
  --accent-glow: rgba(192, 132, 252, 0.15);
  --text-main: #f8fafc;
  --text-secondary: #5f6c7c;
  --text-muted: #64748b;
  --text-inverse: #090d1a;
  --border-light: rgba(129, 140, 248, 0.08);
  --border-medium: rgba(129, 140, 248, 0.16);
  --success-soft: rgba(16, 185, 129, 0.14);
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger-soft: rgba(239, 68, 68, 0.14);
  --info: #525997;
  --info-soft: rgba(129, 140, 248, 0.14);
}
[data-theme="dark"] .auth-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .auth-method label,
[data-theme="dark"] .auth-tab,
[data-theme="dark"] .premium-status-date,
[data-theme="dark"] .sidebar div:last-child {
  color: #b0b0b0;
}
.message-row.sent .poll-header,
.message-row.sent .poll-option-unvoted .poll-option-text,
.message-row.sent .poll-view-voters-btn,
.message-row.sent .poll-voted-left,
.message-row.sent .poll-voted-text-row,
[data-theme="dark"] .auth-tab:hover {
  color: #fff;
}
[data-theme="dark"] .auth-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}
[data-theme="dark"] #twofa-screen {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}
[data-theme="dark"] #twofa-screen p,
[data-theme="dark"] .auth-method label a,
[data-theme="dark"] .message-sender-name {
  color: #60a5fa;
}
[data-theme="dark"] .chat-exit-button,
[data-theme="dark"] .modal h3 {
  color: var(--text-main);
}
[data-theme="dark"] .modal input,
[data-theme="dark"] .modal select,
[data-theme="dark"] .modal textarea {
  background: #3d3d3d;
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
[data-theme="dark"] .modal input:focus,
[data-theme="dark"] .modal textarea:focus {
  background: #4d4d4d;
  border-color: var(--primary);
}
[data-theme="dark"] .btn-outline {
  border-color: rgba(255, 255, 255, 0.3);
}
.chat-blocked-banner .btn-join-group:hover,
.message-code-inline:hover,
[data-theme="dark"] .btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
[data-theme="dark"] .btn-danger {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}
[data-theme="dark"] .file-item,
[data-theme="dark"] .mail-item-card,
[data-theme="dark"] .mailbox-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .repo-item,
[data-theme="dark"] .streak-card,
[data-theme="dark"] .user-card {
  background: var(--bg-surface);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .file-item:hover {
  border-color: rgba(67, 97, 238, 0.5);
}
[data-theme="dark"] .mail-item-card:hover,
[data-theme="dark"] .mailbox-card:hover,
[data-theme="dark"] .repo-item:hover {
  background: rgba(67, 97, 238, 0.1);
}
[data-theme="dark"] .user-card:hover {
  background: rgba(67, 97, 238, 0.1);
  border-color: var(--primary);
}
[data-theme="dark"] .section-title {
  color: var(--text-main);
  border-bottom-color: var(--primary-glow);
}
[data-theme="dark"] .streak-card.available {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1),
    rgba(16, 185, 129, 0.2)
  );
}
[data-theme="dark"] .streak-card.milestone {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.1),
    rgba(245, 158, 11, 0.2)
  );
}
[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.8);
}
[data-theme="dark"] .toast {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .toast.error {
  border-left-color: var(--danger);
}
[data-theme="dark"] .toast.success {
  border-left-color: var(--success);
}
[data-theme="dark"] .toast.info {
  border-left-color: var(--primary);
}
[data-theme="dark"] div[style*="color: #666"],
[data-theme="dark"] div[style*="color:#666"],
[data-theme="dark"] p[style*="color: #666"],
[data-theme="dark"] p[style*="color:#666"],
[data-theme="dark"] span[style*="color: #666"] {
  color: #b0b0b0 !important;
}
[data-theme="dark"] div[style*="color: #d97706"],
[data-theme="dark"] div[style*="color:#856404"],
[data-theme="dark"] div[style*="color:#d97706"] {
  color: #fbbf24 !important;
}
[data-theme="dark"] div[style*="background: #d1fae5"] {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #10b981 !important;
}
[data-theme="dark"] .profile-stat-item,
[data-theme="dark"] .storage-box {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"]
  div[style*="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)"] {
  background: linear-gradient(135deg, #3b3b3b 0, #5a5a5a 100%) !important;
}
[data-theme="dark"] div[style*="background: rgba(255,255,255,0.15)"] {
  background: rgba(0, 0, 0, 0.2) !important;
}
[data-theme="dark"] div[style*="background: rgba(255,255,255,0.2)"] {
  background: rgba(0, 0, 0, 0.3) !important;
}
[data-theme="dark"] div[style*="background:white"] {
  background: var(--bg-surface) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] div[style*="background:#fff3cd"] {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  border-left-color: var(--warning) !important;
}
[data-theme="dark"] div[style*="background:#e8f5e9"] {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #10b981 !important;
  border-left-color: var(--success) !important;
}
[data-theme="dark"] div[style*="background:#fef2f2"] {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  border-left-color: var(--danger) !important;
}
[data-theme="dark"] div[style*="color:#2e7d32"] {
  color: #10b981 !important;
}
[data-theme="dark"] div[style*="color:#b91c1c"] {
  color: #ef4444 !important;
}
[data-theme="dark"] div[style*="color:#888"] {
  color: #888 !important;
}
[data-theme="dark"] div[style*="background:#f0f7ff"] {
  background: rgba(67, 97, 238, 0.1) !important;
}
[data-theme="dark"] .tg-icon-gray,
[data-theme="dark"] div[style*="background:#f9f9f9"] {
  background: rgba(255, 255, 255, 0.05) !important;
}
[data-theme="dark"] div[style*="border:2px solid #1e40af"] {
  border-color: var(--primary) !important;
}
[data-theme="dark"] div[style*="border:2px solid #ddd"] {
  border-color: rgba(255, 255, 255, 0.2) !important;
}
[data-theme="dark"] div[style*="color:#1e40af"] {
  color: var(--primary) !important;
}
[data-theme="dark"] code[style*="background:#fff"] {
  background: var(--bg-surface) !important;
  color: var(--text-main) !important;
}
.login-box h2,
body {
  color: var(--text-main);
}
[data-theme="dark"] .premium-status-title {
  color: #fbbf24;
}
[data-theme="dark"] .free-badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}
[data-theme="dark"] .profile-card.is-premium {
  background: linear-gradient(180deg, #2d2d2d 0, #3d2d4a 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow:
    0 15px 35px rgba(168, 85, 247, 0.2),
    0 5px 15px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .profile-card.is-premium::before {
  background: linear-gradient(90deg, #a855f7 0, #ec4899 50%, #f59e0b 100%);
}
.profile-card.is-premium .profile-avatar,
[data-theme="dark"] .profile-card.is-premium .profile-avatar {
  background: linear-gradient(135deg, #a855f7 0, #ec4899 100%);
  box-shadow: 0 10px 25px rgba(236, 72, 153, 0.4);
}
[data-theme="dark"] .premium-status-title {
  background: linear-gradient(90deg, #a855f7 0, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.message-spoiler:not(.revealed),
.message-spoiler:not(.revealed) * {
  -webkit-text-fill-color: transparent !important;
  text-decoration-color: transparent !important;
}
[data-theme="classic"] .auth-tabs {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
[data-theme="classic"] .auth-tab {
  color: #666;
}
[data-theme="classic"] .auth-tab:hover {
  color: #000;
}
[data-theme="classic"] .auth-tab.active {
  border-bottom-color: #000;
  color: #000;
}
[data-theme="classic"] #twofa-screen {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
}
[data-theme="classic"] .modal-overlay {
  background: rgba(0, 0, 0, 0.5);
}
@font-face {
  font-family: "Segoe UI Emoji";
  src:
    local("Segoe UI Emoji"),
    url("seguiemj.ttf") format("truetype");
  unicode-range:
    U+1F000-1FAFF, U+2600-26FF, U+2700-27BF, U+1F900-1F9FF, U+1F300-1F5FF,
    U+1F600-1F64F, U+1F680-1F6FF;
}
* {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}
body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Segoe UI Emoji",
    Roboto,
    sans-serif;
  align-items: center;
}
.twemoji-wrap {
  display: inline;
  white-space: nowrap;
}
.twemoji-wrap img.emoji {
  height: 1.2em;
  width: 1.2em;
  margin: 0 0.05em 0 0.1em;
  vertical-align: -0.1em;
  pointer-events: none;
}
.twemoji-wrap .twemoji-text {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  user-select: text;
  -webkit-user-select: text;
  font-size: inherit;
  line-height: inherit;
}
::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}
#login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at top right,
    #e0e7ff 0,
    var(--bg-body) 100%
  );
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
#login-screen::before {
  background:
    radial-gradient(
      2px 2px at 20% 30%,
      var(--primary-glow) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 40% 70%,
      var(--primary-glow) 0,
      transparent 100%
    ),
    radial-gradient(
      3px 3px at 60% 20%,
      var(--primary-glow) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 80% 50%,
      var(--primary-glow) 0,
      transparent 100%
    ),
    radial-gradient(
      3px 3px at 10% 80%,
      var(--primary-glow) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 90% 90%,
      var(--primary-glow) 0,
      transparent 100%
    ),
    radial-gradient(4px 4px at 50% 50%, var(--accent-glow) 0, transparent 100%),
    radial-gradient(
      2px 2px at 30% 10%,
      var(--primary-glow) 0,
      transparent 100%
    ),
    radial-gradient(
      3px 3px at 70% 60%,
      var(--primary-glow) 0,
      transparent 100%
    ),
    radial-gradient(2px 2px at 45% 40%, var(--accent-glow) 0, transparent 100%);
  background-size: 200% 200%;
  animation: 20s ease-in-out infinite bgParticles;
}
#login-screen::after {
  background:
    radial-gradient(
      3px 3px at 15% 45%,
      var(--success-soft) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 55% 25%,
      var(--success-soft) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 75% 75%,
      var(--primary-glow) 0,
      transparent 100%
    ),
    radial-gradient(
      3px 3px at 25% 90%,
      var(--success-soft) 0,
      transparent 100%
    ),
    radial-gradient(2px 2px at 65% 10%, var(--accent-glow) 0, transparent 100%),
    radial-gradient(4px 4px at 35% 55%, var(--primary-glow) 0, transparent 100%);
  background-size: 200% 200%;
  animation: 25s ease-in-out infinite reverse bgParticles;
}
[data-theme="dark"] #login-screen::before {
  background:
    radial-gradient(
      2px 2px at 20% 30%,
      rgba(127, 156, 245, 0.15) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 40% 70%,
      rgba(127, 156, 245, 0.12) 0,
      transparent 100%
    ),
    radial-gradient(
      3px 3px at 60% 20%,
      rgba(127, 156, 245, 0.15) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 80% 50%,
      rgba(127, 156, 245, 0.12) 0,
      transparent 100%
    ),
    radial-gradient(
      3px 3px at 10% 80%,
      rgba(127, 156, 245, 0.15) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 90% 90%,
      rgba(127, 156, 245, 0.12) 0,
      transparent 100%
    ),
    radial-gradient(
      4px 4px at 50% 50%,
      rgba(129, 140, 248, 0.1) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 30% 10%,
      rgba(127, 156, 245, 0.12) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 45% 40%,
      rgba(129, 140, 248, 0.15) 0,
      transparent 100%
    );
  background-size: 200% 200%;
}
[data-theme="dark"] #login-screen::after {
  background:
    radial-gradient(
      3px 3px at 15% 45%,
      rgba(16, 185, 129, 0.08) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 55% 25%,
      rgba(16, 185, 129, 0.06) 0,
      transparent 100%
    ),
    radial-gradient(
      2px 2px at 75% 75%,
      rgba(127, 156, 245, 0.08) 0,
      transparent 100%
    ),
    radial-gradient(
      3px 3px at 25% 90%,
      rgba(16, 185, 129, 0.06) 0,
      transparent 100%
    ),
    radial-gradient(
      4px 4px at 35% 55%,
      rgba(127, 156, 245, 0.06) 0,
      transparent 100%
    );
  background-size: 200% 200%;
}
@keyframes bgParticles {
  0%,
  100% {
    transform: translate(0, 0) rotate(0);
  }
  25% {
    transform: translate(2%, 1%) rotate(1deg);
  }
  50% {
    transform: translate(-1%, 2%) rotate(-0.5deg);
  }
  75% {
    transform: translate(1%, -1%) rotate(0.5deg);
  }
}
@keyframes bgFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-20px) scale(1.1);
    opacity: 0.6;
  }
}
.login-box {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--glass-border);
  width: 440px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  animation: modalPremiumIn 0.4s var(--motion-spring);
  z-index: 1;
}
#app,
.nav-item {
  overflow: hidden;
}
.login-box h2 {
  margin-bottom: 10px;
  font-size: 1.8rem;
  font-weight: 700;
}
.auth-tab,
.login-box p {
  color: var(--text-muted);
}
.login-box p {
  margin-bottom: 30px;
  font-size: 0.95rem;
}
.login-box input:not(.login-input) {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1.5px solid var(--border-light);
  background: var(--bg-body);
  border-radius: var(--radius-xs);
  font-size: 16px;
  transition: 0.25s;
  font-family: inherit;
  color: var(--text-main);
}
.login-box input:not(.login-input):focus {
  outline: 0;
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
[data-theme="dark"] .login-box input {
  background: rgba(26, 27, 35, 0.6);
}
[data-theme="dark"] .login-box input:focus {
  background: rgba(26, 27, 35, 0.8);
}
.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0;
}
.auth-tab {
  flex: 1;
  padding: 12px 8px;
  background: 0 0;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--motion-spring);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.auth-tab:hover,
.brand {
  color: var(--text-main);
}
.auth-tab:hover {
  background: var(--primary-soft);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}
.auth-tab.active,
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.auth-method {
  display: none;
  animation: 0.3s fadeIn;
}
.auth-method.active,
.call-timer.visible,
.sticker-tab-content.active {
  display: block;
}
.auth-method div[style*="margin: 20px 0"] {
  margin: 20px 0 !important;
  width: 100%;
  box-sizing: border-box;
}
.auth-method label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  width: 100%;
}
.auth-method label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}
.auth-method label span {
  opacity: 0.8;
  word-break: break-word;
  flex: 1;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes modalPremiumIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(15px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.onb-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-medium);
  transition: 0.3s;
}
.onb-step-dot.active {
  background: var(--primary);
  transform: scale(1.3);
  box-shadow: 0 0 12px var(--primary-glow);
}
.onb-step-dot.done {
  background: var(--success);
  transform: scale(1.15);
}
@keyframes onbBounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.onb-step {
  animation: onbSlideIn 0.35s var(--motion-smooth) forwards;
}
@keyframes onbSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes popPulse {
  0% {
    transform: scale(0.98);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes slideInRight {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.85;
  }
}
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.icon-spin {
  animation: 1s linear infinite spin;
}
@keyframes bounce-in {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.25);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes bounce-text {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes highlightPulse {
  0% {
    background: var(--primary-soft);
  }
  50% {
    background: rgba(67, 97, 238, 0.2);
  }
  100% {
    background: 0 0;
  }
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
  background-clip: content-box;
}
@media (prefers-reduced-motion: reduce) {
  *,
  ::after,
  ::before {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}
#twofa-screen {
  padding: 20px;
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--radius-sm);
  margin: 20px 0;
  border: 2px solid var(--primary-glow);
}
#twofa-screen p {
  margin-bottom: 10px;
  color: var(--primary);
}
#telegram-code-section input {
  letter-spacing: 2px;
  font-size: 1.2rem;
  text-align: center;
}
#app {
  display: none;
  width: 100vw !important;
  height: 100vh !important;
  background: var(--bg-surface);
  border-radius: 0 !important;
  box-shadow: none !important;
  flex-direction: row;
  border: none !important;
  margin: 0;
}
.breadcrumb-item,
.nav-item {
  border-radius: var(--radius-xs);
  transition: all 0.2s var(--motion-spring);
  cursor: pointer;
}
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0.8rem;
}
.brand {
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.2rem;
  padding-left: 10px;
}
.nav-item,
.toolbar {
  align-items: center;
  display: flex;
}
.nav-item {
  padding: 8px 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-item span {
  margin-left: 12px;
}
.nav-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateX(2px);
}
.nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateX(4px);
}
[data-theme="dark"] .nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
}
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: 0 0 !important;
  max-width: none !important;
  margin: 0 !important;
}
.toolbar {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-light);
  padding: 0 2rem;
  justify-content: space-between;
  backdrop-filter: blur(12px);
}
.breadcrumbs {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  gap: 5px;
  align-items: center;
  flex-grow: 1;
  flex-wrap: wrap;
  min-height: 32px;
}
.breadcrumb-item {
  padding: 6px 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.breadcrumb-item:hover,
.chat-attachment-btn:hover,
.login-btn-ghost:hover {
  color: var(--primary);
  background: var(--primary-soft);
}
.breadcrumb-item:last-child {
  color: var(--text-main);
  pointer-events: none;
  font-weight: 600;
}
@media (max-width: 768px) {
  body.capacitor-mobile .toolbar {
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    min-height: calc(50px + env(safe-area-inset-top, 0px)) !important;
    background: var(--bg-surface) !important;
  }
  [data-theme="dark"] body.capacitor-mobile .toolbar {
    background: #0a0b10 !important;
  }
  [data-theme="classic"] body.capacitor-mobile .toolbar {
    background: #e8e8e8 !important;
  }
  [data-theme="ocean"] body.capacitor-mobile .toolbar {
    background: #e8f4f8 !important;
  }
  [data-theme="sunset"] body.capacitor-mobile .toolbar {
    background: #fef1e6 !important;
  }
  [data-theme="midnight"] body.capacitor-mobile .toolbar {
    background: #090d1a !important;
  }
  .hide-on-mobile {
    display: none !important;
  }
  .breadcrumbs {
    font-size: 0.9rem;
    gap: 3px;
    min-height: 28px;
  }
  .breadcrumb-item {
    padding: 4px 8px;
    font-size: 0.8rem;
  }
  .toolbar {
    height: 50px !important;
    min-height: 50px !important;
  }
  :root {
    --header-height: 50px;
  }
}
#context-menu,
#mobile-menu-dropdown,
#notifications-dropdown,
#user-menu-dropdown,
.attachment-menu,
.chat-sidebar-menu,
.dropdown-menu,
.sticker-picker {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow), var(--shadow-lg);
  animation: menuPremiumIn 0.25s var(--motion-spring);
  transform-origin: top center;
}
[data-theme="dark"] #context-menu,
[data-theme="dark"] #mobile-menu-dropdown,
[data-theme="dark"] #notifications-dropdown,
[data-theme="dark"] #user-menu-dropdown,
[data-theme="dark"] .attachment-menu,
[data-theme="dark"] .chat-sidebar-menu,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .sticker-picker {
  background: rgba(18, 19, 26, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}
[data-theme="classic"] #context-menu,
[data-theme="classic"] #mobile-menu-dropdown,
[data-theme="classic"] #notifications-dropdown,
[data-theme="classic"] #user-menu-dropdown,
[data-theme="classic"] .attachment-menu,
[data-theme="classic"] .chat-sidebar-menu,
[data-theme="classic"] .dropdown-menu,
[data-theme="classic"] .sticker-picker {
  background: #f5f5f5;
  backdrop-filter: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.attachment-menu-item,
.chat-sidebar-menu button,
.ctx-item,
.dropdown-item,
.menu-item,
.mobile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 3px 5px;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s var(--motion-spring);
  border: none;
  background: 0 0;
  width: calc(100% - 10px);
  text-align: left;
  position: relative;
  overflow: hidden;
}
.btn,
.file-name,
.menu-header {
  font-weight: 600;
}
.btn,
.help-button,
.settings-button {
  transition: all 0.2s var(--motion-spring);
  cursor: pointer;
  font-family: inherit;
}
.attachment-menu-item::before,
.chat-sidebar-menu button::before,
.ctx-item::before,
.dropdown-item::before,
.menu-item::before,
.mobile-dropdown-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--primary);
  opacity: 0;
  border-radius: inherit;
  transition: opacity 0.15s;
}
.attachment-menu-item:hover,
.chat-sidebar-menu button:hover,
.ctx-item:hover,
.dropdown-item:hover,
.menu-item:hover,
.mobile-dropdown-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateX(3px);
}
.attachment-menu-item:active,
.btn:active,
.chat-item:active,
.chat-sidebar-menu button:active,
.ctx-item:active,
.dropdown-item:active,
.file-item:active,
.file-menu-btn:active,
.login-btn-primary:active,
.login-btn-secondary:active,
.mail-item-card:active,
.member-card:active,
.menu-item:active,
.mobile-dropdown-item:active,
.mobile-menu-btn:active,
.nav-item:active,
.profile-stat-item:active,
.repo-item:active,
.tab-btn:active,
.user-card:active {
  transform: scale(0.97);
}
[data-theme="dark"] .attachment-menu-item:hover,
[data-theme="dark"] .chat-sidebar-menu button:hover,
[data-theme="dark"] .ctx-item:hover,
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .menu-item:hover,
[data-theme="dark"] .mobile-dropdown-item:hover {
  background: rgba(127, 156, 245, 0.12);
  color: var(--primary);
}
[data-theme="classic"] .attachment-menu-item:hover,
[data-theme="classic"] .chat-sidebar-menu button:hover,
[data-theme="classic"] .ctx-item:hover,
[data-theme="classic"] .dropdown-item:hover,
[data-theme="classic"] .menu-item:hover,
[data-theme="classic"] .mobile-dropdown-item:hover {
  background: rgba(0, 74, 153, 0.08);
  color: var(--primary);
}
.attachment-menu-item i,
.chat-sidebar-menu button i,
.ctx-item i,
.dropdown-item i,
.menu-item i,
.mobile-dropdown-item i {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition:
    color 0.15s ease,
    transform 0.15s var(--motion-spring);
  flex-shrink: 0;
}
.attachment-menu-item:hover i,
.chat-sidebar-menu button:hover i,
.ctx-item:hover i,
.dropdown-item:hover i,
.menu-item:hover i,
.mobile-dropdown-item:hover i {
  color: var(--primary);
  transform: scale(1.1);
}
.menu-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ctx-divider,
.menu-divider {
  height: 1px;
  margin: 5px 10px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-medium),
    transparent
  );
  border: none;
}
[data-theme="dark"] .ctx-divider,
[data-theme="dark"] .menu-divider {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
}
@keyframes menuPremiumIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes menuPremiumOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-5px) scale(0.97);
  }
}
.menu-closing {
  animation: 0.15s ease-out forwards menuPremiumOut;
}
.chat-sidebar-menu {
  padding: 6px;
}
#context-menu .ctx-message-preview {
  max-height: 220px;
  border-radius: var(--radius-sm);
  user-select: text;
  -webkit-user-select: text;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
}
#context-menu .ctx-message-preview .message-row {
  display: inline-flex !important;
  align-items: flex-start !important;
}
#context-menu .ctx-message-preview .message-bubble {
  user-select: text !important;
  -webkit-user-select: text !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}
.btn,
.file-name,
.profile-card,
.storage-bar-bg {
  overflow: hidden;
}
.actions {
  display: flex;
  gap: 12px;
}
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.btn:hover::after,
.file-item:hover .file-menu-btn,
.image-viewer-overlay .image-viewer-zoom-info.visible,
.login-terms-label input:checked + .login-terms-checkmark::after,
.member-card:hover::before,
.message-image-card:hover .image-overlay,
.message-spoiler:hover,
.pack-sticker-item:hover .pack-sticker-delete {
  opacity: 1;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 8px 24px var(--primary-glow);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0) scale(0.97);
}
.btn-outline {
  background: 0 0;
  border: 1.5px solid var(--border-medium);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.btn-outline.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1.5px solid transparent;
}
.btn-sm,
.report-cat-item {
  border-radius: var(--radius-xs);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}
.help-button,
.settings-button {
  background: var(--bg-surface);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  font-size: inherit;
  color: inherit;
}
.help-button:hover,
.settings-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
  background: var(--primary-soft);
}
.help-button:active,
.settings-button:active {
  transform: translateY(0) scale(0.99);
}
.toggle-switch {
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gray-300, #ccc);
  transition: 0.3s;
  border-radius: 24px;
}
.toggle-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: 0.3s;
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary, #3b82f6);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}
[data-theme="dark"] .toggle-slider {
  background: var(--gray-600, #555);
}
.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5rem;
}
.file-item,
.mail-item-card,
.mailbox-card,
.member-card,
.profile-stat-item,
.repo-item,
.sticker-pack-card,
.streak-card,
.user-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.25s var(--motion-spring);
  box-shadow: var(--shadow-xs);
}
#update-button i[data-lucide="refresh-ccw"],
.file-icon {
  transition: transform 0.3s;
}
.file-item:hover,
.mail-item-card:hover,
.mailbox-card:hover,
.member-card:hover,
.profile-stat-item:hover,
.repo-item:hover,
.sticker-pack-card:hover,
.user-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}
.file-item:active,
.mail-item-card:active,
.mailbox-card:active,
.member-card:active,
.repo-item:active,
.user-card:active {
  transform: translateY(-1px) scale(0.99);
}
.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 50%;
}
.file-item:hover .file-icon {
  background: #e0e7ff;
}
.file-name {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.file-menu-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: 0 0;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: 0.2s;
}
.repo-info h4,
.section-title {
  color: var(--text-main);
  font-weight: 700;
}
.file-menu-btn:hover {
  background: #f1f5f9;
  color: var(--primary);
}
.repo-list,
.repo-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-title {
  font-size: 1.35rem;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-glow);
  letter-spacing: -0.02em;
}
.repo-item,
.user-card {
  padding: 1.5rem;
  transition: all 0.25s var(--motion-spring);
  box-shadow: var(--shadow-xs);
  background: var(--bg-surface);
  cursor: pointer;
}
.mail-item-card:hover,
.mailbox-card:hover,
.profile-stat-item:hover,
.repo-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}
.repo-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.user-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}
.repo-info h4 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.repo-info p {
  font-size: 0.95rem;
  color: var(--text-muted);
}
.profile-card {
  background: var(--bg-surface);
  padding: 35px 25px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary),
    var(--accent),
    var(--primary)
  );
  background-size: 200% 100%;
  animation: 3s ease-in-out infinite shimmer;
}
@keyframes shimmer {
  0%,
  100% {
    background-position: 0 0;
  }
  50% {
    background-position: 100% 0;
  }
}
.profile-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary) 0, #3a0ca3 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  margin-bottom: 15px;
  box-shadow: 0 10px 25px var(--primary-glow);
}
.free-badge,
.premium-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-top: 15px;
}
.premium-badge {
  background: linear-gradient(135deg, #a855f7 0, #ec4899 100%);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
  animation: 2s infinite glow-pulse;
}
.free-badge {
  background: #f1f5f9;
  color: var(--text-muted);
  font-weight: 600;
}
.modal h3,
.report-cat-item,
.stat-value {
  color: var(--text-main);
}
.storage-box {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 25px;
  box-shadow: var(--shadow-xs);
}
.storage-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  margin: 12px 0 8px;
}
.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success) 0, #34d399 100%);
  border-radius: var(--radius-full);
  transition: width 1s ease-out;
}
.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  width: 100%;
  margin-top: 15px;
}
.profile-stat-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 15px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: all 0.2s var(--motion-spring);
  box-shadow: var(--shadow-xs);
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 5px;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 11000;
  display: none;
  justify-content: center;
  align-items: center;
}
.attachment-menu.open,
.call-bar.visible,
.call-overlay.active,
.editor-tool-options.active,
.image-editor-overlay.active,
.modal-overlay.open,
.platform-electron.electron-auth-ready #app,
.sticker-picker.open {
  display: flex;
}
.modal {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 30px;
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--glass-border);
  animation: modalPremiumIn 0.3s var(--motion-pop) forwards;
}
[data-theme="dark"] .modal {
  background: rgba(18, 19, 26, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}
[data-theme="classic"] .modal {
  background: #f5f5f5;
  backdrop-filter: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.modal h3 {
  font-size: 1.35rem;
  margin-bottom: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal input,
.modal select,
.modal textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-xs);
  margin-bottom: 15px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-body);
  color: var(--text-main);
  transition: 0.2s;
}
.modal input:focus,
.modal textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background: var(--bg-surface);
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.chat-header-info,
.modal-actions .btn,
.report-cat-item .cat-label {
  flex: 1;
}
.report-cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-body);
  border: 1.5px solid var(--border-light);
  cursor: pointer;
  transition: 0.15s;
  font-size: 0.95rem;
}
.report-cat-item:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateX(3px);
}
.report-cat-item .cat-icon {
  flex-shrink: 0;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.report-cat-item .cat-chevron {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}
.report-cat-group {
  margin-bottom: 4px;
}
.report-cat-group-header {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 4px 4px;
}
.ctx-menu-open {
  animation: 0.2s cubic-bezier(0.16, 1, 0.3, 1) menuDropdownIn;
}
@keyframes popPulse {
  0% {
    transform: scale(0.98);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.02);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes shrinkFade {
  to {
    opacity: 0;
    transform: scale(0.92);
  }
}
.btn-send.animate-pulse,
.chat-item.animate-pop,
.message-row.animate-pop {
  animation: 0.26s ease-out popPulse;
}
.message-row.animate-delete {
  animation: 0.24s ease-in forwards shrinkFade;
}
.chat-item.animate-delete {
  animation: 0.22s ease-in forwards shrinkFade;
}
.tab-btn {
  border-radius: var(--radius-xs);
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: all 0.2s var(--motion-spring);
}
.tab-btn:hover {
  color: var(--text-main);
  background: var(--primary-soft);
}
.tab-btn.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}
#menu-toggle,
#sidebar-close,
.login-terms-label input[type="checkbox"],
.sticker-tab-content {
  display: none;
}
@media (min-width: 769px) {
  #menu-toggle,
  #sidebar-close {
    display: flex;
    background: 0 0;
    color: var(--text-muted);
    transition: 0.2s;
    cursor: pointer;
  }
  #app.sidebar-open::before:active,
  #menu-toggle,
  #sidebar-close {
    cursor: pointer;
  }
  #menu-toggle {
    margin-right: 12px;
    border: 1px solid var(--border-light);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
  }
  #menu-toggle:hover {
    background: var(--bg-sidebar);
    color: var(--text-main);
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1999;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.12);
  }
  #sidebar-close {
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }
  #sidebar-close:hover {
    background: var(--bg-body);
    color: var(--text-main);
    border-color: var(--primary);
  }
  body.sidebar-open {
    overflow: hidden;
  }
  #app.sidebar-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1998;
    pointer-events: auto;
    cursor: pointer;
  }
  .nav-item.mobile-only-nav {
    display: none !important;
  }
}
.mail-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-sidebar);
  padding: 6px;
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
  overflow-x: auto;
}
.mail-tabs .btn {
  flex: 1;
  min-width: max-content;
  background: 0 0;
  color: var(--text-muted);
  box-shadow: none;
  border: none;
}
.mail-tabs .btn.btn-primary {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.mail-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.25s var(--motion-spring);
  box-shadow: var(--shadow-xs);
  position: relative;
}
.mail-item-card.unread {
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
}
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  body.sidebar-open {
    overflow: auto !important;
  }
  .file-item,
  .nav-item,
  .nav-links,
  .sidebar {
    display: flex;
    display: flex;
  }
  #app {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    flex-direction: column;
  }
  .toolbar {
    padding: 0 15px;
    position: sticky;
    top: 0;
    gap: 8px;
  }
  .actions .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  #menu-toggle,
  #sidebar-close {
    display: none !important;
  }
  .sidebar {
    position: fixed !important;
    bottom: 25px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    width: 70% !important;
    max-width: 340px !important;
    height: 70px !important;
    padding: 0 15px !important;
    z-index: 2000 !important;
    background: rgba(25, 25, 25, 0.72) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 35px !important;
    box-shadow:
      0 15px 35px rgba(0, 0, 0, 0.3),
      inset 0 -1px 2px rgba(255, 255, 255, 0.12) !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    touch-action: none;
    transition:
      transform 0.25s cubic-bezier(0.25, 1, 0.5, 1),
      opacity 0.2s !important;
  }
  body.chat-opened .sidebar {
    transform: translate(-50__, 100px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  .sidebar > .brand,
  .sidebar > div:last-child {
    display: none;
  }
  .nav-links {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  .nav-item {
    margin: 0;
    padding: 0;
    border-radius: 20px;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    width: 55px;
    height: 55px;
    flex: 1 1 0;
    max-width: 25%;
    transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .nav-item span {
    display: block !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    margin-top: 1px !important;
    margin-left: 0 !important;
    letter-spacing: 0.1px !important;
    line-height: 1.2 !important;
    pointer-events: none !important;
    max-width: 80px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .nav-item.active {
    background: rgba(255, 255, 255, 0.22);
    color: var(--primary);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: none;
  }
  .main-content {
    padding-bottom: 0;
  }
  .content-area {
    padding: 15px 10px;
    padding-bottom: calc(95px + env(safe-area-inset-bottom, 0px));
  }
  .file-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .file-icon {
    margin: 0 15px 0 0;
  }
  .file-menu-btn {
    opacity: 1;
    display: flex;
  }
  .modal {
    padding: 20px 15px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
  }
  .repo-item {
    padding: 1.25rem 1rem;
    margin-bottom: 0.75rem;
    gap: 1rem;
  }
  .repo-info h4 {
    font-size: 1.05rem;
    margin-bottom: 8px;
  }
  .repo-info p {
    font-size: 0.9rem;
    margin: 4px 0;
  }
  .profile-card {
    padding: 25px 15px;
    margin: 1rem;
    width: auto;
  }
  .profile-avatar {
    width: 50px;
    height: 50px;
    font-size: 24px;
    margin-bottom: 12px;
  }
  .profile-card .profile-avatar {
    max-width: 50px;
    max-height: 50px;
    overflow: hidden;
  }
  .profile-card .profile-avatar img,
  .profile-card .profile-avatar > div {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
  }
  .profile-avatar ~ h2 {
    margin-top: 12px;
    margin-bottom: 8px;
  }
  .storage-box {
    margin-top: 20px;
    padding: 15px;
  }
  .file-list {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem 0.75rem;
    padding: 1rem 0.5rem;
  }
  .file-item {
    align-items: center;
    padding: 16px 12px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .file-icon {
    width: 56px;
    height: 56px;
    font-size: 2rem;
    margin-bottom: 10px;
  }
  .file-name {
    font-size: 0.85rem;
    margin-bottom: 6px;
    line-height: 1.3;
  }
  .file-meta {
    font-size: 0.75rem;
    margin-top: 4px;
  }
  .modal-header {
    padding: 15px;
    gap: 10px;
  }
  .modal-body {
    padding: 15px;
  }
  .modal-footer {
    padding: 12px 15px;
    gap: 8px;
  }
  .btn {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  .form-group {
    margin-bottom: 16px;
  }
  .form-control {
    padding: 12px;
    font-size: 1rem;
  }
  .sidebar {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
  }
}
.chat-item,
.message-bubble,
.message-button,
body,
html {
  touch-action: manipulation;
}
.streak-ribbon-container::-webkit-scrollbar {
  height: 8px;
  display: none;
}
.streak-ribbon-container::-webkit-scrollbar-track {
  background: 0 0;
}
.streak-ribbon-container::-webkit-scrollbar-thumb {
  background-color: var(--gray-300);
  border-radius: 10px;
}
.streak-ribbon-container::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary);
}
@media (max-width: 480px) {
  .breadcrumbs {
    font-size: 0.75rem;
    gap: 2px;
    min-height: 24px;
  }
  .breadcrumb-item {
    padding: 3px 6px;
    font-size: 0.7rem;
    min-height: 24px;
    display: flex;
    align-items: center;
  }
  .toolbar {
    height: 44px !important;
    min-height: 44px !important;
  }
  :root {
    --header-height: 44px;
  }
  .file-list {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem 0.5rem;
    padding: 0.75rem;
  }
  .file-item {
    padding: 12px 10px;
  }
  .file-icon {
    width: 48px;
    height: 48px;
    font-size: 1.75rem;
    margin-bottom: 8px;
  }
  .file-name {
    font-size: 0.8rem;
  }
  .profile-card {
    margin: 0.75rem 0.5rem;
  }
  .repo-item {
    padding: 1rem 0.75rem;
    margin-bottom: 0.5rem;
  }
  .repo-info h4 {
    font-size: 1rem;
    margin-bottom: 6px;
  }
  .modal-content {
    width: 98%;
  }
  .auth-card {
    margin: 0.5rem;
    width: 95%;
  }
  .profile-card {
    align-items: flex-start;
    text-align: left;
    padding: 16px 12px;
  }
  .profile-avatar {
    width: 48px !important;
    height: 48px !important;
    font-size: 18px !important;
    margin-bottom: 8px !important;
    box-shadow: none !important;
  }
  .profile-avatar ~ h2 {
    margin-top: 6px !important;
    font-size: 1rem !important;
  }
  .profile-card .profile-avatar {
    max-width: 48px;
    max-height: 48px;
    overflow: hidden;
  }
  .profile-card .profile-avatar img,
  .profile-card .profile-avatar > div {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
  }
}
.streak-card {
  flex: 0 0 auto;
  background: var(--bg-surface);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 15px;
  text-align: center;
  scroll-snap-align: center;
  transition: all 0.25s var(--motion-spring);
  position: relative;
}
.streak-card.available {
  border-color: var(--warning);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2);
  transform: translateY(-5px);
  background: #fffdf5;
}
.streak-card.milestone {
  background: linear-gradient(135deg, #fffbeb 0, #fef3c7 100%);
  border-color: var(--warning);
}
.streak-card-day {
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 12px;
  font-size: 0.9rem;
  letter-spacing: 1px;
}
.streak-card-rewards {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.4;
}
.streak-card-status {
  font-size: 0.75rem;
  margin-top: 12px;
  font-weight: 700;
}
.streak-card.completed {
  opacity: 0.6;
  border-color: var(--success);
  background: #f0fdf4;
}
.message-caption del,
.message-caption s,
.message-text del,
.message-text s,
.streak-card.completed .streak-card-day {
  text-decoration: line-through;
}
#the-box .svg-box {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.4));
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  will-change: transform, filter;
}
.modal-overlay {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.modal {
  animation: 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards modalFadeIn;
}
@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal-overlay {
  animation: 0.2s ease-out forwards overlayFadeIn;
}
.toolbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: 0 0;
}
::-webkit-scrollbar-thumb {
  background-color: var(--gray-300);
  border-radius: 10px;
  border: 2px solid var(--gray-100);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary);
}
.file-item {
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.file-icon {
  font-size: 2.2rem;
  width: 60px;
  height: 60px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  transition: transform 0.2s var(--motion-spring);
}
.file-item:hover .file-icon {
  transform: scale(1.1) rotate(3deg);
}
#login-screen {
  background: radial-gradient(
    circle at top right,
    #e0e7ff 0,
    var(--bg-body) 100%
  );
}
[data-theme="dark"] #login-screen {
  background: radial-gradient(
    circle at top right,
    #0f1017 0,
    var(--bg-body) 100%
  );
}
[data-theme="classic"] #login-screen {
  background: radial-gradient(
    circle at top right,
    #d4d4d4 0,
    var(--bg-body) 100%
  );
}
.login-screens-container {
  position: relative;
  width: 100%;
  min-height: 380px;
  overflow: hidden;
}
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  transition:
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 0;
  left: 0;
  padding: 0 4px;
}
.login-screen.active,
.login-screen.active-reverse {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}
.login-screen.slide-out-left {
  opacity: 0;
  transform: translateX(-24px);
  pointer-events: none;
}
.login-screen-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  text-align: center;
  width: 100%;
}
.login-qr-status-row,
.login-screen-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.login-screen-desc {
  margin-bottom: 18px;
  text-align: center;
  line-height: 1.4;
}
.login-qr-box {
  width: 200px;
  height: 200px;
  background: #fff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
  flex-shrink: 0;
}
.login-qr-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.login-qr-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: 2s ease-in-out infinite login-pulse-dot;
}
.login-qr-timer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-bottom: 20px;
}
@keyframes login-pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}
.login-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.login-actions-primary {
  flex-direction: row;
  gap: 10px;
}
.login-back-btn,
.login-btn {
  align-items: center;
  display: flex;
  cursor: pointer;
}
.login-btn {
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  outline: 0;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  flex: 1;
  min-height: 48px;
}
.login-btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 12px var(--primary-glow);
}
.login-btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--primary-glow);
}
.login-btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}
.login-btn-secondary:hover {
  background: var(--bg-body);
  border-color: var(--primary);
  color: var(--primary);
}
.login-btn-ghost {
  background: 0 0;
  color: var(--text-muted);
  flex: none;
  padding: 10px 14px;
  min-height: 40px;
  font-size: 0.83rem;
}
.login-btn-full {
  width: 100%;
  flex: none;
  margin-top: 6px;
}
.login-back-btn {
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-surface);
  color: var(--text-main);
  transition: 0.2s;
  margin-bottom: 12px;
  align-self: flex-start;
  margin-left: -4px;
  flex-shrink: 0;
}
.login-back-btn:hover {
  background: var(--bg-body);
  color: var(--primary);
  transform: translateX(-2px);
}
.login-back-btn:active {
  transform: scale(0.92) translateX(-2px);
}
.login-link-btn {
  background: 0 0;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 10px 0;
  transition: color 0.2s;
  margin-top: 0;
}
.chat-header-status.bot,
.chat-header-status.typing,
.chat-search-input:focus + .chat-search-icon,
.login-input-toggle:hover,
.login-link-btn:hover {
  color: var(--primary);
}
.login-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--bg-body);
  border: 1.5px solid var(--border-light);
  border-radius: 14px;
  padding: 0 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  margin-bottom: 6px;
}
.login-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.login-input-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.6;
}
.login-input-wrapper:focus-within .login-input-icon {
  color: var(--primary);
  opacity: 1;
}
.login-input {
  flex: 1;
  background: 0 0;
  border: none;
  outline: 0;
  color: var(--text-main);
  font-size: 1rem;
  padding: 14px 0;
  font-family: inherit;
  min-width: 0;
}
.login-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}
.login-input-code {
  font-size: 1.4rem;
  letter-spacing: 6px;
  text-align: center;
  font-weight: 600;
  padding: 16px 0;
}
.login-input-toggle {
  background: 0 0;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  flex-shrink: 0;
}
.login-twofa-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--primary);
}
.login-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 10px 0;
  margin-bottom: 4px;
  width: 100%;
}
.login-terms-checkmark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-light);
  background: var(--bg-body);
  flex-shrink: 0;
  position: relative;
  transition: 0.2s;
  margin-top: 1px;
}
.login-terms-label input:checked + .login-terms-checkmark {
  background: var(--primary);
  border-color: var(--primary);
}
.login-terms-checkmark::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.15s;
}
.login-terms-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.login-terms-text a {
  color: var(--primary);
  text-decoration: none;
}
.instructor-arg.invalid,
.login-terms-text a:hover,
.message-caption u,
.message-link,
.message-sender-name:hover,
.message-text u {
  text-decoration: underline;
}
.login-hint-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
  text-align: center;
  margin-top: 10px;
}
#mobile-menu-dropdown,
.chat-layout .sidebar,
.platform-electron.electron-auth-ready #login-screen {
  display: none !important;
}
#toast-container,
.streak-ribbon-container,
.toast {
  display: flex;
  display: flex;
}
.login-box input {
  background: var(--bg-body);
  border: 1.5px solid var(--border-light);
}
.login-box input:focus {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
@media (min-width: 1400px) {
  .login-box {
    padding: 35px 40px;
    width: 480px;
  }
}
@media (max-width: 480px) {
  .login-screens-container {
    min-height: 340px;
  }
  .login-actions-primary {
    flex-direction: column;
  }
  .login-btn {
    padding: 11px 14px;
    font-size: 0.85rem;
    min-height: 44px;
  }
  .login-qr-box {
    width: 170px;
    height: 170px;
  }
  .login-box {
    padding: 30px 20px;
    width: 100%;
    border-radius: var(--radius-md);
    margin: 10px;
  }
  .login-box h2 {
    font-size: 1.4rem;
  }
}
.mailbox-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.25s var(--motion-spring);
  box-shadow: var(--shadow-xs);
}
#chat-input-area,
.toast {
  background: var(--glass-bg);
}
.streak-ribbon-container {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 15px;
  overflow-x: auto;
  padding: 10px 5px 20px;
}
.streak-card {
  flex: 0 0 auto !important;
  min-width: 140px;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  10%,
  30% {
    transform: translateX(-10px) rotate(-5deg);
  }
  20%,
  40% {
    transform: translateX(10px) rotate(5deg);
  }
  50% {
    transform: translateX(-5px) rotate(-2deg);
  }
  60% {
    transform: translateX(5px) rotate(2deg);
  }
  70% {
    transform: translateX(-3px) rotate(-1deg);
  }
  80% {
    transform: translateX(3px) rotate(1deg);
  }
  90% {
    transform: translateX(-1px) rotate(0);
  }
}
@keyframes explode {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}
@keyframes zoomIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes particle {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}
@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}
@keyframes rainbow {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}
@keyframes bounce-in {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}
@keyframes bounce-text {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes slideInUp {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes rotate {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
#update-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}
#update-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
#update-button:hover i[data-lucide="refresh-ccw"] {
  animation: 1s linear infinite rotate;
}
.particle {
  position: absolute;
  font-size: 20px;
  animation: 1s ease-out forwards particle;
  pointer-events: none;
  z-index: 10000;
}
#toast-container {
  top: 20px;
  right: 20px;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
.toast {
  min-width: 0;
  max-width: min(520px, calc(100vw - 32px));
  width: auto;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-border);
  transform: translateX(120%);
  transition: all 0.4s var(--motion-pop);
  pointer-events: auto;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.toast.show {
  transform: translateX(0);
}
.toast.error {
  border-left: 4px solid var(--danger);
  background: linear-gradient(135deg, var(--glass-bg), var(--danger-soft));
}
.toast.success {
  border-left: 4px solid var(--success);
  background: linear-gradient(135deg, var(--glass-bg), var(--success-soft));
}
.toast.info {
  border-left: 4px solid var(--primary);
  background: linear-gradient(135deg, var(--glass-bg), var(--primary-soft));
}
[data-theme="dark"] .toast {
  background: rgba(18, 19, 26, 0.92);
  border-color: rgba(255, 255, 255, 0.06);
}
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.member-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  transition: all 0.25s var(--motion-spring);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.member-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.2s;
}
.member-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 15px;
  box-shadow: 0 8px 16px var(--primary-glow);
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.member-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.member-username {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 15px;
  word-break: break-all;
}
.member-role {
  display: inline-block;
  background: #f1f5f9;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.member-role.owner {
  background: #fffbeb;
  color: var(--warning);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}
@media (max-width: 768px) {
  .members-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }
  #app,
  body {
    height: 100dvh;
    min-height: -webkit-fill-available;
  }
  body {
    padding: 0;
    min-height: 100dvh;
  }
  #app {
    width: 100vw;
    border-radius: 0;
    flex-direction: column;
    height: 100dvh;
  }
  .toolbar {
    padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 8px !important;
    height: auto !important;
    min-height: 50px !important;
  }
  @media (max-width: 480px) {
    .toolbar {
      min-height: 44px !important;
    }
  }
  #menu-toggle,
  #sidebar-close,
  .sidebar > .brand,
  .sidebar > div:first-child,
  .sidebar > div:last-child {
    display: none !important;
  }
  .nav-item,
  .nav-item.mobile-only-nav,
  .nav-links,
  .sidebar {
    display: flex;
  }
  .sidebar {
    position: fixed;
    bottom: 25px;
    left: 15px;
    right: 15px;
    top: auto;
    width: calc(100% - 30px);
    max-width: 100%;
    height: 70px;
    padding: 0 10px;
    z-index: 2000;
    transform: none !important;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(99px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 26px;
    box-shadow:
      0 15px 35px rgba(0, 0, 0, 0.1),
      inset 0 -1px 2px rgba(255, 255, 255, 0.18);
    flex-direction: row;
  }
  .nav-links {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  .nav-item {
    margin: 0;
    padding: 0;
    border-radius: 20px;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    width: 50px;
    height: 50px;
    flex: 1 1 0;
    max-width: 25%;
    transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .nav-item span {
    display: block !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    margin-top: 1px !important;
    margin-left: 0 !important;
    letter-spacing: 0.1px !important;
    line-height: 1.2 !important;
    pointer-events: none !important;
    max-width: 80px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid var(--primary-glow);
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: none;
  }
  [data-theme="dark"] .nav-item.active {
    background: rgba(127, 156, 245, 0.15);
    border-color: rgba(127, 156, 245, 0.25);
  }
  [data-theme="classic"] .nav-item.active {
    background: rgba(0, 74, 153, 0.15);
    border-color: rgba(0, 74, 153, 0.3);
  }
  .main-content {
    padding-bottom: 0;
    margin-bottom: 0;
  }
  .content-area {
    padding: 15px 10px;
    padding-bottom: calc(95px + env(safe-area-inset-bottom, 0px));
  }
  #main-view,
  .storage-box {
    padding: 15px;
  }
  .toolbar {
    padding-left: 15px;
    padding-right: 15px;
  }
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
  .storage-box {
    border-radius: 6px;
  }
  .btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
  .login-box,
  .profile-card {
    padding: 20px;
  }
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  .login-box {
    border-radius: 12px;
    width: 100%;
    max-width: none;
  }
  h2 {
    font-size: 1.4rem !important;
  }
  h3 {
    font-size: 1.1rem !important;
  }
  .profile-avatar {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: column;
    gap: 10px !important;
  }
  .btn-danger,
  .btn-outline,
  .btn-primary {
    width: 100%;
  }
  #mobile-menu-dropdown {
    display: none !important;
    position: fixed;
    width: 250px;
    background: var(--bg-body);
    border: 1px solid var(--gray-200);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 998;
    overflow-y: auto;
    max-height: min(60dvh, calc(100dvh - 110px));
    right: 8px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  #mobile-menu-dropdown.open {
    display: flex;
    animation: 0.3s slideUpMobile;
  }
  @keyframes slideUpMobile {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .mobile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: 0 0;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
    border-left: 3px solid transparent;
  }
  .mobile-dropdown-item:hover {
    background: var(--bg-secondary);
    border-left-color: var(--primary);
  }
  .mobile-dropdown-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  [data-theme="dark"] #mobile-menu-dropdown {
    background: var(--bg-body);
    border-color: rgba(255, 255, 255, 0.1);
  }
  [data-theme="dark"] .mobile-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary);
  }
  #user-menu-dropdown {
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    right: 12px !important;
    bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important;
    width: min(92vw, 320px) !important;
    max-height: min(80dvh, calc(100dvh - 40px));
    transform: none;
    overflow: hidden;
  }
  #user-menu-dropdown > div:last-child {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
  }
}
.profile-card.is-premium {
  background: linear-gradient(180deg, #fff 0, #faf5ff 100%);
  border: 1px solid #f3e8ff;
  box-shadow:
    0 15px 35px rgba(168, 85, 247, 0.12),
    0 5px 15px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}
.profile-card.is-premium::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #a855f7 0, #ec4899 50%, #f59e0b 100%);
}
.premium-status-title {
  margin-top: 12px;
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(90deg, #a855f7 0, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
.premium-status-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.platform-electron #title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  -webkit-app-region: drag;
  user-select: none;
}
.platform-electron .main-content {
  flex-direction: column;
}
.platform-electron #app {
  height: 100vh;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.main-content {
  margin-bottom: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
  position: relative;
}
.messenger-container {
  display: flex;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  position: relative;
  padding-bottom: 0;
}
.profile-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-body);
  color: var(--text-main);
  font-family: inherit;
  transition: 0.2s;
}
.chat-layout,
.chat-sidebar,
.profile-input:focus {
  background: var(--bg-surface);
}
.profile-input:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.chat-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}
.chat-sidebar {
  width: 320px;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  transition: 0.3s;
  position: relative;
}
.chat-sidebar::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--border-medium),
    transparent
  );
}
@media (max-width: 768px) {
  [data-theme="dark"] .sidebar {
    background: rgba(30, 30, 30, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }
  .chat-sidebar {
    width: 100%;
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
    transform: translateX(0);
    transition: transform 0.28s;
    will-change: transform;
    z-index: 30;
    padding-top: 50px;
  }
  .chat-sidebar.hidden {
    transform: translateX(-100%);
    pointer-events: none;
  }
  .chat-main {
    position: relative;
    z-index: 1;
  }
  .chat-search-wrapper {
    gap: 8px !important;
  }
  .chat-sidebar-header {
    padding: 12px 10px;
  }
  #chat-plus-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--motion-spring);
    box-shadow: 0 2px 8px var(--primary-glow);
  }
  #chat-plus-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px var(--primary-glow);
  }
  #chat-plus-btn:active {
    transform: scale(0.95);
  }
  #chat-plus-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
  .chat-search-input {
    min-width: 0;
    font-size: 13px;
    padding: 8px 10px 8px 32px;
  }
  .chat-search-icon {
    left: 8px;
    width: 14px;
    height: 14px;
  }
}
.chat-item,
.chat-item::before {
  transition: all 0.2s var(--motion-spring);
}
.chat-sidebar-header {
  border-bottom: 1px solid var(--border-light);
}
#input-context-menu .input-ctx-header i,
.chat-blocked-banner .btn-join-group .lucide,
.chat-blocked-banner .btn-unblock .lucide,
.chat-search-icon,
.editor-send-btn svg {
  width: 16px;
  height: 16px;
}
.call-avatars-duo > div,
.chat-search-container {
  position: relative;
}
.chat-search-input {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-body);
  color: var(--text-main);
}
.chat-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.chat-search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 0;
}
.chat-item,
.chat-main-header {
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
}
.chat-item-last-msg,
.chat-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-item {
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}
.chat-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transform: scaleY(0);
}
.bot-command-item:hover,
.chat-item.active,
.chat-item:hover,
.sticker-pack-tab:hover,
.tg-settings-row:hover {
  background: var(--primary-soft);
}
.chat-item:active {
  background: rgba(0, 0, 0, 0.04);
  transition:
    transform 60ms,
    background 60ms;
}
[data-theme="dark"] .chat-item:active {
  background: rgba(255, 255, 255, 0.04);
}
.chat-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}
.chat-item-info {
  flex: 1;
  min-width: 0;
}
.chat-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.chat-item-name {
  font-weight: 600;
  color: var(--text-main);
}
.chat-item-time {
  font-size: 11px;
  color: var(--text-muted);
}
.chat-item-last-msg {
  font-size: 13px;
  color: var(--text-muted);
}
.chat-item-unread,
.status-dot.bot,
[data-theme="classic"] .message-row.sent .message-bubble {
  background: var(--primary);
}
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-body);
  position: relative;
  padding-bottom: 0;
  overflow-x: hidden;
}
.chat-main-header {
  padding: 12px 20px;
  background: var(--bg-surface);
  z-index: 5;
}
.chat-header-name {
  font-weight: 600;
  color: var(--text-main);
}
.chat-header-status {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.call-avatars-duo .call-avatar-mic.talking,
.call-status-text.connected,
.chat-header-status.online {
  color: var(--success);
}
.bot-command-item .cmd-desc,
.chat-blocked-banner .blocked-text,
.chat-header-status.offline,
.instructor-arg {
  color: var(--text-muted);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.chat-date-separator,
.message-row {
  width: 100%;
  display: flex;
}
.call-ping-dot.good,
.call-vu-fill.talking,
.status-dot.online {
  background: var(--success);
}
.status-dot.offline {
  background: var(--gray-400);
}
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: calc(var(--header-height, 70px) + 12px) 20px
    calc(120px + env(safe-area-inset-bottom, 0px)) 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.chat-date-separator {
  justify-content: center;
  align-items: center;
  margin: 8px 0;
  user-select: none;
}
.chat-date-separator span {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .chat-date-separator span {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}
.message-row.sent {
  justify-content: flex-end;
}
.message-row.received {
  justify-content: flex-start;
}
.message-bubble {
  border-radius: 18px;
  user-select: none;
  -webkit-user-select: none;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.message-row.sent .message-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.message-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.message-button {
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: inherit;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  -webkit-user-select: none;
}
.image-editor-overlay,
.image-viewer-overlay,
.message-spoiler {
  user-select: none;
  user-select: none;
}
.message-button:hover {
  filter: brightness(0.96);
}
.message-button:active {
  background: rgba(255, 255, 255, 0.28);
  filter: brightness(0.9);
  transition:
    transform 80ms,
    filter 80ms,
    background 80ms;
}
[data-theme="dark"] .message-button:hover {
  filter: brightness(1.1);
}
[data-theme="dark"] .message-button:active {
  background: rgba(255, 255, 255, 0.2);
  filter: brightness(1.2);
}
.message-row.received .message-button:active {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}
[data-theme="dark"] .message-row.received .message-button:active,
[data-theme="dark"] .message-row.sent .message-button {
  background: rgba(255, 255, 255, 0.14);
}
.message-row.received .message-bubble {
  background: var(--bg-surface);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .message-row.received .message-bubble {
  background: rgba(26, 27, 35, 0.8);
  border-color: rgba(255, 255, 255, 0.04);
}
#chat-input-area,
.chat-blocked-banner {
  border-top: 1px solid var(--border-light);
}
.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.8;
}
.message-status {
  display: flex;
  align-items: center;
}
.message-edited-indicator {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  opacity: 0.65;
  font-style: italic;
}
.chat-blocked-banner .btn-unblock,
.ctx-header {
  font-weight: 500;
  align-items: center;
  display: flex;
}
.message-edited-indicator .lucide {
  width: 10px;
  height: 10px;
}
.chat-online-badge,
.ctx-header .lucide {
  width: 12px;
  height: 12px;
}
.message-link {
  color: var(--primary);
  word-break: break-all;
  cursor: pointer;
  transition: opacity 0.2s;
}
.message-link:hover {
  opacity: 0.8;
}
.message-row.sent .message-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration-color: rgba(255, 255, 255, 0.4);
}
.message-row.received .message-link {
  color: var(--primary-light, #2d6a7e);
}
.ctx-header {
  padding: 8px 16px 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  gap: 5px;
  opacity: 0.75;
}
.chat-blocked-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
}
.chat-blocked-banner .btn-unblock {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--danger);
  background: 0 0;
  color: var(--danger);
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
  gap: 6px;
}
.chat-blocked-banner .btn-unblock:hover {
  background: var(--danger);
  color: #fff;
}
.chat-blocked-banner .btn-join-group {
  border: 1px solid var(--primary);
  background: 0 0;
  color: var(--primary);
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-edit-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
  font-size: 13px;
  color: #3b82f6;
}
.chat-edit-bar .lucide,
.link-preview-bar .lucide {
  width: 14px;
  height: 14px;
}
.chat-edit-bar .edit-bar-close {
  margin-left: auto;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: 0.15s;
  border-radius: 50%;
}
.chat-edit-bar .edit-bar-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}
#chat-input-area {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-direction: column;
  align-items: stretch;
}
.chat-input-wrapper {
  flex: 1;
  background: var(--bg-body);
  border: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
}
.chat-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.chat-input {
  flex: 1;
  color: var(--text-main);
  resize: none;
  font-family: inherit;
}
.btn-send {
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--motion-spring);
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-send:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px var(--primary-glow);
  background: var(--primary-hover);
}
.btn-scroll-bottom:active,
.btn-send:active,
.call-btn:active {
  transform: scale(0.92);
}
.link-preview-bar {
  display: none;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
  font-size: 13px;
  color: #10b981;
  animation: 0.2s ease-out slideInUp;
}
.link-preview-bar-toggle {
  margin-left: auto;
  background: 0 0;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  cursor: pointer;
  font-size: 12px;
  color: #10b981;
  transition: 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
#app,
.user-search-results {
  background: var(--bg-surface);
}
.link-preview-bar-toggle:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
}
.link-preview-bar-toggle.active {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 40px;
  text-align: center;
}
.user-search-results {
  flex: 1;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.search-result-item:hover,
.storage-cat-item:hover {
  background: var(--bg-secondary);
}
.attachment-menu-item i,
.chat-header i,
.chat-item i,
.editor-undo-btn svg {
  width: 18px;
  height: 18px;
}
.chat-online-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--success);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}
.chat-bot-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  background: var(--primary, #3b82f6);
  padding: 1px 5px;
  border-radius: 8px;
  border: 2px solid var(--bg-surface);
  line-height: 1.3;
  white-space: nowrap;
}
.chat-item-unread {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 4px var(--primary-glow);
}
.login-icons-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}
.login-proxy-corner-btn {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.platform-capacitor .login-proxy-corner-btn,
.platform-electron .login-proxy-corner-btn,
.status-dots {
  display: inline-flex;
}
.login-proxy-corner-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}
#proxy-login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: var(--bg-body);
  flex-direction: column;
}
#proxy-login-overlay .proxy-login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface);
  flex-shrink: 0;
}
#proxy-login-overlay .proxy-login-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}
#proxy-login-overlay .proxy-login-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.login-icon-micloud,
.login-icon-minid {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  background-color: var(--bg-surface);
}
.login-icon-micloud {
  z-index: 1;
  border: 4px solid #fff;
}
.login-icon-minid {
  z-index: 2;
  margin-left: -24px;
  border: 4px solid #fff;
}
[data-theme="dark"] .login-icon-micloud,
[data-theme="dark"] .login-icon-minid,
[data-theme="midnight"] .login-icon-micloud,
[data-theme="midnight"] .login-icon-minid {
  border-color: var(--bg-surface);
}
.platform-electron #title-bar,
.toolbar {
  border-bottom: 1px solid var(--border-light);
}
@media (max-width: 480px) {
  #main-view,
  .toolbar {
    padding: 10px;
  }
  .toolbar {
    flex-direction: column;
    gap: 10px;
  }
  .login-box,
  .profile-card {
    padding: 15px;
  }
  h2 {
    font-size: 1.2rem !important;
  }
  h3 {
    font-size: 1rem !important;
  }
  .profile-avatar {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  input,
  select,
  textarea {
    padding: 8px 10px !important;
    font-size: 16px !important;
  }
  .btn {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  [style*="display: flex"][style*="justify-content: space-between"][style*="align-items: center"] {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .chat-sidebar {
    padding-top: 44px;
  }
  .login-icon-micloud,
  .login-icon-minid {
    width: 56px;
    height: 56px;
  }
  .login-icon-minid {
    margin-left: -18px;
  }
  .login-icons-wrapper {
    margin-bottom: 16px;
  }
  #user-menu-dropdown .profile-avatar,
  .profile-header .profile-avatar,
  .self-menu .avatar,
  .self-menu .profile-avatar,
  .user-menu .profile-avatar {
    width: 48px !important;
    height: 48px !important;
    font-size: 14px !important;
  }
  .self-menu .profile-info,
  .user-menu .profile-info {
    margin-left: 10px;
  }
  .profile-card {
    align-items: flex-start !important;
    text-align: left !important;
    padding: 12px !important;
  }
  .profile-card .profile-avatar,
  .profile-card img.profile-avatar {
    width: 48px !important;
    height: 48px !important;
    font-size: 18px !important;
    margin-bottom: 8px !important;
    box-shadow: none !important;
    max-width: 48px !important;
    max-height: 48px !important;
    overflow: hidden !important;
  }
  .profile-card .profile-avatar ~ h2 {
    margin-top: 6px !important;
    font-size: 1rem !important;
  }
}
@keyframes pulse-dot {
  0%,
  100%,
  80% {
    transform: scale(1);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.5);
    opacity: 1;
  }
}
.status-dots {
  gap: 3px;
  margin-left: 5px;
}
.status-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  background-color: currentColor;
  border-radius: 50%;
  animation: 1.4s ease-in-out infinite pulse-dot;
}
.status-dots span:first-child {
  animation-delay: -0.32s;
}
.status-dots span:nth-child(2) {
  animation-delay: -0.16s;
}
.status-dots span:nth-child(3) {
  animation-delay: 0s;
}
@keyframes rotate-spinner {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}
.status-spinner {
  display: inline-block;
  vertical-align: -0.1em;
  transform-origin: center center;
  animation-name: rotate-spinner;
  animation-duration: 1s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}
.reply-sender,
.reply-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body {
  line-height: 1.65;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  background-image:
    radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.05),
      transparent 40%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(16, 185, 129, 0.05),
      transparent 30%
    );
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(
      circle at top left,
      rgba(127, 156, 245, 0.04),
      transparent 40%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(16, 185, 129, 0.03),
      transparent 30%
    );
}
[data-theme="classic"] body {
  background-image: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.25;
  letter-spacing: -0.025em;
}
h2 {
  font-size: clamp(1.8rem, 2.25vw, 2.2rem);
}
h3 {
  font-size: clamp(1.35rem, 1.8vw, 1.6rem);
}
button,
input,
label,
p,
select,
textarea {
  line-height: 1.7;
}
.btn,
.chat-item,
.ctx-item,
.file-item,
.file-menu-btn,
.mail-item-card,
.mailbox-card,
.member-card,
.mobile-menu-btn,
.nav-item,
.profile-stat-item,
.repo-item,
.sticker-pack-card,
.streak-card,
.tab-btn,
.user-card,
button:not(.auth-tab):not(.nav-item):not(.theme-btn):not(.chat-tab) {
  transition:
    transform var(--motion-fast) var(--motion-spring),
    box-shadow var(--motion-fast) var(--motion-spring),
    background-color var(--motion-fast) var(--motion-spring),
    border-color var(--motion-fast) var(--motion-spring),
    color var(--motion-fast) var(--motion-spring),
    opacity var(--motion-fast) var(--motion-spring);
  will-change: transform, box-shadow;
  touch-action: manipulation;
}
.btn:hover:not(:active),
.chat-item:hover:not(:active),
.ctx-item:hover:not(:active),
.file-item:hover:not(:active),
.mail-item-card:hover:not(:active),
.mailbox-card:hover:not(:active),
.member-card:hover:not(:active),
.mobile-menu-btn:hover:not(:active),
.nav-item:hover:not(:active),
.profile-stat-item:hover:not(:active),
.repo-item:hover:not(:active),
.sticker-pack-card:hover:not(:active),
.tab-btn:hover:not(:active),
.user-card:hover:not(:active) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
#app {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
}
.sidebar {
  border-right: none;
  box-shadow: inset -1px 0 0 var(--border-light);
  background: var(--bg-sidebar);
}
.toolbar {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
[data-theme="dark"] .toolbar {
  background: rgba(18, 19, 26, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
[data-theme="classic"] .toolbar {
  background: rgba(245, 245, 245, 0.9);
  backdrop-filter: none;
}
.btn-primary {
  transition:
    transform var(--motion-fast) var(--motion-pop),
    box-shadow var(--motion-fast) var(--motion-pop),
    background-color var(--motion-fast) var(--motion-pop);
}
.btn-primary:hover {
  box-shadow: 0 12px 32px var(--primary-glow);
}
.btn-danger:hover,
.btn-outline:hover {
  transform: translateY(-1px);
}
.theme-btn.active,
.theme-btn:hover {
  transform: translateY(-2px) !important;
}
[data-theme="dark"] .sidebar {
  background: rgba(14, 15, 21, 0.88);
  border-right: none;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}
[data-theme="dark"] #app {
  background: rgba(15, 15, 20, 0.92);
}
[data-theme="dark"] .btn-primary {
  box-shadow: 0 12px 32px rgba(127, 156, 245, 0.15);
}
.platform-electron #title-bar {
  background: var(--glass-bg);
  box-shadow: none;
}
.platform-electron [data-theme="dark"] #title-bar {
  background: rgba(18, 19, 26, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.reply-block {
  background: rgba(0, 0, 0, 0.04);
  border-left: 3px solid var(--primary);
  padding: 6px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  transition: background 0.2s;
}
.reply-block:hover {
  background: rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .reply-block {
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .reply-block:hover {
  background: rgba(255, 255, 255, 0.1);
}
.message-row.sent .reply-block {
  background: rgba(255, 255, 255, 0.12);
  border-left-color: rgba(255, 255, 255, 0.5);
}
.message-row.sent .reply-block:hover {
  background: rgba(255, 255, 255, 0.18);
}
.reply-sender {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}
.message-row.sent .reply-sender {
  color: #fff;
  opacity: 0.95;
}
.reply-text {
  color: var(--text-muted);
}
.message-row.sent .poll-voted-count,
.message-row.sent .reply-text {
  color: rgba(255, 255, 255, 0.8);
}
.message-caption {
  margin-top: 8px;
  font-size: 0.95rem;
  color: inherit;
  line-height: 1.4;
}
.reply-preview-area {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  display: none;
  align-items: center;
  animation: 0.2s ease-out slideInUp;
}
.reply-preview-content {
  flex: 1;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
  overflow: hidden;
}
.reply-preview-title {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
}
.reply-preview-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-close-reply:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}
.message-avatar-group {
  margin-right: 8px;
  flex-shrink: 0;
  margin-bottom: 2px;
  align-self: flex-end;
}
.message-sender-name {
  font-size: 13px;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 3px;
  display: block;
  cursor: pointer;
}
@media (max-width: 768px) {
  #chat-input-area {
    padding-bottom: 12px;
    bottom: calc(0px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .messages-container {
    padding-bottom: 120px;
  }
  .chat-layout .sidebar {
    display: none !important;
  }
  .sidebar {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    height: 65px !important;
    width: calc(100% - 20px) !important;
    left: 10px !important;
    right: 10px !important;
  }
  .nav-links {
    justify-content: space-evenly !important;
    gap: 5px;
  }
  .chat-list {
    padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .messages-container {
    padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .content-area {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .chat-container,
  .chat-list,
  .messages,
  .messages-container {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 12px));
  }
  .chat-spacer-mobile {
    display: block;
    height: calc(64px + env(safe-area-inset-bottom, 12px));
  }
}
@media (min-width: 769px) {
  #app.sidebar-open::before,
  #menu-toggle,
  #mobile-menu-dropdown,
  #sidebar-close,
  .sidebar {
    display: none !important;
  }
  .chat-spacer-mobile {
    display: none !important;
    height: 0 !important;
  }
}
.chat-exit-button {
  display: none;
  color: var(--text-main);
  background: 0 0;
  border: none;
}
@media (max-width: 768px) {
  .call-bar {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .chat-exit-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
  }
}
.theme-btn {
  color: var(--text-main) !important;
  background: var(--bg-surface) !important;
  border: 2px solid var(--border-light) !important;
  border-radius: var(--radius-sm) !important;
  padding: 12px 16px !important;
  font-weight: 600 !important;
  transition: all 0.2s var(--motion-spring) !important;
  position: relative;
  overflow: hidden;
}
.theme-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.2s;
}
.theme-btn.active,
[data-theme="dark"] .theme-btn.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}
.theme-btn:hover {
  border-color: var(--primary) !important;
  box-shadow: var(--shadow-hover) !important;
}
.theme-btn.active {
  color: #fff !important;
  box-shadow: 0 4px 16px var(--primary-glow) !important;
}
[data-theme="dark"] .theme-btn {
  background: rgba(26, 27, 35, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] .theme-btn.active {
  color: #0a0b10 !important;
}
[data-theme="classic"] .theme-btn {
  border-color: rgba(0, 0, 0, 0.2) !important;
}
@keyframes highlightPulse {
  0% {
    background: var(--primary-glow);
  }
  50% {
    background: rgba(67, 97, 238, 0.3);
  }
  100% {
    background: 0 0;
  }
}
.highlight-message .message-bubble {
  animation: 2s ease-out highlightPulse;
}
.message-spoiler {
  background-color: currentColor;
  -webkit-text-fill-color: transparent;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 4 0 0 0 -1.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 4 0 0 0 -1.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask-size: 200px;
  mask-size: 200px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.message-spoiler:not(.revealed) * {
  color: transparent !important;
  background-color: transparent !important;
  border-color: transparent !important;
  text-shadow: none !important;
}
.instructor-arg.filled.invalid,
.instructor-arg.invalid {
  text-decoration-color: var(--danger);
}
.message-spoiler.revealed {
  -webkit-text-fill-color: initial !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  animation: none !important;
}
.storage-donut-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
}
.storage-donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--border-light);
  transition: background 0.3s;
}
.storage-donut-inner {
  position: absolute;
  top: 35px;
  left: 35px;
  right: 35px;
  bottom: 35px;
  background: var(--bg-body);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .storage-donut-inner {
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}
.storage-donut-total {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}
.storage-donut-unit {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.storage-cat-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.2s;
  cursor: pointer;
}
.bot-command-item:last-child,
.storage-cat-item:last-child {
  border-bottom: none;
}
.storage-cat-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}
.storage-cat-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}
.storage-cat-percent {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}
.storage-cat-size {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.tg-slider {
  width: 100%;
  height: 4px;
  background: var(--border-medium);
  border-radius: 2px;
  margin: 15px 0;
}
.tg-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s;
}
.tg-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
}
.tg-checkbox-icon {
  color: var(--primary);
  transition: transform 0.2s;
}
.storage-cat-item.unchecked .tg-checkbox-icon {
  color: var(--border-medium);
}
.poll-bubble-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 4px;
}
.poll-header {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 2px;
}
.poll-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 4px;
}
.poll-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}
.poll-option-unvoted {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-light);
  cursor: pointer;
}
[data-theme="dark"] .poll-option-unvoted {
  background: rgba(255, 255, 255, 0.03);
}
.poll-option-unvoted:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.poll-option-unvoted .poll-option-text {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
}
.poll-option-voted {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
  width: 100%;
}
.poll-voted-left {
  width: 42px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  flex-shrink: 0;
  line-height: 1.2;
}
.poll-voted-check {
  margin-top: 3px;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.poll-voted-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.poll-voted-text-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-main);
}
.poll-voted-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  padding-right: 8px;
}
.poll-voted-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.poll-voted-track {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
  position: relative;
}
[data-theme="dark"] .poll-voted-track {
  background: var(--gray-700);
}
.poll-voted-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  transition: width 0.4s ease-out;
}
.tg-settings-group {
  background: var(--bg-surface);
  display: flex;
  box-shadow: var(--shadow-sm);
}
.message-row.sent .poll-desc {
  color: rgba(255, 255, 255, 0.7);
}
.message-row.sent .poll-option-unvoted {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}
.message-row.sent .poll-option-unvoted:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}
.message-row.sent .poll-voted-check {
  color: #fff !important;
}
.image-viewer-overlay .image-viewer-close:hover,
.message-row.sent .poll-voted-track,
.video-recording-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.message-row.sent .poll-voted-bar {
  background: #fff !important;
}
.poll-option-voted.correct .poll-voted-text {
  color: var(--success) !important;
  font-weight: 600;
}
.poll-option-voted.correct .poll-voted-check {
  color: var(--success) !important;
}
.poll-option-voted.correct .poll-voted-bar {
  background: var(--success) !important;
}
.poll-option-voted.incorrect .poll-voted-text {
  color: var(--danger) !important;
  font-weight: 600;
}
#context-menu .ctx-item[style*="color: var(--danger)"] i,
#context-menu .ctx-item[style*="color:var(--danger)"] i,
.poll-option-voted.incorrect .poll-voted-check {
  color: var(--danger) !important;
}
.poll-option-voted.incorrect .poll-voted-bar {
  background: var(--danger) !important;
}
.poll-selector-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  flex-shrink: 0;
}
.message-row.sent .poll-selector-circle {
  border-color: rgba(255, 255, 255, 0.5);
}
.poll-selector-circle.square {
  border-radius: 4px;
}
.tg-settings-group {
  border: 1px solid var(--border-light);
  flex-direction: column !important;
}
.tg-settings-label > .tg-icon-wrap i,
.tg-settings-label > .tg-icon-wrap svg,
.tg-settings-label > i,
.tg-settings-label > svg {
  width: 20px !important;
  height: 20px !important;
  color: var(--text-muted);
  flex-shrink: 0 !important;
}
.tg-settings-label,
.tg-settings-label span {
  color: var(--text-main);
  min-width: 0 !important;
}
.tg-settings-group {
  border-radius: 16px;
  border: 1px solid var(--border-light);
  padding: 6px 0;
  flex-direction: column;
  margin-bottom: 16px;
}
.tg-settings-label,
.tg-settings-row {
  flex-direction: row !important;
  display: flex;
}
.tg-settings-row {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}
.tg-settings-row:last-child {
  border-bottom: none !important;
}
.tg-settings-label {
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  flex: 1 !important;
}
.tg-settings-label span {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.tg-settings-value {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}
.toggle-switch {
  flex-shrink: 0 !important;
}
.tg-icon-wrap {
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.tg-icon-wrap i,
.tg-icon-wrap svg {
  width: 14px !important;
  height: 14px !important;
}
.tg-icon-blue {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
}
.tg-icon-orange {
  background: var(--warning-soft) !important;
  color: var(--warning) !important;
}
.tg-icon-green {
  background: var(--success-soft) !important;
  color: var(--success) !important;
}
.tg-icon-purple {
  background: rgba(139, 92, 246, 0.1) !important;
  color: #8b5cf6 !important;
}
.tg-icon-red {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}
.tg-icon-indigo {
  background: rgba(99, 102, 241, 0.1) !important;
  color: #6366f1 !important;
}
.tg-icon-gray {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--text-muted) !important;
}
@keyframes spin-clock {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}
.message-status-pending svg {
  animation: 1.5s linear infinite spin-clock;
}
.btn-scroll-bottom {
  position: absolute;
  bottom: 80px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-md);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: all 0.25s var(--motion-spring);
  padding: 0;
}
#input-context-menu .input-ctx-header,
#input-context-menu .input-ctx-item,
.message-link-preview {
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
}
.btn-scroll-bottom:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
  background: var(--primary);
  color: #fff;
}
.btn-scroll-bottom i,
.editor-tool-btn svg,
.image-editor-topbar .editor-btn svg {
  width: 20px;
  height: 20px;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.btn-scroll-bottom.show {
  display: flex;
  animation: fadeInUp 0.2s var(--motion-spring);
}
.message-row.sent .message-bubble.msg-failed {
  border: 1px solid var(--danger) !important;
  opacity: 0.8;
}
.message-spoiler {
  background: var(--text-main);
  user-select: none;
  position: relative;
  isolation: isolate;
}
.message-spoiler::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--text-main);
  border-radius: 3px;
  z-index: -1;
  transition: opacity 0.15s;
  opacity: 1;
}
.message-spoiler:not(:hover) {
  transform: scale(1);
}
.message-spoiler:focus,
.message-spoiler:hover {
  background: 0 0;
  color: inherit;
}
#input-context-menu .input-ctx-item {
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-main);
  user-select: none;
}
#input-context-menu .input-ctx-header:hover,
#input-context-menu .input-ctx-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
#input-context-menu .input-ctx-item:active,
.sticker-pack-tab.active {
  background: var(--primary-glow);
}
#input-context-menu .input-ctx-item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
#input-context-menu .input-ctx-item b,
#input-context-menu .input-ctx-item i:not([data-lucide]),
#input-context-menu .input-ctx-item s,
#input-context-menu .input-ctx-item u {
  font-weight: inherit;
  font-style: inherit;
  text-decoration: inherit;
  display: inline;
}
#input-context-menu .input-ctx-item > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
#input-context-menu .input-ctx-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
#input-context-menu .input-ctx-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}
#input-context-menu .input-ctx-header {
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
}
.message-spoiler:focus::before,
.message-spoiler:hover::before {
  opacity: 0.2;
}
.message-spoiler.revealed {
  background: 0 0 !important;
  color: inherit !important;
}
.message-spoiler.revealed::before {
  opacity: 0.2 !important;
}
.message-caption b,
.message-caption strong,
.message-text b,
.message-text strong {
  font-weight: 700;
}
.message-caption em,
.message-caption i,
.message-text em,
.message-text i {
  font-style: italic;
}
.message-caption code,
.message-code,
.message-text code {
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.85em;
  background: var(--gray-100);
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--text-main);
  word-break: break-word;
}
.image-editor-overlay,
.image-viewer-overlay .image-viewer-zoom-info {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
[data-theme="dark"] .message-caption code,
[data-theme="dark"] .message-code,
[data-theme="dark"] .message-text code {
  background: var(--gray-200);
}
[data-theme="classic"] .message-caption code,
[data-theme="classic"] .message-code,
[data-theme="classic"] .message-text code {
  background: #e0e0e0;
}
.message-link-preview {
  margin-top: 8px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-secondary);
  flex-direction: row;
  align-items: stretch;
}
.message-link-preview:hover {
  background: var(--hover-bg, rgba(128, 128, 128, 0.08));
}
.attachment-menu-item:hover,
.chat-attachment-btn:hover {
  background: rgba(67, 97, 238, 0.08);
  color: var(--primary);
}
.link-preview-image {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  overflow: hidden;
  background: var(--gray-100);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.attachment-menu,
.sticker-picker {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
}
.link-preview-description,
.link-preview-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-preview-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.link-preview-body {
  padding: 10px 12px;
  min-width: 0;
  flex: 1;
}
.link-preview-domain {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: lowercase;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 4px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.link-preview-description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.message-datetime {
  cursor: help;
  border-bottom: 1px dashed var(--border-light);
  padding-bottom: 1px;
  white-space: nowrap;
}
.message-row.sent .message-datetime {
  color: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.3);
}
.message-row.received .message-datetime {
  color: var(--primary);
  border-bottom-color: var(--border-light);
}
[data-theme="dark"] .message-row.received .message-datetime {
  border-bottom-color: var(--gray-600);
}
.chat-attachment-btn {
  color: var(--text-muted);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-attachment-btn:hover {
  transform: rotate(15deg);
}
.chat-attachment-btn i {
  width: 22px;
  height: 22px;
}
.attachment-menu {
  position: absolute;
  bottom: 70px;
  left: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), var(--glass-shadow);
  display: none;
  flex-direction: column;
  padding: 6px;
  min-width: 200px;
  z-index: 1000;
  border: 1px solid var(--glass-border);
  animation: menuPremiumIn 0.2s var(--motion-spring);
}
.attachment-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-main);
  font-weight: 500;
  transition: 0.2s;
}
.sticker-picker {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  flex-direction: column;
  border: 1px solid var(--glass-border);
  animation: menuPremiumIn 0.25s var(--motion-spring);
}
.sticker-picker-header {
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sticker-picker-content {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sticker-item {
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.message-file-card,
.message-image-card {
  margin-top: 4px;
  transition: 0.2s;
  cursor: pointer;
}
.sticker-picker-tabs {
  display: flex;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-light);
}
.sticker-pack-tab {
  width: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sticker-pack-tab img {
  width: 24px;
  height: 24px;
}
.message-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 200px;
}
.image-editor-topbar .editor-btn:hover,
.message-file-card:hover {
  background: rgba(255, 255, 255, 0.2);
}
.call-card-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.message-file-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.message-file-info {
  flex: 1;
  overflow: hidden;
}
.message-file-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-file-size {
  font-size: 0.75rem;
  opacity: 0.7;
}
.message-image-card {
  display: inline-block;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.message-image-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.message-image-card img {
  display: block;
  width: 100%;
  height: auto;
}
.message-image-card .image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.image-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  touch-action: none;
  -webkit-user-select: none;
}
.image-viewer-overlay .image-viewer-close {
  position: fixed;
  top: calc(40px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  font-size: 22px;
  transition: background 0.2s;
}
.image-viewer-overlay .image-viewer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.image-viewer-overlay .image-viewer-container:active {
  cursor: grabbing;
}
.image-viewer-overlay #image-viewer-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  transform-origin: center center;
  transition: none;
  pointer-events: none;
  touch-action: none;
  will-change: transform;
}
.image-viewer-overlay .image-viewer-zoom-info {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.editor-tool-btn:hover,
.image-editor-topbar .editor-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.image-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a2e;
  z-index: 20000;
  display: none;
  flex-direction: column;
  color: #fff;
  touch-action: none;
  -webkit-user-select: none;
}
.image-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  z-index: 10;
  min-height: 48px;
  flex-shrink: 0;
}
.image-editor-topbar .editor-btn {
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.image-editor-topbar .editor-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.image-editor-topbar .editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.editor-send-btn {
  background: var(--accent-color, #6c5ce7);
  border: none;
  color: #fff;
  padding: 6px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}
.editor-send-btn:hover,
.message-file-card .dl-open-btn:hover {
  opacity: 0.85;
}
.image-editor-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: #111;
}
.image-editor-canvas-wrap canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: crosshair;
  touch-action: none;
}
.image-editor-canvas-wrap canvas.editor-crop-mode {
  cursor: crosshair;
}
.image-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  flex-wrap: wrap;
  z-index: 10;
}
.editor-tool-btn {
  background: 0 0;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 9px;
  transition: 0.2s;
  position: relative;
}
.editor-tool-btn span {
  font-size: 9px;
  opacity: 0.7;
}
.editor-ar-btn.active,
.editor-tool-btn.active {
  background: var(--accent-color, #6c5ce7);
  color: #fff;
}
.editor-tool-separator {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
  flex-shrink: 0;
}
.editor-tool-options {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  flex-wrap: wrap;
  z-index: 10;
}
.editor-opt-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
.editor-opt-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.editor-color-picker {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: 0 0;
}
.editor-color-picker::-webkit-color-swatch-wrapper {
  padding: 2px;
}
.editor-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}
.editor-size-slider {
  width: 80px;
  height: 4px;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}
.editor-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color, #6c5ce7);
  cursor: pointer;
}
.editor-size-val {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  min-width: 24px;
  text-align: center;
}
.editor-crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  touch-action: none;
}
.editor-crop-rect {
  position: absolute;
  border: 2px dashed rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  cursor: move;
  touch-action: none;
}
.editor-crop-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 2px solid var(--accent-color, #6c5ce7);
  border-radius: 50%;
  z-index: 6;
  touch-action: none;
}
.editor-crop-handle.nw {
  top: -10px;
  left: -10px;
  cursor: nw-resize;
}
.editor-crop-handle.ne {
  top: -10px;
  right: -10px;
  cursor: ne-resize;
}
.editor-crop-handle.sw {
  bottom: -10px;
  left: -10px;
  cursor: sw-resize;
}
.editor-crop-handle.se {
  bottom: -10px;
  right: -10px;
  cursor: se-resize;
}
.editor-ar-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.editor-ar-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.editor-undo-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.editor-undo-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.editor-undo-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.editor-filter-slider {
  width: 120px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: 0;
}
.editor-filter-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color, #6c5ce7);
  cursor: pointer;
}
.call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(16px);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  animation: 0.25s ease-out forwards overlayFadeIn;
}
.call-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  width: 380px;
  max-width: 92%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  animation: modalPremiumIn 0.3s var(--motion-pop) forwards;
}
.call-e2ee-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 6px 12px;
  background: var(--primary-soft);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: help;
  user-select: none;
}
.call-e2ee-bar .e2ee-lock {
  opacity: 0.6;
  margin-right: 4px;
}
.call-e2ee-emojis {
  font-size: 1.1rem;
  letter-spacing: 2px;
}
.call-avatars-duo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 16px;
}
.call-avatars-duo .my-avatar {
  z-index: 2;
  margin-right: -12px;
}
.call-avatars-duo .their-avatar {
  z-index: 1;
}
.call-avatars-duo .call-avatar-mic {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: var(--bg-surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  font-size: 10px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.call-names-duo,
.call-stats-row {
  align-items: center;
  display: flex;
}
.call-names-duo {
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.call-names-duo .call-name-me {
  color: var(--text-muted);
  font-weight: 500;
}
.call-names-duo .call-name-sep {
  color: var(--text-muted);
  opacity: 0.4;
}
.call-names-duo .call-name-them,
.instructor-base {
  color: var(--text-main);
  font-weight: 700;
}
.call-stats-row {
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 0.75rem;
}
.call-ping-indicator,
.call-vu-meter {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
}
.call-ping-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.call-ping-dot.fair {
  background: var(--warning);
}
.call-bar-btn-end,
.call-ping-dot.bad {
  background: var(--danger);
}
.call-ping-text {
  color: var(--text-muted);
}
.call-vu-label {
  opacity: 0.5;
  font-size: 0.65rem;
}
.call-vu-bar {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-200);
  overflow: hidden;
}
.call-vu-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: var(--primary);
  transition: width 0.15s;
}
.call-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--primary);
  overflow: hidden;
}
.call-avatar img,
.video-note-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.call-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.call-status-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.call-status-text.connecting {
  color: var(--warning);
}
.call-timer {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 24px;
  display: none;
}
.call-actions-row {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.call-bar,
.call-btn {
  align-items: center;
  cursor: pointer;
}
.call-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  display: flex;
  justify-content: center;
  transition: all 0.2s var(--motion-spring);
  font-size: 24px;
  color: #fff;
  background: var(--gray-200);
}
.call-btn:hover {
  transform: scale(1.08);
}
.call-btn-accept {
  background: var(--success);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}
.call-btn-decline,
.call-btn-end {
  background: var(--danger);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}
.call-btn-decline {
  transform: rotate(135deg);
}
#toast-container,
.call-bar,
.video-note-duration {
  left: 50%;
  transform: translateX(-50%);
}
.call-bar-btn-mute,
.call-btn-mute,
.call-btn-toggle {
  background: var(--gray-200);
  color: var(--text-main);
}
.call-bar-btn-mute.active,
.call-btn-mute.active {
  background: var(--warning);
  color: #fff;
}
.call-btn-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}
.call-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
@keyframes ringPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    box-shadow: 0 0 0 24px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}
.call-btn-accept.ringing {
  animation: 1.5s infinite ringPulse;
}
.call-bar {
  position: fixed;
  bottom: 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  padding: 8px 20px 8px 12px;
  display: none;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  z-index: 1999;
  animation: slideUp 0.3s var(--motion-spring) forwards;
}
.call-bar-avatar,
.call-bar-btn {
  border-radius: 50%;
  display: flex;
}
.call-bar-avatar {
  width: 36px;
  height: 36px;
  background: var(--success-soft);
  align-items: center;
  justify-content: center;
  color: var(--success);
  overflow: hidden;
}
.call-bar-name,
.form-group input,
.form-group label,
[data-theme="dark"] .form-group input {
  color: var(--text-main);
}
.call-bar-avatar img,
.pack-sticker-item img,
.video-selfie-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.call-bar-info {
  display: flex;
  flex-direction: column;
}
.call-bar-name {
  font-size: 0.8rem;
  font-weight: 600;
}
.call-bar-duration {
  font-size: 0.7rem;
  color: var(--success);
}
.call-bar-actions {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}
.call-bar-btn {
  width: 32px;
  height: 32px;
  border: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
  transition: 0.15s;
}
.pack-sticker-item,
.sticker-pack-card,
.tab-btn {
  transition: 0.2s;
  cursor: pointer;
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
.message-file-card .dl-progress-wrap {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.message-file-card .dl-progress-track {
  width: 100%;
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
}
.message-file-card .dl-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #4338ca);
  border-radius: 3px;
  transition: width 0.2s linear;
}
.message-file-card .dl-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.message-file-card .dl-progress-pct {
  font-weight: 600;
  color: var(--primary);
}
.message-file-card .dl-open-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
[data-theme="dark"] .attachment-menu,
[data-theme="dark"] .sticker-picker {
  background: rgba(22, 22, 28, 0.96);
  border-color: rgba(255, 255, 255, 0.1);
}
.sticker-manager-modal,
.sticker-pack-editor-modal {
  max-width: 600px;
  width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sticker-manager-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: 0 0;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.sticker-packs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
}
.sticker-pack-name,
.sticker-pack-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sticker-pack-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.sticker-pack-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.sticker-pack-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.sticker-pack-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  width: 100%;
}
.sticker-pack-title {
  font-size: 0.8rem;
  opacity: 0.7;
  width: 100%;
}
.create-pack-form {
  max-width: 400px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
}
.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: 1rem;
}
.form-group input:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 69, 84, 0.1);
}
.pack-info-section {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 20px;
  margin-bottom: 20px;
}
[data-theme="dark"] .form-group input,
[data-theme="dark"] .sticker-pack-card {
  background: rgba(22, 22, 28, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
}
.pack-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.pack-stickers-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.pack-stickers-section h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.pack-stickers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}
.pack-sticker-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.pack-sticker-delete,
.voice-play-btn {
  border-radius: 50%;
  color: #fff;
  display: flex;
}
.pack-sticker-item:hover {
  transform: scale(1.05);
}
.pack-sticker-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(239, 68, 68, 0.9);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 12px;
}
[data-theme="dark"] .sticker-pack-card:hover,
[data-theme="dark"] .toast.info {
  border-color: var(--primary);
}
[data-theme="dark"] .form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 69, 84, 0.2);
}
body,
html {
  overscroll-behavior: none;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  position: fixed;
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
}
.voice-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  min-width: 200px;
}
.voice-play-btn {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: 0.2s;
}
.voice-play-btn.playing,
.voice-progress-line {
  background: var(--primary, #ef4444);
}
.voice-play-btn:hover {
  transform: scale(1.1);
}
.voice-waveform {
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  position: relative;
}
.voice-waveform .wave-bar {
  width: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: height 0.15s;
}
.voice-waveform .wave-bar.played {
  background: var(--text-muted);
  opacity: 0.5;
}
.toast,
.video-note-container.playing .video-note-play-icon {
  opacity: 0;
}
.voice-duration {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}
.voice-progress-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  pointer-events: none;
  transition: left 0.1s linear;
}
.voice-recording-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--danger, #ef4444);
  animation: 1.5s ease-in-out infinite pulse-border;
  flex: 1;
  min-width: 0;
}
.voice-cancel-btn,
.voice-recording-dot {
  border-radius: 50%;
  background: var(--danger, #ef4444);
}
@keyframes pulse-border {
  0%,
  100% {
    border-color: var(--danger, #ef4444);
  }
  50% {
    border-color: rgba(239, 68, 68, 0.3);
  }
}
.voice-recording-dot {
  width: 10px;
  height: 10px;
  animation: 0.8s ease-in-out infinite blink-red;
  flex-shrink: 0;
}
@keyframes blink-red {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
.voice-recording-timer {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--danger, #ef4444);
  min-width: 45px;
  flex-shrink: 0;
}
.voice-recording-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-cancel-btn {
  width: 36px;
  height: 36px;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.btn-cam,
.btn-mic,
.voice-send-btn {
  border-radius: 50%;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.voice-send-btn {
  width: 38px;
  height: 38px;
  background: var(--primary);
  color: #fff;
  border: none;
  justify-content: center;
  flex-shrink: 0;
}
.btn-cam,
.btn-mic {
  width: 36px;
  height: 36px;
  background: 0 0;
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
  justify-content: center;
  flex-shrink: 0;
  transition: 0.2s;
}
.btn-cam:hover,
.btn-mic:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-cam.recording,
.btn-mic.recording,
.video-recording-btn.stop {
  border-color: var(--danger, #ef4444);
  animation: 1s ease-in-out infinite pulse-btn;
}
.btn-cam.recording,
.btn-mic.recording {
  background: var(--danger, #ef4444);
  color: #fff;
}
@keyframes pulse-btn {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}
@keyframes spin {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}
.video-note-container {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  display: inline-block;
}
.video-note-container .video-note-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.2s;
}
.video-note-duration {
  position: absolute;
  bottom: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  pointer-events: none;
}
.video-selfie-preview {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  border: 3px solid var(--danger, #ef4444);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
  animation: 1.5s ease-in-out infinite pulse-border;
}
.video-recording-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.video-recording-timer {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
}
.video-recording-actions {
  display: flex;
  gap: 30px;
  margin-top: 20px;
}
.video-recording-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: 0.2s;
  backdrop-filter: blur(8px);
}
.video-recording-btn.stop {
  width: 64px;
  height: 64px;
  background: var(--danger, #ef4444);
}
button i,
button svg {
  pointer-events: none;
}
.message-spoiler {
  background-color: var(--text-main);
  color: transparent;
  border-radius: 4px;
  padding: 0 3px;
  cursor: pointer;
  user-select: none;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 4 0 0 0 -1.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 4 0 0 0 -1.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask-size: 200px;
  mask-size: 200px;
  animation: 10s linear infinite spoiler-shimmer;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: opacity 1s;
}
.toast,
.toast.error,
.toast.info,
.toast.success,
[data-theme="dark"] .toast {
  background: var(--bg-surface);
}
@keyframes spoiler-shimmer {
  0% {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
  100% {
    -webkit-mask-position: 200px 200px;
    mask-position: 200px 200px;
  }
}
.chat-list,
.content-area,
.messages-container,
.modal-body,
.user-search-results {
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
}
.chat-item,
.file-item,
.message-bubble {
  transform: translateZ(0);
  will-change: transform, opacity;
  contain: layout paint;
}
.btn,
.chat-item,
.nav-item {
  transition:
    transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
    background-color 0.2s,
    opacity 0.2s !important;
}
#title-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999999;
}
.platform-electron #title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-light);
  padding-left: 12px;
  -webkit-app-region: drag;
  user-select: none;
}
#title-bar-controls button,
.toast {
  display: flex;
  align-items: center;
  color: var(--text-main);
}
.toast.error,
[data-theme="dark"] .toast.error {
  border-color: var(--danger);
}
#title-bar-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}
#title-bar-controls {
  -webkit-app-region: no-drag;
  display: flex;
  height: 100%;
}
#title-bar-controls button {
  font-family: "Segoe MDL2 Assets", Arial;
  font-size: 10px;
  width: 46px;
  height: 100%;
  border: none;
  background: 0 0;
  cursor: pointer;
  transition: background-color 0.15s;
  justify-content: center;
}
#title-bar-controls button:hover {
  background-color: rgba(0, 0, 0, 0.1);
}
#title-bar-controls #close-btn:hover {
  background-color: #e81123;
  color: #fff;
}
.platform-electron #login-screen {
  top: 32px !important;
  height: calc(100% - 32px) !important;
}
.platform-electron #app {
  margin-top: 32px;
  height: calc(100vh - 32px) !important;
  border: none !important;
  border-radius: 0;
  width: 100vw;
}
#toast-container {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  align-items: center;
  width: 100%;
  max-width: 90vw;
}
.toast {
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-medium);
  font-weight: 500;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  transform: translateY(-25px) scale(0.95);
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.2s;
  will-change: transform, opacity;
}
.code-copy-btn,
.code-header {
  display: flex;
  font-size: 0.75rem;
  color: #abb2bf;
}
.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast.error {
  color: var(--text-main);
}
.toast.success {
  border-color: var(--success);
  color: var(--text-main);
}
.toast.info {
  border-color: var(--primary);
  color: var(--text-main);
}
[data-theme="dark"] .toast {
  border-color: var(--border-light);
}
[data-theme="dark"] .toast.success {
  border-color: var(--success);
}
.message-file-icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 12px;
}
.message-file-card .message-file-icon {
  margin: 0 !important;
}
.circular-progress {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
  pointer-events: none;
}
.circular-progress circle {
  fill: none;
  stroke-width: 2.5;
}
.circular-progress circle.bg {
  stroke: var(--border-medium);
}
.circular-progress circle.fg {
  stroke: var(--primary);
  stroke-dasharray: 119.38;
  stroke-dashoffset: 119.38;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}
.message-code-block {
  background: #282c34;
  border-radius: 8px;
  margin: 8px 0;
  overflow: hidden;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  user-select: text;
}
.code-header {
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #21252b;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border-bottom: 1px solid #181a1f;
  user-select: none;
}
.code-lang {
  font-weight: 600;
  text-transform: capitalize;
}
.code-copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
  padding: 4px 8px;
  border-radius: 4px;
}
.code-copy-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}
.code-copy-btn:active,
.reaction-badge:active {
  transform: scale(0.95);
}
.message-code-block pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.45;
}
.message-code-block code.hljs {
  background: 0 0;
  padding: 0;
  color: #abb2bf;
  white-space: pre;
}
.message-code-inline {
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.85em;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.2s;
  white-space: pre-wrap;
  word-break: break-word;
}
.message-code-inline:active {
  transform: scale(0.95);
  display: inline-block;
}
button *,
div[onclick] i,
div[onclick] img,
div[onclick] svg,
span[onclick] i,
span[onclick] img,
span[onclick] svg {
  pointer-events: none !important;
}
.call-bar-btn,
.call-btn {
  pointer-events: auto !important;
}
@keyframes jelly-bounce-bar {
  0%,
  100% {
    transform: scale(1, 1);
    opacity: 1;
  }
  30% {
    transform: scale(1.3, 0.82);
    opacity: 0.65;
  }
  65% {
    transform: scale(0.88, 1.15);
    opacity: 0.9;
  }
  85% {
    transform: scale(1.04, 0.98);
    opacity: 0.98;
  }
}
.message-bubble {
  transition:
    transform var(--motion-fast) var(--motion-spring),
    box-shadow var(--motion-fast) var(--motion-spring) !important;
  will-change: transform, box-shadow;
}
.message-bubble.context-open {
  transform: scale(0.95) !important;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.1) !important;
  z-index: 1000 !important;
}
#context-menu .ctx-message-preview {
  overflow: visible !important;
  border-radius: var(--radius-sm);
  user-select: text;
  -webkit-user-select: text;
  word-break: break-word;
}
[data-theme="dark"] #context-menu .ctx-message-preview {
  background: 0 0;
}
#context-menu .ctx-message-preview .message-row {
  width: 100% !important;
  display: flex;
  padding: 0 !important;
  margin: 0 !important;
  align-items: flex-start !important;
}
#context-menu .ctx-message-preview .message-bubble {
  cursor: text !important;
  width: auto !important;
  max-width: 100% !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin: 0 !important;
}
#context-menu .ctx-message-preview,
#context-menu .ctx-message-preview *,
#context-menu .ctx-message-preview .message-text {
  white-space: pre-wrap;
  user-select: text !important;
  -webkit-user-select: text !important;
}
.message-row.sent .poll-bubble-container div[style*="color: var(--primary)"],
.message-row.sent .poll-bubble-container div[style*="color:var(--primary)"] {
  color: rgba(255, 255, 255, 0.95) !important;
}
.message-row.sent .poll-bubble-container div[style*="color: var(--text-muted)"],
.message-row.sent .poll-bubble-container div[style*="color:var(--text-muted)"] {
  color: rgba(255, 255, 255, 0.75) !important;
}
.message-row.sent .poll-view-voters-btn {
  color: #fff !important;
  border-top-color: rgba(255, 255, 255, 0.2) !important;
}
.reaction-badge.active,
.reaction-badge:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
#modal-alert,
#modal-confirm,
#modal-prompt {
  z-index: 30000 !important;
}
#modal-custom {
  z-index: 20000 !important;
}
#modal-custom .modal {
  background: var(--bg-surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--border-medium) !important;
}
.message-reactions-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  user-select: none;
  -webkit-user-select: none;
}
.reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s var(--motion-spring);
  position: relative;
  overflow: hidden;
}
.reaction-badge:hover {
  transform: translateY(-1px);
}
.reaction-badge.active {
  color: var(--primary);
}
.reaction-badge-count {
  font-size: 0.8rem;
  opacity: 0.9;
}
@keyframes reaction-pop {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}
.reaction-emoji-animate {
  animation: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards reaction-pop;
}
.reaction-selector-row {
  display: flex;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  scrollbar-width: none;
}
.reaction-select-btn:active,
.sticker-item:active {
  transform: scale(0.9);
}
.sticker-picker {
  position: absolute;
  bottom: 70px;
  right: 20px;
  width: 320px;
  height: 400px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), var(--glass-shadow);
  display: none;
  flex-direction: column;
  z-index: 1001;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  animation: menuPremiumIn 0.25s var(--motion-spring);
}
.phantom-bubble,
.skeleton-placeholder {
  animation: 1.5s linear infinite skeleton-shimmer;
}
.sticker-picker-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
}
.sticker-picker-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.sticker-item,
.sticker-pack-tab {
  border-radius: var(--radius-xs);
  align-items: center;
  cursor: pointer;
}
.sticker-item {
  transition: transform 0.15s var(--motion-spring);
  display: flex;
  justify-content: center;
  aspect-ratio: 1;
}
.sticker-item:hover {
  transform: scale(1.18);
  background: var(--primary-soft);
}
.sticker-item img,
.sticker-item svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 58px;
  max-height: 58px;
}
.sticker-picker-tabs {
  display: flex;
  padding: 6px 12px;
  gap: 8px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-light);
  overflow-x: auto;
  scrollbar-width: none;
}
.sticker-picker-tabs::-webkit-scrollbar {
  display: none;
}
.sticker-pack-tab {
  min-width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  transition: 0.2s;
  font-size: 1.3rem;
  user-select: none;
}
.sticker-pack-tab.active {
  background: var(--primary-soft);
  border: 1px solid var(--primary-glow);
}
.message-sticker {
  padding: 0 !important;
  background: 0 0 !important;
  box-shadow: none !important;
  border: none !important;
}
.message-sticker img,
.message-sticker svg {
  max-width: 160px;
  height: auto;
  display: block;
}
.message-select-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  cursor: pointer;
  align-self: center;
  flex-shrink: 0;
  transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1);
}
.message-select-indicator:active {
  transform: scale(0.85);
}
@keyframes quiz-correct-bounce {
  0%,
  100% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.05) translateY(-2px);
  }
  50% {
    transform: scale(0.98);
  }
  70% {
    transform: scale(1.02);
  }
}
@keyframes quiz-incorrect-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}
.poll-option-voted.correct {
  animation: 0.5s quiz-correct-bounce;
}
.poll-option-voted.incorrect {
  animation: 0.4s quiz-incorrect-shake;
}
.hex-confetti {
  position: fixed;
  width: 14px;
  height: 16px;
  pointer-events: none;
  z-index: 999999;
  will-change: transform, opacity;
}
@keyframes hex-fall {
  0% {
    transform: translateY(-20px) rotate(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(0) rotate(45deg) scale(1);
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.6);
    opacity: 0;
  }
}
.message-row.sent .reaction-badge {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: #fff !important;
}
.message-row.sent .reaction-badge.active {
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: #fff !important;
}
.message-row.received .reaction-badge {
  background: var(--bg-body) !important;
  border-color: var(--border-medium) !important;
  color: var(--text-main) !important;
}
.message-row.received .reaction-badge.active {
  background: var(--primary-soft) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
.bot-command-item,
.reaction-selector-row {
  border-bottom: 1px solid var(--border-light);
}
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.skeleton-placeholder {
  background: linear-gradient(
    90deg,
    var(--gray-200) 25%,
    var(--gray-100) 50%,
    var(--gray-200) 75%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-xs);
  display: inline-block;
}
.command-instructor,
.phantom-bubble,
.reaction-selector-row {
  background: var(--bg-surface);
}
[data-theme="dark"] .phantom-bubble,
[data-theme="dark"] .skeleton-placeholder {
  background: linear-gradient(
    90deg,
    var(--gray-50) 25%,
    var(--gray-100) 50%,
    var(--gray-50) 75%
  );
}
.phantom-bubble-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 10px;
}
.phantom-bubble {
  max-width: 60%;
  height: 44px;
  border-radius: 18px;
  border: 1px solid var(--border-light);
}
.phantom-bubble.sent {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-soft) 25%,
    var(--primary-glow) 50%,
    var(--primary-soft) 75%
  );
  background-size: 200% 100%;
}
.phantom-bubble.received {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.reaction-selector-row {
  position: sticky;
  display: flex;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  scrollbar-width: none;
}
#context-menu .ctx-message-preview {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: none;
  margin: 0;
  padding: 6px 4px 0;
  border-radius: var(--radius-sm);
  background: 0 0;
  user-select: text;
  -webkit-user-select: text;
  word-break: break-word;
  transition:
    transform 0.15s ease-out,
    opacity 0.15s ease-out,
    max-height 0.15s ease-out,
    margin 0.15s ease-out,
    padding 0.15s ease-out;
  will-change: transform, opacity, max-height;
}
.ctx-divider {
  transition:
    opacity 0.15s ease-out,
    height 0.15s ease-out,
    margin 0.15s ease-out;
  will-change: opacity, height;
}
.bot-command-item {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  transition: background 0.2s;
}
.command-instructor {
  display: flex;
  align-items: center;
}
.instructor-arg.filled {
  opacity: 0.4;
  color: var(--text-main);
}
.bot-command-item {
  display: flex;
  flex-direction: column;
  padding: 8px 14px;
  cursor: pointer;
}
.bot-command-item .cmd-name {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
}
.bot-command-item .cmd-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.command-instructor {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: "Cascadia Code", monospace;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}
.instructor-arg {
  color: var(--text-muted);
  transition: 0.2s;
  position: relative;
  margin-left: 6px;
}
.instructor-arg.active {
  transform: scale(1.05);
  color: #f59e0b;
  font-weight: 800;
  transform: translateY(-1px);
}
.instructor-arg.filled {
  opacity: 0.35;
  color: var(--text-main);
}
.instructor-arg.empty {
  color: var(--warning);
  font-weight: 800;
  transform: scale(1.05);
  display: inline-block;
}
.instructor-arg.valid {
  color: var(--success);
  font-weight: 800;
}
.instructor-arg.invalid {
  color: var(--danger);
  font-weight: 800;
}
.instructor-arg.filled {
  text-decoration: line-through;
  opacity: 0.5;
}
.instructor-arg.pending {
  color: var(--text-muted);
  opacity: 0.7;
}
@keyframes brain-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.2));
  }
  50% {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
  }
}
.brain-thinking {
  animation: 1.4s ease-in-out infinite brain-pulse;
  color: var(--warning) !important;
}
@keyframes dot-bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
.thinking-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  background-color: var(--warning);
  border-radius: 50%;
  animation: 1.2s ease-in-out infinite dot-bounce;
  margin: 0 1px;
}
.thinking-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.thinking-dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes cursor-blink {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}
.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: currentColor;
  margin-left: 3px;
  vertical-align: middle;
  animation: 0.8s infinite cursor-blink;
}
@keyframes chunk-fade-in {
  from {
    opacity: 0;
    transform: translateY(3px) scale(0.98);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
.chunk-appear {
  display: inline;
  animation: 0.35s cubic-bezier(0.215, 0.61, 0.355, 1) forwards chunk-fade-in;
  will-change: opacity, transform, filter;
}
@keyframes poll-bar-expand {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
.poll-voted-bar {
  transform-origin: left center !important;
  animation: 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards poll-bar-expand !important;
}
.poll-option-unvoted,
.poll-option-voted {
  transition:
    transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
    background-color 0.2s,
    border-color 0.2s !important;
}
.poll-option-unvoted:active,
.poll-option-voted:active {
  transform: scale(0.97) !important;
  filter: brightness(0.96);
}
.inline-btn:active,
.message-button:active {
  transform: scale(0.98);
}
.poll-selector-circle {
  transition:
    transform 0.2s,
    border-color 0.2s,
    background-color 0.2s !important;
}
.inline-btn,
.message-button {
  padding: 10px 16px;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.1s;
  text-align: center;
  min-height: 40px;
  box-sizing: border-box;
  font-weight: 500;
  cursor: pointer;
}
.poll-option-unvoted:active .poll-selector-circle {
  transform: scale(1.15);
}
.inline-keyboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  width: 100%;
}
.inline-keyboard-row {
  display: flex;
  gap: 4px;
  width: 100%;
}
.inline-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08) !important;
  border: none !important;
  color: #fff !important;
  font-size: 14px;
  border-radius: 10px;
  position: relative;
  user-select: none;
}
.inline-btn:hover,
[data-theme="dark"] .message-button:hover,
[data-theme="midnight"] .message-button:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}
.inline-btn:active {
  background: rgba(255, 255, 255, 0.18) !important;
}
.inline-btn-arrow {
  position: absolute;
  right: 8px;
  top: 6px;
  font-size: 10px;
  opacity: 0.6;
  color: #fff;
  line-height: 1;
  font-family: sans-serif;
}
.message-bubble,
.message-button {
  position: relative;
  user-select: none;
}
.message-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
}
.message-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-main) !important;
  font-size: 14px;
  border-radius: 10px;
  width: 100%;
}
[data-theme="dark"] .message-button,
[data-theme="midnight"] .message-button {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}
.message-button:hover {
  background: rgba(0, 0, 0, 0.08) !important;
}
.message-bubble {
  max-width: 100%;
  width: fit-content;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  -webkit-user-select: none;
  touch-action: manipulation;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.message-location-card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
@media (max-width: 480px) {
  .editor-ar-btn,
  .editor-opt-label {
    font-size: 10px;
  }
  .editor-tool-btn {
    width: 36px;
    height: 36px;
  }
  .editor-tool-btn svg {
    width: 16px;
    height: 16px;
  }
  .editor-tool-btn span {
    display: none;
  }
  .editor-tool-separator {
    height: 20px;
  }
  .editor-ar-btn {
    padding: 3px 7px;
  }
  .editor-size-slider {
    width: 60px;
  }
  .editor-filter-slider {
    width: 80px;
  }
  .editor-color-picker {
    width: 24px;
    height: 24px;
  }
  .message-bubble.message-location {
    max-width: calc(100vw - 32px) !important;
  }
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  input:focus,
  select:focus,
  textarea:focus {
    font-size: 16px !important;
  }
}
@media (max-width: 768px) {
  .call-overlay,
  .sidebar,
  .toolbar {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }
  .sidebar {
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    box-shadow:
      0 15px 35px rgba(0, 0, 0, 0.3),
      inset 0 -1px 2px rgba(255, 255, 255, 0.12) !important;
    display: flex;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: none;
    background: var(--bg-sidebar) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid var(--border-light) !important;
  }
  .nav-links-container {
    align-items: center !important;
  }
  .nav-item {
    display: flex;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    flex: none !important;
    color: rgba(255, 255, 255, 0.4) !important;
  }
  .nav-item.active {
    color: #0a84ff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .highlight-inner {
    background: rgba(255, 255, 255, 0.16) !important;
    box-shadow:
      inset 0 1px 2px rgba(255, 255, 255, 0.1),
      0 4px 10px rgba(0, 0, 0, 0.15) !important;
    transform-origin: center center !important;
    will-change: transform, opacity;
  }
  .sticker-picker {
    right: 10px;
    left: 10px;
    width: calc(100% - 20px);
    bottom: calc(65px + env(safe-area-inset-bottom, 0px));
    height: 350px;
  }
  .sidebar {
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08) !important;
    display: flex;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: none;
  }
  [data-theme="dark"] .sidebar,
  [data-theme="midnight"] .sidebar {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 12px 35px transparent !important;
  }
  [data-theme="classic"] .sidebar {
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
  }
  .nav-links-container {
    display: flex;
    align-items: center !important;
  }
  .nav-item {
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    flex: none !important;
    color: var(--text-muted) !important;
    opacity: 0.7 !important;
  }
  .highlight-inner {
    background: var(--primary-soft) !important;
    border: 1px solid var(--primary-glow) !important;
    box-shadow:
      0 4px 12px var(--primary-glow),
      inset 0 1px 2px rgba(255, 255, 255, 0.1) !important;
    transform-origin: center center !important;
    will-change: transform, opacity;
  }
  .nav-links-container,
  .sidebar {
    height: 50px !important;
    overflow: visible !important;
  }
  .sidebar {
    position: fixed !important;
    bottom: calc(15px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    width: 55% !important;
    max-width: 300px !important;
    padding: 0 15px !important;
    z-index: 2000 !important;
    background: #fff !important;
    border: 1.5px solid var(--border-light) !important;
    border-radius: 24px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    display: flex;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: none;
  }
  .nav-links,
  .nav-links-container {
    display: flex;
    width: 100% !important;
    position: relative !important;
  }
  .nav-item,
  .nav-links {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
  }
  [data-theme="dark"] .sidebar,
  [data-theme="midnight"] .sidebar {
    background: rgba(10, 11, 16, 0.25) !important;
    border: 1.5px solid var(--border-light) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  }
  [data-theme="classic"] .sidebar {
    background: rgba(245, 245, 245, 0.4) !important;
    border: 1.5px solid var(--border-medium) !important;
    box-shadow: none !important;
  }
  .nav-item,
  .nav-item.active {
    background: 0 0 !important;
    box-shadow: none !important;
  }
  .sidebar > .brand,
  .sidebar > div:first-child,
  .sidebar > div:last-child,
  .status-icon[data-status="connected"],
  .status-text[data-status="connected"] {
    display: none !important;
  }
  .nav-links {
    flex-direction: row !important;
    height: 100% !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    gap: 5px !important;
    z-index: 2 !important;
  }
  .nav-item {
    border-radius: 16px !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 70px !important;
    height: 50px !important;
    flex: none !important;
    border: none !important;
    transform: none !important;
    color: var(--text-muted) !important;
    opacity: 0.75 !important;
    transition:
      color 0.3s,
      opacity 0.3s !important;
  }
  .highlight-wrapper,
  .nav-item span {
    pointer-events: none !important;
    display: block !important;
  }
  .nav-item i,
  .nav-item svg {
    width: 20px !important;
    height: 20px !important;
    margin-bottom: 2px !important;
    pointer-events: none !important;
  }
  .nav-item span {
    font-size: 10px !important;
    font-weight: 600 !important;
    margin-top: 1px !important;
    margin-left: 0 !important;
    letter-spacing: 0.1px !important;
    line-height: 1.2 !important;
  }
  .nav-item.active {
    color: var(--primary) !important;
    opacity: 1 !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .highlight-wrapper {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 100% !important;
    z-index: 1 !important;
    will-change: transform, width;
    transition:
      transform 0.5s cubic-bezier(0.25, 1, 0.4, 1.15),
      width 0.5s cubic-bezier(0.25, 1, 0.4, 1.15);
  }
  .highlight-inner {
    width: 150% !important;
    height: 100% !important;
    margin-left: -30% !important;
    margin-top: -8% !important;
    border-radius: 50px !important;
    background: var(--primary-soft) !important;
    border: 1.5px solid var(--primary-glow) !important;
    box-shadow: none !important;
    transform-origin: center center !important;
    will-change: transform, opacity;
    transition: opacity 0.3s;
  }
  .is-jelly {
    animation: 0.55s cubic-bezier(0.25, 1, 0.5, 1) forwards jelly-bounce-bar;
  }
  .chat-sidebar-header,
  .toolbar {
    background: var(--bg-surface) !important;
  }
  #chat-plus-btn,
  [data-theme="dark"] .mobile-logo-text,
  [data-theme="midnight"] .mobile-logo-text {
    color: var(--primary) !important;
  }
  #chat-plus-btn,
  .toolbar {
    box-shadow: none !important;
    display: flex !important;
  }
  .toolbar {
    border-bottom: 1px solid var(--border-light) !important;
    padding: 0 16px !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 50px !important;
    min-height: 50px !important;
  }
  #minagram-status-indicator {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 1px !important;
    min-height: 44px !important;
  }
  .mobile-logo-text {
    display: block !important;
    font-size: 21px !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px !important;
    color: #2481cc !important;
    line-height: 1.1 !important;
  }
  .status-text[data-status="connecting"],
  .status-text[data-status="reconnecting"],
  .status-text[data-status="updating"] {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--text-muted) !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #user-menu-dropdown {
    position: fixed !important;
    top: calc(50px + env(safe-area-inset-top, 0px)) !important;
    bottom: auto !important;
    left: auto !important;
    right: 12px !important;
    width: min(92vw, 260px) !important;
    max-height: min(80dvh, calc(100dvh - 80px)) !important;
    transform: none !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-lg) !important;
  }
  .chat-sidebar-header {
    padding: 8px 16px !important;
    border-bottom: none !important;
  }
  .chat-search-container,
  .chat-search-wrapper {
    background: 0 0 !important;
  }
  .chat-search-input {
    background: var(--bg-body) !important;
    border: none !important;
    border-radius: 24px !important;
    padding: 8px 16px 8px 40px !important;
    font-size: 15px !important;
    color: var(--text-main) !important;
  }
  .chat-search-icon {
    left: 14px !important;
    color: var(--text-muted) !important;
    width: 16px !important;
    height: 16px !important;
  }
  #chat-plus-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: var(--primary-soft) !important;
    border: none !important;
    align-items: center !important;
    justify-content: center !important;
  }
}
.chat-sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface);
}
.chat-search-input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 14px;
  outline: 0;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.chat-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.chat-search-icon {
  left: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.status-text[data-status="connected"] {
  color: var(--primary) !important;
  font-weight: 700;
  font-size: 1.15rem;
}
#context-menu .ctx-item::before,
.mobile-logo-text {
  display: none;
}
@media (max-width: 768px) {
  .chat-sidebar-header,
  .toolbar {
    background: var(--bg-surface) !important;
  }
  .chat-sidebar {
    position: absolute !important;
    top: 50px !important;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: calc(100% - 50px) !important;
  }
  .toolbar {
    box-shadow: none !important;
    border-bottom: 1px solid var(--border-light) !important;
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 50px !important;
    min-height: 50px !important;
  }
  #minagram-status-indicator {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 1px !important;
    min-height: 44px !important;
  }
  .mobile-logo-text {
    display: block !important;
    font-size: 21px !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px !important;
    color: var(--primary) !important;
    line-height: 1.1 !important;
  }
  #chat-plus-btn,
  .status-icon,
  .status-text {
    display: none !important;
  }
  #user-menu-dropdown {
    position: fixed !important;
    top: calc(50px + env(safe-area-inset-top, 0px)) !important;
    bottom: auto !important;
    left: auto !important;
    right: 12px !important;
    width: min(92vw, 260px) !important;
    max-height: min(80dvh, calc(100dvh - 80px)) !important;
    transform: none !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-lg) !important;
  }
  .chat-sidebar-header {
    padding: 8px 16px !important;
    border-bottom: none !important;
  }
  .chat-search-container,
  .chat-search-wrapper {
    background: 0 0 !important;
  }
  .chat-search-input {
    background: var(--bg-body) !important;
    border: none !important;
    border-radius: 24px !important;
    padding: 8px 16px 8px 40px !important;
    font-size: 15px !important;
    color: var(--text-main) !important;
  }
  .chat-search-icon {
    left: 14px !important;
    color: var(--text-muted) !important;
    width: 16px !important;
    height: 16px !important;
  }
  .main-content:has(.chat-main.active) #toolbar {
    display: none !important;
  }
  .main-content:has(.chat-main.active) .content-area {
    padding-top: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
  }
  #toolbar.toolbar {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 16px !important;
    height: 50px !important;
    min-height: 50px !important;
    gap: 0 !important;
  }
  #toolbar .actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #global-user-menu-btn {
    margin: 0 !important;
    padding: 6px !important;
    height: auto !important;
    background: 0 0 !important;
  }
  #main-view:has(.chat-layout) {
    padding: 0 !important;
  }
  #chat-sidebar {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-right: none !important;
    z-index: 10 !important;
  }
  body.chat-opened #toolbar {
    display: none !important;
  }
  body.chat-opened #main-view {
    height: 100dvh !important;
  }
  #app:has(.chat-sidebar.hidden) #toolbar,
  body.chat-opened #toolbar {
    display: none !important;
  }
  #app:has(.chat-sidebar.hidden) #main-view,
  body.chat-opened #main-view {
    padding-top: 0 !important;
    height: 100dvh !important;
  }
  #app:has(.chat-sidebar.hidden) .sidebar,
  body.chat-opened .sidebar {
    transform: translate(-50%, 150px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  #app:has(.chat-sidebar.hidden) .messages-container,
  body.chat-opened .messages-container {
    padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .highlight-wrapper {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 100% !important;
    z-index: 1 !important;
    pointer-events: none !important;
  }
  .highlight-inner {
    position: absolute !important;
    top: -2px !important;
    bottom: -2px !important;
    left: -14px !important;
    right: -14px !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 50px !important;
    background: var(--primary-soft) !important;
    border: 1.5px solid var(--primary-glow) !important;
    box-shadow: none !important;
    transform-origin: center center !important;
    will-change: transform, opacity;
    transition: opacity 0.3s;
  }
}
@media (min-width: 769px) {
  .brand {
    color: var(--primary) !important;
    transition: color 0.3s;
  }
  .chat-sidebar-header {
    padding: 12px 16px !important;
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-light) !important;
  }
  .chat-search-input {
    border-radius: 20px !important;
    padding: 9px 12px 9px 38px !important;
    border: 1px solid var(--border-light) !important;
  }
  .chat-search-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
  }
}
.chat-input-wrapper {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: flex-end;
}
.chat-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.chat-input {
  flex: 1;
  background: 0 0;
  border: none;
  color: var(--text-main);
  font-size: 16px;
  outline: 0;
  max-height: 120px;
  overflow-y: auto;
  padding: 10px 4px;
  resize: none;
  line-height: 1.4;
  font-family: inherit;
}
#context-menu .ctx-item i,
.chat-attachment-btn,
.chat-blocked-banner .blocked-text {
  color: var(--text-muted);
  color: var(--text-muted);
}
.chat-attachment-btn {
  background: 0 0;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  border-radius: 50%;
  flex-shrink: 0;
  height: 36px;
  width: 36px;
  margin-bottom: 2px;
}
.bot-cmd-btn {
  background: var(--primary) !important;
  color: #fff !important;
  width: 32px !important;
  height: 32px !important;
  margin-bottom: 4px;
  margin-left: 2px;
}
.bot-cmd-btn:hover {
  background: var(--primary-hover) !important;
}
.btn-send {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all 0.2s var(--motion-spring);
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--primary-glow);
}
#chat-input-area {
  padding: 10px 16px;
  background: 0 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-top: none !important;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.chat-blocked-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.chat-blocked-banner .blocked-text {
  font-size: 13px;
  background: var(--bg-surface);
  padding: 6px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.chat-blocked-banner .btn-join-group {
  padding: 10px 28px !important;
  border-radius: 24px !important;
  background: var(--primary) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 14px var(--primary-glow) !important;
  transition: all 0.2s var(--motion-spring) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-blocked-banner .btn-join-group:hover {
  background: var(--primary-hover) !important;
  transform: translateY(-1.5px) scale(1.02);
  box-shadow: 0 6px 20px var(--primary-glow) !important;
}
.chat-blocked-banner .btn-join-group:active {
  transform: scale(0.96) !important;
}
.message-bubble.message-location,
.message-bubble.message-poll {
  width: 280px !important;
  max-width: 100% !important;
}
.chat-input-wrapper {
  flex: 1;
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
}
.chat-input-row {
  display: flex;
  align-items: flex-end;
  width: 100%;
}
.chat-edit-bar,
.link-preview-bar,
.reply-preview-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px 8px !important;
  background: 0 0 !important;
  border: none !important;
  border-bottom: 1px solid var(--border-light) !important;
  border-radius: 0 !important;
  margin-bottom: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.chat-edit-bar div,
.link-preview-bar div,
.reply-preview-area div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
  text-align: left;
}
[data-theme="classic"] #context-menu {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}
#context-menu .ctx-item {
  display: flex;
  align-items: center;
  color: var(--text-main);
  box-sizing: border-box;
}
#context-menu .ctx-item:hover {
  transform: none;
  background: rgba(0, 0, 0, 0.05);
}
[data-theme="classic"] #context-menu .ctx-item:hover {
  background: rgba(0, 74, 153, 0.08);
}
#context-menu .ctx-item i {
  transition: none;
  width: 18px;
  height: 18px;
}
#context-menu .ctx-item:hover i {
  color: var(--text-main);
  transform: none;
}
.reaction-selector-row {
  display: flex;
  gap: 6px;
  background: 0 0;
  border-bottom: 1px solid var(--border-light);
  box-sizing: border-box;
  scrollbar-width: none;
}
#context-menu,
.reaction-selector-row {
  background: var(--glass-bg);
  scrollbar-width: none;
}
.reaction-select-btn {
  user-select: none;
  -webkit-user-select: none;
  font-size: 1.45rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  -webkit-user-select: none;
}
.reaction-select-btn:hover {
  transform: scale(1.25);
  transform: scale(1.3) translateY(-2px);
}
#context-menu {
  position: fixed !important;
  display: none;
  z-index: 25000;
  min-width: 200px;
  max-width: 260px;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 0 0 6px;
  max-height: calc(100vh - 40px);
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transform-origin: top left;
  flex-direction: column;
}
#context-menu::-webkit-scrollbar {
  display: none;
}
[data-theme="dark"] #context-menu,
[data-theme="midnight"] #context-menu {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  background: rgba(20, 21, 28, 0.98);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
[data-theme="classic"] #context-menu {
  background: #f5f5f5;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
#context-menu .ctx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 0;
  border-radius: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  background: 0 0;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.15s;
}
[data-theme="dark"] #context-menu .ctx-item:hover,
[data-theme="midnight"] #context-menu .ctx-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
#context-menu .ctx-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--border-light);
}
.reaction-selector-row {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-light);
  border-radius: 14px 14px 0 0;
  box-sizing: border-box;
}
[data-theme="dark"] .reaction-selector-row,
[data-theme="midnight"] .reaction-selector-row {
  background: rgba(20, 21, 28, 0.98);
}
.reaction-selector-row::-webkit-scrollbar {
  display: none;
}
.chat-blocked-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-light) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: 0 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-top: none !important;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  gap: 8px;
  pointer-events: none;
}
.chat-blocked-banner * {
  pointer-events: auto;
}
.chat-blocked-banner .btn-join-group {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--primary) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer;
  box-shadow: var(--shadow-sm) !important;
  transition: all 0.2s var(--motion-spring) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}
.chat-blocked-banner .btn-join-group:hover {
  background: var(--primary-soft) !important;
  transform: translateY(-1px);
}
body.platform-capacitor.platform-android {
  background-color: var(--bg-body) !important;
}
body.platform-capacitor.platform-android #app {
  height: calc(100dvh - 24px) !important;
  margin-top: 24px !important;
}
body.platform-capacitor.platform-android #login-screen {
  top: 24px !important;
  height: calc(100% - 24px) !important;
}
body.platform-capacitor.platform-android .login-proxy-corner-btn {
  top: max(8px, env(safe-area-inset-top, 0px)) !important;
}
/* ===== ?????????? ? ??????? ????????? ????????? ===== */
      .image-editor-toolbar {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        scrollbar-width: none;
      }
      .image-editor-toolbar::-webkit-scrollbar {
        display: none;
      }
      .editor-tool-options {
        display: none;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        background: rgba(0, 0, 0, 0.4);
        flex-shrink: 0;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scrollbar-width: none;
        z-index: 10;
        width: 100%;
        box-sizing: border-box;
      }
      .editor-tool-options::-webkit-scrollbar {
        display: none;
      }
      .editor-tool-options.active {
        display: flex !important;
      }
      .editor-opt-group {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
      }
      .editor-select-custom {
        padding: 6px 10px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.2);
        font-size: 12px;
        outline: none;
        cursor: pointer;
      }
      .editor-select-custom option {
        background: #1a1a2e;
        color: #fff;
      }
      .editor-color-picker-wrap {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(255, 255, 255, 0.1);
        padding: 4px 8px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.15);
      }