/* Basis: Reset, Typografie, Custom Scrollbar, Fokus, Utilities. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
p  { margin: 0 0 .8em; }
a  { color: inherit; }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Custom Scrollbar — gleiche Formsprache überall */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(255, 255, 255, .18); }

.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.mono  { font-family: var(--mono); font-size: .92em; }
.hidden { display: none !important; }
/* Querlauf für breite Inhalte (Tabellen).
 *
 *  `overflow-x: auto` allein genügt NICHT. Grid- und Flex-Kinder haben von Haus
 *  aus `min-width: auto` und weigern sich, unter ihre Inhaltsbreite zu
 *  schrumpfen. Eine 880 px breite Tabelle drückt dann die ganze Kette von
 *  Eltern auseinander, bis die Seite selbst seitwärts läuft — der Querlauf
 *  bekommt nie eine Chance, weil sein Kasten mitgewachsen ist.
 *
 *  Deshalb bekommt jeder Vorfahr eines `.scroll-x` `min-width: 0`. Damit hört
 *  die Kette auf zu wachsen und die Tabelle scrollt in ihrem eigenen Kasten —
 *  auf jedem Gerät, in jeder Ansicht, auch in solchen, die es noch nicht gibt. */
.scroll-x { overflow-x: auto; min-width: 0; max-width: 100%; }
:has(> .scroll-x), :has(.scroll-x) { min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
