:root {
    /* =====================================================================
       ZENTRALE DESIGN-TOKENS – einzige Quelle der Wahrheit für Farben.
       Niemals Hex-Werte in Razor/Scoped-CSS duplizieren, immer hierauf
       referenzieren (var(--tri-…)). Auch scoped .razor.css erbt diese.
       ===================================================================== */

    /* Markengrün */
    --tri-green: #2e8b3d;          /* Standard (Buttons, Links, Akzente) */
    --tri-green-hover: #277a35;
    --tri-green-active: #1f5e28;
    --tri-green-dark: #14532d;     /* dunkler Akzent: Hover-Text, Links */
    --tri-green-soft: #cdeacf;     /* heller Akzent: weiche Ränder/Unterstriche */
    --tri-green-bg: #ebf6ed;       /* sehr heller Grün-Hintergrund (Hover-Flächen) */
    --tri-green-bg-active: #e1f1e4;/* aktiver Grün-Hintergrund (Sidebar active) */

    /* Grau & Text */
    --tri-text: #33373d;           /* Standard-Textfarbe */
    --tri-muted: #6c757d;          /* gedämpfter Text, Formular-Labels */
    --tri-muted-2: #4b5159;        /* etwas dunkler (Sekundärinfo, Nav-Text) */
    --tri-subtle: #495057;         /* Hinweis-Grau (z. B. „bearbeiten") */
    --tri-faint: #9aa0a6;          /* sehr blass (Abschnittstitel, Carets) */
    --tri-border: #e7e9ec;         /* Standard-Rahmen */
    --tri-surface: #f3f4f6;        /* Seiten-Hintergrund */
    --tri-ink: #1f2227;            /* schwarzer Sidebar-Kopf / mobiler Menü-Knopf */

    /* Akzentfarben */
    --tri-dialog: #e8590c;         /* „Nur im Dialog startbar"-Badge */
    --tri-secondary: #6c757d;      /* neutrale Sekundär-Pille (Kritiker-Badge) */

    --bs-primary: var(--tri-green);
    --bs-primary-rgb: 46, 139, 61;
    --bs-success: var(--tri-green);
    --bs-success-rgb: 46, 139, 61;
    --bs-link-color: var(--tri-green);
    --bs-link-color-rgb: 46, 139, 61;
    --bs-link-hover-color: var(--tri-green-dark);
}

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--tri-surface);
    color: var(--tri-text);
}

/* Grün-Buttons (primary UND success) nutzen denselben zentralen Grünton. */
.btn-primary, .btn-success {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--tri-green);
    --bs-btn-border-color: var(--tri-green);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--tri-green-hover);
    --bs-btn-hover-border-color: var(--tri-green-hover);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--tri-green-active);
    --bs-btn-active-border-color: var(--tri-green-active);
    --bs-btn-disabled-bg: var(--tri-green);
    --bs-btn-disabled-border-color: var(--tri-green);
}

.btn-outline-primary, .btn-outline-success {
    --bs-btn-color: var(--tri-green);
    --bs-btn-border-color: var(--tri-green);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--tri-green);
    --bs-btn-hover-border-color: var(--tri-green);
    --bs-btn-active-bg: var(--tri-green);
    --bs-btn-active-border-color: var(--tri-green);
}

.text-primary, .text-success { color: var(--tri-green) !important; }
.bg-primary, .bg-success { background-color: var(--tri-green) !important; }
.text-bg-primary, .text-bg-success { background-color: var(--tri-green) !important; color: #fff !important; }

/* Einheitliche Bezeichnungsfelder (Formular-Labels): fett und dunkelgrau – überall gleich. */
.form-label {
    font-weight: 600 !important;
    color: var(--tri-muted) !important;
}

/* Klammer-/Zusatzhinweise im Label nicht fett (z. B. „(Markdown)", „(optional)"). */
.form-label .text-muted,
.form-label .small {
    font-weight: 400 !important;
}

/* Dashboard stat cards */
.stat-card {
    border: none;
    border-left: 0.3rem solid var(--accent, var(--tri-green));
    border-radius: 0.6rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 1.3rem;
    color: #fff;
    background-color: var(--accent, var(--tri-green));
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    font-size: 1.5rem;
}

/* Tag-Bubbles */
.tag-pill {
    background-color: var(--tri-green);
    color: #fff;
    font-weight: 500;
    padding: 0.4em 0.7em;
}

.tag-pill .tag-x {
    font-size: 0.55rem;
    padding: 0.25em;
    opacity: 0.85;
}

.tag-pill .tag-x:hover {
    opacity: 1;
}

.tag-x-btn {
    border: none;
    background: none;
    padding: 0;
    line-height: 1;
    font-size: 0.7rem;
    opacity: 0.85;
    cursor: pointer;
}

.tag-x-btn:hover { opacity: 1; }

/* Tag-Auswahlliste (Picker) */
.tag-picker {
    position: absolute;
    z-index: 1056;            /* über dem tag-pop-backdrop (1055), damit Einträge klickbar bleiben */
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 0.6rem;
    padding: 0.35rem;
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.16);
}

/* Kopfzeile des Auswahl-Popups (MCP/Tool/Skill hinzufügen). */
.tag-picker-head {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9aa0a6;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.3rem 0.6rem 0.4rem;
}

.tag-picker-item {
    display: flex;
    align-items: center;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    color: #33373d;
}

.tag-picker-item:hover {
    background-color: #ebf6ed;
    color: var(--tri-green);
}

/* Farb-Swatches (Tag-Verwaltung) */
.swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d0d3d8;
    cursor: pointer;
    padding: 0;
}

.swatch-active {
    box-shadow: 0 0 0 2px #212529;
}

/* Tag mit rundem Entfernen-Symbol (Detailansicht) */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.35em 0.75em;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tag-chip .tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: inherit;
    opacity: 0.8;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}

.tag-chip .tag-remove:hover { opacity: 1; }
.tag-chip .tag-remove i { font-size: 1rem; }

