/* Waldaffe Substratlabor
   Vier Farben nach Martins Vorgabe: Waldaffe-Grün (in Abstufungen), Anthrazit, Papier, Ocker (nur Hinweise).
   Bildsprache: Laborjournal. Millimeterpapier, Probenetikett, Messskala. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/HankenGrotesk.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Grün, abgeleitet aus dem Logo #49603D */
  --gruen-950: oklch(0.22 0.03 135);
  --gruen-900: oklch(0.28 0.04 135);
  --gruen: #49603D;                       /* Logo */
  --gruen-dunkel: oklch(0.40 0.055 135);
  --gruen-500: oklch(0.58 0.065 133);
  --gruen-300: oklch(0.80 0.05 128);
  --gruen-200: oklch(0.88 0.035 125);
  --gruen-100: oklch(0.94 0.02 122);
  --gruen-10: oklch(0.47 0.06 135 / 0.08);
  --gruen-20: oklch(0.47 0.06 135 / 0.18);

  /* Anthrazit und Papier, leicht zum Grün getönt */
  --text: oklch(0.24 0.012 130);
  --text-2: oklch(0.24 0.012 130 / 0.64);
  --text-3: oklch(0.24 0.012 130 / 0.45);
  --linie: oklch(0.24 0.012 130 / 0.11);
  --linie-stark: oklch(0.24 0.012 130 / 0.24);
  --grund: oklch(0.966 0.008 110);
  --papier: oklch(0.985 0.005 105);
  --weiss: oklch(0.995 0.003 105);

  /* Ocker nur für Hinweise und Prüfstatus */
  --ocker: oklch(0.63 0.12 70);
  --ocker-text: oklch(0.47 0.09 65);
  --ocker-10: oklch(0.63 0.12 70 / 0.12);

  --radius: 16px;
  --radius-klein: 10px;
  --schatten: 0 1px 2px oklch(0.24 0.012 130 / 0.05), 0 10px 28px -16px oklch(0.24 0.03 135 / 0.22);
  --schatten-hoch: 0 2px 4px oklch(0.24 0.012 130 / 0.06), 0 18px 40px -18px oklch(0.24 0.03 135 / 0.32);
  --schrift: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --raster-fein: oklch(0.47 0.06 135 / 0.045);
  --raster-grob: oklch(0.47 0.06 135 / 0.07);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text);
  font: 15px/1.5 var(--schrift); font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  background-color: var(--grund);
  /* Millimeterpapier, sehr zurückhaltend */
  background-image:
    linear-gradient(var(--raster-grob) 1px, transparent 1px),
    linear-gradient(90deg, var(--raster-grob) 1px, transparent 1px),
    linear-gradient(var(--raster-fein) 1px, transparent 1px),
    linear-gradient(90deg, var(--raster-fein) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gruen); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
.versteckt { display: none !important; }
::selection { background: var(--gruen-200); }

.augenbraue {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gruen-dunkel); margin-bottom: 6px;
}

