:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --card-2: #232733;
  --text: #e8eaed;
  --muted: #9aa0ac;
  --accent: #5b8cff;
  --good: #3fb950;
  --bad: #f0603a;
  --depends: #d9a93a;
  --border: #2b2f3a;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.site-head { text-align: center; margin-bottom: 1.75rem; }
.brand {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.tagline { margin: 0.25rem 0 0; color: var(--muted); }

.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --- Question card --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.question-body {
  font-size: 1.25rem;
  line-height: 1.45;
  margin: 0 0 1.25rem;
}

fieldset.choices {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
fieldset.choices legend { padding: 0; margin: 0 0 0.6rem; font-weight: 600; }

.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.choice:hover { border-color: var(--accent); }
.choice input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.choice:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice .label { font-weight: 600; }

/* --- Depends text --- */
.depends-wrap { margin-top: 0.9rem; }
.depends-wrap[hidden] { display: none; }
.depends-wrap textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  font: inherit;
}
.counter { text-align: right; font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }
.counter.limit { color: var(--bad); }

/* --- Buttons --- */
button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.7rem 1.1rem;
  background: var(--card-2);
  color: var(--text);
}
.btn-primary, button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0e14;
  font-weight: 700;
}
.btn-primary:hover, button[type="submit"]:hover { filter: brightness(1.05); }
.btn-secondary { background: transparent; }
button:disabled { opacity: 0.5; cursor: default; }

.actions { margin-top: 1.25rem; display: flex; gap: 0.75rem; }

/* --- Results --- */
.results { margin-top: 0.5rem; }
.result-row {
  display: grid;
  grid-template-columns: 90px 1fr 48px;
  align-items: center;
  gap: 0.6rem;
  margin: 0.55rem 0;
}
.result-row .name { font-weight: 600; }
.bar {
  height: 14px;
  background: var(--card-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span { display: block; height: 100%; width: 0; transition: width 0.5s ease; }
.bar.good > span { background: var(--good); }
.bar.bad > span { background: var(--bad); }
.bar.depends > span { background: var(--depends); }
.pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.sources { margin-top: 1.1rem; font-size: 0.9rem; }
.sources a { color: var(--accent); word-break: break-all; }

/* --- Subscribe --- */
.subscribe {
  margin-top: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.subscribe h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }
#subscribe-form { display: flex; gap: 0.6rem; }
#subscribe-form input {
  flex: 1;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
}
.sub-status { min-height: 1.2em; margin: 0.6rem 0 0; font-size: 0.9rem; }
.sub-status.ok { color: var(--good); }
.sub-status.err { color: var(--bad); }

.site-foot { margin-top: 3rem; text-align: center; font-size: 0.85rem; }

/* --- Modal --- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; z-index: 50;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 460px; width: 100%;
}
.modal-card h2 { margin: 0 0 0.75rem; }
.modal-body p { margin: 0 0 0.75rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1rem; }

/* --- States --- */
.loading, .empty { text-align: center; color: var(--muted); padding: 2rem 0; }

h1 { line-height: 1.2; }
