/* Grundlayout: schlicht und neutral (V-25), zuerst für Smartphones (V-17).
   Keine externen Schriften oder Dienste (V-23). */

:root {
  --text: #1f2328;
  --text-leise: #59636e;
  --hintergrund: #f6f7f8;
  --flaeche: #ffffff;
  --rand: #d0d7de;
  --akzent: #2f5d8a;
  --akzent-dunkel: #234a6f;
  --ok: #1a7f37;
  --ok-hell: #e6f4ea;
  --fehler: #b42318;
  --fehler-hell: #fdecea;
  --warnung: #7a5a00;
  --warnung-hell: #fff6d6;
  --radius: 8px;
  --abstand: 1rem;
}

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

[hidden] { display: none !important; }

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

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

.rahmen { width: 100%; max-width: 40rem; margin: 0 auto; padding: 0 var(--abstand); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--abstand); top: var(--abstand); background: var(--flaeche); padding: .5rem; z-index: 10; }

.kopf { background: var(--flaeche); border-bottom: 1px solid var(--rand); }
.kopf .rahmen { padding-top: .75rem; padding-bottom: .75rem; }
.marke { font-weight: 600; font-size: 1.05rem; }

main.rahmen { padding-top: var(--abstand); padding-bottom: 2rem; }

h1 { font-size: 1.4rem; line-height: 1.25; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: var(--abstand);
}
.karte.schmal { max-width: 26rem; margin: 0 auto; }

fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
legend { font-weight: 600; font-size: 1.05rem; margin-bottom: .25rem; padding: 0; }

label { display: block; margin: .75rem 0 .25rem; font-weight: 500; }
label.auswahl { display: flex; align-items: center; gap: .5rem; font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"] {
  display: block;
  width: 100%;
  min-height: 44px;              /* gut antippbar */
  padding: .6rem .75rem;
  font: inherit;
  font-size: 1rem;               /* verhindert Zoom auf iOS */
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 6px;
}
input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin: 0; }
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 2px;
}

