/* RS Versus · Base
   Dieselbe Sprache wie RingSide (Kobalt, Geist, Radius 8/12/16, dieselben
   Flaechen- und Textstufen), damit die Basis und das Produkt eine Familie
   bleiben. Drei Theme-Zustaende wie dort: kein data-theme = System. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --surface-3: #eceef2;
  --border: rgba(11, 13, 18, 0.1);
  --border-strong: rgba(11, 13, 18, 0.18);
  --hairline: rgba(11, 13, 18, 0.08);
  --text: #0b0d12;
  --text-2: #575d6b;
  --muted: #8a909e;
  --faint: #a8adb8;
  --accent: #2347eb;
  --accent-hover: #1a38c4;
  --accent-soft: rgba(35, 71, 235, 0.08);
  --on-accent: #ffffff;
  --green: #0a8f5f;
  --red: #d4293a;
  --gold: #a8791a;
  --shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 2px rgba(11, 13, 18, 0.05), 0 2px 8px rgba(11, 13, 18, 0.05);
  --shadow-floating: 0 8px 32px rgba(11, 13, 18, 0.12);
  --shadow-shot: 0 24px 64px -24px rgba(11, 13, 18, 0.35), 0 2px 8px rgba(11, 13, 18, 0.08);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a0b0e;
    --surface: #131519;
    --surface-2: #1b1e24;
    --surface-3: #23272f;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --hairline: rgba(255, 255, 255, 0.08);
    --text: #ecedf0;
    --text-2: #a4a8b1;
    --muted: #8b8f98;
    --faint: #5d616a;
    --accent: #3d63f5;
    --accent-hover: #5b7bff;
    --accent-soft: rgba(93, 123, 255, 0.14);
    --green: #17c07f;
    --red: #f4525f;
    --gold: #e0b13f;
    --shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.28);
    --shadow-floating: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-shot: 0 32px 80px -24px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0a0b0e;
  --surface: #131519;
  --surface-2: #1b1e24;
  --surface-3: #23272f;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --hairline: rgba(255, 255, 255, 0.08);
  --text: #ecedf0;
  --text-2: #a4a8b1;
  --muted: #8b8f98;
  --faint: #5d616a;
  --accent: #3d63f5;
  --accent-hover: #5b7bff;
  --accent-soft: rgba(93, 123, 255, 0.14);
  --green: #17c07f;
  --red: #f4525f;
  --gold: #e0b13f;
  --shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-floating: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-shot: 0 32px 80px -24px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

/* Screenshot je Theme: standardmaessig hell, dunkel ueber beide Wege.
   (Zwei Klassen, damit die Regel ueber `.shot-img` gewinnt — sonst standen im
   hellen Theme beide Bilder untereinander.) */
.shot .shot-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .shot .shot-dark { display: block; }
  :root:not([data-theme='light']) .shot .shot-light { display: none; }
}
:root[data-theme='dark'] .shot .shot-dark { display: block; }
:root[data-theme='dark'] .shot .shot-light { display: none; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2 { text-wrap: balance; margin: 0; letter-spacing: -0.02em; }
code, pre { font-family: var(--mono); }

/* Filmkorn wie auf RingSide: nimmt der Flaeche das Sterile, ohne sichtbar zu sein. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 60;
  padding: 8px 12px; background: var(--accent); color: var(--on-accent); border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Kopfzeile ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px; padding: 0 clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 13px; letter-spacing: -0.04em;
  box-shadow: var(--shadow-raised);
}
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.brand-sub { color: var(--muted); font-size: 14px; }
.brand-sub::before { content: '·'; margin: 0 8px 0 0; color: var(--faint); }
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }

/* Ansichten: Base | Projects */
.views { display: flex; gap: 4px; margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--border); }
.view-tab {
  height: 34px; padding: 0 13px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2); background: transparent; cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.view-tab:hover { color: var(--text); background: var(--surface-2); }
.view-tab:active { transform: translateY(1px); }
.view-tab[aria-selected='true'] { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.view[hidden] { display: none; }
/* Raumwechsel (Stufe 8): Der neue Raum schiebt sich von der Seite herein,
   aus der Richtung, in die man geht — kurz, mit Nachlauf, nie mehr als
   320 ms. Ohne Bewegungswunsch nur ein Einblenden. */
.view { animation: room-in 0.32s var(--ease-out) both; }
.view[data-dir='left'] { --room-x: -28px; }
.view[data-dir='right'] { --room-x: 28px; }
.view[data-dir='none'] { --room-x: 0px; }
@keyframes room-in { from { opacity: 0; transform: translateX(var(--room-x, 0px)) translateY(6px) scale(0.995); } to { opacity: 1; transform: none; } }
.view-tab kbd { margin-left: 6px; font-family: var(--mono); font-size: 10px; color: var(--muted); border: 1px solid var(--hairline); border-radius: 4px; padding: 0 4px; }
.view-tab[aria-selected='true'] kbd { color: var(--text-2); }
@media (max-width: 640px) { .view-tab kbd { display: none; } }
.clock { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Knoepfe ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 12px;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-raised);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { text-decoration: none; border-color: var(--border-strong); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 6px 16px -6px rgba(11, 13, 18, 0.45); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn .arrow { color: var(--muted); font-size: 12px; transition: transform 0.18s var(--ease-out); }
.btn-primary .arrow { color: color-mix(in srgb, var(--on-accent) 75%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover .arrow { transform: translate(1px, -1px); }
}

.theme {
  width: 36px; height: 36px; border-radius: 999px; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-2); background: transparent; border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}
.theme:hover { color: var(--text); border-color: var(--border-strong); }
.theme:active { transform: scale(0.94); }
.theme .ico-sun { display: none; }
:root[data-theme='dark'] .theme .ico-sun { display: block; }
:root[data-theme='dark'] .theme .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme .ico-sun { display: block; }
  :root:not([data-theme='light']) .theme .ico-moon { display: none; }
}

/* ---------- Inhalt ---------- */
.wrap {
  width: 100%; max-width: 1180px; margin: 0 auto; flex: 1;
  padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 40px) 48px;
}
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
h1 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 700; line-height: 1.05; }
.head-line { margin: 0; color: var(--text-2); font-size: 14.5px; }
.head-line b { color: var(--text); font-weight: 600; }

