/* ============================================================
   VOCEO — CSS Design System
   Pure dark theme, Google Meet-inspired
============================================================ */

:root {
  /* Core palette */
  --bg:         #000000;
  --surface:    #1c1c1e;
  --surface2:   #2c2c2e;
  --surface3:   #3a3a3c;
  --border:     rgba(255,255,255,0.08);
  --text:       #f5f5f5;
  --text-dim:   #8e8e93;
  --primary:    #1a73e8;
  --primary-h:  #1557b0;
  --green:      #34a853;
  --red:        #ea4335;
  --red-h:      #c62828;

  /* Control bar */
  --ctrl-bg:    rgba(32, 33, 36, 0.92);
  --ctrl-hover: rgba(255,255,255,0.08);
  --ctrl-active-bg: rgba(255,255,255,0.10);
  --ctrl-muted-bg:  #ea4335;
}

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

body {
  font-family: 'Outfit', 'Google Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LOBBY SCREEN
============================================================ */
.lobby-screen {
  display: flex;
  width: 100%;
  height: 100vh;
  background: #000;
}

/* Left half — preview */
.lobby-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: #111;
  gap: 24px;
  border-right: 1px solid var(--border);
}

.lobby-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.brand-icon  { font-size: 28px; color: var(--primary); }
.brand-name  {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 30%, #8ab4f8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Preview video box */
.preview-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16/9;
  border-radius: 16px;
  overflow: hidden;
  background: #1c1c1e;
  border: 1px solid var(--border);
}

.preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror */
}

.preview-controls {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.preview-ctrl-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(32,33,36,0.85);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  backdrop-filter: blur(8px);
}
.preview-ctrl-btn:hover { background: rgba(255,255,255,0.15); transform: scale(1.08); }
.preview-ctrl-btn.muted { background: var(--red); }

/* Audio ring for preview */
.preview-audio-ring {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 2.5px solid transparent;
  pointer-events: none;
  transition: border-color 0.1s;
}
.preview-audio-ring.speaking { border-color: var(--green); }

/* Device selectors */
.device-selectors {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
  max-width: 512px;
}

.device-select-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
}

.device-icon { color: var(--text-dim); font-size: 18px; }

.device-select {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.device-select option { background: var(--surface2); color: var(--text); }

/* Right half — join panel */
.lobby-right {
  flex: 0 0 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.join-card {
  width: 100%;
  max-width: 380px;
}

.join-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.join-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 36px;
}

.join-form { display: flex; flex-direction: column; gap: 14px; }

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.2);
}

.input-icon { color: var(--text-dim); font-size: 18px; }

.join-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  letter-spacing: 1px;
}
.join-input::placeholder { color: var(--text-dim); letter-spacing: 0; }

.join-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.join-btn:hover {
  background: var(--primary-h);
  box-shadow: 0 4px 18px rgba(26,115,232,0.4);
  transform: translateY(-1px);
}
.join-btn:active { transform: translateY(0); }

.join-hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

/* ============================================================
   CALL SCREEN
============================================================ */
.call-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Video Grid (multi-party) ──────────────────────────── */
.video-grid {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 3px;
  background: #000;
  z-index: 1;
  transition: grid-template-columns 0.3s ease, grid-template-rows 0.3s ease;
}

/* 0 peers: hidden behind waiting overlay */
.video-grid[data-peers="0"] { display: none; }

