:root {
  --bg: #050816;
  --bg-soft: rgba(15, 23, 42, 0.92);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-strong: rgba(56, 189, 248, 0.25);
  --danger: #f97373;
  --text: #f9fafb;
  --text-soft: #9ca3af;
  --border: rgba(148, 163, 184, 0.2);

  --message-font-size: 14px;
  --meta-font-size: 11px;
  --message-avatar-size: 52px;
  --sidebar-width: 360px;
  --sidebar-elements-scale: 1;
  --sidebar-theme-background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(8, 16, 32, 0.98));
  /* rollback backup: previous dark chat background */
  --chat-main-bg-old: linear-gradient(
    180deg,
    rgba(6, 14, 40, 0.98) 0%,
    rgba(4, 11, 34, 0.97) 45%,
    rgba(2, 8, 28, 0.98) 100%
  );
  --chat-main-bg: var(--chat-main-bg-old);
  --chat-main-bg-size: cover;
  --chat-main-bg-position: center center;
  --chat-main-bg-repeat: no-repeat;
  --chat-main-overlay: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #1d2435 0, #050816 55%, #000 100%);
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

body.is-sidebar-resizing,
body.is-sidebar-resizing * {
  cursor: ew-resize !important;
  user-select: none !important;
}

.app {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  min-height: 100dvh;
}

.panel {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  border-radius: 0;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.08), transparent 60%),
    radial-gradient(circle at bottom, rgba(168, 85, 247, 0.05), transparent 55%),
    var(--bg-soft);
  border: 1px solid var(--border);
  box-shadow:
    0 20px 70px rgba(15, 23, 42, 0.85),
    inset 0 0 0 1px rgba(15, 23, 42, 0.9);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.chat-panel {
  display: grid;
  grid-template-columns: var(--sidebar-width, 360px) 1fr;
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
}

/* Login */

.login-panel {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 48px 24px;
  overflow-y: auto;
}

.logo {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(120deg, #38bdf8, #a855f7, #f97316);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(15, 23, 42, 0.9);
}

.subtitle {
  margin: 0;
  color: var(--text-soft);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.register-block {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.register-toggle {
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  transition: transform 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}

.register-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.25);
}

.register-form {
  max-width: 100%;
}

.login-form input {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.9);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
  background: rgba(15, 23, 42, 1);
}

.avatar-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  font-size: 13px;
  color: var(--text-soft);
}

.avatar-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.avatar-toggle {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.avatar-toggle:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.avatar-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.avatar-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-soft);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.avatar-upload-label input[type="file"] {
  display: none;
}

.avatar-upload-label:hover {
  border-color: var(--accent);
  color: var(--text);
}

.avatar-upload-preview {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 0 12px rgba(15, 23, 42, 0.65);
}

.avatar-upload-clear {
  border: none;
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}

.avatar-upload-clear:hover {
  background: rgba(248, 113, 113, 0.2);
}

.avatar-crop-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 22, 0.85);
  z-index: 3200;
  padding: 24px;
}

.avatar-crop-card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  padding: 20px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.avatar-crop-card h3 {
  margin: 0;
  font-size: 16px;
}

.avatar-crop-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

.avatar-crop-area {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: rgba(2, 6, 23, 0.6);
  border: 2px solid rgba(148, 163, 184, 0.4);
  align-self: center;
}

.avatar-crop-area img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.avatar-crop-area img:active {
  cursor: grabbing;
}

.avatar-crop-handle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.9);
  border: 2px solid rgba(15, 23, 42, 0.9);
  cursor: nwse-resize;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.7);
}

.avatar-crop-zoom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
}

.avatar-crop-zoom input[type="range"] {
  width: 100%;
}

.avatar-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.avatar-crop-cancel,
.avatar-crop-apply {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.avatar-crop-cancel {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

.avatar-crop-apply {
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  color: #0f172a;
}

.avatar-option {
  border: 1px solid transparent;
  background: transparent;
  padding: 2px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.avatar-option img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: block;
}

.avatar-option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px) scale(1.03);
}

.avatar-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.avatar-upload input {
  display: none;
}

.avatar-upload-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
}

.avatar-upload-preview img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 0 12px rgba(15, 23, 42, 0.6);
}

.avatar-upload-clear {
  border: none;
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}

.avatar-upload-clear:hover {
  background: rgba(248, 113, 113, 0.3);
}

.login-form button {
  border-radius: 999px;
  border: none;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  color: #0f172a;
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.45);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.login-form button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 36px rgba(56, 189, 248, 0.55);
}

.login-form button:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.9);
}

.login-form button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35) brightness(0.8);
  box-shadow: none;
  transform: none;
}

.login-form button:disabled:hover {
  transform: none;
  filter: grayscale(0.35) brightness(0.8);
  box-shadow: none;
}

.auth-hint {
  margin: -2px 6px 0;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(148, 163, 184, 0.95);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.75);
}

.auth-feedback {
  width: 100%;
  max-width: 320px;
  margin-top: 2px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.35;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
}

.auth-feedback.is-error {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
}

.auth-feedback.is-success {
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(20, 83, 45, 0.22);
  color: #bbf7d0;
}

.auth-feedback.is-info {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(30, 64, 175, 0.2);
  color: #bae6fd;
}

.color-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  font-size: 13px;
  color: var(--text-soft);
}

.color-picker input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
}

.color-picker input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 999px;
}

.color-picker input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 999px;
}

/* Chat layout */

.chat-panel {
  display: grid;
  grid-template-columns: var(--sidebar-width, 360px) 1fr;
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.6) transparent;

  background: var(--sidebar-theme-background);
}

#chat-screen[data-sidebar-theme="neon-night"] {
  --sidebar-theme-background:
    radial-gradient(circle at 14% 10%, rgba(56, 189, 248, 0.18), transparent 48%),
    radial-gradient(circle at 88% 92%, rgba(99, 102, 241, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(8, 16, 32, 0.99));
}

#chat-screen[data-sidebar-theme="dark-doodle"] {
  --sidebar-theme-background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.58) 0%,
      rgba(0, 0, 0, 0.12) 22%,
      rgba(0, 0, 0, 0.12) 78%,
      rgba(0, 0, 0, 0.58) 100%
    ),
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.16), transparent 44%),
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.06), transparent 40%),
    radial-gradient(circle at 88% 86%, rgba(255, 255, 255, 0.07), transparent 42%),
    linear-gradient(180deg, rgba(6, 8, 11, 0.72), rgba(10, 11, 15, 0.85)),
    url("/assets/chat-bg/official/bg-chat-tile-dark_a4be512e7195b6b733d9110b408f075d.png")
      left top / 540px 981px repeat,
    linear-gradient(180deg, #1b1f25 0%, #11141a 52%, #0a0d12 100%);
}

#chat-screen[data-sidebar-theme="arctic-glow"] {
  --sidebar-theme-background:
    radial-gradient(circle at 12% 8%, rgba(186, 230, 253, 0.52), transparent 38%),
    radial-gradient(circle at 78% 18%, rgba(125, 211, 252, 0.34), transparent 42%),
    radial-gradient(circle at 88% 88%, rgba(14, 165, 233, 0.28), transparent 43%),
    linear-gradient(155deg, rgba(20, 70, 122, 0.96) 0%, rgba(14, 44, 90, 0.95) 48%, rgba(8, 28, 62, 0.98) 100%);
}

#chat-screen[data-sidebar-theme="sunset-waves"] {
  --sidebar-theme-background:
    radial-gradient(circle at 14% 14%, rgba(251, 146, 60, 0.22), transparent 42%),
    radial-gradient(circle at 86% 86%, rgba(244, 114, 182, 0.2), transparent 44%),
    linear-gradient(160deg, rgba(35, 20, 58, 0.98) 0%, rgba(76, 30, 75, 0.96) 52%, rgba(25, 35, 66, 0.98) 100%);
}

#chat-screen[data-sidebar-theme="emerald-mist"] {
  --sidebar-theme-background:
    radial-gradient(circle at 10% 8%, rgba(52, 211, 153, 0.2), transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(16, 185, 129, 0.18), transparent 45%),
    linear-gradient(165deg, rgba(7, 45, 52, 0.97), rgba(7, 25, 43, 0.98));
}

#chat-screen[data-sidebar-theme="royal-violet"] {
  --sidebar-theme-background:
    radial-gradient(circle at 15% 12%, rgba(196, 181, 253, 0.24), transparent 44%),
    radial-gradient(circle at 78% 84%, rgba(129, 140, 248, 0.2), transparent 42%),
    linear-gradient(150deg, rgba(30, 27, 75, 0.98), rgba(48, 31, 108, 0.97) 56%, rgba(23, 34, 66, 0.98));
}

#chat-screen[data-sidebar-theme="ember-grid"] {
  --sidebar-theme-background:
    repeating-linear-gradient(0deg, rgba(251, 191, 36, 0.16) 0 2px, rgba(0, 0, 0, 0) 2px 16px),
    repeating-linear-gradient(90deg, rgba(244, 114, 182, 0.1) 0 2px, rgba(0, 0, 0, 0) 2px 18px),
    radial-gradient(circle at 18% 14%, rgba(251, 146, 60, 0.26), transparent 40%),
    linear-gradient(165deg, rgba(63, 22, 21, 0.97), rgba(95, 37, 28, 0.96) 56%, rgba(35, 23, 54, 0.98));
}

#chat-screen[data-sidebar-theme="ocean-stripes"] {
  --sidebar-theme-background:
    repeating-linear-gradient(180deg, rgba(56, 189, 248, 0.16) 0 6px, rgba(2, 132, 199, 0.04) 6px 16px),
    radial-gradient(ellipse at 20% 6%, rgba(125, 211, 252, 0.26), transparent 40%),
    radial-gradient(ellipse at 85% 94%, rgba(34, 211, 238, 0.22), transparent 42%),
    linear-gradient(170deg, rgba(4, 58, 94, 0.98), rgba(7, 35, 73, 0.98) 60%, rgba(8, 24, 52, 0.99));
}

#chat-screen[data-sidebar-theme="aurora-mesh"] {
  --sidebar-theme-background:
    radial-gradient(circle at 20% 18%, rgba(34, 197, 94, 0.24), transparent 40%),
    radial-gradient(circle at 82% 30%, rgba(59, 130, 246, 0.22), transparent 43%),
    radial-gradient(circle at 50% 92%, rgba(168, 85, 247, 0.2), transparent 46%),
    linear-gradient(175deg, rgba(9, 20, 52, 0.98), rgba(10, 25, 64, 0.98));
}

#chat-screen[data-sidebar-theme="graphite-carbon"] {
  --sidebar-theme-background:
    repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.08) 0 8px, rgba(15, 23, 42, 0.05) 8px 16px),
    radial-gradient(circle at 16% 12%, rgba(125, 211, 252, 0.1), transparent 46%),
    linear-gradient(160deg, rgba(18, 28, 43, 0.98), rgba(10, 17, 31, 0.99));
}

#chat-screen[data-sidebar-theme="candy-haze"] {
  --sidebar-theme-background:
    radial-gradient(circle at 14% 16%, rgba(244, 114, 182, 0.24), transparent 42%),
    radial-gradient(circle at 84% 84%, rgba(147, 51, 234, 0.18), transparent 44%),
    linear-gradient(155deg, rgba(43, 23, 59, 0.98), rgba(31, 27, 73, 0.97) 52%, rgba(14, 31, 66, 0.98));
}

#chat-screen[data-sidebar-theme="crimson-dawn"] {
  --sidebar-theme-background:
    radial-gradient(circle at 12% 8%, rgba(254, 202, 202, 0.34), transparent 38%),
    radial-gradient(circle at 84% 16%, rgba(248, 113, 113, 0.3), transparent 40%),
    radial-gradient(circle at 86% 90%, rgba(220, 38, 38, 0.22), transparent 42%),
    linear-gradient(158deg, rgba(98, 22, 24, 0.97), rgba(126, 28, 36, 0.96) 50%, rgba(61, 17, 26, 0.98));
}

#chat-screen[data-sidebar-theme="ruby-noir"] {
  --sidebar-theme-background:
    radial-gradient(circle at 14% 12%, rgba(239, 68, 68, 0.22), transparent 38%),
    radial-gradient(circle at 84% 20%, rgba(190, 24, 93, 0.2), transparent 40%),
    radial-gradient(circle at 82% 88%, rgba(153, 27, 27, 0.22), transparent 42%),
    linear-gradient(162deg, rgba(33, 10, 19, 0.99), rgba(49, 11, 27, 0.98) 54%, rgba(20, 10, 20, 0.99));
}

#chat-screen[data-sidebar-theme="mars-dust"] {
  --sidebar-theme-background:
    radial-gradient(circle at 10% 12%, rgba(251, 146, 60, 0.26), transparent 40%),
    radial-gradient(circle at 86% 84%, rgba(185, 28, 28, 0.22), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(217, 119, 6, 0.2), transparent 40%),
    linear-gradient(160deg, rgba(92, 49, 31, 0.97), rgba(112, 53, 34, 0.96) 52%, rgba(64, 28, 22, 0.98));
}

#chat-screen[data-sidebar-theme="mahogany-flare"] {
  --sidebar-theme-background:
    radial-gradient(circle at 16% 10%, rgba(248, 113, 113, 0.26), transparent 40%),
    radial-gradient(circle at 84% 18%, rgba(251, 146, 60, 0.22), transparent 40%),
    radial-gradient(circle at 84% 90%, rgba(153, 27, 27, 0.24), transparent 42%),
    linear-gradient(155deg, rgba(83, 32, 24, 0.98), rgba(116, 46, 33, 0.96) 54%, rgba(55, 23, 18, 0.99));
}

#chat-screen[data-sidebar-theme="garnet-night"] {
  --sidebar-theme-background:
    radial-gradient(circle at 14% 12%, rgba(251, 113, 133, 0.24), transparent 40%),
    radial-gradient(circle at 84% 82%, rgba(157, 23, 77, 0.22), transparent 42%),
    radial-gradient(circle at 82% 20%, rgba(220, 38, 38, 0.18), transparent 40%),
    linear-gradient(162deg, rgba(57, 17, 36, 0.99), rgba(72, 18, 42, 0.98) 54%, rgba(36, 16, 32, 0.99));
}

#chat-screen[data-sidebar-theme="scarlet-grid"] {
  --sidebar-theme-background:
    repeating-linear-gradient(0deg, rgba(248, 113, 113, 0.14) 0 2px, rgba(0, 0, 0, 0) 2px 15px),
    repeating-linear-gradient(90deg, rgba(239, 68, 68, 0.12) 0 2px, rgba(0, 0, 0, 0) 2px 17px),
    radial-gradient(circle at 16% 12%, rgba(252, 165, 165, 0.24), transparent 40%),
    linear-gradient(160deg, rgba(86, 18, 28, 0.98), rgba(124, 25, 38, 0.96) 54%, rgba(58, 16, 29, 0.99));
}

#chat-screen[data-sidebar-theme="oxblood-weave"] {
  --sidebar-theme-background:
    repeating-linear-gradient(135deg, rgba(127, 29, 29, 0.16) 0 7px, rgba(69, 10, 10, 0.06) 7px 16px),
    repeating-linear-gradient(45deg, rgba(190, 24, 93, 0.1) 0 6px, rgba(0, 0, 0, 0) 6px 18px),
    radial-gradient(circle at 82% 18%, rgba(251, 113, 133, 0.2), transparent 40%),
    linear-gradient(160deg, rgba(61, 12, 24, 0.99), rgba(78, 15, 29, 0.98) 52%, rgba(42, 10, 24, 0.99));
}

#chat-screen[data-sidebar-theme="polar-day"] {
  --sidebar-theme-background:
    linear-gradient(180deg, rgba(7, 18, 38, 0.44), rgba(7, 18, 38, 0.56)),
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.34), transparent 38%),
    radial-gradient(circle at 86% 16%, rgba(147, 197, 253, 0.26), transparent 40%),
    radial-gradient(circle at 88% 90%, rgba(56, 189, 248, 0.2), transparent 42%),
    linear-gradient(160deg, rgba(170, 215, 255, 0.84), rgba(92, 162, 231, 0.86) 52%, rgba(52, 116, 195, 0.9));
}

#chat-screen[data-sidebar-theme="citrus-zest"] {
  --sidebar-theme-background:
    linear-gradient(180deg, rgba(19, 22, 34, 0.4), rgba(19, 22, 34, 0.52)),
    radial-gradient(circle at 14% 12%, rgba(254, 240, 138, 0.34), transparent 38%),
    radial-gradient(circle at 88% 16%, rgba(251, 191, 36, 0.26), transparent 40%),
    radial-gradient(circle at 86% 88%, rgba(132, 204, 22, 0.24), transparent 42%),
    linear-gradient(162deg, rgba(249, 210, 42, 0.82), rgba(236, 171, 18, 0.84) 52%, rgba(138, 184, 54, 0.86));
}

#chat-screen[data-sidebar-theme="rose-latte"] {
  --sidebar-theme-background:
    linear-gradient(180deg, rgba(30, 18, 39, 0.4), rgba(30, 18, 39, 0.52)),
    radial-gradient(circle at 12% 10%, rgba(255, 241, 242, 0.36), transparent 38%),
    radial-gradient(circle at 84% 22%, rgba(251, 113, 133, 0.26), transparent 40%),
    radial-gradient(circle at 84% 90%, rgba(244, 114, 182, 0.24), transparent 42%),
    linear-gradient(158deg, rgba(251, 200, 215, 0.84), rgba(236, 159, 191, 0.84) 52%, rgba(213, 109, 154, 0.88));
}

