/* Forms: the one form system (design-direction.md section 5, item 12, and "Forms"). The components in
   app/components/forms draw every part of it: the form and its error summary, the sections, a field's
   label, hint, error and control, the character count, the option rows, date and time, and the actions.

   Linked after 35-components.css and before 40-native.css, so the touch target floor in
   40-native.css still wins over this file's. Tokens only, logical properties only (both enforced:
   test/styles/tokens_test.rb, test/styles/components_test.rb), so a form reads on the light shell
   and on the console, in light and in dark, and right to left.

   10-globals.css styles every text-like control by element (`input[type="text"]`, `textarea`,
   `select`, the date and time kinds). That is specificity (0,1,1), so a rule here that changes one of
   its properties is written `.field .field-control` (0,2,0) and wins by specificity, not by order.

   The rules the design keeps, each with its reason (design-direction.md, "Forms"):

   * A form is sections. Wide, a section is a row: its title and a sentence on how to fill it in on the left, its fields
     on the right, so a long form is scanned by its titles and filled down one column. Narrow, the title is over the
     fields. The form is a container, so this follows the room the form has, not the window.
   * Fields take the whole row; two short ones that belong together (a start and an end, a building and a room) are
     halves side by side, and their controls line up because a half's help goes under its control.
   * A label is sentence case, 14px, semibold; its help is smaller and muted (still 4.5:1). Optional fields say
     "(optional)"; the rest are required, said once at the top.
   * A control is 40px tall (44px on touch, `--target-min`), its fill a step above the page (`--surface-raised`), its
     edge `--control-line` (3:1 against every ground, 1.4.11), its text 1rem (iOS zooms below 16px).
   * Focus is an outline of `--focus` (3:1, 1.4.11) two pixels out, not a shadow, so it survives forced colors; nothing
     in a form is sticky, so nothing covers it (2.4.11).
   * A few choices are option rows, each saying when to choose it; short answers can be chips; many are a select.
   * An error is text with a mark, the control's edge thickens, and the summary at the top links to each field: never
     color alone (1.4.1, 3.3.1).
   * Short values get short controls (`data-width`), so the size of a box says what goes in it. */

/* ── The form and its sections ───────────────────────────────────────────── */

/* The form is a container, so its sections lay out by the room the form has (a sheet, a modal in the phone apps, a
   wide console page) and not by the window. Wide: each section is a row, its title and a sentence about it on the
   left, its fields on the right, like the settings of any well-made application, so a long form is scanned by its
   titles and filled down one column. Narrow: the title over the fields. */
.tform {
  container: tform / inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-inline-size: 0;
  max-inline-size: 60rem;
}
/* A form with no sections (a one-field inline form) spaces its fields itself. */
.tform:not(:has(> .form-section)) {
  gap: 0.85rem;
}
.tform > .error-summary {
  margin-block-end: 1.25rem;
}
.tform-note {
  margin: 0 0 var(--space-3);
  color: var(--fg2);
  font-size: var(--text-sm);
  line-height: 1.5;
}
/* A sentence that says something the person does not choose (the records it goes into, when there is one). */
.tform-fact {
  margin: 0 0 1rem;
  padding-block: 0.75rem;
  padding-inline: 1rem;
  color: var(--fg1);
  background: var(--surface-sunken);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.form-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem 2.5rem;
  min-inline-size: 0;
  margin: 0;
  padding-block: 1.5rem;
  padding-inline: 0;
  border: 0;
  border-block-start: 1px solid var(--rule);
}
/* A legend cannot be a grid item in every engine while it is the fieldset's rendered legend, so it floats, which
   makes it an ordinary box the grid places like any other. */
.form-section-title {
  float: inline-start;
  margin: 0;
  padding: 0;
  color: var(--fg1);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}
.form-section-intro {
  margin: 0;
  max-inline-size: 60ch;
  color: var(--fg2);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.form-section-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  min-inline-size: 0;
  margin-block-start: 0.85rem;
}
/* A field takes the whole row unless it says it is half of a pair (`width: :half`). */
.form-section-fields > * {
  grid-column: 1 / -1;
  min-inline-size: 0;
}
.form-section-fields > [data-width="half"] {
  grid-column: auto;
}

