/* ============================================================
   SiteRooster Automation — v3
   All classes prefixed sr-auto- to avoid conflicts
   ============================================================ */

:root {
    --sr-emerald:        #059669;
    --sr-emerald-light:  #10b981;
    --sr-emerald-bg:     #ecfdf5;
    --sr-emerald-border: #a7f3d0;

    --auto-s1:      #059669; /* scan   — emerald */
    --auto-s1-bg:   #ecfdf5;
    --auto-s2:      #0ea5e9; /* learn  — sky */
    --auto-s2-bg:   #f0f9ff;
    --auto-s3:      #8b5cf6; /* rank   — violet */
    --auto-s3-bg:   #f5f3ff;
    --auto-s4:      #f59e0b; /* watch  — amber */
    --auto-s4-bg:   #fffbeb;
    --auto-purple:  #8b5cf6;
    --auto-teal:    #0d9488;
    --auto-teal-bg: #f0fdfa;
    --auto-amber:   #f59e0b;

    --auto-radius:  12px;
    --auto-shadow:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --auto-shadow-md: 0 4px 12px rgba(0,0,0,.08);
}

/* ── Layout ─────────────────────────────────── */

.sr-auto-view {
    max-width: 100%;
}

/* ── Section header ─────────────────────────── */

.sr-auto-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.sr-auto-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sr-auto-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--sr-emerald-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sr-emerald);
    flex-shrink: 0;
}
.sr-auto-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 2px;
}
.sr-auto-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}
.sr-auto-status-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 20px;
    background: #f3f4f6;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}
.sr-auto-status-pill.running {
    background: #ecfdf5;
    color: var(--sr-emerald);
}
.sr-auto-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d1d5db;
}
.sr-auto-status-pill.running .sr-auto-status-dot {
    background: var(--sr-emerald);
    animation: sr-auto-pulse 1.4s ease-in-out infinite;
}

@keyframes sr-auto-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .5; transform: scale(1.3); }
}

/* ── Pipeline layout (configure view) ──────── */

.sr-auto-pipeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Each stage row: card + stub + pills */
.sr-auto-row {
    display: grid;
    grid-template-columns: 1fr 24px auto;
    align-items: start;
    gap: 0;
}

/* Vertical connector between rows */
.sr-auto-v-connector {
    display: grid;
    grid-template-columns: 1fr 24px auto;
}
.sr-auto-v-line {
    border-left: 2px dashed #e5e7eb;
    margin-left: 24px;
    height: 28px;
}

/* Horizontal stub connecting card to pills */
.sr-auto-h-stub {
    border-top: 2px dashed #e5e7eb;
    margin-top: 24px;
}

/* Pills column */
.sr-auto-pill-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 14px;
}
.sr-auto-pill-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sr-auto-pill-hline {
    width: 14px;
    border-top: 2px dashed #e5e7eb;
    margin: 0 2px;
}
.sr-auto-pill-vline {
    border-left: 2px dashed #e5e7eb;
    height: 14px;
    margin-left: 14px;
}

/* ── Stage card ─────────────────────────────── */

.sr-auto-stage-card {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--auto-radius);
    box-shadow: var(--auto-shadow);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.sr-auto-stage-card:hover {
    border-color: #d1d5db;
    box-shadow: var(--auto-shadow-md);
}
.sr-auto-stage-card[data-stage="1"] { border-left: 3px solid var(--auto-s1); }
.sr-auto-stage-card[data-stage="2"] { border-left: 3px solid var(--auto-s2); }
.sr-auto-stage-card[data-stage="3"] { border-left: 3px solid var(--auto-s3); }
.sr-auto-stage-card[data-stage="4"] { border-left: 3px solid var(--auto-s4); }

