/* Handgeschrieben, eine Datei, eine Akzentfarbe.
   Es ist ein Arbeitswerkzeug, kein Produkt-Launch: keine Animationen, keine
   Verlaeufe, keine Icon-Bibliothek. Dichte Tabellen mit ruhiger Zeilenhoehe. */

:root {
  --akzent: #17557f;
  --akzent-schwach: #e8eef4;
  --fg: #16191d;
  --fg-leise: #5b636e;
  --bg: #ffffff;
  --flaeche: #f7f8fa;
  --linie: #dde1e6;
  --linie-stark: #c2c8d0;
  --warnung: #8a5300;
  --fehler: #99231d;

  --zeile: 1.55;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: var(--zeile);
  color: var(--fg);
  background: var(--bg);
}

/* --- Tastaturbedienung ------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--akzent);
  color: #fff;
  padding: 10px 16px;
  z-index: 10;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
}

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

.kopf {
  display: flex;
  align-items: baseline;
  gap: 28px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--linie);
  background: var(--flaeche);
}

.marke {
  font-weight: 600;
  font-size: 15px;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.kopf nav { display: flex; gap: 20px; }

.kopf nav a {
  color: var(--fg-leise);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.kopf nav a:hover { color: var(--fg); }
.kopf nav a[aria-current="page"] {
  color: var(--akzent);
  border-bottom-color: var(--akzent);
}

main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 26px 28px 80px;
}

/* --- Typografie -------------------------------------------------------- */

h1 { font-size: 21px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 30px 0 10px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }

a { color: var(--akzent); }

.leise { color: var(--fg-leise); }
.klein { font-size: 13px; }
.zahl { font-variant-numeric: tabular-nums; }

.seitenkopf {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

/* --- Formulare --------------------------------------------------------- */

form { margin: 0; }

label { display: block; font-weight: 500; margin-bottom: 5px; }

input[type="text"], input[type="url"], input[type="number"], select, textarea {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--linie-stark);
  border-radius: var(--radius);
  padding: 8px 10px;
  width: 100%;
}

/* Mehrere Seeds, einer je Zeile: Monospace, damit lange Links vergleichbar
   untereinander stehen, und senkrecht groesser ziehbar -- waagerecht nicht, das
   sprengte sonst die Spalte. */
textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 96px;
}

input[type="range"] { width: 200px; vertical-align: middle; }

fieldset {
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0;
}
legend { font-weight: 500; padding: 0 6px; }

.feld { margin-bottom: 20px; }
.feld .hinweis { font-size: 13px; color: var(--fg-leise); margin-top: 5px; }

.reihe { display: flex; gap: 20px; flex-wrap: wrap; }
.reihe > * { flex: 1 1 180px; }

.ankreuz { display: flex; gap: 20px; flex-wrap: wrap; }
.ankreuz label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 400;
  margin: 0;
}
.ankreuz input { margin: 0; }

