/* Schriften: Doto, Geist, Geist Mono (Variable), jeweils SIL Open Font License 1.1 (siehe public/fonts/LICENSE-FONTS.txt). Lokal eingebunden, keine externen Anfragen. */
@font-face { font-family: "Doto"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/doto-latin-wght-normal.woff2) format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/geist-latin-wght-normal.woff2) format("woff2"); }
@font-face { font-family: "GeistMono"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/geist-mono-latin-wght-normal.woff2) format("woff2"); }

:root {
  --u: 44px;
  --pitch: calc(var(--u) + 2px);
  --rail: 30px;

  --plate-a: #2e323d;
  --plate-b: #23262e;
  --edge: #0d0e12;
  --silk: #9097a8;
  --lcd-bg: #09110e;
  --lcd-fg: #b9ffd9;
  --lcd-dim: #78d6a6;
  --g: #3ddc84;
  --a: #ffb020;
  --b: #4aa8ff;
  --r: #ff5a5f;
  --btn: #1a1c22;
  --btn-hi: #3a3f4c;
  --light: #e9ecf5;

  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "GeistMono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --dot: "Doto", "GeistMono", ui-monospace, monospace;
}
html[data-theme="day"] {
  --bg1: #fbfcff; --bg2: #e3e7f1; --text: #1b1e27; --muted: #566074;
  --panel: #ffffff; --panel-text: #1b1e27; --panel-edge: #1b1e27;
  --floor: rgba(30, 40, 90, 0.28); --rack-glow: transparent;
}
html[data-theme="night"] {
  --bg1: #1b2238; --bg2: #090b10; --text: #e9ecf5; --muted: #a2aac0;
  --panel: #1b1e28; --panel-text: #e9ecf5; --panel-edge: #4a5062;
  --floor: rgba(0, 0, 0, 0.6); --rack-glow: rgba(61, 220, 132, 0.10);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(1100px 760px at 50% 8%, var(--bg1), var(--bg2) 75%) fixed;
  background-color: var(--bg2);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
  overflow-x: hidden;
  transition: background-color 0.4s, color 0.4s;
}
html.blackout body { background: #04050a; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--b); outline-offset: 3px; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Effekt-Ebenen ---------- */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; z-index: 1; }
#confettiLayer { z-index: 45; }
html[data-theme="day"] #starLayer { display: none; }
.p { position: absolute; top: -40px; line-height: 1; animation: fall linear; will-change: transform; }
html[data-theme="day"] .p.flake { filter: drop-shadow(0 0 1px #5b6a99); }
.star { position: absolute; color: #fff; animation: twinkle 2.4s ease-in-out infinite; line-height: 1; }
@keyframes fall { from { transform: translate3d(0, 0, 0) rotate(0deg); } to { transform: translate3d(var(--sway, 0px), 112vh, 0) rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }

/* Taschenlampe beim Stromausfall */
#darkMask {
  position: fixed; inset: 0; z-index: 44; pointer-events: none; opacity: 0; transition: opacity 0.6s;
  background: radial-gradient(circle 170px at var(--mx, 50%) var(--my, 50%), rgba(3, 4, 8, 0) 0, rgba(3, 4, 8, 0.55) 55%, rgba(3, 4, 8, 0.94) 100%);
}
html.blackout #darkMask { opacity: 1; }
@media (pointer: coarse) { #darkMask { background: rgba(3, 4, 8, 0.6); } }

/* ---------- Bühne und Rack ---------- */
.stage { position: relative; z-index: 2; padding: clamp(20px, 4vw, 44px) 14px 40px; }
.rack-wrap { position: relative; width: min(580px, 100%); margin: 0 auto; }
.rack {
  position: relative;
  padding: 18px 0 20px;
  background: linear-gradient(180deg, #1b1d23, #121318);
  border-radius: 10px;
  box-shadow: 0 0 0 3px #0c0d10, inset 0 0 0 2px #2b2e37, 0 40px 70px -24px rgba(15, 20, 50, 0.55), 0 0 90px var(--rack-glow);
}
.rack .shadow { position: absolute; left: 4%; right: 4%; bottom: -26px; height: 40px; background: radial-gradient(closest-side, var(--floor), transparent); filter: blur(6px); z-index: -1; }
.rack::before, .rack::after {
  content: "";
  position: absolute;
  top: 8px; bottom: 8px;
  width: var(--rail);
  background-color: #0e0f14;
  background-image: radial-gradient(circle at 50% 50%, #000 0 3px, #2e323c 3.5px 4.6px, transparent 5px);
  background-size: 100% calc(var(--pitch) / 3);
  box-shadow: inset 0 0 0 1px #1d2027;
}
.rack::before { left: 4px; border-radius: 6px 0 0 6px; }
.rack::after { right: 4px; border-radius: 0 6px 6px 0; }
.units { position: relative; margin: 0 calc(var(--rail) + 6px); display: flex; flex-direction: column; gap: 2px; z-index: 1; }
.unums { position: absolute; left: -26px; top: 18px; display: flex; flex-direction: column; }
.unums span { height: var(--pitch); display: flex; align-items: center; justify-content: flex-end; width: 20px; font: 500 10px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.floor { height: 205px; }

.unit {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 9px 18px;
  min-height: calc(var(--h) * var(--pitch) - 2px);
  background: linear-gradient(180deg, var(--plate-a), var(--plate-b));
  border: 1px solid var(--edge);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 1px 0 rgba(255, 255, 255, 0.04);
  color: var(--light);
}
.unit::before, .unit::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 9px; height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  background:
    linear-gradient(transparent 42%, rgba(0, 0, 0, 0.65) 42% 58%, transparent 58%),
    radial-gradient(circle at 35% 30%, #959cac, #3b3f4a 62%, #1b1d23);
}
.unit::before { left: 5px; transform: rotate(35deg); }
.unit::after { right: 5px; transform: rotate(-20deg); }

.sl { margin: 0; font: 600 10px/1.3 var(--mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--silk); }
.sl.v { writing-mode: vertical-rl; transform: rotate(180deg); align-self: center; white-space: nowrap; }
.grow { flex: 1; }

/* ---------- LEDs ---------- */
.led {
  --c: var(--g);
  display: inline-block;
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65), 0 0 7px var(--c), inset 0 0 2px rgba(255, 255, 255, 0.8);
  transition: opacity 0.25s, background 0.2s, box-shadow 0.2s;
}
.led.a { --c: var(--a); }
.led.b { --c: var(--b); }
.led.r { --c: var(--r); }
.led.dim { opacity: 0.15; box-shadow: none; }
.led.blink { animation: ledblink var(--bd, 1.6s) steps(1) infinite; animation-delay: var(--dl, 0s); }
@keyframes ledblink { 0%, 62% { opacity: 1; } 63%, 100% { opacity: 0.2; } }
.unit.off .led { opacity: 0.08; box-shadow: none; animation: none; }
html.led-xmas .led { animation: xmasled 1.4s steps(1) infinite; animation-delay: var(--dl, 0s); }
@keyframes xmasled {
  0% { background: #ff5a5f; box-shadow: 0 0 7px #ff5a5f; }
  50% { background: #3ddc84; box-shadow: 0 0 7px #3ddc84; }
}
html.led-party .led { animation: party 2.2s linear infinite; animation-delay: var(--dl, 0s); }
@keyframes party { to { filter: hue-rotate(360deg); } }
html.led-halloween .led, html.led-halloween .led.a, html.led-halloween .led.b, html.led-halloween .led.r { --c: #ff8a1f; }
html.led-love .led, html.led-love .led.a, html.led-love .led.b { --c: #ff5fa8; }

/* ---------- LCD ---------- */
.lcd {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  background: var(--lcd-bg);
  color: var(--lcd-fg);
  font-family: var(--dot);
  font-weight: 700;
  border-radius: 6px;
  overflow: hidden;
  text-shadow: 0 0 6px rgba(120, 255, 190, 0.5);
  box-shadow: inset 0 0 0 2px #04070a, inset 0 0 30px rgba(0, 0, 0, 0.85), 0 0 0 2px #3a4050, 0 0 0 3px #0e1015;
  transition: background 0.4s, color 0.4s, text-shadow 0.4s, filter 0.6s;
}
.lcd::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px); }
.unit.off .lcd { background: #050807; color: transparent; text-shadow: none; }
.rack.lowpower .lcd { filter: brightness(0.7); }
.lcd p, .lcd h1 { margin: 0; }
.lcd-top { font-size: 17px; font-weight: 600; color: var(--lcd-dim); min-height: 1.25em; line-height: 1.2; }
.lcd-name { font-weight: 900; font-size: clamp(34px, 9.4vw, 54px); line-height: 0.98; letter-spacing: 0.01em; margin-top: 4px !important; }
.lcd-name span { display: block; min-height: 1em; }
.lcd-role { margin-top: 10px !important; font-size: clamp(15px, 3.8vw, 19px); font-weight: 700; min-height: 2.4em; line-height: 1.2; }
.caret { display: inline-block; width: 0.55em; height: 0.85em; margin-left: 3px; background: var(--lcd-fg); vertical-align: -0.05em; animation: blink 1s steps(1) infinite; box-shadow: 0 0 6px rgba(120, 255, 190, 0.6); }
@keyframes blink { 50% { opacity: 0; } }
.lcd-boot { margin: 0; font: 500 12.5px/1.7 var(--mono); white-space: pre-wrap; min-height: 150px; text-shadow: 0 0 5px rgba(120, 255, 190, 0.45); }
.side-leds { width: 52px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 2px 0; }
.side-leds .row { display: flex; align-items: center; gap: 7px; }

/* ---------- Lüfter ---------- */
.fans { align-items: center; justify-content: center; gap: 26px; padding-top: 5px; padding-bottom: 5px; }
.vent { flex: 1; height: 100%; min-height: 26px; border-radius: 2px; background: repeating-linear-gradient(90deg, #14161b 0 3px, #2c303a 3px 7px); opacity: 0.85; }
.fan { position: relative; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--edge); background: #15161b; box-shadow: inset 0 0 0 2px #3a3f4a; cursor: pointer; flex: none; }
.fan i { position: absolute; inset: 3px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, #4a5060 0 14deg, #16171c 14deg 30deg); animation: spin var(--fs, 1.6s) linear infinite; }
.fan::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #20232a; box-shadow: 0 0 0 1px #000; }
.unit.off .fan i { animation-play-state: paused; }
.rack.lowpower .fan i { animation-duration: 4.5s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- KVM-Konsole ---------- */
.kvm { flex-direction: column; gap: 0; padding-top: 6px; padding-bottom: 6px; min-height: 0; height: calc(var(--h) * var(--pitch) - 2px); overflow: hidden; transition: height 0.45s cubic-bezier(0.3, 1.05, 0.5, 1); }
.kvm-head { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.term {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 0 14px;
  max-height: 0;
  font-family: var(--mono); font-weight: 500; font-size: 12.5px; line-height: 1.5;
  text-shadow: 0 0 5px rgba(120, 255, 190, 0.4);
  cursor: text;
  visibility: hidden; opacity: 0;
}
.kvm.open .term { visibility: visible; opacity: 1; max-height: none; padding: 10px 14px; margin-top: 8px; transition: opacity 0.3s 0.2s; }
.term-out { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; white-space: pre-wrap; word-break: break-word; scrollbar-width: thin; scrollbar-color: #2f6b50 transparent; position: relative; z-index: 1; }
.tl { min-height: 1.5em; }
.tl .dir { color: #7fc7ff; }
.tl .deny { color: #ffb86b; }
.tl .err { color: #ff9a9a; }
.tl .dim { color: var(--lcd-dim); }
.tl .hi { color: #ffffff; }
.tl a { color: #7fe3ff; }
.term-line { display: flex; align-items: baseline; position: relative; z-index: 1; margin: 0; }
.term-prompt { white-space: pre; flex: none; }
.term-prompt .pu { color: #8dffbf; }
.term-prompt .pp { color: #7fc7ff; }
.term-in { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0; color: inherit; font: inherit; text-shadow: inherit; caret-color: var(--lcd-fg); outline: none; }
@media (pointer: coarse) { .term-in { font-size: 16px; } }

/* ---------- Display und Uptime ---------- */
.up-lcd { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 6px 16px; }
.up-line { font-size: 16px; font-weight: 700; color: var(--lcd-dim); line-height: 1.2; }
.up-time { font-size: 36px; font-weight: 900; line-height: 1.05; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.colon { display: inline-block; width: 0.3em; height: 0.62em; margin: 0 0.1em; vertical-align: -0.02em; background: linear-gradient(currentColor, currentColor) 50% 18% / 0.17em 0.17em no-repeat, linear-gradient(currentColor, currentColor) 50% 82% / 0.17em 0.17em no-repeat; filter: drop-shadow(0 0 4px rgba(120, 255, 190, 0.5)); }
.unit.off .colon { opacity: 0; }
.up-side { width: 124px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }

/* ---------- Laufwerke ---------- */
.bays { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tray {
  position: relative; text-align: left; padding: 24px 8px 14px;
  background: linear-gradient(180deg, #454a58, #313642);
  border: 1px solid #0b0c10; border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 2px 0 rgba(0, 0, 0, 0.45);
  font: 600 11px/1.2 var(--mono); color: var(--light); cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.28s;
}
.tray .led { position: absolute; top: 8px; right: 8px; }
.tray .th { position: absolute; left: 8px; right: 8px; bottom: 6px; height: 4px; border-radius: 2px; background: #181a20; }
.tray:hover { background: linear-gradient(180deg, #4d5262, #373c49); }
.tray[aria-pressed="true"] { transform: translateY(-3px) scale(1.07); z-index: 3; box-shadow: 0 14px 20px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.tray .tl { display: block; word-break: break-word; }

/* ---------- Systeme ---------- */
.sys { gap: 10px; }
.sys-nas { display: flex; flex-direction: column; gap: 6px; flex: 0 0 188px; }
.nas { display: flex; flex-direction: column; justify-content: space-between; gap: 5px; flex: 1; padding: 6px 9px 7px; background: #15171c; border: 1px solid #0b0c10; border-radius: 6px; color: var(--light); text-decoration: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.nas:hover { background: #1c1f26; }
.nas-top { display: flex; align-items: center; gap: 7px; font: 600 11px/1.2 var(--mono); }
.nas-top small { margin-left: auto; font: 500 10px/1 var(--mono); color: #aeb4c6; }
.nas-bays { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.bay { position: relative; height: 24px; border-radius: 3px; background: linear-gradient(180deg, #3d4250, #2a2e38); border: 1px solid #0b0c10; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.bay::before { content: ""; position: absolute; left: 4px; right: 4px; bottom: 4px; height: 3px; border-radius: 2px; background: #15171c; }
.bay .led { position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; }
.nas:hover .bay .led, .nas:focus-visible .bay .led { animation: ledblink 0.22s steps(1) infinite; }
.sys-grid { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 32px; gap: 6px; align-content: center; }
.srv { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 3px 10px; background: #15171c; border: 1px solid #0b0c10; border-radius: 6px; color: var(--light); text-decoration: none; min-width: 0; }
a.srv:hover { background: #20232b; }
.srv .led { grid-row: 1 / span 2; }
.srv b { font: 600 11px/1.15 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv small { font: 500 10px/1.1 var(--mono); color: #aeb4c6; }

/* ---------- USV ---------- */
.ups { flex-direction: column; justify-content: center; gap: 8px; }
.ups-top { display: flex; align-items: center; gap: 12px; }
.ind { display: inline-flex; align-items: center; gap: 6px; }
.segs { flex: 1; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.seg { height: 18px; border-radius: 2px; background: #15171c; box-shadow: inset 0 0 0 1px #0b0c10; transition: background 0.2s, box-shadow 0.2s; }
.seg.on { background: var(--sc, var(--g)); box-shadow: 0 0 8px var(--sc, var(--g)); }
.ups-bot { display: flex; align-items: center; gap: 10px; }
.ups .lcd { display: flex; align-items: center; gap: 12px; padding: 6px 14px; min-height: 38px; }
.pct { font-size: 26px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.pct small { font-size: 16px; margin-left: 2px; }
.ups-msg { font: 500 11.5px/1.3 var(--mono); }
html.blackout #upsBtn { animation: pulsebtn 1s ease-in-out infinite; background: #1f6b46; }
@keyframes pulsebtn { 50% { box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1); } }

.kbtn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--btn); color: var(--light);
  border: 1px solid #0b0c10; border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 0 rgba(0, 0, 0, 0.5);
  font: 600 12px/1 var(--mono);
  cursor: pointer; white-space: nowrap;
  transition: background 0.12s, translate 0.1s;
}
.kbtn:hover { background: var(--btn-hi); }
.kbtn:active { translate: 0 2px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.kbtn[aria-pressed="true"] { background: #1f6b46; }
.kbtn kbd { font: inherit; padding: 1px 6px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 4px; opacity: 0.85; }

/* ---------- Steuerung ---------- */
.pw { align-items: center; gap: 8px; padding-top: 5px; padding-bottom: 5px; flex-wrap: wrap; }
.pwr { position: relative; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid #0b0c10; background: radial-gradient(circle at 35% 30%, #5b6172, #2a2d36); box-shadow: 0 0 0 2px #3d4252, 0 2px 0 2px rgba(0, 0, 0, 0.5); color: #9fe9bf; cursor: pointer; display: grid; place-items: center; flex: none; }
.pwr svg { width: 15px; height: 15px; filter: drop-shadow(0 0 4px rgba(61, 220, 132, 0.8)); }
.pwr:active { translate: 0 2px; }
.lcd-xs { flex: none; padding: 3px 12px; font-size: 18px; }

/* ---------- Patchfeld und Kabel ---------- */
.ports { flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.port { position: relative; display: grid; justify-items: center; align-content: start; gap: 5px; padding-top: 1px; color: var(--light); text-decoration: none; font: 600 10.5px/1.2 var(--mono); min-width: 0; }
.port:hover, .port:focus-visible, .port.hot { z-index: 6; }
.plabel { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port.free .plabel { color: #6f7688; font-weight: 500; }
.pj { display: flex; align-items: center; gap: 5px; }
.pl { display: flex; flex-direction: column; gap: 5px; }
.pl .led { width: 6px; height: 6px; }
.jack { position: relative; width: 46px; height: 32px; background: linear-gradient(180deg, #05060a, #0d0f14); border: 2px solid #5a6174; border-radius: 4px; box-shadow: inset 0 0 8px #000, 0 1px 0 rgba(255, 255, 255, 0.08); }
.jack::before { content: ""; position: absolute; left: 6px; right: 6px; bottom: 4px; height: 11px; background: repeating-linear-gradient(90deg, #d4aa5a 0 2px, transparent 2px 5px); }
.jack::after { content: ""; position: absolute; left: 50%; top: -2px; width: 14px; height: 5px; margin-left: -7px; background: #2a2d36; }
.boot { position: absolute; left: 50%; bottom: -8px; width: 36px; height: 36px; margin-left: -18px; border-radius: 4px 4px 9px 9px; background: var(--cable, #4aa8ff); border: 2px solid rgba(0, 0, 0, 0.55); transition: box-shadow 0.2s, filter 0.2s; }
.boot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.25)); }
.boot::after { content: ""; position: absolute; left: 6px; right: 6px; top: 5px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.3); }
.port.hot .boot, .port:focus-visible .boot { box-shadow: 0 0 14px var(--cable); filter: brightness(1.15); }
.port.hot .led.a { animation: ledblink 0.25s steps(1) infinite; }

.cables { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 5; transition: opacity 0.25s; }
.cables.hide { opacity: 0; }
.tag {
  position: absolute; z-index: 6;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px;
  background: var(--panel); color: var(--panel-text);
  border: 1px solid var(--panel-edge); border-radius: 9px;
  font: 600 12px/1 var(--mono); text-decoration: none; white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.35);
  transition: translate 0.2s cubic-bezier(0.3, 1.5, 0.5, 1), box-shadow 0.2s;
}
.tag i { width: 9px; height: 9px; border-radius: 50%; background: var(--cable); box-shadow: 0 0 7px var(--cable); }
.tag:hover, .tag.hot { translate: 0 -4px; box-shadow: 0 14px 22px -8px rgba(0, 0, 0, 0.5); }

/* ---------- Post-it, Fußzeile ---------- */
.postit {
  position: absolute; top: 118px; left: calc(100% + 26px); width: 138px;
  padding: 14px 12px 16px; background: #f7e36b; color: #2b2610;
  font: 600 13.5px/1.35 var(--font); transform: rotate(4deg);
  box-shadow: 0 10px 18px rgba(20, 24, 50, 0.25); border: 0; text-align: left; cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.postit:hover { transform: rotate(-2deg) scale(1.05); }
.postit::before { content: ""; position: absolute; top: -8px; left: 50%; width: 52px; height: 16px; margin-left: -26px; background: rgba(255, 255, 255, 0.55); transform: rotate(-3deg); }
.foot { width: min(580px, 100%); margin: 0 auto; font-size: 0.95rem; color: var(--muted); text-align: left; }
.foot p { margin: 0 0 6px; }
.foot a { color: inherit; }

/* ---------- Toast, Bugs ---------- */
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 22px; translate: -50% 20px;
  display: flex; align-items: center; gap: 10px;
  max-width: min(92vw, 520px); padding: 11px 18px;
  background: #15171c; color: #f1f3fa; border: 1px solid #343845; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  font-weight: 550; font-size: 0.95rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, translate 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--g); box-shadow: 0 0 8px var(--g); }
.toast.show { opacity: 1; translate: -50% 0; }
.bug { position: fixed; z-index: 46; left: 0; top: 0; padding: 4px; margin: 0; font-size: 28px; line-height: 1; background: none; border: 0; cursor: crosshair; will-change: transform; }
.bug.splat { animation: splat 0.4s ease-out forwards; pointer-events: none; }
@keyframes splat { to { opacity: 0; scale: 1.8; } }

/* ---------- Befehls-Palette ---------- */
.pal-back { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: center; align-items: flex-start; padding: 14vh 16px 0; background: rgba(8, 10, 18, 0.55); backdrop-filter: blur(3px); }
.pal { width: min(560px, 100%); background: var(--panel); color: var(--panel-text); border: 1px solid var(--panel-edge); border-radius: 16px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45); overflow: hidden; }
.pal input { width: 100%; font: inherit; font-size: 1.1rem; font-weight: 550; padding: 16px 20px; border: 0; border-bottom: 1px solid rgba(128, 136, 160, 0.4); background: transparent; color: inherit; }
.pal input:focus-visible { outline: none; }
.pal input::placeholder { color: var(--muted); }
.pal ul { list-style: none; margin: 0; padding: 8px; max-height: 46vh; overflow-y: auto; }
.pal li { padding: 10px 14px; border-radius: 10px; font-weight: 550; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.pal li small { font: 500 12px/1.4 var(--mono); opacity: 0.65; }
.pal li[aria-selected="true"] { background: rgba(61, 220, 132, 0.25); }
.pal li.empty { cursor: default; font-weight: 500; }

/* ---------- Mobil ---------- */
@media (max-width: 1040px) { .postit { display: none; } }
@media (max-width: 700px) { .unums { display: none; } }
@media (max-width: 560px) {
  :root { --rail: 18px; }
  .rack::before { left: 3px; } .rack::after { right: 3px; }
  .units { margin: 0 calc(var(--rail) + 4px); }
  .unit { padding: 8px 12px; gap: 10px; }
  .unit::before { left: 3px; } .unit::after { right: 3px; }
  .side-leds { width: 34px; }
  .up-side { display: none; }
  .up-time { font-size: 32px; }
  .bays { grid-template-columns: repeat(2, 1fr); }
  .sys { flex-wrap: wrap; }
  .sys-nas { flex: 1 1 100%; }
  .ups-top .sl:first-child { display: none; }
  .ups-bot { flex-wrap: wrap; }
  .pw .kbtn kbd { display: none; }
  .pw .grow { display: none; }
  .pw .kbtn { padding: 7px 10px; }
  .ports { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .floor { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .fan i, .led.blink, .caret, html.led-xmas .led, html.led-party .led, html.blackout #upsBtn { animation: none; }
  .tray, .tag, .kvm { transition: none; }
}

/* ===================== Ergänzungen für die Server-Version ===================== */
.unit[data-h="1"] { --h: 1; } .unit[data-h="2"] { --h: 2; } .unit[data-h="5"] { --h: 5; }

.banner { width: min(580px, 100%); margin: 0 auto 14px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: #15171c; color: #f1f3fa; border: 1px solid #343845; border-radius: 10px; font: 600 12.5px/1.4 var(--mono); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.4); }

/* Mail-Gateway */
.mail .mail-form { display: none; flex: none; flex-direction: column; gap: 8px; margin-top: 8px; padding: 12px 14px; font-family: var(--mono); font-weight: 500; font-size: 12.5px; text-shadow: 0 0 5px rgba(120, 255, 190, 0.35); }
.mail.open .mail-form { display: flex; }
.mail-form label { position: relative; z-index: 1; display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: start; }
.mail-form label > span { color: var(--lcd-dim); padding-top: 4px; }
.mail-form input:not(.hp), .mail-form textarea {
  width: 100%; min-width: 0; padding: 3px 2px; background: transparent; color: var(--lcd-fg);
  border: 0; border-bottom: 1px dashed rgba(120, 214, 166, 0.55); border-radius: 0;
  font: inherit; text-shadow: inherit; caret-color: var(--lcd-fg); outline: none; resize: none;
}
.mail-form textarea { border: 1px dashed rgba(120, 214, 166, 0.55); padding: 6px; }
.mail-form input:focus, .mail-form textarea:focus { border-color: var(--lcd-fg); background: rgba(120, 255, 190, 0.06); }
.mail-form ::placeholder { color: rgba(120, 214, 166, 0.45); }
@media (pointer: coarse) { .mail-form input:not(.hp), .mail-form textarea, .note-form input { font-size: 16px; } }
.mail-hint { margin: 0; color: var(--lcd-dim); position: relative; z-index: 1; }
.mail-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mail-count { color: var(--lcd-dim); font-size: 11px; }
.mail-log { position: relative; z-index: 1; margin: 0; font: 500 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
.mail-log .ok { color: #8dffbf; } .mail-log .bad { color: #ff9a9a; } .mail-log .dim { color: var(--lcd-dim); }
.hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.mail.sending #ledMail { animation: ledblink 0.2s steps(1) infinite; }
.mail.closed #mailBtn { opacity: 0.55; cursor: not-allowed; }

/* Post-it-Wand */
.wall { width: min(820px, 100%); margin: 40px auto 6px; }
.wall h2 { margin: 0 0 16px; font: 700 1.15rem/1.2 var(--font); }
.notes { list-style: none; margin: 0; padding: 8px 4px 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 26px 20px; }
.notes li { position: relative; padding: 18px 13px 13px; min-height: 108px; background: var(--nc, #f7e36b); color: #2b2610; font: 600 14px/1.35 var(--font); word-break: break-word; transform: rotate(var(--rot, 0deg)); box-shadow: 0 10px 18px rgba(20, 24, 50, 0.22); transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1); }
.notes li:hover { transform: rotate(0deg) scale(1.04); z-index: 2; }
.notes li::before { content: ""; position: absolute; top: -8px; left: 50%; width: 46px; height: 15px; margin-left: -23px; background: rgba(255, 255, 255, 0.55); transform: rotate(-3deg); }
.notes li small { display: block; margin-top: 10px; font: 500 11px/1.2 var(--mono); opacity: 0.7; }
.notes-empty { color: var(--muted); }
.note-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 26px; }
.note-form input:not(.hp) { flex: 1 1 200px; min-width: 0; padding: 10px 12px; background: var(--panel); color: var(--panel-text); border: 1px solid var(--panel-edge); border-radius: 9px; font: 500 0.95rem var(--font); }
.note-form input[name="name"] { flex: 0 1 150px; }
.note-msg { flex: 1 1 100%; margin: 0; min-height: 1.4em; font-size: 0.9rem; color: var(--muted); }
.note-msg.ok { color: #1f8a56; } html[data-theme="night"] .note-msg.ok { color: #62e0a0; }
.note-msg.bad { color: #c0392b; } html[data-theme="night"] .note-msg.bad { color: #ff8d86; }
.vis { margin: 10px 0 0; font-size: 0.85rem; }
@media (max-width: 560px) { .mail-form label { grid-template-columns: 1fr; gap: 2px; } .mail-form label > span { padding-top: 0; } }
@media (prefers-reduced-motion: reduce) { .notes li { transition: none; } .mail.sending #ledMail { animation: none; } }

/* ===== Rack ausgeschaltet ===== */
html.rack-off #cables, html.rack-off #postit, html.rack-off .unit:not(#ctlUnit) { pointer-events: none; }
html.rack-off #cables, html.rack-off #postit { opacity: 0.25; filter: grayscale(1); }
html.rack-off .unit:not(#ctlUnit) { filter: brightness(0.6); }
html.rack-off #powerBtn { box-shadow: none; }
html.rack-off #powerBtn { opacity: 0.85; }
html.rack-off #soundBtn, html.rack-off #openPal, html.rack-off #themeBtn { opacity: 0.4; cursor: not-allowed; }
.off-note { margin: 10px 0 0; font-size: 0.9rem; }
.off-note a { color: inherit; text-decoration: underline; }
.langsw { margin: 8px 0 0; font-size: 0.85rem; }
.langsw a { color: inherit; text-decoration: none; opacity: 0.75; padding: 2px 4px; }
.langsw a:hover, .langsw a:focus-visible { text-decoration: underline; opacity: 1; }
.langsw a[aria-current="true"] { opacity: 1; font-weight: 700; text-decoration: underline; }
.attrib { margin: 6px 0 0; font-size: 0.75rem; opacity: 0.7; }
.attrib a { color: inherit; }
html.rack-off .caret, .unit.off .caret { display: none; animation: none; }
html.rack-off .led, html.rack-off .led.blink { animation: none; }

/* Rack aus: nichts leuchtet, blinkt oder läuft */
html.rack-off .unit:not(#ctlUnit) .lcd, html.rack-off .unit:not(#ctlUnit) .lcd * { visibility: hidden; animation: none; }
html.rack-off .unit:not(#ctlUnit) .seg.on { background: #15171c; box-shadow: inset 0 0 0 1px #0b0c10; }
html.rack-off .unit:not(#ctlUnit) .fan i, html.rack-off .unit:not(#ctlUnit) .led { animation: none; }
html.rack-off .cables circle { visibility: hidden; }
