/* Le HTML est écrit en chinois : on ne peint rien tant que boot.js et applyLanguage()
   n'ont pas tranché la langue, sinon un lecteur anglophone voit un flash de chinois.
   boot.js retire la classe au bout de 2 s au cas où client.js ne se chargerait pas. */
html.i18n-pending body {
  visibility: hidden;
}
:root {
  --bg-dark: #111111;
  --bg-panel: #1a1a1a;
  --bg-button: #333333;
  --bg-button-hover: #444444;
  --text-main: #ffffff;
  --border-color: #2a2a2a;
  --accent: #0e78f9;
  --danger: #ff4a4a;
  --success: #1faa63;
}
body, html {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  height: 100dvh;
  overflow: hidden;
}
.screen {
  display: none;
  height: 100dvh;
  flex-direction: column;
}
.screen.active {
  display: flex;
}
#landing, #join, #create, #schedule, #recap, #prejoin, #password, #waiting {
  justify-content: center;
  align-items: center;
  background: var(--bg-dark);
  overflow-y: auto;
  padding: 20px 0;
  box-sizing: border-box;
}
.card {
  position: relative;
  background: var(--bg-panel);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
}
.card h1 {
  margin-top: 0;
  font-size: 1.8rem;
  color: var(--text-main);
  margin-bottom: 6px;
}
.landing-tagline {
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}
.landing-desc {
  margin: 0 0 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #b5b5b5;
}
.landing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  text-align: left;
  font-size: 0.85rem;
  color: #b5b5b5;
}
.landing-features li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  line-height: 1.5;
}
.landing-features li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  font-size: 0.85rem;
  color: #b5b5b5;
  cursor: pointer;
  margin: 2px 0 14px;
  user-select: none;
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
.password-setup {
  display: none;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-bottom: 6px;
}
.password-setup.show {
  display: block;
}
.password-setup input[type="text"] {
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: 2px;
  font-size: 1.05rem;
}
.password-setup button {
  margin-bottom: 4px;
}
.room-password {
  display: none;
  font-size: 0.82rem;
  color: #b5b5b5;
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.landing-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  line-height: 1.6;
  color: #8a8a8a;
}
button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 15px;
}
button:active {
  opacity: 0.8;
}
input[type="text"] {
  background: var(--bg-dark);
  color: var(--text-main);
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  outline: none;
}
input[type="text"]:focus {
  border-color: var(--accent);
}
.main-layout {
  position: relative;
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: hidden;
  height: calc(100dvh - 70px);
  width: 100vw;
}

.stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#main-view-container {
  display: none;
  flex: 1;
  min-height: 0;
  background: #000;
  position: relative;
}

.stage-action {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 40;
  width: auto;
  margin: 0;
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(26, 26, 26, 0.75);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
@media (hover: hover) and (pointer: fine) {
  #main-view-container:hover .stage-action {
    opacity: 1;
  }
}
@media (hover: none) {
  .stage-action {
    display: none;
  }
}
.stage-action svg {
  width: 18px;
  height: 18px;
  display: block;
}

#room.is-fullscreen {
  width: 100vw;
  height: 100vh;
}
#room.is-fullscreen .stage-action {
  opacity: 1;
}

.screen-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Screen capture is full-range RGB but mediasoup cannot forward the WebRTC
   color-space header extension, so receivers may render the limited-range
   (16-235) luma without expanding it, which looks washed out. Uncomment to
   compensate; remove it again if blacks end up crushed. */
/*
.screen-wrapper video {
  filter: contrast(1.164);
}
*/

.video-grid {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg-dark);
  align-content: center;
  justify-content: center;
}

.video-grid:not(.filmstrip) > .video-wrapper,
.video-grid:not(.filmstrip) > .screen-wrapper {
  flex: 0 0 auto;
  width: var(--tile-w, 100%);
  height: var(--tile-h, 100%);
}

.video-grid.filmstrip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-content: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  height: 132px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--border-color);
}

.video-grid.filmstrip .video-wrapper {
  flex: 0 0 auto;
  width: 196px;
  height: 110px;
  border-radius: 8px;
  outline: none;
}

.video-grid:not(.filmstrip) > .video-wrapper {
  outline: 1px solid rgba(255, 255, 255, 0.07);
  outline-offset: -1px;
}

.video-grid.filmstrip .video-avatar {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
}

.video-grid.filmstrip .badge-quality,
.video-grid.filmstrip .tile-hand {
  display: none;
}

.video-grid.filmstrip {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-button) transparent;
}
.video-grid.filmstrip::-webkit-scrollbar {
  height: 6px;
}
.video-grid.filmstrip::-webkit-scrollbar-track {
  background: transparent;
}
.video-grid.filmstrip::-webkit-scrollbar-thumb {
  background: var(--bg-button);
  border-radius: 3px;
}

#room.filmstrip-active #roomCodeBadge,
#room.filmstrip-active .view-switch {
  top: 147px;
}

