[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }

:root {
  color-scheme: light;
  --page: #f1f1ec;
  --surface: #fcfcfa;
  --surface-2: #f6f6f2;
  --ink: #1b1b18;
  --ink-2: #55544f;
  --muted: #7d7c76;
  --grid: #e3e2db;
  --axis: #c6c5bc;
  --rule: rgba(27, 27, 24, 0.12);
  --btn: #1b1b18;
  --btn-ink: #fcfcfa;
  --btn-hover: #3a3a35;
  --focus: #1b1b18;
  --drop: #e8e8e1;
  --good: #0ca30c; --good-ink: #006300; --good-bg: rgba(12, 163, 12, 0.10);
  --warn: #c98a00; --warn-bg: rgba(250, 178, 25, 0.18);
  --crit: #d03b3b; --crit-bg: rgba(208, 59, 59, 0.10);
  --info-bg: rgba(27, 27, 24, 0.06);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #111110; --surface: #1a1a19; --surface-2: #20201e;
    --ink: #f3f2ec; --ink-2: #c3c2b7; --muted: #8f8e87;
    --grid: #2c2c2a; --axis: #3d3d39; --rule: rgba(255, 255, 255, 0.10);
    --btn: #f3f2ec; --btn-ink: #111110; --btn-hover: #d8d7cf; --focus: #f3f2ec; --drop: #232321;
    --good-ink: #3fc23f; --good-bg: rgba(12, 163, 12, 0.18);
    --warn: #fab219; --warn-bg: rgba(250, 178, 25, 0.14);
    --crit: #e66767; --crit-bg: rgba(208, 59, 59, 0.20);
    --info-bg: rgba(255, 255, 255, 0.07);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111110; --surface: #1a1a19; --surface-2: #20201e;
  --ink: #f3f2ec; --ink-2: #c3c2b7; --muted: #8f8e87;
  --grid: #2c2c2a; --axis: #3d3d39; --rule: rgba(255, 255, 255, 0.10);
  --btn: #f3f2ec; --btn-ink: #111110; --btn-hover: #d8d7cf; --focus: #f3f2ec; --drop: #232321;
  --good-ink: #3fc23f; --good-bg: rgba(12, 163, 12, 0.18);
  --warn: #fab219; --warn-bg: rgba(250, 178, 25, 0.14);
  --crit: #e66767; --crit-bg: rgba(208, 59, 59, 0.20);
  --info-bg: rgba(255, 255, 255, 0.07);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
}

* { box-sizing: border-box; }
body {
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1140px; margin: 0 auto; padding: 28px 20px 64px; display: grid; gap: 28px; }
@media (max-width: 520px) { .wrap { padding-inline: 16px; padding-block: 20px 48px; } }