/* Reiter */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 2px; margin: 0 -2px 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 16px; border-radius: 12px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2);
  background: transparent; border: 1px solid transparent; cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab:active { transform: translateY(1px); }
.tab[aria-selected='true'] { color: var(--text); background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-raised); }
.tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.tab[data-status='live'] .dot { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); animation: live-ring 1.6s ease-out infinite; }
.tab[data-status='idea'] .dot, .tab-new .dot { background: transparent; border: 1.5px dashed var(--muted); }
.tab-new { color: var(--muted); border-style: dashed; border-color: var(--border); }
.tab-new[aria-selected='true'] { border-style: solid; }
@keyframes live-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}

/* Panel */
.panel {
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-raised);
  padding: clamp(20px, 3vw, 32px);
  min-height: 320px;
}
.project {
  display: grid; gap: 28px clamp(24px, 4vw, 48px);
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas: 'text shot' 'facts facts';
  align-items: start;
}
.project-text { grid-area: text; min-width: 0; }
.shot { grid-area: shot; }
.facts { grid-area: facts; }
.project-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.project-name { font-size: clamp(26px, 3vw, 34px); font-weight: 700; line-height: 1.1; }
.status {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 10px 0 8px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--c, var(--muted)); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 45%, transparent);
  background: color-mix(in srgb, var(--c, var(--muted)) 10%, transparent);
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.status[data-status='live'] i { animation: live-ring 1.6s ease-out infinite; }
.project-since { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.project-summary { margin: 14px 0 0; color: var(--text-2); font-size: 15.5px; line-height: 1.55; max-width: 52ch; }
.project-domain { display: inline-block; margin-top: 8px; padding: 6px 0; font-family: var(--mono); font-size: 13px; color: var(--text); }
.project-domain::after { content: ' ↗'; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.health {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  padding: 7px 11px 7px 9px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--hairline);
  font-variant-numeric: tabular-nums;
}
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; transition: background-color 0.3s ease; }
.health[data-state='ok'] .health-dot { background: var(--green); animation: live-ring 1.6s ease-out infinite; --c: var(--green); }
.health[data-state='ok'] { color: var(--text); }
.health[data-state='down'] .health-dot { background: var(--red); }
.health[data-state='down'] { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.health b { font-weight: 600; }
.health .sep { color: var(--faint); margin: 0 2px; }

/* Screenshot im Fensterrahmen */
.shot {
  margin: 0; position: relative;
  border-radius: 14px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: var(--shadow-shot);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.2s ease;
}
.shot-bar {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  background: var(--surface-3); border-bottom: 1px solid var(--hairline);
}
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.shot-url {
  margin-left: 8px; flex: 1; height: 20px; line-height: 20px; padding: 0 10px; border-radius: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shot-img { display: block; width: 100%; height: auto; aspect-ratio: 1440 / 900; object-fit: cover; object-position: top; }
@media (hover: hover) and (pointer: fine) {
  .shot:hover { transform: translateY(-3px); border-color: var(--border-strong); }
}
.shot-empty { display: grid; place-items: center; min-height: 260px; background: transparent; box-shadow: none; border: 0; }
.slot {
  width: 100%; height: 100%; min-height: 260px; border-radius: 14px;
  border: 1.5px dashed var(--border-strong);
  display: grid; place-items: center; align-content: center; gap: 8px;
  color: var(--muted); padding: 24px;
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.slot-plus { font-size: 40px; line-height: 1; color: var(--faint); font-weight: 300; }
.slot-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }

/* Faktentafel */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 0 24px;
  margin: 0;
}
.facts > div { padding: 14px 0 16px; border-top: 1px solid var(--hairline); min-width: 0; }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.facts dd { margin: 0; font-size: 14px; color: var(--text); overflow-wrap: break-word; }

/* Leerer Reiter */
.project-new .project-summary code { font-size: 13px; padding: 1px 5px; border-radius: 6px; background: var(--surface-2); color: var(--text); }
.snippet {
  margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--hairline);
  font-size: 12.5px; line-height: 1.55; color: var(--text-2);
}

/* ---------- Operations: Karte + Dock ---------- */
.ops {
  display: grid; grid-template-columns: minmax(0, 1fr) 372px;
  grid-template-areas: 'map dock' 'warn dock' 'wall dock' 'log dock';
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-raised);
  overflow: hidden; margin-bottom: 0;
}

