/* ╔══════════════════════════════════════════════════
   ║  FamilyChat — Dark Premium UI
   ╚══════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-deep: #0a0b14;
  --bg-base: #0f1121;
  --bg-card: #161929;
  --bg-hover: #1e2340;
  --bg-active: #252a4a;
  --bg-input: #1a1f38;

  --accent: #6366f1;
  --accent-2: #818cf8;
  --accent-glow: rgba(99, 102, 241, .35);

  --green: #22c55e;
  --red: #f43f5e;
  --red-dark: #be123c;

  --text-primary: #e8eaf6;
  --text-muted: #7b82a8;
  --text-dim: #4a527a;

  --border: rgba(255, 255, 255, .06);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --sidebar-w: 320px;
  --transition: .2s cubic-bezier(.4, 0, .2, 1);
}

html,
body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
}

/* ——— Scrollbar ——— */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ═══════ SCREENS ═══════ */
.screen {
  position: fixed;
  inset: 0;
  transition: opacity .3s, transform .3s;
}

.screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(.98);
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

/* When mini call bar is visible, push all screen content down */
body.has-mini-bar .screen {
  top: 50px;
  height: calc(100% - 50px);
}

/* ═══════════════════════════════════════
   AUTH
═══════════════════════════════════════ */
#screen-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .25;
  animation: blobFloat 8s ease-in-out infinite;
}

.auth-blob-1 {
  width: 500px;
  height: 500px;
  background: #6366f1;
  top: -150px;
  left: -100px;
  animation-delay: 0s;
}

.auth-blob-2 {
  width: 400px;
  height: 400px;
  background: #8b5cf6;
  bottom: -100px;
  right: -100px;
  animation-delay: -3s;
}

.auth-blob-3 {
  width: 300px;
  height: 300px;
  background: #06b6d4;
  top: 50%;
  left: 60%;
  animation-delay: -5s;
}

@keyframes blobFloat {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-30px) scale(1.05);
  }
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.auth-logo {
  text-align: center;
}

.logo-icon {
  font-size: 52px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.logo-text {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-2), #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .04);
}

.auth-card h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-error {
  background: rgba(244, 63, 94, .1);
  border: 1px solid rgba(244, 63, 94, .3);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.form-error.hidden {
  display: none;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.auth-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════ */
#screen-app {
  background: var(--bg-deep);
}

.app-layout {
  display: flex;
  height: 100vh;
}

/* ——— Sidebar ——— */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-user-info {
  min-width: 0;
}

.sidebar-username {
  display: block;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online-dot-label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.online-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--green);
}

.sidebar-actions {
  display: flex;
  gap: 4px;
}

.search-box {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.chat-list-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.chat-list-empty .hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

.chat-item:hover {
  background: var(--bg-hover);
}

.chat-item.active {
  background: var(--bg-active);
}

.chat-item-info {
  flex: 1;
  min-width: 0;
}

.chat-item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-last {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}

.chat-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.chat-item-time {
  font-size: 11px;
  color: var(--text-dim);
}

.unread-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ——— Avatar ——— */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
  position: relative;
}

.avatar.large {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

.avatar.xlarge {
  width: 80px;
  height: 80px;
  font-size: 32px;
}

.avatar .status-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: var(--green);
  border: 2px solid var(--bg-base);
  border-radius: 50%;
}

.avatar .status-indicator.offline {
  background: var(--text-dim);
}

/* ——— Icon button ——— */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.icon-btn.call-btn:hover {
  background: rgba(99, 102, 241, .2);
  color: var(--accent-2);
}

/* ——— Chat Area ——— */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 12px;
}

.placeholder-icon {
  font-size: 64px;
  opacity: .5;
}

.chat-placeholder h2 {
  font-size: 24px;
  font-weight: 600;
}

.chat-placeholder p {
  font-size: 14px;
  color: var(--text-dim);
}

.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-window.hidden {
  display: none;
}

.chat-header {
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-base);
  flex-shrink: 0;
}

.chat-header-avatar {
  flex-shrink: 0;
}

.chat-header-info {
  flex: 1;
  min-width: 0;
}

.chat-header-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.chat-header-status {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-header-actions {
  display: flex;
  gap: 4px;
}

.back-btn {
  display: none;
}

/* ——— Messages ——— */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 8px;
}

.messages-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100%;
  justify-content: flex-end;
}

.msg-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}

.msg-group.mine {
  align-items: flex-end;
}

.msg-group.theirs {
  align-items: flex-start;
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding: 0 4px;
}

.msg-sender-name {
  font-size: 12px;
  font-weight: 600;
}

.msg-time {
  font-size: 11px;
  color: var(--text-dim);
}

.msg-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
}

.msg-group.mine .msg-bubble {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-group.theirs .msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

/* ──────── Unread Badge ──────── */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  margin-top: 4px;
  flex-shrink: 0;
}

.chat-item-last.has-unread {
  color: var(--text-primary);
  font-weight: 600;
}

