:root {
  --akzent: #f2b705;
  --akzent-dunkel: #c99700;
  --text: #2f2f2c;
  --text-leise: #5f5e57;
  --grau-logo: #716a5d;
  --flaeche: #f6f5f1;
  --rand: #d4d1c7;
  --link: #7a5200;
  --fehler: #b3261e;
  --fehler-flaeche: #fdecea;
  --ok: #1e6b3a;
  --ok-flaeche: #e7f4ec;
  --info-flaeche: #fff7dc;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: #fff;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: #000; }

:focus-visible { outline: 3px solid #000; outline-offset: 2px; }

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

.skip { position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* ---- Kopf ---------------------------------------------------------------- */
.kopf {
  border-bottom: 3px solid var(--akzent);
  background: #fff;
}
.kopf-innen {
  max-width: 62rem; margin: 0 auto; padding: .75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.kopf img { display: block; }
.logo-text { height: 2.4rem; width: auto; }
.logo-linien { height: 2.8rem; width: auto; }

main { max-width: 62rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

h1 { font-size: 1.55rem; line-height: 1.25; margin: .25rem 0 1rem; font-weight: 600; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 1.5rem 0 .6rem; font-weight: 600; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
h2:focus { outline: none; }
.untertitel { margin: -.5rem 0 1.1rem; color: var(--text-leise); }

p { margin: 0 0 .9rem; }

/* ---- Boxen -------------------------------------------------------------- */
.box {
  border: 1px solid var(--rand); border-radius: var(--radius);
  background: var(--flaeche); padding: .9rem 1.1rem; margin: 0 0 1rem;
}
.box.info { background: var(--info-flaeche); border-color: #e9d27a; }
.box.fehler { background: var(--fehler-flaeche); border-color: #e6a5a0; color: #5c130e; }
.box.ok { background: var(--ok-flaeche); border-color: #9fcfb0; }
.box > :last-child { margin-bottom: 0; }

details.hinweis {
  border: 1px solid var(--rand); border-radius: var(--radius);
  margin: 0 0 .5rem; background: #fff;
}
details.hinweis > summary {
  cursor: pointer; padding: .7rem 1rem; font-weight: 500; list-style: none;
  display: flex; gap: .6rem; align-items: baseline;
}
details.hinweis > summary::-webkit-details-marker { display: none; }
details.hinweis > summary::before {
  content: "+"; font-weight: 700; width: 1rem; text-align: center; flex: none;
}
details.hinweis[open] > summary::before { content: "–"; }
details.hinweis[open] > summary { border-bottom: 1px solid var(--rand); }
details.hinweis > div { padding: .8rem 1rem .2rem; }
details.hinweis.wichtig { border-color: var(--akzent-dunkel); border-width: 2px; }

/* ---- Fortschritt ---------------------------------------------------------- */
.fortschritt { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.fortschritt li {
  font-size: .85rem; padding: .2rem .65rem; border-radius: 999px;
  border: 1px solid var(--rand); color: var(--text-leise); background: #fff;
}
.fortschritt li[aria-current="step"] { background: var(--akzent); border-color: var(--akzent-dunkel); color: #1d1d1b; font-weight: 600; }
.fortschritt li.fertig { background: var(--flaeche); }

/* ---- Formular ------------------------------------------------------------- */
form { max-width: 40rem; }
.feld { margin: 0 0 1.1rem; }
label, legend { display: block; font-weight: 500; margin-bottom: .3rem; padding: 0; }
.hilfe { font-size: .9rem; color: var(--text-leise); margin: .2rem 0 0; }
.pflichtstern { color: var(--fehler); }

input[type="text"], input[type="email"], input[type="tel"], select {
  width: 100%; font: inherit; color: inherit;
  padding: .6rem .7rem; min-height: 2.75rem;
  border: 1px solid #7d7a70; border-radius: 6px; background: #fff;
}
input[readonly] { background: var(--flaeche); }
select option:disabled { color: #8b887e; }

.feld.hat-fehler input, .feld.hat-fehler select { border-color: var(--fehler); border-width: 2px; }
.fehlertext { color: var(--fehler); font-size: .92rem; margin: .3rem 0 0; font-weight: 500; }

fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }

.option {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .55rem .75rem; margin: 0 0 .4rem;
  border: 1px solid var(--rand); border-radius: 8px; background: #fff;
}
.option input { width: 1.25rem; height: 1.25rem; margin: .2rem 0 0; flex: none; accent-color: #7a5200; }
.option label { margin: 0; font-weight: 400; flex: 1; cursor: pointer; }
.option:has(input:checked) { border-color: var(--akzent-dunkel); background: var(--info-flaeche); }

.pflicht-karte {
  border: 2px solid var(--akzent-dunkel); background: var(--info-flaeche);
  border-radius: var(--radius); padding: .8rem 1rem; margin: 0 0 1rem;
}
.pflicht-karte .titel { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-leise); }
.pflicht-karte .name { font-size: 1.15rem; font-weight: 600; }

.modul {
  border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem 1.1rem .2rem; margin: 0 0 1.2rem;
}
.modul > h3 { margin-top: 0; }

/* ---- Buttons ------------------------------------------------------------- */
.aktionen { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
button, .button {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  min-height: 2.75rem; padding: .55rem 1.4rem; border-radius: 999px;
  border: 2px solid var(--akzent-dunkel); background: var(--akzent); color: #1d1d1b;
  display: inline-flex; align-items: center; justify-content: center;
}
button:hover, .button:hover { background: #ffc824; color: #000; }
button.sekundaer { background: #fff; border-color: #7d7a70; font-weight: 500; }
button.sekundaer:hover { background: var(--flaeche); }
button.gefahr { background: #fff; border-color: var(--fehler); color: var(--fehler); }
button.gefahr:hover { background: var(--fehler-flaeche); }
button:disabled { opacity: .55; cursor: not-allowed; }

/* ---- Zusammenfassung ---------------------------------------------------------- */
dl.zusammenfassung { margin: 0 0 1rem; display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: .45rem 1rem; }
dl.zusammenfassung dt { color: var(--text-leise); }
dl.zusammenfassung dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---- Fuß ------------------------------------------------------------------------ */
footer { border-top: 1px solid var(--rand); background: var(--flaeche); color: var(--text-leise); font-size: .9rem; }
footer .innen { max-width: 62rem; margin: 0 auto; padding: 1rem; }

/* ---- Admin ------------------------------------------------------------------ */
.admin-breit { max-width: 80rem; }
.werkzeuge { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin: 0 0 1rem; }
.werkzeuge .feld { margin: 0; }
.werkzeuge input, .werkzeuge select { min-width: 11rem; width: auto; }
.tabelle-rahmen { overflow-x: auto; border: 1px solid var(--rand); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: .5rem .65rem; text-align: left; border-bottom: 1px solid var(--rand); white-space: nowrap; vertical-align: top; }
thead th { background: var(--flaeche); position: sticky; top: 0; }
th button.sortieren {
  all: unset; cursor: pointer; font-weight: 600; display: inline-flex; gap: .25rem; align-items: center;
}
th button.sortieren:focus-visible { outline: 3px solid #000; outline-offset: 2px; }
tbody tr:hover { background: #fffbea; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.klein-btn { min-height: 2rem; padding: .2rem .8rem; font-size: .85rem; }
.kennzahlen { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0 0 1rem; }
.kennzahl { border: 1px solid var(--rand); border-radius: var(--radius); padding: .6rem 1rem; background: #fff; }
.kennzahl .wert { font-size: 1.4rem; font-weight: 600; }
.kennzahl .name { font-size: .85rem; color: var(--text-leise); }

@media (max-width: 36rem) {
  h1 { font-size: 1.3rem; }
  dl.zusammenfassung { grid-template-columns: 1fr; gap: 0; }
  dl.zusammenfassung dt { margin-top: .6rem; font-size: .88rem; }
  .logo-linien { display: none; }
  .aktionen button, .aktionen .button { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Admin: Reiter und Vertiefungs-Ansicht ------------------------------------ */
.reiter { display: flex; gap: .25rem; border-bottom: 2px solid var(--rand); margin: 0 0 1rem; flex-wrap: wrap; }
.reiter button[role="tab"] {
  border-radius: 8px 8px 0 0; border: 2px solid var(--rand); border-bottom: 0; background: var(--flaeche);
  font-weight: 500; margin-bottom: -2px;
}
.reiter button[role="tab"][aria-selected="true"] { background: var(--akzent); border-color: var(--akzent-dunkel); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.chips a {
  border: 1px solid var(--rand); border-radius: 999px; padding: .2rem .8rem; background: #fff;
  text-decoration: none; color: var(--text); font-size: .92rem;
}
.chips a:hover { background: var(--info-flaeche); }
.vert-abschnitt { margin: 0 0 1.5rem; }
.vert-abschnitt h3 { margin: 1rem 0 .1rem; scroll-margin-top: 1rem; }
.zaehler { font-weight: 400; font-size: .95rem; color: var(--text-leise); margin-left: .4rem; }
[hidden] { display: none !important; }
