/* Agent Studio — Phase 1 layout */
.st-shell { padding: 24px 24px 40px; }
.st-head { margin-bottom: 16px; }
.st-head h1 { margin: 0 0 8px; font-size: 40px; color: var(--agt-strong); letter-spacing: -.02em; }
.st-top { display: flex; gap: 8px; align-items: baseline; margin-bottom: 16px; }
.st-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.st-side { background: linear-gradient(180deg, var(--agt-panel), var(--agt-panel2)); border: 1px solid var(--agt-line); border-radius: 14px; padding: 16px; position: sticky; top: 90px; }
.st-side h2 { margin: 0 0 8px; font-size: 14px; color: var(--agt-strong); }
.st-new { width: 100%; background: var(--agt-primary); color: var(--color-text); border: 0; border-radius: 9px; padding: 8px; font: inherit; font-weight: 800; font-size: 12px; cursor: pointer; margin-bottom: 8px; }
.st-proj { display: block; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 8px 8px; color: var(--agt-text); font: inherit; cursor: pointer; }
.st-proj:hover, .st-proj.active { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.35); }
.st-proj strong { display: block; font-size: 12px; }
.st-proj small { color: var(--agt-muted); font-size: 12px; }
.st-note { margin-top: 16px; font-size: 12px; color: var(--agt-muted); border-top: 1px solid var(--agt-line); padding-top: 8px; }
.st-work { display: grid; gap: 16px; }
.st-card { background: linear-gradient(180deg, var(--agt-panel), var(--agt-panel2)); border: 1px solid var(--agt-line); border-radius: 14px; padding: 16px 16px; }
.st-card h2 { margin: 0 0 8px; font-size: 16px; color: var(--agt-strong); }
.st-label { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--agt-muted); font-weight: 700; margin-bottom: 8px; }
.st-text, .st-input { width: 100%; background: var(--agt-input); color: var(--agt-text); border: 1px solid var(--agt-line); border-radius: 9px; padding: 8px 8px; font: inherit; font-size: 14px; }
.st-text { resize: vertical; line-height: 1.5; }
.st-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.st-btn { background: rgba(20,28,43,0.07); border: 1px solid var(--agt-line); color: var(--agt-text); padding: 8px 16px; border-radius: 9px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.st-btn-gold { background: var(--agt-primary); color: var(--color-text); border: 0; font-weight: 800; }
.st-small { color: var(--agt-muted); font-size: 12px; }
.st-tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--agt-line); margin-bottom: 16px; }
.st-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--agt-muted); padding: 8px 8px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.st-tab.active { color: var(--agt-goldp); border-bottom-color: var(--agt-primary); }
.st-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 16px; }
.st-field { display: grid; gap: 8px; margin-bottom: 8px; }
.st-field > span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--agt-muted); font-weight: 700; }
.st-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--agt-muted); }
.st-split { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 16px; }
.st-filelist { display: grid; gap: 8px; align-content: start; }
.st-file { text-align: left; background: transparent; border: 1px solid var(--agt-line); border-radius: 7px; color: var(--agt-text); padding: 8px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.st-file:hover { border-color: var(--agt-primary); }
.st-code { background: var(--color-surface); color: var(--color-primary); border: 1px solid var(--color-primary); border-radius: 9px; padding: 16px; font-family: var(--font-body); font-size: 12px; white-space: pre-wrap; max-height: 420px; overflow: auto; }
.st-score { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; border: 6px solid var(--agt-primary); font-size: 24px; font-weight: 800; color: var(--agt-strong); }
.st-score span { font-size: 12px; color: var(--agt-muted); }
.st-check { font-size: 12px; padding: 8px 0; color: var(--agt-muted); }
.st-check.ok { color: var(--agt-ok); } .st-check.bad { color: var(--agt-bad); }
.st-finding { border: 1px solid var(--agt-line); border-left: 3px solid var(--agt-warn); border-radius: 8px; padding: 8px 8px; margin-bottom: 8px; font-size: 12px; }
.st-finding.critical { border-left-color: var(--agt-bad); }
.st-finding.high { border-left-color: var(--color-primary); }
.st-gate { border: 1px solid rgba(59,130,246,0.5); background: rgba(59,130,246,0.08); border-radius: 9px; padding: 8px 16px; font-size: 12px; margin: 8px 0; }
.st-policy { font-size: 12px; color: var(--agt-muted); }
@media (max-width: 900px) { .st-layout, .st-grid2, .st-split { grid-template-columns: 1fr; } .st-side { position: static; } }

/* ---------------------------------------------------------------- Phase 2 */
.st-tabs { position: sticky; top: 72px; background: var(--agt-panel); z-index: 3; padding-top: 8px; }
.st-tab i { font-style: normal; display: inline-block; margin-left: 8px; background: rgba(59,130,246,0.18); color: var(--agt-goldp); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 800; }
.st-subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.st-subtab { background: transparent; border: 1px solid var(--agt-line); border-radius: 999px; color: var(--agt-muted); padding: 8px 16px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.st-subtab.active { color: var(--color-text); background: var(--agt-primary); border-color: var(--agt-primary); }
.st-subtab i { font-style: normal; opacity: .7; margin-left: 8px; }
.st-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.st-search { flex: 1 1 260px; }
.st-select { flex: 0 1 200px; }
.st-skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.st-skill-card, .st-int-card { background: linear-gradient(180deg, var(--agt-panel), var(--agt-panel2)); border: 1px solid var(--agt-line); border-radius: 12px; padding: 16px 16px; margin-bottom: 0; display: grid; gap: 8px; align-content: start; }
.st-skill-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.st-skill-head h4 { margin: 0; font-size: 14px; color: var(--agt-strong); line-height: 1.3; }
.st-badge { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 8px 8px; border: 1px solid var(--agt-line); color: var(--agt-muted); white-space: nowrap; }
.st-badge.ok { color: var(--agt-ok); border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.1); }
.st-badge.warn { color: var(--color-error); border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.1); }
.st-badge.bad { color: var(--agt-bad); border-color: rgba(239,68,68,0.45); background: rgba(239,68,68,0.1); }
.st-meta { display: flex; flex-wrap: wrap; gap: 8px 8px; font-size: 12px; color: var(--agt-muted); }
.st-meta code, .st-tools-line code { background: rgba(20,28,43,0.06); border: 1px solid var(--agt-line); border-radius: 5px; padding: 8px 8px; font-size: 12px; }
.st-tools-line { gap: 8px; }
.st-preview { max-height: 260px; margin: 0; }
.st-callout { border: 1px solid var(--agt-line); border-left: 3px solid var(--agt-primary); border-radius: 9px; padding: 8px 16px; font-size: 12px; color: var(--agt-muted); margin: 0 0 16px; background: rgba(59,130,246,0.05); }
.st-detail-grid { margin-top: 8px; }
.st-scan { display: grid; gap: 8px; }
.st-btn-ghost { background: transparent; }
.st-btn.st-danger { color: var(--agt-bad); border-color: rgba(239,68,68,0.35); }
.st-check-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--agt-muted); margin: 8px 0; }
.st-warn-text { color: var(--color-error); }
.st-list { margin: 8px 0 8px; padding-left: 16px; font-size: 12px; color: var(--agt-muted); }
.st-builder-sections { margin-top: 8px; }
@media (max-width: 900px) { .st-tabs { position: static; } .st-skill-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Phase 3: workflows */
.st-workflow-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.wf-name { flex: 1 1 260px; }
.st-wf-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.wf-palette { background: linear-gradient(180deg, var(--agt-panel), var(--agt-panel2)); border: 1px solid var(--agt-line); border-radius: 12px; padding: 8px; max-height: 520px; overflow: auto; }
.wf-pal-group { margin-bottom: 8px; }
.wf-pal-list { display: grid; gap: 8px; }
.wf-pal { display: flex; gap: 8px; align-items: center; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--agt-text); padding: 8px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.wf-pal:hover { border-color: var(--agt-line); background: rgba(20,28,43,0.05); }
.wf-pal i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.wf-canvas { position: relative; min-height: 520px; border: 1px solid var(--agt-line); border-radius: 12px; background: radial-gradient(circle, rgba(20,28,43,0.1) 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(180deg, var(--agt-panel), var(--agt-panel2)); overflow: auto; }
.wf-svg { position: absolute; inset: 0; pointer-events: none; }
.wf-edge { fill: none; stroke: var(--color-primary); stroke-width: 1.6; }
.wf-node { position: absolute; width: 168px; background: var(--agt-input); border: 1px solid var(--agt-line); border-radius: 9px; overflow: hidden; cursor: grab; box-shadow: 0 6px 16px rgba(0,0,0,0.24); }
.wf-node.selected { box-shadow: 0 0 0 2px rgba(0,0,0,0.24), 0 6px 16px rgba(0,0,0,0.24); }
.wf-node.connecting { outline: 2px dashed var(--agt-primary); }
.wf-node-head { display: flex; gap: 8px; align-items: center; padding: 8px 8px; background: rgba(20,28,43,0.05); font-size: 12px; font-weight: 700; color: var(--agt-strong); }
.wf-node-head i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.wf-node-head span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-link { border: 1px solid var(--agt-line); background: transparent; color: var(--agt-goldp); border-radius: 5px; width: 18px; height: 18px; line-height: 1; font-size: 12px; cursor: pointer; padding: 0; }
.wf-node-body { padding: 8px 8px; display: grid; gap: 8px; }
.wf-node-body code { font-size: 12px; color: var(--agt-muted); }
.wf-node-body small { font-size: 12px; color: var(--agt-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-wf-lower { margin-top: 16px; grid-template-columns: 1fr 1fr; }
.st-inner { background: rgba(20,28,43,0.03); padding: 8px 16px; margin: 8px 0; }
.st-timeline { margin: 8px 0 8px; padding-left: 24px; display: grid; gap: 8px; }
.st-timeline li { font-size: 12px; color: var(--agt-muted); }
.st-timeline li strong { color: var(--agt-text); margin-right: 8px; }
.st-timeline li code { font-size: 12px; }
.st-timeline li p { margin: 8px 0 0; }
.st-timeline li.ok { border-left: 2px solid var(--agt-ok); padding-left: 8px; }
.st-timeline li.warn { border-left: 2px solid var(--color-error); padding-left: 8px; }
.st-timeline li.bad { border-left: 2px solid var(--agt-bad); padding-left: 8px; }

/* ---------------------------------------------------------------- Phase 3: permissions */
.perm-head h3 { margin: 0; }
.perm-presets { margin: 8px 0 8px; }
.perm-summary { gap: 16px; margin-top: 8px; }
.perm-group { margin: 16px 0 16px; }
.perm-group h4 { margin: 0 0 8px; font-size: 12px; color: var(--agt-goldp); letter-spacing: .04em; text-transform: uppercase; }
.perm-scroll { overflow-x: auto; border: 1px solid var(--agt-line); border-radius: 10px; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 720px; }
.perm-table th, .perm-table td { padding: 8px 8px; border-bottom: 1px solid var(--agt-line); text-align: left; vertical-align: top; }
.perm-table thead th { background: rgba(20,28,43,0.04); color: var(--agt-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.perm-table tbody tr:last-child th, .perm-table tbody tr:last-child td { border-bottom: 0; }
.perm-table td { white-space: nowrap; }
.perm-name { display: block; color: var(--agt-text); font-weight: 600; }
.perm-id { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--agt-muted); }
.perm-cell { display: flex; float: left; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--agt-muted); cursor: pointer; width: 74px; text-align: center; }
.perm-cell input { accent-color: var(--color-primary); }
.policy-table td { white-space: normal; }
.st-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.test-level { border: 1px solid var(--agt-line); border-radius: 10px; padding: 8px 16px; background: rgba(20,28,43,0.03); display: grid; gap: 8px; }
.test-level.active { border-color: rgba(59,130,246,0.55); background: rgba(59,130,246,0.07); }
.test-level strong { color: var(--agt-strong); font-size: 12px; }
.test-level .st-badge { justify-self: start; }

/* ---------------------------------------------------------------- Phase 3: testing */
.chat-log { display: grid; gap: 16px; max-height: 480px; overflow: auto; padding: 8px 8px; }
.chat-turn { display: grid; gap: 8px; }
.chat-user { justify-self: end; max-width: 82%; background: rgba(59,130,246,0.16); border: 1px solid rgba(59,130,246,0.35); border-radius: 10px; padding: 8px 8px; font-size: 12px; }
.chat-agent { justify-self: start; max-width: 88%; background: rgba(20,28,43,0.05); border: 1px solid var(--agt-line); border-radius: 10px; padding: 8px 8px; font-size: 12px; color: var(--agt-text); }
.chat-timeline summary { cursor: pointer; color: var(--agt-muted); font-size: 12px; }
.chat-input { margin-top: 16px; }
.chat-input .st-input { flex: 1 1 340px; }
.inj-payload { margin: 0; border-left: 3px solid var(--agt-bad); padding: 8px 8px; background: rgba(59,130,246,0.06); font-size: 12px; color: var(--agt-muted); font-family: var(--font-body); }
.sec-head { align-items: center; }
.sec-metrics { display: grid; gap: 8px; }
.sec-metrics .st-meta { gap: 16px; }
.sec-validation { margin-top: 8px; }
.st-gate.ok { border-color: rgba(34,197,94,0.45); background: rgba(34,197,94,0.08); }
@media (max-width: 1000px) { .st-wf-layout, .st-wf-lower, .st-grid3 { grid-template-columns: 1fr; } .wf-canvas { min-height: 420px; } }

/* ---------------------------------------------------------------- Phase 4: teams + architect */
.tm-tree, .tm-tree ul { list-style: none; margin: 0; padding-left: 16px; }
.tm-tree { padding-left: 0; }
.tm-tree li { margin: 8px 0; position: relative; }
.tm-tree li::before { content: ""; position: absolute; left: -14px; top: 12px; width: 12px; border-top: 1px solid var(--agt-line); }
.tm-tree > li::before { display: none; }
.tm-node { display: inline-flex; gap: 8px; align-items: center; padding: 8px 8px; border: 1px solid var(--agt-line); border-radius: 8px; background: rgba(20,28,43,0.04); }
.tm-node code { font-size: 12px; color: var(--agt-muted); }
.tm-node strong { font-size: 12px; color: var(--agt-strong); }
.tm-member { margin-bottom: 0; }
.st-platform-note { margin: -8px 0 8px; }

/* ---------------------------------------------------------------- Phase 5: marketplace, sharing, enterprise */
.bp-card { position: relative; }
.bp-card .st-badge { align-self: flex-start; }
.ent-banned { max-height: 190px; overflow: auto; border: 1px solid var(--agt-line); border-radius: 8px; padding: 8px; }
.ent-banned label { font-size: 12px; }
.st-toolbar .st-badge { align-self: center; }
.share-url { word-break: break-all; font-size: 12px; color: var(--agt-muted); }