#chat-screen[data-sidebar-theme="aqua-tiles"] {
  --sidebar-theme-background:
    linear-gradient(180deg, rgba(7, 27, 41, 0.42), rgba(7, 27, 41, 0.54)),
    repeating-linear-gradient(45deg, rgba(14, 165, 233, 0.14) 0 9px, rgba(167, 243, 208, 0.08) 9px 20px),
    repeating-linear-gradient(-45deg, rgba(56, 189, 248, 0.1) 0 7px, rgba(0, 0, 0, 0) 7px 16px),
    radial-gradient(circle at 86% 18%, rgba(186, 230, 253, 0.28), transparent 40%),
    linear-gradient(160deg, rgba(124, 234, 218, 0.84), rgba(94, 190, 231, 0.84) 54%, rgba(39, 150, 206, 0.88));
}

#chat-screen[data-sidebar-theme="gold-weave"] {
  --sidebar-theme-background:
    linear-gradient(180deg, rgba(30, 20, 9, 0.42), rgba(30, 20, 9, 0.56)),
    repeating-linear-gradient(120deg, rgba(251, 191, 36, 0.14) 0 6px, rgba(0, 0, 0, 0) 6px 16px),
    repeating-linear-gradient(60deg, rgba(249, 115, 22, 0.1) 0 6px, rgba(0, 0, 0, 0) 6px 18px),
    radial-gradient(circle at 14% 10%, rgba(255, 237, 213, 0.32), transparent 38%),
    linear-gradient(160deg, rgba(245, 215, 140, 0.84), rgba(225, 173, 60, 0.84) 52%, rgba(194, 97, 31, 0.88));
}

#chat-screen[data-chat-main-theme="dark-doodle"] {
  --chat-main-bg:
    linear-gradient(
      180deg,
      rgba(4, 7, 12, 0.38) 0%,
      rgba(4, 7, 12, 0.26) 52%,
      rgba(4, 7, 12, 0.44) 100%
    ),
    url("/assets/chat-bg/official/123.jpg");
}

#chat-screen[data-chat-main-theme="deep-night"] {
  --chat-main-bg:
    linear-gradient(
      180deg,
      rgba(6, 14, 40, 0.98) 0%,
      rgba(4, 11, 34, 0.97) 45%,
      rgba(2, 8, 28, 0.98) 100%
    );
}

#chat-screen[data-chat-main-theme="aurora-stream"] {
  --chat-main-bg:
    radial-gradient(circle at 12% 8%, rgba(34, 211, 238, 0.2), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(168, 85, 247, 0.22), transparent 40%),
    linear-gradient(165deg, rgba(7, 26, 48, 0.98) 0%, rgba(9, 38, 57, 0.96) 48%, rgba(20, 18, 52, 0.98) 100%);
}

#chat-screen[data-chat-main-theme="graphite-wave"] {
  --chat-main-bg:
    radial-gradient(circle at 70% 0%, rgba(148, 163, 184, 0.14), transparent 42%),
    linear-gradient(170deg, rgba(9, 14, 24, 0.98) 0%, rgba(16, 27, 43, 0.97) 53%, rgba(7, 11, 20, 0.99) 100%);
}

#chat-screen[data-chat-main-theme="cobalt-clouds"] {
  --chat-main-bg:
    radial-gradient(circle at 20% 16%, rgba(56, 189, 248, 0.18), transparent 38%),
    radial-gradient(circle at 80% 24%, rgba(37, 99, 235, 0.2), transparent 40%),
    linear-gradient(170deg, rgba(5, 20, 54, 0.98) 0%, rgba(7, 35, 74, 0.97) 45%, rgba(6, 23, 52, 0.99) 100%);
}

#chat-screen[data-chat-main-theme="emerald-depth"] {
  --chat-main-bg:
    radial-gradient(circle at 22% 14%, rgba(34, 197, 94, 0.2), transparent 40%),
    radial-gradient(circle at 84% 86%, rgba(20, 184, 166, 0.18), transparent 36%),
    linear-gradient(170deg, rgba(5, 24, 24, 0.98) 0%, rgba(4, 46, 46, 0.97) 50%, rgba(3, 29, 38, 0.98) 100%);
}

#chat-screen[data-chat-main-theme="crimson-dusk"] {
  --chat-main-bg:
    radial-gradient(circle at 16% 10%, rgba(248, 113, 113, 0.2), transparent 42%),
    radial-gradient(circle at 82% 22%, rgba(244, 63, 94, 0.2), transparent 40%),
    linear-gradient(168deg, rgba(37, 10, 16, 0.98) 0%, rgba(58, 16, 25, 0.97) 52%, rgba(24, 10, 18, 0.99) 100%);
}

#chat-screen[data-chat-main-theme="amber-fade"] {
  --chat-main-bg:
    radial-gradient(circle at 14% 8%, rgba(251, 191, 36, 0.18), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(249, 115, 22, 0.16), transparent 34%),
    linear-gradient(170deg, rgba(41, 26, 7, 0.98) 0%, rgba(65, 35, 8, 0.97) 46%, rgba(24, 15, 7, 0.99) 100%);
}

#chat-screen[data-chat-main-theme="violet-grid"] {
  --chat-main-bg:
    linear-gradient(160deg, rgba(20, 10, 36, 0.98) 0%, rgba(35, 14, 58, 0.97) 48%, rgba(18, 10, 34, 0.99) 100%),
    repeating-linear-gradient(
      45deg,
      rgba(167, 139, 250, 0.1) 0 10px,
      rgba(139, 92, 246, 0.05) 10px 20px
    );
}

#chat-screen[data-chat-main-theme="arctic-milk"] {
  --chat-main-bg:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.76), transparent 40%),
    radial-gradient(circle at 86% 88%, rgba(125, 211, 252, 0.22), transparent 36%),
    linear-gradient(170deg, rgba(246, 251, 255, 0.98) 0%, rgba(227, 239, 255, 0.96) 52%, rgba(209, 228, 247, 0.98) 100%);
}

#chat-screen[data-chat-main-theme="cloud-ivory"] {
  --chat-main-bg:
    radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.78), transparent 38%),
    radial-gradient(circle at 82% 18%, rgba(196, 181, 253, 0.22), transparent 34%),
    linear-gradient(165deg, rgba(255, 252, 244, 0.98) 0%, rgba(244, 239, 228, 0.96) 50%, rgba(233, 226, 213, 0.98) 100%);
}

#chat-screen[data-chat-main-theme="peach-frost"] {
  --chat-main-bg:
    radial-gradient(circle at 16% 10%, rgba(255, 237, 213, 0.7), transparent 40%),
    radial-gradient(circle at 88% 88%, rgba(251, 207, 232, 0.26), transparent 34%),
    linear-gradient(170deg, rgba(255, 245, 236, 0.98) 0%, rgba(255, 229, 210, 0.96) 48%, rgba(239, 218, 203, 0.98) 100%);
}

#chat-screen[data-chat-main-theme="mint-glass"] {
  --chat-main-bg:
    radial-gradient(circle at 14% 8%, rgba(236, 253, 245, 0.76), transparent 42%),
    radial-gradient(circle at 84% 90%, rgba(125, 211, 252, 0.24), transparent 34%),
    linear-gradient(168deg, rgba(238, 255, 248, 0.98) 0%, rgba(213, 249, 235, 0.96) 50%, rgba(199, 236, 227, 0.98) 100%);
}

#chat-screen[data-chat-main-theme="jade-forest"] {
  --chat-main-bg:
    radial-gradient(circle at 16% 10%, rgba(74, 222, 128, 0.2), transparent 42%),
    radial-gradient(circle at 84% 86%, rgba(20, 184, 166, 0.18), transparent 34%),
    linear-gradient(168deg, rgba(6, 32, 22, 0.99) 0%, rgba(9, 56, 34, 0.98) 52%, rgba(5, 34, 29, 0.99) 100%);
}

#chat-screen[data-chat-main-theme="lime-nebula"] {
  --chat-main-bg:
    radial-gradient(circle at 14% 10%, rgba(190, 242, 100, 0.18), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(134, 239, 172, 0.2), transparent 36%),
    linear-gradient(166deg, rgba(20, 42, 10, 0.99) 0%, rgba(40, 72, 15, 0.98) 50%, rgba(18, 44, 20, 0.99) 100%);
}

#chat-screen[data-chat-main-theme="pine-matrix"] {
  --chat-main-bg:
    linear-gradient(165deg, rgba(6, 28, 18, 0.99) 0%, rgba(6, 42, 28, 0.98) 54%, rgba(4, 30, 24, 0.99) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(74, 222, 128, 0.1) 0 2px,
      rgba(0, 0, 0, 0) 2px 14px
    );
}

#chat-screen[data-chat-main-theme="cyan-diagonal"] {
  --chat-main-bg:
    repeating-linear-gradient(135deg, rgba(56, 189, 248, 0.16) 0 10px, rgba(0, 0, 0, 0) 10px 24px),
    repeating-linear-gradient(45deg, rgba(34, 211, 238, 0.1) 0 7px, rgba(0, 0, 0, 0) 7px 18px),
    linear-gradient(166deg, rgba(6, 24, 46, 0.99) 0%, rgba(10, 44, 66, 0.98) 52%, rgba(7, 26, 52, 0.99) 100%);
}

#chat-screen[data-chat-main-theme="slate-hex"] {
  --chat-main-bg:
    radial-gradient(circle at 50% 50%, rgba(148, 163, 184, 0.08) 0 24%, rgba(0, 0, 0, 0) 24% 100%),
    repeating-linear-gradient(60deg, rgba(148, 163, 184, 0.08) 0 2px, rgba(0, 0, 0, 0) 2px 18px),
    repeating-linear-gradient(-60deg, rgba(100, 116, 139, 0.08) 0 2px, rgba(0, 0, 0, 0) 2px 18px),
    linear-gradient(168deg, rgba(17, 24, 39, 0.99) 0%, rgba(30, 41, 59, 0.98) 52%, rgba(15, 23, 42, 0.99) 100%);
}

#chat-screen[data-chat-main-theme="ruby-dots"] {
  --chat-main-bg:
    radial-gradient(circle, rgba(248, 113, 113, 0.12) 0 2px, rgba(0, 0, 0, 0) 2px 14px),
    linear-gradient(168deg, rgba(40, 12, 20, 0.99) 0%, rgba(68, 16, 30, 0.98) 52%, rgba(34, 10, 24, 0.99) 100%);
  --chat-main-bg-size: 18px 18px, cover;
  --chat-main-bg-position: 0 0, center center;
}

#chat-screen[data-chat-main-theme="sun-weave"] {
  --chat-main-bg:
    repeating-linear-gradient(120deg, rgba(251, 191, 36, 0.14) 0 7px, rgba(0, 0, 0, 0) 7px 20px),
    repeating-linear-gradient(60deg, rgba(249, 115, 22, 0.09) 0 6px, rgba(0, 0, 0, 0) 6px 18px),
    linear-gradient(165deg, rgba(40, 24, 10, 0.99) 0%, rgba(64, 36, 9, 0.98) 50%, rgba(33, 19, 8, 0.99) 100%);
}

#chat-screen:is(
    [data-sidebar-theme="polar-day"],
    [data-sidebar-theme="citrus-zest"],
    [data-sidebar-theme="rose-latte"],
    [data-sidebar-theme="aqua-tiles"],
    [data-sidebar-theme="gold-weave"]
  ) .sidebar-section-head {
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(8, 24, 49, 0.44), rgba(17, 36, 64, 0.34));
  border: 1px solid rgba(15, 23, 42, 0.3);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.24);
}

#chat-screen:is(
    [data-sidebar-theme="polar-day"],
    [data-sidebar-theme="citrus-zest"],
    [data-sidebar-theme="rose-latte"],
    [data-sidebar-theme="aqua-tiles"],
    [data-sidebar-theme="gold-weave"]
  ) .sidebar h2 {
  background: linear-gradient(120deg, #0b4269, #1d4ed8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 10px rgba(15, 23, 42, 0.34),
    0 0 16px rgba(37, 99, 235, 0.18);
}

#chat-screen:is(
    [data-sidebar-theme="polar-day"],
    [data-sidebar-theme="citrus-zest"],
    [data-sidebar-theme="rose-latte"],
    [data-sidebar-theme="aqua-tiles"],
    [data-sidebar-theme="gold-weave"]
  ) .sidebar h2::after {
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.95), rgba(30, 64, 175, 0.82));
  box-shadow:
    0 0 8px rgba(14, 116, 144, 0.32),
    0 0 14px rgba(15, 23, 42, 0.44);
}

#chat-screen:is(
    [data-sidebar-theme="polar-day"],
    [data-sidebar-theme="citrus-zest"],
    [data-sidebar-theme="rose-latte"],
    [data-sidebar-theme="aqua-tiles"],
    [data-sidebar-theme="gold-weave"]
  ) .profile-trigger,
#chat-screen:is(
    [data-sidebar-theme="polar-day"],
    [data-sidebar-theme="citrus-zest"],
    [data-sidebar-theme="rose-latte"],
    [data-sidebar-theme="aqua-tiles"],
    [data-sidebar-theme="gold-weave"]
  ) .logout-button {
  border-color: rgba(12, 74, 110, 0.7);
  background: linear-gradient(125deg, rgba(10, 77, 145, 0.84), rgba(29, 78, 216, 0.74));
  color: #f8fbff;
  box-shadow:
    0 0 14px rgba(15, 23, 42, 0.34),
    inset 0 0 0 1px rgba(224, 242, 254, 0.2);
}

#chat-screen:is(
    [data-sidebar-theme="polar-day"],
    [data-sidebar-theme="citrus-zest"],
    [data-sidebar-theme="rose-latte"],
    [data-sidebar-theme="aqua-tiles"],
    [data-sidebar-theme="gold-weave"]
  ) .contact-search-button,
#chat-screen:is(
    [data-sidebar-theme="polar-day"],
    [data-sidebar-theme="citrus-zest"],
    [data-sidebar-theme="rose-latte"],
    [data-sidebar-theme="aqua-tiles"],
    [data-sidebar-theme="gold-weave"]
  ) .section-toggle {
  border-color: rgba(8, 47, 73, 0.72);
  background: linear-gradient(130deg, rgba(13, 84, 158, 0.86), rgba(30, 64, 175, 0.72));
  color: #f8fbff;
  box-shadow:
    inset 0 0 0 1px rgba(191, 219, 254, 0.18),
    0 0 12px rgba(15, 23, 42, 0.24);
}

#chat-screen:is(
    [data-sidebar-theme="polar-day"],
    [data-sidebar-theme="citrus-zest"],
    [data-sidebar-theme="rose-latte"],
    [data-sidebar-theme="aqua-tiles"],
    [data-sidebar-theme="gold-weave"]
  ) .users-list {
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.1), transparent 60%),
    linear-gradient(135deg, rgba(7, 19, 39, 0.94), rgba(10, 26, 50, 0.9));
  border-color: rgba(125, 211, 252, 0.38);
  box-shadow:
    0 0 20px rgba(2, 6, 23, 0.55),
    0 0 30px rgba(15, 23, 42, 0.45);
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--sidebar-width, 360px) - 4px);
  width: 10px;
  z-index: 22;
  cursor: ew-resize;
  touch-action: none;
  border: none;
  background: transparent;
  outline: none;
}

.sidebar-resizer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: min(35%, 240px);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(56, 189, 248, 0.25),
    rgba(168, 85, 247, 0.22)
  );
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
  transition: background 0.15s ease, box-shadow 0.15s ease, width 0.15s ease;
}

.sidebar-resizer:hover::before,
.sidebar-resizer.is-dragging::before,
.sidebar-resizer:focus-visible::before {
  width: 3px;
  background: linear-gradient(
    180deg,
    rgba(56, 189, 248, 0.9),
    rgba(168, 85, 247, 0.8)
  );
  box-shadow:
    0 0 10px rgba(56, 189, 248, 0.7),
    0 0 20px rgba(168, 85, 247, 0.45);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sidebar-section--stretch {
  flex: 0 0 auto;
  min-height: auto;
}


.sidebar h2 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent); /* запасной вариант, если градиент не применится */

  background: linear-gradient(120deg, #38bdf8, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  text-shadow:
    0 0 12px rgba(56, 189, 248, 0.65),
    0 0 22px rgba(168, 85, 247, 0.4);
}

.sidebar h2::after {
  content: "";
  display: block;
  margin-top: 6px;
  width: 40px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(56, 189, 248, 0.95),
    rgba(168, 85, 247, 0.75)
  );
  box-shadow:
    0 0 10px rgba(56, 189, 248, 0.6),
    0 0 18px rgba(15, 23, 42, 0.9);
}

.sidebar-section-head h2 {
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
}

.contact-search-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(147, 197, 253, 0.92);
  border-radius: 13px;
  color: #f4fbff;
  background: linear-gradient(
    135deg,
    rgba(22, 105, 205, 0.98),
    rgba(49, 137, 251, 0.92)
  );
  box-shadow:
    inset 0 0 0 1px rgba(224, 242, 254, 0.28),
    0 0 16px rgba(56, 189, 248, 0.58),
    0 0 28px rgba(37, 99, 235, 0.4);
  animation: contact-search-glow 2.2s ease-in-out infinite;
}

