/* Marktpotenzialprüfung: Farben wie beim Aufgaben Board */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --seite: #fbfbfd;
  --karte: #ffffff;
  --karte-rand: #dcdfe4;
  --flaeche: #f4f5f7;
  --flaeche-stark: #e7e9ee;
  --text: #172b4d;
  --leise: #5b6b86;
  --linie: #dfe1e6;
  --akzent: #0c66e4;
  --akzent-hover: #0055cc;
  --akzent-text: #ffffff;
  --link: #0055cc;
  --eingabe: #ffffff;
  --eingabe-rand: #b3bac6;
  --fokus: #1d7afc;
  --knopf-hover: #eef0f4;
  --rot: #ae2e24;   --rot-hell: #ffeceb;   --rot-linie: #e2483d;
  --gruen: #1f845a; --gruen-hell: #dcfff1; --gruen-text: #164b35;
  --gelb: #7f5f01;  --gelb-hell: #fff7d6;  --gelb-linie: #f5b800;
  --blau-hell: #e9f2ff; --blau-text: #09326c;
  --grau-hell: #f1f2f4; --grau-text: #44546f;
  --schatten: 0 1px 1px rgba(9, 30, 66, .18), 0 0 1px rgba(9, 30, 66, .24);
  --schatten-hoch: 0 6px 16px rgba(9, 30, 66, .16), 0 0 1px rgba(9, 30, 66, .3);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --seite: #15191d;
  --karte: #22272b;
  --karte-rand: #3a444e;
  --flaeche: #1d2125;
  --flaeche-stark: #2c333a;
  --text: #dee4ea;
  --leise: #9fadbc;
  --linie: #38414a;
  --akzent: #579dff;
  --akzent-hover: #85b8ff;
  --akzent-text: #101214;
  --link: #85b8ff;
  --eingabe: #1d2125;
  --eingabe-rand: #596773;
  --fokus: #85b8ff;
  --knopf-hover: #2c333a;
  --rot: #fd9891;   --rot-hell: #42221f;   --rot-linie: #f15b50;
  --gruen: #7ee2b8; --gruen-hell: #1c3329; --gruen-text: #baf3db;
  --gelb: #f8e6a0;  --gelb-hell: #332e1b;  --gelb-linie: #cf9f02;
  --blau-hell: #1c2b41; --blau-text: #cce0ff;
  --grau-hell: #2c333a; --grau-text: #b6c2cf;
  --schatten: 0 1px 1px rgba(0, 0, 0, .5), 0 0 1px rgba(0, 0, 0, .5);
  --schatten-hoch: 0 6px 16px rgba(0, 0, 0, .5), 0 0 1px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--seite);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; margin-top: 1.2em; }
p { margin: 0 0 .8em; }
.leise { color: var(--leise); }
.klein { font-size: .9rem; }
.versteckt { display: none !important; }

/* Kopfzeile */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px max(16px, calc((100vw - 1100px) / 2));
  background: var(--karte); border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); margin-right: auto; }
.marke img { height: 34px; width: auto; display: block; }
.marke .logo-dunkel { display: none; }
:root[data-theme="dark"] .marke .logo-hell { display: none; }
:root[data-theme="dark"] .marke .logo-dunkel { display: block; }
.marke-text { display: flex; flex-direction: column; line-height: 1.15; }
.marke-text strong { font-size: 1.05rem; }
.marke-text span { font-size: .85rem; color: var(--leise); }
.kopf-rechts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }

/* Knöpfe */
button, .knopf {
  font: inherit; font-size: .95rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 8px; min-height: 42px;
  border: 1px solid var(--eingabe-rand); background: var(--karte); color: var(--text); text-decoration: none;
}
button:hover, .knopf:hover { background: var(--knopf-hover); }
button.haupt, .knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 600; }
button.haupt:hover, .knopf.haupt:hover { background: var(--akzent-hover); }
button.gross, .knopf.gross { font-size: 1.05rem; padding: 12px 22px; min-height: 50px; }
button.gefahr { color: var(--rot); border-color: var(--rot-linie); }
button.schlicht { border-color: transparent; background: transparent; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }

/* Karten und Listen */
.karte { background: var(--karte); border: 1px solid var(--karte-rand); border-radius: 12px; padding: 20px; box-shadow: var(--schatten); }
.karte + .karte { margin-top: 16px; }
.leiste { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 20px; }
.leiste h1 { margin: 0; }

.liste { display: grid; gap: 12px; }
.eintrag {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center;
  padding: 16px 18px; border-radius: 12px; background: var(--karte); border: 1px solid var(--karte-rand);
  box-shadow: var(--schatten); color: var(--text); text-decoration: none;
}
.eintrag:hover { box-shadow: var(--schatten-hoch); }
.eintrag-titel { font-size: 1.1rem; font-weight: 650; }
.eintrag-info { color: var(--leise); font-size: .92rem; }
.eintrag-rechts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .eintrag { grid-template-columns: 1fr; }
  .eintrag-rechts { justify-content: flex-start; }
}

.leer { text-align: center; padding: 48px 20px; color: var(--leise); }

/* Marken (Chips) */
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: var(--grau-hell); color: var(--grau-text);
}
.chip.gruen { background: var(--gruen-hell); color: var(--gruen-text); }
.chip.gelb { background: var(--gelb-hell); color: var(--gelb); }
.chip.rot { background: var(--rot-hell); color: var(--rot); }
.chip.blau { background: var(--blau-hell); color: var(--blau-text); }
.chip.rahmen { background: transparent; border: 1px solid var(--linie); }

