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

.ar-workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 1120px;
    width: 100%;
}

.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: 8px;
    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 {
    font-weight: 600;
    color: var(--text-1);
}

.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);
}

.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: 6px;
    padding: 1px 7px;
    white-space: nowrap;
}

.ar-tag--new {
    color: var(--accent-strong, var(--accent));
    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: 8px;
    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: 8px;
    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: 8px;
    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: 7px;
    background: var(--surface);
    font-size: 13px;
    color: var(--text-2);
}

.ar-plan-task.is-applied {
    border-color: rgba(28, 184, 112, 0.3);
    background: color-mix(in srgb, var(--success, #1cb870) 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: 6px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-3);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
}

.ar-item-apply:hover {
    border-color: rgba(28, 184, 112, 0.5);
    background: var(--success-soft);
    color: var(--success);
}

.ar-item-reject:hover {
    border-color: rgba(224, 78, 100, 0.4);
    background: var(--danger-soft);
    color: #e04e64;
}

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

.ar-item-state--applied {
    color: var(--success, #1cb870);
}

.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, var(--accent));
}

.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: 8px;
    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: 7px;
    box-shadow: none;
}

.ar-proposal-actions .ar-apply {
    border-color: rgba(28, 184, 112, 0.34);
    background: var(--success-soft);
    color: var(--success);
}

.ar-proposal-actions .ar-apply:hover {
    border-color: rgba(28, 184, 112, 0.52);
    background: rgba(28, 184, 112, 0.16);
    color: var(--success);
    box-shadow: none;
}

.ar-proposal-actions .ar-reject {
    border-color: rgba(224, 78, 100, 0.24);
    color: var(--text-3);
}

.ar-proposal-actions .ar-reject:hover,
.ar-proposal-actions .ar-reject.btn-confirm-pending {
    border-color: rgba(224, 78, 100, 0.38) !important;
    background: var(--danger-soft) !important;
    color: #e04e64 !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;
    }
}