.chat-item-time.has-unread {
  color: var(--accent-2);
  font-weight: 600;
}

.chat-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.system-msg {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  padding: 8px 0;
}

/* ──────── Mini Call Bar (Telegram-style top banner) ──────── */
.mini-call-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 400;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 24px rgba(34, 197, 94, .45);
  animation: slideDown .2s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}


.mini-call-bar.hidden {
  display: none;
}

.mini-call-pulse {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: mcPulse 1.4s infinite;
  flex-shrink: 0;
}

@keyframes mcPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.mini-call-name {
  font-size: 14px;
  font-weight: 600;
}

.mini-call-actions {
  display: flex;
  gap: 4px;
}

@keyframes miniCallIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}

.minimize-btn {
  background: rgba(255, 255, 255, .08);
}

/* ——— Message Input ——— */
.message-input-area {
  padding: 12px 16px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}

.message-input-wrap {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  transition: border-color var(--transition);
}

.message-input-wrap:focus-within {
  border-color: rgba(99, 102, 241, .5);
}

#message-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  resize: none;
  max-height: 140px;
  line-height: 1.4;
}

#message-input::placeholder {
  color: var(--text-dim);
}

.emoji-btn {
  font-size: 20px;
  margin-bottom: 4px;
}

.send-btn {
  background: var(--accent);
  color: #fff;
  margin-bottom: 4px;
}

.send-btn:hover {
  background: var(--accent-2);
  color: #fff;
}

.send-btn svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════
   MODAL
═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .6);
  animation: modalIn .2s cubic-bezier(.4, 0, .2, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(.96) translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.modal-header {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-search input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.modal-search input:focus {
  border-color: var(--accent);
}

.user-list {
  overflow-y: auto;
  padding: 8px;
  max-height: 50vh;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}

.user-item:hover {
  background: var(--bg-hover);
}

.user-item-info .name {
  font-size: 14px;
  font-weight: 600;
}

.user-item-info .username {
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════
   CALL OVERLAY
═══════════════════════════════════════ */
.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-overlay.hidden {
  display: none;
}

.call-bg-blur {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 20, .85);
  backdrop-filter: blur(16px);
}

.call-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.local-video {
  position: absolute;
  bottom: 120px;
  right: 24px;
  width: 140px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, .2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
  cursor: move;
  z-index: 3;
}

.call-top-info {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 90%;
}

.call-name {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.call-status {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  padding: 4px 12px;
  border-radius: 99px;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.call-center-info {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-avatar {}

/* Video Active Mode Overrides */
.call-container.video-active .call-center-info {
  display: none;
}

.incoming-call-panel {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  text-align: center;
}

.incoming-call-panel.hidden {
  display: none;
}

.incoming-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.incoming-actions {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.call-controls {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 16px;
}

.call-controls.hidden {
  display: none;
}

.call-action-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  backdrop-filter: blur(8px);
}

.call-action-btn svg {
  width: 24px;
  height: 24px;
}

.call-action-btn:hover {
  transform: scale(1.1);
}

.call-action-btn.reject-btn {
  background: var(--red);
  transform: rotate(135deg);
}

.call-action-btn.reject-btn:hover {
  transform: rotate(135deg) scale(1.1);
  box-shadow: 0 8px 24px rgba(244, 63, 94, .5);
}

.call-action-btn.accept-btn {
  background: var(--green);
}

.call-action-btn.accept-btn:hover {
  box-shadow: 0 8px 24px rgba(34, 197, 94, .5);
}

.call-action-btn.end-call-btn {
  background: var(--red);
  transform: rotate(135deg);
}

.call-action-btn.end-call-btn:hover {
  transform: rotate(135deg) scale(1.1);
  box-shadow: 0 8px 24px rgba(244, 63, 94, .5);
}

.call-action-btn.muted {
  background: rgba(244, 63, 94, .3);
}

.call-action-btn.cam-off {
  background: rgba(244, 63, 94, .3);
}

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
  min-width: 200px;
  max-width: 320px;
  animation: toastIn .3s ease;
  pointer-events: all;
}

.toast.error {
  border-color: rgba(244, 63, 94, .4);
}

.toast.success {
  border-color: rgba(34, 197, 94, .4);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ═══════════════════════════════════════
   LOADING
═══════════════════════════════════════ */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 32px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════ */
@media (max-width: 680px) {
  :root {
    --sidebar-w: 100vw;
  }

  .sidebar {
    position: fixed;
    inset: 0;
    z-index: 10;
    transform: translateX(0);
    transition: transform .3s;
  }

  .sidebar.hidden-mobile {
    transform: translateX(-100%);
  }

  .chat-area {
    position: fixed;
    inset: 0;
    z-index: 11;
    background: var(--bg-deep);
  }

  .chat-area.hidden-mobile {
    display: none;
  }

  .back-btn {
    display: flex !important;
  }

  .local-video {
    width: 100px;
    height: 75px;
    bottom: 100px;
    right: 12px;
  }

  .call-controls {
    bottom: 24px;
  }
}