:root {
  --ink: #17242c;
  --muted: #4c5c66;
  --line: #ccd6dc;
  --surface: #ffffff;
  --page: #f3f5f6;
  --accent: #17465f;
  --accent-hover: #0f3347;
  --accent-soft: #e6eff4;
  --good: #14603c;
  --good-soft: #e3f3ea;
  --ok: #6b4e00;
  --ok-soft: #fbf1d3;
  --bad: #5c3b47;
  --bad-soft: #f2e8ec;
  --critical: #8f1414;
  --critical-soft: #fdeaea;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid #d9770b; outline-offset: 2px; }
main:focus, h1:focus, h2:focus { outline: none; }

.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }

.site-header { background: var(--accent); padding: 10px 20px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; }
.brand:hover { color: #fff; text-decoration: underline; }

.case-notice {
  background: #fff4d6;
  border-bottom: 2px solid #b98900;
  color: #3f2f00;
  font-size: .9rem;
  padding: 8px 20px;
}
.case-notice strong { display: block; }

main { max-width: 860px; margin: 0 auto; padding: 22px 16px 60px; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 10px; }
h2 { font-size: 1.22rem; line-height: 1.3; margin: 0 0 10px; }
h3 { font-size: 1.02rem; line-height: 1.35; margin: 18px 0 6px; }
p { margin: 0 0 10px; }
ul { margin: 0 0 10px; padding-left: 22px; }
li { margin-bottom: 5px; }

.muted { color: var(--muted); }
.eyebrow { color: var(--muted); font-size: .88rem; font-weight: 600; margin-bottom: 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  padding: 16px 18px;
}
.card > :last-child { margin-bottom: 0; }

.question { font-size: 1.08rem; font-weight: 700; }

.btn {
  appearance: none;
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 8px 18px;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.secondary { background: #fff; color: var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.choices { border: 0; margin: 0 0 14px; padding: 0; }
.choices legend { padding: 0; margin-bottom: 8px; }
.choice {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  padding: 11px 12px;
}
.choice:hover { background: var(--accent-soft); }
.choice:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-soft); padding: 10px 11px; }
.choice input { flex: none; height: 18px; margin: 3px 0 0; width: 18px; }

label.field-label { display: block; font-weight: 600; margin-bottom: 5px; }
textarea, input[type="text"] {
  background: #fff;
  border: 1px solid #7c8b95;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
  width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
.form-error { color: var(--critical); font-weight: 600; margin-top: 8px; }
.form-error:empty { display: none; }

.badge {
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-block;
  font-size: .9rem;
  font-weight: 700;
  padding: 2px 11px;
  white-space: nowrap;
}
.badge.bevorzugt { background: var(--good-soft); color: var(--good); }
.badge.vertretbar { background: var(--ok-soft); color: var(--ok); }
.badge.problematisch { background: var(--bad-soft); color: var(--bad); }
.badge.critical { background: var(--critical); border-color: var(--critical); color: #fff; }

.critical-box {
  background: var(--critical-soft);
  border: 2px solid var(--critical);
  border-radius: 6px;
  color: #5e0d0d;
  margin: 12px 0;
  padding: 11px 14px;
}
.critical-box strong { display: block; margin-bottom: 3px; }

.basis { color: var(--muted); font-size: .94rem; }
.rationale-quote { background: var(--page); border-left: 4px solid var(--line); margin: 8px 0 0; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

.criteria label { align-items: flex-start; cursor: pointer; display: flex; gap: 10px; margin-bottom: 8px; }
.criteria input { flex: none; height: 18px; margin: 3px 0 0; width: 18px; }
.points-line { font-weight: 700; margin-top: 10px; }

.key-message { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 10px 14px; }

.positions { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 8px 0 12px; }
.position { background: var(--page); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.position strong { display: block; margin-bottom: 3px; }

details { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 600; min-height: 44px; padding: 10px 12px; }
summary .badge { margin-left: 6px; }
details .details-body { border-top: 1px solid var(--line); padding: 10px 12px; }
details .details-body > :last-child { margin-bottom: 0; }

.history h3:first-child { margin-top: 0; }
.history-entry { border-left: 3px solid var(--line); margin-bottom: 10px; padding-left: 10px; }

.sources { font-size: .9rem; list-style: none; margin: 8px 0 0; padding: 0; }
.sources li { margin-bottom: 7px; overflow-wrap: anywhere; }
.sources .checked { color: var(--muted); display: block; }

.progress { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }

.run-list { list-style: none; margin: 0; padding: 0; }
.run-list li {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin: 0;
  padding: 12px 0;
}
.run-list li:first-child { border-top: 0; }
.run-state { color: var(--muted); display: block; font-size: .88rem; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; font-size: .93rem; width: 100%; }
caption { font-weight: 600; margin-bottom: 6px; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
th { background: var(--page); font-weight: 700; }
td input[type="text"] { min-width: 100px; padding: 6px 8px; }

.score { font-size: 1.15rem; font-weight: 700; }
.error { background: var(--critical-soft); border: 1px solid var(--critical); border-radius: 6px; padding: 12px; }

@media (max-width: 720px) {
  .case-notice { padding: 8px 14px; }
  .site-header { padding: 10px 14px; }
  main { padding: 16px 10px 48px; }
  .card { padding: 14px 13px; }
  h1 { font-size: 1.38rem; }

  /* Tabellen werden auf dem Smartphone zu beschrifteten Karten. */
  table.stack thead { border: 0; clip: rect(0 0 0 0); height: 1px; overflow: hidden; position: absolute; width: 1px; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { background: var(--page); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; padding: 6px 10px; }
  table.stack td { border: 0; padding: 5px 0; }
  table.stack td::before { color: var(--muted); content: attr(data-label); display: block; font-size: .82rem; font-weight: 700; }
  .btn { width: 100%; }
  .run-list .btn { width: auto; }
}