.contact-search-icon {
  width: 20px;
  height: 20px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(147, 197, 253, 0.65));
}

.contact-search-button:hover {
  border-color: rgba(219, 234, 254, 0.98);
  color: #ffffff;
  background: linear-gradient(
    135deg,
    rgba(36, 127, 235, 0.99),
    rgba(76, 154, 255, 0.94)
  );
  box-shadow:
    inset 0 0 0 1px rgba(239, 246, 255, 0.42),
    0 0 18px rgba(125, 211, 252, 0.72),
    0 0 34px rgba(37, 99, 235, 0.48);
}

.create-group-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(249, 115, 22, 0.95);
  border-radius: 13px;
  color: #fff7ed;
  background: linear-gradient(
    135deg,
    rgba(251, 113, 133, 0.98),
    rgba(249, 115, 22, 0.92)
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 237, 213, 0.22),
    0 0 16px rgba(251, 113, 133, 0.58),
    0 0 30px rgba(249, 115, 22, 0.48);
  animation: create-group-pulse 2.2s ease-in-out infinite;
}

.create-group-button:hover {
  border-color: rgba(255, 237, 213, 0.98);
  color: #ffffff;
  background: linear-gradient(
    135deg,
    rgba(244, 63, 94, 0.99),
    rgba(251, 146, 60, 0.94)
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 242, 0.42),
    0 0 20px rgba(251, 113, 133, 0.74),
    0 0 36px rgba(249, 115, 22, 0.6);
}

.create-group-icon {
  width: 22px;
  height: 22px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(255, 237, 213, 0.68));
}

.group-search-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(125, 211, 252, 0.95);
  border-radius: 13px;
  color: #f0f9ff;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.96),
    rgba(37, 99, 235, 0.9)
  );
  box-shadow:
    inset 0 0 0 1px rgba(224, 242, 254, 0.24),
    0 0 16px rgba(56, 189, 248, 0.55),
    0 0 30px rgba(59, 130, 246, 0.38);
  animation: group-search-pulse 2.1s ease-in-out infinite;
}

.group-search-button:hover {
  border-color: rgba(224, 242, 254, 0.98);
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.98),
    rgba(59, 130, 246, 0.94)
  );
  box-shadow:
    inset 0 0 0 1px rgba(239, 246, 255, 0.34),
    0 0 20px rgba(125, 211, 252, 0.72),
    0 0 36px rgba(37, 99, 235, 0.52);
}

.group-search-icon {
  width: 20px;
  height: 20px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(186, 230, 253, 0.66));
}

@keyframes create-group-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 237, 213, 0.22),
      0 0 14px rgba(251, 113, 133, 0.5),
      0 0 24px rgba(249, 115, 22, 0.36);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 237, 213, 0.34),
      0 0 22px rgba(251, 113, 133, 0.8),
      0 0 40px rgba(249, 115, 22, 0.62);
  }
}

@keyframes group-search-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(224, 242, 254, 0.24),
      0 0 14px rgba(56, 189, 248, 0.44),
      0 0 24px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(239, 246, 255, 0.35),
      0 0 20px rgba(125, 211, 252, 0.7),
      0 0 36px rgba(37, 99, 235, 0.52);
  }
}

@keyframes contact-search-glow {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(224, 242, 254, 0.28),
      0 0 14px rgba(56, 189, 248, 0.46),
      0 0 24px rgba(37, 99, 235, 0.32);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(224, 242, 254, 0.35),
      0 0 20px rgba(56, 189, 248, 0.72),
      0 0 36px rgba(37, 99, 235, 0.55);
  }
}

.section-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #d2ecff;
  background: linear-gradient(130deg, rgba(56, 189, 248, 0.2), rgba(20, 31, 59, 0.82));
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.22);
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.section-toggle:hover {
  border-color: rgba(125, 211, 252, 0.9);
  color: #ffffff;
  background: linear-gradient(130deg, rgba(56, 189, 248, 0.34), rgba(59, 130, 246, 0.3));
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.42),
    0 0 22px rgba(37, 99, 235, 0.22);
}

.section-toggle.is-collapsed {
  transform: rotate(-90deg);
}

.sidebar-section.is-collapsed {
  gap: 4px;
}

.profile-trigger {
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: linear-gradient(
    120deg,
    rgba(56, 189, 248, 0.28),
    rgba(168, 85, 247, 0.24)
  );
  color: #e5f3ff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-transform: uppercase;
  transition:
    transform 0.12s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  box-shadow:
    0 0 10px rgba(56, 189, 248, 0.22),
    inset 0 0 0 1px rgba(15, 23, 42, 0.35);
}

.profile-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.9);
  background: linear-gradient(
    120deg,
    rgba(56, 189, 248, 0.4),
    rgba(125, 211, 252, 0.25)
  );
  box-shadow:
    0 0 16px rgba(56, 189, 248, 0.35),
    inset 0 0 0 1px rgba(14, 116, 144, 0.28);
}

.profile-trigger:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(125, 211, 252, 0.55),
    0 0 16px rgba(56, 189, 248, 0.4);
}

.logout-button {
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: linear-gradient(
    120deg,
    rgba(56, 189, 248, 0.32),
    rgba(168, 85, 247, 0.24)
  );
  color: #e5f3ff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    color 0.22s ease,
    transform 0.12s ease;
  box-shadow:
    0 0 10px rgba(56, 189, 248, 0.22),
    inset 0 0 0 1px rgba(15, 23, 42, 0.35);
}

.logout-button:hover {
  background: linear-gradient(
    120deg,
    rgba(248, 113, 113, 0.44),
    rgba(239, 68, 68, 0.4),
    rgba(190, 18, 60, 0.36)
  );
  border-color: rgba(248, 113, 113, 0.78);
  color: #fff;
  box-shadow:
    0 0 16px rgba(248, 113, 113, 0.45),
    inset 0 0 0 1px rgba(127, 29, 29, 0.25);
  transform: translateY(-1px);
}

.logout-button:active {
  transform: translateY(0);
}

.logout-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(248, 113, 113, 0.5),
    0 0 16px rgba(248, 113, 113, 0.45);
}


.users-list {
  list-style: none;
  padding: 10px 12px 10px 8px;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-soft);
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.6) transparent;

  /* более яркий, контрастный фон под список ников */
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.16), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  box-shadow:
    0 0 26px rgba(15, 23, 42, 0.95),
    0 0 40px rgba(15, 23, 42, 0.97);
}

.sidebar .users-list {
  padding: calc(10px * var(--sidebar-elements-scale)) calc(12px * var(--sidebar-elements-scale))
    calc(10px * var(--sidebar-elements-scale)) calc(8px * var(--sidebar-elements-scale));
  gap: calc(8px * var(--sidebar-elements-scale));
  font-size: calc(15px * var(--sidebar-elements-scale));
}

.users-list--stretch {
  flex: 0 0 auto;
  min-height: auto;
  overflow-y: visible;
}

.users-list li.is-active {
  background: linear-gradient(
    90deg,
    rgba(56, 189, 248, 0.25),
    rgba(15, 23, 42, 0.9)
  );
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow:
    0 0 16px rgba(56, 189, 248, 0.4),
    0 0 28px rgba(168, 85, 247, 0.25);
  color: #e0f2fe;
}

.users-list li.is-self {
  background: linear-gradient(
    90deg,
    rgba(56, 189, 248, 0.2),
    rgba(15, 23, 42, 0.9)
  );
}

.users-list li {
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.98),
    rgba(15, 23, 42, 0.82)
  );
  border: 1px solid rgba(148, 163, 184, 0.45);
  position: relative;

  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  max-width: 100%;

  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 8px rgba(15, 23, 42, 0.9),
    0 0 14px rgba(15, 23, 42, 1);
  transition:
    transform 0.08s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}

.users-list--compact {
  padding: 8px 12px 8px 8px;
  gap: 6px;
}

.sidebar .users-list--compact {
  padding: calc(8px * var(--sidebar-elements-scale)) calc(12px * var(--sidebar-elements-scale))
    calc(8px * var(--sidebar-elements-scale)) calc(8px * var(--sidebar-elements-scale));
  gap: calc(6px * var(--sidebar-elements-scale));
}

.users-list--compact li {
  padding: 6px 10px;
  font-size: 14px;
}

.sidebar .users-list li {
  padding: calc(8px * var(--sidebar-elements-scale)) calc(12px * var(--sidebar-elements-scale));
  gap: calc(10px * var(--sidebar-elements-scale));
}

.sidebar .users-list--compact li {
  padding: calc(6px * var(--sidebar-elements-scale)) calc(10px * var(--sidebar-elements-scale));
  font-size: calc(14px * var(--sidebar-elements-scale));
}

.users-list li.direct-dialog-item {
  padding-right: 34px;
}

.sidebar .users-list li.direct-dialog-item {
  padding-right: calc(34px * var(--sidebar-elements-scale));
}

.users-list li.chat-room-item {
  padding-right: 10px;
  width: 100%;
  align-self: stretch;
  min-width: 0;
}

.sidebar .users-list li.chat-room-item {
  padding-right: calc(10px * var(--sidebar-elements-scale));
}

.users-list li.chat-room-item .user-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.users-list li.chat-room-item:hover .user-name {
  color: var(--room-title-hover-color, currentColor);
  text-shadow: var(--room-title-hover-glow, none);
}

.chat-room-requests-trigger {
  margin-left: auto;
  flex-shrink: 0;
  border: 1px solid rgba(248, 113, 113, 0.58);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(69, 10, 10, 0.72), rgba(76, 5, 25, 0.7));
  color: #ffe4e6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  cursor: pointer;
  box-shadow:
    0 0 12px rgba(248, 113, 113, 0.34),
    0 0 22px rgba(251, 113, 133, 0.2);
  transition:
    transform 0.12s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.chat-room-requests-trigger:hover,
.chat-room-requests-trigger:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(252, 165, 165, 0.82);
  box-shadow:
    0 0 14px rgba(252, 165, 165, 0.42),
    0 0 28px rgba(244, 63, 94, 0.26);
  filter: brightness(1.06);
}

.chat-room-requests-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.chat-room-requests-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  border: 1px solid rgba(254, 202, 202, 0.8);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 10px rgba(239, 68, 68, 0.7),
    0 0 18px rgba(220, 38, 38, 0.36);
}

.direct-hide-button {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 1px solid rgba(226, 232, 240, 0.4);
  border-radius: 999px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.75);
  color: rgba(226, 232, 240, 0.95);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.12s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.users-list li.direct-dialog-item:hover .direct-hide-button,
.users-list li.direct-dialog-item.is-active .direct-hide-button {
  opacity: 1;
  pointer-events: auto;
}

.direct-hide-button:hover {
  transform: translateY(-50%) scale(1.06);
  border-color: rgba(248, 113, 113, 0.82);
  background: rgba(127, 29, 29, 0.8);
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.35);
}

.users-list li.is-clickable {
  cursor: pointer;
}

.users-list li.is-clickable:hover {
  transform: translateY(-1px);
  background: linear-gradient(
    90deg,
    rgba(30, 41, 59, 0.98),
    rgba(15, 23, 42, 0.9)
  );
  box-shadow: 0 0 18px rgba(15, 23, 42, 0.6);
}

#chat-screen[data-sidebar-outline="off"] .users-list li,
#chat-screen[data-sidebar-outline="off"] .users-list li.is-active,
#chat-screen[data-sidebar-outline="off"] .users-list li.is-self,
#chat-screen[data-sidebar-outline="off"] .users-list li.is-clickable:hover,
#chat-screen[data-sidebar-outline="disabled"] .users-list li,
#chat-screen[data-sidebar-outline="disabled"] .users-list li.is-active,
#chat-screen[data-sidebar-outline="disabled"] .users-list li.is-self,
#chat-screen[data-sidebar-outline="disabled"] .users-list li.is-clickable:hover {
  border-color: rgba(148, 163, 184, 0.26) !important;
  box-shadow: none !important;
  text-shadow: none;
}

#chat-screen[data-sidebar-outline="avatars-only"] .users-list li,
#chat-screen[data-sidebar-outline="avatars-only"] .users-list li.is-active,
#chat-screen[data-sidebar-outline="avatars-only"] .users-list li.is-self {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 12px;
  padding: 6px 8px;
  text-shadow: none;
}

#chat-screen[data-sidebar-outline="avatars-only"] .users-list li.is-clickable:hover {
  border-color: transparent !important;
  background: linear-gradient(
    100deg,
    rgba(56, 189, 248, 0.12),
    rgba(168, 85, 247, 0.08)
  ) !important;
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.16),
    0 0 16px rgba(15, 23, 42, 0.24) !important;
}

#chat-screen[data-sidebar-outline="avatars-only"] .users-list li .user-name {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.public-chat-shortcut {
  width: 100%;
  margin-top: 8px;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.7);
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.4),
    rgba(168, 85, 247, 0.35)
  );
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow:
    0 0 16px rgba(56, 189, 248, 0.45),
    0 0 28px rgba(168, 85, 247, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.public-chat-shortcut:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow:
    0 0 20px rgba(56, 189, 248, 0.6),
    0 0 32px rgba(168, 85, 247, 0.45);
}

.user-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--avatar-border, rgba(148, 163, 184, 0.7));
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.35),
    0 0 14px var(--avatar-glow, rgba(15, 23, 42, 0.65));
}

.sidebar .user-avatar {
  width: calc(45px * var(--sidebar-elements-scale));
  height: calc(45px * var(--sidebar-elements-scale));
}

.user-avatar.is-clickable {
  cursor: pointer;
}

.message-avatar {
  width: var(--message-avatar-size);
  height: var(--message-avatar-size);
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--avatar-border, rgba(148, 163, 184, 0.7));
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.35),
    0 0 14px var(--avatar-glow, rgba(15, 23, 42, 0.65));
}

.message-avatar.is-clickable {
  cursor: pointer;
}

.user-name {
  flex: 1;
}

.user-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.user-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.6);
  box-shadow: 0 0 6px rgba(15, 23, 42, 0.7);
}

.sidebar .user-status {
  width: calc(8px * var(--sidebar-elements-scale));
  height: calc(8px * var(--sidebar-elements-scale));
}

.user-status.is-online {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

.users-empty {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  opacity: 0.7;
  align-self: stretch;
  text-align: center;
}

.user-unread {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}


/* Chat main */

.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0; /* важно для скролла внутри */
  position: relative;
  background-image: var(--chat-main-overlay), var(--chat-main-bg);
  background-size: cover, var(--chat-main-bg-size);
  background-position: center center, var(--chat-main-bg-position);
  background-repeat: no-repeat, var(--chat-main-bg-repeat);
}

.chat.is-file-drag::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 9, 26, 0.5);
  z-index: 8;
  pointer-events: none;
}

.chat.is-file-drag::after {
  content: "Отпустите файл(ы), чтобы прикрепить";
  position: absolute;
  inset: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 2px dashed rgba(125, 211, 252, 0.95);
  background: linear-gradient(
    145deg,
    rgba(14, 116, 144, 0.25) 0%,
    rgba(37, 99, 235, 0.2) 52%,
    rgba(30, 64, 175, 0.24) 100%
  );
  color: #e0f2fe;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.9);
  box-shadow:
    0 0 0 1px rgba(125, 211, 252, 0.35),
    0 0 24px rgba(56, 189, 248, 0.45),
    inset 0 0 28px rgba(59, 130, 246, 0.2);
  z-index: 9;
  pointer-events: none;
}

.home-view {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.home-view-card {
  width: min(540px, 100%);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.48);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.2), transparent 55%),
    radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.18), transparent 60%),
    linear-gradient(140deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.88));
  box-shadow:
    0 0 24px rgba(15, 23, 42, 0.95),
    0 0 34px rgba(56, 189, 248, 0.2);
  padding: 24px;
}

.home-view-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: 0.04em;
}

.home-view-card p {
  margin: 0;
  color: #d0e7ff;
  line-height: 1.45;
}

.home-inline-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #dff5ff;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(191, 233, 255, 0.8);
  text-underline-offset: 3px;
  cursor: pointer;
}

.home-inline-link:hover,
.home-inline-link:focus-visible {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.95);
}

.notes-view {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.notes-view-card {
  border-radius: 18px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.2), transparent 60%),
    linear-gradient(130deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.9));
  color: #dff5ff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 20px 26px;
  box-shadow:
    0 0 18px rgba(56, 189, 248, 0.35),
    0 0 34px rgba(15, 23, 42, 0.9);
}

.chat-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9));
}

.chat-header.has-public-participants {
  padding-top: 6px;
  padding-bottom: 44px;
}

.chat-header.has-public-participants.no-public-status {
  padding-bottom: 18px;
}

.chat-header.has-public-participants .chat-title {
  min-height: 0;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 3;
  margin-left: auto;
}

