/* cx33 - Bausteine: Tabellen, Diagnoseliste, Logs, Hinweisfelder.
   Anmeldeseite, Kurzmeldungen und Rueckfragen stehen in meldungen.css. */

/* --- Tabellen und Listen ------------------------------------------------- */

table.list {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Gruppenueberschrift: wie die Spaltenkoepfe. Das Namensfeld darin soll wie
   der Name aussehen. */
table.list tr.gruppe td {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); padding: 16px 14px 4px; border-bottom: 0;
}
.gruppen-name {
  width: auto; min-width: 12ch; margin: 0; padding: 2px 6px; font: inherit;
  background: transparent; border-color: transparent; color: inherit;
}
.gruppen-name:hover { border-color: var(--line-lt); }
table.list th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--faint);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
table.list tr:last-child td { border-bottom: none; }
table.list td.right { text-align: right; }
table.list td.nowrap, table.list code.nowrap { white-space: nowrap; }
table.result td { font-family: var(--mono); font-size: 12px; white-space: pre; }

/* Auf schmalen Schirmen wird aus jeder Zeile ein Block: die Kopfzeile faellt
   weg, jede Zelle bekommt ihre Beschriftung aus data-label. Zellen ohne
   Beschriftung stehen voll in der Breite. Ergebnistabellen der SQL-Konsole
   bleiben Tabellen und scrollen in ihrem .scroll-Rahmen. */
@media (max-width: 760px) {
  table.list:not(.result) { display: block; border: 0; background: none; }
  table.list:not(.result) thead { display: none; }
  table.list:not(.result) tbody { display: block; }

  table.list:not(.result) tr {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 14px;
    margin-bottom: 10px;
  }

  table.list:not(.result) td { display: flex; gap: 12px; padding: 7px 0; text-align: left; }
  table.list:not(.result) td.right { justify-content: flex-start; }
  table.list:not(.result) tr:last-child td { border-bottom: 1px solid var(--line); }
  table.list:not(.result) tr td:last-child { border-bottom: 0; }

  table.list:not(.result) td[data-label]::before {
    content: attr(data-label);
    flex: none;
    width: 110px;
    color: var(--faint);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    padding-top: 2px;
  }
}

dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 16px; margin: 0; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }

.muted { color: var(--muted); font-size: 13px; }
.strong { font-weight: 600; color: var(--text); }
.bad-text { color: var(--bad); }
/* Eine Nebenangabe unter einer Hauptangabe - leiser als .muted, aber noch
   lesbar. Steht unter dem Zielordner einer Erweiterung. */
.klein { color: var(--muted); font-size: 11.5px; }

/* Die Commit-Auswahl in der Erweiterungsliste. Dieselbe Hoehe wie ein kleiner
   Knopf - sie steht in derselben Zeile wie "Ausrollen", und zwei Kaesten
   nebeneinander, die sich um sieben Pixel unterscheiden, sieht man sofort.
   Nicht in Schreibmaschinenschrift: die kostet ein Drittel der Breite, und
   der Betreff ist hier laenger als die Kennung. */
.commit-wahl {
  max-width: 100%;
  width: 26ch;
  padding: 6px 11px;
  font-size: 12.5px;
  /* Ein <select> rechnet seine Zeilenhoehe selbst und laesst sich per
     line-height nicht umstimmen - es waere drei Pixel flacher als der kleine
     Knopf daneben. Also dieselbe Rechnung von Hand: Polsterung und Rahmen
     (6+6+1+1) plus die Zeilenhoehe des Textes (1.55). Dass beide gleich hoch
     bleiben, misst erweiterung-commit.test.mjs im Browser - eine Zahl, die
     hier steht und dort nicht geprueft wird, laeuft irgendwann auseinander. */
  height: calc(14px + 1.55em);
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 8px;
}

.empty {
  padding: 48px;
  text-align: center;
  color: var(--faint);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--faint); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.off { background: var(--line-lt); }

/* --- Diagnose ------------------------------------------------------------ */

