/* Wiesen-App — Gestaltung. Zuerst fuer das Smartphone im Hochformat. */

:root {
  --grund: #f6f5f2;
  --blatt: #ffffff;
  --linie: #d6d3cc;
  --schrift: #1c1b19;
  --gedaempft: #6b6862;
  --betont: #2f6f3e;
  --warnung: #b3261e;
  --hinweis: #8a6d00;

  /* Altersstufen nach § 5.2 */
  --frisch: #d9d9d9;
  --bald: #f2d024;
  --reif: #3f9c52;
  --weide: #8a5a2b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--schrift);
  background: var(--grund);
}

body.mittig {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 16px;
}

/* -------------------------------------------------------------- Hauptmenue */

.hauptmenue {
  display: flex; gap: 2px; overflow-x: auto;
  background: var(--blatt); border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 800;
}
.hauptmenue a {
  flex: 0 0 auto; padding: 12px 14px; min-height: 44px;
  display: flex; align-items: center;
  color: var(--gedaempft); text-decoration: none; font-weight: 600;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.hauptmenue a.aktiv { color: var(--betont); border-bottom-color: var(--betont); }
.hauptmenue a.abmelden { margin-left: auto; color: var(--gedaempft); font-weight: 400; }

/* --------------------------------------------------------------- Meldungen */

.meldungen { padding: 8px 12px 0; }
.meldung {
  padding: 10px 12px; border-radius: 6px; margin-bottom: 6px;
  border-left: 4px solid;
}
.meldung.erfolg { background: #e8f3ea; border-color: var(--betont); }
.meldung.fehler { background: #fbeae9; border-color: var(--warnung); }

/* ------------------------------------------------------------------ Blatt */

.blatt { padding: 12px; }
.karte-blatt {
  background: var(--blatt); border: 1px solid var(--linie); border-radius: 8px;
  padding: 14px; margin-bottom: 12px;
}
.anmeldeformular { width: min(360px, 100%); }
.anmeldeformular h1 { margin: 0 0 16px; font-size: 22px; }

h1 { font-size: 20px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 14px 0 6px; }

label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--gedaempft); }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px;
  min-height: 44px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--linie); border-radius: 6px; background: #fff;
  color: var(--schrift);
}
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; display: inline-block; }
.ankreuz { display: flex; align-items: center; gap: 8px; }

button, .knopf {
  min-height: 44px; padding: 10px 14px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--linie); border-radius: 6px; background: #f0efec;
  color: var(--schrift); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
button:active, .knopf:active { background: #e2e0dc; }
.hauptknopf { background: var(--betont); border-color: var(--betont); color: #fff; width: 100%; }
.gefahrknopf { background: #fff; border-color: var(--warnung); color: var(--warnung); }
.klein { min-height: 34px; padding: 5px 9px; font-size: 13px; }

.knopfreihe { display: flex; gap: 6px; flex-wrap: wrap; }
.knopfreihe > * { flex: 1 1 auto; }

/* ------------------------------------------------------------------ Karte */

body.kartenseite { overflow: hidden; height: 100vh; }
#karte { position: absolute; top: 45px; left: 0; right: 0; bottom: 132px; }

#leiste {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 810;
  background: var(--blatt); border-top: 2px solid var(--schrift);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
#summe { font-size: 17px; font-weight: 700; }
#zusatz { font-size: 13px; color: var(--gedaempft); min-height: 18px; margin-bottom: 6px; }
#zusatz .bio { color: var(--warnung); }

.werkzeugleiste {
  position: absolute; top: 53px; right: 8px; z-index: 805;
  display: flex; flex-direction: column; gap: 6px;
}
.werkzeugleiste button {
  background: rgba(255,255,255,.94); min-height: 40px; padding: 6px 10px; font-size: 13px;
}
.werkzeugleiste button.ein { background: var(--betont); color: #fff; border-color: var(--betont); }

.schlaglabel {
  background: none; border: none; box-shadow: none; padding: 0;
  font-size: 12px; font-weight: 700; color: #111;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.schlaglabel::before { display: none; }
.duengesymbol {
  background: none; border: none; box-shadow: none;
  font-size: 15px; text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}

#legende {
  position: absolute; left: 8px; bottom: 140px; z-index: 805;
  background: rgba(255,255,255,.94); border: 1px solid var(--linie);
  border-radius: 6px; padding: 8px 10px; font-size: 12px; line-height: 1.7;
}
#legende .muster {
  display: inline-block; width: 16px; height: 12px; margin-right: 6px;
  border: 1px solid #555; vertical-align: -1px;
}

/* ---------------------------------------------------------------- Tabellen */

.tabellenhuelle { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--blatt); }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--linie); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--gedaempft); }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
tr.summenzeile td { font-weight: 700; border-top: 2px solid var(--schrift); }
td.ueber-grenze { color: var(--warnung); font-weight: 700; }

.stufe-frisch { background: var(--frisch); }
.stufe-bald   { background: var(--bald); }
.stufe-reif   { background: var(--reif); color: #fff; }
.stufe-beweidet { background: var(--weide); color: #fff; }
.merker {
  display: inline-block; padding: 1px 7px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
}

.wiesenblock { margin-bottom: 18px; }
.wiesenblock > h2 { padding-bottom: 4px; border-bottom: 2px solid var(--schrift); }
.hinweiszeile { color: var(--hinweis); font-size: 13px; padding: 4px 0; }
.gedaempft { color: var(--gedaempft); }
.gezeichnet { color: var(--gedaempft); font-size: 13px; }

/* ------------------------------------------------------------------ Dialog */

dialog {
  border: none; border-radius: 10px; padding: 0; width: min(460px, 94vw);
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(0,0,0,.45); }
.dialoginhalt { padding: 16px; }
.dialoginhalt h2 { margin-top: 0; }

.vorschautabelle { margin: 10px 0; font-size: 14px; }

/* ------------------------------------------------------------ Grosse Geraete */

@media (min-width: 760px) {
  .blatt { max-width: 1100px; margin: 0 auto; padding: 20px; }
  .spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  #leiste { padding-bottom: 10px; }
}

/* ------------------------------------------------------- Stammdaten-Karten */

.schlagkarte {
  border: 1px solid var(--linie); border-radius: 6px;
  padding: 10px 12px; margin: 10px 0; background: #fcfcfb;
}
.schlagkopf { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.schlagkopf strong { flex: 1 1 auto; color: var(--schrift); }
.schlagkarte form { margin: 0; }
.schlagkarte label { margin-bottom: 8px; }