/* Weißes "+"-Tag, das das Popover öffnet */
.tag-add {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.3em 0.7em;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #fff;
    color: #495057;
    border: 1px dashed #adb5bd;
    cursor: pointer;
}

.tag-add:hover { border-color: var(--tri-green); color: var(--tri-green); }

/* Popover zum Zuordnen/Anlegen von Tags */
.tag-pop-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: transparent;
}

.btn-close-sm {
    width: 0.6rem;
    height: 0.6rem;
    padding: 0.25rem;
}

.tag-pop {
    position: absolute;
    z-index: 1060;
    top: calc(100% + 6px);
    left: 0;
    width: 280px;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 0.6rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 0.6rem;
}

.tag-pop-item {
    display: flex;
    align-items: center;
    gap: 0.5em;
    width: 100%;
    padding: 0.35rem 0.4rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.88rem;
}

.tag-pop-item:hover { background-color: #f3f5f7; }

.tag-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 auto;
}

/* Zurück-Button auf gleiche Höhe wie die große Agenten-Nummer */
.btn-back {
    height: 3.2rem;
    width: 3.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Große Agenten-Nummer in der Detailansicht */
.agent-id-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.2rem;
    height: 3.2rem;
    padding: 0 0.6rem;
    border-radius: 0.75rem;
    background: var(--tri-green);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(46,139,61,0.3);
}

/* Tag-Filter (Agentenliste): aufklappbares Popup mit mehrfach wählbaren Bubbles */
.tag-filter-pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1056;
    background: #fff;
    border: 1px solid #e6e8ea;
    border-radius: 0.6rem;
    padding: 0.6rem;
    max-height: 320px;
    overflow-y: auto;
}

.tag-filter-pill {
    border: 0;
    cursor: pointer;
    padding: 0.42em 0.75em;
    font-size: 0.82rem;
    opacity: 0.45;
    transition: opacity 0.12s ease, box-shadow 0.12s ease;
}

.tag-filter-pill:hover {
    opacity: 0.8;
}

.tag-filter-pill.tag-filter-pill-on {
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(16, 24, 40, 0.22);
}

/* Kritiker-Agenten: graue Nummer statt grün */
.agent-id-badge.agent-id-badge-critic {
    background: #6f757d;
    box-shadow: 0 2px 6px rgba(111,117,125,0.3);
}

/* ---------- Kanban-Dashboard ---------- */

/* Kartenbewegungen werden per FLIP (Web Animations API) animiert – siehe index.html. */

/* Runder Benutzer-Avatar (Bild oder Symbol-Fallback) */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e7e9ec;
    color: #8a9099;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Avatar mit Kamera-Button (Foto wählen) in Dialogen */
.avatar-edit {
    position: relative;
    flex-shrink: 0;
}

.avatar-edit-btn {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background-color: var(--tri-green);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    border: 2px solid #fff;
}

.avatar-edit-btn:hover { background-color: #256e31; }

.kanban-board {
    display: grid;
    /* Alle Spalten dynamisch gleich breit in EINER Reihe (unabhängig von der Spaltenanzahl). */
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .kanban-board { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 576px) {
    .kanban-board { grid-template-columns: 1fr; }
}

.kanban-col {
    background: var(--col-bg, #f4f5f7);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0.9rem;
    padding: 0.75rem;
    min-height: 200px;
}

.kanban-col-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.4rem 0.75rem;
}

.kanban-col-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--col-accent, #6c757d);
}

.kanban-col-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--col-accent, #6c757d);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.4rem;
    padding: 0.05rem 0.45rem;
}

/* Laufzeitanzeige in der Spalte "In Arbeit" */
.kanban-runtime { color: #80868b; }
.kanban-runtime-over { color: #dc3545; font-weight: 700; }

/* Stop-Button auf wartenden/laufenden Karten */
.kanban-stop-btn {
    border: none;
    background: none;
    color: #dc3545;
    font-size: 1rem;
    line-height: 1;
    padding: 0.1rem 0.25rem;
    border-radius: 0.35rem;
    opacity: 0.7;
}
.kanban-stop-btn:hover { opacity: 1; background: #fdecea; }

/* Icon-Button zum Archivieren im Spaltenkopf */
.kanban-archive-btn {
    border: none;
    background: none;
    color: var(--col-accent, #6c757d);
    font-size: 0.95rem;
    line-height: 1;
    padding: 0.2rem 0.35rem;
    border-radius: 0.35rem;
    opacity: 0.65;
}
.kanban-archive-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

.kanban-col-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.kanban-empty {
    color: #9aa0a6;
    font-size: 0.85rem;
    text-align: center;
    padding: 1.25rem 0;
}

.kanban-col-foot {
    text-align: center;
    font-size: 0.75rem;
    color: #9aa0a6;
    padding: 0.6rem 0.4rem 0.1rem;
}

.kanban-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 0.7rem;
    padding: 0.75rem 0.85rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s, transform 0.15s;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.kanban-card-id {
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: #9aa0a6;
    margin-bottom: 0.25rem;
}

.kanban-card-run-link {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.kanban-card-title {
    display: flex;
    align-items: flex-start;   /* Agentenkopf oben am (mehrzeiligen) Text, nicht mittig */
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--tri-muted-2);
    text-decoration: none;
    margin-bottom: 0.45rem;
}

/* Statusfarbenes Agentenkopf-Symbol auf der Karte (klein) … */
.kanban-card-icon {
    height: 26px;
    width: auto;
    flex-shrink: 0;
}

/* … und in der Lauf-Detailansicht (so hoch wie Titel + Unterzeile) */
.run-detail-icon {
    height: 72px;
    width: auto;
}

/* Einstellungen: Abschnitte */
.settings-section {
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #eceef0;
}

.settings-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.settings-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2b2f36;
    margin-bottom: 0.75rem;
}

/* Lauf-Detail: grüne Icon-Kachel im Kopf */
.run-detail-tile {
    width: 3rem;
    height: 3rem;
    border-radius: 0.8rem;
    background-color: var(--tri-green);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex: 0 0 auto;
}

/* Audit-Zeitstrahl */
.run-timeline-item {
    position: relative;
    padding-left: 1.4rem;
    padding-bottom: 0.85rem;
}

.run-timeline-item::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    bottom: 0;
    width: 2px;
    background-color: #d7e3da;
}

.run-timeline-item:last-child {
    padding-bottom: 0;
}

.run-timeline-item:last-child::before {
    bottom: auto;
    height: 9px;
}

.run-timeline-item::after {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid var(--tri-green);
}

.run-timeline-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.15rem;
}

.run-timeline-time {
    font-size: 0.75rem;
    color: #8a9099;
}

/* Benachrichtigungs-Karten im Lauf-Detail */
.run-notif-card {
    border: 1px solid #e7e9ec;
    border-radius: 0.65rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.6rem;
}

.run-notif-card:last-child {
    margin-bottom: 0;
}

.run-notif-hitl {
    background-color: #f6f7f9;
}


.kanban-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.55rem;
}

