@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #101010; --surface: #171717; --surface-2: #202020; --surface-3: #292929;
  --line: #303030; --line-2: #505050; --text: #f4f4f4; --dim: #a2a2a2; --muted: #969696;
  --white: #ffffff; --black: #101010; --action: #f4f4f4; --on-action: #101010;
  --danger: #c43732; --danger-hover: #a92b27; --on-danger: #ffffff;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-pill: 999px;
  --shadow: 0 16px 40px -20px #00000080;
  --t: 180ms cubic-bezier(.16,1,.3,1);
  color-scheme: dark; font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
:root[data-theme='light'] {
  --bg: #f8f8f8; --surface: #ffffff; --surface-2: #ededed; --surface-3: #e4e4e4;
  --line: #dedede; --line-2: #a0a0a0; --text: #171717; --dim: #636363; --muted: #666666;
  --action: #171717; --on-action: #ffffff; color-scheme: light;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; scrollbar-color: var(--line-2) var(--bg); scrollbar-width: thin; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
body:has(.call:not([hidden])) { overflow: hidden; }
button, input, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; border: 0; background: none; }
button, a, input, summary, select { touch-action: manipulation; }
button { transition: background var(--t), color var(--t), border-color var(--t), transform var(--t); }
button:active:not(:disabled) { transform: translateY(1px); }
a { color: inherit; text-decoration: none; text-underline-offset: 5px; }
input, select { caret-color: var(--text); }
button:disabled { opacity: .5; cursor: wait; }
[hidden] { display: none !important; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 5px; }
.ic { width: 20px; height: 20px; display: block; flex: none; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 32px; height: 32px; }
.page-width { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; left: 24px; top: -80px; padding: 12px 20px; background: var(--action); color: var(--on-action); }
.skip-link:focus { top: 16px; }
.site-header { height: 88px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; font-weight: 700; font-size: 25px; letter-spacing: -.04em; }
.wordmark > span { color: var(--dim); }
.brand-symbol { width: 29px; height: 29px; margin-right: 13px; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.text-button { display: flex; align-items: center; gap: 18px; min-height: 44px; color: var(--dim); font-size: 13px; }
.text-button:hover { color: var(--text); }
.text-button .ic { transform: rotate(-45deg); }
.header-divider { width: 1px; height: 20px; background: var(--line); }
.theme-toggle { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.theme-toggle:hover { background: var(--surface-2); border-color: var(--line-2); }
.theme-toggle .moon, [data-theme='light'] .theme-toggle .sun { display: none; }
[data-theme='light'] .theme-toggle .moon { display: block; }
.hero { min-height: calc(100svh - 250px); justify-content: center; display: flex; flex-direction: column; align-items: center; gap: 40px; padding-block: 48px 64px; }
.hero-copy { max-width: 900px; width: 100%; min-width: 0; text-align: center; }
h1 { font-size: clamp(36px, 4.5vw, 60px); line-height: 1.15; letter-spacing: -.04em; font-weight: 500; margin: 0; text-wrap: balance; }
h1 > span { display: block; color: var(--dim); }
.hero-description { color: var(--dim); margin: 20px auto 0; font-size: 14px; line-height: 1.8; max-width: 55ch; text-wrap: balance; }
.signal { height: 96px; display: flex; justify-content: center; align-items: center; gap: 5px; margin: 20px auto 0; width: max-content; max-width: 100%; }
.signal i { display: block; flex: 0 1 3px; width: 3px; height: calc(var(--h) * .68); border-radius: 3px; background: var(--dim); opacity: .65; transform-origin: center; animation: signal-arrive 1.3s cubic-bezier(.16,1,.3,1) backwards; animation-delay: calc(var(--n) * 16ms); }
@keyframes signal-arrive { from { transform: scaleY(.1); opacity: .15; } to { transform: scaleY(1); opacity: .65; } }
.hero-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-wrap: balance; }
.join-area { width: min(100%, 560px); min-width: 0; }
.join-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
h2 { font-size: 25px; font-weight: 500; letter-spacing: -.035em; line-height: 1.3; margin: 0; }
.room-indicator { color: var(--muted); }
.join-description { color: var(--muted); font-size: 13px; margin: 9px 0 24px; }
.join-form { width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.preview { width: 100%; max-width: 100%; min-width: 0; aspect-ratio: 1.86; border-radius: var(--r); background: #191919; position: relative; overflow: hidden; isolation: isolate; color: #efefef; }
.preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 14px; background: #191919; }
.preview-orbit { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; border: 1px solid #3b3b3b; margin-bottom: 10px; }
.preview-orbit .ic { width: 25px; height: 25px; color: #d7d7d7; }
#previewLabel { color: #a5a5a5; font-size: 12px; }
.enable-devices { display: flex; align-items: center; justify-content: center; gap: 8px; color: #e0e0e0; font-size: 11px; min-height: 44px; }
.enable-devices:hover { text-decoration: underline; text-underline-offset: 4px; }
.enable-devices .ic { width: 13px; height: 13px; }
.preview-caption { position: absolute; top: 17px; left: 18px; color: #b1b1b1; font-size: 9px; letter-spacing: .13em; }
.preview-bottom { position: absolute; bottom: 13px; left: 18px; right: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#previewName { max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; padding: 3px 7px; margin-left: -7px; background: #19191999; border-radius: 4px; }
.preview-toggles { display: flex; gap: 8px; }
.round { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); flex: none; }
.round:hover { background: var(--surface-3); border-color: var(--line-2); }
.preview :focus-visible { outline-color: #ffffff; outline-offset: 3px; }
.preview .round { color: #f4f4f4; background: #2a2a2a; border-color: #444; width: 44px; height: 44px; }
.preview .round .ic { width: 16px; height: 16px; }
.round.on .off-ic, .round:not(.on) .on-ic { display: none; }
.preview .round:not(.on), .round.accent { background: #f4f4f4; color: #171717; border-color: #f4f4f4; }
.meter { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; }
.meter i { display: block; height: 100%; width: 100%; background: #f4f4f4; transform: scaleX(0); transform-origin: left; transition: transform 80ms linear; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field label { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; gap: 10px; }
.field label span { font-size: 11px; color: var(--muted); }
.name, .chat-form input, #inviteUrl { width: 100%; min-width: 0; padding: 13px 15px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 14px; }
input::placeholder { color: var(--muted); opacity: 1; }
input:focus { border-color: var(--line-2); }
.devices { margin-top: -7px; }
.devices summary { list-style: none; cursor: pointer; min-height: 38px; display: flex; align-items: center; justify-content: space-between; color: var(--dim); font-size: 12px; }
.devices summary > span { display: inline-flex; align-items: center; gap: 9px; }
summary::-webkit-details-marker { display: none; }
.devices summary > .ic { width: 13px; transition: transform var(--t); }
.devices[open] summary > .ic { transform: rotate(180deg); }
.device-field { margin-block: 8px 12px; }
.devices label { display: block; color: var(--dim); font-size: 12px; margin-bottom: 5px; }
.device-picker { position: relative; }
.device-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); font-size: 13px; }
.device-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-trigger:hover, .device-trigger[aria-expanded='true'] { border-color: var(--line-2); }
.device-trigger > .ic { width: 13px; transition: transform var(--t); }
.device-trigger[aria-expanded='true'] > .ic { transform: rotate(180deg); }
.device-options { position: absolute; z-index: 10; top: calc(100% + 5px); inset-inline: 0; padding: 4px; max-height: 220px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.device-option { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px; border-radius: 4px; font-size: 13px; overflow-wrap: anywhere; cursor: pointer; }
.device-option > span { flex: 1; min-width: 0; }
.device-option:hover, .device-option.active { background: var(--surface-2); }
.device-option[aria-selected='true'] { font-weight: 650; }
.device-option .ic { width: 15px; height: 15px; visibility: hidden; }
.device-option[aria-selected='true'] .ic { visibility: visible; }
.primary { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 52px; padding: 14px 19px; background: var(--action); color: var(--on-action); border-radius: var(--r-sm); font-weight: 650; font-size: 14px; }
.primary:hover { opacity: .87; }
/* Preparation stays light in light mode, including controls over live video. */
[data-theme='light'] .primary { background: #e3e3e3; color: #171717; border: 1px solid #cccccc; }
[data-theme='light'] .primary:hover { background: #d8d8d8; opacity: 1; }
[data-theme='light'] .primary:disabled { opacity: .5; }
[data-theme='light'] .preview { background: #eeeeee; color: #333333; border: 1px solid #dedede; }
[data-theme='light'] .preview-off { background: #eeeeee; }
[data-theme='light'] .preview-orbit { background: #f8f8f8; border-color: #d2d2d2; }
[data-theme='light'] .preview-orbit .ic { color: #555555; }
[data-theme='light'] #previewLabel { color: #636363; }
[data-theme='light'] .enable-devices { color: #404040; }
[data-theme='light'] .preview-caption { color: #636363; background: #eeeeeee6; padding: 3px 5px; margin: -3px -5px; border-radius: 3px; }
[data-theme='light'] #previewName { color: #333333; background: #eeeeeee6; }
[data-theme='light'] .preview .round { background: #fafafa; color: #333333; border-color: #c4c4c4; }
[data-theme='light'] .preview .round:hover { background: #e4e4e4; border-color: #a0a0a0; }
[data-theme='light'] .preview .round:not(.on) { background: #d5d5d5; color: #171717; border-color: #b8b8b8; }
[data-theme='light'] .preview :focus-visible { outline-color: #333333; box-shadow: 0 0 0 5px #ffffff; }
[data-theme='light'] .meter i { background: #636363; }
.primary[aria-busy='true'] .ic { animation: connecting 1s ease-in-out infinite; }
@keyframes connecting { 50% { transform: translateX(5px); opacity: .4; } }
.e2ee { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 11px; color: var(--muted); margin: -3px 0 0; }
.e2ee .ic { width: 12px; height: 12px; }
.error { font-size: 12px; color: var(--text); margin: 0; padding: 12px; background: var(--surface-2); border-radius: var(--r-sm); line-height: 1.6; }
.invite-entry { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); }
#inviteForm label { display: block; font-size: 12px; margin-bottom: 8px; }
#inviteForm > div { display: flex; gap: 8px; align-items: center; }
.invite-submit { display: inline-flex; justify-content: center; align-items: center; gap: 9px; align-self: stretch; padding: 0 15px; min-height: 48px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font-size: 13px; flex: none; }
.invite-submit:hover { background: var(--surface-3); border-color: var(--line-2); }
#inviteError { margin-top: 8px; }
.features { border-block: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); padding-block: 25px; gap: 30px; }
.features > div { display: flex; align-items: center; gap: 15px; }
.features .ic { color: var(--dim); width: 21px; height: 21px; }
.features p { margin: 0; font-size: 12px; line-height: 1.7; }
.features p span { display: block; color: var(--muted); font-size: 11px; }
.features > div:nth-child(2) { justify-self: center; }
.features > div:last-child { justify-self: end; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 25px; color: var(--muted); font-size: 10px; }
.site-footer > span:first-child { font-weight: 650; font-size: 12px; }
.site-footer > span:last-child { display: flex; align-items: center; gap: 8px; }
.site-footer .ic { width: 12px; height: 12px; transform: rotate(-45deg); }
.how-it-works { padding-block: 50px; border-bottom: 1px solid var(--line); }
.how-it-works ol { display: grid; grid-template-columns: repeat(3,1fr); gap: 35px; padding-left: 20px; margin-top: 28px; }
.how-it-works li { padding-left: 5px; font-size: 14px; }
.how-it-works p { color: var(--dim); font-size: 13px; max-width: 35ch; }
/* The call is a focused workspace, using the same restrained grayscale system. */
.screen { position: fixed; inset: 0; display: flex; }
/* ── In-call shell ───────────────────────────────────────────────────────── */
.call { flex-direction: column; background: var(--bg); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 18px 10px; }
.topbar .left, .topbar .right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brandmark { font-weight: 700; letter-spacing: -.035em; font-size: 19px; }
.timer { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 13px; padding: 0 2px; }

.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: var(--r-pill); background: transparent; border: 1px solid var(--line); color: var(--dim); font-size: 12.5px; font-weight: 550; transition: background var(--t), border-color var(--t), color var(--t), transform var(--t); }
.chip .ic { color: currentColor; }
button.chip:hover { color: var(--text); border-color: var(--line-2); }
button.chip:active { transform: scale(0.96); }
.chip.accent { background: var(--white); border-color: var(--white); color: var(--black); font-weight: 650; }
button.chip.accent:hover { background: #e4e4e6; color: var(--black); }
.chip.tone-live { color: var(--dim); }
.chip.tone-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--white); flex: none; }

.banner { margin: 2px 18px 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-size: 13.5px; }

.body { flex: 1; display: flex; min-height: 0; gap: 10px; padding: 12px 16px 0; }
.stage { min-width: 0; flex: 1; display: grid; gap: 10px; min-height: 0; align-content: center; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* Tiles */
.tile { min-width: 0; max-width: 100%; position: relative; background: #000; border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 9; min-height: 0; border: 1px solid var(--line); animation: fade 0.3s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0a0a0b; display: block; }
.tile.self video { transform: scaleX(-1); }
.tile .avatar { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(20px, 6.5vmin, 40px); font-weight: 600; color: var(--dim); background: var(--surface); letter-spacing: 0.02em; }
.tile .label { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 550; color: var(--white); background: rgba(0, 0, 0, 0.55); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.tile .label .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .label .ic { width: 13px; height: 13px; color: var(--white); }
.tile.speaking { border-color: var(--white); box-shadow: inset 0 0 0 1px var(--white); }
.tile .hand { position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--white); color: var(--black); }
.tile .hand .ic { width: 17px; height: 17px; }
.tile .react-badge { position: absolute; right: 10px; bottom: 10px; font-size: 24px; animation: pop 0.4s ease; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ── Control bar ─────────────────────────────────────────────────────────── */
.controls { align-self: center; display: flex; align-items: center; gap: 6px; margin: 14px auto calc(16px + env(safe-area-inset-bottom)); padding: 8px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line);  }
.ctrl { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; padding: 6px 8px 4px; border-radius: 14px; color: var(--text); transition: transform var(--t); }
.ctrl .ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-pill); background: transparent; border: 1px solid var(--line-2); color: var(--text); transition: background var(--t), color var(--t), border-color var(--t); }
.ctrl .l { font-size: 10.5px; color: var(--muted); font-weight: 550; letter-spacing: 0.01em; }
.ctrl:hover .ico { background: rgba(255, 255, 255, 0.07); }
.ctrl:active { transform: scale(0.95); }
.ctrl.on .off-ic, .ctrl:not(.on):not(.leave):not(.plain) .on-ic { display: none; }
/* muted mic / camera off, and toggled-on features: inverted (white fill) */
#mic:not(.on) .ico, #cam:not(.on) .ico, .ctrl.active .ico { background: var(--action); color: var(--on-action); border-color: var(--action); }
#mic:not(.on):hover .ico, #cam:not(.on):hover .ico, .ctrl.active:hover .ico { background: var(--action); color: var(--on-action); opacity: .84; }
.ctrl.active .l, #mic:not(.on) .l, #cam:not(.on) .l { color: var(--dim); }
.sep { width: 1px; height: 32px; background: var(--line); margin: 0 4px; }
.ctrl.leave .ico { border: 1.5px solid var(--white); color: var(--white); }
.ctrl.leave:hover .ico { background: var(--white); color: var(--black); }
.ctrl.leave .ic { transform: rotate(135deg); }

/* ── Side panel ──────────────────────────────────────────────────────────── */
.panel { width: 328px; flex: none; display: flex; flex-direction: column; min-height: 0; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); animation: slide .2s ease-out both; }
@keyframes slide { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.panel-tabs { display: flex; padding: 4px; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { flex: 1; padding: 11px; border-radius: var(--r-sm); color: var(--muted); font-weight: 600; font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; justify-content: center; transition: color var(--t), background var(--t); }
.tab:hover { color: var(--dim); }
.tab.active { color: var(--text); background: var(--surface-2); }
.tab.close { flex: 0 0 38px; color: var(--muted); }
.badge { background: var(--white); color: var(--black); border-radius: var(--r-pill); padding: 1px 7px; font-size: 11px; font-weight: 700; }
.panel-view { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 12px; }

.host-tools { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.small { display: inline-flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: var(--r-sm); background: transparent; border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 550; transition: background var(--t), border-color var(--t), transform var(--t); }
.small .ic { color: var(--dim); }
.small:hover { background: var(--surface-2); border-color: var(--line-2); }
.small:active { transform: scale(0.98); }
.small.danger { border-color: var(--line-2); }
.small.danger:hover { background: var(--white); color: var(--black); }
.small.danger:hover .ic { color: var(--black); }

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.people li { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: var(--r-sm); transition: background var(--t); }
.people li:hover { background: var(--surface-2); }
.people .pa { width: 30px; height: 30px; border-radius: var(--r-pill); display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--text); background: var(--surface-3); border: 1px solid var(--line); flex: none; }
.people .pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.people .tag { font-size: 10px; color: var(--dim); border: 1px solid var(--line); padding: 2px 8px; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: 0.05em; }
.people .st { color: var(--dim); display: inline-flex; } .people .st .ic { width: 16px; height: 16px; }
.people .kick { width: 28px; height: 28px; border-radius: var(--r-pill); display: grid; place-items: center; color: var(--muted); transition: background var(--t), color var(--t); }
.people .kick:hover { background: var(--white); color: var(--black); } .people .kick .ic { width: 14px; height: 14px; }

.chat-log { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.chat-log li { font-size: 14px; line-height: 1.4; max-width: 90%; }
.chat-log .who { color: var(--muted); font-weight: 600; font-size: 11px; display: block; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.03em; }
.chat-log .bubble { background: var(--surface-2); border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; display: inline-block; word-break: break-word; }
.chat-log .mine { align-self: flex-end; text-align: right; }
.chat-log .mine .bubble { background: var(--white); color: var(--black); border-color: var(--white); }
.chat-log .sys { color: var(--muted); font-style: italic; font-size: 12.5px; align-self: center; }
.chat-form { display: flex; gap: 8px; padding-top: 10px; align-items: center; }
.chat-form .round { width: 42px; height: 42px; flex: none; }

.reactions-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.reaction { position: absolute; bottom: 100px; font-size: 34px; animation: floatUp 2.4s ease-out forwards; }
@keyframes floatUp { 0% { transform: translateY(0) scale(0.5); opacity: 0; } 15% { opacity: 1; transform: translateY(-12px) scale(1.1); } 100% { transform: translateY(-44vh) scale(1); opacity: 0; } }
.react-bar { position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); display: flex; gap: 2px; padding: 6px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line);  z-index: 25; animation: popBar .18s ease-out both; }
@keyframes popBar { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translateX(-50%); } }
.react-bar button { font-size: 24px; width: 44px; height: 44px; border-radius: var(--r-pill); transition: transform var(--t), background var(--t); }
.react-bar button:hover { background: var(--surface-2); transform: scale(1.12); }

.topbar { min-height: 88px; padding-inline: 28px; border-bottom: 1px solid var(--line); }
.logo { display: grid; place-items: center; }
.topbar .left { gap: 13px; }
.topbar .right { gap: 12px; }
.chip { height: 38px; font-size: 12px; }
button.chip { min-height: 44px; }
.chip.accent { background: var(--action); color: var(--on-action); border-color: var(--action); }
.body { padding: 24px 28px 0; gap: 20px; }
.stage { overflow: auto; align-content: center; gap: 16px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.stage[data-count='1'] { grid-template-columns: minmax(0,1fr); }
.stage[data-count='1'] .tile { width: min(100%,1100px); max-height: 100%; justify-self: center; }
.stage[data-count='3'], .stage[data-count='4'] { grid-template-columns: repeat(2,minmax(0,1fr)); }
.stage[data-many='true'] { grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; }
.tile { background: var(--surface); border-color: var(--line); }
.tile[data-source='screen'] video { object-fit: contain; transform: none; }
.tile .avatar { font-size: clamp(32px,6vw,72px); font-weight: 450; letter-spacing: -.04em; background: var(--surface); }
.tile .label { left: 18px; bottom: 18px; border-radius: 6px; padding: 6px 10px; }
.tile .avatar::before { content: ''; position: absolute; width: 128px; height: 128px; border: 1px solid var(--line); border-radius: 50%; }
.controls { margin: 24px auto calc(24px + env(safe-area-inset-bottom)); padding: 7px 12px; gap: 8px; border-radius: 16px; background: var(--surface); }
.ctrl { min-width: 62px; padding: 5px; gap: 7px; }
.ctrl .ico { border: 0; background: var(--surface-2); border-radius: 10px; }
.ctrl .l { color: var(--dim); font-size: 10px; }
.ctrl.leave .ico { background: var(--danger); color: var(--on-danger); border: 0; }
.ctrl.leave:hover .ico { background: var(--danger-hover); color: var(--on-danger); opacity: 1; }
.panel { width: 340px; }
.panel-tabs { padding: 9px; }
.panel-view { padding: 16px; }
.tab.close { flex-basis: 44px; }
.people .kick { width: 44px; height: 44px; }
.chat-log:empty::before { content: 'Разговор продолжается здесь.\AОтправьте первое сообщение.'; white-space: pre-line; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; margin: auto 10px; }
.chat-form input { font-size: 14px; }
@media (max-width: 900px) {
  .page-width { width: calc(100% - 48px); }
  .site-header { height: 84px; }
  .join-description { margin-bottom: 20px; }
  .features { gap: 20px; }
  .features > div { display: block; justify-self: start !important; }
  .features .ic { margin-bottom: 10px; }
  .site-footer > span:last-child { display: none; }
  .how-it-works ol { grid-template-columns: 1fr; gap: 20px; }
  .topbar { min-height: 76px; padding-inline: 16px; }
  #e2eeChip { display: none; }
  .topbar .left, .topbar .right { gap: 8px; }
  .topbar .brandmark { font-size: 16px; }
  .body { padding: 16px 12px 0; }
  .stage, .stage[data-many='true'] { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .panel { position: fixed; inset: 12px 12px calc(90px + env(safe-area-inset-bottom)); width: auto; z-index: 40; }
  .controls { margin-block: 16px calc(16px + env(safe-area-inset-bottom)); gap: 5px; padding: 8px; max-width: calc(100% - 16px); }
  .ctrl .l { display: none; }
  .ctrl { min-width: 0; padding: 0; }
  .ctrl .ico { width: 44px; height: 44px; }
  .sep { margin-inline: 2px; }
}
@media (max-width: 480px) {
  .page-width { width: calc(100% - 32px); }
  .site-header { height: 76px; }
  .hero { gap: 32px; padding-block: 32px 40px; }
  .hero-description { margin-top: 16px; font-size: 13px; max-width: 36ch; }
  h1 > span { display: block; }
  .desktop-break { display: none; }
  .wordmark { font-size: 22px; }
  .brand-symbol { width: 24px; margin-right: 10px; }
  .header-actions { gap: 9px; }
  .text-button { font-size: 11px; line-height: 1.4; gap: 0; width: 76px; text-align: center; justify-content: center; }
  .text-button .ic, .header-divider { display: none; }
  .theme-toggle { width: 44px; height: 44px; border: 0; }
  h2 { font-size: 23px; }
  .features { grid-template-columns: 1fr; gap: 22px; padding-block: 27px; }
  .features > div { display: flex; gap: 17px; }
  .features .ic { margin: 0; }
  .features p, .features p span { font-size: 12px; }
  .site-footer { align-items: flex-start; gap: 20px; font-size: 10px; }
  .site-footer > span:nth-child(2) { text-align: right; max-width: 150px; }
  .preview .round { width: 44px; height: 44px; }
  .preview-bottom { bottom: 9px; right: 9px; }
  .preview-off { padding-bottom: 26px; }
  .preview-orbit { width: 48px; height: 48px; margin-bottom: 6px; }
  .preview-orbit .ic { width: 21px; height: 21px; }
  .preview-caption { top: 13px; left: 14px; font-size: 8px; }
  .enable-devices { min-height: 36px; }
  .topbar .brandmark { display: none; }
  .topbar .chip { padding-inline: 9px; }
  .topbar .timer { font-size: 12px; }
  .controls { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .ctrl .ico { width: 40px; height: 44px; }
  .tile .label { left: 8px; bottom: 8px; font-size: 10px; }
  .tile .avatar::before { width: 80px; height: 80px; }
}
@media (max-height: 600px) and (min-width: 801px) { .topbar { min-height: 60px; } .body { padding-top: 12px; } .controls { margin-block: 12px; } .ctrl .l { display: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 600px) {
  .stage[data-count='2'] { grid-template-columns: minmax(0,1fr); }
  .stage[data-count='2'] .tile { aspect-ratio: 16 / 10; max-height: 100%; }
}

/* Explicit permission step: inactive hardware is never presented as enabled. */
.preview { min-height: 274px; }
.preview:not([data-state='ready']) .preview-off { padding: 22px 20px 16px; }
.preview:not([data-state='ready']) .preview-caption { display: none; }
.preview:not([data-state='ready']) .preview-orbit { width: 42px; height: 42px; margin-bottom: 12px; }
.preview:not([data-state='ready']) .preview-orbit .ic { width: 21px; height: 21px; }
.preview:not([data-state='ready']) #previewLabel { color: #eeeeee; font-size: 15px; font-weight: 600; text-align: center; }
.device-help { max-width: 31ch; margin: 8px 0 0; font-size: 12px; line-height: 1.6; text-align: center; color: #aaaaaa; }
.enable-devices { margin-top: 14px; padding: 0 17px; gap: 14px; border-radius: 7px; border: 1px solid #555555; background: #eeeeee; color: #202020; min-height: 42px; font-size: 12px; font-weight: 600; }
.enable-devices:hover { background: #dddddd; text-decoration: none; }
.enable-devices:disabled { background: #303030; color: #cccccc; border-color: #444444; opacity: 1; }
.permission-options { display: flex; gap: 18px; margin-top: 6px; }
.permission-options button { color: #bcbcbc; min-height: 38px; padding: 5px 0; font-size: 11px; text-underline-offset: 4px; }
.permission-options button:hover { color: #ffffff; text-decoration: underline; }
.preview[data-state='ready'] .device-help { max-width: 30ch; }
[data-theme='light'] .preview:not([data-state='ready']) #previewLabel { color: #333333; }
[data-theme='light'] .device-help { color: #636363; }
[data-theme='light'] .enable-devices { background: #fafafa; color: #333333; border-color: #bcbcbc; }
[data-theme='light'] .enable-devices:hover { background: #ffffff; border-color: #999999; }
[data-theme='light'] .enable-devices:disabled { background: #e4e4e4; color: #636363; border-color: #cccccc; }
[data-theme='light'] .permission-options button { color: #606060; }
[data-theme='light'] .permission-options button:hover { color: #171717; }
.small.danger { background: var(--danger); color: var(--on-danger); border-color: var(--danger); }
.small.danger .ic, .small.danger:hover .ic { color: var(--on-danger); }
.small.danger:hover { background: var(--danger-hover); color: var(--on-danger); border-color: var(--danger-hover); }

/* Device transitions never change the preview or form geometry. */
.preview { flex-shrink: 0; }
.device-status { position: absolute; z-index: 2; top: 12px; inset-inline: 12px; margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--surface); color: var(--text); font-size: 12px; line-height: 1.5; }
.preview:has(.device-status:not([hidden])) .preview-caption { visibility: hidden; }
.preview[data-state='ready'] .preview-off { padding: 54px 20px 66px; }
.preview[data-state='ready'] .preview-orbit { width: 48px; height: 48px; }

.device-status { display: flex; align-items: center; gap: 12px; }
.device-status > span { flex: 1; }
.device-status button { flex: none; min-height: 32px; padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }

/* Home is an invitation; a room URL is a focused preparation screen. */
.landing-actions { width: min(100%, 400px); min-width: 0; }
.room-entry { min-height: 0; padding-block: 48px 64px; }
#joinTitle:focus { outline: none; }
@media (max-width: 480px) {
  .hero { min-height: 0; padding-block: 48px; }
  .room-entry { padding-block: 28px 40px; }
  .name, #inviteUrl { font-size: 16px; }
}

/* The shared footer remains present on preparation as well as home. */
.prejoin { display: flex; flex-direction: column; min-height: 100svh; }
.site-header { flex-shrink: 0; }
.room-entry { flex: 1; justify-content: flex-start; }
.prejoin:has(.room-entry) .site-footer { border-top: 1px solid var(--line); }
@media (max-width: 480px) {
  .signal { height: 80px; gap: 4px; margin-top: 16px; }
  .signal i { height: calc(var(--h) * .56); }
  .hero-note { font-size: 11px; max-width: 32ch; margin-inline: auto; }
  .site-footer { flex-wrap: wrap; gap: 16px; }
  .site-footer > span:last-child { display: flex; width: 100%; justify-content: center; }
}

/* --- Added: no-flash initial state, connection setting, per-participant volume --- */

/* Home vs room decided before first paint by the inline <head> script, so a
   refresh paints the right screen with no landing->room jump. */
html.room #landingIntro,
html.room #landingActions,
html.room #landingFeatures,
html.room #howItWorks,
html.room #howBtn { display: none !important; }
html:not(.room) #preparation { display: none !important; }

/* Connection ("способ связи") setting in the preparation card */
.conn-field { display: grid; gap: 8px; padding: 6px 2px 2px; }
.conn-field label { font-size: 12px; color: var(--dim); }
.conn-field select { width: 100%; }
.conn-hint { font-size: 11px; line-height: 1.5; color: var(--muted); margin: 2px 0 0; }

/* Per-participant local volume in the people panel */
#peopleList li { flex-wrap: wrap; }
.pvol { display: flex; align-items: center; gap: 9px; width: 100%; margin: 7px 0 1px; }
.pvol svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.pvol input[type="range"] { flex: 1; height: 3px; -webkit-appearance: none; appearance: none; background: var(--line-2); border-radius: 999px; outline: none; cursor: pointer; }
.pvol input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--text); cursor: pointer; }
.pvol input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--text); cursor: pointer; }
.pvol input[type="range"]:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.pvolval { font-size: 11px; color: var(--muted); width: 36px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
