/* Bounded app frame: every workspace retains its shared header. */
html,body{height:100%;overflow:hidden}
#app{height:100dvh;min-height:0;overflow:hidden}
.shell,.pipeline-shell,.market-shell,.operator-shell{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.shell>.topbar{flex:0 0 auto;position:relative;top:auto;z-index:25;background:#fff;border-bottom:1px solid #cbd5e1}
.shell>main{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.shell>footer{flex:0 0 auto}
.pipeline-shell>main{display:flex;flex-direction:column;overflow:hidden;scrollbar-gutter:auto}
.pipeline-shell .compact-summary,.pipeline-shell .crm-bulk-toolbar{flex:0 0 auto}
.pipeline-shell .pipeline-workspace{min-height:0;flex:1;overflow:hidden;padding-top:0}
.pipeline-shell #lead-results{min-height:0;flex:1;display:flex;flex-direction:column;overflow:hidden}
.pipeline-shell #lead-results>.board{height:100%;min-height:0;flex:1;overflow:auto;align-items:stretch;scrollbar-gutter:stable;overscroll-behavior:contain}
.pipeline-shell .board>.column{min-height:100%;flex-shrink:0;position:relative;overflow:visible}
.pipeline-shell .board .column-head{position:sticky;top:0;z-index:3;background:#f8fafc;padding-top:12px}
.pipeline-shell #lead-results>.table-wrap{min-height:0;overflow:auto}
.shell .table-wrap thead th{position:sticky;top:0;z-index:2}
.pipeline-picker{display:block;flex:1;min-width:0;margin:0}
.pipeline-picker select{width:100%;max-width:240px;min-height:38px;padding:6px 22px 6px 0;background:transparent;border:0;box-shadow:none;font-size:14px;font-weight:700;color:#0f172a;border-radius:4px;text-transform:uppercase;text-overflow:ellipsis}
.pipeline-manage-button{min-height:30px;width:30px;padding:0;flex:0 0 auto;background:#eff6ff;border:1px solid #cbd5e1;color:#2563eb;border-radius:5px}
.pipeline-manager{display:grid;gap:20px}.pipeline-manager form{padding:16px;border:1px solid #cbd5e1;border-radius:8px;background:#f8fafc}.pipeline-manager label{margin-top:0}.pipeline-manager small{color:#475569}
.market-logo.logo-operator-workspace{background:#eff6ff;color:#2563eb}
.settings-subnav{position:sticky;top:0;align-self:start;max-height:100%;overflow:auto}
.operator-shell>.topbar{display:flex}.operator-shell>main{padding:0;overflow:hidden}.operator-shell .operator-workspace{height:100%;min-height:0}.operator-shell>footer{display:none}
#main:has(>.inbox-workspace){overflow:hidden}.shell .inbox-workspace{height:100%;min-height:0}
@media(max-width:600px){
 #app:has(>.sidebar){display:flex;flex-direction:column}#app>.sidebar{position:relative;flex:0 0 56px;min-height:56px}
 .shell,.pipeline-shell,.market-shell,.operator-shell{height:auto;flex:1;min-height:0;margin-left:0}
 .pipeline-picker select{font-size:13px;max-width:none}.pipeline-manage-button{width:28px;min-height:28px}
 .pipeline-shell .compact-summary{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:20px;padding:10px 14px;min-height:70px}.pipeline-shell .compact-summary>div{min-width:120px}.pipeline-shell .compact-summary strong{font-size:18px}
 .pipeline-shell footer{display:none}.pipeline-shell .board{margin-right:0}.operator-shell .operator-workspace{height:100%}
}
/* Natural column height lets sticky headers cover the complete card stack. */
.pipeline-shell #lead-results>.board{align-items:flex-start}
.pipeline-shell .board>.column{height:auto;align-self:flex-start}
.topbar-title:has(.pipeline-picker){gap:8px;padding-right:12px}
.topbar-title:has(.pipeline-picker)>.topbar-view-icon{display:none}
.pipeline-picker select{max-width:none}
/* Legacy full-page modules now live under the persistent app header. */
.shell:has(.entity-directory)>.topbar,.shell:has(.task-workspace)>.topbar,.shell:has(.inbox-reference)>.topbar{display:flex}
.entity-directory,.task-workspace{min-height:100%}
.directory-header,.task-toolbar{position:sticky;top:0;z-index:12}
.inbox-reference .inbox-columns{height:100%;min-height:0}

.pipeline-shell .board:has(.lead-drop-slot){overflow-y:auto}

/* Always-visible board/list controls, independent of the filter popover. */
.pipeline-view-switch{display:flex;align-items:center;gap:2px;flex:0 0 auto;margin:0 14px;padding:3px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fafc}
.pipeline-view-switch button{display:grid;place-items:center;width:32px;min-height:30px;padding:5px;border:0;border-radius:4px;background:transparent;color:#475569}
.pipeline-view-switch .icon{width:18px;height:18px}
.pipeline-view-switch button:hover{background:#e2e8f0;color:#0f172a}
.pipeline-view-switch button[aria-pressed=true]{background:#dbeafe;color:#1d4ed8}
.pipeline-view-switch button:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
@media(max-width:600px){.pipeline-view-switch{position:absolute;right:13px;bottom:4px;margin:0;z-index:2;padding:1px}.pipeline-view-switch button{width:31px;min-height:29px}.pipeline-shell .topbar-search{padding-right:83px}}