/* ---------- Kopf: dunkles Band mit Raster, Reiter wie Register ---------- */
.kopf {
  position: sticky; top: 0; z-index: 20; color: var(--papier);
  background-color: var(--gruen-900);
  background-image:
    linear-gradient(oklch(1 0 0 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.05) 1px, transparent 1px),
    radial-gradient(120% 140% at 0% 0%, oklch(0.40 0.06 135 / 0.9), transparent 60%);
  background-size: 24px 24px, 24px 24px, 100% 100%;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  box-shadow: 0 1px 0 oklch(0 0 0 / 0.15), 0 10px 30px -18px oklch(0.2 0.03 135 / 0.7);
}
.kopf-innen { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding-top: 12px; }
.marke { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.kopf .logo { height: 19px; width: auto; display: block; }
.kopf .titel {
  font-size: 15px; font-weight: 750; letter-spacing: -0.01em; white-space: nowrap;
  padding-left: 14px; border-left: 1px solid oklch(1 0 0 / 0.22); line-height: 1.1;
}
.kopf .titel small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; opacity: 0.62; margin-top: 2px; }
.wer { margin-left: auto; font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.wer em { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: oklch(1 0 0 / 0.14); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: var(--gruen-200); color: var(--gruen-950); box-shadow: inset 0 0 0 2px oklch(1 0 0 / 0.35);
}
.wer button {
  background: transparent; border: 1px solid oklch(1 0 0 / 0.25); color: inherit; cursor: pointer;
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; transition: background 180ms var(--ease);
}
.wer button:hover { background: oklch(1 0 0 / 0.1); }

.nav { order: 3; width: 100%; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-top: 8px; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  text-decoration: none; color: oklch(0.985 0.005 105 / 0.78); padding: 10px 15px 11px; border-radius: 12px 12px 0 0;
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: background 180ms var(--ease), color 180ms var(--ease);
}
.nav a:hover { background: oklch(1 0 0 / 0.08); color: var(--papier); }
.nav a.aktiv { background: var(--grund); color: var(--gruen-950); }
.nav .trenner { width: 1px; background: oklch(1 0 0 / 0.18); margin: 10px 8px; flex-shrink: 0; }

/* ---------- Seite ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 28px 16px 40px; }
.fuss {
  max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; display: flex; gap: 8px 18px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3);
}
.fuss b { color: var(--text-2); font-weight: 650; }
.seitenkopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.seitenkopf p { margin: 6px 0 0; color: var(--text-2); font-size: 14px; max-width: 70ch; }
.etikett-kopf h1 { font-size: 40px; letter-spacing: -0.03em; }

.karte {
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 22px; margin-bottom: 18px; box-shadow: var(--schatten);
}
.karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.karte-kopf h2 { display: flex; align-items: center; gap: 12px; font-size: 19px; }
.karte-kopf .einheit { font-size: 12.5px; color: var(--text-2); padding: 4px 10px; border-radius: 999px; background: var(--grund); }
.schritt {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  font-size: 13px; font-weight: 800; letter-spacing: 0.02em; color: var(--papier);
  background: linear-gradient(160deg, var(--gruen-500), var(--gruen-dunkel));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.25), 0 3px 8px -3px oklch(0.3 0.05 135 / 0.6);
}

/* ---------- Probenetikett ---------- */
.etikett {
  position: relative; background: var(--papier);
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, oklch(0.47 0.06 135 / 0.025) 14px 15px);
  border-color: var(--linie-stark);
}
.etikett::before {
  /* Lochung wie bei einem Anhängeetikett */
  content: ""; position: absolute; top: 18px; right: 18px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--grund); box-shadow: inset 0 1px 2px oklch(0.24 0.012 130 / 0.35), 0 0 0 3px var(--gruen-100);
}
.etikett .probe-kopf { padding-right: 28px; }

/* ---------- Einstellungen ---------- */
.einstellungen-leiste { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 14px; }
.einstellungen-leiste .label { font-weight: 700; color: var(--gruen-dunkel); margin-right: 4px; }
.chip {
  background: var(--papier); border: 1px solid var(--gruen-20); border-radius: 999px; padding: 4px 12px; white-space: nowrap;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.8);
}
.chip b { font-weight: 700; }
.chip.hinweis { border-color: var(--ocker); color: var(--ocker-text); background: var(--ocker-10); }

