:root {
  color-scheme: dark;
  --bg: #0e1116;
  --panel: #161b22;
  --line: #2a313c;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #7aa2f7;
  --ok: #3fb950;
  --bad: #f85149;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

header { display: flex; align-items: center; justify-content: space-between; }
h1 { font-size: 18px; margin: 0; font-weight: 600; }

.conn {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.conn::before { content: "●"; margin-right: 6px; }
.conn.on { color: var(--ok); }
.conn.off { color: var(--bad); }
.conn.wait { color: var(--muted); }

.stage { position: relative; display: flex; justify-content: center; }
.bezel {
  width: min(360px, 86vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #000;
  border: 6px solid #20262f;
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px #0008;
  overflow: hidden;
}
canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
.loading {
  position: absolute;
  inset: auto 0 12px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.loading.hidden { display: none; }

.status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.status .wide { grid-column: 1 / -1; }
.label { color: var(--muted); font-size: 12px; margin-right: 4px; }

.log {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 120px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg { white-space: pre-wrap; }
.msg .who { color: var(--muted); font-size: 12px; margin-right: 6px; }
.msg.me .who { color: var(--accent); }
.msg.err { color: var(--bad); }
.msg.sys { color: var(--muted); font-style: italic; }

form { display: flex; gap: 8px; }
input[type="text"], input[type="password"] {
  flex: 1;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  min-width: 0;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button {
  background: #21262d;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }

details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
summary { cursor: pointer; color: var(--muted); }
.settings { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.settings label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1 1 200px; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.talk { display: flex; align-items: center; gap: 12px; }
.talk .hint { margin: 0; }
.talk button.live { border-color: var(--accent); }
.meter { flex: 1; height: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
#mic-level { height: 100%; width: 0; background: var(--accent); transition: width 60ms linear; }
code { background: #0003; padding: 1px 5px; border-radius: 4px; }
