/* The small set of layout helpers pages use instead of a utility framework. Last layer: they beat kit classes. */
@layer utilities {
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.5rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.5rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.row-tight { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.row-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }

/* Two columns once the page column is wide enough (iPad landscape, ~1064px): by container, not by window. */
.cols {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

@container page (min-width: 46rem) {
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

.muted { color: var(--text-muted); }
.small { font-size: 0.8125rem; }
.strong { font-weight: 600; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-serif); }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }

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

@media (width < 48rem) {
  .hide-phone { display: none !important; }
}

@media (width >= 48rem) {
  .only-phone { display: none !important; }
}

/* Keyboard hints («Space», «1–4») only where a keyboard is likely. */
@media (hover: none) {
  .kbd-hint { display: none !important; }
}

kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.3em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
  color: var(--primary-600);
  background: var(--primary-100);
  border: 1px solid var(--primary-200);
  border-radius: 0.25rem;
}
}