/* ---------- Felder ---------- */
.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feld > span, .feld > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.feld input, .feld select, .feld textarea, td input, td select, .nzeile input, .nzeile select {
  width: 100%; min-height: 44px; padding: 9px 12px; background-color: var(--weiss);
  border: 1px solid var(--linie-stark); border-radius: var(--radius-klein);
  box-shadow: inset 0 1px 2px oklch(0.24 0.012 130 / 0.06);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.feld input:hover, .feld select:hover, .nzeile input:hover, .nzeile select:hover { border-color: oklch(0.24 0.012 130 / 0.38); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gruen); box-shadow: 0 0 0 4px var(--gruen-20); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--gruen-500); outline-offset: 2px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px !important;
  background-image: linear-gradient(45deg, transparent 50%, var(--gruen) 50%), linear-gradient(135deg, var(--gruen) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input::placeholder { color: var(--text-3); }
.felder { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 9px 18px; border-radius: 12px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--gruen-20); background: var(--weiss); color: var(--gruen-dunkel); font-weight: 700; font-size: 14.5px;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.9), 0 1px 2px oklch(0.24 0.012 130 / 0.08);
  transition: background 160ms var(--ease), transform 120ms var(--ease), box-shadow 160ms var(--ease);
}
.knopf:hover { background: var(--gruen-100); border-color: var(--gruen-300); }
.knopf:active { transform: translateY(1px); box-shadow: inset 0 1px 2px oklch(0.24 0.012 130 / 0.12); }
.knopf.primaer {
  border-color: var(--gruen-950); color: var(--papier);
  background: linear-gradient(180deg, var(--gruen-500), var(--gruen-dunkel) 70%);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.28), 0 6px 14px -8px oklch(0.3 0.06 135 / 0.9);
}
.knopf.primaer:hover { background: linear-gradient(180deg, var(--gruen-dunkel), var(--gruen-900)); }
.knopf.gross { min-height: 52px; font-size: 16px; }
.knopf.leise { border-color: transparent; box-shadow: none; background: transparent; }
.knopf.gefahr { border-color: var(--ocker); color: var(--ocker-text); }
.knopf.gefahr:hover { background: var(--ocker-10); }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Probe-Kopf ---------- */
.probe-kopf { display: grid; gap: 14px; grid-template-columns: 1.2fr 0.8fr 1.6fr; align-items: end; }
.probe-kopf .knopfreihe { grid-column: 1 / -1; padding-top: 4px; }
.probe-kopf input[data-f="probenId"] { font-weight: 700; letter-spacing: 0.02em; }
.speicherstand { font-size: 12.5px; color: var(--text-2); margin-top: 10px; min-height: 18px; display: flex; align-items: center; gap: 6px; }
.speicherstand:not(:empty)::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gruen-500); }
.speicherstand.offen { color: var(--ocker-text); font-weight: 700; }
.speicherstand.offen::before { background: var(--ocker); box-shadow: 0 0 0 3px var(--ocker-10); }

/* ---------- Messung: pH und EC wie Geräteanzeigen ---------- */
.phec { display: grid; gap: 22px; grid-template-columns: 1fr 1fr 1.25fr; align-items: start; }
.gross > label { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: 0.01em; }
.gross input {
  font-size: 44px; font-weight: 750; letter-spacing: -0.03em; min-height: 82px; padding: 8px 18px;
  color: var(--gruen-950); border-radius: 14px; border-width: 1.5px;
  background: linear-gradient(180deg, var(--papier), var(--weiss));
  box-shadow: inset 0 2px 6px oklch(0.24 0.012 130 / 0.08), inset 0 0 0 1px oklch(1 0 0 / 0.6);
}
.gross input::placeholder { color: oklch(0.24 0.012 130 / 0.18); }

.skala {
  position: relative; display: flex; justify-content: space-between; margin-top: 12px; padding-top: 16px;
  font-size: 11px; font-weight: 600; color: var(--text-3);
}
.skala::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; border-radius: 999px;
  box-shadow: inset 0 1px 2px oklch(0.24 0.012 130 / 0.18);
}
.skala::after {
  /* Teilstriche */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; border-radius: 999px; opacity: 0.55;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 14 - 1px), oklch(1 0 0 / 0.9) calc(100% / 14 - 1px) calc(100% / 14));
}
.ph-skala::before { background: linear-gradient(90deg, var(--ocker), oklch(0.82 0.08 85) 32%, var(--gruen-100) 50%, var(--gruen-300) 66%, var(--gruen-dunkel)); }
.ec-skala::before { background: linear-gradient(90deg, var(--gruen-100), var(--gruen-300) 45%, var(--gruen-dunkel)); }
.ec-skala::after { background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 6 - 1px), oklch(1 0 0 / 0.9) calc(100% / 6 - 1px) calc(100% / 6)); }
.skala .zeiger {
  position: absolute; left: 0; right: 0; top: -5px; height: 18px; pointer-events: none;
  transform: translateX(var(--pos, 0%)); transition: transform 320ms var(--ease), opacity 200ms var(--ease);
}
.skala .zeiger::after {
  content: ""; position: absolute; left: -9px; top: 0; width: 18px; height: 18px; border-radius: 50%;
  background: var(--weiss); border: 3px solid var(--gruen-950); box-shadow: 0 2px 6px oklch(0.24 0.03 135 / 0.35);
}
.skala.leer .zeiger { opacity: 0; }
.skala.ausserhalb .zeiger::after { border-color: var(--ocker); box-shadow: 0 0 0 4px var(--ocker-10); }
.messwert-status { margin-top: 10px; min-height: 24px; }

