/* ============================================================
   Bluewave – App Layout Styles (app.html)
   Redesign 2026 – modernes Dark-Mode-UI
   ============================================================ */

/* ============================================================
   ROOT APP GRID
   ============================================================ */
.bw-app {
  display: grid;
  grid-template-columns: 60px 240px 1fr 220px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

/* ============================================================
   WORKSPACE RAIL (60px – ganz links)
   ============================================================ */
.bw-workspace-rail {
  width: 60px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 12px;
  gap: 4px;
  overflow-y: auto;
  overflow-x: visible;
  flex-shrink: 0;
  scrollbar-width: none;
  position: relative;
  z-index: 10;
}

.bw-workspace-rail::-webkit-scrollbar { display: none; }

/* Logo */
.bw-rail-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  margin-bottom: 2px;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.bw-rail-logo-wrap:hover {
  transform: scale(1.06);
}

.bw-rail-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.bw-rail-divider {
  width: 32px;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
  margin: 4px 0;
}

/* Workspace Items */
.bw-workspace-item {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-radius 0.2s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.bw-workspace-item:hover {
  border-radius: var(--radius-full);
  transform: scale(1.04);
}

/* Active indicator: linke Linie */
.bw-workspace-item::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent);
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1), height 0.18s ease;
}

.bw-workspace-item.active::before {
  transform: translateY(-50%) scaleY(1);
  height: 28px;
}

.bw-workspace-item.active {
  border-radius: var(--radius-md);
}

.bw-workspace-icon {
  width: 44px;
  height: 44px;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  user-select: none;
  overflow: hidden;
  transition: border-radius 0.2s ease;
}

.bw-workspace-item:hover .bw-workspace-icon {
  border-radius: var(--radius-full);
}

.bw-workspace-item.active .bw-workspace-icon {
  border-radius: var(--radius-md);
}

/* Add button */
.bw-workspace-add {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1.5px dashed var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.18s ease;
}

.bw-workspace-add:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
  transform: scale(1.06);
}

/* Rail bottom user area */
.bw-rail-user {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
}

/* ============================================================
   SIDEBAR (240px)
   ============================================================ */
.bw-sidebar {
  width: 240px;
  height: 100vh;
  height: 100dvh;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.bw-sidebar-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 8px;
  min-height: 52px;
}

.bw-sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  letter-spacing: -0.01em;
}

.bw-sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 6px 12px;
}

.bw-channel-section {
  margin-bottom: 6px;
}

/* Channel items */
.bw-channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
  font-size: 0.875rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
  position: relative;
  user-select: none;
  white-space: nowrap;
  overflow: visible;
  margin-bottom: 1px;
}

.bw-channel-item:hover {
  background: var(--surface-3);
  color: var(--fg);
  transform: translateX(1px);
}

.bw-channel-item.active {
  background: var(--accent-subtle);
  color: var(--fg);
  font-weight: 600;
}

.bw-channel-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 3px;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  background: var(--accent);
}

.bw-channel-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bw-channel-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User-Panel unten */
.bw-user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: color-mix(in oklab, var(--surface-2) 95%, var(--bg));
}

.bw-user-panel-info {
  flex: 1;
  min-width: 0;
}

.bw-user-panel-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bw-user-panel-status {
  font-size: 0.7rem;
  color: var(--online);
  font-weight: 500;
}

.bw-user-panel-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ============================================================
   CHAT MAIN
   ============================================================ */
.bw-chat-main {
  background: var(--surface-1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
}

/* Chat Header */
.bw-chat-header {
  position: sticky;
  top: 0;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in oklab, var(--surface-1) 85%, transparent);
  flex-shrink: 0;
  z-index: 10;
}

.bw-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.bw-chat-header-channel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.bw-chat-channel-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.bw-chat-channel-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.bw-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* Messages Container */
.bw-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-behavior: smooth;
}

/* Message Group */
.bw-message-group {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  margin-top: 14px;
  animation: slideInLeft 0.18s ease;
}

.bw-message-group:first-child {
  margin-top: 0;
}

.bw-message-avatar-col {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bw-message-content-col {
  flex: 1;
  min-width: 0;
}

.bw-message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.bw-message-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  transition: color 0.15s ease;
  line-height: 1;
}

.bw-message-username:hover {
  color: var(--accent);
}

.bw-message-timestamp {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0.8;
}

