/* Farben liegen in colors.css. */
:root {
  /* Terminal-Metrik: Shell-Text und Eingabezeile teilen diese Werte, damit
     Caret und Prompt garantiert auf einer Linie sitzen. */
  --term-size: 13.5px;
  --term-leading: 1.65;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--phosphor);
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
}

/* Hier lagen mal CRT-Scanlines (body::after) und ein wandernder
   Glint-Spot (#desktop::after). Beide entfernt: animierte Vollbild-Layer
   mit mix-blend-mode bzw. mask-position zwingen Safari zu Dauer-Repaints
   (~45 % CPU auf einem MacBook). Falls so ein Effekt zurückkommen soll,
   nur compositor-freundlich animieren (transform/opacity, ohne Blend). */

/* ---------- Desktop ---------- */
#desktop {
  position: relative;
  min-height: 100vh;
  padding: 0 0 60px;      /* unten Platz für die Leiste */
  overflow: hidden;
}

/* dezentes Raster, damit "Desktop" lesbar wird */
#desktop::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(60,140,102,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60,140,102,.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ---------- Fenster ---------- */
.win {
  position: absolute;
  /* Basis-z-index; das JS hebt fokussierte Fenster von hier aus weiter an. */
  z-index: 10;
  background: radial-gradient(120% 140% at 50% 0%, var(--bg-1), var(--bg-0));
  border: 1px solid var(--phosphor-dim);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(124,255,178,0.05),
    0 14px 40px rgba(0,0,0,0.55),
    inset 0 0 60px rgba(124,255,178,0.03);
  display: flex;
  flex-direction: column;
  /* nicht über den Desktop-Rand hinaus zerren */
  max-width: calc(100vw - 16px);
}

/* fokussiertes Fenster hebt sich ab */
.win.focused {
  border-color: var(--phosphor);
  box-shadow:
    0 0 0 1px rgba(124,255,178,0.12),
    0 18px 50px rgba(0,0,0,0.6),
    0 0 34px rgba(124,255,178,0.10),
    inset 0 0 60px rgba(124,255,178,0.04);
}

.win.dragging { cursor: grabbing; user-select: none; }

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: grab;
  touch-action: none;          /* Drag auf Touch statt Scroll */
  border-bottom: 1px solid rgba(60,140,102,0.28);
  border-radius: 10px 10px 0 0;
  flex-shrink: 0;
}
.win.dragging .titlebar { cursor: grabbing; }

.win:not(.focused) .titlebar { opacity: .72; }

/* Dots nach CD-Regelwerk: in Ruhe IMMER farbig — auf Touch gibt es kein
   Hover, drei graue Punkte wären dort bedeutungslos. Der Dot unter dem
   Zeiger bekommt nur den Underglow in eigener Farbe bei 60 % — kein
   Skalieren, kein Aufhellen. */
.dots { display: flex; gap: 8px; }
.dot {
  width: 11px; height: 11px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--phosphor-dim);
  transition: box-shadow .18s;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.dot.red    { background: var(--mac-red); }
.dot.yellow { background: var(--mac-yellow); }
.dot.green  { background: var(--mac-green); }
.dot:hover.red    { box-shadow: 0 0 9px rgba(255,95,87,.6); }
.dot:hover.yellow { box-shadow: 0 0 9px rgba(254,188,46,.6); }
.dot:hover.green  { box-shadow: 0 0 9px rgba(40,200,64,.6); }

/* Tastatur-Fokus sichtbar machen */
.dot:focus-visible {
  outline: 1px solid var(--phosphor);
  outline-offset: 2px;
}

/* Symbol im Dot, wie bei macOS erst beim Hover über die Gruppe.
   Als SVG-Maske statt Text-Glyph: Glyphen sitzen wegen Baseline-Offset
   nie optisch mittig in einem 11px-Kreis. Koordinaten auf halben Pixeln
   (3.5/6/8.5) halten die Kanten ruhig; grün als zwei gefüllte Dreiecke
   statt Pfeilkonturen — Flächen bleiben bei 11px lesbar (CD 1a). */
.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,.62);
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: 11px 11px;
          mask-size: 11px 11px;
  opacity: 0;
  transition: opacity .15s;
}
.dots:hover .dot::after { opacity: 1; }