.sr-auto-stage-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    cursor: pointer;
    user-select: none;
}
.sr-auto-stage-header:hover { background: #fafafa; }

.sr-auto-stage-num {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    flex-shrink: 0;
}
.sr-auto-stage-num.s1 { background: var(--auto-s1-bg); color: var(--auto-s1); }
.sr-auto-stage-num.s2 { background: var(--auto-s2-bg); color: var(--auto-s2); }
.sr-auto-stage-num.s3 { background: var(--auto-s3-bg); color: var(--auto-s3); }
.sr-auto-stage-num.s4 { background: var(--auto-s4-bg); color: var(--auto-s4); }

.sr-auto-stage-info { flex: 1; min-width: 0; }
.sr-auto-stage-name {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}
.sr-auto-stage-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 1px;
}
.sr-auto-stage-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.sr-auto-saved-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #9ca3af;
    white-space: nowrap;
}
.sr-auto-saved-badge.saved {
    background: var(--sr-emerald-bg);
    color: var(--sr-emerald);
}
.sr-auto-cost-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    background: #ede9fe;
    color: var(--auto-s3);
    white-space: nowrap;
}
.sr-auto-chevron {
    color: #9ca3af;
    transition: transform .2s;
    flex-shrink: 0;
}
.sr-auto-chevron.open { transform: rotate(180deg); }

/* Stage body (collapsible) */
.sr-auto-stage-body {
    display: none;
    border-top: 1px solid #f3f4f6;
    padding: 20px 20px;
}
.sr-auto-stage-body.open { display: block; }

/* ── Config grid ────────────────────────────── */

.sr-auto-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.sr-auto-col-full {
    grid-column: 1 / -1;
}
.sr-auto-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sr-auto-select {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #111827;
    background: white;
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 28px;
}
.sr-auto-select:focus { border-color: var(--sr-emerald); }

.sr-auto-checkbox {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    margin-top: 4px;
}
.sr-auto-checkbox input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--sr-emerald); }

.sr-auto-check-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.sr-auto-textarea {
    width: 100%;
    min-height: 64px;
    padding: 8px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-family: monospace;
    color: #374151;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s;
}
.sr-auto-textarea:focus { border-color: var(--sr-emerald); }

.sr-auto-paths-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.sr-auto-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 5px;
    line-height: 1.4;
}

/* ── Slider ─────────────────────────────────── */

.sr-auto-slider-wrap { width: 100%; }
.sr-auto-slider-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 7px;
}
.sr-auto-slider-val {
    font-weight: 700;
    color: #111827;
}
.sr-auto-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
}
.sr-auto-range.s1::-webkit-slider-thumb { background: var(--auto-s1); }
.sr-auto-range.s2::-webkit-slider-thumb { background: var(--auto-s2); }
.sr-auto-range.s3::-webkit-slider-thumb { background: var(--auto-s3); }
.sr-auto-range.s4::-webkit-slider-thumb { background: var(--auto-s4); }
.sr-auto-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    transition: transform .1s;
}
.sr-auto-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.sr-auto-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ── Segmented control ─────────────────────── */

.sr-auto-segmented {
    display: flex;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}
