@font-face {
  font-family: "Onest";
  src: url("/fonts/onest.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #2B2B28;
  --muted: #62625C;
  --bg: #F4F4F1;
  --card: #FFFFFF;
  --soft: #E8E8E3;
  --line: #DCDCD5;
  --live: #00A36C;
  --accent: #2B2B28;
  --accent-hover: #3B3B37;
  --on-accent: #F4F4F1;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --h-transform: none;
  --h-weight: 700;
  --h-tracking: -.035em;
  --amber: #F0A23B;
  --amber-bg: #FCEFD9;
  --amber-text: #8A5300;
  --coral: #E5533D;
  --coral-bg: #FCE6E1;
  --coral-text: #B42318;

  --stage: #2B2B28;
  --tile: #383834;
  --tile-2: #45453F;
  --on-stage: #F4F4F1;
  --on-stage-2: #B9B9B1;
  --cbtn: #3E3E3A;
  --cbtn-hover: #4A4A45;

  --r-card: 20px;
  --r-tile: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.in-room { background: var(--stage); color-scheme: dark; overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.sprite { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.room :focus-visible { outline-color: var(--bg); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; }
.breathe { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.7); opacity: .55; } }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--ease), transform .12s var(--ease), color .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--soft); }
.btn-light { background: var(--bg); color: var(--ink); }
.btn-light:hover { background: var(--card); }
.btn.wide { width: 100%; }
.btn .ic { width: 20px; height: 20px; }

.field {
  width: 100%; min-height: 48px; padding: 12px 16px;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--card);
  transition: border-color .15s;
}
.field:hover { border-color: #c4c4bc; }
.field:focus { outline: none; border-color: var(--ink); }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.label { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin: 18px 0 6px; }

/* Шапка */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px clamp(16px, 4vw, 48px); }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 44px; }
.brand img { display: block; height: 26px; width: auto; }
.brand-meet { font-size: 25px; font-weight: 500; color: var(--muted); letter-spacing: -.01em; line-height: 1; transform: translateY(-1px); }
.clock { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }

