/* ============================================================================
   Utilities
   --------------------------------------------------------------------------
   Loaded LAST so a utility wins over the component rule it is correcting.
   Every value maps onto a token scale; `n` in a spacing utility is the step
   in 4px units (mt-4 = 16px), which is why 8px is .gap-2 and not .gap-8.
   Utilities keep a one-off spacing decision on the scale; they are not a
   licence to build layouts in the markup.
   ========================================================================== */

/* Text */
.text-muted { color: var(--text-muted); }
.text-body { color: var(--text-body); }
.text-green { color: var(--success); }
.text-blue { color: var(--info); }
.text-yellow { color: var(--warning); }
.text-red { color: var(--danger-on-soft); }
.text-brand { color: var(--brand); }
.text-2xs { font-size: var(--text-2xs); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }
.font-normal { font-weight: var(--weight-normal); }
.font-medium { font-weight: var(--weight-medium); }
.font-bold { font-weight: var(--weight-semibold); }
.font-heavy { font-weight: var(--weight-bold); }
.tabular { font-variant-numeric: tabular-nums; }
.underline { text-decoration: underline; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Display and flex */
.d-none { display: none; }
.d-inline { display: inline; }
.d-block { display: block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.ml-auto { margin-left: auto; }
.relative { position: relative; }
/* Visible to a screen reader, absent from the page. Used where an icon carries
   the whole meaning of a control, as in the theme switcher. */
.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;
}

/* Spacing — step n = 4n px */
.gap-1 { gap: var(--space-2); }
.gap-2 { gap: var(--space-4); }
.gap-3 { gap: var(--space-6); }
.gap-4 { gap: var(--space-8); }
.gap-5 { gap: var(--space-10); }
.gap-6 { gap: var(--space-12); }
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-2); }
.mt-2 { margin-top: var(--space-4); }
.mt-3 { margin-top: var(--space-6); }
.mt-4 { margin-top: var(--space-8); }
.mt-5 { margin-top: var(--space-10); }
.mt-6 { margin-top: var(--space-12); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-2); }
.mb-2 { margin-bottom: var(--space-4); }
.mb-3 { margin-bottom: var(--space-6); }
.mb-4 { margin-bottom: var(--space-8); }
.mb-5 { margin-bottom: var(--space-10); }
.mb-6 { margin-bottom: var(--space-12); }
.ml-1 { margin-left: var(--space-2); }
.ml-2 { margin-left: var(--space-4); }
.p-0 { padding: 0; }
.pb-2 { padding-bottom: var(--space-4); }

/* Sizing — for inputs and selects that should not fill their row */
.w-auto { width: auto; }
.w-full { width: 100%; }
.min-w-sm { min-width: 120px; }
.min-w-md { min-width: 140px; }
.min-w-lg { min-width: 160px; }
.min-w-xl { min-width: 180px; }
.min-w-2xl { min-width: 280px; }
.icon-box { width: var(--space-12); height: var(--space-12); }

/* Padding — step n = 4n px, plus the two card densities that are not on that grid. */
.p-2 { padding: var(--space-4); }
.p-3 { padding: var(--space-6); }
.p-5 { padding: var(--space-10); }
.p-6 { padding: var(--space-12); }
.p-8 { padding: var(--space-16); }
.px-4 { padding-left: var(--space-8); padding-right: var(--space-8); }
.py-2 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-3 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.pad-row { padding: var(--space-5) var(--space-8); }
.pad-body { padding: var(--space-6) var(--space-9); }
.pad-header { padding: var(--space-7) var(--space-9); }

/* Margin — the right/bottom directions the components actually use. */
.mr-1 { margin-right: var(--space-2); }
.mr-2 { margin-right: var(--space-4); }
.mr-3 { margin-right: var(--space-6); }
.mb-1h { margin-bottom: var(--space-3); }

/* Sizing */
.w-sm { width: 160px; }
.w-md { width: 240px; }
.flex-w-lg { flex: 0 0 320px; }
.max-w-sm { max-width: 300px; }
.max-w-md { max-width: 420px; }
.max-w-lg { max-width: 600px; }
.max-w-xl { max-width: 700px; }
.max-w-2xl { max-width: 800px; }
.max-w-3xl { max-width: 900px; }
.min-w-3xl { min-width: 420px; }

/* Misc */
.absolute { position: absolute; }
.cursor-pointer { cursor: pointer; }
.list-none { list-style: none; }
.pre-wrap { white-space: pre-wrap; }
.pin-tr { position: absolute; top: var(--space-3); right: var(--space-3); }
