/* v4.3-RC5 — compact ERD refinement */
body.workspace-erd #erdWorkspace .erd-toolbar{
  grid-template-columns:minmax(190px,max-content) minmax(220px,1fr) max-content!important;
  gap:10px!important;
  padding:10px 14px!important;
}
body.workspace-erd #erdWorkspace .erd-toolbar-title strong{font-size:14px!important;line-height:1.1!important}
body.workspace-erd #erdWorkspace .erd-toolbar-title span{font-size:10px!important;line-height:1.2!important}
body.workspace-erd #erdWorkspace .global-search-wrap{max-width:440px!important}
body.workspace-erd #erdWorkspace .global-search-wrap input{height:40px!important;padding-right:38px!important}
body.workspace-erd #erdWorkspace .global-search-wrap>kbd{display:none!important}
body.workspace-erd #erdWorkspace .top-actions{gap:6px!important}
body.workspace-erd #erdWorkspace #btnFullscreen{
  padding:8px 12px!important;
  min-width:auto!important;
  white-space:nowrap!important;
}
body.workspace-erd #erdWorkspace #btnTheme,
body.workspace-erd #erdWorkspace #btnHelp{display:none!important}

body.workspace-erd #erdWorkspace .left-panel .panel-scroll{
  display:grid;
  gap:10px;
  padding:12px 12px 22px!important;
}
body.workspace-erd #erdWorkspace .left-panel .panel-scroll > section,
body.workspace-erd #erdWorkspace .left-panel .panel-scroll > .mf-erd-group-card,
body.workspace-erd #erdWorkspace .left-panel .panel-scroll > details.mf-erd-group-card{
  margin:0!important;
}
body.workspace-erd #erdWorkspace .mf-erd-group-card{
  border:1px solid var(--line);
  border-radius:12px;
  background:color-mix(in srgb,var(--panel2) 72%,transparent);
  overflow:hidden;
}
body.workspace-erd #erdWorkspace .mf-erd-group-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 12px;
  border-bottom:1px solid color-mix(in srgb,var(--line) 65%,transparent);
  background:color-mix(in srgb,var(--panel) 88%,transparent);
}
body.workspace-erd #erdWorkspace .mf-erd-group-head b,
body.workspace-erd #erdWorkspace details.mf-erd-group-card > summary b{
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}
body.workspace-erd #erdWorkspace .mf-erd-group-body{
  display:grid;
  gap:0;
  padding:4px 0 2px;
}
body.workspace-erd #erdWorkspace .mf-erd-group-body > section{
  border:0!important;
  padding:10px 12px!important;
}
body.workspace-erd #erdWorkspace .mf-erd-group-body > section + section{
  border-top:1px solid color-mix(in srgb,var(--line) 60%,transparent)!important;
}
body.workspace-erd #erdWorkspace details.mf-erd-group-card > summary{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 12px;
  cursor:pointer;
  background:color-mix(in srgb,var(--panel) 88%,transparent);
}
body.workspace-erd #erdWorkspace details.mf-erd-group-card > summary::-webkit-details-marker{display:none}
body.workspace-erd #erdWorkspace details.mf-erd-group-card > summary::after{
  content:'▾';
  color:var(--muted);
  font-size:14px;
}
body.workspace-erd #erdWorkspace details.mf-erd-group-card:not([open]) > summary::after{content:'▸'}
body.workspace-erd #erdWorkspace details.mf-erd-group-card .mf-erd-group-body{padding-top:2px}

body.workspace-erd #erdWorkspace .mf-erd-group-card .segmented{grid-template-columns:repeat(2,1fr)!important}
body.workspace-erd #erdWorkspace .mf-erd-group-card .segmented button{min-height:34px!important}
body.workspace-erd #erdWorkspace .mf-erd-group-card #modeTabs button[data-mode="audit"],
body.workspace-erd #erdWorkspace .mf-erd-group-card .button-grid [data-layout="force"],
body.workspace-erd #erdWorkspace .mf-erd-group-card .button-grid [data-layout="radial"]{
  display:none!important;
}
body.workspace-erd #erdWorkspace .mf-erd-group-card .button-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.workspace-erd #erdWorkspace .mf-erd-group-card .domain-list{max-height:200px!important}
body.workspace-erd #erdWorkspace .mf-erd-group-card .micro-copy{font-size:10px!important}
body.workspace-erd #erdWorkspace .mf-erd-group-hint{font-size:10px;color:var(--muted)}

body.workspace-erd #erdWorkspace .canvas-header{
  grid-template-columns:minmax(160px,1fr) max-content!important;
  padding:8px 12px!important;
  min-height:58px!important;
}
body.workspace-erd #erdWorkspace .canvas-header > div:first-child{min-width:0}
body.workspace-erd #erdWorkspace .canvas-header h1{font-size:14px!important;margin:0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.workspace-erd #erdWorkspace .canvas-header p{font-size:10px!important;margin:3px 0 0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.workspace-erd #erdWorkspace .canvas-actions{
  gap:5px!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  scrollbar-width:thin;
}
body.workspace-erd #erdWorkspace .canvas-actions button{
  min-height:32px!important;
  padding:6px 10px!important;
  font-size:11px!important;
}
body.workspace-erd #erdWorkspace #btnExport{display:none!important}
body.workspace-erd #erdWorkspace .statusbar{font-size:10px!important}
body.workspace-erd #erdWorkspace .statusbar span:last-child{display:none!important}

@media(max-width:1320px){
  body.workspace-erd #erdWorkspace .erd-toolbar{grid-template-columns:1fr!important}
  body.workspace-erd #erdWorkspace .global-search-wrap{max-width:none!important}
  body.workspace-erd #erdWorkspace .top-actions{justify-content:flex-end!important}
}
@media(max-width:960px){
  body.workspace-erd #erdWorkspace .canvas-header{grid-template-columns:1fr!important;gap:8px!important}
  body.workspace-erd #erdWorkspace .canvas-actions{justify-content:flex-start!important}
}
