:root {
  --bg: #14161a;
  --panel: #1e2126;
  --panel-2: #262a31;
  --accent: #4f7cff;
  --accent-hover: #6b90ff;
  --danger: #e5484d;
  --text: #f2f3f5;
  --text-dim: #9aa1ac;
  --border: #33373f;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The single most load-bearing line in this file: several panels below
   (.status-overlay, .rtmp-panel, .background-panel, .host-settings-panel,
   .live-status, ...) set their own `display` unconditionally so they can
   lay out their contents with flex/grid once shown. Without this rule, an
   author `display` declaration always wins over the UA stylesheet's own
   `[hidden] { display: none }` default (author styles beat UA styles
   regardless of specificity), so toggling an element's `hidden` attribute
   from JS did nothing visually -- the element stayed rendered, in place,
   and (worst of all for a fixed/absolute-positioned one like the status
   overlay) still intercepting clicks meant for whatever was underneath it.
   `!important` here is deliberate: it's what lets every panel below keep
   declaring its own `display` for the *visible* state without needing to
   remember to also guard the hidden state itself. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); }

/* ---------- Landing page ---------- */
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
}

.card h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.card p.subtitle {
  margin: 0 0 24px;
  color: var(--text-dim);
  font-size: 14px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin: 16px 0 6px;
}

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}

input[type="text"]:focus { outline: 2px solid var(--accent); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.checkbox-row label { margin: 0; color: var(--text); font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary { background: var(--accent); color: white; width: 100%; margin-top: 20px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); width: 100%; margin-top: 10px; }
.btn-secondary:hover { background: #2f333b; }
.btn-danger { background: var(--danger); color: white; }
.btn-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  font-size: 18px;
}
.btn-icon.active { background: var(--danger); color: white; border-color: var(--danger); }
.btn-icon:hover { background: #2f333b; }

.control-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}
.control-group select {
  background: transparent;
  color: var(--text-dim);
  border: none;
  font-size: 12px;
  padding: 4px 2px 4px 8px;
}
.control-group .btn-icon { width: 38px; height: 38px; font-size: 15px; }

.error-text { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 16px; }

/* ---------- Room page ---------- */
.room {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.room-header .room-code { color: var(--text-dim); }
.room-code-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.room-code-label-text { color: var(--text-dim); font-size: 13px; }
.room-code-value {
  color: var(--text);
  letter-spacing: 3px;
  font-size: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
}
.btn-small { width: auto; margin: 0; padding: 7px 12px; font-size: 12px; }
.live-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--danger);
  font-weight: 600;
  font-size: 13px;
}
.live-status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.header-right { display: flex; align-items: center; gap: 10px; }
.header-right .btn-icon { width: 34px; height: 34px; font-size: 14px; }
.locked-badge { font-size: 12px; color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }

.host-settings-panel {
  position: absolute;
  top: 52px;
  right: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toggle-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; white-space: nowrap; cursor: pointer; }

.password-row { padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--border); }
.password-label { display: block; font-size: 12px; color: var(--text-dim); margin: 0 0 6px; }
.password-controls { display: flex; gap: 6px; }
.password-controls input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
}
.password-status { margin: 6px 0 0; font-size: 11px; color: var(--text-dim); }

.invite-email-panel {
  position: absolute;
  top: 52px;
  left: 20px;
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  z-index: 25;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.invite-email-panel h3 { margin: 0 0 10px; font-size: 15px; }
.invite-email-label { display: block; font-size: 12px; color: var(--text-dim); margin: 0 0 6px; }
.invite-email-panel textarea,
.invite-email-panel input[type="text"] {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
}
.invite-team-row { display: flex; gap: 6px; margin-bottom: 10px; }
.invite-team-row select {
  flex: 1;
  min-width: 0;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}
.invite-action-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.invite-email-status { margin: 8px 0 0; font-size: 12px; color: var(--text-dim); min-height: 14px; }

.teams-manage-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.teams-manage-panel h4 { margin: 0 0 8px; font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.teams-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; max-height: 140px; overflow-y: auto; }
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}
.team-count { color: var(--text-dim); font-size: 11px; }
.team-remove-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.team-remove-btn:hover { color: var(--danger); }
.teams-empty { margin: 0; font-size: 12px; color: var(--text-dim); }
.teams-add-row { display: flex; flex-direction: column; gap: 6px; }