.video-grid.layout-speaker {
  display: grid;
  grid-template-columns: 1fr 250px;
  grid-auto-rows: 150px;
  align-content: start;
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mirror-video {
  transform: scaleX(-1);
}

.video-name-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-mic {
  display: none;
  color: var(--danger);
}
.badge-mic svg {
  width: 14px;
  height: 14px;
  display: block;
}
.video-wrapper.mic-off .badge-mic {
  display: block;
}
.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
  z-index: 5;
}
.video-wrapper:not(.cam-off) .video-placeholder {
  display: none;
}
.video-wrapper.cam-off video {
  visibility: hidden;
}
.video-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-button);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text-main);
  user-select: none;
}
.video-wrapper.speaking::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 3px solid var(--success);
  border-radius: 8px;
  pointer-events: none;
  z-index: 20;
}
.badge-quality {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  margin-left: 2px;
  pointer-events: auto;
  cursor: default;
}
.q-bar {
  width: 3px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.22);
}
.q-bar:nth-child(1) { height: 4px; }
.q-bar:nth-child(2) { height: 6px; }
.q-bar:nth-child(3) { height: 9px; }
.q-bar:nth-child(4) { height: 12px; }
.badge-quality[data-level="1"] .q-bar:nth-child(-n+1) { background: var(--danger); }
.badge-quality[data-level="2"] .q-bar:nth-child(-n+2) { background: #ffb020; }
.badge-quality[data-level="3"] .q-bar:nth-child(-n+3) { background: #3ddc84; }
.badge-quality[data-level="4"] .q-bar:nth-child(-n+4) { background: #3ddc84; }
.quality-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  flex-direction: column;
  gap: 3px;
  background: rgba(10, 10, 10, 0.96);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-main);
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  z-index: 60;
}
.badge-quality:hover .quality-tip {
  display: flex;
}
/* Une ligne vide n'occupe pas de place dans l'info-bulle */
.quality-tip span:empty {
  display: none;
}
.video-wrapper.main-stage {
  aspect-ratio: auto;
  height: 100%;
  max-width: none;
  max-height: none;
}
.video-grid > .screen-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.sidebar {
  width: 320px;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
}
.sidebar.hidden {
  display: none;
}
.chat-box {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-message {
  background: var(--bg-button);
  padding: 10px 14px;
  border-radius: 8px;
  align-self: flex-start;
  max-width: 90%;
  word-wrap: break-word;
}
.chat-message-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.chat-message strong {
  color: var(--accent);
  font-size: 0.85rem;
}
.chat-message a {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}
.chat-message.chat-system {
  align-self: stretch;
  max-width: 100%;
  background: transparent;
  border: 1px dashed var(--border-color);
}
.chat-message.chat-system strong {
  color: var(--text-muted);
}
.chat-time {
  font-size: 0.7rem;
  color: #8a8a8a;
  flex-shrink: 0;
}
.resume-share {
  display: none;
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 10px;
  background: rgba(26, 26, 26, 0.97);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  z-index: 90;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.resume-share.show {
  display: flex;
}
#room.filmstrip-active .resume-share {
  top: 147px;
}
#topBanners {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 30px);
  z-index: 90;
}
.top-banner {
  display: none;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 0;
  padding: 9px 14px;
  background: rgba(26, 26, 26, 0.97);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.top-banner.show {
  display: flex;
}
.top-banner:hover {
  background: rgba(42, 42, 42, 0.97);
}
.top-banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent);
}
/* Bandeau d'enregistrement : visible par tous les participants, non cliquable */
.recording-banner {
  border-left-color: var(--danger);
  cursor: default;
}
.recording-banner:hover {
  background: rgba(26, 26, 26, 0.97);
}
.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  animation: recording-pulse 1.6s ease-in-out infinite;
}
@keyframes recording-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) {
  .recording-dot {
    animation: none;
  }
}
/* Bouton d'enregistrement : pastille au repos, carré « stop » pendant la capture */
#btnRecord .record-square {
  display: none;
}
#btnRecord.recording .record-dot {
  display: none;
}
#btnRecord.recording .record-square {
  display: block;
}
#btnRecord.recording,
#btnRecord.recording svg {
  color: var(--danger);
}
#btnRecord:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#btnRecordPause .resume-icon {
  display: none;
}
#btnRecordPause.paused .pause-icon {
  display: none;
}
#btnRecordPause.paused .resume-icon {
  display: block;
}
/* Durée écoulée, en chiffres tabulaires pour éviter le sautillement */
.recording-time {
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}
.recording-banner.paused .recording-dot {
  animation: none;
  opacity: 0.45;
}
#room.filmstrip-active #topBanners {
  top: 147px;
}
#room:has(.resume-share.show) #topBanners {
  top: 66px;
}
@media (max-width: 680px) {
  #topBanners {
    left: 15px;
    right: 15px;
    transform: none;
    align-items: stretch;
    max-width: none;
  }
  .top-banner {
    justify-content: center;
  }
  #room:has(.top-banner.show) #roomCodeBadge,
  #room:has(.top-banner.show) .view-switch {
    top: 59px;
  }
  #room:has(.top-banner.show + .top-banner.show) #roomCodeBadge,
  #room:has(.top-banner.show + .top-banner.show) .view-switch {
    top: 103px;
  }
  #room.filmstrip-active:has(.top-banner.show) #roomCodeBadge,
  #room.filmstrip-active:has(.top-banner.show) .view-switch {
    top: 191px;
  }
  #room.filmstrip-active:has(.top-banner.show + .top-banner.show) #roomCodeBadge,
  #room.filmstrip-active:has(.top-banner.show + .top-banner.show) .view-switch {
    top: 235px;
  }
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.icon-btn:focus-visible,
.badge-action:focus-visible,
.stage-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.chat-compose {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 15px 15px 20px;
  flex-shrink: 0;
}
#chat-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  border-radius: 8px;
  padding: 14px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  outline: none;
  color: var(--text-main);
}
.chat-send {
  width: 46px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-send:hover {
  filter: brightness(1.1);
}
.chat-send:disabled {
  background: var(--bg-button);
  color: var(--text-muted);
  cursor: default;
  filter: none;
}
.chat-send svg {
  width: 18px;
  height: 18px;
  display: block;
}
.controls {
  background: var(--bg-panel);
  height: 70px;
  border-top: 1px solid var(--border-color);
  display: flex;
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 135;
}
.controls-left, .controls-center {
  display: flex;
  gap: 12px;
}
.controls-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.btn-group {
  display: flex;
  background: var(--bg-button);
  border-radius: 8px;
  align-items: center;
  height: 44px;
}
.btn-group:hover {
  background: var(--bg-button-hover);
}
.btn-group[hidden] {
  display: none;
}
.select-wrapper {
  position: relative;
  height: 100%;
}
.arrow-btn {
  background: transparent;
  padding: 0 10px;
  height: 100%;
  margin: 0;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px 0 0 8px;
}
.arrow-btn svg {
  width: 16px;
  height: 16px;
  color: var(--text-main);
}
.hidden-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}
.icon-btn {
  position: relative;
  background: transparent;
  padding: 0 16px;
  height: 100%;
  margin: 0;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 8px 8px 0;
}
.btn-group > .icon-btn:only-child {
  border-radius: 8px;
}
/* Bouton de gauche dans un groupe fusionné : l'arrondi doit suivre celui du groupe */
.btn-group > .icon-btn:first-child:not(:only-child) {
  border-radius: 8px 0 0 8px;
}
.btn-group > .reaction-wrapper:last-child > .icon-btn {
  border-radius: 0 8px 8px 0;
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  color: var(--text-main);
}
.icon-btn.off {
  color: var(--danger);
}
.icon-btn.off svg {
  color: var(--danger);
}
.icon-btn svg .slash {
  display: none;
}
.icon-btn.off svg .slash {
  display: block;
}
.btn-group.sharing {
  background: var(--danger);
}
.btn-group.sharing .icon-btn,
.btn-group.sharing .icon-btn svg {
  color: white;
}
#roomCodeBadge {
  position: absolute;
  top: 15px;
  left: 15px;
  max-width: calc(100vw - 30px);
  box-sizing: border-box;
  background: rgba(26, 26, 26, 0.8);
  padding: 8px 8px 8px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 50;
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: padding 0.15s ease;
}
.room-badge-lines {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.badge-info {
  display: none;
  width: 19px;
  height: 19px;
  color: var(--text-main);
}
#roomCodeBadge.collapsed {
  padding: 7px;
  gap: 0;
}
#roomCodeBadge.collapsed .room-badge-lines,
#roomCodeBadge.collapsed .badge-action {
  display: none;
}
#roomCodeBadge.collapsed .badge-info {
  display: block;
}
.badge-action {
  width: auto;
  margin: 0;
  padding: 5px 6px;
  border-radius: 5px;
  background: var(--bg-button);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.badge-action:hover {
  background: var(--bg-button-hover);
}
.badge-action svg {
  width: 15px;
  height: 15px;
  display: block;
}
.app-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: var(--danger);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
  pointer-events: none;
  max-width: calc(100vw - 40px);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 400;
}
.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.app-toast.error {
  background: var(--danger);
}
.app-toast.success {
  background: var(--success);
}
.app-toast.info {
  background: var(--accent);
}
.app-toast::before {
  content: "!";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.app-toast.success::before {
  content: "✓";
}
.chat-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(26, 26, 26, 0.96);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 8px;
  max-width: min(360px, calc(100vw - 40px));
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out, visibility 0.25s;
  z-index: 300;
}
.chat-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.chat-toast svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}
.chat-toast-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-toast-sender {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}
.chat-toast-text {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-badge {
  display: none;
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  box-sizing: border-box;
  background: var(--danger);
  color: white;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
}
.chat-badge.show {
  display: block;
}
.reconnect-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(26, 26, 26, 0.96);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  visibility: hidden;
  max-width: calc(100vw - 40px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out, visibility 0.25s;
  z-index: 500;
}
.reconnect-banner.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.reconnect-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--bg-button);
  border-top-color: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: reconnect-spin 0.8s linear infinite;
}
@keyframes reconnect-spin {
  to { transform: rotate(360deg); }
}
.float-top-right {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 50;
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  height: 35px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
}
.float-top-right svg {
  width: 20px;
  height: 20px;
}
.view-switch {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: right 0.2s ease;
}
@media (min-width: 769px) {
  #room:not(.immersive):has(#participants-sidebar:not(.hidden)) .view-switch,
  #room:not(.immersive):has(#chat-sidebar:not(.hidden)) .view-switch {
    right: 336px;
  }
  #room:not(.immersive):has(#participants-sidebar:not(.hidden)):has(#chat-sidebar:not(.hidden)) .view-switch {
    right: 657px;
  }
}
#btnImmersive {
  display: none;
}
#room.immersive .controls,
#room.immersive #roomCodeBadge,
#room.immersive .pager,
#room.immersive #topBanners,
#room.immersive .sidebar,
#room.immersive #btnToggleLayout {
  display: none !important;
}
#room.immersive .main-layout {
  height: 100dvh;
}
.standalone .controls {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.standalone .main-layout {
  height: calc(100dvh - 70px - env(safe-area-inset-bottom, 0px));
}
.standalone .pager {
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
}
.view-switch .float-top-right {
  position: static;
}
.view-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  flex-direction: column;
  gap: 2px;
  min-width: 168px;
  background: rgba(26, 26, 26, 0.98);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 210;
}
.view-menu.show {
  display: flex;
}
.view-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border-radius: 7px;
  background: transparent;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
}
.view-option:hover {
  background: var(--bg-button);
}
/* Vue verrouillée pendant un enregistrement */
.view-option.locked {
  opacity: 0.4;
}
.view-option.active {
  background: var(--accent);
}
.view-option svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
#room.focus-active .stage {
  background: #000;
}
#room.focus-active #roomCodeBadge,
#room.focus-active #topBanners,
#room.focus-active .resume-share {
  top: 15px;
}
.card-wide {
  max-width: 460px;
}
.language-switch {
  position: fixed;
  top: 18px;
  right: 18px;
  width: auto;
  margin: 0;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 10;
}
.language-switch:hover {
  background: var(--bg-button);
}
.card h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}
.btn-secondary {
  background: var(--bg-button);
  margin-bottom: 0;
}
.preview-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
}
.preview-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.preview-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8a8a;
  font-size: 0.9rem;
  background: var(--bg-panel);
}
.preview-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.preview-btn {
  background: var(--bg-button);
  border-radius: 8px !important;
  width: 48px;
  height: 44px;
  padding: 0;
  flex: none;
}
.preview-btn:hover {
  background: var(--bg-button-hover);
}
.meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.meter-label {
  font-size: 0.78rem;
  color: #8a8a8a;
  white-space: nowrap;
}
.meter {
  flex: 1;
  height: 6px;
  background: var(--bg-dark);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: #3ddc84;
  transition: width 0.08s linear;
}
.field-label {
  display: block;
  text-align: left;
  font-size: 0.75rem;
  color: #8a8a8a;
  margin-bottom: 6px;
}
.field-select {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-dark);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 11px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  outline: none;
}
.waiting-preview-box {
  display: none;
  margin-bottom: 4px;
}
.waiting-preview-box video.show {
  display: block;
}
.waiting-preview-box:has(video.show) {
  display: block;
}
.waiting-preview {
  width: 104px;
  height: 59px;
  border-radius: 6px;
  background: #000;
  object-fit: contain;
  flex-shrink: 0;
}
.waiting-section .participant-row {
  flex-wrap: wrap;
  row-gap: 6px;
}
.waiting-section .participant-actions {
  margin-left: auto;
}
.waiting-spinner {
  width: 34px;
  height: 34px;
  margin: 18px auto;
  border: 3px solid var(--bg-button);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: reconnect-spin 0.9s linear infinite;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px 12px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-action {
  width: auto;
  height: 30px;
  margin: 0;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--bg-button);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.sidebar-action:hover {
  background: var(--bg-button-hover);
}
.sidebar-close {
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  background: var(--bg-button);
  color: var(--text-main);
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-close:hover {
  background: var(--bg-button-hover);
}
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  z-index: 600;
}
.modal-backdrop.show {
  display: flex;
}
.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 26px;
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.modal-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.modal-card .landing-desc {
  margin-bottom: 20px;
}
.modal-card .field-select {
  margin-bottom: 20px;
}
.modal-card button {
  margin-top: 0;
  margin-bottom: 15px;
}
.modal-card button:last-child {
  margin-bottom: 0;
}
.btn-danger {
  background: var(--danger);
}
.sidebar-subtitle {
  padding: 10px 16px 6px;
  font-size: 0.75rem;
  color: #8a8a8a;
}
.waiting-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-button);
  border-radius: 21px;
  transition: background 0.2s;
}
.slider::before {
  content: "";
  position: absolute;
  height: 15px;
  width: 15px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.switch input:checked + .slider {
  background: var(--accent);
}
.switch input:checked + .slider::before {
  transform: translateX(17px);
}
.password-section {
  display: none;
  border-bottom: 1px solid var(--border-color);
}
.waiting-toggle-row.no-border {
  border-bottom: none;
}
.password-edit-row {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0 16px 12px;
}
.password-edit-row.show {
  display: flex;
}
.password-edit-row input[type="text"] {
  flex: 1;
  min-width: 0;
  width: auto;
  margin-bottom: 0;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.password-edit-row .participant-action {
  padding: 7px 10px;
  font-size: 0.75rem;
}
.waiting-section {
  display: none;
  border-bottom: 1px solid var(--border-color);
  background: rgba(14, 120, 249, 0.07);
}
.participants-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
}
.participant-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-button);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}
.participant-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.participant-name {
  font-size: 0.87rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.participant-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  flex-shrink: 0;
}
/* Le co-hôte porte la même étiquette que l'hôte, en creux : on doit distinguer
   les deux d'un coup d'œil sans faire croire qu'il y a deux hôtes. */
