:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f7f8fa;
  --border: #d0d7de;
  --text: #1f2328;
  --muted: #57606a;
  --accent: #0b5cad;
  --accent-text: #ffffff;
  --warn-bg: #fff4e5;
  --warn-border: #b25e00;
  --ok: #1a7f37;
  --bad: #b3261e;
  --icon-bg: #ffffff;
  --backdrop: rgba(31, 35, 40, 0.5);
}

/* Dunkles Farbschema nach Systemeinstellung. Alle Farben laufen über die Variablen. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #3d444d;
    --text: #e6edf3;
    --muted: #9da7b3;
    --accent: #58a6ff;
    --accent-text: #0d1117;
    --warn-bg: #3a2a10;
    --warn-border: #d29922;
    --ok: #3fb950;
    --bad: #ff7b72;
    --backdrop: rgba(0, 0, 0, 0.65);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, "Segoe UI", system-ui, sans-serif;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
h4 { font-size: 0.95rem; margin: 16px 0 6px; }

code, .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.muted, .hint { color: var(--muted); }
.hint { font-size: 0.9rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
}

.notice {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 16px 0;
}
.notice.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
}

.field { display: flex; flex-direction: column; }
label { font-weight: 600; margin-bottom: 4px; }
.label-row { display: flex; align-items: center; margin-bottom: 4px; }
.label-row label { margin-bottom: 0; }

/* Kleines Fragezeichen, das zum Glossar springt. Nur Text und Rahmen, keine Bilddatei. */
a.help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 6px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
}
a.help:hover, a.help:focus-visible { background: var(--accent); color: var(--accent-text); }
label.inline { font-weight: 400; margin-right: 16px; }

input[type="text"], select {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 16px 0 0;
  padding: 8px 12px;
}

button {
  font: inherit;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.secondary, .report-head button {
  background: var(--bg);
  color: var(--accent);
}

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

.actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.report-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.report-head .actions { margin-top: 0; }

.status { min-height: 1.6em; margin: 12px 0; font-weight: 600; }
.status.error { color: var(--bad); }
.status.ok { color: var(--ok); }

.summary-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.authenticator-name { font-size: 1.2rem; font-weight: 700; margin: 0; }
.authenticator-name.status-text { font-size: 1.05rem; }
.title-large { font-size: 1.25rem; }
/* Die Logos der Liste sind für hellen Hintergrund gedacht; deshalb in beiden Modi eine helle Kachel. */
.authenticator-icon { border-radius: 6px; border: 1px solid var(--border); background: var(--icon-bg); padding: 2px; }
.explorer-info { margin-bottom: 8px; }
.explorer-info .muted { margin: 0; font-size: 0.85rem; }
.cmp-status { font-weight: 700; margin-right: 8px; }
.cmp-met { color: var(--ok); }
.cmp-deviates { color: var(--bad); }
.cmp-undetermined, .cmp-info { color: var(--muted); }



dl.kv {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 4px 12px;
  margin: 0;
}
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
dl.kv.nested { margin-left: 4px; }
.break { overflow-wrap: anywhere; word-break: break-all; }

details.cert { border: 1px solid var(--border); border-radius: 4px; padding: 8px 12px; margin: 8px 0; background: var(--bg); }
details summary { cursor: pointer; font-weight: 600; }

pre {
  overflow: auto;
  max-height: 480px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.glossary h3 { margin-top: 20px; scroll-margin-top: 12px; }
.glossary table { border-collapse: collapse; width: 100%; margin: 8px 0; background: var(--bg); }
.glossary th, .glossary td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.glossary th { background: var(--surface); }
.glossary td:first-child { white-space: nowrap; }

/* Popup mit dem Glossar-Abschnitt (natives <dialog>, öffnet per showModal). */
dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
dialog::backdrop { background: var(--backdrop); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.glossary-body h3 { margin-top: 0; }




footer { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { margin-top: 6px; }
}