.sr-auto-seg-btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: white;
    border: none;
    cursor: pointer;
    border-right: 1.5px solid #e5e7eb;
    transition: background .15s, color .15s;
    text-align: center;
    white-space: nowrap;
}
.sr-auto-seg-btn:last-child { border-right: none; }
.sr-auto-seg-btn.active {
    background: var(--sr-emerald-bg);
    color: var(--sr-emerald);
    font-weight: 700;
}
.sr-auto-seg-btn:hover:not(.active) { background: #f9fafb; }

/* ── Stage footer ───────────────────────────── */

.sr-auto-stage-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid #f3f4f6;
    gap: 12px;
}
.sr-auto-footer-note {
    font-size: 11px;
    color: #9ca3af;
    flex: 1;
}
.sr-auto-save-btn {
    padding: 7px 18px;
    background: var(--sr-emerald);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, transform .1s;
}
.sr-auto-save-btn:hover { background: #047857; }
.sr-auto-save-btn:active { transform: scale(.97); }

/* ── Destination pills ───────────────────────── */

.sr-auto-dest-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 5px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1.5px solid transparent;
}
.sr-auto-pill-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Per-stage pill colours */
.pill-s1 { background: var(--auto-s1-bg); color: var(--auto-s1); border-color: var(--sr-emerald-border); }
.pill-s2 { background: var(--auto-s2-bg); color: var(--auto-s2); border-color: #bae6fd; }
.pill-s3 { background: var(--auto-s3-bg); color: var(--auto-s3); border-color: #ddd6fe; }
.pill-s4 { background: var(--auto-s4-bg); color: var(--auto-s4); border-color: #fde68a; }
.pill-purple { background: #f5f3ff; color: var(--auto-purple); border-color: #ddd6fe; }
.pill-teal   { background: var(--auto-teal-bg); color: var(--auto-teal); border-color: #99f6e4; }
.pill-amber  { background: #fffbeb; color: var(--auto-amber); border-color: #fde68a; }

.pi-s1 { background: var(--auto-s1-bg); color: var(--auto-s1); }
.pi-s2 { background: var(--auto-s2-bg); color: var(--auto-s2); }
.pi-s3 { background: var(--auto-s3-bg); color: var(--auto-s3); }
.pi-s4 { background: var(--auto-s4-bg); color: var(--auto-s4); }
.pi-purple { background: #ede9fe; color: var(--auto-purple); }
.pi-teal   { background: var(--auto-teal-bg); color: var(--auto-teal); }
.pi-amber  { background: #fef3c7; color: var(--auto-amber); }

/* ── Run bar ─────────────────────────────────── */

.sr-auto-run-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--auto-radius);
    box-shadow: var(--auto-shadow);
    padding: 16px 22px;
    margin-top: 20px;
    gap: 12px;
    flex-wrap: wrap;
}
.sr-auto-run-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}
.sr-auto-run-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    background: var(--sr-emerald);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s, opacity .15s;
    white-space: nowrap;
}
.sr-auto-run-btn:hover:not(:disabled) { background: #047857; }
.sr-auto-run-btn:active:not(:disabled) { transform: scale(.97); }
.sr-auto-run-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Activity log (configure view) ──────────── */

.sr-auto-log-card {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--auto-radius);
    box-shadow: var(--auto-shadow);
    margin-top: 20px;
    overflow: hidden;
}
.sr-auto-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid #f3f4f6;
}
.sr-auto-log-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}
.sr-auto-log-sub {
    font-size: 11px;
    color: #9ca3af;
}
.sr-auto-live-pill {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 3px 8px;
    border-radius: 10px;
    background: #fef2f2;
    color: #ef4444;
    animation: sr-auto-pulse 1.4s ease-in-out infinite;
}
.sr-auto-log-body {
    padding: 10px 0;
    max-height: 280px;
    overflow-y: auto;
}
.sr-auto-log-empty {
    padding: 16px 18px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

/* Log entries */
.sr-auto-log-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 18px;
}
.sr-auto-log-entry:hover { background: #fafafa; }
.sr-auto-log-tag {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 2px 7px;
    border-radius: 6px;
    margin-top: 1px;
    text-transform: uppercase;
}
.sr-auto-log-tag.tag-pipeline { background: #f3f4f6; color: #6b7280; }
.sr-auto-log-tag.tag-scan     { background: var(--auto-s1-bg); color: var(--auto-s1); }
.sr-auto-log-tag.tag-learn    { background: var(--auto-s2-bg); color: var(--auto-s2); }
.sr-auto-log-tag.tag-rank     { background: var(--auto-s3-bg); color: var(--auto-s3); }
.sr-auto-log-tag.tag-watch    { background: var(--auto-s4-bg); color: var(--auto-s4); }

.sr-auto-log-text {
    font-size: 12px;
    color: #374151;
    flex: 1;
    line-height: 1.4;
}
.sr-auto-log-time {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 1px;
}


/* ════════════════════════════════════════════
   RUNNING VIEW
═══════════════════════════════════════════ */

/* Agent hero card */
.sr-auto-agent-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: white;
    border: 1.5px solid var(--sr-emerald-border);
    border-radius: var(--auto-radius);
    box-shadow: var(--auto-shadow-md);
    padding: 22px 24px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f0fdf9 0%, white 60%);
}
.sr-auto-agent-orb {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--sr-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px var(--sr-emerald-bg);
    animation: sr-auto-orb-pulse 2s ease-in-out infinite;
}
@keyframes sr-auto-orb-pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--sr-emerald-bg); }
    50%       { box-shadow: 0 0 0 8px #d1fae5; }
}

