/* Grundlagen: Seite, Schrift, Formulare, Knoepfe */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--hg);
  color: var(--text);
  font: 16px/1.5 var(--schrift);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1 { font-size: clamp(1.45rem, 1.2rem + 1.1vw, 1.9rem); line-height: 1.2; letter-spacing: -0.015em; font-weight: 750; margin: 0 0 var(--abstand); }
h2 { font-size: clamp(1.08rem, 1rem + 0.35vw, 1.2rem); line-height: 1.3; letter-spacing: -0.01em; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 1rem; font-weight: 650; margin: 0 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--akzent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
h1:focus { outline: none; }
[hidden] { display: none !important; }
.leise { color: var(--text-leise); }
.nur-vorleser {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Betraege und Zahlen stehen sauber untereinander */
.zahl, .tabelle td, dl.felder dd, .ampel-zeile, .baum-zeile .leise, .kopfreihe .anzahl { font-variant-numeric: tabular-nums; }

label, .feld-titel { display: block; font-weight: 600; margin-bottom: 6px; }
.feld { margin-bottom: 16px; }
.feld .hilfe { font-size: 0.875rem; color: var(--text-leise); margin-top: 6px; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--rand-stark);
  border-radius: var(--radius-klein);
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  transition: border-color var(--dauer), box-shadow var(--dauer);
}
input:hover, select:hover, textarea:hover { border-color: var(--text-leise); }
input:focus, select:focus, textarea:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-hell); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--fokus); outline-offset: 1px; }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--akzent); box-shadow: none; }
.ankreuzen { display: flex; gap: 10px; align-items: center; font-weight: 400; min-height: 44px; }
input[aria-invalid="true"] { border-color: var(--fehler); }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  border: 1px solid var(--akzent); border-radius: var(--radius-klein);
  background: var(--akzent); color: var(--akzent-text);
  font: inherit; font-weight: 650; letter-spacing: 0.005em; text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.08);
  transition: background-color var(--dauer), border-color var(--dauer), color var(--dauer), transform var(--dauer), box-shadow var(--dauer);
}
.knopf:hover { background: var(--akzent-druck); border-color: var(--akzent-druck); }
.knopf:active { transform: translateY(1px); box-shadow: none; }
.knopf.zweit { background: var(--flaeche); color: var(--akzent); border-color: var(--akzent-rand); box-shadow: none; }
.knopf.zweit:hover { background: var(--akzent-hell); border-color: var(--akzent); }
.knopf.gefahr { background: var(--flaeche); color: var(--fehler); border-color: var(--fehler); box-shadow: none; }
.knopf.gefahr:hover { background: var(--fehler-hg); }
.knopf.klein { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }
.knopf.breit { width: 100%; }
/* Datei-Knoepfe sind <label>: ohne den Label-Abstand gleich hoch wie <button> in derselben Reihe;
   der Fokus des versteckten Datei-Felds markiert nur den eigenen Knopf */
label.knopf { margin-bottom: 0; }
label.knopf:has(+ input:focus) { outline: 3px solid var(--fokus); outline-offset: 2px; }
.knopf[disabled], .knopf[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.karte .knopfreihe:last-child, .karte form > .knopfreihe:last-child { margin-bottom: 0; }
form .raster { row-gap: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
