/* OSP-Server-Monitor · css/ansichten/last.css — Serverlast (0.9.8, Auftrag Server-Last 13.11.2026)
   Kopfzeile mit Ampel und Ergebnissatz, sechs Kacheln, Verlauf 24 h neben Befunden und Verbrauchern, Tagesspitzen
   (osp-tabelle.v1), zwei Ausklappfelder im Kopf. Der Inhaltsbereich scrollt nie: die Ansicht ist so hoch wie der Rumpf,
   die Tabelle bekommt die Resthöhe und scrollt in sich. Drei Anordnungen:
     breit (ab 1300 px, ab 561 px hoch): Tabelle links, Verlauf und Befunde als Spalte rechts (1366 × 650: 12 Zeilen)
     schmal (z. B. 960 × 1000): Verlauf | Befunde als niedrige Reihe (190 px) über der Tabelle, Kacheln 3 + 3
     niedrig (bis 560 px, z. B. 150 %): Verlauf und Befunde gehen per Schalter im Kopf über der Tabelle auf (8 Zeilen)
   Schrift mindestens 12 px, Ziele mindestens 24 px. Dunkel fest (Rahmen 2.10). */
#tab-last { --lw-polster: 16px; }
.lw { position: relative; container-type: inline-size; height: calc(100dvh - 44px - var(--lw-polster)); min-height: 0; min-width: 0;
  display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 190px minmax(0, 1fr);
  grid-template-areas: "kopf" "kacheln" "mitte" "tab"; }
.lw-kopf { grid-area: kopf; } .lw-kacheln { grid-area: kacheln; } .lw-mitte { grid-area: mitte; } .lw-tagesspitzen { grid-area: tab; }
@media (min-width: 1300px) and (min-height: 561px) {
  /* Die Tabelle braucht rund 830 px (Spalten 820 px, Werkzeugleiste einzeilig); was darüber hinaus frei ist, bekommen Verlauf
     und Befunde (mindestens 280, höchstens 600 px): kein leerer Streifen rechts neben der Tabelle bei 1640 px */
  .lw { grid-template-columns: minmax(0, 1fr) clamp(280px, calc(100% - 840px), 600px); grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "kopf kopf" "kacheln kacheln" "tab mitte"; }
  .lw .lw-mitte { grid-template-columns: minmax(0, 1fr); grid-template-rows: 200px minmax(0, 1fr); }   /* Verlauf oben, Befunde darunter */
  .lw .lw-mitte .lw-hd-s#lwChartSatz { display: none; }          /* schmale Spalte: der Satz steht im Lesetext des Diagramms */
}
.lw h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: 0; text-transform: none; }