.sr-auto-agent-info { flex: 1; min-width: 0; }
.sr-auto-agent-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}
.sr-auto-agent-sub {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
}

/* Thinking dots */
.sr-auto-thinking {
    display: flex;
    gap: 3px;
    align-items: center;
}
.sr-auto-thinking span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--sr-emerald);
    animation: sr-auto-think 1.2s ease-in-out infinite;
}
.sr-auto-thinking span:nth-child(2) { animation-delay: .2s; }
.sr-auto-thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes sr-auto-think {
    0%, 80%, 100% { transform: scale(.7); opacity: .4; }
    40%            { transform: scale(1); opacity: 1; }
}

.sr-auto-agent-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.sr-auto-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
}
.sr-auto-meta-item strong { color: #111827; }

.sr-auto-stop-btn {
    padding: 8px 16px;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #ef4444;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s, border-color .15s;
}
.sr-auto-stop-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* ── Running pipeline cards ─────────────────── */

.sr-auto-run-pipeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}

/* Same row layout as configure */
.sr-auto-run-row {
    display: grid;
    grid-template-columns: 1fr 24px auto;
    align-items: start;
    gap: 0;
}
.sr-auto-run-v-line {
    border-left: 2px solid #e5e7eb;
    height: 14px;
    margin-left: 24px;
}

/* Running stage card */
.sr-auto-run-card {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: var(--auto-radius);
    box-shadow: var(--auto-shadow);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.sr-auto-run-card.active {
    border-color: var(--sr-emerald);
    box-shadow: 0 0 0 3px var(--sr-emerald-bg), var(--auto-shadow-md);
}
.sr-auto-run-card.done {
    border-color: var(--sr-emerald-border);
    background: #fafffe;
}
.sr-auto-run-card.pending {
    opacity: .55;
}

.sr-auto-run-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}
.sr-auto-run-num {
    font-size: 11px;
    font-weight: 800;
    color: #9ca3af;
    letter-spacing: .02em;
    width: 24px;
    flex-shrink: 0;
}
.sr-auto-run-info { flex: 1; }
.sr-auto-run-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

/* Spinner */
.sr-auto-run-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid var(--sr-emerald-bg);
    border-top-color: var(--sr-emerald);
    border-radius: 50%;
    display: none;
    animation: sr-auto-spin .7s linear infinite;
}
.sr-auto-run-card.active .sr-auto-run-spinner { display: block; }
@keyframes sr-auto-spin { to { transform: rotate(360deg); } }

/* Checkmark */
.sr-auto-run-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
    transition: background .2s, color .2s;
}
.sr-auto-run-card.done .sr-auto-run-check {
    background: var(--sr-emerald);
    color: white;
}

/* Run card body — mini stats */
.sr-auto-run-body {
    padding: 0 14px 12px;
    display: none;
}
.sr-auto-run-card.active .sr-auto-run-body,
.sr-auto-run-card.done .sr-auto-run-body { display: block; }

.sr-auto-run-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 8px;
}
.sr-auto-run-stat {}
.sr-auto-run-stat-val {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}
.sr-auto-run-stat-val.live { color: var(--sr-emerald); }
.sr-auto-run-stat-lbl {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sr-auto-run-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
}
.sr-auto-run-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d1d5db;
}
.sr-auto-run-card.active .sr-auto-run-dot {
    background: var(--sr-emerald);
    animation: sr-auto-pulse 1.4s ease-in-out infinite;
}
.sr-auto-run-card.done .sr-auto-run-dot { background: var(--sr-emerald); }