.dot.red::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 3.5 8.5 8.5M8.5 3.5 3.5 8.5' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 3.5 8.5 8.5M8.5 3.5 3.5 8.5' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
.dot.yellow::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 6h5' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 6h5' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
/* Grün: zwei Dreiecke nach außen (maximieren) */
.dot.green::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 3.5H7.5L3.5 7.5Z' fill='%23000'/%3E%3Cpath d='M8.5 8.5H4.5L8.5 4.5Z' fill='%23000'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 3.5H7.5L3.5 7.5Z' fill='%23000'/%3E%3Cpath d='M8.5 8.5H4.5L8.5 4.5Z' fill='%23000'/%3E%3C/svg%3E");
}
/* Maximiert: Dreiecke drehen nach innen (wiederherstellen) —
   der Zustand steckt im Icon, nicht in einem zweiten Button. */
.win.maximized .dot.green::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M8.5 3.5v4L4.5 3.5Z' fill='%23000'/%3E%3Cpath d='M3.5 8.5v-4l4 4Z' fill='%23000'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M8.5 3.5v4L4.5 3.5Z' fill='%23000'/%3E%3Cpath d='M3.5 8.5v-4l4 4Z' fill='%23000'/%3E%3C/svg%3E");
}

/* ---------- Touch: kein Hover ---------- */
@media (hover: none) {
  /* Icons dauerhaft sichtbar — sonst tippt man auf drei
     bedeutungslose Punkte (CD 1a). */
  .dot::after { opacity: 1; }
  /* 44×44px-Hitbox je Dot, der Punkt selbst bleibt 11px;
     Abstand wächst auf 12 (CD 1d). */
  .dots { gap: 12px; }
  .dot::before {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 44px; height: 44px;
    transform: translate(-50%, -50%);
  }
}

/* ---------- Maximiert ---------- */
.win.maximized {
  left: 12px !important;
  top: 12px !important;
  width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 66px) !important;
  height: calc(100vh - 66px);
}
.win.maximized .titlebar { cursor: default; }
.win.maximized #screen { height: auto; flex: 1; min-height: 200px; }

/* ---------- Minimiert: als Kachel in der Leiste ---------- */
.win.minimized { display: none; }

/* ---------- Schließen / Minimieren: Animationen ----------
   Beide laufen über transform + opacity, also rein auf dem Compositor.
   `display: none` (.minimized) setzt die JS-Logik erst, wenn die
   Animation durch ist — sonst verschwindet das Fenster sofort und
   es gäbe nichts zu sehen. */
.win.animating-out {
  pointer-events: none;
  will-change: transform, opacity;
}

/* Minimieren: schrumpft in die linke untere Ecke, wo der Tray sitzt.
   Die Keyframes kommen aus dem JS (Web Animations API), weil das Ziel
   von der aktuellen Fensterposition abhängt. transform-origin unten
   links, damit die Bewegung dorthin "zieht". */
.win.win-minimizing { transform-origin: 0 100%; }

/* Schließen: CRT-Abschaltung. Das Bild klappt auf eine Scanline
   zusammen, die kurz hell aufglüht, zieht sich zu einem Punkt
   zusammen und verlischt — wie eine Röhre, der man den Strom nimmt. */
.win.win-closing {
  transform-origin: 50% 50%;
  animation: win-crt-off .42s steps(60, end) forwards;
}
@keyframes win-crt-off {
  0%   { transform: scale(1, 1);      filter: brightness(1);              opacity: 1; }
  /* erst vertikal auf die Linie zusammenklappen … */
  38%  { transform: scale(1, .012);   filter: brightness(2.6) saturate(0); opacity: 1; }
  /* … kurz als greller Strich stehen bleiben … */
  52%  { transform: scale(1.01, .012); filter: brightness(3.4) saturate(0); opacity: 1; }
  /* … dann seitlich zum Punkt … */
  82%  { transform: scale(.045, .012); filter: brightness(3.4) saturate(0); opacity: .95; }
  /* … und aus. */
  100% { transform: scale(0, .012);   filter: brightness(1);               opacity: 0; }
}

/* Geschlossene Fenster wieder öffnen */
.closed-hint { color: var(--muted); }
.closed-hint code { color: var(--amber); font: inherit; }

