/* PathKEY — the respondent flow (design §12.4). Owned by the respondent &
   report workstream. Role tokens only (css/tokens.css); components from
   styles.css. Phone first; on a desktop the flow is a centred 560px column
   that never changes width between steps. Respondent text and fields are 16px
   (which also stops iOS zooming into a field). */

/* ------------------------------------------------------------ the column --- */
.app[data-layout="respond"] .work { background: var(--wash-image) top left / 100% 360px no-repeat, var(--bg-canvas); }
.respond {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: var(--sp-6) var(--sp-4) var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-4);
  font-size: var(--fs-16); line-height: var(--lh-16);
}
/* The flow draws its own footer (coach, privacy, the EU line) in the respondent's language. */
.app[data-layout="respond"]:has(.r-foot) .respond-foot { display: none; }

/* A coach or an admin trying the link: what the respondent sees, under this note. */
.r-preview {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  background: var(--highlight-faint); border: 1px dashed var(--highlight-ring); border-radius: var(--r-12);
  font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-2);
}
.r-preview > .icon { flex: none; color: var(--highlight-strong-text); }
.r-preview p { flex: 1 1 260px; margin: 0; }
.r-preview strong { color: var(--text); font-weight: var(--fw-semibold); }
.r-preview-actions { display: flex; gap: var(--sp-1); margin-left: auto; }

.r-coach { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-muted); }
.r-coach strong { color: var(--text); font-weight: var(--fw-semibold); }
.r-coach-co { color: var(--text-muted); }

.r-card {
  display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0;
  padding: var(--sp-6); background: var(--bg-surface);
  border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card);
}
.r-center { align-items: center; text-align: center; }
.r-step {
  font-size: var(--fs-11); line-height: var(--lh-11); font-weight: var(--fw-bold);
  letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--text-eyebrow);
}
.r-title { font-size: var(--fs-26); line-height: var(--lh-26); font-weight: var(--fw-bold); letter-spacing: var(--track-display); }
.r-title:focus, .r-stmt:focus, .r-display:focus { outline: none; box-shadow: none; }
.r-title-icon { display: flex; align-items: center; gap: var(--sp-3); }
.r-subtitle { font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-semibold); }
.r-display { font-size: var(--fs-32); line-height: var(--lh-32); font-weight: var(--fw-bold); letter-spacing: var(--track-display); }
.r-lede { color: var(--text-2); font-size: var(--fs-16); line-height: 25px; text-wrap: pretty; }
.r-nobr { white-space: nowrap; }
.r-lede strong { color: var(--text); font-weight: var(--fw-semibold); }
.r-note {
  display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4);
  background: var(--bg-subtle); border: 1px solid var(--line-soft); border-radius: var(--r-12);
  font-size: var(--fs-14); line-height: 21px; color: var(--text-2); text-align: left;
}
.r-note > .icon { flex: none; margin-top: 3px; color: var(--accent); }
.r-note.is-preview { background: var(--highlight-faint); border: 1px dashed var(--highlight-ring); }
.r-note.is-preview > .icon { color: var(--highlight-strong-text); }
.r-hint { font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-muted); }
/* a link's error states carry no "needs you" gold: a neutral tile */
.respond .icon-tile-neutral { background: var(--bg-sunken); }
/* an alternative path (skip, start over, finish): a teal link with a touch-sized target */
.respond .btn-link { min-height: 44px; padding: 0 var(--sp-2); font-weight: var(--fw-semibold); }
.respond .btn-link:focus-visible { box-shadow: var(--focus-ring); }

/* ------------------------------------------------ before you start: trust --- */
.r-trust { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.r-trust li { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-14); line-height: 21px; color: var(--text-2); }
.r-trust li > span:last-child { padding-top: 5px; }
.r-trust strong { color: var(--text); font-weight: var(--fw-semibold); }

/* v5: the company the link is for — what it receives, the firm that can open the report */
.r-company-notes { padding-top: var(--sp-3); border-top: 1px solid var(--line-soft); }
.r-with { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-muted); }
.r-with .icon { color: var(--accent); }

