.agent-panel { color:var(--text,#f1f2f3); }
.ap-header { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:4px 2px 14px; }
.ap-header h1 { margin:0; color:#f4f5f6; font-size:24px; font-weight:650; letter-spacing:-.02em; }
.ap-eyebrow { margin:0 0 5px; color:#63d4f2; font-size:10px; letter-spacing:.11em; font-weight:700; }
.ap-subtitle,.ap-hint,.ap-worker-option small,.ap-source small,.ap-worker-option em,.ap-empty,.ap-loading { color:#a9adb3; line-height:1.5; }
.ap-subtitle { margin:6px 0 0; font-size:12px; }
.ap-chip,.ap-status { display:inline-flex; align-items:center; gap:5px; border:1px solid #3b3d41; border-radius:999px; padding:5px 9px; color:#55d68a; background:#202824; font-size:11px; white-space:nowrap; }
.ap-ready { color:#55d68a; border-color:#315a43; background:#1c2a22; }
.ap-unready { color:#ffd166; border-color:#69552b; background:#2d281c; }
.ap-header-actions { display:flex; align-items:center; gap:9px; }
.ap-back,.ap-link-button { border:0; background:transparent; color:#6acdf4; cursor:pointer; font:inherit; }
.ap-card { min-width:0; border:1px solid #333539; border-radius:14px; padding:15px; background:#1d1e20; box-shadow:0 5px 18px rgba(0,0,0,.14); }
.ap-card h2 { margin:0; font-size:15px; color:#f0f1f2; }
.ap-card h3 { margin:0 0 7px; font-size:13px; color:#d8dadd; }
.ap-card-head,.ap-section-head,.ap-worker-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.ap-workbench { display:flex; flex-direction:column; height:calc(100vh - 106px); min-height:440px; gap:8px; }
.ap-workbench>.ap-header { flex:0 0 auto; padding:2px 3px 8px; }
.ap-workbench-scroll { flex:1 1 auto; min-height:0; overflow-y:auto; padding:2px 3px 18px; }
.ap-workbench-columns { display:grid; grid-template-columns:minmax(300px,.82fr) minmax(0,1.18fr); align-items:stretch; gap:12px; }
.ap-role-panel,.ap-library-panel { min-height:280px; }
.ap-system-roles { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.ap-fixed-role { display:inline-flex; border:1px solid #44464b; border-radius:999px; padding:4px 8px; color:#c4c7ca; background:#27282b; font-size:10px; }
.ap-worker-select { display:grid; grid-template-columns:1fr; gap:8px; margin-top:13px; }
.ap-worker-option,.ap-source { display:flex; align-items:flex-start; gap:10px; border:1px solid #3b3d41; border-left:3px solid #54d78d; background:#242527; border-radius:10px; padding:10px 11px; min-width:0; cursor:pointer; transition:border-color .15s,background .15s; }
.ap-worker-option:hover,.ap-source:hover { background:#2a2b2e; }
.ap-worker-option input,.ap-source input,.ap-toggle input,.ap-cloud-consent input { flex:0 0 17px; width:17px; height:17px; margin:2px 0 0; accent-color:#55d68a; }
.ap-role-0 { border-left-color:#53d5ee; }
.ap-role-1 { border-left-color:#af83ff; }
.ap-role-2 { border-left-color:#54d78d; }
.ap-role-3 { border-left-color:#ff647c; }
.ap-role-4 { border-left-color:#ffd166; }
.ap-worker-option span,.ap-source span { display:grid; gap:4px; min-width:0; }
.ap-worker-option strong,.ap-source strong { font-size:12px; color:#ebedef; line-height:1.4; }
.ap-worker-option small,.ap-source small,.ap-worker-option em { font-size:10px; line-height:1.4; font-style:normal; }
.ap-worker-option em { color:#90959b; }
.ap-worker-option.is-unavailable { opacity:.55; cursor:not-allowed; }
.ap-link-button { margin-top:12px; padding:5px 0; font-size:11px; }
.ap-library-count { display:block; margin-top:5px; color:#62d5ef; font-size:11px; }
.ap-sources { margin-top:8px; }
.ap-source-search { display:block; width:100%; margin-top:7px; color:#f1f2f3; background:#161719; border:1px solid #424449; border-radius:9px; padding:9px 10px; font:inherit; font-size:12px; }
.ap-source-count { margin:7px 0; font-size:10px; }
.ap-source-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; max-height:270px; overflow:auto; padding:2px; }
.ap-source { padding:8px; border-left-width:1px; }
.ap-source-disabled { opacity:.52; }
.ap-local-details { margin-top:11px; padding-top:10px; border-top:1px solid #36383c; }
.ap-local-details summary,.ap-skill-notes summary,.ap-job summary { cursor:pointer; color:#61c9f0; font-size:11px; }
.ap-local-files { max-height:240px; overflow:auto; }
.ap-path { overflow-wrap:anywhere; font-size:9px!important; }
.ap-cloud-consent { display:flex!important; align-items:flex-start; gap:8px; padding:9px 10px; margin-top:9px; border:1px solid #64532e; border-radius:9px; background:#292519; color:#f0cd69; font-size:10px; line-height:1.45; }
.ap-launch-dock { position:sticky; z-index:5; bottom:0; flex:0 0 auto; padding:10px 3px 12px; border-top:1px solid #383a3e; background:linear-gradient(180deg,rgba(18,19,21,.92),#161719 24%); backdrop-filter:blur(12px); }
.ap-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; margin:0; }
.ap-form textarea { resize:vertical; min-height:46px; max-height:100px; font-size:13px; }
.ap-form textarea,.ap-profile textarea,.ap-profile input:not([type=checkbox]),.ap-profile select { width:100%; min-width:0; color:#f0f1f2; background:#161719; border:1px solid #424449; border-radius:9px; padding:9px 10px; font:inherit; font-size:12px; }
.ap-form :focus-visible,.agent-panel button:focus-visible,.ap-profile :focus-visible { outline:2px solid #61c9f0; outline-offset:2px; }
.ap-form .ap-primary { min-width:110px; min-height:46px; border:0; border-radius:9px; color:#08161a; background:#52c8ec; font-weight:700; cursor:pointer; }
.ap-form .ap-message { grid-column:1/-1; min-height:0; margin:0; font-size:11px; color:#65d78f; }
.agent-panel button { cursor:pointer; min-height:36px; border-radius:9px; padding:7px 11px; font:inherit; font-size:11px; font-weight:650; }
.agent-panel button:disabled { opacity:.62; cursor:wait; }
.ap-primary { border:0; color:#08161a; background:#52c8ec; }
.ap-secondary { color:#dfe1e4; background:#292a2d; border:1px solid #45474c; }
.ap-message { min-height:1.2em; color:#65d78f; margin:0; font-size:11px; }
.ap-error { color:#ff8493; white-space:pre-wrap; overflow-wrap:anywhere; }
.ap-success { color:#62d991; }
.ap-empty,.ap-loading { padding:12px 4px; font-size:12px; }
.ap-history { margin-top:12px; }
.ap-jobs { display:grid; gap:10px; margin-top:12px; }
.ap-job { padding:13px; border:1px solid #383a3f; border-radius:11px; background:#202124; }
.ap-job-title h3 { overflow-wrap:anywhere; }
.ap-router,.ap-final { margin-top:10px; padding:11px; border:1px solid #3d5964; border-radius:9px; background:#20272a; }
.ap-worker-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:10px; }
.ap-worker { border:1px solid #393b40; border-left:3px solid #af83ff; background:#242527; border-radius:10px; padding:11px; min-width:0; }
.ap-worker h4,.ap-router h4,.ap-final h4 { color:#67cbed; font-size:12px; margin:9px 0 5px; }
.ap-worker p,.ap-router p { line-height:1.5; overflow-wrap:anywhere; font-size:12px; }
.ap-worker pre,.ap-job pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; font-size:12px; line-height:1.6; color:#d5d7da; max-height:420px; overflow:auto; }
.ap-job details { margin-top:9px; }
.ap-job li { margin:4px 0; line-height:1.45; font-size:11px; }
.ap-events { list-style:none; padding:0; }
.ap-events li { color:#aeb2b7; font-size:10px; }
.ap-events time { color:#6bcdf0; margin-right:8px; }
.ap-learn { margin-top:10px; padding:11px; background:#1e2c23; border:1px solid #35624c; border-radius:10px; color:#c7ead5; }
.ap-profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.ap-profile { min-width:0; padding:13px; border:1px solid #3b3d41; border-radius:11px; background:#232426; }
.ap-profile legend { padding:0 5px; color:#69cbed; font-size:13px; font-weight:650; }
.ap-profile label { display:block; color:#c8cbd0; font-size:11px; margin:9px 0 5px; }
.ap-profile-model { display:grid; grid-template-columns:1fr 1fr; gap:7px 9px; align-items:center; margin:10px 0; }
.ap-profile-model label { margin:0; }
.ap-profile-model .ap-status { grid-column:1/-1; justify-self:start; }
.ap-toggle { display:flex!important; align-items:center; gap:8px; }
.ap-skill-notes { margin-top:10px; padding-top:8px; border-top:1px solid #3b3d41; }
.ap-note { border-left:2px solid #af83ff; padding:6px 9px; margin:7px 0; background:#29262f; }
.ap-note small { display:block; color:#a99abe; margin-top:4px; }
.ap-note pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; color:#d8d3df; font-size:11px; }
.ap-section-head { align-items:center; }
.agent-panel .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:950px) { .ap-workbench { height:auto; min-height:calc(100vh - 120px); overflow:visible; }.ap-workbench-scroll { overflow:visible; }.ap-workbench-columns,.ap-profile-grid { grid-template-columns:1fr; }.ap-launch-dock { bottom:0; } }
@media(max-width:700px) { .ap-worker-select,.ap-source-list,.ap-worker-grid { grid-template-columns:1fr; }.ap-profile-model { grid-template-columns:1fr; }.ap-profile-model .ap-status { grid-column:auto; }.ap-header { flex-wrap:wrap; }.ap-header-actions { width:100%; justify-content:space-between; }.ap-form { grid-template-columns:minmax(0,1fr) auto; }.ap-form .ap-primary { min-width:80px; padding:7px; }.ap-workbench { height:auto; min-height:calc(100vh - 126px); }.ap-launch-dock { position:sticky; bottom:53px; } }

/* Keep the launch controls accessible without stretching the content cards. */
.ap-workbench-columns { align-items:start; }
.ap-role-panel,.ap-library-panel { min-height:0; }
body:has(#main .agent-panel) .chat-fab { display:none; }
@media(max-width:950px), (max-height:700px) {
  #main:has(.agent-panel) { overflow:visible; }
  .ap-workbench { height:auto; min-height:0; }
  .ap-workbench-scroll { overflow:visible; }
}
@media(max-width:820px) {
  #main:has(.agent-panel) { overflow:visible; padding-bottom:calc(88px + env(safe-area-inset-bottom)); }
  .ap-launch-dock { bottom:calc(63px + env(safe-area-inset-bottom)); }
  .ap-form .ap-primary { min-height:48px; }
}
