:root {
  --bg: #131416;
  --surface: #1c1e22;
  --surface-hover: #25282e;
  --surface-elevated: #262930;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ========================================================================= */
/* VIEWS & TOP HEADER                                                        */
/* ========================================================================= */

.view {
  display: none;
  width: 100%;
  height: 100%;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.organizer-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
}

/* ========================================================================= */
/* BUTTONS & INPUTS                                                          */
/* ========================================================================= */

input[type="text"],
input[type="password"],
input[type="search"],
select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
}

.input-sm,
.select-sm {
  padding: 6px 10px;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  color: var(--text);
  background: var(--surface-elevated);
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-hover);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-icon:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.icon {
  width: 20px;
  height: 20px;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

.muted-text {
  color: var(--text-muted);
  font-size: 13px;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
}

/* ========================================================================= */
/* HOME & ORGANIZER DASHBOARD                                                */
/* ========================================================================= */

.home-main {
  flex: 1;
  overflow-y: auto;
  padding: 36px 24px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.join-hero-card {
  max-width: 460px;
  width: 100%;
  margin: 12px auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.join-hero-card h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.inline-form input {
  flex: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 840px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.create-room-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-row input[type="password"] {
  flex: 1;
  min-width: 0;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.list-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.list-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ========================================================================= */
/* PRE-JOIN LOBBY                                                            */
/* ========================================================================= */

.prejoin-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 24px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 780px) {
  .prejoin-container {
    flex-direction: column;
    gap: 20px;
  }
}

.prejoin-preview-box {
  position: relative;
  flex: 1.3;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.prejoin-meter-wrap {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  overflow: hidden;
}

.prejoin-audio-bar {
  height: 100%;
  width: 0%;
  background: #22c55e;
  transition: width 0.08s linear;
}

.prejoin-media-controls {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.prejoin-card {
  flex: 0.9;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prejoin-card h2 {
  font-size: 22px;
  font-weight: 600;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ========================================================================= */
/* WAITING ROOM                                                              */
/* ========================================================================= */

.waiting-card {
  margin: auto;
  max-width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================================================= */
/* CONFERENCE CALL VIEW                                                      */
/* ========================================================================= */

.call-topbar {
  height: 48px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.call-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.call-title {
  font-weight: 500;
  font-size: 14px;
}

.call-timer {
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}

.transcription-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 500;
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.waiting-alert-banner {
  position: fixed;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 13px;
}

.waiting-alert-actions {
  display: flex;
  gap: 6px;
}

.call-workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  padding: 4px 16px;
  gap: 14px;
}

.call-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================================================= */
/* VIDEO GRID (2-10 PERSONEN & SPOTLIGHT)                                    */
/* ========================================================================= */

.video-grid {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 10px;
  align-content: center;
  justify-content: center;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
}

.video-grid[data-count="1"] {
  grid-template-columns: minmax(0, 960px);
}

.video-grid[data-count="2"] {
  grid-template-columns: repeat(2, 1fr);
}

.video-grid[data-count="3"],
.video-grid[data-count="4"] {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.video-grid[data-count="5"],
.video-grid[data-count="6"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.video-grid[data-count="7"],
.video-grid[data-count="8"],
.video-grid[data-count="9"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.video-grid[data-count="10"] {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

/* Spotlight-Ansicht (bei Bildschirmfreigabe: Groß dargestellt, alle anderen rechts am Rand übereinander) */
.video-grid.spotlight-mode {
  display: grid !important;
  grid-template-columns: 1fr minmax(180px, 260px) !important;
  grid-auto-rows: minmax(80px, 1fr) !important;
  grid-template-rows: none !important;
  gap: 10px !important;
  height: 100% !important;
  max-height: 100% !important;
  align-content: stretch !important;
}

.video-tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Gelbe Umrandung beim Handheben */
.video-tile.hand-raised {
  border: 3px solid #facc15 !important;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.55) !important;
}

.video-tile.hand-raised.speaking {
  border: 3px solid #facc15 !important;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.8) !important;
}

.video-tile.speaking:not(.hand-raised) {
  border-color: var(--accent);
}

.video-grid.spotlight-mode .video-tile.pinned {
  grid-column: 1 / 2 !important;
  grid-row: 1 / span 12 !important;
  height: 100% !important;
  min-height: 0 !important;
  z-index: 2;
}

.video-grid.spotlight-mode .video-tile.pinned video {
  object-fit: contain !important;
  background: #090a0c;
}

.video-grid.spotlight-mode .video-tile:not(.pinned) {
  grid-column: 2 / 3 !important;
  height: 100% !important;
  min-height: 80px !important;
  max-height: 220px !important;
}

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

.video-tile.local-camera:not(.screenshare) video {
  transform: scaleX(-1);
}

.video-tile.screenshare video {
  object-fit: contain;
  background: #0b0c0e;
}

.tile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-elevated);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  user-select: none;
}

.tile-overlay-bottom {
  position: absolute;
  left: 10px;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.tile-name-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(15, 16, 19, 0.72);
  backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 500;
}

.tile-status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tile-badge-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 16, 19, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.tile-badge-icon.muted {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

/* ========================================================================= */
/* BOTTOM CONTROL DOCK                                                       */
/* ========================================================================= */

.call-bottombar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.control-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.dock-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 2px;
}

.ctrl-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--surface-elevated);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}

.ctrl-btn:hover {
  background: var(--surface-hover);
}

.ctrl-btn.off {
  background: var(--danger);
  color: #fff;
}

.ctrl-btn.active {
  background: var(--accent);
  color: #fff;
}

.ctrl-btn.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.ctrl-btn-leave {
  width: 56px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
}

.ctrl-btn-leave:hover {
  background: var(--danger-hover);
}

.ctrl-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popover-anchor {
  position: relative;
}

.emoji-popover {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 30;
}

.emoji-popover button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.12s;
}

.emoji-popover button:hover {
  transform: scale(1.25);
}

.leave-popover {
  position: absolute;
  bottom: 56px;
  right: 0;
  width: 220px;
  padding: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
}

/* ========================================================================= */
/* SIDE DRAWER (TEILNEHMER, CHAT, TRANSKRIPT)                                */
/* ========================================================================= */

.side-drawer {
  width: 340px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.drawer-tabs {
  display: flex;
  gap: 4px;
}

.drawer-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.drawer-tab.active {
  background: var(--surface-elevated);
  color: var(--text);
}

.tab-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 2px;
}

.drawer-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.drawer-panel.active {
  display: flex;
}

.host-perm-box {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.drawer-section {
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.peer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.peer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.peer-item-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.perm-pill {
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.perm-pill.enabled {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* CHAT & TRANSKRIPT LISTEN */

.chat-messages,
.transcript-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble,
.transcript-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.bubble-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.bubble-text {
  font-size: 13px;
  word-break: break-word;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.chat-input-bar input {
  flex: 1;
  min-width: 0;
}

.transcript-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

/* ========================================================================= */
/* FLOATING EMOJI REACTIONS                                                  */
/* ========================================================================= */

.reactions-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-emoji {
  position: absolute;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  animation: floatUp 2.6s ease-out forwards;
}

.floating-emoji .emoji-char {
  font-size: 32px;
}

.floating-emoji .emoji-sender {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(-220px) scale(1.15);
    opacity: 0;
  }
}

/* ========================================================================= */
/* MODALS & TOASTS                                                           */
/* ========================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 88vh;
}

.modal-sm {
  max-width: 380px;
}

.modal-lg {
  max-width: 720px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.summary-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

.summary-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.summary-section h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.summary-section ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-container {
  position: fixed;
  bottom: 88px;
  left: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 14px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ========================================================================= */
/* MOBILE & HOCHKANTMODUS (PORTRAIT) OPTIMIERUNGEN                           */
/* ========================================================================= */

@media (max-width: 768px) {
  /* Kompakte obere Leiste */
  .call-topbar {
    height: 48px;
    padding: 0 10px;
  }

  .call-title {
    max-width: 130px;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Arbeitsbereich füllt die Höhe exakt aus ohne Scrollbalken */
  .call-workspace {
    padding: 4px 6px;
    gap: 6px;
    position: relative;
    overflow: hidden;
  }

  /* Seitenleiste als schwebendes Overlay, damit sie das Videogitter nicht quetscht */
  .side-drawer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 340px;
    z-index: 50;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.7);
  }

  /* Spotlight im Hochkantmodus: geteilter Bildschirm oben groß, andere Videos unten horizontal */
  .video-grid.spotlight-mode {
    grid-template-columns: 1fr !important;
    grid-template-rows: 2.3fr 1fr !important;
    grid-auto-flow: column !important;
    gap: 6px !important;
  }

  .video-grid.spotlight-mode .video-tile.pinned {
    grid-column: 1 / -1 !important;
    grid-row: 1 / 2 !important;
  }

  .video-grid.spotlight-mode .video-tile:not(.pinned) {
    grid-column: auto !important;
    grid-row: 2 / 3 !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}

/* Speziell für Hochkantmodus / Smartphones (max-width: 640px) oder Portrait-Orientierung */
@media (max-width: 640px), (max-width: 768px) and (orientation: portrait) {
  .video-tile {
    min-height: 0 !important; /* Erlaubt Kacheln zu schrumpfen, damit ALLE sichtbar bleiben */
  }

  .video-grid {
    gap: 6px;
  }

  /* 1 Teilnehmer */
  .video-grid[data-count="1"] {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
  }

  /* 2 Teilnehmer im Hochkantmodus: Vertikal übereinander für volle Bildbreite */
  .video-grid[data-count="2"] {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr 1fr !important;
  }

  /* 3 & 4 Teilnehmer: 2 Spalten x 2 Zeilen */
  .video-grid[data-count="3"],
  .video-grid[data-count="4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
  }

  /* 5 & 6 Teilnehmer: 2 Spalten x 3 Zeilen */
  .video-grid[data-count="5"],
  .video-grid[data-count="6"] {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(3, 1fr) !important;
  }

  /* 7 bis 10 Teilnehmer: 2 Spalten mit sanftem Scrollen */
  .video-grid[data-count="7"],
  .video-grid[data-count="8"],
  .video-grid[data-count="9"],
  .video-grid[data-count="10"] {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-rows: minmax(85px, 1fr) !important;
    overflow-y: auto !important;
  }

  .tile-name-badge {
    font-size: 11px;
    padding: 2px 6px;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tile-avatar {
    width: 48px;
    height: 48px;
    font-size: 16px;
  }

  /* Untere Steuerleiste: Passt auf jeden Smartphone-Bildschirm ohne Abschneiden */
  .call-bottombar {
    height: 62px;
    padding: 0 4px;
    max-width: 100vw;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
  }

  .control-dock {
    max-width: 98vw;
    padding: 4px 6px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-sizing: border-box;
  }

  .control-dock::-webkit-scrollbar {
    display: none;
  }

  .ctrl-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-shrink: 0;
  }

  .ctrl-btn .icon {
    width: 17px;
    height: 17px;
  }

  .ctrl-btn-leave {
    width: 46px;
    min-width: 46px;
    height: 36px;
  }

  .dock-divider {
    height: 18px;
    margin: 0 1px;
    flex-shrink: 0;
  }

  .toast-container {
    bottom: 74px;
    left: 10px;
    right: 10px;
  }
}