.participant-tag.co-host {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 1px 5px;
}
/* Renommage en place : l'input remplace le libellé, il doit occuper la même
   largeur sans faire sauter la rangée. */
input[type="text"].participant-rename {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 3px 7px;
  font-size: 0.87rem;
  line-height: 1.3;
  border-radius: 5px;
  background: var(--bg-dark);
  border: 1px solid var(--accent);
  color: var(--text-main);
}
.participant-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.participant-hand {
  font-size: 0.85rem;
}
.participant-state {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.participant-state svg {
  width: 13px;
  height: 13px;
  display: block;
}
.participant-state.on {
  background: var(--bg-button);
  color: #b5b5b5;
}
/* Un indicateur n'est cliquable que dans le sens de l'extinction : sans ce
   repère visuel, rien ne distingue un état d'un bouton. */
.participant-state.actionable {
  cursor: pointer;
}
.participant-state.actionable:hover {
  outline: 1px solid var(--accent);
}
.participant-more {
  all: unset;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b5b5b5;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.participant-more:hover {
  background: var(--bg-button);
  color: var(--text-main);
}
/* Le menu est en position fixe et hors du panneau : à l'intérieur, le
   défilement de la liste le rognerait. */
.participant-menu {
  display: none;
  position: fixed;
  z-index: 400;
  min-width: 160px;
  padding: 5px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}
.participant-menu.show {
  display: block;
}
.participant-menu-item {
  all: unset;
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
}
.participant-menu-item:hover {
  background: var(--bg-button);
}
.participant-menu-item.danger {
  color: var(--danger);
}
.participant-menu-item.danger:hover {
  background: rgba(255, 74, 74, 0.15);
}
.participant-state.off {
  background: rgba(255, 74, 74, 0.18);
  color: var(--danger);
}
/* Jusqu'à quatre actions par rangée depuis les co-hôtes : sans retour à la
   ligne, la colonne déborde du panneau sur écran étroit. */
.participant-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  flex-shrink: 0;
  max-width: 60%;
}
.participant-action {
  width: auto;
  margin: 0;
  padding: 4px 8px;
  font-size: 0.7rem;
  border-radius: 5px;
  background: var(--bg-button);
  color: var(--text-main);
  font-weight: 500;
}
.participant-action.primary {
  background: var(--accent);
}
.participant-action.danger {
  background: rgba(255, 74, 74, 0.2);
  color: var(--danger);
}
.pager {
  display: none;
  position: absolute;
  bottom: 82px;
  right: 20px;
  align-items: center;
  gap: 10px;
  background: rgba(26, 26, 26, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 5px 8px;
  z-index: 60;
  backdrop-filter: blur(4px);
}
.pager.show {
  display: flex;
}
.pager-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  background: var(--bg-button);
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1;
}
.pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.pager-label {
  font-size: 0.8rem;
  min-width: 42px;
  text-align: center;
}
/* Élément de lecture du fichier partagé : hors écran, il alimente le relais canvas */
.file-source {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
/* Lecteur du fichier vidéo partagé : superposé à la tuile, visible du seul partageur */
.file-player {
  display: none;
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 25;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(17, 17, 17, 0.86);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.file-player.show {
  display: flex;
}
/* La barre de lecture occupe le bas de la tuile : on remonte au-dessus d'elle le
   badge de nom, les barres de qualité et le bouton plein écran de la scène, qui
   vivent tous les trois au même endroit. */
.screen-wrapper:has(.file-player.show) .video-name-badge,
.video-wrapper:has(.file-player.show) .video-name-badge {
  bottom: 66px;
}
.stage:has(.file-player.show) .stage-action {
  bottom: 76px;
}
.file-player-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
}
.file-player-btn svg {
  width: 18px;
  height: 18px;
  color: var(--text-main);
}
@media (hover: hover) and (pointer: fine) {
  .file-player-btn:hover {
    background: var(--bg-button);
  }
}
#filePlayPause .player-play {
  display: none;
}
#filePlayPause.paused .player-pause {
  display: none;
}
#filePlayPause.paused .player-play {
  display: block;
}
#btnFileVolume .volume-mute {
  display: none;
}
#btnFileVolume.muted .volume-wave {
  display: none;
}
#btnFileVolume.muted .volume-mute {
  display: block;
}
.file-player-time {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  opacity: 0.85;
  flex-shrink: 0;
}
.file-player-seek {
  flex: 1;
  min-width: 60px;
  height: 4px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-button);
  border-radius: 2px;
  cursor: pointer;
}
.file-player-seek::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.file-player-seek::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.file-volume-wrapper {
  position: relative;
  flex-shrink: 0;
}
.file-volume-panel {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(26, 26, 26, 0.97);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.file-volume-panel.show {
  display: flex;
}
.file-volume-value {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  opacity: 0.85;
}
/* Curseur vertical : writing-mode suffit depuis Chrome 124 / Firefox 129 / Safari 17.4.
   L'ancien -webkit-appearance: slider-vertical est supprimé, il n'est plus standardisé
   et Chrome le signale en dépréciation. Le lecteur de fichier est de toute façon masqué
   là où captureStream n'existe pas, donc sur Safari et iOS. */
.file-volume-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 20px;
  height: 110px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.tile-hidden {
  display: none !important;
}
/* Masquage des tuiles caméra éteinte pendant un enregistrement en vue galerie */
.tile-off-hidden {
  display: none !important;
}
.tile-hand {
  display: none;
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 1.1rem;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  padding: 2px 6px;
  z-index: 12;
}
.video-wrapper.hand-raised .tile-hand {
  display: block;
}
.tile-reactions {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 11;
}
.reaction-float {
  position: absolute;
  bottom: 10%;
  font-size: 1.9rem;
  animation: reaction-rise 2.4s ease-out forwards;
}
@keyframes reaction-rise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { transform: translateY(-10px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-150px) scale(1); opacity: 0; }
}
.reaction-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 100%;
}
.reaction-picker {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  gap: 4px;
  background: rgba(26, 26, 26, 0.97);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 200;
}
.reaction-picker.show {
  display: flex;
}
.reaction-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
}
.reaction-btn:hover {
  background: var(--bg-button);
}
.icon-btn.active-toggle {
  color: var(--accent);
}
.icon-btn.active-toggle svg {
  color: var(--accent);
}
.more-wrapper {
  display: none;
  position: relative;
}
.more-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 20px;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 24px);
  gap: 8px;
  background: rgba(26, 26, 26, 0.98);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 220;
}
.more-menu.show {
  display: flex;
}
@media (max-width: 900px) {
  .more-menu {
    left: 12px;
    right: 12px;
    max-width: none;
  }
}
.more-menu .btn-group {
  width: auto;
  height: 44px;
  flex: 0 0 auto;
  background: var(--bg-button);
  border-radius: 8px !important;
  align-items: center;
  position: relative;
}
.more-menu .btn-group:hover {
  background: var(--bg-button-hover);
}
.more-menu .icon-btn {
  width: auto;
  height: 100%;
  padding: 0 14px;
  border-radius: 8px !important;
  flex: none;
}
.more-menu .icon-btn svg {
  width: 20px;
  height: 20px;
}
.more-menu .reaction-picker {
  left: auto;
  right: 0;
  transform: none;
}
.chat-badge.dot {
  display: block;
  min-width: 9px;
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  top: 6px;
  right: 6px;
}

