/* form — a stack of FORM PARTS under an optional head. Every control kind's
 * paint lives on its own part sheet; this carries the grid and submit row. */

/* A field spans the whole row by default, and ADJACENT stackable fields pack
 * side by side; a LONE stackable keeps the full row. */
[data-sk-form-fields] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--kit-space-4);
  align-items: end;
}
[data-sk-form-fields] > .sk-form-part {
  grid-column: 1 / -1;
  margin-bottom: 0;
}
[data-sk-form-fields] > .sk-form-part[data-sk-stack]:has(+ .sk-form-part[data-sk-stack]),
[data-sk-form-fields] > .sk-form-part[data-sk-stack] + .sk-form-part[data-sk-stack] {
  grid-column: auto / span 1;
}
@media (max-width: 560px) {
  [data-sk-form-fields] {
    grid-template-columns: 1fr;
  }
}

/* The SUBMIT row — the filled action plus a quiet trailing note. */
.sk-form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--kit-space-3);
  margin-top: var(--kit-space-1);
}
/* The grid zeroes its parts' margin-bottom, so the flow spacing would crowd
 * the submit row against the last field. */
[data-sk-form-fields] + .sk-form-actions {
  margin-top: var(--kit-space-4);
}
.sk-form-actions-note {
  font-size: var(--sk-text-detail-size);
  color: var(--sk-ink-muted);
}

/* The form column holds a readable width — a full-viewport text input is
 * not a better text input. */
.sk-form-body {
  max-width: 40rem;
}
.sk-form[data-align="center"] .sk-form-body {
  margin-inline: auto;
}
.sk-form[data-align="right"] .sk-form-body {
  margin-inline-start: auto;
}

.sk-form-status {
  margin: var(--kit-space-2) 0 0;
  color: var(--sk-accent);
}
