/* Match the source header's 320px field width and wrap as space permits. */
[data-rule-form-toolbar]{display:none}
#referenceMasterFormModal:has(.directory-rule-editor) #referenceMasterForm>.modal-header,
#referenceMasterFormModal:has(.directory-rule-editor) #referenceMasterFormTabs{display:none}
#referenceMasterFormModal:has(.directory-rule-editor) [data-rule-form-toolbar]{display:inline-flex}
#referenceMasterFormModal:has(.directory-rule-editor) .reference-master-form-toolbar button:disabled{opacity:.5;cursor:not-allowed}
#referenceMasterFormModal:has(.directory-rule-editor) .reference-master-form-toolbar{gap:12px;flex-wrap:wrap;min-height:44px;padding:7px 18px;background:#eef0f5;flex:none}
#referenceMasterFormModal:has(.directory-rule-editor) .reference-master-form-toolbar button{width:auto;flex:none;min-height:28px;height:28px;border-radius:0;border:0;padding:0 14px;font-size:13px;background:#5582f3;color:#fff}
#referenceMasterFormModal:has(.directory-rule-editor) .reference-master-form-toolbar button span{display:inline}
#referenceMasterFormModal:has(.directory-rule-editor) .reference-master-form-toolbar button>svg{display:none}
#referenceMasterFormModal:has(.directory-rule-editor) .reference-master-form-toolbar .split-caret{padding:0 5px;border-left:1px solid #ffffff55}
#referenceMasterFormModal:has(.directory-rule-editor) .reference-master-form-toolbar .split-caret svg{display:block;width:12px;height:12px}
#referenceMasterFormModal:has(.directory-rule-editor) .reference-master-form-toolbar [role=menuitem]{background:white;color:#333;width:100%;text-align:left}
#referenceMasterFormFields:has(.directory-rule-editor){grid-template-columns:repeat(auto-fill,minmax(min(320px,100%),1fr));gap:7px 20px;padding:18px 50px;align-content:start;min-width:0}
#referenceMasterFormFields:has(.directory-rule-editor)>label.field{display:grid;grid-template-columns:110px minmax(0,1fr);align-items:center;gap:8px;margin:0;grid-column:auto}
#referenceMasterFormFields:has(.directory-rule-editor)>label.field>span:first-child{text-align:right;font-size:13px;font-weight:400}
#referenceMasterFormFields:has(.directory-rule-editor)>label.field>.input-wrap{height:32px;min-height:32px;border-radius:0;padding:0 8px;min-width:0}
#referenceMasterFormFields:has(.directory-rule-editor)>label:has([data-reference-master-field=type]) .required-mark{display:none}
#referenceMasterFormFields:has(.directory-rule-editor)>label:is(.directory-rule-readonly,:has([data-reference-master-field=type]),:has([data-reference-master-field=schemeCode]))>.input-wrap{border-color:transparent;background:transparent;padding-left:0}
#referenceMasterFormFields:has(.directory-rule-editor) :is([data-reference-master-field=type],[data-reference-master-field=schemeCode],.directory-rule-readonly input){border:0;background:transparent;box-shadow:none;appearance:none;color:#333;opacity:1;padding:0}
#referenceMasterFormFields:has(.directory-rule-editor) [data-reference-master-field=type]{background-image:none}
#referenceMasterFormFields>.directory-rule-editor{grid-column:1/-1;min-width:0;width:100%;margin-top:18px}
.directory-rule-editor{position:relative}
.directory-rule-editor .reference-timestamp-input{min-width:215px}
.directory-rule-editor .reference-timestamp-input input{min-width:180px;width:180px;flex:1;border:0;font-size:12px}
.directory-rule-editor .directory-table-scroll{width:100%;max-height:calc(100vh - 380px);min-height:90px;overflow:auto}
.directory-rule-editor .directory-condition-table{min-width:920px;font-size:13px}
.directory-rule-editor .directory-condition-table th,.directory-rule-editor .directory-condition-table td{padding:6px 4px}
.directory-rule-editor .directory-condition-table th{font-weight:400;background:#f5f5f5}
.directory-rule-editor .directory-condition-table input{border:1px solid #d9d9d9;outline-offset:1px}
.directory-rule-batch-value{display:flex;align-items:center;border:1px solid #d9d9d9;min-width:200px}
.directory-rule-editor .directory-rule-batch-value input{flex:1;width:100%;min-width:0;border:0}
.directory-rule-editor .directory-rule-batch-value button{display:grid;place-items:center;width:24px;min-width:24px;height:26px;border:0;background:white;color:#999;padding:0}
.directory-rule-batch-dialog{width:400px;height:480px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);padding:0;border:0;border-radius:0;box-sizing:border-box;color:#333;overflow:hidden}
.directory-rule-batch-dialog[open]{display:flex;flex-direction:column}
.directory-rule-batch-dialog::backdrop{background:#0006}
.directory-rule-batch-dialog header{display:flex;align-items:center;justify-content:space-between;min-height:50px;padding:0 20px;border-bottom:1px solid #eee;box-sizing:border-box;font-size:16px;font-weight:400}
.directory-rule-batch-dialog header button{background:transparent;border:0;color:#999;font-size:21px;width:20px;padding:0;cursor:pointer}
.directory-rule-batch-body{flex:1;min-height:0;padding:27px 30px 20px;display:flex;flex-direction:column;box-sizing:border-box}
.directory-rule-batch-body textarea{display:block;width:100%;height:304px;max-height:100%;min-height:60px;box-sizing:border-box;resize:none;border:1px solid #d9d9d9;border-radius:0;padding:4px 8px;font:13px/21px Arial,"Microsoft YaHei",sans-serif;overflow:auto}
.directory-rule-batch-body textarea:focus-visible{outline:1px solid #5582f3;outline-offset:0}
.directory-rule-batch-body [role=alert]{color:#c33;font-size:12px;margin:6px 0 0}
.directory-rule-batch-body [role=alert]:empty{display:none}
.directory-rule-batch-dialog footer{display:flex;gap:16px;justify-content:center;align-items:center;min-height:50px;border-top:1px solid #eee}
.directory-rule-batch-dialog footer button{width:60px;height:28px;min-height:28px;padding:0;border:1px solid #ccc;border-radius:0;background:white;color:#666;font-size:14px;font-weight:400;cursor:pointer}
.directory-rule-batch-dialog footer button.primary-button{background:#5582f3;border-color:#5582f3;color:white}
.directory-rule-editor .directory-condition-table input,.directory-rule-editor .directory-condition-table select{height:28px;border-radius:0;box-sizing:border-box;padding:2px 4px}
.directory-rule-editor .directory-condition-table select{min-width:58px}
.directory-rule-editor [data-rule-key=operator]{width:130px}
.directory-rule-editor [data-rule-key][hidden]{display:none}
.directory-rule-operator{width:130px;min-width:0}
.directory-rule-operator>summary{height:28px;box-sizing:border-box;font-size:13px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.directory-rule-operator .project-scheme-options{width:180px;min-width:180px}
.directory-rule-operator [role=listbox]{max-height:290px;overflow:auto}
.directory-rule-operator .project-scheme-options input{width:100%;min-width:0;height:28px;font-size:13px}
.directory-rule-operator .project-scheme-options [role=option]{display:block;width:100%;padding:6px 10px;color:#333;font-size:13px;text-align:left}
.directory-rule-operator .project-scheme-options [role=option][hidden]{display:none}
.directory-rule-operator .project-scheme-options [role=option][aria-selected=true]{color:#5582f3;background:#eef3ff}
.directory-rule-operator .project-scheme-options [role=option]:disabled{color:#999}
.directory-rule-operator [data-rule-no-operators]{margin:8px;color:#999}
.directory-rule-small{width:66px}
.directory-rule-small>summary{padding-right:20px}
.directory-rule-small .project-scheme-options{width:66px;min-width:60px}
.directory-rule-small .project-scheme-options [role=option]{min-height:30px;padding:6px 10px}
.directory-rule-enum{min-width:180px;max-width:340px}
.directory-rule-enum>summary{height:28px;box-sizing:border-box;font-size:13px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.directory-rule-enum .project-scheme-options{min-width:200px}
.directory-rule-enum .project-scheme-options [role=option]{display:block;width:100%;padding:7px 12px;text-align:left;color:#333;font-size:13px}
.directory-rule-enum .project-scheme-options [role=option][aria-selected=true]{color:#5582f3;background:#eef3ff}
.directory-rule-enum .project-scheme-options label{display:flex;align-items:center;gap:8px;padding:7px 12px;font-size:13px;white-space:nowrap}
.directory-rule-enum .project-scheme-options input[type=checkbox]{width:14px;height:14px;min-width:14px}
.directory-rule-editor [data-rule-add]{margin-top:12px;border:1px solid #5582f3;border-radius:0;padding:3px 7px;color:#5582f3}
.directory-rule-more>summary{list-style:none;cursor:pointer;color:#666;padding:4px 6px}
.directory-rule-more>summary::-webkit-details-marker{display:none}
.directory-rule-more .directory-rule-row-menu{display:none;position:absolute;min-width:90px;width:110px;background:#fff;border:1px solid #eee;box-shadow:0 2px 8px #0002}
.directory-rule-more[open]>.directory-rule-row-menu{display:block}
.directory-rule-editor .directory-rule-more .directory-rule-row-menu button{width:100%;height:30px;padding:4px 12px;text-align:left;font-size:13px;color:#333}
.directory-rule-editor .directory-rule-more .directory-rule-row-menu button:hover{background:#eef3ff;color:#5582f3}
.directory-rule-field-dropdown{width:300px;min-width:200px}
.directory-rule-field-dropdown .scheme-field-options{max-height:336px;overflow:auto}
.directory-rule-field-dropdown .scheme-field-options small{display:block;color:#999;font-size:11px}
.directory-rule-field-dropdown [data-rule-field-message]{margin:4px 8px;color:#c33;font-size:12px}
.directory-rule-field-dropdown [data-rule-field-message]:empty{display:none}
.directory-reference-cell>.directory-rule-field-toggle{font-size:15px;color:#666}
.directory-reference-picker.directory-rule-object-picker:has(.hierarchy-reference-tree){width:min(960px,96vw);height:min(580px,90vh)}
.directory-reference-picker.directory-rule-object-picker:has(.hierarchy-reference-tree) .with-tree{grid-template-columns:200px minmax(0,1fr)}
.directory-rule-object-picker .directory-reference-layout{flex:1;min-height:0;height:calc(100% - 106px)}
.directory-rule-object-picker .directory-reference-tree{width:200px;min-width:150px;overflow:auto}
.directory-rule-object-picker .directory-reference-tree>select,.directory-rule-object-picker .directory-reference-tree>input{display:none}
.directory-rule-object-picker .directory-reference-scroll{overflow:auto;max-height:100%}
.directory-rule-object-picker table{min-width:820px}
.directory-rule-object-picker footer{position:relative}
.directory-rule-object-picker .directory-rule-all-applications{position:absolute;left:12px;display:flex;align-items:center;gap:6px;font-size:12px;font-weight:400}
.directory-rule-object-picker .directory-rule-all-applications input{margin:0}
@media(max-width:760px){#referenceMasterFormFields:has(.directory-rule-editor){padding:16px;gap:10px 14px;grid-template-columns:minmax(0,1fr)}#referenceMasterFormFields:has(.directory-rule-editor)>label.field{grid-template-columns:90px minmax(0,1fr)}}
