/* NEXUS Status – Stil im NEXUS-Markenbild (Farben und Schrift aus nexus-ui/src/app.css). Keine Inline-Stile (CSP). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }

/* ---------- Tokens: dunkel (Standard) ---------- */
:root {
  --bg: #090d15;
  --surface: #0e1420;
  --surface-2: #151e2e;
  --surface-3: #1d2940;
  --border: #202c40;
  --border-strong: #354765;
  --text: #edf2fc;
  --text-muted: #9aa9c1;
  --accent: #5688ff;
  --accent-strong: #8eafff;
  --accent-soft: rgb(86 136 255 / .13);
  --on-accent: #071126;
  --shadow: 0 10px 30px rgb(0 0 0 / .45);

  --ok: #22c55e;   --ok-text: #4ade80;   --ok-soft: rgb(34 197 94 / .12);
  --warn: #f59e0b; --warn-text: #fbbf24; --warn-soft: rgb(245 158 11 / .13);
  --down: #ef4444; --down-text: #f87171; --down-soft: rgb(239 68 68 / .14);
  --maint: #5688ff; --maint-text: #8eafff; --maint-soft: rgb(86 136 255 / .14);
  --unk: #64748b;  --unk-text: #a3b0c4;  --unk-soft: rgb(148 163 184 / .12);
  --on-c: #090d15;

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --fast: 120ms;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --surface-3: #e8e4db;
  --border: #ddd8cc;
  --border-strong: #c9c3b5;
  --text: #1b1a17;
  --text-muted: #5f5a50;
  --accent: #2454ca;
  --accent-strong: #2454ca;
  --accent-soft: rgb(41 90 216 / .10);
  --on-accent: #ffffff;
  --shadow: 0 10px 30px rgb(40 30 10 / .14);

  --ok: #16a34a;   --ok-text: #157335;   --ok-soft: rgb(22 163 74 / .10);
  --warn: #d97706; --warn-text: #a34a06; --warn-soft: rgb(217 119 6 / .11);
  --down: #dc2626; --down-text: #b91c1c; --down-soft: rgb(220 38 38 / .09);
  --maint: #2454ca; --maint-text: #2454ca; --maint-soft: rgb(36 84 202 / .09);
  --unk: #8f897c;  --unk-text: #5f5a50;  --unk-soft: rgb(120 110 90 / .10);
  --on-c: #ffffff;
  color-scheme: light;
}

