:root {
  --bg: #050505;
  --panel: #0b0b0b;
  --panel-2: #111111;
  --panel-3: #171717;
  --text: #f2f2f2;
  --muted: #999999;
  --muted-2: #6f6f6f;
  --accent: #2f7dff;
  --danger: #d93636;
  --line: #242424;
  --line-2: #333333;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

button, input, select { font: inherit; }

button {
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 12px 15px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }
button:disabled { cursor: not-allowed; opacity: .55; }

button.ghost {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line-2);
}

button.small { padding: 9px 11px; font-size: 13px; }
button.tiny { padding: 7px 9px; font-size: 12px; }
button.danger { background: var(--danger); border-color: var(--danger); }
button.off { background: #333; color: #ddd; }

input, select {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: #070707;
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

input[type="file"] { padding: 10px; }
input::placeholder { color: #555; }
input:focus, select:focus { border-color: var(--accent); }

.hidden { display: none !important; }

.join-screen {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(280px, 380px);
  grid-template-rows: auto auto;
  align-content: center;
  justify-content: center;
  gap: 14px;
}

.join-card,
.setup-card,
.rooms-card,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  padding: 24px;
}

.join-card { grid-row: span 2; }

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line-2);
}

.logo-large { width: 94px; height: 94px; }

.brand-logo,
.profile-preview img,
.avatar img,
.tile-avatar img,
.message-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 7vw, 56px);
  line-height: .95;
  letter-spacing: -.04em;
}

h2 { margin: 0; font-size: 20px; }

h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line-2);
  margin-bottom: 16px;
}

.tab {
  background: var(--panel-2);
  border: 0;
  border-right: 1px solid var(--line-2);
  color: var(--muted);
  box-shadow: none;
}

.tab:last-child { border-right: 0; }

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