/* 1 peer: full screen */
.video-grid[data-peers="1"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

/* 2 peers: side by side */
.video-grid[data-peers="2"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

/* 3 peers: 2 on top row + 1 full width bottom */
.video-grid[data-peers="3"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.video-grid[data-peers="3"] .video-tile:last-child {
  grid-column: 1 / -1;
}

/* Each remote tile */
.video-tile {
  position: relative;
  overflow: hidden;
  background: #111;
  border-radius: 4px;
  animation: tile-in 0.35s ease;
}

@keyframes tile-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

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

.tile-label {
  position: absolute;
  bottom: 8px;
  left: 10px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  pointer-events: none;
}

/* Waiting overlay */
.waiting-overlay {
  position: absolute;
  inset: 0;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.5s;
}

.waiting-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.waiting-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.waiting-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.waiting-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.waiting-room {
  font-size: 14px;
  color: var(--text-dim);
}
.waiting-room-name {
  color: #8ab4f8;
  font-weight: 600;
}

/* ── Local PIP ─────────────────────────────────────────── */
.local-pip {
  position: absolute;
  bottom: 100px;
  right: 20px;
  width: 220px;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  z-index: 20;
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  cursor: grab;
  transition: border-color 0.15s;
}
.local-pip:active { cursor: grabbing; }

.local-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror */
  display: block;
}

.pip-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  pointer-events: none;
}

.pip-audio-ring {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 2.5px solid transparent;
  pointer-events: none;
  transition: border-color 0.1s;
}
.pip-audio-ring.speaking { border-color: var(--green); animation: ring-pulse 0.5s ease-in-out infinite alternate; }
@keyframes ring-pulse {
  from { border-color: rgba(52,168,83,0.5); }
  to   { border-color: var(--green); }
}

/* ── Server Info Badge (lobby) ────────────────────────── */
.server-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.2px;
  transition: color 0.3s;
}

.server-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #555;
  flex-shrink: 0;
  transition: background 0.3s;
}

.server-badge.online  { color: var(--text); }
.server-badge.online .server-dot { background: var(--green); box-shadow: 0 0 6px rgba(52,168,83,0.5); }
.server-badge.offline .server-dot { background: var(--red); }

/* ── Server Chip (call topbar) ────────────────────────── */
.server-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Top Bar ───────────────────────────────────────────── */

.call-topbar {
  position: absolute;
  top: 0;
  left: 0; right: 0;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
  z-index: 30;
  transition: opacity 0.3s;
}

.topbar-left  { display: flex; align-items: center; gap: 8px; }
.topbar-center{ flex: 1; text-align: center; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.brand-icon-sm { font-size: 20px; color: var(--primary); }
.brand-name-sm {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #fff 30%, #8ab4f8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.call-room-label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.06);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.call-timer {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.conn-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.conn-waiting { background: rgba(255,200,0,0.1); color: #ffd600; border-color: rgba(255,214,0,0.3); }
.conn-connected { background: rgba(52,168,83,0.12); color: var(--green); border-color: rgba(52,168,83,0.3); }
.conn-dot { font-size: 8px; }

/* ── Bottom Controls ───────────────────────────────────── */
.call-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 88px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  z-index: 30;
  transition: opacity 0.3s;
}

.ctrl-section { display: flex; align-items: center; gap: 8px; }
.ctrl-left  { flex: 1; }
.ctrl-center{ flex: 0; gap: 12px; }
.ctrl-right { flex: 1; justify-content: flex-end; }

.ctrl-room-name {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}

/* Control buttons */
.ctrl-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.ctrl-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
}
.ctrl-btn:hover  { transform: scale(1.08); }
.ctrl-btn:active { transform: scale(0.95); }

.ctrl-btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 20px;
}