h1, h2, h3 { font-family: var(--display); font-weight: 600; text-wrap: balance; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(30px, 5vw, 40px); line-height: 1.05; text-transform: uppercase; }
h2 { font-size: 22px; text-transform: uppercase; letter-spacing: 0.03em; }
h3 { font-size: 17px; letter-spacing: 0.02em; }
p { margin: 0; }
.eyebrow { font: 500 12px/1.2 var(--mono); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.lede { color: var(--ink-2); max-width: 64ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

header.top { display: grid; gap: 8px; }

/* Laden */
.load { display: grid; gap: 12px; }
.drop {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; border: 1.5px dashed var(--axis); border-radius: 10px;
  background: var(--surface); cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.drop:hover, .drop.over { background: var(--drop); border-color: var(--ink-2); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop .ico { width: 38px; height: 38px; flex: none; color: var(--ink-2); }
.drop strong { font-weight: 600; }
.drop .sub { color: var(--muted); font-size: 13px; }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.files li {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%;
  padding: 5px 6px 5px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--rule);
  font-size: 13px;
}
.files .fname { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.msg { font-size: 13px; color: var(--ink-2); min-height: 1.2em; }
.msg.err { color: var(--crit); }

/* Buttons & Formular */
button, input, select { font: inherit; color: inherit; }
.btn {
  appearance: none; border: 0; border-radius: 7px; padding: 7px 14px; cursor: pointer;
  background: var(--btn); color: var(--btn-ink); font-weight: 500; font-size: 14px;
}
.btn:hover { background: var(--btn-hover); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn.ghost:hover { background: var(--info-bg); }
.x {
  appearance: none; border: 0; background: transparent; cursor: pointer; color: var(--muted);
  width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; flex: none;
}
.x:hover { background: var(--info-bg); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input[type="text"], input[type="number"], input[type="datetime-local"], select {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 7px; padding: 6px 9px;
  font-size: 14px; min-width: 0; max-width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 0; }
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); min-width: 0; }

/* Filterzeile */
.filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
}
.filters .grp { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.filters .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--surface); cursor: pointer; font-size: 13px; user-select: none;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip.off { color: var(--muted); background: transparent; }
.chip.off .key { opacity: 0.3; }
.key { display: inline-block; width: 16px; height: 3px; border-radius: 2px; flex: none; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; padding: 2px; background: var(--surface); }
.seg button { appearance: none; border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }

/* Abschnitte */
section.block { display: grid; gap: 14px; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.head p { color: var(--ink-2); font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px 12px; display: grid; gap: 10px; min-width: 0; }
.card h3 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card h3 .muted { font: 400 12px var(--sans); letter-spacing: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); list-style: none; margin: 0; padding: 0; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.note { font-size: 12.5px; color: var(--muted); }
.chartbox { position: relative; width: 100%; min-width: 0; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
svg .grid { stroke: var(--grid); stroke-width: 1; }
svg .axis { stroke: var(--axis); stroke-width: 1; }
svg .tick { fill: var(--muted); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
svg .tick.major { fill: var(--ink-2); }
svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg .enddot { stroke: var(--surface); stroke-width: 2; }
svg .cross { stroke: var(--ink-2); stroke-width: 1; }
svg .empty { fill: var(--muted); font: 12.5px var(--sans); }

/* Tabellen */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; white-space: nowrap; }
th { font-weight: 500; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
td .big { font-size: 15px; font-weight: 600; }
.devcell { display: flex; gap: 9px; align-items: baseline; }
.devcell .key { transform: translateY(-3px); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border-radius: 999px;
  font-size: 12px; font-weight: 500; margin-top: 3px; white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; flex: none; }
.pill.good { background: var(--good-bg); color: var(--good-ink); }
.pill.warn { background: var(--warn-bg); color: var(--ink); }
.pill.warn svg { color: var(--warn); }
.pill.crit { background: var(--crit-bg); color: var(--ink); }
.pill.crit svg { color: var(--crit); }
.pill.info { background: var(--info-bg); color: var(--ink-2); }

/* Verzögerung */
.strip { display: grid; gap: 4px; }
.strip + .strip { margin-top: 6px; }
.striphead { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 13px; }
.striphead b { font-weight: 600; }

/* Details */
details.dev { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
details.dev > summary { cursor: pointer; padding: 11px 16px; display: flex; gap: 10px; align-items: center; list-style: none; }
details.dev > summary::-webkit-details-marker { display: none; }
details.dev > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(-45deg); transition: transform 0.15s; flex: none; }
details.dev[open] > summary::before { transform: rotate(45deg); }
details.dev .body { padding: 0 16px 16px; display: grid; gap: 14px; }
details.dev h4 { margin: 0 0 4px; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
details.dev .tablewrap { border-radius: 8px; }
.cmd { font-family: var(--mono); font-size: 12px; white-space: normal; word-break: break-word; color: var(--ink-2); }

/* Datenverbrauch */
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.formgrid .btn { height: 34px; }
.sim { display: grid; gap: 8px; }
.sim + .sim { border-top: 1px solid var(--rule); padding-top: 14px; }
.simhead { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.simhead b { font-weight: 600; }
.result { font-size: 14px; color: var(--ink-2); }
.result strong { color: var(--ink); font-weight: 600; }
.banner { font-size: 13px; padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); }

/* Geräte */
.devtable input { width: 100%; min-width: 9ch; }
.devtable td { white-space: normal; }

.empty-state { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 22px; display: grid; gap: 8px; }
.empty-state ol { margin: 4px 0 0; padding-left: 20px; color: var(--ink-2); display: grid; gap: 4px; }

details.method { background: transparent; border-top: 1px solid var(--rule); padding-top: 14px; }
details.method summary { cursor: pointer; font-weight: 500; }
details.method ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); max-width: 80ch; font-size: 14px; }

.tip {
  position: fixed; z-index: 20; pointer-events: none; min-width: 150px; max-width: 280px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14); padding: 8px 10px; font-size: 12.5px;
}
.tip .th { color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.tip .row { display: flex; align-items: center; gap: 8px; }
.tip .row b { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 52px; }
.tip .row span:last-child { color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

#summary td:nth-child(3) { white-space: normal; min-width: 210px; }
#summary td:nth-child(3) .sub { max-width: 30ch; }

.filters .push { margin-left: auto; }
.filters .push .msg { align-self: center; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.pdfscope {
  position: fixed; left: -12000px; top: 0; width: 720px; pointer-events: none; background: #ffffff;
  --surface: #ffffff; --surface-2: #f6f6f2; --ink: #1b1b18; --ink-2: #55544f; --muted: #7d7c76;
  --grid: #e3e2db; --axis: #c6c5bc; --rule: rgba(27, 27, 24, 0.12);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
}
.pdfscope .pdfhost { width: 720px; }

/* ---------- Server-Version ---------- */
.topline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.who { font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.who button { appearance: none; border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 0; font-size: 13px; }
.login { display: grid; justify-items: start; }
.login .card { width: min(100%, 380px); }
.login input { width: 100%; }
.filters .wide { width: 100%; margin: -4px 0 0; }
.chip .x { width: 20px; height: 20px; margin: -2px -4px -2px 0; }
.picker { position: relative; }
.picker > summary { list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.picker > summary::-webkit-details-marker { display: none; }
.pickpanel {
  position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; width: min(92vw, 380px);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16); display: grid; gap: 8px;
}
.pickpanel input[type="search"] { width: 100%; background: var(--surface); border: 1px solid var(--rule); border-radius: 7px; padding: 6px 9px; font-size: 14px; }
.picklist { max-height: 320px; overflow-y: auto; display: grid; gap: 2px; }
.pick { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; align-items: center; padding: 6px 6px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.pick:hover { background: var(--info-bg); }
.pick .pname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick input:disabled + .dot + .pname { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--axis); }
.dot.on { background: var(--good); }
body.loading #results { opacity: 0.55; transition: opacity 0.2s; }
.devtable input:disabled, #rform :disabled, .card input:disabled { opacity: 0.6; }
