/* ============================================================================
   Agent-Hub — Design „Werkbank / Kommandobrücke" (Seele statt AI-Slop)
   ----------------------------------------------------------------------------
   Verschmilzt die zwei Haus-Handschriften:
   · reichenberg.ruhr  — warme Erdtöne, Terminal-Ästhetik (Prompts/Präfixe),
                         gestrichelte Hairlines, monospace-Handschrift.
   · Sigil-Dashboard   — Gold als Marke/Aktion, Aether-Teal als „lebt/läuft",
                         Hairlines statt Glow, 3px-Nav-Streifen, 1px-Hover-Lift.
   Der Hub ist nur per SSH-Tunnel erreichbar — die Terminal-Metapher ist
   verdient, nicht dekoriert. Bewusst plain CSS, kein Build-Schritt.

   Token-Herleitung + Gremium-Auflagen: DESIGN.md (Repo-Wurzel).
   Terminal-Präfix-Regel (Gremium): „›" NUR auf zwei Ebenen — View-Titel
   (.topbar h1) und Panel-Kopf nutzt stattdessen „//". Kein „›" auf Feld-
   Labels, Tabellenspalten, Tags. Status wird NIE nur über Farbe kodiert
   (immer Badge-Text; grauer Dot zusätzlich formkodiert als hohler Ring).
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* --- Warme Flächen-Rampe (Near-Black, leicht bräunlich) --- */
  --bg:        oklch(14% 0.008 65);   /* Grund */
  --bg-deep:   oklch(10% 0.006 65);   /* Sidebar, Insets, Log-Flächen */
  --surface:   oklch(18% 0.008 65);   /* Karten / Panels */
  --surface-2: oklch(23% 0.010 65);   /* erhöhte Fläche / Hover / Inputs */
  --surface-3: oklch(27% 0.012 65);

  /* --- Warmer Text (Creme) --- Kontraste gegen --bg (WCAG AA geprüft):
     fg 16:1 · fg-dim 8.6:1 · fg-faint 5.7:1 (worst case surface-2 4.8:1). */
  --fg:        oklch(93% 0.010 85);   /* Headlines / Strong */
  --fg-dim:    oklch(74% 0.015 80);   /* sekundär / Meta */
  --fg-faint:  oklch(63% 0.012 78);   /* NUR dekorativ/kleine Labels — NIE als
                                         regulärer Fließtext auf --surface-2. */

  /* --- Marke & Signale (semantisch, kein beliebiger Akzent) --- */
  --gold:      oklch(81% 0.13 78);    /* Marke / Aktion / Primär */
  --gold-d:    oklch(73% 0.12 74);    /* Gold aktiv / Hover */
  --gold-ink:  oklch(24% 0.03 70);    /* dunkle Tinte AUF Gold (9:1) */
  --gold-soft: oklch(81% 0.13 78 / .12); /* Gold-Flächenhauch (nav, chips) */
  --aether:    oklch(76% 0.09 190);   /* läuft / OK / online (Teal) */
  --aether-d:  oklch(60% 0.09 190);
  --amber:     oklch(77% 0.13 68);    /* Warnung / gestoppt — NIE Fehler */
  --vermilion: oklch(66% 0.17 38);    /* Fehler / überfällig — NIE Warnung */
  --slate:     oklch(64% 0.010 75);   /* inaktiv / unbekannt (neutral warm) */

  /* --- Hairlines (Linien statt Glow) --- */
  --line:      oklch(82% 0 0 / .14);
  --line-2:    oklch(82% 0 0 / .24);
  --line-dash: oklch(82% 0 0 / .18);

  /* --- Form --- */
  --r-sm: 4px;  --r: 6px;  --r-lg: 8px;
  --shadow: 0 1px 0 oklch(100% 0 0 / .02) inset, 0 18px 50px -30px oklch(0% 0 0 / .7);
  --ease: cubic-bezier(.2,.8,.2,1);

  --mono: 'Fira Code', ui-monospace, 'Cascadia Code', Menlo, monospace;
  --sans: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Legacy-Aliasse (Templates/Bestand referenzieren teils alte Namen) */
  --accent: var(--gold);
  --green: var(--aether);
  --red: var(--vermilion);
  --gray: var(--slate);
  --border: var(--line);
  --border-2: var(--line-2);
  --radius: var(--r);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  /* dezenter warmer Grund-Verlauf (atmosphärischer Anker, kein Glow-Overkill) */
  background-image: radial-gradient(120% 60% at 50% -10%, oklch(20% 0.02 70 / .5), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { font-family: var(--mono); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
code, pre, .mono { font-family: var(--mono); }
::selection { background: var(--gold-soft); }

/* Nur für Screenreader (sichtbaren Kontext hinter dekorativen Elementen). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --- Layout: Sidebar + Content --- */
.layout { display: flex; min-height: 100dvh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--bg-deep);
  border-right: 1px solid var(--line); padding: 20px 14px;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; padding: 0 6px; }
.brand .logo { width: 30px; height: 30px; color: var(--gold); flex-shrink: 0; }
.brand b { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .01em; }
.brand .tagline { font-family: var(--mono); font-size: .6rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--fg-dim); display: block; margin-top: 1px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--r-sm); color: var(--fg-dim); font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a:hover { background: var(--surface); color: var(--fg); text-decoration: none; }
/* aktiver Seiten-Indikator: 3px Gold-Streifen links + Gold→transparent-Verlauf.
   Bewusst KEIN flächiger background-color-Fill (sonst Kasten-Look zurück). */
