:root {
  color-scheme: light dark;
  --bg: #f6f6f7;
  --card: #ffffff;
  --fg: #17171a;
  --muted: #6b6b75;
  --line: #e3e3e8;
  --accent: #4f46e5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --card: #1f1f25;
    --fg: #f2f2f5;
    --muted: #9a9aa6;
    --line: #32323b;
    --accent: #8b84ff;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 32px 16px;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
}
main { width: 100%; max-width: 440px; }
h1 { font-size: 20px; margin: 0 0 4px; }
p.lead { margin: 0 0 24px; color: var(--muted); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; gap: 12px; margin-bottom: 16px; }
.row > div { flex: 1; }
select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
button {
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: 600 15px/1 inherit;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: default; }
button.secondary { background: transparent; color: var(--muted); border: 1px solid var(--line); }
#status { margin: 16px 0 0; font-size: 13px; color: var(--muted); min-height: 20px; }
#status.error { color: #d1344b; }
#qr { margin-top: 20px; text-align: center; }
#qr img {
  width: 100%;
  max-width: 260px;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}
#joinUrl {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  word-break: break-all;
  color: var(--accent);
}
.meta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.hidden { display: none; }
#captions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  max-height: 180px;
  overflow-y: auto;
}
#captions div { margin-bottom: 6px; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 13px;
}
#langBox { margin-top: 18px; }