@media (max-width: 768px) {
  .controls {
    padding: 0 10px;
    justify-content: center;
    gap: 10px;
  }
  
  .controls-left, .controls-center {
    position: static !important;
    transform: none !important;
    display: flex;
    gap: 10px;
    flex: initial !important;
  }
  
  .arrow-btn {
    padding: 0 6px;
  }

  .arrow-btn svg {
    width: 14px;
    height: 14px;
  }

  .btn-group {
    height: 44px;
    flex-shrink: 0;
    border-radius: 8px !important;
  }
  
  .controls .icon-btn {
    padding: 0 14px;
    border-radius: 8px !important;
    width: 100%;
    height: 100%;
  }
  
  .controls .icon-btn svg {
    width: 20px;
    height: 20px;
  }

  .sidebar {
    width: 100%;
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 150;
  }

  .sidebar-close {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .sidebar-action {
    height: 36px;
  }
}

@media (max-width: 900px) {
  .controls-center {
    position: static;
    transform: none;
  }
  .controls {
    gap: 10px;
  }
}

@media (max-width: 680px) {
  .controls {
    padding: 0 8px;
    gap: 8px;
  }

  .controls-left, .controls-center {
    gap: 8px;
  }

  .controls .icon-btn {
    padding: 0 12px;
  }

  .more-menu .btn-group {
    height: 44px;
  }

  .more-menu .icon-btn {
    width: auto;
    padding: 0 14px;
  }

  .pager {
    bottom: 78px;
    right: 12px;
  }
}

@media (max-width: 400px) {
  .controls {
    padding: 0 6px;
    gap: 6px;
  }

  .controls-left, .controls-center {
    gap: 6px;
  }

  .controls .icon-btn {
    padding: 0 10px;
  }

  .arrow-btn {
    padding: 0 5px;
  }
}

@media (max-width: 330px) {
  .controls-left .select-wrapper,
  .controls-left .divider {
    display: none;
  }
}

.tool-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 70px;
  z-index: 120;
  flex-direction: column;
  background: var(--bg-dark);
}
.tool-overlay.show {
  display: flex;
}
#room.immersive .tool-overlay {
  bottom: 0;
}
.standalone .tool-overlay {
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}
#room {
  --tool-panel-w: 55vw;
}
.tool-resizer {
  display: none;
  position: absolute;
  top: 0;
  bottom: 70px;
  width: 11px;
  z-index: 130;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}
