:root {
  --bg: #fbf6f1;
  --flaeche: #fffdfa;
  --flaeche-2: #f4ebe1;
  --text: #2a1d14;
  --text-2: #6f5f52;
  --linie: #e8d9ca;
  --akzent: #c2410c;
  --akzent-hell: #ffedd5;
  --ocker: #9a3412;
  --ocker-hell: #fff1e6;
  --rot: #b42318;
  --rot-hell: #fde4e1;
  --gruen: #15803d;
  --gruen-hell: #dcf3e2;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(40, 30, 10, .06), 0 2px 8px rgba(40, 30, 10, .04);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-substrat: #4d7c0f; --r-steril: #0e7490; --r-pilz: #c2410c; --r-wachstum: #b45309; --r-prozess: #7c2d12; --r-probe: #57534e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #19130f;
    --flaeche: #221a14;
    --flaeche-2: #2d231b;
    --text: #f3e9df;
    --text-2: #b3a395;
    --linie: #3d3127;
    --akzent: #fb923c;
    --akzent-hell: #43200d;
    --ocker: #fdba74;
    --ocker-hell: #3a2416;
    --rot: #f28b82;
    --rot-hell: #44201c;
    --gruen: #5fd38a;
    --gruen-hell: #173622;
    --r-substrat: #a3d65c; --r-steril: #5ccbe6; --r-pilz: #fb923c; --r-wachstum: #fbbf24; --r-prozess: #f0a27a; --r-probe: #c8c2bb;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
}
a { color: var(--akzent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; margin: .2em 0 .4em; }
h2 { font-size: 1.3rem; margin: 2rem 0 .7rem; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
.leise { color: var(--text-2); }
.klein { font-size: .875rem; }
.mono { font-family: var(--mono); font-size: .9em; }

/* Kopf */
.kopf {
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 10;
}
.kopf-innen {
  max-width: 1180px; margin: 0 auto; padding: .6rem 16px;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.marke {
  font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: .5rem;
}
.marke svg { color: var(--akzent); }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.nav a {
  color: var(--text); text-decoration: none; padding: .35rem .7rem; border-radius: 7px; font-size: .95rem;
}
.nav a:hover, .nav a.aktiv { background: var(--flaeche-2); }
.nav-rechts { display: flex; gap: .5rem; align-items: center; }
.zaehler {
  background: var(--ocker); color: #fff; border-radius: 99px; font-size: .75rem;
  padding: 0 .45rem; margin-left: .25rem; font-weight: 600;
}

main { max-width: 1180px; margin: 0 auto; padding: 1.5rem 16px 4rem; }
.fuss {
  max-width: 1180px; margin: 0 auto; padding: 1.5rem 16px 3rem; color: var(--text-2);
  font-size: .875rem; border-top: 1px solid var(--linie);
}

/* Knöpfe */
.knopf, button {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  font: inherit; font-size: .95rem; font-weight: 550;
  padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--akzent);
  background: var(--akzent); color: var(--flaeche); text-decoration: none;
}
.knopf:hover, button:hover { filter: brightness(1.08); }
.knopf.sekundaer, button.sekundaer { background: transparent; color: var(--akzent); }
.knopf.klein { padding: .25rem .6rem; font-size: .85rem; }
button.gefahr { background: var(--rot); border-color: var(--rot); }
.knopfreihe { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* Karten und Raster */
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: var(--schatten);
}
.raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.raster-2 { display: grid; gap: 1.5rem; grid-template-columns: 2fr 1fr; }
@media (max-width: 860px) { .raster-2 { grid-template-columns: 1fr; } }

.kennzahlen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0; }
@media (max-width: 700px) { .kennzahlen { grid-template-columns: repeat(2, 1fr); } }
.kennzahl { text-decoration: none; color: inherit; }
.kennzahl strong { display: block; font-size: 2rem; font-weight: 700; color: var(--akzent); font-variant-numeric: tabular-nums; }
.kennzahl span { color: var(--text-2); font-size: .9rem; }

.held {
  padding: 2rem 0 .5rem;
}
.held p { font-size: 1.1rem; max-width: 60ch; color: var(--text-2); }

/* Tabellen */
.tabelle-huelle { overflow-x: auto; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-weight: 600; color: var(--text-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; background: var(--flaeche-2); }
tr:last-child td { border-bottom: 0; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: color-mix(in srgb, var(--flaeche-2) 50%, transparent); }

dl.werte { display: grid; grid-template-columns: minmax(140px, 45%) 1fr; gap: .35rem 1rem; margin: 0; }
dl.werte dt { color: var(--text-2); font-size: .9rem; }
dl.werte dd { margin: 0; font-variant-numeric: tabular-nums; }

/* Etiketten */
.etikett {
  display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 99px;
  background: var(--flaeche-2); color: var(--text-2); white-space: nowrap;
}
.etikett.offen { background: var(--ocker-hell); color: var(--ocker); }
.etikett.angenommen { background: var(--gruen-hell); color: var(--akzent); }
.etikett.abgelehnt { background: var(--rot-hell); color: var(--rot); }

/* Filter / Suche */
.filter { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0 1.25rem; align-items: center; }
.filter input[type=search], .filter select { min-width: 0; flex: 1 1 180px; }

/* Formulare */
input[type=text], input[type=email], input[type=url], input[type=search], input[type=date], input[type=number],
input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text);
  padding: .45rem .6rem; border: 1px solid var(--linie); border-radius: 7px; background: var(--flaeche);
}
input.zahl { font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: -1px; border-color: transparent; }
fieldset { border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); padding: 1rem 1.25rem 1.25rem; margin: 0 0 1.25rem; }
legend { font-weight: 650; padding: 0 .4rem; }
.felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem 1.1rem; }
.feld label { display: block; font-size: .87rem; font-weight: 550; margin-bottom: .25rem; }
.feld .hilfe { font-size: .78rem; color: var(--text-2); margin-top: .2rem; }
.feld.breit { grid-column: 1 / -1; }
.feld.pflicht label::after { content: " *"; color: var(--ocker); }
.feld .fehler, .fehlerliste { color: var(--rot); font-size: .83rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.feld.hat-fehler input, .feld.hat-fehler select, .feld.hat-fehler textarea { border-color: var(--rot); }
.inline-zeile { border-top: 1px dashed var(--linie); padding-top: .9rem; margin-top: .9rem; }
.inline-zeile:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.inline-zeile .loeschen { font-size: .85rem; color: var(--rot); display: flex; gap: .3rem; align-items: center; }
.inline-zeile .loeschen input { width: auto; }
.honig { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Meldungen */
.meldungen { list-style: none; padding: 0; margin: 0 0 1rem; }
.meldungen li { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .5rem; background: var(--akzent-hell); }
.meldungen li.error { background: var(--rot-hell); color: var(--rot); }
.meldungen li.info { background: var(--ocker-hell); }
.hinweis { padding: .9rem 1.1rem; border-radius: var(--radius); background: var(--ocker-hell); border: 1px solid color-mix(in srgb, var(--ocker) 30%, transparent); }

/* Vergleich (Prüfung / Versionen) */
.diff td.alt { color: var(--text-2); }
.diff tr.geaendert td.neu { background: var(--gruen-hell); }
.diff tr.geaendert td.alt { background: var(--rot-hell); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--rot) 50%, transparent); }
.diff ul { margin: 0; padding-left: 1.1rem; }

