:root { --bg:#faf9f6; --fg:#1d1d1b; --muted:#6b6b66; --line:#ddd9d0; --accent:#8b1a1a; --accent-bg:#fbeaea;
  --rot:#c62828; --gelb:#d69a00; --gruen:#2e7d32; --rot-bg:#fde8e8; --gelb-bg:#fff5d6; --gruen-bg:#e6f4e8; --mark:#fff2a8; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:17px/1.55 Georgia, "Times New Roman", serif; }
header.top { border-bottom:1px solid var(--line); padding:10px 24px; display:flex; justify-content:space-between; align-items:baseline; font-family:system-ui, sans-serif; font-size:14px; color:var(--muted); }
header.top b { color:var(--accent); font-size:16px; }
main { max-width:960px; margin:0 auto; padding:24px; }
main.breit { max-width:1240px; }
h1 { font-size:28px; line-height:1.2; margin:0 0 6px; }
h2 { font-size:21px; margin:32px 0 10px; border-bottom:1px solid var(--line); padding-bottom:4px; }
h3 { font-size:18px; margin:20px 0 6px; }
.kontext { color:var(--muted); font-family:system-ui, sans-serif; font-size:15px; margin-bottom:22px; }
.aufgabe { background:#fff; border:1px solid var(--line); border-left:4px solid var(--accent); padding:12px 16px; margin:16px 0 24px; }
label { display:block; font-family:system-ui, sans-serif; font-size:14px; font-weight:600; margin:14px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea { width:100%; font:inherit; font-size:16px; padding:8px 10px; border:1px solid #bbb; border-radius:4px; background:#fff; }
textarea { min-height:110px; }
textarea.klein { min-height:56px; font-size:15px; }
button, .btn { font:inherit; font-family:system-ui, sans-serif; font-size:16px; padding:10px 18px; border-radius:5px; border:1px solid var(--accent); background:var(--accent); color:#fff; cursor:pointer; text-decoration:none; display:inline-block; }
button.sekundaer, .btn.sekundaer { background:#fff; color:var(--accent); }
button.klein, .btn.klein { font-size:14px; padding:5px 10px; }
.fehler { background:var(--rot-bg); border:1px solid var(--rot); color:#7a1010; padding:10px 14px; margin:12px 0; font-family:system-ui, sans-serif; }
.flash { background:var(--gruen-bg); border:1px solid var(--gruen); padding:10px 14px; margin:12px 0; font-family:system-ui, sans-serif; }
.hinweis { color:var(--muted); font-family:system-ui, sans-serif; font-size:14px; }
table { border-collapse:collapse; width:100%; font-family:system-ui, sans-serif; font-size:14px; }
th, td { text-align:left; padding:7px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-weight:600; }
code, .mono { font-family:ui-monospace, Menlo, monospace; font-size:13px; word-break:break-all; }
.badge { display:inline-block; font-family:system-ui, sans-serif; font-size:12px; padding:1px 8px; border-radius:10px; border:1px solid var(--line); background:#fff; white-space:nowrap; }
.badge.offen { background:#eef; } .badge.in_arbeit { background:var(--gelb-bg); } .badge.abgeschlossen { background:var(--gruen-bg); } .badge.publiziert { background:var(--gruen); color:#fff; }
/* Claims */
.claim { background:#fff; border:1px solid var(--line); border-left:6px solid #999; padding:12px 16px; margin:10px 0; border-radius:3px; }
.claim.hoch { border-left-color:var(--rot); } .claim.mittel { border-left-color:var(--gelb); } .claim.niedrig { border-left-color:var(--gruen); }
.claim.fehlt { outline:2px solid var(--rot); }
.claim .text { font-size:17px; margin:0 0 6px; }
.claim .meta { font-family:system-ui, sans-serif; font-size:14px; color:var(--muted); }
.claim .meta a { color:var(--accent); }
.claim .zeile { display:flex; gap:18px; flex-wrap:wrap; align-items:flex-start; margin-top:10px; font-family:system-ui, sans-serif; font-size:14px; }
.claim .zeile > div { flex:1 1 220px; }
.claim .radios label { display:inline-block; font-weight:normal; margin:0 12px 0 0; }
.ampel { display:inline-block; width:12px; height:12px; border-radius:50%; vertical-align:middle; margin-right:5px; }
.ampel.hoch { background:var(--rot); } .ampel.mittel { background:var(--gelb); } .ampel.niedrig { background:var(--gruen); }
.qs { font-weight:600; } .qs.fraglich { color:var(--gelb); } .qs.widerlegt { color:var(--rot); } .qs.bestaetigt { color:var(--gruen); }
/* Review-Layout */
.review { display:grid; grid-template-columns: minmax(0, 1fr) 340px; gap:28px; }
@media (max-width: 900px) { .review { grid-template-columns:1fr; } }
.entwurf { background:#fff; border:1px solid var(--line); padding:28px 36px; font-size:17px; line-height:1.6; position:relative; }
.entwurf h1 { font-size:24px; } .entwurf h2 { font-size:20px; border:0; } .entwurf h3 { font-size:18px; }
.entwurf mark { background:var(--mark); padding:0 1px; cursor:pointer; }
.entwurf.ohne-markierung mark { background:transparent; cursor:auto; }
.entwurf mark.aktiv { background:#ffd166; }
.seitenleiste { font-family:system-ui, sans-serif; font-size:14px; }
.seitenleiste .box { background:#fff; border:1px solid var(--line); padding:12px 14px; margin-bottom:16px; position:sticky; top:12px; }
.seitenleiste ul { padding-left:18px; margin:6px 0; }
.seitenleiste li { margin-bottom:6px; }
.seitenleiste li.nicht-gefunden { color:var(--muted); }
#kommentar-knopf { position:absolute; display:none; z-index:5; }
.kommentar { background:#fff; border:1px solid var(--line); padding:10px 14px; margin:8px 0; font-family:system-ui, sans-serif; font-size:14px; }
.kommentar .zitat { border-left:3px solid var(--gelb); padding-left:8px; color:var(--muted); font-style:italic; margin-bottom:4px; }
/* Log */
.log-gruppe h2 { margin-top:28px; }
.ev { display:grid; grid-template-columns: 130px 1fr; gap:12px; padding:8px 0; border-bottom:1px dotted var(--line); }
.ev .zeit { font-family:system-ui, sans-serif; font-size:13px; color:var(--muted); }
.ev .wer { font-family:system-ui, sans-serif; font-size:13px; font-weight:600; }
.ev .typ { font-size:11px; }
.ev details { font-family:ui-monospace, monospace; font-size:12px; color:var(--muted); }
@media print { header.top, .kein-druck { display:none; } body { background:#fff; } }

/* Zusatz-Aktionen (2a) */
.zusatz { display:flex; gap:14px; flex-wrap:wrap; margin:6px 0 16px; font-family:system-ui, sans-serif; font-size:14px; }
.zusatz details { background:#fff; border:1px solid var(--line); border-radius:4px; padding:4px 10px; flex:1 1 300px; }
.zusatz summary { cursor:pointer; color:var(--accent); font-weight:600; }
.zusatz-form label { margin-top:8px; }
/* Editor + Diff */
.editor-layout { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:24px; }
@media (max-width:900px) { .editor-layout { grid-template-columns:1fr; } }
textarea.editor { min-height:520px; font-family:ui-monospace, Menlo, monospace; font-size:14px; line-height:1.5; }
.diff-stats { font-family:system-ui, sans-serif; font-size:14px; margin:8px 0 12px; display:flex; gap:16px; flex-wrap:wrap; align-items:baseline; }
.diff-stats span { padding:2px 8px; border-radius:3px; }
.diff-text { background:#fff; border:1px solid var(--line); padding:22px 28px; line-height:1.7; }
.diff-text h3 { margin:18px 0 6px; }
.d-uebernommen { color:#555; }
.d-geaendert { background:var(--gelb-bg); border-bottom:2px solid var(--gelb); }
.d-neu { background:var(--gruen-bg); border-bottom:2px solid var(--gruen); }
.d-entfernt { color:var(--rot); }
.diff-stats .d-uebernommen { background:#eee; }
.diff-entfernt { font-family:system-ui, sans-serif; font-size:14px; margin-top:10px; }
.diff-entfernt li { text-decoration:line-through; color:var(--muted); margin-bottom:4px; }
pre.volltext { white-space:pre-wrap; background:#fff; border:1px solid var(--line); padding:20px; font-family:Georgia, serif; font-size:15px; }
/* Volltext-Ansicht (Brief v5) */
.vt-kopf { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; font-family:system-ui, sans-serif; font-size:14px; background:#fff; border:1px solid var(--line); padding:8px 14px; margin-bottom:14px; }
.vt-versionen a.aktiv { font-weight:700; }
.vt-schichten label { display:inline-block; font-weight:normal; margin:0 10px 0 0; }
.vt-schichten .zaehler { color:var(--muted); }
.vt-layout { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:24px; }
.vt-haupt { position:relative; }   /* Bezugsrahmen fuer Popover und Kommentar-Knopf (absolut positioniert) */
@media (max-width:900px) { .vt-layout { grid-template-columns:1fr; } }
.vt-text { position:relative; }
.vt-allgemein { background:var(--gelb-bg); border:1px solid var(--gelb); padding:10px 14px; margin-bottom:12px; font-family:system-ui, sans-serif; font-size:14px; }
.vt-allgemein ul { margin:4px 0 0; padding-left:18px; }
/* Schichten: nur sichtbar, wenn Klasse s-<name> auf #volltext */
.vt .d-geaendert, .vt .d-neu { background:transparent; border-bottom:0; }
.vt.s-diff .d-geaendert { background:var(--gelb-bg); border-bottom:2px solid var(--gelb); }
.vt.s-diff .d-neu { background:var(--gruen-bg); border-bottom:2px solid var(--gruen); }
.vt .claim-mark { cursor:auto; }
.vt.s-claims .claim-mark { background:#eef0ff; border-bottom:2px dotted #5560c0; cursor:pointer; }
.vt.s-claims .claim-mark.neu { background:var(--mark); border-bottom-style:solid; border-bottom-color:#b8860b; }
.vt.s-claims .claim-mark.fraglich { border-bottom-color:var(--gelb); }
.vt.s-claims .claim-mark.widerlegt { border-bottom-color:var(--rot); background:var(--rot-bg); }
.vt .hinweis-marke { display:none; }
.vt.s-hinweise .hinweis-marke { display:inline-block; position:absolute; right:-30px; background:var(--gelb); color:#fff; font-size:13px; line-height:20px; width:22px; text-align:center; border-radius:4px; cursor:pointer; font-family:system-ui, sans-serif; }
.vt.s-hinweise .hinweis-marke.erledigt { background:var(--gruen); }
.vt .kommentar-mark { background:transparent; }
.vt.s-kommentare .kommentar-mark { background:#ffe9c9; border-bottom:2px solid #e08a00; cursor:pointer; }
.vt .aktiv { outline:2px solid var(--accent); outline-offset:2px; }
.vt .vt-nur-diff, .vt .vt-nur-claims, .vt .vt-nur-hinweise, .vt .vt-nur-kommentare { display:none; }
.vt.s-diff .vt-nur-diff, .vt.s-claims .vt-nur-claims, .vt.s-hinweise .vt-nur-hinweise, .vt.s-kommentare .vt-nur-kommentare { display:block; }
.vt-popover { position:absolute; z-index:6; max-width:420px; background:#fff; border:1px solid #999; box-shadow:0 4px 16px rgba(0,0,0,.15); padding:10px 14px; font-family:system-ui, sans-serif; font-size:14px; }
.vt-popover p { margin:6px 0; } .vt-popover ul { padding-left:18px; margin:6px 0; }
.vt-popover-zu { float:right; border:0; background:transparent; color:var(--muted); font-size:18px; padding:0 4px; cursor:pointer; }
.vt-editor { margin-top:10px; }
.vt.editor-aktiv .vt-seite { opacity:.5; }
#kommentar-knopf { position:absolute; z-index:5; }
.vt-entscheid { margin-top:10px; padding-top:8px; border-top:1px solid var(--line); display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.vt-entscheid input { flex:1 1 160px; font-size:13px; padding:4px 6px; }
.vt-ki { margin-top:8px; padding-top:8px; border-top:1px dashed var(--line); font-family:system-ui, sans-serif; font-size:14px; }
.hinweis-inline { margin-top:8px; font-family:system-ui, sans-serif; font-size:14px; }
.hinweis-inline textarea { min-height:56px; }
.hinweis-inline .zeile { margin-top:6px; align-items:center; }
.hinweis-inline select { width:auto; font-size:13px; padding:4px 6px; }
:target { outline:2px solid var(--accent); outline-offset:3px; }
.schema { background:#fff; border:1px solid var(--line); padding:14px 18px; margin:12px 0 18px; font-family:system-ui, sans-serif; font-size:14px; }
.schema-schritte { display:flex; align-items:stretch; gap:10px; flex-wrap:wrap; }
.schema-schritt { flex:1 1 220px; display:flex; gap:10px; background:var(--bg); border:1px solid var(--line); border-radius:6px; padding:10px 12px; }
.schema-nr { flex:0 0 28px; height:28px; border-radius:50%; background:var(--accent); color:#fff; font-weight:700; display:flex; align-items:center; justify-content:center; }
.schema-pfeil { align-self:center; color:var(--muted); font-size:22px; }
@media (max-width:900px) { .schema-pfeil { display:none; } }
.schema-text { margin:12px 0 0; color:var(--fg); }
.val-karte .val-block { margin:8px 0; padding:8px 12px; border-left:3px solid var(--line); font-family:system-ui, sans-serif; font-size:14px; }
.val-karte .val-block .text { font-family:Georgia, serif; font-size:16px; margin:2px 0 4px; }
.val-titel { font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); font-weight:600; margin-bottom:2px; }
.val-recherche { border-left-color:var(--gruen); } .val-entwurf { border-left-color:#5560c0; } .val-pruefung { border-left-color:var(--gelb); }
.val-zitat { margin:4px 0; padding:8px 12px; background:var(--bg); font-family:Georgia, serif; font-size:15px; line-height:1.55; }
.val-zitat mark { background:var(--mark); }
.vt.s-hinweise .hinweis-marke.vorschlag { background:#5560c0; }
.vt.s-hinweise .hinweis-marke.an-autor { background:var(--rot); }
.vt .hinweis-anker { border-bottom:0; } .vt.s-hinweise .hinweis-anker { border-bottom:2px dashed var(--gelb); }
.vorschlag { display:block; margin:4px 0 0 22px; padding:6px 10px; background:#eef0ff; border-left:3px solid #5560c0; font-family:system-ui, sans-serif; font-size:14px; }
.vt-popover .vorschlag { margin:6px 0; }
.val-vorschlag { border-left-color:#5560c0; background:#f4f5ff; }
.zugangslink { color:var(--accent); text-decoration:underline dotted; }
.gate { background:var(--gelb-bg); border:2px solid var(--gelb); padding:12px 18px; margin:14px 0; font-family:system-ui, sans-serif; font-size:14px; }
.gate h2 { margin-top:4px; border:0; }
.gate-punkt { background:#fff; border:1px solid var(--line); padding:8px 12px; margin:8px 0; }
.gate-punkt label { display:block; margin:4px 0 0; }
.val-vorrunde { border-left-color:var(--rot); }
.quellen-delta { background:#fff; border:1px solid var(--line); padding:10px 14px; margin:10px 0; font-family:system-ui, sans-serif; font-size:14px; }
.quellen-delta ul { margin:6px 0; padding-left:18px; }
tr.platzhalter td { color:var(--muted); }

.badge-test { display:inline-block; vertical-align:middle; font-size:11px; letter-spacing:.06em; padding:2px 8px; border-radius:4px; background:#F6ECD8; color:#8A5A0B; border:1px solid #8A5A0B; margin-left:8px; font-weight:600; }

.kilauf { background:#f7f8f6; border:1px solid #dce0dc; border-radius:8px; padding:8px 12px; margin:8px 0; } .kilauf > summary { cursor:pointer; font-weight:600; } .kilauf ul, .kilauf ol { margin:4px 0; padding-left:18px; }

.ev.zurueckgenommen { opacity:.6; } .ev.zurueckgenommen > div:last-child { text-decoration:line-through; text-decoration-color:#8A5A0B; } .ev.zurueckgenommen .hinweis { text-decoration:none; } .badge.kennzeichen { background:#F6ECD8; color:#8A5A0B; border:1px solid #8A5A0B; }

.vt .aend-marke { display:none; font-size:11px; font-family:ui-monospace, monospace; background:#E3EAF4; color:#2F4E78; border:1px solid #2F4E78; border-radius:4px; padding:1px 6px; margin-right:6px; cursor:pointer; vertical-align:middle; }
.vt.s-aenderungen .aend-marke { display:inline-block; } .vt.s-aenderungen .aend { border-left:3px solid #2F4E78; padding-left:8px; }
