/* Styles für Erweiterung „agents“ – AI1 + Subagenten, Live-Graph */
.ag-ws-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-3); }
.ag-ws-opt { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-4); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: var(--surface-2); }
.ag-ws-opt h3 { margin: 0; font-size: 1rem; }
.ag-ws-opt p { margin: 0; }
.ag-ws-opt input[type=url] { width: 100%; }
.ag-wsbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--fs-sm); min-width: 0; }
.ag-wsbar > span { min-width: 0; overflow-wrap: anywhere; }
.ag-ws-ico { color: var(--accent); font-weight: 700; }
.ag-spacer { flex: 1 1 auto; }
.ag-runs { display: flex; align-items: center; gap: 8px; margin-top: var(--sp-3); }
.ag-runs select { max-width: 100%; min-width: 0; flex: 1 1 auto; }
.ag-sub { font-size: var(--fs-sm); color: var(--text-2); margin: var(--sp-4) 0 var(--sp-2); font-weight: 600; }
.ag-details { margin: 8px 0; }
.ag-details summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); }
.ag-contracts { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.ag-contracts > li { border-left: 3px solid var(--border-strong); padding: 4px 10px; }
.ag-c-file { font-family: var(--mono); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.ag-c-exports { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-sm); }
.ag-c-exports code { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }

.ag-pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); }
.ag-pkg { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ag-pkg-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ag-pkg-head strong { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ag-files { display: flex; flex-wrap: wrap; gap: 4px; }
.ag-file { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 1px 6px; overflow-wrap: anywhere; }
.ag-size { flex-wrap: nowrap; }
.ag-size select { min-width: 0; flex: 1 1 auto; }
.ag-opts { margin-top: var(--sp-4); border-top: 1px solid var(--border); padding-top: var(--sp-3); }

.ag-agent { --ag: var(--accent); display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--ag); color: #fff; font-size: 11px; font-weight: 700; flex: none; }
.ag-agent-sm { min-width: 30px; height: 18px; font-size: 10px; }

.ag-stats .stat-value { font-size: 22px; }
.ag-status.is-running { color: var(--info); }
.ag-status.is-done { color: var(--ok); }
.ag-status.is-failed { color: var(--danger); }
.ag-status.is-paused, .ag-status.is-stopped { color: var(--warn); }
.ag-error { margin-bottom: var(--sp-3); cursor: default; background: var(--warn-soft); }
.ag-controls { margin-bottom: var(--sp-3); }

.ag-live { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-3); align-items: start; }
.ag-graph-panel { min-width: 0; margin-top: var(--sp-3); }
.ag-live .ag-graph-panel { margin-top: 0; }
.ag-graph-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 20px 20px; overflow: hidden; }
.ag-graph { display: block; width: 100%; height: auto; }
.ag-edge { stroke: var(--border-strong); stroke-width: 1; opacity: .7; }
.ag-edge.is-planned { stroke-dasharray: 4 4; }
.ag-node circle { fill: var(--surface); stroke: var(--text-3); stroke-width: 1.5; }
.ag-node text { font-size: 11px; fill: var(--text-2); font-family: var(--mono); pointer-events: none; }
.ag-node.in-pkg circle { stroke: var(--text-2); stroke-width: 2; }
.ag-node.is-new circle { stroke-dasharray: 3 2; fill: var(--surface-2); }
.ag-node.is-waiting circle { stroke: var(--text-3); }
.ag-node.is-running circle, .ag-node.is-checking circle { stroke: var(--info); fill: var(--info-soft); animation: ag-pulse 1.4s ease-in-out infinite; }
.ag-node.is-done circle { stroke: var(--ok); fill: var(--ok-soft); stroke-dasharray: none; }
.ag-node.is-failed circle { stroke: var(--danger); fill: var(--danger-soft); }
.ag-hub circle { fill: var(--accent); stroke: var(--accent-soft); stroke-width: 6; }
.ag-hub text { fill: var(--on-accent); font-weight: 800; font-size: 14px; }
.ag-send { stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .75; animation: ag-dash 1s linear infinite; }
.ag-dot { transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.ag-dot circle { fill: var(--ag); stroke: #fff; stroke-width: 2; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.ag-dot text { fill: #fff; font-size: 9px; font-weight: 800; pointer-events: none; }
@keyframes ag-pulse { 50% { stroke-width: 4; } }
@keyframes ag-dash { to { stroke-dashoffset: -10; } }
@media (prefers-reduced-motion: reduce) { .ag-dot { transition: none; } .ag-send, .ag-node circle { animation: none !important; } }
.ag-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.ag-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--text-3); display: inline-block; }
.lg-plan { border-style: dashed; }
.lg-run { border-color: var(--info); background: var(--info-soft); }
.lg-done { border-color: var(--ok); background: var(--ok-soft); }
.lg-fail { border-color: var(--danger); background: var(--danger-soft); }