.r-more > summary, .r-foot-privacy > summary {
  display: inline-flex; align-items: center; gap: var(--sp-1); cursor: pointer; list-style: none;
  color: var(--text-link); font-size: var(--fs-14); font-weight: var(--fw-medium); border-radius: var(--r-4);
}
.r-more > summary::-webkit-details-marker, .r-foot-privacy > summary::-webkit-details-marker { display: none; }
@media (hover: hover) and (pointer: fine) { .r-more > summary:hover { text-decoration: underline; } }
.r-more-chevron { transition: transform var(--dur-2) var(--ease); }
.r-more[open] .r-more-chevron { transform: rotate(90deg); }
.r-privacy-text {
  display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); padding: var(--sp-4);
  background: var(--bg-sunken); border-radius: var(--r-12); text-align: left;
  font-size: var(--fs-13); line-height: 20px; color: var(--text-2);
}
.r-more[open] .r-privacy-text, .r-foot-privacy[open] .r-privacy-text { animation: r-fade var(--dur-3) var(--ease-enter) both; }

/* --------------------------------------------------------------- forms --- */
.r-form { display: flex; flex-direction: column; gap: var(--sp-5); }
.r-field { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.r-field > label, .r-group > legend { font-size: var(--fs-14); line-height: 20px; font-weight: var(--fw-medium); color: var(--text-2); padding: 0; }
.respond :where(input:not([type=checkbox]):not([type=radio])) {
  min-height: var(--h-xl); padding: 11px var(--sp-4); font-size: var(--fs-16); line-height: 24px; border-radius: var(--r-12);
}
.respond input.r-year { max-width: 140px; font-variant-numeric: tabular-nums; }
.respond input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; border-radius: var(--r-6); }
.respond input[type=checkbox]::after { width: 11px; height: 6px; }
.r-check { min-height: 44px; align-items: flex-start; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-12); background: var(--bg-subtle); transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
@media (hover: hover) and (pointer: fine) { .r-check:hover { border-color: var(--line-control); } }
.r-check:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.r-check .checkbox-text { display: block; font-size: var(--fs-14); line-height: 21px; color: var(--text); }
.r-check.has-error { border-color: var(--crit); background: var(--crit-soft); }
.r-check-small { min-height: 32px; font-size: var(--fs-14); }
/* v5: the optional boxes under the required one, named as optional */
.r-optional { display: flex; flex-direction: column; gap: var(--sp-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.r-optional-title { padding: 0; margin-bottom: var(--sp-1); font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-bold); letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--text-muted); }
.r-optional .r-hint { margin-top: calc(-1 * var(--sp-1)); padding-left: var(--sp-4); }
/* T1.30: where the report goes, above the boxes; a group entrant's address, fixed once given */
.r-destination { display: grid; gap: var(--sp-2); }
.r-destination > p { margin: 0; font-size: var(--fs-14); line-height: 21px; color: var(--text-2); }
.r-destination strong, .r-bound { overflow-wrap: anywhere; }
.r-bound { margin: 0; font-weight: var(--fw-bold); }
.r-check-small .checkbox-text { font-size: var(--fs-14); }
.r-error { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-13); line-height: 19px; color: var(--crit-text); margin-top: calc(-1 * var(--sp-2)); }
.r-field .r-error { margin-top: 0; }
.r-error .icon { flex: none; margin-top: 2px; }

.r-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.r-group > legend { margin-bottom: var(--sp-2); }
.r-parts { display: flex; align-items: flex-end; gap: var(--sp-2); }
.r-part { display: flex; flex-direction: column; gap: 4px; }
.r-part-label { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); }
.r-part input { text-align: center; padding-left: var(--sp-2); padding-right: var(--sp-2); }
.r-part-s input { width: 72px; }
.r-part-l input { width: 100px; }
.r-colon { padding-bottom: 12px; color: var(--text-muted); font-weight: var(--fw-semibold); }
.r-group.has-error .r-part input { border-color: var(--crit); }

/* ticking the birth-data consent opens the fields (the accordion motion) */
.r-reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-3) var(--ease-enter); }
.r-reveal.is-open { grid-template-rows: 1fr; }
.r-reveal-inner { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: var(--sp-5); opacity: 0; transition: opacity var(--dur-3) var(--ease) 40ms; }
.r-reveal.is-open > .r-reveal-inner { opacity: 1; padding: 2px; margin: -2px; }

