/* =========================================================
   Lightweight utility helpers (deliberately small).
   Compose with components rather than replace them.
   ========================================================= */

.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.grid {
  display: grid;
}
.block {
  display: block;
}
.hidden {
  display: none;
}

.flex-col {
  flex-direction: column;
}
.flex-1 {
  flex: 1;
  min-width: 0;
}
.flex-none {
  flex: none;
}
.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}
.items-start {
  align-items: flex-start;
}
.items-end {
  align-items: flex-end;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.justify-end {
  justify-content: flex-end;
}
.justify-start {
  justify-content: flex-start;
}

.gap-1 {
  gap: var(--space-1);
}
.gap-2 {
  gap: var(--space-2);
}
.gap-3 {
  gap: var(--space-3);
}
.gap-4 {
  gap: var(--space-4);
}
.gap-5 {
  gap: var(--space-5);
}
.gap-6 {
  gap: var(--space-6);
}

.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}
.min-w-0 {
  min-width: 0;
}

.mt-2 {
  margin-top: var(--space-2);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-6 {
  margin-top: var(--space-6);
}
.mb-2 {
  margin-bottom: var(--space-2);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-6 {
  margin-bottom: var(--space-6);
}

/* ---------------------------------------------------------------
   Das Hilfsklassen-Vokabular der Referenz, wörtlich. Es steht in
   ihrem gerenderten Markup an rund dreißig Stellen — ``row between``
   auf jeder Kopfzeile mit zwei Enden, ``number`` auf jeder Zahl, die
   sich ändert. Wer es nicht hat, baut jede dieser Stellen einzeln
   nach und weicht bei jeder ein wenig anders ab.
   --------------------------------------------------------------- */

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.between {
  justify-content: space-between;
}

.grow {
  flex: 1;
  min-width: 0;
}

/* Tabellenziffern. UIUX.md verlangt sie ausdrücklich für wechselnde
   Mengen und Summen: ohne sie springt die Spalte, sobald aus einer 1
   eine 8 wird. */
.number {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

/* Vertical rhythm.
   ``min-width: 0`` auf den Kindern: ohne das weigert sich ein Flex-Element,
   unter seine Inhaltsbreite zu schrumpfen, und ein langer Name oder eine
   breite Tabelle schiebt die ganze Seite waagerecht auf. Bei 320 px fällt
   genau das auf. */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.stack > *,
.stack-sm > *,
.stack-lg > *,
.stack-xl > * {
  min-width: 0;
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.stack-lg {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.stack-xl {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
  border: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) {
  .md\:grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .md\:grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .md\:hidden {
    display: none;
  }
  .md\:flex {
    display: flex;
  }
}
