/* Discord Upgrades for PulseChat: File Sharing, Drawer & WebRTC Voice Channels */

/* Speaking Ring Animations */
@keyframes pulse-speak {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7), 0 0 8px rgba(34, 197, 94, 0.5);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.4), 0 0 14px rgba(34, 197, 94, 0.8);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0), 0 0 8px rgba(34, 197, 94, 0.5);
  }
}

.pulse-speaking {
  animation: pulse-speak 1.5s infinite !important;
  border-color: #22c55e !important;
  box-shadow: 0 0 10px #22c55e !important;
}

/* Lightbox Modal */
.pulse-lightbox-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: pulse-fade-in 0.15s ease-out;
}

.pulse-lightbox-img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  user-select: none;
}

@keyframes pulse-fade-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Drag & Drop Overlay */
.pulse-dropzone-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(18, 19, 22, 0.92);
  border: 3px dashed #5865F2;
  border-radius: 8px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  backdrop-filter: blur(2px);
  animation: pulse-fade-in 0.12s ease-out;
}

/* Attachment Cards */
.pulse-attachment-card {
  display: flex;
  align-items: center;
  background-color: #2b2d31;
  border: 1px solid #35373c;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  max-width: 440px;
  gap: 0.75rem;
  transition: all 0.15s ease;
}

.pulse-attachment-card:hover {
  background-color: #313338;
  border-color: #404249;
}

/* Shared Files Drawer */
.pulse-files-drawer,
.pulse-notes-drawer {
  width: 350px;
  height: 100%;
  background-color: #2b2d31;
  border-left: 1px solid #1f2023;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
  animation: pulse-slide-left 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.pulse-note-card {
  transition: all 0.15s ease;
}
.pulse-note-card:hover {
  border-color: #4e5058;
}

@keyframes pulse-slide-left {
  from { transform: translateX(100%); opacity: 0.5; }
  to { transform: translateX(0); opacity: 1; }
}

/* Voice Bar */
.pulse-voice-bar {
  background-color: #1e1f22;
  border-top: 1px solid #232428;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pulse-voice-conn-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

/* User & Client Settings Modal */
.pulse-settings-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: pulse-fade-in 0.15s ease-out;
}

.pulse-settings-container {
  width: 100%;
  max-width: 960px;
  height: 82vh;
  max-height: 800px;
  background-color: #313338;
  border: 1px solid #232428;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  overflow: hidden;
  user-select: none;
}

.pulse-settings-sidebar {
  width: 240px;
  background-color: #2b2d31;
  border-right: 1px solid #232428;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0.75rem;
  flex-shrink: 0;
  overflow-y: auto;
}

.pulse-settings-content {
  flex: 1;
  padding: 2.25rem 2.5rem;
  overflow-y: auto;
  color: #dbdee1;
  display: flex;
  flex-direction: column;
}

.pulse-settings-nav-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #949ba4;
  padding: 0.5rem 0.75rem 0.25rem;
}

.pulse-settings-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #b5bac1;
  cursor: pointer;
  transition: all 0.12s ease;
  margin-bottom: 2px;
}

.pulse-settings-nav-item:hover {
  background-color: #35373c;
  color: #dbdee1;
}

.pulse-settings-nav-item.active {
  background-color: #404249;
  color: #ffffff;
  font-weight: 600;
}

.pulse-settings-card {
  background-color: #2b2d31;
  border: 1px solid #232428;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.pulse-settings-card:hover {
  border-color: #35373c;
}

.pulse-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  border: 2px solid transparent;
}

.pulse-color-swatch:hover {
  transform: scale(1.12);
}

.pulse-color-swatch.active {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.pulse-vu-track {
  width: 100%;
  height: 10px;
  background-color: #1e1f22;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid #35373c;
}

.pulse-vu-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 70%, #ef4444 100%);
  border-radius: 9999px;
  transition: width 0.08s ease-out;
}