.r-nav { display: flex; align-items: center; gap: var(--sp-3); }
.r-grow { flex: 1 1 auto; min-width: 0; }
.btn.r-wide { width: 100%; }
.btn.r-square { width: var(--h-xl); padding: 0; flex: none; }
.r-actions-col { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); width: 100%; }
.r-actions-row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); }
.r-skip { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); text-align: center; margin-top: calc(-1 * var(--sp-2)); }

/* ------------------------------------------------------ welcome back --- */
.r-confirm { width: 100%; display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-12); background: var(--bg-subtle); animation: r-fade var(--dur-3) var(--ease-enter) both; }
.r-confirm-title { font-weight: var(--fw-semibold); }
.r-confirm p:not(.r-confirm-title) { font-size: var(--fs-14); color: var(--text-2); }
.r-restored { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); font-size: var(--fs-13); color: var(--accent-text); animation: r-fade var(--dur-3) var(--ease-enter) both; }

/* ---------------------------------------------------------- progress --- */
.r-progress { display: flex; flex-direction: column; gap: var(--sp-2); width: 100%; }
.r-progress-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-13); line-height: var(--lh-13); }
.r-progress-section { color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-progress-count { color: var(--text); font-weight: var(--fw-semibold); flex: none; }
.r-bar { display: flex; gap: 3px; height: 6px; }
.r-seg { flex: 1 1 0; min-width: 6px; height: 100%; border-radius: var(--r-full); background: var(--data-track); overflow: hidden; }
.r-seg-fill { display: block; height: 100%; border-radius: var(--r-full); background: var(--data-fill); transition: width var(--dur-4) var(--ease-move); }
.r-progress-block { display: flex; flex-direction: column; gap: var(--sp-2); }
.r-progress-meta { display: flex; justify-content: space-between; gap: var(--sp-3); min-height: 16px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); }
.r-progress-meta span { display: inline-flex; align-items: center; gap: 4px; }
.r-progress-meta .icon { color: var(--ok); }

/* --------------------------------------------------------- statement --- */
.r-statement {
  display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-4);
  padding: var(--sp-6) var(--sp-5) var(--sp-5); background: var(--bg-surface);
  border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-2);
}
.r-statement.is-fwd { animation: r-in-fwd var(--dur-3) var(--ease-enter) both; }
.r-statement.is-back { animation: r-in-back var(--dur-3) var(--ease-enter) both; }
@keyframes r-in-fwd { from { opacity: 0; transform: translateX(var(--slide)); } to { opacity: 1; transform: none; } }
@keyframes r-in-back { from { opacity: 0; transform: translateX(calc(-1 * var(--slide))); } to { opacity: 1; transform: none; } }
@keyframes r-fade { from { opacity: 0; transform: translateY(var(--lift)); } to { opacity: 1; transform: none; } }
.r-prompt { font-size: var(--fs-13); line-height: var(--lh-13); font-weight: var(--fw-semibold); color: var(--accent-text); }
.r-stmt { font-size: 28px; line-height: 36px; font-weight: var(--fw-medium); letter-spacing: var(--track-tight); text-wrap: balance; min-height: 72px; }
.r-stmt.is-long { font-size: 24px; line-height: 32px; }
.r-stmt.is-longer { font-size: 20px; line-height: 28px; }