.history-search-button {
  border: 1px solid rgba(125, 211, 252, 0.72);
  border-radius: 12px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ecfeff;
  background:
    radial-gradient(circle at 25% 25%, rgba(125, 211, 252, 0.28), transparent 56%),
    linear-gradient(135deg, rgba(10, 48, 95, 0.96), rgba(14, 74, 147, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(224, 242, 254, 0.2),
    0 0 14px rgba(56, 189, 248, 0.36);
}

.history-search-button:hover {
  border-color: rgba(186, 230, 253, 0.96);
  background:
    radial-gradient(circle at 25% 25%, rgba(186, 230, 253, 0.34), transparent 58%),
    linear-gradient(135deg, rgba(14, 68, 137, 0.98), rgba(29, 94, 199, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(224, 242, 254, 0.3),
    0 0 18px rgba(56, 189, 248, 0.55);
}

.icon-button {
  border: none;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 999px;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

.icon-button:hover {
  background: rgba(148, 163, 184, 0.15);
  transform: translateY(-1px);
}

.icon-button.muted {
  opacity: 0.6;
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
}

.zoom-control input[type="range"] {
  width: 90px;
}

.chat-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  z-index: 2;
  min-height: 34px;
}

.chat-settings-button {
  border: 1px solid rgba(56, 189, 248, 0.72);
  background:
    radial-gradient(circle at 30% 30%, rgba(125, 211, 252, 0.38), transparent 55%),
    linear-gradient(135deg, rgba(18, 64, 126, 0.96), rgba(23, 78, 164, 0.9));
  color: #d8f2ff;
  border-radius: 12px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(125, 211, 252, 0.65);
  box-shadow:
    inset 0 0 0 1px rgba(186, 230, 253, 0.2),
    0 0 14px rgba(56, 189, 248, 0.35),
    0 0 28px rgba(37, 99, 235, 0.28);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.2s ease,
    box-shadow 0.22s ease,
    color 0.22s ease,
    background 0.22s ease;
}

.chat-settings-button:hover {
  transform: translateY(-1px);
  border-color: rgba(147, 197, 253, 0.96);
  color: #ffffff;
  background:
    radial-gradient(circle at 30% 30%, rgba(191, 219, 254, 0.48), transparent 56%),
    linear-gradient(135deg, rgba(30, 93, 184, 0.98), rgba(29, 78, 216, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(224, 242, 254, 0.34),
    0 0 16px rgba(125, 211, 252, 0.55),
    0 0 34px rgba(37, 99, 235, 0.36);
}

.chat-settings-button:active {
  transform: translateY(0);
}

.chat-settings-button.hidden {
  display: none;
}

#chat-title-text {
  transition: all 0.2s ease;
}

#chat-title-text.is-public-title {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  display: inline-block;
  font-size: clamp(24px, 2vw, 36px);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  width: max-content;
  max-width: calc(100% - 340px);
  overflow: visible;
  text-overflow: clip;
  color: var(--chat-title-base-color, #7dd3fc);
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  text-shadow: var(
    --chat-title-base-glow,
    0 0 2px rgba(224, 247, 255, 0.82),
    0 0 10px rgba(56, 189, 248, 0.56),
    0 0 20px rgba(56, 189, 248, 0.42),
    0 0 32px rgba(14, 165, 233, 0.28)
  );
  pointer-events: none;
}

#chat-title-text.is-public-title.is-clickable {
  pointer-events: auto;
  cursor: pointer;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#chat-title-text.is-public-title.is-clickable:hover,
#chat-title-text.is-public-title.is-clickable:focus-visible {
  color: var(--chat-title-hover-color, #ecfeff);
  text-shadow: var(
    --chat-title-hover-glow,
    0 0 4px rgba(224, 247, 255, 0.95),
    0 0 14px rgba(56, 189, 248, 0.72),
    0 0 28px rgba(56, 189, 248, 0.52),
    0 0 42px rgba(14, 165, 233, 0.34)
  );
  outline: none;
}

.chat-room-status {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: #e3f4ff;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  text-shadow:
    0 0 10px rgba(56, 189, 248, 0.44),
    0 0 18px rgba(14, 116, 144, 0.26);
  max-width: min(70vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header.has-public-participants .chat-room-status {
  position: absolute;
  left: 50%;
  top: 62px;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
}

.chat-pinned-banner {
  margin: 8px 18px 0;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background:
    radial-gradient(circle at 10% 18%, rgba(56, 189, 248, 0.1), transparent 50%),
    linear-gradient(145deg, rgba(11, 25, 50, 0.38), rgba(16, 31, 58, 0.28));
  backdrop-filter: blur(8px);
  box-shadow:
    inset 0 0 0 1px rgba(226, 232, 240, 0.04),
    0 8px 18px rgba(2, 6, 23, 0.3),
    0 0 12px rgba(56, 189, 248, 0.16);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-pinned-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-pinned-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a5f3fc;
}

.chat-pinned-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.chat-pinned-author {
  font-size: 13px;
  font-weight: 800;
  color: #e0f2fe;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-pinned-time {
  font-size: 11px;
  color: rgba(191, 219, 254, 0.85);
  white-space: nowrap;
}

.chat-pinned-toggle {
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.34);
  color: #d7f0ff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.chat-pinned-toggle:hover {
  border-color: rgba(186, 230, 253, 0.62);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.18);
  filter: brightness(1.05);
}

.chat-pinned-body {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(2, 6, 23, 0.2), rgba(15, 23, 42, 0.16));
  color: #e2e8f0;
  text-align: left;
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.03);
}

.chat-pinned-body:hover {
  border-color: rgba(125, 211, 252, 0.54);
  background: linear-gradient(145deg, rgba(2, 6, 23, 0.26), rgba(15, 23, 42, 0.22));
}

.chat-pinned-banner.is-collapsed .chat-pinned-body {
  display: none;
}

.public-participants-trigger {
  position: absolute;
  left: 50%;
  top: 42px;
  transform: translateX(-50%);
  border: none;
  background: transparent;
  color: #d2e8ff;
  border-radius: 0;
  padding: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  z-index: 2;
  text-shadow:
    0 0 9px rgba(125, 211, 252, 0.52),
    0 0 18px rgba(37, 99, 235, 0.34);
  transition:
    color 0.18s ease,
    text-shadow 0.22s ease,
    transform 0.15s ease;
}

.public-participants-trigger:hover,
.public-participants-trigger:focus-visible {
  color: #ffffff;
  text-shadow:
    0 0 12px rgba(191, 219, 254, 0.7),
    0 0 20px rgba(56, 189, 248, 0.4);
}

.chat-context {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.7);
}

.chat-context.is-direct {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.6);
  background: linear-gradient(
    120deg,
    rgba(56, 189, 248, 0.25),
    rgba(168, 85, 247, 0.2)
  );
  box-shadow:
    0 0 14px rgba(56, 189, 248, 0.35),
    0 0 24px rgba(168, 85, 247, 0.2);
}

.participants-modal .participants-card {
  width: min(560px, 96vw);
  max-height: min(78vh, 760px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at 15% 18%, rgba(56, 189, 248, 0.2), transparent 46%),
    radial-gradient(circle at 84% 24%, rgba(168, 85, 247, 0.16), transparent 52%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(17, 24, 39, 0.94));
  border: 1px solid rgba(125, 211, 252, 0.38);
  box-shadow:
    0 18px 46px rgba(3, 9, 23, 0.72),
    0 0 24px rgba(56, 189, 248, 0.25),
    inset 0 0 0 1px rgba(148, 197, 255, 0.14);
}

.participants-list {
  margin: 0;
  padding: 2px 0;
  overflow: auto;
  max-height: min(60vh, 560px);
}

.participants-list li {
  min-height: 46px;
  width: 100%;
  align-self: stretch;
  text-align: left;
}

.participants-list .user-name {
  text-align: left;
}

.participants-role-badge {
  margin-left: auto;
  border: 1px solid rgba(125, 211, 252, 0.42);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.92);
  background: rgba(30, 64, 175, 0.26);
}

.participants-role-badge.is-owner {
  border-color: rgba(253, 224, 71, 0.74);
  color: #fef9c3;
  background: linear-gradient(135deg, rgba(202, 138, 4, 0.35), rgba(234, 179, 8, 0.24));
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.28);
}

.participants-role-badge.is-admin {
  border-color: rgba(110, 231, 183, 0.72);
  color: #d1fae5;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.34), rgba(6, 182, 212, 0.22));
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.26);
}

.back-to-public {
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: linear-gradient(
    120deg,
    rgba(56, 189, 248, 0.35),
    rgba(168, 85, 247, 0.3)
  );
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.35),
    0 0 24px rgba(168, 85, 247, 0.25);
}

.back-to-public:hover {
  background: linear-gradient(
    120deg,
    rgba(56, 189, 248, 0.5),
    rgba(168, 85, 247, 0.45)
  );
  border-color: rgba(56, 189, 248, 0.7);
  transform: translateY(-1px);
}

.dm-popup {
  position: fixed;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.8);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.dm-popup.hidden {
  display: none;
}

.dm-popup .dm-title {
  font-size: 12px;
  color: var(--text-soft);
}

.dm-popup .dm-action {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.28),
    rgba(168, 85, 247, 0.25)
  );
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.25),
    0 0 18px rgba(168, 85, 247, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.dm-popup .dm-action:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow:
    0 0 16px rgba(56, 189, 248, 0.35),
    0 0 24px rgba(168, 85, 247, 0.25);
}

.dm-popup .dm-action--public {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.3),
    rgba(56, 189, 248, 0.25)
  );
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow:
    0 0 12px rgba(34, 197, 94, 0.25),
    0 0 18px rgba(56, 189, 248, 0.2);
}

.dm-popup .dm-action--public:hover {
  border-color: rgba(34, 197, 94, 0.65);
  box-shadow:
    0 0 16px rgba(34, 197, 94, 0.35),
    0 0 24px rgba(56, 189, 248, 0.25);
}

.dm-popup .dm-action--photo {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.34),
    rgba(56, 189, 248, 0.26)
  );
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow:
    0 0 12px rgba(99, 102, 241, 0.3),
    0 0 18px rgba(56, 189, 248, 0.2);
}

.dm-popup .dm-action--photo:hover {
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow:
    0 0 16px rgba(99, 102, 241, 0.42),
    0 0 24px rgba(56, 189, 248, 0.28);
}

.chat-status {
  font-size: 13px;
  color: var(--accent);
}

.chat-notifications {
  position: fixed;
  top: 78px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 7000;
  max-width: 320px;
}

.chat-notification {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(
    135deg,
    rgba(30, 64, 175, 0.98),
    rgba(56, 189, 248, 0.9)
  );
  border: 1px solid rgba(56, 189, 248, 0.85);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow:
    0 0 18px rgba(59, 130, 246, 0.6),
    0 0 32px rgba(56, 189, 248, 0.55),
    0 8px 24px rgba(15, 23, 42, 0.6);
  animation: notification-enter 0.2s ease;
}

.chat-notification.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.chat-notification__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-notification__title {
  font-weight: 700;
  font-size: 13px;
  color: #f8fafc;
}

.chat-notification__body {
  font-size: 12px;
  color: rgba(248, 250, 252, 0.9);
}

.chat-notification__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-notification__action {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  background: rgba(248, 250, 252, 0.95);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.chat-notification__action:hover {
  background: #ffffff;
}

.chat-notification__close {
  border: none;
  background: rgba(15, 23, 42, 0.4);
  color: rgba(248, 250, 252, 0.9);
  border-radius: 999px;
  padding: 4px 8px;
  cursor: pointer;
}

@keyframes notification-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 22, 0.85);
  z-index: 1500;
  padding: 24px;
}

#profile-modal {
  z-index: 1700;
}

body.global-update-lock {
  overflow: hidden;
}

.global-update-overlay {
  position: fixed;
  inset: 0;
  z-index: 4200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(56, 189, 248, 0.12), transparent 44%),
    linear-gradient(160deg, rgba(2, 6, 23, 0.86), rgba(2, 8, 24, 0.94));
  backdrop-filter: blur(10px);
}

.global-update-card {
  width: min(560px, 96vw);
  border-radius: 24px;
  border: 1px solid rgba(125, 211, 252, 0.56);
  background:
    radial-gradient(circle at 12% 12%, rgba(56, 189, 248, 0.2), transparent 56%),
    linear-gradient(150deg, rgba(12, 38, 72, 0.98), rgba(8, 20, 40, 0.96));
  box-shadow:
    0 24px 70px rgba(2, 6, 23, 0.88),
    0 0 26px rgba(56, 189, 248, 0.28);
  padding: 26px 24px 22px;
  text-align: center;
}

.global-update-title {
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #e0f2fe;
  text-shadow: 0 0 18px rgba(125, 211, 252, 0.42);
}

.global-update-message {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.48;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.global-update-hint {
  margin-top: 12px;
  font-size: 13px;
  color: rgba(191, 219, 254, 0.92);
}

.global-update-action {
  margin-top: 18px;
  min-width: 210px;
  border: 1px solid rgba(125, 211, 252, 0.82);
  border-radius: 999px;
  padding: 11px 18px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.38), rgba(29, 78, 216, 0.34));
  color: #f8fafc;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 0 18px rgba(56, 189, 248, 0.32),
    0 0 34px rgba(37, 99, 235, 0.24);
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.global-update-action:hover,
.global-update-action:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(186, 230, 253, 0.95);
  box-shadow:
    0 0 24px rgba(125, 211, 252, 0.48),
    0 0 36px rgba(59, 130, 246, 0.32);
}

.incoming-noncontact-overlay {
  position: fixed;
  inset: 0;
  z-index: 4190;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at 20% 15%, rgba(14, 165, 233, 0.14), transparent 44%),
    radial-gradient(circle at 85% 10%, rgba(56, 189, 248, 0.12), transparent 46%),
    linear-gradient(150deg, rgba(2, 8, 24, 0.78), rgba(5, 10, 28, 0.86));
  backdrop-filter: blur(8px);
}

.incoming-noncontact-card {
  width: min(620px, 96vw);
  border-radius: 24px;
  border: 1px solid rgba(56, 189, 248, 0.7);
  background:
    radial-gradient(circle at 12% 18%, rgba(56, 189, 248, 0.24), transparent 56%),
    linear-gradient(145deg, rgba(11, 36, 74, 0.97), rgba(8, 20, 44, 0.96));
  box-shadow:
    0 26px 78px rgba(2, 6, 23, 0.86),
    0 0 24px rgba(56, 189, 248, 0.36),
    0 0 54px rgba(37, 99, 235, 0.24);
  padding: 24px 22px 20px;
  text-align: center;
  position: relative;
  animation: incoming-noncontact-pulse 2.8s ease-in-out infinite;
}

.incoming-noncontact-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.52);
  background: rgba(7, 89, 133, 0.32);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.incoming-noncontact-title {
  margin-top: 14px;
  font-size: clamp(24px, 4.4vw, 34px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #f0f9ff;
  text-align: center;
  text-shadow:
    0 0 14px rgba(125, 211, 252, 0.34),
    0 0 30px rgba(56, 189, 248, 0.2);
}

.incoming-noncontact-message {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.96);
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
}

.incoming-noncontact-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.incoming-noncontact-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  min-width: 168px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.incoming-noncontact-btn--view {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(37, 99, 235, 0.36));
  border-color: rgba(125, 211, 252, 0.8);
  color: #f0f9ff;
  box-shadow:
    0 0 16px rgba(56, 189, 248, 0.34),
    0 0 28px rgba(37, 99, 235, 0.24);
}

.incoming-noncontact-btn--add {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.34), rgba(6, 182, 212, 0.32));
  border-color: rgba(110, 231, 183, 0.75);
  color: #ecfeff;
  box-shadow:
    0 0 16px rgba(16, 185, 129, 0.3),
    0 0 28px rgba(6, 182, 212, 0.24);
}

.incoming-noncontact-btn:hover,
.incoming-noncontact-btn:focus-visible {
  transform: translateY(-1px);
}

.incoming-noncontact-btn--view:hover,
.incoming-noncontact-btn--view:focus-visible {
  border-color: rgba(186, 230, 253, 0.94);
  box-shadow:
    0 0 22px rgba(125, 211, 252, 0.48),
    0 0 34px rgba(37, 99, 235, 0.34);
}

.incoming-noncontact-btn--add:hover,
.incoming-noncontact-btn--add:focus-visible {
  border-color: rgba(167, 243, 208, 0.92);
  box-shadow:
    0 0 22px rgba(52, 211, 153, 0.44),
    0 0 34px rgba(14, 165, 233, 0.3);
}

.incoming-noncontact-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.incoming-noncontact-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(125, 211, 252, 0.62);
  background: rgba(8, 47, 73, 0.55);
  color: #e0f2fe;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.14s ease;
}

.incoming-noncontact-close:hover,
.incoming-noncontact-close:focus-visible {
  background: rgba(2, 132, 199, 0.5);
  border-color: rgba(186, 230, 253, 0.92);
  transform: translateY(-1px);
}

@keyframes incoming-noncontact-pulse {
  0%,
  100% {
    box-shadow:
      0 26px 78px rgba(2, 6, 23, 0.86),
      0 0 22px rgba(56, 189, 248, 0.32),
      0 0 50px rgba(37, 99, 235, 0.22);
  }
  50% {
    box-shadow:
      0 26px 78px rgba(2, 6, 23, 0.86),
      0 0 30px rgba(125, 211, 252, 0.52),
      0 0 66px rgba(37, 99, 235, 0.36);
  }
}

.group-join-request-overlay {
  z-index: 4194;
}

.group-join-request-card {
  border-color: rgba(34, 197, 94, 0.72);
  background:
    radial-gradient(circle at 12% 18%, rgba(34, 197, 94, 0.24), transparent 56%),
    linear-gradient(145deg, rgba(9, 52, 35, 0.97), rgba(6, 33, 24, 0.96));
  box-shadow:
    0 26px 78px rgba(2, 6, 23, 0.86),
    0 0 24px rgba(34, 197, 94, 0.34),
    0 0 54px rgba(5, 150, 105, 0.22);
}