/* Chat Density & Scaling */
:root {
  --pulse-chat-font-size: 14px;
}

body.pulse-chat-compact {
  --pulse-chat-font-size: 13px;
}

body.pulse-chat-compact [class*="group"] {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

.pulse-settings-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 20;
}

/* Code & Terminal Blocks */
.pulse-code-card {
  background-color: #141517;
  border: 1px solid #232428;
  border-radius: 8px;
  overflow: hidden;
  margin: 0.5rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.pulse-code-header {
  background-color: #1a1b1e;
  border-bottom: 1px solid #232428;
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-family: monospace;
  color: #949ba4;
  user-select: none;
}

.pulse-code-copy-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background-color: #2b2d31;
  color: #dbdee1;
  font-size: 11px;
  font-family: system-ui, -apple-system, sans-serif;
  cursor: pointer;
  transition: all 0.12s ease;
  border: none;
}

.pulse-code-copy-btn:hover {
  background-color: #35373c;
  color: #ffffff;
}

.pulse-code-copy-btn.copied {
  background-color: #23a55a;
  color: #ffffff;
  font-weight: 600;
}

.pulse-code-pre {
  padding: 0.75rem 1rem;
  font-size: 13px;
  font-family: "Consolas", "Fira Code", "Monaco", "Courier New", monospace;
  line-height: 1.5;
  color: #e6e6e6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Inline Animated GIFs & Media Embeds */
.pulse-gif-card {
  display: inline-block;
  max-width: 100%;
  margin: 0.35rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #2b2d31;
  background-color: rgba(0,0,0,0.3);
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pulse-gif-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}

.pulse-gif-card img {
  max-height: 320px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* Jumboji (large emojis) */
.pulse-jumboji {
  font-size: 2.25rem !important;
  line-height: 1.2 !important;
  display: inline-block;
  vertical-align: middle;
}

/* Smart Paste Notification Banner */
.pulse-smart-paste-banner {
  background: linear-gradient(90deg, #1e1f22 0%, #2b2d31 100%);
  border: 1px solid #5865F2;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #dbdee1;
  box-shadow: 0 2px 10px rgba(88, 101, 242, 0.2);
  animation: pulse-fade-in 0.15s ease-out;
}

/* Popovers: Emoji & GIF Pickers */
.pulse-popover-container {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 1rem;
  width: 340px;
  max-height: 380px;
  background-color: #2b2d31;
  border: 1px solid #1f2023;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  user-select: none;
  animation: pulse-fade-in 0.15s ease-out;
}

.pulse-popover-header {
  background-color: #1e1f22;
  border-bottom: 1px solid #232428;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pulse-emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0.5rem;
  overflow-y: auto;
  max-height: 280px;
}

.pulse-emoji-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: background-color 0.1s ease, transform 0.1s ease;
}

.pulse-emoji-btn:hover {
  background-color: #35373c;
  transform: scale(1.18);
}

.pulse-gif-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 0.6rem;
  overflow-y: auto;
  max-height: 300px;
}

.pulse-gif-item {
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background-color: #1e1f22;
  border: 1px solid #35373c;
  transition: transform 0.12s ease, border-color 0.12s ease;
  height: 90px;
  position: relative;
}

.pulse-gif-item:hover {
  transform: scale(1.03);
  border-color: #5865F2;
}

.pulse-gif-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pulse-gif-item-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 6px;
  text-shadow: 0 1px 2px black;
}

/* Interactive Checklists in Notes & Chat */
.pulse-checklist-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.15rem 0;
  user-select: none;
}

.pulse-checklist-checkbox {
  margin-top: 0.2rem;
  width: 14px;
  height: 14px;
  accent-color: #5865F2;
  cursor: pointer;
}

.pulse-checklist-text.checked {
  text-decoration: line-through;
  color: #80848e;
}

