:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #151f35;
  background: #f4f6fb;
  --muted: #4e5c74;
  --line: #dce2ee;
  --blue: #3159eb;
  --blue-dark: #2145ca;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid #5979ff; outline-offset: 3px; }

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 max(5vw, 20px);
}
.brand, .brand > span { display: inline-flex; align-items: center; gap: 10px; }
.brand { text-decoration: none; font-size: 22px; font-weight: 750; letter-spacing: -.045em; }
.brand-divider { width: 1px; height: 16px; background: var(--line); margin-left: 4px; }
.brand-label { letter-spacing: 0; font-size: .875rem; font-weight: 600; color: var(--muted); }
.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.home { width: min(1040px, calc(100% - 48px)); margin-block: clamp(40px, 10vh, 112px) 40px; }
.start-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  min-height: 482px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 54px #1a2d5810;
}
.start-content { align-self: center; padding: clamp(28px, 5vw, 62px); }
.eyebrow { display: block; color: var(--blue-dark); font-size: .875rem; font-weight: 700; letter-spacing: .08em; }
h1 { margin: 10px 0 0; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.05em; line-height: 1.18; overflow-wrap: anywhere; }
.intro { color: var(--muted); line-height: 1.75; margin: 14px 0 26px; }
.start-visual {
  display: grid;
  place-items: center;
  padding: 36px;
  background: radial-gradient(ellipse at 10% 95%, #5a61e9, transparent 55%), linear-gradient(145deg, #10256b, #294fc9 65%, #6062e7);
}
.demo-window {
  width: min(100%, 400px);
  padding: 15px;
  border: 1px solid #8f9ee9;
  background: #182c70;
  border-radius: 19px;
  box-shadow: 0 22px 48px #0d194b88;
  transform: rotate(-4deg);
}
.demo-header { display: flex; gap: 5px; padding: 0 0 12px 2px; }
.demo-header span { width: 6px; height: 6px; border-radius: 50%; background: #9caeeb; }
.demo-videos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-tile { aspect-ratio: 1.16; display: grid; place-items: center; border-radius: 10px; }
.demo-tile.blue { background: #4369ef; }
.demo-tile.lavender { background: #c1b9ff; }
.demo-tile span { display: grid; place-items: center; width: 42%; aspect-ratio: 1; border-radius: 50%; background: #fff3; color: #fff; font-size: clamp(1.15rem, 3vw, 1.75rem); font-weight: 700; }
.demo-tile.lavender span { color: #302968; background: #fff7; }
.demo-controls { display: flex; justify-content: center; gap: 8px; padding-top: 12px; }
.demo-controls svg { width: 30px; height: 28px; padding: 6px; color: #fff; background: #ffffff24; border-radius: 7px; }

form { display: grid; gap: 9px; }
form > label, summary { font-size: .9rem; font-weight: 650; }
input:not([type=checkbox]) {
  border: 1px solid #c7d0e1;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  padding: 0 12px;
  min-width: 0;
  min-height: 44px;
  width: 100%;
}
input::placeholder { color: #65728b; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  min-height: 44px;
  padding: 9px 15px;
  border-radius: 10px;
  font-weight: 650;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease;
}
.button:disabled { opacity: .65; cursor: wait; }
.primary { background: var(--blue); color: #fff; }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.secondary { background: #eef2ff; color: #2443b5; }
.secondary:hover:not(:disabled) { background: #e0e8ff; }
form .button { margin-top: 3px; }
.join-link { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 15px; }
.join-link summary { cursor: pointer; width: fit-content; color: var(--blue-dark); }
.join-link form { margin-top: 16px; }
.form-error, .feedback { margin: 0; font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.form-error { color: #a1253a; }

.room { padding-block: 38px; }
.room-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 25px; }
.room-heading h1 { font-size: clamp(1.7rem, 3vw, 2.45rem); }
.status { display: inline-flex; align-items: center; gap: 7px; background: #e9efff; color: #2845a9; padding: 8px 12px; border-radius: 8px; font-weight: 650; font-size: .875rem; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status[data-state="connected"] { background: #e1f6ea; color: #18603b; }
.status[data-state="failed"] { background: #ffedf1; color: #a1253a; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 310px); align-items: start; gap: 20px; }
.sidebar { display: grid; gap: 15px; }
.side-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.side-card h2 { margin: 0 0 14px; font-size: 1.05rem; }
.side-card > p { color: var(--muted); font-size: .875rem; line-height: 1.6; margin: -4px 0 10px; }
.device-options { display: flex; flex-wrap: wrap; column-gap: 12px; margin: 2px 0; }
.device-options label { display: inline-flex; align-items: center; min-height: 42px; gap: 4px; color: var(--muted); font-size: .875rem; cursor: pointer; }
.device-options input { accent-color: var(--blue); width: 16px; height: 16px; margin: 0; }
.share-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
#share-link { background: #f7f9fe; font-size: .875rem; }
#share-feedback { margin: 8px 0 0; }
.card-heading { display: flex; justify-content: space-between; align-items: baseline; }
.member-count { color: var(--muted); font-size: .875rem; }
.members { list-style: none; display: grid; padding: 0; margin: 0; gap: 12px; }
.members li { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px; }
.members strong, .members small { display: block; overflow-wrap: anywhere; }
.members strong { font-size: .95rem; }
.members small { color: var(--muted); font-size: .8125rem; margin-top: 3px; }

.stage { position: relative; overflow: hidden; isolation: isolate; display: grid; place-items: center; width: 100%; aspect-ratio: 16/10; min-height: 300px; border-radius: 19px 19px 0 0; background: radial-gradient(ellipse at 50% 8%, #24355d, #111a30 68%); color: #fff; }
.stage:only-child { border-radius: 19px; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage-placeholder { display: grid; place-items: center; text-align: center; padding: 20px 24px 55px; }
.stage-placeholder strong { margin-top: 14px; font-size: 1.13rem; overflow-wrap: anywhere; }
.stage-placeholder p { margin: 9px 0 0; color: #c5d0e9; font-size: .9rem; line-height: 1.6; }
.avatar { display: grid; place-items: center; background: #e8edff; color: #2145ca; width: 36px; height: 36px; border-radius: 10px; font-weight: 750; }
.avatar.large { width: 65px; height: 65px; border-radius: 18px; background: #344e82; color: #f5f8ff; font-size: 1.5rem; }
.avatar.large svg { width: 30px; height: 30px; }
.self-tile { position: absolute; right: 12px; bottom: 12px; width: clamp(92px, 23%, 180px); aspect-ratio: 16/10; border: 1px solid #7788af; border-radius: 12px; background: #253553; overflow: hidden; }
.self-tile video { object-fit: cover; transform: scaleX(-1); }
.self-placeholder { display: grid; place-items: center; height: 100%; color: #d2dcf5; }
.video-label { position: absolute; left: 12px; bottom: 12px; background: #101a30df; color: #fff; border-radius: 7px; padding: 5px 9px; font-size: .8125rem; max-width: 64%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.self-tile .video-label { left: 5px; bottom: 5px; }
.playback { position: absolute; top: 12px; left: 12px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px; background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 19px 19px; }
.stage:has(+ .controls[hidden]) { border-radius: 19px; }
.control { color: #263b68; background: #eef2fa; }
.control[aria-pressed="true"] { color: #2443b5; background: #e6edff; }
.control[aria-pressed="false"] svg { opacity: .65; }
.control:hover:not(:disabled) { border-color: #a2b4e1; }
.leave { color: #a1253a; background: #fff0f2; margin-left: auto; }
.leave:hover:not(:disabled) { background: #ffe2e8; }
.notice { margin: 10px 0; border-radius: 10px; padding: 10px 13px; font-size: .9rem; line-height: 1.6; }
.danger { background: #fff0f2; color: #a1253a; }
.icon-library { position: absolute; width: 0; height: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 760px) {
  .shell { width: calc(100% - 28px); }
  .home { margin-top: 24px; }
  .start-card, .room-grid { grid-template-columns: minmax(0, 1fr); }
  .start-visual { padding: 32px 50px; }
  .demo-window { max-width: 280px; }
  .room { padding-block: 22px; }
  .room-heading { align-items: flex-start; margin-bottom: 16px; }
  .stage { min-height: 240px; }
  .controls { padding: 8px; }
  .controls .button { padding-inline: 9px; }
}

#remote-video { opacity: 0; }
.stage.show-remote #remote-video { opacity: 1; }