.group-join-request-kicker {
  border-color: rgba(110, 231, 183, 0.58);
  background: rgba(6, 95, 70, 0.32);
  color: #d1fae5;
}

.group-join-request-title {
  text-shadow:
    0 0 14px rgba(134, 239, 172, 0.3),
    0 0 30px rgba(34, 197, 94, 0.18);
}

.group-join-request-message {
  color: rgba(220, 252, 231, 0.95);
}

.group-join-request-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(134, 239, 172, 0.35);
  background: rgba(2, 44, 34, 0.44);
  color: rgba(220, 252, 231, 0.92);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
}

.group-join-request-btn--reject {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.38), rgba(190, 24, 93, 0.3));
  border-color: rgba(252, 165, 165, 0.74);
  color: #fff1f2;
  box-shadow:
    0 0 16px rgba(248, 113, 113, 0.28),
    0 0 28px rgba(190, 24, 93, 0.2);
}

.group-join-request-btn--accept {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.44), rgba(16, 185, 129, 0.36));
  border-color: rgba(167, 243, 208, 0.82);
  color: #f0fdf4;
  box-shadow:
    0 0 16px rgba(74, 222, 128, 0.32),
    0 0 28px rgba(16, 185, 129, 0.24);
}

.group-join-request-btn--reject:hover,
.group-join-request-btn--reject:focus-visible {
  border-color: rgba(254, 202, 202, 0.95);
}

.group-join-request-btn--accept:hover,
.group-join-request-btn--accept:focus-visible {
  border-color: rgba(220, 252, 231, 0.96);
}

.group-join-requests-list-card {
  width: min(560px, 95vw);
  text-align: left;
  border-color: rgba(248, 113, 113, 0.55);
  background:
    radial-gradient(circle at 14% 15%, rgba(248, 113, 113, 0.2), transparent 56%),
    linear-gradient(145deg, rgba(46, 13, 36, 0.96), rgba(24, 32, 64, 0.94));
  box-shadow:
    0 24px 72px rgba(15, 23, 42, 0.9),
    0 0 24px rgba(251, 113, 133, 0.32),
    0 0 46px rgba(244, 63, 94, 0.18);
}

.group-join-requests-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(2, 6, 23, 0.42);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(56vh, 440px);
  overflow-y: auto;
}

.group-join-request-item {
  border: 1px solid rgba(251, 113, 133, 0.42);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.8));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  cursor: pointer;
  transition:
    transform 0.13s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.group-join-request-item:hover {
  transform: translateY(-1px);
  border-color: rgba(252, 165, 165, 0.72);
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.26);
}

.group-join-request-item-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.group-join-request-item-name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-join-request-item-note {
  font-size: 12px;
  color: rgba(254, 226, 226, 0.9);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-card {
  background: linear-gradient(
    150deg,
    rgba(19, 53, 98, 0.96) 0%,
    rgba(22, 66, 120, 0.95) 45%,
    rgba(38, 88, 126, 0.95) 100%
  );
  border: 1px solid rgba(125, 211, 252, 0.45);
  border-radius: 24px;
  padding: 28px;
  width: min(440px, 92vw);
  text-align: center;
  position: relative;
  box-shadow:
    0 20px 60px rgba(15, 23, 42, 0.85),
    0 0 24px rgba(56, 189, 248, 0.25);
}

.delete-confirm-modal {
  z-index: 1820;
}

.delete-confirm-card {
  width: min(360px, 92vw);
  text-align: center;
  border: 1px solid rgba(248, 113, 113, 0.58);
  background: linear-gradient(
    145deg,
    rgba(58, 16, 28, 0.96) 0%,
    rgba(92, 24, 36, 0.93) 52%,
    rgba(50, 13, 23, 0.96) 100%
  );
  box-shadow:
    0 22px 64px rgba(15, 23, 42, 0.9),
    0 0 24px rgba(248, 113, 113, 0.36);
}

.delete-confirm-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffe4e6;
  text-shadow: 0 0 14px rgba(248, 113, 113, 0.35);
  margin-bottom: 18px;
}

.delete-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.delete-confirm-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  min-width: 106px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.delete-confirm-btn:hover {
  transform: translateY(-1px);
}

.delete-confirm-btn--cancel {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(148, 163, 184, 0.45);
  color: #e2e8f0;
}

.delete-confirm-btn--cancel:hover {
  background: rgba(51, 65, 85, 0.78);
  border-color: rgba(203, 213, 225, 0.62);
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.26);
}

.delete-confirm-btn--danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.94), rgba(190, 24, 93, 0.92));
  border-color: rgba(252, 165, 165, 0.72);
  color: #fff;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.34);
}

.delete-confirm-btn--danger:hover {
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.5);
}

.join-confirm-modal {
  z-index: 1825;
}

.chat-leave-confirm-modal {
  z-index: 1828;
}

.chat-leave-confirm-card {
  width: min(390px, 92vw);
  text-align: center;
  border: 1px solid rgba(248, 113, 113, 0.7);
  background: linear-gradient(
    145deg,
    rgba(66, 13, 31, 0.97) 0%,
    rgba(101, 24, 44, 0.95) 52%,
    rgba(56, 9, 27, 0.97) 100%
  );
  box-shadow:
    0 24px 66px rgba(15, 23, 42, 0.92),
    0 0 24px rgba(248, 113, 113, 0.4);
}

.chat-leave-confirm-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  color: #ffe4e6;
  text-shadow: 0 0 14px rgba(248, 113, 113, 0.38);
  margin-bottom: 18px;
}

.chat-leave-confirm-btn {
  min-width: 116px;
}

.chat-leave-confirm-btn--cancel {
  background: rgba(51, 65, 85, 0.68);
  border-color: rgba(252, 165, 165, 0.36);
  color: #fee2e2;
}

.chat-leave-confirm-btn--cancel:hover {
  border-color: rgba(252, 165, 165, 0.62);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.24);
}

.chat-leave-confirm-btn--accept {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.96), rgba(190, 24, 93, 0.93));
  border-color: rgba(252, 165, 165, 0.74);
  color: #fff1f2;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.34);
}

.chat-leave-confirm-btn--accept:hover {
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.5);
}

.join-confirm-card {
  width: min(380px, 92vw);
  text-align: center;
  border: 1px solid rgba(74, 222, 128, 0.62);
  background: linear-gradient(
    145deg,
    rgba(8, 62, 40, 0.96) 0%,
    rgba(12, 85, 52, 0.94) 52%,
    rgba(7, 55, 36, 0.96) 100%
  );
  box-shadow:
    0 22px 64px rgba(15, 23, 42, 0.9),
    0 0 24px rgba(74, 222, 128, 0.38);
}

.join-confirm-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  color: #dcfce7;
  text-shadow: 0 0 14px rgba(74, 222, 128, 0.3);
  margin-bottom: 18px;
}

.join-confirm-subtitle {
  margin: -8px 0 14px;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(209, 250, 229, 0.94);
  text-align: center;
}

.join-request-message-wrap {
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: center;
}

.join-request-message-wrap span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(187, 247, 208, 0.92);
}

.join-request-message-wrap textarea {
  border-radius: 12px;
  border: 1px solid rgba(110, 231, 183, 0.56);
  background: rgba(6, 78, 59, 0.34);
  color: #ecfdf5;
  font-size: 14px;
  line-height: 1.45;
  min-height: 92px;
  padding: 10px 12px;
  text-align: center;
  resize: vertical;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.join-request-message-wrap textarea::placeholder {
  color: rgba(167, 243, 208, 0.7);
}

.join-request-message-wrap textarea:focus {
  border-color: rgba(167, 243, 208, 0.88);
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.34),
    0 0 16px rgba(16, 185, 129, 0.28);
}

.join-confirm-btn {
  min-width: 116px;
}

.join-confirm-btn--cancel {
  background: rgba(6, 95, 70, 0.36);
  border-color: rgba(110, 231, 183, 0.48);
  color: #d1fae5;
}

.join-confirm-btn--cancel:hover {
  background: rgba(6, 95, 70, 0.52);
  border-color: rgba(167, 243, 208, 0.7);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.32);
}

.join-confirm-btn--accept {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.96), rgba(5, 150, 105, 0.94));
  border-color: rgba(167, 243, 208, 0.72);
  color: #f0fdf4;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.34);
}

.join-confirm-btn--accept:hover {
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.52);
}

.create-group-modal {
  z-index: 1830;
}

.create-group-card {
  width: min(430px, 92vw);
  text-align: center;
  border: 1px solid rgba(249, 115, 22, 0.6);
  background: linear-gradient(
    150deg,
    rgba(95, 24, 46, 0.96) 0%,
    rgba(115, 40, 33, 0.94) 50%,
    rgba(98, 45, 16, 0.96) 100%
  );
  box-shadow:
    0 24px 66px rgba(15, 23, 42, 0.92),
    0 0 24px rgba(251, 113, 133, 0.4);
}

.create-group-title {
  font-size: 32px;
  font-weight: 800;
  color: #fff7ed;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 12px rgba(251, 113, 133, 0.45),
    0 0 20px rgba(249, 115, 22, 0.28);
}

.create-group-subtitle {
  margin-top: 10px;
  color: rgba(255, 237, 213, 0.9);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.create-group-field {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(255, 237, 213, 0.92);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-align: center;
}

.create-group-field span {
  text-align: center;
}

.create-group-field input,
.create-group-field select {
  border-radius: 12px;
  border: 1px solid rgba(251, 146, 60, 0.64);
  background: rgba(12, 14, 34, 0.8);
  color: #fff7ed;
  font-size: 15px;
  padding: 12px 14px;
  text-align: center;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.create-group-field input::placeholder {
  color: rgba(254, 215, 170, 0.62);
}

.create-group-field input:focus,
.create-group-field select:focus {
  border-color: rgba(251, 191, 36, 0.9);
  box-shadow:
    0 0 0 1px rgba(251, 146, 60, 0.5),
    0 0 16px rgba(249, 115, 22, 0.32);
}

.create-group-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.create-group-btn {
  min-width: 118px;
}

.create-group-btn--cancel {
  background: rgba(30, 41, 59, 0.66);
  border-color: rgba(251, 146, 60, 0.4);
  color: #ffedd5;
}

.create-group-btn--cancel:hover {
  border-color: rgba(253, 186, 116, 0.74);
  box-shadow: 0 0 14px rgba(251, 146, 60, 0.24);
}

.create-group-btn--confirm {
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.95), rgba(249, 115, 22, 0.95));
  border-color: rgba(254, 215, 170, 0.7);
  color: #fff7ed;
  box-shadow: 0 0 14px rgba(251, 113, 133, 0.36);
}

.create-group-btn--confirm:hover {
  box-shadow:
    0 0 20px rgba(251, 113, 133, 0.5),
    0 0 30px rgba(249, 115, 22, 0.35);
}

.profile-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 8px;
  cursor: pointer;
}

.profile-avatar {
  width: 170px;
  height: 170px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--profile-accent, rgba(56, 189, 248, 0.7));
  box-shadow:
    0 0 16px rgba(56, 189, 248, 0.4),
    0 0 28px rgba(15, 23, 42, 0.8);
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-avatar:hover {
  transform: scale(1.02);
  box-shadow:
    0 0 20px rgba(56, 189, 248, 0.5),
    0 0 36px rgba(15, 23, 42, 0.9);
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.profile-action {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.25),
    rgba(168, 85, 247, 0.2)
  );
  color: var(--text);
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow:
    0 0 18px rgba(56, 189, 248, 0.25),
    0 0 28px rgba(168, 85, 247, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-width: 220px;
}

.profile-action--primary {
  border-color: rgba(56, 189, 248, 0.7);
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.4),
    rgba(168, 85, 247, 0.3)
  );
  box-shadow:
    0 0 22px rgba(56, 189, 248, 0.35),
    0 0 32px rgba(168, 85, 247, 0.25);
}

.profile-action--danger {
  border-color: rgba(248, 113, 113, 0.62);
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.32),
    rgba(190, 24, 93, 0.26)
  );
  box-shadow:
    0 0 18px rgba(248, 113, 113, 0.26),
    0 0 26px rgba(190, 24, 93, 0.2);
}

.profile-action:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow:
    0 0 26px rgba(56, 189, 248, 0.4),
    0 0 36px rgba(168, 85, 247, 0.3);
}

.profile-avatar-view {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 22, 0.95);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.profile-avatar-view.hidden {
  display: none;
}

.profile-avatar-view img {
  max-width: 85%;
  max-height: 85%;
  border-radius: 24px;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.8),
    0 0 28px rgba(56, 189, 248, 0.3);
}

.profile-avatar-view .profile-avatar-view-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
}

.profile-card--self {
  width: min(620px, 96vw);
  max-height: min(92vh, 980px);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.contact-search-card {
  width: min(520px, 96vw);
  max-height: min(88vh, 820px);
  overflow: hidden;
}

.group-search-card {
  width: min(560px, 96vw);
  max-height: min(88vh, 820px);
  overflow: hidden;
}

.history-search-card {
  width: min(620px, 96vw);
  max-height: min(88vh, 820px);
  overflow: hidden;
}

.chat-settings-card {
  width: min(560px, 95vw);
  max-height: min(90vh, 980px);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 20px 18px 18px;
}

.chat-settings-card > .self-profile-title {
  text-align: center;
  margin-bottom: 2px;
}

.chat-settings-section {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.32);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), transparent 56%),
    linear-gradient(145deg, rgba(9, 21, 44, 0.9), rgba(8, 18, 37, 0.86));
}

.chat-settings-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(186, 230, 253, 0.9);
  margin-bottom: 8px;
}

.chat-settings-avatar-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.chat-settings-avatar-row .self-profile-avatar {
  width: 98px;
  height: 98px;
  margin: 0;
}

.chat-settings-avatar-controls {
  width: 100%;
  max-width: 360px;
}

.chat-settings-avatar-controls .self-profile-upload-label {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 8px 12px;
  justify-content: center;
}

.chat-settings-inline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chat-settings-color-field {
  margin-bottom: 0;
}

.chat-settings-color-field span {
  text-align: center;
}

.chat-settings-reset-colors {
  min-width: 100%;
  margin-top: 2px;
  padding: 9px 14px;
  font-size: 13px;
  border-color: rgba(125, 211, 252, 0.5);
  box-shadow:
    0 0 14px rgba(56, 189, 248, 0.2),
    0 0 20px rgba(99, 102, 241, 0.12);
}

.admin-update-card {
  width: min(540px, 96vw);
}

.chat-room-card {
  width: min(520px, 95vw);
  text-align: center;
}

.chat-room-card-title {
  margin-bottom: 10px;
}

.chat-room-card-avatar {
  margin-bottom: 10px;
}

.chat-room-card-name {
  margin-bottom: 12px;
  color: #e0f2fe;
}

.chat-room-card-description-wrap {
  text-align: center;
  border: 1px solid rgba(125, 211, 252, 0.4);
  border-radius: 14px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 55%),
    linear-gradient(145deg, rgba(9, 19, 40, 0.9), rgba(12, 25, 49, 0.86));
  padding: 12px 14px;
}

.chat-room-card-description-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(186, 230, 253, 0.85);
  margin-bottom: 8px;
}

.chat-room-card-description {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 40px;
}

.chat-room-card-link-wrap {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.38);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), transparent 56%),
    linear-gradient(145deg, rgba(9, 19, 40, 0.9), rgba(12, 25, 49, 0.86));
}

.chat-room-card-link-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(186, 230, 253, 0.85);
  margin-bottom: 8px;
}

.chat-room-card-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.chat-room-card-link-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: rgba(10, 17, 36, 0.82);
  color: #dbeafe;
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
}

.chat-room-card-link-copy {
  border: 1px solid rgba(125, 211, 252, 0.66);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #e6f5ff;
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.3), rgba(37, 99, 235, 0.26));
  cursor: pointer;
}

.chat-room-card-link-copy:hover {
  border-color: rgba(186, 230, 253, 0.92);
  filter: brightness(1.08);
}

.chat-room-card-link-copy.is-copied {
  border-color: rgba(52, 211, 153, 0.72);
  color: #ecfdf5;
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.34), rgba(6, 182, 212, 0.24));
}

.chat-room-card-link-copy[disabled] {
  cursor: default;
  opacity: 0.58;
  filter: saturate(0.75);
}

.chat-settings-actions-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chat-settings-actions-grid .profile-action {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  font-size: 13px;
}

.chat-settings-actions-wrap {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-settings-save-main {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
}

.chat-settings-actions-group {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.52), rgba(30, 41, 59, 0.42));
}

.chat-settings-actions-label {
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.9);
}

.chat-settings-delete-info {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.18);
  color: rgba(254, 226, 226, 0.98);
  font-size: 12px;
  line-height: 1.35;
}

.chat-settings-privacy-panel {
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(167, 243, 208, 0.34);
  background:
    radial-gradient(circle at top left, rgba(16, 185, 129, 0.12), transparent 56%),
    linear-gradient(145deg, rgba(8, 26, 40, 0.9), rgba(7, 20, 34, 0.86));
}

.chat-settings-privacy-current {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(187, 247, 208, 0.88);
  text-align: center;
}

.chat-settings-privacy-current span {
  color: #ecfdf5;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.chat-settings-toggle {
  gap: 6px;
}

.chat-settings-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #22c55e;
}

.chat-settings-toggle small {
  display: block;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(187, 247, 208, 0.85);
}