/* the answer scale: ten cells, one row, never wrapping */
.r-scale {
  display: grid; grid-template-columns: repeat(var(--cells, 10), minmax(0, 1fr));
  height: 52px; margin-top: var(--sp-2);
  background: var(--bg-subtle); border: 1px solid var(--line-control); border-radius: var(--r-12); overflow: hidden;
}
.r-cell {
  position: relative; display: grid; place-items: center; min-width: 0; height: 100%; padding: 0;
  border: 0; border-left: 1px solid var(--line); background: none; cursor: pointer;
  font: var(--fw-medium) var(--fs-16)/1 var(--font-ui); color: var(--text-2); -webkit-tap-highlight-color: transparent;
}
.r-cell:first-child { border-left: 0; }
.r-cell::before {
  content: ""; position: absolute; inset: 3px; border-radius: var(--r-8); background: transparent;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.r-cell > .num { position: relative; }
/* hover tints only under a real pointer: a phone keeps :hover on the last
   tapped spot, which would pre-mark the same cell on the next statement */
@media (hover: hover) and (pointer: fine) { .r-cell:hover::before { background: var(--accent-soft); } }
.r-cell:active::before { transform: scale(.96); }
.r-cell:focus-visible { box-shadow: none; }
.r-cell:focus-visible::before { box-shadow: var(--focus-ring-inset); }
.r-cell[aria-checked="true"] { color: var(--text-on-accent); font-weight: var(--fw-semibold); }
.r-cell[aria-checked="true"]::before { background: var(--accent); box-shadow: var(--shadow-confirm); }
.r-cell[aria-checked="true"]:focus-visible::before { box-shadow: var(--focus-ring-inset), var(--shadow-confirm); outline: 2px solid var(--bg-surface); outline-offset: -5px; }
.r-ends { display: flex; justify-content: space-between; gap: var(--sp-4); font-size: var(--fs-13); line-height: 18px; color: var(--text-muted); }
.r-ends span { max-width: 48%; }
.r-ends span:last-child { text-align: right; }
.r-reassure { display: flex; align-items: flex-start; gap: var(--sp-2); padding: 0 var(--sp-1); font-size: var(--fs-13); line-height: 19px; color: var(--text-muted); }
.r-reassure .icon { flex: none; margin-top: 2px; color: var(--accent); }
.r-bottom { margin-top: var(--sp-2); }

/* ------------------------------------------------------------- review --- */
.r-alert {
  display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); text-align: left;
  background: var(--warn-soft); color: var(--warn-text); border-radius: var(--r-12); font-size: var(--fs-14); line-height: 21px;
}
.r-alert > .icon { flex: none; margin-top: 3px; }
.r-alert:focus { outline: none; }
.r-alert.is-crit { background: var(--crit-soft); color: var(--crit-text); }
.r-alert-body { display: flex; flex-direction: column; gap: var(--sp-1); }
.r-alert a { color: inherit; font-weight: var(--fw-semibold); display: inline-flex; align-items: center; gap: 4px; }
.r-details-wrap { position: relative; padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-12); background: var(--bg-subtle); }
.r-details { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-2) var(--sp-5); font-size: var(--fs-14); line-height: 20px; }
.r-details > div { display: contents; }
.r-details dt { color: var(--text-muted); }
.r-details dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.r-details-edit { position: absolute; top: var(--sp-3); right: var(--sp-4); font-size: var(--fs-14); font-weight: var(--fw-medium); }
.r-sections { display: flex; flex-direction: column; gap: var(--sp-2); }
.r-sections .accordion { box-shadow: none; border-radius: var(--r-12); }
.r-sections .accordion-title { font-size: var(--fs-14); }
.r-missing-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--warn); }
.r-ok { color: var(--ok); }
.r-review-list { list-style: none; margin: 0; padding: var(--sp-1) 0; }
.r-review-list li { border-top: 1px solid var(--line-soft); }
.r-review-list li:first-child { border-top: 0; }
.r-review-list li.is-missing { background: var(--warn-soft); }
/* the whole row changes the answer: statement in full, value, a quiet pencil */
.r-review-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 14px; align-items: center; gap: var(--sp-2) var(--sp-3);
  min-height: 48px; padding: var(--sp-2) var(--sp-4); font-size: var(--fs-14); line-height: 20px; color: var(--text); text-decoration: none;
  transition: background var(--dur-1) var(--ease);
}
.r-review-row:focus-visible { outline: none; box-shadow: var(--focus-ring-inset); }
.r-review-n { font-size: var(--fs-12); color: var(--text-muted); }
.r-review-stem { color: var(--text); overflow-wrap: anywhere; }
.r-review-v { min-width: 28px; height: 24px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-text); font-weight: var(--fw-semibold); font-size: var(--fs-13); }
.r-review-v.is-missing {
  grid-column: 3 / 5; display: inline-flex; align-items: center; gap: 2px; padding: 0 6px 0 10px;
  background: var(--bg-surface); border: 1.5px solid var(--warn); color: var(--warn-text); font-weight: var(--fw-semibold); font-size: var(--fs-12);
}
.r-review-edit { color: var(--text-muted); opacity: .55; transition: opacity var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.r-review-row:focus-visible .r-review-edit { opacity: 1; color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .r-review-row:hover { background: var(--bg-selected-row); }
  .r-review-list li.is-missing .r-review-row:hover { background: none; }
  .r-review-row:hover .r-review-edit { opacity: 1; color: var(--accent); }
}

/* submitting: a calm working state, two lines taking turns */
.r-sending { padding-top: var(--sp-10); padding-bottom: var(--sp-10); }
.r-spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--accent-soft-2); border-top-color: var(--accent); animation: r-spin 900ms linear infinite; }
@keyframes r-spin { to { transform: rotate(360deg); } }
.r-cycle { display: inline-grid; }
.r-cycle > span { grid-area: 1 / 1; animation: r-cycle-a 3.2s var(--ease) infinite both; }
.r-cycle > span + span { animation-name: r-cycle-b; }
@keyframes r-cycle-a { 0%, 42% { opacity: 1; } 50%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes r-cycle-b { 0%, 42% { opacity: 0; } 50%, 92% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- done --- */
.r-done { padding-top: var(--sp-8); gap: var(--sp-3); }
.r-done-mark {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); margin-bottom: var(--sp-2);
  animation: r-pop var(--dur-4) var(--ease-enter) both;
}
@keyframes r-pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.r-done .r-actions-col { margin-top: var(--sp-2); }
.r-next { gap: var(--sp-3); }
.r-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.r-steps li { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-14); line-height: 20px; color: var(--text-2); }
.r-steps strong { color: var(--text); font-weight: var(--fw-semibold); }
.r-step-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--text-on-accent); font-size: var(--fs-13); font-weight: var(--fw-semibold); }
.r-coach-card { display: flex; align-items: center; gap: var(--sp-3); padding-top: var(--sp-4); margin-top: var(--sp-1); border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.r-coach-text { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; font-size: var(--fs-14); line-height: 20px; }
.r-coach-text span { color: var(--text-muted); font-size: var(--fs-13); }
.r-finish { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); text-align: center; }