@container tform (min-inline-size: 44rem) {
  .form-section {
    grid-template-columns: 13rem minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .form-section-title {
    grid-column: 1;
    grid-row: 1;
  }
  .form-section > .form-section-intro {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
  }
  .form-section-fields {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-block-start: 0;
  }
  /* The button lines up with the fields' column; a form with no sections has no such column, so its button stays at
     the start of the row. */
  .tform:has(> .form-section) > .form-actions {
    padding-inline-start: 15.5rem;
  }
}
@container tform (max-inline-size: 30rem) {
  .form-section-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-section-fields > [data-width="half"] {
    grid-column: 1 / -1;
  }
}

/* ── A field ─────────────────────────────────────────────────────────────── */

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 0.3rem;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.field-label {
  display: block;
  float: none;
  margin: 0;
  padding: 0;
  color: var(--fg1);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  overflow-wrap: anywhere;
}
.field-optional {
  color: var(--fg2);
  font-weight: 400;
}
/* Kept for the forms not yet moved to the form system, whose labels still say "required". */
.field-required {
  color: var(--fg2);
  font-weight: 400;
}

.field-help {
  max-inline-size: 60ch;
  color: var(--fg2);
  font-size: 0.8125rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.field-help p {
  margin: 0;
}
.field-help p + p {
  margin-block-start: 0.25rem;
}

/* In a pair, the two controls line up: the help of a half goes under its control (it is still the control's description,
   read when it takes focus), so a sentence on one side does not push its control below the other's. */
.form-section-fields > [data-width="half"] > .field-help {
  order: 3;
}
.form-section-fields > [data-width="half"] > .field-count-wrap {
  order: 4;
}

.field-errors {
  display: grid;
  gap: 0.25rem;
}
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0;
  color: var(--tone-bad-fg);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.field-error-mark {
  flex: none;
  inline-size: 1rem;
  block-size: 1rem;
  margin-block-start: 0.12rem;
}

/* ── Controls ────────────────────────────────────────────────────────────── */

.field .field-control {
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 2.5rem;
  padding-block: 0.5rem;
  padding-inline: 0.75rem;
  color: var(--fg1);
  background: var(--surface-raised);
  border: 1px solid;
  border-color: var(--control-line);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: none;
}
@media (pointer: coarse) {
  .field .field-control {
    min-block-size: var(--target-min);
  }
}
.field .field-control:hover {
  border-color: var(--fg3);
}
.field .field-control:focus {
  border-color: var(--accent);
  box-shadow: none;
}
.field .field-control:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
/* A date or time control does not match :focus-visible in Chrome while the focus is in one of its segments, so it
   takes the ring on any focus (a pointer focus here also starts typing, so the ring is right either way; 2.4.7). */
.field .field-control:is([type="date"], [type="time"]):focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.field .field-control[aria-invalid="true"] {
  border-color: var(--tone-bad-fg);
  box-shadow: inset 0 0 0 1px var(--tone-bad-fg);
}

/* Sized to what goes in it, and growing with what is typed where the engine can (field-sizing); where
   it cannot, `rows` is the size and the corner drags up and down only, never wider than the screen. */
.field textarea.field-control {
  min-block-size: 7.5rem;
  max-block-size: 60dvh;
  resize: vertical;
  field-sizing: content;
}

/* Short values, short boxes: the width says what goes in it. Never wider than the column. */
.field[data-width="short"] .field-control,
.field[data-width="short"] .field-select {
  max-inline-size: 11rem;
}
.field[data-width="medium"] .field-control,
.field[data-width="medium"] .field-select {
  max-inline-size: 20rem;
}

/* The select: the browser's own control and keyboard, with its arrow drawn in currentColor by us, so it
   matches the other controls and turns with the mode. The arrow is two borders of a square, turned,
   and sits at the end of the line in either direction. */
.field-select {
  position: relative;
  display: block;
  min-inline-size: 0;
}
.field .field-select select.field-control {
  appearance: none;
  padding-inline-end: 2.5rem;
  cursor: pointer;
}
.field-select::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 1rem;
  inline-size: 0.5rem;
  block-size: 0.5rem;
  margin-block-start: -0.35rem;
  border-block-end: 2px solid var(--fg2);
  border-inline-end: 2px solid var(--fg2);
  transform: rotate(45deg);
  pointer-events: none;
}

/* ── The character count ─────────────────────────────────────────────────── */

/* Without a script the limit is said in words ("You can enter up to 500 characters"). With one, the
   words stay for a screen reader (they are the control's description) and the line beside them shows
   what is left; a separate live region says it only near the limit (character_count_controller.js). */
.field-count {
  margin: 0;
  color: var(--fg2);
  font-size: 0.8125rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.field-count[data-near] {
  color: var(--fg1);
  font-weight: 650;
}

/* ── Option rows: radios and checkboxes ─────────────────────────────────── */

/* A group has no border of its own to turn, so one with an error gets a bar at its start, in the error
   text's color (3:1), joining the message to the rows it is about. */
.field-group[data-invalid] {
  padding-inline-start: 0.85rem;
  border-inline-start: 3px solid var(--tone-bad-fg);
}
.field-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.4rem;
  margin-block-start: 0.2rem;
}
/* A long list of boxes in labelled sets (Forms::MultiSelectComponent `groups:`): a short heading and, where near neighbours need telling apart, one line, over each run of boxes. */
.field-option-set {
  display: grid;
  gap: 0.25rem;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.field-option-set + .field-option-set {
  margin-block-start: 0.75rem;
}
.field-option-set-label {
  padding: 0;
  color: var(--fg1);
  font-size: var(--text-sm);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.field-option-set-hint {
  margin: 0;
  max-inline-size: 60ch;
  color: var(--fg2);
  font-size: var(--text-sm);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
/* Short answers as chips in a wrapping row: the densest way to show every choice at once. */
.field-options[data-layout="chips"] {
  display: flex;
  flex-wrap: wrap;
}
.field-options[data-layout="stack"] {
  grid-template-columns: minmax(0, 1fr);
}
.field-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-inline-size: 0;
  min-block-size: 2.5rem;
  padding-block: 0.55rem;
  padding-inline: 0.75rem;
  color: var(--fg1);
  background: var(--surface-raised);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  line-height: 1.35;
  cursor: pointer;
}
@media (pointer: coarse) {
  .field-option {
    min-block-size: var(--target-min);
  }
}
.field-option:hover {
  border-color: var(--fg3);
}
.field-option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.field-option:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.field-option input[type="checkbox"],
.field-option input[type="radio"] {
  flex: none;
  inline-size: 1.1rem;
  block-size: 1.1rem;
  margin: 0.1rem 0 0;
  cursor: pointer;
}
/* The ring is on the row, so the box itself does not draw a second one. */
.field-option input:focus-visible {
  outline: none;
}
.field-option-text {
  display: grid;
  gap: 0.15rem;
  min-inline-size: 0;
}
.field-option-label {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.field-option-label {
  font-weight: 600;
}
.field-option-hint {
  color: var(--fg2);
  font-size: 0.8125rem;
  line-height: 1.4;
}
/* A lone checkbox ("they did not give their name") is one row, as wide as what it says. */
.field-check .field-option {
  justify-self: start;
  max-inline-size: 100%;
}

/* ── Date and time ───────────────────────────────────────────────────────── */

.field-datetime-parts {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  margin-block-start: 0.1rem;
}
.field-datetime-part {
  display: grid;
  gap: 0.3rem;
  min-inline-size: 0;
}
.field-datetime-part-label {
  color: var(--fg2);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
}
.field .field-datetime-part input.field-control[type="date"] {
  inline-size: 10.5rem;
  max-inline-size: 100%;
}
.field .field-datetime-part input.field-control[type="time"] {
  inline-size: 9rem;
  max-inline-size: 100%;
}
.field-now[hidden] {
  display: none;
}

/* ── The error summary ───────────────────────────────────────────────────── */

.error-summary {
  display: grid;
  gap: 0.6rem;
  padding-block: 1rem;
  padding-inline: 1.15rem;
  color: var(--fg1);
  background: var(--tone-bad-bg);
  border: 1px solid var(--tone-bad-line);
  border-inline-start: 4px solid var(--tone-bad-fg);
  border-radius: var(--radius-md);
}
.error-summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.error-summary-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--tone-bad-fg);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.3;
}
.error-summary-list {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  padding-inline-start: 1.25rem;
}
.error-summary-list a {
  /* A line of the summary is a link with no sentence around it, so a target of its own: 24 CSS px tall at the least (WCAG 2.5.8), and the touch floor on a finger. */
  display: inline-flex;
  align-items: center;
  min-block-size: 1.5rem;
  color: var(--tone-bad-fg);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
@media (pointer: coarse) {
  .error-summary-list a {
    min-block-size: var(--target-min);
  }
}

/* ── Actions ─────────────────────────────────────────────────────────────── */

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding-block: 1.25rem 0.5rem;
  border-block-start: 1px solid var(--rule);
}
/* An inline form's actions (a Save beside the choice it saves, an Add on a search result): no hairline, no space above,
   the button next to what it acts on. */
.form-actions[data-inline] {
  padding-block: 0;
  border-block-start: 0;
}
.form-cancel {
  color: var(--fg1);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  min-block-size: 24px;
}

@media (pointer: coarse) {
  .form-cancel {
    display: inline-flex;
    align-items: center;
    min-block-size: var(--target-min);
  }
}

/* Forced colors drop our fills and shadows: the invalid edge, the chosen row and the focus keep a
   signal that is not color (a thicker edge; the system's own outline). */
@media (forced-colors: active) {
  .field .field-control[aria-invalid="true"] {
    border-width: 2px;
  }
  .field-option:has(input:checked) {
    border-width: 2px;
  }
}

/* ── A form behind a button (Forms::DisclosureComponent) ──────────────────── */

.form-disclosure {
  min-inline-size: 0;
  margin-block-start: var(--density-block, 0.75rem);
}
.form-disclosure-button {
  list-style: none;
  cursor: pointer;
}
.form-disclosure-button::-webkit-details-marker {
  display: none;
}
.form-disclosure-button::after {
  content: "";
  inline-size: 0.45em;
  block-size: 0.45em;
  margin-inline-start: 0.5em;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.15em);
}
.form-disclosure[open] > .form-disclosure-button::after {
  transform: rotate(-135deg) translateY(-0.1em);
}
.form-disclosure-body {
  margin-block-start: 1rem;
  min-inline-size: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .form-disclosure-button::after {
    transition: transform 150ms ease;
  }
}

/* A part of a section that belongs to one answer (reveal_controller.js): set in under the choice it follows. */
.form-dependent {
  min-inline-size: 0;
  padding-inline-start: 1rem;
  border-inline-start: 2px solid var(--rule);
}
.form-dependent[hidden] {
  display: none;
}

/* A field offered a suggestion (Forms::Assist; field_assist_controller.js). The label and its Suggest button share a row that wraps under a long label or a narrow screen, the button at
   the row's end. The suggestion sits under the control as a draft set apart from what the person wrote: a tinted card with an accent rule at its start, a small "Suggestion" line with
   its icon (the words say what it is, not the color), the suggestion's words with room between paragraphs, its actions, and where it came from. */
.field-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
  min-inline-size: 0;
}
.field-label-row > .field-label {
  flex: 1 1 12rem;
  min-inline-size: 0;
}
.field-assist-button {
  flex: 0 0 auto;
}
.field-suggestion:empty {
  display: none;
}
.field-suggestion {
  margin-block-start: var(--space-2);
  min-inline-size: 0;
}
.field-suggestion__card {
  display: grid;
  gap: var(--space-2);
  padding-block: var(--space-3);
  padding-inline: var(--space-3) var(--space-4);
  border: 1px solid var(--accent-line);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  min-inline-size: 0;
}
.field-suggestion__card--message {
  border-inline-start-color: var(--rule-strong);
  border-color: var(--rule);
  background: var(--surface-sunken);
}
.field-suggestion__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.02em;
}
.field-suggestion__text {
  display: grid;
  gap: var(--space-2);
  color: var(--fg1);
  overflow-wrap: anywhere;
}
.field-suggestion__text p,
.field-suggestion__message,
.field-suggestion__used,
.field-suggestion__source {
  margin: 0;
  overflow-wrap: anywhere;
}
.field-suggestion__lead {
  color: var(--fg2);
  font-size: var(--text-sm);
}
.field-suggestion__lead strong {
  color: var(--fg1);
}
.field-suggestion__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.field-suggestion__used {
  color: var(--fg1);
  font-weight: 600;
}
.field-suggestion__source {
  color: var(--fg2);
  font-size: var(--text-xs);
}