.kcl {
  display: grid; gap: 14px; padding: 18px; border-radius: 14px; align-self: stretch;
  background: linear-gradient(160deg, var(--gruen-100), var(--papier));
  border: 1px solid var(--gruen-20);
}
.kcl .wert-block { display: grid; gap: 2px; }
.kcl .zahl { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; color: var(--gruen-950); }
.wert-block .lbl { font-size: 12px; color: var(--text-2); display: block; font-weight: 600; }
.phec-details { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--linie-stark); }

/* ---------- Ergebniszahlen und Status ---------- */
.zahl { color: var(--gruen-dunkel); font-weight: 700; white-space: nowrap; font-size: 15.5px; }
.zahl.leer { color: var(--text-3); font-weight: 500; }
.status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px 3px 8px;
  border-radius: 999px; white-space: nowrap; border: 1px solid transparent; line-height: 1.4;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.75; flex-shrink: 0; }
.status.ok { background: var(--gruen-100); color: var(--gruen-dunkel); border-color: var(--gruen-20); }
.status.neutral { background: oklch(0.24 0.012 130 / 0.05); color: var(--text-2); }
.status.neutral::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.status.pruefen { background: var(--ocker-10); color: var(--ocker-text); border-color: oklch(0.63 0.12 70 / 0.35); font-weight: 700; }