/* Kopfzeile: Ampel-Badge, ein Satz Ergebnis, Zeit der Messung */
.lw-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 28px; min-width: 0; }   /* eng: zweite Zeile statt gekürzter Satz */
.lw-kopf > * { flex: none; }
.lw-kopf .lw-satz { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lw-kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lw-mitte-knopf { display: none; min-height: 26px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.lw-mitte-knopf[aria-expanded="true"] { background: #0070B0; border-color: #0070B0; color: #fff; }
.lw-kopf .badge { font-size: 12px; min-height: 22px; padding: 0 9px; }
.lw-satz { font-size: 14px; font-weight: 600; color: var(--text); }
.lw-stand { font-size: 12px; color: var(--text-2); }
.lw-alt { font-size: 12px; color: var(--warn); }
.lw-alt a { color: inherit; text-decoration: underline; }
.lw-kopf a.lw-badge-link { display: inline-flex; align-items: center; min-height: 24px; text-decoration: none; cursor: pointer;   /* Ziel ≥ 24 px */
  color: var(--warn); border-color: rgba(210, 153, 34, .35); background: rgba(210, 153, 34, .08); }   /* wie .lw-alt: lesbar statt grau */
.lw-kopf a.lw-badge-link:hover { text-decoration: underline; }

/* Kacheln: eine Reihe ab rund 830 px Breite (150 % mit offener Leiste), sonst umbrechend */
.lw-kacheln { display: grid; gap: 8px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
@container (max-width: 760px) { .lw-kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lw-tab-titel { display: none; } }   /* 960 px: 3 + 3, Werte ungekürzt; Werkzeugleiste einzeilig */
.lw-k { container-type: inline-size; position: relative; display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 6px 10px 7px 12px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--border); border-left: 3px solid var(--ok); border-radius: var(--radius); }
.lw-k[data-stufe="warn"] { border-left-color: var(--warn); }
.lw-k[data-stufe="crit"] { border-left-color: var(--crit); background: linear-gradient(180deg, rgba(248, 81, 73, .08), var(--panel-2)); }
.lw-k[data-stufe="na"] { border-left-color: var(--border-2); }
.lw-k-kopf { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.lw-k-l { font-size: 12px; line-height: 15px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-k-st { flex: none; display: inline-flex; width: 15px; height: 15px; color: #3fb950; }
.lw-k-st svg { width: 15px; height: 15px; }
.lw-kz { display: none; }
@container (max-width: 150px) { .lw-lg { display: none; } .lw-kz { display: inline; } }   /* 150 %: Kurzform statt „CPU-D…“ */
.lw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lw-k[data-stufe="warn"] .lw-k-st { color: #f0b429; }
.lw-k[data-stufe="crit"] .lw-k-st { color: #ff8078; }
.lw-k[data-stufe="na"] .lw-k-st { color: var(--text-3); }
.lw-k-v { font: 600 17px/22px var(--mono); letter-spacing: -.3px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-k-s { font-size: 12px; line-height: 15px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mitte: Verlauf und Befunde/Verbraucher, Höhe begrenzt, Befunde scrollen in sich */
.lw-mitte { display: grid; gap: 8px; min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); grid-template-rows: minmax(0, 1fr); }
.lw-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--border); border-radius: var(--radius); }
.lw-hd { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; min-height: 34px; padding: 4px 12px; border-bottom: 1px solid var(--border); }
.lw-hd-s { margin-left: auto; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.lw-chart { position: relative; flex: 1 1 0; min-height: 0; padding: 4px 8px 2px; }   /* das Diagramm füllt sein Feld */
.lw-seite-inhalt { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.lw-zw { font-size: 13px; }
.lw-befunde { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lw-b { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; align-items: baseline; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); }
.lw-b .badge { font-size: 12px; }
.lw-b--crit { border-color: rgba(248, 81, 73, .45); }
.lw-b--warn { border-color: rgba(210, 153, 34, .4); }
.lw-b-t { font-size: 13px; font-weight: 600; color: var(--text); }
.lw-b-x { grid-column: 2; font-size: 12.5px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.lw-vbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px 16px; }
.lw-vb h4 { margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.lw-liste { list-style: none; margin: 0; padding: 0; }
.lw-liste li { display: flex; justify-content: space-between; gap: 10px; min-height: 24px; align-items: center; font-size: 12.5px; border-bottom: 1px solid var(--border); }
.lw-liste li:last-child { border-bottom: 0; }
.lw-liste li > a { display: inline-flex; align-items: center; min-height: 24px; }
.lw-liste li > span, .lw-liste li > a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lw-liste b { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Tagesspitzen: Zahlen zentriert (Baustein), Freitext links, Werte über der Schwelle mit Punkt und Farbe */
.lw-tagesspitzen { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lw-tab { flex: 1 1 0; min-width: 0; min-height: 0; }
.lw-tab .ot { height: 100%; --ot-zf: 2; --ot-kopfh: 2.9em; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lw-tab .ot-titel { white-space: normal; line-height: 1.15; }                 /* Kopftexte zweizeilig statt Querscroll */
.lw-tab .ot-kopfzeile .ot-sort { font-size: 12px; padding: 0 12px 0 4px; gap: 3px; }   /* höchstens zwei Zeilen, nichts abgeschnitten */
.lw-tab td[data-spalte="verursacher"] .ot-z, .lw-tab th[data-key="verursacher"] { text-align: left; }
.lw-tab td[data-spalte="verursacher"] .ot-z { display: flex; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; -webkit-line-clamp: unset; }
.lw-tab .lw-vu-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; }                  /* nur die Namen werden gekürzt … */
.lw-tab .lw-vu-mehr { flex: none; color: var(--text-2); }                                        /* … „+1“ bleibt stehen */
.lw-tab td .ot-z { font-variant-numeric: tabular-nums; }
.lw-tab td[data-spalte="tag"] .ot-z, .lw-tab td[data-spalte="cpu_spitze_zeit"] .ot-z { white-space: nowrap; }
.lw-tab td[data-spalte="cpu_spitze_zeit"] .ot-z { padding: 0 4px; }   /* Größe „groß“: „20:55“ passt in 58 px */
.lw-tab .ot-z[data-lw]::before { content: "●"; margin-right: 5px; font-size: .8em; vertical-align: 1px; }
.lw-tab .ot-z[data-lw="warn"] { color: #fbbf24; }
.lw-tab .ot-z[data-lw="crit"] { color: #ff8078; font-weight: 600; }

/* Ausklappfelder im Kopf: Knopf in der Kopfzeile, Inhalt als Feld rechts unter dem Kopf, scrollt in sich */
.lw-leiste { display: flex; gap: 8px; align-items: center; }
.lw-leiste--leer { margin: 0 auto; }
.lw-auf { position: relative; }
.lw-auf > summary { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--panel); font-size: 12.5px; color: var(--text-2); cursor: pointer; list-style: none; white-space: nowrap; }
.lw-auf > summary::-webkit-details-marker { display: none; }
.lw-auf > summary::after { content: "▾"; margin-left: 6px; font-size: 12px; }
.lw-auf[open] > summary { color: var(--text); border-color: var(--text-3); }
.lw-auf-inhalt { position: absolute; z-index: 45; top: calc(100% + 4px); right: 0; width: min(560px, 80vw); max-height: calc(100dvh - 44px - 90px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 14px 12px; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .55); }
.lw-def, .lw-punkte { margin: 0; padding: 0; display: grid; gap: 8px; max-width: 75ch; }
.lw-def { list-style: none; }
.lw-punkte { padding-left: 18px; gap: 4px; }
.lw-def li { display: grid; gap: 1px; font-size: 12.5px; line-height: 1.45; }
.lw-def li b { font-weight: 600; color: var(--text); }
.lw-def li span { color: var(--text-2); }
.lw-punkte li { font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.lw-grund { font-size: 12px; }
.lw-klein { margin: 8px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.45; max-width: 75ch; }
.lw-link { margin: 8px 0 0; font-size: 12px; }
.lw-link a, .lw-leer a { display: inline-flex; align-items: center; min-height: 24px; }
.lw-leer { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.lw.lw--leer { display: block; height: auto; }
.lw-tab-titel { flex: none; margin: 0 2px 0 2px; font-size: 13px; white-space: nowrap; }
.lw-tab .ot-suche { flex: 1 1 10em; min-width: 8em; max-width: 16em; }   /* Werkzeugleiste bleibt einzeilig; freier Platz geht an die Suche (Platzhalter lesbar) */
.lw-leer--gross { margin: 24px auto; max-width: 70ch; text-align: center; font-size: 13px; line-height: 1.55; }
.lw a:focus-visible, .lw summary:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 1px; }

/* 150 % bzw. niedriges Fenster: Kopf + Kacheln ≤ 70 px, Verlauf und Befunde hinter dem Schalter, die Tabelle hat den Rest */
@media (max-height: 560px) {
  #tab-last { --lw-polster: 8px; }
  .lw { gap: 6px; grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "kopf" "kacheln" "tab"; }
  .lw-kopf { min-height: 26px; }
  .lw-satz { font-size: 13px; }
  .lw-stand { display: none; }                                  /* steht im Tooltip des Satzes */
  .lw-alt { display: none; }                                    /* „veraltet“: das Badge ist der Link zum Dienst, der Kopf bleibt einzeilig */
  .lw-mitte-knopf { display: inline-flex; align-items: center; }
  .lw-k { padding: 2px 8px 3px 10px; gap: 0; }
  .lw-k-v { font-size: 14px; line-height: 18px; }
  .lw-k-s { display: none; }                                     /* steht im Tooltip der Kachel */
  .lw-mitte { display: none; }
  /* geht über der Tabelle auf (gleiche Rasterfläche), unabhängig davon, ob der Kopf ein- oder zweizeilig ist */
  .lw--mitte-auf .lw-mitte { display: grid; grid-area: tab; position: relative; z-index: 40; align-self: start; height: min(260px, 100%);
    padding: 6px; background: var(--bg); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .55); }
}
@media (prefers-reduced-motion: reduce) { .lw * { transition: none !important; animation: none !important; } }