/* Formular */
.formular { display: grid; gap: 18px; }
.feld label, .feld .bezeichnung { display: block; font-weight: 600; margin-bottom: 6px; }
.feld .hilfe { color: var(--leise); font-size: .9rem; margin: 4px 0 0; }
input[type=text], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--eingabe);
  border: 1px solid var(--eingabe-rand); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 150px; resize: vertical; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .zwei { grid-template-columns: 1fr; } }

.ablage {
  border: 2px dashed var(--eingabe-rand); border-radius: 12px; padding: 26px 18px; text-align: center;
  background: var(--flaeche); cursor: pointer;
}
.ablage.ueber { border-color: var(--akzent); background: var(--blau-hell); }
.ablage strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.ablage input { display: none; }
.check { display: flex; gap: 10px; align-items: center; }
.check input { width: 20px; height: 20px; }

.hinweis { border-radius: 10px; padding: 14px 16px; background: var(--blau-hell); color: var(--blau-text); margin-bottom: 18px; }
.hinweis.gelb { background: var(--gelb-hell); color: var(--gelb); }
.hinweis.rot { background: var(--rot-hell); color: var(--rot); }
.hinweis p:last-child { margin-bottom: 0; }

/* Fortschritt */
.schritte { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
@media (max-width: 640px) { .schritte { grid-template-columns: 1fr; } }
.schritt { border-radius: 10px; padding: 14px; border: 1px solid var(--linie); background: var(--flaeche); }
.schritt .nr { font-size: .85rem; color: var(--leise); }
.schritt.aktiv { border-color: var(--akzent); background: var(--blau-hell); }
.schritt.fertig { border-color: var(--gruen); background: var(--gruen-hell); }
.schritt.aktiv strong::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 50%; background: var(--akzent); animation: puls 1.2s infinite; }
@keyframes puls { 50% { opacity: .2; } }
.protokoll { max-height: 280px; overflow: auto; font-size: .9rem; border-top: 1px solid var(--linie); padding-top: 10px; }
.protokoll div { padding: 3px 0; color: var(--leise); }
.protokoll div:first-child { color: var(--text); font-weight: 600; }

/* Bericht */
.bericht-kopf { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.bericht-kopf h1 { margin-bottom: 4px; }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.urteil { border-radius: 14px; padding: 22px; margin: 20px 0; border: 2px solid var(--linie); background: var(--karte); }
.urteil .label { font-size: .9rem; color: var(--leise); text-transform: uppercase; letter-spacing: .04em; }
.urteil .wert { font-size: 1.6rem; font-weight: 750; margin: 2px 0 10px; }
.urteil.gruen { border-color: var(--gruen); background: var(--gruen-hell); }
.urteil.gelb { border-color: var(--gelb-linie); background: var(--gelb-hell); }
.urteil.rot { border-color: var(--rot-linie); background: var(--rot-hell); }
.urteil.grau { border-color: var(--linie); background: var(--grau-hell); }
.urteil p { font-size: 1.05rem; }

.fragen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 760px) { .fragen { grid-template-columns: 1fr; } }
.frage { border: 1px solid var(--karte-rand); border-radius: 12px; padding: 16px; background: var(--karte); }
.frage-kopf { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.frage-kopf strong { font-size: 1.05rem; }
.frage ul { margin: 8px 0 0; padding-left: 20px; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 10px; border-bottom: 1px solid var(--linie); }
th { font-size: .85rem; color: var(--leise); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.tabelle-huelle { overflow-x: auto; border: 1px solid var(--karte-rand); border-radius: 12px; background: var(--karte); }
.tabelle-huelle table tr:last-child td { border-bottom: 0; }

.abschnitt { margin-top: 28px; }
.befund { padding: 10px 0; border-bottom: 1px solid var(--linie); }
.befund:last-child { border-bottom: 0; }
.befund .quellen { font-size: .85rem; margin-top: 4px; word-break: break-word; }
.listen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 12px; }
@media (max-width: 700px) { .listen { grid-template-columns: 1fr; } }
.listen > div { background: var(--flaeche); border-radius: 10px; padding: 12px 16px; }
.listen ul { margin: 6px 0 0; padding-left: 20px; }

.legende { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; color: var(--leise); }
details { border: 1px solid var(--karte-rand); border-radius: 12px; background: var(--karte); padding: 0 18px; margin-top: 14px; }
details > summary { cursor: pointer; padding: 14px 0; font-weight: 650; }
details[open] > summary { border-bottom: 1px solid var(--linie); margin-bottom: 12px; }
details > div { padding-bottom: 16px; }
.dossier { font-size: .95rem; word-break: break-word; }
details.optional { margin-top: 0; }
details.optional .formular { padding-bottom: 18px; }
.ablage { padding: 44px 18px; }
.dossier table { margin: 10px 0; }

.entscheid { display: grid; gap: 12px; }
.meta { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--leise); font-size: .92rem; }

/* Meldung unten */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--seite); padding: 12px 18px; border-radius: 10px; box-shadow: var(--schatten-hoch);
}

/* Druck: nur der Bericht */
@media print {
  :root { --seite: #fff; --karte: #fff; }
  body { font-size: 11pt; background: #fff; color: #000; }
  .kopf, .aktionen, .nicht-drucken, .toast { display: none !important; }
  main { padding: 0; max-width: none; }
  .karte, .eintrag, .frage, .tabelle-huelle, details { box-shadow: none; }
  .abschnitt, .frage, tr { break-inside: avoid; }
  a { color: #000; }
  details > summary { list-style: none; }
}
