/* Berichtsserver – Adonis/KMPC-Design. Farben als Tokens, Hell und Dunkel. */
@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/static/fira-code.woff2') format('woff2'); }

:root {
  --gruen: #85BD21; --gruen-text: #4f7310; --gruen-tief: #3b570b; --gruen-weich: #eef5e0;
  --tinte: #111111; --grau: #666666; --haar: #e8e8e4; --off: #f8f8f6; --flaeche: #ffffff;
  --auswahl: #dbe9ff; --warn: #a3480f; --schatten: 0 8px 24px rgba(0,0,0,.14);
  --sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Fira Code', 'SF Mono', ui-monospace, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dunkel"] {
  --gruen: #8fc92a; --gruen-text: #a9d65a; --gruen-tief: #c3e48a; --gruen-weich: #1c2610;
  --tinte: #f2f2f0; --grau: #a3a39e; --haar: #2a2a28; --off: #0d0d0c; --flaeche: #141413; --auswahl: #1d3150;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    --gruen: #8fc92a; --gruen-text: #a9d65a; --gruen-tief: #c3e48a; --gruen-weich: #1c2610;
    --tinte: #f2f2f0; --grau: #a3a39e; --haar: #2a2a28; --off: #0d0d0c; --flaeche: #141413; --auswahl: #1d3150;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--off); color: var(--tinte); font: 400 16px/1.6 var(--sans); }
a { color: var(--gruen-text); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gruen); outline-offset: 2px; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12px; }
.mono-label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--grau); margin: 0; }
.gedaempft { color: var(--grau); }
.klein { font-size: 13px; }
.fehlertext { color: var(--warn); }

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo img { display: block; height: 30px; width: auto; }
.logo-dunkel { display: none !important; }
:root[data-theme="dunkel"] .logo-hell { display: none !important; }
:root[data-theme="dunkel"] .logo-dunkel { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) .logo-hell { display: none !important; }
  :root:not([data-theme="hell"]) .logo-dunkel { display: block !important; }
}
.marke-gross .logo { gap: 14px; }
.marke-gross .logo img { height: 44px; }
.welle { display: block; width: 100%; height: 12px; margin-top: 24px; }
.welle path { fill: none; stroke: var(--gruen); stroke-width: 2; }
.marke { display: flex; align-items: center; gap: 10px; }
.marke .mono { letter-spacing: .18em; text-transform: uppercase; color: var(--grau); font-size: 11px; }

