:root {
  --grund: #ffffff;
  --leiste: #f3f4f6;
  --rand: #d6d9de;
  --text: #1f2328;
  --leise: #59636e;
  --akzent: #1f6feb;
  --akzent-text: #ffffff;
  --fehler: #cf222e;
  --warnung: #9a6700;
  --hinweis: #0969da;
  --gut: #1a7f37;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grund: #1e1e1e;
    --leiste: #252526;
    --rand: #3c3c3c;
    --text: #e6e6e6;
    --leise: #a0a0a0;
    --akzent: #388bfd;
    --akzent-text: #ffffff;
    --fehler: #f85149;
    --warnung: #d29922;
    --hinweis: #58a6ff;
    --gut: #3fb950;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --grund: #1e1e1e;
  --leiste: #252526;
  --rand: #3c3c3c;
  --text: #e6e6e6;
  --leise: #a0a0a0;
  --akzent: #388bfd;
  --akzent-text: #ffffff;
  --fehler: #f85149;
  --warnung: #d29922;
  --hinweis: #58a6ff;
  --gut: #3fb950;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--grund);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}

.leiste {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 16px;
  background: var(--leiste);
  border-bottom: 1px solid var(--rand);
}
.marke { font-weight: 600; white-space: nowrap; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 6px; }
.status { margin-left: auto; color: var(--leise); font-size: 13px; }
.status.ok { color: var(--gut); }
.status.fehler { color: var(--fehler); }

button, select, input {
  font: inherit;
  color: var(--text);
  background: var(--grund);
  border: 1px solid var(--rand);
  border-radius: 6px;
  padding: 4px 10px;
  min-height: 30px;
}
button { cursor: pointer; }
button:hover { border-color: var(--akzent); }
button:disabled { opacity: .5; cursor: default; }
button.haupt { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
select { max-width: 220px; }

.flaeche { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.editor { flex: 1; min-height: 200px; }

.befunde {
  height: 28%;
  min-height: 90px;
  overflow: auto;
  border-top: 1px solid var(--rand);
  background: var(--leiste);
}
.befunde h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); margin: 8px 16px 4px; }
.befunde ul { list-style: none; margin: 0; padding: 0 0 8px; }
.befunde li {
  padding: 3px 16px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 5.5em 4.5em 1fr;
  gap: 8px;
}
.befunde li:hover { background: var(--grund); }
.befunde .schwere { font-weight: 600; }
.befunde .FEHLER .schwere { color: var(--fehler); }
.befunde .WARNUNG .schwere { color: var(--warnung); }
.befunde .HINWEIS .schwere { color: var(--hinweis); }
.befunde .ort { color: var(--leise); font-variant-numeric: tabular-nums; }
.befunde .hinweis { grid-column: 3; color: var(--leise); }
.befunde .leer { color: var(--leise); cursor: default; display: block; }

dialog {
  background: var(--grund);
  color: var(--text);
  border: 1px solid var(--rand);
  border-radius: 8px;
  width: min(440px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0, 0, 0, .4); }
dialog h2 { margin-top: 0; font-size: 18px; }
dialog input { width: 100%; }
dialog menu { display: flex; justify-content: flex-end; padding: 0; margin: 16px 0 0; }
.fehler { color: var(--fehler); }

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

/* Einladungsseite (/einladung): eine Spalte, die scrollt, statt Editorflaeche */
body.seite { display: block; height: auto; min-height: 100%; }
.einladung { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
.einladung h1 { font-size: 22px; margin: 16px 0 8px; }
.einladung h2 { font-size: 16px; margin: 0 0 8px; }
.einladung ol { margin: 0; padding-left: 20px; }
.einladung li p { margin: 6px 0; }
.karte {
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--leiste);
  padding: 12px 16px;
  margin: 16px 0;
}
.warnkarte { border-color: var(--fehler); }
.warnung-text { color: var(--warnung); }
.leise { color: var(--leise); font-size: 13px; }
.kopierzeile { display: flex; gap: 8px; align-items: flex-start; }
.wert {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--grund);
  border: 1px solid var(--rand);
  border-radius: 6px;
  padding: 5px 8px;
  user-select: all;
}
a.knopf {
  display: inline-block;
  text-decoration: none;
  color: var(--text);
  background: var(--grund);
  border: 1px solid var(--rand);
  border-radius: 6px;
  padding: 5px 12px;
}
a.knopf:hover { border-color: var(--akzent); }
a.knopf.haupt { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }

@media (max-width: 640px) {
  .leiste { padding: 8px; }
  .status { margin-left: 0; width: 100%; }
  .befunde li { grid-template-columns: 4.5em 1fr; }
  .befunde .ort { display: none; }
  .befunde .hinweis { grid-column: 2; }
  .kopierzeile { flex-direction: column; align-items: stretch; }
}
