.agent-panel { position:fixed; top:0; right:0; bottom:0; width:var(--agent-width); z-index:30; display:flex; flex-direction:column; background:#fcfdfd; border-left:1px solid #dbe4e5; box-shadow:-6px 0 30px #28454d05; }
body.agent-open .workspace { margin-right:var(--agent-width); }
.agent-backdrop { display:none; }
.agent-header { display:flex; align-items:center; gap:10px; padding:20px 18px; border-bottom:1px solid var(--line); min-height:82px; }
.agent-mark { display:grid; place-items:center; width:36px; height:36px; flex-shrink:0; background:#e4f0ed; color:#39786a; border:1px solid #d6e7e0; border-radius:10px; }
.agent-heading h2 { font-size:15px; }
.agent-heading small { display:block; color:#7e9295; font-size:10px; margin-top:2px; }
.agent-header-actions { margin-left:auto; display:flex; gap:3px; }
.agent-header-actions .icon-button,.agent-session-bar .icon-button { width:30px; height:30px; border-color:transparent; background:transparent; color:#849497; }
.agent-header-actions .ui-icon,.agent-session-bar .ui-icon { width:17px; height:17px; }
.agent-header-actions .icon-button:hover,.agent-session-bar .icon-button:hover { color:#2a7065; background:#eaf2ef; }
.agent-session-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 18px 4px; color:#5c7479; font-size:12px; }
#agent-session-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:550; }
.agent-connection { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 18px 12px; }
.agent-connection .pill { font-size:10px; padding:3px 7px; }
.agent-connection .link-button { font-size:11px; }
.agent-context { display:flex; align-items:center; flex-wrap:wrap; gap:6px; padding:9px 18px; border-block:1px solid #e9eeee; color:#658183; background:#f4f8f7; font-size:11px; }
.context-dot { width:5px; height:5px; border-radius:50%; background:#78a99b; }
.agent-context-product { overflow:hidden; max-width:145px; text-overflow:ellipsis; white-space:nowrap; padding-left:6px; border-left:1px solid #cededa; }
.agent-messages { flex:1; min-height:80px; overflow:auto; overscroll-behavior:contain; padding:20px 18px; scrollbar-width:thin; scrollbar-color:#c3d6d1 transparent; outline-offset:-3px; }
.agent-welcome { padding:30px 2px 8px; }
.agent-welcome-icon { width:46px; height:46px; border:1px solid #d6e5df; background:#eaf3ef; border-radius:12px; color:#3a7d6b; display:grid; place-items:center; margin-bottom:20px; }
.agent-welcome-icon .ui-icon { width:25px; height:25px; }
.agent-welcome h3 { font-size:21px; font-weight:650; color:#38565a; margin-bottom:12px; letter-spacing:-.4px; }
.agent-welcome p { font-size:12px; color:#72898d; line-height:1.95; }
.agent-suggestions { display:flex; flex-direction:column; gap:8px; margin-top:25px; }
.agent-suggestions button { background:#fff; color:#5b777b; border:1px solid #e1e9e7; border-radius:7px; padding:11px 12px; font-size:11px; text-align:left; line-height:1.7; }
.agent-suggestions button:hover { background:#f1f7f5; border-color:#bad3ca; color:#386a61; }
.agent-message { margin:0 0 22px; }
.agent-message-meta { display:flex; align-items:center; gap:8px; margin-bottom:9px; font-size:10px; color:#8fa0a3; }
.agent-message-meta strong { font-size:11px; font-weight:550; color:#658188; }
.agent-message-meta time { margin-left:auto; }
.agent-message-content { font-size:14px; line-height:1.9; white-space:pre-wrap; overflow-wrap:anywhere; color:#48656b; }
.agent-message.user .agent-message-content { border:1px solid #d9e6e1; border-radius:9px; padding:13px 14px; background:#eef5f2; color:#34594f; }
.agent-steps { margin:-6px 0 20px; padding:0; border:1px solid #e2eae7; border-radius:8px; background:#f7faf9; }
.agent-steps>summary { cursor:pointer; display:flex; align-items:center; gap:7px; padding:11px; list-style:none; color:#597a72; }
.agent-steps>summary::-webkit-details-marker { display:none; }
.agent-steps>summary>.ui-icon { width:15px; height:15px; }
.agent-steps>summary>strong { font-size:11px; font-weight:550; }
.agent-steps>summary>.pill { margin-left:auto; font-size:10px; }
.agent-steps>ol { list-style:none; margin:0 12px 12px 18px; padding:0 0 0 14px; border-left:1px solid #cbded5; }
.agent-step { position:relative; padding:9px 0 9px 0; }
.agent-step:before { content:''; position:absolute; left:-18px; top:17px; width:6px; height:6px; border:1px solid #c0d4cb; border-radius:50%; background:#f7faf9; }
.agent-step.succeeded:before { background:#70a493; border-color:#70a493; }
.agent-step.failed:before,.agent-step.unknown:before { background:#c66f59; border-color:#c66f59; }
.agent-step-heading { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.agent-step-heading strong { color:#4a6b63; font-size:11px; font-weight:550; overflow-wrap:anywhere; }
.agent-step-heading .pill { font-size:9px; padding:2px 5px; flex-shrink:0; }
.agent-step p { font-size:11px; color:#7b8c8a; margin-top:7px; line-height:1.8; overflow-wrap:anywhere; white-space:pre-wrap; }
.agent-receipt { margin-top:8px; font-size:10px; color:#628079; }
.agent-receipt summary { cursor:pointer; }
.agent-receipt pre { max-height:180px; overflow:auto; background:#eef3f1; border-radius:5px; padding:8px; font-size:10px; line-height:1.6; }
.agent-run-status { padding:12px 18px; border-top:1px solid #dce7e3; background:#f2f7f5; flex-shrink:0; }
.agent-run-summary { display:flex; align-items:center; gap:8px; }
.agent-run-summary>span:not(.pill) { font-size:10px; color:#7c9591; }
.agent-run-summary>.pill { font-size:10px; }
.agent-run-control { margin-left:auto; min-height:28px; padding:4px 8px; font-size:10px; }
.agent-run-control .ui-icon { width:13px; height:13px; }
.agent-run-status p { font-size:11px; color:#697e7b; overflow-wrap:anywhere; margin-top:8px; }
.agent-run-status p.negative { color:var(--red); }
.agent-run-status small { display:block; font-size:10px; color:#7d928c; margin-top:8px; }
.agent-business-links { display:flex; gap:12px; margin-top:8px; }
.agent-business-links .link-button { font-size:10px; }
.agent-error { padding:10px 18px; background:#fff1eb; color:#a65443; font-size:11px; line-height:1.8; overflow-wrap:anywhere; }
.agent-composer { margin:14px 14px 0; padding:0; border:1px solid #cbdcd7; background:#fff; border-radius:10px; box-shadow:0 2px 6px #21473c05; flex-shrink:0; }
.agent-composer:focus-within { border-color:#6faba0; box-shadow:0 0 0 3px #c7e5dd50; }
.agent-composer textarea { border:0; background:transparent; resize:vertical; min-height:80px; max-height:180px; font-size:12px; line-height:1.85; padding:12px 13px; box-shadow:none; }
.agent-composer textarea:focus-visible { outline:0; }
.agent-composer textarea::placeholder { color:#91a4a6; }
.agent-composer-footer { display:flex; justify-content:space-between; gap:8px; align-items:center; padding:2px 10px 10px 12px; }
.agent-composer-footer>span { font-size:9px; color:#91a3a4; }
.agent-send { width:30px; height:30px; border:0; color:#fff; background:#2d7d71; border-radius:7px; display:grid; place-items:center; }
.agent-send:disabled { background:#e3ece8; color:#9eb5ae; cursor:default; opacity:1; }
.agent-send .ui-icon { width:19px; height:19px; }
.agent-footer { font-size:9px; color:#99aaa9; text-align:center; padding:10px 16px 14px; }
.agent-history { max-height:260px; flex-shrink:0; overflow:auto; background:#f1f6f4; border-block:1px solid #dfe9e4; padding:14px 18px; }
.agent-history-heading { font-size:11px; color:#68817a; margin-bottom:8px; }
.agent-history-item { display:block; width:100%; border:1px solid transparent; border-radius:6px; text-align:left; background:transparent; padding:9px; margin:3px 0; color:#58746b; }
.agent-history-item strong { font-size:12px; display:block; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.agent-history-item small { font-size:10px; color:#8b9e98; }
.agent-history-item:hover,.agent-history-item.active { background:#fff; border-color:#dbe7e1; }
.agent-policy-dialog { width:min(720px,calc(100vw - 32px)); max-width:720px; max-height:90dvh; padding:26px; }
.agent-policy-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:22px; }
.agent-policy-heading h2 { font-size:21px; }
.agent-policy-form>h3 { margin:26px 0 14px; font-size:14px; color:#46615e; }
.agent-permissions { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:20px; }
.agent-permissions .checkbox-field { padding:14px; border:1px solid #dfe8e3; border-radius:8px; background:#f9fbfa; }
.agent-policy-form .checkbox-field strong { font-size:12px; }
.agent-policy-form .notice { font-size:11px; }
.agent-limits { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:24px; }
.agent-usage { font-size:12px; margin-bottom:15px; }
.agent-policy-form .form-error { margin-top:14px; }
.agent-assets { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:10px; }
.agent-asset { border:1px solid #dce6e2; border-radius:6px; overflow:hidden; background:#fff; }
.agent-asset .asset-media { height:130px; }
.agent-asset .link-button { font-size:10px; padding:7px 9px; text-align:left; overflow-wrap:anywhere; line-height:1.8; }
.agent-heading small,.agent-context,.agent-welcome p,.agent-message-meta,.agent-step p,.agent-run-summary>span:not(.pill),.agent-run-status small,.agent-composer-footer>span,.agent-footer,.agent-history-item small { color:#637579; }
@media (min-width:1181px) and (max-width:1650px) {
  body.agent-open .topbar { padding:14px 24px; }
  body.agent-open .topbar-status #ad-mode-status,body.agent-open .topbar-status #platform-status { display:none; }
  body.agent-open main { padding:28px 24px 0; }
  body.agent-open .heading-meta { display:flex; flex-direction:row; align-items:center; flex-wrap:wrap; width:100%; gap:10px; }
  body.agent-open .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.agent-open .overview-grid,body.agent-open .two-columns,body.agent-open .creative-grid,body.agent-open .operations-columns { grid-template-columns:1fr; }
  body.agent-open .scenario-layout { grid-template-columns:1fr; }
  body.agent-open .assets-filters { flex:1 1 100%; }
  body.agent-open .cost-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  body.agent-open .economics-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:1180px) {
  body.agent-open .workspace { margin-right:0; }
  .agent-panel { width:min(var(--agent-width),100vw); box-shadow:-12px 0 50px #20313c30; }
  .agent-backdrop:not([hidden]) { display:block; position:fixed; inset:0; background:#172d3e5c; border:0; z-index:25; }
}
@media (max-width:480px) {
  .agent-panel { width:100%; }
  .agent-header { padding:16px 18px; min-height:76px; }
  .agent-welcome { padding-top:18px; }
  .agent-policy-dialog { padding:20px; }
  .agent-permissions { grid-template-columns:1fr; gap:10px; }
  .agent-limits { grid-template-columns:1fr; }
}
