/* node7 air status */
:root {
  --bg: #05080F;
  --bg-deep: #03060C;
  --surface: #08111C;
  --surface-2: #0C1A28;
  --line: rgba(31, 184, 214, .18);
  --line-strong: rgba(31, 184, 214, .38);
  --grid: #00465A;
  --cyan: #1FB8D6;
  --cyan-hi: #40E0FF;
  --highlight: #E1FCFF;
  --magenta: #FF4FD8;
  --text: #D8F4FF;
  --muted: #7C9CB0;
  --faint: #4A6577;
  --on-accent: #05080F;
  --node-core: #060E18;
  --glow: rgba(64, 224, 255, .6);
  --glow-bad: rgba(255, 79, 216, .7);
  --glow-wait: rgba(225, 252, 255, .9);
  --header-bg: rgba(5, 8, 15, .88);
  --tabbar-bg: rgba(5, 8, 15, .95);
  --glass: rgba(8, 17, 28, .78);
  --hero-top: #0C2234;
  --host-glow: rgba(31, 184, 214, .45);
  --bad-bg: rgba(255, 79, 216, .08);
  --bad-line: rgba(255, 79, 216, .45);
  --warn-bg: rgba(225, 252, 255, .06);
  --warn-line: rgba(225, 252, 255, .35);
  --ok-bg: rgba(64, 224, 255, .06);
  --ok-line: rgba(64, 224, 255, .3);
  --hover: rgba(31, 184, 214, .06);
  --shadow: 0 4px 20px rgba(0, 0, 0, .5);
  --grid-opacity: .55;
  --mono: "DejaVu Sans Mono", "Menlo", "Consolas", ui-monospace, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --r-lg: 16px;
  --r-md: 10px;
  --r-sm: 6px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
/* Helle Variante: manuell gewählt oder Systemeinstellung, solange nichts gewählt ist */
:root[data-theme="light"] {
  --bg: #EDF4F8;
  --bg-deep: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #E2EDF3;
  --line: rgba(10, 143, 176, .18);
  --line-strong: rgba(10, 143, 176, .38);
  --grid: #A9D3E2;
  --cyan: #0A8FB0;
  --cyan-hi: #077A97;
  --highlight: #0B1A26;
  --magenta: #C2188C;
  --text: #0B1A26;
  --muted: #4B6576;
  --faint: #7C95A4;
  --on-accent: #FFFFFF;
  --node-core: #FFFFFF;
  --glow: rgba(10, 143, 176, .35);
  --glow-bad: rgba(194, 24, 140, .35);
  --glow-wait: rgba(10, 143, 176, .6);
  --header-bg: rgba(237, 244, 248, .9);
  --tabbar-bg: rgba(237, 244, 248, .96);
  --glass: rgba(255, 255, 255, .86);
  --hero-top: #CFE6F0;
  --host-glow: rgba(10, 143, 176, .15);
  --bad-bg: rgba(194, 24, 140, .07);
  --bad-line: rgba(194, 24, 140, .4);
  --warn-bg: rgba(11, 26, 38, .04);
  --warn-line: rgba(11, 26, 38, .25);
  --ok-bg: rgba(10, 143, 176, .07);
  --ok-line: rgba(10, 143, 176, .3);
  --hover: rgba(10, 143, 176, .07);
  --shadow: 0 4px 18px rgba(11, 26, 38, .15);
  --grid-opacity: .8;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #EDF4F8;
    --bg-deep: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #E2EDF3;
    --line: rgba(10, 143, 176, .18);
    --line-strong: rgba(10, 143, 176, .38);
    --grid: #A9D3E2;
    --cyan: #0A8FB0;
    --cyan-hi: #077A97;
    --highlight: #0B1A26;
    --magenta: #C2188C;
    --text: #0B1A26;
    --muted: #4B6576;
    --faint: #7C95A4;
    --on-accent: #FFFFFF;
    --node-core: #FFFFFF;
    --glow: rgba(10, 143, 176, .35);
    --glow-bad: rgba(194, 24, 140, .35);
    --glow-wait: rgba(10, 143, 176, .6);
    --header-bg: rgba(237, 244, 248, .9);
    --tabbar-bg: rgba(237, 244, 248, .96);
    --glass: rgba(255, 255, 255, .86);
    --hero-top: #CFE6F0;
    --host-glow: rgba(10, 143, 176, .15);
    --bad-bg: rgba(194, 24, 140, .07);
    --bad-line: rgba(194, 24, 140, .4);
    --warn-bg: rgba(11, 26, 38, .04);
    --warn-line: rgba(11, 26, 38, .25);
    --ok-bg: rgba(10, 143, 176, .07);
    --ok-line: rgba(10, 143, 176, .3);
    --hover: rgba(10, 143, 176, .07);
    --shadow: 0 4px 18px rgba(11, 26, 38, .15);
    --grid-opacity: .8;
    color-scheme: light;
  }
}
.mark-light { display: none !important; }
:root[data-theme="light"] .mark-light { display: inline-block !important; }
:root[data-theme="light"] .mark-dark { display: none !important; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .mark-light { display: inline-block !important; }
  :root:not([data-theme]) .mark-dark { display: none !important; }
}


* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: var(--cyan-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--cyan-hi); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 700; }
small { font-size: .6em; }

/* ---------- Status-Knoten (wie die Endpunkte der 7 im Logo) ---------- */
.node {
  display: inline-block; flex: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--node-core);
  border: 3px solid var(--cyan-hi);
  box-shadow: 0 0 8px var(--glow);
}
.node.is-bad { border-color: var(--magenta); box-shadow: 0 0 9px var(--glow-bad); }
.node.is-off { border-color: var(--faint); box-shadow: none; }
.node.is-wait { border-color: var(--highlight); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 12px var(--glow-wait); } }

/* ---------- Buttons & Formulare ---------- */
.btn {
  font: 600 14px/1 var(--sans);
  border-radius: var(--r-md);
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: var(--cyan-hi); }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: var(--on-accent); }
.btn-primary:hover { background: var(--cyan-hi); }
.btn-ghost { background: transparent; }
.btn-small { padding: 7px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: wait; }

input, select {
  font: 15px var(--sans); color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  min-width: 0;
}
input:focus, select:focus { outline: none; border-color: var(--cyan-hi); box-shadow: 0 0 0 3px var(--ok-bg); }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--cyan); width: 16px; height: 16px; }

/* ---------- Boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot img { width: 72px; opacity: .8; }
.boot { background: var(--bg); }

/* ---------- Login ---------- */
.center-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 38%, var(--hero-top) 0%, var(--bg) 70%);
}
.login-card {
  width: min(380px, 100%);
  display: flex; flex-direction: column; gap: 14px;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 32px 28px 28px;
}
.login-mark { width: 88px; align-self: center; margin: -8px 0 -6px; }
.login-title { font: 700 22px/1.2 var(--mono); text-align: center; letter-spacing: -.01em; }
.login-sub { margin: -8px 0 6px; text-align: center; color: var(--muted); font-size: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input { font-size: 16px; padding: 11px 12px; }
.login-error { margin: 0; min-height: 1.2em; color: var(--magenta); font-size: 14px; }
.login-error:empty { display: none; }
.login-note { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- Kopfzeile ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 24px;
  background: var(--header-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand-host { font: 700 16px var(--mono); }
.tabs { display: flex; gap: 4px; }
.tabs a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r-md);
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.tabs a:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.tabs a[aria-current="page"] { color: var(--highlight); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--cyan); }
.tabs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.live { display: inline-flex; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--muted); }
.live .node { width: 10px; height: 10px; border-width: 2px; }

main { padding: 0 0 48px; }