.bw-message-bubble {
  padding: 8px 13px;
  border-radius: 4px 14px 14px 14px;
  background: var(--surface-3);
  color: var(--fg);
  max-width: 70%;
  font-size: 0.9375rem;
  line-height: 1.55;
  word-break: break-word;
  display: inline-block;
  transition: background 0.15s ease;
}

.bw-message-bubble:hover {
  background: color-mix(in oklab, var(--surface-3) 90%, var(--fg));
}

.bw-message-bubble code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.875em;
}

/* Consecutive */
.bw-message-consecutive {
  margin-top: 2px !important;
}

.bw-message-consecutive .bw-message-avatar-col .bw-avatar-wrap {
  visibility: hidden;
}

.bw-message-consecutive .bw-message-header {
  display: none;
}

/* Eigene Nachrichten (rechts) */
.bw-message-own {
  flex-direction: row-reverse;
  animation: slideInRight 0.18s ease;
}

.bw-message-own .bw-message-bubble {
  background: var(--own-bubble);
  color: var(--own-bubble-text);
  border-radius: 14px 4px 14px 14px;
}

.bw-message-own .bw-message-bubble:hover {
  background: color-mix(in oklab, var(--own-bubble) 88%, #fff);
}

.bw-message-own .bw-message-header {
  flex-direction: row-reverse;
}

.bw-message-own .bw-message-content-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* System-Message */
.bw-message-system {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0;
}

.bw-message-system-inner {
  display: inline-block;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

/* Date Divider */
.bw-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 10px;
}

.bw-date-divider::before,
.bw-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.bw-date-divider-label {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 600;
}

/* Unread Divider */
.bw-unread-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.bw-unread-divider::before,
.bw-unread-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(108, 99, 255, 0.35);
}

.bw-unread-divider-label {
  background: var(--accent-subtle);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================================
   MESSAGE INPUT AREA
   ============================================================ */
.bw-message-input-area {
  padding: 10px 16px 14px;
  background: var(--surface-1);
  flex-shrink: 0;
  position: relative;
}

.bw-input-wrapper-chat {
  display: flex;
  align-items: flex-end;
  gap: 0;
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
  min-height: 48px;
}

.bw-input-wrapper-chat:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.bw-input-icons-left,
.bw-input-icons-right {
  display: flex;
  align-items: flex-end;
  padding: 6px 6px 6px;
  gap: 2px;
  flex-shrink: 0;
}

.bw-input-action-btn {
  opacity: 0.6;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.bw-input-action-btn:hover {
  opacity: 1;
  color: var(--accent);
}

.bw-chat-textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem; /* min 16px – verhindert iOS Safari Auto-Zoom */
  resize: none;
  max-height: 160px;
  min-height: 36px;
  line-height: 1.5;
  padding: 10px 4px 8px;
  scrollbar-width: none;
  align-self: flex-end;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.bw-chat-textarea::-webkit-scrollbar { display: none; }

.bw-chat-textarea::placeholder {
  color: var(--muted);
  opacity: 0.65;
}

/* Send Button */
.bw-send-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.18s cubic-bezier(.34, 1.56, .64, 1);
  flex-shrink: 0;
  margin: 0 6px 6px 0;
}

.bw-send-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: scale(1.08);
}

.bw-send-btn:active {
  transform: scale(0.93);
}

/* ============================================================
   MEMBER SIDEBAR (rechts, 220px)
   ============================================================ */
.bw-member-sidebar {
  width: 220px;
  height: 100vh;
  height: 100dvh;
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.22s ease;
}

.bw-member-sidebar.collapsed {
  width: 0;
  border-left: none;
}

.bw-member-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 52px;
}

.bw-member-sidebar-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.bw-member-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
}

.bw-member-group {
  margin-bottom: 8px;
}

.bw-member-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.bw-member-item:hover {
  background: var(--surface-3);
}

.bw-member-name {
  font-size: 0.83rem;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  font-weight: 500;
}

.bw-member-item.offline .bw-member-name {
  color: var(--muted);
  opacity: 0.7;
}

.bw-member-more {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 4px 8px;
}

/* ============================================================
   VIDEO OVERLAY
   ============================================================ */
.bw-video-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 500;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}

.bw-video-overlay.hidden {
  display: none !important;
}

.bw-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.bw-video-room-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bw-video-room-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--fg);
  display: flex;
  align-items: center;
}

.bw-video-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface-3);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
}

.bw-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  align-content: start;
}