.tool-resizer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 46px;
  border-radius: 2px;
  background: var(--border-color);
  transition: background 0.15s;
}
.tool-resizer:hover::after,
.tool-resizer.dragging::after {
  background: var(--accent);
}
#room.immersive .tool-resizer {
  bottom: 0;
}
.standalone .tool-resizer {
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
  #room.tool-docked .main-layout {
    width: calc(100vw - var(--tool-panel-w));
  }
  #room.tool-docked .tool-overlay {
    left: auto;
    width: var(--tool-panel-w);
    border-left: 1px solid var(--border-color);
  }
  #room.tool-docked .tool-resizer {
    display: block;
    right: calc(var(--tool-panel-w) - 5px);
  }
}

.cam-dock {
  display: none;
  position: absolute;
  z-index: 140;
  width: 188px;
  max-height: calc(100dvh - 96px);
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(18, 18, 18, 0.92);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  touch-action: none;
}
#room.cam-dock-active .cam-dock:not(.minimized) {
  display: flex;
}
.cam-dock.dragging {
  opacity: 0.85;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7);
}
.cam-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 2px 8px;
  flex: none;
  cursor: grab;
  background: rgba(255, 255, 255, 0.05);
}
.cam-dock.dragging .cam-dock-header {
  cursor: grabbing;
}
.cam-dock-grip svg {
  width: 16px;
  height: 16px;
  display: block;
  color: #8b8b8b;
}
.cam-dock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
}
.cam-dock-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.cam-dock-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}
.cam-dock-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.cam-dock-body .video-wrapper {
  flex: none;
  width: 100%;
  height: 101px;
  border-radius: 7px;
  overflow: hidden;
}
@media (max-height: 660px) {
  .cam-dock-body .video-wrapper {
    height: 74px;
  }
}
.cam-dock-body .video-avatar {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}
.cam-dock-body .badge-quality,
.cam-dock-body .tile-hand {
  display: none;
}
.cam-dock-body .video-name-badge {
  bottom: 4px;
  left: 4px;
  padding: 2px 5px;
  font-size: 0.7rem;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cam-dock-restore {
  display: none;
  position: absolute;
  z-index: 140;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(18, 18, 18, 0.92);
  color: var(--text-main);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  touch-action: none;
}
#room.cam-dock-active .cam-dock.minimized + .cam-dock-restore {
  display: flex;
}
.cam-dock-restore.dragging {
  opacity: 0.85;
}
.cam-dock-restore svg {
  width: 20px;
  height: 20px;
  display: block;
}
.cam-dock-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  line-height: 18px;
  text-align: center;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  flex: none;
}
.tool-header-icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--text-main);
}
.tool-header-title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}
.tool-header-status {
  font-size: 0.78rem;
  color: #8b8b8b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-header-btn,
.canvas-rail-btn,
.canvas-thumb,
.canvas-thumb-remove,
.canvas-tool,
.wb-tool,
.wb-shape-option,
.wb-mini,
.wb-swatch {
  margin: 0;
  box-sizing: border-box;
  flex: none;
}
.tool-header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: var(--bg-button);
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}
.tool-header-btn:hover {
  background: var(--bg-button-hover);
}
.tool-header-btn svg {
  width: 17px;
  height: 17px;
}
.tool-header-icon-btn {
  width: 34px;
  padding: 0;
  justify-content: center;
  font-size: 1rem;
}
.tool-header-btn:focus-visible,
.canvas-tool:focus-visible,
.canvas-rail-btn:focus-visible,
.wb-tool:focus-visible,
.wb-mini:focus-visible,
.canvas-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tool-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
}

