/* Share the available viewport, then scroll within lists and working panes. */
.workspace-shell.compact-shell {
  height:100dvh; min-height:0; overflow:hidden;
}
.workspace-shell.compact-shell>main {
  display:flex; flex-direction:column; height:100%; min-height:0; overflow:hidden;
}
.workspace-shell.compact-shell>main>.content {
  display:flex; flex-direction:column; flex:1; width:100%; max-width:none;
  height:auto; min-width:0; min-height:0; padding:8px; overflow:auto;
}
.workspace-shell.compact-shell .content>.organization-sections,
.workspace-shell.compact-shell .content>.strategy-peer,
.workspace-shell.compact-shell .content>.page-heading,
.workspace-shell.compact-shell .content>.strategy-heading { flex-shrink:0; }
.workspace-shell.compact-shell .content>.organization-sections { margin-bottom:8px; }
.workspace-shell.compact-shell .content>:is(.projects-page,.ideas-page,.thinking-page,.assistant-page,.library-page,.directory-page,.contacts-page,.rn-page,.stars-page,.okr-page,.mp-page,.task-search-page) {
  flex:1 0 auto; min-width:0; display:flex; flex-direction:column;
}
.workspace-shell.compact-shell .content>.empty,
.workspace-shell.compact-shell .rn-page>.rn-empty {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.workspace-shell.compact-shell .content>.empty { margin:0; min-height:180px; }

/* Project lists keep their compact rows while the surrounding panel fills. */
.workspace-shell.compact-shell .projects-page>.projects-layout {
  flex:1; min-height:0; align-items:stretch;
}
.workspace-shell.compact-shell .projects-layout>.projects-panel {
  display:flex; flex-direction:column; min-height:0;
}
.workspace-shell.compact-shell .projects-panel>:is(.project-list,.project-cards,.empty) { flex:1; }
.workspace-shell.compact-shell .projects-panel .project-grid { align-content:start; }
.workspace-shell.compact-shell .content[data-page="members"]>.table-wrap {
  flex:1; min-height:140px; overflow:auto; background:#fff;
}
.workspace-shell.compact-shell .content[data-page="members"]>.permission-note { flex-shrink:0; margin-bottom:0; }
.workspace-shell.compact-shell .content[data-page="strategies"]>.strategy-plans {
  flex:1; align-content:start;
}
.workspace-shell.compact-shell .strategy-workspace { flex:1 0 auto; }

/* Library, chat, idea cards and whiteboards use the remaining row height. */
@media(min-width:1101px) {
  .workspace-shell.compact-shell .content>:is(.library-page,.assistant-page,.ideas-page,.directory-page) {
    flex:1; min-height:0;
  }
  .workspace-shell.compact-shell .library-notebook { height:auto; min-height:0; }
  .workspace-shell.compact-shell .library-workspace { flex:1; min-height:0; }
  .workspace-shell.compact-shell .library-page :is(.library-sources,.library-chat) {
    height:auto; min-height:0; max-height:none;
  }
  .workspace-shell.compact-shell .library-preview .library-original-preview { min-height:0; }
  .workspace-shell.compact-shell .library-preview .library-original-frame { height:100%; min-height:180px; }
  .workspace-shell.compact-shell .assistant-layout {
    flex:1; min-height:0; align-items:stretch; grid-template-rows:minmax(0,1fr);
  }
  .workspace-shell.compact-shell .assistant-layout>.assistant-input { min-height:0; overflow:auto; }
  .workspace-shell.compact-shell .assistant-output {
    display:flex; flex-direction:column; min-height:0; overflow:auto;
  }
  .workspace-shell.compact-shell .assistant-conversation {
    display:flex; flex-direction:column; flex:1; min-height:350px;
  }
  .workspace-shell.compact-shell .assistant-messages { flex:1; max-height:none; min-height:100px; }
  .workspace-shell.compact-shell .assistant-conversation>:not(.assistant-messages) { flex-shrink:0; }
  .workspace-shell.compact-shell .assistant-output>.assistant-result { flex-shrink:0; }
  .workspace-shell.compact-shell .idea-layout { flex:1; min-height:0; }
  .workspace-shell.compact-shell .idea-layout>:is(.idea-sidebar,.idea-detail) { min-height:0; overflow:auto; }
  .workspace-shell.compact-shell .idea-main { min-height:0; }
  .workspace-shell.compact-shell .idea-card-grid { flex:1; min-height:0; max-height:none; }
  .workspace-shell.compact-shell .idea-board-workspace { flex:1; min-height:0; }
  .workspace-shell.compact-shell .idea-board-workspace .idea-viewport { height:auto; min-height:180px; }
  .workspace-shell.compact-shell .idea-tray { min-height:0; max-height:none; }
  .workspace-shell.compact-shell .source-boards { flex:1; height:auto; min-height:220px; }
  .workspace-shell.compact-shell .directory-page .people-workspace:not(.people-expanded) {
    height:auto; min-height:0; flex:1; align-items:stretch;
  }
  .workspace-shell.compact-shell .directory-page .talent-panel { min-height:0; max-height:none; }
  .workspace-shell.compact-shell .directory-page .talent-table-scroll {
    height:auto; flex:1; min-height:0; max-height:none;
  }
}
.workspace-shell.compact-shell .idea-heading { margin-bottom:10px; }
.workspace-shell.compact-shell .idea-capture { margin-bottom:10px; flex-shrink:0; }
.workspace-shell.compact-shell .idea-heading { flex-shrink:0; }
.workspace-shell.compact-shell .thinking-layout { flex:1; align-items:stretch; }
.workspace-shell.compact-shell .thinking-layout>.thinking-panel { min-width:0; }
.workspace-shell.compact-shell .okr-panel { flex:1; min-height:250px; display:flex; flex-direction:column; }
.workspace-shell.compact-shell .okr-panel>:is(.okr-table-scroll,.okr-alignment) { flex:1; max-height:none; }
.workspace-shell.compact-shell .mp-page>.mp-resume-grid { flex:1; }
.workspace-shell.compact-shell .mp-page>.mp-empty { flex:1; }
.workspace-shell.compact-shell .mp-page>.mp-footer { margin-top:auto; padding-top:10px; }
.workspace-shell.compact-shell .task-search-page>#task-search-results { display:flex; flex-direction:column; flex:1; }
.workspace-shell.compact-shell #task-search-results>:is(.task-search-list,.task-search-empty) { flex:1; }
.workspace-shell.compact-shell .task-search-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; }