.kanban-card-times {
    font-size: 0.74rem;
    color: #80868b;
    margin-bottom: 0.5rem;
}

.kanban-card-error {
    font-size: 0.78rem;
    color: #b02a37;
    background: #fdf0f1;
    border-left: 3px solid #dc3545;
    border-radius: 0.3rem;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-priority {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 0.3rem;
    padding: 0.1rem 0.35rem;
    margin-left: 0.4rem;
}
.kanban-priority-low { background: #eceff1; color: #607d8b; }
.kanban-priority-high { background: #fff3e0; color: #e65100; }
.kanban-priority-immediate { background: #fdecea; color: #c62828; }
.kanban-priority-dialog { background: #e1f1e4; color: #1e6b2c; }

.kanban-card-foot {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    border-top: 1px solid #f1f3f4;
    padding-top: 0.55rem;
}

.kanban-card-foot .agent-id-chip {
    min-width: 1.6rem;
    height: 1.3rem;
    font-size: 0.72rem;
    border-radius: 0.35rem;
}

.kanban-card-agent {
    font-size: 0.8rem;
    color: #5f6368;
}

.kanban-card-link {
    color: #9aa0a6;
    font-size: 0.85rem;
    text-decoration: none;
}

.kanban-card-link:hover { color: var(--tri-green-dark); }

/* Modernes Benutzer-Modal */
.user-modal {
    border-radius: 1.1rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.22);
}
.user-modal-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eef0f2;
}
.user-modal-avatar {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    background: linear-gradient(135deg, var(--tri-green), #4caf50);
    box-shadow: 0 4px 10px rgba(46,139,61,0.35);
}
.user-modal-body { padding: 1.5rem; }
.user-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #eef0f2;
}
.role-toggle {
    display: flex;
    gap: 0.5rem;
}
.role-option {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1.5px solid #dde1e5;
    border-radius: 0.6rem;
    background: #fff;
    color: #6c757d;
    font-weight: 600;
    transition: all 0.15s;
}
.role-option:hover { border-color: var(--tri-green); color: var(--tri-green); }
.role-option.active {
    border-color: var(--tri-green);
    background: #e1f1e4;
    color: #1e6b2c;
}

/* Sortierbare Tabellen-Überschriften */
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
th.sortable:hover { background-color: #e9ecef; }

/* Kleine Agenten-Nummer für Listen/Überschriften */
.agent-id-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    height: 1.5rem;
    padding: 0 0.45rem;
    border-radius: 0.4rem;
    background: var(--tri-green);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}

/* Agentenkopf-Symbol in der Liste (grün; Kritiker grau via Graustufenfilter).
   Höhe an den zweizeiligen Textblock (Name + Beschreibung) rechts angeglichen. */
.agent-head {
    height: 2.4rem;
    width: auto;
    flex: 0 0 auto;
    display: block;
}

/* Etwas größere Nummern-Variante für die Agentenliste (Worker grün, Kritiker grau). */
.agent-id-chip-lg {
    min-width: 2.3rem;
    height: 1.95rem;
    padding: 0 0.55rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

/* In Titel/Namen integrierte Agentennummer: dunkelgrau, gleiche Schriftart wie der Name. */
.agent-num {
    color: var(--tri-subtle);
}

/* Agentenname im Seitentitel: Markengrün. */
.agent-name-title {
    color: var(--tri-green);
}

.agent-head-critic {
    filter: grayscale(1) brightness(1.05);
}

/* Größerer Kopf für Detail-/Kopfbereiche (passt zur Höhe des Nummern-Badges). */
.agent-head-lg {
    height: 3.2rem;
}

/* Kritiker-Agenten: graue Nummer (zur Unterscheidung von der grünen Worker-Nummer). */
.agent-id-chip-critic {
    background: #6f757d;
}

/* Drag&Drop-Tabelle für Skills (vorangestellte Prompts) */
.skill-order-table tbody tr {
    cursor: grab;
}

.skill-order-table tbody tr.skill-row-dragging {
    opacity: 0.5;
    background: #ebf6ed;
}

.skill-order-table .bi-grip-vertical {
    cursor: grab;
}

/* Aktionen-Menü (Kebab) in der Agentenliste. */
/* Aktionsmenü darf aus dem Tabellen-Container herausragen (sonst wird das Popup bei den
   unteren Zeilen abgeschnitten). */
.agents-table-wrap {
    overflow: visible;
}

.agent-actions-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 1056;
    min-width: 210px;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 0.6rem;
    padding: 0.35rem;
    text-align: left;
}

/* Bei den unteren Zeilen nach oben öffnen, damit das Menü im sichtbaren Bereich bleibt. */
.agent-actions-menu-up {
    top: auto;
    bottom: calc(100% + 4px);
}

.agent-actions-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    color: #33373d;
}

.agent-actions-item:hover {
    background-color: #ebf6ed;
}

/* ---------- Ordner-TreeView ---------- */
.folder-tree {
    user-select: none;
}

/* Ordner-Auswahl als Popup (z. B. Filter in der Agentenliste). */
.folder-filter-pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1056;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 0.6rem;
    padding: 0.4rem;
    max-height: 22rem;
    overflow: auto;
    user-select: none;
}

.folder-node {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.82rem;       /* gleiche Größe wie die Agenten-Blätter */
    transition: background 0.12s, box-shadow 0.12s;
}

.folder-node:hover {
    background: #f1f5f2;
}

.folder-node.selected {
    background: #e4f3e7;
    box-shadow: inset 3px 0 0 var(--tri-green);
}

/* Hervorhebung beim Darüberziehen eines Agenten (Drop-Ziel). */
.folder-node.drag-over {
    background: #d7efdc;
    box-shadow: 0 0 0 2px var(--tri-green) inset;
}

.folder-caret {
    width: 1rem;
    display: inline-flex;
    justify-content: center;
    color: #8a9099;
    font-size: 0.8rem;
    flex: 0 0 auto;
}

.folder-icon {
    color: #d8a13a;            /* Ordner-Gelb */
    flex: 0 0 auto;
}

.folder-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-count {
    flex: 0 0 auto;
    min-width: 1.4rem;
    text-align: center;
    background: #e9ecef;
    color: #495057;
    border-radius: 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.05rem 0.45rem;
}

/* Aktions-Buttons je Knoten: erst beim Hovern sichtbar. */
.folder-actions {
    display: inline-flex;
    gap: 0.15rem;
    opacity: 0;
    transition: opacity 0.12s;
    flex: 0 0 auto;
}

.folder-node:hover .folder-actions {
    opacity: 1;
}

.folder-actions button {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0.1rem 0.3rem;
    border-radius: 0.35rem;
    line-height: 1;
}

.folder-actions button:hover {
    background: #ffffff;
    color: var(--tri-green);
}

/* Agenten-Blatt im Baum (unter einem Ordner) – kompakt, dezent. */
.folder-agent-leaf {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.12rem 0.5rem;
    border-radius: 0.5rem;
    cursor: grab;
    font-size: 0.82rem;
}

.folder-agent-leaf:hover {
    background: #f1f5f2;
}

.folder-agent-leaf:active {
    cursor: grabbing;
}

.folder-agent-leaf-icon {
    color: #9aa0a6;
    font-size: 0.8rem;
    flex: 0 0 auto;
}

/* Agentennummer als dezenter Text (nicht im Kasten). */
.folder-agent-leaf-num {
    color: #9aa0a6;
    font-weight: 600;
    margin-right: 0.35rem;
}

/* Agentenname: normal (nicht fett), dezente Farbe, beim Hovern grün. */
.folder-agent-leaf-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #33373d;
    font-weight: 400;
    text-decoration: none;
}