/* Главная */
.home { min-height: 100%; display: flex; flex-direction: column; }
.hero {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center; gap: clamp(32px, 6vw, 96px);
  max-width: 1280px; width: 100%; margin: 0 auto; padding: clamp(16px, 4vw, 48px);
}
h1 { font-size: clamp(36px, 5.2vw, 64px); line-height: 1.04; letter-spacing: var(--h-tracking); font-weight: var(--h-weight); text-transform: var(--h-transform); margin: 0 0 20px; text-wrap: balance; }
.lead { font-size: clamp(17px, 1.5vw, 19px); color: var(--muted); max-width: 34em; margin: 0 0 32px; text-wrap: pretty; }
.start { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.join-form { display: flex; gap: 8px; flex: 1 1 300px; max-width: 420px; }
.join-form .field { border-radius: 999px; padding-left: 20px; }
.form-error { min-height: 1.5em; margin: 10px 0 0; color: var(--coral-text); font-size: 15px; }
.facts { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; }
.facts li { font-size: 14px; color: var(--muted); line-height: 1.4; }
.facts strong { display: block; color: var(--ink); font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 2px; }

.hero-demo { position: relative; }
.demo-stage { background: var(--stage); border-radius: 28px; padding: 56px 18px 18px; color: var(--on-stage); position: relative; }
.demo-chip { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; background: rgba(43, 43, 40, .82); padding: 6px 12px; border-radius: 999px; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-tile { aspect-ratio: 4 / 3; background: var(--tile); border-radius: 14px; position: relative; display: grid; place-items: center; transition: box-shadow .3s; }
.demo-tile.speaking { box-shadow: inset 0 0 0 2px rgba(244, 244, 241, .75); }
.demo-av { width: 64px; height: 64px; border-radius: 50%; background: var(--tile-2); display: grid; place-items: center; font-size: 26px; font-weight: 600; }
.demo-name { position: absolute; left: 12px; bottom: 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.demo-caption { margin: 14px 4px 4px; min-height: 3em; font-size: 15px; line-height: 1.5; color: var(--on-stage); }
.demo-caption b { font-weight: 600; }
.typing { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--live); animation: typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
.demo-notes { list-style: none; margin: 14px 0 0; padding: 16px 18px; background: var(--card); border-radius: 20px; font-size: 14px; line-height: 1.45; display: grid; gap: 8px; }
.demo-notes li { display: grid; grid-template-columns: 44px 1fr; gap: 6px; animation: noteIn .5s var(--ease) both; }
.demo-notes time { color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-notes b { font-weight: 600; }
@keyframes noteIn { from { opacity: 0; transform: translateY(6px); } }
.foot { display: flex; align-items: center; gap: 10px; padding: 24px clamp(16px, 4vw, 48px) 32px; color: var(--muted); font-size: 14px; font-weight: 500; }
.foot img { height: 16px; width: auto; }

/* Лобби */
.lobby { min-height: 100%; display: flex; flex-direction: column; }
.lobby-body { flex: 1; width: 100%; align-content: center; max-width: 1120px; margin: 0 auto; padding: clamp(8px, 3vw, 40px) clamp(16px, 4vw, 48px) 48px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.preview { position: relative; aspect-ratio: 16 / 9; background: var(--stage); border-radius: var(--r-card); overflow: hidden; color: var(--on-stage); }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview-off { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--on-stage-2); font-size: 15px; text-align: center; padding: 24px; }
.preview.has-video .preview-off { display: none; }
.preview-bar { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 12px; }
.meter { position: absolute; left: 18px; bottom: 26px; display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.meter i { width: 4px; height: 4px; border-radius: 2px; background: var(--on-stage); opacity: .35; transition: height .08s, opacity .08s; }
.lobby-side h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 6px; }
.room-code { margin: 0; font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.room-who { margin: 6px 0 4px; color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.devices { margin-top: 14px; }
.devices summary { cursor: pointer; color: var(--muted); font-size: 15px; min-height: 44px; display: flex; align-items: center; }
.devices .label:first-of-type { margin-top: 4px; }
.perm { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--amber-bg); color: var(--amber-text); font-size: 14px; line-height: 1.45; }
#enterBtn { margin-top: 22px; }
#copyLobby { margin-top: 10px; }

.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--tile-2); color: var(--on-stage); display: grid; place-items: center; font-weight: 600; font-size: 17px; flex: none; text-transform: uppercase; }
.avatar.big { width: 96px; height: 96px; font-size: 38px; }

/* Кнопки управления звонком */
.cbtn {
  position: relative; width: 52px; height: 52px; border-radius: 999px; border: 0;
  display: inline-grid; place-items: center; background: var(--cbtn); color: var(--on-stage);
  transition: background-color .15s var(--ease), transform .12s var(--ease), border-radius .2s var(--ease);
}
.cbtn:hover { background: var(--cbtn-hover); }
.cbtn:active { transform: scale(.94); }
.cbtn.off { background: var(--coral-bg); color: var(--coral-text); border-radius: 18px; }
.cbtn.on { background: var(--soft); color: var(--ink); border-radius: 18px; }
.cbtn.hand-on { background: var(--amber-bg); color: var(--amber-text); border-radius: 18px; }
.cbtn.leave { width: 72px; background: var(--coral); color: var(--card); }
.cbtn.leave:hover { background: #d1442f; }
.preview .cbtn { background: rgba(62, 62, 58, .88); }
.preview .cbtn.off { background: var(--coral-bg); }

.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 999px; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--ink); transition: background-color .15s; }
.icon-btn:hover { background: var(--soft); }
.icon-btn.dark { color: var(--on-stage); width: 48px; height: 48px; }
.icon-btn.dark:hover { background: var(--cbtn); }
.icon-btn.dark[aria-pressed="true"] { background: var(--soft); color: var(--ink); }
.badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tile-2); color: var(--on-stage); font-size: 11px; font-weight: 600; display: grid; place-items: center; line-height: 1; }
.icon-btn.dark[aria-pressed="true"] .badge { background: var(--ink); }
.unread { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 2px var(--stage); }

