/* Native system type avoids a font download and matches the device's controls.
   Blue is the user's chosen accent; reserve it for actions and selected states. */
:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20242a;
  background: #fff;
  font-synthesis: none;
  --blue: #2563eb;
  --muted: #626973;
  --line: #e0e3e7;
  --radius: 5px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; color: #838992; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.shell { max-width: 1440px; margin: auto; padding: 0 40px; }
header {
  height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand { color: inherit; text-decoration: none; font-size: 23px; font-weight: 650; letter-spacing: -.6px; }
.header-note { color: var(--muted); font-size: 14px; }
main {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 56px;
  padding: 48px 0 40px;
  align-items: start;
}
h1 { font-size: 28px; font-weight: 600; line-height: 1.25; letter-spacing: -.5px; margin: 0 0 12px; }
#setup-description { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0; }
.setup-panel { margin-top: 32px; }
.audio-option { display: flex; gap: 9px; align-items: center; font-size: 14px; margin: 0 0 20px; }
.audio-option input { accent-color: var(--blue); width: 16px; height: 16px; margin: 0; }
.primary {
  width: 100%; padding: 13px 16px; border: 1px solid var(--blue);
  background: var(--blue); color: #fff; border-radius: var(--radius);
  font-size: 14px; font-weight: 550; transition: background 150ms;
}
.primary:hover { background: #1d4ed8; }
.primary:disabled { background: #e4e7ec; border-color: #e4e7ec; }
.status { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 14px 0 0; }
.status.error { color: #a72e2e; }
.video-stage {
  height: clamp(380px, 40vw, 560px);
  position: relative; background: #202226; border-radius: var(--radius);
  overflow: hidden; color: #f5f5f5;
}
.stage-top {
  position: absolute; z-index: 2; top: 20px; left: 20px; right: 20px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.connection-status { display: flex; align-items: center; gap: 8px; color: #c3c6cc; }
.tiny-dot { width: 6px; height: 6px; border-radius: 50%; background: #858a92; }
.tiny-dot.connected { background: #c3c6cc; }
#timer { color: #c3c6cc; font-variant-numeric: tabular-nums; }
#remote-video { height: 100%; width: 100%; object-fit: contain; display: block; }
.remote-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 20px 20px 85px;
  pointer-events: none; text-align: center;
}
.remote-placeholder h2 { font-size: 20px; font-weight: 500; margin: 0 0 10px; }
.remote-placeholder p { font-size: 14px; line-height: 1.5; color: #aeb2b9; margin: 0; }
.self-preview {
  position: absolute; right: 20px; bottom: 46px; width: 144px; height: 108px;
  border: 1px solid #55585d; border-radius: var(--radius); overflow: hidden;
  background: #303338; display: grid; place-items: center;
}
.self-preview video { position: absolute; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
#self-placeholder { font-size: 16px; color: #c0c3c9; }
.self-label { position: absolute; bottom: 8px; left: 8px; font-size: 10px; white-space: nowrap; color: #fff; background: #202226; padding: 3px 5px; }
.self-label span { color: #b8bdc6; font-size: 9px; }
.stage-bottom { position: absolute; bottom: 17px; left: 20px; font-size: 12px; color: #b8bdc6; }
.controls { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 16px 0 0; }
.control {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  background: #fff; border-radius: var(--radius); padding: 11px 14px;
  color: #343b46; font-size: 13px;
}
.control-icon { display: flex; align-items: center; }
.control-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.control:hover:not(:disabled) { background: #f4f5f7; }
.control[aria-pressed=true] { border-color: var(--blue); color: var(--blue); }
.control-divider { width: 8px; }
.hangup { color: #a72e2e; }
.share-row { display: flex; gap: 8px; margin: 8px 0; }
.share-row input { min-width: 0; width: 100%; border: 1px solid #b8bec8; border-radius: var(--radius); padding: 11px 10px; color: #343b46; background: #fff; font-size: 13px; }
.copy-button { white-space: nowrap; border: 1px solid var(--blue); background: var(--blue); color: #fff; border-radius: var(--radius); font-size: 13px; padding: 0 12px; }
#share-panel > label { font-size: 14px; }
.small { font-size: 12px; line-height: 1.6; color: var(--muted); }
.text-button { border: 0; background: none; padding: 3px 0; color: var(--blue); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
#retry, #new-room { display: block; margin-top: 16px; }
footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 20px 0; font-size: 13px; color: var(--muted); }
.how-content { max-width: 700px; margin: 0 0 32px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.play-audio { position: absolute; z-index: 3; top: 58px; left: 50%; transform: translateX(-50%); background: #fff; border: 0; border-radius: var(--radius); padding: 12px 18px; color: var(--blue); font-size: 14px; white-space: nowrap; }
@media (max-width: 1000px) {
  .shell { padding: 0 28px; }
  main { grid-template-columns: 260px minmax(0, 1fr); gap: 32px; }
  .control { padding: 10px; }
}
@media (max-width: 760px) {
  .shell { padding: 0 20px; }
  header { height: 64px; }
  main { display: flex; flex-direction: column; padding: 28px 0; gap: 28px; }
  .intro, .call-area { width: 100%; }
  h1 { font-size: 26px; }
  .setup-panel { margin-top: 24px; }
  .video-stage { height: 350px; }
  .remote-placeholder { padding-bottom: 100px; }
  .remote-placeholder h2 { font-size: 18px; }
  .remote-placeholder p { font-size: 13px; }
  .self-preview { width: 104px; height: 78px; right: 16px; }
  .controls { gap: 8px; flex-wrap: wrap; }
  .control { padding: 10px; font-size: 12px; }
  .control-divider { display: none; }
}

/* The lobby is a device check; the meeting is a dedicated video workspace. */
.shell { max-width: 1600px; padding: 0 32px; }
header { border: 0; height: 88px; }
.brand { font-weight: 500; font-size: 27px; color: #444746; }
main { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 64px; padding: 64px 0 32px; align-items: center; }
.call-area { grid-column: 1; grid-row: 1; }
.intro { grid-column: 2; grid-row: 1; max-width: 400px; }
h1 { font-size: 32px; font-weight: 400; letter-spacing: -.5px; }
#setup-description { color: #5f6368; font-size: 16px; }
.video-stage { height: auto; aspect-ratio: 16 / 10; min-height: 340px; border-radius: 12px; background: #202124; }
.primary { border-radius: 24px; width: auto; min-width: 150px; padding: 13px 24px; }
.setup-panel { margin-top: 28px; }
.join-form { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.join-form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.join-row { display: flex; align-items: center; gap: 12px; }
.join-row input { min-width: 0; width: 100%; border: 1px solid #747775; border-radius: 4px; padding: 14px 12px; font-size: 14px; }
.join-button { background: none; border: 0; color: var(--blue); font-size: 14px; font-weight: 600; padding: 12px 4px; }
.status-area { padding-bottom: 24px; max-width: 720px; }
.status { margin: 0; }
.remote-placeholder { padding: 24px 24px 95px; }
.remote-placeholder h2 { font-size: 24px; font-weight: 400; }
.self-preview { display: none; }
.has-preview:not(.in-call) .self-preview { display: grid; inset: 0; width: 100%; height: 100%; border: 0; border-radius: inherit; }
.has-preview:not(.in-call) .remote-placeholder { display: none; }
.has-preview:not(.in-call) .self-label { left: 20px; bottom: 20px; font-size: 13px; background: #202124; }
.has-preview:not(.in-call) #self-placeholder { font-size: 24px; }
body:not(.in-call) .stage-top, body:not(.in-call) .stage-bottom { display: none; }
.controls { gap: 12px; }
.control { border-radius: 24px; padding: 12px 18px; }
.control-icon svg { width: 20px; height: 20px; }
.control[aria-pressed=true] { color: #b3261e; border-color: #b3261e; }
.preview-button { border: 0; background: none; color: var(--blue); font-size: 13px; padding: 12px; }
body:not(.in-call) .meeting-only { display: none; }
footer { margin-top: 12px; }
.in-call { min-height: 100dvh; background: #202124; color: #f1f3f4; }
.in-call .shell { max-width: none; padding: 0 20px; }
.in-call header, .in-call footer, .in-call .how-content, .in-call .preview-button { display: none; }
.in-call main { display: block; padding: 20px 0 0; }
.in-call .call-area { width: 100%; }
.in-call .video-stage { height: calc(100dvh - 166px); min-height: 260px; aspect-ratio: auto; background: #171819; }
.in-call .controls { height: 72px; margin: 0; }
.in-call .control { color: #f1f3f4; background: #3c4043; border-color: #3c4043; }
.in-call .control:hover:not(:disabled) { background: #505458; }
.in-call .control[aria-pressed=true], .in-call .hangup { background: #b3261e; border-color: #b3261e; color: white; }
.in-call .self-preview { display: grid; width: 200px; height: 135px; right: 20px; bottom: 44px; border-color: #5f6368; border-radius: 8px; }
.in-call .self-label { font-size: 12px; }
.in-call .status-area { padding: 0 8px 12px; margin: auto; text-align: center; max-width: 1000px; }
.in-call .status { color: #bdc1c6; font-size: 12px; }
.in-call .status.error { color: #ffb4ab; }
.in-call .text-button { color: #a8c7fa; }
.in-call .intro { display: none; }
.in-call.details-open .intro { display: block; position: fixed; z-index: 5; top: 32px; right: 32px; width: min(360px, calc(100vw - 40px)); padding: 24px; border-radius: 8px; background: #fff; color: #202124; border: 1px solid #dadce0; }
.in-call .intro h1 { font-size: 22px; }
.in-call .intro .text-button { color: var(--blue); }
.in-call .intro #setup-description, .in-call .audio-option, .in-call #join-form { display: none; }
.in-call .intro .setup-panel { margin-top: 24px; }
@media (max-width: 1000px) {
  main { gap: 32px; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); }
  .video-stage { min-height: 300px; }
}
@media (max-width: 760px) {
  .shell { padding: 0 20px; }
  header { height: 72px; }
  main { display: flex; flex-direction: column; padding: 16px 0 24px; gap: 32px; }
  .call-area { order: 0; }
  .intro { order: 1; max-width: none; }
  h1 { font-size: 28px; }
  .video-stage { min-height: 250px; height: auto; }
  .control { padding: 11px 13px; }
  .remote-placeholder h2 { font-size: 22px; }
  .controls { gap: 8px; }
  .preview-button { padding: 10px 4px; }
  .in-call .shell { padding: 0 8px; }
  .in-call main { padding-top: 8px; }
  .in-call .video-stage { height: calc(100dvh - 206px); }
  .in-call .self-preview { width: 112px; height: 84px; right: 12px; }
  .in-call .controls { height: auto; min-height: 100px; padding: 12px 0; gap: 8px; }
  .in-call .control { font-size: 12px; padding: 10px 12px; }
  .in-call.details-open .intro { top: 20px; right: 20px; }
}
.call-area { min-width: 0; }
.video-stage { width: 100%; }
.name-label { display: block; font-size: 14px; margin-bottom: 8px; }
.name-input { display: block; width: 100%; border: 1px solid #747775; border-radius: 4px; padding: 13px 12px; font: inherit; font-size: 15px; margin-bottom: 24px; }
.room-code { font-size: 15px; margin: 0 0 20px; }
.room-code strong { letter-spacing: 2px; }
#remote-name { margin-right: 16px; color: #fff; font-size: 14px; }
#self-name { font-size: inherit; color: #fff; }
.self-label { max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; }
.in-call .name-label, .in-call .name-input { display: none; }