.nav a.active { background: linear-gradient(90deg, var(--gold-soft), transparent); color: var(--fg); }
.nav a.active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--gold);
}
.nav svg { width: 18px; height: 18px; }
.sidebar .foot { margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--line-dash);
  font-family: var(--mono); font-size: .78rem; color: var(--fg-dim); line-height: 1.5; }
.sidebar .foot .prompt { color: var(--aether); }        /* admin@hub */
.sidebar .foot .cwd { color: var(--gold); }              /* :~$ */

.content { flex: 1; min-width: 0; padding: 26px 30px 64px; max-width: 1200px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
/* Terminal-Prompt vor jedem View-Titel („› Übersicht") — Ebene 1 von 2. */
.topbar h1::before { content: "› "; color: var(--gold); font-weight: 600; }
.topbar .sub { color: var(--fg-dim); font-size: .88rem; margin-top: 3px; }

/* Eyebrow (mono, weit gesperrt, Gold) — für Sektions-Auszeichnung. */
.eyebrow { font-family: var(--mono); font-size: .66rem; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }

/* --- Summary-Leiste --- */
.summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.summary .chip {
  display: flex; align-items: center; gap: 9px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px 16px;
  transition: border-color .15s var(--ease), transform .18s var(--ease);
}
.summary .chip:hover { border-color: var(--line-2); transform: translateY(-1px); }
.summary .chip .n { font-family: var(--mono); font-size: 1.35rem; font-weight: 600;
  font-variant-numeric: tabular-nums; }
.summary .chip small { color: var(--fg-dim); }

/* --- Status-Karten-Grid --- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s var(--ease), transform .18s var(--ease);
}
/* soul-lift: 1px Hebung, KEIN Begleit-Glow (Glow=aktiv, nicht Hover). */
.card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card .name { font-family: var(--mono); font-weight: 600; font-size: 1.02rem; }
.card .name a { color: var(--fg); display: inline-flex; align-items: center; gap: 6px; }
/* Pfeil-Shift auf Karten-Link-Hover (reichenberg-Handschrift, nachlaufend). */
.card .name a::after { content: "›"; color: var(--gold); opacity: 0; transform: translateX(-3px);
  transition: opacity .15s var(--ease), transform .15s var(--ease); }
.card .name a:hover { text-decoration: none; }
.card .name a:hover::after { opacity: 1; transform: translateX(0); }
/* Typ-Chip kontextfrei (Gremium-Auflage anti-slop): wird auch in Detail-Köpfen
   (Konsole + Vollansicht) und im Gedächtnis-Panel-Titel verwendet — nicht nur
   auf Karten. font-size absolut, damit der Chip in h1/h2 nicht mitwächst. */
.kind { font-family: var(--mono); font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .1em;
  color: var(--gold); border: 1px solid var(--line-2); padding: 2px 7px; border-radius: var(--r-sm);
  background: var(--gold-soft); vertical-align: middle; }
.card .desc { color: var(--fg-dim); font-size: .85rem; min-height: 2.3em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--fg-dim); }
.card .meta b { color: var(--fg); font-weight: 500; font-family: var(--mono); }

/* --- Status-Badge (Ampel, semantisch benannt) --- */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600;
  padding: 4px 10px; border-radius: 20px; white-space: nowrap; font-family: var(--mono); letter-spacing: .01em; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.s-green .dot, .dot.green { background: var(--aether); }