/* Комната */
.room { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; color: var(--on-stage); background: var(--stage); }
.room-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 0; min-height: 40px; }
.room-meta { font-size: 15px; color: var(--on-stage-2); font-variant-numeric: tabular-nums; display: none; }
.room-meta .sep { margin: 0 10px; opacity: .5; }
.notes-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--tile); font-size: 13px; font-weight: 500; margin-left: auto; margin-right: auto; }
.room-main { position: relative; display: flex; min-height: 0; padding: 12px 16px; gap: 16px; }
.stage { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; gap: 12px; }
.tiles { flex: 1; min-width: 0; min-height: 0; gap: 12px; }
.tiles.fill { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.tiles.fit { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; }
.tiles.fit .tile { width: var(--tw); height: var(--th); flex: none; }
.strip { display: none; flex-direction: column; gap: 12px; width: 220px; flex: none; overflow-y: auto; }
.stage.spotlight .strip { display: flex; }
.strip .tile { aspect-ratio: 16 / 10; flex: none; }

.tile { position: relative; background: var(--tile); border-radius: var(--r-tile); overflow: hidden; min-height: 0; display: grid; place-items: center; animation: tileIn .35s var(--ease) both; }
@keyframes tileIn { from { opacity: 0; transform: scale(.97); } }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.tile.has-video video { opacity: 1; }
.tile.screen video { object-fit: contain; background: #1f1f1d; }
.tile.self video { transform: scaleX(-1); }
.tile.self.screen video { transform: none; }
.tile .avatar { width: clamp(56px, 22%, 120px); height: auto; aspect-ratio: 1; font-size: clamp(22px, 4vw, 44px); transition: opacity .2s; }
.tile.has-video .avatar { opacity: 0; }
.tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .2s; pointer-events: none; }
.tile.speaking::after { box-shadow: inset 0 0 0 2px rgba(244, 244, 241, .8); }
.tile-name { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 8px; border-radius: 999px; background: rgba(43, 43, 40, .72); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tile-name span { overflow: hidden; text-overflow: ellipsis; }
.tile-name .dot { display: none; }
.tile.speaking .tile-name .dot { display: inline-block; animation: breathe 1.1s ease-in-out infinite; }
.tile-name .ic { width: 16px; height: 16px; color: #F6B4A8; display: none; }
.tile.muted .tile-name .ic { display: block; }
.tile.muted .tile-name .dot { display: none; }
.tile-hand { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; background: var(--amber-bg); color: var(--amber-text); font-size: 13px; font-weight: 600; display: none; align-items: center; gap: 6px; }
.tile-hand .ic { width: 16px; height: 16px; }
.tile.hand .tile-hand { display: inline-flex; }
.tile-pin { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 999px; border: 0; background: rgba(43, 43, 40, .72); color: var(--on-stage); display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.tile:hover .tile-pin, .tile-pin:focus-visible, .tile.pinned .tile-pin { opacity: 1; }
.tile.pinned .tile-pin { background: var(--bg); color: var(--ink); }
.tile-pin .ic { width: 18px; height: 18px; }
.tile-state { position: absolute; top: 12px; right: 56px; font-size: 13px; color: var(--on-stage-2); }

.alone { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 32px)); background: var(--tile); border-radius: var(--r-card); padding: 22px; text-align: center; z-index: 3; }
.stage.has-others .alone { display: none; }
.alone p { margin: 0 0 14px; color: var(--on-stage); }
.alone .btn { max-width: 100%; }
.alone .btn span { overflow: hidden; text-overflow: ellipsis; }

.captions { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(880px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 6px; z-index: 4; pointer-events: none; }
.cap { align-self: center; max-width: 100%; background: rgba(28, 28, 26, .86); color: var(--card); padding: 8px 14px; border-radius: 12px; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.4; animation: capIn .2s var(--ease) both; }
.cap b { font-weight: 600; color: var(--on-stage-2); margin-right: 6px; }
@keyframes capIn { from { opacity: 0; transform: translateY(4px); } }

.reactions { position: absolute; left: 24px; bottom: 0; width: 160px; height: 60%; pointer-events: none; z-index: 5; overflow: hidden; }
.react { position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; animation: floatUp 3.2s var(--ease) forwards; }
.react span:first-child { font-size: 36px; line-height: 1; }
.react span:last-child { font-size: 12px; background: rgba(43, 43, 40, .8); padding: 2px 8px; border-radius: 999px; margin-top: 4px; white-space: nowrap; }
@keyframes floatUp { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-340px); opacity: 0; } }

.banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--amber-bg); color: var(--amber-text); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 6; }

