/* Kein Framework, keine Buendelung. Die Seite hat sechs Kacheln, davon eine mit einem
   Baum - dafuer genuegt, was der Browser mitbringt. */
:root {
  --grund: #12151a; --flaeche: #1a1f27; --rand: #2b323d;
  --text: #e6e9ef; --leise: #99a2b0;
  --gut: #57a773; --befund: #d98b3a; --schlecht: #c85a54; --neutral: #5a7fa8;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --grund: #f6f7f9; --flaeche: #fff; --rand: #dde1e7;
    --text: #1b1f26; --leise: #5b6472; color-scheme: light;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.kopf {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--rand); background: var(--flaeche);
  position: sticky; top: 0; z-index: 2;
}
.kopf h1 { font-size: 1rem; margin: 0; letter-spacing: .02em; }
.kopf__rechts { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.kopf__nutzer { display: flex; gap: .4rem; align-items: center; }
.marke { font-weight: 600; }
.alter { color: var(--leise); font-size: .8rem; }
button {
  font: inherit; padding: .3rem .7rem; border-radius: 6px;
  border: 1px solid var(--rand); background: transparent; color: inherit; cursor: pointer;
}
button:hover { border-color: var(--neutral); }
main { padding: 1rem; display: grid; gap: 1rem; max-width: 1400px; margin: 0 auto; }

.kachel { border: 1px solid var(--rand); border-radius: 8px; background: var(--flaeche); }
.kachel > h2 {
  font-size: .95rem; margin: 0; padding: .6rem .8rem;
  border-bottom: 1px solid var(--rand); display: flex; gap: .5rem; align-items: baseline;
}
.kachel > h2 .anzahl { color: var(--leise); font-weight: 400; font-size: .85rem; }
.kachel__inhalt { padding: .8rem; overflow-x: auto; }

/* Eine ausgefallene Quelle nimmt NICHT die Seite mit - sie sagt an ihrer Stelle,
   was fehlt. Fuer ein Werkzeug, das man wegen einer Stoerung oeffnet, ist das der
   ganze Unterschied. */
.fehler {
  border-left: 3px solid var(--schlecht); padding: .5rem .7rem;
  background: color-mix(in srgb, var(--schlecht), transparent 90%);
}
.fehler .hinweis { color: var(--leise); margin-top: .35rem; }

table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { text-align: left; padding: .3rem .5rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
th { color: var(--leise); font-weight: 600; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }

/* Zustand nie allein ueber Farbe: jede Marke traegt Text. */
.zustand { font-size: .78rem; padding: .05rem .4rem; border-radius: 4px; white-space: nowrap; }
.zustand--gut { background: color-mix(in srgb, var(--gut), transparent 78%); }
.zustand--befund { background: color-mix(in srgb, var(--befund), transparent 76%); }
.zustand--schlecht { background: color-mix(in srgb, var(--schlecht), transparent 78%); }
.zustand--neutral { background: color-mix(in srgb, var(--neutral), transparent 80%); }

/* Der Baum ist <details> - der Browser kann das, ohne dass jemand es nachbaut. */
details { margin-left: .9rem; }
details > summary { cursor: pointer; padding: .12rem 0; }
details > summary::marker { color: var(--leise); }
.baum > details { margin-left: 0; }
.datei { background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
         padding: .12rem 0; text-align: left; text-decoration: underline dotted; }
.bytes { color: var(--leise); font-size: .8rem; }
.luecke { color: var(--befund); }
.fuss { padding: .8rem 1rem; color: var(--leise); font-size: .8rem; border-top: 1px solid var(--rand); }
.fuss a { color: inherit; }
dialog { border: 1px solid var(--rand); border-radius: 8px; background: var(--flaeche);
         color: var(--text); max-width: min(90vw, 900px); width: 100%; }
dialog::backdrop { background: rgb(0 0 0 / 60%); }

/* =====================================================================================
   Der Protokoll-Betrachter
   =====================================================================================
   Vorher stand das Protokoll aufgeklappt in einer Tabellenzeile - mit fester Hoehe,
   ohne Suche, ohne Stellschrauben. Jetzt ist es ein Fenster, das fast den ganzen Schirm
   nimmt: Wer ein Protokoll liest, tut nichts anderes daneben.

   Die Hoehe ist FEST (85vh) und nicht vom Inhalt abhaengig. Sonst springt das Fenster
   bei jedem Nachladen in eine andere Groesse - und beim 5-Sekunden-Takt waere das
   unbenutzbar. */
.lv {
  max-width: min(96vw, 1400px);
  width: 100%;
  height: 85vh;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.lv-kopf {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .8rem; border-bottom: 1px solid var(--rand);
}
.lv-titel { margin: 0; font-size: .95rem; }
.lv-zu { border: 0; font-size: 1rem; line-height: 1; padding: .2rem .5rem; }

.lv-leiste {
  display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center;
  padding: .6rem .8rem; border-bottom: 1px solid var(--rand);
  font-size: .82rem; color: var(--leise);
}
.lv-leiste label { display: flex; gap: .35rem; align-items: center; }
.lv-leiste select, .lv-leiste input {
  font: inherit; font-size: .85rem; color: var(--text); background: var(--grund);
  border: 1px solid var(--rand); border-radius: 5px; padding: .2rem .35rem;
}
.lv-leiste input[type="number"] { width: 5.5rem; }
.lv-haken { cursor: pointer; }
.lv-haken input { accent-color: var(--neutral); }
.lv-suche { flex: 1 1 14rem; }
.lv-suche input { flex: 1; min-width: 8rem; }

/* Der Rollbereich ist das Herz: Er bekommt den ganzen Rest der Hoehe (flex: 1) und
   rollt selbst - nicht das Fenster. Nur so bleibt die Leiste beim Blaettern stehen. */
.lv-text {
  flex: 1; overflow: auto; padding: .6rem .8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem; line-height: 1.5; tab-size: 2;
  white-space: pre;
}
.lv-text--umbruch { white-space: pre-wrap; word-break: break-word; }
.lv-zeile { padding: 0 .3rem; border-left: 2px solid transparent; }
.lv-zeile:hover { background: color-mix(in srgb, var(--neutral), transparent 92%); }
/* Eine Lesehilfe, kein Urteil - siehe logviewer.js. */
.lv-zeile--fehler { border-left-color: var(--schlecht);
  background: color-mix(in srgb, var(--schlecht), transparent 92%); }
.lv-zeile--warn { border-left-color: var(--befund);
  background: color-mix(in srgb, var(--befund), transparent 93%); }
/* Der Zeitstempel steht in jeder Zeile vorn und verdeckt sonst, weswegen man hinsieht. */
.lv-zeit { color: var(--leise); }

.lv-fuss { padding: .5rem .8rem; border-top: 1px solid var(--rand); }
.knopf {
  font: inherit;
  font-size: .8rem;
  padding: .2rem .6rem;
  border-radius: .4rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.knopf[disabled] { opacity: .5; cursor: progress; }
