* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family:
    "Google Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: #e8eaed;
  height: 100dvh;
}

/* ===== Join screen ===== */
#join-screen {
  height: 100dvh;
  display: none;
  align-items: center;
  justify-content: center;
  background: #202124;
  padding: 16px;
}

#join-box {
  background: #2d2e30;
  padding: 32px 28px;
  border-radius: 16px;
  width: 100%;
  max-width: 340px;
}

#join-box h1 {
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
}

#join-box label {
  display: block;
  font-size: 13px;
  color: #9aa0a6;
  margin-bottom: 6px;
  margin-top: 14px;
}

#join-box input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #3c4043;
  background: #202124;
  color: #fff;
  font-size: 15px;
}

#join-box button {
  width: 100%;
  padding: 13px;
  margin-top: 22px;
  border: none;
  border-radius: 24px;
  background: #8ab4f8;
  color: #202124;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

#join-box button:disabled {
  background: #555;
  color: #ccc;
  cursor: not-allowed;
}

#join-error {
  color: #f28b82;
  font-size: 13px;
  margin-top: 12px;
  display: none;
  line-height: 1.4;
}

/* ===== Meeting screen ===== */
#meeting-screen {
  display: none;
  height: 100dvh;
  background: #000;
  flex-direction: column;
}

/* --- Top bar --- */
#top-bar {
  flex-shrink: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #e8eaed;
  min-width: 0;
}

#top-left .sep {
  color: #5f6368;
}

#top-left #room-code {
  color: #9aa0a6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.count-participant {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #393838;
  border-radius: 30px;
  padding: 10px;
}

#avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #8ab4f8;
  color: #202124;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

#participant-count {
  background: #3c4043;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
}

/* --- Dropdown Layout di top-bar (pengganti toolbar grid lama) --- */
#top-right .dropdown-menu {
  background: #2d2e30;
  border: 1px solid #3c4043;
}

#top-right .dropdown-item {
  color: #e8eaed;
}

#top-right .dropdown-item:hover,
#top-right .dropdown-item:focus {
  background: #3c4043;
  color: #e8eaed;
}

#top-right .dropdown-item.active {
  background: #8ab4f8;
  color: #202124;
  font-weight: 600;
}

/* --- View switcher: cuma satu yang aktif dalam satu waktu --- */
.view {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.view.active {
  display: flex;
}

/* --- Mode 1: Spotlight (dipakai kalau ADA yang screen share) --- */
#stage-area {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
}

#main-stage {
  width: 100%;
  height: 100%;
  max-width: 1100px;
}

#thumbnail-strip {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 0 16px 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
#thumbnail-strip::-webkit-scrollbar {
  display: none;
}
#thumbnail-strip .p-tile {
  width: 120px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 10px;
}

/* --- Mode 2: Desktop gallery (gak ada share, di layar lebar) --- */
#view-desktop-gallery {
  padding: 0 16px 8px 16px;
}

/* < 4 peserta: tile sama besar semua, wrap rapi (2 atas 1 bawah-center buat 3 orang) */
#desktop-gallery-grid.few-mode {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
#desktop-gallery-grid.few-mode .p-tile {
  flex: 0 1 46%;
  aspect-ratio: 16 / 10;
  max-height: 46%;
}
/* 1 peserta aja: tile mengisi penuh area gallery,
   video tetap contain -> landscape fit-to-width, portrait fit-to-height, gak kepotong */
#desktop-gallery-grid.few-mode .p-tile:only-child {
  flex: 0 1 100%;
  max-height: 100%;
  height: 100%;
  aspect-ratio: auto;
}
#desktop-gallery-grid.few-mode .p-tile:last-child:nth-child(odd) {
  margin-left: auto;
  margin-right: auto;
}

/* >= 4 peserta: grid beneran, dipaging sesuai grid 4/8/16 */
#desktop-gallery-grid.paged-mode {
  display: grid;
  gap: 10px;
  flex: 1;
  min-height: 0;
}
#desktop-gallery-grid.paged-mode .p-tile {
  width: 100%;
  height: 100%;
}

