/* AssistantFormDraftComponent (app/components/assistant_form_draft_component.rb; app/javascript/controllers/form_draft_controller.js; TF-C, the TAG follow-ups, decision D-137 = A): the section above a
   form's questions that starts the assistant's draft, and the card the script puts beside a question once the assistant has answered.

   The section is a panel like the case page's (a hairline, a raised surface, an accent edge on its inline start that says "start here" and never alarms): its head with the pill, then the lede, the one
   button, the line that says what is going on and the fine print. The card beside a question is quieter and plainly provisional: the same pill as a draft in the assistant's panel (.assistant-draft-mark,
   38-shell.css) says in words that it is not an answer yet, the draft is set apart on a sunken surface, and its source and its one button sit under it. The words of a draft keep their line breaks
   (pre-line), and everything that holds words may shrink and wrap, so a language 40% longer never widens the page (WCAG 1.4.10).

   Numbered 29: the numbers 30 and up are all taken (by the shell, the components and the offices' own), and 29 comes before the component rules of 35, which this section needs nothing from: it declares its own
   classes and reads the tokens. Tokens only and logical properties only, both enforced (test/styles/tokens_test.rb, test/styles/components_test.rb), so it reads on the light shell and the console, in light and
   in dark, and mirrors in a right-to-left language. Nothing is pinned to an edge and nothing sets a height. */

.assistant-form-draft {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--density-gap);
  min-inline-size: 0;
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-inline-start: 3px solid var(--accent-line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.assistant-form-draft__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  min-inline-size: 0;
}
.assistant-form-draft__head > * {
  min-inline-size: 0;
  margin: 0;
}

.assistant-form-draft__title {
  margin-block: 0;
  font-size: var(--text-base);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.assistant-form-draft__lede,
.assistant-form-draft__note {
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.assistant-form-draft__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  min-inline-size: 0;
}

/* What is going on and what came of it. A live region stays in the page while it is empty (one that is added with its words is not reliably announced), so while it says nothing it is put away the way
   `.sr-only` does it, and takes no room; the moment it holds words it is drawn in the flow. */
.assistant-form-draft__status {
  margin-block: 0;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.assistant-form-draft__status:empty,
.assistant-form-draft__said:empty {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

/* The card beside a question. */
.assistant-form-draft__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
  min-inline-size: 0;
  margin-block-start: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--rule);
  border-inline-start: 3px solid var(--accent-line);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.assistant-form-draft__text {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.assistant-form-draft__source {
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.assistant-form-draft__source:empty {
  display: none;
}

.assistant-form-draft__use {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  min-inline-size: 0;
}

.assistant-form-draft__said {
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

/* The preview's sample card sits where the script would put one: under the section, not inside it. */
.assistant-form-draft__sample {
  min-inline-size: 0;
}