.canvas-rail {
  width: 108px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 10px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  box-sizing: border-box;
}
.canvas-rail.collapsed {
  width: 46px;
  padding: 12px 5px;
}
.canvas-rail.collapsed .canvas-thumbs {
  display: none;
}
.canvas-thumbs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.canvas-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  flex: none;
}
.canvas-thumb.active {
  border-color: var(--accent);
}
.canvas-thumb-preview {
  position: absolute;
  inset: 0;
  padding: 4px 5px;
  font-size: 3px;
  line-height: 1.5;
  color: #444444;
  text-align: left;
  overflow: hidden;
  word-break: break-word;
}
.canvas-thumb-number {
  position: absolute;
  left: 0;
  bottom: 0;
  min-width: 16px;
  padding: 1px 4px;
  border-radius: 0 6px 0 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 0.7rem;
}
.canvas-thumb-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.canvas-thumb:hover .canvas-thumb-remove,
.canvas-thumb.active .canvas-thumb-remove {
  opacity: 1;
}
.canvas-thumb-remove.armed {
  background: var(--danger);
  opacity: 1;
}
.canvas-rail-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.canvas-rail.collapsed .canvas-rail-actions {
  flex-direction: column;
}
.canvas-rail-btn {
  flex: 1;
  width: auto;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: var(--bg-button);
  color: var(--text-main);
  cursor: pointer;
}
.canvas-rail-btn:hover {
  background: var(--bg-button-hover);
}
.canvas-rail-btn svg {
  width: 18px;
  height: 18px;
}
.canvas-rail.collapsed #btnCanvasCollapse svg {
  transform: scaleX(-1);
}
.canvas-main {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}
.canvas-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: thin;
}
.canvas-tool-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
  border-right: 1px solid var(--border-color);
  flex: none;
}
.canvas-tool-group:last-child {
  border-right: none;
  padding-right: 0;
}
.canvas-tool {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
}
.canvas-tool:hover {
  background: var(--bg-button);
}
.canvas-tool.active {
  background: var(--accent);
}
.canvas-tool svg {
  width: 18px;
  height: 18px;
}
.canvas-color input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  border: none;
  padding: 0;
  cursor: pointer;
}
.canvas-color-swatch {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: #111111;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}
.canvas-color svg {
  width: 16px;
  height: 16px;
}
.canvas-tool:disabled {
  opacity: 0.35;
  cursor: default;
}
.canvas-tool:disabled:hover {
  background: transparent;
}
.canvas-size-select {
  height: 34px;
  min-width: 96px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--bg-button);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.canvas-file-input {
  display: none;
}
.canvas-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  box-sizing: border-box;
}
.canvas-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  min-height: 100%;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 6px;
  box-sizing: border-box;
  cursor: text;
}
#toolExportDialog .modal-card {
  padding: 30px;
}
#toolExportDialog h2 {
  margin-bottom: 12px;
}
#toolExportDialog .landing-desc {
  margin-bottom: 24px;
}
.export-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.export-row + #btnToolExportDone {
  margin-top: 14px;
}
#btnToolExportDone {
  margin-bottom: 0;
}
.export-row svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.canvas-editor {
  flex: 1 0 auto;
  padding: 48px 52px;
  color: #1c1c1c;
  font-size: 17px;
  line-height: 1.7;
  outline: none;
  box-sizing: border-box;
  word-break: break-word;
}
.canvas-empty {
  position: absolute;
  top: 48px;
  left: 52px;
  right: 52px;
  pointer-events: none;
  color: #8a8f98;
}
.canvas-empty.hidden {
  display: none;
}
.canvas-empty-title {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.7;
}
.canvas-empty-desc {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
}
.canvas-editor h1 {
  font-size: 30px;
  margin: 0.5em 0 0.3em;
}
.canvas-editor h2 {
  font-size: 23px;
  margin: 0.5em 0 0.3em;
}
.canvas-editor ul,
.canvas-editor ol {
  margin: 0.3em 0;
  padding-left: 1.6em;
}
.canvas-editor table {
  border-collapse: collapse;
  margin: 0.6em 0;
  width: 100%;
}
.canvas-editor td {
  border: 1px solid #c9ced6;
  padding: 6px 9px;
  min-width: 40px;
  vertical-align: top;
}
.canvas-editor img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.6em 0;
  border-radius: 4px;
}
.canvas-editor hr {
  border: none;
  border-top: 1px solid #d7dbe0;
  margin: 1em 0;
}
.canvas-editor .cz-1 { font-size: 13px; }
.canvas-editor .cz-2 { font-size: 17px; }
.canvas-editor .cz-3 { font-size: 22px; }
.canvas-editor .cz-4 { font-size: 30px; }
.canvas-table-menu {
  display: none;
  position: absolute;
  z-index: 20;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}