#desktop-pager {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 0;
  font-size: 13px;
  color: #9aa0a6;
}
#desktop-pager.visible {
  display: flex;
}
#desktop-pager button {
  background: #3c4043;
  color: #e8eaed;
  border: none;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
}
#desktop-pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* --- Mode 3: Mobile (swipe: halaman speaker <-> halaman grid) --- */
#mobile-pager {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#mobile-pager::-webkit-scrollbar {
  display: none;
}

.mobile-page {
  flex: 0 0 100%;
  scroll-snap-align: start;
  height: 100%;
  overflow-y: auto;
  position: relative;
}

#mobile-page-speaker {
  padding: 8px 16px;
}
#mobile-speaker-stage {
  width: 100%;
  height: 100%;
}
#mobile-speaker-stage .p-tile {
  width: 100%;
  height: 100%;
}

#mobile-self-pip {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 92px;
  height: 130px;
  z-index: 5;
}
#mobile-self-pip .p-tile {
  width: 100%;
  height: 100%;
  border: 2px solid #8ab4f8;
}

#mobile-page-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px 16px;
  align-content: start;
}
#mobile-page-grid .p-tile {
  aspect-ratio: 16 / 9;
}
#mobile-page-grid .p-tile .name-tag {
  font-size: 11px;
}

#mobile-dots {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 0;
}
#mobile-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5f6368;
}
#mobile-dots .dot.active {
  background: #8ab4f8;
}

@media (min-width: 769px) {
  #view-mobile,
  #mobile-dots {
    display: none !important;
  }
}
@media (max-width: 768px) {
  #top-right .choice-grid,
  #view-desktop-gallery {
    display: none !important;
  }
}

/* --- Kartu peserta (dipakai ulang di semua mode) --- */
.p-tile {
  position: relative;
  background: #3c4043;
  border-radius: 16px;
  overflow: hidden;
  /* pembatas antar frame kamera (berlaku desktop & mobile) */
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.p-tile .video-wrap {
  display: none;
  width: 100%;
  height: 100%;
  background: #000;
}
.p-tile.has-video .video-wrap {
  display: block;
}
.p-tile.has-video .name-center {
  display: none;
}

.p-tile video {
  width: 100%;
  height: 100%;
  /* contain (bukan cover) -- video SELALU keliatan utuh, gak pernah kepotong,
       entah sumbernya landscape (kamera laptop) atau portrait (kamera HP).
       Sisa ruang yang kosong otomatis jadi letterbox hitam, bukan di-crop. */
  object-fit: contain;
  display: block;
}

.p-tile .name-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-align: center;
  padding: 8px;
  font-size: 15px;
}

#thumbnail-strip .p-tile .name-center,
#mobile-page-grid .p-tile .name-center,
#mobile-self-pip .p-tile .name-center {
  font-size: 11px;
}

.p-tile .name-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#thumbnail-strip .p-tile .name-tag {
  font-size: 10px;
  bottom: 5px;
  left: 5px;
  padding: 2px 6px;
}

/* --- Ikon Raise Hand di sudut kamera --- */
.raise-hand-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  background: #fdd663;
  color: #202124;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 5;
}
.raise-hand-icon[hidden] {
  display: none;
}

/* --- Ikon Mic Muted di sudut tile kamera --- */
.tile-mic-icon {
  position: absolute;
  bottom: 28px; /* di atas name-tag */
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(234, 67, 53, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  pointer-events: none;
  z-index: 4;
}

.tile-mic-icon[hidden] {
  display: none !important;
}

#thumbnail-strip .raise-hand-icon,
#mobile-self-pip .raise-hand-icon {
  width: 26px;
  height: 26px;
  font-size: 14px;
  top: 4px;
  right: 4px;
}
#mobile-page-grid .raise-hand-icon,
#screen-share-sidebar .raise-hand-icon,
.materi-participant-card .raise-hand-icon {
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  font-size: 14px;
}

/* --- Reaction bar --- */
#reaction-bar {
  flex-shrink: 0;
  display: none;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
#reaction-bar::-webkit-scrollbar {
  display: none;
}
#reaction-bar.visible {
  display: flex;
}

