﻿.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-chat);
  position: relative;
  min-width: 0;
}

.chat__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  background: var(--bg-sidebar);
  z-index: 5;
}

.chat__back {
  display: none;
}

.chat__header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.chat__header-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat__header-name {
  font-size: var(--font-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat__header-status {
  font-size: var(--font-xs);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}

.chat__header-status--online {
  color: var(--online);
}

.chat__header-actions {
  display: flex;
  gap: var(--sp-1);
  flex-shrink: 0;
}

.chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.chat__date {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4) 0;
}

.chat__date span {
  font-size: var(--font-xs);
  color: var(--text-muted);
  background: var(--bg-surface-solid);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-xl);
  font-weight: var(--fw-medium);
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 65%;
}

.message--sent {
  align-self: flex-end;
  align-items: flex-end;
}

.message--received {
  align-self: flex-start;
  align-items: flex-start;
}

.message__bubble {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-lg);
  font-size: var(--font-base);
  line-height: 1.45;
  word-wrap: break-word;
  position: relative;
}

.message--sent .message__bubble {
  background: var(--sent-gradient);
  color: var(--text-inverse);
  border-bottom-right-radius: var(--radius-xs);
  box-shadow: 0 2px 12px rgba(109, 40, 217, 0.3);
}

.message--received .message__bubble {
  background: var(--bg-surface-solid);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.message__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-1) 0;
}

.message__time {
  font-size: 0.625rem;
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}

.message--sent .message__time {
  color: var(--text-muted);
}

.message__status {
  display: flex;
  color: var(--text-muted);
}

.message__status--read {
  color: var(--accent-secondary);
}

.message__status svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  align-self: flex-start;
}

.typing-indicator__dots {
  display: flex;
  gap: 3px;
  background: var(--bg-surface-solid);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.typing-indicator__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  animation: typingDot 1.4s ease-in-out infinite;
}

.typing-indicator__dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator__dot:nth-child(3) { animation-delay: 0.4s; }

.chat__input-area {
  flex-shrink: 0;
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
  backdrop-filter: blur(12px);
  position: relative;
}

.chat__input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  transition: all var(--t-fast);
}

.chat__input-wrapper:focus-within {
  border-color: var(--border-accent);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.chat__input {
  flex: 1;
  min-height: 24px;
  max-height: 120px;
  padding: var(--sp-1) 0;
  font-size: var(--font-base);
  color: var(--text-primary);
  resize: none;
  line-height: 1.4;
  background: transparent;
  border: none;
  outline: none;
}

.chat__input::placeholder { color: var(--text-muted); }

.chat__input-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-shrink: 0;
}

.chat__send-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  transition: all var(--t-fast);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
}

.chat__send-btn:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-glow-strong);
}

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

.chat__send-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.chat__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  color: var(--text-muted);
  text-align: center;
  padding: var(--sp-8);
}

.chat__empty-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-2);
}

.chat__empty-icon svg {
  width: 36px;
  height: 36px;
  color: var(--accent-light);
  stroke-width: 1.5;
}

.chat__empty h3 {
  font-size: var(--font-xl);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.chat__empty p {
  font-size: var(--font-sm);
  max-width: 280px;
  line-height: 1.6;
}

.message__media {
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 300px;
}

.message__image {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.message__video {
  display: block;
  width: 100%;
  max-height: 300px;
  border-radius: var(--radius-md);
  background: #000;
}

.voice-msg {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  min-width: 200px;
  background: var(--bg-surface-solid);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.message--sent .voice-msg {
  background: var(--sent-gradient);
  border: none;
  box-shadow: 0 2px 12px rgba(109, 40, 217, 0.3);
}

.voice-msg__play {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--t-fast);
  border: none;
}

.voice-msg__play:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.08);
}

.voice-msg__play svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  fill: currentColor;
}

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

.voice-msg__bar {
  width: 3px;
  min-height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.4);
}

.message--sent .voice-msg__bar {
  background: rgba(255,255,255,0.5);
}

.message--received .voice-msg__bar {
  background: var(--text-muted);
}

.voice-msg__duration {
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  min-width: 30px;
  text-align: right;
}

.message--received .voice-msg__duration {
  color: var(--text-muted);
}

.message--received .voice-msg__play {
  background: var(--accent-muted);
  color: var(--accent-light);
}

.video-msg {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-glow);
}