/* --------------------------------------------------------------- errors --- */
.r-error-card { margin-top: var(--sp-8); padding-top: var(--sp-8); padding-bottom: var(--sp-8); }

/* --------------------------------------------------------------- footer --- */
.r-foot {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: var(--sp-1) var(--sp-4);
  margin-top: auto; padding-top: var(--sp-4); font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); text-align: center;
}
.r-foot > span:first-child { display: inline-flex; align-items: center; gap: 5px; }
.r-foot .icon { color: var(--accent); }
.r-foot a, .r-foot-privacy > summary { font-size: var(--fs-12); color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.r-foot-privacy { text-align: left; }
.r-foot-privacy[open] { flex-basis: 100%; }

/* --------------------------------------------------------------- phones --- */
@media screen and (max-width: 767px) {
  .respond { padding: var(--sp-4) var(--sp-4) var(--sp-4); gap: var(--sp-3); min-height: calc(100dvh - var(--topline-h) - var(--appbar-h)); }
  .r-card { padding: var(--sp-5); }
  .r-title { font-size: 24px; line-height: 30px; }
  .r-display { font-size: 28px; line-height: 34px; }
  /* on a phone the progress (and who sent it) stays in view under the header:
     one glass band from the header down, closed by a visible hairline */
  .r-progress-block {
    position: sticky; top: calc(var(--topline-h) + var(--appbar-h)); z-index: var(--z-sticky);
    margin: 0 calc(-1 * var(--sp-4)); padding: var(--sp-3) var(--sp-4);
    background: var(--bg-glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-1);
  }
  .respond[data-step="questions"] > .r-progress-block:first-child { margin-top: calc(-1 * var(--sp-4)); }
  /* the statement sits above the thumb zone; the answer scale and Next under the thumb */
  .respond[data-step="questions"] .r-statement { margin-top: auto; padding: var(--sp-5) var(--sp-3) var(--sp-4); }
  .r-stmt { font-size: 24px; line-height: 32px; min-height: 64px; }
  .r-stmt.is-long { font-size: 21px; line-height: 29px; }
  .r-stmt.is-longer { font-size: 18px; line-height: 26px; }
  .r-bottom {
    position: sticky; bottom: 0; z-index: var(--z-sticky); margin: 0 calc(-1 * var(--sp-4));
    padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom));
    background: var(--bg-glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: var(--shadow-bar);
  }
  .respond[data-step="questions"] .r-foot { margin-top: 0; padding-top: var(--sp-2); }
  .r-review-row { grid-template-columns: 22px minmax(0, 1fr) auto 14px; padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .r-details { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .r-details dd { margin-bottom: var(--sp-2); }
}
@media (prefers-reduced-motion: reduce) {
  .r-spinner { animation-duration: 2.4s; }
  .r-cycle > span { animation: none; }
  .r-cycle > span + span { visibility: hidden; }
}
@media screen and (max-width: 359px) {
  .r-scale { height: 48px; }
  .r-cell { font-size: var(--fs-14); }
}

/* ------------------------------------------ answer scales (WS-SCALES) --- */
/* A scale with words between its ends shows every point's words in its cell;
 * two poles get a marked middle (the middle point, or a line between the two
 * middle points), and the ends line a dot between the two poles. */
.r-scale.is-labelled { height: auto; min-height: 52px; }
.r-scale.is-labelled .r-cell { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; height: auto; padding: 10px 8px 14px; }
.r-cell-label { position: relative; font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-regular); color: var(--text-muted); text-align: center; overflow-wrap: anywhere; hyphens: auto; }
.r-cell[aria-checked="true"] .r-cell-label { color: var(--text-on-accent); }
.r-scale.is-bipolar { position: relative; }
.r-cell.is-middle::after { content: ""; position: absolute; left: 50%; bottom: 7px; width: 14px; height: 2px; border-radius: 1px; background: var(--line-strong); transform: translateX(-50%); }
.r-cell.is-middle[aria-checked="true"]::after { background: var(--text-on-accent); }
.r-scale.is-bipolar:not(:has(.is-middle))::after { content: ""; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 2px; border-radius: 1px; background: var(--line-strong); transform: translateX(-50%); pointer-events: none; }
.r-ends.is-bipolar { position: relative; align-items: center; }
.r-ends.is-bipolar .r-mid { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transform: translate(-50%, -50%); }
/* on a phone, a scale with words on every point reads as a list, one point a row */
@media screen and (max-width: 520px) {
  .r-scale.is-labelled { grid-template-columns: minmax(0, 1fr); }
  .r-scale.is-labelled .r-cell { flex-direction: row; justify-content: flex-start; gap: var(--sp-3); padding: 12px var(--sp-4); border-left: 0; border-top: 1px solid var(--line); }
  .r-scale.is-labelled .r-cell:first-child { border-top: 0; }
  .r-scale.is-labelled .r-cell-label { text-align: left; font-size: var(--fs-13); line-height: var(--lh-13); }
  .r-scale.is-labelled .r-cell.is-middle::after { left: auto; right: var(--sp-4); bottom: 50%; transform: translateY(50%); }
}

/* v5.2: the Language select of the first screen (docs/v52-mvp.md 6.2). */
.r-language { margin: 0 0 var(--sp-4); max-width: 320px; }
.r-language select { width: 100%; min-height: 44px; padding: 0 var(--sp-3); border: 1px solid var(--line-strong, var(--line)); border-radius: var(--r-control);
  background: var(--bg-surface); color: var(--text); font: inherit; }
.r-block-scale { display: flex; flex-wrap: wrap; gap: 1rem; padding: 1rem 0; }
.r-block-scale span { flex: 1 1 5rem; }
.r-block-row { border: 0; padding: 1rem 0; margin: 0; min-width: 0; }
.r-block-row legend { padding: 0; font-weight: 600; }
.r-block-row .r-scale { margin-top: .75rem; }
.r-block-count { font-variant-numeric: tabular-nums; }