.chat-update-banner-settings {
  margin-top: 0;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.38);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 56%),
    linear-gradient(145deg, rgba(10, 22, 44, 0.9), rgba(8, 18, 37, 0.86));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-update-banner-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(186, 230, 253, 0.92);
  text-align: left;
}

.chat-update-banner-send {
  width: 100%;
  min-width: 0;
  padding: 9px 12px;
}

.chat-update-banner-send:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  filter: saturate(0.8);
  box-shadow: none;
  transform: none;
}

.chat-update-banner-cooldown {
  text-align: left;
  font-size: 12px;
  color: rgba(191, 219, 254, 0.9);
}

.chat-members-card {
  width: min(560px, 96vw);
  max-height: min(84vh, 820px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-members-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-members-tab {
  border: 1px solid rgba(148, 163, 184, 0.46);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease,
    transform 0.12s ease;
}

.chat-members-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.75);
  color: #eaf8ff;
}

.chat-members-tab.is-active {
  border-color: rgba(56, 189, 248, 0.8);
  color: #e6f5ff;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.26), rgba(37, 99, 235, 0.2));
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.2),
    0 0 20px rgba(37, 99, 235, 0.15);
}

.chat-members-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(62vh, 600px);
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
}

.chat-members-row {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.88));
  text-align: left;
}

.chat-members-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.chat-members-name {
  font-weight: 700;
  font-size: 15px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.chat-members-role {
  font-size: 12px;
  color: var(--text-soft);
  width: 100%;
  text-align: left;
}

.chat-members-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.chat-members-remove {
  border: 1px solid rgba(248, 113, 113, 0.58);
  color: #fff0f0;
  background: linear-gradient(120deg, rgba(239, 68, 68, 0.34), rgba(190, 24, 93, 0.24));
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.chat-members-remove[disabled] {
  cursor: default;
  opacity: 0.55;
}

.chat-members-unblock {
  border: 1px solid rgba(74, 222, 128, 0.58);
  color: #ecfdf5;
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.34), rgba(6, 182, 212, 0.24));
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.chat-members-unblock:hover {
  border-color: rgba(134, 239, 172, 0.76);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.28);
}

.chat-members-unblock[disabled] {
  cursor: default;
  opacity: 0.55;
}

.self-profile-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
  text-align: center;
}

.self-profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.self-profile-tab {
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.48);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease,
    transform 0.1s ease;
}

.self-profile-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.75);
  color: var(--text);
}

.self-profile-tab.is-active {
  border-color: rgba(56, 189, 248, 0.78);
  color: #e6f5ff;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.26),
    rgba(168, 85, 247, 0.18)
  );
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.2),
    0 0 20px rgba(168, 85, 247, 0.14);
}

.self-profile-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.self-profile-section {
  display: none;
  padding: 2px 2px 4px;
}

.self-profile-section.is-active {
  display: block;
}

.self-profile-avatar {
  display: block;
  margin: 0 auto 12px;
  width: 130px;
  height: 130px;
  cursor: pointer;
}

.self-profile-avatar-options {
  max-height: 140px;
  margin-bottom: 12px;
}

.self-profile-upload-label {
  display: flex;
  margin: 0 auto 14px;
  min-width: 220px;
  width: fit-content;
  justify-content: center;
  align-self: center;
}

.self-profile-upload-label input[type="file"] {
  display: none;
}

.contact-search-results {
  list-style: none;
  margin: 10px 0 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
}

.contact-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.88));
}

.contact-search-result .user-avatar {
  width: 40px;
  height: 40px;
}

.contact-search-result-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.contact-search-result-name {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-search-result-status {
  font-size: 12px;
  color: var(--text-soft);
}

.contact-search-result-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-search-result-action {
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #e6f5ff;
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.26), rgba(168, 85, 247, 0.22));
  cursor: pointer;
}

.contact-search-result-action:not([disabled]):hover {
  filter: brightness(1.08);
}

.contact-search-result-action--remove {
  border-color: rgba(248, 113, 113, 0.58);
  color: #fff0f0;
  background: linear-gradient(120deg, rgba(239, 68, 68, 0.34), rgba(190, 24, 93, 0.24));
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.26);
}

.contact-search-result-action[disabled] {
  cursor: default;
  opacity: 0.65;
}

.contact-search-loading {
  margin-top: 10px;
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
}

.group-search-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.88));
}

.group-search-result .user-avatar {
  width: 42px;
  height: 42px;
  margin-top: 2px;
}

.group-search-result-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.group-search-result-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  color: #e0f2fe;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.group-search-result-privacy {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: 100%;
  min-height: 1.2em;
  color: rgba(186, 230, 253, 0.78);
}

.group-search-result-privacy--open {
  color: #22c55e;
}

.group-search-result-privacy--closed {
  color: #ef4444;
}

.group-search-result-description {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(186, 230, 253, 0.9);
  width: 100%;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.group-search-result-link {
  font-size: 11px;
  color: rgba(147, 197, 253, 0.8);
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-search-result-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-search-result-action {
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #e6f5ff;
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.26), rgba(168, 85, 247, 0.22));
  cursor: pointer;
}

.group-search-result-action:not([disabled]):hover {
  filter: brightness(1.08);
}

.group-search-result-action--join {
  border-color: rgba(52, 211, 153, 0.6);
  color: #ecfdf5;
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.34), rgba(6, 182, 212, 0.26));
}

.group-search-result-action--request {
  border-color: rgba(250, 204, 21, 0.64);
  color: #fef9c3;
  background: linear-gradient(120deg, rgba(217, 119, 6, 0.34), rgba(234, 179, 8, 0.28));
}

.group-search-result-action--pending {
  border-color: rgba(196, 181, 253, 0.56);
  color: rgba(233, 213, 255, 0.92);
  background: linear-gradient(120deg, rgba(124, 58, 237, 0.28), rgba(79, 70, 229, 0.22));
}

.group-search-result-action--locked {
  border-color: rgba(248, 113, 113, 0.52);
  color: rgba(254, 226, 226, 0.92);
  background: linear-gradient(120deg, rgba(239, 68, 68, 0.3), rgba(190, 24, 93, 0.2));
}

.group-search-result-action[disabled] {
  cursor: default;
  opacity: 0.65;
}

.group-search-loading {
  margin-top: 10px;
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
}

.history-search-results {
  list-style: none;
  margin: 10px 0 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(56vh, 460px);
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
}

.group-search-results {
  list-style: none;
  margin: 10px 0 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(56vh, 420px);
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
}

.history-search-item {
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 14px;
  background: linear-gradient(125deg, rgba(2, 6, 23, 0.88), rgba(15, 23, 42, 0.78));
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.18s ease, transform 0.14s ease;
}

.history-search-item:hover {
  border-color: rgba(125, 211, 252, 0.72);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.28);
  transform: translateY(-1px);
}

.history-search-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.history-search-item-author {
  font-size: 13px;
  font-weight: 800;
}

.history-search-item-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-soft);
}

.history-search-item-text {
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-search-empty {
  margin-top: 10px;
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
}

.self-profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.self-profile-options-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.self-profile-field--half {
  flex: 1 1 0;
  min-width: 0;
}

.self-profile-field span {
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.03em;
}

.self-profile-field input,
.self-profile-field select,
.self-profile-field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}

.self-profile-field input:focus,
.self-profile-field select:focus,
.self-profile-field textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.self-profile-field textarea {
  min-height: 94px;
  resize: vertical;
}

.self-profile-field input[type="color"] {
  height: 42px;
  padding: 4px;
  cursor: pointer;
}

.self-profile-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.self-profile-field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

.self-profile-field input:-webkit-autofill,
.self-profile-field input:-webkit-autofill:hover,
.self-profile-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.55) inset;
  transition: background-color 9999s ease-out 0s;
}

@media (max-width: 640px) {
  .self-profile-options-row {
    flex-direction: column;
    gap: 0;
  }

  .self-profile-footer-actions {
    grid-template-columns: 1fr;
  }

  .chat-settings-avatar-row {
    flex-direction: column;
    align-items: center;
  }

  .chat-settings-avatar-controls {
    width: 100%;
  }

  .chat-settings-inline-grid {
    grid-template-columns: 1fr;
  }

  .chat-settings-actions-grid {
    grid-template-columns: 1fr;
  }
}

.self-profile-color-field {
  align-items: flex-start;
}

.self-profile-color-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.self-profile-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.self-profile-slider-value {
  font-size: 12px;
  font-weight: 700;
  color: #bae6fd;
  letter-spacing: 0.03em;
}

.self-profile-avatar-size-field input[type="range"] {
  padding: 0;
}

.self-profile-chat-bg-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.self-profile-chat-bg-upload {
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.45);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.self-profile-chat-bg-upload:hover {
  border-color: rgba(56, 189, 248, 0.72);
  background: rgba(56, 189, 248, 0.16);
  transform: translateY(-1px);
}

.self-profile-chat-bg-upload input[type="file"] {
  display: none;
}

.self-profile-color-field input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  min-width: 72px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: transparent;
  overflow: hidden;
  flex: 0 0 auto;
  cursor: pointer;
}

.self-profile-color-reset {
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.45);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.self-profile-color-reset:hover {
  border-color: rgba(56, 189, 248, 0.8);
  background: rgba(56, 189, 248, 0.16);
  transform: translateY(-1px);
}

.self-profile-color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.self-profile-color-field input[type="color"]::-webkit-color-swatch {
  border: none;
}

.self-profile-color-field input[type="color"]::-moz-color-swatch {
  border: none;
}

.self-profile-dialogs-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.self-profile-dialogs-feature input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.self-profile-dialogs-feature span {
  line-height: 1.3;
}

.self-profile-dialogs-feature-hint {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-soft);
}

.self-profile-hidden-header {
  margin-top: 6px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.self-profile-hidden-title {
  margin: 0;
  min-width: 0;
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hidden-dialogs-clear {
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.26),
    rgba(190, 24, 93, 0.22)
  );
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.hidden-dialogs-clear:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.75);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.2);
}

.self-profile-footer-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-top: 12px;
}

.self-profile-footer-actions.is-single {
  grid-template-columns: minmax(220px, 320px);
  justify-content: center;
}

.self-profile-footer-actions .profile-action {
  width: 100%;
  min-width: 0;
}

.hidden-dialogs-clear:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.hidden-dialogs-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.hidden-dialog-item {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
}

.hidden-dialog-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hidden-dialog-restore {
  border: 1px solid rgba(56, 189, 248, 0.6);
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.3),
    rgba(168, 85, 247, 0.25)
  );
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}

.hidden-dialog-remove {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.88);
  color: rgba(252, 165, 165, 0.96);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hidden-dialog-remove:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.8);
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.24);
}

.hidden-dialog-empty {
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  color: var(--text-soft);
  padding: 10px;
  text-align: center;
  font-size: 13px;
}

.self-profile-chat-rooms-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 360px);
  overflow-y: auto;
}

.self-profile-chat-room-item {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  background: linear-gradient(125deg, rgba(2, 6, 23, 0.86), rgba(15, 23, 42, 0.76));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease;
}

.self-profile-chat-room-item:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.65);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
}

.self-profile-chat-room-item.is-active {
  border-color: rgba(56, 189, 248, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(56, 189, 248, 0.2),
    0 0 16px rgba(56, 189, 248, 0.24);
}

.self-profile-chat-room-avatar {
  width: 42px;
  height: 42px;
}

.self-profile-chat-room-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.self-profile-chat-room-name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.self-profile-chat-room-description {
  font-size: 12px;
  color: rgba(186, 230, 253, 0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.self-profile-chat-room-leave {
  flex-shrink: 0;
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.55), rgba(136, 19, 55, 0.52));
  color: rgba(255, 228, 230, 0.95);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.2);
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    transform 0.12s ease,
    filter 0.12s ease;
}

.self-profile-chat-room-leave:hover {
  transform: translateY(-1px);
  border-color: rgba(252, 165, 165, 0.78);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.28);
  filter: brightness(1.06);
}

.self-profile-contact-item {
  cursor: default;
}

.self-profile-contact-remove {
  flex-shrink: 0;
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.54), rgba(136, 19, 55, 0.48));
  color: rgba(255, 228, 230, 0.95);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.2);
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    transform 0.12s ease,
    filter 0.12s ease;
}

.self-profile-contact-remove:hover {
  transform: translateY(-1px);
  border-color: rgba(252, 165, 165, 0.78);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.28);
  filter: brightness(1.06);
}

.self-profile-contact-remove[disabled] {
  opacity: 0.6;
  cursor: default;
}

.self-profile-chat-room-empty {
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  color: var(--text-soft);
  padding: 10px;
  text-align: center;
  font-size: 13px;
}

/* Audio player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 14px 8px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.62);
  background: linear-gradient(
    130deg,
    rgba(20, 57, 96, 0.95) 0%,
    rgba(24, 66, 116, 0.92) 48%,
    rgba(58, 42, 132, 0.9) 100%
  );
  box-shadow:
    0 0 16px rgba(56, 189, 248, 0.42),
    0 0 34px rgba(99, 102, 241, 0.34),
    inset 0 0 0 1px rgba(125, 211, 252, 0.18);
}

.audio-player.hidden {
  display: none;
}

.audio-player .icon-button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.38);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.audio-play {
  font-size: 15px;
  color: #e2f7ff;
  border-color: rgba(56, 189, 248, 0.72) !important;
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.28),
    rgba(56, 189, 248, 0.3),
    rgba(99, 102, 241, 0.28)
  ) !important;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.34),
    0 0 20px rgba(34, 197, 94, 0.28);
}

.audio-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.audio-title {
  font-size: 15px;
  font-weight: 600;
  color: #f0fbff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.28);
}

.audio-time {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.86);
}

#audio-progress {
  -webkit-appearance: none;
  appearance: none;
  flex: 2;
  max-width: 360px;
  min-width: 180px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(56, 189, 248, 0.88),
    rgba(99, 102, 241, 0.88)
  );
  box-shadow:
    0 0 10px rgba(56, 189, 248, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

#audio-progress::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(56, 189, 248, 0.82),
    rgba(99, 102, 241, 0.82)
  );
}

#audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #f8fafc;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.65),
    0 0 18px rgba(99, 102, 241, 0.45);
}

#audio-progress::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(
    90deg,
    rgba(56, 189, 248, 0.82),
    rgba(99, 102, 241, 0.82)
  );
}

#audio-progress::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #f8fafc;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.65),
    0 0 18px rgba(99, 102, 241, 0.45);
}

.audio-close {
  color: rgba(226, 232, 240, 0.92);
}

.audio-close:hover {
  color: #fff;
  border-color: rgba(248, 113, 113, 0.75) !important;
  background: linear-gradient(
    135deg,
    rgba(248, 113, 113, 0.25),
    rgba(99, 102, 241, 0.24)
  ) !important;
  box-shadow:
    0 0 12px rgba(248, 113, 113, 0.36),
    0 0 18px rgba(99, 102, 241, 0.3);
}

/* Messages */

.messages {
  flex: 1;
  list-style: none;
  padding: 16px 18px;
  margin: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.6) transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;   /* <-- главное: больше не растягиваем по ширине */
}

.message.is-unread .message-bubble {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.4);
}

.unread-indicator {
  position: absolute;
  right: 24px;
  bottom: 118px;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.9), rgba(168, 85, 247, 0.9));
  color: #0f172a;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.6);
  z-index: 4;
}

.unread-indicator:hover {
  filter: brightness(1.05);
}

.scroll-to-latest {
  position: absolute;
  right: 24px;
  bottom: 174px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(56, 189, 248, 0.78);
  border-radius: 999px;
  background: linear-gradient(140deg, rgba(56, 189, 248, 0.92), rgba(99, 102, 241, 0.86));
  color: #f8fbff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 0 16px rgba(56, 189, 248, 0.6),
    0 12px 24px rgba(2, 6, 23, 0.75);
  z-index: 4;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}

.scroll-to-latest:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow:
    0 0 20px rgba(56, 189, 248, 0.72),
    0 16px 30px rgba(2, 6, 23, 0.86);
}


.messages::-webkit-scrollbar {
  width: 6px;
}

.messages::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar,
.users-list::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.users-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.users-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  font-size: var(--message-font-size);

  /* заметная анимация появления */
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  animation: message-in 0.22s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.message-bubble {
  max-width: 56%;
  border-radius: 14px;
  padding: 8px 10px;
  background: var(--bubble-bg, rgba(12, 20, 42, 0.92));
  border: 1px solid var(--bubble-border, rgba(148, 163, 184, 0.32));
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
}

.message-bubble::after {
  display: none;
}

.message .meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  font-size: var(--meta-font-size);
}

.message-bubble.has-visible-text {
  padding: 8px 34px 8px 10px;
}

.message-bubble.has-visible-text .meta {
  padding-right: 24px;
}

.message .author {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
}

.message .author.is-clickable {
  cursor: pointer;
  text-decoration: none;
}

.message .author.is-clickable:hover {
  text-decoration: underline;
}

