:root {
  --navy: #14396b;      /* header bar, ballot numbers */
  --ink: #16191d;
  --line: #2b3440;
  --soft: #b9c1cb;
  --green: #0b7a3b;
  --red: #b3261e;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }

body {
  font: 17px/1.45 system-ui, sans-serif; color: var(--ink); background: #e9edf2;
  height: 100dvh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

header {
  display: flex; gap: 10px; align-items: center; background: var(--navy); color: #fff;
  font-size: 14px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
}
header #stat { margin-left: auto; font-variant-numeric: tabular-nums; }
#gear { background: none; border: 0; color: #fff; font-size: 19px; padding: 0 4px; }

main { flex: 1; min-height: 0; display: flex; background: #fff; }
section { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 16px; padding: 20px 18px; }
h1 { font-size: 27px; font-weight: 700; line-height: 1.2; }
.hint { color: #5a6673; font-size: 15px; }
.thanks { margin: auto; font-size: 38px; color: var(--green); text-align: center; }
label { color: #5a6673; font-size: 15px; }

input {
  font-size: 24px; padding: 14px; border: 2px solid var(--line); background: #fff; color: inherit;
}

/* big machine-style action buttons */
button { font: inherit; color: inherit; }
.big { padding: 22px; font-size: 23px; font-weight: 700; background: #fff; border: 3px solid var(--line); }
.big.go { background: var(--green); border-color: var(--green); color: #fff; }
.big.no { background: #fff; border-color: var(--red); color: var(--red); }
#s-home .go, #s-consent .go { margin-top: auto; }

/* step line above the question */
.step { display: flex; align-items: center; gap: 14px; color: #5a6673; font-size: 14px; min-height: 26px; }
.step .link { background: none; border: 0; padding: 4px 8px 4px 0; font-size: 16px; font-weight: 600; color: var(--navy); }
.step .link:active { background: none; color: #0e2a50; }

/* the ballot and every question after it */
#q-list { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow: auto; min-height: 0; }
.opt {
  display: flex; align-items: stretch; gap: 0; text-align: left; padding: 0;
  background: #fff; border: 2px solid var(--line);
}
.opt .num {
  flex: 0 0 58px; display: flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; font-size: 24px; font-weight: 700;
}
.opt.extra .num { background: #dfe4ea; }
.opt.plain.extra { border-color: #8e99a6; color: #4a5460; }
.opt .txt { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 14px; }
.opt.plain .txt { padding: 19px 16px; }   /* no ballot number to give the row height */
.opt b { font-size: 20px; font-weight: 700; }
.opt i { font-style: normal; font-size: 14px; color: #5a6673; text-transform: uppercase; letter-spacing: .03em; }
.opt::after {
  content: ""; flex: 0 0 34px; align-self: center; height: 34px;
  border: 2px solid var(--line); margin-right: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; line-height: 1;
}
.opt.sel { border-color: var(--green); background: #e9f6ee; }
.opt.sel::after { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }

/* One tap answers, so the next question slides in slowly enough to be noticed
   (‹ Назад slides the other way). --i staggers the rows. */
@keyframes in-next { from { opacity: 0; transform: translateX(30px); } }
@keyframes in-prev { from { opacity: 0; transform: translateX(-30px); } }
#s-q.fwd h1 { animation: in-next .45s ease-out both; }
#s-q.back h1 { animation: in-prev .45s ease-out both; }
#s-q.fwd .opt { animation: in-next .4s ease-out both calc(var(--i) * 30ms); }
#s-q.back .opt { animation: in-prev .4s ease-out both calc(var(--i) * 30ms); }
@media (prefers-reduced-motion: reduce) { #s-q * { animation-duration: 1ms; } }

.alert { background: #fdecec; border-left: 6px solid var(--red); color: var(--red);
  font-weight: 600; padding: 12px 14px; }
.alert .tick { display: block; margin-top: 6px; font-size: 15px; font-weight: 400; }

button:active { background: #dce8f7; }
.big.go:active { background: #0a6534; }
.opt:active .num { background: #0e2a50; }
[hidden] { display: none !important; }