.emoji-btn {
  font-size: 22px;
  background: #3c4043;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  cursor: pointer;
}

/* --- Floating emoji animation --- */
.floating-emoji {
  position: absolute;
  font-size: 32px;
  left: 50%;
  bottom: 20%;
  transform: translateX(-50%);
  animation: floatUp 1.6s ease-out forwards;
  pointer-events: none;
}
@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-140px);
  }
}

/* --- Device picker popup (mic/cam) --- */
.device-picker-popup {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: #2d2e30;
  border: 1px solid #3c4043;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  padding: 10px 0;
  min-width: 260px;
  max-width: 320px;
  z-index: 3000;
  display: none;
}
.device-picker-popup.open {
  display: block;
}
.device-picker-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #9aa0a6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 16px 4px 16px;
}
.device-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: none;
  color: #e8eaed;
  font-size: 13px;
  text-align: left;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0;
}
.device-picker-item:hover {
  background: #3c4043;
}
.device-picker-item.active {
  color: #8ab4f8;
}
.device-picker-item.active::before {
  content: "✓";
  font-size: 13px;
  margin-right: 2px;
  flex-shrink: 0;
}
.device-picker-divider {
  height: 1px;
  background: #3c4043;
  margin: 6px 0;
}

/* --- Grup tombol mic/cam (tombol utama + chevron) --- */
.ctrl-btn-group {
  display: flex;
  align-items: center;
  background: #3c4043;
  border-radius: 28px;
  overflow: hidden;
  flex-shrink: 0;
}
.ctrl-btn-group .ctrl-btn {
  border-radius: 0;
  background: transparent;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.ctrl-btn-group .ctrl-btn.active {
  background: transparent;
  color: #e8eaed;
}
.ctrl-btn-group .ctrl-btn.off {
  background: #ea4335;
  color: #fff;
}
.ctrl-btn-chevron {
  width: 22px;
  min-width: 22px;
  height: 48px;
  border: none;
  background: transparent;
  color: #9aa0a6;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.2s, background 0.2s;
}
.ctrl-btn-chevron:hover {
  color: #e8eaed;
  background: rgba(255,255,255,0.08);
}

/* --- Bottom control bar --- */
#control-bar-wrap {
  flex-shrink: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) 16px;
  display: flex;
  justify-content: center;
}

#control-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #202124;
  border-radius: 30px;
  padding: 8px 10px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
#control-bar::-webkit-scrollbar {
  display: none;
}

.ctrl-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 19px;
  background: #3c4043;
  color: #e8eaed;
  flex-shrink: 0;
}

.ctrl-btn.active {
  background: #8ab4f8;
  color: #202124;
}
.ctrl-btn.off {
  background: #ea4335;
  color: #fff;
}
#btn-hand.active {
  background: #fdd663;
  color: #202124;
}
.ctrl-btn.danger {
  background: #ea4335;
  color: #fff;
  width: 64px;
  border-radius: 24px;
}

@media (max-width: 480px) {
  #top-left {
    font-size: 12px;
  }
  #thumbnail-strip .p-tile {
    width: 92px;
    height: 70px;
  }
  .ctrl-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 17px;
  }
  .ctrl-btn.danger {
    width: 56px;
  }
}
/* ===== Share Materi: picker modal (kayak gambar1) ===== */
#materi-picker-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#materi-picker-overlay.visible {
  display: flex;
}

#materi-picker-box {
  background: #2d2e30;
  border-radius: 16px;
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#materi-picker-header {
  padding: 18px 20px 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#materi-picker-header h2 {
  font-size: 17px;
}
#materi-picker-close {
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 20px;
  cursor: pointer;
}

#materi-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
#materi-tabs::-webkit-scrollbar {
  display: none;
}

.materi-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #5f6368;
  background: transparent;
  color: #e8eaed;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.materi-tab.active {
  background: #8ab4f8;
  color: #202124;
  border-color: #8ab4f8;
}

