/* Respondent surfaces (/f/), per design/AGENTS.md § Respondent surfaces.
   No accent anywhere; blue only as the fill of the one primary. */

/* Sheet on a desk. */
body.desk {
  background: var(--color-paper-dim);
}

.sheet {
  max-width: var(--measure-wide);
  margin: var(--space-4) auto var(--space-6);
  background: var(--color-paper);
  border: var(--border) solid var(--color-line);
  border-radius: calc(var(--radius) * 2);
  overflow: hidden;
}

.sheet__body {
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.sheet__head {
  padding: var(--space-4) var(--space-5) 0;
}

/* Below 78rem: a --space-2 desk gutter and --space-3 inner padding,
   so the width goes to the fields. */
@media (max-width: 78rem) {
  .sheet {
    margin-inline: var(--space-2);
  }

  .sheet__body {
    padding: var(--space-3) var(--space-3) var(--space-4);
  }

  .sheet__head {
    padding: var(--space-3) var(--space-3) 0;
  }
}

/* On small screens the sheet becomes the page. */
@media (max-width: 40rem) {
  body.desk {
    background: var(--color-paper);
  }

  .sheet {
    margin: 0;
    border: none;
    border-radius: 0;
  }
}

.sheet__title {
  padding-block-end: var(--space-3);
}

/* Part band: named progress on paper-dim, closed by an ink rule. */
.band {
  background: var(--color-paper-dim);
  border-block: var(--border) solid var(--color-ink);
  padding: var(--space-2) var(--space-5);
  display: grid;
  gap: var(--space-1);
}

.sheet > .band:first-child {
  border-block-start: none;
}

@media (max-width: 78rem) {
  .band {
    padding-inline: var(--space-3);
  }
}

.band__label {
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.band__bar {
  block-size: 0.5rem;
  border-radius: 999rem;
  background: var(--color-line);
  overflow: hidden;
}

.band__fill {
  block-size: 100%;
  background: var(--color-ink);
  transition: inline-size 200ms ease;
}

/* Questions: printed on the sheet, no box. --space-4, a line rule,
   --space-4 after a question (the rule closes it). A text or list block
   belongs to what follows it, so no rule after it. */
.questions > .q + * {
  margin-block-start: var(--space-4);
  padding-block-start: var(--space-4);
  border-block-start: var(--border) solid var(--color-line);
}

/* A Choose one's words (its legend) float, so the fieldset lays them out
   like a div's label: under its padding, not across its top rule. They
   are still the fieldset's legend. A cleared box's own top margin is
   lost, so the legend carries the space to what follows. */
.q > legend {
  float: inline-start;
  inline-size: 100%;
  margin-block-end: var(--space-2);
}

.q > legend:has(+ .q__help) {
  margin-block-end: 0.25rem;
}

.q > legend + * {
  clear: both;
}

.questions > .block + * {
  margin-block-start: var(--space-3);
}

/* A bookend's blocks (the cover, the summary's intro, the thank-you page):
   one after another, generous space, no rules. */
.page-blocks > * + * {
  margin-block-start: var(--space-4);
}

.page-blocks + .cards {
  margin-block-start: var(--space-4);
}

/* The summary's box to tick sits under the last card, before the nav. */
.confirm {
  margin-block-start: var(--space-4);
}

.page-blocks + .nav {
  margin-block-start: var(--space-5);
}

.q__label {
  display: block;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.3;
}

.q__help {
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
  max-width: var(--measure);
  margin-block-start: 0.25rem;
}

.q__control {
  margin-block-start: var(--space-2);
}

.q__error {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-error);
  margin-block-start: var(--space-1);
}

/* Every place you answer is one white box with a 1.5× strong edge. */
.answer {
  display: block;
  width: 100%;
  font-size: var(--text-base);
  min-height: var(--target-min);
  padding: var(--space-1) var(--space-2);
  background: var(--color-paper);
  border: calc(var(--border) * 1.5) solid var(--color-line-strong);
  border-radius: var(--radius);
}

textarea.answer {
  min-height: 9rem;
  line-height: var(--leading);
  resize: vertical;
}

.q.is-invalid .answer {
  border-color: var(--color-error);
}

/* Dropdown: the same answer box. The wrapper draws the control's own arrow, two borders in
   currentColor (no icon; survives forced colors). */
.select {
  position: relative;
  display: block;
}

.select::after {
  content: "";
  position: absolute;
  inset-inline-end: var(--space-2);
  inset-block-start: 50%;
  inline-size: 0.6em;
  block-size: 0.6em;
  border-inline-end: var(--border) solid currentColor;
  border-block-end: var(--border) solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

select.answer {
  appearance: none;
  padding-inline-end: calc(var(--space-2) * 2 + 0.6em);
  line-height: var(--leading);
  color: var(--color-ink);
  cursor: pointer;
  text-overflow: ellipsis;
}

/* "Choose one…" reads as not chosen yet: the words say it, the soft ink only echoes them. */
select.answer:has(option[value=""]:checked) {
  color: var(--color-ink-soft);
}

select.answer option {
  color: var(--color-ink);
}

/* Choices share one answer box; rows divided by --color-line. */
.answer--choices {
  padding: 0;
  overflow: hidden;
}

.option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target-min);
  padding: var(--space-2);
  cursor: pointer;
}