.s-red .dot,   .dot.red   { background: var(--vermilion); }
.s-amber .dot, .dot.amber { background: var(--amber); }
/* „inaktiv/unbekannt/Bereit/Deaktiviert" = form-kodiert als hohler Ring
   (nicht nur Farbe): unterscheidbar von den gefüllten Aktiv-Zuständen. */
.s-gray .dot,  .dot.gray  { background: transparent; box-shadow: inset 0 0 0 1.5px var(--slate); }
/* Puls „läuft": AUSSCHLIESSLICH opacity (compositor-freundlich, kein box-shadow-
   Glow/Atmen) — Gremium-Auflage Anti-Slop + Game-Feel. */
.s-green { background: oklch(76% 0.09 190 / .12); color: var(--aether); }
.s-red   { background: oklch(66% 0.17 38 / .12);  color: oklch(76% 0.13 40); }
.s-amber { background: oklch(77% 0.13 68 / .12);  color: var(--amber); }
.s-gray  { background: oklch(64% 0.01 75 / .12);  color: var(--fg-dim); }
.dot.green.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
/* !important, weil .dot.green.pulse (0-3-0) sonst den Reset überstimmt —
   Media-Querys erhöhen die Spezifität nicht. */
@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none !important; } }

/* --- Buttons --- */
.btn { font-family: var(--sans); font-size: .85rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--fg);
  padding: 8px 14px; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .18s var(--ease), opacity .15s;
  min-height: 38px; }
.btn:hover { background: var(--surface-3); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: var(--gold-d); border-color: var(--gold-d); }
.btn.danger { border-color: oklch(66% 0.17 38 / .5); color: oklch(76% 0.13 40); background: oklch(66% 0.17 38 / .08); }
.btn.danger:hover { background: oklch(66% 0.17 38 / .18); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { min-height: 30px; padding: 5px 10px; font-size: .78rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Tabellen --- */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--fg-dim); font-weight: 500; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; font-family: var(--mono); }
td.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr:hover td { background: oklch(82% 0 0 / .022); }

/* --- Panels --- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel > h2, .panel > .phead > h2 { position: relative; padding-left: 1.7em; }
/* „//"-Kommentar-Präfix an Panel-Titeln (reichenberg-Handschrift) — Ebene 2 von 2. */
.panel > h2::before, .panel > .phead > h2::before {
  content: "//"; position: absolute; left: 0; color: var(--gold); font-weight: 500; opacity: .85; }
.panel > .phead { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px dashed var(--line-dash); }
.panel > .phead > h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px 26px; }
.kv { display: flex; flex-direction: column; gap: 3px; }
.kv label { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-faint); }
.kv .v { font-family: var(--mono); font-size: .9rem; word-break: break-word; }

/* --- Log-Viewer --- */
.log { background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 16px; font-family: var(--mono); font-size: .8rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; max-height: 540px; overflow-y: auto;
  color: var(--fg-dim); }
.log .live { color: var(--aether); }

/* --- Formulare --- */
form.agentform { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; font-size: .9rem; }
.field .hint { font-size: .78rem; color: var(--fg-dim); }
.field .req { color: var(--gold); }
input, select, textarea {
  font-family: var(--sans); font-size: .92rem; background: var(--bg-deep); color: var(--fg);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; width: 100%;
  min-height: 42px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft); }
textarea { min-height: 110px; resize: vertical; font-family: var(--mono); font-size: .86rem; }
input.mono { font-family: var(--mono); }
.checkrow { display: flex; align-items: center; gap: 10px; }
.checkrow input { width: auto; min-height: auto; accent-color: var(--gold); }
.kind-fields { display: none; }
.kind-fields.show { display: flex; flex-direction: column; gap: 16px; }

/* --- Gedächtnis-Panel --- */
h3.subhead { font-family: var(--mono); font-size: .8rem; color: var(--fg-dim); margin: 10px 0 8px;
  letter-spacing: .04em; }

/* --- Nachrichten --- */
td.msgbody { max-width: 380px; white-space: pre-wrap; word-break: break-word; font-size: .84rem; }
form.msgform { max-width: 620px; }

/* --- Aktivitäts-Tabelle (globale Läufe) --- */
table.activity td.lastline { max-width: 300px; }
table.activity td.lastline .liveline { display: block; max-width: 300px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Eingeklappte „Erweiterte Optionen" ---
   Kein display:flex auf <details> selbst (bräche das native Auf-/Zuklappen).
   Kein „›"-Präfix hier (Zwei-Ebenen-Regel) — native Disclosure-Marke bleibt. */
details.advanced { border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); padding: 0 16px; }
details.advanced > summary { cursor: pointer; padding: 14px 0; font-weight: 500;
  font-family: var(--mono); font-size: .9rem; color: var(--fg-dim); list-style-position: inside; }