/* Панель */
.panel { width: 360px; flex: none; background: var(--card); color: var(--ink); border-radius: var(--r-card); display: flex; flex-direction: column; min-height: 0; overflow: hidden; animation: panelIn .25s var(--ease) both; color-scheme: light; }
@keyframes panelIn { from { opacity: 0; transform: translateX(12px); } }
.panel :focus-visible { outline-color: var(--ink); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 22px; }
.panel-head h2 { font-size: 19px; margin: 0; letter-spacing: -.01em; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 22px 20px; overflow-y: auto; }
.pane-note { font-size: 13px; color: var(--muted); margin: 0 0 12px; line-height: 1.45; }
.pane-sub { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 6px; }
.pane-warn { font-size: 13px; background: var(--amber-bg); color: var(--amber-text); padding: 10px 12px; border-radius: 12px; margin: 12px 0 0; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 12px; padding: 8px 0; min-height: 56px; }
.people .avatar { background: var(--soft); color: var(--ink); width: 40px; height: 40px; font-size: 16px; }
.people .who { flex: 1; min-width: 0; }
.people .who b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .who small { color: var(--muted); font-size: 13px; }
.people .ic { width: 20px; height: 20px; color: var(--muted); }
.people .ic.muted { color: var(--coral-text); }
.people .ic.hand { color: var(--amber-text); }

.chat-pane { padding-bottom: 12px; }
.chat-list { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.chat-list li .meta { font-size: 13px; color: var(--muted); }
.chat-list li .meta b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.chat-list li p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-list li a { color: var(--ink); text-underline-offset: 2px; }
.chat-form { display: flex; gap: 6px; align-items: flex-end; margin-top: 12px; background: var(--bg); border-radius: 24px; padding: 4px 4px 4px 6px; }
.chat-form .field { border: 0; background: transparent; resize: none; max-height: 140px; min-height: 44px; padding: 10px 10px; border-radius: 20px; line-height: 1.45; }
.chat-form .send { background: var(--accent); color: var(--on-accent); flex: none; }
.chat-form .send:hover { background: var(--accent-hover); }
.chat-form .send .ic { width: 18px; height: 18px; }
.empty { color: var(--muted); font-size: 14px; text-align: center; margin: auto 0; padding: 24px 0; }

.notes-ctl { padding-bottom: 14px; border-bottom: 1px solid var(--soft); }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 600; min-height: 44px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none; transition: background-color .2s; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--ink); outline-offset: 2px; }
.notes-row .label { margin-top: 8px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; margin-top: 12px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.notes-list { list-style: none; margin: 0; padding: 14px 0 0; flex: 1; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.45; min-height: 120px; }
.notes-list li { display: grid; grid-template-columns: 44px 1fr; gap: 6px; }
.notes-list time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 2px; }
.notes-list b { font-weight: 600; }
.notes-list li.interim span { color: var(--muted); }
.notes-actions { display: flex; gap: 8px; padding-top: 14px; }
.notes-actions .btn { flex: 1; min-height: 44px; padding: 0 14px; }

/* Нижняя панель */
.controls { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 20px calc(14px + env(safe-area-inset-bottom)); }
.ctl-left { font-size: 15px; color: var(--on-stage-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl-center { display: flex; gap: 10px; align-items: center; }
.ctl-right { display: flex; gap: 4px; justify-content: flex-end; }
.narrow-only { display: none; }
.pop { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--tile); border-radius: 18px; padding: 8px; z-index: 10; animation: popIn .18s var(--ease) both; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, 6px); } }
.react-pop { display: flex; gap: 2px; }
.react-pop button, .more-emoji button { width: 48px; height: 48px; border: 0; border-radius: 12px; background: transparent; font-size: 26px; line-height: 1; transition: background-color .12s, transform .12s; }
.react-pop button:hover, .more-emoji button:hover { background: var(--cbtn-hover); transform: scale(1.1); }
.more-pop { width: min(320px, calc(100vw - 24px)); display: flex; flex-direction: column; }
.more-pop > button { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: var(--on-stage); text-align: left; font-size: 16px; }
.more-pop > button:hover { background: var(--cbtn-hover); }
.more-emoji { display: flex; justify-content: space-between; padding: 6px 4px 2px; border-top: 1px solid var(--tile-2); margin-top: 4px; }

