/* ─────────────────────────────────────────────────────────────────────────
   SAVE AS IT CHANGES — the visible half of crm/js/autosave.js (METIS-pub#696).

   A field that saves as it changes says so beside its label: "Saving…" while
   the request is out, "Saved" once it is stored (it stays until the next
   change — no timer, no fade), "Not saved" in the danger colour when the
   request failed or was refused. A validation message renders under the
   control as the shared .form-errors box.

   Markup contract (docs/dev/web/ui-guide.md § Saving as it changes):
     <form data-autosave hx-trigger="autosave" …>
       <label>…</label>
       <span class="autosave-status" data-autosave-status role="status">…</span>
   ───────────────────────────────────────────────────────────────────────── */

@layer components {
  .autosave-status {
    margin-left: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
  }

  .autosave-status--error { color: var(--color-danger); }

  /* A one-line box that grows with its text (crm/js/autogrow.js, which sets
     the height where the browser cannot): the name, read whole however long
     it is (METIS-pub#787). */
  textarea[data-autogrow] {
    field-sizing: content;
    resize: none;
    overflow: hidden;
  }
}
