:root {
  color-scheme: dark;
  --bg: #080b14;
  --surface: rgba(18, 23, 39, .62);
  --surface-strong: rgba(23, 29, 49, .84);
  --surface-soft: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .11);
  --line-bright: rgba(255, 255, 255, .2);
  --text: #f7f9ff;
  --muted: #9da7bd;
  --violet: #8b7cff;
  --blue: #55b7ff;
  --cyan: #45e7d0;
  --green: #65e6a7;
  --red: #ff668a;
  --shadow: 0 32px 80px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(95, 89, 220, .18), transparent 43%),
    linear-gradient(145deg, #080b14 0%, #0b1020 50%, #080b14 100%);
  color: var(--text);
  font: 16px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button, select, input { min-height: 48px; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(85, 183, 255, .48);
  outline-offset: 3px;
}

.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; display: block; border-radius: 50%; filter: blur(2px); opacity: .45; will-change: transform; }
.orb-one { width: 520px; height: 520px; left: -220px; top: -180px; background: radial-gradient(circle at 35% 35%, rgba(69, 231, 208, .44), rgba(55, 104, 255, .08) 62%, transparent 72%); animation: drift-one 18s ease-in-out infinite alternate; }
.orb-two { width: 640px; height: 640px; right: -280px; top: 8%; background: radial-gradient(circle at 50%, rgba(139, 124, 255, .4), rgba(70, 36, 160, .07) 65%, transparent 73%); animation: drift-two 22s ease-in-out infinite alternate; }
.orb-three { width: 380px; height: 380px; left: 38%; bottom: -230px; background: radial-gradient(circle, rgba(49, 135, 255, .28), transparent 70%); animation: breathe 10s ease-in-out infinite; }
.grid { position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(to bottom, black, transparent 82%); }

