/* conference/web/styles.css — Phase 1 (Task 2). Minimal, dependency-free. */
:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --accent: #3b6cf6;
  --danger: #d64545;
  --ok: #2e9e5b;
  --warn: #d99a2b;
  --muted: color-mix(in srgb, currentColor 55%, transparent);
  --card: color-mix(in srgb, currentColor 6%, transparent);
  --border: color-mix(in srgb, currentColor 18%, transparent);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 1.5rem 1rem 4rem;
  line-height: 1.5;
}

#app {
  width: 100%;
  max-width: 42rem;
}

.screen[hidden] {
  display: none;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.7rem;
}

.tagline {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

/* ---- Zoom mute callout ---- */
.zoom-callout {
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border));
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border-radius: 0.6rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}
.zoom-callout strong {
  display: block;
  margin-bottom: 0.2rem;
}
.zoom-callout.compact {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* ---- Join form ---- */
#join-form {
  display: grid;
  gap: 0.35rem;
}
#join-form label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.6rem;
}
#join-form input,
#join-form select {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: inherit;
}
button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 0.5rem;
  padding: 0.7rem 1rem;
  font-weight: 600;
}
#join-btn {
  margin-top: 1.1rem;
  background: var(--accent);
  color: #fff;
}
#join-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.error {
  color: var(--danger);
  font-weight: 600;
  margin: 0.75rem 0 0;
}
.error[hidden] {
  display: none;
}
.fineprint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* ---- Room screen ---- */
.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.room-id {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.room-id .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.badge {
  font-weight: 700;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.15rem 0.5rem;
}
button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 50%, var(--border));
}

/* ---- Status bar (Task 4 surfaces rotation/reconnect state here) ---- */
.status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.status-bar[data-state="live"] .status-dot {
  background: var(--ok);
}
.status-bar[data-state="connecting"] .status-dot,
.status-bar[data-state="reconnecting"] .status-dot,
.status-bar[data-state="rotating"] .status-dot {
  background: var(--warn);
  animation: pulse 1.1s ease-in-out infinite;
}
.status-bar[data-state="offline"] .status-dot {
  background: var(--danger);
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

/* Rotation / reconnect detail surfaced by the worker's conf-status data channel (Task 4/5). */
.status-detail {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}
.speaker-line {
  margin: -0.25rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.speaker-line[data-state="speaking"] {
  color: var(--ok);
  font-weight: 650;
}

.unblock {
  width: 100%;
  background: var(--warn);
  color: #201400;
  margin-bottom: 0.75rem;
}
.unblock[hidden] {
  display: none;
}

/* ---- Room body ---- */
.room-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 34rem) {
  .room-body {
    grid-template-columns: 1.4fr 1fr;
  }
}

.roster-panel,
.controls-panel {
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.9rem 1rem;
  background: var(--card);
}
.roster-panel h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}
.count {
  display: inline-block;
  min-width: 1.5rem;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: 1rem;
  padding: 0 0.4rem;
  font-size: 0.8rem;
}
.roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.roster-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
}
.roster-item.self {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.speaking-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--border);
  flex: none;
}
.speaking-dot.active {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 30%, transparent);
}
.roster-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-lang {
  font-size: 0.8rem;
  color: var(--muted);
}
.langs-line {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.mic {
  width: 100%;
  background: var(--ok);
  color: #fff;
}
.mic:not(.on) {
  background: var(--danger);
}
.controls-panel .hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
}

/* Mid-meeting language switch */
.switch-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0.9rem 0 0.3rem;
}
.lang-switch {
  font: inherit;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: inherit;
}
.lang-switch:disabled {
  opacity: 0.6;
  cursor: progress;
}
.switch-status {
  margin: 0.4rem 0 0;
}
.switch-status.error {
  color: var(--danger);
}
.switch-status[hidden] {
  display: none;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

/* ---- Test-tone publisher (dev) ---- */
h1 .badge {
  font-size: 0.7rem;
  vertical-align: middle;
  background: var(--warn);
  color: #201400;
}
.lang-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.3rem 0.75rem;
  margin: 0.4rem 0 0.5rem;
}
.lang-checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}
#start-btn {
  margin-top: 0.75rem;
  background: var(--accent);
  color: #fff;
}
#stop-btn {
  margin-top: 0.75rem;
}