/* Balken im Eigenschaftsvergleich */
.balken { height: .55rem; background: var(--akzent); border-radius: 0 4px 4px 0; min-width: 2px; opacity: .85; }
.balken-zelle { width: 28%; min-width: 120px; vertical-align: middle; }

.verlauf { list-style: none; padding: 0; margin: 0; }
.verlauf li { padding: .5rem 0; border-bottom: 1px solid var(--linie); font-size: .9rem; }
.verlauf li:last-child { border-bottom: 0; }

.kopfzeile { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.kopfzeile h1 { margin-bottom: .1rem; }
.unter { margin-top: 0; }
.leer { padding: 2rem; text-align: center; color: var(--text-2); }

/* Lange Wörter (DOIs, URLs, Institutionen) dürfen umbrechen; Rasterspalten dürfen schrumpfen */
.raster-2 > *, .raster > * { min-width: 0; }
dl.werte dd, .karte p { overflow-wrap: anywhere; }

/* Auf schmalen Bildschirmen scrollt der Kopf mit, damit Inhalte Platz haben */
@media (max-width: 760px) { .kopf { position: static; } }

/* Suchfeld im Kopf – immer oben rechts */
.kopf-suche { position: relative; }
.kopf-suche input { width: 280px; padding: .38rem .7rem .38rem 2rem; font-size: .88rem; border-radius: 8px; background: var(--bg); }
.kopf-suche svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; stroke: var(--text-2); pointer-events: none; }
.nav a { font-size: .92rem; padding: .32rem .65rem; }
.app .kopf-innen { max-width: none; padding-inline: 20px; }
@media (max-width: 1100px) { .kopf-suche input { width: 200px; } }
@media (max-width: 760px) { .nav-rechts { width: 100%; } .kopf-suche { flex: 1; } .kopf-suche input { width: 100%; } }