.folder-agent-leaf-name:hover {
    color: var(--tri-green);
}

.folder-agent-leaf-remove {
    border: none;
    background: transparent;
    color: #adb5bd;
    padding: 0.05rem 0.3rem;
    border-radius: 0.35rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.12s;
    flex: 0 0 auto;
}

.folder-agent-leaf:hover .folder-agent-leaf-remove {
    opacity: 1;
}

.folder-agent-leaf-remove:hover {
    background: #fff;
    color: #dc3545;
}

/* Farbiger Tag-Punkt am Ordnerknoten. */
.folder-tag-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex: 0 0 auto;
}

/* Agenten-Zeile (rechts), per Drag&Drop einem Ordner zuweisbar – kompakt. */
.folder-agent-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #eceef1;
    border-radius: 0.5rem;
    margin-bottom: 0.3rem;
    background: #fff;
    cursor: grab;
    font-size: 0.82rem;
}

.folder-agent-row:hover {
    border-color: #cfe6d5;
    background: #fafdfb;
}

.folder-agent-row:active {
    cursor: grabbing;
}

/* Topbar: angemeldeter Benutzer */
.topbar-user {
    color: #cfd2d6;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Klickbarer Benutzername in der Topbar (öffnet das Profil) */
.topbar-user-btn {
    align-items: center;
    background: none;
    border: none;
    color: #cfd2d6;
    font-size: 0.9rem;
    margin-left: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
}
.topbar-user-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* API-Token-Liste in Profil-/Benutzer-Dialogen */
.token-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.token-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid #e6e8ea;
    border-radius: 0.5rem;
    background: #f8f9fa;
}
.token-value {
    display: block;
    font-size: 0.75rem;
    color: #4b5159;
    word-break: break-all;
}

/* Lauf-Historie */
.list-group-item-action.active-run {
    background-color: #e1f1e4;
    border-left: 3px solid var(--tri-green);
}

.chat-bubble {
    max-width: 85%;
    border-radius: 0.75rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
}

.chat-out {
    background-color: #e1f1e4;
    border: 1px solid var(--tri-green-soft);
}

.chat-in {
    background-color: #f1f3f5;
    border: 1px solid #e6e8ea;
}

/* Volle-Breite-Chatnachrichten (Claude-Desktop-Stil) */
.chat-msg {
    width: 100%;
    border-radius: 0.6rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.chat-msg-out {
    background-color: #e1f1e4;
    border: 1px solid var(--tri-green-soft);
}

.chat-msg-in {
    background-color: #f7f8fa;
    border: 1px solid #e6e8ea;
}

.chat-msg-critic {
    background-color: #fff4e3;
    border: 1px solid #ffd9a0;
}

/* Finale, vom Lauf übernommene Antwort hervorheben. */
.chat-msg-final {
    border: 2px solid var(--tri-green);
    box-shadow: 0 0 0 3px rgba(46, 139, 61, 0.12);
}

.chat-msg-critic .chat-msg-head {
    color: #b45e09;
}

.chat-msg-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5159;
    margin-bottom: 0.35rem;
}

