/* ——— Dictation ———
   Speak instead of typing (dictation_controller, composers/_dictation): a
   circle beside the T at rest. Its state is the element's own attribute, and
   each state shows its one line (the canvas's Composer artboard). While it
   records, the circles beside it step aside for its time and its two ways
   out: the words must not be posted half spoken. */
@layer components {
  .dictation:not([data-state="rest"], [data-state="inserted"]) .dictation__start,
  .dictation:not([data-state="recording"]) :is(.dictation__discard, .dictation__stop),
  .dictation__message {
    display: none;
  }

  .dictation[data-state="recording"] .dictation__message--recording,
  .dictation[data-state="writing"] .dictation__message--writing,
  .dictation[data-state="inserted"] .dictation__message--inserted,
  .dictation[data-state="failed"] .dictation__message--failed {
    display: inline-flex;
    align-items: center;
    gap: var(--inline-space-half);
  }

  .btn:has(~ .dictation[data-state="recording"]),
  .dictation[data-state="recording"] ~ .btn {
    display: none;
  }

  /* A line that waits on the server — writing it down, what came of it, a
     failure with its two buttons — is a sentence. Beside the circles it took
     the words' width, down to one letter in a to-do's Notes (owner,
     2026-11-18). In a row that is a grid — a field's own composer
     (lexxy.css), the chat's line (chat-composer.css) — it takes a row of its
     own under the words, where the canvas drew it, and the circles keep
     theirs. The recording's line stays beside its two circles: it is short,
     and the click that starts it moves nothing. */
  :has(> .dictation:is([data-state="writing"], [data-state="inserted"], [data-state="failed"])) {
    > *,
    > .dictation > * {
      grid-row: 1;
    }

    > .dictation > .dictation__message {
      grid-row: 2;
      grid-column: 1;
    }
  }
}