/* Note Monospace Mode */
.pulse-note-monospace {
  font-family: "Consolas", "Fira Code", "Monaco", "Courier New", monospace !important;
  background-color: #18191c !important;
  border-color: #35373c !important;
  white-space: pre !important;
  overflow-x: auto !important;
}

/* ==================== Roles & Permissions Styles ==================== */

.pulse-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: rgba(255, 255, 255, 0.05);
  color: #e0e2e5;
  white-space: nowrap;
}

.pulse-role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
  flex-shrink: 0;
}

.pulse-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s, border-color 0.1s;
}

.pulse-color-swatch:hover {
  transform: scale(1.15);
}

.pulse-color-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* 3-State Permission Toggle Buttons */
.pulse-perm-group {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  background-color: #2b2d31;
  border: 1px solid #35373c;
}

.pulse-perm-btn {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s ease;
  color: #949ba4;
  background: transparent;
  border: none;
  cursor: pointer;
}

.pulse-perm-btn:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #dbdee1;
}

.pulse-perm-btn.active-allow {
  background-color: #23a55a !important;
  color: #ffffff !important;
}

.pulse-perm-btn.active-inherit {
  background-color: #4e5058 !important;
  color: #ffffff !important;
}

.pulse-perm-btn.active-deny {
  background-color: #f23f43 !important;
  color: #ffffff !important;
}

/* Locked Chat Input Bar */
.pulse-chat-locked-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background-color: #2b2d31;
  border: 1px dashed #35373c;
  border-radius: 8px;
  color: #949ba4;
  font-size: 0.825rem;
  font-weight: 500;
  user-select: none;
}

/* ==========================================================================
   Server Settings & Permission Modals Scroll & Layout Engine
   ========================================================================== */

.pulse-server-settings-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  overflow-y: auto;
  user-select: none;
  animation: pulse-fade-in 0.15s ease-out;
}

.pulse-server-settings-modal {
  width: 100%;
  max-width: 960px;
  height: 85vh;
  max-height: 720px;
  min-height: 480px;
  background-color: #313338;
  border-radius: 12px;
  border: 1px solid #232428;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  overflow: hidden;
  position: relative;
}

.pulse-server-settings-sidebar {
  width: 220px;
  background-color: #2b2d31;
  border-right: 1px solid #232428;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 0.75rem;
  flex-shrink: 0;
  overflow-y: auto;
}

.pulse-server-settings-main {
  flex: 1;
  background-color: #313338;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

/* Roles Tab Sub-Columns */
.pulse-roles-pane {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.pulse-roles-list-col {
  width: 230px;
  background-color: #2b2d31;
  border-right: 1px solid #232428;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}

.pulse-roles-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.pulse-role-editor-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  background-color: #313338;
}

.pulse-role-editor-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
}

.pulse-role-editor-footer {
  padding: 0.85rem 1.5rem;
  background-color: #2b2d31;
  border-top: 1px solid #232428;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* Members Tab */
.pulse-members-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  padding: 1.5rem;
  overflow: hidden;
}

.pulse-members-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
}