.bw-video-grid[data-count="1"] { grid-template-columns: 1fr; }
.bw-video-grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.bw-video-grid[data-count="3"],
.bw-video-grid[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
.bw-video-grid[data-count="5"],
.bw-video-grid[data-count="6"] { grid-template-columns: repeat(3, 1fr); }
.bw-video-grid[data-count="7"],
.bw-video-grid[data-count="8"],
.bw-video-grid[data-count="9"] { grid-template-columns: repeat(3, 1fr); }
.bw-video-grid[data-count="10"],
.bw-video-grid[data-count="11"],
.bw-video-grid[data-count="12"] { grid-template-columns: repeat(4, 1fr); }

.bw-video-tile {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
  transition: border-color 0.2s ease;
}

.bw-video-tile.speaking {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.bw-video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bw-video-tile-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  flex-direction: column;
  gap: 8px;
}

.bw-video-tile-placeholder .bw-avatar {
  width: 64px;
  height: 64px;
  font-size: 1.4rem;
}

.bw-video-tile-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bw-video-tile-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bw-video-empty-state {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Video Controls */
.bw-video-controls {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.bw-video-ctrl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.bw-video-ctrl-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--fg);
  transition: all 0.18s ease;
  border: 1px solid var(--border);
}

.bw-video-ctrl-btn:hover .bw-video-ctrl-icon {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}

.bw-video-ctrl-btn.muted .bw-video-ctrl-icon {
  background: rgba(225, 29, 72, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}

.bw-video-ctrl-label {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Hang-Up */
.bw-video-hangup .bw-video-ctrl-icon {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  width: 56px;
  height: 56px;
}

.bw-video-hangup:hover .bw-video-ctrl-icon {
  box-shadow: 0 4px 16px var(--danger-glow);
  background: #c81a40;
  border-color: #c81a40;
  color: #fff;
}

/* ============================================================
   MODAL: CHANNEL-TYP RADIO CARDS
   ============================================================ */
.bw-channel-type-cards {
  display: flex;
  gap: 8px;
}

.bw-channel-type-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--surface-3);
}

.bw-channel-type-card:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.bw-channel-type-card.selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

.bw-channel-type-card input[type="radio"] {
  display: none;
}

.bw-channel-type-icon {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bw-channel-type-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.bw-channel-type-card.selected .bw-channel-type-label {
  color: var(--accent);
}

/* ============================================================
   SETTINGS MODAL: FARB-PICKER
   ============================================================ */
.bw-color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bw-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.bw-color-swatch:hover,
.bw-color-swatch.selected {
  border-color: var(--fg);
  transform: scale(1.18);
}

/* ============================================================
   INVITE CODE BOX
   ============================================================ */
.bw-invite-code-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.bw-invite-code-text {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--fg);
  letter-spacing: 1.5px;
  word-break: break-all;
  background: none;
  border: none;
  outline: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .bw-app {
    grid-template-columns: 60px 240px 1fr;
  }
  .bw-member-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    z-index: 50;
    transform: translateX(0);
  }
  .bw-member-sidebar.collapsed {
    transform: translateX(100%);
    width: 220px;
    border-left: 1px solid var(--border);
  }
}

@media (max-width: 1024px) {
  .bw-member-sidebar {
    display: none;
  }
  .bw-app {
    grid-template-columns: 60px 240px 1fr;
  }
}

@media (max-width: 768px) {
  .bw-app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 56px;
  }

  .bw-workspace-rail {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(56px + env(safe-area-inset-bottom));
    flex-direction: row;
    justify-content: space-around;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
    border-right: none;
    border-top: 1px solid var(--border);
    z-index: 100;
    overflow: visible;
  }

  .bw-rail-divider { display: none; }
  .bw-rail-logo-wrap { display: none; }
  .bw-rail-user { margin-top: 0; padding-top: 0; flex-direction: row; gap: 4px; }
  .bw-rail-settings-btn { display: none; }

  .bw-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }

  .bw-sidebar.open {
    transform: translateX(0);
  }

  .bw-chat-main {
    grid-column: 1;
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }

  .bw-voice-bar {
    left: 0;
  }
}

@media (max-width: 480px) {
  .bw-messages-container {
    padding: 10px 10px 6px;
  }

  .bw-message-input-area {
    padding: 8px 10px 10px;
  }

  .bw-chat-header {
    padding: 0 10px;
  }

  .bw-message-bubble {
    max-width: 85%;
  }
}
