/* ReportX – Aussehen nach der Marke innovation.today (Navy #14304A, Teal #0F766E), zuerst fürs Handy. */
@font-face {
  font-family: "Nunito";
  src: url("/marke/Nunito-Variable.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --navy: #14304a;
  --teal: #0f766e;
  --grund: #f4f6f8;
  --flaeche: #ffffff;
  --text: #14243a;
  --leise: #5b6b7d;
  --linie: #d9e0e7;
  --akzent: #0f766e;
  --akzent-text: #ffffff;
  --gut: #1b7f4b;
  --mittel: #a76a00;
  --kritisch: #b3261e;
  --gut-fl: #e3f4ea;
  --mittel-fl: #fdf0d5;
  --kritisch-fl: #fde4e1;
  --schatten: 0 1px 2px rgba(20, 48, 74, .08), 0 4px 14px rgba(20, 48, 74, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0c1b2c;
    --flaeche: #13283f;
    --text: #e8eef4;
    --leise: #9db0c3;
    --linie: #27405a;
    --akzent: #5eead4;
    --akzent-text: #0c1b2c;
    --gut: #6fd39b;
    --mittel: #f2c261;
    --kritisch: #ff8a80;
    --gut-fl: #143a29;
    --mittel-fl: #40300c;
    --kritisch-fl: #4a1c19;
    --schatten: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text);
  background: var(--grund);
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 800; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
h4 { font-size: .9rem; margin: .9rem 0 .2rem; color: var(--leise); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 .6rem; }
a { color: var(--akzent); }
.leise { color: var(--leise); }
.klein { font-size: .86rem; }

/* Kopf */
#kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .6rem;
  padding: calc(.5rem + env(safe-area-inset-top)) .9rem .5rem;
  background: var(--navy); color: #fff;
}
#kopf a.zurueck { color: #fff; text-decoration: none; font-size: 1.5rem; line-height: 1; padding: .2rem .5rem .3rem 0; min-width: 44px; }
#kopf .titel { flex: 1; min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#kopf .titel small { display: block; font-weight: 500; opacity: .75; font-size: .75rem; }
#kopf img { height: 22px; }
.stand { font-size: .78rem; font-weight: 700; padding: .25rem .6rem; border-radius: 99px; white-space: nowrap; background: rgba(255, 255, 255, .14); }
.stand.wartet { background: #f2c261; color: #2b1d00; }
.stand.konflikt { background: #ff8a80; color: #3b0b07; }

#leiste:empty { display: none; }
#leiste { background: var(--kritisch-fl); color: var(--text); padding: .7rem .9rem; border-bottom: 1px solid var(--linie); }
#leiste .knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

main { max-width: 760px; margin: 0 auto; padding: .9rem .9rem 5rem; }

/* Karten und Listen */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: .9rem; margin-bottom: .8rem; box-shadow: var(--schatten); }
.karte > :last-child { margin-bottom: 0; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { border-top: 1px solid var(--linie); }
.liste > li:first-child { border-top: 0; }
.liste a.zeile, .liste button.zeile {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%;
  min-height: 52px; padding: .6rem .1rem; color: inherit; text-decoration: none; text-align: left;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: .8rem; }
.kacheln a {
  display: flex; flex-direction: column; justify-content: center; min-height: 76px; padding: .7rem .8rem;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; box-shadow: var(--schatten);
  color: inherit; text-decoration: none; font-weight: 800;
}
.kacheln a small { font-weight: 500; color: var(--leise); }
.kacheln a.haupt { background: var(--akzent); color: var(--akzent-text); border-color: transparent; grid-column: 1 / -1; }
.kacheln a.haupt small { color: inherit; opacity: .85; }

/* Eingaben */
label.feld { display: block; margin-bottom: .7rem; }
label.feld > span { display: block; font-size: .82rem; font-weight: 700; color: var(--leise); margin-bottom: .2rem; }
input, select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 10px; padding: .6rem .7rem; min-height: 46px;
}
textarea { resize: vertical; min-height: 5.2rem; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--akzent); }
label.haken { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

button {
  font: inherit; font-weight: 800; min-height: 46px; padding: .55rem 1rem; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text);
}
button.haupt { background: var(--akzent); border-color: transparent; color: var(--akzent-text); }
button.gefahr { color: var(--kritisch); border-color: var(--kritisch); }
button.schlicht { border-color: transparent; background: none; color: var(--akzent); padding-inline: .3rem; }
button:disabled { opacity: .5; cursor: default; }
.knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; }
.knoepfe.rechts { justify-content: flex-end; }
a.knopf { display: inline-flex; align-items: center; min-height: 46px; padding: .55rem .3rem; font-weight: 800; text-decoration: none; }
.zeilenkopf { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }

/* Umschalter (Belegstufe, Urteil, Dringlichkeit) */
.umschalter { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .35rem; margin-bottom: .7rem; }
.umschalter button { padding: .5rem .25rem; min-height: 50px; font-size: .92rem; }
.umschalter button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.umschalter button.gut[aria-pressed="true"] { background: var(--gut-fl); color: var(--gut); border-color: var(--gut); }
.umschalter button.mittel[aria-pressed="true"] { background: var(--mittel-fl); color: var(--mittel); border-color: var(--mittel); }
.umschalter button.kritisch[aria-pressed="true"] { background: var(--kritisch-fl); color: var(--kritisch); border-color: var(--kritisch); }
@media (prefers-color-scheme: dark) {
  .umschalter button[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
}

/* Marken */
.marke { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .02em; padding: .12rem .5rem; border-radius: 99px; border: 1px solid var(--linie); color: var(--leise); white-space: nowrap; }
.marke.muss { background: var(--navy); color: #fff; border-color: var(--navy); }
.marke.gut, .marke.belegt { color: var(--gut); border-color: var(--gut); background: var(--gut-fl); }
.marke.mittel, .marke.vorgefuehrt { color: var(--mittel); border-color: var(--mittel); background: var(--mittel-fl); }
.marke.kritisch { color: var(--kritisch); border-color: var(--kritisch); background: var(--kritisch-fl); }
.marke.behauptet { border-style: dashed; }
.marke.recht { color: var(--mittel); border-color: var(--mittel); }

/* Durchlauf */
.dl-kopf { position: sticky; top: 0; z-index: 15; background: var(--navy); color: #fff; margin: -.9rem -.9rem .8rem; padding: .55rem .9rem .6rem; }
.dl-kopf.ueberzogen { background: #7a2a12; }
.dl-kopf button { background: rgba(255, 255, 255, .14); color: #fff; border-color: transparent; min-height: 40px; padding: .3rem .7rem; }
.dl-kopf .oben { display: flex; align-items: center; gap: .5rem; }
.dl-kopf .abschnitt { flex: 1; min-width: 0; text-align: left; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; padding-left: 0; }
.dl-kopf .zeiten { display: flex; justify-content: space-between; gap: .6rem; font-size: .84rem; font-variant-numeric: tabular-nums; opacity: .92; margin-top: .25rem; }
.balken { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; margin-top: .4rem; }
.balken > i { display: block; height: 100%; background: #5eead4; }
.hinweis { border-radius: 10px; padding: .6rem .7rem; margin-bottom: .7rem; background: var(--mittel-fl); border: 1px solid var(--mittel); }
.frage-text { font-size: 1.2rem; font-weight: 800; line-height: 1.28; margin: .3rem 0 .6rem; }
dl.hilfen { margin: 0 0 .8rem; display: grid; gap: .35rem; }
dl.hilfen > div { display: grid; grid-template-columns: 6.2rem 1fr; gap: .5rem; font-size: .92rem; line-height: 1.35; }
.nach { display: block; }
.warum { color: var(--leise); font-size: .9rem; margin: -.3rem 0 .6rem; }
dl.hilfen dt { font-weight: 800; color: var(--leise); }
dl.hilfen dd { margin: 0; }
dl.hilfen .warn dt { color: var(--kritisch); }
.fotos { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.fotos img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linie); }
.dl-fuss {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; gap: .5rem;
  padding: .55rem .9rem calc(.55rem + env(safe-area-inset-bottom)); background: var(--flaeche); border-top: 1px solid var(--linie);
}
.dl-fuss button { flex: 1; }
.dl-fuss button.haupt { flex: 2; }
table.tf { width: 100%; border-collapse: collapse; margin-bottom: .6rem; font-size: .9rem; }
table.tf th, table.tf td { border: 1px solid var(--linie); padding: .25rem; vertical-align: top; text-align: left; }
table.tf input, table.tf select { min-height: 40px; padding: .3rem .4rem; border: 0; }

/* Bewertung */
.zaehler { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin: .5rem 0 .7rem; text-align: center; }
.zaehler div { border: 1px solid var(--linie); border-radius: 10px; padding: .35rem .2rem; font-size: .76rem; color: var(--leise); }
.zaehler b { display: block; font-size: 1.2rem; color: var(--text); }
.noten { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; margin-bottom: .7rem; }
.noten button { padding: .3rem 0; min-height: 44px; font-variant-numeric: tabular-nums; }
.noten button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.gesamt { display: flex; align-items: baseline; gap: .7rem; }
.gesamt .zahl { font-size: 2.6rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.gesamt .zahl.schlecht { color: var(--kritisch); }
table.noten-tab { width: 100%; border-collapse: collapse; }
table.noten-tab td { padding: .35rem 0; border-top: 1px solid var(--linie); }
table.noten-tab td:last-child { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.noten-tab tr.schlecht td:last-child { color: var(--kritisch); }

.befund { border-left: 4px solid var(--linie); padding: .2rem 0 .2rem .7rem; margin-bottom: .7rem; }
.befund.kritisch { border-color: var(--kritisch); }
.befund.mittel { border-color: var(--mittel); }
.befund.gut { border-color: var(--gut); }

details > summary { cursor: pointer; min-height: 46px; display: flex; align-items: center; gap: .5rem; font-weight: 700; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details:not(.karte) > summary { align-items: flex-start; padding: .55rem 0; border-top: 1px solid var(--linie); font-weight: 600; font-size: .97rem; }
details:not(.karte) > summary .marke { margin-top: .15rem; }
details:not(.karte)[open] > summary { font-weight: 800; }
details > summary .text { flex: 1; min-width: 0; }
details.gesperrt > summary .text { text-decoration: line-through; color: var(--leise); }

/* Einstellungen und KI-Vorschläge */
.liste div.zeile { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .1rem; }
code, input.token { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; overflow-wrap: anywhere; }
input.token { margin: .5rem 0; }
.knoepfe + label.feld { margin-top: .7rem; }
.ki { margin-bottom: .7rem; }
.ki:empty { display: none; }
.vorschlaege { margin-top: .8rem; border-top: 1px solid var(--linie); padding-top: .8rem; }
.vorschlag { border-left: 4px solid var(--linie); padding: .2rem 0 .2rem .7rem; margin-bottom: .9rem; }
.vorschlag.unbelegt { border-color: var(--kritisch); }
.vorschlag blockquote { margin: 0 0 .6rem; padding: .4rem .6rem; border-radius: 8px; background: var(--grund); font-size: .92rem; overflow-wrap: anywhere; }
.vorschlag.unbelegt blockquote { background: var(--kritisch-fl); }
.vorschlag .knoepfe { align-items: center; }
.vorzeile { white-space: pre-wrap; }

.meldung {
  position: fixed; left: 50%; bottom: calc(5rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  max-width: 90vw; padding: .6rem 1rem; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 700; box-shadow: var(--schatten);
}
.meldung.fehler { background: var(--kritisch); }
dialog { border: 1px solid var(--linie); border-radius: 14px; padding: 1rem; max-width: min(92vw, 560px); width: 100%; background: var(--flaeche); color: var(--text); }
dialog::backdrop { background: rgba(10, 20, 35, .55); }

@media (min-width: 700px) {
  .kacheln { grid-template-columns: repeat(3, 1fr); }
  .dl-fuss { position: static; padding: 0; border: 0; background: none; margin-top: 1rem; }
  main { padding-bottom: 2rem; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background-color .12s, border-color .12s; }
}
