.agent-workbench[data-workspace-view="chat"] .agent-workbench-grid,.agent-workbench-grid[data-workspace-view="chat"]{grid-template-columns:minmax(240px,270px) minmax(0,1fr)}
.agent-dialog-card select{appearance:none;min-height:48px;padding:0 46px 0 14px;border:1px solid var(--line);border-radius:12px;background-color:var(--surface);background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:calc(100% - 21px) 52%,calc(100% - 15px) 52%;background-size:6px 6px,6px 6px;background-repeat:no-repeat;color:var(--ink);font:inherit;font-size:13px;font-weight:700;cursor:pointer;transition:border-color .2s,box-shadow .2s,background-color .2s}.agent-dialog-card select:hover{border-color:color-mix(in srgb,var(--orange) 55%,var(--line));background-color:color-mix(in srgb,var(--surface) 94%,var(--orange))}.agent-dialog-card select:focus{outline:0;border-color:var(--orange);box-shadow:0 0 0 4px color-mix(in srgb,var(--orange) 14%,transparent)}.agent-dialog-card [data-close-create]{min-height:42px;padding:8px 16px;border:1px solid var(--line);border-radius:11px;color:var(--muted);background:var(--surface-muted);font:inherit;font-size:12px;font-weight:750;text-decoration:none;cursor:pointer}.agent-dialog-card [data-close-create]:hover{border-color:var(--orange);color:var(--ink);background:var(--surface)}
.inspector-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.inspector-picker label{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start;gap:10px;min-width:0;padding:13px;border:1px solid var(--line);border-radius:12px;background:var(--surface-muted);cursor:pointer;transition:border-color .2s,background .2s}.inspector-picker label:hover{border-color:color-mix(in srgb,var(--orange) 50%,var(--line));background:color-mix(in srgb,var(--orange) 6%,var(--surface-muted))}.inspector-picker input[type="checkbox"]{width:18px!important;height:18px;flex:0 0 18px;margin:2px 0 0;accent-color:var(--orange)}.inspector-picker span{min-width:0}.inspector-picker strong,.inspector-picker small{display:block;overflow-wrap:anywhere}.inspector-picker strong{color:var(--ink);font-size:12px}.inspector-picker small{margin-top:4px;color:var(--muted);font-size:10px;line-height:1.5}.inspector-form[data-save-capabilities]{gap:16px}.inspector-form[data-save-capabilities]>h3{margin:4px 0 0;font-size:14px}.inspector-form[data-save-capabilities]>button{width:max-content;min-width:150px}@media(max-width:900px){.inspector-picker{grid-template-columns:1fr}}
.agent-inspector,.agent-inspector .inspector-body,.agent-inspector .inspector-form,.capability-manager{min-width:0;max-width:100%;box-sizing:border-box}.agent-inspector .inspector-body{overflow-x:hidden}.agent-inspector .inspector-form>*{min-width:0}.agent-workbench:not([data-workspace-view="settings"]) .capability-manager-toolbar{grid-template-columns:1fr}.agent-workbench:not([data-workspace-view="settings"]) .capability-manager-toolbar>div{grid-column:auto}.agent-workbench:not([data-workspace-view="settings"]) .capability-manager-toolbar select{width:100%}.agent-workbench:not([data-workspace-view="settings"]) .capability-resource-row{grid-template-columns:52px 20px minmax(0,1fr)}
.capability-manager{container-type:inline-size;display:grid;gap:12px;min-width:0}.capability-manager-toolbar{display:grid;grid-template-columns:minmax(130px,.7fr) minmax(180px,1.35fr) 130px;gap:9px;align-items:center}.capability-manager-toolbar>div strong,.capability-manager-toolbar>div small{display:block}.capability-manager-toolbar>div strong{font-size:14px}.capability-manager-toolbar>div small{margin-top:4px;color:var(--muted);font-size:10px}.capability-manager-toolbar>div .capability-help{color:#b45309;font-size:10px}.capability-manager-toolbar input,.capability-manager-toolbar select{box-sizing:border-box;width:100%;min-height:40px;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;font-size:11px}.capability-manager-toolbar select{appearance:none;padding-right:34px;background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:calc(100% - 17px) 52%,calc(100% - 12px) 52%;background-size:5px 5px,5px 5px;background-repeat:no-repeat}.capability-filters{display:flex;gap:5px;padding:4px;border:1px solid var(--line);border-radius:11px;background:var(--surface-muted);overflow:auto}.capability-filters button{flex:1;min-width:64px;padding:8px 10px;border:0;border-radius:8px;background:transparent;color:var(--muted);font:inherit;font-size:10px;font-weight:800;cursor:pointer}.capability-filters button.active,.capability-filters button:hover{background:var(--surface);color:var(--ink);box-shadow:0 3px 10px rgba(23,43,77,.08)}.capability-resource-list{display:grid;grid-auto-rows:max-content;align-content:start;gap:7px;max-height:430px;min-height:120px;padding-right:4px;overflow:auto}.capability-resource-row,.inspector-tool-toggle.capability-resource-row{display:grid!important;grid-template-columns:58px 20px minmax(0,1fr);grid-auto-rows:max-content;align-items:start;align-self:start;gap:10px;box-sizing:border-box;width:100%;min-width:0;height:auto!important;min-height:76px!important;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface-muted);cursor:pointer;transition:border-color .2s,background .2s}.capability-resource-row:hover{border-color:color-mix(in srgb,var(--orange) 48%,var(--line));background:color-mix(in srgb,var(--orange) 5%,var(--surface-muted))}.capability-resource-row:has(input:checked){border-color:color-mix(in srgb,var(--orange) 55%,var(--line));background:color-mix(in srgb,var(--orange) 8%,var(--surface-muted))}.capability-resource-row input[type="checkbox"]{grid-column:2;width:18px!important;height:18px;margin:0;accent-color:var(--orange)}.capability-resource-row>span{grid-column:3;min-width:0}.capability-resource-row strong,.capability-resource-row small{display:block;overflow-wrap:anywhere}.capability-resource-row strong{color:var(--ink);font-size:12px}.capability-resource-row small{margin-top:3px;color:var(--muted);font-size:10px;line-height:1.45}.capability-type-badge{grid-column:1;grid-row:1;display:inline-flex;justify-content:center;padding:5px 7px;border-radius:999px;font-style:normal;font-size:9px;font-weight:900}.capability-type-badge.tool{color:#2f6fb4;background:color-mix(in srgb,#4c8ed9 13%,var(--surface))}.capability-type-badge.skill{color:var(--orange);background:color-mix(in srgb,var(--orange) 12%,var(--surface))}.capability-type-badge.knowledge{color:#25825e;background:color-mix(in srgb,#2fa777 13%,var(--surface))}.capability-resource-row[hidden]{display:none!important}.agent-workbench[data-workspace-view="settings"] .capability-resource-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:min(64vh,720px)}.inspector-form[data-save-capabilities]>button{position:sticky;bottom:0;z-index:2;width:100%;margin-top:2px;box-shadow:0 -12px 24px var(--surface)}@media(max-width:1200px){.capability-manager-toolbar{grid-template-columns:1fr 1fr}.capability-manager-toolbar>div{grid-column:1/-1}.agent-workbench[data-workspace-view="settings"] .capability-resource-list{grid-template-columns:1fr}}@media(max-width:720px){.capability-manager-toolbar{grid-template-columns:1fr}.capability-manager-toolbar>div{grid-column:auto}.capability-resource-list{max-height:none}.capability-resource-row,.inspector-tool-toggle.capability-resource-row{grid-template-columns:52px 20px minmax(0,1fr)}}
.capability-resource-row{grid-template-columns:auto minmax(0,1fr) auto!important;align-items:start!important;min-height:76px!important;padding:12px!important;background:var(--surface)!important}.capability-resource-row .capability-type-badge{grid-column:1!important;grid-row:1!important;align-self:start;min-width:42px;box-sizing:border-box}.capability-resource-row>span{grid-column:2!important;grid-row:1!important;align-self:start}.capability-resource-row>input[type="checkbox"]{position:static!important;grid-column:3!important;grid-row:1!important;align-self:start;box-sizing:border-box!important;width:18px!important;min-width:18px!important;max-width:18px!important;height:18px!important;min-height:18px!important;max-height:18px!important;margin:0!important;padding:0!important}.capability-resource-row .capability-state{grid-column:2!important;grid-row:2!important;justify-self:start;margin-top:2px;font-size:9px;font-style:normal;font-weight:800;white-space:nowrap}.capability-resource-row .capability-state.on{color:#15803d}.capability-resource-row .capability-state.off{color:#94a3b8}.capability-resource-row [data-configure-tool]{grid-column:2!important;grid-row:3!important;justify-self:start;margin-top:6px}.capability-resource-row .capability-risk{grid-column:2!important;grid-row:3!important;justify-self:start;margin:6px 0 0}.capability-resource-row.is-disabled{opacity:.78}.capability-resource-row.is-saving{opacity:.55;pointer-events:none}.agent-workbench[data-workspace-view="settings"] .capability-resource-list{grid-template-columns:repeat(2,minmax(260px,1fr));align-items:stretch}.agent-workbench[data-workspace-view="settings"] .capability-resource-row{align-self:stretch;height:100%!important}.agent-workbench:not([data-workspace-view="settings"]) .capability-resource-list{grid-template-columns:1fr}.capability-runtime-budget{grid-template-columns:minmax(0,1fr) minmax(100px,.45fr) minmax(100px,.45fr);align-items:end}.capability-runtime-head{align-self:center}.capability-runtime-head strong,.capability-runtime-head small{display:block}.capability-runtime-head strong{color:var(--ink);font-size:12px}.capability-runtime-head small{margin-top:4px;color:var(--muted);font-size:9px}.capability-runtime-budget label{min-width:0}.capability-runtime-budget label small{grid-column:auto}.capability-runtime-budget>p{grid-column:1/-1;margin:0;color:var(--muted);font-size:9px;line-height:1.5}@container (max-width:560px){.capability-manager-toolbar{grid-template-columns:1fr}.capability-manager-toolbar>div{grid-column:auto}.capability-filters button{min-width:0}.capability-resource-list{grid-template-columns:1fr!important;max-height:none}.capability-runtime-budget{grid-template-columns:1fr 1fr}.capability-runtime-head,.capability-runtime-budget>p{grid-column:1/-1}}@container (max-width:390px){.capability-filters{display:grid;grid-template-columns:1fr 1fr}.capability-resource-row{grid-template-columns:auto minmax(0,1fr) auto!important}.capability-runtime-budget{grid-template-columns:1fr}.capability-runtime-head,.capability-runtime-budget>p{grid-column:auto}}
.agent-inspector{container-type:inline-size}.agent-inspector .inspector-tabs{flex-wrap:wrap;overflow:visible}.agent-inspector .inspector-tabs button{flex:1 1 70px}.agent-inspector .inspector-tabs button[data-inspector-tab="publish"]{flex-basis:110px}@container (max-width:440px){.agent-inspector .inspector-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.agent-inspector .inspector-tabs button{min-width:0;padding:8px 4px}.agent-inspector .inspector-tabs button[data-inspector-tab="publish"]{grid-column:span 2}}
.agent-workbench[data-workspace-view="chat"] .agent-inspector,.agent-workbench-grid[data-workspace-view="chat"] .agent-inspector{display:none}
.agent-rail,.agent-rail-head,.agent-list,.agent-list-group,.agent-list-item{box-sizing:border-box;min-width:0;max-width:100%}.agent-rail{overflow-x:hidden}.agent-list{overflow-x:hidden;overflow-y:auto}.agent-list-group,.agent-list-item,.agent-list-copy{overflow:hidden}.agent-list-copy strong,.agent-list-copy small{max-width:100%}
.agent-workbench[data-workspace-view="settings"] .agent-workbench-grid,.agent-workbench-grid[data-workspace-view="settings"]{grid-template-columns:minmax(240px,270px) minmax(0,1fr)}
.agent-workbench[data-workspace-view="settings"] .agent-chat,.agent-workbench-grid[data-workspace-view="settings"] .agent-chat{display:none}
.agent-view-switch{display:flex;align-items:center;gap:3px;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface-muted);white-space:nowrap}
.agent-view-switch button{min-width:62px;padding:9px 14px;border:0;border-radius:9px;background:transparent;color:var(--muted);font:inherit;font-size:11px;font-weight:800;cursor:pointer;transition:background .2s,color .2s,box-shadow .2s}
.agent-view-switch button:hover,.agent-view-switch button.active{background:var(--surface);color:var(--ink);box-shadow:0 4px 12px rgba(23,43,77,.1)}
.agent-head-actions{flex-wrap:wrap;justify-content:flex-end}.agent-head-actions .section-badge{min-height:36px;display:inline-flex;align-items:center}
.agent-workbench[data-workspace-view="chat"] .agent-chat,.agent-workbench[data-workspace-view="settings"] .agent-inspector{grid-column:auto}
.agent-workbench[data-workspace-view="chat"] .chat-messages{padding-right:clamp(24px,6vw,100px);padding-left:clamp(24px,6vw,100px)}
.agent-workbench[data-workspace-view="settings"] .inspector-body{max-width:960px;margin:0 auto;padding:24px 32px 48px}.agent-workbench[data-workspace-view="settings"] .inspector-tabs{justify-content:center;padding:12px 20px}
.agent-workbench[data-workspace-view="settings"] .inspector-tabs button{padding:10px 18px;font-size:12px}
@media(max-width:1500px) and (min-width:1051px){.agent-workbench[data-workspace-view="chat"] .agent-workbench-grid,.agent-workbench[data-workspace-view="settings"] .agent-workbench-grid{grid-template-columns:220px minmax(0,1fr)}}
@media(max-width:1050px){.agent-view-switch{order:3;width:100%;justify-content:space-between}.agent-view-switch button{flex:1}.agent-workbench[data-workspace-view="chat"] .agent-workbench-grid,.agent-workbench[data-workspace-view="settings"] .agent-workbench-grid{grid-template-columns:1fr}.agent-workbench[data-workspace-view="chat"] .agent-rail,.agent-workbench[data-workspace-view="settings"] .agent-rail{grid-column:1}.agent-workbench[data-workspace-view="chat"] .agent-chat,.agent-workbench[data-workspace-view="settings"] .agent-inspector{grid-column:1}.agent-workbench[data-workspace-view="settings"] .inspector-body{padding:20px}.agent-workbench[data-workspace-view="settings"] .inspector-tabs{justify-content:flex-start}}
.agent-avatar{position:relative}.agent-avatar img{display:block;width:100%;height:100%;object-fit:cover}.agent-avatar b{display:none;position:absolute;font-size:inherit}.agent-avatar:not(.has-image) b{display:block}
.agent-avatar{display:inline-flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:42px;border-radius:14px;background:linear-gradient(135deg,#f2a65a,#e8753d);background-position:center;background-size:cover;background-repeat:no-repeat;color:#fff;font-weight:850;overflow:hidden}.agent-avatar.small{width:34px;height:34px;flex-basis:34px;border-radius:11px;font-size:12px}.agent-avatar.has-image{font-size:0}.chat-agent-identity .agent-avatar{width:40px;height:40px;flex-basis:40px;border-radius:13px}.agent-avatar-editor{display:flex;align-items:center;gap:16px;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface-muted)}.agent-avatar-preview{display:inline-flex;align-items:center;justify-content:center;width:88px;height:88px;flex:0 0 88px;border-radius:16px;background:linear-gradient(135deg,#f2a65a,#e8753d);background-position:center;background-size:cover;color:#fff;font-size:28px;font-weight:850}.agent-avatar-preview.has-image{font-size:0}.agent-avatar-editor strong,.agent-avatar-editor small{display:block}.agent-avatar-editor small{margin-top:5px;color:var(--muted);font-size:11px;line-height:1.5}.agent-avatar-actions{display:flex;gap:8px;margin-top:10px}.agent-avatar-actions label{display:inline-flex;align-items:center;cursor:pointer}
.capability-risk{margin-left:auto;padding:3px 7px;border-radius:999px;background:#f59e0b1c;color:#b45309;font-size:9px;font-style:normal;font-weight:800;white-space:nowrap}.capability-runtime-budget{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:13px;border:1px solid var(--line);border-radius:13px;background:var(--surface-muted)}.capability-runtime-budget label{display:grid;gap:6px;color:var(--muted);font-size:10px}.capability-runtime-budget input{width:100%;padding:9px 10px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink)}.capability-runtime-budget small{grid-column:1/-1;color:var(--muted);font-size:9px;line-height:1.5}@media(max-width:680px){.capability-runtime-budget{grid-template-columns:1fr}.capability-runtime-budget small{grid-column:auto}}
.tool-connection-dialog{width:min(920px,calc(100vw - 32px))!important}.tool-connection-shell{padding:28px!important}.tool-connection-head{padding-bottom:18px;border-bottom:1px solid var(--line)}.tool-connection-head [data-tool-dialog-close]{min-width:76px;min-height:42px;border:1px solid var(--line);border-radius:12px;background:var(--surface-muted);color:var(--muted);font-weight:800}.dynamic-connection-form{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px!important}.connection-dynamic-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;min-width:0}.connection-field{display:grid!important;gap:7px!important;min-width:0;color:var(--muted);font-size:11px;font-weight:750}.connection-field>span{display:block}.connection-field>span b{color:#e65f2b}.connection-field input,.connection-field select,.connection-field textarea,.connection-advanced textarea{box-sizing:border-box;width:100%;min-width:0;min-height:46px;padding:11px 13px;border:1px solid var(--line);border-radius:12px;background:var(--surface-muted);color:var(--ink);font:inherit;font-size:13px;outline:none;transition:border-color .2s,box-shadow .2s,background .2s}.connection-field input:focus,.connection-field select:focus,.connection-field textarea:focus,.connection-advanced textarea:focus{border-color:var(--orange);background:var(--surface);box-shadow:0 0 0 4px color-mix(in srgb,var(--orange) 12%,transparent)}.connection-field select{appearance:none;padding-right:38px;background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:calc(100% - 18px) 52%,calc(100% - 13px) 52%;background-size:5px 5px,5px 5px;background-repeat:no-repeat}.connection-field small{color:var(--muted);font-size:10px;line-height:1.45}.connection-check-field{display:flex!important;align-items:center!important;gap:10px!important;min-height:46px;padding:11px 13px;border:1px solid var(--line);border-radius:12px;background:var(--surface-muted);color:var(--ink)!important}.connection-check-field input,.permission-toggle input,.delegate-agent-card input{appearance:none;width:38px!important;height:22px!important;flex:0 0 38px;margin:0!important;border:1px solid #cbd5e1;border-radius:999px;background:#e5e7eb;position:relative;cursor:pointer;transition:.2s}.connection-check-field input:before,.permission-toggle input:before,.delegate-agent-card input:before{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0f172a33;transition:.2s}.connection-check-field input:checked,.permission-toggle input:checked,.delegate-agent-card input:checked{border-color:var(--orange);background:var(--orange)}.connection-check-field input:checked:before,.permission-toggle input:checked:before,.delegate-agent-card input:checked:before{transform:translateX(16px)}.connection-permissions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:9px!important;padding:14px!important}.permission-toggle{display:flex!important;align-items:center!important;gap:9px!important;min-height:42px;padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface-muted);color:var(--ink)!important}.connection-advanced{padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface-muted)}.connection-advanced summary{cursor:pointer;color:var(--muted);font-size:11px;font-weight:800}.connection-advanced textarea{margin-top:10px;background:var(--surface)}.tool-connection-actions{padding-top:4px}.tool-connection-actions output{min-height:18px;color:var(--muted);font-size:11px}.delegate-connection-form{grid-template-columns:repeat(2,minmax(0,1fr))!important}.delegate-agent-list{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:340px;padding:2px;overflow:auto}.delegate-agent-card{display:grid!important;grid-template-columns:auto 42px minmax(0,1fr) 24px;align-items:center!important;gap:11px!important;min-width:0;padding:13px!important;border:1px solid var(--line)!important;border-radius:13px!important;background:var(--surface-muted)!important;cursor:pointer}.delegate-agent-card:has(input:checked){border-color:var(--orange)!important;background:color-mix(in srgb,var(--orange) 7%,var(--surface))!important}.delegate-agent-avatar{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:12px;background:#e8f1ff;color:#2f6fb4;font-weight:900}.delegate-agent-copy{min-width:0}.delegate-agent-copy strong,.delegate-agent-copy small{display:block}.delegate-agent-copy small{margin-top:4px;color:var(--muted);font-size:10px}.delegate-agent-card>i{color:transparent;font-style:normal;font-weight:900}.delegate-agent-card:has(input:checked)>i{color:var(--orange)}@container (max-width:760px){.connection-dynamic-fields,.delegate-agent-list{grid-template-columns:1fr}.connection-permissions{grid-template-columns:repeat(2,minmax(0,1fr))!important}}@media(max-width:680px){.tool-connection-shell{padding:20px!important}.dynamic-connection-form,.delegate-connection-form,.connection-dynamic-fields,.delegate-agent-list{grid-template-columns:1fr!important}.connection-permissions{grid-template-columns:1fr!important}.tool-connection-actions{flex-wrap:wrap}.tool-connection-actions output{width:100%}}
.tool-connection-head [data-tool-dialog-close]:focus{outline:0;box-shadow:0 0 0 4px color-mix(in srgb,var(--orange) 12%,transparent)}
.agent-avatar-editor{display:grid;grid-template-columns:88px minmax(0,1fr);align-items:center;gap:16px;min-width:0}.agent-avatar-editor>div:last-child{min-width:0}.agent-avatar-editor small{overflow-wrap:anywhere}.agent-avatar-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.agent-avatar-actions .button,.agent-avatar-actions label{box-sizing:border-box;min-height:36px;white-space:nowrap;line-height:1.2}.agent-avatar-actions label{justify-content:center}.catalog-readonly-panel{display:grid;gap:16px;min-width:0}.catalog-readonly-banner{display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:12px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface-muted)}.catalog-readonly-icon{display:grid;place-items:center;width:52px;height:52px;border-radius:14px;background:linear-gradient(135deg,#f2a65a,#e8753d);color:#fff;font-size:20px;font-weight:850}.catalog-readonly-banner h3{margin:0;font-size:16px}.catalog-readonly-banner p,.catalog-readonly-banner small{display:block;margin:4px 0 0;color:var(--muted);line-height:1.55;overflow-wrap:anywhere}.catalog-readonly-badge{padding:5px 9px;border-radius:999px;background:#e8f7ef;color:#16764b;font-size:10px;font-weight:800;white-space:nowrap}.catalog-readonly-section{display:grid;gap:12px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}.catalog-readonly-section h4{margin:0;font-size:13px}.catalog-readonly-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.catalog-readonly-grid span{display:grid;gap:4px;min-width:0;padding:11px;border-radius:10px;background:var(--surface-muted);color:var(--muted);font-size:10px}.catalog-readonly-grid b{color:var(--ink);font-size:12px;overflow-wrap:anywhere}.catalog-readonly-copy,.catalog-runtime-note{margin:0;color:var(--muted);font-size:11px;line-height:1.65;overflow-wrap:anywhere}.catalog-runtime-note{padding:10px 12px;border-left:3px solid var(--orange);background:color-mix(in srgb,var(--orange) 7%,var(--surface-muted))}.catalog-resource-group{display:grid;gap:7px}.catalog-resource-group>strong{font-size:11px}.catalog-resource-chips{display:flex;flex-wrap:wrap;gap:7px;min-width:0}.catalog-resource-chip{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:7px 9px;border:1px solid var(--line);border-radius:9px;background:var(--surface-muted);color:var(--ink);font-size:10px;overflow-wrap:anywhere}.catalog-resource-chip b{color:var(--orange);font-size:9px;white-space:nowrap}@media(max-width:520px){.agent-avatar-editor{grid-template-columns:1fr}.agent-avatar-preview{width:76px;height:76px;flex-basis:76px}.catalog-readonly-banner{grid-template-columns:44px minmax(0,1fr)}.catalog-readonly-icon{width:44px;height:44px}.catalog-readonly-badge{grid-column:2;justify-self:start}.catalog-readonly-grid{grid-template-columns:1fr}}
.agent-avatar-actions>label.button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:36px;padding:9px 14px;border:1px solid transparent;border-radius:10px;color:var(--muted);background:var(--surface-muted);font:inherit;font-size:12px;font-weight:800;line-height:1.2;text-decoration:none;white-space:nowrap;cursor:pointer;box-shadow:none;transition:transform .2s ease,border-color .2s ease,color .2s ease,background .2s ease}.agent-avatar-actions>label.button:hover{border-color:color-mix(in srgb,var(--orange) 45%,var(--line));color:var(--ink);background:var(--surface);transform:translateY(-1px)}.agent-avatar-actions>label.button:focus-within{outline:3px solid color-mix(in srgb,var(--ice) 80%,transparent);outline-offset:3px}
.create-avatar-required{display:grid;gap:5px;padding:12px 14px;border:1px solid color-mix(in srgb,var(--orange) 28%,var(--line));border-radius:12px;background:color-mix(in srgb,var(--orange) 7%,var(--surface-muted));color:var(--muted);font-size:11px;line-height:1.5}.create-avatar-required strong{color:var(--ink);font-size:12px}.create-avatar-required span{overflow-wrap:anywhere}
.tool-connection-head [data-tool-dialog-close]{box-sizing:border-box!important;min-width:64px!important;width:auto!important;min-height:36px!important;height:36px!important;padding:0 16px!important;outline:0!important;box-shadow:none!important}.tool-connection-head [data-tool-dialog-close]:focus,.tool-connection-head [data-tool-dialog-close]:focus-visible{outline:0!important;box-shadow:none!important;border-color:var(--orange)!important}
.tool-connection-form .connection-check-field>input[type="checkbox"],.tool-connection-form .permission-toggle>input[type="checkbox"],.tool-connection-form .delegate-agent-card>input[type="checkbox"]{box-sizing:border-box!important;width:38px!important;min-width:38px!important;max-width:38px!important;height:22px!important;min-height:22px!important;max-height:22px!important;padding:0!important;flex:0 0 38px!important;line-height:1!important}
.composer-hint{max-width:100%;line-height:1.55;white-space:normal;overflow-wrap:anywhere;word-break:break-word}.composer-tools{align-items:flex-start;flex-wrap:wrap}.composer-cost{white-space:nowrap}.chat-bubble{max-width:100%;overflow-wrap:anywhere;word-break:break-word}.chat-message{min-width:0;max-width:min(88%,760px)}
.version-load-state{display:grid;gap:8px;min-height:150px;align-content:center;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--surface-muted)}.version-load-state strong{color:var(--ink);font-size:14px}.version-load-state span{color:var(--muted);font-size:11px;line-height:1.6}.version-load-state .button{justify-self:start}
.agent-usage-editor{display:grid;gap:14px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface-muted)}.agent-usage-editor-head{display:flex;align-items:center;justify-content:space-between;gap:14px}.agent-usage-editor-head strong,.agent-usage-editor-head small{display:block}.agent-usage-editor-head small{margin-top:4px;color:var(--muted);font-size:10px;line-height:1.5}.agent-usage-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.agent-usage-dialog{width:min(760px,calc(100vw - 32px));max-height:calc(100vh - 36px);padding:0;border:0;border-radius:18px;background:var(--surface);color:var(--ink);box-shadow:0 24px 80px #0f172a55}.agent-usage-dialog::backdrop{background:#0f172a88;backdrop-filter:blur(4px)}.agent-usage-dialog-card{display:grid;gap:18px;max-height:calc(100vh - 36px);padding:24px;overflow:auto}.agent-usage-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.agent-usage-dialog-head h3{margin:4px 0 0}.agent-usage-summary,.catalog-usage-summary{margin:0;color:var(--muted);line-height:1.65}.agent-usage-markdown,.catalog-usage-copy{line-height:1.8;overflow-wrap:anywhere}.agent-usage-dialog-card section,.catalog-usage-list{display:grid;gap:7px}.agent-usage-dialog-card section span,.catalog-usage-list span{width:max-content;max-width:100%;padding:7px 9px;border:1px solid var(--line);border-radius:9px;background:var(--surface-muted);font-size:11px}.catalog-personal-connections{display:grid;gap:9px;margin-top:4px;padding-top:14px;border-top:1px solid var(--line)}.catalog-personal-connections-head strong,.catalog-personal-connections-head small{display:block}.catalog-personal-connections-head small{margin-top:4px;color:var(--muted);font-size:10px;line-height:1.5}.catalog-personal-connection{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface-muted)}.catalog-personal-connection span{display:grid;gap:3px;min-width:0}.catalog-personal-connection small{color:var(--muted);font-size:10px}@media(max-width:680px){.agent-usage-grid{grid-template-columns:1fr}.agent-usage-editor-head{align-items:flex-start;flex-direction:column}.catalog-personal-connection{grid-template-columns:1fr}.catalog-personal-connection .button{justify-self:start}}
.consumer-app-actions{display:none;align-items:center;gap:7px}.agent-workbench[data-access-mode="consumer"] .agent-secondary-nav,.agent-workbench[data-access-mode="consumer"] .agent-inspector,.agent-workbench[data-access-mode="consumer"] .agent-view-switch{display:none!important}.agent-workbench[data-access-mode="consumer"] .consumer-app-actions{display:flex}.agent-workbench[data-access-mode="consumer"] .agent-workbench-head{align-items:flex-start}.agent-workbench[data-access-mode="consumer"] .agent-workbench-grid{grid-template-columns:minmax(220px,270px) minmax(0,1fr)!important}.agent-workbench[data-access-mode="consumer"] .agent-chat{grid-column:auto!important}.agent-workbench[data-access-mode="consumer"] .chat-messages{padding-right:clamp(24px,5vw,80px);padding-left:clamp(24px,5vw,80px)}.consumer-app-dialog{width:min(820px,calc(100vw - 32px));max-height:calc(100vh - 36px);padding:0;border:0;border-radius:18px;background:var(--surface);color:var(--ink);box-shadow:0 24px 80px #0f172a55}.consumer-app-dialog::backdrop{background:#0f172a88;backdrop-filter:blur(5px)}.consumer-app-shell{display:grid;grid-template-rows:auto auto minmax(0,1fr);max-height:calc(100vh - 36px)}.consumer-app-shell>header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:23px 26px 16px;border-bottom:1px solid var(--line)}.consumer-app-shell>header h2{margin:4px 0}.consumer-app-shell>header small{color:var(--muted)}.consumer-app-shell>nav{display:flex;gap:4px;padding:0 26px;border-bottom:1px solid var(--line);overflow:auto}.consumer-app-shell>nav button{padding:12px 14px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font:inherit;font-size:11px;font-weight:800;white-space:nowrap;cursor:pointer}.consumer-app-shell>nav button.active{border-bottom-color:var(--orange);color:var(--ink)}.consumer-app-shell>main{min-height:0;overflow:auto}.consumer-app-section{display:grid;gap:18px;padding:24px 26px 30px}.consumer-app-summary{margin:0;color:var(--muted);font-size:13px;line-height:1.7}.consumer-app-guide{line-height:1.8;overflow-wrap:anywhere}.consumer-app-list,.consumer-resource-group{display:grid;gap:8px}.consumer-app-list>strong,.consumer-resource-group>strong{font-size:12px}.consumer-app-list span,.consumer-app-list button,.consumer-resource-group>span{box-sizing:border-box;width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-muted);color:var(--ink);text-align:left}.consumer-app-list button{font:inherit;font-size:11px;cursor:pointer}.consumer-resource-group>span{display:grid;gap:4px}.consumer-resource-group small{color:var(--muted);font-size:10px;line-height:1.5}.consumer-connection-intro strong,.consumer-connection-intro p{display:block}.consumer-connection-intro p{margin:5px 0 0;color:var(--muted);font-size:11px;line-height:1.6}.consumer-connection-list{display:grid;gap:9px}.consumer-connection-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:13px;border:1px solid var(--line);border-radius:11px;background:var(--surface-muted)}.consumer-connection-row>span{display:grid;gap:4px;min-width:0}.consumer-connection-row small{color:var(--muted);font-size:10px;line-height:1.45}.consumer-connection-row em{color:var(--muted);font-size:10px;font-style:normal;white-space:nowrap}.consumer-connection-row em.ok{color:#15803d;font-weight:800}.consumer-connection-empty{padding:30px 16px;border:1px dashed var(--line);border-radius:12px;color:var(--muted);text-align:center}@media(max-width:780px){.agent-workbench[data-access-mode="consumer"] .agent-workbench-grid{grid-template-columns:1fr!important}.consumer-app-actions .button{padding:7px 9px;font-size:10px}.consumer-connection-row{grid-template-columns:1fr auto}.consumer-connection-row .button{grid-column:1/-1;justify-self:start}}@media(max-width:520px){.consumer-app-actions{width:100%;order:3}.consumer-app-actions .button{flex:1}.chat-head-actions{flex-wrap:wrap}.consumer-app-shell>header,.consumer-app-section{padding-left:18px;padding-right:18px}.consumer-app-shell>nav{padding:0 18px}}
.consumer-app-actions [hidden]{display:none!important}.consumer-connection-row.is-requirement{grid-template-columns:minmax(0,1fr) auto}.consumer-app-shell .icon-button{width:34px;height:34px;min-width:34px;padding:0;border-radius:8px;font-size:20px;line-height:1}.consumer-app-summary,.consumer-app-guide,.consumer-resource-group span,.consumer-connection-row span{min-width:0;overflow-wrap:anywhere;word-break:break-word}body.modal-open{overflow:hidden}

.agent-list-group{display:grid;gap:3px;padding:0 0 9px}.agent-list-group+.agent-list-group{padding-top:9px;border-top:1px solid var(--line)}.agent-list-group-head{display:flex;align-items:center;justify-content:space-between;padding:5px 10px;color:var(--muted)}.agent-list-group-head strong{font-size:10px}.agent-list-group-head span{font-size:9px}.agent-list-group-empty{margin:0;padding:8px 10px;color:var(--muted);font-size:10px}.agent-list-empty.compact{display:grid;gap:10px;padding:14px 10px;text-align:left}.agent-list-empty.compact .button{justify-self:start}.agent-access-dot{width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:#94a3b8}.agent-access-dot.is-owner,.agent-access-dot.is-subscribed,.agent-access-dot.is-trial{background:#16a34a}.agent-access-dot.is-expired,.agent-access-dot.is-trial-expired{background:#e65f2b}.agent-access-dot.is-runtime-disabled,.agent-access-dot.is-unavailable{background:#dc2626}.agent-entitlement{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:16px;padding:13px 18px;border-top:1px solid var(--line);background:#f7fbff}.agent-entitlement[hidden]{display:none}.agent-entitlement-copy{min-width:0}.agent-entitlement-copy strong{font-size:12px}.agent-entitlement-copy p{margin:4px 0 0;color:var(--muted);font-size:10px;line-height:1.5}.agent-entitlement-meta{display:flex;gap:16px}.agent-entitlement-meta span{display:grid;gap:3px;color:var(--ink);font-size:10px;white-space:nowrap}.agent-entitlement-meta b{color:var(--muted);font-size:9px}.agent-entitlement-actions{display:flex;gap:7px;white-space:nowrap}.agent-entitlement.is-expired,.agent-entitlement.is-subscription-required,.agent-entitlement.is-trial-expired{background:#fff8f3}.agent-entitlement.is-runtime-disabled,.agent-entitlement.is-unavailable{background:#fff5f5}.consumer-access-summary{padding-bottom:18px;border-bottom:1px solid var(--line)}.consumer-access-summary h3{margin:13px 0 6px}.consumer-access-summary p{margin:0;color:var(--muted);line-height:1.65}.agent-access-badge{display:inline-flex;padding:5px 9px;border-radius:999px;background:#eef2f7;color:var(--muted);font-size:10px;font-weight:800}.agent-access-badge.is-subscribed,.agent-access-badge.is-owner,.agent-access-badge.is-trial{background:#eaf8ef;color:#15803d}.agent-access-badge.is-expired,.agent-access-badge.is-trial-expired{background:#fff0e8;color:#c2410c}.consumer-access-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.consumer-access-grid span{display:grid;gap:5px;padding:13px;border:1px solid var(--line);border-radius:10px;background:var(--surface-muted);font-size:12px}.consumer-access-grid b{color:var(--muted);font-size:10px}.consumer-access-actions{display:flex;justify-content:flex-end;gap:8px}@media(max-width:900px){.agent-entitlement{grid-template-columns:1fr}.agent-entitlement-meta{flex-wrap:wrap}.agent-entitlement-actions{justify-content:flex-start}}@media(max-width:520px){.consumer-access-grid{grid-template-columns:1fr}.agent-entitlement-meta{display:grid;grid-template-columns:1fr 1fr}.agent-entitlement-actions{flex-wrap:wrap}}

/* Keep runtime limits in a predictable reading order at every inspector width. */
.capability-runtime-budget{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-areas:"head head" "calls concurrency" "note note";align-items:start!important;gap:12px 14px!important;padding:16px!important}.capability-runtime-head{grid-area:head;align-self:start!important;padding-bottom:2px}.capability-runtime-budget>label:nth-of-type(1){grid-area:calls}.capability-runtime-budget>label:nth-of-type(2){grid-area:concurrency}.capability-runtime-budget>label{display:grid!important;grid-template-columns:1fr!important;align-content:start;gap:7px!important;min-width:0}.capability-runtime-budget>label>input{box-sizing:border-box;width:100%!important;min-width:0;min-height:44px}.capability-runtime-budget>label>small{grid-column:auto!important}.capability-runtime-budget>p{grid-area:note!important;margin:0!important;padding-top:2px;border-top:1px solid color-mix(in srgb,var(--line) 72%,transparent);padding-top:10px!important}@container (max-width:520px){.capability-runtime-budget{grid-template-columns:1fr!important;grid-template-areas:"head" "calls" "concurrency" "note"!important}}

/* Keep all eight inspector sections aligned as two balanced rows. */
.agent-inspector .inspector-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;overflow:visible}
.agent-inspector .inspector-tabs button,.agent-inspector .inspector-tabs button[data-inspector-tab="publish"]{box-sizing:border-box;min-width:0;width:100%;padding:9px 5px;white-space:nowrap;grid-column:auto;line-height:1.2}

.consumer-model-field{display:grid;gap:8px;max-width:620px}
.consumer-model-field>span{font-size:12px;font-weight:800;color:var(--ink)}
.consumer-model-field select{width:100%;min-height:42px;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-muted);color:var(--ink);font:inherit;font-size:12px;outline:none}
.consumer-model-field select:focus{border-color:var(--orange);box-shadow:0 0 0 3px color-mix(in srgb,var(--orange) 18%,transparent)}
.consumer-model-note{color:var(--muted);font-size:11px;line-height:1.6;min-height:18px}
.consumer-model-actions{display:flex;align-items:center;flex-wrap:wrap;gap:9px}
.consumer-model-actions output{color:#15803d;font-size:11px;line-height:1.5}
@media(max-width:520px){.consumer-model-actions{align-items:stretch}.consumer-model-actions .button{flex:1;min-width:0}.consumer-model-actions output{width:100%}}

/* Long-label layout: keep the studio readable in English, Japanese and narrow panes. */
.agent-workbench,
.agent-workbench *{box-sizing:border-box}
.agent-workbench .agent-workbench-head,
.agent-workbench .agent-workbench-title,
.agent-workbench .agent-head-actions,
.agent-workbench .chat-head,
.agent-workbench .chat-agent-identity,
.agent-workbench .chat-head-actions,
.agent-workbench .inspector-head{min-width:0}
.agent-workbench .agent-workbench-title{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:14px}
.agent-workbench .agent-workbench-title>div{min-width:0}
.agent-workbench .agent-secondary-nav{justify-self:start;flex:none;min-width:0;width:max-content;max-width:100%;display:flex;flex-wrap:wrap;align-items:stretch;gap:4px;padding:4px;overflow:visible}
.agent-workbench .agent-secondary-nav a{flex:1 1 110px;min-width:0;display:flex;align-items:center;justify-content:center;text-align:center;white-space:normal;overflow-wrap:anywhere;word-break:break-word;line-height:1.3;padding:8px 10px}
.agent-workbench .agent-list-copy strong{display:-webkit-box;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:normal;overflow-wrap:anywhere;word-break:break-word;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:1.35;min-height:2.7em}
.agent-workbench .agent-list-copy small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.agent-workbench .chat-agent-identity>div:last-child{min-width:0}
.agent-workbench .chat-agent-identity strong,
.agent-workbench .chat-agent-identity small{max-width:100%;overflow-wrap:anywhere;word-break:break-word}
.agent-workbench .chat-head-actions{flex:0 1 auto;justify-content:flex-end;flex-wrap:wrap;max-width:48%}
.agent-workbench .chat-head-actions>*{min-width:0;max-width:100%}
.agent-workbench .run-status-pill{white-space:normal;text-align:center;line-height:1.25}
.agent-workbench .chat-messages{justify-content:flex-start;align-items:stretch;overflow-x:hidden;overflow-y:auto}
.agent-workbench .chat-message{flex:0 0 auto;min-height:0}
.agent-workbench .chat-bubble{height:auto;min-height:0}
.agent-workbench .inspector-head>div{min-width:0}
.agent-workbench .inspector-head h2{overflow-wrap:anywhere;word-break:break-word}
.agent-workbench .inspector-tabs{display:grid;grid-template-columns:repeat(auto-fit,minmax(86px,1fr));gap:5px;min-width:0;overflow:visible}
.agent-workbench .inspector-tabs button,
.agent-workbench .inspector-tabs button[data-inspector-tab="publish"]{min-width:0;width:100%;display:flex;align-items:center;justify-content:center;text-align:center;white-space:normal;overflow-wrap:anywhere;word-break:break-word;line-height:1.25;padding:9px 7px}
.agent-workbench .inspector-body,
.agent-workbench .inspector-form,
.agent-workbench .inspector-form label,
.agent-workbench .inspector-form label>*{min-width:0;max-width:100%}
.agent-workbench .inspector-form label{line-height:1.35}
.agent-workbench .button,
.agent-workbench button,
.agent-workbench input,
.agent-workbench select,
.agent-workbench textarea{max-width:100%}
.agent-workbench .button,
.agent-workbench button{overflow-wrap:anywhere;word-break:break-word;line-height:1.25}

@media(max-width:1180px){
  .agent-workbench .agent-workbench-head{align-items:flex-start;flex-wrap:wrap}
  .agent-workbench .agent-workbench-title{flex:1 1 100%}
  .agent-workbench .agent-secondary-nav{flex-basis:100%;width:100%}
  .agent-workbench .agent-head-actions{width:100%;justify-content:flex-start}
}

/* Absolute last override: derive workspace size from the live parent flex
   layout so title/navigation height and browser viewport are both respected. */
@media (min-width:961px){
  body.agent-studio-shell .center-layout{height:calc(100dvh - 76px)!important;min-height:0!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-workbench{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-workbench .agent-workbench-head{flex:0 0 auto!important}
  body.agent-studio-shell .center-main.agent-workbench .agent-workbench-grid,
  body.agent-studio-shell .center-main.agent-workbench.skill-workspace .skill-layout,
  body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace .knowledge-layout{flex:1 1 auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-resource-page{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-resource-page .agent-workbench-head{flex:0 0 auto!important}
  body.agent-studio-shell .center-main.agent-resource-page .resource-full-panel{flex:1 1 auto!important;height:auto!important;min-height:0!important;margin-top:14px!important;overflow-y:auto!important;overflow-x:hidden!important}
  body.agent-studio-shell .side-nav{position:relative!important;top:auto!important;height:100%!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important}
}


/* Never leave a blank inspector while employee details are loading. */
.agent-inspector [data-inspector-body]:empty::before{
  content:'选择员工后查看配置。';
  display:block;
  color:var(--muted);
  font-size:12px;
}
@media(max-width:900px){
  .agent-workbench .agent-workbench-title{display:block}
  .agent-workbench .agent-secondary-nav{margin-top:12px}
  .agent-workbench .chat-head{align-items:flex-start;flex-wrap:wrap}
  .agent-workbench .chat-agent-identity{flex:1 1 220px}
  .agent-workbench .chat-head-actions{flex:1 1 100%;justify-content:flex-start;max-width:none}
}
@media(max-width:560px){
  .agent-workbench .agent-secondary-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .agent-workbench .agent-secondary-nav a{flex:auto;min-height:38px;padding:7px 8px}
  .agent-workbench .inspector-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .agent-workbench .inspector-tabs button{min-height:38px}
  .agent-workbench .agent-list-copy strong{min-height:0}
}
@media(max-width:380px){
  .agent-workbench .agent-secondary-nav{grid-template-columns:1fr}
  .agent-workbench .inspector-tabs{grid-template-columns:1fr 1fr}
}

/* Keep the mode switch on the same baseline as the secondary navigation.
   The primary actions remain in the heading row, leaving the lower-right
   area visually aligned with the studio tabs. */
@media (min-width:1181px){
  .agent-workbench .agent-workbench-head{position:relative}
  .agent-workbench .agent-head-actions{position:static}
  .agent-workbench .agent-view-switch{position:absolute;right:0;bottom:0}
}
@media (max-width:1180px){
  .agent-workbench .agent-view-switch{position:static}
}

/* English and Japanese need slightly denser controls, while labels still wrap safely. */
html[data-lang="en"] .agent-workbench,
html[lang="en"] .agent-workbench,
html[data-lang="ja"] .agent-workbench,
html[lang="ja"] .agent-workbench{letter-spacing:0}
html[data-lang="en"] .agent-workbench .agent-secondary-nav a,
html[lang="en"] .agent-workbench .agent-secondary-nav a,
html[data-lang="ja"] .agent-workbench .agent-secondary-nav a,
html[lang="ja"] .agent-workbench .agent-secondary-nav a{font-size:10px;padding-inline:8px}
html[data-lang="en"] .agent-workbench .inspector-tabs button,
html[lang="en"] .agent-workbench .inspector-tabs button,
html[data-lang="ja"] .agent-workbench .inspector-tabs button,
html[lang="ja"] .agent-workbench .inspector-tabs button{font-size:10px;padding-inline:6px}
html[data-lang="en"] .agent-workbench .agent-list-copy strong,
html[lang="en"] .agent-workbench .agent-list-copy strong,
html[data-lang="ja"] .agent-workbench .agent-list-copy strong,
html[lang="ja"] .agent-workbench .agent-list-copy strong{font-size:11px}

/* Canonical employee studio shell. Keep one bounded height chain and make
   the content area inside each panel the only vertical scroll owner. */
@media (min-width:961px){
  html:has(body.agent-studio-shell),
  body.agent-studio-shell{
    height:100%;
    overflow:hidden!important;
  }
  body.agent-studio-shell > header.nav{
    box-sizing:border-box;
    height:76px;
    min-height:76px;
  }
  body.agent-studio-shell .center-layout{
    height:calc(100dvh - 76px)!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .side-nav{
    min-height:0;
    height:100%;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
  }
  body.agent-studio-shell .center-main.agent-workbench{
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    gap:14px!important;
    box-sizing:border-box;
    height:100%!important;
    min-height:0!important;
    padding:18px clamp(20px,2vw,36px) 22px!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .agent-workbench-head{
    min-height:0;
    margin:0!important;
  }
  body.agent-studio-shell .agent-workbench-grid{
    display:grid!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    align-items:stretch!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell :is(.agent-rail,.agent-chat,.agent-inspector){
    box-sizing:border-box;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
  }
  body.agent-studio-shell :is(.agent-rail,.agent-chat,.agent-inspector){
    flex-direction:column!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell :is(.agent-rail,.agent-chat){
    display:flex!important;
  }
  body.agent-studio-shell .agent-inspector{
    display:flex!important;
  }
  body.agent-studio-shell :is(.agent-rail-head,.chat-head,.inspector-head,.chat-composer,.inspector-tabs){
    flex:0 0 auto!important;
  }
  body.agent-studio-shell :is(.agent-list,.chat-messages,.inspector-body){
    flex:1 1 0!important;
    min-height:0!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="chat"] .agent-workbench-grid{
    grid-template-columns:minmax(210px,250px) minmax(0,1fr)!important;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="chat"] .agent-inspector{
    display:none!important;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-workbench-grid{
    grid-template-columns:minmax(210px,250px) minmax(0,1fr)!important;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-chat{
    display:none!important;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-inspector{
    display:flex!important;
    grid-column:auto!important;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .inspector-body{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:24px clamp(24px,3vw,48px) 48px!important;
  }
}

/* Final geometry override: this block intentionally lives at the end so
   legacy layout rules above cannot reintroduce viewport-sized gaps. */
@media (min-width:961px){
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page){
    display:grid!important;
    grid-template-rows:max-content minmax(0,1fr)!important;
    align-content:stretch!important;
    gap:14px!important;
    height:100%!important;
    min-height:0!important;
    padding:28px clamp(20px,2vw,36px) 8px!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .agent-workbench-head{
    margin:0!important;
    min-height:0!important;
  }
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .agent-workbench-grid{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    align-self:stretch!important;
  }
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) :is(.agent-rail,.agent-chat,.agent-inspector){
    height:100%!important;
    min-height:0!important;
  }
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .agent-chat{
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .chat-messages{
    flex:1 1 0!important;
    min-height:0!important;
    height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
  }

  body.agent-studio-shell .center-main.agent-workbench.skill-workspace,
  body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace{
    display:grid!important;
    grid-template-rows:max-content minmax(0,1fr)!important;
    align-content:stretch!important;
    gap:14px!important;
    height:100%!important;
    min-height:0!important;
    padding:28px clamp(20px,2vw,36px) 8px!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .center-main.agent-workbench:is(.skill-workspace,.knowledge-workspace) .agent-workbench-head{
    margin:0!important;
    min-height:0!important;
  }
  body.agent-studio-shell .center-main.agent-workbench:is(.skill-workspace,.knowledge-workspace) :is(.skill-layout,.knowledge-layout){
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    overflow:hidden!important;
    align-self:stretch!important;
  }
  body.agent-studio-shell .center-main.agent-workbench.skill-workspace :is(.skill-list-panel,.skill-editor-panel,.skill-preview-panel),
  body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace .kb-panel{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .center-main.agent-workbench.skill-workspace :is(.skill-list,.skill-form,.markdown-preview),
  body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace :is(.kb-list,.doc-list,.kb-import-panel){
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable;
  }

  body.agent-studio-shell .center-main.agent-resource-page{
    display:block!important;
    height:100%!important;
    min-height:0!important;
    padding:28px clamp(20px,2vw,36px) 24px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  body.agent-studio-shell .center-main.agent-resource-page .agent-workbench-head{
    margin:0!important;
    min-height:0!important;
  }
  body.agent-studio-shell .center-main.agent-resource-page .resource-full-panel{
    height:auto!important;
    min-height:0!important;
    margin:14px 0 0!important;
    overflow:visible!important;
  }
}

/* Final studio geometry contract. Keep one consistent gap after the
   secondary navigation and avoid viewport-sized empty panels on sparse pages. */
@media (min-width:961px){
  body.agent-studio-shell .center-main.agent-workbench{
    box-sizing:border-box!important;
    gap:14px!important;
    padding-top:28px!important;
    padding-bottom:8px!important;
  }
  body.agent-studio-shell .agent-workbench-head{
    margin-bottom:0!important;
  }
  body.agent-studio-shell .agent-workbench-head + .agent-workbench-grid,
  body.agent-studio-shell .agent-workbench-head + .skill-layout,
  body.agent-studio-shell .agent-workbench-head + .knowledge-layout,
  body.agent-studio-shell .agent-workbench-head + .resource-full-panel{
    margin-top:0!important;
  }

  /* Workbench: reserve only the real space below the header. */
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .agent-workbench-grid{
    height:auto!important;
    min-height:calc(100dvh - 300px)!important;
    max-height:calc(100dvh - 150px)!important;
    align-self:stretch!important;
  }
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) :is(.agent-rail,.agent-chat,.agent-inspector){
    height:100%!important;
    min-height:0!important;
  }

  /* Persona templates: the panel starts one standard gap below navigation. */
  body.agent-studio-shell .center-main.agent-resource-page .resource-full-panel{
    margin-top:14px!important;
  }

  /* Skill editor and knowledge hub share the same 14px header-to-content gap. */
  body.agent-studio-shell .center-main.skill-workspace,
  body.agent-studio-shell .center-main.knowledge-workspace{
    gap:14px!important;
  }
  body.agent-studio-shell .center-main.skill-workspace .skill-layout,
  body.agent-studio-shell .center-main.knowledge-workspace .knowledge-layout{
    min-height:0!important;
    margin-top:0!important;
  }
  body.agent-studio-shell .center-main.knowledge-workspace .knowledge-layout{
    height:auto!important;
  }
  body.agent-studio-shell .center-main.knowledge-workspace .kb-panel{
    min-height:420px!important;
    height:auto!important;
  }
}

@media (min-width:1181px){
  body.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-workbench-grid{
    grid-template-columns:minmax(200px,240px) minmax(0,1fr) minmax(300px,360px)!important;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-inspector{
    display:flex!important;
    grid-column:auto!important;
  }
}

@media (min-width:961px) and (max-width:1180px){
  body.agent-studio-shell .center-layout{
    grid-template-columns:180px minmax(0,1fr)!important;
  }
  body.agent-studio-shell .center-main.agent-workbench{
    padding-right:12px!important;
    padding-left:12px!important;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-workbench-grid{
    grid-template-columns:150px minmax(0,1fr) minmax(280px,320px)!important;
    grid-template-rows:minmax(0,1fr)!important;
    gap:8px!important;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-rail{
    grid-column:1;
    grid-row:1;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-chat{
    grid-column:2;
    grid-row:1;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-inspector{
    display:flex!important;
    grid-column:3!important;
    grid-row:1;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="chat"] .agent-workbench-grid,
  body.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-workbench-grid{
    grid-template-columns:170px minmax(0,1fr)!important;
    gap:10px!important;
  }
}

@media (max-width:960px){
  html:has(body.agent-studio-shell),
  body.agent-studio-shell{
    height:auto;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }
  body.agent-studio-shell .center-layout,
  body.agent-studio-shell .center-main.agent-workbench,
  body.agent-studio-shell .agent-workbench-grid{
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
  body.agent-studio-shell .center-layout{
    display:block!important;
  }
  body.agent-studio-shell .side-nav{
    position:sticky;
    top:68px;
    z-index:20;
    display:flex;
    flex-direction:row;
    gap:5px;
    padding:10px 14px;
    border-right:0;
    border-bottom:1px solid var(--line);
    overflow-x:auto;
    overflow-y:hidden;
  }
  body.agent-studio-shell .side-nav-label{
    display:none;
  }
  body.agent-studio-shell .side-nav a{
    flex:0 0 auto;
    white-space:nowrap;
  }
  body.agent-studio-shell .center-main.agent-workbench{
    display:block!important;
    padding:24px 16px 56px!important;
  }
  body.agent-studio-shell .agent-workbench-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:14px;
    margin-top:18px!important;
  }
  body.agent-studio-shell :is(.agent-rail,.agent-chat,.agent-inspector){
    box-sizing:border-box;
    width:100%;
    min-height:0!important;
    max-height:min(72dvh,720px);
  }
  body.agent-studio-shell :is(.agent-list,.chat-messages,.inspector-body){
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }
  body.agent-studio-shell .agent-workbench[data-workspace-view="chat"] .agent-inspector,
  body.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-chat{
    display:none!important;
  }
}

/* Give the studio body a real reading height. The header may wrap on large
   displays, so calculating the grid as the leftover viewport made all three
   panels unnecessarily short. */
@media (min-width:961px){
  html:has(body.agent-studio-shell),
  body.agent-studio-shell{
    height:auto!important;
    min-height:100%!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }
  body.agent-studio-shell .center-layout{
    height:auto!important;
    min-height:calc(100dvh - 76px)!important;
    align-items:stretch!important;
    overflow:visible!important;
  }
  body.agent-studio-shell .center-main.agent-workbench{
    height:auto!important;
    min-height:calc(100dvh - 76px)!important;
    grid-template-rows:auto minmax(760px,auto)!important;
    overflow:visible!important;
  }
  body.agent-studio-shell .agent-workbench-grid{
    height:auto!important;
    min-height:clamp(760px,calc(100dvh - 100px),1180px)!important;
    overflow:visible!important;
  }
  body.agent-studio-shell :is(.agent-rail,.agent-chat,.agent-inspector){
    height:100%!important;
    min-height:inherit!important;
    overscroll-behavior-y:auto!important;
  }
  body.agent-studio-shell :is(.agent-list,.chat-messages,.inspector-body){
    overscroll-behavior-y:auto!important;
  }
  body.agent-studio-shell .side-nav{
    position:relative!important;
    top:auto!important;
    align-self:stretch!important;
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    overflow:visible!important;
  }
}

/* Studio scroll contract: each panel has one predictable scroll owner. */
body.agent-studio-shell .agent-rail,
body.agent-studio-shell .agent-chat,
body.agent-studio-shell .agent-inspector{
  min-width:0!important;
  min-height:0!important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
body.agent-studio-shell .agent-list,
body.agent-studio-shell .chat-messages,
body.agent-studio-shell .inspector-body{
  scrollbar-width:thin;
  scrollbar-color:color-mix(in srgb,var(--muted) 55%,transparent) transparent;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y;
}
body.agent-studio-shell .agent-list::-webkit-scrollbar,
body.agent-studio-shell .chat-messages::-webkit-scrollbar,
body.agent-studio-shell .inspector-body::-webkit-scrollbar{width:8px;height:8px}
body.agent-studio-shell .agent-list::-webkit-scrollbar-thumb,
body.agent-studio-shell .chat-messages::-webkit-scrollbar-thumb,
body.agent-studio-shell .inspector-body::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:999px;background:color-mix(in srgb,var(--muted) 48%,transparent);background-clip:padding-box}

/* The employee rail must remain readable at every width. */
body.agent-studio-shell .agent-list{display:grid!important;grid-auto-rows:max-content!important;align-content:start!important;gap:4px!important;padding:4px 8px 16px!important}
body.agent-studio-shell .agent-list-group{display:grid!important;gap:4px!important;min-width:0!important;overflow:visible!important}
body.agent-studio-shell .agent-list-group-head{min-height:30px;padding:6px 10px!important}
body.agent-studio-shell .agent-list-item{display:grid!important;grid-template-columns:34px minmax(0,1fr) 8px!important;align-items:center!important;gap:10px!important;min-width:0!important;min-height:58px!important;width:100%!important;padding:9px 10px!important;overflow:visible!important}
body.agent-studio-shell .agent-list-item .agent-avatar{grid-column:1;grid-row:1;width:34px!important;height:34px!important}
body.agent-studio-shell .agent-list-copy{display:grid!important;grid-column:2;grid-row:1;min-width:0!important;overflow:visible!important;color:var(--ink)!important}
body.agent-studio-shell .agent-list-copy strong{display:block!important;min-width:0!important;min-height:0!important;max-width:100%!important;color:var(--ink)!important;font-size:12px!important;line-height:1.35!important;white-space:normal!important;overflow:visible!important;visibility:visible!important;opacity:1!important}
body.agent-studio-shell .agent-list-copy small{display:block!important;min-width:0!important;max-width:100%!important;margin-top:4px!important;color:var(--muted)!important;font-size:10px!important;line-height:1.3!important;white-space:normal!important;overflow:hidden!important;text-overflow:ellipsis!important}
body.agent-studio-shell .agent-list-item .agent-access-dot{grid-column:3;grid-row:1;justify-self:end}
body.agent-studio-shell .agent-list-group-empty,
body.agent-studio-shell .agent-list-empty.compact{overflow-wrap:anywhere}

/* Keep long settings forms and chat output accessible without clipping. */
body.agent-studio-shell .inspector-body{min-height:0!important;height:auto!important;overflow-x:hidden!important;overflow-y:auto!important}
body.agent-studio-shell .inspector-form{min-height:max-content!important;padding-bottom:16px}
body.agent-studio-shell .chat-messages{min-height:0!important;height:auto!important;overflow-x:hidden!important;overflow-y:auto!important}
body.agent-studio-shell .chat-message,
body.agent-studio-shell .chat-bubble,
body.agent-studio-shell .message-markdown{max-height:none!important}

@media (max-width:960px){
  body.agent-studio-shell .agent-list{max-height:none!important}
  body.agent-studio-shell .agent-list-item{min-height:60px!important}
}

/* The conversation workspace should start near the top of the content area.
   Older shared studio rules reserved a tall heading slot, which left a large
   empty band above the title on wide screens. */
@media (min-width:961px){
  body.agent-studio-shell .center-main.agent-workbench{
    padding-top:10px!important;
    gap:10px!important;
  }
  body.agent-studio-shell .agent-workbench-head{
    min-height:0!important;
    align-content:start!important;
    align-items:start!important;
  }
  body.agent-studio-shell .agent-workbench-title,
  body.agent-studio-shell .agent-workbench-title>div{
    min-height:0!important;
  }
  body.agent-studio-shell .agent-workbench-title{
    gap:10px!important;
  }
  body.agent-studio-shell .agent-workbench-title .muted{
    margin-top:4px!important;
  }
  body.agent-studio-shell .agent-workbench-head{
    display:block!important;
    position:relative!important;
  }
  body.agent-studio-shell .agent-workbench-title{
    width:100%!important;
  }
  body.agent-studio-shell .agent-workbench-title>div:first-child{
    padding-right:320px;
  }
  body.agent-studio-shell .agent-head-actions{
    position:absolute;
    top:4px;
    right:0;
  }
  body.agent-studio-shell .agent-studio-navigation{
    display:grid;
    grid-template-columns:minmax(0,600px) 204px;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    width:100%;
  }
  body.agent-studio-shell .agent-studio-navigation .agent-view-switch{
    position:static!important;
    right:auto!important;
    bottom:auto!important;
    width:204px!important;
  }
}

body.agent-studio-shell .agent-secondary-nav a{
  gap:7px!important;
}
body.agent-studio-shell .agent-secondary-nav .ui-nav-icon{
  display:inline-grid!important;
  visibility:visible!important;
  flex:0 0 17px;
  width:17px;
  height:17px;
  place-items:center;
  opacity:1!important;
}
body.agent-studio-shell .agent-secondary-nav .ui-nav-icon svg{
  display:block!important;
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

@media (max-width:1180px){
  body.agent-studio-shell .agent-workbench-title>div:first-child{padding-right:0}
  body.agent-studio-shell .agent-head-actions{position:static;margin-top:12px;justify-content:flex-start}
  body.agent-studio-shell .agent-studio-navigation{grid-template-columns:1fr;gap:10px}
  body.agent-studio-shell .agent-studio-navigation .agent-view-switch{width:100%!important;max-width:360px}
}

/* Keep the studio header compact: a little top breathing room, then the
   workspace immediately below the navigation instead of a large spacer. */
@media (min-width:961px){
  body.agent-studio-shell .center-main.agent-workbench{
    align-content:start!important;
    grid-template-rows:max-content minmax(0,1fr)!important;
    padding-top:28px!important;
  }
  body.agent-studio-shell .agent-workbench-head{
    height:auto!important;
    min-height:0!important;
    align-self:start!important;
    margin-bottom:0!important;
  }
  body.agent-studio-shell .agent-workbench-grid{
    align-self:stretch!important;
  }
}

/* The editor and knowledge pages use their own three-column workspaces, but
   they should share the same outer rhythm and bounded scrolling behavior as
   the main employee studio. */
@media (min-width:961px){
  body.agent-studio-shell .center-main.agent-workbench.skill-workspace,
  body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace{
    display:grid!important;
    grid-template-rows:max-content minmax(0,1fr)!important;
    gap:14px!important;
    height:100%!important;
    min-height:0!important;
    padding:28px clamp(20px,2vw,36px) 16px!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .skill-layout,
  body.agent-studio-shell .knowledge-layout{
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .skill-list,
  body.agent-studio-shell .skill-form,
  body.agent-studio-shell .markdown-preview,
  body.agent-studio-shell .kb-list,
  body.agent-studio-shell .doc-list,
  body.agent-studio-shell .kb-import-panel{
    min-height:0!important;
  }
  body.agent-studio-shell .skill-list,
  body.agent-studio-shell .skill-form,
  body.agent-studio-shell .markdown-preview,
  body.agent-studio-shell .kb-list,
  body.agent-studio-shell .doc-list,
  body.agent-studio-shell .kb-import-panel{
    overflow-y:auto!important;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
  }
}

@media (min-width:961px){
  body.agent-studio-shell .center-main.agent-workbench.agent-resource-page{
    display:block!important;
    height:auto!important;
    min-height:calc(100dvh - 76px)!important;
    padding:28px clamp(20px,2vw,36px) 24px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  body.agent-studio-shell .agent-resource-page .agent-workbench-head{
    height:auto!important;
    min-height:0!important;
    margin:0!important;
  }
  body.agent-studio-shell .agent-resource-page .resource-full-panel{
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    overflow:visible!important;
  }
}

/* Let wheel/touch scrolling start over any content in resource pages. */
@media (min-width:961px){
  body.agent-studio-shell .center-main.agent-workbench.skill-workspace,
  body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace{
    display:block!important;
    height:auto!important;
    min-height:calc(100dvh - 76px)!important;
    padding-bottom:24px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  body.agent-studio-shell .skill-layout,
  body.agent-studio-shell .knowledge-layout{
    height:auto!important;
    min-height:calc(100dvh - 250px)!important;
    overflow:visible!important;
  }
  body.agent-studio-shell .skill-list-panel,
  body.agent-studio-shell .skill-editor-panel,
  body.agent-studio-shell .skill-preview-panel,
  body.agent-studio-shell .kb-panel{
    height:auto!important;
    min-height:520px!important;
    max-height:none!important;
    overflow:visible!important;
  }
  body.agent-studio-shell .skill-list,
  body.agent-studio-shell .skill-form,
  body.agent-studio-shell .markdown-preview,
  body.agent-studio-shell .kb-list,
  body.agent-studio-shell .doc-list,
  body.agent-studio-shell .kb-import-panel{
    overflow:visible!important;
    max-height:none!important;
  }
}

/* The chat workspace should end near the viewport bottom instead of adding
   another full-viewport minimum height below its header. */
@media (min-width:961px){
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page){
    min-height:0!important;
  }
  body.agent-studio-shell .agent-workbench-grid{
    min-height:0!important;
  }
}

/* Chat-only scrolling: keep the page shell still while the pointer is over
   the message stream, and leave the composer visible at the bottom. */
@media (min-width:961px){
  body.agent-studio-shell .agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .agent-chat{
    display:flex!important;
    flex-direction:column!important;
    min-height:0!important;
    height:100%!important;
    overflow:hidden!important;
    overscroll-behavior:contain;
  }
  body.agent-studio-shell .agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .chat-messages{
    flex:1 1 0!important;
    min-height:0!important;
    height:0!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    touch-action:pan-y;
  }
  body.agent-studio-shell .agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .chat-composer{
    flex:0 0 auto!important;
  }
}

/* Final geometry override. Keep this block last so legacy rules above cannot
   reintroduce viewport-sized gaps or disable inner scrolling. */
@media (min-width:961px){
  /* Final responsive contract: the header sizes itself, while the workspace
     flexes into the remaining browser height. No fixed canvas height. */
  body.agent-studio-shell .center-layout{height:calc(100dvh - 76px)!important;min-height:0!important;overflow:hidden!important;align-items:stretch!important}
  body.agent-studio-shell .center-main.agent-workbench:not(.agent-resource-page){display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-workbench:not(.agent-resource-page) .agent-workbench-head{flex:0 0 auto!important}
  body.agent-studio-shell .center-main.agent-workbench:not(.agent-resource-page) .agent-workbench-grid,
  body.agent-studio-shell .center-main.agent-workbench.skill-workspace .skill-layout,
  body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace .knowledge-layout{flex:1 1 auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-resource-page{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-resource-page .agent-workbench-head{flex:0 0 auto!important}
  body.agent-studio-shell .center-main.agent-resource-page .resource-full-panel{flex:1 1 auto!important;height:auto!important;min-height:0!important;margin-top:14px!important;overflow-y:auto!important;overflow-x:hidden!important}
  body.agent-studio-shell .side-nav{position:relative!important;top:auto!important;height:100%!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important}

  /* The page heading is scrollable chrome; each workspace below it gets a
     full viewport-height canvas of its own. */
  body.agent-studio-shell .center-layout{height:auto!important;min-height:calc(100dvh - 76px)!important;overflow:visible!important;align-items:stretch!important}
  body.agent-studio-shell .center-main.agent-workbench:not(.agent-resource-page){height:auto!important;min-height:0!important;overflow:visible!important}
  body.agent-studio-shell .center-main.agent-workbench:not(.agent-resource-page) .agent-workbench-grid,
  body.agent-studio-shell .center-main.agent-workbench.skill-workspace .skill-layout,
  body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace .knowledge-layout{height:100dvh!important;min-height:100dvh!important;max-height:none!important}
  body.agent-studio-shell .side-nav{position:sticky!important;top:0!important;height:calc(100dvh - 76px)!important;max-height:calc(100dvh - 76px)!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important}

  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page){display:grid!important;grid-template-rows:max-content auto!important;align-content:start!important;gap:14px!important;height:auto!important;min-height:0!important;padding:28px clamp(20px,2vw,36px) 24px!important;overflow:visible!important}
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .agent-workbench-head{margin:0!important;min-height:0!important}
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .agent-workbench-grid{height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;align-self:stretch!important}
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) :is(.agent-rail,.agent-chat,.agent-inspector){height:100%!important;min-height:0!important}
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .agent-chat{display:flex!important;flex-direction:column!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-workbench:not(.skill-workspace):not(.knowledge-workspace):not(.agent-resource-page) .chat-messages{flex:1 1 0!important;min-height:0!important;height:0!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain!important}

  body.agent-studio-shell .center-main.agent-workbench.skill-workspace,
  body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace{display:grid!important;grid-template-rows:max-content auto!important;align-content:start!important;gap:14px!important;height:auto!important;min-height:0!important;padding:28px clamp(20px,2vw,36px) 24px!important;overflow:visible!important}
  body.agent-studio-shell .center-main.agent-workbench:is(.skill-workspace,.knowledge-workspace) .agent-workbench-head{margin:0!important;min-height:0!important}
  body.agent-studio-shell .center-main.agent-workbench:is(.skill-workspace,.knowledge-workspace) :is(.skill-layout,.knowledge-layout){height:100%!important;min-height:0!important;max-height:100%!important;margin:0!important;overflow:hidden!important;align-self:stretch!important}
  body.agent-studio-shell .center-main.agent-workbench.skill-workspace :is(.skill-list-panel,.skill-editor-panel,.skill-preview-panel),body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace .kb-panel{height:100%!important;min-height:0!important;max-height:100%!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-workbench.skill-workspace :is(.skill-list,.skill-form,.markdown-preview),body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace :is(.kb-list,.doc-list,.kb-import-panel){min-height:0!important;max-height:none!important;overflow-y:auto!important;overscroll-behavior:contain!important;scrollbar-gutter:stable}

  body.agent-studio-shell .center-main.agent-resource-page{display:grid!important;grid-template-rows:max-content auto!important;align-content:start!important;gap:14px!important;height:auto!important;min-height:0!important;padding:28px clamp(20px,2vw,36px) 24px!important;overflow:visible!important}
  body.agent-studio-shell .center-main.agent-resource-page .agent-workbench-head{margin:0!important;min-height:0!important}
  body.agent-studio-shell .center-main.agent-resource-page .resource-full-panel{height:100dvh!important;min-height:100dvh!important;margin:0!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important}
}

/* Keep this as the final cascade layer. Workspace height comes from the
   parent flex track, not a hard-coded viewport subtraction. */
@media (min-width:961px){
  body.agent-studio-shell .center-layout{height:calc(100dvh - 76px)!important;min-height:0!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-workbench{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-workbench .agent-workbench-head{flex:0 0 auto!important}
  body.agent-studio-shell .center-main.agent-workbench .agent-workbench-grid,
  body.agent-studio-shell .center-main.agent-workbench.skill-workspace .skill-layout,
  body.agent-studio-shell .center-main.agent-workbench.knowledge-workspace .knowledge-layout{flex:1 1 auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-resource-page{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;overflow:hidden!important}
  body.agent-studio-shell .center-main.agent-resource-page .agent-workbench-head{flex:0 0 auto!important}
  body.agent-studio-shell .center-main.agent-resource-page .resource-full-panel{flex:1 1 auto!important;height:auto!important;min-height:0!important;margin-top:14px!important;overflow-y:auto!important;overflow-x:hidden!important}
  body.agent-studio-shell .side-nav{position:relative!important;top:auto!important;height:100%!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important}
}

/* Absolute final workspace-mode contract. Keep this at EOF: the legacy file
   contains older mode rules above, so display and grid placement must be
   resolved here after every generic panel declaration. */
@media (min-width:961px){
  body.agent-studio-shell .agent-workbench-grid{grid-template-rows:minmax(0,1fr)!important}

  body.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-workbench-grid{grid-template-columns:minmax(220px,270px) minmax(0,1fr) minmax(320px,380px)!important}
  body.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-rail{display:flex!important;grid-column:1!important;grid-row:1!important}
  body.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-chat{display:flex!important;grid-column:2!important;grid-row:1!important}
  body.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-inspector{display:flex!important;grid-column:3!important;grid-row:1!important}

  body.agent-studio-shell .agent-workbench[data-workspace-view="chat"] .agent-workbench-grid{grid-template-columns:minmax(220px,270px) minmax(0,1fr)!important}
  body.agent-studio-shell .agent-workbench[data-workspace-view="chat"] .agent-rail{display:flex!important;grid-column:1!important;grid-row:1!important}
  body.agent-studio-shell .agent-workbench[data-workspace-view="chat"] .agent-chat{display:flex!important;grid-column:2!important;grid-row:1!important}
  body.agent-studio-shell .agent-workbench[data-workspace-view="chat"] .agent-inspector{display:none!important}

  body.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-workbench-grid{grid-template-columns:minmax(220px,270px) minmax(0,1fr)!important}
  body.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-rail{display:flex!important;grid-column:1!important;grid-row:1!important}
  body.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-chat{display:none!important}
  body.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-inspector{display:flex!important;grid-column:2!important;grid-row:1!important}
}

/* Final desktop sizing contract. The navigation height is measured at
   runtime, so the workspace always fills the browser's actual remaining
   height. Bottom padding provides a small, consistent breathing space. */
@media (min-width:961px){
  html:has(body.agent-studio-shell),
  body.agent-studio-shell{
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .center-layout{
    height:calc(100dvh - var(--studio-nav-height,76px))!important;
    min-height:0!important;
    overflow:hidden!important;
    align-items:stretch!important;
  }
  body.agent-studio-shell .center-main.agent-workbench{
    display:flex!important;
    flex-direction:column!important;
    gap:14px!important;
    height:100%!important;
    min-height:0!important;
    padding:24px clamp(20px,2vw,36px) 20px!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .center-main.agent-workbench .agent-workbench-head{
    flex:0 0 auto!important;
    min-height:0!important;
    margin:0!important;
  }
  body.agent-studio-shell .center-main.agent-workbench :is(.agent-workbench-grid,.skill-layout,.knowledge-layout,.resource-full-panel){
    flex:1 1 0!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .center-main.agent-workbench :is(.agent-rail,.agent-chat,.agent-inspector,.skill-list-panel,.skill-editor-panel,.skill-preview-panel,.kb-panel){
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .center-main.agent-workbench .agent-inspector{
    flex-direction:column!important;
  }
  body.agent-studio-shell .center-main.agent-workbench :is(.agent-list,.chat-messages,.inspector-body){
    flex:1 1 0!important;
  }
  body.agent-studio-shell .center-main.agent-workbench :is(.agent-list,.chat-messages,.inspector-body,.skill-list,.skill-form,.markdown-preview,.kb-list,.doc-list,.kb-import-panel,.resource-full-panel){
    min-height:0!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
  }
  body.agent-studio-shell .side-nav{
    position:relative!important;
    top:auto!important;
    align-self:stretch!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
  }
}

/* Authoritative geometry selectors. Repeating the shell class intentionally
   outranks legacy page-specific selectors that still exist earlier in this
   stylesheet. Keep this block at the physical end of the file. */
@media (min-width:961px){
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-layout{
    height:calc(100dvh - var(--studio-nav-height,76px))!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench{
    display:flex!important;
    flex-direction:column!important;
    gap:14px!important;
    height:100%!important;
    min-height:0!important;
    padding:24px clamp(20px,2vw,36px) 20px!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench > .agent-workbench-head{
    flex:0 0 auto!important;
    min-height:0!important;
    margin:0!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench > :is(.agent-workbench-grid,.skill-layout,.knowledge-layout,.resource-full-panel){
    flex:1 1 0!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .agent-workbench-grid > :is(.agent-rail,.agent-chat,.agent-inspector){
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .agent-workbench[data-workspace-view="split"] .agent-inspector,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-inspector{
    display:flex!important;
    flex-direction:column!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .agent-workbench[data-workspace-view="chat"] .agent-inspector,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .agent-workbench[data-workspace-view="settings"] .agent-chat{
    display:none!important;
  }
}

/* Shared studio page contract. Persona, Skill and Knowledge use different
   content grids, but their heading and scroll boundaries must be identical. */
@media (min-width:961px){
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.agent-resource-page,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace{
    display:flex!important;
    flex-direction:column!important;
    gap:14px!important;
    height:100%!important;
    min-height:0!important;
    padding:24px clamp(20px,2vw,36px) 20px!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.agent-resource-page > .agent-workbench-head,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace > .agent-workbench-head,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace > .agent-workbench-head{
    flex:0 0 auto!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:end!important;
    gap:18px 24px!important;
    min-height:0!important;
    margin:0!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench :is(.agent-workbench-title){
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:12px!important;
    min-width:0!important;
    width:100%!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench .agent-secondary-nav{
    position:static!important;
    justify-self:stretch!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench :is(.agent-view-switch,.skill-view-switch,.knowledge-view-switch){
    position:static!important;
    right:auto!important;
    bottom:auto!important;
    align-self:end!important;
    justify-self:end!important;
    flex:0 0 auto!important;
    width:204px!important;
    max-width:204px!important;
    min-height:46px!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.agent-resource-page > .resource-full-panel,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace > .skill-layout,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace > .knowledge-layout{
    flex:1 1 0!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.agent-resource-page > .resource-full-panel{
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace .skill-layout,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace .knowledge-layout{
    display:grid!important;
    align-items:stretch!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace :is(.skill-list-panel,.skill-editor-panel,.skill-preview-panel),
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace .kb-panel{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace :is(.skill-list,.skill-form,.markdown-preview),
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace :is(.kb-list,.doc-list,.kb-import-panel){
    min-height:0!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
  }
}

/* Keep the heading and the workspace on one exact content width. Without
   this, legacy min-width rules let the lower cards grow wider than the header,
   making the right-side mode switch appear stranded in the middle. */
@media (min-width:961px){
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench > .agent-workbench-head,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench > :is(.agent-workbench-grid,.skill-layout,.knowledge-layout,.resource-full-panel){
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .agent-studio-navigation{
    width:100%!important;
    min-width:0!important;
    grid-template-columns:minmax(0,1fr) 204px!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .agent-studio-navigation .agent-view-switch{
    justify-self:end!important;
  }

  /* Persona has no mode switch, so its secondary nav spans the full heading
     width just like the reference layout. */
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.agent-resource-page .agent-secondary-nav{
    width:max-content!important;
    max-width:none!important;
    grid-template-columns:repeat(4,max-content)!important;
    justify-self:start!important;
    overflow:visible!important;
  }

  /* The four destinations share one full-width navigation bar; mode controls
     stay in the separate right-hand column on pages that have them. */
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench :is(.agent-secondary-nav){
    width:max-content!important;
    max-width:none!important;
    grid-template-columns:repeat(4,max-content)!important;
    justify-self:start!important;
    overflow:visible!important;
  }
}

/* Final responsive pass for the three-mode controls and the lower panel
   boundary.  Keep this at the end so it wins over legacy fixed-width rules. */
@media (min-width:1181px){
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .agent-studio-navigation{
    grid-template-columns:minmax(0,1fr) max-content!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench :is(.agent-view-switch,.skill-view-switch,.knowledge-view-switch){
    width:max-content!important;
    max-width:100%!important;
    grid-template-columns:repeat(3,minmax(62px,max-content))!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench :is(.agent-view-switch,.skill-view-switch,.knowledge-view-switch) button{
    width:auto!important;
    min-width:62px!important;
    max-width:none!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
}
@media (min-width:961px){
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.agent-resource-page,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace{
    box-sizing:border-box!important;
    padding-bottom:24px!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.agent-resource-page > .resource-full-panel,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace > .skill-layout,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace > .knowledge-layout{
    margin-bottom:6px!important;
    max-height:calc(100% - 6px)!important;
  }

  /* The heading must size to its actual title/nav content.  Older studio
     rules assigned a tall minimum row, leaving a conspicuous empty band under
     the secondary navigation on Skill and Knowledge pages. */
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.agent-resource-page > .agent-workbench-head,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace > .agent-workbench-head,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace > .agent-workbench-head{
    height:auto!important;
    min-height:0!important;
    align-content:start!important;
    align-items:start!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench :is(.agent-workbench-title,.agent-studio-navigation){
    min-height:0!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench .agent-workbench-title>div{
    min-height:0!important;
  }

  /* Do not let percentage heights on the grid children resolve against the
     viewport.  That made the Skill/Knowledge panels run underneath the
     outer clip, hiding their bottom corners. */
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace > .skill-layout,
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace > .knowledge-layout{
    height:auto!important;
    flex:1 1 0!important;
    min-height:0!important;
    overflow:visible!important;
  }
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.skill-workspace > .skill-layout > :is(.skill-list-panel,.skill-editor-panel,.skill-preview-panel),
  body.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell.agent-studio-shell .center-main.agent-workbench.knowledge-workspace > .knowledge-layout > .kb-panel{
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    align-self:stretch!important;
  }
}

/* Final shared viewport contract. The shell owns the browser-height budget;
   the heading keeps its natural height and the workspace consumes only the
   remaining space. Internal lists/editors scroll, while the outer panels keep
   their bottom breathing room and rounded corners. */
@media (min-width:961px){
  html:has(body.agent-studio-shell),
  body.agent-studio-shell{
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .center-layout{
    height:calc(100dvh - var(--studio-nav-height,76px))!important;
    min-height:0!important;
    overflow:hidden!important;
    align-items:stretch!important;
  }
  body.agent-studio-shell .center-main.agent-workbench{
    display:flex!important;
    flex-direction:column!important;
    flex:1 1 auto!important;
    width:auto!important;
    height:100%!important;
    min-height:0!important;
    box-sizing:border-box!important;
    gap:14px!important;
    padding:24px clamp(20px,2vw,36px) 20px!important;
    overflow:hidden!important;
  }
  body.agent-studio-shell .center-main.agent-workbench > .agent-workbench-head{
    flex:0 0 auto!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
  }
  body.agent-studio-shell .center-main.agent-workbench > :is(.agent-workbench-grid,.skill-layout,.knowledge-layout,.resource-full-panel){
    flex:1 1 auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    align-self:stretch!important;
    box-sizing:border-box!important;
  }
  body.agent-studio-shell .center-main.agent-workbench > .agent-workbench-grid{
    overflow:hidden!important;
    grid-template-rows:minmax(0,1fr)!important;
  }
  body.agent-studio-shell .center-main.agent-workbench > .skill-layout,
  body.agent-studio-shell .center-main.agent-workbench > .knowledge-layout{
    overflow:hidden!important;
    grid-template-rows:minmax(0,1fr)!important;
    align-items:stretch!important;
  }
  body.agent-studio-shell .center-main.agent-workbench > .resource-full-panel{
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
    border-radius:18px!important;
  }
  body.agent-studio-shell .center-main.agent-workbench > :is(.agent-workbench-grid,.skill-layout,.knowledge-layout) > :is(.agent-rail,.agent-chat,.agent-inspector,.skill-list-panel,.skill-editor-panel,.skill-preview-panel,.kb-panel){
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    border-radius:18px!important;
    overflow:hidden!important;
    align-self:stretch!important;
  }
  body.agent-studio-shell .center-main.agent-workbench > .skill-layout :is(.skill-list,.skill-form,.markdown-preview),
  body.agent-studio-shell .center-main.agent-workbench > .knowledge-layout :is(.kb-list,.doc-list,.kb-import-panel),
  body.agent-studio-shell .center-main.agent-workbench > .agent-workbench-grid :is(.agent-list,.chat-messages,.inspector-body){
    min-height:0!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
  }
  body.agent-studio-shell .center-main.agent-workbench > .skill-layout :is(.skill-form,.markdown-preview){
    height:auto!important;
  }
  body.agent-studio-shell .center-main.agent-workbench > .skill-layout .skill-form{
    flex:1 1 auto!important;
  }
}