button, .knopf {
  font: inherit;
  font-weight: 500;
  color: #fff;
  background: var(--akzent);
  border: 1px solid var(--akzent);
  border-radius: var(--radius);
  padding: 9px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .knopf:hover { background: #10466a; }

.knopf.leiser, button.leiser {
  color: var(--akzent);
  background: var(--bg);
  border-color: var(--linie-stark);
}
.knopf.leiser:hover, button.leiser:hover { background: var(--akzent-schwach); }

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

.meldung {
  border: 1px solid var(--linie);
  border-left: 3px solid var(--fg-leise);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  background: var(--flaeche);
}
.meldung.fehler { border-left-color: var(--fehler); color: var(--fehler); }
.meldung.warnung { border-left-color: var(--warnung); color: var(--warnung); }

/* --- Kennzahlen -------------------------------------------------------- */

.kennzahlen {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche);
  margin-bottom: 20px;
}
.kennzahl .wert { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kennzahl .name { font-size: 12px; color: var(--fg-leise); text-transform: uppercase; letter-spacing: 0.04em; }

/* --- Steuerleiste ueber der Liste -------------------------------------- */
/* Der Schieberegler steht hier, nicht in einem Einstellungsmenue. */

.steuerung {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.steuerung .gruppe { display: flex; align-items: center; gap: 9px; }
.steuerung label { margin: 0; font-weight: 500; white-space: nowrap; }
.steuerung .ausgabe {
  min-width: 34px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.steuerung select { width: auto; }
.steuerung .rechts { margin-left: auto; display: flex; gap: 10px; }

/* --- Tabelle ----------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-leise);
  padding: 0 12px 9px;
  border-bottom: 1px solid var(--linie-stark);
  white-space: nowrap;
}
th.rechts, td.rechts { text-align: right; }

td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--linie);
  vertical-align: top;
}

tbody tr:hover { background: var(--flaeche); }

.sp-bild { width: 78px; }
.sp-score { width: 215px; }
.sp-zahl { width: 82px; }
.sp-alter { width: 74px; white-space: nowrap; }

/* --- Score ------------------------------------------------------------- */

.score { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.balken {
  height: 4px;
  background: var(--akzent-schwach);
  border-radius: 2px;
  margin: 5px 0 7px;
  overflow: hidden;
}
.balken > span { display: block; height: 100%; background: var(--akzent); }

.aufschluesselung { font-size: 12px; color: var(--fg-leise); line-height: 1.45; }

/* --- Fundpfad-Chips ---------------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chip {
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--linie-stark);
  border-radius: 10px;
  color: var(--fg-leise);
  white-space: nowrap;
}
.chip.mehrfach { border-color: var(--akzent); color: var(--akzent); }

/* --- Vorschaubild: unscharf, Klick deckt auf --------------------------- */
/* Wer den ganzen Tag das Schlimmste der Plattform sichtet, dem hilft das. */

.vorschau { position: relative; display: block; width: 74px; }

.vorschau input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.vorschau label {
  display: block;
  margin: 0;
  cursor: pointer;
  position: relative;
  width: 74px;
  height: 99px;
  background: #e4e7ea;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
}

.vorschau img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: blur(9px);
}

.vorschau .hinweis {
  position: absolute;
  inset: auto 0 0 0;
  font-size: 10px;
  text-align: center;
  padding: 2px 0;
  background: rgba(255, 255, 255, 0.88);
  color: var(--fg-leise);
  letter-spacing: 0.03em;
}

.vorschau input:checked ~ label img { filter: none; }
.vorschau input:checked ~ label .hinweis { display: none; }
.vorschau input:focus-visible ~ label { outline: 2px solid var(--akzent); outline-offset: 2px; }

/* --- Aufklappzeile ----------------------------------------------------- */

.unterhalb {
  padding: 14px 12px;
  border-bottom: 1px solid var(--linie);
  color: var(--fg-leise);
  font-size: 14px;
}
.unterhalb button {
  background: none;
  border: none;
  color: var(--akzent);
  padding: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* --- Leerer Zustand ---------------------------------------------------- */

.leer {
  padding: 46px 24px;
  text-align: center;
  color: var(--fg-leise);
  border: 1px dashed var(--linie-stark);
  border-radius: var(--radius);
}

/* --- Status ------------------------------------------------------------ */

.status {
  display: inline-block;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 10px;
  border: 1px solid var(--linie-stark);
  color: var(--fg-leise);
  white-space: nowrap;
}
.status.laeuft { border-color: var(--akzent); color: var(--akzent); }
.status.fertig { border-color: #2f7d32; color: #2f7d32; }
.status.warnung { border-color: var(--warnung); color: var(--warnung); }
.status.fehler { border-color: var(--fehler); color: var(--fehler); }

/* --- Detailansicht ----------------------------------------------------- */

.zweispaltig { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 34px; }

.karte {
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.paare { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; }
.paare dt { color: var(--fg-leise); }
.paare dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.komponenten { width: 100%; }
.komponenten td { padding: 7px 0; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.komponenten .punkte { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.komponenten .roh { text-align: right; color: var(--fg-leise); font-size: 12px; font-variant-numeric: tabular-nums; }

.beschreibung {
  background: var(--flaeche);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-wrap: anywhere;
}

@media (max-width: 1279px) {
  .zweispaltig { grid-template-columns: 1fr; }
  main { padding: 20px 16px 60px; }
}

/* --- Anmeldung --------------------------------------------------------- */

.anmeldung {
  max-width: 380px;
  margin: 60px auto 0;
}
.anmeldung h1 { margin-bottom: 22px; }

/* --- Kopfzeile rechts -------------------------------------------------- */

.kopf-rechts {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

button.alslink {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--fg-leise);
  text-decoration: underline;
  cursor: pointer;
}
button.alslink:hover { color: var(--fg); background: none; }

/* --- Aktionsspalte ----------------------------------------------------- */

.aktionen {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.aktionen form { display: inline; }

button.klein, .knopf.klein {
  padding: 4px 10px;
  font-size: 13px;
}

/* --- Ertrags-Score (Phase 3) ------------------------------------------- */

.sp-ertrag { width: 118px; }
.sp-bewertung { width: 236px; }

/* Zweite Spalte optisch zuruecknehmen: Der Szene-Score fuehrt, der Ertrag
   ergaenzt. Gleiche Akzentfarbe, nur blasser. */
.balken.zweit > span { background: #7ba3c0; }

/* --- Bewertung --------------------------------------------------------- */

.bewertung {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.bewertung form { display: inline; }

.bewert-knopf {
  font: inherit;
  font-size: 12px;
  padding: 3px 9px;
  color: var(--fg-leise);
  background: var(--bg);
  border: 1px solid var(--linie-stark);
  border-radius: 10px;
  cursor: pointer;
}
.bewert-knopf:hover { background: var(--flaeche); color: var(--fg); }

.bewert-knopf.gewaehlt-relevant {
  background: #2f7d32; border-color: #2f7d32; color: #fff;
}
.bewert-knopf.gewaehlt-irrelevant {
  background: var(--fg-leise); border-color: var(--fg-leise); color: #fff;
}
.bewert-knopf.gewaehlt-handed_over {
  background: var(--akzent); border-color: var(--akzent); color: #fff;
}

/* Bewertete Zeilen treten zurueck, ohne zu verschwinden. */
tr.bewertet-irrelevant td, tr.bewertet-discarded td { opacity: 0.5; }
tr.bewertet-handed_over td { background: var(--akzent-schwach); }

/* --- Lexikon ----------------------------------------------------------- */

.schmal { width: 110px; }
tr.inaktiv td { opacity: 0.55; }

table input[type="text"], table input[type="number"] {
  padding: 4px 7px;
  font-size: 13px;
}

/* --- Kurzanleitung ------------------------------------------------------ */
/* Eingeklappt eine Zeile, aufgeklappt drei Saetze und ein Beispiel. Immer an
   derselben Stelle -- wer sie einmal gefunden hat, sucht sie nicht wieder. */

details.hilfe {
  border: 1px solid var(--linie);
  border-left: 3px solid var(--akzent);
  border-radius: var(--radius);
  background: var(--flaeche);
  margin-bottom: 22px;
}

details.hilfe > summary {
  cursor: pointer;
  padding: 10px 16px;
  font-weight: 500;
  color: var(--akzent);
  list-style: none;
}
details.hilfe > summary::-webkit-details-marker { display: none; }

details.hilfe > summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  color: var(--fg-leise);
}
details.hilfe[open] > summary::before { content: "▾"; }

details.hilfe > summary:hover { background: var(--akzent-schwach); }
details.hilfe > summary:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }

.hilfe-inhalt {
  padding: 0 16px 14px 32px;
  max-width: 78ch;
}
.hilfe-inhalt p { margin: 0 0 10px; }
.hilfe-inhalt p:last-child { margin-bottom: 0; }
.hilfe-beispiel { color: var(--fg-leise); font-size: 14px; }

/* --- Warnung, wenn Skripte nicht laufen ---------------------------------
   Umgekehrt herum gedacht: Der Kasten steht standardmaessig da und wird erst
   ausgeblendet, wenn app.js seine Marke gesetzt hat. Andersherum -- ihn per
   Skript einblenden -- waere genau dann wirkungslos, wenn er gebraucht wird.

   Die kurze Verzoegerung verhindert, dass er bei jedem Seitenaufbau
   aufblitzt: app.js laeuft mit `defer`, also erst nach dem Parsen. */
.ohne-skript {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--warnung-rand, #b45309);
  border-left-width: 4px;
  border-radius: 4px;
  background: var(--warnung-flaeche, #fffbeb);
  line-height: 1.5;
}
html.skript-laeuft .ohne-skript { display: none; }

/* Ein Loeschknopf soll aussehen wie ein Loeschknopf. */
.gefaehrlich {
  background: var(--gefahr, #b91c1c);
  border-color: var(--gefahr, #b91c1c);
  color: #fff;
}
.bestaetigung .gross { font-size: 1.05rem; margin: 0 0 6px; }

/* Umgekehrt zur Warnung oben: nur zeigen, wenn Skripte fehlen. */
html.skript-laeuft .nur-ohne-skript { display: none; }