/* MycoShare: Logo, Status-Plaketten, Kommentare, Rechtstexte */
.marke { gap: .55rem; font-size: 1.12rem; letter-spacing: -.01em; }
.marke svg { flex: none; }
.marke b { color: var(--akzent); font-weight: 800; }
.plakette { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 650; padding: .1rem .55rem;
  border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.plakette.reviewed { background: var(--gruen-hell); color: var(--gruen); }
.plakette.community { background: var(--akzent-hell); color: var(--ocker); }
.urteil { display: inline-flex; align-items: center; gap: .25rem; font-weight: 650; font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; }
.urteil.richtig { background: var(--gruen-hell); color: var(--gruen); }
.urteil.falsch { background: var(--rot-hell); color: var(--rot); }
.urteil.hinweis { background: var(--flaeche-2); color: var(--text-2); }
.kommentare { display: grid; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.kommentar { border: 1px solid var(--linie); border-left-width: 4px; border-radius: var(--radius); padding: .8rem 1rem; background: var(--flaeche); }
.kommentar.richtig { border-left-color: var(--gruen); }
.kommentar.falsch { border-left-color: var(--rot); }
.kommentar p { margin: .35rem 0 0; }
.kommentar .kopfz { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--text-2); }
.urteil-wahl { display: flex; gap: .5rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.urteil-wahl label { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--linie); border-radius: 999px; padding: .35rem .8rem; cursor: pointer; font-weight: 550; }
.urteil-wahl input { width: auto; }
.urteil-wahl li:nth-child(1) label:has(input:checked) { background: var(--gruen-hell); border-color: var(--gruen); color: var(--gruen); }
.urteil-wahl li:nth-child(2) label:has(input:checked) { background: var(--rot-hell); border-color: var(--rot); color: var(--rot); }
.urteil-wahl li:nth-child(3) label:has(input:checked) { background: var(--flaeche-2); border-color: var(--text-2); }
.rechtstext { max-width: 72ch; }
.rechtstext h2 { font-size: 1.15rem; }
.rechtstext .platzhalter { background: var(--akzent-hell); color: var(--ocker); padding: 0 .3rem; border-radius: 4px; }
details.neu-eig { margin-top: .8rem; }
details.neu-eig summary { cursor: pointer; color: var(--akzent); font-size: .88rem; font-weight: 550; }
details.neu-eig .felder { margin-top: .7rem; }

/* Rezept: Herstellung als Flussdiagramm */
.rezept { margin: 1.4rem 0 .4rem; }
.rezept-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; margin-bottom: .6rem; }
.rezept-kopf h2 { margin: 0; }
.rezept-legende { display: flex; flex-wrap: wrap; gap: .3rem .9rem; list-style: none; margin: 0 0 0 auto; padding: 0; color: var(--text-2); }
.rezept-legende li::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; background: var(--farbe); }
.rezept-fluss { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px 30px; list-style: none; margin: 0; padding: 4px 2px 10px; }
.schritt { --farbe: var(--r-probe); position: relative;
  background: var(--flaeche); border: 1px solid var(--linie); border-top: 4px solid var(--farbe); border-radius: var(--radius);
  padding: .65rem .75rem .7rem; box-shadow: var(--schatten); font-size: .82rem; }