/* ════════════════════════════════════════════
   COMPLETED VIEW
═══════════════════════════════════════════ */

.sr-auto-done-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--sr-emerald-bg);
    border: 1.5px solid var(--sr-emerald-border);
    border-radius: var(--auto-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}
.sr-auto-done-check {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sr-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sr-auto-done-title {
    font-size: 15px;
    font-weight: 700;
    color: #065f46;
}
.sr-auto-done-sub {
    font-size: 12px;
    color: #047857;
    margin-top: 2px;
}

/* Done pipeline rows */
.sr-auto-done-pipeline { display: flex; flex-direction: column; }
.sr-auto-done-row {
    display: grid;
    grid-template-columns: 1fr 24px auto;
    align-items: start;
    gap: 0;
}
.done-connector { display: grid; grid-template-columns: 1fr 24px auto; }
.done-line      { border-left: 2px solid var(--sr-emerald-border); height: 16px; margin-left: 24px; }
.done-stub      { border-top: 2px solid var(--sr-emerald-border); margin-top: 24px; }
.done-hline     { width: 14px; border-top: 2px solid var(--sr-emerald-border); margin: 0 2px; }
.done-vline     { border-left: 2px solid var(--sr-emerald-border); height: 14px; margin-left: 14px; }

.sr-auto-done-card {
    background: white;
    border: 1.5px solid var(--sr-emerald-border);
    border-left: 3px solid var(--sr-emerald);
    border-radius: var(--auto-radius);
    box-shadow: var(--auto-shadow);
    overflow: hidden;
}
.sr-auto-done-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fafffe;
}
.sr-auto-done-num {
    font-size: 11px;
    font-weight: 800;
    color: var(--sr-emerald);
    letter-spacing: .02em;
}
.sr-auto-done-name {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}
.sr-auto-done-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--sr-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}
.sr-auto-done-card-body { padding: 10px 14px 12px; }
.sr-auto-done-stats { display: flex; gap: 20px; }
.sr-auto-done-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--sr-emerald);
    line-height: 1;
}
.sr-auto-done-lbl {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sr-auto-done-limit {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--auto-amber);
    margin-top: 8px;
    padding: 5px 8px;
    background: #fffbeb;
    border-radius: 6px;
    width: fit-content;
}

/* Done destination pills */
.pill-done {
    background: var(--sr-emerald-bg);
    color: var(--sr-emerald);
    border-color: var(--sr-emerald-border);
}
.pi-done { background: var(--sr-emerald-bg); color: var(--sr-emerald); }

