/* KI-Studiobilder – Stil im Look von THE UNKNOWN BEAST: Near-Black, warmes Off-White, Gelb nur auf Dunkel */
:root {
  --dunkel: #161616;
  --dunkel-2: #1a1a1a;
  --text: #1a1a1a;
  --text-leise: #6b6862;
  --grund: #edebe4;
  --flaeche: #ffffff;
  --flaeche-leise: #e5e2da;
  --gelb: #ffff00;
  --gruen: #1f7a4d;
  --gruen-leise: #dcefe4;
  --rot: #b3261e;
  --rot-leise: #f6dedc;
  --blau-leise: #e1e6f2;
  --rund: 14px;
  --rund-klein: 10px;
  --pille: 999px;
  --luft: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--grund);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
img { display: block; max-width: 100%; }

/* Kopfleiste: Bereiche oben, rechts die Blase */
.leiste {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 28px; background: var(--dunkel); color: #fff;
}
.marke { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; text-decoration: none; }
.bereiche { display: flex; gap: 6px; }
.bereiche a {
  text-decoration: none; padding: 7px 14px; border-radius: var(--pille); color: #cfcfcf; font-weight: 500;
}
.bereiche a.aktiv { background: #2a2a2a; color: #fff; }
.blase {
  margin-left: auto; padding: 6px 14px; border-radius: var(--pille); background: #2a2a2a; color: #cfcfcf;
  font-size: 13px; font-weight: 500;
}

main { max-width: 1280px; margin: 0 auto; padding: 32px 28px 80px; }
.abschnitt { background: var(--flaeche); border-radius: var(--rund); padding: var(--luft); margin-bottom: 20px; }
.abschnitt > h2 { margin-bottom: 16px; }
.kopf { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.kopf .rechts { margin-left: auto; display: flex; gap: 10px; }
.leise { color: var(--text-leise); }
.klein { font-size: 13px; }

/* Pillen und Knoepfe */
.pille {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--pille);
  font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap; background: var(--flaeche-leise);
}
.pille.gelb { background: var(--gelb); color: var(--dunkel); }
.pille.fertig, .pille.bestanden { background: var(--gruen-leise); color: var(--gruen); }
.pille.fehler, .pille.durchgefallen { background: var(--rot-leise); color: var(--rot); }
.pille.laeuft { background: var(--dunkel); color: var(--gelb); }
.pille.wartet { background: var(--flaeche-leise); color: var(--text-leise); }
.pille.hinweis { background: var(--blau-leise); color: #2b3b66; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border: 0; border-radius: var(--pille); font: inherit; font-weight: 600; font-size: 14px; line-height: 1;
  cursor: pointer; text-decoration: none; background: var(--flaeche-leise); color: var(--text);
}
.knopf.haupt { background: var(--dunkel); color: #fff; }
.knopf.hell { background: #fff; color: var(--text); }
.knopf.klein { height: 32px; padding: 0 13px; font-size: 13px; }
.knopf:disabled { opacity: 0.45; cursor: default; }
.knopf:not(:disabled):hover { filter: brightness(0.95); }
.knopf.haupt:not(:disabled):hover { background: #000; }

/* Formular */
.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
label { display: grid; gap: 6px; align-content: space-between; font-weight: 600; font-size: 13.5px; }
label .leise { font-weight: 400; }
input[type=text], input[type=file] {
  width: 100%; height: 42px; padding: 0 14px; border: 0; border-radius: var(--rund-klein); background: var(--grund);
  font: inherit; color: var(--text);
}
input[type=file] { padding: 9px 12px; height: auto; }
.wahl { display: flex; gap: 8px; flex-wrap: wrap; }
.wahl button {
  height: 36px; padding: 0 15px; border: 0; border-radius: var(--pille); background: var(--grund); font: inherit;
  font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--text);
}
.wahl button.an { background: var(--dunkel); color: #fff; }
.wahl button:disabled { opacity: 0.4; cursor: default; }

.posen { display: grid; gap: 18px; }
.posen-reihe h3 { margin-bottom: 8px; }
.posen-auswahl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 640px; }
.posen-auswahl button {
  padding: 0; border: 0; border-radius: var(--rund-klein); overflow: hidden; cursor: pointer; background: none;
  outline: 3px solid transparent; outline-offset: -3px;
}
.posen-auswahl button.an { outline-color: var(--dunkel); }
.posen-auswahl img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; }

.farben { display: grid; gap: 8px; max-width: 640px; }
.farbe { display: grid; grid-template-columns: 42px 1fr 120px 36px; gap: 8px; align-items: center; }
.farbe input[type=color] {
  width: 42px; height: 42px; padding: 0; border: 0; border-radius: var(--rund-klein); background: none; cursor: pointer;
}
.farbe input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.farbe input[type=color]::-webkit-color-swatch { border: 0; border-radius: var(--rund-klein); }
.farbe .weg { width: 36px; height: 36px; padding: 0; }
.aktionen { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.formfuss { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.meldung-fehler { color: var(--rot); font-weight: 600; }

/* Auftragsliste */
.liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.eintrag {
  display: grid; gap: 10px; padding: 12px; border-radius: var(--rund); background: var(--flaeche); text-decoration: none;
}
.eintrag .bild { aspect-ratio: 3 / 4; border-radius: var(--rund-klein); background: var(--grund); overflow: hidden; }
.eintrag .bild img { width: 100%; height: 100%; object-fit: cover; }
.eintrag .zeile { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.leer { padding: 36px; text-align: center; color: var(--text-leise); background: var(--flaeche); border-radius: var(--rund); }

/* Auftrag */
.steckbrief { display: grid; grid-template-columns: 160px 1fr; gap: 6px 18px; font-size: 14px; }
.steckbrief dt { color: var(--text-leise); }
.steckbrief dd { margin: 0; }
.ansicht-kopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ansicht-kopf .meldung { color: var(--text-leise); font-size: 13.5px; }
.stufen { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.block { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--flaeche-leise); }
.block-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.block-kopf .knopf { margin-left: auto; }
.bilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.bilder.gross { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.kachel { display: grid; gap: 7px; align-content: start; }
.kachel img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--rund-klein); background: var(--grund);
  cursor: zoom-in;
}
.kachel.breit img { aspect-ratio: auto; }
.kachel.gewaehlt img { outline: 3px solid var(--dunkel); outline-offset: -3px; }
.kachel .unter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.kachel .befund { font-size: 12.5px; color: var(--text-leise); }
.farbfeld { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th { text-align: left; font-weight: 600; color: var(--text-leise); padding: 6px 10px 6px 0; }
.tabelle td { padding: 7px 10px 7px 0; border-top: 1px solid var(--flaeche-leise); }
.zahl { font-variant-numeric: tabular-nums; }
details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
pre.fehlertext { white-space: pre-wrap; font-size: 12px; background: var(--grund); padding: 12px; border-radius: var(--rund-klein); }

/* Vollbild */
.vollbild {
  position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: 1fr auto; gap: 12px; padding: 24px;
  background: rgba(10, 10, 10, 0.92);
}
.vollbild[hidden] { display: none; }
.vollbild img { max-height: calc(100vh - 110px); margin: 0 auto; object-fit: contain; border-radius: var(--rund-klein); }
.vollbild-leiste { display: flex; align-items: center; justify-content: center; gap: 16px; color: #fff; }
.vollbild .schliessen {
  position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: #2a2a2a; color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}

/* Zugangsseite */
body.zugang { display: grid; place-items: center; min-height: 100vh; }
.zugang-karte { display: grid; gap: 16px; width: min(360px, 90vw); padding: 28px; background: #fff; border-radius: var(--rund); }
.hinweis.fehler { margin: 0; color: var(--rot); font-weight: 600; font-size: 13.5px; }

@media (max-width: 700px) {
  .leiste { gap: 14px; padding: 12px 16px; }
  .blase { display: none; }
  main { padding: 20px 16px 60px; }
  .steckbrief { grid-template-columns: 1fr; }
  .farbe { grid-template-columns: 42px 1fr 36px; }
  .farbe .hex { display: none; }
}
