@import url("/workbench.css") layer(legacy);
@import url("/library.css") layer(legacy);
@import url("/brand-assets.css") layer(legacy);
@import url("/experience.css") layer(legacy);
@import url("/agent-editor.css") layer(legacy);
@import url("/bc-shared.css");

.connector-scope-switch{display:flex;align-items:center;gap:4px;padding:4px;border-radius:6px;background:var(--bc-canvas);height:36px;box-sizing:border-box}
.connector-scope-switch button{height:28px;min-height:28px;padding:0 12px;border:0;border-radius:4px;background:transparent;color:var(--bc-muted);cursor:pointer}
.connector-scope-switch button[aria-pressed="true"]{background:var(--bc-surface);color:var(--bc-text);box-shadow:0 1px 2px #00000010}
.connector-scope-switch button:hover{color:var(--bc-text);background:var(--bc-hover)}
.connector-scope-description{color:var(--bc-muted);margin:12px 0;font-size:13px;line-height:1.65}
#globalConnectorDialog{width:min(560px,calc(100vw - 48px));max-height:calc(100vh - 48px)}
#globalConnectorDialog .connector-dialog-shell{padding:24px}
#globalConnectorDialog header{display:flex;align-items:center;justify-content:space-between;gap:16px}
#globalConnectorDialog h2{margin:0;font-size:18px;line-height:26px}
#globalConnectorDialog .field-label{display:grid;gap:8px;margin:20px 0 12px}
#globalConnectorDialog input{width:100%;box-sizing:border-box}
.connector-setup-help{margin:12px 0;font-size:13px;line-height:1.8}
.connector-setup-help summary{cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.connector-setup-help ol{padding-left:22px}
.connector-setup-help a{text-decoration:underline;text-underline-offset:3px}
#globalConnectorError{color:var(--bc-danger,#b42318);font-size:13px;line-height:1.65}
#globalConnectorDialog footer{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}

/* Keep the runtime's intermediate boot screen behind one stable loading surface. */
#dshAgentFrame:not([data-library-ready="true"]){visibility:hidden}
/* Keep the frame drawable: visibility:hidden throttles native history/scroll
   animation frames. One opaque cover masks its intermediate initial paints. */
.dsh-agent-shell:has(#dshAgentFrame[data-paint-pending="true"]) .dsh-agent-loading{z-index:3;background:var(--bc-surface)}

/* Scope tabs stay inside the shared 36px track. */
.shell .library-tabs{align-items:center;box-sizing:border-box;height:36px;padding:4px;gap:4px}
.shell .library-tabs button{box-sizing:border-box;flex:none;height:28px;min-height:28px;margin:0;padding:0 12px;border:0;border-radius:4px;line-height:20px}
/* Give the three daily fields usable writing space without clipping shorter windows. */
.shell .daily-workspace{grid-template-rows:auto auto auto;gap:16px}
.shell .daily-page-head{margin:0}
.shell .daily-writing #dailyPane{overflow:visible}
.shell .daily-editor{height:auto;padding:16px;gap:16px;border-radius:8px}
.shell .daily-editor-head{justify-content:flex-end}
.shell .daily-report-form{grid-template-rows:repeat(3,auto) auto;gap:20px}
.shell .daily-field{gap:8px}
.shell .daily-field textarea{height:clamp(120px,calc((100dvh - 400px)/3),260px);min-height:120px;resize:vertical}
.shell .daily-form-actions{padding-top:16px}
#marketGrid{display:block;padding:16px 0}
#marketGrid .market-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,400px),1fr));gap:16px;align-items:stretch}
#marketView .market-stage-head{justify-content:space-between;align-items:center}
#marketView .market-stage-head>.connector-scope-switch{display:flex}
#marketGrid .market-card{min-height:0;margin:0;padding:16px;gap:12px}
#marketGrid .market-card p{margin:0;line-height:20px}
#marketGrid .connector-capability-tags{margin-top:auto;padding-top:8px}
#marketGrid [data-connector-action]{align-self:flex-start}
html[data-workbench-identity-pending] .primary-sidebar{visibility:hidden}