.schritt:not(:last-child):not(.zeilenende)::after { content: ""; position: absolute; right: -25px; top: 1.45rem; width: 20px; height: 2px; background: var(--text-2); opacity: .6; }
.schritt:not(:last-child):not(.zeilenende)::before { content: ""; position: absolute; right: -26px; top: calc(1.45rem - 4px); border: 5px solid transparent; border-left: 7px solid var(--text-2); border-right: 0; opacity: .6; }
.substrat { --farbe: var(--r-substrat); } .steril { --farbe: var(--r-steril); } .pilz { --farbe: var(--r-pilz); }
.wachstum { --farbe: var(--r-wachstum); } .prozess { --farbe: var(--r-prozess); } .probe { --farbe: var(--r-probe); }
.schritt-kopf { display: flex; align-items: center; gap: .45rem; margin-bottom: .4rem; }
.schritt-kopf h3 { margin: 0; font-size: .9rem; line-height: 1.2; }
.schritt .nr { flex: none; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--farbe); color: var(--flaeche);
  display: grid; place-items: center; font-size: .72rem; font-weight: 700; }
.schritt .dauer { margin-left: auto; white-space: nowrap; font-family: var(--mono); font-size: .72rem; color: var(--farbe); font-weight: 600; }
.schritt dl { margin: 0; }
.schritt dt { color: var(--text-2); font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; margin-top: .35rem; }
.schritt dt:first-child { margin-top: 0; }
.schritt dd { margin: 0; overflow-wrap: anywhere; line-height: 1.35; }
.schritt.leer { border-style: dashed; border-top-style: solid; box-shadow: none; background: transparent; }
.schritt.leer h3 { color: var(--text-2); }
.rezept-zeit { display: flex; gap: 3px; margin-top: .3rem; font-size: .74rem; }
.rezept-zeit span { min-width: 90px; flex-grow: 0; flex-shrink: 1; padding: .3rem .5rem; border-radius: 6px; background: color-mix(in srgb, var(--r-wachstum) 18%, var(--flaeche));
  border-left: 3px solid var(--r-wachstum); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .rezept-fluss { grid-template-columns: 1fr; gap: 22px; }
  .schritt:not(:last-child):not(.zeilenende)::after { right: auto; left: 1.4rem; top: auto; bottom: -19px; width: 2px; height: 14px; }
  .schritt:not(:last-child):not(.zeilenende)::before { right: auto; left: calc(1.4rem - 4px); top: auto; bottom: -23px; border: 5px solid transparent; border-top: 7px solid var(--text-2); border-bottom: 0; }
  .rezept-legende { margin-left: 0; }
}

/* Hinweis auf die öffentliche Review-Version */
.demo-hinweis { font-size: .7rem; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
  color: var(--ocker); background: var(--akzent-hell); border: 1px solid color-mix(in srgb, var(--akzent) 35%, transparent);
  border-radius: 999px; padding: .1rem .5rem; align-self: center; }

/* Lizenz-Zustimmung */
.feld.zustimmung { margin-top: .6rem; padding: .7rem .85rem; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche-2); }
.zustimmung-label { display: flex !important; gap: .6rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.zustimmung-label input[type=checkbox] { width: 1.15rem; height: 1.15rem; margin-top: .15rem; flex: none; accent-color: var(--akzent); }
.feld.zustimmung.hat-fehler { border-color: var(--rot); background: var(--rot-hell); }
.feld.zustimmung .fehler { margin: .35rem 0 0; color: var(--rot); font-weight: 600; font-size: .85rem; }

/* Smartphone: kompakter Kopf, Menü als scrollbare Zeile, kein Lab */
.nur-mobil { display: none; }
@media (max-width: 700px) {
  .nav-lab, .f-recht { display: none; }
  .nur-mobil { display: inline; }
  .kopf-innen { gap: .45rem .75rem; padding: .5rem 14px; }
  .nav-rechts { display: contents; }
  .marke { order: 1; margin-right: auto; }
  .demo-hinweis { order: 2; }
  .nav-rechts > * { order: 2; }
  .nav-rechts > .kopf-suche { order: 3; flex: 1 1 100%; }
  .kopf-suche input { width: 100%; }
  .nav { order: 4; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; gap: .1rem; margin-inline: -4px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; white-space: nowrap; padding: .4rem .7rem; }
  main { padding-top: 1rem; }
  h1 { font-size: 1.5rem; }
  .held { padding-top: 1rem; }
  .held p { font-size: 1rem; }
  .filter > * { flex: 1 1 100%; }
  .kopfzeile .knopfreihe { width: 100%; }
}
