/* Neutral, cross-party identity: charcoal/slate on warm off-white, hairline rules.
   No party hues (no saturated green, blue or red fields), no flag crimson.
   Selection is shown by fill + weight + a check mark, never by colour alone. */
:root {
  --bg: #f6f4ef;
  --card: #fffdf9;
  --ink: #26292d;
  --muted: #5d6166;
  --rule: #d8d3c8;
  --accent: #3f464d;      /* graphite slate */
  --accent-ink: #ffffff;
  --soft: #ebe7df;
  --focus: #26292d;
  --radius: 10px;
  --tap: 46px;
  font-size: 17px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1f22; --card: #24272b; --ink: #ecebe7; --muted: #a9aaa6; --rule: #3a3e43;
    --accent: #d9d6cf; --accent-ink: #1d1f22; --soft: #2e3236; --focus: #ecebe7;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  line-height: 1.5;
}
:lang(ne) { font-family: "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 96px; outline: none; }
.loading { color: var(--muted); }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--rule); }
.top-inner { max-width: 640px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { font-weight: 600; font-size: .95rem; letter-spacing: .01em; color: inherit; text-decoration: none; }
.lang { min-height: 40px; padding: 4px 12px; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.lang .on { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.progress { height: 3px; background: var(--soft); }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* type */
h1 { font-size: 1.45rem; line-height: 1.3; margin: 16px 0 8px; }
h2 { font-size: 1.2rem; line-height: 1.35; margin: 8px 0 4px; }
.step { color: var(--muted); font-size: .85rem; margin: 12px 0 0; }
.lead { font-size: 1.02rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.banner { border: 1px solid var(--rule); background: var(--card); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0; font-size: .92rem; }
.banner button { margin-left: 6px; }
.error { border-left: 3px solid var(--ink); padding: 6px 10px; margin: 10px 0; font-weight: 600; background: var(--soft); }

/* question blocks */
.q { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 18px 0 8px; min-width: 0; }
.q:first-of-type { border-top: 0; }
.q > legend, .q .qtext { font-weight: 600; font-size: 1.02rem; padding: 0; margin-bottom: 8px; display: block; }
.req { font-weight: 400; font-size: .8rem; color: var(--muted); margin-left: 6px; }
.help { color: var(--muted); font-size: .9rem; margin: -2px 0 10px; }

/* options (radio / checkbox) */
.opts { display: grid; gap: 8px; }
.opts.inline { display: flex; flex-wrap: wrap; }
.opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); cursor: pointer; }
.opts.inline .opt { padding: 8px 14px; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt .mark { flex: 0 0 22px; height: 22px; border: 1.5px solid var(--muted); border-radius: 50%; display: grid; place-items: center; font-size: 14px; line-height: 1; }
.opt.cb .mark { border-radius: 5px; }
.opt.sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.opt.sel .mark { border-color: var(--accent-ink); }
.opt.sel .mark::after { content: "✓"; }
.opt.dis { opacity: .45; cursor: not-allowed; }
.opt:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.note { display: block; font-weight: 400; font-size: .8rem; opacity: .85; }
.counter { font-size: .88rem; color: var(--muted); margin: 6px 0; }
.counter.full { color: var(--ink); font-weight: 600; }

/* text inputs */
input[type=text], input[type=number], textarea, select {
  width: 100%; min-height: var(--tap); padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
}
textarea { min-height: 110px; resize: vertical; }
select { appearance: auto; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.other-input { margin-top: 8px; }
.field { margin: 8px 0; }
.field label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.ward input { max-width: 140px; }

/* seven-point pairs */
.pair { padding: 14px 0; border-top: 1px dashed var(--rule); }
.pair:first-of-type { border-top: 0; }
.ends { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: .92rem; margin-bottom: 8px; }
.ends .r { text-align: right; }
.dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dot { position: relative; display: grid; place-items: center; min-height: var(--tap); cursor: pointer; }
.dot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dot span { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--muted); background: var(--card); display: grid; place-items: center; font-size: 13px; }
.dot.mid span { width: 30px; height: 30px; }
.dot.sel span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dot.sel span::after { content: "✓"; }
.dot:focus-within span { outline: 2px solid var(--focus); outline-offset: 2px; }
.midlabel { text-align: center; font-size: .78rem; color: var(--muted); }

/* 0-10 and 1-5 scales */
.scale { display: grid; gap: 6px; }
.scale.s11 { grid-template-columns: repeat(6, 1fr); }
.scale.s5 { grid-template-columns: repeat(5, 1fr); }
.scale .opt { justify-content: center; padding: 6px 0; font-variant-numeric: tabular-nums; }
.scale .opt .mark { display: none; }
.anchors { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin: 4px 0 0; gap: 12px; }
.likert-item { padding: 10px 0; border-top: 1px dashed var(--rule); }
.likert-item:first-of-type { border-top: 0; }
.likert-item .lab { margin-bottom: 6px; }

/* issue groups */
.group { margin: 14px 0 4px; }
.group h3 { font-size: .9rem; text-transform: none; letter-spacing: .02em; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.sticky-count { position: sticky; bottom: 72px; background: var(--bg); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; width: max-content; margin: 10px auto 0; font-size: .9rem; }

/* budget */
.brow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--rule); }
.brow:first-of-type { border-top: 0; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: var(--tap); height: var(--tap); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); color: var(--ink); font-size: 1.3rem; cursor: pointer; }
.stepper input { width: 64px; text-align: center; padding: 8px 4px; }
.btotal { margin: 12px 0; padding: 10px 12px; border-radius: var(--radius); background: var(--soft); font-weight: 600; }
.btotal.ok { background: var(--accent); color: var(--accent-ink); }

/* nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--rule); z-index: 4; }
.nav-inner { max-width: 640px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 10px; justify-content: space-between; }
.btn { min-height: var(--tap); padding: 10px 20px; border-radius: var(--radius); border: 1px solid var(--accent); font: inherit; font-weight: 600; cursor: pointer; background: var(--card); color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); flex: 1; }
.btn:disabled { opacity: .5; cursor: wait; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.ts { margin: 16px 0 4px; min-height: 70px; }
.privacy { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 20px; }
