/* Deliberately neutral: the test page must not lean towards either direction. */
:root {
  --bg: #f6f6f5;
  --surface: #ffffff;
  --ink: #1b1b1b;
  --ink-2: #555555;
  --ink-3: #8a8a8a;
  --line: #e2e2e0;
  --line-2: #cfcfcc;
  --accent: #1b1b1b;
  --focus: #2f6fde;
  --error: #b42318;
  --error-bg: #fef3f2;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

.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; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1:focus, h2:focus { outline: none; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px;
  background: rgba(246, 246, 245, 0.92);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
}
.topbar-title { font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.topbar-progress { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.bar { display: block; width: 120px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--ink); border-radius: 4px; transition: width .3s ease; }

.wrap { max-width: 720px; margin: 0 auto; padding: 40px 24px 64px; }
.wrap--intro { max-width: 760px; }
.wrap--done { padding-top: 120px; text-align: center; }

.step-head { margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.h1 { margin: 0; font-size: 32px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.h1--xl { font-size: 40px; }
.h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.lead { margin: 12px 0 0; font-size: 18px; color: var(--ink-2); }
.small { font-size: 14px; color: var(--ink-2); margin: 12px 0 0; }
.strong { color: var(--ink); font-weight: 600; }
.note { margin: 16px 0 0; font-size: 14px; color: var(--ink-2); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-top: 16px; }
.card p { margin: 0; color: var(--ink-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.grid2 .card { margin-top: 0; }
.steps, .bullets { margin: 0; padding-left: 20px; color: var(--ink-2); }
.steps li, .bullets li { margin: 4px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #000; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--lg { min-height: 52px; padding: 14px 28px; font-size: 16px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 4px 0; font: 14px var(--font); color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.ext { font-weight: 400; }

.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.nav--intro { justify-content: flex-start; border-top: 0; padding-top: 8px; }

/* snippet of the live page + the link that opens it */
.open-box {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 24px;
  padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.open-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.snippet {
  position: relative; display: block; max-width: 100%; aspect-ratio: 16 / 9;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--line);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.snippet:hover { border-color: var(--ink); box-shadow: 0 6px 20px rgba(0, 0, 0, .10); }
.snippet img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }


/* ---------- questions ---------- */
.questions { margin-top: 28px; }
.q { margin: 0 0 18px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
fieldset.q { margin-inline: 0; }
.q--invalid { border-color: var(--error); background: var(--error-bg); }
.q-label { display: block; padding: 0; margin: 0 0 12px; font-weight: 600; font-size: 16px; }
legend.q-label { float: left; width: 100%; }
legend.q-label + * { clear: both; }
.q-hint { clear: both; margin: -6px 0 12px; font-size: 14px; color: var(--ink-3); }
.q-sublabel { display: block; margin: 12px 0 6px; font-size: 14px; color: var(--ink-2); }
.req { color: var(--error); }
.q-error { margin: 10px 0 0; font-size: 14px; color: var(--error); }
.q-error--block { margin-top: 8px; padding: 12px 14px; border-radius: 8px; background: var(--error-bg); }

.input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
  font: 16px/1.4 var(--font); color: var(--ink);
}
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(47, 111, 222, .18); }
.textarea { resize: vertical; min-height: 88px; }
.select { appearance: auto; }
.words { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.choices { display: grid; gap: 8px; clear: both; }
.choices--row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer; background: #fff;
}
.choice:hover { border-color: var(--ink); }
.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); flex: none; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* 1–5 rating */
.rating { clear: both; max-width: 420px; }
.rating-dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.dot { position: relative; display: block; cursor: pointer; }
.dot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dot-num {
  display: flex; align-items: center; justify-content: center; height: 44px;
  border: 1px solid var(--line-2); border-radius: 8px; font-weight: 600; color: var(--ink-2); background: #fff;
}
.dot:hover .dot-num { border-color: var(--ink); }
.dot input:checked + .dot-num { background: var(--ink); color: #fff; border-color: var(--ink); }
.dot input:focus-visible + .dot-num { outline: 2px solid var(--focus); outline-offset: 2px; }
.rating-ends { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--ink-3); }

/* semantic-differential scales */
.scales { clear: both; display: grid; gap: 4px; }
.scale-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.scale-row:first-child { border-top: 0; }
.scale-end { font-size: 14px; color: var(--ink-2); }
.scale-end--l { text-align: right; }
.scale-dots { display: flex; gap: 6px; }
.sdot { position: relative; display: block; width: 36px; height: 36px; cursor: pointer; }
.sdot input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sdot-mark { display: block; width: 100%; height: 100%; border: 1px solid var(--line-2); border-radius: 50%; background: #fff; transition: background .12s ease, border-color .12s ease; }
.sdot:hover .sdot-mark { border-color: var(--ink); }
.sdot input:checked + .sdot-mark { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 4px #fff; }
.sdot input:focus-visible + .sdot-mark { outline: 2px solid var(--focus); outline-offset: 2px; }

/* compare thumbnails */
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.thumb { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.thumb-media { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; background: var(--line); }
.thumb figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 12px 14px; font-size: 14px; }
.thumb figcaption a { color: var(--ink-2); }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .bar { width: 64px; }
  .topbar-title { font-size: 12px; }
  .wrap { padding: 28px 16px 48px; }
  .h1 { font-size: 26px; }
  .h1--xl { font-size: 30px; }
  .lead { font-size: 16px; }
  .grid2, .thumbs { grid-template-columns: 1fr; }
  .q { padding: 16px; }
  .words { grid-template-columns: 1fr; }
  .scale-row { grid-template-columns: 1fr 1fr; grid-template-areas: "l r" "d d"; row-gap: 8px; }
  .scale-end--l { grid-area: l; text-align: left; }
  .scale-end--r { grid-area: r; text-align: right; }
  .scale-dots { grid-area: d; justify-content: space-between; }
  .sdot { width: 40px; height: 40px; }
  .btn--lg { width: 100%; }
  .open-box { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .open-actions { align-items: stretch; }
  .open-box .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