/* Channel Settings Modal */
.pulse-channel-settings-modal {
  width: 100%;
  max-width: 580px;
  height: 85vh;
  max-height: 640px;
  background-color: #313338;
  border-radius: 12px;
  border: 1px solid #232428;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pulse-channel-settings-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Member Role Modal */
.pulse-member-role-modal {
  width: 100%;
  max-width: 380px;
  max-height: 85vh;
  background-color: #313338;
  border-radius: 12px;
  border: 1px solid #232428;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pulse-member-role-scroll {
  max-height: 320px;
  overflow-y: auto;
  padding: 1rem;
}

/* Custom Discord Scrollbars */
.pulse-roles-list-scroll::-webkit-scrollbar,
.pulse-role-editor-scroll::-webkit-scrollbar,
.pulse-server-settings-sidebar::-webkit-scrollbar,
.pulse-members-scroll::-webkit-scrollbar,
.pulse-channel-settings-scroll::-webkit-scrollbar,
.pulse-member-role-scroll::-webkit-scrollbar,
.pulse-server-settings-backdrop::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.pulse-roles-list-scroll::-webkit-scrollbar-track,
.pulse-role-editor-scroll::-webkit-scrollbar-track,
.pulse-server-settings-sidebar::-webkit-scrollbar-track,
.pulse-members-scroll::-webkit-scrollbar-track,
.pulse-channel-settings-scroll::-webkit-scrollbar-track,
.pulse-member-role-scroll::-webkit-scrollbar-track,
.pulse-server-settings-backdrop::-webkit-scrollbar-track {
  background: #2b2d31;
  border-radius: 4px;
}

.pulse-roles-list-scroll::-webkit-scrollbar-thumb,
.pulse-role-editor-scroll::-webkit-scrollbar-thumb,
.pulse-server-settings-sidebar::-webkit-scrollbar-thumb,
.pulse-members-scroll::-webkit-scrollbar-thumb,
.pulse-channel-settings-scroll::-webkit-scrollbar-thumb,
.pulse-member-role-scroll::-webkit-scrollbar-thumb,
.pulse-server-settings-backdrop::-webkit-scrollbar-thumb {
  background: #1a1b1e;
  border-radius: 4px;
  border: 2px solid #2b2d31;
}

.pulse-roles-list-scroll::-webkit-scrollbar-thumb:hover,
.pulse-role-editor-scroll::-webkit-scrollbar-thumb:hover,
.pulse-server-settings-sidebar::-webkit-scrollbar-thumb:hover,
.pulse-members-scroll::-webkit-scrollbar-thumb:hover,
.pulse-channel-settings-scroll::-webkit-scrollbar-thumb:hover,
.pulse-member-role-scroll::-webkit-scrollbar-thumb:hover,
.pulse-server-settings-backdrop::-webkit-scrollbar-thumb:hover {
  background: #111214;
}

.pulse-roles-list-scroll,
.pulse-role-editor-scroll,
.pulse-server-settings-sidebar,
.pulse-members-scroll,
.pulse-channel-settings-scroll,
.pulse-member-role-scroll,
.pulse-server-settings-backdrop {
  scrollbar-width: thin;
  scrollbar-color: #1a1b1e #2b2d31;
}

/* ==========================================================================
   Discord Channel Context Menu (Right Click)
   ========================================================================== */

.pulse-context-menu {
  position: fixed;
  background-color: #111214;
  border: 1px solid #232428;
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
  padding: 6px 8px;
  min-width: 195px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: pulse-popover-in 0.1s ease-out;
  user-select: none;
}

.pulse-context-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #dbdee1;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: background-color 0.1s ease, color 0.1s ease;
}

.pulse-context-menu-item:hover {
  background-color: #5865f2;
  color: #ffffff;
}

.pulse-context-menu-item.danger {
  color: #f23f43;
}

.pulse-context-menu-item.danger:hover {
  background-color: #da373c;
  color: #ffffff;
}

.pulse-context-menu-separator {
  height: 1px;
  background-color: #232428;
  margin: 4px 0;
}

/* ==========================================================================
   Voice Channel Screensharing & Stage View
   ========================================================================== */

/* Live Stream Badge in Voice Roster */
.pulse-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background-color: #ed4245;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: pulse-glow-red 2s infinite ease-in-out;
  cursor: pointer;
}

@keyframes pulse-glow-red {
  0%, 100% { box-shadow: 0 0 4px rgba(237, 66, 69, 0.4); }
  50% { box-shadow: 0 0 10px rgba(237, 66, 69, 0.8); }
}

/* Voice Bar Stream Button */
.pulse-voice-bar-btn {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #949ba4;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pulse-voice-bar-btn:hover {
  background-color: #35373c;
  color: #ffffff;
}

