:root {
  --bg: #f3f6f8;
  --card: #ffffff;
  --text: #17212b;
  --muted: #5b6b7a;
  --accent: #0f8fa8;
  --danger: #c0392b;
  --ok: #1e9e5a;
  --warn: #d68910;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11171c;
    --card: #1b242c;
    --text: #e6edf3;
    --muted: #93a4b3;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 16px;
}
.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.08);
}
h1 { margin: 0; font-size: 1.6rem; color: var(--accent); }
.room { margin: 4px 0 20px; color: var(--muted); }
button {
  font: inherit;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  background: #e3e9ee;
  color: #17212b;
}
button.primary { width: 100%; background: var(--accent); color: #fff; font-weight: 600; padding: 16px; }
button.danger { background: var(--danger); color: #fff; }
button:disabled { opacity: 0.5; cursor: default; }
#sharing-controls { display: flex; gap: 10px; }
#sharing-controls button { flex: 1; }
.status { margin: 18px 0 0; font-weight: 600; }
.status[data-state="ok"] { color: var(--ok); }
.status[data-state="busy"] { color: var(--warn); }
.status[data-state="error"] { color: var(--danger); }
.hint { color: var(--muted); font-size: 0.9rem; }
.hint a { color: var(--accent); }
.notice { background: #fff4e0; color: #6b4a00; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
pre { font-size: 0.8rem; white-space: pre-wrap; margin: 8px 0 0; }
details { margin-top: 16px; color: var(--muted); }
label { display: block; font-weight: 600; margin-bottom: 8px; }
#pin {
  width: 100%;
  font: 600 2.2rem/1 ui-monospace, "Consolas", monospace;
  letter-spacing: 0.5em;
  text-align: center;
  padding: 12px 0 12px 0.5em;
  border: 2px solid #cfd8df;
  border-radius: 10px;
  margin-bottom: 12px;
  background: transparent;
  color: var(--text);
}
#pin:focus { outline: none; border-color: var(--accent); }