.video-msg__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-msg__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  color: white;
}

.video-msg__play:hover {
  background: rgba(0,0,0,0.5);
}

.video-msg__play svg {
  width: 36px;
  height: 36px;
  stroke-width: 1.5;
  fill: rgba(255,255,255,0.9);
}

.attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: var(--sp-5);
  background: var(--bg-surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  pointer-events: none;
  transition: all var(--t-fast);
}

.attach-menu--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.attach-menu__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.attach-menu__item:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.attach-menu__item svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
  flex-shrink: 0;
}

.recording-bar {
  display: none;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-input);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-xl);
}

.recording-bar--visible {
  display: flex;
}

.chat__input-wrapper--hidden {
  display: none !important;
}

.recording-bar__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: #ef4444;
  animation: pulse 1s ease-in-out infinite;
  flex-shrink: 0;
}

.recording-bar__time {
  font-size: var(--font-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}

.recording-bar__label {
  font-size: var(--font-sm);
  color: var(--text-muted);
  flex: 1;
}

.recording-bar__cancel,
.recording-bar__send {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  flex-shrink: 0;
}

.recording-bar__cancel {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

.recording-bar__cancel:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.recording-bar__send {
  background: var(--accent-gradient);
  color: var(--text-inverse);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
}

.recording-bar__send:hover {
  transform: scale(1.08);
}

.recording-bar__cancel svg,
.recording-bar__send svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.chat__mic-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

.voice-msg {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  min-width: 240px;
  max-width: 360px;
  background: var(--bg-surface-solid);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.message--sent .voice-msg {
  background: var(--sent-gradient);
  border-color: transparent;
}

.voice-msg__play {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}

.message--sent .voice-msg__play {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.voice-msg__play:hover {
  transform: scale(1.08);
}

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

.voice-msg__play svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.voice-msg__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.voice-msg__waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}

.voice-msg__bar {
  width: 3px;
  min-height: 3px;
  border-radius: 2px;
  background: var(--text-muted);
  opacity: 0.4;
  transition: opacity var(--t-fast), background var(--t-fast);
}

.voice-msg__bar--active {
  background: var(--accent-light);
  opacity: 1;
}

.message--sent .voice-msg__bar {
  background: rgba(255, 255, 255, 0.4);
}

.message--sent .voice-msg__bar--active {
  background: white;
  opacity: 1;
}

.voice-msg__progress {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.message--sent .voice-msg__progress {
  background: rgba(255, 255, 255, 0.15);
}

.voice-msg__progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 2px;
  background: var(--accent-light);
  transition: width 100ms linear;
}

.message--sent .voice-msg__progress-fill {
  background: rgba(255, 255, 255, 0.8);
}

.voice-msg__duration {
  font-size: var(--font-xs);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

.message--sent .voice-msg__duration {
  color: rgba(255, 255, 255, 0.7);
}

.chat-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-1);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 20;
  opacity: 0;
  transform: translateY(-4px) scale(0.95);
  pointer-events: none;
  transition: all 150ms var(--ease-out);
}

.chat-dropdown--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.chat-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.chat-dropdown__item:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.chat-dropdown__item svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  flex-shrink: 0;
}

.chat-dropdown__item--danger {
  color: #ef4444;
}

.chat-dropdown__item--danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.chat-dropdown__item--unblock {
  color: var(--online);
}

.chat-dropdown__item--unblock:hover {
  background: rgba(34, 197, 94, 0.1);
  color: var(--online);
}

.chat-dropdown__divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-1) 0;
}

.blocked-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-xl);
  animation: slideUp 250ms var(--ease-out) both;
}

.blocked-banner__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ef4444;
}

.blocked-banner__icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
}

.blocked-banner__text {
  flex: 1;
  font-size: var(--font-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

.blocked-banner__text strong {
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
}

.blocked-banner__btn {
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-sm);
  background: rgba(34, 197, 94, 0.12);
  color: var(--online);
  font-size: var(--font-xs);
  font-weight: var(--fw-semibold);
  border: 1px solid rgba(34, 197, 94, 0.2);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.blocked-banner__btn:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}

.blocked-banner__btn:active {
  transform: scale(0.97);
}

.reply-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
}

.reply-bar__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reply-bar__author {
  font-size: var(--font-xs);
  font-weight: var(--fw-semibold);
  color: var(--accent);
}