.canvas-table-menu.show {
  display: flex;
}
.canvas-table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: #b5b5b5;
  white-space: nowrap;
}
.canvas-table-row input {
  width: 68px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--bg-button);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.canvas-table-menu button {
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 7px;
}

.whiteboard-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  touch-action: none;
}
#whiteboardCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
.whiteboard-stage[data-tool="pan"] #whiteboardCanvas { cursor: grab; }
.whiteboard-stage[data-tool="select"] #whiteboardCanvas { cursor: default; }
.whiteboard-stage[data-tool="text"] #whiteboardCanvas { cursor: text; }
.whiteboard-stage[data-tool="laser"] #whiteboardCanvas { cursor: pointer; }
.whiteboard-stage.dragging #whiteboardCanvas { cursor: grabbing; }
.wb-rail {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d9dde3;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.wb-tool {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #4a5059;
  cursor: pointer;
}
.wb-tool:hover {
  background: #eef1f5;
}
.wb-tool.active {
  background: #e5f0ff;
  color: var(--accent);
}
.wb-tool.armed {
  background: var(--danger);
  color: #ffffff;
}
.wb-tool svg {
  width: 19px;
  height: 19px;
}
.wb-shape-menu {
  display: none;
  position: absolute;
  left: 62px;
  top: 50%;
  transform: translateY(-50%);
  gap: 2px;
  padding: 5px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d9dde3;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.wb-shape-menu.show {
  display: flex;
}
.wb-shape-option {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #4a5059;
  cursor: pointer;
}
.wb-shape-option:hover {
  background: #eef1f5;
}
.wb-shape-option.active {
  background: #e5f0ff;
  color: var(--accent);
}
.wb-shape-option svg {
  width: 18px;
  height: 18px;
}
.wb-options {
  display: none;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d9dde3;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  max-width: calc(100% - 28px);
  flex-wrap: wrap;
  justify-content: center;
}
.wb-options.show {
  display: flex;
}
.wb-swatches {
  display: flex;
  gap: 6px;
}
.wb-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
}
.wb-swatch.active {
  border-color: #333a44;
}
.wb-width-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wb-width-label {
  font-size: 0.78rem;
  color: #5b616b;
}
#wbWidth {
  width: 110px;
  accent-color: var(--accent);
}
.wb-bottom-bar {
  position: absolute;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d9dde3;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.wb-bottom-left {
  left: 14px;
}
.wb-bottom-right {
  right: 14px;
}
.wb-bottom-divider {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: #dde1e7;
}
.wb-mini {
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #4a5059;
  cursor: pointer;
}
.wb-mini:hover {
  background: #eef1f5;
}
.wb-mini:disabled {
  opacity: 0.35;
  cursor: default;
}
.wb-mini.armed {
  background: var(--danger);
  color: #ffffff;
}
.wb-mini svg {
  width: 16px;
  height: 16px;
}
.wb-zoom-label {
  min-width: 44px;
  text-align: center;
  font-size: 0.78rem;
  color: #4a5059;
  font-variant-numeric: tabular-nums;
}
.wb-text-input {
  display: none;
  position: absolute;
  z-index: 5;
  min-width: 140px;
  padding: 4px 6px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
  color: #111111;
  font-family: inherit;
  line-height: 1.25;
  resize: none;
  overflow: hidden;
  outline: none;
}
.wb-text-input.show {
  display: block;
}

@media (max-width: 900px) {
  .canvas-editor {
    padding: 28px 24px;
  }
  .canvas-empty {
    top: 28px;
    left: 24px;
    right: 24px;
  }
  .canvas-scroll {
    padding: 10px;
  }
}

@media (max-width: 680px) {
  .tool-header {
    padding: 8px 10px;
    gap: 8px;
  }
  .tool-header-status {
    display: none;
  }
  .tool-header-btn span {
    display: none;
  }
  .tool-header-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
  .canvas-rail {
    width: 74px;
    padding: 8px 6px;
  }
  .canvas-rail.collapsed {
    width: 40px;
  }
  .canvas-editor {
    padding: 20px 16px;
    font-size: 16px;
  }
  .canvas-empty {
    top: 20px;
    left: 16px;
    right: 16px;
  }
  .canvas-empty-title,
  .canvas-empty-desc {
    font-size: 16px;
  }
  .canvas-scroll {
    padding: 0;
  }
  .canvas-sheet {
    border-radius: 0;
  }
  .wb-rail {
    left: 8px;
    padding: 3px;
  }
  .wb-tool {
    width: 32px;
    height: 32px;
  }
  .wb-shape-menu {
    left: 48px;
  }
  .wb-bottom-left {
    left: 8px;
  }
  .wb-bottom-right {
    right: 8px;
    bottom: 62px;
  }
  .wb-options {
    top: 8px;
    gap: 8px;
    padding: 6px 10px;
  }
  #wbWidth {
    width: 80px;
  }
}

