/* Guest seat. The shared screen is the large region. Other people sit in a row under it. */
html, body { overflow-x: hidden; }
.guest-app {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 16px 20px;
}
.guest-offer, .guest-role, #guest-status {
  color: var(--ink);
  font: 1rem/1.45 var(--ui);
  overflow-wrap: anywhere;
}
.guest-offer { font-weight: 600; margin: 18px 0 4px; }
.guest-role { margin: 0 0 12px; color: var(--mute); }
#guest-status { margin: 0 0 12px; min-height: 1.45em; }
/* The refused-microphone panel replaces that small line: large type, plain box, one button. */
.guest-mic-help {
  box-sizing: border-box;
  width: 100%;
  max-width: 40rem;
  margin: 8px 0 16px;
  padding: 28px 22px 22px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}
.guest-mic-help p {
  margin: 0 0 18px;
  color: var(--ink);
  font: 700 1.5rem/1.35 var(--ui);
  overflow-wrap: anywhere;
}
.guest-mic-help button {
  min-height: 52px;
  min-width: 9rem;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font: 700 1.15rem/1 var(--ui);
}
.guest-enter { margin: 18px 0 0; max-width: 32rem; }
.guest-enter label {
  display: block;
  margin: 0 0 8px;
  color: var(--ink);
  font: 600 1rem/1.3 var(--ui);
}
.guest-enter-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}
.guest-enter input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 28%, var(--paper));
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: 600 1.05rem/1.2 var(--ui);
  letter-spacing: 0.04em;
}
.guest-enter button {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 88px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: 600 1rem/1 var(--ui);
}
#guest-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
/* An author display rule beats the hidden attribute. Keep it hidden until the call is up. */
#guest-offer[hidden],
#guest-role[hidden],
#guest-enter[hidden],
#guest-status[hidden],
#guest-stage[hidden],
#guest-demo[hidden],
#guest-mute[hidden],
#guest-leave[hidden],
#guest-end-demo[hidden],
#guest-screen-empty[hidden],
.guest-app [hidden] {
  display: none !important;
}
#guest-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 42vh;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  overflow: hidden;
}
#guest-screen-videos {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
#guest-screen-videos video {
  width: 100%;
  flex: 1 1 auto;
  min-height: 42vh;
  object-fit: contain;
  background: var(--ink);
}
#guest-screen-empty {
  margin: 0;
  padding: 28px 16px;
  color: var(--paper);
  font: 600 1rem/1.4 var(--ui);
}
#guest-people {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  padding: 0 0 4px;
}
.guest-person {
  position: relative;
  flex: 0 0 148px;
  height: 96px;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
}
.guest-person-video { position: absolute; inset: 0; }
.guest-person-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--ink);
}
.guest-person span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  color: var(--paper);
  font: 600 12px/1.3 var(--ui);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guest-controls {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  max-width: 100%;
}
.guest-controls button {
  flex: 1 1 auto;
  min-height: 44px;
  min-width: 44px;
  font: 600 1rem/1 var(--ui);
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
}
#guest-leave { background: var(--ink); }
#guest-end-demo { background: var(--ink); }
#guest-mute[data-mic="live"] { background: #1f7a4d; color: #fff; }
#guest-mute[data-mic="muted"] { background: #C8372D; color: #fff; }
/* A demo pass seat: one calm line above the stage, and End Demo in place of Leave. */
.guest-demo {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
}
.guest-demo p {
  margin: 0;
  color: var(--ink);
  font: 1rem/1.45 var(--ui);
  overflow-wrap: anywhere;
}
.guest-audio {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* A demo pass link (/guest/?demo=1#CODE): the welcome, then one press. Phone first; it centres on a wide screen. */
.guest-welcome {
  box-sizing: border-box;
  max-width: 34rem;
  margin: 20px auto 8px;
  padding: 24px 20px 20px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent), 0 8px 28px color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
  font: 1rem/1.5 var(--ui);
}
.guest-welcome-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font: 700 0.78rem/1.2 var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.guest-welcome-title {
  margin: 0 0 10px;
  font: 700 1.6rem/1.2 var(--ui);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.guest-welcome-notice {
  margin: 0 0 18px;
  color: color-mix(in srgb, var(--ink) 82%, var(--paper));
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
.guest-welcome-steps {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.guest-welcome-steps li {
  position: relative;
  margin: 0 0 10px;
  padding: 0 0 0 38px;
  min-height: 26px;
  counter-increment: step;
  overflow-wrap: anywhere;
}
.guest-welcome-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
  color: var(--accent);
  font: 700 0.85rem/26px var(--ui);
  text-align: center;
}
.guest-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
  color: var(--ink);
  font: 0.95rem/1.45 var(--ui);
  overflow-wrap: anywhere;
}
.guest-rec-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 0.4em;
  border-radius: 50%;
  background: #C8372D;
}
.guest-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guest-welcome-actions button {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 12px;
  font: 600 1.05rem/1.2 var(--ui);
  cursor: pointer;
  touch-action: manipulation;
}
.guest-join {
  border: 0;
  background: var(--accent);
  color: #fff;
}
.guest-join-quiet {
  border: 1px solid color-mix(in srgb, var(--ink) 22%, var(--paper));
  background: var(--paper);
  color: var(--ink);
}
.guest-join:focus-visible, .guest-join-quiet:focus-visible, .guest-sound:focus-visible,
.guest-screen-full:focus-visible, .guest-controls button:focus-visible, .guest-mic-help button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, var(--paper));
  outline-offset: 2px;
}
/* The one "Tap to hear Rigel" button, only when the browser blocked sound. */
.guest-sound {
  display: block;
  width: 100%;
  min-height: 52px;
  margin: 0 0 10px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: 700 1.05rem/1.2 var(--ui);
}
.guest-screen-full {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  color: var(--paper);
  font: 600 0.85rem/1 var(--ui);
}
.guest-screen-tip {
  margin: 0;
  color: var(--mute);
  font: 0.85rem/1.4 var(--ui);
  text-align: center;
}