.chat-tokens {
    font-size: 0.7rem;
    font-weight: 400;
    color: #9aa0a6;
    margin-left: 0.4rem;
}

.chat-copy {
    border: none;
    background: none;
    color: #9aa0a6;
    padding: 0 0.25rem;
    line-height: 1;
    cursor: pointer;
    font-size: 0.9rem;
}

.chat-copy:hover { color: var(--tri-green); }

.chat-activity > summary {
    cursor: pointer;
    font-size: 0.78rem;
    color: #6c757d;
    list-style: none;
}

.chat-activity > summary:hover { color: var(--tri-green); }

.chat-activity-body {
    margin-top: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: #f6f8f9;
    border-left: 3px solid #c9d3cb;
    border-radius: 0.35rem;
    font-size: 0.82rem;
}

.progress-history {
    border-top: 1px solid #dde0e4;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    max-height: 55vh;
    overflow-y: auto;
}

.progress-activity-log {
    background: #f0f4f1;
    border-left: 3px solid var(--tri-green);
    border-radius: 0.4rem;
    padding: 0.4rem 0.75rem;
}

.progress-activity-item {
    font-size: 0.82rem;
    color: #3a4a3d;
    padding: 0.1rem 0;
}

/* Composer: Eingabefeld mit +-Button (Anhänge) und grünem Senden-Button */
.composer {
    border: 1.5px solid #dde1e5;
    border-radius: 1rem;
    background: #fff;
    padding: 0.65rem 0.75rem 0.5rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.composer:focus-within {
    border-color: var(--tri-green);
    box-shadow: 0 0 0 0.18rem rgba(46, 139, 61, 0.12);
}

.composer-text {
    display: block;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font: inherit;
    line-height: 1.45;
}

.composer-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.composer-add {
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
    color: #4b5159;
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 0;
}

.composer-add:hover { background: #eef0f3; }
.composer-add.disabled { opacity: 0.4; pointer-events: none; }

.composer-send {
    width: 2.3rem;
    height: 2.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.65rem;
    background: var(--tri-green);
    color: #fff;
    font-size: 1.05rem;
    transition: background 0.15s;
}

.composer-send:hover:not(:disabled) { background: #1e6b2c; }
.composer-send:disabled { opacity: 0.45; }

/* Chat-Layout mit fixierter Eingabeleiste */
.chat-card {
    display: flex;
    flex-direction: column;
    min-height: 60vh;
}

.chat-scroll {
    flex: 1;
    overflow-y: auto;
    max-height: 65vh;
}

.chat-input {
    border-top: 1px solid #e6e8ea;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom-left-radius: var(--bs-card-border-radius, .375rem);
    border-bottom-right-radius: var(--bs-card-border-radius, .375rem);
}

/* Markdown-Darstellung */
.markdown-body { font-size: 0.95rem; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: 0 0 0.6rem; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
    margin: 0.8rem 0 0.5rem;
    font-weight: 600;
    line-height: 1.25;
}
.markdown-body h1 { font-size: 1.4rem; }
.markdown-body h2 { font-size: 1.2rem; }
.markdown-body h3 { font-size: 1.05rem; }
.markdown-body ul, .markdown-body ol { margin: 0 0 0.6rem 1.25rem; }
.markdown-body code {
    background: #eceef1;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.875em;
    color: #b3306f;
}
.markdown-body pre {
    background: #1f2227;
    color: #e6e8ea;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    overflow-x: auto;
}
.markdown-body pre code { background: none; color: inherit; padding: 0; }
.markdown-body table {
    border-collapse: collapse;
    width: auto;
    margin: 0 0 0.6rem;
    font-size: 0.9rem;
}
.markdown-body th, .markdown-body td {
    border: 1px solid #d7dade;
    padding: 0.35rem 0.6rem;
    text-align: left;
}
.markdown-body th { background: #f1f3f5; }
.markdown-body blockquote {
    border-left: 3px solid var(--tri-green-soft);
    margin: 0 0 0.6rem;
    padding: 0.2rem 0.8rem;
    color: #5b6b73;
}
.markdown-body a { color: var(--tri-green); }

/* JSON-Editor / -Vorschau */
.json-preview {
    background: #1f2227;
    color: #e6e8ea;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 240px;
    overflow: auto;
    white-space: pre;
}
.json-preview .json-key { color: #79c0ff; }
.json-preview .json-string { color: #7ee787; }
.json-preview .json-number { color: #ffa657; }
.json-preview .json-bool { color: #d2a8ff; }
.json-preview .json-null { color: #8b949e; }

/* Agent-Detail */
/* Alle Links zentral: Logo-Grün. Beim HOVERN (Maus drüber, vor dem Klick)
   deutlich dunkleres Grün + fett + Zeigefinger → signalisiert Klickbarkeit.
   Kein Unterstreichen. !important schlägt Bootstrap. */
a,
.agent-name-link,
.kanban-card-title,
.kanban-card-run-link {
    color: var(--tri-green);
}

/* Namen in Listen/Karten durchgängig fett hervorheben. */
.agent-name-link,
.kanban-card-title {
    font-weight: 600;
}

/* Audit-Protokoll: farbiger Kategorie-Punkt vor dem Label. */
.audit-cat { display: inline-flex; align-items: center; white-space: nowrap; font-weight: 400; }
.audit-dot {
    flex: 0 0 auto;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    margin-right: .4rem;
}
.bg-purple { background-color: #7c4dff !important; }
.bg-teal { background-color: #0d9488 !important; }
.bg-pink { background-color: #d63384 !important; }

a:hover,
.agent-name-link:hover,
.kanban-card-title:hover,
.kanban-card-run-link:hover {
    color: var(--tri-green-dark) !important;
    text-decoration: none !important;
    cursor: pointer;
}

/* Buttons/Chips/Badges/Picker bleiben beim Hovern normal (kein Fett).
   NICHT .nav-link aufnehmen: `inherit` zieht 400 vom Elternelement und würde
   das Zustands-Gewicht der Tabs (aktiv 700 / inaktiv 600) beim Hover auf 400
   stürzen lassen. Die Tab-Gewichte regelt allein der .trinidat-tabs-Block. */
a.btn:hover,
a.agent-id-chip:hover,
a.agent-id-badge:hover,
.trigger-agent-item:hover,
.tag-picker-item:hover {
    font-weight: inherit !important;
}

/* Anklickbare große Agentennummer-Badge (führt zur Detailseite) */
a.agent-id-badge {
    text-decoration: none;
    color: #fff;
    transition: background 0.15s;
}
a.agent-id-badge:hover {
    background: var(--tri-green-dark);
    color: #fff !important;
    text-shadow: none;
}

/* Anklickbarer Agentennummer-Chip (führt zur Detailseite) */
a.agent-id-chip {
    text-decoration: none;
    transition: background 0.15s;
}
a.agent-id-chip:hover {
    background: var(--tri-green-dark);
    color: #fff !important;
    text-shadow: none;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
}

/* Interaktives Struktur-Diagramm */
.diagram-scroll {
    overflow-x: auto;
}

.diagram {
    position: relative;
    margin: 0 auto;
}

.diagram-lines {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.diag-node {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 16px;
    box-sizing: border-box;
    padding: 8px 12px 8px 16px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    border: 1px solid #e7e9ee;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.10), 0 1px 3px rgba(16, 24, 40, 0.06);
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

/* Farbiger Akzentstreifen links */
.diag-node::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 16px 0 0 16px;
}

.diag-mcp::before {
    background: linear-gradient(180deg, #f3c66b 0%, #e0a51f 100%);
}

.diag-tool::before {
    background: linear-gradient(180deg, #8ed8cd 0%, #1f9e8d 100%);
}

.diag-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 500;
    color: #33373d;
    word-break: break-word;
}

.diag-node-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.diag-node-kind {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.diag-mcp {
    border-color: #f0d49a;
    background: linear-gradient(160deg, #fffdf8 0%, #fff4dc 100%);
}

.diag-mcp .diag-node-kind {
    color: #c98a00;
}

.diag-tool {
    border-color: #aee0d8;
    background: linear-gradient(160deg, #f7fcfb 0%, #e3f5f1 100%);
}

.diag-tool .diag-node-kind {
    color: #1f9e8d;
}

.diag-skill::before {
    background: linear-gradient(180deg, #8fb3f7 0%, #5b8def 100%);
}

.diag-skill {
    border-color: #b9cdf7;
    background: linear-gradient(160deg, #f7faff 0%, #e6eefb 100%);
}

.diag-skill .diag-node-kind {
    color: #3f6fd0;
}

/* Sub-Agenten von „Agent starten" – grau, unter dem Agenten */
.diag-subagent::before {
    background: linear-gradient(180deg, #b9bfc7 0%, #8a9099 100%);
}
.diag-subagent {
    border-color: #d3d7dd;
    background: linear-gradient(160deg, #f4f5f7 0%, #e7e9ed 100%);
    cursor: pointer;
}
.diag-subagent .diag-node-kind {
    color: #6c757d;
}

/* Lauf-Kette (Run-Knoten) */
.diag-run::before {
    background: linear-gradient(180deg, #b9c0c9 0%, #8a9099 100%);
}

.diag-run {
    border-color: #dfe3e8;
    background: linear-gradient(160deg, #fbfcfd 0%, #eef1f4 100%);
}

.diag-run .diag-node-kind {
    color: #5b6470;
}

.diag-run-user {
    font-size: 10px;
    color: #6b7280;
    margin-top: 1px;
}

.diag-run.diag-run-ok::before {
    background: linear-gradient(180deg, #6cc47c 0%, var(--tri-green) 100%);
}

.diag-run.diag-run-ok .diag-node-kind {
    color: var(--tri-green);
}

.diag-run.diag-run-error::before {
    background: linear-gradient(180deg, #e88a8a 0%, #d64545 100%);
}

.diag-run.diag-run-error .diag-node-kind {
    color: #d64545;
}

.diag-run.diag-run-active::before {
    background: linear-gradient(180deg, #8fb3f7 0%, #3f6fd0 100%);
}

/* Aktueller Lauf hervorgehoben */
.diag-run.diag-run-current {
    border-color: var(--tri-green);
    box-shadow: 0 0 0 3px rgba(46, 139, 61, 0.22), 0 10px 22px rgba(16, 24, 40, 0.16);
}

/* Kritiker: wie der Worker dargestellt, aber in Grau.
   Doppelte Klasse erhöht die Spezifität, damit der graue Hintergrund den grünen
   von .diag-agent überschreibt, unabhängig von der Reihenfolge im Stylesheet. */
.diag-agent.diag-agent-critic {
    background: linear-gradient(150deg, #9aa0a8 0%, #7c828b 55%, #61666e 100%);
    box-shadow: 0 8px 22px rgba(60, 64, 70, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    cursor: pointer;
}

.diag-agent.diag-agent-critic .diag-agent-label {
    color: #e7e9ec;
}

.diag-node-kind i {
    font-size: 10px;
    margin-right: 2px;
}

.diag-node:hover {
    box-shadow: 0 10px 22px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.08);
    transform: translateY(-2px);
}

.diag-node.open {
    border-color: var(--tri-green);
    box-shadow: 0 0 0 3px rgba(46, 139, 61, 0.22), 0 10px 22px rgba(16, 24, 40, 0.16);
    /* Über das Klick-Backdrop (z-index 1055) heben, sonst fangen es die Popup-Buttons nicht. */
    z-index: 1056;
}

.diag-agent {
    z-index: 2;
    background: linear-gradient(150deg, #34a14a 0%, var(--tri-green) 55%, #246e31 100%);
    border: none;
    border-radius: 20px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 14px;
    cursor: default;
    box-shadow: 0 8px 22px rgba(36, 110, 49, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.diag-agent-figure {
    height: 88%;
    width: auto;
    flex: 0 0 auto;
    object-fit: contain;
    filter: grayscale(1) brightness(1.35) contrast(0.85)
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
    opacity: 0.92;
}

.diag-agent-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
    flex: 1 1 auto;
}

.diag-agent-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #d6f0d9;
}

.diag-agent-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.15;
    /* Lange Namen (z. B. „Rechtschreibprüfung Word") umbrechen statt aus dem Kasten laufen. */
    overflow-wrap: anywhere;
    word-break: break-word;
}

.diag-pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1056;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 8px;
    padding: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

h1:focus {
    outline: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.2rem rgba(46, 139, 61, 0.35);
}

.form-control:focus, .form-select:focus {
    border-color: #8fd39b;
    box-shadow: 0 0 0 0.2rem rgba(46, 139, 61, 0.18);
}

.form-check-input:checked {
    background-color: var(--tri-green);
    border-color: var(--tri-green);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--tri-green);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* Durchsuchbare Agentenauswahl im Trigger-Dialog */
.trigger-agent-list {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-radius: 0.5rem;
    padding: 0.3rem;
}
.trigger-agent-item {
    display: flex;
    align-items: center;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    color: #33373d;
}
.trigger-agent-item:hover { background-color: #ebf6ed; color: var(--tri-green-dark); }

/* Tab-Register (Bootstrap nav-tabs) in Logo-Grün.
   WICHTIG: Hover ändert NIEMALS das Schriftgewicht – nur Farbe/Unterstrich.
   Sonst „springt" der aktive (700) Tab beim Hovern auf das Hover-Gewicht
   zurück und wirkt dünner. Gewicht hängt allein am Zustand inaktiv/aktiv. */
.trinidat-tabs .nav-link {
    border: none;
    background: none;
    color: var(--tri-muted);
    font-weight: 600;            /* inaktiv: solide, nie „dünn" */
    border-bottom: 2px solid transparent;
}
.trinidat-tabs .nav-link:hover {
    color: var(--tri-green-dark);
    border-bottom-color: var(--tri-green-soft);
}
.trinidat-tabs .nav-link.active {
    color: var(--tri-green);
    font-weight: 700;            /* aktiv: fett – unabhängig von Hover/Focus */
    background: none;
    border-bottom: 2px solid var(--tri-green);
}
/* Zähler-Badges in den Registern in hellerem Grau. */
.trinidat-tabs .nav-link .badge {
    background-color: #ced4da !important;
    color: var(--tri-subtle) !important;
}

/* =====================================================================
   Wiederverwendbare Komponenten-Klassen – statt inline-style in Razor.
   ===================================================================== */

/* Art-/Status-Pillen am Seitenkopf (Worker / Kritiker / „Nur im Dialog"). */
.badge-kind {
    font-size: .7rem;
    font-weight: 600;
    vertical-align: middle;
}
.badge-worker { background-color: var(--tri-green) !important; color: #fff !important; }
.badge-critic { background-color: var(--tri-secondary) !important; color: #fff !important; }
.badge-dialog { background-color: var(--tri-dialog) !important; color: #fff !important; }
/* Kleinere Inline-Variante (in Listen/Karten neben dem Agentennamen). */
.badge-dialog-sm { font-size: .65em; vertical-align: 2px; }

/* Grauer Zusatz im Editor-Titel (z. B. „bearbeiten"). */
.editor-subtitle { color: var(--tri-subtle); font-weight: 400; }

/* Text-Utilities auf Basis der zentralen Grautöne (statt inline-Farben). */
.text-muted-2 { color: var(--tri-muted-2) !important; }

/* ===== Chat-Seite ===== */
.chat-shell { display:flex; gap:1rem; height: calc(100vh - 160px); min-height: 480px; }
.chat-sidebar {
    width: 290px; flex: 0 0 290px; display:flex; flex-direction:column;
    background:#fff; border-radius:.75rem; box-shadow:0 .125rem .25rem rgba(0,0,0,.06); overflow:hidden;
}
.chat-sidebar-head { padding:.85rem .9rem; border-bottom:1px solid #eef0f2; }
.chat-list { overflow:auto; padding:.4rem; flex:1 1 auto; }
.chat-list-item {
    display:block; width:100%; text-align:left; border:0; background:transparent;
    border-radius:.6rem; padding:.55rem .65rem; margin-bottom:.15rem; cursor:pointer; color:inherit;
}
.chat-list-item:hover { background:#f3f5f7; }
.chat-list-item.active { background:#e7f3ea; }
.chat-list-title { font-weight:600; font-size:.9rem; line-height:1.2; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.chat-list-meta { font-size:.75rem; color:#8a9099; margin-top:.15rem; }

.chat-main { flex:1 1 auto; min-width:0; display:flex; flex-direction:column;
    background:#fff; border-radius:.75rem; box-shadow:0 .125rem .25rem rgba(0,0,0,.06); overflow:hidden; }
.chat-main-head { padding:.85rem 1rem; border-bottom:1px solid #eef0f2; display:flex; align-items:center; gap:.6rem; }
.chat-info { padding:.7rem 1rem; border-bottom:1px solid #eef0f2; background:#fbfbfc; max-height:16rem; overflow:auto; }
.chat-info a { cursor:pointer; }
.chat-thread { flex:1 1 auto; overflow:auto; padding:1.1rem 1.2rem; background:#fafbfc; }
.chat-row { display:flex; margin-bottom:.7rem; }
.chat-row.user { justify-content:flex-end; }
.chat-bubble { max-width:78%; padding:.55rem .85rem; border-radius:1rem; font-size:.92rem; }
.chat-bubble :last-child { margin-bottom:0; }
.chat-bubble.user { background:var(--tri-green); color:#fff; border-bottom-right-radius:.3rem; }
.chat-bubble.agent { background:#eef1f4; color:#212529; border-bottom-left-radius:.3rem; }
.chat-bubble.user a { color:#dff3e4; }
.chat-typing { color:#6c757d; font-size:.85rem; padding:.2rem .4rem; }
.chat-composer { padding:.75rem; border-top:1px solid #eef0f2; }
.chat-empty { flex:1 1 auto; display:flex; align-items:center; justify-content:center; color:#8a9099; text-align:center; padding:2rem; }
.chat-agent-pick { width:100%; }
/* System-Prompt-Editor: etwas kleinerer Font + Vollbild-Modus */
.agent-prompt-area { font-size: .82rem; line-height: 1.45; }
/* Gerenderte Markdown-Vorschau des System-Prompts (z. B. Test-/Dialogseite) – etwas kleiner. */
.agent-prompt-md, .agent-prompt-md .markdown-body { font-size: .85rem; }
.agent-prompt-sidebar { font-size: .9rem; }
.prompt-fs {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: #fff;
    padding: 1rem 1.25rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
}
.prompt-fs .agent-prompt-row { flex: 1 1 auto; min-height: 0; }
.prompt-fs .agent-prompt-area { height: calc(100vh - 11rem) !important; resize: none; }
.prompt-fs .agent-prompt-preview { max-height: calc(100vh - 8rem) !important; }
.prompt-fs .agent-prompt-sidebar { max-height: calc(100vh - 11rem) !important; }

.chat-agent-item { display:flex; align-items:center; gap:.6rem; width:100%; text-align:left; border:1px solid #e6e8eb; background:#fff; border-radius:.6rem; padding:.6rem .75rem; margin-bottom:.4rem; cursor:pointer; }
.chat-agent-item:hover { border-color:var(--tri-green); background:#f6fbf7; }

/* Interaktive Rückfragen (Multiple-Choice) in der Agent-Bubble */
.chat-questions { margin:.15rem 0; }
.chat-questions .cq-intro { font-weight:600; margin-bottom:.5rem; }
.chat-questions .cq-group { border:1px solid #d0e5d8; border-radius:.5rem; background:#fff; padding:.5rem .65rem; margin-bottom:.5rem; }
.chat-questions .cq-q { font-weight:600; margin-bottom:.4rem; }
.chat-questions .cq-option { display:flex; align-items:flex-start; gap:.5rem; padding:.18rem 0; cursor:pointer; }
.chat-questions .cq-option input { margin-top:.2rem; cursor:pointer; }
.chat-questions .cq-option input:disabled, .chat-questions .cq-option input:disabled ~ span { cursor:default; }
.chat-questions .cq-other { margin-top:.4rem; }
.chat-questions .cq-submit { margin-top:.2rem; }

/* ---------- Einheitlich abgerundete Karten ----------
   Alle Karten erhalten einen deutlicheren, einheitlichen Radius. Karten, die eine
   Tabelle enthalten, beschneiden ihren Inhalt an den runden Ecken (sonst füllt die
   Tabelle die Ecken eckig aus). */
.card {
    --bs-card-border-radius: 0.75rem;
    --bs-card-inner-border-radius: 0.7rem;
    border-radius: 0.75rem;
}

.card:has(> .table-responsive),
.card:has(> table) {
    overflow: hidden;
}

/* Einheitliche Tabellen: etwas kleinere Schrift, Kopfzeilen in Grau (nicht schwarz/fett). */
.table {
    font-size: 0.875rem;
}
.table > thead th {
    color: var(--tri-muted);
    font-weight: 600;
    font-size: 0.8rem;
}

/* JSON-Editor: kompaktere Schrift */
.json-editor textarea {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Tool-Call-Popover (Agent-Editor, über dem Tools-Symbol in der Formatierungsleiste) */
.toolcalls-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.toolcalls-pop {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 1050;
    width: 24rem;
    max-width: 90vw;
    max-height: 26rem;
    overflow: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
    padding: 0.7rem 0.8rem;
}

/* ---------- Einheitliches Seiten-Kopfband ----------
   Die Überschrift jeder Seite (erstes Element des Inhalts) bildet ein weißes Band
   in Höhe der schwarzen Sidebar-Kopfzeile (64px) mit hellgrüner Unterkante. Die Linie
   liegt damit bündig auf 64px; die Überschrift steht im weißen Band darüber, der
   restliche (graue) Seiteninhalt folgt darunter – ohne Überlappung. Volle Breite per
   negativer Ränder, die das horizontale Padding des Inhaltsbereichs ausgleichen. */
.page-content > :first-child {
    display: flex !important;
    align-items: center !important;
    min-height: 80px;
    background-color: #fff;
    border-bottom: 2px solid var(--tri-green);
    margin: 0 -1rem 1.5rem -1rem !important;
    padding: 0 1rem;
    /* Titelzeile bleibt beim Scrollen oben fixiert (gilt für alle Seiten,
       da jede Seite dieses Kopfband als erstes Element rendert). Das Fenster
       scrollt, daher genügt sticky top:0; z-index über den Inhaltskarten. */
    position: sticky;
    top: 0;
    z-index: 30;
}

/* Seitenüberschriften einheitlich etwas kleiner und in Markengrün (Agentennummern
   behalten ihr Grau über die spezifischere .agent-num-Regel). */
.page-content > :first-child h1 {
    color: var(--tri-green);
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0;
}

/* Führendes Icon jeder Seitenüberschrift als grüne Kachel mit weißem Glyph
   (wie auf der Lauf-Detailseite). Das Glyph je Seite bleibt erhalten; Badge-Icons
   (in <span>) und der Agenten-Avatar (Bild) sind nicht betroffen. */
.page-content > :first-child h1 > i.bi {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-right: 0.7rem !important;
    border-radius: 0.8rem;
    background-color: var(--tri-green);
    color: #fff;
    font-size: 1.5rem;
    vertical-align: middle;
}

@media (min-width: 992px) {
    .page-content > :first-child {
        margin-left: -1.5rem !important;
        margin-right: -1.5rem !important;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}
