/* Agent-Review — Vorschläge aus Agent-Läufen prüfen */

@keyframes ar-shell-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.ar-workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 1120px;
    width: 100%;
    animation: ar-shell-in 0.30s ease both;
}

.ar-refresh {
    margin-left: auto;
}

.ar-refresh.is-refreshing {
    cursor: wait;
}

/* Setup-Infos & Downloads leben jetzt in der Guide-View ("So funktioniert's");
   hier bleibt nur der .guide-backlink-Hinweis (Styles in guide.css). */

/* ── Lauf-Karte ───────────────────────────────────────── */
.ar-run {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.ar-run-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
}

.ar-run-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.ar-actor {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    color: var(--text-1);
}

.ar-actor::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    flex-shrink: 0;
}

.ar-run-id {
    font-size: 12px;
    color: var(--text-4);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ar-run-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ar-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 10px;
}

/* ── Vorschlag-Zeile ──────────────────────────────────── */
.ar-proposals {
    display: flex;
    flex-direction: column;
}

.ar-proposal {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.12s ease;
}

.ar-proposal:hover {
    background: var(--surface-2);
}

.ar-proposal:last-child {
    border-bottom: none;
}

.ar-proposal.is-busy,
.ar-run.is-busy .ar-proposal {
    opacity: 0.62;
}

.ar-proposal.is-busy button,
.ar-run.is-busy button {
    cursor: wait;
}

.ar-proposal-body {
    min-width: 0;
    flex: 1;
}

.ar-row-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.ar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.35;
}

.ar-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 1px 7px;
    white-space: nowrap;
}

.ar-tag--new {
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-color: transparent;
}

.ar-desc {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--text-3);
    white-space: pre-wrap;
    word-break: break-word;
}

.ar-work-summary {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    border-left: 3px solid var(--accent);
    border-radius: var(--r);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.ar-work-label {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 750;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ar-work-summary p {
    margin: 0;
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ar-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ar-routing {
    margin: 10px 0 0;
    color: var(--text-3);
}

.ar-routing summary {
    cursor: pointer;
    width: max-content;
    max-width: 100%;
    font-size: 12px;
    font-weight: 650;
    color: var(--text-3);
}

.ar-routing summary:hover {
    color: var(--text-1);
}

.ar-routing dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 12px;
    margin: 8px 0 0;
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    background: var(--surface-2);
}

.ar-routing dl div {
    min-width: 0;
}

.ar-routing dt {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-4);
    text-transform: uppercase;
}

.ar-routing dd {
    margin: 0;
    font-size: 12px;
    color: var(--text-2);
    overflow-wrap: anywhere;
}

.ar-chip {
    font-size: 12px;
    color: var(--text-3);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 9px;
}

.ar-plan {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.ar-plan-sprint {
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    background: var(--surface-2);
}

.ar-plan-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-1);
}

.ar-plan-tasks {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ar-plan-task {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: 13px;
    color: var(--text-2);
    transition: border-color 0.12s ease, background 0.12s ease;
}

.ar-plan-task.is-applied {
    border-color: color-mix(in srgb, var(--success) 30%, transparent);
    background: color-mix(in srgb, var(--success) 7%, var(--surface));
}

.ar-plan-task.is-rejected {
    opacity: 0.6;
}

.ar-plan-task.is-rejected .ar-plan-task-title {
    text-decoration: line-through;
}

.ar-plan-task-title {
    min-width: 0;
    overflow-wrap: anywhere;
}

.ar-plan-task-h {
    color: var(--text-4);
    font-size: 12px;
}

.ar-plan-empty {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-4);
    font-style: italic;
}

.ar-hint {
    font-size: 12px;
    color: var(--text-4);
}

.ar-item-actions {
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
}

.ar-item-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-3);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.ar-item-apply:hover {
    border-color: color-mix(in srgb, var(--success) 50%, transparent);
    background: var(--success-soft);
    color: var(--success);
}

.ar-item-reject:hover {
    border-color: color-mix(in srgb, var(--danger) 40%, transparent);
    background: var(--danger-soft);
    color: var(--danger);
}

.ar-item-state {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ar-item-state--applied {
    color: var(--success);
}

.ar-item-state--rejected {
    color: var(--text-4);
}

.ar-status-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ar-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
}

.ar-status--next {
    color: var(--success);
}

.ar-arrow {
    color: var(--text-4);
}

.ar-proposal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    width: 246px;
    padding: 4px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    background: var(--surface-2);
}

.ar-proposal-actions .btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    border-radius: var(--r-sm);
    box-shadow: none;
}

.ar-proposal-actions .ar-apply {
    border-color: color-mix(in srgb, var(--success) 34%, transparent);
    background: var(--success-soft);
    color: var(--success);
}

.ar-proposal-actions .ar-apply:hover {
    border-color: color-mix(in srgb, var(--success) 52%, transparent);
    background: color-mix(in srgb, var(--success) 16%, transparent);
    color: var(--success);
    box-shadow: none;
}

.ar-proposal-actions .ar-reject {
    border-color: color-mix(in srgb, var(--danger) 24%, transparent);
    color: var(--text-3);
}

.ar-proposal-actions .ar-reject:hover,
.ar-proposal-actions .ar-reject.btn-confirm-pending {
    border-color: color-mix(in srgb, var(--danger) 38%, transparent) !important;
    background: var(--danger-soft) !important;
    color: var(--danger) !important;
    box-shadow: none;
}

@media (max-width: 920px) {
    .ar-proposal {
        flex-direction: column;
        gap: 12px;
    }

    .ar-proposal-actions {
        align-self: stretch;
        width: 100%;
    }
}

@media (max-width: 760px) {
    .ar-refresh {
        margin-left: 0;
    }

    .ar-run-head {
        align-items: stretch;
    }

    .ar-run-title,
    .ar-run-meta {
        width: 100%;
    }

    .ar-run-meta {
        justify-content: space-between;
    }
}

@media (max-width: 680px) {
    .ar-proposal-actions {
        flex-direction: row;
        width: 100%;
    }
    .ar-proposal-actions .btn-sm {
        flex: 1;
    }
}