.message .text {
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message-body {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 4px 8px;
  min-width: 0;
}

.message-body .text {
  flex: 1 1 0;
  min-width: 0;
}

.message-status {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: var(--meta-font-size);
  color: var(--text-soft);
  line-height: 1;
}

.message-edited-badge {
  font-size: calc(var(--meta-font-size) - 1px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(226, 232, 240, 0.78);
}

.message-checks {
  color: var(--text-soft);
  font-weight: 600;
}

.message-checks.is-read {
  color: var(--accent);
}

.message-checks.is-sent {
  color: rgba(226, 232, 240, 0.7);
}

.message-time {
  color: var(--text-soft);
}

.chat-emoji {
  font-size: calc(var(--message-font-size) * 2);
  line-height: 1;
  display: inline-block;
}

.message .text a {
  color: #00e5ff;
}

.message:not(.me) .message-bubble {
  color: var(--incoming-text-color, inherit);
}

.message:not(.me) .message-bubble .text {
  color: var(--incoming-text-color, inherit);
}

.message:not(.me) .message-bubble .message-status,
.message:not(.me) .message-bubble .message-time,
.message:not(.me) .message-bubble .message-checks,
.message:not(.me) .message-bubble .message-edited-badge {
  color: var(--incoming-meta-color, var(--text-soft));
}

.message:not(.me) .message-bubble .text a {
  color: var(--incoming-link-color, #00e5ff);
}

#chat-screen[data-message-glow-mode="standard-shadow"] .message:not(.me) .message-bubble {
  background: #ffffff !important;
}

#chat-screen[data-message-glow-mode="standard-shadow"] .message:not(.me) .message-bubble,
#chat-screen[data-message-glow-mode="standard-shadow"] .message:not(.me) .message-bubble .text {
  color: #0f172a;
}

#chat-screen[data-message-glow-mode="standard-shadow"] .message:not(.me) .message-bubble .message-status,
#chat-screen[data-message-glow-mode="standard-shadow"] .message:not(.me) .message-bubble .message-time,
#chat-screen[data-message-glow-mode="standard-shadow"] .message:not(.me) .message-bubble .message-checks,
#chat-screen[data-message-glow-mode="standard-shadow"] .message:not(.me) .message-bubble .message-edited-badge {
  color: rgba(15, 23, 42, 0.72);
}

#chat-screen[data-message-glow-mode="standard-shadow"] .message:not(.me) .message-bubble .text a {
  color: #111827;
}

.message.me .message-bubble {
  color: var(--own-text-color, var(--text));
}

.message.me .message-bubble.has-visible-text {
  padding: 8px 10px 8px 34px;
}

.message.me .message-bubble.has-visible-text .meta {
  padding-right: 0;
  padding-left: 24px;
}

.message.me .message-bubble .text {
  color: inherit;
}

.message.me .message-bubble .message-status,
.message.me .message-bubble .message-time {
  color: var(--own-meta-color, rgba(226, 232, 240, 0.78));
}

.message.me .message-bubble .message-checks {
  color: var(--own-check-color, var(--accent));
}

.message.me .message-bubble .message-checks.is-sent {
  color: var(--own-meta-color, rgba(226, 232, 240, 0.78));
}

.message.me .message-bubble .text a {
  color: var(--own-link-color, #7dd3fc);
}

.message.me .message-bubble .reply-block .reply-snippet {
  --reply-snippet-color: rgba(248, 250, 252, 0.98);
  font-weight: 700;
}

.message:not(.me) .message-bubble .reply-block .reply-snippet {
  --reply-snippet-color: #0b0b0b;
}

.message .attachments {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.message-bubble.has-attachments-only {
  width: fit-content;
  max-width: min(620px, 72vw);
  padding: 6px 8px;
  gap: 2px;
}

.message-bubble.has-attachments-only .message-body {
  justify-content: flex-end;
  gap: 4px;
}

.message-bubble.has-attachments-only .message-status {
  margin-left: 0;
}

.message-bubble.has-attachments-only .attachment-images {
  max-width: min(600px, 70vw);
}

.message-bubble.has-attachments-only .attachment-thumb {
  max-width: clamp(160px, 29vw, 260px);
  max-height: 200px;
}

.message-reactions {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-end;
}

.message-reactions:empty {
  display: none;
  margin-top: 0;
}

.reaction-chip {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.reaction-chip.is-selected {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.16);
}

.message-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
}

.message.me .message-actions {
  left: 8px;
  right: auto;
}

.message-actions-trigger {
  border: 0;
  border-radius: 0;
  width: auto;
  height: auto;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--message-actions-trigger-color, rgba(191, 219, 254, 0.96));
  cursor: pointer;
  opacity: 1;
  transform: none;
  appearance: none;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: var(--message-actions-trigger-glow, 0 0 8px rgba(56, 189, 248, 0.3));
  transition:
    color 0.2s ease,
    text-shadow 0.2s ease;
}

.message-actions-trigger.is-open {
  color: var(--message-actions-trigger-color, #f0f9ff);
  text-shadow: var(--message-actions-trigger-glow, 0 0 12px rgba(56, 189, 248, 0.45));
}

.message-actions-trigger:hover {
  color: var(--message-actions-trigger-color, #f0f9ff);
  text-shadow: var(--message-actions-trigger-glow, 0 0 12px rgba(56, 189, 248, 0.45));
}

.message-actions-popup {
  position: fixed;
  left: 0;
  top: 0;
  min-width: 190px;
  max-width: min(280px, calc(100vw - 16px));
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: linear-gradient(155deg, rgba(5, 14, 34, 0.98), rgba(8, 21, 44, 0.97));
  box-shadow:
    0 16px 36px rgba(2, 6, 23, 0.75),
    0 0 24px rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(10px);
  z-index: 14000;
}

.message-actions-popup.hidden {
  display: none;
}

.message-actions-popup-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.message-actions-popup-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #dbeafe;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.message-actions-popup-item:hover {
  background: rgba(37, 99, 235, 0.2);
  color: #f8fbff;
}

.message-actions-popup-item[data-action="pin"] {
  color: #fde68a;
}

.message-actions-popup-item[data-action="edit"] {
  color: #bae6fd;
}

.message-actions-popup-item[data-action="delete"] {
  color: #fecdd3;
}

.message-actions-popup-item[data-action="copy"] {
  color: #bbf7d0;
}

.message-actions-popup-icon {
  width: 18px;
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.message-actions-popup-label {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.reaction-trigger {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.message-bubble:hover .reaction-trigger {
  opacity: 1;
  transform: scale(1);
}

.reaction-trigger:hover {
  background: rgba(56, 189, 248, 0.2);
}

.message-pin-trigger {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(250, 204, 21, 0.42);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 35, 8, 0.76);
  color: #fde68a;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.message-bubble:hover .message-pin-trigger {
  opacity: 1;
  transform: scale(1);
}

.message-pin-trigger:hover {
  background: rgba(120, 53, 15, 0.86);
  border-color: rgba(252, 211, 77, 0.82);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.message-bubble.has-message-pin .reaction-trigger {
  right: 40px;
}

.message-bubble.has-message-edit .reaction-trigger {
  right: 40px;
}

.message-bubble.has-note-delete .reaction-trigger,
.message-bubble.has-message-delete .reaction-trigger {
  right: 40px;
}

.message-bubble.has-message-pin.has-message-edit .reaction-trigger,
.message-bubble.has-message-pin.has-message-delete .reaction-trigger {
  right: 72px;
}

.message-bubble.has-note-delete.has-message-edit .reaction-trigger,
.message-bubble.has-message-delete.has-message-edit .reaction-trigger {
  right: 72px;
}

.message-bubble.has-message-pin.has-message-delete.has-message-edit .reaction-trigger {
  right: 104px;
}

.message-edit-trigger {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 24, 44, 0.72);
  color: #dff7ff;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.message-bubble.has-note-delete .message-edit-trigger,
.message-bubble.has-message-delete .message-edit-trigger {
  right: 40px;
}

.message-bubble.has-message-pin .message-edit-trigger {
  right: 40px;
}

.message-bubble.has-message-pin.has-message-delete .message-edit-trigger {
  right: 40px;
}

.message-bubble:hover .message-edit-trigger {
  opacity: 1;
  transform: scale(1);
}

.message-edit-trigger:hover {
  background: rgba(8, 47, 73, 0.88);
  border-color: rgba(125, 211, 252, 0.8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.note-delete-trigger,
.message-delete-trigger {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(239, 68, 68, 0.32);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(40, 10, 20, 0.72);
  color: #ffd1d8;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.message-bubble.has-message-pin .message-delete-trigger {
  right: 40px;
}

.message-bubble.has-message-pin.has-message-edit .message-delete-trigger {
  right: 72px;
}

.message-bubble:hover .note-delete-trigger,
.message-bubble:hover .message-delete-trigger {
  opacity: 1;
  transform: scale(1);
}

.note-delete-trigger:hover,
.message-delete-trigger:hover {
  background: rgba(127, 29, 29, 0.85);
  border-color: rgba(248, 113, 113, 0.72);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.4);
}

.message-bubble.has-message-pin .meta,
.message-bubble.has-message-edit .meta,
.message-bubble.has-message-delete .meta,
.message-bubble.has-note-delete .meta {
  padding-right: 36px;
}

.message-bubble.has-message-pin.has-message-edit .meta,
.message-bubble.has-message-pin.has-message-delete .meta,
.message-bubble.has-message-delete.has-message-edit .meta,
.message-bubble.has-note-delete.has-message-edit .meta {
  padding-right: 68px;
}

.message-bubble.has-message-pin.has-message-delete.has-message-edit .meta {
  padding-right: 100px;
}

.message.me .message-bubble.has-message-pin .meta,
.message.me .message-bubble.has-message-edit .meta,
.message.me .message-bubble.has-message-delete .meta,
.message.me .message-bubble.has-note-delete .meta,
.message.me .message-bubble.has-message-pin.has-message-edit .meta,
.message.me .message-bubble.has-message-pin.has-message-delete .meta,
.message.me .message-bubble.has-message-delete.has-message-edit .meta,
.message.me .message-bubble.has-note-delete.has-message-edit .meta,
.message.me .message-bubble.has-message-pin.has-message-delete.has-message-edit .meta {
  padding-right: 0;
}

.message.me .reaction-trigger,
.message.me .message-pin-trigger,
.message.me .message-edit-trigger,
.message.me .note-delete-trigger,
.message.me .message-delete-trigger {
  left: 8px;
  right: auto;
}

.message.me .message-bubble.has-message-pin .reaction-trigger,
.message.me .message-bubble.has-message-edit .reaction-trigger,
.message.me .message-bubble.has-note-delete .reaction-trigger,
.message.me .message-bubble.has-message-delete .reaction-trigger {
  left: 40px;
}

.message.me .message-bubble.has-message-pin.has-message-edit .reaction-trigger,
.message.me .message-bubble.has-message-pin.has-message-delete .reaction-trigger,
.message.me .message-bubble.has-note-delete.has-message-edit .reaction-trigger,
.message.me .message-bubble.has-message-delete.has-message-edit .reaction-trigger {
  left: 72px;
}

.message.me .message-bubble.has-message-pin.has-message-delete.has-message-edit .reaction-trigger {
  left: 104px;
}

.message.me .message-bubble.has-note-delete .message-edit-trigger,
.message.me .message-bubble.has-message-delete .message-edit-trigger,
.message.me .message-bubble.has-message-pin .message-edit-trigger,
.message.me .message-bubble.has-message-pin.has-message-delete .message-edit-trigger {
  left: 40px;
}

.message.me .message-bubble.has-message-pin .message-delete-trigger {
  left: 40px;
}

.message.me .message-bubble.has-message-pin.has-message-edit .message-delete-trigger {
  left: 72px;
}

.reaction-picker {
  position: fixed;
  z-index: 50;
  display: flex;
  gap: 6px;
  padding: 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.75);
}

.reaction-picker.hidden {
  display: none;
}

.reaction-option {
  border: none;
  background: transparent;
  font-size: 36px;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.reaction-option:hover {
  transform: translateY(-2px);
}

.message .attachment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attachment-thumb {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  max-width: 420px;
  max-height: 300px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.attachment-thumb:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.6);
}

.attachment-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-files {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message .attachment-item {
  font-size: 12px;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.message .attachment-item a {
  color: #7dd3fc;
  text-decoration: none;
}

.message .attachment-item a:hover {
  text-decoration: underline;
}

.message .attachment-audio {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audio-attachment {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  border-radius: 12px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
}

.audio-attachment:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.6);
}

.message.me .message-bubble {
  border-radius: 14px;
}

.message:not(.me) .message-bubble {
  border-radius: 14px;
}

.message.me .meta {
  flex-direction: row-reverse;
  text-align: right;
}

.message.me {
  margin-left: auto;
  flex-direction: row-reverse;
}

.messages.is-own-left .message.me {
  margin-left: 0;
  margin-right: auto;
  flex-direction: row;
}

.messages.is-own-left .message.me .meta {
  flex-direction: row;
  text-align: left;
}

.messages.is-own-left .message.me .message-actions {
  left: auto;
  right: 8px;
}

.messages.is-own-left .message.me .message-bubble.has-visible-text {
  padding: 8px 34px 8px 10px;
}

.messages.is-own-left .message.me .message-bubble.has-visible-text .meta {
  padding-left: 0;
  padding-right: 24px;
}

.messages.is-own-left .message.me .message-bubble {
  border-radius: 14px;
}

.messages.is-own-left .message.me .message-bubble.has-message-pin .meta,
.messages.is-own-left .message.me .message-bubble.has-message-edit .meta,
.messages.is-own-left .message.me .message-bubble.has-message-delete .meta,
.messages.is-own-left .message.me .message-bubble.has-note-delete .meta {
  padding-right: 36px;
}

.messages.is-own-left .message.me .message-bubble.has-message-pin.has-message-edit .meta,
.messages.is-own-left .message.me .message-bubble.has-message-pin.has-message-delete .meta,
.messages.is-own-left .message.me .message-bubble.has-message-delete.has-message-edit .meta,
.messages.is-own-left .message.me .message-bubble.has-note-delete.has-message-edit .meta {
  padding-right: 68px;
}

.messages.is-own-left
  .message.me
  .message-bubble.has-message-pin.has-message-delete.has-message-edit
  .meta {
  padding-right: 100px;
}

.messages.is-own-left .message.me .reaction-trigger,
.messages.is-own-left .message.me .message-pin-trigger,
.messages.is-own-left .message.me .message-edit-trigger,
.messages.is-own-left .message.me .note-delete-trigger,
.messages.is-own-left .message.me .message-delete-trigger {
  left: auto;
  right: 8px;
}

.messages.is-own-left .message.me .message-bubble.has-message-pin .reaction-trigger,
.messages.is-own-left .message.me .message-bubble.has-message-edit .reaction-trigger,
.messages.is-own-left .message.me .message-bubble.has-note-delete .reaction-trigger,
.messages.is-own-left .message.me .message-bubble.has-message-delete .reaction-trigger {
  left: auto;
  right: 40px;
}

.messages.is-own-left .message.me .message-bubble.has-message-pin.has-message-edit .reaction-trigger,
.messages.is-own-left .message.me .message-bubble.has-message-pin.has-message-delete .reaction-trigger,
.messages.is-own-left .message.me .message-bubble.has-note-delete.has-message-edit .reaction-trigger,
.messages.is-own-left .message.me .message-bubble.has-message-delete.has-message-edit .reaction-trigger {
  left: auto;
  right: 72px;
}

.messages.is-own-left
  .message.me
  .message-bubble.has-message-pin.has-message-delete.has-message-edit
  .reaction-trigger {
  left: auto;
  right: 104px;
}

.messages.is-own-left .message.me .message-bubble.has-note-delete .message-edit-trigger,
.messages.is-own-left .message.me .message-bubble.has-message-delete .message-edit-trigger,
.messages.is-own-left .message.me .message-bubble.has-message-pin .message-edit-trigger,
.messages.is-own-left .message.me .message-bubble.has-message-pin.has-message-delete .message-edit-trigger {
  left: auto;
  right: 40px;
}

.messages.is-own-left .message.me .message-bubble.has-message-pin .message-delete-trigger {
  left: auto;
  right: 40px;
}

.messages.is-own-left .message.me .message-bubble.has-message-pin.has-message-edit .message-delete-trigger {
  left: auto;
  right: 72px;
}

.message.system {
  margin: 10px auto;
  max-width: 70%;
  text-align: center;
  font-size: 13px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  display: block;
  position: relative;
  padding-right: 28px;
}

.message.system-join-leave {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.message.system-join-leave .system-nick {
  font-weight: 700;
}

.message.system-join-leave .system-nick.is-clickable {
  cursor: pointer;
  text-decoration: none;
}

.message.system-join-leave .system-nick.is-clickable:hover {
  text-decoration: underline;
}

.message.system-join-leave .system-rest {
  margin-left: 4px;
}

.message.system .system-delete-trigger {
  position: absolute;
  top: 50%;
  right: -2px;
  transform: translateY(-50%);
  border: 1px solid rgba(248, 113, 113, 0.48);
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.12s ease, border-color 0.16s ease, box-shadow 0.18s ease;
}

.message.system .system-delete-trigger:hover {
  transform: translateY(-50%) scale(1.05);
  border-color: rgba(252, 165, 165, 0.72);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.34);
}

/* Input */

.typing-indicator {
  min-height: 18px;
  padding: 8px 20px 0;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
  color: rgba(191, 219, 254, 0.92);
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.message-form {
  border-top: 1px solid rgba(45, 212, 191, 0.35);
  padding: 16px 20px;
  display: flex;
  gap: 10px;
  background: linear-gradient(
    135deg,
    rgba(14, 40, 68, 0.96) 0%,
    rgba(23, 55, 92, 0.94) 55%,
    rgba(16, 79, 94, 0.92) 100%
  );
  box-shadow:
    0 -10px 28px rgba(10, 32, 56, 0.45),
    inset 0 1px 0 rgba(125, 211, 252, 0.14);
  align-items: center;
}

.message-form.is-editing {
  border-top-color: rgba(56, 189, 248, 0.78);
  box-shadow:
    0 -12px 30px rgba(10, 32, 56, 0.52),
    inset 0 1px 0 rgba(125, 211, 252, 0.34),
    inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}

.message-form input,
.message-form textarea {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 12px 16px;
  font-size: 15px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  resize: none;
  min-height: 54px;
  max-height: 162px;
  line-height: 1.4;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.message-form textarea::placeholder,
.message-form input::placeholder {
  color: #64748b;
}

.message-form input:focus,
.message-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
  background: #ffffff;
}

.message-form .send-button {
  border-radius: 999px;
  border: none;
  width: 54px;
  height: 54px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  color: #0f172a;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.9);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.message-form .send-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.95);
}

.message-form .send-button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.95);
}

.message-form .send-button.is-save-mode {
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  color: #02212e;
  box-shadow:
    0 12px 28px rgba(2, 132, 199, 0.55),
    0 0 18px rgba(34, 211, 238, 0.42);
}

.message-form .send-button.is-save-mode:hover {
  box-shadow:
    0 16px 38px rgba(2, 132, 199, 0.62),
    0 0 24px rgba(34, 211, 238, 0.5);
}

.attach-button,
.emoji-button,
.clear-message-button {
  font-size: 20px;
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-soft);
}

.clear-message-button {
  font-size: 22px;
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.45);
  text-shadow: 0 0 10px rgba(244, 63, 94, 0.45);
  background: linear-gradient(
    140deg,
    rgba(127, 29, 29, 0.22) 0%,
    rgba(190, 24, 93, 0.18) 100%
  );
}

.attach-button {
  color: #86efac;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}

.attach-button:hover {
  color: #ecfdf5;
  border-color: rgba(74, 222, 128, 0.95);
  background: linear-gradient(
    135deg,
    rgba(22, 101, 52, 0.4) 0%,
    rgba(21, 128, 61, 0.35) 100%
  );
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.7),
    0 0 14px rgba(34, 197, 94, 0.75),
    0 0 30px rgba(22, 163, 74, 0.55);
  text-shadow: 0 0 14px rgba(220, 252, 231, 0.95);
}

.emoji-button:hover {
  color: #fefce8;
  border-color: rgba(250, 204, 21, 0.95);
  background: linear-gradient(
    135deg,
    rgba(202, 138, 4, 0.4) 0%,
    rgba(161, 98, 7, 0.34) 100%
  );
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.7),
    0 0 14px rgba(234, 179, 8, 0.72),
    0 0 30px rgba(202, 138, 4, 0.5);
  text-shadow: 0 0 14px rgba(254, 249, 195, 0.95);
}

.clear-message-button:hover {
  color: #fff1f2;
  border-color: rgba(251, 113, 133, 0.95);
  background: linear-gradient(
    135deg,
    rgba(190, 24, 93, 0.44) 0%,
    rgba(220, 38, 38, 0.42) 100%
  );
  box-shadow:
    0 0 0 1px rgba(251, 113, 133, 0.7),
    0 0 14px rgba(244, 63, 94, 0.75),
    0 0 30px rgba(220, 38, 38, 0.55);
  text-shadow: 0 0 14px rgba(254, 205, 211, 0.9);
}

.emoji-panel {
  position: absolute;
  right: 16px;
  bottom: 120px;
  width: min(420px, calc(100% - 32px));
  max-height: 420px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.92),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  z-index: 5;
  backdrop-filter: blur(18px);
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0s linear 0s;
  will-change: opacity, transform;
}