/* Тосты */
.toasts { position: fixed; left: 20px; bottom: 96px; display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; max-width: min(360px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: toastIn .25s var(--ease) both; overflow-wrap: anywhere; }
body.in-room .toasts { left: auto; right: 20px; bottom: auto; top: 64px; }
body.in-room .toast { background: var(--bg); color: var(--ink); }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* После выхода */
.left { min-height: 100%; }
.left-body { max-width: 640px; margin: 0 auto; padding: clamp(48px, 12vh, 140px) clamp(16px, 4vw, 48px); text-align: center; }
.left-body h1 { font-size: clamp(32px, 4.4vw, 48px); }
.left-body .lead { margin-left: auto; margin-right: auto; }
.left-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* Адаптив */
@media (min-width: 900px) {
  .room-meta { display: inline; }
  .notes-chip { margin-left: 0; margin-right: 0; }
}
@media (max-width: 1100px) {
  .ctl-left { display: none; }
  .controls { grid-template-columns: auto 1fr; }
  .ctl-center { justify-content: flex-start; }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 8px; }
  .hero-demo { max-width: 560px; }
  .lobby-body { grid-template-columns: 1fr; max-width: 640px; }
  .panel { position: absolute; inset: 12px 12px 0 auto; z-index: 20; width: min(380px, calc(100% - 24px)); box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
}
@media (max-width: 720px) {
  .wide-only { display: none; }
  .narrow-only { display: inline-grid; }
  .controls { grid-template-columns: 1fr auto; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); gap: 6px; }
  .ctl-center { gap: 8px; }
  .ctl-right { gap: 0; }
  .cbtn { width: 48px; height: 48px; }
  .cbtn.leave { width: 60px; }
  .icon-btn.dark { width: 44px; height: 44px; }
  #btnNotes { display: none; }
  .room-main { padding: 8px; }
  .room-top { padding: 10px 12px 0; }
  .tiles, .stage { gap: 8px; }
  .stage.spotlight { flex-direction: column; }
  .strip { flex-direction: row; width: auto; height: 110px; overflow-x: auto; overflow-y: hidden; }
  .strip .tile { height: 100%; aspect-ratio: 4 / 3; }
  .panel { inset: 0; width: 100%; border-radius: 0; position: fixed; }
  .facts { grid-template-columns: 1fr; gap: 12px; }
  .facts li { display: flex; align-items: baseline; gap: 10px; }
  .facts strong { display: inline; font-size: 18px; white-space: nowrap; }
  .start .btn-primary { width: 100%; }
  .join-form { max-width: none; flex-basis: 100%; }
  .toasts { left: 12px; bottom: 84px; }
  body.in-room .toasts { left: 12px; right: 12px; top: 56px; max-width: none; align-items: center; }
  .tile-pin { display: none; }
}
@media (max-width: 380px) {
  .ctl-center { gap: 6px; }
  .cbtn { width: 44px; height: 44px; }
  .cbtn.leave { width: 52px; }
  .icon-btn.dark { width: 44px; height: 44px; }
  #btnChat { display: none; }
}

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

/* Пространства клиентов */
.h2, .lobby-side h2, .left-body h1, .panel-head h2 { text-transform: var(--h-transform); }
.lobby-side h2 { font-weight: var(--h-weight); letter-spacing: var(--h-tracking); }
.brand img.tenant-logo { height: var(--logo-h, 26px); }
.powered { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.powered img { height: 14px; width: auto; display: block; }
.room-id { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.room-logo { height: var(--logo-room-h, 22px); width: auto; display: block; flex: none; }
.room-name { font-size: 15px; font-weight: 600; color: var(--on-stage); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rooms { margin: 28px 0 0; }
.rooms h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.rooms ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.room-card { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 16px 12px 18px; border-radius: 16px; border: 0; background: var(--card); color: var(--ink); text-align: left; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, transform .12s var(--ease); }
.room-card:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.room-card:active { transform: scale(.98); }
.room-card b { display: block; font-weight: 600; }
.room-card small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.room-card .ic { color: var(--muted); }
.lobby-powered { margin-top: 18px; display: flex; justify-content: center; }
.powered .pw-meet { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: -2px; }
.room-powered { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--on-stage-2); font-size: 14px; font-weight: 500; }
.room-powered img { height: 14px; width: auto; display: block; }
.room-top { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 720px) {
  .room-top .notes-chip { order: 3; margin: 0 auto; }
  .room-top.has-notes::after { content: ""; order: 2; flex-basis: 100%; }
  .room-id { flex: 1; }
}
@media (max-width: 420px) {
  .brand img.tenant-logo { height: calc(var(--logo-h) * .8); }
  .pw-label { display: none; }
}