/* Die Karte: Canvas als Untergrund, echte Elemente darueber. */
.ops-map { grid-area: map; position: relative; background: var(--surface); padding: 18px 20px 20px; }
.ops-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ops-head { position: relative; z-index: 1; margin-bottom: 14px; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ops-state { margin: 4px 0 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); text-wrap: balance; }
.ops-fresh {
  margin: 2px 0 0; font-family: var(--mono); font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px;
}
.ops-fresh[data-fetching='true']::after {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: live-ring 1.1s ease-out infinite; --c: var(--accent);
}

/* Die Buehne: Schreibtische links und rechts, die Kugel in der Mitte.
   Die Kugel ist ein leeres Element — rs/ops.js misst es und malt dort hinein. */
.ops-stage {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 0.72fr) 96px minmax(0, 1.55fr);
  align-items: center; gap: 0 10px; min-height: 300px;
}
.ops-core { grid-column: 2; justify-self: center; width: 84px; height: 84px; }
.ops-stage > .desk:not(.desk-slot) { grid-column: 3; }
.ops-stage > .desk-slot { grid-column: 1; grid-row: 1; }

.desk {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 14px 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 18px 40px -26px rgba(11, 13, 18, 0.5), var(--shadow-raised);
  transition: border-color 0.2s ease, box-shadow 0.25s var(--ease-out);
}
.desk[data-act='run'] { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.desk-head { display: flex; align-items: center; gap: 10px; }
.desk-name { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.desk-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.desk-domain { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-dot { margin-left: auto; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.desk-dot[data-state='live'] { background: var(--green); animation: live-ring 1.8s ease-out infinite; --c: var(--green); }
.desk-dot[data-state='warn'] { background: var(--gold); }
.desk-dot[data-state='down'] { background: var(--red); }
.desk-dot[data-state='idle'] { background: var(--accent); }
.desk-sys, .desk-next {
  margin: 8px 0 0; font-family: var(--mono); font-size: 11px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.desk-sys[data-state='down'] { color: var(--red); }
.desk-sys[data-state='warn'] { color: var(--gold); }
.desk-next { margin-top: 2px; color: var(--muted); }

/* Kennzahlen: Wert vorn, Kurve dahinter, Veraenderung daneben. */
.desk-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
/* Discord ist die siebte Zahl: als Leiste ueber die volle Breite statt allein in einer Reihe. */
.tile[data-kpi='discord'] { grid-column: 1 / -1; }
.tile {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 14px; align-content: start;
  gap: 0 6px; padding: 9px 10px 0; min-height: 66px; text-align: left; cursor: pointer;
  font: inherit; color: inherit; border-radius: 9px;
  border: 1px solid var(--hairline); background: var(--surface-2);
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.12s ease;
}
.tile:hover { border-color: var(--border-strong); }
.tile:active { transform: translateY(1px); }
.tile[data-act='run'] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.tile[data-act='ok'] { border-color: var(--green); }
.tile[data-act='err'] { border-color: var(--red); }
.tile-value { grid-column: 1; grid-row: 1; font-size: 19px; font-weight: 600; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.tile-delta {
  grid-column: 2; grid-row: 1; align-self: center; justify-self: start;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; padding: 1px 4px; border-radius: 5px;
  color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent);
}
.tile-delta[data-dir='up'] { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.tile-delta[data-dir='down'] { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.tile-label {
  grid-column: 1 / -1; grid-row: 2; margin-top: 3px; margin-bottom: 2px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.04em; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-spark {
  grid-column: 1 / -1; grid-row: 3; align-self: end;
  width: calc(100% + 20px); margin: 0 -10px; height: 14px; opacity: 0.8; pointer-events: none;
}
.tile-spark { display: none; }
.tile-spark.on { display: block; }
.tile:not(:has(.tile-spark.on)) { padding-bottom: 8px; }
.spark-line { fill: none; stroke: var(--c, var(--accent)); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.spark-area { fill: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); stroke: none; }
.spark-dot { fill: var(--c, var(--accent)); }
.desk { --c: var(--accent); }
@keyframes tile-flash { from { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); } to { background: var(--surface-2); } }
.tile.changed { animation: tile-flash 0.6s var(--ease-out); }

/* Der leere Platz */
.desk-slot {
  display: grid; place-items: center; align-content: center; gap: 4px; min-height: 150px;
  border-style: dashed; background: color-mix(in srgb, var(--surface-2) 55%, transparent);
  box-shadow: none; color: var(--muted); text-align: center;
}
.desk-slot:hover { border-color: var(--border-strong); text-decoration: none; }
.slot-plus { font-size: 26px; font-weight: 300; color: var(--faint); line-height: 1; }
.slot-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.slot-hint { font-family: var(--mono); font-size: 10px; color: var(--faint); }

/* Was Aufmerksamkeit braucht, steht auf dem Schirm — nicht in einem Tooltip. */
.ops-warnings { grid-area: warn; display: grid; gap: 1px; background: var(--hairline); border-top: 1px solid var(--hairline); }
.ops-warnings[hidden] { display: none; }
.ops-warnings .warn { display: flex; align-items: center; gap: 9px; padding: 9px 20px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.ops-warnings .warn-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--gold); }
.ops-warnings .warn[data-level='down'] .warn-dot { background: var(--red); }
.ops-warnings .warn[data-level='down'] .warn-text { color: var(--red); }

/* Das Protokoll: scrollbar und anhaltbar (WCAG 2.2.2). */
.ops-log { grid-area: log; border-top: 1px solid var(--hairline); background: var(--surface-2); }
.ops-log-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px 4px; }
.ops-pause {
  font: inherit; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; cursor: pointer; color: var(--muted);
  background: transparent; border: 1px solid var(--hairline);
}
.ops-pause:hover { color: var(--text); border-color: var(--border-strong); }
.ops-pause[data-on='true'] { color: var(--accent); border-color: var(--accent); }
.ops-ticker {
  height: 96px; overflow-y: auto; padding: 0 20px 10px; display: flex; flex-direction: column; gap: 3px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums;
  scrollbar-width: thin;
}
.ops-ticker div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.ops-ticker .t { color: var(--muted); margin-right: 10px; }
.ops-ticker .ok { color: var(--green); }
.ops-ticker .run { color: var(--accent); }
.ops-ticker .warn { color: var(--gold); }

/* Das Dock: Jarvis | Team */
.jarvis { grid-area: dock; display: flex; flex-direction: column; min-height: 520px; max-height: 640px; border-left: 1px solid var(--border); background: var(--surface); }
.jv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 10px; border-bottom: 1px solid var(--hairline); }
.jv-switch { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--hairline); }
.jv-tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 6px; border-radius: 9px; border: 0;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); background: transparent; cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.jv-tab:hover { color: var(--text); }
.jv-tab[aria-selected='true'] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-raised); }
#jv-tab-team { padding-left: 12px; }
.jv-mark { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 11px; }
.jv-badge[hidden] { display: none; }
.jv-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-family: var(--mono); font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }
.jv-sub { margin: 0; padding: 8px 16px 0; font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jv-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.jv-pane[hidden] { display: none; }
.jv-status {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px 0 8px; border-radius: 999px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--hairline); background: var(--surface-2);
}
.jv-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.jv-status[data-state='ok'] { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.jv-status[data-state='ok']::before { background: var(--green); }
.jv-status[data-state='busy'] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.jv-status[data-state='busy']::before { background: var(--accent); animation: live-ring 1s ease-out infinite; --c: var(--accent); }
.jv-status[data-state='warn'] { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.jv-status[data-state='warn']::before { background: var(--gold); }
.jv-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.jv-empty { color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.jv-empty p { margin: 0 0 10px; }
.jv-empty .jv-sub-note { color: var(--muted); font-size: 12.5px; }
.jv-empty code { font-size: 12px; padding: 1px 5px; border-radius: 6px; background: var(--surface-2); color: var(--text); }
.jv-msg { max-width: 94%; font-size: 13.5px; line-height: 1.5; animation: swap 0.24s var(--ease-out); }
.jv-msg.user { align-self: flex-end; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--accent); color: var(--on-accent); white-space: pre-wrap; overflow-wrap: anywhere; }
.jv-msg.assistant { align-self: flex-start; min-width: 0; }
.jv-msg.assistant .body { padding: 9px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); border: 1px solid var(--hairline); color: var(--text); overflow-wrap: anywhere; }
.jv-msg.assistant .body p { margin: 0 0 8px; } .jv-msg.assistant .body p:last-child { margin: 0; }
.jv-msg.assistant .body ul, .jv-msg.assistant .body ol { margin: 0 0 8px; padding-left: 18px; }
.jv-msg.assistant .body li { margin: 2px 0; }
.jv-msg.assistant .body code { font-size: 12px; padding: 1px 4px; border-radius: 5px; background: var(--surface-3); }
.jv-msg.assistant .body .err { color: var(--red); }
.jv-msg.streaming .body p:last-child::after { content: '▍'; color: var(--accent); animation: caret 1s steps(2) infinite; margin-left: 1px; }
@keyframes caret { 50% { opacity: 0; } }
.jv-steps { display: grid; gap: 2px; margin: 0 0 6px 2px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.jv-steps .ok { color: var(--green); } .jv-steps .run { color: var(--accent); } .jv-steps .err { color: var(--red); }
.jv-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.jv-chip {
  font: inherit; font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.jv-chip:hover { color: var(--text); border-color: var(--border-strong); }
.jv-chip:active { transform: translateY(1px); }
.jarvis[data-auth='guest'] .jv-chips, .jarvis[data-auth='guest'] .jv-form, .jarvis[data-auth='guest'] .jv-foot, .jarvis[data-auth='guest'] .jv-memory, .jarvis[data-auth='unknown'] .jv-chips { display: none; }

/* Team-Chat */
.tm-day { align-self: center; margin: 2px 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tm-msg { max-width: 88%; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; line-height: 1.45; animation: swap 0.24s var(--ease-out); }
.tm-msg.mine { align-self: flex-end; align-items: flex-end; }
.tm-msg.theirs { align-self: flex-start; align-items: flex-start; }
.tm-who { font-size: 11px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.tm-body { padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tm-msg.mine .tm-body { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.tm-msg.theirs .tm-body { background: var(--surface-2); border: 1px solid var(--hairline); color: var(--text); border-bottom-left-radius: 4px; }
.tm-msg time { font-family: var(--mono); font-size: 10px; color: var(--muted); padding: 0 4px; }
.jv-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--hairline); }
.jv-input {
  flex: 1; min-width: 0; resize: none; min-height: 40px; max-height: 120px; padding: 9px 12px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: inherit; font-size: 14px; line-height: 1.4;
}
.jv-input::placeholder { color: var(--muted); }
.jv-input:disabled { opacity: 0.6; }
.jv-btn {
  width: 40px; height: 40px; flex: none; border-radius: 12px; padding: 0; cursor: pointer;
  display: grid; place-items: center; font: inherit; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-raised);
  transition: transform 0.12s ease, color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.jv-btn:hover { color: var(--text); border-color: var(--border-strong); }
.jv-btn:active { transform: translateY(1px) scale(0.97); }
.jv-btn:disabled { opacity: 0.5; cursor: default; }
.jv-send { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.jv-send:hover { background: var(--accent-hover); color: var(--on-accent); }
.jv-mic[data-on='true'] { color: var(--red); border-color: var(--red); animation: live-ring 1.2s ease-out infinite; --c: var(--red); }
/* Freisprechen: dauerhaft an, deshalb ruhiger als das kurze Diktat. */
.jv-hands[data-on='true'] { color: var(--green); border-color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.jv-hands[data-on='true']::after {
  content: ''; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--green); animation: live-ring 1.8s ease-out infinite; --c: var(--green);
}
.jv-btn { position: relative; }
.jv-hands[hidden] { display: none; }
.jv-speak[data-on='true'] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.jv-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 16px 10px; }
.jv-clear, .jv-foot-btn { padding: 4px 0; font: inherit; font-size: 11.5px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.jv-clear:hover, .jv-foot-btn:hover { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.jv-foot-btn { display: inline-flex; align-items: center; gap: 6px; }
.jv-foot-btn[aria-expanded='true'] { color: var(--text); }
.jv-memory-count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--hairline); font-family: var(--mono); font-size: 10px; color: var(--text-2); display: grid; place-items: center; }
.jv-memory-count[hidden] { display: none; }
/* Was Jarvis sich gemerkt hat: sichtbar, je Eintrag loeschbar. Nie
   automatisch befuellt — nur was ein Gruender ihm gesagt hat. */
.jv-memory { margin: 0 12px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; animation: jv-float-in 0.2s var(--ease-out); }
.jv-memory[hidden] { display: none; }
.jv-memory-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--hairline); font-size: 12.5px; font-weight: 600; color: var(--text); }
.jv-memory-note { font-family: var(--mono); font-size: 10.5px; font-weight: 400; color: var(--muted); }
.jv-memory-list { list-style: none; margin: 0; padding: 4px 0; max-height: 220px; overflow: auto; }
.jv-memory-list li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 10px; font-size: 12.5px; line-height: 1.4; color: var(--text); }
.jv-memory-list li + li { border-top: 1px solid var(--hairline); }
.jv-memory-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.jv-memory-by { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.jv-memory-del { flex: none; width: 24px; height: 24px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.jv-memory-del:hover { color: var(--red); border-color: var(--border); }
.jv-memory-empty { padding: 10px; font-size: 12.5px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 1040px) {
  .ops-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 14px; }
  .ops-core { grid-column: 1; grid-row: 1; justify-self: center; }
  .ops-stage > .desk:not(.desk-slot) { grid-column: 1; grid-row: 2; }
  .ops-stage > .desk-slot { grid-column: 1; grid-row: 3; min-height: 92px; }
}
@media (max-width: 900px) {
  .ops { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'map' 'warn' 'log' 'dock'; }
  .jarvis { border-left: 0; border-top: 1px solid var(--border); min-height: 440px; max-height: none; }
  .jv-log { max-height: 340px; }
}
@media (max-width: 640px) {
  .ops { border-radius: 14px; }
  .ops-map { padding: 14px 14px 16px; }
  .ops-state { font-size: 14px; }
  .desk-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-log-head { padding-left: 14px; padding-right: 14px; }
  .ops-ticker { padding: 0 14px 10px; height: 84px; }
  .ops-warnings .warn { padding-left: 14px; padding-right: 14px; }
  .jv-head, .jv-log, .jv-form { padding-left: 14px; padding-right: 14px; }
  .jv-chips { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 767px) and (pointer: coarse) {
  .jv-input { font-size: 16px; }
}

/* ---------- Jarvis schwebend (ausserhalb der Base-Ansicht) ---------- */
.jv-float { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.jv-float[hidden] { display: none; }
.jv-launch {
  position: relative; width: 52px; height: 52px; border-radius: 16px; padding: 0; cursor: pointer;
  display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 12px 32px -10px color-mix(in srgb, var(--accent) 70%, transparent), var(--shadow-raised);
  transition: transform 0.16s var(--ease-out), box-shadow 0.2s ease;
}
.jv-launch:hover { transform: translateY(-1px); }
.jv-launch:active { transform: scale(0.96); }
.jv-launch-mark { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.jv-launch-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--accent); }
.jv-launch[aria-expanded='true'] { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-floating); }
.jv-launch[aria-expanded='true'] .jv-launch-dot { display: none; }
/* Mikrofon an: roter Punkt, auch bei offenem Dock — man soll nie mithoeren
   lassen, ohne es zu sehen. */
.jv-launch[data-mic='true'] .jv-launch-dot { display: block; background: var(--red); }
.jv-launch[data-mic='true'][aria-expanded='true'] .jv-launch-dot { box-shadow: 0 0 0 2px var(--surface); }
.jv-float-panel {
  order: -1; width: min(400px, calc(100vw - 40px)); height: min(640px, calc(100vh - 120px));
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-floating);
  animation: jv-float-in 0.22s var(--ease-out);
}
.jv-float-panel[hidden] { display: none; }
@keyframes jv-float-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
/* Listen aus der Datenbank im Dock: eine echte Tabelle, keine Aufzaehlung
   im Fliesstext. Zahlen rechtsbuendig in Tabellenziffern. */
.jv-table { margin: 6px 0 8px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.jv-table-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; }
.jv-table-title { font-size: 12.5px; font-weight: 600; color: var(--text); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jv-table-count { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.jv-table-dl {
  height: 28px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s var(--ease-out);
}
.jv-table-dl:active { transform: scale(0.97); }
@media (hover: hover) { .jv-table-dl:hover { border-color: var(--border-strong); } }
.jv-table-scroll { max-height: 260px; overflow: auto; }
.jv-table table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 12px; }
.jv-table th, .jv-table td { padding: 6px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--hairline); }
.jv-table th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; color: var(--text-2); font-size: 11px; }
.jv-table td { color: var(--text); }
.jv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.jv-table .empty { color: var(--muted); text-align: center; }

/* Jarvis' Gesicht (rs/robot.js): der Roboter im Streifen ueber dem Verlauf,
   daneben sein erster Satz und zwei Vorschlaege. Farbe nur aus den Tokens;
   Licht geht von der Antenne aus, wenn er zuhoert. */
.jv-face { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px 6px; }
.jarvis[data-auth='guest'] .jv-face, .jarvis[data-auth='unknown'] .jv-face { display: none; }
.jv-face-robot { flex: none; width: 56px; height: 56px; }
.jv-face-say { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.jv-face-text { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text); }
.jv-face-text.muted { color: var(--muted); }
.jv-face-next { display: flex; flex-wrap: wrap; gap: 6px; }
.jv-face-next:empty { display: none; }
.jv-next {
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  font: inherit; font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.12s var(--ease-out);
}
.jv-next:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.jv-next:active { transform: scale(0.97); }
.jv-next::before { content: '→ '; color: var(--accent); }
.rs-robot { display: block; width: 100%; height: 100%; overflow: visible; }
.rs-robot .rb-face { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; }
.rs-robot .rb-visor { fill: color-mix(in srgb, var(--text) 88%, var(--accent)); }
.rs-robot .rb-eye { fill: var(--accent); transition: fill 0.2s ease; }
.rs-robot .rb-mouth { fill: var(--accent); }
.rs-robot .rb-ear, .rs-robot .rb-stem, .rs-robot .rb-limb { fill: var(--border-strong); }
.rs-robot .rb-hand { fill: var(--accent); }
.rs-robot .rb-bulb { fill: var(--border-strong); transition: fill 0.25s ease; }
.rs-robot .rb-think-dot { fill: var(--accent); opacity: 0; transition: opacity 0.2s ease; }
.rs-robot .rb-arm { transition: transform 0.35s var(--ease-out); }
.rs-robot[data-state='listening'] .rb-bulb { fill: var(--green); filter: url(#rb-glow); }
.rs-robot[data-state='listening'] .rb-ear { fill: var(--green); }
.rs-robot[data-state='thinking'] .rb-think-dot { opacity: 1; }
.rs-robot[data-state='thinking'] .rb-eye { fill: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.rs-robot[data-state='speaking'] .rb-mouth { fill: var(--on-accent); filter: url(#rb-glow); }
.rs-robot[data-state='speaking'] .rb-visor { fill: color-mix(in srgb, var(--accent) 35%, var(--text)); }
.rs-robot[data-state='acting'] .rb-hand { filter: url(#rb-glow); }
/* Der kleine Roboter im Reiter: dieselbe Zeichnung, 22 px, nur Gesicht */
.jv-mark { padding: 0; background: transparent; overflow: visible; }
.jv-mark .rs-robot { width: 26px; height: 26px; margin: -2px; }

/* Auftraege (Jobs) als Lanes: eine Zeile je Auftrag, die Stationen als
   Run-Ribbon — Fehler springen ins Auge, Laufendes pulsiert leise. */
#jv-tab-jobs { padding-left: 12px; }
.jv-badge-run { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--hairline); }
.jb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 6px; flex-wrap: wrap; }
.jb-title { font-size: 12px; color: var(--muted); flex: 1 1 180px; min-width: 0; }
.jb-run {
  height: 30px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap;
  transition: border-color 0.15s ease, transform 0.12s var(--ease-out);
}
.jb-run:active { transform: scale(0.97); }
.jb-run:disabled { opacity: 0.55; cursor: default; }
@media (hover: hover) { .jb-run:hover:not(:disabled) { border-color: var(--border-strong); } }
.jb-log { gap: 8px; }
.jb-lane { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.jb-lane[data-status='running'] { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.jb-lane[data-status='failed'] { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.jb-lane-top { display: flex; align-items: center; gap: 8px; }
.jb-lane-title { font-size: 13px; font-weight: 600; color: var(--text); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-when { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.jb-status { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--hairline); color: var(--text-2); background: var(--surface-2); }
.jb-status[data-status='running'] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.jb-status[data-status='done'] { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 10%, transparent); }
.jb-status[data-status='failed'] { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: color-mix(in srgb, var(--red) 10%, transparent); }
.jb-status[data-status='cancelled'] { text-decoration: line-through; }
.jb-ribbon { display: flex; gap: 4px; flex-wrap: wrap; }
.jb-step { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 8px; font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--hairline); max-width: 100%; }
.jb-step i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); flex: none; }
.jb-step[data-status='running'] i { background: var(--accent); animation: jb-pulse 1.2s ease-in-out infinite; }
.jb-step[data-status='done'] i { background: var(--green); }
.jb-step[data-status='failed'] i { background: var(--red); }
.jb-step[data-status='done'], .jb-step[data-status='running'] { color: var(--text); }
.jb-step small { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes jb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.jb-out { font-size: 12.5px; line-height: 1.45; color: var(--text-2); white-space: pre-wrap; border-top: 1px solid var(--hairline); padding-top: 8px; max-height: 140px; overflow: auto; }
.jb-err { font-size: 12px; color: var(--red); }
.jb-cancel { align-self: flex-start; padding: 2px 0; font: inherit; font-size: 11.5px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.jb-cancel:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

/* Die Bildschirmwand (rs/wall.js): drei Panels unter der Karte. Jedes
   bedienbar, keines laut. Zahlen in Mono, Farbe nur fuer Bedeutung. */
.ops-wall { grid-area: wall; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); border-top: 1px solid var(--hairline); background: var(--surface); }
.wall-panel { padding: 12px 20px 14px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.wall-panel + .wall-panel { border-left: 1px solid var(--hairline); }
.wall-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wall-link { font: inherit; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--hairline); background: transparent; color: var(--muted); cursor: pointer; }
.wall-link:hover { color: var(--text); border-color: var(--border-strong); }
.wall-day { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-body { display: flex; flex-direction: column; gap: 6px; min-height: 64px; }
.wall-empty { margin: 0; font-size: 12.5px; color: var(--muted); }
.ops-wall[data-auth='guest'] .wall-body, .ops-wall[data-auth='unknown'] .wall-body { opacity: 0.7; }
.wall-lane { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-2); cursor: pointer; transition: border-color 0.15s ease; }
.wall-lane:hover { border-color: var(--border-strong); }
.wall-lane[data-status='running'] { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.wall-lane[data-status='failed'] { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.wall-lane-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'title status' 'when status'; align-items: center; column-gap: 8px; row-gap: 2px; }
.wall-lane-title { grid-area: title; font-size: 12.5px; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-when { grid-area: when; font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.wall-lane-top .jb-status { grid-area: status; }
.wall-ribbon { display: flex; gap: 3px; }
.wall-step { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--border); }
.wall-step[data-status='running'] { background: var(--accent); animation: jb-pulse 1.2s ease-in-out infinite; }
.wall-step[data-status='done'] { background: var(--green); }
.wall-step[data-status='failed'] { background: var(--red); }
/* Tagesleiste: 24 Stunden, Punkte je Ereignis, eine Jetzt-Linie */
.wall-timeline { position: relative; height: 34px; margin: 2px 0 0; }
.wall-tick { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wall-tick i { display: block; width: 1px; height: 8px; background: var(--border); }
.wall-tick b { font: inherit; font-family: var(--mono); font-size: 9.5px; font-weight: 400; color: var(--muted); }
.wall-timeline::before { content: ''; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--hairline); }
.wall-now { position: absolute; top: -2px; width: 2px; height: 14px; border-radius: 1px; background: var(--accent); transform: translateX(-50%); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent); }
.wall-dot { position: absolute; top: 2px; width: 6px; height: 6px; border-radius: 50%; transform: translateX(-50%); background: var(--text-2); }
.wall-dot[data-kind='round'] { background: var(--accent); }
.wall-dot[data-kind='signup'] { background: var(--green); }
.wall-dot[data-kind='report'], .wall-dot[data-kind='job'] { background: var(--gold, #e0b13f); }
.wall-dot[data-status='failed'] { background: var(--red); }
.wall-dot[data-future='true'] { background: transparent; border: 1.5px solid var(--text-2); }
.wall-dot[data-kind='session'] { border-color: var(--accent); }
.wall-events { gap: 4px; }
.wall-ev { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--text); min-width: 0; }
.wall-ev[data-future='true'] { color: var(--text-2); }
.wall-ev-time { flex: none; width: 40px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.wall-ev-label { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-ev-detail { flex: 1 1 0; min-width: 0; font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Wachdienst */
.wall-sys { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.wall-sys i, .wall-check i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.wall-sys[data-state='ok'] i, .wall-sys[data-state='live'] i { background: var(--green); }
.wall-sys[data-state='warn'] i { background: var(--gold, #e0b13f); }
.wall-sys[data-state='down'] i { background: var(--red); }
.wall-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text); line-height: 1.4; }
.wall-check[data-level='ok'] i { background: var(--green); margin-top: 5px; }
.wall-check[data-level='warn'] i { background: var(--gold, #e0b13f); margin-top: 5px; }
.wall-check[data-level='down'] i { background: var(--red); margin-top: 5px; }
@media (max-width: 1040px) { .ops-wall { grid-template-columns: 1fr; } .wall-panel + .wall-panel { border-left: 0; border-top: 1px solid var(--hairline); } }

/* Die Welt-Schicht der Basis (Entscheidung 6/6b): tieferer Grund, Licht
   von den aktiven Dingen, nicht von Flaechen. Nur auf der Basis, nicht auf
   der Spielerseite. Im hellen Thema die ruhige Fassung ohne Leuchten. */
#view-base { position: relative; }
#view-base::before {
  content: ''; position: absolute; inset: -40px -20px 0; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 45% at 30% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
[data-theme='light'] #view-base::before { opacity: 0.45; }
@media (prefers-color-scheme: light) { :root:not([data-theme='dark']) #view-base::before { opacity: 0.45; } }

/* Inventory (rs/inventory.js): Karten je Dienst, gruppiert nach Kategorie.
   "please fill in" ist sichtbar, nicht versteckt — eine Luecke im Inventar
   ist eine Aufgabe. */
.project-inventory { grid-column: 1 / -1; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.inv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 16px; flex-wrap: wrap; }
.inv-title { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.inv-project { color: var(--muted); font-weight: 500; }
.inv-sub { margin: 6px 0 0; color: var(--text-2); max-width: 60ch; }
.inv-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.inv-search input { width: min(360px, 90vw); height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.inv-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.inv-cat { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.inv-cat[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.inv-cat small { font-family: var(--mono); font-size: 10.5px; color: var(--muted); font-weight: 400; }
.inv-note { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.inv-group { grid-column: 1 / -1; margin-top: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.inv-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: inherit; transition: border-color 0.15s ease, transform 0.12s var(--ease-out); }
.inv-card:hover { border-color: var(--border-strong); }
.inv-card:active { transform: translateY(1px); }
.inv-card[data-status='planned'] { border-style: dashed; }
.inv-card-top { display: flex; align-items: baseline; gap: 8px; }
.inv-card-name { font-weight: 600; font-size: 14.5px; color: var(--text); flex: 1 1 auto; min-width: 0; }
.inv-card-status { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.inv-card-purpose { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.inv-card dl { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 3px 10px; font-size: 12.5px; }
.inv-card dt { color: var(--muted); }
.inv-card dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.inv-card dd.fill { color: var(--gold, #e0b13f); font-style: italic; }
.inv-card dd.soon { color: var(--red); }
.inv-badge { align-self: flex-start; font-family: var(--mono); font-size: 10.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold, #e0b13f) 45%, var(--border)); color: var(--gold, #e0b13f); }
.inv-form { margin-top: 16px; padding: 16px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-floating); }
.inv-form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.inv-form-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; font: inherit; }
.inv-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 14px; }
.inv-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.inv-fields label.wide { grid-column: 1 / -1; }
.inv-fields input, .inv-fields select, .inv-fields textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.inv-form-error { margin: 10px 0 0; font-size: 13px; color: var(--red); }
.inv-form-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.inv-form-actions .spacer { flex: 1; }
.inv-empty { grid-column: 1 / -1; padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 16px; }

/* Freigabe: Jarvis haelt vor einem riskanten Schritt an. Nur ein Mensch
   entscheidet (rs/pagecontrol.js). Bewusst ruhig — die Frage ist wichtig,
   aber kein Alarm. */
.jv-approve {
  margin: 0 12px 8px; padding: 12px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  display: flex; flex-direction: column; gap: 10px;
  animation: jv-float-in 0.2s var(--ease-out);
}
.jv-approve-text { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.jv-approve-text b { font-weight: 600; }
.jv-approve-row { display: flex; justify-content: flex-end; gap: 8px; }
.jv-approve-row button {
  height: 36px; padding: 0 14px; border-radius: 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s var(--ease-out);
}
.jv-approve-row button:active { transform: scale(0.97); }
.jv-approve-row .jv-approve-yes { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) { .jv-approve-row .jv-approve-no:hover { border-color: var(--border-strong); } }

/* Im schwebenden Kasten fuellt das Dock ihn ganz aus, ohne eigenen Rand. */
.jv-float-panel .jarvis { height: 100%; min-height: 0; max-height: none; border: 0; }
@media (max-width: 640px) {
  .jv-float { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .jv-float-panel { width: calc(100vw - 24px); height: calc(100vh - 110px); }
}

/* ---------- Fuss ---------- */
.foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 40px) calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px;
}
.foot nav { display: flex; gap: 16px; }
.foot a { color: var(--text-2); padding: 8px 2px; margin: -8px 0; display: inline-block; }

/* ---------- Auftritt ---------- */
.enter { opacity: 0; transform: translateY(10px); animation: enter 0.55s var(--ease-out) forwards; }
.enter-1 { animation-delay: 0.03s; }
.enter-2 { animation-delay: 0.1s; }
.enter-3 { animation-delay: 0.17s; }
@keyframes enter { to { opacity: 1; transform: none; } }
.swap { animation: swap 0.24s var(--ease-out); }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .enter, .swap { animation: none; opacity: 1; transform: none; }
  .tab .dot, .status i, .health-dot, .jv-status::before, .jv-mic, .jv-hands::after, .jv-msg, .tm-msg, .desk-dot, .ops-fresh::after, .tile.changed, .jv-float-panel, .jv-approve, .jv-memory, .jb-step i, .wall-step { animation: none !important; }
  .view { animation: room-fade 0.2s ease both; }
  .shot, .btn, .tab, .theme { transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Schmal ---------- */
@media (max-width: 860px) {
  .project { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'text' 'shot' 'facts'; gap: 22px; }
  .facts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { height: 58px; gap: 8px; }
  .brand-name { display: none; }
  .views { margin-left: 4px; padding-left: 10px; }
  .view-tab { padding: 0 10px; font-size: 13px; }
  .clock { display: none; }
  .head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .panel { padding: 18px 16px 20px; border-radius: 14px; }
  .links .btn { flex: 1 1 auto; justify-content: center; }
  .project-summary { font-size: 15px; }
  .snippet { font-size: 11.5px; }
}
@keyframes room-fade { from { opacity: 0; } to { opacity: 1; } }
