:root {
  --grund: #f6f6f4;
  --flaeche: #ffffff;
  --text: #1d1d1b;
  --leise: #6b6b66;
  --linie: #deded8;
  --akzent: #2f5d50;
  --akzent-text: #ffffff;
  --warn: #9a4b00;
  --warn-flaeche: #fff3e5;
  --fehler: #a32020;
  --fehler-flaeche: #fdecec;
  --gut: #1f6b3a;
  --gut-flaeche: #e8f5ec;
  --zeile-hover: #f0f3f1;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #161716;
    --flaeche: #1f2120;
    --text: #e8e8e4;
    --leise: #a0a09a;
    --linie: #353835;
    --akzent: #7fb8a6;
    --akzent-text: #0e1a16;
    --warn: #f0a556;
    --warn-flaeche: #3a2a17;
    --fehler: #f08a8a;
    --fehler-flaeche: #3a1c1c;
    --gut: #8fd1a5;
    --gut-flaeche: #1b3324;
    --zeile-hover: #262a28;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
/* Sonst überstimmt `display: flex` an .navi/.wer das hidden-Attribut
   (gefunden bei der Sichtprüfung am 30.10.2026). */
[hidden] { display: none !important; }
body { margin: 0; background: var(--grund); color: var(--text); }
h1 { font-size: 1.25rem; margin: 0 0 .75rem; }
h2 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: var(--akzent); color: var(--akzent-text); border: 0; border-radius: 6px; padding: .45rem .8rem; cursor: pointer; }
button.leise, .filter button, .navi button { background: transparent; color: var(--text); border: 1px solid var(--linie); }
button.aktiv, .filter button.aktiv, .navi button.aktiv { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px; padding: .4rem .5rem; }
label { display: block; margin: .5rem 0; }
label input, label select, label textarea { display: block; width: 100%; margin-top: .25rem; }
label.inline { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
label.inline input { width: auto; display: inline-block; margin: 0; }

.kopf { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; padding: .6rem 1rem; background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 2; }
.marke { font-weight: 650; }
.abzeichen { font-weight: 500; font-size: .8rem; color: var(--warn); background: var(--warn-flaeche); border-radius: 999px; padding: .15rem .55rem; margin-left: .4rem; }
.navi { display: flex; flex-wrap: wrap; gap: .3rem; }
.wer { margin-left: auto; color: var(--leise); }
main { padding: 1rem; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 1rem 1.2rem; max-width: 1100px; }
.karte.schmal { max-width: 440px; margin: 2rem auto; }
.leiste { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .75rem; }
.filter { display: flex; gap: .3rem; flex-wrap: wrap; }
.leise-text { color: var(--leise); }
.meldung { min-height: 1.2em; color: var(--fehler); }
.meldung.gut { color: var(--gut); }
.hinweis { color: var(--leise); font-size: .9rem; }
.geheimnis { font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem; letter-spacing: .05em; background: var(--grund); padding: .6rem; border-radius: 6px; word-break: break-all; }
.codes { font-family: ui-monospace, Menlo, monospace; columns: 2; }

.tabellen-huelle { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; }
.tabelle { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.tabelle th, .tabelle td { padding: .35rem .5rem; border-bottom: 1px solid var(--linie); text-align: left; white-space: nowrap; vertical-align: top; }
.tabelle th { position: sticky; top: 0; background: var(--flaeche); font-weight: 600; font-size: .8rem; color: var(--leise); }
.tabelle td.zahl, .tabelle th.zahl { text-align: right; }
.tabelle td.grund { white-space: normal; min-width: 18rem; max-width: 30rem; color: var(--leise); font-size: .85rem; }
.grund-kurz { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tabelle tbody tr { cursor: pointer; }
.tabelle tbody tr:hover { background: var(--zeile-hover); }
.hoch { color: var(--gut); }
.tief { color: var(--fehler); }
.marke-warn { color: var(--warn); background: var(--warn-flaeche); border-radius: 4px; padding: 0 .3rem; font-size: .8rem; }
.marke-fehler { color: var(--fehler); background: var(--fehler-flaeche); border-radius: 4px; padding: 0 .3rem; font-size: .8rem; }
.marke-gut { color: var(--gut); background: var(--gut-flaeche); border-radius: 4px; padding: 0 .3rem; font-size: .8rem; }

.detail { margin-top: 1rem; }
.detail-gitter { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .25rem 1rem; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; margin: .75rem 0; }
.kachel { border: 1px solid var(--linie); border-radius: 8px; padding: .6rem .7rem; }
.kachel b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.schaetzung { border: 1px dashed var(--warn); background: var(--warn-flaeche); border-radius: 8px; padding: .7rem .9rem; }
textarea.json { width: 100%; min-height: 22rem; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.regel { border-top: 1px solid var(--linie); padding: .75rem 0; }

@media (max-width: 640px) {
  main { padding: .6rem; }
  .karte { padding: .8rem; }
  .wer { margin-left: 0; }
}