#materi-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.materi-card {
  cursor: pointer;
  text-align: center;
}
.materi-card-thumb {
  background: #4a4d51;
  border-radius: 10px;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid transparent;
}
.materi-card.selected .materi-card-thumb {
  border-color: #8ab4f8;
}
.materi-card-title {
  font-size: 12px;
  margin-top: 6px;
  color: #e8eaed;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#materi-picker-footer {
  padding: 14px 20px;
}
#materi-share-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 24px;
  background: #8ab4f8;
  color: #202124;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
#materi-share-btn:disabled {
  background: #555;
  color: #ccc;
  cursor: not-allowed;
}

/* ===== Share Materi: viewer overlay (kayak gambar2) ===== */
#materi-viewer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Sisakan ruang untuk control bar di bawah (control bar ~48px + padding ~20px + safe-area) */
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  background: #202124;
  z-index: 40;
  flex-direction: column;
  padding: 12px;
}
#materi-viewer-overlay.visible {
  display: flex;
}

#materi-viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  flex-shrink: 0;
}
#materi-viewer-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#materi-draw-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.materi-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #3c4043;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.materi-tool-btn.active {
  background: #8ab4f8;
}
.materi-color-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.materi-color-btn.active {
  border-color: #fff;
}

#materi-stop-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #3c4043;
  border: none;
  color: #f28b82;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

#materi-viewer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
}

#materi-content {
  flex: 1;
  min-width: 0;
  background: #111;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#materi-canvas-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}
/* Penerima (bukan presenter) gak boleh scroll manual sama sekali --
     posisinya cuma boleh berubah lewat sync dari presenter. JS scrollTop
     tetap jalan normal walau overflow:hidden, cuma input manual (wheel/jari/
     scrollbar) yang diblokir. */
#materi-canvas-wrap.viewer-locked {
  overflow: hidden;
}
/* Kontainer semua halaman PDF ditumpuk vertikal, di-scale bareng buat zoom */
#materi-pages-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  transform-origin: top center;
  transition: transform 0.12s ease-out;
}
.materi-page-canvas {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}
/* Canvas gambar nutupin SELURUH tinggi dokumen (bukan cuma 1 halaman/viewport),
     jadi coretan ikut ke-scroll & ke-zoom bareng kontennya secara alami. */
#materi-draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* default tembus klik, cuma aktif kalau mode gambar nyala */
  touch-action: auto;
}
#materi-draw-canvas.draw-active {
  pointer-events: auto;
  cursor: crosshair;
  /* Jangan biarkan touchscreen melakukan scroll/pan
     ketika sedang menggambar */
  touch-action: none;
}

#materi-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px;
  background: #1a1a1a;
}
#materi-nav button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #3c4043;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
#materi-nav button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
#materi-zoom-label {
  font-size: 13px;
  color: #9aa0a6;
  min-width: 50px;
  text-align: center;
}

#materi-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #2d2e30;
  border-radius: 16px;
  overflow-y: auto;
  padding: 10px;
}
.materi-participant-card {
  width: 100%;
  aspect-ratio: 4/3;
  margin-bottom: 8px;
}

@media (max-width: 700px) {
  #materi-viewer-body {
    flex-direction: column;
  }
  #materi-sidebar {
    width: 100%;
    max-height: 130px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  .materi-participant-card {
    flex-shrink: 0;
    width: 130px;
    margin-bottom: 0;
  }
}

/* ===== SCREEN SHARE VIEWER (meniru tampilan materi viewer) ===== */
#screen-share-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Sisakan ruang untuk control bar di bawah (sama seperti materi-viewer-overlay) */
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  background: #202124;
  z-index: 40;
  flex-direction: column;
  padding: 12px;
}
#screen-share-overlay.visible {
  display: flex;
}

#screen-share-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  flex-shrink: 0;
}
#screen-share-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#screen-share-stop-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #3c4043;
  border: none;
  color: #f28b82;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

#screen-share-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
}

#screen-share-content {
  flex: 1;
  min-width: 0;
  background: #111;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#screen-share-content video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#screen-share-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #2d2e30;
  border-radius: 16px;
  overflow-y: auto;
  padding: 10px;
}
#screen-share-sidebar .p-tile {
  width: 100%;
  aspect-ratio: 4/3;
  margin-bottom: 8px;
}

