.agent-builder-page{
    margin-left:320px;
    min-height:100vh;
    background:#f8fafc;
    color:#0f172a;
    padding:28px;
    font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.agent-builder-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    flex-wrap:wrap;
    margin-bottom:22px;
}
.agent-builder-title{
    margin:0 0 8px;
    font-size:30px;
    font-weight:900;
    letter-spacing:-.045em;
}
.agent-builder-lead{
    margin:0;
    color:#64748b;
    font-weight:650;
}
.agent-builder-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.agent-builder-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:10px 14px;
    border-radius:12px;
    border:1px solid rgba(148,163,184,.28);
    background:#fff;
    color:#0f172a;
    text-decoration:none;
    font-weight:850;
    box-shadow:0 8px 22px rgba(15,23,42,.05);
}
.agent-builder-btn.primary{
    background:linear-gradient(135deg,#2563eb,#7c3aed);
    color:#fff;
    border-color:transparent;
}
.agent-builder-grid{
    display:grid;
    grid-template-columns:280px minmax(0,1fr) 320px;
    gap:18px;
    align-items:start;
}
.agent-builder-panel{
    background:#fff;
    border:1px solid rgba(148,163,184,.22);
    border-radius:20px;
    padding:18px;
    box-shadow:0 16px 42px rgba(15,23,42,.06);
}
.agent-builder-panel h2{
    margin:0 0 12px;
    font-size:17px;
    font-weight:900;
}
.agent-template-card,
.agent-step-card,
.agent-setting-card{
    border:1px solid rgba(148,163,184,.22);
    border-radius:16px;
    background:#f8fafc;
    padding:14px;
    margin-bottom:12px;
}
.agent-template-card strong,
.agent-step-card strong,
.agent-setting-card strong{
    display:block;
    margin-bottom:5px;
    color:#0f172a;
}
.agent-template-card small,
.agent-step-card small,
.agent-setting-card small{
    color:#64748b;
    font-weight:650;
}
.agent-template-card.active{
    background:linear-gradient(135deg,rgba(37,99,235,.10),rgba(124,58,237,.10));
    border-color:rgba(37,99,235,.28);
}
.agent-builder-canvas{
    min-height:620px;
}
.agent-flow-lane{
    position:relative;
    display:flex;
    flex-direction:column;
    gap:14px;
}
.agent-step-card{
    position:relative;
    background:#fff;
    padding:16px 16px 16px 54px;
}
.agent-step-card:before{
    content:attr(data-step);
    position:absolute;
    left:14px;
    top:16px;
    width:28px;
    height:28px;
    border-radius:10px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#0f172a;
    color:#fff;
    font-size:12px;
    font-weight:900;
}
.agent-step-card:after{
    content:"";
    position:absolute;
    left:27px;
    bottom:-15px;
    width:2px;
    height:14px;
    background:#cbd5e1;
}
.agent-step-card:last-child:after{
    display:none;
}
.agent-step-meta{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:10px;
}
.agent-chip{
    display:inline-flex;
    align-items:center;
    min-height:24px;
    padding:4px 8px;
    border-radius:999px;
    background:#eff6ff;
    color:#1d4ed8;
    font-size:12px;
    font-weight:850;
}
.agent-form-row{
    display:flex;
    flex-direction:column;
    gap:7px;
    margin-bottom:12px;
}
.agent-form-row label{
    font-size:12px;
    font-weight:900;
    color:#475569;
}
.agent-form-row input,
.agent-form-row select,
.agent-form-row textarea{
    width:100%;
    box-sizing:border-box;
    border:1px solid rgba(148,163,184,.35);
    border-radius:12px;
    padding:10px 12px;
    background:#fff;
    color:#0f172a;
    font-weight:650;
}
.agent-template-run-list{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
}
.agent-run-template{
    background:#fff;
    border:1px solid rgba(148,163,184,.22);
    border-radius:18px;
    padding:16px;
    box-shadow:0 14px 32px rgba(15,23,42,.05);
}
.agent-run-template h3{
    margin:0 0 8px;
    font-size:17px;
}
.agent-run-template p{
    margin:0 0 14px;
    color:#64748b;
    font-weight:650;
    line-height:1.6;
}
@media(max-width:1180px){
    .agent-builder-grid{grid-template-columns:1fr;}
}
@media(max-width:960px){
    .agent-builder-page{margin-left:0;padding:18px;}
    .agent-template-run-list{grid-template-columns:1fr;}
}