.waiting-room-request, .participant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.waiting-room-request { background: rgba(79,124,255,0.08); border-radius: 6px; padding: 8px; margin-bottom: 6px; border-bottom: none; }
.row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.row-actions button {
  border: none;
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}
.row-actions button:hover { background: #333844; }
.row-actions button.admit { background: var(--accent); color: white; }
.row-actions button.deny, .row-actions button.remove { background: var(--danger); color: white; }
#waitingRoomRequests { margin-bottom: 10px; }
#waitingRoomRequests h4 { margin: 0 0 6px; font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }

.broadcast-group, .screenshare-group { position: relative; }
.broadcast-chooser {
  position: absolute;
  bottom: 56px;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 15;
}
.broadcast-chooser-title { margin: 0 0 2px; font-size: 12px; color: var(--text-dim); }
.broadcast-chooser button { width: 100%; text-align: left; white-space: normal; }

.reaction-group { position: relative; }
.reaction-popover {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.reaction-emoji { border: none; background: none; font-size: 22px; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.reaction-emoji:hover { background: var(--panel-2); }

.floating-reaction {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  animation: floatUp 2s ease-out forwards;
  pointer-events: none;
}
@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -60px); }
}

.hand-badge { margin-left: 4px; }

.caption-bubble {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  max-height: 3.6em;
  overflow: hidden;
  background: rgba(10, 11, 13, 0.78);
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  text-align: left;
}

.rtmp-panel {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.rtmp-panel h3 { margin: 0 0 6px; font-size: 15px; }
.rtmp-hint { margin: 0 0 14px; font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.rtmp-add-row { display: flex; gap: 6px; margin-bottom: 10px; }
.rtmp-add-row select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  padding: 6px;
}
.rtmp-add-row input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
}
.rtmp-destination-list { margin-bottom: 12px; max-height: 120px; overflow-y: auto; }
.rtmp-empty { margin: 0; font-size: 12px; color: var(--text-dim); }
.rtmp-destination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--panel-2);
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 6px;
}
.rtmp-remove-btn { border: none; background: none; color: var(--text-dim); font-size: 16px; cursor: pointer; line-height: 1; }
.rtmp-remove-btn:hover { color: var(--danger); }
.rtmp-action-row { display: flex; gap: 8px; }
.rtmp-status { margin: 10px 0 0; font-size: 12px; color: var(--text-dim); }

.poll-panel {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.poll-panel h3 { margin: 0 0 10px; font-size: 15px; padding-right: 20px; }
.poll-panel input[type="text"] { margin-bottom: 8px; }
.poll-close-btn { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; font-size: 12px; }
.poll-status { font-size: 12px; color: var(--text-dim); margin: 6px 0 0; }
#pollAddOptionBtn, #pollStartBtn, #pollEndBtn, #pollNewBtn { width: auto; margin: 6px 6px 0 0; }
.poll-option-row {
  margin-bottom: 8px;
}
.poll-option-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.poll-option-btn:disabled { cursor: default; }
.poll-option-bar {
  position: absolute;
  inset: 0;
  background: rgba(79, 124, 255, 0.25);
  z-index: 0;
  transition: width 0.2s ease;
}
.poll-option-btn.my-vote { border-color: var(--accent); }
.poll-option-btn.my-vote::after { content: ' ✓'; }
.poll-option-label { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 8px; }

.whiteboard-panel {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.whiteboard-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.whiteboard-colors { display: flex; gap: 6px; }
.whiteboard-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
}
.whiteboard-color.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
#whiteboardClearBtn { width: auto; margin: 0; }
#whiteboardCloseBtn { width: 30px; height: 30px; font-size: 13px; margin-left: auto; }
#whiteboardCanvas {
  display: block;
  background: #111318;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: crosshair;
  touch-action: none;
  max-width: 100%;
}