/* Small screens keep stacked panels reachable. The header height is intrinsic. */
@media(max-width:1100px) {
  .workspace-shell.compact-shell .content>:is(.library-page,.assistant-page,.ideas-page,.directory-page) { min-height:100%; }
  .workspace-shell.compact-shell .projects-page>.projects-layout { min-height:420px; }
  .workspace-shell.compact-shell .library-notebook { height:auto; }
  .workspace-shell.compact-shell .source-boards { flex:1; min-height:450px; }
}
@media(max-width:640px) {
  .workspace-shell.compact-shell { display:flex; flex-direction:column; }
  .workspace-shell.compact-shell>.sidebar { position:relative; top:auto; height:auto; flex-shrink:0; }
  .workspace-shell.compact-shell>main { flex:1; height:auto; min-height:0; padding-bottom:42px; }
  .workspace-shell.compact-shell>main>.content { height:auto; min-height:0; padding:6px; }
  .workspace-shell.compact-shell.sidebar-hidden>main { padding-bottom:0; }
  .workspace-shell.compact-shell.project-workspace>main>.content { height:auto; min-height:0; }
  .workspace-shell.compact-shell .task-overview-page { min-height:100%; }
  .workspace-shell.compact-shell .content>.home-gantt { min-height:100%; }
  .workspace-shell.compact-shell .content>.schedule-page { height:100%; min-height:0; }
  .workspace-shell.compact-shell .thinking-layout { flex-direction:column-reverse; }
  .workspace-shell.compact-shell .mp-page>.mp-resume-grid { flex:none; }
}
.workspace-shell.compact-shell.workspace-fullscreen>main { padding-bottom:0; }
.workspace-shell.compact-shell.workspace-fullscreen>main>.content,
body[data-workspace-window] .workspace-shell.compact-shell>main>.content { padding:0; }
body[data-workspace-window] .workspace-shell.compact-shell>main { padding-bottom:0; }

