:root {
  color-scheme: dark;
  font: 16px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: #141612;
  color: #f1f2ed;
  --accent: #c6fb81;
  --muted: #a4aa9d;
  --line: #32382c;
  --panel: #1b1e18;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
h1, h2, p { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
svg { display: block; width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.topbar { border-bottom: 1px solid #2a3025; }
.topbar-inner { max-width: 1256px; min-height: 82px; margin: auto; padding: 0 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; gap: 10px; align-items: center; font-size: 29px; font-weight: 740; letter-spacing: -.06em; }
.brand-period { margin-left: -10px; color: var(--accent); }
.brand-mark { width: 35px; height: 35px; border-radius: 10px; background: var(--accent); display: flex; align-items: center; justify-content: center; gap: 3px; }
.brand-mark i { display: block; height: 9px; width: 2.4px; border-radius: 3px; background: #212919; }
.brand-mark i:nth-child(2) { height: 16px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 15px; border: 1px solid var(--line); border-radius: 10px; background: #20241d; color: #e8ebe2; font-size: .875rem; font-weight: 630; transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.button:hover:not(:disabled) { border-color: #596151; background: #2b3126; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { color: #989e90; }
.invite { min-width: 208px; }
.invite svg { color: var(--accent); width: 17px; height: 17px; }

.layout { max-width: 1256px; margin: 0 auto; padding: 62px 36px 54px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 340px); gap: 30px; align-items: start; }
.call { min-width: 0; }
.call-heading { margin-bottom: 28px; }
.status { display: inline-flex; align-items: center; gap: 8px; color: #c4cebb; font-size: .875rem; }
.status > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: #849276; }
.status[data-state='active'] > span:first-child { background: var(--accent); box-shadow: 0 0 12px #a8ef6470; }
.status[data-state='joining'] > span:first-child, .status[data-state='reconnecting'] > span:first-child { background: #e3bd76; }
h1 { font-size: clamp(2.35rem, 4.7vw, 4.25rem); line-height: 1.08; font-weight: 710; letter-spacing: -.066em; margin: 6px 0 11px; }
.call-heading p { color: var(--muted); }

.stage { position: relative; isolation: isolate; min-height: 350px; display: grid; grid-template-rows: auto 1fr auto; border: 1px solid #3b4832; border-radius: 20px; background: radial-gradient(ellipse at 50% 50%, #26331e, transparent 75%), #1c2319; overflow: hidden; }
.stage::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(circle, #c6fb8133 1px, transparent 1.2px) 50% 50% / 23px 23px; mask-image: radial-gradient(ellipse at center, #000 8%, #0007 52%, transparent 88%); }
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px 0; color: #becab3; font-size: .875rem; }
.stage-top > span { display: flex; align-items: center; gap: 8px; }
.stage-top svg { color: #b1e17d; width: 18px; height: 18px; }
.stage-top time { font: .9rem ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; color: #d9e7d0; }
.signal-wrap { display: grid; place-items: center; padding: 20px 0; }
.signal { display: flex; align-items: center; justify-content: center; gap: clamp(4px, 1vw, 8px); height: 138px; }
.signal i { width: clamp(3px, .52vw, 7px); display: block; border-radius: 12px; background: #c6fb81; opacity: .84; transition: height .13s linear, opacity .2s ease; }
.signal i:nth-child(even) { opacity: .5; }
.stage[data-state='active'] .signal i { opacity: .73; }
.stage[data-state='active'] .signal i:nth-child(even) { opacity: .46; }
.stage[data-state='joining'] .signal, .stage[data-state='reconnecting'] .signal { opacity: .65; }
.stage-bottom { min-height: 93px; text-align: center; padding: 0 20px 24px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 12px; }
.stage-bottom p { max-width: 35ch; font-size: .875rem; color: #d1dcc8; }
.stage-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.primary { min-height: 53px; padding: 0 24px; border-color: transparent; color: #1b2215; background: var(--accent); font-size: 1rem; }
.primary:hover:not(:disabled) { border-color: #defeb4; background: #d5ffa5; }
.primary:disabled { background: #acc98c; color: #313d29; }

.controls { display: flex; gap: 9px; margin-top: 15px; }
.control { min-height: 49px; }
.control svg { width: 18px; height: 18px; }
.control[aria-pressed='true']:not(:disabled) { border-color: #526943; color: #d8f6bd; background: #252f20; }
.leave { margin-left: auto; color: #ffc3bb; background: #2d2120; border-color: #523635; }
.leave:hover:not(:disabled) { background: #442a27; border-color: #885550; }
.leave:disabled { color: #aaa095; background: #211e1b; border-color: #392f2d; }
.switch { width: 29px; height: 16px; flex: 0 0 auto; border-radius: 20px; background: #535b4d; position: relative; margin-left: 3px; transition: background .16s ease; }
.switch::before { content: ''; position: absolute; left: 3px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: #f2f5ee; transition: transform .16s ease; }
.noise[aria-pressed='true'] .switch { background: var(--accent); }
.noise[aria-pressed='true'] .switch::before { transform: translateX(13px); background: #263821; }
.noise:disabled .switch { opacity: .6; }
.noise-note { color: var(--muted); font-size: .875rem; margin-top: 10px; }

.aside { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); margin-top: 4px; overflow: hidden; }
.aside section { padding: 21px 21px 23px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
h2 { font-size: 1.125rem; line-height: 1.35; font-weight: 660; letter-spacing: -.025em; }
.count { font: .875rem ui-monospace, Consolas, monospace; color: #c5d2bb; border: 1px solid #394333; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.participants { min-height: 142px; }
.participant-empty { color: var(--muted); font-size: .875rem; }
.participant-list { display: grid; gap: 4px; padding: 0; margin: 0; list-style: none; max-height: 315px; overflow: auto; }
.participant { display: flex; align-items: center; gap: 10px; padding: 7px 0; min-height: 50px; }
.avatar { display: grid; flex: 0 0 36px; place-items: center; height: 36px; border: 1px solid #3c4834; border-radius: 9px; background: #283124; color: #cedcc3; transition: border-color .17s ease, color .17s ease; }
.avatar svg, .participant-state { width: 17px; height: 17px; }
.participant[data-speaking='true'] .avatar { border-color: var(--accent); color: var(--accent); }
.participant-info { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.participant strong { font-size: .875rem; }
.participant small { color: var(--muted); font-size: .8125rem; }
.participant-state { color: #b3c6a6; }
.participant[data-muted='true'] .participant-state { color: #c3a4a0; }

.audio { border-top: 1px solid var(--line); }
.audio .section-heading { margin-bottom: 21px; }
.audio-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 4px; align-items: center; }
.audio-control + .audio-control { margin-top: 21px; }
.audio-control label { display: flex; align-items: center; gap: 7px; font-size: .875rem; color: #d3d9cd; }
.audio-control label svg { width: 17px; height: 17px; color: #aab6a1; }
.audio-control output { font: .8125rem ui-monospace, Consolas, monospace; color: var(--accent); }
input[type='range'] { grid-column: 1 / -1; width: 100%; height: 25px; margin: 0; background: transparent; accent-color: var(--accent); cursor: pointer; }

dialog { width: min(420px, calc(100% - 32px)); padding: 23px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: #f1f2ed; }
dialog::backdrop { background: #050604b3; }
dialog form { display: grid; gap: 16px; }
dialog input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #22271e; color: #f1f2ed; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); white-space: nowrap; overflow: hidden; }

@media (max-width: 940px) {
  .layout { padding: 44px 24px; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(255px, 285px); }
  .topbar-inner { min-height: 72px; padding-inline: 24px; }
  .controls { flex-wrap: wrap; }
  .control { padding-inline: 11px; }
}

@media (max-width: 730px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 30px; }
  .aside { margin-top: 4px; }
  .stage { min-height: 295px; }
  .participants { min-height: 0; }
}

@media (max-width: 420px) {
  .layout, .topbar-inner { padding-inline: 14px; }
  .topbar-inner { min-height: 66px; }
  .invite { min-width: 0; padding-inline: 10px; }
  .stage-top { padding-inline: 15px; }
  .controls { gap: 6px; }
  .control { flex: 1 0 auto; padding-inline: 8px; gap: 6px; }
  .control.noise { order: 1; width: 100%; }
  .switch { margin-left: auto; }
  .stage { border-radius: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
