/* CSC-Meet — glass design: translucent, blurred panels floating over the video */

:root {
  color-scheme: dark;
  --bg: #07080c;
  --text: #f5f6f8;
  --text-2: rgba(245, 246, 248, 0.74);
  --text-3: rgba(245, 246, 248, 0.5);
  --accent: #0a84ff;
  --accent-hi: #3d9cff;
  --ok: #30d158;
  --warn: #ffd60a;
  --danger: #ff453a;
  --tr: #64d2ff;
  --glass: rgba(30, 32, 40, 0.4);
  --glass-strong: rgba(20, 22, 28, 0.66);
  --glass-solid: #1b1e25;
  --fill: rgba(255, 255, 255, 0.09);
  --fill-hover: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.13);
  --blur: 26px;
  --shadow: 0 14px 44px rgba(0, 0, 0, 0.36);
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --gap: 10px;
  --dock-h: 68px;
  /* video and slides stay between the top bar and the dock, so controls never cover them */
  --top-h: 62px;
  --bottom-h: calc(var(--dock-h) + 30px);
  --strip-w: clamp(170px, 19vw, 300px);
  --panel-w: min(400px, calc(100vw - 28px));
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: clip;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; }

/* ---------- the glass material ---------- */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(175%);
  backdrop-filter: blur(var(--blur)) saturate(175%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
/* light rim: brighter on the top-left edge, like curved glass catching the light */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.1) 30%, rgba(255, 255, 255, 0.03) 60%, rgba(255, 255, 255, 0.2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(42vmax 42vmax at 12% 18%, rgba(10, 132, 255, 0.34), transparent 62%),
    radial-gradient(36vmax 36vmax at 88% 22%, rgba(191, 90, 242, 0.24), transparent 62%),
    radial-gradient(46vmax 46vmax at 62% 95%, rgba(100, 210, 255, 0.2), transparent 62%),
    var(--bg);
}

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 650;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
@media (hover: hover) { .btn:hover:not(:disabled) { background: var(--fill-hover); } }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.small { height: 36px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn.big { height: 52px; font-size: 16px; border-radius: 16px; }
.btn.ghost { background: transparent; }
@media (hover: hover) { .btn.ghost:hover:not(:disabled) { background: var(--fill); } }
.btn.primary {
  background: linear-gradient(180deg, #2b95ff, #0a7cf5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 26px rgba(10, 132, 255, 0.34);
}
@media (hover: hover) { .btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #45a3ff, #1487ff); } }
.btn.danger { background: var(--danger); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn.busy { opacity: 0.75; }
.glass-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 18px rgba(0, 0, 0, 0.3);
}
@media (hover: hover) { .glass-btn:hover { background: rgba(255, 255, 255, 0.22); } }
.round { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.link-btn { border: 0; background: none; color: var(--accent-hi); padding: 0 4px; font-weight: 600; }
.icon-btn { border: 0; background: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
@media (hover: hover) { .icon-btn:hover { background: var(--fill); color: var(--text); } }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.field input, .field select, .gloss-search, .chat-form textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: box-shadow 0.2s, background 0.2s;
}
.field input:focus, .field select:focus, .gloss-search:focus, .chat-form textarea:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: rgba(255, 255, 255, 0.1);
}
.field select option { background: var(--glass-solid); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.55), var(--tr));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* ---------- join screen (and the "you left" screen, laid out the same way) ---------- */
.join, .left {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
}
.join-bg {
  position: fixed;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  transform: scaleX(-1);
  filter: blur(44px) saturate(1.4) brightness(0.5);
  opacity: 0;
  transition: opacity 0.8s;
  pointer-events: none;
}
.join-bg.on { opacity: 1; }
.join-card {
  width: min(1000px, 100%);
  padding: 28px;
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.join-card.narrow { width: min(460px, 100%); align-items: center; text-align: center; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand h1 { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.brand p { color: var(--text-2); font-size: 14px; }
/* the company logo is dark blue and grey: it sits on a light plate to stay readable on glass */
.company-logo {
  height: 52px;
  width: auto;
  padding: 7px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  flex: none;
}
.masked { -webkit-text-security: disc; }

.lang-block { display: flex; flex-direction: column; gap: 8px; }
.lang-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.seg {
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 650;
  transition: background 0.25s var(--ease), color 0.2s, box-shadow 0.25s;
}
@media (hover: hover) { .seg:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); } }
.seg[aria-checked="true"] {
  background: rgba(255, 255, 255, 0.17);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 6px 18px rgba(0, 0, 0, 0.28);
}
.seg-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
}
.seg[aria-checked="true"] .seg-badge { background: var(--accent); color: #fff; }
.lang-hint { font-size: 13px; color: var(--text-3); padding: 0 6px; }

.join-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: start; }
.preview {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: radial-gradient(120% 120% at 30% 20%, #1b2233, #0b0d12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview.nocam video { visibility: hidden; }
.preview .avatar { position: absolute; inset: 0; display: none; place-items: center; }
.preview.nocam .avatar { display: grid; }
.preview.empty .avatar { display: none; }
.preview-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.preview-empty .btn { max-width: 100%; }
.preview-toggles { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 12px; }
.preview-toggles .round.off { background: rgba(255, 69, 58, 0.9); }
.meter { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.08); }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #b6f36a); transform-origin: left; transform: scaleX(0); transition: transform 0.08s linear; }

.join-form { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.room-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(10, 132, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.35);
  font-weight: 600;
}
.room-chip .link-btn { margin-left: auto; }

/* rooms: join one from the list or create a new one */
.room-box { display: flex; flex-direction: column; gap: 12px; }
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.mode {
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  transition: background 0.25s var(--ease), color 0.2s, box-shadow 0.25s;
}
.mode .i { width: 18px; height: 18px; flex: none; }
@media (hover: hover) { .mode:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); } }
.mode[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.17);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 6px 18px rgba(0, 0, 0, 0.28);
}
.room-list { display: flex; flex-direction: column; gap: 6px; max-height: 232px; overflow-y: auto; scrollbar-width: thin; }
.room-item {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--fill);
  color: var(--text);
  text-align: left;
  transition: background 0.2s, box-shadow 0.2s;
}
@media (hover: hover) { .room-item:hover { background: var(--fill-hover); } }
.room-item[aria-checked="true"] { background: rgba(10, 132, 255, 0.22); box-shadow: inset 0 0 0 1.5px var(--accent); }
.room-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-people { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.room-people.busy { color: var(--ok); }
.room-empty { font-size: 13px; color: var(--text-2); padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.field-hint { font-size: 12px; line-height: 1.4; color: var(--text-3); padding: 0 4px; margin-top: -4px; }
.danger-link { align-self: center; color: #ff8a80; font-size: 13px; }
.devices summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 14px;
  list-style: none;
}
.devices summary::-webkit-details-marker { display: none; }
.devices[open] { display: flex; flex-direction: column; gap: 10px; }
.hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.hint .i { width: 18px; height: 18px; }
.form-error {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 69, 58, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 69, 58, 0.4);
  color: #ffb4ae;
  font-size: 14px;
}
.built-with { text-align: center; font-size: 12px; color: var(--text-3); letter-spacing: 0.01em; }

/* ---------- call screen ---------- */
/* clip, not hidden: a hidden-overflow box can still be scrolled by focus, and the closed
   panel waiting off-screen would then drag the whole call sideways */
.call { position: fixed; inset: 0; overflow: clip; background: transparent; }
.stage { position: absolute; inset: 0; transition: right 0.35s var(--ease); }
/* on wide screens the open panel takes its own column instead of covering the video */
@media (min-width: 1180px) {
  .call.panel-open .stage { right: calc(var(--panel-w) + 14px); }
  .call.panel-open .dock,
  .call.panel-open .captions,
  .call.panel-open .ptt-hint { left: calc((100% - var(--panel-w) - 14px) / 2); }
}

.tiles {
  position: absolute;
  top: var(--top-h);
  bottom: var(--bottom-h);
  left: var(--gap);
  right: var(--gap);
  display: grid;
  gap: var(--gap);
}
.tiles[data-count="0"] { display: none; }
.tiles[data-count="1"] { grid-template: 1fr / 1fr; }
.tiles[data-count="2"] { grid-template: 1fr / 1fr 1fr; }
.tiles[data-count="3"], .tiles[data-count="4"] { grid-template: 1fr 1fr / 1fr 1fr; }
.tiles[data-count="5"], .tiles[data-count="6"], .tiles[data-count="7"] { grid-template: 1fr 1fr / 1fr 1fr 1fr; }
@media (orientation: portrait) {
  .tiles[data-count="2"] { grid-template: 1fr 1fr / 1fr; }
}

.stage[data-mode="spotlight"] .spot {
  position: absolute;
  top: var(--top-h);
  bottom: var(--bottom-h);
  left: var(--gap);
  right: calc(var(--strip-w) + var(--gap) * 2);
}
.stage[data-mode="spotlight"] .spot .tile { position: absolute; inset: 0; }
.stage[data-mode="spotlight"] .tiles {
  left: auto;
  width: var(--strip-w);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  scrollbar-width: none;
}
.stage[data-mode="spotlight"] .tiles[data-count="0"] { display: flex; }
.stage[data-mode="spotlight"] .tiles .tile { flex: none; aspect-ratio: 16 / 9; }

.tile {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  border-radius: var(--r-lg);
  background: radial-gradient(120% 120% at 30% 20%, #1a2131, #0b0d12);
  transition: box-shadow 0.25s;
}
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.screen video { object-fit: contain; background: #030406; }
.tile.fit video { object-fit: contain; }
.tile.self video { transform: scaleX(-1); }
.tile.nocam video { visibility: hidden; }
.tile .avatar { position: absolute; inset: 0; display: none; place-items: center; }
.tile.nocam .avatar { display: grid; }
.avatar span {
  width: clamp(56px, 24%, 140px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(20px, 3.4vw, 46px);
  font-weight: 700;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
}
.preview .avatar span { width: 96px; font-size: 34px; }
.tile.speaking { box-shadow: 0 0 0 2px var(--ok), 0 0 30px rgba(48, 209, 88, 0.32); }

.tile-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  height: 30px;
  padding: 0 11px 0 6px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  --blur: 18px;
}
.tile.screen .tile-label { padding-left: 11px; }
.tile-label .lang {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}
.tile.foreign .tile-label .lang { background: rgba(100, 210, 255, 0.24); color: var(--tr); }
.tile-label .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-label .mic-off { display: none; color: var(--danger); }
.tile-label .mic-off .i { width: 16px; height: 16px; }
.tile.micoff .tile-label .mic-off { display: inline-flex; }
.tile-status {
  position: absolute;
  top: 10px;
  left: 10px;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  --blur: 16px;
}
.tile-status[data-kind="weak"] { color: var(--warn); }
.tile-status[data-kind="relay"] { color: var(--tr); }
.tile-fs { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; opacity: 0; transition: opacity 0.2s; --blur: 16px; }
.tile-fs .i { width: 18px; height: 18px; }
.tile:hover .tile-fs, .tile:focus-within .tile-fs { opacity: 1; }
.tile.self .tile-fs, .tile.pip .tile-status { display: none; }

/* yourself */
.stage[data-mode="alone"] .tile.self { position: absolute; inset: var(--gap); }
/* picture-in-picture: in any corner (dragged there); in a bottom corner it rises above the
   captions by --pip-clear, which stage.js keeps up to date; takes the camera's own shape */
.tile.self.pip {
  --pip-x: calc(var(--gap) + 12px);
  position: absolute;
  right: var(--pip-x);
  bottom: max(calc(var(--bottom-h) + 12px), var(--pip-clear, 0px));
  width: clamp(150px, 17vw, 260px);
  max-height: 42vh;
  aspect-ratio: var(--ar, 16 / 9);
  z-index: 20;
  border-radius: var(--r-md);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2);
  touch-action: none;
  cursor: grab;
  transition: bottom 0.35s var(--ease), transform 0.35s var(--ease);
}
.tile.self.pip.portrait { width: clamp(96px, 9vw, 150px); }
.tile.self.pip[data-corner="tl"], .tile.self.pip[data-corner="bl"] { left: var(--pip-x); right: auto; }
.tile.self.pip[data-corner="tl"], .tile.self.pip[data-corner="tr"] { top: calc(var(--top-h) + 10px); bottom: auto; }
.tile.self.pip.dragging { transition: none; cursor: grabbing; z-index: 40; }
.tile.self.pip.speaking { box-shadow: 0 0 0 2px var(--ok), 0 12px 34px rgba(0, 0, 0, 0.5); }
.tile.pip .tile-label { height: 24px; font-size: 11px; left: 6px; bottom: 6px; }
.tile.pip .avatar span { width: 44px; font-size: 16px; }

.waiting {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  width: min(440px, calc(100vw - 32px));
  padding: 28px 30px;
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.waiting h2 { font-size: 22px; font-weight: 700; }
.waiting p { color: var(--text-2); font-size: 14px; margin-bottom: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s var(--ease);
}
.top-left, .top-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.top-right { justify-content: flex-end; }
.pill {
  pointer-events: auto;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 19px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
.pill .i { width: 18px; height: 18px; }
@media (hover: hover) { .pill-action:hover { background: rgba(60, 64, 76, 0.55); } }
.pill .sep { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.2); }
.pill .count { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.clock { font-variant-numeric: tabular-nums; color: var(--text-2); }
.tr-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.tr-pill[data-state="active"] .dot, .tr-pill[data-state="ready"] .dot { background: var(--tr); box-shadow: 0 0 10px var(--tr); }
.tr-pill[data-state="active"] { color: var(--tr); }
.tr-pill[data-state="muted"] .dot { background: var(--danger); }
.tr-pill[data-state="connecting"] .dot { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.tr-pill[data-state="error"] .dot { background: var(--danger); animation: pulse 1.2s ease-in-out infinite; }
.tr-pill[data-state="error"] { color: #ffb4ae; }
.share-pill { background: rgba(10, 132, 255, 0.34); }
.pill-btn { border: 0; height: 28px; padding: 0 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.92); color: #06080c; font-weight: 700; font-size: 13px; }

/* ---------- dock ---------- */
.dock {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 36px;
  transition: opacity 0.35s, transform 0.35s var(--ease);
}
.dock-group { display: flex; gap: 8px; }
.ctl {
  position: relative;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--text);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s, color 0.2s;
}
@media (hover: hover) { .ctl:hover:not(:disabled) { background: var(--fill-hover); } }
.ctl:active:not(:disabled) { transform: scale(0.93); }
.ctl.off { background: rgba(255, 69, 58, 0.92); color: #fff; }
.ctl.on { background: var(--accent); color: #fff; }
.ctl.soft-on { background: rgba(255, 255, 255, 0.2); }
.ctl.tr-on { background: rgba(100, 210, 255, 0.2); color: var(--tr); box-shadow: inset 0 0 0 1px rgba(100, 210, 255, 0.5); }
.ctl.ptt::after {
  content: "␣";
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 12px;
  color: var(--text-2);
}
.ctl.ptt:not(.live) { background: rgba(255, 255, 255, 0.05); color: var(--text-2); }
.ctl.ptt.live { background: var(--ok); color: #04210d; }
.ctl.danger { width: 66px; border-radius: 26px; background: var(--danger); color: #fff; }
@media (hover: hover) { .ctl.danger:hover { background: #ff6259; } }
.ctl .badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font: 700 11px/1 var(--font);
}
.mix {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.mix input { width: 120px; }

/* ---------- captions (filled in Stage 3) ---------- */
.captions {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bottom-h) + 14px);
  transform: translateX(-50%);
  z-index: 25;
  width: min(980px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transition: bottom 0.35s var(--ease);
}
.call.idle .captions { bottom: 24px; }
.cap {
  max-width: 100%;
  padding: 8px 20px 10px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(14, 16, 22, 0.52);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.3s var(--ease);
  transition: opacity 0.3s;
}
.cap.out { opacity: 0; }
.cap-who { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; color: var(--tr); margin-bottom: 2px; }
.cap-main { font-size: 22px; line-height: 1.32; font-weight: 560; }
.cap-sub { display: block; margin-top: 3px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.cap.self { padding: 6px 16px 8px; }
.cap.self .cap-who { color: var(--text-3); }
.cap.self .cap-main { font-size: 16px; color: var(--text-2); }
.cap.self .cap-sub { font-size: 12px; color: var(--text-3); }

.ptt-hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bottom-h) + 14px);
  transform: translateX(-50%);
  z-index: 26;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.call.idle { cursor: none; }
.call.idle .topbar { opacity: 0; transform: translateY(-12px); }
.call.idle .dock { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }
.call.idle .topbar *, .call.idle .ptt-hint { pointer-events: none; }

/* ---------- banners & toasts ---------- */
.banner {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 16px;
  font-weight: 600;
  color: var(--warn);
}
.banner.clickable { color: var(--text); background: rgba(10, 132, 255, 0.5); }
.toasts {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(560px, calc(100vw - 32px));
}
.toast {
  padding: 10px 18px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 550;
  text-align: center;
  overflow-wrap: anywhere;
  animation: toast-in 0.35s var(--ease);
  transition: opacity 0.35s, transform 0.35s;
}
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast.has-action { display: flex; align-items: center; gap: 12px; text-align: left; pointer-events: auto; }
.toast-btn { flex: none; border: 0; border-radius: 12px; padding: 6px 12px; background: var(--accent); color: #fff; font-weight: 650; }

/* ---------- side panel ---------- */
.panel {
  position: absolute;
  top: 64px;
  right: 14px;
  bottom: calc(var(--dock-h) + 34px);
  z-index: 28;
  width: var(--panel-w);
  border-radius: var(--r-lg);
  background: var(--glass-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.4s var(--ease), opacity 0.3s, visibility 0s linear 0.4s;
}
.panel.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.tabs { display: flex; align-items: center; gap: 4px; padding: 8px 8px 6px; overflow-x: auto; scrollbar-width: none; }
.tab {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--text-2);
  font-weight: 650;
  font-size: 14px;
}
@media (hover: hover) { .tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); } }
.tab.active { background: rgba(255, 255, 255, 0.15); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.tabs .icon-btn { margin-left: auto; flex: none; }
.tabs .tab { flex: none; padding: 0 11px; }
.tab-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
.panel-foot { padding: 10px 14px 14px; display: flex; justify-content: flex-end; }

.transcript { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.tx, .tx-event { display: flex; gap: 8px; align-items: baseline; }
.tx time, .tx-event time, .msg-head time { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; }
.tx b { flex: none; }
.tx-text { color: var(--text-2); overflow-wrap: anywhere; }
.tx-event { color: var(--text-3); font-size: 13px; }
.tx-cap .tx-body { min-width: 0; overflow-wrap: anywhere; }
.tx-cap .tx-text { color: var(--text); }
.tx-cap .lang { font-size: 10px; font-weight: 800; padding: 1px 5px; margin-left: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); color: var(--text-2); }
.tx-sub { margin-top: 2px; font-size: 12px; color: var(--text-3); }
.tx-cap.live .tx-text::after { content: " ▍"; color: var(--tr); animation: pulse 1s ease-in-out infinite; }

.chat-list { display: flex; flex-direction: column; gap: 10px; }
.msg {
  align-self: flex-start;
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 16px 16px 16px 6px;
  background: rgba(255, 255, 255, 0.08);
}
.msg.mine { align-self: flex-end; border-radius: 16px 16px 6px 16px; background: rgba(10, 132, 255, 0.32); }
.msg-head { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 2px; }
.msg-head .lang { font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); color: var(--text-2); }
.msg.foreign .msg-head .lang { color: var(--tr); background: rgba(100, 210, 255, 0.18); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-note { margin-top: 4px; font-size: 12px; color: var(--text-3); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-note.pending { font-style: italic; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; align-items: flex-end; }
.chat-form textarea { height: auto; min-height: 44px; max-height: 140px; padding: 11px 14px; resize: none; line-height: 1.4; }
.send-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; }
.send-btn .i { width: 20px; height: 20px; }

.gloss-search { margin: 4px 14px 8px; width: calc(100% - 28px); height: 40px; }
.gloss { width: 100%; border-collapse: collapse; font-size: 14px; }
.gloss th { position: sticky; top: 0; padding: 6px 8px; text-align: left; font-size: 11px; letter-spacing: 0.05em; color: var(--text-3); background: rgba(20, 22, 28, 0.9); }
.gloss td { padding: 7px 8px; border-top: 1px solid rgba(255, 255, 255, 0.07); vertical-align: top; }
@media (hover: hover) { .gloss tr:hover td { background: rgba(255, 255, 255, 0.04); } }
.empty { color: var(--text-3); font-size: 14px; padding: 10px 2px; }

/* ---------- meeting materials: list in the panel ---------- */
.mat-head { padding: 4px 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.mat-upload { align-self: flex-start; cursor: pointer; }
.mat-list { display: flex; flex-direction: column; gap: 6px; }
.mat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 8px 9px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--fill);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
@media (hover: hover) { .mat-item:hover { background: var(--fill-hover); } }
.mat-item.pending { cursor: default; opacity: 0.7; }
.mat-icon { flex: none; display: grid; color: var(--tr); }
.mat-icon .i { width: 22px; height: 22px; }
.mat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mat-name { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-meta { font-size: 12px; color: var(--text-3); }
.mat-del { flex: none; width: 32px; height: 32px; }
.mat-empty { color: var(--text-3); font-size: 14px; padding: 10px 2px; }

/* ---------- meeting materials: the viewer over the stage ---------- */
.viewer {
  position: absolute;
  top: var(--top-h);
  bottom: var(--bottom-h);
  left: var(--gap);
  right: var(--gap);
  z-index: 22; /* over the video and the PiP, under the captions */
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* nearly opaque: the video behind must not tint the text being read */
  background: rgba(16, 18, 24, 0.95);
  --blur: 30px;
}
@media (min-width: 1180px) {
  .call.panel-open .viewer { right: calc(var(--panel-w) + 14px + var(--gap)); }
}
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vw-title { flex: 1; min-width: 120px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-nav { display: flex; align-items: center; gap: 4px; }
.vw-page { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--text-2); }
.vw-follow { font-size: 13px; color: var(--text-2); }
.vw-tabs { display: none; gap: 6px; padding: 8px 12px 0; }
.vw-tab { flex: 1; height: 34px; border: 0; border-radius: 12px; background: transparent; color: var(--text-2); font-weight: 650; }
.vw-tab[aria-selected="true"] { background: rgba(255, 255, 255, 0.15); color: var(--text); }
.viewer-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }
.vw-orig { margin: 0; min-height: 0; overflow: auto; padding: 12px; display: flex; justify-content: center; align-items: flex-start; background: rgba(0, 0, 0, 0.25); }
.vw-orig img { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); background: #fff; }
.vw-tr { min-height: 0; overflow: auto; padding: 16px 20px 24px; font-size: 15px; line-height: 1.55; }
.viewer.same .viewer-body { grid-template-columns: 1fr; }
.viewer.same .vw-tr { display: none; }
.vw-note { color: var(--text-3); }
@media (max-width: 860px) {
  .vw-tabs { display: flex; }
  .viewer-body { grid-template-columns: 1fr; }
  .viewer[data-pane="tr"]:not(.same) .vw-orig { display: none; }
  .viewer[data-pane="orig"] .vw-tr { display: none; }
  .viewer.same .vw-tabs { display: none; }
  .vw-follow span { display: none; }
  #vwShow span:not([data-icon]) { display: none; }
}

/* translated pages (public/js/markdown.js) */
.md h3, .md h4, .md h5, .md h6 { margin: 14px 0 6px; line-height: 1.3; }
.md h3 { font-size: 19px; }
.md h4 { font-size: 17px; }
.md h5, .md h6 { font-size: 15px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md code { font-size: 13px; padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); }
.md-table { overflow-x: auto; margin: 0 0 12px; }
.md table { border-collapse: collapse; font-size: 14px; }
.md th, .md td { padding: 5px 8px; border: 1px solid rgba(255, 255, 255, 0.14); vertical-align: top; text-align: left; }
.md th { background: rgba(255, 255, 255, 0.08); }

/* ---------- dialogs ---------- */
dialog.dialog {
  border: 0;
  padding: 0;
  width: min(460px, calc(100vw - 32px));
  border-radius: var(--r-lg);
  color: var(--text);
  background: var(--glass-strong);
  --blur: 34px;
}
dialog.dialog.narrow { width: min(380px, calc(100vw - 32px)); }
dialog.dialog::backdrop { background: rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.dialog-body h3 { font-size: 19px; font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.mix-row { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 12px; }
.mix-row input { flex: 1; }

.left-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.left h2 { font-size: 22px; }
.audios { display: none; }

/* ---------- motion ---------- */
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- no glass available or wanted ---------- */
@media (prefers-reduced-transparency: reduce) {
  .glass, .glass-btn, dialog.dialog { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .glass-btn, dialog.dialog { background: var(--glass-solid); }
}

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .join-grid { grid-template-columns: 1fr; }
  .mix { display: none; }
}
@media (max-width: 760px) {
  :root { --dock-h: 60px; --strip-w: 100%; }
  .join { padding: 12px; place-items: start center; }
  .join-card { padding: 18px; border-radius: 26px; gap: 16px; }
  .company-logo { height: 42px; padding: 5px 9px; border-radius: 12px; }
  .brand h1 { font-size: 22px; }
  /* two columns of languages: badges line up one under another */
  .seg { justify-content: flex-start; padding: 0 14px; }
  .row2 { grid-template-columns: 1fr; }
  .dock { gap: 8px; padding: 6px 8px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .dock-group { gap: 5px; }
  .ctl { width: 44px; height: 44px; }
  .ctl .i { width: 20px; height: 20px; }
  .ctl.danger { width: 54px; }
  #btnCc, #btnTr { display: none; }
  .clock, #btnInvite span:not([data-icon]) { display: none; }
  .tr-pill { display: none; }
  :root { --top-h: 58px; --bottom-h: calc(var(--dock-h) + 22px); }
  .stage[data-mode="spotlight"] .spot { right: var(--gap); bottom: calc(var(--bottom-h) + 104px); }
  .stage[data-mode="spotlight"] .tiles { top: auto; height: 94px; width: auto; left: var(--gap); flex-direction: row; justify-content: flex-start; }
  .stage[data-mode="spotlight"] .tiles .tile { height: 100%; }
  .tile.self.pip { --pip-x: 12px; width: 108px; }
  .tile.self.pip.portrait { width: 80px; }
  .panel { top: 60px; right: 10px; left: 10px; width: auto; bottom: calc(var(--dock-h) + 26px); }
  .cap { font-size: 18px; }
}
