/* Stack — vertical rhythm */
.stack > * + * { margin-top: var(--gap-4); }
.stack-tight > * + * { margin-top: var(--gap-2); }
.stack-loose > * + * { margin-top: var(--gap-6); }

/* Cluster — inline row with wrap */
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-3);
  align-items: center;
}
.cluster--end { justify-content: flex-end; }
.cluster--between { justify-content: space-between; }

/* Inline form-row variant: a labelled input next to a button. Bottom-
   aligns the row (so the labelless button shares a baseline with the
   input under the label) and zeroes the contained .field's bottom
   margin (which otherwise pushes the input above the button). Used
   instead of inline style="align-items: flex-end" so CSP style-src
   without 'unsafe-inline' doesn't strip the alignment. */
.cluster--input-row { align-items: flex-end; }
.cluster--input-row > .field { margin-bottom: 0; }

/* Responsive grids */
.grid-2 { display: grid; gap: var(--gap-5); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: var(--gap-5); grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 880px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