/* ---------- Nährstoffe: Tabelle am PC, Karten am Handy ---------- */
.ntabelle { display: grid; gap: 0; }
.nzeile {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: minmax(0,1.3fr) minmax(0,1.1fr) minmax(0,1fr) minmax(0,0.8fr) minmax(0,0.9fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.25fr);
  grid-template-areas: "name anz mess verd korr elem ziel stat";
  padding: 10px 8px; border-bottom: 1px solid var(--linie); border-radius: 10px;
  transition: background 160ms var(--ease);
}
.nzeile:not(.kopfzeile):hover, .mzeile:not(.kopfzeile):hover { background: oklch(0.47 0.06 135 / 0.035); }
.nzeile.kopfzeile, .mzeile.kopfzeile {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
  padding-top: 0; align-items: end; border-bottom-color: var(--linie-stark); border-radius: 0;
}
.nzeile .n-name { grid-area: name; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.nzeile .n-name small { display: block; font-weight: 500; color: var(--text-2); font-size: 12px; letter-spacing: 0; }
.nzeile .n-anz { grid-area: anz; } .nzeile .n-mess { grid-area: mess; } .nzeile .n-verd { grid-area: verd; }
.nzeile .n-korr { grid-area: korr; } .nzeile .n-elem { grid-area: elem; } .nzeile .n-ziel { grid-area: ziel; }
.nzeile .n-stat { grid-area: stat; }
.nzeile .n-mess input { font-weight: 700; font-size: 16px; }
.nzeile .mlabel, .mzeile .mlabel { display: none; }

.mzeile {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: minmax(0,0.9fr) repeat(3, minmax(0,1fr)) minmax(0,0.95fr) minmax(0,0.95fr) minmax(0,1.35fr) minmax(0,1.35fr);
  grid-template-areas: "name di cat cal catox calox cats cals";
  padding: 12px 8px; border-bottom: 1px solid var(--linie); border-radius: 10px;
}
.mzeile > :nth-child(1) { grid-area: name; font-weight: 800; font-size: 17px; } .mzeile > :nth-child(2) { grid-area: di; }
.mzeile > :nth-child(3) { grid-area: cat; } .mzeile > :nth-child(4) { grid-area: cal; }
.mzeile > :nth-child(5) { grid-area: catox; } .mzeile > :nth-child(6) { grid-area: calox; }
.mzeile > :nth-child(7) { grid-area: cats; } .mzeile > :nth-child(8) { grid-area: cals; }
.mzeile .zahl small { font-weight: 400; color: var(--text-2); }
.mzeile.kopfzeile > :nth-child(1), .nzeile.kopfzeile .n-name, .nzeile.kopfzeile > :first-child { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.mzeile .status, .nzeile .status { white-space: normal; text-align: left; }
.m-wert { display: grid; gap: 6px; }
.balken {
  display: block; height: 6px; border-radius: 999px; background: var(--gruen-300);
  transform-origin: left center; transform: scaleX(var(--w, 0)); transition: transform 360ms var(--ease), opacity 200ms var(--ease);
}
.balken.di { background: var(--gruen-200); }
.balken.cat { background: var(--gruen-500); }
.balken.cal { background: var(--gruen-900); }
.balken.aus { opacity: 0; }
.mzeile.kopfzeile > :nth-child(2)::before, .mzeile.kopfzeile > :nth-child(3)::before, .mzeile.kopfzeile > :nth-child(4)::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px;
}
.mzeile.kopfzeile > :nth-child(2)::before { background: var(--gruen-200); }
.mzeile.kopfzeile > :nth-child(3)::before { background: var(--gruen-500); }
.mzeile.kopfzeile > :nth-child(4)::before { background: var(--gruen-900); }

/* ---------- Aufklapper ---------- */
details.karte { padding: 0; }
details.karte > summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 18px 22px; border-radius: var(--radius); transition: background 160ms var(--ease);
}
details.karte > summary:hover { background: oklch(0.47 0.06 135 / 0.035); }
details.karte > summary::-webkit-details-marker { display: none; }
details.karte > summary::after {
  content: ""; width: 9px; height: 9px; flex-shrink: 0; margin-right: 4px;
  border-right: 2px solid var(--gruen); border-bottom: 2px solid var(--gruen);
  transform: rotate(45deg); transition: transform 220ms var(--ease);
}
details.karte[open] > summary::after { transform: rotate(-135deg); }
details.karte > :not(summary) { margin-left: 22px; margin-right: 22px; }
details.karte > :last-child { margin-bottom: 22px; }
details.karte > summary h2 small { font-weight: 500; color: var(--text-2); font-size: 12.5px; margin-left: 8px; letter-spacing: 0; }

.hinweise { font-size: 12.5px; color: var(--text-2); margin: 14px 0 0; padding-left: 18px; }
.hinweise li { margin: 4px 0; }
.hinweise li::marker { color: var(--gruen-500); }

/* ---------- Banner ---------- */
.banner { border-radius: 14px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.hinweis { background: var(--ocker-10); border: 1px solid oklch(0.63 0.12 70 / 0.35); }
.banner.info { background: var(--gruen-100); border: 1px solid var(--gruen-20); }

/* ---------- Tabellen ---------- */
.tabelle-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-weight: 700; }
thead th {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
  white-space: nowrap; border-bottom-color: var(--linie-stark);
}
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tbody tr.klickbar { cursor: pointer; transition: background 140ms var(--ease); }
tbody tr.klickbar:hover { background: var(--gruen-100); }
tbody tr.klickbar td:nth-child(2) { font-weight: 700; }
td .klein, .klein { font-size: 12px; color: var(--text-2); }
td.klein { min-width: 240px; }
.tabelle-wrap td { overflow-wrap: anywhere; }