label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.profile-preview,
.avatar,
.tile-avatar,
.message-avatar {
  overflow: hidden;
  background: #070707;
  border: 1px solid var(--line-2);
  color: var(--text);
  display: grid;
  place-items: center;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-preview { width: 54px; height: 54px; }

.form-row.two {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
}

.primary-btn { width: 100%; margin-top: 14px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.mini-status {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.active-rooms {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}

.room-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  cursor: pointer;
}

.room-item:hover { background: var(--panel-3); }

.room-item strong {
  font-size: 14px;
  word-break: break-all;
}

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

.room-badge {
  padding: 4px 7px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 12px;
}

.empty-list {
  color: var(--muted);
  padding: 12px;
  border: 1px solid var(--line-2);
  text-align: center;
}

.app {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  overflow: hidden;
}

.stage {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #060606;
}

.call-topbar {
  height: 64px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.call-topbar strong { font-size: 20px; }

.connection-status {
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.connection-status.warn { color: #e7c169; }
.connection-status.bad { color: #ff8a8a; }

.video-grid {
  min-height: 0;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  align-items: center;
  gap: 24px;
  overflow: auto;
}

/* One compact column per participant: screen preview above avatar/name. */
.participant-stack {
  width: 150px;
  flex: 0 0 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tile {
  position: relative;
  overflow: hidden;
  min-height: 215px;
  border: 1px solid var(--line-2);
  background: #020202;
}

.tile video {
  width: 100%;
  height: 100%;
  min-height: 215px;
  object-fit: cover;
  display: block;
  background: #020202;
}

.tile audio { display: none; }

.tile .placeholder {
  min-height: 215px;
  display: grid;
  place-items: center;
  background: #080808;
}

.tile-avatar {
  width: 92px;
  height: 92px;
  font-size: 44px;
}

.tile .label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 7px 9px;
  background: rgba(0, 0, 0, .75);
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 700;
}

/* Compact voice participant card: avatar with the name directly underneath. */
.tile.voice-tile {
  width: 108px;
  min-height: 0;
  justify-self: center;
  align-self: center;
  overflow: visible;
  border: 0;
  background: transparent;
}

.tile.voice-tile .placeholder {
  min-height: 0;
  background: transparent;
}

.tile.voice-tile .label {
  position: static;
  width: 100%;
  margin-top: 7px;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Screen-share preview: exactly the same square size as the participant photo. */
.tile.screen-tile {
  width: 92px;
  height: 92px;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
}

.tile.screen-tile video {
  width: 92px;
  height: 92px;
  min-height: 0;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--line-2);
  box-sizing: border-box;
  cursor: zoom-in;
}

.tile.screen-tile .placeholder {
  width: 92px;
  height: 92px;
  min-height: 0;
  background: #000;
  border: 1px solid var(--line-2);
  box-sizing: border-box;
}

.tile.screen-tile .label {
  display: none;
}

.controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.chat-panel {
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.room-box {
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  padding: 12px;
  margin-bottom: 14px;
}

.room-box h2 {
  margin: 0 0 7px;
  word-break: break-all;
}

.room-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.room-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.user-list {
  display: grid;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  margin-bottom: 16px;
}

.user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
}

.avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.chat-head h3 { margin: 0; }

.messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message {
  padding: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  line-height: 1.35;
  word-break: break-word;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
}

.message.system {
  color: var(--muted);
  display: block;
}

.message-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.message-body { min-width: 0; }

.message b {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.message span {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.emoji-row {
  display: flex;
  gap: 7px;
  padding-top: 10px;
}

.emoji-btn {
  width: 40px;
  height: 36px;
  padding: 0;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-top: 10px;
}

.chat-form button {
  width: 48px;
  padding-inline: 0;
}

.toast {
  position: absolute;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 10px 13px;
  background: #111;
  border: 1px solid var(--line-2);
  color: var(--text);
  max-width: min(520px, calc(100% - 32px));
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0,0,0,.7);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card { width: min(440px, 100%); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.video-grid::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.user-list::-webkit-scrollbar,
.active-rooms::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.video-grid::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb,
.user-list::-webkit-scrollbar-thumb,
.active-rooms::-webkit-scrollbar-thumb {
  background: #333;
}

@media (max-width: 980px) {
  body { overflow: auto; }

  .join-screen {
    grid-template-columns: minmax(280px, 520px);
    align-content: start;
    padding: 14px;
  }

  .join-card { grid-row: auto; }

  .app {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .chat-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  .join-card,
  .setup-card,
  .rooms-card,
  .modal-card {
    padding: 18px;
  }

  .brand-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row.two,
  .room-actions,
  .profile-row {
    grid-template-columns: 1fr;
  }

  .profile-preview {
    width: 64px;
    height: 64px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .controls button {
    flex: 1 1 140px;
  }
}








.tile.screen-tile video {
  object-fit: contain;
  background: #000;
}





.screen-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: none;
}

.screen-viewer.open {
  display: block;
}

.screen-viewer video {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000;
  display: block;
}





body.viewer-open .chat-panel,
body.viewer-open .controls,
body.viewer-open .call-topbar {
  visibility: hidden;
}




.screen-viewer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  background: #000 !important;
}

.screen-viewer.open {
  display: block !important;
}

.screen-viewer video {
  position: absolute;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain !important;
  background: #000 !important;
}




.screen-viewer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  background: #000 !important;
  display: none !important;
  pointer-events: auto !important;
}

.screen-viewer.open {
  display: block !important;
}

.screen-viewer video {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain !important;
  background: #000 !important;
  display: block !important;
  pointer-events: none !important;
}







body.viewer-open {
  overflow: hidden !important;
}

body.viewer-open .app > *:not(.screen-viewer) {
  visibility: hidden;
}
















.screen-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(0,0,0,.72);
  display: grid;
  place-items: center;
  padding: 18px;
}

.screen-choice-modal.hidden {
  display: none !important;
}

.screen-choice-card {
  width: min(420px, 100%);
  border: 1px solid var(--line-2);
  background: var(--panel);
  padding: 14px;
}

.screen-choice-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.screen-choice-btn {
  width: 100%;
  text-align: left;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line-2);
  padding: 12px 14px;
}

.screen-choice-btn:hover {
  background: var(--panel-3);
}


.settings-toggle {
  width: 100%;
  margin-top: 12px;
}

.compressor-panel {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
}

.slider-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.slider-row:first-child {
  margin-top: 0;
}

.slider-row label {
  margin: 0 0 3px;
}

.slider-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.slider-row strong {
  color: var(--text);
  font-size: 13px;
  min-width: 54px;
  text-align: right;
}

.compressor-panel input[type="range"] {
  padding: 0;
  margin: 8px 0 6px;
  height: 26px;
  border: 0;
  background: transparent;
}

.compressor-panel button {
  margin-top: 10px;
}


.controls > .hidden {
  display: none !important;
}

.settings-block {
  margin-top: 12px;
}

.settings-block .settings-toggle + .settings-toggle {
  margin-top: 8px;
}


/* Final compact screen-preview override (same 92x92 size as the avatar). */
.participant-stack .tile.screen-tile,
.participant-stack .tile.screen-tile video,
.participant-stack .tile.screen-tile .placeholder {
  width: 92px;
  height: 92px;
  min-height: 0;
}

.participant-stack .tile.screen-tile video {
  object-fit: contain;
}

.participant-stack .tile.screen-tile .label {
  display: none;
}

/* Force screen preview to match participant avatar exactly (92x92). */
.participant-stack .tile.screen-tile {
  width: 92px !important;
  height: 92px !important;
  min-width: 92px !important;
  min-height: 92px !important;
  max-width: 92px !important;
  max-height: 92px !important;
  flex: 0 0 92px !important;
  border: 0 !important;
  background: transparent !important;
}

.participant-stack .tile.screen-tile video,
.participant-stack .tile.screen-tile .placeholder {
  width: 92px !important;
  height: 92px !important;
  min-width: 92px !important;
  min-height: 92px !important;
  max-width: 92px !important;
  max-height: 92px !important;
  box-sizing: border-box !important;
}

.participant-stack .tile.screen-tile video {
  object-fit: contain !important;
}

/* ========================================================================
   WNB CALLS — TS-inspired room UI experiment v1
   Layout only. Existing WebRTC / Socket.IO logic and DOM ids are preserved.
   ======================================================================== */

:root {
  --ts-rail: #07090d;
  --ts-sidebar: #0b0e13;
  --ts-surface: #0d1118;
  --ts-surface-2: #111722;
  --ts-panel: #0c1017;
  --ts-hover: #151c28;
  --ts-line: #202938;
  --ts-line-soft: #171e29;
  --ts-blue: #3d8dff;
  --ts-blue-soft: rgba(61, 141, 255, .16);
}

.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 62px 270px minmax(440px, 1fr) 330px;
  background: var(--ts-surface);
  overflow: hidden;
}

.app-rail {
  min-width: 0;
  background: var(--ts-rail);
  border-right: 1px solid var(--ts-line-soft);
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.rail-logo {
  width: 40px;
  height: 40px;
  border: 1px solid var(--ts-line);
  background: #020305;
  overflow: hidden;
}

.rail-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rail-line {
  width: 28px;
  height: 1px;
  background: var(--ts-line);
  margin: 2px 0;
}

.rail-badge {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid #285eaa;
  background: var(--ts-blue-soft);
  color: #cfe3ff;
  font-size: 15px;
  font-weight: 900;
}

.rail-spacer { flex: 1; }

.rail-live {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #66758a;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}

.rail-live span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #47d18c;
  box-shadow: 0 0 10px rgba(71, 209, 140, .45);
}

.room-sidebar {
  min-width: 0;
  background: var(--ts-sidebar);
  border-right: 1px solid var(--ts-line-soft);
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand {
  min-height: 48px;
  padding: 2px 6px 16px;
  border-bottom: 1px solid var(--ts-line-soft);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
}

.sidebar-brand strong {
  display: block;
  font-size: 17px;
  letter-spacing: .015em;
}

.sidebar-brand small,
.call-heading small,
.chat-panel-head small {
  display: block;
  margin-top: 3px;
  color: #65758b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
}

.room-sidebar .room-box {
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--ts-line);
  border-radius: 9px;
  background: linear-gradient(180deg, #111722 0%, #0e131c 100%);
}

.room-box-kicker {
  color: #617086;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  margin-bottom: 7px;
}

.room-sidebar .room-box h2 {
  margin: 0 0 5px;
  font-size: 17px;
}

.room-sidebar .room-meta {
  margin-bottom: 11px;
  color: #7e8da0;
  font-size: 12px;
}

.room-sidebar .room-actions {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.room-sidebar .room-actions button {
  padding: 8px 9px;
  border-radius: 6px;
  font-size: 11px;
}

.sidebar-section-head {
  padding: 0 5px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.sidebar-section-head h3 {
  margin: 0;
  color: #74849a;
  font-size: 10px;
}

.section-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #47d18c;
}

.room-sidebar .user-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  gap: 3px;
  margin: 0;
  padding-right: 2px;
}

.room-sidebar .user {
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  transition: background .13s ease, border-color .13s ease;
}

.room-sidebar .user:hover {
  background: var(--ts-hover);
  border-color: #1e2a3a;
}

.room-sidebar .avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border-color: #2a3647;
}

.room-sidebar .user-name {
  color: #dbe5f3;
  font-size: 13px;
  font-weight: 700;
}

.room-sidebar .user-status {
  color: #718198;
}

.sidebar-tip {
  margin-top: 12px;
  padding: 10px;
  border-top: 1px solid var(--ts-line-soft);
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 8px;
  color: #6f8097;
}

.sidebar-tip .tip-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ts-line);
  border-radius: 7px;
  color: #8da0b9;
}

.sidebar-tip strong,
.sidebar-tip small {
  display: block;
}

.sidebar-tip strong { color: #91a1b6; font-size: 11px; }
.sidebar-tip small { margin-top: 2px; font-size: 9px; line-height: 1.25; }

.stage {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-rows: 70px minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 50% 40%, rgba(42, 74, 119, .10), transparent 38%),
    var(--ts-surface);
}

.call-topbar {
  height: 70px;
  padding: 0 18px;
  border-bottom: 1px solid var(--ts-line-soft);
  background: rgba(11, 15, 21, .92);
}

.call-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.voice-glyph {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #265d9e;
  border-radius: 9px;
  color: #82b9ff;
  background: rgba(61, 141, 255, .10);
  font-size: 12px;
}

.call-heading strong {
  display: block;
  min-width: 0;
  max-width: 50vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  color: #e6edf7;
}

.call-heading small { margin-top: 0; margin-bottom: 3px; }

.connection-status {
  padding: 7px 10px;
  border: 1px solid #253144;
  border-radius: 7px;
  background: #0d131c;
  color: #8394aa;
  font-size: 11px;
}

.stage-surface {
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.stage-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 82%);
}

.video-grid {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 26px;
  gap: 28px;
  justify-content: center;
  align-content: center;
}

.participant-stack {
  width: 124px;
  flex: 0 0 124px;
  gap: 7px;
}

.tile.voice-tile {
  width: 108px;
}

.tile-avatar {
  border-radius: 10px;
  border-color: #2b3748;
  background: #0c1118;
  box-shadow: 0 8px 28px rgba(0,0,0,.24);
}

.tile.voice-tile .label {
  margin-top: 7px;
  color: #d9e3f1;
  font-size: 12px;
  font-weight: 700;
}

.participant-stack .tile.screen-tile video,
.participant-stack .tile.screen-tile .placeholder {
  border-radius: 10px;
  border-color: #315075 !important;
  background: #04070b !important;
  box-shadow: 0 0 0 1px rgba(61,141,255,.05), 0 8px 25px rgba(0,0,0,.24);
}

.controls-shell {
  padding: 10px 16px 14px;
  background: linear-gradient(180deg, rgba(13,17,24,0) 0%, #0b0f15 36%);
}

.controls {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 7px;
  gap: 6px;
  border: 1px solid var(--ts-line);
  border-radius: 11px;
  background: #090d13;
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
}

.controls button {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 7px;
  border-color: #263246;
  background: #121925;
  color: #dce6f4;
  font-size: 12px;
}

.controls button:hover { background: #182235; }
.controls button:not(.ghost):not(.danger) { background: #173c70; border-color: #245d9e; }
.controls button:not(.ghost):not(.danger):hover { background: #1e4d8e; }
.controls button.danger { background: #5a2027; border-color: #7d2b35; }
.controls button.danger:hover { background: #722832; }

.chat-panel {
  min-width: 0;
  padding: 0;
  background: var(--ts-panel);
  border-left: 1px solid var(--ts-line-soft);
  display: grid;
  grid-template-rows: 70px minmax(0,1fr) auto auto;
}

.chat-panel-head {
  padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--ts-line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-panel-head h2 {
  margin: 2px 0 0;
  color: #e3ebf6;
  font-size: 16px;
}

.chat-panel-head .ghost {
  border-radius: 6px;
  padding: 7px 9px;
  background: #101720;
  border-color: #263143;
  color: #8c9bb0;
}

.chat-panel .messages {
  padding: 12px 11px;
  gap: 5px;
}

.chat-panel .message {
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.chat-panel .message:hover {
  background: #101620;
  border-color: #192333;
}

.chat-panel .message-avatar {
  border-radius: 7px;
  border-color: #293548;
}

.chat-panel .message b { font-size: 12px; }
.chat-panel .message span { font-size: 10px; }

.chat-panel .emoji-row {
  padding: 7px 10px 0;
  border-top: 1px solid var(--ts-line-soft);
}

.chat-panel .emoji-btn {
  width: 34px;
  height: 30px;
  border-radius: 6px;
  background: #111823;
  border-color: #242f40;
}

.chat-panel .chat-form {
  padding: 9px 10px 12px;
  gap: 6px;
}

.chat-panel .chat-form input {
  min-height: 40px;
  border-radius: 8px;
  background: #080c12;
  border-color: #263143;
  padding: 10px 12px;
  font-size: 12px;
}

.chat-panel .chat-form button {
  width: 42px;
  border-radius: 8px;
  background: #2267bd;
  border-color: #2f7edb;
}

.toast { top: 82px; border-radius: 7px; background: #111824; border-color: #273448; }

@media (max-width: 1240px) {
  .app { grid-template-columns: 54px 235px minmax(390px, 1fr) 285px; }
  .room-sidebar { padding-inline: 9px; }
  .sidebar-tip { display: none; }
  .video-grid { padding-inline: 16px; gap: 20px; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .app {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 54px minmax(210px, 250px) minmax(0, 1fr);
    grid-template-rows: minmax(620px, 100vh) minmax(360px, 60vh);
  }
  .app-rail { grid-column: 1; grid-row: 1; }
  .room-sidebar { grid-column: 2; grid-row: 1; }
  .stage { grid-column: 3; grid-row: 1; }
  .chat-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    border-left: 0;
    border-top: 1px solid var(--ts-line-soft);
  }
}

@media (max-width: 700px) {
  .app {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .app-rail { display: none; }
  .room-sidebar {
    grid-column: 1;
    grid-row: 1;
    min-height: 260px;
    max-height: 42vh;
  }
  .stage {
    grid-column: 1;
    grid-row: 2;
    min-height: 650px;
  }
  .chat-panel {
    grid-column: 1;
    grid-row: 3;
    min-height: 420px;
  }
  .call-heading strong { max-width: 62vw; }
}

/* ========================================================================
   WNB CALLS — room UI v2
   Cleaner solid surfaces, no decorative rail/glow/grid.
   ======================================================================== */

.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(460px, 1fr) 340px;
  background: var(--ts-surface);
  overflow: hidden;
}

.room-sidebar {
  grid-column: 1;
  min-width: 0;
  padding: 16px 10px 12px;
  background: var(--ts-sidebar);
  border-right: 1px solid var(--ts-line-soft);
  overflow: hidden;
}

.room-sidebar .room-box {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--ts-line);
  border-radius: 8px;
  background: #0f141c;
}

.room-sidebar .room-box h2 {
  margin: 0 0 5px;
  font-size: 17px;
}

.sidebar-section-head {
  padding: 0 6px 8px;
}

.sidebar-section-head h3 {
  margin: 0;
  color: #74849a;
  font-size: 10px;
}

.room-sidebar .user-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  align-content: flex-start;
  gap: 3px;
  margin: 0;
  padding: 0 2px 0 0;
  overflow-y: auto;
}

.room-sidebar .user {
  flex: 0 0 auto;
  width: 100%;
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: default;
}

.room-sidebar .user[data-volume-user="1"] {
  cursor: context-menu;
}

.room-sidebar .user:hover {
  background: #121923;
  border-color: #1d2836;
}

.stage {
  grid-column: 2;
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  background: var(--ts-surface) !important;
}

.call-topbar {
  height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid var(--ts-line-soft);
  background: #0b0f15 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.call-topbar > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e6edf7;
  font-size: 16px;
}

.stage-surface {
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--ts-surface);
}

.stage-surface::before {
  display: none !important;
  content: none !important;
  background: none !important;
}

.video-grid {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 26px;
  gap: 28px;
  justify-content: center;
  align-content: center;
  background: transparent !important;
}

.tile-avatar,
.participant-stack .tile.screen-tile video,
.participant-stack .tile.screen-tile .placeholder,
.controls,
.controls-shell,
.connection-status {
  box-shadow: none !important;
}

.participant-stack .tile.screen-tile video,
.participant-stack .tile.screen-tile .placeholder {
  border-color: #315075 !important;
}

.controls-shell {
  padding: 10px 16px 14px;
  background: var(--ts-surface) !important;
}

.controls {
  background: #090d13;
}

.chat-panel {
  grid-column: 3;
  min-width: 0;
  padding: 0;
  background: var(--ts-panel);
  border-left: 1px solid var(--ts-line-soft);
  display: grid;
  grid-template-rows: 64px minmax(0,1fr) auto auto;
}

.chat-panel-head {
  min-height: 64px;
  padding: 0 14px 0 16px;
}

.chat-panel-head h2 {
  margin: 0;
}

.chat-panel .message-media-wrap {
  margin-top: 7px;
  max-width: 100%;
}

.chat-panel .message-media {
  display: block;
  max-width: 100%;
  max-height: 260px;
  width: auto;
  height: auto;
  border: 1px solid #263143;
  border-radius: 7px;
  object-fit: contain;
  background: #05080c;
}

.chat-panel .chat-form {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 42px;
  padding: 9px 10px 12px;
  gap: 6px;
}

.chat-panel .chat-form .chat-media-btn,
.chat-panel .chat-form .chat-send-btn {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.chat-panel .chat-form .chat-media-btn {
  background: #111823;
  border-color: #263143;
  color: #b9c7d8;
  font-size: 21px;
  font-weight: 400;
}

.chat-panel .chat-form .chat-media-btn:hover {
  background: #17202c;
}

.participant-volume-menu {
  position: fixed;
  z-index: 10020;
  width: 230px;
  padding: 12px;
  border: 1px solid #2a3749;
  border-radius: 8px;
  background: #0b1017;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}

.participant-volume-head {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.participant-volume-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e3ebf6;
  font-size: 12px;
}

.participant-volume-head span {
  flex: 0 0 auto;
  color: #8ebcff;
  font-size: 11px;
  font-weight: 800;
}

.participant-volume-menu input[type="range"] {
  width: 100%;
  margin: 0;
  padding: 0;
  accent-color: var(--ts-blue);
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 230px minmax(390px, 1fr) 300px;
  }
  .video-grid { padding-inline: 16px; gap: 20px; }
}

@media (max-width: 920px) {
  body { overflow: auto; }
  .app {
    height: auto;
    min-height: 100vh;
    grid-template-columns: minmax(210px, 245px) minmax(0, 1fr);
    grid-template-rows: minmax(620px, 100vh) minmax(360px, 60vh);
  }
  .room-sidebar { grid-column: 1; grid-row: 1; }
  .stage { grid-column: 2; grid-row: 1; }
  .chat-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    border-left: 0;
    border-top: 1px solid var(--ts-line-soft);
  }
}

@media (max-width: 680px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .room-sidebar {
    grid-column: 1;
    grid-row: 1;
    min-height: 250px;
    max-height: 40vh;
  }
  .stage {
    grid-column: 1;
    grid-row: 2;
    min-height: 620px;
  }
  .chat-panel {
    grid-column: 1;
    grid-row: 3;
    min-height: 420px;
  }
}
.participant-volume-menu { box-shadow: none !important; }

/* === USER REQUEST PATCH: square design, larger users, room meta hidden, screen replaces avatar === */
.room-sidebar .room-box h2,
.room-sidebar .room-meta {
  display: none !important;
}

.room-sidebar .room-box {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

/* Larger avatars in the left participant list */
.room-sidebar .user {
  min-height: 58px !important;
  padding: 8px 8px !important;
}

.room-sidebar .avatar {
  width: 40px !important;
  height: 40px !important;
}

.room-sidebar .user-name {
  font-size: 14px !important;
}

/* Larger center participant tile */
.participant-stack {
  width: 128px !important;
  align-items: center !important;
}

.tile.voice-tile,
.tile.screen-tile {
  width: 128px !important;
}

.tile-avatar,
.tile.voice-tile .placeholder,
.participant-stack .tile.screen-tile video,
.participant-stack .tile.screen-tile .placeholder {
  width: 128px !important;
  height: 128px !important;
  min-width: 128px !important;
  min-height: 128px !important;
}

.tile.voice-tile .label {
  margin-top: 8px !important;
}

/* Put screen share exactly in the avatar place. */
.participant-stack {
  position: relative !important;
}

.participant-stack:has(.tile.screen-tile) .tile.voice-tile .placeholder {
  visibility: hidden !important;
}

.participant-stack:has(.tile.screen-tile) .tile.screen-tile {
  position: absolute !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 3 !important;
  margin: 0 !important;
}

.participant-stack:has(.tile.screen-tile) .tile.screen-tile .label {
  display: none !important;
}

.participant-stack:has(.tile.screen-tile) .tile.voice-tile {
  position: relative !important;
  z-index: 1 !important;
}

.participant-stack:has(.tile.screen-tile) .tile.voice-tile .label {
  margin-top: 8px !important;
}

/* No rounded look anywhere important. */
button,
input,
select,
textarea,
.modal-card,
.room-sidebar,
.stage,
.chat-panel,
.room-box,
.controls,
.controls-shell,
.connection-status,
.tile,
.tile-avatar,
.tile video,
.tile .placeholder,
.user,
.avatar,
.message,
.message-image,
.message-image img,
.chat-form,
.chat-input,
.emoji-btn,
.participant-volume-menu,
.participant-volume-menu input,
.screen-viewer,
.screen-viewer video,
.screen-choice-btn,
.toast {
  border-radius: 0 !important;
}


/* ========================================================================
   WNB CALLS — UI V3
   User-selected changes only. Bottom controls intentionally untouched.
   ======================================================================== */

/* 1. Remove the room id/title from the top bar, keep only connection state. */
.call-topbar > strong {
  display: none !important;
}

.call-topbar {
  justify-content: flex-end !important;
}

/* 2. Larger central participant identity. Screen share uses this same slot. */
.participant-stack {
  width: 160px !important;
}

.tile.voice-tile,
.tile.screen-tile {
  width: 160px !important;
}

.tile-avatar,
.tile.voice-tile .placeholder,
.participant-stack .tile.screen-tile video,
.participant-stack .tile.screen-tile .placeholder {
  width: 160px !important;
  height: 160px !important;
  min-width: 160px !important;
  min-height: 160px !important;
}

.tile.voice-tile .label {
  margin-top: 9px !important;
  font-size: 14px !important;
}

/* 3. Speaking indicator: border only, no glow/shadow. */
.participant-stack.is-speaking .tile-avatar,
.participant-stack.is-speaking .tile.voice-tile .placeholder,
.participant-stack.is-speaking .tile.screen-tile video,
.participant-stack.is-speaking .tile.screen-tile .placeholder,
.room-sidebar .user.is-speaking .avatar {
  border-color: #58a6ff !important;
  outline: 1px solid #58a6ff !important;
  outline-offset: 1px !important;
  box-shadow: none !important;
}

/* 6. Collapsible chat. */
.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-toggle-btn {
  width: 32px !important;
  min-width: 32px !important;
  padding: 6px 0 !important;
  font-size: 18px !important;
  line-height: 1 !important;
}

.app.chat-collapsed {
  grid-template-columns: 260px minmax(460px, 1fr) 48px !important;
}

.app.chat-collapsed .chat-panel {
  grid-template-rows: 64px 0 0 0 !important;
  overflow: hidden !important;
}

.app.chat-collapsed .chat-panel-head {
  padding: 0 !important;
  justify-content: center !important;
}

.app.chat-collapsed .chat-panel-head h2,
.app.chat-collapsed #clearChatBtn,
.app.chat-collapsed .messages,
.app.chat-collapsed .emoji-row,
.app.chat-collapsed .chat-form {
  display: none !important;
}

.app.chat-collapsed .chat-head-actions {
  gap: 0 !important;
}

/* 7. Chat image/GIF viewer. GIF remains animated because the original image URL is reused. */
.chat-panel .message-media {
  cursor: zoom-in;
  border-radius: 0 !important;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, .92);
  cursor: zoom-out;
}

.media-viewer img {
  display: block;
  max-width: min(92vw, 1500px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid #2a3544;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: default;
}

/* 9. Compact unobtrusive system messages. */
.message.system {
  display: flex !important;
  align-items: baseline;
  gap: 6px;
  margin: 2px 0 !important;
  padding: 2px 2px !important;
  border: 0 !important;
  background: transparent !important;
  color: #6f7c8d !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.message.system .system-text {
  color: #788596 !important;
}

.message.system .system-time {
  color: #4f5967 !important;
  font-size: 10px !important;
}

/* 15. Square language everywhere in the room UI. */
.app *,
.media-viewer,
.media-viewer * {
  border-radius: 0 !important;
}

/* Keep the existing no-grid/no-glow direction explicit. */
.stage-surface,
.video-grid {
  background-image: none !important;
}

.stage-surface::before,
.stage-surface::after,
.video-grid::before,
.video-grid::after {
  display: none !important;
  content: none !important;
}

/* ========================================================================
   WNB CALLS — UI V3.1
   14: remove remaining top text/status bar.
   15: bottom controls intentionally unchanged.
   16: no decorative effects added.
   ======================================================================== */
.call-topbar {
  display: none !important;
}

.stage {
  grid-template-rows: minmax(0, 1fr) auto !important;
}

/* ========================================================================
   WNB CALLS — UI V4.1 first page
   Full-page structure using the exact room palette. No glow, gradients,
   shadows or rounded corners. Room UI and bottom call controls untouched.
   ======================================================================== */

.join-screen {
  width: 100vw !important;
  height: 100vh !important;
  min-height: 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 390px !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 0 !important;
  align-content: stretch !important;
  justify-content: stretch !important;
  overflow: hidden !important;
  background: var(--ts-surface) !important;
  color: #e6edf7 !important;
}

.join-main-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 88px minmax(0, 1fr);
  background: var(--ts-surface) !important;
  border: 0 !important;
}

.join-brand-bar {
  height: 88px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--ts-line-soft);
  background: var(--ts-surface) !important;
}

.join-brand-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 0;
  background: transparent;
}

.join-brand-mark img {
  width: 58px;
  height: 58px;
  display: block;
  object-fit: contain;
  object-position: center;
}

.join-brand-bar h1 {
  margin: 0;
  color: #eef4fc;
  font-size: 30px;
  line-height: 1;
  letter-spacing: .01em;
  font-weight: 800;
}

.join-content-shell {
  width: min(760px, calc(100% - 68px));
  margin: auto;
  padding: 34px 0 44px;
  min-height: 0;
}

.join-screen .tabs {
  height: 42px;
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--ts-line);
  background: var(--ts-panel);
}

.join-screen .tab {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid var(--ts-line);
  background: var(--ts-panel) !important;
  color: #77869a;
  box-shadow: none !important;
  filter: none !important;
}

.join-screen .tab:last-child { border-right: 0; }

.join-screen .tab:hover {
  background: var(--ts-hover) !important;
  color: #d8e2ee;
}

.join-screen .tab.active {
  background: var(--ts-surface-2) !important;
  color: #f2f6fb !important;
  box-shadow: inset 0 -2px 0 var(--ts-blue) !important;
}

.join-profile-card {
  min-height: 104px;
  padding: 16px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--ts-line);
  background: var(--ts-panel) !important;
}

.join-screen .profile-preview {
  width: 72px !important;
  height: 72px !important;
  border: 1px solid #2a3647 !important;
  background: #07090d !important;
  color: #dce7f4;
}

.join-profile-main { min-width: 0; }

.join-field-title {
  margin: 0 0 7px !important;
  color: #738298 !important;
  font-size: 10px !important;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.join-screen input,
.join-screen select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--ts-line) !important;
  background: #090d13 !important;
  color: #e5edf7 !important;
  outline: 0;
  box-shadow: none !important;
}

.join-screen input:focus,
.join-screen select:focus {
  border-color: #315075 !important;
  box-shadow: none !important;
}

.join-screen input::placeholder { color: #586578; }

.join-profile-actions {
  min-height: 25px;
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-file-input {
  position: fixed !important;
  left: -99999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.avatar-change-btn,
.avatar-remove-btn {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #9eacbd !important;
  font-size: 12px !important;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none !important;
  filter: none !important;
}

.avatar-change-btn:hover { color: #dce7f4 !important; }
.avatar-remove-btn:hover { color: #e77272 !important; }

.join-mic-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--ts-line);
  background: var(--ts-panel) !important;
}

.join-section-head {
  min-height: 28px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.join-section-head h2,
.rooms-panel-head h2 {
  margin: 0;
  color: #edf3fb;
  font-size: 16px;
}

.join-screen label {
  margin: 10px 0 6px;
  color: #738298;
  font-size: 11px;
}

.join-screen .mini-status {
  min-height: 0;
  margin: 0;
  color: #77869a;
  font-size: 11px;
}

.join-screen .mini-status:not(:empty)::before {
  content: '■';
  margin-right: 6px;
  color: #596679;
  font-size: 8px;
}

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

.join-screen button.ghost,
.join-screen .mic-test-btn,
.join-screen .mic-refresh-btn,
.join-screen .rooms-refresh-btn {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--ts-line) !important;
  background: #090d13 !important;
  color: #dbe5f3 !important;
  box-shadow: none !important;
  filter: none !important;
}

.join-screen button.ghost:hover,
.join-screen .mic-test-btn:hover,
.join-screen .mic-refresh-btn:hover,
.join-screen .rooms-refresh-btn:hover {
  background: var(--ts-hover) !important;
  border-color: #2b394d !important;
}

.join-screen .tab-panel { margin-top: 18px; }

.join-screen .form-row.two {
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 10px;
}

.join-screen .primary-btn {
  height: 46px;
  margin-top: 14px;
  border: 1px solid #3d8dff !important;
  background: var(--ts-blue) !important;
  color: #fff !important;
  box-shadow: none !important;
  filter: none !important;
}

.join-screen .primary-btn:hover { background: #559cff !important; }
.join-screen .primary-btn:disabled { opacity: .55; }

.join-screen .rooms-card {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  padding: 0 !important;
  display: grid;
  grid-template-rows: 88px minmax(0, 1fr);
  border: 0 !important;
  border-left: 1px solid var(--ts-line-soft) !important;
  background: var(--ts-sidebar) !important;
  overflow: hidden;
}

.rooms-panel-head {
  height: 88px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--ts-line-soft);
}

.rooms-panel-head small {
  display: block;
  margin-top: 4px;
  color: #617086;
  font-size: 10px;
}

.rooms-refresh-btn {
  width: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
}

.join-screen .active-rooms {
  min-height: 0;
  max-height: none !important;
  padding: 14px;
  display: flex !important;
  flex-direction: column;
  align-content: stretch;
  gap: 6px;
  overflow-y: auto;
}

.join-screen .room-item {
  min-height: 62px;
  width: 100%;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  border: 1px solid var(--ts-line) !important;
  background: var(--ts-panel) !important;
  color: #dce6f3;
  cursor: pointer;
  box-shadow: none !important;
}

.join-screen .room-item:hover {
  background: var(--ts-hover) !important;
  border-color: #2b394d !important;
}

.join-screen .room-item > div { min-width: 0; width: 100%; }
.join-screen .room-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #eef4fc;
  font-size: 14px;
}

.join-screen .room-item span {
  display: block;
  margin-top: 5px;
  color: #718198;
  font-size: 11px;
}

.join-screen .empty-list {
  min-height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ts-line);
  color: #617086;
  background: var(--ts-panel);
}

/* Absolutely no rounded corners / glow / gradients on the entry page. */
.join-screen,
.join-screen *,
.join-main-pane,
.join-brand-bar,
.join-brand-mark,
.join-content-shell,
.join-profile-card,
.join-mic-section,
.join-screen .rooms-card,
.join-screen .room-item {
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.join-screen::before,
.join-screen::after,
.join-main-pane::before,
.join-main-pane::after {
  display: none !important;
  content: none !important;
  background-image: none !important;
}

@media (max-width: 980px) {
  .join-screen {
    grid-template-columns: minmax(0, 1fr) 310px !important;
  }
  .join-content-shell {
    width: calc(100% - 40px);
  }
  .join-brand-bar { padding: 0 20px; }
}

@media (max-width: 760px) {
  .join-screen {
    overflow-y: auto !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
  }
  .join-main-pane {
    min-height: 100vh;
  }
  .join-screen .rooms-card {
    height: min(50vh, 500px);
    border-left: 0 !important;
    border-top: 1px solid var(--ts-line-soft) !important;
  }
}


/* V4.2: status labels never render decorative dots/squares. */
.mini-status::before,
.join-screen .mini-status::before {
  content: none !important;
  display: none !important;
}

/* Room rows are click targets, not selectable text. */
.join-screen .room-item {
  user-select: none;
}

/* V4.3 critical visibility fix.
   Full-page join styles use display:grid !important, so the hidden state
   needs the more specific rule below or the join screen remains over the call. */
.join-screen.hidden,
#joinScreen.hidden {
  display: none !important;
}

/* Keep the call app hidden before a successful join. */
.app.hidden,
#app.hidden {
  display: none !important;
}

/* Status text is text-only everywhere: no dots/squares/bullets. */
.mini-status::before,
.join-screen .mini-status::before,
#mediaStatus::before,
.connection-status::before {
  content: none !important;
  display: none !important;
}

/* ========================================================================
   V4.4 — screen share replaces participant avatar exactly
   ======================================================================== */

/* Explicit JS class is used instead of relying only on :has(). */
.participant-stack.has-screen-share {
  position: relative !important;
}

.participant-stack.has-screen-share .tile.voice-tile .placeholder {
  visibility: hidden !important;
}

.participant-stack.has-screen-share .tile.screen-tile {
  position: absolute !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 5 !important;
  margin: 0 !important;
}

.participant-stack.has-screen-share .tile.screen-tile .label {
  display: none !important;
}

/* Override legacy 92px max-size rules: screen and avatar use one 160px slot. */
.participant-stack .tile.screen-tile,
.participant-stack .tile.screen-tile video,
.participant-stack .tile.screen-tile .placeholder {
  width: 160px !important;
  height: 160px !important;
  min-width: 160px !important;
  min-height: 160px !important;
  max-width: 160px !important;
  max-height: 160px !important;
  box-sizing: border-box !important;
}

.participant-stack .tile.screen-tile {
  flex: 0 0 160px !important;
  border: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
}

.participant-stack .tile.screen-tile video {
  object-fit: contain !important;
  background: #000 !important;
}

/* Keep exactly one visible name: the voice/avatar tile owns the name. */
.participant-stack.has-screen-share .tile.voice-tile .label {
  visibility: visible !important;
}


/* ========================================================================
   V4.5 — one immutable media slot per participant
   Screen share overlays the avatar inside the SAME participant stack.
   The in-flow voice tile keeps the participant position fixed.
   ======================================================================== */
.participant-stack {
  position: relative !important;
  width: 160px !important;
  min-width: 160px !important;
  flex: 0 0 160px !important;
}

.participant-stack .tile.voice-tile {
  position: relative !important;
  width: 160px !important;
  min-width: 160px !important;
  z-index: 1 !important;
}

.participant-stack .tile.voice-tile .placeholder,
.participant-stack .tile-avatar {
  width: 160px !important;
  height: 160px !important;
  min-width: 160px !important;
  min-height: 160px !important;
  max-width: 160px !important;
  max-height: 160px !important;
}

.participant-stack.has-screen-share .tile.screen-tile {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 160px !important;
  height: 160px !important;
  min-width: 160px !important;
  min-height: 160px !important;
  max-width: 160px !important;
  max-height: 160px !important;
  transform: none !important;
  margin: 0 !important;
  z-index: 5 !important;
}

.participant-stack.has-screen-share .tile.screen-tile video,
.participant-stack.has-screen-share .tile.screen-tile .placeholder {
  position: absolute !important;
  inset: 0 !important;
  width: 160px !important;
  height: 160px !important;
  min-width: 160px !important;
  min-height: 160px !important;
  max-width: 160px !important;
  max-height: 160px !important;
  object-fit: cover !important;
  border: 1px solid #315075 !important;
  background: #000 !important;
}

/* The avatar remains in document flow (so no layout movement), but is invisible
   while the screen preview paints over the exact same 160x160 slot. */
.participant-stack.has-screen-share .tile.voice-tile .placeholder {
  visibility: hidden !important;
}

.participant-stack.has-screen-share .tile.screen-tile .label {
  display: none !important;
}

/* ========================================================================
   V4.8 — immutable participant slots + reliable screen preview visibility
   ======================================================================== */

/* Every participant owns one fixed slot. A screen share paints inside that slot
   and can never add width/height to the flex layout. */
.participant-stack {
  position: relative !important;
  width: 160px !important;
  min-width: 160px !important;
  max-width: 160px !important;
  min-height: 184px !important;
  flex: 0 0 160px !important;
  gap: 0 !important;
  overflow: visible !important;
}

.participant-stack .tile.voice-tile {
  position: relative !important;
  width: 160px !important;
  min-width: 160px !important;
  max-width: 160px !important;
  min-height: 184px !important;
  overflow: visible !important;
}

.participant-stack .tile.voice-tile .placeholder,
.participant-stack .tile-avatar {
  width: 160px !important;
  height: 160px !important;
  min-width: 160px !important;
  min-height: 160px !important;
  max-width: 160px !important;
  max-height: 160px !important;
  box-sizing: border-box !important;
}

.participant-stack .tile.voice-tile .label {
  display: block !important;
  width: 160px !important;
  min-height: 18px !important;
  margin: 7px 0 0 !important;
  text-align: center !important;
  visibility: visible !important;
}

.participant-stack.has-screen-share .tile.voice-tile .placeholder {
  visibility: hidden !important;
}

.participant-stack .tile.screen-tile,
.participant-stack.has-screen-share .tile.screen-tile {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  width: 160px !important;
  height: 160px !important;
  min-width: 160px !important;
  min-height: 160px !important;
  max-width: 160px !important;
  max-height: 160px !important;
  flex: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  z-index: 10 !important;
  overflow: hidden !important;
  border: 0 !important;
  background: #000 !important;
}

.participant-stack .tile.screen-tile video,
.participant-stack .tile.screen-tile .placeholder,
.participant-stack.has-screen-share .tile.screen-tile video,
.participant-stack.has-screen-share .tile.screen-tile .placeholder {
  position: absolute !important;
  inset: 0 !important;
  width: 160px !important;
  height: 160px !important;
  min-width: 160px !important;
  min-height: 160px !important;
  max-width: 160px !important;
  max-height: 160px !important;
  margin: 0 !important;
  object-fit: cover !important;
  box-sizing: border-box !important;
  border: 1px solid #315075 !important;
  background: #000 !important;
}

.participant-stack .tile.screen-tile .label,
.participant-stack.has-screen-share .tile.screen-tile .label {
  display: none !important;
}

/* Participant visibility is independent from media arrival. */
.video-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-content: center !important;
  align-items: flex-start !important;
  gap: 28px !important;
}


/* WNB CALLS application download */
.download-app-btn {
  margin-left: auto;
  height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ts-line);
  border-radius: 0;
  background: #090d13;
  color: #dbe5f3;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
  transition: none;
}

.download-app-btn:hover {
  border-color: #2b394d;
  background: var(--ts-hover);
  color: #f2f6fb;
}

.download-app-btn:focus-visible {
  outline: 1px solid #315075;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .join-brand-bar {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .download-app-btn {
    padding: 0 10px;
    font-size: 12px;
  }
}


/* Room owner controls */
.room-sidebar .room-actions .room-entry-btn {
  grid-column: auto;
}

.participant-volume-menu .participant-kick-btn {
  width: 100%;
  margin-top: 10px;
  border-radius: 0 !important;
}

.room-actions:has(#deleteRoomBtn.hidden) #copyLinkBtn {
  grid-column: auto;
}


/* V6.2 - chat scrolling and clickable links */
.chat-panel {
  min-height: 0 !important;
  overflow: hidden !important;
}

.chat-panel .messages {
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.chat-panel .message-text {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-panel .message-link {
  color: #65a8ff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
}

.chat-panel .message-link:hover {
  color: #8fc1ff;
}

/* V6.2.1 - reliable chat scrolling in Chromium/Electron */
.chat-panel {
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.chat-panel .chat-panel-head {
  flex: 0 0 64px !important;
  min-height: 64px !important;
}

.chat-panel .messages {
  flex: 1 1 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  scrollbar-gutter: stable !important;
  -webkit-overflow-scrolling: touch;
}

.chat-panel .emoji-row,
.chat-panel .chat-form {
  flex: 0 0 auto !important;
}

.chat-panel .messages::-webkit-scrollbar {
  width: 8px !important;
}

.chat-panel .messages::-webkit-scrollbar-track {
  background: #090d13 !important;
}

.chat-panel .messages::-webkit-scrollbar-thumb {
  background: #334155 !important;
  border: 0 !important;
}

.chat-panel .messages::-webkit-scrollbar-thumb:hover {
  background: #475569 !important;
}

.app.chat-collapsed .chat-panel {
  display: flex !important;
  flex-direction: column !important;
}

.app.chat-collapsed .chat-panel .messages,
.app.chat-collapsed .chat-panel .emoji-row,
.app.chat-collapsed .chat-panel .chat-form {
  display: none !important;
}

/* Account UI */
.join-brand-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-btn,
.download-app-btn {
  height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--ts-line);
  border-radius: 0 !important;
  background: #090d13;
  color: #dbe5f3;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none !important;
  transition: none !important;
}

.account-btn:hover,
.download-app-btn:hover {
  border-color: #2b394d;
  background: var(--ts-hover);
  color: #f2f6fb;
  filter: none;
}

.account-unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #315075;
  background: #163a67;
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

.account-modal-card {
  width: min(920px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  overflow: hidden;
  border-radius: 0 !important;
}

.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--ts-line);
  margin-bottom: 16px;
}

.account-tab {
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--ts-line);
  border-radius: 0 !important;
  background: #0b0f15;
  color: #7d8ca1;
  box-shadow: none !important;
}

.account-tab:last-child { border-right: 0; }
.account-tab.active { background: #111824; color: #eef4fc; }
.account-tab:hover { background: #111824; filter: none; }

.account-form {
  display: grid;
  gap: 0;
}

.account-form .primary-btn {
  margin-top: 16px;
}

.account-field-state {
  margin-top: 6px;
  color: #e06a6a;
  font-size: 12px;
}

.account-profile-line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--ts-line);
  background: #090d13;
}

.account-avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ts-line);
  background: #07090d;
  font-weight: 900;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.account-profile-line strong {
  display: block;
  color: #eef4fc;
  font-size: 15px;
}