@media (max-width: 700px) {
  #screen-share-body {
    flex-direction: column;
  }
  #screen-share-sidebar {
    width: 100%;
    max-height: 130px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  #screen-share-sidebar .p-tile {
    flex-shrink: 0;
    width: 130px;
    margin-bottom: 0;
  }
}

/* ============================================================
   SIDEBAR PESERTA (panel kanan, daftar peserta meeting)
   ============================================================ */
#participant-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1200;
}

#participant-sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

#participant-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 320px;
  max-width: 100vw;
  background: #202124;
  border-left: 1px solid #3c4043;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1300;
  display: flex;
  flex-direction: column;
}

#participant-sidebar.open {
  transform: translateX(0);
}

.participant-sidebar-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #3c4043;
}

.participant-sidebar-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #e8eaed;
}

.participant-sidebar-header h3 small {
  font-size: 12px;
  font-weight: 400;
  color: #9aa0a6;
  margin-left: 6px;
}

#participant-sidebar-close {
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 50%;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

#participant-sidebar-close:hover {
  background: #3c4043;
  color: #e8eaed;
}

#participant-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.participant-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #2d2e30;
  transition: background 0.2s ease;
}

.participant-item:hover {
  background: #3c4043;
}

.participant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #202124;
  text-transform: uppercase;
  user-select: none;
}

.participant-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.participant-name {
  font-size: 14px;
  font-weight: 500;
  color: #e8eaed;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.participant-badge.host {
  background: #fbbc04;
  color: #202124;
}

.participant-badge.participant {
  background: #5f6368;
  color: #e8eaed;
}

.participant-status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.participant-status-icons .status-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #e8eaed;
}

.participant-status-icons .status-icon.muted {
  background: #ea4335;
}

.participant-status-icons .status-icon.off {
  background: #ea4335;
}

.participant-status-icons .status-icon.on {
  background: #3a3c3e;
}

/* Tombol titik 3 untuk dropdown aksi */
.participant-more-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 50%;
  color: #9aa0a6;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.participant-more-btn:hover {
  background: #5f6368;
  color: #e8eaed;
}

.participant-more-btn.active {
  background: #5f6368;
  color: #e8eaed;
}

/* Dropdown aksi peserta */
.participant-dropdown {
  position: absolute;
  right: 8px;
  top: calc(100% + 4px);
  min-width: 180px;
  background: #2d2e30;
  border: 1px solid #3c4043;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 6px;
  display: none;
  z-index: 20;
}

.participant-dropdown.open {
  display: block;
}

.participant-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: none;
  color: #e8eaed;
  font-size: 13px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.participant-dropdown button:hover {
  background: #3c4043;
}

.participant-dropdown button.danger {
  color: #f28b82;
}

.participant-dropdown button.danger:hover {
  background: rgba(234, 67, 53, 0.15);
}

/* Bar aksi massal host (Mute Semua, Lower Hand Semua) */
.participant-actions-bar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #3c4043;
  flex-shrink: 0;
}

.btn-participant-action {
  flex: 1;
  background: #3c4043;
  color: #e8eaed;
  border: none;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s;
}

.btn-participant-action:hover {
  background: #5f6368;
}

.participant-dropdown .dropdown-divider {
  height: 1px;
  background: #3c4043;
  margin: 5px 8px;
}

/* Count peserta di top-bar jadi tombol yang bisa diklik */
.count-participant {
  cursor: pointer;
  user-select: none;
  transition:
    background-color 0.2s ease,
    transform 0.15s ease;
}

.count-participant:hover {
  background-color: #4a4949;
}

.count-participant:active {
  transform: scale(0.96);
}

.count-participant .chevron-icon {
  font-size: 10px;
  color: #9aa0a6;
  transition: transform 0.3s ease;
}

.count-participant.open .chevron-icon {
  transform: rotate(180deg);
}

/* Mobile: sidebar sedikit lebih sempit biar area utama tetap kelihatan */
@media (max-width: 700px) {
  #participant-sidebar {
    width: 85vw;
  }
}