.emoji-panel.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0s linear 0.22s;
}

.emoji-panel-header {
  display: flex;
  gap: 8px;
  padding: 10px 12px 6px;
}

.emoji-tab {
  border: none;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-soft);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.emoji-tab.active {
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.35), rgba(168, 85, 247, 0.35));
  color: var(--text);
  box-shadow: 0 8px 18px rgba(56, 189, 248, 0.2);
}

.emoji-panel-search {
  padding: 0 12px 10px;
}

.emoji-panel-search input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  font-size: 13px;
}

.emoji-panel-body {
  padding: 0 10px 12px;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.emoji-grid,
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 6px;
  overflow-y: auto;
  padding: 4px 2px 0;
  max-height: 300px;
}

.emoji-item {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
  border-radius: 10px;
  transition: background 0.15s ease, transform 0.12s ease;
}

.emoji-item:hover {
  background: rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
}

.sticker-item {
  border: none;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.sticker-item:hover {
  background: rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
}

.sticker-item img {
  width: 100%;
  height: auto;
  display: block;
}

.message.sticker .text {
  display: flex;
  justify-content: flex-start;
}

.message.sticker .sticker-message {
  width: 140px;
  max-width: 160px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.55);
  padding: 6px;
}

.message.sticker .sticker-message img {
  width: 100%;
  height: auto;
  display: block;
}

.attachment-count {
  font-size: 12px;
  color: var(--text-soft);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.8);
}

.mention-suggest {
  margin: 0 18px 8px;
  max-height: calc(5 * 34px + 2px);
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: linear-gradient(
    145deg,
    rgba(10, 24, 52, 0.95) 0%,
    rgba(14, 35, 70, 0.92) 52%,
    rgba(31, 41, 89, 0.9) 100%
  );
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.7),
    0 0 16px rgba(56, 189, 248, 0.2);
  overflow-x: hidden;
}

.mention-suggest-item {
  width: 100%;
  min-height: 34px;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: transparent;
  color: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.12s ease, color 0.12s ease;
}

.mention-suggest-item:last-child {
  border-bottom: none;
}

.mention-suggest-item:hover,
.mention-suggest-item.is-active {
  background: rgba(56, 189, 248, 0.2);
  color: #f8fbff;
}

.mention-suggest-login {
  font-weight: 700;
}

.mention-suggest-hint {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.85);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.composer-link-preview {
  padding: 8px 16px 12px;
  border-top: 1px solid rgba(71, 85, 105, 0.36);
  background: linear-gradient(
    165deg,
    rgba(9, 18, 40, 0.95) 0%,
    rgba(22, 35, 67, 0.92) 55%,
    rgba(31, 41, 89, 0.9) 100%
  );
}

.composer-link-preview-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  border-radius: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  background: linear-gradient(
    140deg,
    rgba(15, 23, 42, 0.92) 0%,
    rgba(12, 24, 52, 0.88) 55%,
    rgba(30, 41, 89, 0.84) 100%
  );
  box-shadow:
    0 10px 22px rgba(2, 6, 23, 0.48),
    inset 0 1px 0 rgba(125, 211, 252, 0.16);
  text-decoration: none;
}

.composer-link-preview-card.is-loading {
  opacity: 0.88;
}

.composer-link-preview-media {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer-link-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.composer-link-preview-media.is-fallback {
  font-size: 20px;
}

.composer-link-preview-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.composer-link-preview-site {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(125, 211, 252, 0.9);
}

.composer-link-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-link-preview-desc {
  font-size: 12px;
  color: rgba(186, 206, 224, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-link-preview {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.message-link-preview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  text-decoration: none;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.36);
  background: linear-gradient(
    145deg,
    rgba(17, 34, 63, 0.86) 0%,
    rgba(35, 57, 99, 0.78) 100%
  );
  box-shadow:
    0 10px 22px rgba(2, 6, 23, 0.44),
    inset 0 1px 0 rgba(125, 211, 252, 0.18);
  padding: 10px 12px 12px;
  width: min(100%, 560px);
  max-width: 560px;
  min-width: 0;
}

.message-link-preview-card.is-loading {
  opacity: 0.9;
}

.message-link-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 3px solid rgba(56, 189, 248, 0.85);
  padding-left: 10px;
  min-width: 0;
}

.message-link-preview-site {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #60a5fa;
}

.message-link-preview-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.message-link-preview-desc {
  font-size: 14px;
  line-height: 1.3;
  color: rgba(224, 236, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.message-link-preview-card.has-image {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.message-link-preview-card.has-icon {
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  width: auto;
  max-width: min(100%, 420px);
  padding: 8px 10px;
}

.message-link-preview-card.has-icon .message-link-preview-meta {
  border-left: none;
  padding-left: 0;
}

.message-link-preview-card.has-icon .message-link-preview-title {
  font-size: 16px;
  -webkit-line-clamp: 2;
}

.message-link-preview-card.has-icon .message-link-preview-desc {
  font-size: 12px;
  -webkit-line-clamp: 2;
}

.message-link-preview-card.has-no-image {
  width: auto;
  max-width: min(100%, 460px);
}

.message-link-preview-image-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(147, 197, 253, 0.34);
  background: rgba(15, 23, 42, 0.66);
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 220px;
  justify-self: stretch;
  align-self: stretch;
}

.message-link-preview-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-link-preview-image-wrap.is-icon {
  width: 40px;
  height: 40px;
  max-height: none;
  border-radius: 10px;
  aspect-ratio: auto;
  justify-self: start;
  align-self: center;
}

@media (max-width: 760px) {
  .message-link-preview-card {
    width: min(100%, 100%);
    max-width: 100%;
  }

  .message-link-preview-image-wrap {
    max-height: 180px;
    justify-self: stretch;
  }

  .message-link-preview-card.has-no-image,
  .message-link-preview-card.has-icon {
    max-width: min(100%, 100%);
    width: auto;
  }
}

.attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 12px;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.92);
}

.attachment-preview .attachment-thumb {
  max-width: 120px;
  max-height: 90px;
  border-radius: 10px;
}

.attachment-preview .attachment-file {
  font: inherit;
  font-size: 12px;
  color: var(--text-soft);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.8);
  cursor: pointer;
}

/* Utils */

.hidden {
  display: none !important;
}

/* Responsive */

@media (max-width: 720px) {
  .panel {
    max-width: 100%;
    min-height: 100%;
    border-radius: 0;
  }

  .chat-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
  }

  .sidebar-resizer {
    display: none;
  }

  #chat-title-text.is-public-title {
    top: 2px;
    font-size: clamp(19px, 6vw, 23px);
    letter-spacing: 0.1em;
    max-width: calc(100% - 180px);
  }

  .chat-header.has-public-participants {
    padding-top: 6px;
    padding-bottom: 42px;
  }

  .chat-header.has-public-participants.no-public-status {
    padding-bottom: 16px;
  }

  .chat-header.has-public-participants .chat-title {
    min-height: 0;
  }

  .public-participants-trigger {
    top: 30px;
    font-size: 14px;
    max-width: calc(100% - 168px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-header.has-public-participants .chat-room-status {
    top: 46px;
    font-size: 12px;
    max-width: calc(100% - 170px);
  }

  .chat-pinned-banner {
    margin: 8px 10px 0;
    padding: 8px 10px;
  }

  .global-update-overlay {
    padding: 14px;
  }

  .global-update-card {
    width: min(96vw, 520px);
    border-radius: 20px;
    padding: 20px 16px 18px;
  }

  .global-update-message {
    font-size: 14px;
  }

  .global-update-action {
    width: 100%;
    min-width: 0;
  }

  .incoming-noncontact-overlay {
    padding: 12px;
  }

  .incoming-noncontact-card {
    width: min(96vw, 540px);
    border-radius: 20px;
    padding: 20px 14px 16px;
  }

  .incoming-noncontact-title {
    font-size: clamp(22px, 6.2vw, 30px);
  }

  .incoming-noncontact-message {
    font-size: 14px;
  }

  .incoming-noncontact-actions {
    gap: 10px;
  }

  .incoming-noncontact-btn {
    width: 100%;
    min-width: 0;
  }

  .join-request-message-wrap textarea {
    min-height: 78px;
    font-size: 13px;
  }

  .group-join-request-note {
    font-size: 12px;
  }

  .sidebar {
    order: 2;
    border-right: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .sidebar-section {
    flex: 1 1 100%;
  }

  .sidebar-section--stretch {
    flex: 1 1 100%;
    min-height: 0;
  }

  .users-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .users-list--stretch {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .users-list li {
    font-size: 12px;
  }

  .sidebar .users-list li {
    font-size: calc(12px * var(--sidebar-elements-scale));
  }

  .chat-members-tabs {
    justify-content: stretch;
  }

  .chat-members-tab {
    flex: 1 1 48%;
  }

  .chat-room-card-link-row {
    grid-template-columns: 1fr;
  }

  .chat-room-card-link-copy {
    width: 100%;
  }

  .group-search-result {
    flex-wrap: wrap;
    align-items: center;
  }

  .group-search-result-meta {
    flex: 1 1 calc(100% - 52px);
  }

  .group-search-result-actions {
    margin-left: 52px;
    width: calc(100% - 52px);
    justify-content: flex-end;
  }

  .chat-room-requests-trigger {
    padding: 4px 8px;
    gap: 4px;
  }

  .chat-room-requests-label {
    display: none;
  }

  .group-join-requests-list-card {
    width: min(94vw, 520px);
  }
}

.bots-toggle {
  display: none !important;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
  margin: 4px 0 6px;
}

.bots-toggle input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent);
}

.users-list li.fake-bot {
  opacity: 0.7;
  font-style: italic;
}


@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* превью ответа над полем ввода */
.reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--reply-accent, var(--accent));
  padding: 6px 10px;
  margin: 6px 0;
  border-radius: 8px;
  font-size: 12px;
}

.reply-preview.hidden {
  display: none;
}

.edit-preview {
  border-left-color: rgba(56, 189, 248, 0.95);
  background: linear-gradient(
    135deg,
    rgba(13, 44, 71, 0.78) 0%,
    rgba(25, 63, 96, 0.74) 100%
  );
  box-shadow:
    0 0 16px rgba(14, 165, 233, 0.24),
    inset 0 0 0 1px rgba(125, 211, 252, 0.18);
}

.edit-preview .reply-author {
  color: #7dd3fc;
}

.reply-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  overflow: hidden;
}

.reply-info .reply-author {
  font-weight: 600;
  color: var(--reply-accent, var(--accent));
}

.reply-info .reply-text {
  color: var(--text-soft);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.reply-cancel {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--text-soft);
  margin-left: 8px;
}

.reply-cancel:hover {
  color: var(--accent);
}

/* цитата внутри самого сообщения */
.reply-block {
  border-left: 3px solid var(--reply-accent, #38bdf8);
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-soft);
  background: rgba(15, 23, 42, 0.18);
  box-shadow: none;
  opacity: 1;
}

.reply-block.is-clickable {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.reply-block.is-clickable:hover {
  opacity: 1;
}

.reply-block .reply-author {
  font-weight: 600;
  color: var(--reply-accent, var(--accent));
  margin-bottom: 1px;
}

.reply-block .reply-author.is-clickable {
  cursor: pointer;
}

.reply-block .reply-author.is-clickable:hover {
  text-decoration: underline;
}

.reply-block .reply-snippet {
  color: var(--reply-snippet-color, var(--text));
  line-height: 1.35;
  font-weight: 700;
}

.mention-chip {
  background: none;
  border: none;
  padding: 0;
  margin: 0 4px 0 0;
  font: inherit;
  font-weight: 700;
  color: var(--mention-color, var(--accent));
  cursor: pointer;
  text-decoration: none;
}

.mention-chip:hover {
  text-decoration: underline;
}

.message.message-highlight {
  position: relative;
}

.message.message-highlight::before {
  content: "";
  position: absolute;
  inset: -6px -8px;
  border-radius: 20px;
  background: var(--highlight-bg, rgba(56, 189, 248, 0.18));
  box-shadow:
    inset 0 0 0 1px var(--highlight-border, rgba(56, 189, 248, 0.35)),
    0 0 18px var(--highlight-border, rgba(56, 189, 248, 0.35));
  z-index: 0;
  opacity: 1;
  transition: opacity 0.6s ease, box-shadow 0.6s ease;
}

.message.message-highlight > * {
  position: relative;
  z-index: 1;
}

.message-highlight .message-bubble {
  box-shadow:
    0 0 18px rgba(56, 189, 248, 0.45),
    0 0 32px rgba(168, 85, 247, 0.3);
  border-color: rgba(56, 189, 248, 0.85);
  transition: box-shadow 0.6s ease, border-color 0.6s ease;
}

.message.message-highlight.is-fading::before {
  opacity: 0;
  box-shadow: none;
}

.message-highlight.is-fading .message-bubble {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.35);
  border-color: var(--bubble-border, rgba(148, 163, 184, 0.3));
}

/* Lightbox */
.media-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(2, 6, 18, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 24px;
  cursor: zoom-out;
}

.media-lightbox.hidden {
  display: none;
}

.lightbox-content {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.media-lightbox img {
  max-width: min(1500px, 92vw);
  max-height: calc(100dvh - 90px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(145deg, #ffffff, #e8edf9);
  color: #0b1220;
  font-size: 24px;
  font-weight: 800;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    0 12px 28px rgba(2, 6, 18, 0.7),
    0 0 0 1px rgba(15, 23, 42, 0.15);
  transition:
    transform 0.14s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.lightbox-close:hover {
  background: linear-gradient(
    140deg,
    rgba(255, 255, 255, 0.98),
    rgba(254, 226, 226, 0.95)
  );
  box-shadow:
    0 16px 34px rgba(2, 6, 18, 0.78),
    0 0 0 2px rgba(248, 113, 113, 0.45);
  transform: translateY(-1px) scale(1.04);
}

.lightbox-close:active {
  transform: translateY(0) scale(0.99);
}

body.lightbox-open {
  overflow: hidden;
}