/* ---------- Hero mit Horizont ---------- */
.hero {
  position: relative;
  padding: 36px 24px 28px;
  background: radial-gradient(ellipse 80% 120% at 50% 0%, var(--hero-top) 0%, var(--bg) 70%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.horizon {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 55%;
  pointer-events: none;
}
.horizon line { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: var(--grid-opacity); }
.horizon-line { fill: url(#hz); }
.hero-inner { position: relative; max-width: 1280px; margin: 0 auto; }
.host {
  font: 700 clamp(30px, 5.2vw, 52px)/1.05 var(--mono);
  letter-spacing: -.02em;
  color: var(--text);
  text-shadow: 0 0 22px var(--host-glow);
  overflow-wrap: anywhere;
}
.host-meta { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.verdict {
  display: flex; align-items: flex-start; gap: 14px;
  margin-top: 18px; padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--ok-line);
  background: linear-gradient(var(--ok-bg), var(--ok-bg)), var(--surface);
}
.verdict.is-warn { border-color: var(--warn-line); background: linear-gradient(var(--warn-bg), var(--warn-bg)), var(--surface); }
.verdict.is-bad { border-color: var(--bad-line); background: linear-gradient(var(--bad-bg), var(--bad-bg)), var(--surface); }
.verdict .node { margin-top: 5px; width: 16px; height: 16px; }
.verdict-title { margin: 0; font: 700 19px/1.3 var(--mono); }
.verdict.is-bad .verdict-title { color: var(--magenta); }
.verdict-list { margin: 6px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.verdict-list li { margin-top: 3px; }
.verdict-list li.is-bad { color: var(--text); }

.vitals {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  margin-top: 28px;
}
.vital {
  position: relative;
  padding: 16px 16px 12px;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--line);
}
.vital h2 { font: 600 13px var(--sans); color: var(--muted); }
.vital-num { margin: 4px 0 0; font: 700 38px/1.1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.vital-num small { font-size: 18px; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.vital-num-net { font-size: 24px; line-height: 1.55; }
.vital-sub { margin: 2px 0 8px; color: var(--muted); font-size: 13px; min-height: 1.5em; font-variant-numeric: tabular-nums; }
.vital.is-hot { border-color: var(--bad-line); }
.vital.is-hot .vital-num { color: var(--magenta); }
.spark { display: block; width: 100%; height: 32px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--cyan-hi); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark .spark-alt { stroke: var(--magenta); opacity: .75; }
.vital.is-hot .spark polyline:not(.spark-alt) { stroke: var(--magenta); }

/* ---------- Panels ---------- */
.grid {
  max-width: 1328px; margin: 24px auto 0; padding: 0 24px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  min-width: 0;
}
.panel-wide { grid-column: 1 / -1; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font: 700 16px var(--mono); color: var(--highlight); }
.panel-link { font-size: 13px; }
.empty { color: var(--muted); font-size: 14px; margin: 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kv-tight { margin-top: 14px; }

/* Balken */
.meter { margin-bottom: 14px; }
.meter:last-child { margin-bottom: 0; }
.meter-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.meter-head b { font: 700 14px var(--mono); overflow-wrap: anywhere; }
.meter-head span { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--cyan); }
.bar.is-hot i { background: var(--magenta); }
.meter-foot { margin-top: 5px; font-size: 12px; color: var(--faint); }

.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.core { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 11px var(--mono); color: var(--muted); }
.core-col { width: 100%; height: 52px; border-radius: var(--r-sm); background: var(--surface-2); position: relative; overflow: hidden; }
.core-col i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--cyan); }
.core-col.is-hot i { background: var(--magenta); }

.iface { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.iface:first-child { border-top: 0; padding-top: 0; }
.iface b { font: 700 14px var(--mono); }
.iface span { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.iface .tot { display: block; font-size: 12px; color: var(--faint); }

/* Stack-Übersicht */
.stack-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.stack-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text);
  border: 1px solid transparent;
}
.stack-chip:hover { text-decoration: none; border-color: var(--line-strong); }
.stack-chip b { font: 700 14px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-chip span { margin-left: auto; color: var(--muted); font: 12px var(--mono); white-space: nowrap; }
.stack-chip.is-bad { border-color: var(--bad-line); }

/* ---------- Container-Ansicht ---------- */
.toolbar {
  width: 100%; max-width: 1328px; margin: 20px auto 0; padding: 0 24px;
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
}
.toolbar input[type=search] { flex: 1 1 260px; }
#stacks { max-width: 1328px; margin: 16px auto 0; padding: 0 24px; display: flex; flex-direction: column; gap: 16px; }
.stack { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stack-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.stack-head h2 { font: 700 16px var(--mono); color: var(--highlight); }
.stack-head .dir { color: var(--faint); font: 12px var(--mono); overflow-wrap: anywhere; }
.stack-head .count { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.ctable { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.ctable .w-node { width: 46px; }
.ctable .w-main { width: 36%; }
.ctable .w-num { width: 96px; }
.ctable .w-act { width: 96px; }
.ctable th.num { text-align: right; }
.ctable th { text-align: left; font-weight: 600; font-size: 12px; color: var(--faint); padding: 8px 12px; }
.ctable td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.ctable th:first-child, .ctable td:first-child { padding-left: 18px; }
.ctable td:last-child { padding-right: 18px; text-align: right; }
.ctable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-name { font: 700 14px var(--mono); overflow-wrap: anywhere; }
.c-image { color: var(--faint); font: 12px var(--mono); overflow-wrap: anywhere; }
.c-status { color: var(--muted); }
.c-status.is-bad { color: var(--magenta); }
.c-ports { color: var(--faint); font: 12px var(--mono); }

/* ---------- Logs ---------- */
main:has(> .view-logs:not([hidden])) { padding-bottom: 0; }
.view-logs { display: flex; flex-direction: column; height: calc(100vh - 57px); height: calc(100dvh - 57px); }
.log-toolbar select#log-source { flex: 1 1 260px; max-width: 460px; }
.log-toolbar input[type=search] { flex: 1 1 160px; }
.log-toggles { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.log-state { max-width: 1328px; width: 100%; margin: 10px auto 0; padding: 0 24px; font-size: 13px; color: var(--muted); min-height: 1.5em; }
.log-state.is-bad { color: var(--magenta); }
.log-wrap { position: relative; flex: 1; min-height: 0; max-width: 1328px; width: 100%; margin: 6px auto 16px; padding: 0 24px; }
.log {
  height: 100%; overflow: auto;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 10px 0;
  font: 12.5px/1.55 var(--mono);
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}
.log.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.ll { display: flex; gap: 12px; padding: 0 14px; }
.ll:hover { background: var(--hover); }
.ll .t { color: var(--faint); flex: none; user-select: none; }
.log.no-ts .t { display: none; }
.ll .m { min-width: 0; }
.ll.err .m { color: var(--magenta); }
.ll.warn .m { color: var(--cyan-hi); }
.ll.stderr { box-shadow: inset 2px 0 0 var(--bad-line); }
.ll.sep { color: var(--cyan); padding-top: 4px; padding-bottom: 4px; }
.ll.hide { display: none; }
.log-jump { position: absolute; right: 40px; top: 12px; box-shadow: var(--shadow); }
.log-empty { padding: 18px 16px; color: var(--muted); font-family: var(--sans); white-space: normal; }

/* ---------- Responsiv ---------- */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  /* backdrop-filter wuerde die fixierte Tab-Leiste an den Kopf binden */
  .top { padding: 8px 14px; gap: 12px; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .brand img { width: 30px; height: 30px; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    justify-content: space-around; gap: 0;
    padding: 6px 6px calc(6px + var(--safe-b));
    background: var(--tabbar-bg);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .tabs a { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 10px; flex: 1; align-items: center; }
  .tabs a[aria-current="page"] { box-shadow: inset 0 2px 0 var(--cyan); background: transparent; }
  .tabs svg { width: 22px; height: 22px; }
  main { padding-bottom: calc(80px + var(--safe-b)); }
  .hero { padding: 24px 14px 20px; }
  .vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
  .vital { padding: 12px 12px 10px; }
  .vital-num { font-size: 30px; }
  .vital-num-net { font-size: 17px; line-height: 1.75; }
  .grid, .toolbar, #stacks { padding: 0 14px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 16px; }
  .panel { padding: 16px 14px 14px; }
  .stack-summary { grid-template-columns: minmax(0, 1fr); }

  /* Container als Karten-Zeilen */
  .ctable thead { display: none; }
  .ctable, .ctable tbody, .ctable tr, .ctable td { display: block; width: 100%; }
  .ctable tr {
    display: grid; grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 2px 10px; padding: 12px 14px; border-top: 1px solid var(--line);
  }
  .ctable td { padding: 0 !important; border: 0; width: auto !important; }
  .ctable td.c-node { grid-row: 1 / span 3; padding-top: 4px !important; }
  .ctable td.c-main { grid-column: 2; }
  .ctable td.c-act { grid-column: 3; grid-row: 1 / span 2; text-align: right; }
  .ctable td.c-st { grid-column: 2 / span 2; }
  .ctable td.num { grid-column: 2 / span 2; text-align: left; display: inline; }
  .ctable td.c-metrics { grid-column: 2 / span 2; text-align: left; color: var(--muted); font-size: 13px; }
  .ctable td.num-desk { display: none; }

  .view-logs { height: calc(100dvh - 51px - 70px - var(--safe-b)); }
  .log-toolbar select#log-source { max-width: none; flex-basis: 100%; }
  .log-state, .log-wrap { padding: 0 14px; }
  .log { font-size: 12px; }
  input, select, .login-card input { font-size: 16px; }
  .stack-head .dir { display: none; }
  .log-jump { right: 26px; }
  .live #live-text { display: none; }
}
@media (min-width: 761px) {
  .ctable td.c-metrics { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.boot-error { padding: 24px; }

/* ---------- Theme-Schalter ---------- */
.theme-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  font: 600 12px var(--sans); cursor: pointer;
}
.theme-btn:hover { color: var(--text); border-color: var(--cyan-hi); }
.theme-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-float { position: fixed; top: 14px; right: 14px; z-index: 30; }

/* ---------- Kurzstatus ---------- */
.landing-card {
  width: min(460px, 100%);
  display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  background: var(--glass);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 30px 26px 26px;
}
.landing-mark { width: 88px; align-self: center; margin: -8px 0 -6px; }
.landing-host { font: 700 20px/1.2 var(--mono); text-align: center; overflow-wrap: anywhere; }
.verdict-big { margin-top: 4px; padding: 18px; }
.verdict-big .node { width: 20px; height: 20px; border-width: 4px; margin-top: 4px; }
.verdict-big .verdict-title { font-size: 24px; }
.verdict-items { margin: -4px 0 0; padding: 0 4px; list-style: none; font-size: 14px; color: var(--muted); }
.verdict-items:empty { display: none; }
.verdict-items li { margin-top: 4px; }
.landing-meta { margin: 0; text-align: center; color: var(--faint); font-size: 13px; }
@media (max-width: 760px) {
  .theme-btn .theme-label { display: none; }
  .top-right { gap: 8px; }
}

/* ---------- Kacheln anklickbar ---------- */
.vital[role="button"] { cursor: pointer; }
.vital[role="button"]:hover { border-color: var(--line-strong); }
.vital h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vital-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vital[role="button"]:hover .vital-icon { stroke: var(--cyan-hi); }

/* ---------- Verlauf-Overlay ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 12, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-card {
  position: relative; width: min(920px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px;
  padding: 18px 20px 16px; box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { font: 700 20px var(--mono); color: var(--highlight); }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--cyan-hi); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.seg { display: inline-flex; margin-top: 14px; padding: 3px; border-radius: var(--r-md); background: var(--surface-2); gap: 2px; }
.seg button {
  font: 600 13px var(--sans); color: var(--muted); background: transparent; border: 0;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: inset 0 -2px 0 var(--cyan); }
.hist-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px 16px; margin: 16px 0 8px; }
.hist-stats div { min-width: 0; }
.hist-stats dt { font-size: 12px; color: var(--muted); }
.hist-stats dd { margin: 0; font: 700 18px var(--mono); font-variant-numeric: tabular-nums; }
.chart { position: relative; margin-top: 6px; }
.chart svg { display: block; width: 100%; height: 280px; touch-action: pan-y; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--faint); font: 11px var(--sans); }
.chart .line-avg { fill: none; stroke: var(--cyan-hi); stroke-width: 1.8; stroke-linejoin: round; }
.chart .line-max { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.chart .line-alt { fill: none; stroke: var(--magenta); stroke-width: 1.6; stroke-linejoin: round; opacity: .85; }
.chart .area { fill: var(--cyan-hi); opacity: .12; }
.chart .cursor { stroke: var(--muted); stroke-width: 1; }
.chart .dot { fill: var(--node-core); stroke: var(--cyan-hi); stroke-width: 2.5; }
.chart .dot-alt { stroke: var(--magenta); }
.chart-tip {
  position: absolute; top: 4px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 6px 9px; font-size: 12px; line-height: 1.45; box-shadow: var(--shadow); white-space: nowrap;
}
.chart-tip b { font: 700 13px var(--mono); }
.chart-legend { margin: 8px 0 0; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.chart-legend span::before { content: ""; display: inline-block; width: 14px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2px solid var(--cyan-hi); }
.chart-legend span.max::before { border-top: 1px dashed var(--muted); }
.chart-legend span.alt::before { border-top-color: var(--magenta); }
.chart-note { margin: 6px 0 0; font-size: 12px; color: var(--faint); min-height: 1.2em; }
body.modal-open { overflow: hidden; }
@media (max-width: 760px) {
  .modal { padding: 0; place-items: end stretch; }
  .modal-card { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding: 16px 14px calc(16px + var(--safe-b)); }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 9px 6px; }
  .chart svg { height: 230px; }
  .hist-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hist-stats dd { font-size: 15px; }
}
.chart-legend span.plain::before { display: none; }

/* ---------- Öffentliche Startseite ---------- */
body.mode-lite .tabs { display: none; }
.count-chip b { font-size: 20px; }
.count-chip span { margin-left: 0; font: 14px var(--sans); color: var(--muted); }
@media (max-width: 760px) {
  body.mode-lite main { padding-bottom: calc(32px + var(--safe-b)); }
  .stack-summary:has(.count-chip) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .count-chip { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* Status-Punkt der öffentlichen Startseite */
.host { display: flex; align-items: center; gap: 18px; }
.host-dot { width: 26px; height: 26px; border-width: 5px; flex: none; }
.host-dot:not(.is-bad):not(.is-wait) { box-shadow: 0 0 14px var(--glow); }
.host-dot.is-bad { box-shadow: 0 0 16px var(--glow-bad); }
body.mode-lite .vital h2, body.mode-lite .panel-head h2 { font-family: var(--mono); }
@media (max-width: 760px) { .host-dot { width: 20px; height: 20px; border-width: 4px; } .host { gap: 12px; } }

/* ---------- Container-Verlauf ---------- */
.modal-wide { width: min(1040px, 100%); }
.cm-headtext { min-width: 0; }
.cm-headtext h2 { overflow-wrap: anywhere; }
.cm-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.cm-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cm-now dd { font-size: 14px; }
.cchart { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.cchart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cchart-head h3 { margin: 0; font: 700 15px var(--mono); color: var(--highlight); }
.cchart-stats { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-small svg { height: 150px; }
.ctable tbody tr[data-name] { cursor: pointer; }
.ctable tbody tr[data-name]:hover td { background: var(--hover); }
@media (max-width: 760px) {
  .chart-small svg { height: 130px; }
  .cm-now { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.seg button { white-space: nowrap; }
@media (max-width: 760px) {
  .cm-bar .seg { flex: 1 1 auto; }
}

/* ---------- Konsole ---------- */
.view-console { display: flex; flex-direction: column; height: calc(100vh - 57px); height: calc(100dvh - 57px); }
main:has(> .view-console:not([hidden])) { padding-bottom: 0; }
.con-toolbar { justify-content: space-between; }
.con-state { display: inline-flex; align-items: center; gap: 10px; font: 600 14px var(--mono); min-width: 0; overflow-wrap: anywhere; }
.con-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.con-settings { max-width: 1328px; width: 100%; margin: 8px auto 0; padding: 0 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.con-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.con-form input { width: 100%; }
.con-form button { justify-self: start; }
.con-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.con-hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.con-hint code, .con-key { font-family: var(--mono); }
.con-key { margin: 10px 0; padding: 10px 12px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.con-fp { margin-top: 12px; }
.con-wrap { flex: 1; min-height: 0; max-width: 1328px; width: 100%; margin: 8px auto 16px; padding: 0 24px; }
/* Innenabstand am .xterm-Element, nicht am Container: FitAddon zieht nur diesen ab */
.term { height: 100%; background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; overflow: hidden; }
.term .xterm { height: 100%; box-sizing: border-box; padding: 8px 4px 8px 10px; }
.term .xterm-viewport { background: transparent !important; }
.con-keys { display: flex; gap: 6px; overflow-x: auto; padding: 0 14px 10px; -webkit-overflow-scrolling: touch; }
.con-keys button { flex: none; font: 600 13px var(--mono); padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); }
@media (max-width: 1080px) { .con-settings { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .view-console { height: calc(100dvh - 51px - 70px - var(--safe-b)); }
  .con-settings, .con-wrap { padding: 0 14px; }
  .term .xterm { padding: 6px 2px 6px 6px; }
}

/* Statusanzeige-Links */
.wall-hint { margin-top: 0; }
.wall-links { margin-top: 12px; grid-template-columns: auto minmax(0, 1fr); }
.wall-links dd { text-align: left; }
.wall-links code { font: 12px var(--mono); overflow-wrap: anywhere; user-select: all; }
.wall-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