/* Zustandsfarbe pro Element: --c (Fläche), --ct (Text), --cs (weicher Hintergrund) */
[class*="-operational"] { --c: var(--ok); --ct: var(--ok-text); --cs: var(--ok-soft); }
[class*="-degraded"] { --c: var(--warn); --ct: var(--warn-text); --cs: var(--warn-soft); }
[class*="-down"] { --c: var(--down); --ct: var(--down-text); --cs: var(--down-soft); }
[class*="-maintenance"] { --c: var(--maint); --ct: var(--maint-text); --cs: var(--maint-soft); }
[class*="-unknown"], [class*="-nodata"] { --c: var(--unk); --ct: var(--unk-text); --cs: var(--unk-soft); }
.notice-info { --c: var(--accent); --ct: var(--accent-strong); --cs: var(--accent-soft); }

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* Sticky-Kopf (56 px) darf weder Anker-Ziele noch Tastaturfokus verdecken. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1100px 420px at 50% -220px, var(--accent-soft), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-strong); text-underline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
code, .mono { font-family: var(--font-mono); font-size: .9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
h1, h2, h3, h4 { text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.noscript { max-width: 640px; margin: 40px auto; padding: 0 16px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding-inline: 16px; }
.wrap-wide { max-width: 1280px; }
@media (min-width: 640px) { .wrap { padding-inline: 24px; } }

.t-operational, .t-degraded, .t-down, .t-maintenance, .t-unknown { color: var(--ct); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 500; font-size: 14px;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--text-muted);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kopf und Fuß ---------- */
.site-head {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.brand-mark { color: var(--accent-strong); flex: none; }
.brand-word { font: 600 13px/1 var(--font-mono); letter-spacing: .16em; }
.brand-sep { width: 1px; height: 16px; background: var(--border-strong); }
.brand-sub { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.brand-tag { font: 500 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-strong); }
.head-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.head-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 9px; color: var(--text-muted); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.head-link:hover { background: var(--surface-2); color: var(--text); }

.site-foot { margin-top: 64px; border-top: 1px solid var(--border); padding: 22px 0 36px; font-size: 13px; color: var(--text-muted); }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-links a { color: var(--text-muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); text-decoration: underline; }
.foot-note { margin: 0; }

/* ---------- Zustandssymbole, Pillen, Abzeichen ---------- */
.si { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--c); color: var(--on-c); }
.si svg { stroke-width: 3; }
.si-14 { width: 14px; height: 14px; } .si-16 { width: 16px; height: 16px; } .si-18 { width: 18px; height: 18px; }
.si-20 { width: 20px; height: 20px; } .si-22 { width: 22px; height: 22px; }
.si-36 { width: 36px; height: 36px; box-shadow: 0 0 0 5px var(--cs); }
.si-44 { width: 44px; height: 44px; box-shadow: 0 0 0 6px var(--cs); }
.si-36 svg, .si-44 svg { stroke-width: 2.6; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px 1px 7px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1.6; color: var(--ct); background: var(--cs); white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
}
.pill svg { stroke-width: 2.6; flex: none; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 1.6;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap;
}
.badge.b-operational, .badge.b-degraded, .badge.b-down, .badge.b-maintenance { color: var(--ct); background: var(--cs); border-color: color-mix(in srgb, var(--c) 30%, transparent); }
.b-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); animation: pulse-c 2s infinite; }
.b-private { color: var(--accent-strong); background: var(--accent-soft); border-color: transparent; }
.b-phase-active { color: var(--ct); background: var(--cs); border-color: color-mix(in srgb, var(--c) 30%, transparent); }
@keyframes pulse-c { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 5px transparent; } }

/* ---------- Banner ---------- */
.banner {
  position: relative; margin: 28px 0 20px; padding: 20px 22px; border-radius: 16px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c, var(--border)) 38%, var(--border));
  background: linear-gradient(180deg, var(--cs, transparent), transparent 75%), var(--surface);
}
.banner-loading { --c: var(--border-strong); --cs: transparent; }
.banner-main { display: flex; align-items: center; gap: 16px; }
.banner-text { flex: 1 1 12rem; min-width: 0; } /* Basis > 0: auf schmalen Schirmen rutscht der Knopf unter den Text */
.banner-title { margin: 0; font-size: 1.4rem; line-height: 1.25; font-weight: 600; letter-spacing: -.012em; }
.banner-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.banner-sub a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); }
.banner-sub a:hover { color: var(--text); }
.banner-compact { margin-top: 24px; padding: 16px 18px; }
.banner-compact .banner-title { font-size: 1.2rem; }
.skeleton-pulse { animation: fade 1.1s ease-in-out infinite alternate; }
@keyframes fade { from { opacity: .35; } to { opacity: .8; } }

