:root {
  --bg: #f2f5f2;
  --panel: #ffffff;
  --surface: #f8faf8;
  --surface-strong: #eef3ef;
  --ink: #14221c;
  --muted: #617069;
  --muted-light: #87938d;
  --line: #dbe3de;
  --line-strong: #cbd7d1;
  --accent: #12664c;
  --accent-dark: #0b4d39;
  --accent-soft: #e3f1eb;
  --accent-pale: #f1f8f5;
  --warn: #855716;
  --danger: #922f2f;
  --shadow: 0 24px 70px rgba(24, 48, 38, 0.08);
  --panel-radius: 28px;
  --control-radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 2%, rgba(65, 138, 105, 0.12), transparent 30rem),
    linear-gradient(180deg, #f7f9f7 0, var(--bg) 38rem);
}

button,
textarea,
select,
input { font: inherit; }

button { cursor: pointer; }
button:disabled {
  cursor: not-allowed;
  border-color: #dfe5e1;
  color: #8a958f;
  background: #f2f5f3;
  box-shadow: none;
}

button:focus-visible,
summary:focus-visible,
textarea:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid #28775d;
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hidden { display: none !important; }

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin: 0 6px 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: white;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(18, 102, 76, 0.2);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.mode-badge {
  padding: 7px 11px;
  border: 1px solid #d6ad6c;
  border-radius: 999px;
  color: #6d480f;
  background: #fff8eb;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.language-toggle {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 14px rgba(24, 48, 38, 0.03);
}

.language-toggle button {
  min-width: 42px;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
}

.language-toggle button.selected {
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 780;
}

.language-toggle button:disabled { cursor: default; }

.language-toggle button.selected:disabled {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.panel {
  border: 1px solid rgba(211, 222, 216, 0.95);
  border-radius: var(--panel-radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel:focus,
h1:focus { outline: none; }

h1,
h2,
p { margin-top: 0; }

h1 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4.6vw, 3.65rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

h2 {
  font-size: 1rem;
  line-height: 1.35;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

html[lang="zh-CN"] .eyebrow,
html[lang="ja"] .eyebrow {
  letter-spacing: 0.05em;
  text-transform: none;
}

.lead {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.7;
}

.lead.small { max-width: 680px; font-size: 0.98rem; }

.primary-action,
.secondary-action,
.text-action {
  min-height: 46px;
  border-radius: var(--control-radius);
  padding: 11px 20px;
  font-weight: 780;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.primary-action {
  min-width: 136px;
  border: 1px solid var(--accent);
  color: white;
  background: var(--accent);
  box-shadow: 0 9px 20px rgba(18, 102, 76, 0.16);
}

.primary-action:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.secondary-action {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: white;
}

.secondary-action:hover:not(:disabled) {
  border-color: #9eb3a8;
  background: var(--accent-pale);
}

.text-action {
  border: 1px solid transparent;
  color: var(--accent);
  background: transparent;
}

.text-action:hover:not(:disabled) { background: var(--accent-pale); }

/* Intro */

.intro-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 62px);
}

.intro-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent), #65a98c);
  content: "";
}

.intro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: clamp(36px, 6vw, 76px);
  align-items: center;
}

.intro-copy { padding: 12px 0; }
.intro-copy h1 { max-width: 690px; }
.intro-copy .lead { max-width: 610px; }

.intro-guide {
  padding: 25px 25px 23px;
  border-radius: 22px;
  color: white;
  background:
    radial-gradient(circle at 100% 0, rgba(118, 190, 157, 0.2), transparent 18rem),
    #173128;
  box-shadow: 0 20px 44px rgba(19, 49, 39, 0.16);
}

.study-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.study-facts div {
  min-width: 0;
  padding: 0 13px;
  text-align: center;
}

.study-facts div:first-child { padding-left: 0; }
.study-facts div:last-child { padding-right: 0; }
.study-facts div + div { border-left: 1px solid rgba(255, 255, 255, 0.14); }
.study-facts strong,
.study-facts span { display: block; }
.study-facts strong { margin-bottom: 4px; color: white; font-size: 1.05rem; }
.study-facts span { color: #b9ccc3; font-size: 0.7rem; line-height: 1.25; }

.instruction-grid { display: grid; gap: 0; }

.instruction-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
  padding: 13px 0;
}

.instruction-card + .instruction-card { border-top: 1px solid rgba(255, 255, 255, 0.11); }
.instruction-card:first-child { padding-top: 0; }
.instruction-card:last-child { padding-bottom: 0; }
.instruction-card h2 { margin: 0 0 4px; color: white; font-size: 0.92rem; }
.instruction-card p { margin: 0; color: #b9ccc3; font-size: 0.82rem; line-height: 1.5; }

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #d8ebe2;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 850;
}