.account-username {
  margin-top: 4px;
  color: #74849a;
  font-size: 12px;
}

.account-user-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--ts-line);
  border-top: 0;
}

.account-user-tab {
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--ts-line);
  background: #0b0f15;
  color: #7d8ca1;
  font-size: 12px;
  box-shadow: none !important;
}

.account-user-tab:last-child { border-right: 0; }
.account-user-tab.active { background: #111824; color: #eef4fc; }
.account-user-tab:hover { background: #111824; filter: none; }

.account-user-panel {
  max-height: 560px;
  overflow: auto;
  padding-top: 14px;
}

.account-profile-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.account-profile-actions button {
  flex: 1;
}

.account-logout-btn,
.account-security-action {
  width: 100%;
  margin-top: 16px;
}

.account-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 14px;
}

.account-inline-form input,
.account-inline-form button {
  height: 42px;
}

.account-list-block + .account-list-block {
  margin-top: 16px;
}

.account-list-title {
  margin-bottom: 7px;
  color: #7d8ca1;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.account-list {
  display: grid;
  gap: 6px;
}

.account-empty {
  padding: 14px;
  border: 1px solid var(--ts-line);
  background: #080b10;
  color: #68778b;
  font-size: 13px;
  text-align: center;
}

.account-person-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 7px 8px;
  border: 1px solid var(--ts-line);
  background: #090d13;
}

