/* ══ Fundy — Agent tab (js/x-agent.js) ══ */
.dash-agent { padding-bottom: 28px; }
.ag { display: grid; grid-template-columns: 330px minmax(0, 1fr) 320px; gap: var(--sp-gap, 14px); align-items: start; }
.ag-col { display: flex; flex-direction: column; gap: var(--sp-gap, 14px); min-width: 0; }
.ag-card { border: 1px solid var(--border); background: var(--surface); padding: 16px; }
.ag-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12.5px; font-weight: 600; }
.ag-h .muted { margin-left: auto; font-weight: 400; font-size: 10.5px; }

/* composer */
.ag-lv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; border: 1px solid var(--border-2); }
.ag-lv button { height: 30px; font-size: 11.5px; color: var(--text-3); }
.ag-lv button:hover { color: var(--text); }
.ag-lv button.on { background: var(--surface-3); color: var(--text); }
.ag-lv button b { font-weight: 600; }
.ag-lv-d { margin: 8px 0 12px; font-size: 11px; line-height: 1.5; color: var(--text-3); }
.ag-prompt { width: 100%; min-height: 110px; resize: vertical; padding: 10px 12px; font-size: 12.5px; line-height: 1.55; }
.ag-tpl { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 12px; }
.ag-tpl button { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; font-size: 11px; color: var(--text-2); border: 1px solid var(--border-2); background: var(--surface-2); }
.ag-tpl button:hover { color: var(--text); border-color: var(--border-3); }
.ag-run { display: flex; gap: 8px; align-items: center; }
.ag-mode .seg-btn { display: inline-flex; align-items: center; gap: 5px; }
.ag-run .btn-primary { margin-left: auto; }
.ag-warn { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px 10px; font-size: 11px; color: var(--yellow); border: 1px solid rgba(245, 184, 61, .3); background: rgba(245, 184, 61, .07); }

/* guardrails */
.ag-g { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 11.5px; color: var(--text-2); }
.ag-g .inp-wrap { width: 108px; height: 28px; }
.ag-g input { width: 100%; font-family: var(--mono); font-size: 12px; }
.ag-g-l { margin: 12px 0 6px; font-size: 11px; color: var(--text-3); }
.ag-pads { display: flex; flex-wrap: wrap; gap: 5px; }
.ag-pads button { height: 24px; padding: 0 8px; font-size: 11px; color: var(--text-3); border: 1px solid var(--border-2); }
.ag-pads button.on { color: var(--text); border-color: var(--text-3); background: var(--surface-3); }
.ag-kill { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 38px; margin-top: 14px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(var(--red-rgb), .22); border: 1px solid rgba(var(--red-rgb), .55); transition: background .15s; }
.ag-kill:hover { background: rgba(var(--red-rgb), .38); }

/* mission */
.ag-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 70px 30px; border: 1px dashed var(--border-2); color: var(--text-3); }
.ag-empty .ic { color: var(--text); }
.ag-empty h3 { margin: 4px 0 0; font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -.02em; }
.ag-empty p { max-width: 440px; margin: 0; font-size: 12.5px; line-height: 1.6; }
.ag-flow { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-family: var(--pixel); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.ag-flow span { padding: 4px 8px; border: 1px solid var(--border-2); color: var(--text-2); }
.ag-flow i { width: 12px; height: 1px; background: var(--border-3); }
.ag-mh { display: flex; align-items: flex-start; gap: 12px; }
.ag-mt { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.ag-mtags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.ag-acts { display: flex; gap: 6px; flex-shrink: 0; }
.ag-stats { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; margin: 16px 0 12px; padding: 12px 0; border-top: 1px solid var(--border-dim); border-bottom: 1px solid var(--border-dim); }
.ag-stats span { display: block; font-size: 10.5px; color: var(--text-3); margin-bottom: 3px; }
.ag-stats b { font-family: var(--mono); font-weight: 400; font-size: 14px; }
.ag-spk { flex: 1 1 140px; min-width: 120px; height: 40px; display: flex; align-items: center; justify-content: flex-end; font-size: 10.5px; overflow: hidden; }
.ag-spark { width: 100%; height: 40px; }
.ag-budget { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-3); }
.ag-budget b { font-family: var(--mono); font-weight: 400; color: var(--text-2); white-space: nowrap; }
.ag-bar { flex: 1; height: 4px; background: var(--surface-3); }
.ag-bar i { display: block; height: 100%; background: var(--chrome, var(--accent)); transition: width .4s; }
.ag-goal { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 6px; padding: 10px 12px; font-size: 12px; line-height: 1.5; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border-dim); }
.ag-goal .ic { margin-top: 2px; flex-shrink: 0; }