details.advanced[open] > summary { color: var(--fg); border-bottom: 1px solid var(--line); }
details.advanced[open] > .field { margin-top: 16px; }
details.advanced > .field:last-child { margin-bottom: 16px; }

/* --- Toast --- */
#toast-zone { position: fixed; bottom: 22px; right: 22px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
/* Gleichmäßiger Hairline-Rahmen statt farbigem Seiten-Tab (Anti-Slop-Detektor). */
.toast { background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); padding: 11px 16px; box-shadow: var(--shadow); font-size: .86rem; max-width: 380px;
  animation: slidein .2s var(--ease); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- Login --- */
.login-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background-image: radial-gradient(80% 50% at 50% 0%, oklch(20% 0.02 70 / .6), transparent 65%); }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 34px 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-card .brand { justify-content: center; margin-bottom: 6px; }
.login-card p.tag { text-align: center; color: var(--fg-dim); margin: 0 0 22px; font-size: .9rem;
  font-family: var(--mono); }
.err { background: oklch(66% 0.17 38 / .12); border: 1px solid oklch(66% 0.17 38 / .4); color: oklch(76% 0.13 40);
  padding: 9px 12px; border-radius: var(--r-sm); font-size: .85rem; margin-bottom: 14px; }
.notice { background: var(--gold-soft); border: 1px solid var(--gold-d); color: var(--gold);
  padding: 9px 12px; border-radius: var(--r-sm); font-size: .85rem; margin-bottom: 14px; }

/* --- Responsive --- */
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; display: flex; flex-direction: row;
    flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px; }
  .sidebar .brand { margin-bottom: 0; margin-right: auto; }
  .sidebar .foot { display: none; }
  .nav { display: flex; gap: 4px; }
  .nav a { padding: 8px 10px; }
  .nav a.active::before { display: none; }
  .nav a span { display: none; }   /* Icon-only: aria-label bleibt am <a> (base.html) */
  .content { padding: 18px 16px 50px; }
}
/* --- Zugänglichkeit & HTMX-Ladezustand --- */
a:focus-visible, .btn:focus-visible, .nav a:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, summary:focus-visible, .hbar:focus-visible {
  outline: 2px solid var(--aether); outline-offset: 2px; border-radius: var(--r-sm);
}
/* HTMX setzt .htmx-request auf das auslösende Element während des Requests. */
.btn.htmx-request { opacity: .55; pointer-events: none; position: relative; }
.btn.htmx-request::after {
  content: ""; width: 13px; height: 13px; margin-left: 4px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; display: inline-block; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Ein Block deckt ALLE Bewegungen ab (Puls, Lift, Pfeil, Chip, Toast, Spinner). */
@media (prefers-reduced-motion: reduce) {
  .btn.htmx-request::after, .dot.pulse, .toast { animation: none !important; }
  .card, .btn, .summary .chip, .card .name a::after,
  input, select, textarea, .history .hbar { transition: none; }
  .card:hover, .btn:hover, .summary .chip:hover { transform: none; }
}
.muted { color: var(--fg-dim); }
.spacer { flex: 1; }
.tag-pill { font-family: var(--mono); font-size: .7rem; background: var(--surface-2); color: var(--fg-dim);
  padding: 2px 7px; border-radius: var(--r-sm); border: 1px solid var(--line); }

/* --- Status-Zeile, Pills (extern/stockt) --- */
.statusrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { font-family: var(--mono); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  padding: 2px 7px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--fg-dim);
  border: 1px solid var(--line); }
.pill.amber { background: oklch(77% 0.13 68 / .14); color: var(--amber); border-color: oklch(77% 0.13 68 / .4); }