button, .knopf {
  display: inline-block;
  width: 100%;
  min-height: 44px;
  margin-top: 1rem;
  padding: .65rem 1rem;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--akzent);
  border: 1px solid var(--akzent);
  border-radius: 6px;
  cursor: pointer;
}
button:hover, .knopf:hover { background: var(--akzent-dunkel); }
.zweitrangig { color: var(--akzent); background: var(--flaeche); }
.zweitrangig:hover { color: #fff; }

.klein { font-size: .875rem; color: var(--text-leise); margin: .35rem 0; }

.hinweis {
  padding: .75rem;
  border-radius: 6px;
  border: 1px solid var(--rand);
  background: var(--hintergrund);
}
.hinweis ul { margin: 0; padding-left: 1.2rem; }
.hinweis.fehler  { color: var(--fehler);  background: var(--fehler-hell);  border-color: #f4b8b2; }
.hinweis.ok      { color: var(--ok);      background: var(--ok-hell);      border-color: #b7dfc1; }
.hinweis.warnung { color: var(--warnung); background: var(--warnung-hell); border-color: #ecd98a; }

table.pruefung { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.pruefung th, table.pruefung td { text-align: left; padding: .5rem .25rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
table.pruefung td.ok  { color: var(--ok);     font-weight: 600; white-space: nowrap; }
table.pruefung td.nok { color: var(--fehler); font-weight: 600; white-space: nowrap; }

code { font-family: ui-monospace, Consolas, monospace; font-size: .875rem; background: var(--hintergrund); padding: .1rem .3rem; border-radius: 4px; }
code.umbruch { display: block; padding: .5rem; overflow-wrap: anywhere; }

@media (min-width: 40rem) {
  :root { --abstand: 1.5rem; }
  button, .knopf { width: auto; }
  main.rahmen { padding-top: 2rem; }
}

.karte > .hinweis { margin: .75rem 0; }

/* ---- Modul 2: Navigation, Listen, Formulare ---- */

.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
a.marke { color: var(--text); text-decoration: none; }
.abmelden { margin: 0; }
button.link {
  width: auto; min-height: 44px; margin: 0; padding: .4rem .25rem;
  color: var(--akzent); background: none; border: 0; font-weight: 500; text-decoration: underline;
}
button.link:hover { background: none; color: var(--akzent-dunkel); }
.kopf .navi { display: flex; flex-wrap: wrap; gap: 0 1rem; padding-top: 0; padding-bottom: .4rem; }
.kopf .kopfzeile { padding-bottom: .25rem; }
.navi a { display: inline-block; padding: .4rem 0; color: var(--akzent); text-decoration: none; font-weight: 500; }
.navi a:hover { text-decoration: underline; }

a { color: var(--akzent); }
.links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1rem 0 0; }
.zurueck { margin: 0 0 .75rem; }

main > .karte, main > form > .karte, main > .hinweis, main > .aktionen { margin-bottom: var(--abstand); }
.karte h2:first-child { margin-top: 0; }

select, input[type="search"] {
  display: block; width: 100%; min-height: 44px; padding: .6rem .75rem;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 6px;
}
input[type="radio"] { width: 1.25rem; height: 1.25rem; margin: 0; }
input[readonly] { background: var(--hintergrund); }
select:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

.optionen { margin-top: 1rem; }
.unterbereich { border-left: 3px solid var(--rand); padding-left: .75rem; margin: .75rem 0; }
hr { border: 0; border-top: 1px solid var(--rand); margin: 1.25rem 0; }

.aktionen { display: flex; flex-direction: column; gap: .5rem; }
.aktionen .knopf { margin-top: 0; }
.filter button { margin-top: .75rem; }

.daten { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .75rem; margin: 0; }
.daten dt { color: var(--text-leise); }
.daten dd { margin: 0; overflow-wrap: anywhere; }

.marken { display: flex; flex-wrap: wrap; gap: .35rem; margin: .35rem 0 0; }
.marker {
  display: inline-block; padding: .05rem .5rem; font-size: .8rem; line-height: 1.6;
  border: 1px solid var(--rand); border-radius: 999px; background: var(--hintergrund); color: var(--text);
}
.marker.status-aktiv { color: var(--ok); background: var(--ok-hell); border-color: #b7dfc1; }
.marker.status-einladung_offen, .marker.status-wartet_freigabe { color: var(--warnung); background: var(--warnung-hell); border-color: #ecd98a; }
.marker.status-einladung_abgelaufen, .marker.status-loeschung { color: var(--fehler); background: var(--fehler-hell); border-color: #f4b8b2; }

.liste { list-style: none; margin: 0 0 var(--abstand); padding: 0; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.liste li { border-bottom: 1px solid var(--rand); }
.liste li:last-child { border-bottom: 0; }
.liste a { display: block; padding: .75rem var(--abstand); color: var(--text); text-decoration: none; }
.liste a:hover { background: var(--hintergrund); }
.liste strong, .liste .klein { display: block; overflow-wrap: anywhere; }
.liste .klein { margin: .1rem 0 0; }
.protokoll li { padding: .6rem var(--abstand); }
.protokoll .zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.protokoll strong { display: inline; }

.seiten { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.seiten a { display: inline-block; padding: .5rem 0; }

.karte.gefahr { border-color: #f4b8b2; }
.gefaehrlich { background: var(--fehler); border-color: var(--fehler); color: #fff; }
.gefaehrlich:hover { background: #8f1c13; }

@media (min-width: 40rem) {
  .aktionen { flex-direction: row; }
  .aktionen .knopf { width: auto; }
}

/* ---- Modul 3: Inhalte, Einstellungen, Rechtstexte ---- */

h3 { font-size: 1rem; margin: 1rem 0 .35rem; }

textarea, input[type="number"], input[type="date"], input[type="time"] {
  display: block; width: 100%; min-height: 44px; padding: .6rem .75rem;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 6px;
}
textarea { resize: vertical; line-height: 1.45; }
textarea:focus-visible, input:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
input.kurz { max-width: 12rem; }
fieldset[disabled] input, fieldset[disabled] textarea, fieldset[disabled] select { background: var(--hintergrund); color: var(--text-leise); }
fieldset.gruppe { margin: .5rem 0; }
fieldset.gruppe legend { font-size: 1rem; font-weight: 500; }

.md-werkzeug { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .35rem; }
.md-werkzeug button {
  width: auto; min-width: 44px; min-height: 40px; margin: 0; padding: .3rem .6rem;
  color: var(--text); background: var(--hintergrund); border: 1px solid var(--rand); font-weight: 400;
}
.md-werkzeug button:hover { background: var(--rand); }

.md { overflow-wrap: anywhere; }
.md p { margin: 0 0 .6rem; }
.md ul, .md ol { margin: 0 0 .6rem; padding-left: 1.4rem; }
.md > :last-child { margin-bottom: 0; }
.vorschau .md, div.md.vorschau { padding: .6rem .75rem; border: 1px dashed var(--rand); border-radius: 6px; background: var(--hintergrund); }
.md-hilfe { margin: .75rem 0; }
.md-hilfe summary { cursor: pointer; color: var(--akzent); }
.md-hilfe ul { padding-left: 1.2rem; margin: .35rem 0 0; }

.zeilen li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem var(--abstand); }
.zeilen li > span { min-width: 0; flex: 1; }
.zeilen form { margin: 0; flex: none; }
.zeilen button { width: auto; margin: 0; }
.zeilen .marken { margin-top: .25rem; }

.zeilenfelder { list-style: none; margin: .5rem 0; padding: 0; }
.zeilenfelder li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: 0 0 .5rem; }
.zeilenfelder label.inline { display: inline; margin: 0; font-weight: 400; }
.zeilenfelder input[type="number"] { width: 6.5rem; display: inline-block; }

.auswahlliste { list-style: none; margin: .5rem 0; padding: 0; }
.auswahlliste li { padding: .25rem 0; }
.einrueck { padding-left: 1.75rem; }
.gebiet { margin: 1rem 0 .35rem; }
.unternavi { margin: 0 0 var(--abstand); }
.links.rechtliches { justify-content: center; margin-top: 1.25rem; }
.karte.vorschau { border-style: dashed; }
main > form > fieldset > .karte, main > section.karte + form { margin-bottom: var(--abstand); }
.karte > h2:first-of-type { margin-top: 0; }
.unternavi { margin-top: .75rem; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.phasenkopf { display: grid; grid-template-columns: 6.5rem 6.5rem; gap: .5rem; margin: .5rem 0 0; }
.phasenkopf span { line-height: 1.3; }
.phasen .zeilenfelder li { display: grid; grid-template-columns: 6.5rem 6.5rem; gap: .5rem; }
.phasen .zeilenfelder input[type="number"] { width: 100%; }
