/* v4.3-RC4 — ERD workspace usability recovery */
body.workspace-erd #mfUsabilityBar,
body.workspace-erd .mf-skip-links{display:none!important}

body.workspace-erd .topbar{
  grid-template-columns:minmax(220px,max-content) minmax(260px,0.95fr) max-content!important;
  gap:12px!important;
}
body.workspace-erd .header-search{max-width:480px!important;min-width:220px!important}

body.workspace-erd #erdWorkspace{display:block;min-height:0}
body.workspace-erd #erdWorkspace .erd-toolbar,
body.workspace-erd #erdWorkspace .canvas-header{
  overflow:hidden;
}
body.workspace-erd #erdWorkspace .canvas-header{
  display:grid!important;
  grid-template-columns:minmax(180px,1fr) max-content!important;
  gap:12px!important;
  align-items:center!important;
  padding:10px 14px!important;
}
body.workspace-erd #erdWorkspace .canvas-header h1{font-size:15px!important;line-height:1.2!important}
body.workspace-erd #erdWorkspace .canvas-header p{font-size:11px!important;line-height:1.3!important}
body.workspace-erd #erdWorkspace .canvas-actions{
  display:flex!important;
  flex-wrap:nowrap!important;
  gap:6px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  padding-bottom:2px!important;
  justify-content:flex-end!important;
  scrollbar-width:thin;
}
body.workspace-erd #erdWorkspace .canvas-actions button{
  white-space:nowrap!important;
  flex:0 0 auto!important;
  min-height:36px!important;
  padding:7px 11px!important;
}
body.workspace-erd #erdWorkspace .erd-panel-head,
body.workspace-erd #erdWorkspace .panel h3,
body.workspace-erd #erdWorkspace .filter-chip,
body.workspace-erd #erdWorkspace .toggle-row,
body.workspace-erd #erdWorkspace .domain-item,
body.workspace-erd #erdWorkspace .segmented button,
body.workspace-erd #erdWorkspace .layout-btn,
body.workspace-erd #erdWorkspace .button-grid button,
body.workspace-erd #erdWorkspace .ghost-btn,
body.workspace-erd #erdWorkspace .wide-btn,
body.workspace-erd #erdWorkspace .select-row,
body.workspace-erd #erdWorkspace .statusbar{
  font-size:12px!important;
}
body.workspace-erd #erdWorkspace .chip-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
body.workspace-erd #erdWorkspace .filter-chip{
  min-height:42px!important;
  font-weight:800!important;
  color:var(--text)!important;
  border-width:1px!important;
  position:relative!important;
}
body.workspace-erd #erdWorkspace .filter-chip.active{box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)!important}
body.workspace-erd #erdWorkspace .filter-chip[data-value=L1].active{background:color-mix(in srgb,#2b78b8 35%,var(--panel))!important;color:#d7ebff!important;border-color:#5aa7ea!important}
body.workspace-erd #erdWorkspace .filter-chip[data-value=L2].active{background:color-mix(in srgb,#00a6a6 35%,var(--panel))!important;color:#ddffff!important;border-color:#49d7d7!important}
body.workspace-erd #erdWorkspace .filter-chip[data-value=L3].active{background:color-mix(in srgb,#8b5cf6 35%,var(--panel))!important;color:#efe6ff!important;border-color:#bda4ff!important}
body.workspace-erd #erdWorkspace .filter-chip[data-value=L4].active{background:color-mix(in srgb,#d97706 35%,var(--panel))!important;color:#fff2db!important;border-color:#f2bb72!important}
body.workspace-erd #erdWorkspace .filter-chip[data-value=L5].active{background:color-mix(in srgb,#e11d48 35%,var(--panel))!important;color:#ffe2ea!important;border-color:#ff9eb1!important}
body.workspace-erd #erdWorkspace .filter-chip[data-value=L6].active{background:color-mix(in srgb,#0f9f7a 35%,var(--panel))!important;color:#dffcf3!important;border-color:#7fddc0!important}
body.workspace-erd #erdWorkspace .filter-chip[data-value=L7].active{background:color-mix(in srgb,#475569 34%,var(--panel))!important;color:#edf2f7!important;border-color:#aeb8c5!important}
body.workspace-erd #erdWorkspace .filter-chip[data-value=L8].active{background:color-mix(in srgb,#db2777 35%,var(--panel))!important;color:#ffe6f2!important;border-color:#ff9bc6!important}
body.workspace-erd #erdWorkspace .filter-chip[data-value=L9].active{background:color-mix(in srgb,#7c3aed 35%,var(--panel))!important;color:#f3eaff!important;border-color:#ccb7ff!important}
body.workspace-erd #erdWorkspace .filter-chip:not(.active){opacity:.88!important}

body.workspace-erd #erdWorkspace .mf-l9-layer-filter,
body.workspace-erd #erdWorkspace .mf-erd-l9-launch{
  border-style:solid!important;
  pointer-events:auto!important;
}
body.workspace-erd #erdWorkspace .mf-erd-l9-panel{
  display:grid;
  gap:8px;
  margin-top:8px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:color-mix(in srgb,var(--panel2) 94%,transparent);
}
body.workspace-erd #erdWorkspace .mf-erd-l9-panel.hidden{display:none!important}
body.workspace-erd #erdWorkspace .mf-erd-l9-panel p{
  margin:0;
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
}
body.workspace-erd #erdWorkspace .mf-erd-l9-launch{
  width:100%;
  min-height:36px;
  padding:8px 10px;
  white-space:nowrap;
  background:color-mix(in srgb,#7c3aed 10%,var(--panel2));
  border-color:color-mix(in srgb,#7c3aed 35%,var(--line));
}
body.workspace-erd #erdWorkspace .global-search-wrap{max-width:520px!important}
body.workspace-erd #erdWorkspace .top-actions{gap:6px!important}
body.workspace-erd #erdWorkspace .top-actions .primary-btn{white-space:nowrap!important}

@media(max-width:1380px){
  body.workspace-erd #erdWorkspace .canvas-header{grid-template-columns:1fr!important}
  body.workspace-erd #erdWorkspace .canvas-actions{justify-content:flex-start!important}
}
@media(max-width:980px){
  body.workspace-erd .topbar{grid-template-columns:minmax(170px,max-content) minmax(160px,1fr) max-content!important}
  body.workspace-erd .header-search{max-width:320px!important;min-width:160px!important}
}