.account-person-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ts-line);
  background: #05070a;
  color: #dbe5f3;
  font-size: 12px;
  font-weight: 800;
}

.account-person-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.account-person-main {
  min-width: 0;
}

.account-person-name {
  overflow: hidden;
  color: #e9eff7;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-person-meta {
  margin-top: 3px;
  color: #6f7e91;
  font-size: 11px;
}

.account-person-meta.online {
  color: #7ba5d6;
}

.account-person-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.account-person-actions button {
  padding: 7px 9px;
  font-size: 11px;
}

.account-messages-panel {
  height: min(520px, calc(100vh - 250px));
  min-height: 0;
  max-height: none;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  padding-top: 14px;
  overflow: hidden;
}

.dm-threads {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--ts-line);
  border-right: 0;
  background: #070a0f;
}

.dm-thread {
  width: 100%;
  min-height: 55px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--ts-line);
  background: #080c12;
  color: #dbe5f3;
  text-align: left;
  box-shadow: none !important;
}

.dm-thread:hover,
.dm-thread.active {
  background: #111824;
  filter: none;
}

.dm-thread-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ts-line);
  background: #05070a;
  font-size: 11px;
  font-weight: 800;
}

.dm-thread-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dm-thread-main {
  min-width: 0;
}

.dm-thread-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-thread-last {
  margin-top: 4px;
  overflow: hidden;
  color: #647386;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-thread-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  background: #163a67;
  border: 1px solid #315075;
  font-size: 10px;
}