/* Records share the same viewport layout as the other workspaces. */
.workspace-shell.compact-shell .content>.records-hub {
  display:flex; flex-direction:column; flex:1 0 auto; min-width:0;
}
.workspace-shell.compact-shell .records-hub>.records-tabs { flex-shrink:0; }
.workspace-shell.compact-shell .records-hub>[role="tabpanel"] {
  display:flex; flex-direction:column; flex:1; min-width:0; min-height:0;
}
.workspace-shell.compact-shell .records-hub .journal-page {
  width:100%; max-width:none; margin:0; padding-bottom:0; flex:1 0 auto;
}
.workspace-shell.compact-shell .records-hub>[role="tabpanel"]>.ideas-page {
  display:flex; flex-direction:column; flex:1 0 auto; min-width:0;
}
@media(min-width:1101px) {
  .workspace-shell.compact-shell .content>.records-hub { flex:1; min-height:0; }
  .workspace-shell.compact-shell .records-hub>[role="tabpanel"] { overflow:auto; }
  .workspace-shell.compact-shell .records-hub .journal-page {
    display:flex; flex-direction:column; flex:1; min-height:0;
  }
  .workspace-shell.compact-shell .journal-page>:is(.journal-heading,.journal-composer,.journal-ai) { flex-shrink:0; }
  .workspace-shell.compact-shell .journal-browse {
    display:flex; flex-direction:column; flex:1; min-height:160px;
  }
  .workspace-shell.compact-shell .journal-browse>:not([data-feed]) { flex-shrink:0; }
  .workspace-shell.compact-shell .journal-browse>[data-feed] {
    flex:1; min-height:120px; overflow:auto; scrollbar-width:thin;
  }
  .workspace-shell.compact-shell .records-hub>[role="tabpanel"]>.ideas-page { flex:1; min-height:0; }
}
.workspace-mode-label{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:12px;color:var(--muted,#64748b)}
.workspace-shell.compact-shell .sidebar-tools{flex-wrap:wrap;min-width:0}
.workspace-shell.compact-shell .sidebar-account-mode{grid-column:1/-1;min-width:0;box-sizing:border-box;padding:8px 2px;border-top:1px solid #273449;justify-content:space-between;font-size:12px;gap:8px}
.workspace-shell.compact-shell .sidebar-account-mode select{min-width:0;max-width:calc(100% - 58px);flex:0 1 110px}
.workspace-shell.compact-shell .sidebar-tools .inbox-quick-entry{width:auto;min-width:80px;max-width:100%;margin-left:auto;padding:5px 7px;font-size:12px;color:#fff;background:#2563eb;border-radius:6px}
.workspace-shell.compact-shell .sidebar-tools .inbox-quick-entry:hover{background:#1d4ed8;color:#fff}
.workspace-mode-label select{width:auto;min-width:95px;padding:5px 7px;border:1px solid #cbd5e1;border-radius:7px;background:var(--surface,#fff);font-size:13px;color:var(--text,#1e293b)}
@media(max-width:600px){.workspace-mode-label{font-size:0;gap:0}.workspace-mode-label select{min-width:86px;padding:4px;font-size:12px}.top-actions{gap:4px}}
