:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1d2330; --muted: #677085; --line: #dfe3ea;
  --accent: #2f6fde; --accent-text: #fff; --yes: #1f8a4c; --no: #c23b3b; --warn: #b7791f;
  --playing: #e8f0ff; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171d; --panel: #1d212a; --text: #e6e9ef; --muted: #9aa3b5; --line: #2e3442;
    --accent: #5b8ff0; --yes: #3fb872; --no: #e06363; --warn: #e0a84a; --playing: #22324f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, "Segoe UI", sans-serif; }
a { color: var(--accent); }
header { display: flex; gap: 20px; align-items: center; padding: 10px 20px; background: var(--panel);
         border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header nav { display: flex; gap: 14px; flex: 1; }
header nav a { text-decoration: none; color: var(--muted); padding: 4px 2px; }
header nav a.active { color: var(--text); border-bottom: 2px solid var(--accent); }
.me { color: var(--muted); }
main { max-width: 980px; margin: 24px auto; padding: 0 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
h1 { font-size: 22px; margin: 0 0 12px; } h2 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
button { font: inherit; border: 1px solid transparent; border-radius: 8px; padding: 8px 16px; cursor: pointer;
         background: var(--accent); color: var(--accent-text); }
button:disabled { opacity: .5; cursor: default; }
button.secondary { background: transparent; color: var(--text); border-color: var(--line); }
button.yes { background: var(--yes); } button.no { background: var(--no); }
button.link { background: none; color: var(--accent); padding: 0; }
button.big { font-size: 18px; padding: 12px 22px; min-width: 120px; }
kbd { font: 12px ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
      padding: 0 5px; margin-left: 6px; opacity: .85; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.question { font-size: 26px; margin: 4px 0 14px; }
.clips { list-style: none; padding: 0; margin: 12px 0; }
.clips li { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 6px; }
.clips li.playing { background: var(--playing); }
.clips li.excluded .text { text-decoration: line-through; color: var(--muted); }
.clips .text { flex: 1; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.ok { color: var(--yes); border-color: var(--yes); } .tag.bad { color: var(--no); border-color: var(--no); }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.progress > div { height: 100%; background: var(--yes); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { font-size: 34px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
                          background: var(--panel); color: var(--text); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.login { max-width: 360px; margin: 10vh auto; }
.login form { display: grid; gap: 12px; }
.error { color: var(--no); }
.ratings { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.ratings button { font-size: 22px; width: 64px; height: 64px; }
details summary { cursor: pointer; color: var(--muted); }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
         padding: 8px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.show { opacity: .92; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); max-width: 440px; }
dialog menu { display: flex; gap: 10px; justify-content: flex-end; padding: 0; margin: 16px 0 0; }
dialog input { width: 100%; }
.playbtn { background: transparent; color: var(--accent); border: 1px solid var(--line); padding: 2px 9px; }
@media (max-width: 600px) { .question { font-size: 21px; } button.big { min-width: 0; flex: 1; } }
#mic { padding: 4px 10px; font-size: 13px; }
#mic.on { border-color: var(--yes); color: var(--yes); }
#mic.loading { border-color: var(--warn); color: var(--warn); }
#mic.error { border-color: var(--no); color: var(--no); }
.voicehint { font-size: 12px; color: var(--muted); margin-top: 8px; }