.pulse-voice-bar-btn.streaming {
  background-color: rgba(35, 165, 90, 0.2);
  color: #23a55a;
  border: 1px solid rgba(35, 165, 90, 0.4);
}

.pulse-voice-bar-btn.streaming:hover {
  background-color: rgba(237, 66, 69, 0.2);
  color: #ed4245;
  border-color: rgba(237, 66, 69, 0.4);
}

/* Voice Stage Container */
.pulse-voice-stage {
  position: absolute;
  inset: 0;
  background-color: #111214;
  z-index: 35;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.pulse-voice-stage-header {
  height: 52px;
  padding: 0 1.25rem;
  background-color: #1e1f22;
  border-bottom: 1px solid #232428;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
}

.pulse-voice-stage-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #0b0c0d;
  overflow: hidden;
}

.pulse-voice-stage-video-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pulse-voice-stage-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background-color: #000000;
  border-radius: 6px;
}

/* Multi-Stream Gallery Thumbnails */
.pulse-stream-gallery {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #1e1f22;
  border-top: 1px solid #232428;
  overflow-x: auto;
  flex-shrink: 0;
  max-height: 110px;
}

.pulse-stream-thumb-card {
  width: 140px;
  height: 80px;
  border-radius: 6px;
  background-color: #2b2d31;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.pulse-stream-thumb-card:hover {
  transform: translateY(-2px);
  border-color: #5865f2;
}

.pulse-stream-thumb-card.active {
  border-color: #5865f2;
  box-shadow: 0 0 10px rgba(88, 101, 242, 0.5);
}

/* Interactive Remote Control Overlay */
.pulse-remote-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  z-index: 20;
}

/* Remote Control Floating Safety Banner on Streamer */
.pulse-remote-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(17, 18, 20, 0.95);
  border: 1px solid #ed4245;
  border-radius: 8px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  z-index: 100;
  animation: pulse-popover-in 0.15s ease-out;
}

/* Picture in Picture Floating Card */
.pulse-pip-container {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 320px;
  height: 180px;
  background-color: #111214;
  border: 1px solid #35373c;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.pulse-pip-container:hover {
  border-color: #5865f2;
  box-shadow: 0 20px 48px rgba(88, 101, 242, 0.3);
}

.pulse-pip-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 40%, rgba(0,0,0,0.8) 100%);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  transition: opacity 0.15s ease;
}

.pulse-pip-container:hover .pulse-pip-overlay {
  opacity: 1;
}


/* ==========================================================================
   Chat Messages & Content Text Selection & Highlighting
   ========================================================================== */

/* Enable selection in messages area and all text contents */
.select-text,
.message-content,
.pulse-code-card,
.pulse-code-pre,
.pulse-code-pre code,
.pulse-ansi-container,
.pulse-ansi-container pre,
.pulse-ansi-container code,
.pulse-note-card,
.pulse-notes-drawer .pulse-note-card,
.pulse-note-body,
.pulse-checklist-text,
.pulse-files-drawer .truncate,
.text-discord-text,
.text-discord-header,
[class*="text-discord-text"],
[class*="text-discord-header"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Ensure the message list scroll container and all message items permit selection */
div[ref="m"],
.flex-1.overflow-y-auto,
.flex-1.overflow-y-auto > div,
.group.hover\:bg-discord-darkest\/20,
.group.hover\:bg-discord-darkest\/20 * {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Restore default pointer cursors and prevent selection on non-text controls */
.group button,
.group a,
.group [role="button"],
.group svg,
.group img,
.group video,
.group .rounded-full,
.pulse-code-copy-btn,
.pulse-checklist-checkbox,
.pulse-live-badge {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

/* Discord-authentic Blurple Text Selection Highlight */
::selection {
  background-color: rgba(88, 101, 242, 0.45) !important;
  color: #ffffff !important;
}

::-moz-selection {
  background-color: rgba(88, 101, 242, 0.45) !important;
  color: #ffffff !important;
}