.title { margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.win-body {
  padding: 18px 20px 16px;
  overflow: auto;
  flex: 1;
}

/* ---------- Scrollbars im CRT-Look ----------
   Firefox versteht scrollbar-width/-color, WebKit/Blink die ::-webkit-Regeln.
   Beide gelten für jeden scrollbaren Bereich, nicht nur das Terminal. */
#screen, .win-body, .scroller {
  scrollbar-width: thin;
  scrollbar-color: var(--phosphor-dim) rgba(60,140,102,0.09);
}

#screen::-webkit-scrollbar,
.win-body::-webkit-scrollbar,
.scroller::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#screen::-webkit-scrollbar-track,
.win-body::-webkit-scrollbar-track,
.scroller::-webkit-scrollbar-track {
  background: rgba(60,140,102,0.09);
  border-radius: 999px;
}

#screen::-webkit-scrollbar-thumb,
.win-body::-webkit-scrollbar-thumb,
.scroller::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--phosphor-dim), #2f6f51);
  border: 2px solid transparent;      /* schlanker Balken mit Luft zum Track */
  background-clip: content-box;
  border-radius: 999px;
}

#screen::-webkit-scrollbar-thumb:hover,
.win-body::-webkit-scrollbar-thumb:hover,
.scroller::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, var(--phosphor), var(--phosphor-dim));
  background-clip: content-box;
}

/* Ecke zwischen horizontaler und vertikaler Leiste */
#screen::-webkit-scrollbar-corner,
.win-body::-webkit-scrollbar-corner,
.scroller::-webkit-scrollbar-corner {
  background: transparent;
}

.ok { color: var(--phosphor); }
.warn { color: var(--amber); }
.err { color: var(--red); }
.dim { color: var(--muted); }
/* Lilac ausschließlich für Auth/SSO (CD-Signalregel) */
.lilac { color: var(--lilac); }

.win-foot {
  padding: 11px 20px 13px;
  border-top: 1px dashed var(--phosphor-dim);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

/* ---------- Fenstergrößen ---------- */
#win-shell     { width: min(540px, calc(100vw - 24px)); }
#win-projects  { width: min(500px, calc(100vw - 24px)); }
#win-dashboard { width: min(560px, calc(100vw - 24px)); }

/* Kein Fenster darf höher werden als der Desktop — sonst rutscht
   das darunter gestapelte aus dem Bild. */
.win { max-height: calc(100vh - 96px); }
#win-dashboard { max-height: min(420px, calc(100vh - 96px)); }

/* ---------- Shell ---------- */
#screen {
  font-size: var(--term-size);
  line-height: var(--term-leading);
  height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Prompt-Zeile erbt Größe und Zeilenhöhe von #screen, damit die Eingabe
   exakt wie der Terminal-Text darüber aussieht.

   `center` statt `baseline`: ein leeres Input hat keine Text-Baseline, der
   Flex-Container nimmt dann dessen Unterkante — der Caret saß dadurch zu
   hoch und sprang beim ersten Zeichen nach unten. Bei gleicher Zeilenhöhe
   auf Prompt und Input ist zentriert deckungsgleich mit der Baseline. */
.prompt-line {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: var(--term-size); line-height: var(--term-leading);
}
.ps1 { color: var(--phosphor-dim); white-space: nowrap; }

#input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--phosphor); font: inherit; letter-spacing: inherit; padding: 0;
  caret-color: var(--phosphor); min-width: 40px;
  line-height: inherit;               /* UA-Default würde das Leading überschreiben */
  /* feste Höhe, unabhängig vom Inhalt */
  height: calc(var(--term-size) * var(--term-leading));
}

.hint { margin-top: 5px; font-size: 11px; color: var(--muted); }
kbd {
  font: inherit; font-size: 10.5px;
  border: 1px solid var(--phosphor-dim);
  border-radius: 3px; padding: 0 4px;
  color: var(--phosphor-dim);
}

.cmd-echo { color: var(--muted); margin-top: 13px; }
.cmd-echo b { color: var(--phosphor); font-weight: normal; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; margin: 0; }
.kv dt { color: var(--phosphor-dim); }
.kv dd { margin: 0; }

.fetch { display: flex; gap: 22px; flex-wrap: wrap; }
.fetch pre { margin: 0; color: var(--phosphor); font-size: 11.5px; line-height: 1.3; }