.intro-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  margin-top: clamp(30px, 4vw, 46px);
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.privacy-note {
  position: relative;
  max-width: 650px;
  margin: 0;
  padding-left: 34px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.privacy-note::before {
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  color: var(--accent-dark);
  background: var(--accent-soft);
  content: "i";
  font-size: 0.75rem;
  font-weight: 900;
}

.intro-actions { min-width: 230px; text-align: right; }
.start-action { min-width: 220px; }

.participant-status,
.resume-note,
.load-status {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.resume-note,
.load-status { margin: 8px 0 0; }

.candidate-notice {
  max-width: 760px;
  margin: 22px auto 0;
  padding: 13px 16px;
  border: 1px solid #dfb875;
  border-radius: 12px;
  color: #6d480f;
  background: #fff8ea;
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Consent and setup */

.form-panel { padding: clamp(28px, 4.5vw, 54px); }

.form-panel > h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(1.8rem, 3.5vw, 2.75rem);
}

.form-panel > .lead { margin-bottom: 30px; }

.consent-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 22px;
  align-items: start;
  margin-top: 30px;
}

.study-info {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.study-info > section {
  display: grid;
  grid-template-columns: minmax(150px, 0.32fr) minmax(0, 0.68fr);
  gap: 24px;
  padding: 23px 25px;
}

.study-info > section + section { border-top: 1px solid var(--line); }
.study-info h2 { margin: 1px 0 0; color: var(--accent-dark); font-size: 0.93rem; }
.study-info p { margin: 0 0 10px; color: #52625a; font-size: 0.9rem; line-height: 1.62; }
.study-info p:last-child { margin-bottom: 0; }

.study-contacts { margin: 15px 0 0; }

.study-contacts div {
  display: grid;
  grid-template-columns: minmax(118px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.study-contacts dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 760;
}

.study-contacts dd {
  margin: 0;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.consent-decision {
  padding: 22px;
  border: 1px solid #bed1c7;
  border-radius: 20px;
  background: var(--accent-pale);
}

.consent-checklist,
.compact-fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.consent-checklist legend,
.compact-fieldset legend {
  padding: 0;
  color: var(--ink);
  font-weight: 820;
}

.consent-checklist legend { margin-bottom: 12px; font-size: 0.96rem; }

.consent-checklist label {
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 44px;
  margin: 0;
  padding: 12px 2px;
  border: 0;
  border-top: 1px solid rgba(190, 209, 199, 0.85);
  border-radius: 0;
  color: #35453d;
  background: transparent;
  font-size: 0.82rem;
  line-height: 1.42;
  cursor: pointer;
}

.consent-checklist label:hover { background: rgba(255, 255, 255, 0.44); }

.consent-checklist input,
.inline-check input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--accent);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.consent-decision .form-actions { margin-top: 18px; }

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.setup-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
}

.setup-card-wide { grid-column: 1 / -1; }

.setup-card-heading {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  min-height: 44px;
  margin-bottom: 17px;
}

.setup-index {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.setup-card-heading h2 { margin: 2px 0 0; color: var(--ink); font-size: 1rem; }
.setup-card-heading p { margin: 7px 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.55; }
.setup-card > .secondary-action { width: 100%; }

.field-row {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 720;
}

.field-row select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 8px 12px;
  color: var(--ink);
  background: white;
}

.inline-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  margin: 15px 0 0;
  color: #3e4e46;
  font-size: 0.84rem;
  line-height: 1.45;
}

.compact-fieldset { margin-top: 18px; }
.compact-fieldset legend { font-size: 0.84rem; }
.compact-fieldset .confidence-row { margin-top: 10px; }

.inline-status {
  min-height: 1.25rem;
  margin: 10px 0 0 !important;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.inline-status[data-state="success"] { color: var(--accent); }
.inline-status[data-state="error"] { color: var(--danger); }

.instruction-questions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.instruction-question {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.instruction-question > p {
  min-height: 2.7em;
  margin-bottom: 12px;
  color: #33433b;
  font-size: 0.87rem;
  font-weight: 740;
  line-height: 1.42;
}

.check-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-choice-row button {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 11px;
  color: var(--muted);
  background: white;
  font-size: 0.81rem;
  line-height: 1.3;
}

.check-choice-row button:hover { border-color: #9eb3a8; }

.check-choice-row button.selected {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 760;
}

/* Trial */

.trial-panel { padding: clamp(23px, 3.5vw, 40px); }

.trial-header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
  width: min(100%, 760px);
  margin: 0 auto 20px;
}

.trial-header h1 {
  max-width: 670px;
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.12;
}

.progress-block {
  flex: 0 0 auto;
  width: min(190px, 25vw);
  padding-top: 2px;
  color: var(--muted);
  text-align: right;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.video-card {
  width: min(100%, 640px, 68vh);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #c5d1cb;
  border-radius: 20px;
  background: #101513;
  box-shadow: 0 16px 40px rgba(17, 32, 26, 0.12);
}

.video-frame {
  position: relative;
  display: flex;
  justify-content: center;
  background: #171c1a;
}

.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #171c1a;
}

.transcript-card {
  padding: 14px clamp(16px, 4vw, 30px) 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: white;
  background: linear-gradient(180deg, #18201c 0%, #101513 100%);
  text-align: center;
}

.transcript-card span {
  display: block;
  color: #aab8b1;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.transcript-card p {
  max-width: 690px;
  margin: 6px auto 0;
  font-size: clamp(0.92rem, 1.7vw, 1.04rem);
  font-weight: 650;
  line-height: 1.5;
}

.transcript-block + .transcript-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.transcript-translation p { color: #c8dad2; }

.media-status {
  position: absolute;
  left: 13px;
  bottom: 47px;
  max-width: calc(100% - 26px);
  padding: 7px 10px;
  border-radius: 8px;
  color: white;
  background: rgba(15, 23, 19, 0.82);
  font-size: 0.75rem;
  line-height: 1.3;
  pointer-events: none;
}

.media-status.ready { display: none; }
.media-status.error { display: block; background: rgba(133, 38, 38, 0.92); }
.media-status.complete { display: block; background: rgba(11, 77, 57, 0.94); }

.answer-section {
  width: min(100%, 760px);
  margin: 22px auto 0;
}

.answer-section > h2 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.choice-button {
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font-weight: 780;
}

.choice-button:hover:not(:disabled) {
  border-color: #92ad9f;
  background: var(--accent-pale);
}

.choice-button.selected,
.choice-button.not-sure.selected {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.followup {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.followup-step,
.note-disclosure {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  animation: followup-reveal 180ms ease-out;
}

.question-block { min-width: 0; }

.question-block + .question-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.question-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 780;
  line-height: 1.4;
}

.confidence-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
}

.confidence-row button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font-variant-numeric: tabular-nums;
}

.confidence-row button:hover { border-color: #92ad9f; }

.confidence-row button.selected {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
  font-weight: 800;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 6px;
  color: var(--muted-light);
  font-size: 0.7rem;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.option-grid > .check-option { grid-column: span 2; }
.option-grid > .check-option:nth-last-child(-n + 2) { grid-column: span 3; }

.check-option { position: relative; min-width: 0; }

.check-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-option span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  height: 100%;
  min-height: 48px;
  padding: 8px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: white;
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.check-option span::before {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid #9fb0a7;
  border-radius: 5px;
  color: white;
  background: white;
  content: "";
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}

.check-option input:checked + span {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(18, 102, 76, 0.2);
  font-weight: 730;
}

.check-option input:checked + span::before {
  border-color: var(--accent);
  background: var(--accent);
  content: "\2713";
}

.check-option input:focus-visible + span {
  outline: 3px solid #28775d;
  outline-offset: 2px;
}

.field-hint {
  display: block;
  margin-top: 7px;
  color: var(--muted-light);
  font-size: 0.7rem;
}

.note-disclosure { padding: 0; overflow: hidden; }

.note-disclosure summary {
  padding: 14px 17px;
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 760;
  cursor: pointer;
}

.note-disclosure[open] summary { border-bottom: 1px solid var(--line); }
.notes-field { display: block; padding: 15px 17px 17px; }

.notes-field textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  line-height: 1.45;
}

.pii-warning {
  display: block;
  margin-top: 8px;
  color: #7b5544;
  font-size: 0.7rem;
  line-height: 1.45;
}

@keyframes followup-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.trial-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  width: min(100%, 760px);
  margin: 18px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.submission-status { color: var(--muted); font-size: 0.76rem; }
.submission-status[data-status="saving"] { color: var(--warn); }
.submission-status[data-status="saved"] { color: var(--accent); }
.submission-status[data-status="failed"] { color: var(--danger); }

.inspect-badge {
  margin-top: 4px;
  color: #8c4c18;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
}

.stop-note {
  width: min(100%, 760px);
  margin: 14px auto 0;
  color: var(--muted-light);
  font-size: 0.71rem;
  line-height: 1.5;
}

/* Completion states */

.done-panel {
  width: min(100%, 760px);
  min-height: 510px;
  margin-inline: auto;
  padding: clamp(42px, 7vw, 76px);
  text-align: center;
}

.done-panel h1 {
  max-width: 590px;
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.done-panel .lead { margin-right: auto; margin-left: auto; }

.done-mark,
.declined-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 20px;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(18, 102, 76, 0.2);
  font-size: 1.45rem;
}

.declined-mark {
  color: var(--muted);
  background: var(--surface-strong);
  box-shadow: none;
}

.saving-mark {
  width: 50px;
  height: 50px;
  margin: 0 auto 22px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: saving-spin 800ms linear infinite;
}

@keyframes saving-spin { to { transform: rotate(360deg); } }

.done-save-status {
  max-width: 620px;
  margin: 22px auto;
  color: var(--muted);
  font-size: 0.84rem;
}

.done-save-status[data-status="saving"] { color: var(--warn); }
.done-save-status[data-status="saved"] { color: var(--accent); }
.done-save-status[data-status="failed"] { color: var(--danger); }

.completion-reference {
  display: inline-block;
  margin: 26px auto 0;
  padding: 12px 17px;
  border: 1px solid #b8d0c4;
  border-radius: 11px;
  color: var(--accent-dark);
  background: var(--accent-pale);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  font-weight: 780;
}

.completion-contact {
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--muted-light);
  font-size: 0.79rem;
  line-height: 1.5;
}

@media (max-width: 1000px) {
  .intro-layout { grid-template-columns: 1fr; gap: 30px; }
  .intro-copy { max-width: 760px; padding: 0; }
  .intro-guide { max-width: 760px; }
  .consent-layout { grid-template-columns: 1fr; }
  .consent-decision { position: static; }
}

@media (max-width: 820px) {
  .shell { width: min(100% - 24px, 1180px); }
  .setup-grid { grid-template-columns: 1fr; }
  .setup-card-wide { grid-column: auto; }
  .instruction-questions { grid-template-columns: 1fr; }
  .instruction-question > p { min-height: 0; }
  .trial-header { display: block; }
  .progress-block { width: 100%; margin-top: 14px; text-align: left; }
  .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .option-grid > .check-option,
  .option-grid > .check-option:nth-last-child(-n + 2) { grid-column: auto; }
  .option-grid > .check-option:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 16px, 1180px); padding: 10px 0 36px; }
  .site-header { align-items: flex-start; margin: 0 4px 10px; }
  .header-actions { align-items: flex-end; flex-direction: column-reverse; gap: 6px; }
  .mode-badge { padding: 5px 8px; font-size: 0.62rem; }
  .language-toggle button { min-width: 42px; min-height: 44px; padding: 5px 7px; font-size: 0.76rem; }
  .panel { border-radius: 19px; }
  .intro-panel,
  .form-panel,
  .trial-panel,
  .done-panel { padding: 23px 17px; }
  .intro-panel::before { width: 4px; }
  .intro-layout { gap: 24px; }
  .intro-copy h1 { font-size: clamp(2rem, 11vw, 2.75rem); }
  .intro-guide { padding: 20px 18px; border-radius: 17px; }
  .study-facts div { padding: 0 8px; }
  .study-facts strong { font-size: 0.95rem; }
  .study-facts span { font-size: 0.64rem; }
  .intro-footer { grid-template-columns: 1fr; gap: 20px; }
  .intro-actions { min-width: 0; text-align: left; }
  .start-action { width: 100%; }
  .study-info > section { grid-template-columns: 1fr; gap: 9px; padding: 19px 18px; }
  .study-contacts div { grid-template-columns: 1fr; gap: 3px; }
  .consent-decision { padding: 18px 15px; border-radius: 16px; }
  .setup-card { padding: 19px 16px; border-radius: 16px; }
  .setup-card > .secondary-action { width: 100%; }
  .choice-row { gap: 7px; }
  .choice-button { min-height: 50px; padding: 7px 5px; font-size: 0.82rem; }
  .followup-step { padding: 15px; }
  .option-grid { grid-template-columns: 1fr; }
  .option-grid > .check-option,
  .option-grid > .check-option:nth-last-child(-n + 2),
  .option-grid > .check-option:last-child:nth-child(odd) { grid-column: auto; }
  .trial-footer { align-items: flex-end; }
  .done-panel { min-height: 430px; }
}

@media (max-width: 460px) {
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .primary-action,
  .form-actions .text-action { width: 100%; }
  .check-choice-row { grid-template-columns: 1fr; }
  .choice-row { grid-template-columns: 1fr; }
  .trial-footer { align-items: stretch; flex-direction: column; }
  .trial-footer .primary-action { width: 100%; }
}

@media (max-width: 360px) {
  .followup-step { padding: 12px; }
  .confidence-row { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