/* Salles permanentes : la liste est purement locale, le navigateur se souvient des
   codes créés sur cette machine. Le serveur, lui, ne connaît que la réservation. */
/* ------------------------------------------------------------------ *
   Accueil : mes réunions programmées
 * ------------------------------------------------------------------ */

/* Le repli de la liste est un lien, pas un bouton : trois boutons pleins
   se disputaient déjà l'attention juste au-dessus. */
.link-button {
  all: unset;
  display: block;
  width: 100%;
  margin: 20px 0 0;
  padding: 4px 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--accent);
  cursor: pointer;
}
.link-button:hover {
  text-decoration: underline;
}
/* display: block ci-dessus l'emporte sur le display: none que le navigateur
   applique à [hidden] : sans cette règle, le lien reste visible à 0 réunion. */
.link-button[hidden] {
  display: none;
}
.my-meetings {
  text-align: left;
}
.my-meetings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.my-meeting {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-dark);
}
/* La prochaine réunion à venir est encadrée : c'est la seule information que
   l'on cherche vraiment en ouvrant la page. */
.my-meeting.next {
  border-color: var(--accent);
  background: rgba(14, 120, 249, 0.12);
}
/* Le bloc d'informations rouvre le récapitulatif : c'est un bouton, il doit
   donc perdre l'apparence de bouton sans perdre l'affordance. */
.my-meeting-info {
  all: unset;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-main);
}
.my-meeting-info:hover {
  background: rgba(255, 255, 255, 0.05);
}
.my-meeting-when {
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: capitalize;
}
.my-meeting.next .my-meeting-when {
  font-weight: 600;
}
.my-meeting-label {
  font-size: 1rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-meeting-code {
  font-size: 0.85rem;
  color: #8a8a8a;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
/* Mêmes boutons pleins que « Join meeting », simplement côte à côte. */
.my-meeting-actions {
  display: flex;
  gap: 10px;
}
.my-meeting-actions button {
  flex: 1;
  margin: 0;
  padding: 11px 12px;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------ *
   Programmation d'une réunion
 * ------------------------------------------------------------------ */

.datetime-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.datetime-row .field-select {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  cursor: pointer;
}
.time-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.time-row .field-select {
  flex: 0 0 auto;
  width: auto;
  padding-right: 8px;
  font-variant-numeric: tabular-nums;
}
.time-sep {
  color: #8a8a8a;
  font-weight: 600;
}
.datetime-row .field-select::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.7);
}
/* Cocher « fixe » grise la date au lieu de la masquer : on doit voir que le
   choix existe et pourquoi il ne s'applique plus. */
#scheduleWhen.disabled {
  opacity: 0.4;
  pointer-events: none;
}
input.locked {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-danger {
  background: rgba(255, 74, 74, 0.18);
  color: var(--danger);
}
/* Rythme des écrans d'accueil : 20 px entre le dernier champ et le premier
   bouton, 15 px entre boutons empilés, 0 sur le dernier (.btn-secondary). */
#schedule .landing-hint,
#landing .landing-hint {
  margin: 20px 0 0;
}
#schedule .landing-hint {
  margin-bottom: 20px;
}
#create .checkbox-row:last-of-type {
  margin-bottom: 20px;
}
.my-meetings {
  margin: 14px 0 0;
}

/* ------------------------------------------------------------------ *
   Récapitulatif
 * ------------------------------------------------------------------ */

.pending-host-key {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}
.pending-host-key[hidden] {
  display: none;
}
/* L'invitation à saisir le mot de passe hôte est seule dans une carte centrée :
   un libellé aligné à gauche y paraît décroché. */
.pending-host-key .field-label {
  text-align: center;
}
.pending-host-key input[type="text"] {
  text-align: center;
  letter-spacing: 2px;
  font-size: 1.05rem;
  margin-bottom: 15px;
}
.recap-block[hidden] {
  display: none;
}
.recap-block {
  text-align: left;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
/* Le bloc « à ne pas diffuser » doit se distinguer au premier regard du bloc
   destiné aux participants, sinon les deux se ressemblent trop. */
.recap-private {
  border-color: rgba(255, 74, 74, 0.4);
  background: rgba(255, 74, 74, 0.06);
}
.recap-block-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.recap-hint {
  margin: 0 0 12px;
  font-size: 0.75rem;
  line-height: 1.6;
  color: #8a8a8a;
}
.recap-warn {
  color: var(--danger);
}
.recap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--border-color);
}
.recap-row[hidden] {
  display: none;
}
.recap-label {
  flex-shrink: 0;
  width: 100px;
  font-size: 0.75rem;
  color: #8a8a8a;
}
.recap-value {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}
.recap-link {
  font-size: 0.78rem;
  letter-spacing: 0;
  color: #b5b5b5;
}
.recap-copy {
  all: unset;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-button);
  color: var(--text-main);
  cursor: pointer;
}
.recap-copy svg {
  width: 14px;
  height: 14px;
}
.recap-copy:hover {
  background: var(--bg-button-hover);
}
/* Le texte d'invitation complet est une action à part : il n'appartient à
   aucune ligne, il les résume toutes. */
.recap-invite {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  margin-top: 12px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--bg-button);
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
}
.recap-invite svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.recap-invite:hover {
  background: var(--bg-button-hover);
}
@media (max-width: 520px) {
  .recap-label {
    width: 74px;
  }
}
@media (hover: hover) and (pointer: fine) {
  .my-room:hover {
    border-color: var(--accent);
  }
  .my-room .my-room-forget:hover {
    color: var(--danger);
  }
}