/* steps timeline */
.ag-steps { list-style: none; margin: 12px 0 0; padding: 0; position: relative; }
.ag-steps::before { content: ''; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 1px; background: var(--border-2); }
.ag-st { position: relative; display: flex; gap: 12px; padding: 9px 0; }
.ag-st-ic { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 27px; height: 27px; border: 1px solid var(--border-2); background: var(--surface); font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.ag-st-t { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 12.5px; min-height: 27px; }
.ag-st-t > .ic { color: var(--text-3); }
.ag-st-t b { font-weight: 600; }
.ag-st-d { margin-top: 2px; font-size: 11.5px; line-height: 1.5; color: var(--text-3); }
.ag-cost { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border: 1px solid var(--border-2); color: var(--text-2); }
.ag-risk { font-family: var(--pixel); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 5px; color: var(--text-3); background: var(--surface-3); }
.ag-risk.r-med { color: var(--yellow); background: rgba(245, 184, 61, .1); }
.ag-risk.r-high { color: var(--red); background: rgba(var(--red-rgb), .12); }
.ag-new { font-family: var(--pixel); font-size: 9.5px; padding: 1px 5px; color: #b69cff; background: rgba(182, 156, 255, .12); }
.ag-st.st-done .ag-st-ic { color: var(--green); border-color: rgba(var(--green-rgb), .45); background: rgba(var(--green-rgb), .08); }
.ag-st.st-done .ag-st-d { color: var(--text-2); }
.ag-st.st-running .ag-st-ic { color: var(--text); border-color: var(--text-2); }
.ag-st.st-awaiting .ag-st-ic, .ag-st.st-blocked .ag-st-ic { color: var(--yellow); border-color: rgba(245, 184, 61, .6); }
.ag-st.st-failed .ag-st-ic, .ag-st.st-blocked .ag-st-ic { color: var(--red); border-color: rgba(var(--red-rgb), .6); }
.ag-st.st-skipped { opacity: .45; }
.ag-st.added .ag-st-ic { border-style: dashed; }
.ag-appr { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; }

/* log + history */
.ag-log { display: flex; flex-direction: column; max-height: 460px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.ag-nolog { font-size: 11.5px; line-height: 1.5; }
.ag-le { display: flex; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--border-dim); animation: xPop .25s var(--ease-out, ease); }
.ag-le-ic { flex-shrink: 0; margin-top: 1px; color: var(--text-3); }
.ag-le.k-think .ag-le-ic { color: #b69cff; } .ag-le.k-tool .ag-le-ic { color: var(--text); } .ag-le.k-event .ag-le-ic { color: #6aa8ff; } .ag-le.k-warn .ag-le-ic { color: var(--yellow); } .ag-le.k-done .ag-le-ic { color: var(--green); }
.ag-le-t { font-size: 11.5px; line-height: 1.5; color: var(--text-2); }
.ag-le.k-think .ag-le-t { font-style: italic; color: var(--text-3); }
.ag-le-at { margin-top: 2px; font-family: var(--mono); font-size: 9.5px; color: var(--text-4); }
.ag-hi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; margin-bottom: 4px; text-align: left; border: 1px solid transparent; }
.ag-hi:hover { background: var(--surface-2); }
.ag-hi.on { border-color: var(--border-2); background: var(--surface-2); }
.ag-hi b { display: block; font-size: 12px; font-weight: 600; }
.ag-hi span { font-size: 10.5px; color: var(--text-3); }
.ag-hi-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ag-hi-r em { font-style: normal; font-family: var(--mono); font-size: 11px; }

@media (max-width: 1400px) { .ag { grid-template-columns: 300px minmax(0, 1fr); } .ag-right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .ag, .ag-right { grid-template-columns: 1fr; } .ag-stats { gap: 12px 18px; } }

/* credits */
.ag-cred { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; height: 24px; padding: 0 4px 0 8px; font-size: 11px; font-weight: 500; color: var(--text-2); border: 1px solid var(--border-2); background: var(--surface-2); }
.ag-cred b { font-family: var(--mono); font-weight: 400; color: var(--text); }
.ag-cred span { margin-left: 3px; padding: 2px 6px; font-size: 10px; font-weight: 600; background: var(--chrome-v, var(--accent)); color: #0a0a0b; }
.ag-cred:hover { border-color: var(--border-3); }
.ag-costs { margin-top: 10px; font-size: 10.5px; line-height: 1.5; color: var(--text-3); }
.ag-stats b small { font-size: 10px; color: var(--text-3); }
.ag-cr-bal { margin-bottom: 14px; font-size: 12.5px; color: var(--text-2); }
.ag-cr-bal b { font-family: var(--mono); font-weight: 400; font-size: 16px; color: var(--text); }
.ag-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ag-pack { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 14px 14px; text-align: left; border: 1px solid var(--border-2); background: var(--surface-2); transition: border-color .15s, transform .15s; }
.ag-pack:hover { border-color: var(--text-3); transform: translateY(-2px); }
.ag-pack.feat { border-color: transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--chrome, var(--accent)) border-box; border: 1px solid transparent; }
.ag-pack-tag { position: absolute; top: -9px; left: 12px; padding: 1px 7px; font-family: var(--pixel); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; background: var(--chrome-v, var(--accent)); color: #0a0a0b; }
.ag-pack > b { font-size: 12px; color: var(--text-2); }
.ag-pack-c { font-family: var(--pixel); font-size: 24px; } .ag-pack-c small { font-family: var(--font); font-size: 11px; color: var(--text-3); }
.ag-pack-p { font-size: 17px; font-weight: 700; }
.ag-pack-s { font-size: 10.5px; color: var(--green); }
.ag-pack-sol { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
@media (max-width: 640px) { .ag-packs { grid-template-columns: 1fr; } }