.reply-bar__text {
  font-size: var(--font-xs);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-bar__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast);
}

.reply-bar__close:hover {
  color: var(--text-primary);
}

.reply-bar__close svg {
  width: 16px;
  height: 16px;
}

.message__reply {
  padding: 6px 10px;
  margin-bottom: 4px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.08);
  font-size: var(--font-xs);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background var(--t-fast);
}

.message__reply:hover {
  background: rgba(139, 92, 246, 0.15);
}

.message__reply-author {
  font-weight: var(--fw-semibold);
  color: var(--accent);
}

.message__reply-text {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message--sent .message__reply {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: rgba(255, 255, 255, 0.6);
}

.message--sent .message__reply-author {
  color: rgba(255, 255, 255, 0.85);
}

.message--sent .message__reply-text {
  color: rgba(255, 255, 255, 0.6);
}

.message__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.reaction-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--t-fast);
}

.reaction-badge:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.reaction-badge--mine {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent);
}

.reaction-badge__emoji {
  font-size: 14px;
  line-height: 1;
}

.reaction-badge__count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
}

.reaction-badge--mine .reaction-badge__count {
  color: var(--accent);
}

.message--sent .reaction-badge {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.message--sent .reaction-badge--mine {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.message--sent .reaction-badge__count {
  color: rgba(255, 255, 255, 0.7);
}

.ctx-menu__reactions {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  justify-content: center;
}

.ctx-menu__reaction {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-size: 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--t-fast);
}

.ctx-menu__reaction:hover {
  background: var(--bg-hover);
  transform: scale(1.3);
}

.ctx-menu__divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0 8px;
}

.forward-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  backdrop-filter: blur(4px);
}

.forward-overlay--visible {
  opacity: 1;
}

.forward-modal {
  background: var(--bg-sidebar);
  border-radius: var(--radius-lg);
  width: 380px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.forward-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}

.forward-modal__title {
  font-weight: var(--fw-semibold);
  font-size: var(--font-base);
}

.forward-modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.forward-modal__close:hover {
  color: var(--text-primary);
}

.forward-modal__close svg {
  width: 18px;
  height: 18px;
}

.forward-modal__list {
  overflow-y: auto;
  flex: 1;
  padding: var(--sp-2);
}

.forward-modal__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: none;
  background: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-primary);
  font-size: var(--font-sm);
  transition: background var(--t-fast);
  text-align: left;
}

.forward-modal__item:hover {
  background: var(--bg-hover);
}

.message--highlight {
  animation: msgHighlight 1.5s ease;
}

@keyframes msgHighlight {
  0%, 30% { background: rgba(139, 92, 246, 0.15); }
  100% { background: transparent; }
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  backdrop-filter: blur(8px);
}

.lightbox-overlay--visible {
  opacity: 1;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast);
  z-index: 10;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox__close svg {
  width: 20px;
  height: 20px;
}

.videomsg-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
  backdrop-filter: blur(6px);
}

.videomsg-overlay--visible {
  opacity: 1;
}

.videomsg-recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.videomsg-recorder__preview {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.35);
  background: #000;
}

.videomsg-recorder__timer {
  font-size: var(--font-xl);
  font-weight: var(--fw-bold);
  color: white;
  font-variant-numeric: tabular-nums;
}

.videomsg-recorder__actions {
  display: flex;
  gap: var(--sp-6);
}

.videomsg-recorder__cancel,
.videomsg-recorder__send {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
}

.videomsg-recorder__cancel {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.videomsg-recorder__cancel:hover {
  background: rgba(239, 68, 68, 0.35);
  transform: scale(1.1);
}

.videomsg-recorder__send {
  background: var(--accent);
  color: white;
}

.videomsg-recorder__send:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.videomsg-recorder__cancel svg,
.videomsg-recorder__send svg {
  width: 24px;
  height: 24px;
}

.chat__videomsg-btn svg {
  width: 20px;
  height: 20px;
}

[data-theme="light"] .voice-msg__play {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .voice-msg__play:hover {
  background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .voice-msg__bar {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .voice-msg__bar--active {
  background: var(--accent);
}

[data-theme="light"] .voice-msg__progress {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .recording-bar__cancel {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .reaction-badge {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .reaction-badge:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .message--received .voice-msg__play {
  background: var(--accent-muted);
}

[data-theme="light"] .chat__input-area {
  background: var(--bg-sidebar);
}