.ctrl-active  { background: rgba(255,255,255,0.12); color: #fff; }
.ctrl-active:hover { background: rgba(255,255,255,0.2); }

.ctrl-muted   { background: var(--red); color: #fff; }
.ctrl-muted:hover { background: var(--red-h); }

.ctrl-neutral { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.ctrl-neutral:hover { background: rgba(255,255,255,0.15); color: #fff; }

.ctrl-leave   { background: var(--red); color: #fff; }
.ctrl-leave:hover { background: var(--red-h); box-shadow: 0 0 18px rgba(234,67,53,0.4); }

.ctrl-label {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.leave-label { color: rgba(234,67,53,0.8); }

/* ── Audio Bars (mini visualizer on mic button) ─────────── */
.audio-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  position: absolute;
  bottom: 6px;
  right: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}
.audio-bars.visible { opacity: 1; }

.ab {
  width: 3px;
  border-radius: 2px;
  background: var(--green);
  transition: height 0.1s;
}
.ab1 { height: 4px; }
.ab2 { height: 8px; }
.ab3 { height: 4px; }

/* ── Auto-hide controls ─────────────────────────────────── */
.call-topbar.hidden,
.call-controls.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Fullscreen adjustments ──────────────────────────────── */
:fullscreen .call-controls,
:-webkit-full-screen .call-controls,
:fullscreen .call-topbar,
:-webkit-full-screen .call-topbar { opacity: 1; }

/* ── Toast ──────────────────────────────────────────────── */
.toast-notification {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 99999;
  backdrop-filter: blur(8px);
}
:fullscreen .toast-notification,
:-webkit-full-screen .toast-notification {
  z-index: 99999 !important;
}
  animation: toast-in 0.3s ease;
  display: flex;
  align-items: center;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Utility ───────────────────────────────────────────── */
.d-none { display: none !important; }

/* ============================================================
   RESPONSIVE — TABLET (max 1024px)
============================================================ */
@media (max-width: 1024px) {
  .lobby-right {
    flex: 0 0 360px;
    padding: 40px 28px;
  }

  .lobby-left {
    padding: 40px 32px;
  }

  .ctrl-center { gap: 10px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 768px)
============================================================ */
@media (max-width: 768px) {

  /* Body overflow: lobby needs scroll */
  body { overflow-y: auto; height: auto; }

  /* ── Lobby ── */
  .lobby-screen {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .lobby-left {
    padding: 28px 20px 20px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    gap: 16px;
  }

  .lobby-brand { margin-bottom: 0; }
  .brand-icon  { font-size: 22px; }
  .brand-name  { font-size: 22px; }

  /* Compact preview on mobile */
  .preview-container { max-width: 100%; border-radius: 12px; }

  .preview-ctrl-btn { width: 40px; height: 40px; font-size: 16px; }

  .device-selectors { max-width: 100%; gap: 10px; }
  .device-select-group { padding: 10px 14px; }
  .device-select { font-size: 13px; }

  /* Right panel becomes full width below preview */
  .lobby-right {
    flex: none;
    width: 100%;
    padding: 24px 20px 40px;
  }

  .join-card { max-width: 100%; }
  .join-title { font-size: 22px; }
  .join-subtitle { margin-bottom: 24px; font-size: 13px; }
  .join-input { font-size: 15px; }
  .join-btn { padding: 14px; font-size: 15px; }
  .input-wrapper { padding: 12px 16px; }

  /* ── Call screen ── */
  .call-screen { overflow: hidden; }

  /* Top bar: smaller on mobile */
  .call-topbar {
    height: 52px;
    padding: 0 14px;
  }

  /* Hide room label in topbar center on small screens */
  .topbar-center { display: none; }

  .brand-icon-sm { font-size: 17px; }
  .brand-name-sm { font-size: 16px; }

  .call-timer { font-size: 12px; }

  /* Connection badge: hide text, keep dot only */
  .conn-badge span#connStatus { display: none; }
  .conn-badge { padding: 4px 8px; }

  /* PIP: smaller, bottom-left to avoid overlapping controls */
  .local-pip {
    width: 110px;
    bottom: auto;
    top: 60px;
    right: 12px;
    left: auto;
    border-radius: 10px;
  }

  /* Controls bar: tighter */
  .call-controls {
    height: 80px;
    padding: 0 12px;
  }

  /* Hide room name text in controls left */
  .ctrl-room-name { display: none; }
  .ctrl-left { flex: 0; }
  .ctrl-right { flex: 0; }

  /* Center becomes the main content, takes remaining space */
  .ctrl-center {
    flex: 1;
    justify-content: center;
    gap: 10px;
  }

  /* Buttons: touch-friendly 48px tap target */
  .ctrl-btn { width: 48px; height: 48px; }
  .ctrl-btn-inner { font-size: 18px; }

  /* Hide labels on mobile (icons only) */
  .ctrl-label { display: none; }

  /* Toast: full width, bottom */
  .toast-notification {
    width: calc(100% - 32px);
    left: 16px;
    right: 16px;
    transform: none;
    bottom: 90px;
    border-radius: 12px;
    justify-content: center;
    font-size: 13px;
  }

  @keyframes toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Waiting overlay text */
  .waiting-title { font-size: 18px; }
  .waiting-avatar { width: 72px; height: 72px; font-size: 36px; }
}

/* ============================================================
   RESPONSIVE — SMALL PHONES (max 480px)
============================================================ */
@media (max-width: 480px) {
  .lobby-left { padding: 20px 16px 16px; }
  .lobby-right { padding: 20px 16px 32px; }

  .join-title { font-size: 20px; }

  /* Even smaller PIP */
  .local-pip { width: 90px; }

  /* Tighter controls */
  .ctrl-btn { width: 44px; height: 44px; }
  .ctrl-center { gap: 8px; }
}

/* ============================================================
   SAFE AREA — Notch / Dynamic Island support (iOS)
============================================================ */
@supports (padding: max(0px)) {
  .call-controls {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
    height: calc(80px + env(safe-area-inset-bottom));
  }
  .call-topbar {
    padding-top: max(0px, env(safe-area-inset-top));
  }
  .lobby-screen {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================================================
   SCREEN PINNING & FOCUS ("Switch Me")
============================================================ */
.call-screen.has-pinned .is-pinned {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 5 !important;
  border-radius: 0 !important;
  cursor: pointer;
}
.call-screen.has-pinned .is-pinned video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.call-screen.has-pinned .mini-pip {
  position: absolute !important;
  z-index: 20 !important;
  width: 180px !important;
  aspect-ratio: 16/9 !important;
  border-radius: 12px !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
  overflow: hidden !important;
  cursor: pointer;
  transition: right 0.3s ease, bottom 0.3s ease;
}
.call-screen.has-pinned .mini-pip video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.call-screen.has-pinned .mini-pip .tile-label,
.call-screen.has-pinned .mini-pip .pip-overlay {
  font-size: 10px !important;
  padding: 2px 6px !important;
}

/* ============================================================
   CHAT SIDEBAR
============================================================ */
.chat-panel {
  position: absolute;
  top: 64px;
  right: 20px;
  bottom: 100px;
  width: 340px;
  background: rgba(32, 33, 36, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 2147483647;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
:fullscreen .chat-panel,
:-webkit-full-screen .chat-panel {
  z-index: 2147483647 !important;
}
.chat-panel.hidden {
  transform: translateX(380px);
  opacity: 0;
  pointer-events: none;
}

.chat-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-title { font-size: 16px; font-weight: 600; color: #fff; }
.chat-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
}
.chat-close-btn:hover { color: #fff; }

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.chat-msg {
  background: rgba(255,255,255,0.06);
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-msg.me {
  align-self: flex-end;
  background: var(--primary);
}
.chat-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
}
.chat-msg-sender { color: rgba(255,255,255,0.8); }
.chat-msg-time { color: rgba(255,255,255,0.4); font-size: 10px; }
.chat-msg-text { font-size: 13px; color: #fff; word-break: break-word; }

.chat-input-wrapper {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
}
.chat-input-wrapper input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.chat-input-wrapper input:focus { border-color: var(--primary); }

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.chat-send-btn:hover { background: var(--primary-h); }

.chat-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ============================================================
   SHORTCUTS GUIDE
============================================================ */
.shortcuts-guide {
  position: absolute;
  bottom: 100px;
  left: 20px;
  background: rgba(15, 15, 15, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  border-radius: 8px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
}
.shortcuts-guide:hover {
  opacity: 1;
  background: rgba(15, 15, 15, 0.8);
}
.shortcut-item {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.shortcut-item .key {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: var(--font);
  font-weight: 700;
  color: #fff;
  min-width: 16px;
  text-align: center;
}