.background-panel {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.background-panel h3 { margin: 0 0 6px; font-size: 15px; }
.background-hint { margin: 0 0 14px; font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.background-quick-row { display: flex; gap: 8px; margin-bottom: 12px; }
.background-quick-row .btn-small.active,
.background-preset-swatch.active { outline: 2px solid var(--accent); }
.background-preset-list { display: flex; gap: 8px; flex-wrap: wrap; }
.background-preset-swatch {
  flex: 1;
  min-width: 90px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.background-preset-swatch.swatch-office { background: linear-gradient(180deg, #5b6472, #2b2f36); }
.background-preset-swatch.swatch-beach { background: linear-gradient(180deg, #8ec9e8 0%, #d9ecf2 55%, #e8d9a8 100%); }
.background-preset-swatch.swatch-space { background: radial-gradient(circle at 30% 30%, #2a3050, #0a0e1a 70%); }
.background-status { margin: 10px 0 0; font-size: 12px; color: var(--danger); min-height: 14px; }
.btn-icon:disabled { opacity: 0.4; cursor: not-allowed; }

.status-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,11,13,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.status-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  text-align: center;
  max-width: 420px;
}
.status-box h2 { margin: 0 0 10px; font-size: 20px; }
.status-box p { margin: 0; color: var(--text-dim); font-size: 14px; }

.room-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.video-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  padding: 16px;
  align-content: start;
  overflow-y: auto;
}

/* Pin/spotlight focused view: one tile large, everyone else shrinks to a
   scrollable thumbnail strip below it. `order: -1` on .pinned pulls it to
   the front of the flex-wrap regardless of the tile's actual DOM position
   (tiles are added/removed dynamically as people join/leave), and giving
   it flex-basis:100% forces every other tile to wrap onto the next line. */
.video-grid.focused-mode {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
}
.video-grid.focused-mode .tile {
  flex: 0 0 150px;
  height: 100px;
  aspect-ratio: unset;
}
.video-grid.focused-mode .tile.pinned {
  order: -1;
  flex: 1 1 100%;
  height: 65vh;
}

.tile {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
}
.tile.pinned { border-color: var(--accent); }

.tile-pin-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(10, 11, 13, 0.6);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tile:hover .tile-pin-btn, .tile-pin-btn.active { opacity: 1; }
.tile-pin-btn.active { background: var(--accent); border-color: var(--accent); }

.spotlight-badge { margin-left: 4px; }
.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.tile.no-video video { display: none; }
.tile .avatar {
  display: none;
  width: 100%; height: 100%;
  align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  background: var(--panel-2); color: var(--text);
}
.tile.no-video .avatar { display: flex; }
.tile .tile-label {
  position: absolute;
  left: 8px; bottom: 8px;
  background: rgba(0,0,0,0.55);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tile .media-hint {
  position: absolute;
  top: 8px; left: 8px; right: 8px;
  background: rgba(20, 22, 26, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  z-index: 2;
}
.tile .media-hint .btn-small { margin-top: 6px; }
.tile .badge-agent {
  background: var(--accent);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tile .mute-indicator { font-size: 12px; }

.sidebar {
  width: 300px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar.hidden { display: none; }
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.sidebar-tabs button {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 12px;
  font-size: 13px;
  cursor: pointer;
}
.sidebar-tabs button.active { color: var(--text); border-bottom: 2px solid var(--accent); }

.panel { flex: 1; overflow-y: auto; padding: 12px 14px; display: none; }
.panel.active { display: block; }

.chat-message { margin-bottom: 12px; font-size: 13px; }
.chat-message .who { color: var(--accent); font-weight: 600; margin-right: 6px; }
.chat-message .when { color: var(--text-dim); font-size: 11px; margin-left: 6px; }
.chat-message .body { margin-top: 2px; }
.chat-message .mention {
  background: rgba(88, 166, 255, 0.18);
  color: var(--accent);
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 600;
}
.chat-message .mention-self {
  background: rgba(229, 72, 77, 0.22);
  color: var(--danger);
}

#chatToggleBtn { position: relative; }
#chatToggleBtn.has-mention::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--panel-2);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
}
.chat-input-row input[type="text"] {
  flex: 1;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.chat-file-status {
  margin: 0 10px 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.chat-message .chat-file-image-link {
  display: inline-block;
  margin-top: 6px;
}
.chat-message .chat-file-image {
  display: block;
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.chat-message .chat-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}
.chat-message .chat-file-chip:hover { border-color: var(--accent); }
.chat-message .chat-file-size { color: var(--text-dim); }

.participant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

/* Visually-hidden but still present in the accessibility tree / DOM text --
   used so agent browsers reading page text (not executing JS) can still
   see live call state. See agent-bridge.js. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================== v1.9.0 ==================== */

/* Smaller companion buttons (mic audio settings, clear annotations). */
.btn-icon.btn-mini, .control-group .btn-icon.btn-mini { width: 30px; height: 30px; font-size: 14px; padding: 0; }

.audio-group { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.audio-settings-panel {
  position: absolute;
  bottom: 56px;
  left: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 15;
}
.audio-settings-hint { margin: 6px 0 0; font-size: 11px; color: var(--text-dim); }

/* Notice bars under the header: "please unmute", breakout status. */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  font-size: 13px;
  background: rgba(79, 124, 255, 0.14);
  border-bottom: 1px solid var(--border);
}
.notice-bar.breakout-banner { background: rgba(255, 176, 32, 0.14); }

.toast {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* A tile whose participant is sharing their screen: never crop a screen
   share (object-fit: contain), so what's shared is fully visible and so
   annotations map to the same spot for every viewer. */
.tile.sharing video { object-fit: contain; }
.tile.reconnecting::after {
  content: 'Reconnecting…';
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  color: #fff;
}

/* Annotation overlay: sits over the shared video, ignores the mouse
   unless this client is in draw mode (.active). */
.annotation-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.annotation-canvas.active { pointer-events: auto; cursor: crosshair; }
.annotation-group { display: inline-flex; align-items: center; gap: 4px; }
#annotationColorInput { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); padding: 2px; cursor: pointer; }

/* Breakout rooms */
.breakout-panel {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  max-height: 70vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.breakout-panel h3 { margin: 0; font-size: 15px; }
.breakout-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.breakout-setup-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 10px; }
.breakout-setup-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.breakout-setup-row input, .breakout-setup-row select { padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); width: 90px; }
.breakout-rooms-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.breakout-room { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.breakout-room-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.breakout-room-head .breakout-join-btn { margin-left: auto; }
.breakout-count { color: var(--text-dim); font-size: 12px; }
.breakout-here { margin-left: auto; font-size: 11px; color: var(--text-dim); }
.breakout-member { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 3px 0; }
.breakout-member select { padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 12px; }
.breakout-empty { font-size: 12px; color: var(--text-dim); }
.breakout-broadcast-row { display: flex; gap: 8px; margin: 12px 0 10px; }
.breakout-broadcast-row input { flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.breakout-badge { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 176, 32, 0.2); color: #ffb020; margin-left: 4px; }

/* Host announcements pushed to every breakout room. */
.chat-message.announcement .body { border-left: 3px solid #ffb020; padding-left: 8px; }
.announcement-badge { font-size: 10px; color: #ffb020; font-weight: 500; margin-left: 4px; }