/* ---------- Projekte ---------- */
.cmdline { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.cmdline b { color: var(--phosphor); font-weight: normal; }

.svc {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px dashed rgba(60,140,102,0.22);
  font-size: 13.5px;
}
.svc:first-of-type { border-top: none; }

.svc-dot { font-size: 14px; line-height: 1.2; flex-shrink: 0; }
.svc-dot.run  { color: var(--phosphor); text-shadow: 0 0 8px rgba(124,255,178,0.6); }
.svc-dot.idle { color: var(--amber);    text-shadow: 0 0 8px rgba(255,180,84,0.5); }
.svc-dot.dead { color: var(--muted); }
.svc-dot.lock { color: var(--muted); }
/* Rot bleibt echten Fehlern vorbehalten (CD) — "Störung" ist genau das. */
.svc-dot.err  { color: var(--red); text-shadow: 0 0 8px rgba(255,107,107,0.5); }

.svc-main { flex: 1; min-width: 0; }
.svc-name { color: var(--phosphor); }

/* Verlinkte Titel bleiben im Phosphor-Look statt amber wie normale Links;
   die Unterstreichung kommt erst beim Hover. */
a.svc-name {
  color: var(--phosphor);
  text-decoration: none;
}
a.svc-name:hover,
a.svc-name:focus-visible {
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(124,255,178,0.5);
}
.svc-desc { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; }

.svc.locked .svc-dot,
.svc.locked .svc-name,
.svc.locked .lockicon { opacity: .5; }
.svc.locked .svc-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.svc.locked .svc-desc { color: var(--amber); }
.lockicon { filter: grayscale(1); opacity: .85; font-size: 11.5px; }

.svc-hint {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}
.svc-hint code { color: var(--amber); font: inherit; }

.legend { display: flex; gap: 13px; flex-wrap: wrap; }

/* ---------- Dashboard ---------- */
.top-head { font-size: 12.5px; line-height: 1.75; color: var(--muted); margin-bottom: 13px; }
.top-head .k { color: var(--phosphor-dim); }
.top-head .v { color: var(--phosphor); }

.gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 9px 20px;
  margin: 13px 0 16px;
  font-size: 12px;
}
.gauge-label { color: var(--phosphor-dim); }
.gauge-bar { letter-spacing: -1px; color: var(--phosphor); }
.gauge-bar .empty { color: rgba(60,140,102,0.4); }
.gauge-bar.warn-bar { color: var(--amber); }
.gauge-bar.crit-bar { color: var(--red); }
.gauge-bar .val { letter-spacing: 0; margin-left: 6px; }

.src-line { margin-top: 2px; font-size: 11.5px; }
.src-line .live { color: var(--phosphor); }
.src-line .live::before {
  content: "●";
  margin-right: 5px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.scroller { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  text-align: left; font-weight: normal;
  color: var(--bg-0); background: var(--phosphor-dim);
  padding: 3px 7px; letter-spacing: 0.05em; white-space: nowrap;
}
tbody td { padding: 3px 7px; color: var(--muted); white-space: nowrap; }
tbody tr:hover td { background: rgba(124,255,178,0.05); }
td.cmd { color: var(--phosphor); }
td.num { text-align: right; }
.st-R { color: var(--phosphor); }
.st-S { color: var(--muted); }
.st-D { color: var(--amber); }

/* ---------- Login/Session-Fenster ---------- */
#win-login { width: min(360px, calc(100vw - 24px)); }

.login-row {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px;
  font-size: var(--term-size); line-height: var(--term-leading);
}
.login-label { color: var(--phosphor-dim); white-space: nowrap; }
.login-row input {
  flex: 1; min-width: 40px;
  background: none; border: none; outline: none;
  border-bottom: 1px dashed var(--phosphor-dim);
  color: var(--phosphor); font: inherit; padding: 0 0 2px;
  caret-color: var(--phosphor);
}
.login-row input:focus { border-bottom-color: var(--phosphor); border-bottom-style: solid; }

/* Passwort anzeigen/verstecken: kleiner ASCII-Kollege am Feldende.
   Feste Mindestbreite, damit der Gesichtswechsel (o_o) → (>_<) das
   Eingabefeld nicht umbrechen lässt. */
.eye-btn {
  background: none; border: none; margin: 0; padding: 0 0 2px;
  font: inherit; font-size: 13px;
  color: var(--phosphor-dim);
  min-width: 5.5ch; text-align: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: color .18s, text-shadow .18s;
}
.eye-btn:hover { color: var(--phosphor); text-shadow: 0 0 8px rgba(124,255,178,.55); }
.eye-btn:focus-visible {
  outline: 1px solid var(--phosphor);
  outline-offset: 2px;
  border-radius: 2px;
}

.login-error { margin: 2px 0 10px; font-size: 12px; }

.login-btn {
  background: none;
  border: 1px solid var(--phosphor-dim);
  color: var(--phosphor);
  font: inherit; font-size: 12.5px;
  padding: 6px 14px; border-radius: 3px; cursor: pointer;
}
.login-btn:hover { border-color: var(--phosphor); box-shadow: 0 0 10px rgba(124,255,178,.25); }
.login-btn:disabled { opacity: .5; cursor: default; box-shadow: none; }

.login-fallback { margin-top: 14px; font-size: 11px; }

#sessionView .login-btn { margin-top: 16px; }

/* ---------- Leiste unten ---------- */
.taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: rgba(9,15,13,.93);
  border-top: 1px solid var(--phosphor-dim);
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}