.ag-agents { min-width: 0; }
.ag-agent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 560px; overflow-y: auto; }
.ag-agent-row { display: flex; gap: 8px; align-items: flex-start; width: 100%; border: 0; background: transparent; text-align: left; padding: 6px; border-radius: var(--radius-xs); cursor: pointer; color: var(--text); }
.ag-agent-row:hover, .ag-agent-row.is-on { background: var(--surface-2); }
.ag-agent-main { display: flex; flex-direction: column; min-width: 0; }
.ag-agent-title { font-weight: 600; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.ag-at { color: var(--info); font-family: var(--mono); overflow-wrap: anywhere; }
.ag-agent-list .is-waiting .ag-agent { opacity: .45; }
.ag-agent-list .is-failed .ag-agent-title { color: var(--danger); }

.ag-pkg-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ag-pkg-list > li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; flex-wrap: wrap; }
.ag-pkg-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ag-pkg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-err { color: var(--danger); white-space: pre-wrap; }
.ag-badge-done { background: var(--ok-soft); color: var(--ok); }
.ag-badge-running, .ag-badge-checking { background: var(--info-soft); color: var(--info); }
.ag-badge-failed { background: var(--danger-soft); color: var(--danger); }

.ag-log { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; }
.ag-log li { display: flex; gap: 8px; align-items: baseline; padding: 2px 4px; border-radius: 4px; min-width: 0; }
.ag-log li.is-warn { background: var(--warn-soft); }
.ag-log li.is-error { background: var(--danger-soft); }
.ag-log-t { color: var(--text-3); font-family: var(--mono); font-size: 11px; flex: none; }
.ag-log-x { min-width: 0; overflow-wrap: anywhere; }
.ag-planning .ag-log { margin-top: var(--sp-3); }

.ag-feat-list { list-style: none; padding: 0; margin: 8px 0 12px; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ag-feat-list label { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: var(--radius-xs); cursor: pointer; flex-wrap: wrap; }
.ag-feat-list label:hover { background: var(--surface-2); }
.ag-ref { flex-wrap: nowrap; }
.ag-ref select { flex: 0 1 45%; min-width: 0; }
.ag-ref input { flex: 1 1 auto; min-width: 0; }
.ag-prices { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ag-prices th { text-align: left; font-weight: 600; color: var(--text-2); padding: 4px; }
.ag-prices td { padding: 3px 4px; }
.ag-prices input { width: 100%; min-width: 0; }
.ag-diff { font-family: var(--mono); font-size: 12px; line-height: 1.45; max-height: 65vh; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: var(--radius-sm); white-space: pre; }
.ag-diff .is-add { color: var(--ok); background: var(--ok-soft); display: inline-block; min-width: 100%; }
.ag-diff .is-del { color: var(--danger); background: var(--danger-soft); display: inline-block; min-width: 100%; }
.ag-diff .is-hunk { color: var(--info); }

@media (max-width: 1100px) { .ag-live { grid-template-columns: 1fr; } .ag-agent-list { max-height: none; } }
@media (max-width: 640px) { .ag-pkgs { grid-template-columns: 1fr; } .ag-ref { flex-wrap: wrap; } .ag-ref select { flex-basis: 100%; } }