/* The live demo: a large screen, small name chips, and Mute and End Demo in a bar at the bottom (thumb reach). */
.guest-demo-live .chrome-foot { display: none; }
.guest-app[data-seat="demo-live"] {
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}
.guest-app[data-seat="demo-live"] .guest-demo {
  margin: 12px 0 10px;
  padding: 8px 12px;
}
.guest-app[data-seat="demo-live"] .guest-demo p { font-size: 0.92rem; }
.guest-app[data-seat="demo-live"] #guest-status {
  margin: 0 0 10px;
  color: var(--mute);
  font-size: 0.92rem;
}
/* 16:10, as wide as fits above the bottom bar: on a wide screen it narrows and centres instead of running under it. */
.guest-app[data-seat="demo-live"] #guest-screen {
  box-sizing: border-box;
  width: min(100%, calc((100vh - 260px) * 1.6));
  max-width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 10;
  margin-inline: auto;
  border-radius: 10px;
}
.guest-app[data-seat="demo-live"] #guest-screen-videos video {
  min-height: 0;
  height: 100%;
}
.guest-app[data-seat="demo-live"] #guest-screen-empty {
  margin: auto 0;
  text-align: center;
  font-weight: 500;
  color: color-mix(in srgb, var(--paper) 78%, var(--ink));
}
.guest-app[data-seat="demo-live"] .guest-person {
  flex: 0 0 auto;
  height: auto;
  min-width: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, var(--paper));
  color: var(--ink);
}
.guest-app[data-seat="demo-live"] .guest-person-video { display: none; }
.guest-app[data-seat="demo-live"] .guest-person span {
  position: static;
  display: block;
  padding: 6px 12px;
  background: transparent;
  color: var(--ink);
  font-size: 0.85rem;
}
.guest-app[data-seat="demo-live"] .guest-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  justify-content: center;
  margin: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.guest-app[data-seat="demo-live"] .guest-controls button {
  flex: 1 1 0;
  max-width: 260px;
  min-height: 52px;
  border-radius: 12px;
  font-size: 1.05rem;
}
.guest-app[data-seat="demo-live"] #guest-mute[data-mic="live"] {
  background: #1f7a4d;
  color: #fff;
}
.guest-app[data-seat="demo-live"] #guest-mute[data-mic="muted"] {
  background: #C8372D;
  color: #fff;
}
.guest-app[data-seat="demo-live"] #guest-end-demo {
  background: var(--ink);
  color: var(--paper);
}
/* The demo has ended: the thank-you line alone, calm and centred. */
.guest-app[data-seat="demo-ended"] #guest-status {
  box-sizing: border-box;
  max-width: 34rem;
  margin: 48px auto 0;
  padding: 28px 20px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  text-align: center;
  font: 600 1.2rem/1.45 var(--ui);
}
/* A phone held sideways: the shared screen takes the height; the header and the notes step aside. */
@media (orientation: landscape) and (max-height: 540px) {
  .guest-demo-live .masthead { display: none; }
  .guest-app[data-seat="demo-live"] .guest-demo,
  .guest-app[data-seat="demo-live"] #guest-status,
  .guest-app[data-seat="demo-live"] #guest-people { display: none; }
  .guest-app[data-seat="demo-live"] #guest-screen {
    aspect-ratio: auto;
    height: calc(100vh - 84px - env(safe-area-inset-bottom, 0px));
    max-height: none;
    margin-top: 8px;
  }
  .guest-app[data-seat="demo-live"] .guest-controls {
    padding-top: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .guest-app[data-seat="demo-live"] .guest-controls button { min-height: 44px; }
}
@media (orientation: landscape), (min-width: 700px) {
  .guest-screen-tip { display: none; }
}
@media (min-width: 700px) {
  .guest-welcome { margin-top: 48px; padding: 32px 32px 28px; }
  .guest-welcome-title { font-size: 1.9rem; }
  .guest-welcome-actions { flex-direction: row-reverse; }
  .guest-welcome-actions button { width: auto; flex: 1 1 0; }
}