.dm-chat {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--ts-line);
  background: #080b10;
}

.dm-peer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--ts-line);
  color: #dbe5f3;
  font-size: 13px;
  font-weight: 700;
}

.dm-peer-head > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-clear-btn {
  min-height: 28px;
  padding: 0 9px;
  flex: 0 0 auto;
  border-color: #4a2a2a;
  color: #d9b0b0;
  font-size: 10px;
}

.dm-clear-btn:hover {
  border-color: #683737;
  background: #1a1012;
  color: #f0cccc;
}

.dm-messages {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 10px;
}

.dm-messages::-webkit-scrollbar {
  width: 8px;
}

.dm-messages::-webkit-scrollbar-track {
  background: #070a0f;
}

.dm-messages::-webkit-scrollbar-thumb {
  border: 1px solid #172334;
  background: #26384e;
}

.dm-messages::-webkit-scrollbar-thumb:hover {
  background: #324965;
}

.dm-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: #627084;
  font-size: 13px;
}

.dm-message {
  max-width: 82%;
  margin-bottom: 8px;
  padding: 8px 9px;
  border: 1px solid var(--ts-line);
  background: #0b1018;
}

.dm-message.mine {
  margin-left: auto;
  background: #101a28;
  border-color: #28384d;
}

.dm-message-text {
  color: #e3eaf3;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.dm-message-time {
  margin-top: 5px;
  color: #5e6d80;
  font-size: 9px;
  text-align: right;
}