/* Dictation is part of the input, with the same control edge and theme. */
.field-input { min-inline-size: 0; }
.field-input-dictation > .field-control {
  border-end-start-radius: 0;
  border-end-end-radius: 0;
}
.field-dictation {
  min-inline-size: 0;
  padding: var(--space-2);
  background: var(--surface-sunken);
  border: 1px solid var(--control-line);
  border-block-start: 0;
  border-end-start-radius: var(--radius-md);
  border-end-end-radius: var(--radius-md);
}
.field-rich-text[data-rich-text-state="ready"] .field-dictation {
  border: 0;
  border-block-start: 1px solid var(--rule);
}
.field-dictation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.field-dictation .btn { min-block-size: var(--target-min); }
.field-dictation [hidden] { display: none; }
.field-dictation-status, .field-dictation-disclosure {
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.field-dictation-status { flex: 1 1 12rem; }
.field-dictation-disclosure { margin-block-start: var(--space-1); }
.field-dictation[data-phase="listening"] .field-dictation-status {
  color: var(--fg1);
  font-weight: 650;
}

.dictation-pending { text-decoration: underline dotted; text-underline-offset: 0.2em; }

.field-dictation-level { inline-size: 3rem; block-size: 1rem; }

/* An option a helper suggests (Forms::ChoiceSuggestionComponent): a light that circles its border a few times and then rests, still where motion is reduced. The thicker
   border is taken from the padding, so nothing moves when the highlight lands. It is a suggestion; the tick is the person's. */
@property --suggest-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.field-option.is-suggested {
  border: 3px solid transparent;
  padding-block: calc(0.55rem - 2px);
  padding-inline: calc(0.75rem - 2px);
  background:
    linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box,
    conic-gradient(from var(--suggest-angle), var(--accent) 0 55%, var(--focus) 70%, var(--fg1) 78%, var(--focus) 86%, var(--accent) 100%) border-box;
  box-shadow: 0 0 0 1px var(--accent), 0 0 1.1rem color-mix(in srgb, var(--focus) 70%, transparent);
}
.field-option.is-suggested:has(input:checked) {
  border-color: transparent;
  background:
    linear-gradient(var(--accent-soft), var(--accent-soft)) padding-box,
    conic-gradient(from var(--suggest-angle), var(--accent) 0 55%, var(--focus) 70%, var(--fg1) 78%, var(--focus) 86%, var(--accent) 100%) border-box;
}
@media (prefers-reduced-motion: no-preference) {
  .field-option.is-suggested {
    animation: suggest-circle 1.8s linear 3, suggest-halo 0.9s ease-in-out 6 alternate;
  }
}
.field-option.is-suggested:has(input:checked),
.field-option.is-suggested:has(input:focus-visible) {
  animation: none;
}
.field-option.is-suggested:has(input:focus-visible) {
  box-shadow: none;
}
@media (forced-colors: active) {
  .field-option.is-suggested {
    border: 3px solid Highlight;
    background: Canvas;
  }
}
@keyframes suggest-circle {
  to {
    --suggest-angle: 360deg;
  }
}
@keyframes suggest-halo {
  from {
    box-shadow: 0 0 0 1px var(--accent), 0 0 0.4rem color-mix(in srgb, var(--focus) 45%, transparent);
  }
  to {
    box-shadow: 0 0 0 1px var(--accent), 0 0 1.4rem color-mix(in srgb, var(--focus) 85%, transparent);
  }
}
/* A choice group's suggestion sits under its Suggest button, above the options it marks, so the press is answered where it was made. */
.field-group > .field-suggestion:not(:empty) {
  margin-block-end: var(--space-3);
}
/* A choice group's Suggest button sits under its question (a legend stays the group's first child). */
.field-assist-row {
  display: flex;
  justify-content: flex-end;
  margin-block: calc(var(--space-2) * -1) var(--space-2);
}

/* The place picker (Forms::PlacePickerComponent): building, floor and room side by side where they fit and stacked on a phone. The floor and room frames
   lay their field into the same grid, and an empty frame takes no room. */
.place-picker-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 1rem;
  margin-block-start: 0.25rem;
}
.place-picker-frame {
  display: contents;
}
.place-picker-refresh {
  justify-self: start;
  margin-block-start: 0.75rem;
}
.place-picker-refresh[hidden] {
  display: none;
}
.place-picker > .field:last-child {
  margin-block-start: 1rem;
}
