:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #07111f;
  --panel: rgba(18, 34, 54, .78);
  --line: rgba(255,255,255,.12);
  --text: #f7f9fc;
  --muted: #9eacc0;
  --mint: #49e2b4;
  --blue: #2588ff;
  --red: #ef4f64;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(circle at 15% 0%, #163152 0, transparent 35%), radial-gradient(circle at 90% 90%, #123d38 0, transparent 30%), var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
main { min-height: 100dvh; }
.card { width: min(1060px, calc(100% - 32px)); min-height: min(680px, calc(100dvh - 48px)); margin: 24px auto; border: 1px solid var(--line); border-radius: 32px; background: var(--panel); backdrop-filter: blur(24px); box-shadow: 0 28px 80px rgba(0,0,0,.32); }
.brand { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(145deg, var(--mint), #26aef5); color: #05201d; font-weight: 900; }
.welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px; }
.welcome .brand { position: absolute; top: 56px; }
.welcome-copy { max-width: 720px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 12px; color: var(--mint); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
h1 { margin: 0; font-size: clamp(38px, 7vw, 76px); line-height: 1.02; letter-spacing: -.055em; }
.welcome-copy > p:last-child, .lobby-copy > p { color: var(--muted); font-size: 18px; }
.primary { min-height: 54px; padding: 0 26px; border: 0; border-radius: 16px; background: linear-gradient(135deg, var(--mint), #35bdec); color: #05201d; font-weight: 800; box-shadow: 0 10px 28px rgba(73,226,180,.2); }
.primary:active { transform: translateY(1px); }
.hint { margin-top: 18px; color: var(--muted); font-size: 13px; }
.lobby { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; padding: 86px 64px 54px; position: relative; align-items: center; }
.lobby > .brand { position: absolute; left: 64px; top: 32px; }
.preview-wrap { position: relative; aspect-ratio: 4 / 3; border-radius: 25px; overflow: hidden; background: #040a12; border: 1px solid var(--line); }
.preview-wrap video, .tile video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.video-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: linear-gradient(145deg, #17283b, #0c1827); }
.lobby h1 { font-size: clamp(38px, 5vw, 62px); }
form { display: grid; gap: 12px; margin-top: 32px; }
label { color: var(--muted); font-size: 13px; font-weight: 700; }
input { width: 100%; min-height: 54px; border: 1px solid var(--line); border-radius: 15px; padding: 0 16px; background: rgba(0,0,0,.2); color: var(--text); outline: none; }
input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(73,226,180,.12); }
.error { min-height: 20px; color: #ff8393 !important; font-size: 14px !important; }
.conference { min-height: 100dvh; padding: 20px 24px 112px; }
header { display: flex; justify-content: space-between; align-items: center; max-width: 1500px; margin: 0 auto 18px; }
.meeting-info { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.secure { color: var(--mint); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; width: min(1500px, 100%); margin: auto; }
.tile { position: relative; min-height: 220px; max-height: calc(100dvh - 175px); aspect-ratio: 16 / 10; border-radius: 22px; overflow: hidden; background: linear-gradient(145deg, #17283b, #0c1827); border: 1px solid var(--line); }
.tile.remote video { transform: none; }
.tile-name { position: absolute; left: 12px; bottom: 12px; z-index: 2; padding: 6px 9px; border-radius: 9px; background: rgba(0,0,0,.55); font-size: 13px; backdrop-filter: blur(8px); }
.avatar { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(44px, 8vw, 92px); font-weight: 800; color: var(--mint); }
.controls { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 8px; padding: 9px; z-index: 20; border: 1px solid var(--line); border-radius: 22px; background: rgba(10,20,33,.9); backdrop-filter: blur(18px); box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.control { display: grid; place-items: center; gap: 3px; min-width: 76px; min-height: 58px; border: 0; border-radius: 15px; color: var(--text); background: rgba(255,255,255,.07); }
.control span { font-size: 20px; }
.control small { font-size: 10px; }
.control.off { background: rgba(239,79,100,.2); color: #ff9daa; }
.control.danger { background: var(--red); }
.toast { position: fixed; left: 50%; bottom: 104px; z-index: 30; transform: translate(-50%, 12px); padding: 10px 15px; border-radius: 12px; background: #f5f8fb; color: #0b1727; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 740px) {
  .card { width: 100%; min-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .welcome { padding: 28px 22px; }
  .welcome .brand { top: 28px; }
  h1 { font-size: clamp(42px, 13vw, 62px); }
  .lobby { display: flex; flex-direction: column; gap: 26px; padding: 82px 20px 30px; align-items: stretch; }
  .lobby > .brand { left: 20px; top: 24px; }
  .preview-wrap { aspect-ratio: 4 / 3; }
  .lobby h1 { font-size: 40px; }
  .conference { padding: 14px 10px 102px; }
  header { padding: 0 4px; }
  .secure { display: none; }
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .tile { min-height: 0; border-radius: 15px; aspect-ratio: 3 / 4; }
  .video-grid .tile:only-child { grid-column: 1 / -1; aspect-ratio: 3 / 4; max-height: calc(100dvh - 175px); }
  .controls { width: calc(100% - 20px); justify-content: space-around; bottom: max(10px, env(safe-area-inset-bottom)); }
  .control { min-width: 0; flex: 1; }
}