ul.checks { list-style: none; margin: 0; padding: 0; }
ul.checks li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.checks li:last-child { border-bottom: none; }
.check-name { font-size: 14px; font-weight: 550; }

.badge {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #0b0d11;
}

.badge.ok { background: var(--ok); }
.badge.warn { background: var(--warn); }
.badge.fail { background: var(--bad); }

.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 10px; }
/* Nur die Breite. Hoehe, Polsterung und Schriftgrad kommen aus base.css und
   muessen dieselben sein wie beim Knopf daneben - eine eigene Angabe hier
   gewinnt (diese Datei laedt spaeter) und macht das Feld drei Pixel hoeher
   als die Zeile, in der es steht. Genau so war es. */
.bar input[type="search"] { width: 220px; }
.bar label.check { margin: 0; }

/* Jedes Log traegt dieselbe Leiste. Der einzige farblich abgesetzte Knopf ist
   "Leeren": rot heisst im ganzen Panel "macht etwas kaputt". */
.log-block .bar { margin-top: 0; }
.log-block .log-hinweis { margin: 8px 0 0; font-size: 12px; }
pre.log:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Liste der Commits, die noch nicht installiert sind. */
ul.commits { list-style: none; margin: 0 0 16px; padding: 0; font-size: 13px; }
ul.commits li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.commits li:last-child { border-bottom: none; }

/* --- Logs ---------------------------------------------------------------- */

pre.log {
  margin: 0;
  max-height: 380px;
  overflow: auto;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre.log.short { max-height: 220px; }
pre.log.tall { max-height: 520px; }
pre.log.done-ok { border-color: rgba(52, 211, 153, .5); }
pre.log.done-bad { border-color: rgba(248, 113, 113, .5); }

/* Eine Zeile, ein Element - damit sich vorne eine entfernen und hinten eine
   anhaengen laesst, statt bei jeder ankommenden Zeile alles neu aufzubauen.
   Sichtbar ist der Unterschied nicht: ein Block je Zeile sieht in einem <pre>
   genauso aus wie Text mit Umbruechen. Die Begruendung: log-render.js. */
pre.log > span { display: block; }

pre.log .l-step { color: var(--accent); font-weight: 600; }
pre.log .l-warn { color: var(--warn); }
pre.log .l-bad { color: var(--bad); font-weight: 600; }
pre.log .l-ok { color: var(--ok); }
pre.log mark { background: rgba(109, 140, 255, .25); color: var(--text); border-radius: 3px; }

/* --- Reiter --------------------------------------------------------------- */

/* Eine Zeile, ueberall dieselbe. Der aktive Reiter traegt eine Linie statt
   eines Kastens - das bleibt ruhig, auch bei sechs nebeneinander. Schmale
   Schirme scrollen waagerecht; umbrechen machte die Kopfzeile ungleich hoch. */
.reiter-zeile {
  display: flex; gap: 2px; margin: 0 0 20px; overflow-x: auto;
  border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.reiter-zeile::-webkit-scrollbar { display: none; }
.reiter {
  flex: 0 0 auto; padding: 9px 14px; font-size: 13.5px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.reiter:hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.reiter.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.reiter-marke {
  display: inline-grid; place-items: center; margin-left: 7px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--warn); color: #1b1300; font-size: 11px; font-weight: 700;
}

/* --- Fortschritt ---------------------------------------------------------- */

/* Schritte statt geratener Prozente - er springt, die Uebergangszeit ist
   deshalb bewusst traege. */
.fortschritt { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; width: 100%; }
.fortschritt-schiene {
  flex: 1; height: 6px; border-radius: 3px;
  overflow: hidden; background: var(--panel-2); border: 1px solid var(--line);
}
.fortschritt-fuellung {
  height: 100%; width: 0; border-radius: 3px;
  background: var(--accent); transition: width .6s ease;
}
.fortschritt[data-zustand="fertig"] .fortschritt-fuellung { background: var(--ok); }
.fortschritt[data-zustand="fehler"] .fortschritt-fuellung { background: var(--bad); }
.fortschritt [data-balken-text] { flex: 0 0 auto; font-size: 12.5px; }