/* --- Live-Zeile (letzte Logzeile eines laufenden Runs) --- */
.liveline { font-family: var(--mono); font-size: .76rem; color: var(--fg-dim);
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 6px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liveline a { color: var(--fg-dim); }
.liveline a:hover { color: var(--aether); text-decoration: none; }

/* --- Mini-Verlauf der letzten Läufe --- */
.history { display: flex; gap: 3px; align-items: flex-end; margin-top: auto; padding-top: 4px; }
.history .hbar { width: 8px; height: 16px; border-radius: 2px; opacity: .85;
  background: var(--slate); transition: opacity .15s var(--ease), transform .15s var(--ease); }
.history .hbar:hover { opacity: 1; transform: scaleY(1.15); text-decoration: none; }
.history .hbar.green { background: var(--aether); }
.history .hbar.red   { background: var(--vermilion); }
.history .hbar.amber { background: var(--amber); }
.history .hbar.gray  { background: var(--slate); }
@media (prefers-reduced-motion: reduce) { .history .hbar:hover { transform: none; } }

/* --- Konsole: zweite Liste (links) + Detail-Bereich (rechts) ---------------
   Meister-Detail neben der bestehenden Sidebar. Die Liste ist eine ruhige
   Navigations-Spalte (Terminal-Handschrift: mono-Namen, hohler/gefüllter
   Status-Dot wie überall), der aktive Eintrag trägt denselben 3px-Gold-Streifen
   wie die Sidebar-Nav — eine visuelle Sprache, kein zweites System. */
.console { display: flex; gap: 18px; align-items: flex-start; }
.console-list {
  width: 300px; flex-shrink: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  position: sticky; top: 26px; max-height: calc(100dvh - 52px);
  display: flex; flex-direction: column; overflow: hidden;
}
.console-list-head { padding: 10px; border-bottom: 1px dashed var(--line-dash); flex-shrink: 0; }
.console-list-head input { min-height: 36px; padding: 7px 11px; }
.console-list-scroll { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.al-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--r-sm); color: var(--fg-dim); border: 1px solid transparent;
  position: relative; transition: background .15s var(--ease), color .15s var(--ease);
}
.al-item:hover { background: var(--surface-2); color: var(--fg); text-decoration: none; }
/* aktiver Eintrag = gleiche Handschrift wie die Sidebar-Nav (3px-Gold + Verlauf).
   border-color TRANSPARENT HALTEN (Gremium-Auflage gamefeel): die 1px-Border von
   .al-item ist Platz-Reserve gegen Layout-Sprung — nie einfärben/entfernen. */
.al-item.active { background: linear-gradient(90deg, var(--gold-soft), transparent); color: var(--fg);
  border-color: transparent; }
.al-item.active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--gold);
}
.al-item .dot { width: 9px; height: 9px; }
.al-name { font-family: var(--mono); font-weight: 500; font-size: .9rem;
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Typ-Kürzel ist informativer Inhalt, kein Deko-Label → --fg-dim statt --fg-faint
   (Gremium-Auflage a11y: Eigenregel „faint nie informativ auf surface-2"). */
.al-kind { font-family: var(--mono); font-size: .6rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--fg-dim); flex-shrink: 0; }
/* Sichtbare Nicht-Farb-Zweitkodierung des Status (Gremium-Auflage anti-slop):
   „!" = Fehler/überfällig, „■" = gestoppt — in Graustufen unterscheidbar;
   Screenreader bekommen das Label über den sr-only-Text der Zeile. */
.al-flag { font-family: var(--mono); font-size: .72rem; font-weight: 600; flex-shrink: 0; }
.al-flag.red { color: var(--vermilion); }
.al-flag.amber { color: var(--amber); }

.console-detail { flex: 1; min-width: 0; }
/* Kopf des Detail-Bereichs — der Agentenname ist Sektions-Titel INNERHALB der
   „Agenten"-View, trägt daher bewusst KEIN „›" (Zwei-Ebenen-Regel: „›" nur auf
   der View-Überschrift .topbar h1, „//" auf Panel-Köpfen). */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px dashed var(--line-dash); }
.detail-title { font-family: var(--mono); font-size: 1.25rem; font-weight: 600; margin: 0; }
.detail-head .sub { color: var(--fg-dim); font-size: .86rem; margin-top: 4px; }

.console-empty { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 360px; text-align: center; color: var(--fg-dim);
  border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface); padding: 40px 24px; }
.console-empty svg { width: 42px; height: 42px; color: var(--gold); opacity: .5; }
.console-empty b { font-family: var(--mono); color: var(--fg); }

/* Konsole gestapelt auf schmalen Viewports: Liste oben (scrollbar), Detail darunter. */
@media (max-width: 820px) {
  .console { flex-direction: column; }
  .console-list { width: 100%; position: static; max-height: 320px; }
}
/* reduced-motion HIER (nicht im zentralen Block weiter oben): dieser Abschnitt
   steht am Dateiende — eine frühere gleich-spezifische Regel würde von der
   .al-item-Basisregel wieder überstimmt (Gremium-Auflage a11y, WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) { .al-item { transition: none; } }