/* Einzelkarten: Start, Link, Fehler */
.mitte { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px; }
.karte-gross { width: 100%; max-width: 520px; background: var(--flaeche); border: 1px solid var(--haar); border-radius: 4px; padding: 40px; }
.karte-gross h1 { margin: 28px 0 0; font-size: 32px; line-height: 1.15; font-weight: 200; letter-spacing: -.01em; }
.karte-gross p { margin: 12px 0 0; }
.karte-gross .klein { margin-top: 24px; }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--haar); border-radius: 4px; background: var(--flaeche); cursor: pointer; text-decoration: none; font-size: 14px; }
.knopf:hover { border-color: var(--gruen); }
.knopf-haupt { background: var(--gruen); border-color: var(--gruen); color: #111111; font-weight: 600; }
.knopf-haupt:hover { background: #77aa1d; }
.knopf-akzent { min-height: 36px; border-color: var(--gruen); background: var(--gruen-weich); color: var(--gruen-tief); font-weight: 600; font-size: 13px; }
.knopf-akzent svg path { fill: none; stroke: currentColor; stroke-width: 1.4; }
.knopf-klein { min-height: 32px; padding: 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gruen-tief); }
.knopf[disabled] { opacity: .55; cursor: not-allowed; }

/* Kopfleiste */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 10px 20px; background: var(--flaeche); border-bottom: 1px solid var(--haar); position: sticky; top: 0; z-index: 5; }
.trenner { width: 1px; height: 24px; background: var(--haar); }
.titelzeile { display: flex; align-items: center; gap: 12px; flex: 1 1 360px; min-width: 0; }
.titel { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.auswahl { height: 32px; padding: 0 8px; border: 1px solid var(--haar); border-radius: 4px; background: var(--flaeche); font-family: var(--mono); font-size: 12px; }
.pille { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 5px 10px; border-radius: 4px; background: var(--gruen-weich); color: var(--gruen-tief); white-space: nowrap; }
.pille.ende { background: var(--gruen); color: #111111; }
.pille.grau { background: var(--off); color: var(--grau); border: 1px solid var(--haar); }
.werkzeuge { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.umschalter { display: flex; border: 1px solid var(--haar); border-radius: 4px; overflow: hidden; }
.umschalter button { height: 32px; padding: 0 10px; border: 0; background: var(--flaeche); color: var(--grau); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.umschalter button + button { border-left: 1px solid var(--haar); }
.umschalter button.aktiv { background: var(--gruen-weich); color: var(--gruen-tief); }
.kuerzel { border: 0; padding: 0; cursor: pointer; font-family: inherit; width: 32px; height: 32px; border-radius: 50%; background: var(--tinte); color: var(--flaeche); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* Arbeitsfläche */
.arbeitsflaeche { flex: 1 1 auto; display: flex; flex-wrap: wrap; min-height: 0; }
.lesebereich { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.blattrahmen { flex: 1 1 auto; padding: 24px; display: flex; justify-content: center; }
#inhalt { width: 100%; max-width: 960px; min-height: 70vh; border: 0; border-radius: 4px; background: #ece8dd; display: block; }
.seitenleiste { flex: 1 1 340px; max-width: 400px; background: var(--flaeche); border-left: 1px solid var(--haar); padding: 20px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 57px; align-self: flex-start; max-height: calc(100vh - 57px); overflow-y: auto; }
.app.ohne-leiste .seitenleiste { display: none; }
.seitenleiste-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seitenleiste h2 { margin: 0; font-size: 16px; font-weight: 600; }
.filter button { border: 0; background: transparent; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; color: var(--grau); }
.filter button.aktiv { background: var(--gruen-weich); color: var(--gruen-tief); }

/* Anmerkungen */
.anmerkungsliste { display: flex; flex-direction: column; gap: 12px; }
.anmerkung { border: 1px solid var(--haar); border-radius: 4px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--flaeche); }
.anmerkung.aktiv { border-color: var(--gruen); }
.anmerkung.verwaist .zitat::after { content: ' · Stelle in dieser Version nicht gefunden'; font-style: normal; }
.zitat { margin: 0; padding: 6px 8px; background: var(--off); border-radius: 4px; font-size: 13px; font-style: italic; color: var(--grau); cursor: pointer; }
.autor { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.autor .kreis { width: 24px; height: 24px; border-radius: 50%; background: var(--grau); color: #ffffff; font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.autor .kreis.kmpc { background: var(--gruen); color: #111111; }
.autor strong { font-size: 13px; }
.autor span { font-size: 12px; color: var(--grau); }
.anmerkung p.text { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.antworten { display: flex; flex-direction: column; gap: 8px; margin-left: 12px; padding-left: 12px; border-left: 2px solid var(--haar); }
.zeile { display: flex; gap: 8px; flex-wrap: wrap; }
.eingabe-feld { display: flex; flex-direction: column; gap: 4px; }
.eingabe-feld label { font-size: 12px; color: var(--grau); }
textarea, input[type="text"] { width: 100%; padding: 8px 10px; border: 1px solid var(--haar); border-radius: 4px; background: var(--flaeche); font-size: 14px; }
textarea { min-height: 64px; resize: vertical; }
#neue-anmerkung { border: 1px solid var(--gruen); border-radius: 4px; padding: 12px; background: var(--off); display: flex; flex-direction: column; gap: 8px; }
#neue-anmerkung[hidden] { display: none; }

.verlauf ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.verlauf time { font-family: var(--mono); font-size: 11px; color: var(--grau); white-space: nowrap; }

/* Entscheidungsleiste: eine Zeile, nur Freigabe oder Abnahme */
.entscheidungsleiste { position: sticky; bottom: 0; z-index: 4; background: var(--flaeche); border-top: 1px solid var(--haar); padding: 14px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.entscheidungsleiste[hidden] { display: none; }
.leiste-text { flex: 1 1 360px; min-width: 0; }
.leiste-text p { margin: 2px 0 0; }
.leiste-text .haupt { font-size: 16px; font-weight: 600; }
.optionen { display: flex; gap: 8px; flex-wrap: wrap; }
.verweis { border: 0; padding: 0; background: none; color: var(--gruen-text); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.akzent { color: var(--gruen-text); }
.warnung { color: var(--warn); margin: 0; }

/* Reiter der Seitenleiste */
.reiter { display: flex; gap: 4px; border-bottom: 1px solid var(--haar); }
.reiter button { flex: 1 1 0; border: 0; background: none; padding: 8px 6px 10px; font-size: 14px; font-weight: 600; color: var(--grau); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.reiter button[aria-selected="true"] { color: var(--tinte); border-bottom-color: var(--gruen); }
.reiter .zahl { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--off); border: 1px solid var(--haar);
  font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 18px; }
.reiter button[aria-selected="true"] .zahl { background: var(--gruen-weich); border-color: var(--gruen); color: var(--gruen-tief); }
.tafel { display: flex; flex-direction: column; gap: 12px; }
.tafel[hidden] { display: none; }

/* Fragen */
.fragekarte { border: 1px solid var(--haar); border-radius: 4px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--flaeche); }
.fragekarte p { margin: 0; }
.fragekarte .haupt { font-size: 15px; font-weight: 600; line-height: 1.4; }
.fragekarte .empfehlung { color: var(--grau); line-height: 1.5; }
.fragekarte .empfehlung strong { color: var(--tinte); font-weight: 600; }
.fragekarte.erledigt { background: var(--off); }
.fragekarte .gewaehlt { font-size: 14px; font-weight: 600; color: var(--gruen-tief); }
.fragekarte .gewaehlt::before { content: '✓ '; }
.fragekarte .text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.wahlen { display: flex; flex-direction: column; gap: 6px; }
.wahl { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--haar); border-radius: 4px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.wahl:hover { border-color: var(--gruen); }
.wahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wahl .punkt { flex: none; width: 18px; height: 18px; margin-top: 1px; border: 1.5px solid var(--grau); border-radius: 50%; background: var(--flaeche); }
.wahl .wahl-text { flex: 1 1 auto; min-width: 0; }
.wahl .marke-empf { flex: none; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--gruen-tief);
  background: var(--gruen-weich); padding: 2px 6px; border-radius: 4px; margin-top: 1px; }
.wahl:has(input:checked) { border-color: var(--gruen); background: var(--gruen-weich); }
.wahl input:checked + .punkt { border-color: var(--gruen); box-shadow: inset 0 0 0 4px var(--flaeche); background: var(--gruen); }
.wahl input:focus-visible + .punkt { outline: 2px solid var(--gruen); outline-offset: 2px; }

/* Haken im eigenen Stil */
.haken { position: relative; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.haken input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.haken .kasten { flex: none; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--grau); border-radius: 4px; background: var(--flaeche);
  display: flex; align-items: center; justify-content: center; }
.haken .kasten::after { content: ''; width: 10px; height: 5px; border: solid #111111; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.haken input:checked + .kasten { background: var(--gruen); border-color: var(--gruen); }
.haken input:checked + .kasten::after { opacity: 1; }
.haken input:focus-visible + .kasten { outline: 2px solid var(--gruen); outline-offset: 2px; }

/* Dialog */
.dialog-hintergrund { position: fixed; inset: 0; background: rgba(17,17,17,.55); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px; z-index: 20; }
.dialog-hintergrund[hidden] { display: none; }
.dialog { width: 100%; max-width: 520px; background: var(--flaeche); border-radius: 4px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--schatten); }
.dialog h2 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 300; }
.dialog .zusammenfassung { background: var(--off); border: 1px solid var(--haar); border-radius: 4px; padding: 12px 14px; font-size: 14px; }
.dialog .zusammenfassung p { margin: 2px 0; }
.dialog .zwei { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dialog .aktionen { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.anmerken-knopf { position: absolute; z-index: 6; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 4px; background: #111111; color: #ffffff; font-size: 13px; font-weight: 600; cursor: pointer; }
.meldung { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111111; color: #ffffff; padding: 10px 16px; border-radius: 4px; font-size: 14px; z-index: 30; }
.meldung[hidden] { display: none; }

@media (max-width: 760px) {
  .leiste { padding: 10px 12px; }
  .trenner, .marke .mono { display: none; }
  .blattrahmen { padding: 12px; }
  .seitenleiste { max-width: none; border-left: 0; border-top: 1px solid var(--haar); position: static; max-height: none; }
  .entscheidungsleiste { padding: 12px; }
  .entscheidung .optionen { width: 100%; }
  .entscheidung .optionen .knopf { flex: 1 1 auto; }
  .dialog .zwei { grid-template-columns: 1fr; }
}
@media print { .leiste, .seitenleiste, .entscheidungsleiste { display: none; } }
