/* Fundus – eigenes Erscheinungsbild.
   Petrol als Grundfarbe (ruhig, sachlich), Bernstein als Akzent (der Fund).
   Hell und dunkel folgen dem Gerät. Nur Systemschriften: nichts wird nachgeladen. */

:root {
  color-scheme: light;
  --schrift-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --schrift-anzeige: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --seite: #f6f2ea;          /* Papier */
  --grund: #fffdf8;          /* Karten, Felder */
  --tag-tief: #ece5d8;       /* Bildflächen, Schlagworte */
  --text: #1d2a2a;
  --text-leise: #5d6b69;
  --linie: #e0d8c9;
  --linie-stark: #b9ae99;

  --petrol: #1f4e4a;
  --petrol-hell: #2e6b65;
  --bernstein: #e8a33d;
  --betont: #c7811f;
  --auf-petrol: #f4ede1;

  --gut-flaeche: #e2efe9;
  --offen: #9a5b00;
  --offen-flaeche: #fbefd9;
  --fehler: #b3261e;
  --fehler-flaeche: #fbe4e1;
  --laeuft-flaeche: #e6eef3;

  --rund: 12px;
  --atem: 0.18s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --seite: #121a1a;
    --grund: #1a2525;
    --tag-tief: #243231;
    --text: #ece6da;
    --text-leise: #a3aea9;
    --linie: #2c3b3a;
    --linie-stark: #48605d;
    --petrol: #173c39;
    --petrol-hell: #3f8a82;
    --betont: #f0b45a;
    --gut-flaeche: #1f3530;
    --offen: #f0b45a;
    --offen-flaeche: #3a2f1c;
    --fehler: #ff8a80;
    --fehler-flaeche: #3d2220;
    --laeuft-flaeche: #1f2e36;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 16px/1.5 var(--schrift-text); color: var(--text); background: var(--seite);
}
a { color: var(--petrol-hell); }
img { max-width: 100%; }

/* ---------- Kopf ---------- */
.kopfleiste {
  position: sticky; top: 0; z-index: 10;
  padding: 0.55rem 1rem; padding-top: max(0.55rem, env(safe-area-inset-top));
  color: var(--auf-petrol); background: var(--petrol);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.15);
}
.kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem;
  max-width: 60rem; margin: 0 auto; }
.kopf-marke { display: flex; align-items: center; gap: 0.55rem; min-width: 0; color: inherit; text-decoration: none; }
.kopf-zeichen { width: 1.9rem; height: 1.9rem; border-radius: 8px; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.15); }
.kopf h1 { margin: 0; font-family: var(--schrift-anzeige); font-size: 1.3rem; font-weight: 600; letter-spacing: 0.01em; }
.kopf-navigation { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.kopf-navigation::-webkit-scrollbar { display: none; }
.kopf .reiter {
  flex: 0 0 auto; padding: 0.4rem 0.8rem; color: var(--auf-petrol); text-decoration: none; white-space: nowrap;
  font-size: 0.92rem; background: transparent; border: 0; border-radius: 999px; opacity: 0.85;
  transition: background var(--atem), opacity var(--atem);
}
.kopf .reiter:hover { opacity: 1; background: rgb(255 255 255 / 0.1); }
.kopf .reiter.aktiv { opacity: 1; color: var(--petrol); background: var(--bernstein); font-weight: 600; }

/* ---------- Knöpfe und Felder ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.5rem 1rem; font: inherit; font-size: 0.95rem; color: var(--text); text-decoration: none;
  background: var(--grund); border: 1px solid var(--linie-stark); border-radius: 999px; cursor: pointer;
  transition: border-color var(--atem), background var(--atem);
}
.knopf:hover:not(:disabled) { border-color: var(--petrol-hell); }
.knopf.haupt { color: var(--auf-petrol); background: var(--petrol-hell); border-color: var(--petrol-hell); font-weight: 600; }
.knopf.haupt:hover:not(:disabled) { background: var(--petrol); }
.knopf.gefahr { color: var(--fehler); }
.knopf:disabled { opacity: 0.5; cursor: default; }
.feld {
  padding: 0.5rem 0.7rem; font: inherit; color: var(--text);
  background: var(--grund); border: 1px solid var(--linie-stark); border-radius: 10px;
}
.feld::placeholder { color: var(--text-leise); }
.feld:focus-visible, .knopf:focus-visible, .reiter:focus-visible, a:focus-visible {
  outline: 3px solid var(--bernstein); outline-offset: 2px;
}

/* ---------- Hinweise und Meldungen ---------- */
.stand { margin: 0 0 0.6rem; color: var(--text-leise); font-size: 0.85rem; }
.hinweis { margin: 0 0 1rem; padding: 0.6rem 0.9rem; background: var(--laeuft-flaeche);
  border-left: 4px solid var(--petrol-hell); border-radius: 0 var(--rund) var(--rund) 0; }
.hinweis.warnung { color: var(--offen); background: var(--offen-flaeche); border-left-color: var(--offen); }
.hinweis.fehler { color: var(--fehler); background: var(--fehler-flaeche); border-left-color: var(--fehler); }

dialog.fenster {
  padding: 1.2rem 1.3rem; color: var(--text); background: var(--grund);
  border: 1px solid var(--linie); border-radius: 18px; box-shadow: 0 18px 50px rgb(0 0 0 / 0.25);
}
dialog.fenster::backdrop { background: rgb(18 26 26 / 0.5); backdrop-filter: blur(3px); }
dialog.fenster h2 { margin: 0 0 0.4rem; font-family: var(--schrift-anzeige); font-weight: 600; font-size: 1.3rem; }

.meldung-leiste {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 20; transform: translateX(-50%);
  max-width: calc(100vw - 2rem); padding: 0.6rem 1.1rem; color: var(--auf-petrol); background: var(--petrol-hell);
  border-radius: 999px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
}
.meldung-leiste[data-art="fehler"] { background: var(--fehler); color: #fff; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .kopfleiste { position: static; } .meldung-leiste { display: none; } }