.statusline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.conn { display: inline-flex; align-items: center; gap: 8px; }
.conn svg { flex: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse-ok 2.6s infinite; }
@keyframes pulse-ok { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
.conn-err { color: var(--down-text); font-weight: 500; white-space: normal; }
.conn-stale { color: var(--warn-text); }
.conn-stale .live-dot { background: var(--warn); animation: none; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px -22px -20px; border-top: 1px solid color-mix(in srgb, var(--c, var(--border)) 20%, var(--border)); }
.stat { padding: 12px 22px 14px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat dt { font-size: 12px; color: var(--text-muted); }
.stat dd { margin: 2px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.stat-v { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12px; color: var(--text-muted); }
.stat-live .stat-note { color: var(--down-text); font-weight: 500; }

/* ---------- Hinweise ---------- */
.notices { display: grid; gap: 10px; margin-bottom: 8px; }
.notice {
  display: flex; gap: 14px; padding: 15px 18px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--c);
}
.notice-icon { color: var(--ct); flex: none; margin-top: 2px; }
.notice-body { min-width: 0; flex: 1; }
.notice-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
.notice-title { margin: 0; font-size: 15px; font-weight: 600; }
.notice-text { margin: 5px 0 0; font-size: 14px; color: var(--text-muted); }
.notice-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; font-size: 12.5px; color: var(--text-muted); }
.notice-meta span { display: inline-flex; align-items: center; gap: 6px; }
.notice.is-ended { border-left-color: var(--border-strong); }
.notice.is-ended .notice-icon { color: var(--text-muted); }

/* ---------- Abschnitte ---------- */
.section { margin-top: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.section-title { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -.005em; }
.section-sub { font-size: 13px; color: var(--text-muted); }

.seg { display: inline-flex; gap: 2px; margin: 0; padding: 3px; min-width: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.seg label { position: relative; display: block; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: block; padding: 4px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .18); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Gruppen und Dienste ---------- */
.groups { display: grid; gap: 14px; }
.group { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.group-head h3 { margin: 0; font: 500 12px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.group-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
.group-state svg { stroke-width: 2.6; }
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc { padding: 16px 18px 14px; }
.svc + .svc { border-top: 1px solid var(--border); }
.svc:target { background: var(--accent-soft); }
.svc-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.svc-top > .si { margin-top: 1px; }
.svc-name { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.svc-name a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.svc-name a:hover { text-decoration: underline; text-decoration-color: var(--border-strong); }
.svc-name .ext { color: var(--text-muted); opacity: .7; }
.svc-desc { margin: 1px 0 0; font-size: 13px; color: var(--text-muted); }
.svc-side { display: flex; align-items: center; gap: 18px; }
.svc-lat { display: flex; align-items: center; gap: 10px; }
.lat-v { min-width: 3.6rem; text-align: right; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.svc-state { display: flex; flex-direction: column; align-items: flex-end; min-width: 7.5rem; }
.state-label { font-size: 13.5px; font-weight: 600; }
.since { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.svc-summary { display: flex; align-items: center; gap: 7px; margin: 8px 0 0 32px; font-size: 13.5px; font-weight: 500; }
.svc-summary svg { flex: none; }

.facts { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 9px 0 0 32px; padding: 0; }
.fact { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; font-size: 12px; line-height: 1.7; }
.fact-k { padding: 0 7px; color: var(--text-muted); background: var(--surface-2); }
.fact-v { padding: 0 8px; font-family: var(--font-mono); font-size: 11.5px; }

/* 90-Tage-Leiste */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 32px; margin-top: 14px; }
.bars-empty { align-items: center; justify-content: center; font-size: 12.5px; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 6px; }
.bar { flex: 1 1 0; min-width: 2px; height: 100%; border-radius: 2px; background: var(--c); transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease); }
.bar-nodata { height: 42%; } /* Farbe --unk (≥ 3:1 zur Fläche, WCAG 1.4.11), Höhe als Formmerkmal */
.bar-degraded { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, color-mix(in srgb, var(--warn) 55%, var(--surface)) 3px 5px); }
/* Ausfall kreuzschraffiert, Eingeschränkt schräg, Wartung quer: Zustand auch ohne Farbe unterscheidbar */
.bar-down { background: repeating-linear-gradient(45deg, transparent 0 3px, color-mix(in srgb, var(--down) 45%, var(--surface)) 3px 4px), repeating-linear-gradient(-45deg, var(--down) 0 3px, color-mix(in srgb, var(--down) 45%, var(--surface)) 3px 4px); }
.bar-maintenance { background: repeating-linear-gradient(0deg, var(--maint) 0 3px, color-mix(in srgb, var(--maint) 55%, var(--surface)) 3px 5px); }
.bars:hover .bar { opacity: .55; }
.bars .bar:hover, .bars .bar:focus-visible { opacity: 1; transform: scaleY(1.08); }
.bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.bars-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.bars-foot > span { white-space: nowrap; }
.bf-up { text-align: center; }
.bf-up strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.narrow { display: none; }

.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 16px; margin: 12px 2px 0; padding: 0; list-style: none; font-size: 12px; color: var(--text-muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend .bar { flex: none; width: 8px; height: 14px; }
.legend .bar-nodata { height: 7px; }

/* Sparkline */
.spark { display: block; overflow: visible; flex: none; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--accent); opacity: .13; }
.spark-dot { fill: var(--accent-strong); }
.spark-gap { fill: var(--down); }
.spark-empty { font-size: 11.5px; color: var(--text-muted); }

/* Tooltip */
.tip {
  position: absolute; top: 0; left: 0; z-index: 60; width: max-content; max-width: min(280px, calc(100vw - 16px));
  padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 13px;
}
.tip[hidden] { display: none; }
/* Unsichtbare Brücke über den 10-px-Abstand (+ Rahmen) zum Balken: Maus kann auf den Tooltip wechseln */
.tip::before { content: ""; position: absolute; inset: -12px 0; z-index: -1; }
.tip-inner { display: grid; gap: 6px; }
.tip-date { font-weight: 600; }
.tip-kv { display: flex; justify-content: space-between; gap: 18px; color: var(--text-muted); }
.tip-kv strong { color: var(--text); font-variant-numeric: tabular-nums; }
.tip-kv strong.t-down, .tip-kv strong.t-degraded { color: var(--ct); }
.tip-muted { color: var(--text-muted); max-width: 220px; }
.tip-inc { list-style: none; margin: 2px 0 0; padding: 6px 0 0; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.tip-inc li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }

/* ---------- Vorfälle ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-day + .tl-day { margin-top: 18px; }
.tl-date { margin: 0 0 8px; font: 500 11.5px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.tl-items { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.inc { display: flex; gap: 12px; padding: 14px 16px; }
.inc + .inc { border-top: 1px solid var(--border); }
.inc > .si { margin-top: 1px; }
.inc.is-ongoing { background: linear-gradient(90deg, var(--cs), transparent 65%); }
.inc-body { min-width: 0; flex: 1; }
.inc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.inc-title { font-size: 14.5px; font-weight: 600; }
.inc-msg { margin: 3px 0 0; font-size: 14px; color: var(--text-muted); }
.inc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.empty { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px dashed var(--border-strong); border-radius: 12px; font-size: 14px; color: var(--text-muted); }
.empty p { margin: 0; }

/* ---------- Detailseite ---------- */
.d-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 36px; align-items: start; }
.d-nav { position: sticky; top: 56px; padding: 28px 0 16px; max-height: calc(100vh - 56px); overflow-y: auto; }
.d-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.d-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text-muted); text-decoration: none; position: relative; }
.d-nav a:hover { background: var(--surface-2); color: var(--text); }
.d-nav a[aria-current] { background: var(--accent-soft); color: var(--text); font-weight: 500; }
.d-nav a[aria-current]::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav-state { display: inline-flex; }
.d-main { min-width: 0; }
.dsec { padding-top: 30px; }
.dsec-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.dsec-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -.005em; }
.dsec-note { font-size: 12.5px; color: var(--text-muted); }
.sub-h { margin: 20px 0 0; font-size: 13.5px; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(128px, 100%), 1fr)); gap: 10px; margin-bottom: 8px; }
.tiles-sm { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.tile { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color var(--fast) var(--ease); }
a.tile:hover { border-color: var(--border-strong); }
.tile-degraded, .tile-down { border-color: color-mix(in srgb, var(--c) 42%, var(--border)); background: linear-gradient(180deg, var(--cs), transparent 90%), var(--surface); }
.tile-label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); }
.tile-v { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: break-word; hyphens: auto; }
.tile-note { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }

.dgroup { margin-top: 22px; }
.dgroup-title { margin: 0 0 8px; font: 500 12px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.dsvc { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.dsvc + .dsvc { margin-top: 10px; }
.dsvc-degraded, .dsvc-down { border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.dsvc-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.dsvc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.dsvc-title h4 { margin: 0; font-size: 15px; font-weight: 600; }
.dsvc-title h4 a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.dsvc-title .ext { color: var(--text-muted); }
.dsvc-id { font-size: 11.5px; color: var(--text-muted); }
.dsvc-state { display: flex; align-items: center; gap: 10px; }
.dsvc .svc-summary { margin-left: 30px; }
.dsvc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 10px; }
.dsvc-meta .facts { margin: 0; }
.dsvc .bars { height: 22px; margin-top: 12px; }
.uptimes { display: flex; gap: 18px; margin: 0; }
.uptimes div { display: flex; flex-direction: column; }
.uptimes dt { font-size: 11px; color: var(--text-muted); }
.uptimes dd { margin: 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Tabellen */
.table-wrap { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 8px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--border); }
.tbl thead th { border-top: 0; font-size: 11.5px; font-weight: 500; color: var(--text-muted); background: var(--surface-2); white-space: nowrap; }
.tbl tbody th { font-weight: 500; }
.tbl tr.row-down { background: color-mix(in srgb, var(--down) 6%, transparent); }
.tbl tr.row-degraded { background: color-mix(in srgb, var(--warn) 5%, transparent); }
.tbl .c-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .c-st { white-space: nowrap; }
.tbl .c-st .cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.c-title { display: block; font-weight: 500; }
.c-id, .c-sub { display: block; font-size: 11.5px; color: var(--text-muted); }
.c-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.c-message { display: block; }
.c-detail { display: block; margin-top: 2px; font-size: 11.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.c-msg { min-width: 220px; }
.c-latcell { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-when { white-space: nowrap; }
.c-mem { display: grid; gap: 5px; min-width: 110px; font-variant-numeric: tabular-nums; }
.c-daysv { display: grid; gap: 5px; min-width: 90px; }
.hbar { display: block; height: 6px; min-width: 48px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--c); }

/* Messanzeigen und Diagramme */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 10px; }
.meter { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.m-degraded, .m-down { border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.meter-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
.meter-flag { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.meter-val { margin: 3px 0 9px; font-size: 13.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); gap: 10px; margin-top: 10px; }
.chart { margin: 0; padding: 12px 14px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 12.5px; color: var(--text-muted); }
.chart-title { color: var(--text); font-weight: 500; }
.chart-readout { white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-plot { position: relative; height: 96px; cursor: crosshair; border-radius: 4px; }
.chart-svg { display: block; width: 100%; height: 100%; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-area { fill: var(--accent); opacity: .14; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.chart-cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--text-muted); pointer-events: none; }
.chart-cursor[hidden] { display: none; }
.chart-y { position: absolute; left: 2px; padding: 0 4px; border-radius: 3px; font-size: 10.5px; line-height: 1.4; color: var(--text-muted); background: color-mix(in srgb, var(--surface) 75%, transparent); pointer-events: none; font-variant-numeric: tabular-nums; }
.chart-ytop { top: 0; }
.chart-ymid { top: calc(50% - 8px); }
.chart-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.chart-empty { display: grid; place-items: center; height: 96px; font-size: 13px; color: var(--text-muted); }

/* Schlüssel-Wert-Raster */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); margin: 12px 0 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.kv-item { padding: 9px 14px; min-width: 0; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
.kv dt { font-size: 12px; color: var(--text-muted); }
.kv dd { display: flex; align-items: center; gap: 6px; margin: 1px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
.kv dd svg { flex: none; }
.kv-degraded dd, .kv-down dd, .kv-unknown dd { color: var(--ct); font-weight: 500; }

.callout { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; background: var(--cs); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.callout > svg { flex: none; margin-top: 2px; color: var(--ct); }
.callout-big { padding: 16px 18px; }
.callout-big strong { display: block; font-size: 15px; color: var(--ct); }
.callout-big p { margin: 4px 0 0; color: var(--text); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; margin-top: 14px; }
.card { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.card-degraded { border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-head h3 { margin: 0; font-size: 14px; }
.card .kv { border-radius: 8px; }
.problems { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.problems li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--warn-text); }
.problems svg { flex: none; margin-top: 3px; }

.ips { display: flex; flex-wrap: wrap; gap: 4px; }
.ip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0 6px; border-radius: 6px; font-size: 12px; line-height: 1.7; border: 1px solid var(--border); background: var(--surface-2); overflow-wrap: normal; } /* IP nie mitten im Wort trennen */
.ip-ok svg { color: var(--ok-text); }
.ip-bad { color: var(--down-text); background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 45%, transparent); }
.ip-tag { padding: 0 4px; border-radius: 4px; font: 500 10px/1.5 var(--font-sans); color: var(--warn-text); background: var(--warn-soft); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 0 6px; border-radius: 6px; font-size: 11.5px; line-height: 1.7; border: 1px solid var(--border); background: var(--surface-2); }

/* ---------- Anmeldung ---------- */
.login-wrap { display: grid; place-items: center; min-height: calc(100dvh - 57px); padding: 24px 16px; }
.login-box { display: grid; gap: 12px; width: 100%; max-width: 360px; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.login-box h1 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.login-box p { margin: 0; color: var(--text-muted); font-size: 14px; }
.login-box label { font-size: 13.5px; font-weight: 500; }
.login-box input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; }
.login-box input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-box .btn { justify-content: center; border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; }
.login-box .btn:hover { border-color: var(--accent-strong); background: var(--accent-strong); }
.login-box .login-error { padding: 8px 12px; border-radius: 8px; background: var(--down-soft); color: var(--down-text); font-weight: 500; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 900px) {
  .d-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .d-nav {
    position: sticky; top: 56px; z-index: 20; max-height: none; overflow-x: auto; overflow-y: hidden;
    margin: 0 -16px; padding: 8px 16px; scrollbar-width: none;
    background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  }
  .d-nav::-webkit-scrollbar { display: none; }
  .d-nav ul { display: flex; gap: 4px; width: max-content; }
  .d-nav a { white-space: nowrap; padding: 5px 10px; }
  .d-nav a[aria-current]::before { display: none; }
  html:has(> body.page-details) { scroll-padding-top: 120px; } /* Kopf + Abschnittsleiste */
}
@media (min-width: 640px) and (max-width: 900px) { .d-nav { margin: 0 -24px; padding: 8px 24px; } }

/* Tabellen als Karten, bis die volle Breite (1280 px) erreicht ist: Prüftabellen brauchen ~950 px. */
@media (max-width: 1279px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr { display: block; width: 100%; }
  .tbl tr { padding: 10px 12px; border-top: 1px solid var(--border); }
  .tbl tbody tr:first-child { border-top: 0; }
  .tbl th, .tbl td { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); gap: 10px; padding: 3px 0; border: 0; text-align: left; }
  .tbl th::before, .tbl td::before { content: attr(data-label); font-size: 12px; font-weight: 400; color: var(--text-muted); }
  .tbl .c-num { text-align: left; }
  .tbl .cell { min-width: 0; overflow-wrap: anywhere; }
  .c-msg { min-width: 0; }
  .table-wrap { overflow-x: visible; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .head-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .banner { margin-top: 20px; padding: 16px; }
  .banner-main { flex-wrap: wrap; gap: 14px; }
  .banner-title { font-size: 1.2rem; }
  .banner .statusline { flex-basis: 100%; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); }
  .banner .statusline .conn { white-space: normal; min-width: 0; }
  .stats { grid-template-columns: minmax(0, 1fr); margin: 14px -16px -16px; }
  .stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 16px; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--border); }
  .stat dd { justify-content: flex-end; margin: 0; }
  .section-head { align-items: flex-start; }
  .svc { padding: 14px 14px 12px; }
  .group-head { padding: 10px 14px; }
  .svc-top { grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; }
  .svc-side { grid-column: 2; flex-direction: row-reverse; justify-content: space-between; gap: 10px; }
  .svc-state { flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; margin-right: auto; } /* links, auch ohne Latenzblock */
  .svc-summary, .facts { margin-left: 32px; }
  .bars .bar:nth-child(-n+60) { display: none; }
  .wide { display: none; }
  .narrow { display: inline; }
  .bf-up { font-size: 11.5px; }
  .legend { justify-content: flex-start; }
  .notice { padding: 13px 14px; gap: 10px; }
  .inc { padding: 12px 14px; }
  .dsvc { padding: 12px 13px; }
  .dsvc-head { grid-template-columns: auto minmax(0, 1fr); }
  .dsvc-state { grid-column: 2; flex-wrap: wrap; }
  .dsvc .bars .bar:nth-child(-n+60) { display: none; }
}
@media (max-width: 400px) {
  .brand-sub, .brand-sep { display: none; }
  .spark { width: 84px; }
  .seg span { padding: 4px 8px; }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