.dm-message-media {
  display: block;
  max-width: min(340px, 100%);
  max-height: 260px;
  margin-top: 6px;
  border: 1px solid #263244;
  object-fit: contain;
  cursor: pointer;
}

.dm-form {
  min-width: 0;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--ts-line);
  background: #080b10;
}

.dm-form:not(.hidden) {
  display: grid;
}

.dm-form input,
.dm-form button {
  min-height: 38px;
  margin: 0;
}

.dm-media-btn {
  padding: 0;
}

.account-security-action {
  border-color: #5c2929;
}

@media (max-width: 760px) {
  .join-brand-actions { gap: 5px; }
  .account-btn,
  .download-app-btn { padding: 0 9px; font-size: 11px; }

  .account-modal-card {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
    padding: 14px;
  }

  .account-user-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .account-user-tab {
    border-bottom: 1px solid var(--ts-line);
  }

  .account-messages-panel {
    height: min(570px, calc(100vh - 255px));
    grid-template-columns: 1fr;
    grid-template-rows: 150px minmax(0, 1fr);
  }

  .dm-threads {
    border-right: 1px solid var(--ts-line);
    border-bottom: 0;
  }

  .account-person-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .account-person-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .account-person-actions button {
    flex: 1;
  }
}

/* V8.5 - compact room action grid */
.room-sidebar .room-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.room-sidebar .room-actions > button {
  width: 100%;
  min-width: 0;
}


/* V8.7 - screen share volume opens on right click */
.screen-viewer-volume-menu {
  position: fixed;
  z-index: 2;
  width: 230px;
  padding: 12px;
  border: 1px solid #2a3749;
  border-radius: 8px;
  background: #0b1017;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  color: #e3ebf6;
}

.screen-viewer-volume-menu.hidden {
  display: none !important;
}

.screen-viewer-volume-head {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.screen-viewer-volume-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e3ebf6;
  font-size: 12px;
}

.screen-viewer-volume-head span {
  flex: 0 0 auto;
  color: #8ebcff;
  font-size: 11px;
  font-weight: 800;
}

.screen-viewer-volume-menu input[type="range"] {
  width: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: var(--ts-blue);
}


/* V8.8 - compact SEO summary for the public landing page */
.seo-summary {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--ts-line-soft);
  color: #8695a9;
}

.seo-summary h2 {
  margin: 0 0 7px;
  color: #cbd6e5;
  font-size: 13px;
  font-weight: 800;
}

.seo-summary p {
  max-width: 700px;
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
}

.seo-summary-points {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: #66768d;
  font-size: 10px;
  font-weight: 700;
}

.seo-summary-points span {
  white-space: nowrap;
}
