/* Ketoverse — Gestaltung wie in den Fachreferenzen des Projekts:
   Laborregister-Anmutung, Petrol als Akzent, Statusfarben davon getrennt. */

:root {
  --ground: #E4E9E9;
  --surface: #FAFCFC;
  --surface-2: #EDF2F2;
  --ink: #16242A;
  --ink-muted: #566A6F;
  --ink-faint: #7C8E92;
  --accent: #1A4F5C;
  --line: #C6D1D2;
  --line-stark: #A9B8BA;
  --gruen: #2C6E52;
  --gelb: #8A6614;
  --rot: #A03A29;
  --neutral: #66787C;
  --gruen-fl: #E2EFE8;
  --gelb-fl: #F3EBD7;
  --rot-fl: #F5E3DF;
  --neutral-fl: #E7ECEC;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0E1618;
    --surface: #172224;
    --surface-2: #1E2C2F;
    --ink: #E3EBEB;
    --ink-muted: #94A6A9;
    --ink-faint: #74898D;
    --accent: #74BAC7;
    --line: #2A393C;
    --line-stark: #3D5054;
    --gruen: #63AC86;
    --gelb: #CBA246;
    --rot: #DC7864;
    --neutral: #8FA2A6;
    --gruen-fl: #172C24;
    --gelb-fl: #2C2617;
    --rot-fl: #2E1D1A;
    --neutral-fl: #1F2B2E;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.huelle { max-width: 68rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

:where(a, button, input, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Kopf ---------- */

.kopf { border-bottom: 3px double var(--line-stark); background: var(--surface); }
.kopf-inhalt {
  display: flex; flex-direction: column; gap: .75rem;
  padding-top: clamp(2rem, 5vw, 3.5rem); padding-bottom: clamp(1.6rem, 4vw, 2.5rem);
}
.marke {
  margin: 0; font-family: var(--mono); font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-faint);
}
h1 {
  margin: 0; font-family: var(--serif); font-size: clamp(1.9rem, 5vw, 2.7rem);
  font-weight: 600; line-height: 1.1; letter-spacing: -.015em; text-wrap: balance;
}
.lede { margin: 0; max-width: 46rem; color: var(--ink-muted); }
.lede strong { color: var(--ink); font-weight: 600; }

/* ---------- Suche ---------- */

main { padding-bottom: 4rem; }

.suche {
  display: flex; flex-direction: column; gap: 1rem;
  padding: clamp(1.4rem, 4vw, 2rem) 0 1.2rem;
}

.feld { display: flex; flex-direction: column; gap: .4rem; }
.feld-label {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-faint);
}
#suchfeld {
  font: inherit; font-size: 1.15rem; padding: .7rem .9rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-stark); border-radius: 2px; width: 100%;
}

.filter {
  display: flex; flex-wrap: wrap; gap: 1.2rem 1.8rem; align-items: center;
  font-size: .92rem; color: var(--ink-muted);
}
.filter label { display: inline-flex; align-items: center; gap: .45rem; }
.filter select {
  font: inherit; padding: .25rem .4rem; background: var(--surface);
  color: var(--ink); border: 1px solid var(--line); border-radius: 2px;
}

.trefferzahl {
  margin: 0; font-variant-numeric: tabular-nums;
  font-size: .9rem; color: var(--ink-faint);
}

/* ---------- Ergebnisse ---------- */

.tabellenhuelle {
  overflow-x: auto; border: 1px solid var(--line);
  border-radius: 2px; background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td {
  text-align: left; padding: .6rem .8rem;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
thead th {
  position: sticky; top: 0; z-index: 1;
  font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 700; background: var(--surface-2);
  border-bottom: 1px solid var(--line-stark);
}
.einheit {
  display: block; font-weight: 500; letter-spacing: .04em;
  text-transform: none; opacity: .8;
}
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.schwach { color: var(--ink-muted); }

.zelle-name { min-width: 17rem; display: flex; flex-direction: column; gap: .18rem; }
.name { font-weight: 500; }
.gruppe { font-size: .78rem; color: var(--ink-faint); }

.marken { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.marken > span {
  font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .12rem .4rem; border-radius: 2px;
  background: var(--neutral-fl); color: var(--neutral);
}
.marke-abgeleitet { background: var(--gelb-fl); color: var(--gelb); }
.marke-unbelegt { background: var(--rot-fl); color: var(--rot); }
.marke-unsicher { background: var(--gelb-fl); color: var(--gelb); }

.zelle-ampel { text-align: center; width: 4.5rem; }
.ampel {
  display: inline-block; width: .85rem; height: .85rem; border-radius: 50%;
  border: 1px solid rgb(0 0 0 / .12);
}
.ampel-gruen { background: var(--gruen); }
.ampel-gelb { background: var(--gelb); }
.ampel-rot { background: var(--rot); }
.ampel-unbekannt { background: var(--neutral); opacity: .45; }
.ampel-aus {
  width: auto; height: auto; border: none; border-radius: 2px;
  font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .12rem .4rem; background: var(--neutral-fl); color: var(--neutral);
}

.bezug { margin: .7rem 0 0; font-size: .85rem; color: var(--ink-faint); }
.leer { margin: 2rem 0; color: var(--ink-muted); }

.mehr-huelle { margin: 1.2rem 0 0; }
.mehr {
  font: inherit; font-size: .95rem; padding: .55rem 1.1rem; cursor: pointer;
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--line-stark); border-radius: 2px;
}
.mehr:hover { background: var(--surface-2); }

/* ---------- Hinweise ---------- */

.hinweis-medizin {
  margin-top: 3rem; padding: 1.3rem 1.5rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 2px;
}
.hinweis-medizin h2 {
  margin: 0 0 .5rem; font-family: var(--serif);
  font-size: 1.15rem; font-weight: 600;
}
.hinweis-medizin p { margin: 0; color: var(--ink-muted); font-size: .95rem; }

.fuss {
  border-top: 1px solid var(--line); padding: 1.6rem 0 3rem;
  font-size: .85rem; color: var(--ink-faint);
}
.fuss p { margin: 0 0 .5rem; max-width: 52rem; }

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