.option + .option {
  border-block-start: var(--border) solid var(--color-line);
}

.option:hover {
  background: var(--color-paper-dim);
}

.option input {
  inline-size: 1.75rem;
  block-size: 1.75rem;
  flex: none;
  margin: 0;
  accent-color: var(--color-ink);
}

/* Selected: dot or tick, inner ink edge, paper-dim, weight 600. */
.option:has(:checked) {
  background: var(--color-paper-dim);
  font-weight: 600;
  outline: var(--border) solid var(--color-ink);
  outline-offset: calc(var(--border) * -1);
}

/* Navigation: outcome labels; primary first and full-width on phones. */
.nav {
  margin-block-start: var(--space-5);
  padding-block-start: var(--space-3);
  border-block-start: var(--border) solid var(--color-line);
}

.nav__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: space-between;
  align-items: center;
}

.nav__buttons .btn--action {
  margin-inline-start: auto;
}

.reassure {
  margin-block-start: var(--space-2);
  color: var(--color-ink-soft);
  font-size: var(--text-sm);
  text-align: end;
  max-width: none;
}

@media (max-width: 40rem) {
  .nav__buttons {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .nav__buttons .btn {
    width: 100%;
    margin-inline-start: 0;
  }

  .reassure {
    text-align: center;
  }
}

/* The one primary per respondent screen: action blue, paper words,
   a double-width edge in the same blue. */
.btn--action {
  background: var(--color-action);
  color: var(--color-paper);
  border: calc(var(--border) * 2) solid var(--color-action);
}

.btn--action:hover {
  background: var(--color-action);
  text-decoration: underline;
  text-decoration-thickness: var(--border);
  text-underline-offset: var(--underline-offset);
}

/* Blocked primary (owner, 2026-11-11): grayed out. Same shape and words,
   light-gray fill and edge, lighter words (--color-ink-disabled), no opacity;
   aria-disabled so it stays focusable. */
.btn--action[aria-disabled="true"] {
  background: var(--color-paper-dim);
  border-color: var(--color-line);
  color: var(--color-ink-disabled);
  cursor: not-allowed;
  text-decoration: none;
}

@media (forced-colors: active) {
  .btn--action {
    border: calc(var(--border) * 2) solid ButtonText;
  }

  .btn--action[aria-disabled="true"] {
    border-color: GrayText;
    color: GrayText;
  }
}

.blocked-note {
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: end;
  max-width: none;
  margin-block-start: var(--space-2);
}

@media (max-width: 40rem) {
  .blocked-note {
    text-align: center;
  }
}

/* Completed and closed pages: plain sentences, no button. */
.endpage {
  padding-block: var(--space-4);
}

.endpage p {
  font-size: var(--text-lg);
}

/* Thank-you page (owner checkpoint 2026-11-15): the section page's sizes,
   one step below the closed pages' sentence. The form's name and the
   creator's text and lists at --text-base; block headings keep blocks.css's
   --text-lg 700; the h1 is every runner page's. */
.endpage--completed p,
.endpage--completed li {
  font-size: var(--text-base);
}

/* Trial footer (plan 0013, option B): on the desk, under the sheet, centred.
   Plain words; never between a question and Next. On phones the sheet is the
   page, so it simply follows. */
.sheet:has(+ .made-with) {
  margin-block-end: var(--space-2);
}

.made-with {
  padding: 0 var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
  text-align: center;
}

/* base.css caps every <p> at --measure, left-aligned: centre the box too. */
.made-with p {
  margin-inline: auto;
}

.made-with strong {
  color: var(--color-ink);
  font-weight: 700;
}

/* The link on completed and closed pages: ink, underlined, a full target. */
.made-with a {
  color: var(--color-ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding-inline: var(--space-1);
}
