:root {
  color-scheme: dark;
  --bg: #000000;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.55);
  --line: #ffffff;
  --lt-font: 32px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Segoe UI", system-ui, sans-serif;
}

body {
  min-height: 100dvh;
}

button, input, select {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
}

button { padding: 0.45rem 0.8rem; }

button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}

.landing {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(1.25rem, env(safe-area-inset-bottom));
}

.landing h1 { margin: 0; font-size: 2rem; }

#create-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 28rem;
}

#create-form label { display: flex; flex-direction: column; gap: 0.35rem; }

#pin, #provider, #room-provider { padding: 0.55rem 0.7rem; width: 100%; }

#form-error, .status-error { min-height: 1.2em; color: #ffb4b4; margin: 0; }

.room { height: 100dvh; background: var(--bg); }

.badge {
  position: fixed;
  z-index: 5;
  top: calc(env(safe-area-inset-top) + 0.6rem);
  right: calc(env(safe-area-inset-right) + 0.6rem);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #000000;
}

.dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #3a3a3a;
}

.dot.on { background: #39ff7a; }

.stage {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: calc(env(safe-area-inset-top) + 3.4rem) 0.8rem calc(env(safe-area-inset-bottom) + 0.8rem);
}

.scroller, .pane {
  overflow: auto;
  min-height: 0;
}

.layout-interleaved .pane-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.layout-interleaved .scroller {
  flex: 1;
  min-height: 0;
}

.utterance { margin: 0 0 1.1rem; }

.speaker {
  display: inline-block;
  margin-bottom: 0.25rem;
  padding: 0.05rem 0.55rem;
  border: 1px solid #ffffff;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.line { margin: 0; white-space: pre-wrap; word-break: break-word; }

.final { color: inherit; }

.prov { opacity: 0.65; }

.layout-interleaved .primary { font-size: var(--lt-font); }

.layout-interleaved .secondary {
  margin-top: 0.2rem;
  font-size: calc(var(--lt-font) * 0.72);
}

.panes {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.4rem;
}

.pane-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pane {
  flex: 1;
  font-size: var(--lt-font);
  padding-bottom: 2.5rem;
}

.pane-label {
  position: sticky;
  top: 0;
  background: #000000;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.layout-tabletop .pane-top { transform: rotate(180deg); }

@media (min-width: 640px) {
  .layout-split .panes { flex-direction: row; }
}

.jump {
  position: absolute;
  left: 50%;
  bottom: 0.4rem;
  transform: translateX(-50%);
  z-index: 2;
}

.hud {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 0.75rem calc(env(safe-area-inset-bottom) + 0.75rem);
  background: #000000;
  border-top: 1px solid #222222;
}

.hud[hidden], .modal[hidden], .room[hidden], .landing[hidden] { display: none; }

#provider-wrap { display: flex; flex-direction: column; min-width: 8rem; }

#provider-wrap[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.modal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

#qr-image {
  width: min(80vw, 360px);
  height: auto;
  background: #ffffff;
}
