.account-inbound-view header{display:flex;justify-content:flex-end;gap:var(--sp-4);align-items:flex-start;margin-bottom:var(--sp-4)}
.account-inbound-view .header-actions{display:flex;gap:8px;flex-wrap:wrap}
.account-inbound-view .ainb-env-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:12px 0}
.account-inbound-view .ainb-env-card{border:1px solid var(--border);border-radius:var(--r-md);padding:10px 12px;background:var(--bg-elevated)}
.account-inbound-view .ainb-env-card.ok{border-color:color-mix(in srgb, var(--success, #16a34a) 45%, var(--border))}
.account-inbound-view .ainb-env-card.bad{border-color:color-mix(in srgb, var(--danger, #dc2626) 45%, var(--border))}
.account-inbound-view .ainb-env-card b{display:block;font-size:var(--fs-sm);margin-bottom:4px}
.account-inbound-view .ainb-env-card span{font-size:var(--fs-2xs);color:var(--text-muted);word-break:break-word}
.account-inbound-view .ainb-create-form{display:grid;gap:12px;max-width:640px}
.account-inbound-view .ainb-create-actions{display:flex;gap:8px}
.account-inbound-view .ainb-job-actions{display:flex;gap:6px;flex-wrap:wrap}

.account-inbound-view .ainb-live-log{max-height:360px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}.account-inbound-view progress{display:block;width:100%}.account-inbound-view dialog form{display:grid;gap:12px}.account-inbound-view label{display:grid;gap:6px}
.account-inbound-view .ainb-workspace{display:grid;grid-template-columns:280px minmax(0,1fr);gap:20px;align-items:start;margin-bottom:20px}
.account-inbound-view .ainb-library .panel-body{display:grid;gap:14px}.account-inbound-view h3{margin:0;font-size:var(--fs-sm)}
.account-inbound-view .ainb-flow-choice{display:grid;gap:8px;text-align:left;padding:16px;border:1px solid var(--border);border-radius:var(--r-md);background:var(--bg-elevated);color:var(--text-primary);cursor:pointer}
.account-inbound-view .ainb-flow-choice:hover{border-color:var(--accent)}.account-inbound-view .ainb-flow-choice span{font-size:var(--fs-2xs);color:var(--text-muted);line-height:1.7}
.account-inbound-view .ainb-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}.account-inbound-view .ainb-fields .metric-note{grid-column:1/-1}
.account-inbound-view .ainb-draft-steps{display:grid;gap:14px;margin:16px 0}.account-inbound-view .ainb-draft-step{min-width:0;margin:0;border:1px solid var(--border);border-radius:var(--r-lg);padding:16px}.account-inbound-view .ainb-draft-step legend{padding:0 8px;font-weight:600}
.account-inbound-view .ainb-step-number{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--bg-elevated);border:1px solid var(--border);font-size:13px}
.account-inbound-view .ainb-step-tools{display:flex;justify-content:flex-end;gap:4px;margin-bottom:10px}.account-inbound-view .ainb-check{display:flex;align-items:center;gap:8px}.account-inbound-view .ainb-submit-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid var(--border);padding-top:16px}
.account-inbound-view .ainb-empty{padding:32px 16px;text-align:center;color:var(--text-muted)}.account-inbound-view .ainb-import{margin-bottom:20px}.account-inbound-view .ainb-import>summary{padding:16px;cursor:pointer}
.account-inbound-view .ainb-run-steps{display:flex;gap:12px;list-style:none;margin:0 0 24px;padding:0;flex-wrap:wrap}.account-inbound-view .ainb-run-step{display:flex;align-items:center;gap:10px;padding:12px 16px;border:1px solid var(--border);border-radius:var(--r-md);flex:1;min-width:160px}.account-inbound-view .ainb-run-step div{display:grid;gap:4px}.account-inbound-view .ainb-run-step span:last-child{font-size:var(--fs-2xs);color:var(--text-muted)}
.account-inbound-view .ainb-run-step[data-state="running"]{border-color:var(--accent);background:var(--bg-elevated)}.account-inbound-view .ainb-run-step[data-state="succeeded"] .ainb-step-number{color:var(--success,#16a34a)}.account-inbound-view .ainb-run-step[data-state="failed"]{border-color:var(--danger,#dc2626)}.account-inbound-view .ainb-run-output{display:grid;gap:20px}.account-inbound-view .ainb-run-output summary{cursor:pointer}
.account-inbound-view [hidden]{display:none!important}
@media(max-width:900px){.account-inbound-view .ainb-workspace{grid-template-columns:1fr}.account-inbound-view header{flex-direction:column}.account-inbound-view .ainb-submit-bar{align-items:stretch;flex-direction:column}}
.account-inbound-view .ainb-workspace{grid-template-columns:minmax(300px,380px) minmax(0,1fr)}.account-inbound-view .ainb-operations,.account-inbound-view .ainb-results{display:grid;gap:18px;min-width:0}.account-inbound-view .ainb-operations .panel{margin:0}.account-inbound-view .ainb-operations .ainb-fields{grid-template-columns:1fr}.account-inbound-view .ainb-operations .ainb-submit-bar{flex-direction:column;align-items:stretch}.account-inbound-view .ainb-results td:first-child{overflow-wrap:anywhere}.account-inbound-view .ainb-results .table-wrap{overflow-x:auto}
@media(max-width:1050px){.account-inbound-view .ainb-workspace{grid-template-columns:1fr}}

.account-inbound-view .ainb-history-pagination{display:flex;gap:12px;align-items:center;justify-content:flex-end;padding:16px}.account-inbound-view #ainb-savedResult td{overflow-wrap:anywhere;max-width:500px}.account-inbound-view #ainb-savedResult th{font-weight:400;max-width:300px;overflow-wrap:anywhere}
.account-inbound-view .ainb-records-dialog{width:min(1160px,94vw);max-width:94vw;max-height:88vh;overflow:auto}.account-inbound-view .ainb-records-toolbar{display:flex;align-items:flex-end;gap:16px;padding:16px 0}.account-inbound-view .ainb-records-dialog #ainb-runDetail{margin-top:20px}.account-inbound-view .ainb-records-dialog .table-wrap{overflow-x:auto}.account-inbound-view .ainb-records-dialog td{overflow-wrap:anywhere}.account-inbound-view .ainb-records-dialog .ainb-live-log{max-height:240px}

.ainb-browser-dialog{width:min(1480px,96vw);max-width:96vw;max-height:94vh;overflow:auto}.ainb-browser-dialog canvas{display:block;width:100%;height:auto;min-height:120px;background:#111;outline:1px solid var(--border);touch-action:none}.ainb-browser-dialog canvas:focus{outline:2px solid var(--accent)}.ainb-browser-text{display:flex;gap:8px;margin-top:12px}.ainb-browser-text input{flex:1;min-width:0}

.ainb-duplicate-email{color:#ef4444;font-weight:600}

.ainb-duplicate-warning{display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;border:1px solid #ef4444;border-radius:50%;color:#ef4444;font-size:12px;font-weight:700;cursor:help}

.account-inbound-view .ainb-connection-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--text-muted);margin-right:8px}
.account-inbound-view [data-stream="connected"] .ainb-connection-dot{background:var(--success,#16a34a);animation:ainb-heartbeat 1.6s ease-out infinite}
.account-inbound-view [data-stream="connecting"] .ainb-connection-dot,.account-inbound-view [data-stream="reconnecting"] .ainb-connection-dot{background:var(--warning,#d97706)}
@keyframes ainb-heartbeat{0%,100%{box-shadow:0 0 0 0 transparent;opacity:1}40%{box-shadow:0 0 0 5px color-mix(in srgb,var(--success,#16a34a) 25%,transparent);opacity:.7}}
@media(prefers-reduced-motion:reduce){.account-inbound-view [data-stream="connected"] .ainb-connection-dot{animation:none}}

.account-inbound-view .ainb-history-table{table-layout:fixed;min-width:0;width:100%}
.account-inbound-view .ainb-history-table th,.account-inbound-view .ainb-history-table td{white-space:normal;overflow-wrap:anywhere}
.account-inbound-view .ainb-history-account-preview{display:block;max-width:100%;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;background:transparent;border:0;padding:0;color:inherit;font:inherit;cursor:help}
.ainb-history-accounts-popover{position:fixed;inset:auto;margin:0;width:min(640px,calc(100vw - 32px));max-height:min(360px,60vh);overflow:auto;box-sizing:border-box;padding:16px;border:1px solid var(--border);border-radius:var(--r-md);background:var(--bg-elevated);color:var(--text-primary);box-shadow:0 8px 28px #0003}
.ainb-history-accounts-popover b{display:block;margin-bottom:10px;font-size:var(--fs-sm)}
.ainb-history-account-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 20px;font-size:var(--fs-xs)}
.ainb-history-account-grid span{overflow-wrap:anywhere}
@media(min-width:761px){.account-inbound-view .ainb-history-table th:nth-child(1){width:32%}.account-inbound-view .ainb-history-table th:nth-child(2){width:23%}.account-inbound-view .ainb-history-table th:nth-child(3){width:10%}.account-inbound-view .ainb-history-table th:nth-child(4){width:21%}.account-inbound-view .ainb-history-table th:nth-child(5){width:14%}}

.ainb-outcome-summary{display:flex;gap:4px 10px;flex-wrap:wrap;font-size:var(--fs-2xs);margin:5px 0}
.ainb-outcome-success{color:var(--success,#16a34a)}.ainb-outcome-failure{color:var(--danger,#dc2626)}.ainb-outcome-pending{color:var(--text-muted)}
.ainb-history-account-grid>div{display:grid;gap:4px;min-width:0;padding:8px 0;border-top:1px solid var(--border)}
.account-inbound-view .ainb-outcome-list{display:grid;gap:8px;max-height:360px;overflow:auto}
.account-inbound-view .ainb-outcome-list>div{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;border-top:1px solid var(--border);padding-top:8px}
.account-inbound-view .ainb-outcome-list span{white-space:normal;overflow-wrap:anywhere}

.account-inbound-view .ainb-job-detail-dialog{width:min(1100px,94vw);max-width:94vw}

.account-inbound-view .ainb-choice-buttons{display:flex;flex-wrap:wrap;gap:8px}
.account-inbound-view .ainb-choice-button{white-space:normal;text-align:left;line-height:1.5}
.account-inbound-view .ainb-choice-button[aria-pressed="true"]{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 14%,var(--bg-elevated));color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
