.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: url("/icons/icon.svg") center / contain no-repeat;
  flex: 0 0 auto;
}

.settings-avatar-button {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.settings-avatar-button {
  width: 72px;
  height: 72px;
}

.settings-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.avatar-remove-button {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  color: #fff3f3;
  background: var(--red);
  border: 2px solid #0e141c;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.avatar-remove-button[hidden] {
  display: none;
}

.avatar-remove-button .button-icon {
  width: 13px;
  height: 13px;
}

.settings-avatar-button:focus-visible {
  outline: 3px solid rgba(78, 161, 255, 0.36);
  outline-offset: 3px;
}

.profile-avatar-preview {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  color: #06120d;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  background:
    linear-gradient(135deg, rgba(38, 208, 124, 0.95), rgba(78, 161, 255, 0.92)),
    #26d07c;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.profile-avatar-preview.large {
  width: 72px;
  height: 72px;
  font-size: 24px;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.brand-copy {
  display: grid;
  gap: 2px;
  align-items: center;
  min-width: 0;
}

.brand-copy strong,
.room-title-row,
.room-original-label {
  grid-column: 1;
}

.room-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#roomLabel {
  display: block;
  max-width: 54vw;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-original-label {
  max-width: 54vw;
  color: rgba(159, 173, 189, 0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.room-rename-button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.room-rename-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.room-rename-button .button-icon {
  width: 15px;
  height: 15px;
}

.ghost-button,
.status-badge,
.primary-button,
.control-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.danger-button {
  color: #fff3f3;
  border-color: rgba(255, 107, 107, 0.42);
}

.danger-button:not(:disabled):hover {
  border-color: rgba(255, 107, 107, 0.72);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.primary-button,
.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-icon,
.control-icon {
  display: block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.icon-button .button-icon,
.tile-action .button-icon {
  width: 20px;
  height: 20px;
}

.recent-room-icon-button .button-icon {
  width: 17px;
  height: 17px;
}

.icon-link {
  --icon-url: url("/icons/ui/link.svg");
}

.icon-settings {
  --icon-url: url("/icons/ui/settings.svg");
}

.icon-users {
  --icon-url: url("/icons/ui/users.svg");
}

.icon-log-out {
  --icon-url: url("/icons/ui/log-out.svg");
}

.icon-chart-no-axes-combined {
  --icon-url: url("/icons/ui/chart-no-axes-combined.svg");
}

.icon-paperclip {
  --icon-url: url("/icons/ui/paperclip.svg");
}

.icon-smile {
  --icon-url: url("/icons/ui/smile.svg");
}

.icon-send {
  --icon-url: url("/icons/ui/send.svg");
}

.icon-x {
  --icon-url: url("/icons/ui/x.svg");
}

.icon-maximize-2 {
  --icon-url: url("/icons/ui/maximize-2.svg");
}

.icon-minimize-2 {
  --icon-url: url("/icons/ui/minimize-2.svg");
}

.icon-minus {
  --icon-url: url("/icons/ui/minus.svg");
}

.icon-rotate-ccw {
  --icon-url: url("/icons/ui/rotate-ccw.svg");
}

.icon-trash-2 {
  --icon-url: url("/icons/ui/trash-2.svg");
}

.icon-pin {
  --icon-url: url("/icons/ui/pin.svg");
}

.icon-pin-off {
  --icon-url: url("/icons/ui/pin-off.svg");
}

.icon-pencil {
  --icon-url: url("/icons/ui/pencil.svg");
}

.icon-copy {
  --icon-url: url("/icons/ui/copy.svg");
}

.icon-eye {
  --icon-url: url("/icons/ui/eye.svg");
}

.icon-eye-off {
  --icon-url: url("/icons/ui/eye-off.svg");
}

.icon-panel-right-open {
  --icon-url: url("/icons/ui/panel-right-open.svg");
}

.icon-panel-right-close {
  --icon-url: url("/icons/ui/panel-right-close.svg");
}

.button-icon.icon-mic {
  --icon-url: url("/icons/ui/mic.svg");
}

.icon-mic-off {
  --icon-url: url("/icons/ui/mic-off.svg");
}

.icon-volume-2 {
  --icon-url: url("/icons/ui/volume-2.svg");
}

.icon-volume-x {
  --icon-url: url("/icons/ui/volume-x.svg");
}

.icon-video {
  --icon-url: url("/icons/ui/video.svg");
}

.icon-video-off {
  --icon-url: url("/icons/ui/video-off.svg");
}

.icon-monitor-up {
  --icon-url: url("/icons/ui/monitor-up.svg");
}

.icon-record {
  --icon-url: url("/icons/ui/record-circle.svg");
}

.status-badge {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
}

.status-badge[data-state="online"] {
  color: #08130d;
  background: var(--green);
  border-color: var(--green);
}

.status-badge[data-state="connecting"] {
  color: #1b1202;
  background: var(--amber);
  border-color: var(--amber);
}

.status-badge {
  display: none;
}

body.show-call-stats .status-badge {
  display: inline-flex;
}

.toast {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 45;
  width: max-content;
  max-width: min(280px, calc(100vw - 32px));
  padding: 9px 12px;
  color: #06120d;
  background: var(--green);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.manual-copy-popover {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 120;
  display: grid;
  gap: 9px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px;
  color: var(--text);
  background: rgba(13, 18, 26, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.manual-copy-popover input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 10px;
  color: var(--text);
  background: #0e141c;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
}

.manual-copy-popover .ghost-button {
  min-height: 38px;
}

.profile-gate-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;
  color: var(--text);
  background: rgba(13, 18, 26, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.profile-gate-dialog:not([open]) {
  display: none;
}

.profile-gate-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.profile-gate-card {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.profile-gate-card .brand {
  padding-bottom: 4px;
}

.profile-gate-card .primary-button {
  min-height: 46px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.video-tile {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #05070a;
  box-shadow: var(--shadow);
  --zoom: 1;
  --pan-x: 0px;
  --pan-y: 0px;
}

.video-tile.is-pip {
  cursor: grab;
}

.video-tile video {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  grid-row: 1;
  object-fit: contain;
  object-position: center center;
  background: #05070a;
  transform: translate(var(--pan-x), var(--pan-y)) scale(var(--zoom));
  transform-origin: center center;
  will-change: transform;
}

.focus-layout .video-tile {
  min-height: 0;
}

.focus-layout .video-tile.is-featured {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.focus-layout .video-tile.is-featured video {
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.focus-layout .video-tile.is-pip {
  position: absolute;
  right: 18px;
  bottom: var(--pip-offset, 18px);
  z-index: 4;
  width: clamp(168px, 22vw, 280px);
  aspect-ratio: 16 / 9;
  min-height: 0;
  border-color: rgba(78, 161, 255, 0.48);
  touch-action: none;
  user-select: none;
}

.focus-layout .video-tile.is-pip.is-dragging {
  cursor: grabbing;
  z-index: 8;
}

.focus-layout .video-tile.is-pip.is-resizing {
  cursor: nwse-resize;
  z-index: 9;
}

.focus-layout .video-tile.is-pip video {
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.tile-strip-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  background: rgba(8, 12, 18, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.tile-strip-panel[hidden] {
  display: none;
}

.tile-strip-header {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tile-strip-header strong {
  color: var(--text);
  font-size: 13px;
}

.tile-strip-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.tile-strip-list .video-tile.is-pip {
  position: relative;
  left: auto !important;
  top: auto !important;
  right: auto;
  bottom: auto;
  z-index: 1;
  width: 100%;
  min-height: 118px;
  aspect-ratio: 16 / 9;
  cursor: default;
  touch-action: manipulation;
  transform: none;
}

.tile-strip-list .video-tile.is-pip video {
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.tile-strip-list .video-tile.is-pip .tile-footer {
  min-height: 30px;
  margin: 6px 7px 7px;
  padding: 5px 7px;
  font-size: 12px;
}

.tile-strip-list .video-tile.is-pip .tile-action {
  width: 30px;
  height: 30px;
}

.tile-strip-list .video-tile.is-pip .expand-button {
  top: 7px;
  left: 7px;
}

.tile-strip-list .video-tile.is-pip .hide-button {
  top: 7px;
  left: 43px;
}

.tile-strip-list .video-tile.is-pip .tile-resize-handle {
  display: none;
}

.video-tile.is-hidden-tile {
  display: none;
}

.video-tile[data-state="connecting"] video {
  opacity: 0.42;
}

.video-tile::before {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0 0 48px;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 24px;
  text-align: center;
  pointer-events: none;
}

.video-tile.has-video::before {
  content: "";
}

.tile-action {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--text);
  background: rgba(8, 12, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.tile-action:hover {
  background: rgba(28, 36, 48, 0.92);
}

.expand-button {
  top: 10px;
  left: 10px;
  font-size: 18px;
  line-height: 1;
}

.hide-button {
  top: 10px;
  left: 56px;
}

.hide-button .button-icon {
  width: 20px;
  height: 20px;
}

.hide-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.zoom-reset-button {
  top: 56px;
  left: 10px;
  display: none;
  font-size: 18px;
  line-height: 1;
}

.tile-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: none;
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 0 45%, rgba(255, 255, 255, 0.74) 45% 55%, transparent 55% 100%);
  border: 0;
  border-radius: 0 0 8px 0;
  opacity: 0.78;
}

.focus-layout .video-tile.is-pip .tile-resize-handle {
  display: block;
}

.tile-resize-handle:hover {
  opacity: 1;
}

.hidden-tile-dock {
  position: absolute;
  left: 18px;
  bottom: 88px;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(420px, calc(100% - 36px));
  pointer-events: auto;
}

.hidden-tile-dock[hidden] {
  display: none;
}

.hidden-tile-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
  background: rgba(8, 12, 18, 0.84);
  border: 1px solid rgba(78, 161, 255, 0.58);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hidden-tile-button:hover {
  background: rgba(28, 36, 48, 0.95);
}

.video-tile.is-fullscreen .zoom-reset-button,
.video-tile:fullscreen .zoom-reset-button {
  display: grid;
}

.video-tile.is-fullscreen.is-zoomed,
.video-tile:fullscreen.is-zoomed {
  cursor: grab;
}

.video-tile.is-panning,
.video-tile.is-panning video {
  cursor: grabbing;
}

.tile-footer {
  position: relative;
  z-index: 3;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  margin: 8px 10px 10px;
  padding: 6px 9px;
  color: var(--text);
  background: rgba(8, 12, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.tile-footer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-footer span:last-child {
  color: var(--muted);
  flex: 0 0 auto;
}

.whiteboard-tile {
  --whiteboard-ink: #172033;
  --whiteboard-muted: #64748b;
  --whiteboard-panel: rgba(15, 23, 42, 0.96);
  --whiteboard-accent: #4ea1ff;
  background: #dfe5ec;
}

.whiteboard-tile::before {
  content: "";
}

.whiteboard-shell {
  position: relative;
  grid-row: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.1) 25%, transparent 25%, transparent 75%, rgba(148, 163, 184, 0.1) 75%),
    linear-gradient(45deg, rgba(148, 163, 184, 0.1) 25%, transparent 25%, transparent 75%, rgba(148, 163, 184, 0.1) 75%),
    #e7ebf0;
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
  container-type: size;
  isolation: isolate;
}

.whiteboard-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  color: var(--whiteboard-ink);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16), 0 16px 38px rgba(15, 23, 42, 0.18);
  touch-action: none;
}

.whiteboard-viewport::after {
  content: "Отпустите изображение, чтобы добавить";
  position: absolute;
  inset: 14px;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #eff7ff;
  font-size: clamp(16px, 2.1cqw, 26px);
  font-weight: 750;
  text-align: center;
  background: rgba(15, 35, 58, 0.78);
  border: 3px dashed rgba(78, 161, 255, 0.88);
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
  transition: opacity 120ms ease, transform 120ms ease;
}

.whiteboard-viewport.is-image-dragover::after {
  opacity: 1;
  transform: scale(1);
}

@container (min-aspect-ratio: 16 / 9) {
  .whiteboard-viewport {
    width: auto;
    height: 100%;
  }
}

.whiteboard-surface {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--whiteboard-ink);
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.whiteboard-surface.is-selecting {
  cursor: default;
}

.whiteboard-surface.is-panning {
  cursor: grabbing;
}

.tile-strip-list .whiteboard-tile .whiteboard-viewport {
  pointer-events: none;
}

.tile-strip-list .whiteboard-tile .whiteboard-surface {
  cursor: default;
}

.tile-strip-list .whiteboard-tile .whiteboard-tool-rail {
  display: none;
}

.whiteboard-tool-rail {
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  z-index: 18;
  display: flex;
  align-items: center;
  max-height: none;
  color: var(--text);
}

.whiteboard-tool-toggle {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 52px;
  padding: 0;
  color: var(--text);
  background: rgba(8, 12, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0 10px 10px 0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  touch-action: manipulation;
}

.whiteboard-tool-toggle::before {
  content: "›";
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  transition: transform 160ms ease;
}

.whiteboard-tool-rail:hover .whiteboard-tool-toggle::before,
.whiteboard-tool-rail:focus-within .whiteboard-tool-toggle::before,
.whiteboard-tool-rail.is-open .whiteboard-tool-toggle::before {
  transform: rotate(180deg);
}

.whiteboard-tool-drawer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 12px;
  width: min(304px, calc(100vw - 92px));
  width: min(304px, calc(100cqw - 12px), calc(100vw - 92px));
  max-height: none;
  padding: 12px 12px 12px 54px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  background: var(--whiteboard-panel);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  overscroll-behavior: contain;
  transform: translateX(-12px);
  transition: opacity 150ms ease, transform 150ms ease;
  scrollbar-width: thin;
}

.whiteboard-tool-drawer[hidden] {
  display: none;
}

.whiteboard-tool-rail:hover .whiteboard-tool-drawer,
.whiteboard-tool-rail:focus-within .whiteboard-tool-drawer,
.whiteboard-tool-rail.is-open .whiteboard-tool-drawer,
.whiteboard-tool-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

@container (max-width: 420px) {
  .whiteboard-tool-grid,
  .whiteboard-palette,
  .whiteboard-actions {
    grid-template-columns: repeat(2, minmax(40px, 1fr));
  }
}

.whiteboard-tool-section {
  display: grid;
  gap: 8px;
}

.whiteboard-tool-section > strong,
.whiteboard-tool-section > label,
.whiteboard-tool-label {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.whiteboard-tool-grid,
.whiteboard-palette,
.whiteboard-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.whiteboard-action-stack {
  display: grid;
  gap: 9px;
}

.whiteboard-tool-button,
.whiteboard-color-button,
.whiteboard-action-button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  touch-action: manipulation;
}

.whiteboard-button-icon {
  display: block;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  background: currentColor;
  -webkit-mask: var(--whiteboard-icon) center / contain no-repeat;
  mask: var(--whiteboard-icon) center / contain no-repeat;
}

.whiteboard-tool-button .whiteboard-button-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}

.whiteboard-download-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  color: #eaf4ff;
  font-size: 13px;
  font-weight: 750;
  background: rgba(78, 161, 255, 0.16);
  border: 1px solid rgba(78, 161, 255, 0.58);
  border-radius: 8px;
  touch-action: manipulation;
}

.whiteboard-download-button:hover {
  background: rgba(78, 161, 255, 0.26);
  border-color: rgba(78, 161, 255, 0.9);
}

.whiteboard-image-input {
  display: none;
}

.whiteboard-button-label {
  min-width: 0;
}

.whiteboard-tool-button:hover,
.whiteboard-color-button:hover,
.whiteboard-action-button:hover,
.whiteboard-tool-button.is-active,
.whiteboard-color-button.is-active,
.whiteboard-action-button.is-active {
  background: rgba(78, 161, 255, 0.2);
  border-color: rgba(78, 161, 255, 0.78);
}

.whiteboard-tool-button.is-active,
.whiteboard-color-button.is-active {
  box-shadow: inset 0 0 0 1px rgba(78, 161, 255, 0.32);
}

.whiteboard-color-button {
  min-height: 36px;
  background: var(--whiteboard-color, #111827);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.whiteboard-color-button:hover,
.whiteboard-color-button.is-active {
  background: var(--whiteboard-color, #111827);
  box-shadow: 0 0 0 2px var(--whiteboard-accent), inset 0 0 0 2px rgba(255, 255, 255, 0.86);
}

.whiteboard-tool-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 12px;
}

.whiteboard-tool-range input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: var(--whiteboard-accent);
}

.whiteboard-preview {
  display: grid;
  place-items: center;
  min-height: 38px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.whiteboard-selection {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  border: 2px solid var(--whiteboard-accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.82);
}

.whiteboard-text-editor {
  position: absolute;
  z-index: 24;
  min-width: 90px;
  min-height: 38px;
  padding: 4px 6px;
  overflow: hidden;
  color: var(--whiteboard-ink);
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid var(--whiteboard-accent);
  border-radius: 4px;
  outline: none;
  resize: none;
  touch-action: manipulation;
}

.whiteboard-status {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 12;
  max-width: calc(100% - 72px);
  padding: 6px 9px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.78);
  border-radius: 7px;
  font-size: 12px;
  pointer-events: none;
}

.whiteboard-modal {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--text);
  background: rgba(2, 6, 12, 0.7);
  backdrop-filter: blur(5px);
}

.whiteboard-modal[hidden] {
  display: none;
}

.whiteboard-modal-card {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  max-height: 100%;
  padding: 18px;
  overflow: auto;
  background: #111823;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.whiteboard-modal-card h2,
.whiteboard-modal-card p {
  margin: 0;
}

.whiteboard-modal-card p {
  color: var(--muted);
  line-height: 1.45;
}

.whiteboard-modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.room-lobby-heading {
  display: grid;
  gap: 8px;
}

.room-lobby-header {
  display: grid;
  gap: 8px;
}

.room-lobby-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 4px;
}

.lobby-action-button {
  min-height: 42px;
  padding: 0 12px;
}

.room-lobby-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
}

.room-lobby-heading p,
.recent-room-empty {
  margin: 0;
  color: var(--muted);
}

.room-lobby-form label,
.join-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.recent-rooms {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.recent-room-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.recent-room-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  background: #101720;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.recent-room-card.is-pinned {
  border-color: rgba(38, 208, 124, 0.62);
}

.recent-room-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
}

.recent-room-main strong,
.recent-room-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-room-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.recent-room-meta small {
  color: var(--muted);
  font-size: 12px;
}

.recent-room-actions {
  display: flex;
  gap: 6px;
}

.recent-room-icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 17px;
  line-height: 1;
}

.recent-room-card:hover,
.recent-room-icon-button:hover {
  border-color: rgba(78, 161, 255, 0.72);
}

.recent-room-icon-button.danger:hover {
  color: #fff3f3;
  border-color: rgba(255, 107, 107, 0.72);
}

.settings-panel {
  padding: 12px;
  background: rgba(13, 18, 26, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-panel summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  list-style: none;
}

.settings-panel summary::-webkit-details-marker {
  display: none;
}

.settings-panel summary::after {
  content: "";
  float: right;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.settings-panel[open] summary {
  margin-bottom: 12px;
}

.settings-panel[open] summary::after {
  margin-top: 8px;
  transform: rotate(225deg);
}

.settings-dialog {
  width: min(640px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 28px));
  max-height: min(620px, calc(100svh - 28px));
  padding: 0;
  overflow: visible;
  color: var(--text);
  background: rgba(13, 18, 26, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.settings-dialog:not([open]) {
  display: none;
}

.settings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
}

.settings-dialog-card {
  display: grid;
  gap: 14px;
  max-height: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

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

.settings-dialog-header h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.settings-dialog-header .icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.settings-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(38, 208, 124, 0.08), transparent 44%),
    var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.settings-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(10, 15, 22, 0.64);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.settings-group-heading {
  display: grid;
  gap: 2px;
}

.settings-group-heading strong {
  color: var(--text);
  font-size: 13px;
}

.settings-group-heading span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.settings-devices {
  grid-template-columns: 1fr 1fr;
}

.settings-devices .settings-group-heading {
  grid-column: 1 / -1;
}

.settings-devices .device-setting {
  align-self: start;
}

.microphone-control-bar,
.microphone-noise-status,
.microphone-test-meter,
.microphone-test-status,
#microphoneTestAudio {
  grid-column: 1 / -1;
}

.microphone-control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.microphone-test-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 210px;
  gap: 8px;
  width: auto;
  min-height: 42px;
  margin: 0;
}

.microphone-noise-toggle {
  flex: 0 0 auto;
  min-height: 42px;
  margin: 0;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.035);
}

.microphone-noise-status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.microphone-noise-status[hidden] {
  display: none;
}

.microphone-noise-status.is-error {
  color: #ff9b9b;
}

.microphone-test-button .button-icon {
  width: 18px;
  height: 18px;
}

.microphone-test-button.is-active {
  color: #fff3f3;
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.62);
}

.microphone-test-meter {
  --microphone-test-level: 0%;
  --microphone-gate-threshold-position: 8.333333%;
  display: grid;
  gap: 5px;
  margin-top: 2px;
}

.microphone-test-meter[hidden] {
  display: none;
}

.microphone-test-meter-heading,
.microphone-test-meter-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.microphone-test-meter-heading {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.microphone-test-meter-heading output {
  min-width: 52px;
  color: #dce8f6;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.microphone-test-meter-control {
  position: relative;
  height: 18px;
}

.microphone-test-meter-track {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(58, 211, 140, 0.18) 0 80%,
    rgba(255, 197, 74, 0.2) 80% 90%,
    rgba(255, 91, 91, 0.2) 90% 100%
  );
  border: 1px solid rgba(179, 201, 224, 0.18);
  border-radius: 4px;
}

.microphone-test-meter-fill,
.microphone-test-meter-segments,
.microphone-gate-threshold {
  position: absolute;
  inset: 0;
}

.microphone-test-meter-fill,
.microphone-test-meter-segments {
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.microphone-test-meter-fill {
  background: linear-gradient(
    90deg,
    #39d58d 0 80%,
    #ffc44a 80% 90%,
    #ff5959 90% 100%
  );
  clip-path: inset(0 calc(100% - var(--microphone-test-level)) 0 0);
  transition: clip-path 80ms linear;
}

.microphone-test-meter-segments {
  background: repeating-linear-gradient(
    90deg,
    transparent 0 8px,
    rgba(11, 18, 28, 0.88) 8px 10px
  );
}

.microphone-gate-threshold-marker {
  position: absolute;
  z-index: 3;
  top: -4px;
  bottom: -4px;
  left: var(--microphone-gate-threshold-position);
  width: 2px;
  background: #f4f8ff;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 24, 36, 0.86), 0 0 8px rgba(137, 195, 255, 0.72);
  pointer-events: none;
  transform: translateX(-1px);
}

.microphone-test-meter.is-gate-open .microphone-gate-threshold-marker {
  background: #39d58d;
  box-shadow: 0 0 0 1px rgba(15, 24, 36, 0.86), 0 0 10px rgba(57, 213, 141, 0.88);
}

.microphone-gate-threshold {
  z-index: 4;
  width: 100%;
  height: 26px;
  margin: -4px 0 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.microphone-gate-threshold::-webkit-slider-runnable-track {
  height: 18px;
  background: transparent;
}

.microphone-gate-threshold::-webkit-slider-thumb {
  width: 12px;
  height: 26px;
  margin-top: -4px;
  appearance: none;
  background: rgba(244, 248, 255, 0.16);
  border: 1px solid rgba(244, 248, 255, 0.92);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(15, 24, 36, 0.72);
}

.microphone-gate-threshold::-moz-range-track {
  height: 18px;
  background: transparent;
  border: 0;
}

.microphone-gate-threshold::-moz-range-thumb {
  width: 12px;
  height: 26px;
  background: rgba(244, 248, 255, 0.16);
  border: 1px solid rgba(244, 248, 255, 0.92);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(15, 24, 36, 0.72);
}

.microphone-gate-threshold:focus-visible {
  outline: 2px solid rgba(125, 190, 255, 0.92);
  outline-offset: 5px;
  border-radius: 4px;
}

.microphone-test-meter.is-clipping .microphone-test-meter-track {
  border-color: rgba(255, 91, 91, 0.78);
  box-shadow: 0 0 0 2px rgba(255, 91, 91, 0.12);
}

.microphone-test-meter-legend {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 10px;
  line-height: 1;
}

.microphone-test-meter-legend output {
  color: #dce8f6;
  font-variant-numeric: tabular-nums;
}

.microphone-test-meter-legend span:nth-child(2) {
  color: color-mix(in srgb, var(--muted) 92%, transparent);
}

.microphone-test-meter-legend span:last-child {
  color: rgba(255, 121, 121, 0.82);
}

@media (prefers-reduced-motion: reduce) {
  .microphone-test-meter-fill {
    transition: none;
  }
}

.microphone-test-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.microphone-test-status.is-active {
  color: #82eab3;
}

.microphone-test-status.is-error {
  color: #ff9b9b;
}

.profile-logout-icon-button {
  align-self: center;
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  color: #fff3f3;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.42);
  border-radius: 50%;
}

.profile-logout-icon-button:hover {
  background: rgba(255, 107, 107, 0.18);
  border-color: rgba(255, 107, 107, 0.68);
}

.profile-logout-icon-button .button-icon {
  width: 18px;
  height: 18px;
}

.profile-name-field {
  min-width: 0;
  position: relative;
}

.profile-name-status {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 90;
  width: max-content;
  max-width: min(240px, calc(100vw - 44px));
  padding: 7px 10px;
  color: #06120d;
  background: var(--green);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.profile-name-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.profile-name-status.is-pending {
  color: var(--text);
  background: rgba(28, 36, 48, 0.98);
  border-color: var(--line);
}

.profile-name-status.is-error {
  color: #fff3f3;
  background: rgba(255, 107, 107, 0.18);
  border-color: rgba(255, 107, 107, 0.58);
}

.profile-id-field,
.profile-token-field,
.profile-token-status {
  grid-column: 1 / -1;
}

.profile-id-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.profile-id-row.has-two-actions {
  grid-template-columns: minmax(0, 1fr) 42px 42px;
}

.profile-id-value {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(159, 173, 189, 0.34);
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.profile-id-value:empty::before {
  content: "создается после входа";
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.profile-secret-value.is-hidden {
  user-select: none;
}

.profile-display-icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-display-icon-button:hover {
  background: rgba(78, 161, 255, 0.16);
  border-color: rgba(78, 161, 255, 0.52);
}

.profile-display-icon-button .button-icon {
  width: 18px;
  height: 18px;
}

.profile-token-row,
.profile-gate-token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.profile-inline-field {
  position: relative;
  display: block;
}

.profile-inline-field input {
  box-sizing: border-box;
  width: 100%;
  padding-right: 52px;
}

.profile-inline-field.has-two-actions input {
  padding-right: 106px;
}

.profile-inline-icon-button {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 8px;
  transform: translateY(-50%);
}

.profile-inline-icon-button:hover {
  background: rgba(78, 161, 255, 0.16);
  border-color: rgba(78, 161, 255, 0.52);
}

.profile-inline-icon-button .button-icon {
  width: 18px;
  height: 18px;
}

.profile-inline-field.has-two-actions .profile-inline-icon-button:first-of-type {
  right: 46px;
}

.profile-inline-field.has-two-actions .profile-inline-icon-button:last-of-type {
  right: 6px;
}

.profile-gate-token-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.profile-token-row input,
.profile-gate-token-row input {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.profile-token-status {
  color: var(--muted);
  font-size: 12px;
}

.profile-token-status:empty {
  display: none;
}

.profile-token-status.is-error {
  color: var(--red);
}

.room-rename-dialog {
  width: min(420px, calc(100vw - 28px));
}

.room-rename-note {
  color: var(--muted);
  font-size: 12px;
}

.room-rename-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
}

.profile-gate-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.profile-gate-divider::before,
.profile-gate-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.profile-avatar-input {
  display: none;
}

.avatar-crop-dialog {
  width: min(390px, calc(100vw - 24px));
  padding: 0;
  color: var(--text);
  background: rgba(13, 18, 26, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.avatar-crop-dialog:not([open]) {
  display: none;
}

.avatar-crop-dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(4px);
}

.avatar-crop-card {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.avatar-crop-frame {
  position: relative;
  width: min(300px, calc(100vw - 70px));
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  touch-action: none;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25% 75%, rgba(255, 255, 255, 0.06) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25% 75%, rgba(255, 255, 255, 0.06) 75%),
    #070b10;
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
}

.avatar-crop-frame:active {
  cursor: grabbing;
}

.avatar-crop-frame img {
  position: absolute;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.avatar-crop-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 74%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(0, 0, 0, 0.44) inset;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.avatar-crop-card input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.avatar-crop-actions {
  display: grid;
}

.settings-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.settings-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  color: var(--muted);
}

.profile-help {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--text);
  outline: none;
}

.profile-help-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #06120d;
  background: var(--green);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.profile-help-floating {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 160;
  width: min(360px, calc(100vw - 24px));
  padding: 10px 12px;
  color: var(--text);
  background: rgba(8, 12, 18, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  font-size: 12px;
  line-height: 1.42;
}

.profile-help-floating.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.profile-help-floating[hidden] {
  display: none;
}

.settings-toggle {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px;
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.settings-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-toggle-box {
  position: relative;
  width: 42px;
  height: 24px;
  background: rgba(238, 242, 248, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.settings-toggle-box::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 160ms ease, background-color 160ms ease;
}

.settings-toggle input:checked + .settings-toggle-box {
  background: var(--success-bg);
  border-color: var(--success-line);
}

.settings-toggle input:checked + .settings-toggle-box::after {
  background: var(--green);
  transform: translateX(18px);
}

.settings-toggle input:focus-visible + .settings-toggle-box {
  box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.18);
}

.settings-toggle:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.72;
}

.settings-push {
  background: linear-gradient(135deg, rgba(245, 173, 66, 0.08), rgba(10, 15, 22, 0.64) 42%);
}

.settings-push.is-ready {
  background: linear-gradient(135deg, rgba(38, 208, 124, 0.08), rgba(10, 15, 22, 0.64) 42%);
}

.settings-push.is-warning {
  border-color: var(--warning-line);
}

.settings-push.is-error {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.09), rgba(10, 15, 22, 0.64) 42%);
  border-color: var(--danger-line);
}

.settings-push.is-ready .push-toggle-card {
  border-color: var(--success-line);
}

.settings-push.is-warning .push-toggle-card {
  border-color: var(--warning-line);
}

.settings-push.is-error .push-toggle-card {
  border-color: var(--danger-line);
}

.phone-notification-help {
  width: 100%;
  padding: 10px;
  color: var(--text);
  background: #0e141c;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.phone-notification-help summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  list-style: none;
}

.phone-notification-help summary::-webkit-details-marker {
  display: none;
}

.phone-notification-help summary::after {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.phone-notification-help[open] summary::after {
  transform: rotate(225deg);
}

.phone-notification-help-body {
  display: grid;
  gap: 12px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.phone-notification-help-body section {
  display: grid;
  gap: 7px;
}

.phone-notification-help-body strong {
  color: var(--text);
}

.phone-notification-help-body ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.phone-notification-help-body p {
  margin: 0;
}

.settings-toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-toggle-copy strong {
  font-size: 13px;
}

.settings-toggle-copy small {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 12px;
}

.push-actions {
  display: grid;
}

.push-actions .ghost-button {
  min-height: 38px;
}

.friends-settings {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #0e141c;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.friends-dialog .friends-settings {
  padding: 0;
  background: transparent;
  border: 0;
}

.friend-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.friend-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
}

.friend-status.is-error {
  color: var(--red);
}

.friend-search-results {
  display: grid;
  gap: 8px;
}

.friend-search-title {
  color: var(--muted);
  font-size: 12px;
}

.friend-list {
  display: grid;
  gap: 8px;
}

.friend-search-results:not(:empty) + .friend-list {
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
}

.friend-list-title {
  color: var(--muted);
  font-size: 12px;
}

.friend-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.friend-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  background: #101720;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.friend-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.friend-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  color: #06120d;
  font-weight: 900;
  background: var(--green);
  border-radius: 50%;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.friend-copy strong,
.friend-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-copy small {
  color: var(--muted);
  font-size: 12px;
}

.friend-candidate-row {
  border-color: rgba(78, 161, 255, 0.22);
}

.friend-call-button,
.friend-remove-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.friend-added-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
  font-size: 12px;
}

.friend-present-button {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
}

.room-lobby-form input,
.join-form input,
.friends-settings input,
.settings-grid input:not([type="range"]):not([type="file"]),
.settings-grid select {
  width: 100%;
  min-height: 42px;
  color: var(--text);
  background: #0e141c;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  padding: 0 12px;
}

.settings-grid .profile-inline-field input {
  padding-right: 52px;
}

.settings-grid .profile-inline-field.has-two-actions input {
  padding-right: 112px;
}

.settings-grid select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.room-lobby-form input:focus,
.join-form input:focus,
.friends-settings input:focus,
.settings-grid input:not([type="range"]):not([type="file"]):focus,
.settings-grid select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.18);
}

.settings-grid select:disabled {
  color: rgba(238, 242, 248, 0.42);
  cursor: not-allowed;
}

.primary-button {
  color: #06120d;
  background: var(--green);
  font-weight: 700;
}

.compact-join-form {
  display: none;
}

.stage-controls {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  --stage-controls-y: 0px;
  --screen-menu-left: calc(100% - 158px);
  --record-menu-left: calc(100% - 34px);
  grid-template-columns: repeat(5, 52px);
  width: auto;
  padding: 8px;
  background: rgba(8, 12, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transform: translate(-50%, var(--stage-controls-y));
  transition: opacity 160ms ease, transform 160ms ease;
}

.screen-share-menu {
  position: absolute;
  left: var(--screen-menu-left);
  bottom: calc(100% + 10px);
  z-index: 42;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(94px, 0.75fr);
  gap: 10px;
  width: min(320px, calc(100vw - 24px));
  padding: 10px;
  color: var(--text);
  background: rgba(8, 12, 18, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.recording-menu {
  position: absolute;
  left: var(--record-menu-left);
  bottom: calc(100% + 10px);
  z-index: 42;
  display: grid;
  gap: 8px;
  width: min(220px, calc(100vw - 24px));
  padding: 10px;
  color: var(--text);
  background: rgba(8, 12, 18, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.recording-menu[hidden] {
  display: none;
}

.recording-menu .ghost-button {
  width: 100%;
  min-height: 42px;
}

.screen-share-menu[hidden] {
  display: none;
}

.screen-share-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.screen-share-field select {
  width: 100%;
  min-height: 38px;
  padding: 0 30px 0 10px;
  color: var(--text);
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    #0e141c;
  background-position:
    calc(100% - 17px) 16px,
    calc(100% - 11px) 16px,
    0 0;
  background-size: 6px 6px, 6px 6px, auto;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  appearance: none;
}

.screen-share-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.18);
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

select.custom-select-native {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
}

.custom-select-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 11px 0 12px;
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 72%),
    #0e141c;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.screen-share-field .custom-select-trigger {
  min-height: 38px;
  font-size: 13px;
}

.custom-select-trigger:hover:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 76%),
    #111923;
  border-color: rgba(159, 173, 189, 0.55);
}

.custom-select-trigger:focus-visible,
.custom-select.is-open .custom-select-trigger {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.custom-select-trigger:disabled {
  color: rgba(238, 242, 248, 0.42);
  cursor: not-allowed;
  background: rgba(14, 20, 28, 0.65);
}

.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-chevron {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: color 140ms ease, transform 160ms ease;
}

.custom-select-chevron::before,
.custom-select-chevron::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 7px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
}

.custom-select-chevron::before {
  left: 2px;
  transform: rotate(45deg);
}

.custom-select-chevron::after {
  right: 2px;
  transform: rotate(-45deg);
}

.custom-select.is-open .custom-select-chevron {
  color: var(--blue);
  transform: rotate(180deg);
}

.custom-select-menu {
  position: fixed;
  z-index: 220;
  display: grid;
  gap: 3px;
  padding: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 54%),
    rgba(9, 14, 21, 0.985);
  border: 1px solid rgba(117, 137, 160, 0.46);
  border-radius: 9px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  transform-origin: top center;
  animation: custom-select-in 130ms ease-out;
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 7px 8px 7px 10px;
  color: #dfe7f1;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
}

.custom-select-option:hover:not(:disabled),
.custom-select-option.is-active:not(:disabled) {
  color: #f6faff;
  background: rgba(78, 161, 255, 0.13);
  border-color: rgba(78, 161, 255, 0.2);
}

.custom-select-option[aria-selected="true"] {
  color: #f5faff;
  background: rgba(78, 161, 255, 0.2);
  border-color: rgba(78, 161, 255, 0.42);
}

.custom-select-option:disabled {
  color: rgba(223, 231, 241, 0.38);
  cursor: not-allowed;
}

.custom-select-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-option-mark {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: #07121f;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  background: var(--blue);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 120ms ease, transform 120ms ease;
}

.custom-select-option[aria-selected="true"] .custom-select-option-mark {
  opacity: 1;
  transform: scale(1);
}

@keyframes custom-select-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.screen-menu-action,
.screen-stop-button {
  grid-column: 1 / -1;
  min-height: 38px;
}

@media (hover: hover) and (pointer: fine) {
  .stage:not(:hover):not(:focus-within) .stage-controls {
    --stage-controls-y: 10px;
    opacity: 0;
    pointer-events: none;
  }
}

.control-button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 62px;
  padding: 0;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.stage-controls .control-button {
  width: 52px;
  min-height: 48px;
}

.control-button.is-media-on,
.control-button.screen-toggle.is-active,
.control-button.whiteboard-toggle.is-active {
  color: #06120d;
  background: var(--green);
  border-color: var(--green);
}

.control-button.is-media-off {
  color: #fff3f3;
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.72);
}

.control-button.record-toggle.is-recording {
  color: #fff7f7;
  background: rgba(255, 107, 107, 0.9);
  border-color: rgba(255, 107, 107, 0.95);
}

.control-button.record-toggle.is-recording .icon-record {
  animation: record-pulse 1.2s ease-in-out infinite;
}

.control-button.screen-toggle:not(.is-active) {
  color: var(--text);
  background: var(--panel-strong);
  border-color: var(--line);
}

.control-button.whiteboard-toggle:not(.is-active) {
  color: var(--text);
  background: var(--panel-strong);
  border-color: var(--line);
}

.mobile-camera-switch {
  display: none;
}

.mobile-camera-switch.is-active {
  color: #06120d;
  background: var(--blue);
  border-color: var(--blue);
}

.control-button.danger {
  color: #fff3f3;
  border-color: rgba(255, 107, 107, 0.42);
}

.control-icon {
  width: 28px;
  height: 28px;
}

.control-button .icon-mic {
  --icon-url: url("/icons/ui/mic-off.svg");
}

.control-button.is-media-on .icon-mic {
  --icon-url: url("/icons/ui/mic.svg");
}

.icon-camera {
  --icon-url: url("/icons/ui/video-off.svg");
}

.control-button.is-media-on .icon-camera {
  --icon-url: url("/icons/ui/video.svg");
}

.icon-screen {
  --icon-url: url("/icons/ui/monitor.svg");
}

.control-button.screen-toggle.is-active .icon-screen {
  --icon-url: url("/icons/ui/monitor-up.svg");
}

@keyframes record-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.82);
  }
}

.participants,
.chat-panel {
  min-height: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.participant-sidebar .participants {
  position: relative;
  height: 100%;
  padding-top: 0;
  border-top: 0;
}

.section-heading {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.section-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.section-heading span {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  color: #08130d;
  background: var(--green);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

#participantList {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  align-content: start;
  justify-items: center;
}

.participant-sidebar .section-heading {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.participant-sidebar .section-heading h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.participant-sidebar .section-heading span {
  min-width: 32px;
  height: 28px;
}

.participant-sidebar .section-actions {
  display: grid;
  justify-items: center;
}

.participant-sidebar .icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

.participant-item {
  position: relative;
  display: grid;
  min-height: 58px;
  place-items: center;
}

.participant-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  aspect-ratio: 1 / 1;
  overflow: visible;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.participant-avatar-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: inherit;
  background: #101720;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.participant-avatar-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  clip-path: circle(50%);
}

.participant-avatar:hover .participant-avatar-face,
.participant-item.is-open .participant-avatar-face {
  border-color: rgba(78, 161, 255, 0.72);
}

.participant-item.is-speaking .participant-avatar-face {
  color: #06120d;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(38, 208, 124, 0.18);
}

.participant-status-dots {
  position: absolute;
  right: -7px;
  top: 50%;
  bottom: auto;
  display: grid;
  gap: 2px;
  padding: 0;
  z-index: 2;
  pointer-events: none;
  transform: translateY(-50%);
}

.participant-muted-badge {
  position: absolute;
  left: 2px;
  bottom: 2px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #1b1202;
  background: var(--amber);
  border: 2px solid #080c12;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.36);
  pointer-events: none;
}

.participant-muted-badge .button-icon {
  width: 13px;
  height: 13px;
}

.participant-status-dot {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #fff3f3;
  border: 2px solid #080c12;
  border-radius: 50%;
  background: rgba(255, 107, 107, 0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
}

.participant-status-dot .button-icon {
  width: 10px;
  height: 10px;
}

.participant-status-dot.is-off {
  color: #fff;
  background: rgba(255, 107, 107, 0.96);
}

.participant-status-dot.is-active.is-mic {
  color: #06120d;
  background: var(--green);
}

.participant-status-dot.is-active.is-camera {
  color: #06120d;
  background: var(--blue);
}

.participant-status-dot.is-active.is-screen {
  color: #1b1202;
  background: var(--amber);
}

.participant-status-dot.is-quality-poor,
.participant-status-dot.is-quality-lost,
.participant-status-dot.is-quality-unknown {
  color: #fff;
  background: #ff6b6b;
}

.participant-popover {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 16;
  display: grid;
  gap: 6px;
  min-width: 190px;
  max-width: 260px;
  padding: 10px;
  color: var(--text);
  background: rgba(8, 12, 18, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateY(-50%);
}

.participant-popover[hidden] {
  display: none;
}

.participant-popover strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.participant-popover small {
  color: var(--muted);
}

.participant-trust-badge {
  justify-self: start;
  padding: 3px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.participant-trust-badge[data-state="friend"],
.participant-trust-badge[data-state="self"] {
  color: #06120d;
  background: var(--green);
  border-color: var(--green);
}

.participant-trust-badge[data-state="unknown"] {
  color: #1b1202;
  background: var(--amber);
  border-color: var(--amber);
}

.participant-status-legend {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.participant-audio-controls {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.participant-audio-header,
.participant-audio-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.participant-audio-header {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.participant-audio-header strong {
  color: var(--text);
  font-size: 12px;
}

.participant-audio-header strong.is-boosted {
  color: var(--red);
}

.participant-audio-row input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--green);
}

.participant-audio-row input[type="range"].is-boosted {
  accent-color: var(--red);
}

.participant-mute-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 32px;
  padding: 0;
  color: var(--text);
  background: #101720;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.participant-mute-button .button-icon {
  width: 18px;
  height: 18px;
}

.participant-mute-button:hover {
  border-color: rgba(78, 161, 255, 0.72);
}

.participant-mute-button.is-muted {
  color: #fff3f3;
  border-color: rgba(255, 107, 107, 0.72);
  background: rgba(255, 107, 107, 0.12);
}

.participant-friend-button {
  width: 100%;
  min-height: 34px;
  margin-top: 4px;
  font-size: 12px;
}

.participant-tile-actions {
  display: grid;
  gap: 6px;
  padding-top: 4px;
}

.participant-tile-action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.participant-tile-action-button:hover {
  border-color: rgba(78, 161, 255, 0.72);
  background: rgba(78, 161, 255, 0.14);
}

.participant-tile-action-button.is-show {
  border-color: rgba(38, 208, 124, 0.58);
  background: rgba(38, 208, 124, 0.12);
}

.participant-tile-action-button .button-icon {
  width: 16px;
  height: 16px;
}

.stage > .call-stats {
  position: absolute;
  left: 18px;
  bottom: 88px;
  z-index: 12;
  width: min(540px, calc(100% - 36px));
  padding: 7px 8px;
  background: rgba(8, 12, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.call-stats {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.call-stats[hidden] {
  display: none;
}

.call-stats .section-heading {
  margin-bottom: 0;
}

.call-stats .section-heading h2 {
  font-size: 11px;
}

.call-stats .section-heading span {
  min-width: 24px;
  height: 22px;
  font-size: 10px;
  border-radius: 6px;
}

.call-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.call-stat {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.call-stat span,
.call-stat small {
  color: var(--muted);
  font-size: 10px;
}

.call-stat strong {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.chat-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-panel.is-dragging-file::after {
  content: "Отпустите файлы";
  position: absolute;
  inset: 8px;
  z-index: 22;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 800;
  background: rgba(8, 12, 18, 0.78);
  border: 1px dashed rgba(78, 161, 255, 0.84);
  border-radius: 8px;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.side-panel .chat-panel {
  height: 100%;
  padding-top: 0;
  border-top: 0;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 220ms ease, transform 240ms ease;
}

.chat-panel-toggle {
  position: absolute;
  left: -40px;
  top: 16px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  color: var(--text);
  background: rgba(13, 18, 26, 0.96);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  box-shadow: var(--shadow);
  font-weight: 800;
  line-height: 1;
}

.chat-panel-toggle:hover {
  border-color: rgba(78, 161, 255, 0.72);
}

.chat-unread-badge {
  position: absolute;
  right: 6px;
  top: 6px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  color: #06120d;
  background: var(--amber);
  border: 2px solid #080c12;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.chat-unread-badge[hidden] {
  display: none;
}

body.has-expanded-video .chat-panel-toggle {
  display: none;
}

body.is-resizing-chat {
  cursor: col-resize;
  user-select: none;
}

body.is-resizing-chat .app-layout {
  transition: none;
}

.chat-resize-handle {
  position: absolute;
  left: -7px;
  top: 0;
  bottom: 0;
  z-index: 24;
  width: 14px;
  padding: 0;
  cursor: col-resize;
  background: transparent;
  border: 0;
  border-radius: 0;
  touch-action: none;
}

.chat-resize-handle::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: rgba(159, 173, 189, 0.22);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 160ms ease, background-color 160ms ease;
}

.chat-resize-handle:hover::before,
.chat-resize-handle:focus-visible::before,
body.is-resizing-chat .chat-resize-handle::before {
  opacity: 1;
  background: rgba(78, 161, 255, 0.78);
}

.chat-resize-handle:focus-visible {
  outline: none;
}

.app-layout.chat-collapsed .chat-panel-toggle {
  left: 4px;
  top: 16px;
  width: 36px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.app-layout.chat-collapsed .chat-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px);
}

.app-layout.chat-collapsed .chat-resize-handle,
body.has-expanded-video .chat-resize-handle {
  display: none;
}

.chat-messages {
  align-content: start;
  min-height: 180px;
  overflow: auto;
  color: var(--muted);
  font-size: 13px;
}

.chat-messages:empty::before {
  content: "Сообщений пока нет";
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(159, 173, 189, 0.22);
  border-radius: 8px;
}

.chat-message {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #101720;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-message-meta strong {
  max-width: 190px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message-meta time {
  flex: 0 0 auto;
  color: rgba(238, 242, 248, 0.48);
  font-size: 12px;
}

.chat-message p {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  tab-size: 2;
}

.chat-message p a {
  color: var(--blue);
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: rgba(78, 161, 255, 0.48);
  text-underline-offset: 2px;
}

.chat-message p a:hover,
.chat-message p a:focus-visible {
  color: #8fc4ff;
  text-decoration-color: currentColor;
  outline: none;
}

.chat-image-button {
  display: block;
  width: 100%;
  max-width: 260px;
  padding: 0;
  overflow: hidden;
  background: #05070a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.chat-image-button img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #05070a;
}

.chat-file-attachment {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  padding: 8px;
  color: var(--text);
  background: #0b1118;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
}

.chat-file-type {
  position: relative;
  display: grid;
  place-items: end center;
  width: 52px;
  height: 60px;
  padding: 0 5px 10px;
  color: #eaf3ff;
  overflow: hidden;
  text-decoration: none;
  background: rgba(78, 161, 255, 0.18);
  border: 1px solid rgba(78, 161, 255, 0.46);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.chat-file-type::before {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.chat-file-type:hover,
.chat-file-type:focus-visible {
  border-color: rgba(238, 242, 248, 0.72);
  box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.18);
  outline: none;
}

.chat-file-type.is-pdf {
  color: #fff0f0;
  background: rgba(255, 93, 93, 0.18);
  border-color: rgba(255, 93, 93, 0.5);
}

.chat-file-type.is-doc,
.chat-file-type.is-text {
  color: #eaf3ff;
  background: rgba(78, 161, 255, 0.18);
  border-color: rgba(78, 161, 255, 0.5);
}

.chat-file-type.is-sheet {
  color: #eafff3;
  background: rgba(38, 208, 124, 0.18);
  border-color: rgba(38, 208, 124, 0.52);
}

.chat-file-type.is-slide {
  color: #fff7e5;
  background: rgba(245, 166, 35, 0.18);
  border-color: rgba(245, 166, 35, 0.54);
}

.chat-file-type.is-archive,
.chat-file-type.is-code {
  color: #f4efff;
  background: rgba(161, 121, 255, 0.18);
  border-color: rgba(161, 121, 255, 0.5);
}

.chat-file-type.is-audio,
.chat-file-type.is-video {
  color: #e8fbff;
  background: rgba(42, 209, 219, 0.16);
  border-color: rgba(42, 209, 219, 0.48);
}

.chat-file-type.is-image {
  color: #fff7e8;
  background: rgba(255, 184, 77, 0.18);
  border-color: rgba(255, 184, 77, 0.54);
}

.chat-file-details {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.chat-file-details strong,
.chat-file-details span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-file-details strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.chat-file-details span {
  color: var(--muted);
  font-size: 12px;
}

.chat-form {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.chat-form.is-uploading::after {
  content: attr(data-upload-label);
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 17;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(8, 12, 18, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.chat-form.is-upload-error::after {
  color: #fff3f3;
  background: rgba(36, 13, 16, 0.96);
  border-color: var(--danger-line);
}

.chat-upload-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.chat-upload-status.is-error {
  color: var(--red);
}

.chat-upload-status[hidden] {
  display: none;
}

.chat-input-row {
  display: grid;
  grid-template-columns: 40px 40px minmax(0, 1fr) 40px;
  align-items: end;
  gap: 8px;
}

.chat-input-row .icon-button,
.chat-send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  line-height: 1;
}

.chat-input-row .button-icon {
  width: 20px;
  height: 20px;
  margin: auto;
}

.chat-image-input {
  display: none;
}

.chat-input-row textarea {
  width: 100%;
  min-height: 40px;
  max-height: 160px;
  color: var(--text);
  background: #0e141c;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  padding: 10px 12px;
  overflow: hidden;
  resize: none;
  line-height: 20px;
  font: inherit;
  white-space: pre-wrap;
}

.chat-input-row textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(78, 161, 255, 0.18);
}

.chat-send-button {
  border-radius: 8px;
}

.emoji-picker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 18;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 4px;
  max-height: 220px;
  padding: 8px;
  overflow: auto;
  background: rgba(8, 12, 18, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.emoji-picker[hidden] {
  display: none;
}

.emoji-option {
  display: grid;
  place-items: center;
  height: 34px;
  padding: 0;
  font-size: 19px;
  background: #101720;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.emoji-option:hover {
  background: rgba(78, 161, 255, 0.18);
}

.chat-image-dialog {
  width: min(960px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  max-height: min(760px, calc(100svh - 28px));
  padding: 0;
  color: var(--text);
  background: rgba(5, 7, 10, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.chat-image-dialog:not([open]) {
  display: none;
}

.chat-image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.chat-image-dialog-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.chat-image-dialog-card .icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  background: rgba(8, 12, 18, 0.82);
  font-size: 22px;
}

.chat-image-dialog-card img {
  display: block;
  width: 100%;
  max-height: calc(100svh - 120px);
  object-fit: contain;
  background: #05070a;
  border-radius: 8px;
}

.chat-image-dialog-card p {
  margin: 0;
  min-height: 18px;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 13px;
}

.recording-dialog {
  width: min(460px, calc(100vw - 28px));
  padding: 0;
  color: var(--text);
  background: rgba(8, 12, 18, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.recording-dialog:not([open]) {
  display: none;
}

.recording-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
}

.recording-dialog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.recording-summary,
.recording-status {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.recording-status.is-error {
  color: var(--red);
}

.recording-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.video-tile:fullscreen,
.video-tile.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #000;
  touch-action: none;
}

.focus-layout.video-grid .video-tile.is-fullscreen,
.focus-layout.video-grid .video-tile:fullscreen,
.focus-layout.video-grid .video-tile.is-featured.is-fullscreen,
.focus-layout.video-grid .video-tile.is-featured:fullscreen,
.focus-layout.video-grid .video-tile.is-pip.is-fullscreen,
.focus-layout.video-grid .video-tile.is-pip:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  transform: none;
}

.tile-strip-list .video-tile.is-pip:fullscreen,
.tile-strip-list .video-tile.is-pip.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  transform: none;
  touch-action: none;
}

.video-tile:fullscreen video,
.video-tile.is-fullscreen video {
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.video-tile:fullscreen .tile-footer,
.video-tile.is-fullscreen .tile-footer {
  margin: 10px 16px 16px;
}

.video-tile:fullscreen .expand-button,
.video-tile.is-fullscreen .expand-button {
  top: 16px;
  left: 16px;
}

.video-tile:fullscreen .hide-button,
.video-tile.is-fullscreen .hide-button {
  display: none;
}

.video-tile:fullscreen .zoom-reset-button,
.video-tile.is-fullscreen .zoom-reset-button {
  top: 16px;
  left: 60px;
}

.whiteboard-tile:fullscreen,
.whiteboard-tile.is-fullscreen {
  background: #dfe5ec;
}

.whiteboard-tile:fullscreen .whiteboard-shell,
.whiteboard-tile.is-fullscreen .whiteboard-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.whiteboard-tile:fullscreen .whiteboard-tool-drawer,
.whiteboard-tile.is-fullscreen .whiteboard-tool-drawer {
  max-height: none;
}