.app-shell { width: min(1240px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 32px 24px; }
.topbar { display: flex; min-height: 88px; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 21px; font-weight: 760; letter-spacing: -.03em; }
.logo-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: linear-gradient(145deg, rgba(139,124,255,.9), rgba(63,151,255,.86)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 30px rgba(91,91,255,.24); }
.logo-mark svg { width: 24px; fill: none; stroke: white; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.logo-mark.small { width: 36px; height: 36px; border-radius: 10px; }
.privacy-chip { display: flex; min-height: 36px; align-items: center; gap: 9px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(8, 12, 22, .45); color: var(--muted); font-size: 13px; backdrop-filter: blur(18px); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(101,230,167,.1), 0 0 16px rgba(101,230,167,.7); animation: status-pulse 2.4s ease-in-out infinite; }

.lobby { display: grid; min-height: calc(100vh - 160px); grid-template-columns: minmax(0, 1.06fr) minmax(380px, .82fr); align-items: center; gap: clamp(48px, 8vw, 112px); padding: 40px 0 64px; }
.hero-copy { max-width: 660px; }
.kicker { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 24px; color: #b8c2d8; font-size: 13px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.kicker span { color: var(--cyan); text-shadow: 0 0 16px rgba(69,231,208,.8); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 24px; font-size: clamp(48px, 6.2vw, 82px); font-weight: 730; line-height: .99; letter-spacing: -.062em; }
h1 span { background: linear-gradient(100deg, #f7f9ff 0%, #8ed8ff 44%, #ae9cff 92%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-text { max-width: 600px; margin-bottom: 36px; color: var(--muted); font-size: clamp(17px, 2vw, 20px); line-height: 1.65; }
.trust-row { display: flex; align-items: center; gap: 20px; }
.trust-item { display: grid; gap: 1px; }
.trust-item strong { font-size: 19px; letter-spacing: -.02em; }
.trust-item span { color: var(--muted); font-size: 13px; }
.trust-divider { width: 1px; height: 34px; background: var(--line); }

.glass-panel, .glass-bar { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(24,31,52,.76), rgba(14,19,34,.62)); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--shadow); backdrop-filter: blur(28px) saturate(135%); -webkit-backdrop-filter: blur(28px) saturate(135%); }
.action-panel { position: relative; overflow: hidden; padding: clamp(26px, 4vw, 38px); border-radius: 24px; }
.panel-glow { position: absolute; width: 250px; height: 180px; top: -110px; right: -80px; border-radius: 50%; background: rgba(104,111,255,.24); filter: blur(45px); pointer-events: none; }
.panel-heading { position: relative; display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.panel-heading h2, .invite-card h2 { margin: 2px 0 0; font-size: 24px; line-height: 1.2; letter-spacing: -.025em; }
.overline { margin-bottom: 0; color: #8792aa; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.overline.success { margin-top: 20px; color: var(--green); }
.step-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(125,147,255,.24); border-radius: 14px; background: linear-gradient(145deg, rgba(119,102,255,.22), rgba(66,152,255,.1)); color: #a9cfff; }
.step-icon svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.invite-icon { color: var(--green); }
.panel-intro { margin-bottom: 26px; color: var(--muted); }
.field-stack { display: grid; gap: 9px; }
.field-stack label { color: #c7cede; font-size: 13px; font-weight: 650; }
.select-wrap { position: relative; display: flex; align-items: center; }
.flag { position: absolute; left: 14px; z-index: 1; display: grid; width: 30px; height: 26px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.065); color: #cbd3e6; font-size: 10px; font-weight: 800; letter-spacing: .04em; pointer-events: none; }
select, input { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.045); color: var(--text); }
select { padding: 12px 42px 12px 56px; appearance: auto; cursor: pointer; }
input { padding: 12px 14px; }
select:hover, input:hover { border-color: var(--line-bright); background: rgba(255,255,255,.065); }
.translation-flow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 14px 0; color: #727e98; }
.translation-flow span { height: 1px; background: linear-gradient(90deg, transparent, rgba(125,139,170,.3)); }
.translation-flow span:last-child { background: linear-gradient(90deg, rgba(125,139,170,.3), transparent); }
.translation-flow b { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.primary-button { position: relative; display: flex; width: 100%; min-height: 54px; align-items: center; justify-content: center; gap: 10px; overflow: hidden; margin-top: 28px; padding: 13px 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; background: linear-gradient(110deg, #7668f7, #438fe9 56%, #45c8dc); color: white; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 14px 34px rgba(57,103,230,.25); cursor: pointer; font-weight: 760; transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; }
.primary-button::before { content: ""; position: absolute; inset: 0; transform: translateX(-120%); background: linear-gradient(100deg, transparent, rgba(255,255,255,.2), transparent); transition: transform .65s ease; }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 18px 42px rgba(57,103,230,.34); }
.primary-button:hover::before { transform: translateX(120%); }
.primary-button:active:not(:disabled) { transform: translateY(0) scale(.99); }
.primary-button:disabled { cursor: wait; opacity: .65; }
.primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.primary-button:hover svg { transform: translateX(3px); }
.fine-print { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 16px 0 0; color: #78839a; font-size: 11px; text-align: center; }
.fine-print svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.message { position: relative; z-index: 2; margin-bottom: 22px; padding: 12px 14px; border: 1px solid rgba(255,102,138,.25); border-radius: 10px; background: rgba(255,102,138,.09); color: #ffb4c5; font-size: 14px; }

.invite-card { position: relative; text-align: center; }
.success-orbit { position: relative; display: grid; width: 72px; height: 72px; place-items: center; margin: 0 auto; border: 1px solid rgba(101,230,167,.25); border-radius: 50%; background: rgba(101,230,167,.08); box-shadow: 0 0 40px rgba(101,230,167,.12); }
.success-orbit::before { content: ""; position: absolute; inset: -8px; border: 1px dashed rgba(101,230,167,.22); border-radius: 50%; animation: spin 14s linear infinite; }
.success-orbit span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: var(--green); color: #092318; font-size: 20px; font-weight: 900; }
.copy-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 24px; }
.copy-box input { min-width: 0; color: #b6c0d4; }
.copy-button { min-width: 76px; border: 1px solid var(--line-bright); border-radius: 11px; background: rgba(255,255,255,.08); cursor: pointer; font-weight: 700; transition: background .2s ease, transform .2s ease; }
.copy-button:hover { transform: translateY(-1px); background: rgba(255,255,255,.13); }

.call-screen { min-height: calc(100vh - 130px); padding-bottom: 20px; animation: reveal .5s cubic-bezier(.2,.8,.2,1) both; }
.call-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 6px 0 18px; padding: 14px 16px; border-radius: 18px; }
.call-identity { display: flex; align-items: center; gap: 12px; }
.call-identity h1 { margin: 1px 0 0; font-size: 20px; line-height: 1.1; letter-spacing: -.02em; }
.connection-status { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid rgba(101,230,167,.16); border-radius: 999px; background: rgba(101,230,167,.07); color: #a9eacb; font-size: 12px; font-weight: 650; }
.connection-status > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px rgba(101,230,167,.7); }
.video-stage { position: relative; min-height: min(70vh, 720px); }
.video-card { position: relative; overflow: hidden; border: 1px solid var(--line-bright); background: #05070c; box-shadow: var(--shadow); }
.remote-card { width: 100%; height: min(70vh, 720px); border-radius: 24px; }
.local-card { position: absolute; right: 22px; bottom: 22px; z-index: 3; width: clamp(180px, 20vw, 260px); aspect-ratio: 4 / 3; border-radius: 18px; animation: float-in .6s .2s cubic-bezier(.2,.8,.2,1) both; }
.video-card video { width: 100%; height: 100%; object-fit: cover; background: #05070c; }
.video-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 65%, rgba(0,0,0,.48)); pointer-events: none; }
.video-label { position: absolute; left: 16px; bottom: 15px; z-index: 2; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 9px; background: rgba(5,8,15,.52); color: #e9edfa; font-size: 12px; backdrop-filter: blur(12px); }
.video-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
.video-placeholder strong { margin-top: 16px; color: #e8ecf8; font-size: 18px; }
.video-placeholder > span { font-size: 13px; }
.caption-panel { position: absolute; z-index: 4; left: 50%; bottom: 26px; display: grid; width: min(760px, calc(100% - 260px)); gap: 5px; padding: 12px 18px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: rgba(5,8,15,.72); box-shadow: 0 12px 36px rgba(0,0,0,.28); text-align: center; backdrop-filter: blur(18px); }
.caption-original { color: #aeb8cc; font-size: 13px; }
.caption-translated { color: white; font-size: clamp(16px, 2vw, 22px); line-height: 1.35; }
.local-caption { position: absolute; z-index: 4; right: 10px; bottom: 10px; left: 10px; overflow: hidden; padding: 7px 9px; border-radius: 8px; background: rgba(5,8,15,.68); color: #d8deec; font-size: 11px; text-align: center; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(12px); }
.control-button[aria-pressed="true"] { background: rgba(85,183,255,.13); color: #9ed8ff; }
.control-button[aria-pressed="true"] .control-icon { border-color: rgba(85,183,255,.35); background: rgba(85,183,255,.16); box-shadow: 0 0 18px rgba(85,183,255,.12); }
.waiting-rings { position: relative; width: 80px; height: 80px; }
.waiting-rings i { position: absolute; inset: 0; border: 1px solid rgba(85,183,255,.22); border-radius: 50%; animation: ring 2.4s ease-out infinite; }
.waiting-rings i:nth-child(2) { animation-delay: 1.2s; }
.waiting-rings b { position: absolute; inset: 25px; border-radius: 50%; background: linear-gradient(145deg, var(--violet), var(--blue)); box-shadow: 0 0 30px rgba(85,183,255,.35); }
.controls { position: sticky; z-index: 5; bottom: 18px; display: flex; width: max-content; max-width: calc(100% - 24px); align-items: center; justify-content: center; gap: 10px; margin: -2px auto 0; padding: 9px; border-radius: 20px; transform: translateY(-50%); }
.control-button { display: flex; min-width: 104px; align-items: center; justify-content: center; gap: 9px; padding: 8px 13px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: #c6cede; cursor: pointer; font-size: 13px; font-weight: 680; transition: background .2s ease, color .2s ease, transform .2s ease; }
.control-button:hover { transform: translateY(-1px); background: rgba(255,255,255,.08); color: white; }
.control-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.06); }
.control-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.end-button { color: #ffb2c3; }
.end-button .control-icon { border-color: rgba(255,102,138,.22); background: rgba(255,102,138,.13); }
.end-button:hover { background: rgba(255,102,138,.13); color: #ffd0da; }

.footer { display: flex; justify-content: center; gap: 10px; padding: 20px 0 4px; color: #68738a; font-size: 11px; letter-spacing: .04em; }
[hidden] { display: none !important; }
.enter-up { animation: enter-up .75s cubic-bezier(.2,.8,.2,1) both; }
.delay-one { animation-delay: .12s; }

@keyframes enter-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes reveal { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }
@keyframes float-in { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes drift-one { to { transform: translate(90px, 70px) scale(1.08); } }
@keyframes drift-two { to { transform: translate(-100px, 80px) scale(.94); } }
@keyframes breathe { 50% { transform: scale(1.18); opacity: .62; } }
@keyframes status-pulse { 50% { opacity: .55; box-shadow: 0 0 0 7px rgba(101,230,167,0), 0 0 18px rgba(101,230,167,.75); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring { 0% { transform: scale(.4); opacity: 0; } 28% { opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

@media (max-width: 900px) {
  .lobby { grid-template-columns: 1fr; gap: 48px; padding-top: 42px; }
  .hero-copy { max-width: 720px; text-align: center; }
  .kicker { justify-content: center; }
  .hero-text { margin-right: auto; margin-left: auto; }
  .trust-row { justify-content: center; }
  .action-panel { width: min(560px, 100%); margin: 0 auto; }
  h1 { font-size: clamp(46px, 10vw, 72px); }
}

@media (max-width: 600px) {
  .app-shell { padding: 0 16px 12px; }
  .topbar { min-height: 72px; }
  .privacy-chip { width: 36px; height: 36px; justify-content: center; padding: 0; }
  .privacy-chip .live-dot { display: block; }
  .privacy-chip { font-size: 0; }
  .lobby { min-height: auto; gap: 36px; padding: 36px 0 48px; }
  h1 { margin-bottom: 20px; font-size: clamp(42px, 13vw, 58px); }
  .hero-text { margin-bottom: 28px; font-size: 16px; }
  .trust-row { gap: 14px; }
  .trust-divider { height: 30px; }
  .trust-item strong { font-size: 17px; }
  .trust-item span { font-size: 11px; }
  .action-panel { padding: 24px 19px; border-radius: 20px; }
  .panel-heading h2, .invite-card h2 { font-size: 21px; }
  .copy-box { grid-template-columns: 1fr; }
  .copy-button { width: 100%; }
  .call-header { align-items: flex-start; flex-direction: column; }
  .connection-status { align-self: stretch; justify-content: center; }
  .remote-card { height: calc(100vh - 238px); min-height: 460px; border-radius: 18px; }
  .local-card { right: 12px; bottom: 12px; width: 124px; border-radius: 13px; }
  .caption-panel { bottom: 126px; width: calc(100% - 32px); padding: 10px 12px; }
  .caption-original { font-size: 11px; }
  .caption-translated { font-size: 16px; }
  .controls { position: relative; bottom: auto; width: 100%; gap: 4px; margin: 12px auto 0; padding: 7px; transform: none; }
  .control-button { min-width: 0; flex: 1; flex-direction: column; gap: 4px; padding: 6px; font-size: 10px; }
  .control-icon { width: 32px; height: 32px; }
  .footer { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}


/* Call room sidebar */
.call-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
}

.media-column { min-width: 0; }
.call-workspace .remote-card { height: min(65vh, 650px); }

.room-sidebar {
  display: grid;
  height: min(74vh, 740px);
  min-height: 620px;
  grid-template-rows: minmax(0, 1.05fr) minmax(0, .95fr);
  overflow: hidden;
  padding: 0;
  border-radius: 24px;
}

.sidebar-section {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 22px;
}

.transcript-section { border-bottom: 1px solid var(--line); }
.chat-section { grid-template-rows: auto minmax(0, 1fr) auto; }

.sidebar-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.sidebar-heading.compact { margin-bottom: 12px; }
.sidebar-heading h2 { margin: 2px 0 0; font-size: 17px; letter-spacing: -.02em; }
.sidebar-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid rgba(101,230,167,.14); border-radius: 999px; background: rgba(101,230,167,.07); color: #9ce5c2; font-size: 10px; font-weight: 750; }
.sidebar-status .live-dot { width: 6px; height: 6px; }

.transcript-list, .chat-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
}

.transcript-list { display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.chat-list { display: flex; flex-direction: column; gap: 9px; padding: 2px 4px 10px 0; }

.empty-state {
  display: grid;
  height: 100%;
  min-height: 150px;
  place-content: center;
  justify-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong { margin-top: 10px; color: #d8deec; font-size: 13px; }
.empty-state p { max-width: 230px; margin: 5px 0 0; font-size: 11px; line-height: 1.45; }
.compact-empty { min-height: 90px; }
.empty-icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: rgba(85,183,255,.08); color: #99d5ff; font-size: 14px; font-weight: 800; }

.transcript-entry {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
  animation: enter-up .28s ease both;
}

.transcript-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: #78839a; font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.transcript-source { margin: 0 0 4px; color: #aeb8cc; font-size: 11px; line-height: 1.4; }
.transcript-translation { margin: 0; color: #f4f7ff; font-size: 14px; font-weight: 650; line-height: 1.45; }
.transcript-entry.you { border-color: rgba(85,183,255,.16); background: rgba(85,183,255,.055); }

.chat-message { max-width: 86%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 13px 13px 13px 4px; background: rgba(255,255,255,.055); animation: enter-up .25s ease both; }
.chat-message.outgoing { align-self: flex-end; border-color: rgba(106,121,255,.24); border-radius: 13px 13px 4px 13px; background: linear-gradient(135deg, rgba(116,101,245,.2), rgba(68,143,233,.14)); }
.chat-message p { margin: 0; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.chat-message .chat-translated { margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(255,255,255,.08); color: #b9ddff; }
.chat-message time { display: block; margin-top: 5px; color: #707b91; font-size: 9px; text-align: right; }

.chat-form { padding-top: 10px; border-top: 1px solid var(--line); }
.translate-toggle { display: flex; min-height: 28px; align-items: center; gap: 8px; margin-bottom: 8px; color: #929db3; font-size: 10px; cursor: pointer; }
.translate-toggle input { width: 15px; min-height: 15px; accent-color: var(--blue); }
.chat-compose { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 7px; }
.chat-compose input { min-height: 42px; padding: 9px 11px; font-size: 12px; }
.chat-compose button { display: grid; min-height: 42px; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 11px; background: linear-gradient(135deg, var(--violet), var(--blue)); cursor: pointer; box-shadow: 0 8px 22px rgba(66,126,235,.2); transition: transform .2s ease, filter .2s ease; }
.chat-compose button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.chat-compose button svg { width: 18px; fill: none; stroke: white; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1080px) {
  .call-workspace { grid-template-columns: minmax(0, 1fr) 320px; }
  .control-button { min-width: 82px; }
}

@media (max-width: 900px) {
  .call-workspace { grid-template-columns: 1fr; }
  .room-sidebar { height: 650px; min-height: 0; grid-template-rows: 1fr 1fr; }
  .call-workspace .remote-card { height: min(66vh, 620px); }
}

@media (max-width: 600px) {
  .room-sidebar { height: 640px; border-radius: 18px; }
  .sidebar-section { padding: 18px 16px; }
  .call-workspace { gap: 14px; }
  .call-workspace .remote-card { height: calc(100vh - 238px); min-height: 460px; }
  .control-button { min-width: 0; }
}


/* Refined right-side glass rail */
.call-header-actions { display: flex; align-items: center; gap: 10px; }
.sidebar-toggle {
  display: none;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(139,124,255,.24);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(139,124,255,.15), rgba(85,183,255,.08));
  color: #c8d9ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(18px);
}
.sidebar-toggle svg, .sidebar-close svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.call-workspace {
  grid-template-columns: minmax(0, 1fr) clamp(320px, 28vw, 380px);
  align-items: start;
}

.room-sidebar {
  position: relative;
  isolation: isolate;
  height: min(74vh, 740px);
  border-color: rgba(147,163,255,.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(118,104,247,.18), transparent 34%),
    linear-gradient(155deg, rgba(25,32,55,.86), rgba(11,16,30,.78));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.11),
    inset 1px 0 0 rgba(120,183,255,.05),
    0 28px 70px rgba(0,0,0,.38),
    0 0 0 1px rgba(65,91,160,.05);
}

.room-sidebar::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  right: 24px;
  left: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110,199,255,.75), rgba(151,124,255,.72), transparent);
  box-shadow: 0 0 18px rgba(111,154,255,.45);
  pointer-events: none;
}

.room-sidebar::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 190px;
  height: 190px;
  top: -90px;
  right: -80px;
  border-radius: 50%;
  background: rgba(114,92,255,.16);
  filter: blur(44px);
  pointer-events: none;
}

.sidebar-section { position: relative; z-index: 1; }
.sidebar-heading h2 { font-size: 18px; }
.transcript-entry, .chat-message {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 8px 24px rgba(0,0,0,.08);
}
.transcript-entry:hover { border-color: rgba(110,172,255,.2); background: rgba(255,255,255,.05); }
.chat-compose input { background: rgba(4,8,18,.42); }
.sidebar-close { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) and (min-width: 721px) {
  .call-workspace { grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
  .room-sidebar { height: min(74vh, 700px); min-height: 600px; }
  .sidebar-section { padding: 18px 16px; }
  .sidebar-heading h2 { font-size: 16px; }
  .call-workspace .remote-card { height: min(64vh, 610px); }
}

@media (max-width: 720px) {
  body.sidebar-open { overflow: hidden; }
  .call-screen { animation: none; transform: none; }
  .call-header-actions { width: 100%; align-items: stretch; }
  .call-header-actions .connection-status { flex: 1; }
  .sidebar-toggle { display: inline-flex; justify-content: center; }
  .sidebar-toggle span { display: none; }
  .call-workspace { display: block; }
  .room-sidebar {
    position: fixed;
    z-index: 40;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(380px, calc(100vw - 24px));
    height: auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1.08fr) minmax(0, .92fr);
    border-radius: 22px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(100% + 28px)) scale(.985);
    transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .24s ease;
  }
  .room-sidebar.is-open { opacity: 1; pointer-events: auto; transform: translateX(0) scale(1); }
  .sidebar-close {
    position: absolute;
    z-index: 5;
    top: 14px;
    right: 14px;
    display: grid;
    width: 36px;
    min-height: 36px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255,255,255,.07);
    color: #cbd4e8;
    cursor: pointer;
  }
  .sidebar-backdrop {
    position: fixed;
    z-index: 39;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(2,5,12,.66);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(8px);
    transition: opacity .25s ease;
  }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .sidebar-heading { padding-right: 34px; }
  .sidebar-status { margin-right: 30px; }
}


/* Voice translation test studio */
body.test-room-open { overflow: hidden; }

.test-room-entry {
  display: grid;
  width: 100%;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(115,155,255,.2);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(91,113,236,.11), rgba(67,184,255,.055));
  color: #edf3ff;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.test-room-entry:hover { transform: translateY(-1px); border-color: rgba(123,178,255,.38); background: linear-gradient(135deg, rgba(91,113,236,.18), rgba(67,184,255,.09)); }
.test-room-entry > span:nth-child(2) { display: grid; gap: 3px; }
.test-room-entry b { font-size: 13px; }
.test-room-entry small { color: #8996ae; font-size: 10px; line-height: 1.35; }
.test-entry-icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(135,159,255,.22); border-radius: 12px; background: rgba(114,104,246,.14); color: #a7c8ff; }
.test-entry-icon svg, .test-entry-arrow { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.test-entry-arrow { color: #7887a4; }

.test-room-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}
.test-room-overlay[hidden] { display: none; }
.test-room-backdrop { position: absolute; inset: 0; background: rgba(3,6,15,.8); backdrop-filter: blur(16px); }
.test-room-card {
  position: relative;
  isolation: isolate;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: clamp(24px, 4vw, 38px);
  border-color: rgba(137,155,255,.26);
  border-radius: 28px;
  background:
    radial-gradient(circle at 85% 0%, rgba(115,91,255,.22), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(65,177,255,.1), transparent 35%),
    linear-gradient(150deg, rgba(24,31,55,.96), rgba(8,13,26,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 42px 120px rgba(0,0,0,.6);
  animation: test-room-in .32s cubic-bezier(.2,.85,.25,1) both;
}
.test-room-glow { position: absolute; z-index: -1; top: -110px; right: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(113,91,255,.18); filter: blur(50px); }
.test-room-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.test-room-header h2 { margin: 4px 0 8px; font-size: clamp(25px, 4vw, 36px); letter-spacing: -.04em; }
.test-room-header p:last-child { max-width: 520px; margin: 0; color: #9aa6bb; font-size: 13px; line-height: 1.55; }
.test-room-close { display: grid; flex: 0 0 auto; width: 42px; min-height: 42px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.06); color: #c9d2e5; cursor: pointer; }
.test-room-close svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.test-language-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 14px; margin: 28px 0 18px; }
.test-language-row label { display: grid; gap: 7px; color: #aeb8cc; font-size: 11px; font-weight: 700; }
.test-language-row select { width: 100%; min-height: 48px; padding: 0 38px 0 14px; border: 1px solid rgba(255,255,255,.11); border-radius: 13px; background-color: rgba(5,9,19,.52); color: #f4f7ff; }
.test-language-arrow { display: grid; width: 34px; height: 48px; place-items: center; color: #7d8aff; font-size: 19px; }
.test-status-row { display: flex; min-height: 38px; align-items: center; gap: 9px; margin-bottom: 14px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; background: rgba(3,7,16,.28); color: #aeb8cc; font-size: 11px; }
.test-status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #6d778c; box-shadow: 0 0 0 4px rgba(109,119,140,.08); }
.test-status-dot.listening, .test-status-dot.speaking { background: #65e6a7; box-shadow: 0 0 0 4px rgba(101,230,167,.1), 0 0 16px rgba(101,230,167,.5); animation: test-pulse 1.1s ease infinite; }
.test-status-dot.working { background: #79b9ff; box-shadow: 0 0 0 4px rgba(85,183,255,.1); animation: test-pulse .8s ease infinite; }
.test-status-dot.success { background: #65e6a7; }
.test-status-dot.error { background: #ff718d; box-shadow: 0 0 0 4px rgba(255,113,141,.1); }
.test-voice-name { margin-left: auto; overflow: hidden; color: #7f8da6; text-overflow: ellipsis; white-space: nowrap; }
.test-voice-name.missing { color: #f0a9b6; }

.test-results { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.test-result-card { min-height: 150px; padding: 18px; border: 1px solid rgba(255,255,255,.09); border-radius: 17px; background: rgba(255,255,255,.035); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.test-result-card.translated { border-color: rgba(105,144,255,.22); background: linear-gradient(145deg, rgba(103,94,236,.1), rgba(57,151,238,.055)); }
.test-result-label { color: #7f8aa1; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.test-result-text { margin: 14px 0 0; color: #f5f8ff; font-size: clamp(17px, 2.4vw, 22px); font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.test-result-text.muted { color: #7e899f; font-weight: 500; }

.test-room-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.test-room-actions button { min-height: 52px; }
.test-primary { margin-top: 0; }
.test-primary.is-listening { background: linear-gradient(135deg, #ff5f7d, #d84d72); box-shadow: 0 12px 35px rgba(231,77,113,.28); }
.test-mic-icon { color: currentColor; font-size: 10px; }
.test-primary.is-listening .test-mic-icon { animation: test-pulse .85s ease infinite; }
.test-secondary { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 16px; border: 1px solid rgba(117,158,255,.22); border-radius: 14px; background: rgba(82,112,200,.1); color: #dfeaff; font-weight: 750; cursor: pointer; }
.test-secondary:disabled { opacity: .42; cursor: not-allowed; }
.test-secondary:not(:disabled):hover { border-color: rgba(117,183,255,.45); background: rgba(82,129,218,.16); }
.test-secondary svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.test-help { margin: 14px 0 0; color: #707d94; font-size: 10px; line-height: 1.5; text-align: center; }

.local-caption { max-height: 92px; overflow-y: auto; text-overflow: clip; white-space: normal; line-height: 1.4; }

@keyframes test-room-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes test-pulse { 50% { opacity: .5; transform: scale(.85); } }

@media (max-width: 640px) {
  .test-room-overlay { padding: 10px; }
  .test-room-card { max-height: calc(100vh - 20px); padding: 22px 16px; border-radius: 22px; }
  .test-room-header { gap: 12px; }
  .test-room-header h2 { font-size: 25px; }
  .test-language-row { gap: 8px; margin-top: 22px; }
  .test-language-arrow { width: 20px; }
  .test-results { grid-template-columns: 1fr; }
  .test-result-card { min-height: 112px; }
  .test-room-actions { grid-template-columns: 1fr; }
  .test-status-row { flex-wrap: wrap; }
  .test-voice-name { width: 100%; margin-left: 16px; }
}


/* Free local neural voice progress */
.test-model-progress {
  height: 5px;
  overflow: hidden;
  margin: -6px 2px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.065);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.25);
}
.test-model-progress[hidden] { display: none; }
.test-model-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #796cff, #42c7e8);
  box-shadow: 0 0 14px rgba(80,188,255,.55);
  transition: width .25s ease;
}


/* Resilient call effects */
.effects-control { position: relative; }
.effects-control > .control-button { width: 100%; }
.effects-button.is-open, #effects-button.is-open { color: #d9d1ff; background: rgba(125,104,255,.13); }
.effects-panel {
  position: absolute;
  z-index: 30;
  right: 0;
  bottom: calc(100% + 14px);
  width: 310px;
  padding: 16px;
  border: 1px solid rgba(142,155,255,.25);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(120,97,255,.2), transparent 38%),
    linear-gradient(150deg, rgba(25,32,55,.97), rgba(8,13,26,.97));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 25px 70px rgba(0,0,0,.5);
  backdrop-filter: blur(24px);
  animation: effects-in .2s cubic-bezier(.2,.85,.25,1) both;
}
.effects-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.effects-heading span { color: #929db3; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.effects-heading small { color: #69758b; font-size: 9px; }
.reaction-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.reaction-grid button {
  display: grid;
  min-height: 45px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  font-size: 21px;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.reaction-grid button:hover { transform: translateY(-3px) scale(1.06); border-color: rgba(127,174,255,.3); background: rgba(91,123,225,.13); }
.effects-divider { height: 1px; margin: 14px 0; background: rgba(255,255,255,.08); }
.beauty-button { display: grid; width: 100%; grid-template-columns: 38px minmax(0,1fr) 32px; align-items: center; gap: 10px; padding: 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.035); color: #dce5f7; text-align: left; cursor: pointer; }
.beauty-button:hover { border-color: rgba(128,175,255,.24); background: rgba(85,134,225,.08); }
.beauty-button > span:nth-child(2) { display: grid; gap: 3px; }
.beauty-button b { font-size: 12px; }
.beauty-button small { color: #7f8ba1; font-size: 9px; line-height: 1.35; }
.beauty-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(154,127,255,.2); border-radius: 11px; background: rgba(126,103,243,.11); color: #beaaff; font-size: 18px; }
.beauty-button i { position: relative; width: 31px; height: 18px; border-radius: 999px; background: #31394a; transition: background .2s ease; }
.beauty-button i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #929caf; transition: transform .2s ease, background .2s ease; }
.beauty-button[aria-pressed="true"] { border-color: rgba(101,230,167,.2); background: rgba(101,230,167,.055); }
.beauty-button[aria-pressed="true"] i { background: rgba(101,230,167,.38); }
.beauty-button[aria-pressed="true"] i::after { transform: translateX(13px); background: #8cf0bd; }
.beauty-preview { filter: blur(.2px) brightness(1.07) contrast(.94) saturate(1.06); }

.reaction-layer { position: absolute; z-index: 18; inset: 0; overflow: hidden; pointer-events: none; }
.reaction-burst { position: absolute; right: 18%; bottom: 15%; width: 1px; height: 1px; }
.reaction-burst.outgoing { right: auto; left: 18%; }
.reaction-burst span {
  position: absolute;
  left: 0;
  bottom: 0;
  opacity: 0;
  font-size: clamp(26px, 4vw, 46px);
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
  animation: reaction-rise 2.25s var(--reaction-delay) cubic-bezier(.18,.75,.22,1) forwards;
}

@keyframes effects-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes reaction-rise {
  0% { opacity: 0; transform: translate(0, 30px) scale(.35) rotate(-12deg); }
  16% { opacity: 1; }
  70% { opacity: .96; }
  100% { opacity: 0; transform: translate(var(--reaction-x), -330px) scale(var(--reaction-scale)) rotate(14deg); }
}

@media (max-width: 720px) {
  .effects-control { flex: 1 1 0; min-width: 0; }
  .effects-panel { position: fixed; right: 12px; bottom: 106px; width: min(330px, calc(100vw - 24px)); }
  .reaction-burst { right: 28%; bottom: 18%; }
  .reaction-burst.outgoing { left: 28%; }
}


/* Focus view, background AI, and refined call surfaces */
.call-header { border-color: rgba(135,153,255,.2); background: linear-gradient(135deg, rgba(22,29,52,.84), rgba(10,15,29,.8)); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 18px 48px rgba(0,0,0,.18); }
.connection-status { min-height: 34px; border-color: rgba(101,230,167,.2); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.video-card { cursor: pointer; outline: none; transition: border-color .25s ease, box-shadow .25s ease, transform .28s cubic-bezier(.2,.8,.2,1); }
.video-card:hover { border-color: rgba(131,157,255,.36); box-shadow: 0 24px 75px rgba(0,0,0,.46), 0 0 0 1px rgba(110,139,255,.08); }
.video-card:focus-visible { box-shadow: 0 0 0 3px rgba(91,161,255,.32), var(--shadow); }
.video-card.is-focused { cursor: default; }
.focus-hint { position: absolute; z-index: 6; top: 14px; right: 14px; display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; background: rgba(7,11,22,.58); color: #cbd4e7; font-size: 10px; font-weight: 720; letter-spacing: .02em; opacity: .62; backdrop-filter: blur(14px); transition: opacity .2s ease, transform .2s ease; }
.video-card:hover .focus-hint { opacity: 1; transform: translateY(-1px); }
.video-card.is-focused .focus-hint { opacity: 0; pointer-events: none; }
.video-stage.focus-local .local-card { position: relative; z-index: 1; right: auto; bottom: auto; width: 100%; height: min(70vh, 720px); aspect-ratio: auto; border-radius: 24px; animation: focus-view-in .34s cubic-bezier(.2,.82,.2,1) both; }
.video-stage.focus-local .remote-card { position: absolute; z-index: 7; right: 22px; bottom: 22px; width: clamp(180px, 20vw, 260px); height: auto; aspect-ratio: 4 / 3; border-radius: 18px; animation: focus-pip-in .34s cubic-bezier(.2,.82,.2,1) both; }
.video-stage.focus-local .remote-card .caption-panel { display: none; }
.video-card:fullscreen { width: 100vw !important; height: 100vh !important; max-width: none !important; border: 0; border-radius: 0 !important; background: #02040a; }
.video-card:fullscreen video { object-fit: contain; }
.controls { border-color: rgba(132,151,255,.2); background: linear-gradient(145deg, rgba(20,27,48,.9), rgba(8,13,25,.9)); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 22px 65px rgba(0,0,0,.38); }
.control-button { min-width: 96px; }
.effects-panel { width: 340px; padding: 17px; border-color: rgba(151,135,255,.28); }
.effects-heading.compact { margin-top: 1px; margin-bottom: 10px; }
.video-effect-button + .video-effect-button { margin-top: 8px; }
.video-effect-button { transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.video-effect-button:hover { transform: translateY(-1px); }
.background-icon { border-color: rgba(80,206,255,.22); background: linear-gradient(145deg, rgba(70,190,255,.14), rgba(121,87,255,.13)); color: #82dcff; }
.background-icon::after { content: ""; width: 13px; height: 13px; border: 1px dashed currentColor; border-radius: 50%; opacity: .65; }
.beauty-button:disabled { cursor: wait; opacity: .7; }

@keyframes focus-view-in { from { opacity: .72; transform: scale(.975); } to { opacity: 1; transform: scale(1); } }
@keyframes focus-pip-in { from { opacity: .5; transform: translateY(12px) scale(.92); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 720px) {
  .video-stage.focus-local .local-card { height: min(66vh, 620px); border-radius: 20px; }
  .video-stage.focus-local .remote-card { right: 10px; bottom: 10px; width: 132px; border-radius: 14px; }
  .focus-hint { top: 9px; right: 9px; min-height: 24px; padding: 4px 7px; font-size: 9px; }
  .effects-panel { width: min(350px, calc(100vw - 24px)); }
  .control-button { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .video-stage.focus-local .local-card, .video-stage.focus-local .remote-card { animation: none; }
}

/* Keep the picture-in-picture tile clear of the floating control dock. */
.video-stage:not(.focus-local) .local-card,
.video-stage.focus-local .remote-card { bottom: 72px; }
@media (max-width: 720px) {
  .video-stage:not(.focus-local) .local-card,
  .video-stage.focus-local .remote-card { bottom: 64px; }
}

.video-stage.focus-local .remote-card { min-height: 0; }

/* Simplify waiting content inside the small picture-in-picture tile. */
.video-stage.focus-local .remote-card .video-placeholder strong,
.video-stage.focus-local .remote-card .video-placeholder > span { display: none; }
.video-stage.focus-local .remote-card .waiting-rings { width: 44px; height: 44px; }
.video-stage.focus-local .remote-card .waiting-rings b { inset: 14px; }
.video-stage.focus-local .remote-card .video-label { left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 5px 7px; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* Show the exact processed outgoing video in the local tile. */
.local-effects-preview { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #05070c; pointer-events: none; }
.video-card .video-shade { z-index: 2; }
.video-card .video-label { z-index: 3; }
.local-card .local-caption { z-index: 4; }


/* Icon-first call experience */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
body.call-active .topbar,
body.call-active .footer { display: none; }
body.call-active .app-shell { width: min(1480px, 100%); padding-top: 18px; }
body.call-active .call-screen { min-height: 100vh; padding-bottom: 104px; }
body.call-active .call-header { min-height: 58px; margin: 0 0 14px; padding: 0 4px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.call-identity { min-width: 54px; }
.call-logo-mark { position: relative; display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(144,160,255,.34); border-radius: 17px; background: radial-gradient(circle at 35% 25%, rgba(135,175,255,.95), rgba(85,92,232,.92) 52%, rgba(79,47,171,.95)); box-shadow: inset 0 1px 0 rgba(255,255,255,.48), 0 12px 32px rgba(73,91,225,.31); isolation: isolate; animation: call-logo-float 4.2s ease-in-out infinite; }
.call-logo-mark::before { content: ""; position: absolute; z-index: -1; inset: -7px; border: 1px solid rgba(105,160,255,.18); border-radius: 21px; animation: call-logo-breathe 2.8s ease-in-out infinite; }
.call-logo-mark i { position: absolute; z-index: -1; inset: -11px; border: 1px solid rgba(119,97,255,.2); border-radius: 24px; opacity: 0; animation: call-logo-orbit 3.4s ease-out infinite; }
.call-logo-mark i:nth-child(2) { animation-delay: 1.7s; }
.call-logo-mark svg { width: 24px; fill: none; stroke: white; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 6px rgba(18,26,84,.35)); }
.call-header-actions { display: flex; align-items: center; gap: 9px; }
body.call-active .connection-status { align-self: auto; min-width: 0; max-width: min(52vw, 430px); min-height: 40px; justify-content: flex-start; padding: 8px 13px; border: 1px solid rgba(111,229,174,.2); border-radius: 14px; background: linear-gradient(145deg, rgba(24,48,49,.62), rgba(12,24,36,.72)); box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 10px 28px rgba(0,0,0,.18); color: #b9efd4; backdrop-filter: blur(20px); }
.connection-status > .status-dot { flex: 0 0 7px; width: 7px; height: 7px; background: #6ce6ab; box-shadow: 0 0 0 4px rgba(108,230,171,.08), 0 0 18px rgba(108,230,171,.72); animation: status-orbit-pulse 2.2s ease-in-out infinite; }
.connection-status > .status-copy { overflow: hidden; width: auto; height: auto; min-width: 0; border-radius: 0; background: none; box-shadow: none; font-size: 11px; font-weight: 720; letter-spacing: .01em; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-toggle.icon-action { position: relative; width: 44px; min-width: 44px; height: 44px; padding: 0; border: 1px solid rgba(137,154,255,.2); border-radius: 14px; background: linear-gradient(145deg, rgba(35,43,73,.82), rgba(14,20,38,.9)); color: #cbd5eb; box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 26px rgba(0,0,0,.2); }
.sidebar-toggle.icon-action:hover { transform: translateY(-2px); border-color: rgba(123,156,255,.42); background: rgba(75,92,167,.22); color: white; }
.sidebar-toggle.icon-action svg { width: 19px; }
body.call-active .call-workspace { padding-bottom: 18px; }
body.call-active .video-card { border-color: rgba(124,144,215,.18); background: radial-gradient(circle at 50% 30%, #0a1020, #03060d 72%); box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 28px 90px rgba(0,0,0,.46); }
body.call-active .video-label { border-radius: 999px; background: rgba(5,9,18,.58); color: rgba(236,241,255,.88); font-size: 10px; font-weight: 680; letter-spacing: .015em; }
body.call-active .focus-hint { border-radius: 999px; background: rgba(5,9,18,.58); font-size: 9px; }

body.call-active .controls { position: fixed; z-index: 60; left: 50%; bottom: 20px; display: flex; width: auto; max-width: calc(100vw - 24px); gap: 8px; margin: 0; padding: 8px; border: 1px solid rgba(139,154,226,.22); border-radius: 23px; transform: translateX(-50%); background: linear-gradient(150deg, rgba(25,32,57,.88), rgba(8,13,25,.94)); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 22px 70px rgba(0,0,0,.52), 0 0 0 1px rgba(62,83,156,.05); backdrop-filter: blur(28px) saturate(145%); animation: control-dock-in .55s .12s cubic-bezier(.2,.85,.2,1) both; }
body.call-active .effects-control { flex: 0 0 52px; width: 52px; height: 52px; }
body.call-active .controls .control-button { position: relative; display: grid; flex: 0 0 52px; width: 52px; min-width: 52px; height: 52px; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,.075); border-radius: 17px; background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.025)); color: #b9c4da; box-shadow: inset 0 1px 0 rgba(255,255,255,.065); transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease; }
body.call-active .controls .control-button:hover { transform: translateY(-5px) scale(1.035); border-color: rgba(136,158,255,.28); background: linear-gradient(145deg, rgba(102,123,222,.19), rgba(49,61,117,.11)); color: #f3f6ff; box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 12px 28px rgba(0,0,0,.27); }
body.call-active .controls .control-button:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(90,158,255,.3), inset 0 1px 0 rgba(255,255,255,.1); }
body.call-active .controls .control-icon { width: 100%; height: 100%; border: 0; border-radius: inherit; background: transparent; box-shadow: none; }
body.call-active .controls .control-icon svg { width: 21px; stroke-width: 1.65; }
body.call-active .controls .control-button > span:not(.control-icon) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
body.call-active .controls .control-button::after,
body.call-active .icon-action::after { content: attr(data-tooltip); position: absolute; z-index: 90; left: 50%; bottom: calc(100% + 11px); padding: 6px 9px; transform: translate(-50%, 5px); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: rgba(4,8,17,.93); color: #e6ebf8; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 10px; font-weight: 680; line-height: 1; opacity: 0; pointer-events: none; white-space: nowrap; backdrop-filter: blur(15px); transition: opacity .16s ease, transform .16s ease; }
body.call-active .controls .control-button:hover::after,
body.call-active .controls .control-button:focus-visible::after,
body.call-active .icon-action:hover::after { opacity: 1; transform: translate(-50%, 0); }
body.call-active .controls .control-button[aria-pressed="true"] { border-color: rgba(93,188,255,.36); background: radial-gradient(circle at 50% 35%, rgba(75,185,255,.3), rgba(78,91,218,.16)); color: #bdeaff; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 4px rgba(77,157,255,.055), 0 0 26px rgba(72,146,255,.17); animation: active-control-pulse 2.5s ease-in-out infinite; }
body.call-active .controls #mute-button[aria-pressed="true"],
body.call-active .controls #camera-button[aria-pressed="true"] { border-color: rgba(255,102,138,.34); background: radial-gradient(circle at 50% 35%, rgba(255,93,132,.26), rgba(116,38,73,.17)); color: #ffbacb; box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 0 0 4px rgba(255,89,130,.05), 0 0 24px rgba(255,78,121,.15); }
body.call-active .controls #effects-button.is-open { border-color: rgba(166,133,255,.42); background: radial-gradient(circle at 50% 35%, rgba(156,112,255,.3), rgba(83,58,180,.18)); color: #dfceff; box-shadow: 0 0 0 4px rgba(143,101,255,.06), 0 0 28px rgba(131,88,255,.17); }
body.call-active .controls .end-button { margin-left: 4px; border-color: rgba(255,91,128,.28); background: radial-gradient(circle at 50% 35%, rgba(255,91,128,.24), rgba(111,30,60,.18)); color: #ffb2c5; }
body.call-active .controls .end-button:hover { border-color: rgba(255,102,139,.48); background: radial-gradient(circle at 50% 35%, rgba(255,91,128,.4), rgba(126,32,66,.25)); color: white; box-shadow: 0 12px 28px rgba(74,10,33,.3), 0 0 25px rgba(255,76,121,.14); }
body.call-active .effects-panel { bottom: calc(100% + 16px); border-radius: 21px; background: radial-gradient(circle at 95% 0%, rgba(131,92,255,.23), transparent 34%), linear-gradient(155deg, rgba(28,35,63,.97), rgba(8,13,25,.98)); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 30px 90px rgba(0,0,0,.58); }

@keyframes call-logo-float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(1.5deg); } }
@keyframes call-logo-breathe { 0%,100% { transform: scale(.92); opacity: .3; } 50% { transform: scale(1.08); opacity: .75; } }
@keyframes call-logo-orbit { 0% { transform: scale(.76) rotate(0); opacity: 0; } 24% { opacity: .6; } 100% { transform: scale(1.35) rotate(120deg); opacity: 0; } }
@keyframes status-orbit-pulse { 0%,100% { transform: scale(.9); opacity: .75; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes control-dock-in { from { opacity: 0; transform: translate(-50%, 18px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes active-control-pulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }

@media (max-width: 720px) {
  body.call-active .app-shell { padding: 10px 12px 106px; }
  body.call-active .call-screen { padding-bottom: 82px; }
  body.call-active .call-header { align-items: center !important; flex-direction: row !important; gap: 8px; margin-bottom: 10px; }
  .call-logo-mark { width: 42px; height: 42px; border-radius: 14px; }
  .call-logo-mark svg { width: 21px; }
  .call-header-actions { min-width: 0; flex: 1; justify-content: flex-end; }
  body.call-active .connection-status { width: auto; max-width: calc(100vw - 126px); min-height: 38px; padding: 7px 10px; }
  .connection-status > .status-copy { font-size: 10px; }
  .sidebar-toggle.icon-action { width: 40px; min-width: 40px; height: 40px; border-radius: 13px; }
  body.call-active .controls { bottom: 12px; gap: 5px; padding: 7px; border-radius: 20px; }
  body.call-active .effects-control { flex-basis: 45px; width: 45px; height: 45px; }
  body.call-active .controls .control-button { flex-basis: 45px; width: 45px; min-width: 45px; height: 45px; border-radius: 14px; }
  body.call-active .controls .control-icon svg { width: 18px; }
  body.call-active .controls .control-button::after,
  body.call-active .icon-action::after { display: none; }
  body.call-active .effects-panel { right: -54px; bottom: calc(100% + 13px); }
}

@media (max-width: 380px) {
  body.call-active .controls { gap: 3px; padding: 6px; }
  body.call-active .effects-control { flex-basis: 42px; width: 42px; height: 42px; }
  body.call-active .controls .control-button { flex-basis: 42px; width: 42px; min-width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .call-logo-mark, .call-logo-mark::before, .call-logo-mark i,
  body.call-active .controls, body.call-active .controls .control-button[aria-pressed="true"],
  .connection-status > .status-dot { animation: none; }
}

@media (max-width: 720px) {
  body.call-active .effects-control { flex: 0 0 48px !important; width: 48px !important; height: 48px !important; }
  body.call-active .controls .control-button { flex: 0 0 48px !important; width: 48px !important; min-width: 48px !important; height: 48px !important; min-height: 48px !important; }
}
@media (max-width: 380px) {
  body.call-active .effects-control { flex-basis: 44px !important; width: 44px !important; height: 44px !important; }
  body.call-active .controls .control-button { flex-basis: 44px !important; width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; }
}


/* Keep the desktop video canvas and right rail exactly aligned. */
@media (min-width: 721px) {
  body.call-active .call-workspace {
    --call-panel-height: min(74vh, 740px);
    align-items: stretch;
  }
  body.call-active .media-column,
  body.call-active .video-stage,
  body.call-active .room-sidebar {
    height: var(--call-panel-height);
    min-height: 0;
  }
  body.call-active .video-stage:not(.focus-local) > .remote-card,
  body.call-active .video-stage.focus-local > .local-card {
    height: 100%;
    min-height: 0;
  }
}