.literatur td { font-size: 13px; min-width: 70px; }
.literatur td.titel { font-weight: 800; color: var(--gruen-dunkel); padding-top: 20px; font-size: 14px; }
.literatur tr.leer td { padding: 2px; border: 0; }
.literatur td:first-child { color: var(--text-3); font-size: 11px; min-width: 0; }

/* ---------- Login: Bühne + Formular ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); }
.login-buehne {
  position: relative; overflow: hidden; color: var(--papier); padding: 44px clamp(28px, 5vw, 72px);
  display: flex; flex-direction: column; gap: 28px;
  background-color: var(--gruen-900);
  background-image:
    linear-gradient(oklch(1 0 0 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.05) 1px, transparent 1px),
    radial-gradient(90% 70% at 15% 10%, oklch(0.42 0.06 135), transparent 70%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
}
.login-buehne .logo { height: 26px; width: auto; align-self: flex-start; }
.login-titel { margin-top: auto; position: relative; z-index: 1; }
.login-titel .augenbraue { color: var(--gruen-300); }
.wortmarke {
  margin: 0; font-size: clamp(54px, 8.4vw, 132px); font-weight: 850; letter-spacing: -0.05em; line-height: 0.88;
  color: var(--papier);
}
.login-fakten { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 clamp(120px, 18vh, 200px); }
.login-fakten div { padding: 10px 14px; border-radius: 12px; background: oklch(1 0 0 / 0.07); border: 1px solid oklch(1 0 0 / 0.12); }
.login-fakten dt { font-weight: 850; font-size: 15px; letter-spacing: 0.04em; }
.login-fakten dd { margin: 2px 0 0; font-size: 12px; opacity: 0.72; }
/* Substratschichten, laufen über die Kante */
.schichten { position: absolute; left: -6%; right: -6%; bottom: -30px; display: grid; transform: rotate(-3deg); }
.schichten span { display: block; border-radius: 40% 60% 0 0 / 18px 26px 0 0; margin-top: -10px; }
.schichten span:nth-child(1) { height: 44px; background: var(--gruen-300); }
.schichten span:nth-child(2) { height: 38px; background: var(--gruen-500); }
.schichten span:nth-child(3) { height: 30px; background: var(--ocker); }
.schichten span:nth-child(4) { height: 46px; background: var(--gruen-dunkel); }
.schichten span:nth-child(5) { height: 70px; background: var(--gruen-950); }
.login-formular { display: grid; align-content: center; justify-items: start; padding: 48px clamp(24px, 5vw, 72px); background: var(--grund); }
.login-formular > * { width: 100%; max-width: 380px; }
.login-formular h1 { font-size: 34px; }
.login .untertitel { color: var(--text-2); margin: 8px 0 28px; font-size: 15px; }
.login form { display: grid; gap: 16px; }
.fehler { color: var(--ocker-text); font-size: 14px; font-weight: 700; min-height: 20px; }