/* Done actions */
.sr-auto-done-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.sr-auto-rerun-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    background: var(--sr-emerald);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.sr-auto-rerun-btn:hover { background: #047857; }
.sr-auto-ghost-btn {
    padding: 9px 16px;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.sr-auto-ghost-btn:hover { border-color: #9ca3af; color: #374151; }


/* ════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */

@media (max-width: 640px) {
    .sr-auto-config-grid { grid-template-columns: 1fr; }
    .sr-auto-paths-grid  { grid-template-columns: 1fr; }
    .sr-auto-segmented   { flex-direction: column; }
    .sr-auto-seg-btn     { border-right: none; border-bottom: 1.5px solid #e5e7eb; }
    .sr-auto-seg-btn:last-child { border-bottom: none; }
    .sr-auto-pill-col    { display: none; } /* hide destination pills on mobile */
    .sr-auto-h-stub      { display: none; }
    .sr-auto-row,
    .sr-auto-run-row,
    .sr-auto-done-row    { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════
   ANIMATIONS — Configure view (idle life)
═══════════════════════════════════════════ */

/* Connector lines pulse green gently */
@keyframes sr-auto-line-idle {
    0%, 100% { border-color: #e5e7eb; }
    50%       { border-color: #a7f3d0; }
}
@keyframes sr-auto-stub-idle {
    0%, 100% { border-color: #e5e7eb; }
    50%       { border-color: #a7f3d0; }
}

.sr-auto-v-line {
    animation: sr-auto-line-idle 3s ease-in-out infinite;
}
.sr-auto-h-stub {
    animation: sr-auto-stub-idle 3s ease-in-out infinite;
}
.sr-auto-pill-hline {
    animation: sr-auto-stub-idle 3s ease-in-out infinite;
}
.sr-auto-pill-vline {
    animation: sr-auto-line-idle 3s ease-in-out infinite;
}

/* Ripple downward — each row staggered */
#srAutoRow1 .sr-auto-h-stub,
#srAutoRow1 .sr-auto-pill-hline,
#srAutoRow1 .sr-auto-pill-vline                    { animation-delay: 0s; }
#srAutoRow1 + .sr-auto-v-connector .sr-auto-v-line { animation-delay: 0.2s; }
#srAutoRow2 .sr-auto-h-stub,
#srAutoRow2 .sr-auto-pill-hline,
#srAutoRow2 .sr-auto-pill-vline                    { animation-delay: 0.4s; }
#srAutoRow2 + .sr-auto-v-connector .sr-auto-v-line { animation-delay: 0.6s; }
#srAutoRow3 .sr-auto-h-stub,
#srAutoRow3 .sr-auto-pill-hline,
#srAutoRow3 .sr-auto-pill-vline                    { animation-delay: 0.8s; }
#srAutoRow3 + .sr-auto-v-connector .sr-auto-v-line { animation-delay: 1.0s; }
#srAutoRow4 .sr-auto-h-stub,
#srAutoRow4 .sr-auto-pill-hline,
#srAutoRow4 .sr-auto-pill-vline                    { animation-delay: 1.2s; }

/* Stage number nodes — subtle glow pulse */
@keyframes sr-auto-node-idle {
    0%, 70%, 100% { box-shadow: none; }
    35%            { box-shadow: 0 0 0 5px rgba(5, 150, 105, 0.1); }
}
.sr-auto-stage-num.s1 { animation: sr-auto-node-idle 4s ease-in-out infinite 0s; }
.sr-auto-stage-num.s2 { animation: sr-auto-node-idle 4s ease-in-out infinite 0.6s; }
.sr-auto-stage-num.s3 { animation: sr-auto-node-idle 4s ease-in-out infinite 1.2s; }
.sr-auto-stage-num.s4 { animation: sr-auto-node-idle 4s ease-in-out infinite 1.8s; }

/* Destination pills — gentle float */
@keyframes sr-auto-pill-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-2px); }
}
#srAutoRow1 .sr-auto-dest-pill { animation: sr-auto-pill-float 3.5s ease-in-out infinite 0s; }
#srAutoRow2 .sr-auto-dest-pill { animation: sr-auto-pill-float 3.5s ease-in-out infinite 0.5s; }
#srAutoRow3 .sr-auto-dest-pill { animation: sr-auto-pill-float 3.5s ease-in-out infinite 1.0s; }
#srAutoRow4 .sr-auto-dest-pill { animation: sr-auto-pill-float 3.5s ease-in-out infinite 1.5s; }

/* Run button — breathing glow when enabled */
@keyframes sr-auto-btn-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
    50%       { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0.18); }
}
.sr-auto-run-btn:not(:disabled) {
    animation: sr-auto-btn-breathe 2.5s ease-in-out infinite;
}


/* ════════════════════════════════════════════
   ANIMATIONS — Running view (alive!)
═══════════════════════════════════════════ */

/* Running connector lines — bright flowing pulse */
@keyframes sr-auto-run-line-pulse {
    0%, 100% { border-color: var(--sr-emerald-border); opacity: 0.6; }
    50%       { border-color: var(--sr-emerald); opacity: 1; }
}
.sr-auto-run-v-line {
    animation: sr-auto-run-line-pulse 1.2s ease-in-out infinite;
}
/* Stagger each connector */
#srRunRow1 + .sr-auto-run-v-line { animation-delay: 0s; }
#srRunRow2 + .sr-auto-run-v-line { animation-delay: 0.3s; }
#srRunRow3 + .sr-auto-run-v-line { animation-delay: 0.6s; }

/* Running row h-stubs */
@keyframes sr-auto-run-stub-pulse {
    0%, 100% { border-color: var(--sr-emerald-border); opacity: 0.5; }
    50%       { border-color: var(--sr-emerald); opacity: 1; }
}
.sr-auto-run-row .sr-auto-h-stub {
    animation: sr-auto-run-stub-pulse 1.2s ease-in-out infinite;
}
#srRunRow1 .sr-auto-h-stub { animation-delay: 0.1s; }
#srRunRow2 .sr-auto-h-stub { animation-delay: 0.4s; }
#srRunRow3 .sr-auto-h-stub { animation-delay: 0.7s; }
#srRunRow4 .sr-auto-h-stub { animation-delay: 1.0s; }

/* Running pill hlines/vlines */
.sr-auto-run-row .sr-auto-pill-hline {
    animation: sr-auto-run-stub-pulse 1.2s ease-in-out infinite;
}
.sr-auto-run-row .sr-auto-pill-vline {
    animation: sr-auto-run-line-pulse 1.2s ease-in-out infinite;
}

/* Active card — persistent glow pulse */
@keyframes sr-auto-card-glow {
    0%, 100% { box-shadow: 0 0 0 3px var(--sr-emerald-bg), 0 2px 8px rgba(0,0,0,.06); }
    50%       { box-shadow: 0 0 0 6px #d1fae5, 0 4px 16px rgba(5,150,105,.15); }
}
.sr-auto-run-card.active {
    animation: sr-auto-card-glow 1.8s ease-in-out infinite;
}

/* Done card check — pop in */
@keyframes sr-auto-check-pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}
.sr-auto-run-card.done .sr-auto-run-check {
    animation: sr-auto-check-pop 0.4s cubic-bezier(.175,.885,.32,1.275) forwards;
}

/* Running pills — cascade ripple */
@keyframes sr-auto-run-pill-ripple {
    0%, 100% { opacity: 0.7; transform: translateY(0) scale(1); }
    50%       { opacity: 1; transform: translateY(-2px) scale(1.04); }
}
#srRunRow1 .sr-auto-dest-pill { animation: sr-auto-run-pill-ripple 1.4s ease-in-out infinite 0s; }
#srRunRow2 .sr-auto-dest-pill { animation: sr-auto-run-pill-ripple 1.4s ease-in-out infinite 0.35s; }
#srRunRow3 .sr-auto-dest-pill { animation: sr-auto-run-pill-ripple 1.4s ease-in-out infinite 0.7s; }
#srRunRow4 .sr-auto-dest-pill { animation: sr-auto-run-pill-ripple 1.4s ease-in-out infinite 1.05s; }

/* Live stat values on active card — pulse colour */
@keyframes sr-auto-stat-pulse {
    0%, 100% { color: var(--sr-emerald); }
    50%       { color: var(--sr-emerald-light); }
}
.sr-auto-run-card.active .sr-auto-run-stat-val.live {
    animation: sr-auto-stat-pulse 1.2s ease-in-out infinite;
}

/* Orb on agent card — more dramatic pulse */
@keyframes sr-auto-orb-pulse-strong {
    0%, 100% { box-shadow: 0 0 0 4px var(--sr-emerald-bg); transform: scale(1); }
    50%       { box-shadow: 0 0 0 12px #d1fae5; transform: scale(1.04); }
}
.sr-auto-agent-orb {
    animation: sr-auto-orb-pulse-strong 1.8s ease-in-out infinite !important;
}