/* ============================================================
   SIDEBAR CHAT
   ============================================================ */
#chat-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#chat-sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

#chat-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 380px;
  max-width: 100vw;
  background: #202124;
  border-left: 1px solid #3c4043;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

#chat-sidebar.open {
  transform: translateX(0);
}

.chat-sidebar-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #3c4043;
  background: #2d2e30;
}

.chat-sidebar-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #e8eaed;
}

#chat-sidebar-close {
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

#chat-sidebar-close:hover {
  background: #3c4043;
  color: #e8eaed;
}

/* Area daftar pesan */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #5f6368 transparent;
}

#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #5f6368;
  border-radius: 3px;
}

/* Satu pesan: avatar + bubble */
.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  color: #202124;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.chat-bubble {
  max-width: 78%;
  background: #3c4043;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 8px 12px;
  word-break: break-word;
}

.chat-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.chat-sender {
  font-size: 12px;
  font-weight: 600;
  color: #8ab4f8;
}

.chat-time {
  font-size: 10px;
  color: #9aa0a6;
  flex-shrink: 0;
}

.chat-text {
  font-size: 14px;
  color: #e8eaed;
  line-height: 1.45;
  white-space: pre-wrap;
}

/* Pesan sendiri: dibalik ke kanan */
.chat-msg.own {
  flex-direction: row-reverse;
}

.chat-msg.own .chat-bubble {
  background: #1a73e8;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
}

.chat-msg.own .chat-sender {
  color: #d2e3fc;
}

.chat-msg.own .chat-time {
  color: rgba(255, 255, 255, 0.7);
}

.chat-msg.system {
  justify-content: center;
}

.chat-system {
  font-size: 12px;
  color: #9aa0a6;
  background: #2d2e30;
  padding: 4px 12px;
  border-radius: 999px;
}

/* Input bar */
.chat-input-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #3c4043;
  background: #2d2e30;
}

#chat-input {
  flex: 1;
  min-width: 0;
  background: #3c4043;
  border: 1px solid transparent;
  border-radius: 22px;
  color: #e8eaed;
  font-size: 14px;
  padding: 9px 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

#chat-input::placeholder {
  color: #9aa0a6;
}

#chat-input:focus {
  border-color: #8ab4f8;
}

#chat-send-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

#chat-send-btn:hover {
  background: #1765cc;
}

#chat-send-btn:active {
  transform: scale(0.94);
}

/* Tombol chat di control bar ikut aktif saat sidebar terbuka */
#btn-chat.open {
  background: #1a73e8;
  color: #fff;
}

/* Badge unread chat di tombol chat */
#chat-unread-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ea4335;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  display: inline-block;
  box-shadow: 0 0 0 2px #202124;
}
#chat-unread-badge[hidden] {
  display: none;
}

#btn-chat {
  position: relative;
}

/* Toast notifikasi chat */
.chat-toast {
  background: #2d2e30;
  border: 1px solid #3c4043;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  max-width: 320px;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}
.chat-toast:hover {
  background: #3c4043;
}
.chat-toast .toast-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  color: #202124;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-toast .toast-body {
  min-width: 0;
}
.chat-toast .toast-name {
  font-size: 12px;
  font-weight: 600;
  color: #8ab4f8;
}
.chat-toast .toast-text {
  font-size: 13px;
  color: #e8eaed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 230px;
}

/* Mobile: chat sidebar ikut melebar */
@media (max-width: 700px) {
  #chat-sidebar {
    width: 85vw;
  }
}

/* ============================================================
   MEETING LOADING OVERLAY
   Overlay fullscreen hitam dengan tulisan "Menghubungkan..."
   yang muncul saat join meeting (instant atau scheduled)
   ============================================================ */
.meeting-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.meeting-loading-overlay.show {
  opacity: 1;
}

.meeting-loading-content {
  text-align: center;
  color: white;
}

.meeting-loading-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--hamim-green, #28a745);
  border-radius: 50%;
  animation: meeting-loading-spin 1s linear infinite;
}

@keyframes meeting-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.meeting-loading-text {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.5px;
}