.leer-hinweis { color: var(--text-2); padding: 28px 0; text-align: center; }
.suche { max-width: 380px; margin-bottom: 8px; }
.meldung {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--gruen-950); color: var(--papier); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 50;
  box-shadow: var(--schatten-hoch); animation: rein 260ms var(--ease);
}
@keyframes rein { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Admin (Homer) ---------- */
.admin-form { display: grid; gap: 16px; margin-top: 16px; }
.admin-form > .knopf { justify-self: start; }
.admin-gruppe { grid-column: 1 / -1; border: 1px solid var(--linie); padding: 14px 16px; border-radius: 12px; background: var(--papier); }
.admin-gruppe > summary { cursor: pointer; font-weight: 700; }
.admin-gruppe[open] > summary { margin-bottom: 12px; }
.admin-form textarea { resize: vertical; }
.auswahl { display: flex; align-items: start; gap: 8px; font-size: 14px; }
.auswahl input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--gruen); }
#excel-vorschau h2 { margin-top: 20px; }
#excel-vorschau td { min-width: 100px; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .phec { grid-template-columns: 1fr 1fr; }
  .phec .kcl { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .mzeile { grid-template-columns: minmax(0,0.8fr) repeat(3, minmax(0,1fr)) minmax(0,0.9fr) minmax(0,0.9fr) minmax(0,1.3fr) minmax(0,1.3fr); gap: 10px; }
}

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  body { background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px; }
  .kopf-innen { padding-top: 10px; gap: 4px 12px; }
  .kopf .titel small { display: none; }
  .wer > span:not(.avatar) { display: none; }
  .nav { margin-top: 6px; }
  .nav a { padding: 9px 12px 10px; font-size: 13.5px; }
  .nav .trenner { display: none; }
  main { padding: 18px 12px 28px; }
  .karte { padding: 16px 14px; border-radius: 14px; margin-bottom: 14px; }
  details.karte { padding: 0; }
  details.karte > summary { padding: 15px 14px; }
  details.karte > :not(summary) { margin-left: 14px; margin-right: 14px; }
  details.karte > :last-child { margin-bottom: 16px; }
  h1, .etikett-kopf h1 { font-size: 28px; }
  .karte-kopf { margin-bottom: 12px; }
  .karte-kopf h2 { font-size: 17px; gap: 10px; }
  .karte-kopf .einheit { display: none; }
  .schritt { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }

  .einstellungen-leiste { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .einstellungen-leiste::-webkit-scrollbar { display: none; }
  .einstellungen-leiste .label { white-space: nowrap; }
  .seitenkopf { margin-bottom: 12px; }
  .seitenkopf p { display: none; }
  .probe-kopf { grid-template-columns: 1fr 1fr; gap: 12px; }
  .probe-kopf .f-rezeptur, .probe-kopf .knopfreihe { grid-column: 1 / -1; }
  .probe-kopf .knopfreihe .knopf { flex: 1 1 auto; }
  .etikett::before { top: 12px; right: 12px; width: 11px; height: 11px; }

  .phec { gap: 16px; }
  .gross input { font-size: 36px; min-height: 68px; padding: 6px 14px; }
  .kcl { padding: 14px; gap: 10px; }
  .kcl .zahl { font-size: 24px; }
  .phec-details { grid-template-columns: 1fr 1fr; margin-top: 16px; }
  .phec-details .feld:last-child { grid-column: 1 / -1; }

  .nzeile.kopfzeile, .mzeile.kopfzeile { display: none; }
  .nzeile {
    grid-template-columns: 1fr 1fr 0.8fr;
    grid-template-areas:
      "name name stat"
      "anz mess verd"
      "korr elem ziel";
    padding: 14px 2px; row-gap: 10px; border-radius: 0;
  }
  .nzeile .n-stat { justify-self: end; }
  .nzeile .mlabel, .mzeile .mlabel { display: block; font-size: 11px; font-weight: 600; color: var(--text-3); }
  .mzeile {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
      "name name name"
      "di cat cal"
      ". catox calox"
      "cats cats cats"
      "cals cals cals";
    padding: 14px 2px; row-gap: 10px; border-radius: 0;
  }
  .mzeile > :nth-child(7), .mzeile > :nth-child(8) { display: flex; align-items: center; gap: 8px; }
  .mzeile > :nth-child(7) .mlabel, .mzeile > :nth-child(8) .mlabel { min-width: 72px; }

  .login { grid-template-columns: 1fr; }
  .login-buehne { padding: 24px 20px 0; gap: 18px; min-height: 330px; }
  .login-buehne .logo { height: 20px; }
  .wortmarke { font-size: 58px; }
  .login-fakten { display: none; }
  .login-titel { margin: 24px 0 120px; }
  .schichten { bottom: -40px; }
  .login-formular { padding: 32px 20px 48px; align-content: start; }
  .login-formular h1 { font-size: 28px; }
}
@media (max-width: 480px) { .felder { grid-template-columns: 1fr; } .meldung { max-width: calc(100vw - 24px); width: max-content; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .kopf, .knopfreihe, .nav, .fuss, details:not([open]) { display: none !important; }
  body { background: #fff; }
  .karte { border: 0; padding: 0; box-shadow: none; }
}