.taskbar button {
  background: none;
  border: 1px solid var(--phosphor-dim);
  color: var(--phosphor-dim);
  font: inherit; font-size: 11px;
  padding: 3px 9px; border-radius: 3px; cursor: pointer;
}
.taskbar button:hover { color: var(--phosphor); border-color: var(--phosphor); }

/* Geschlossene/minimierte Fenster: Button bleibt da, wird aber gedimmt —
   Klick holt das Fenster zurück (statt eines extra Tray-Eintrags). */
.taskbar button.win-hidden {
  color: var(--phosphor-faint);
  border-color: var(--phosphor-faint);
  border-style: dashed;
}
.taskbar button.win-hidden:hover { color: var(--phosphor); border-color: var(--phosphor); border-style: solid; }
.taskbar button[aria-pressed="true"] {
  color: var(--bg-0); background: var(--phosphor); border-color: var(--phosphor);
}
.taskbar .sep { color: rgba(60,140,102,.5); }
.taskbar .grow { flex: 1; }

/* Domain links als Anker (wichtig für Subdomains), Uhr rechts (CD 1b) */
.taskbar .domain { color: var(--phosphor-dim); }

/* Angemeldet: aus dem Sitzungs-Button wird der Nutzername und er
   verlinkt auf auth.janekey.de/account — Lilac, weil Auth (CD). */
.taskbar button.authed {
  color: var(--lilac);
  border-color: var(--lilac);
}
.taskbar button.authed:hover {
  color: var(--lilac);
  border-color: var(--lilac);
  box-shadow: 0 0 10px rgba(201,166,245,.25);
}

a { color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  .dot, .titlebar { transition: none; }
  /* Sehr kurze Dauer statt `animation: none`: das animationend-Event
     muss weiterhin feuern, sonst bliebe das Fenster sichtbar hängen. */
  .win.win-minimizing,
  .win.win-closing { animation-duration: .01s; }
}

/* ---------- Mobil: gestapelt statt frei ---------- */
@media (max-width: 720px) {
  #desktop {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 8px 70px;
    overflow: visible;
  }
  #desktop::before { display: none; }
  .win {
    position: static !important;
    width: 100% !important;
    left: auto !important; top: auto !important;
  }
  .titlebar { cursor: default; }
  /* Nur die Metrik anpassen — #screen, .prompt-line und die Caret-Höhe
     ziehen ihre Werte daraus und bleiben automatisch synchron. */
  :root { --term-size: 12.5px; }
  #screen { height: 260px; }

  /* Dashboard: Gauges zu zweit nebeneinander. auto-fit mit 165px-Minimum
     schafft hier nur eine Spalte; mit kleinerer Schrift passt der
     18-Zeichen-Balken samt Wert auch in die halbe Breite. */
  .gauges {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    font-size: 11px;
    gap: 9px 14px;
  }
  .gauge-bar { white-space: nowrap; }

  /* Luft zwischen letzter Tabellenzeile und der horizontalen Scrollbar */
  .scroller { padding-bottom: 10px; }
}
