#documentRuleModal{width:min(1540px,96vw);max-width:96vw;height:min(1000px,95dvh);max-height:95dvh;padding:0;overflow:hidden;border-radius:8px}
#documentRuleForm{height:100%;max-height:none;box-sizing:border-box;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:0;padding:0;overflow:hidden}
#documentRuleForm>.taskEditorHeading{margin:0;padding:18px 56px 16px 20px;border-bottom:1px solid #d8e1ed;min-width:0}
#documentRuleForm h2{font-size:21px;margin:0;overflow-wrap:anywhere}
#documentRuleForm>.close{z-index:3;top:12px;right:14px}
#documentRuleForm>.ruleReviewLayout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);min-height:0;gap:0;overflow:hidden}
#documentRuleForm .ruleReferencePane{display:flex;flex-direction:column;gap:12px;padding:16px;min-width:0;min-height:0;border-right:1px solid #d8e1ed;background:#f6f8fb;overflow:auto}
#documentRuleForm .referenceDocumentField{display:grid;gap:8px;margin:0;padding:0;border:0;background:transparent;min-width:0}
#documentRuleForm input[type=file]{width:100%;min-width:0;box-sizing:border-box;font-size:13px}
.ruleReferenceActions{display:flex;gap:8px;flex-wrap:wrap}
#documentRuleForm .ruleReferenceActions button{font-size:13px;min-height:38px;flex:1;white-space:normal;margin:0}
#rulePdfPreview{display:flex;flex-direction:column;flex:1;min-height:350px;overflow:hidden;border:1px solid #ced8e5;background:#e3e7ec;border-radius:4px}
.rulePdfToolbar{display:flex;align-items:center;justify-content:center;gap:12px;padding:6px;background:#30363c;color:white;flex:none;font-size:13px}
#documentRuleForm .rulePdfToolbar button{width:32px;height:30px;min-height:30px;padding:0;font-size:18px;color:white;background:#424b53;border:1px solid #626c74;border-radius:4px}
.rulePdfViewport{overflow:auto;min-height:0;flex:1;padding:10px}
#rulePdfCanvas{display:block;margin:0 auto;background:white;max-width:100%;height:auto}
#documentRuleForm #rulePreviewImage{width:100%;max-height:650px;object-fit:contain;background:white}
#documentRuleForm [hidden]{display:none!important}
.rulePreviewEmpty{display:grid;place-items:center;flex:1;min-height:280px;color:#5a677b;border:1px dashed #b7c6d8;border-radius:4px;background:white;font-size:14px}
#documentRuleForm .ruleFieldsPane{min-width:0;overflow:auto;padding:16px 20px;display:flex;flex-direction:column;gap:16px;min-height:0}
#documentRuleForm .grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;min-width:0}
#documentRuleForm label{min-width:0;font-size:13px;line-height:1.5}
#documentRuleForm .wide{grid-column:1/-1}
#documentRuleForm select,#documentRuleForm input,#documentRuleForm textarea{max-width:100%;box-sizing:border-box;min-width:0;font-size:14px}
#ruleTaskDestination{display:block;font-weight:400;overflow-wrap:anywhere;background:#f3f6fa;border:1px solid #d7e0ea;padding:10px;border-radius:4px;min-height:42px;box-sizing:border-box}
#ruleReviewStatus{font-size:13px;line-height:1.5;padding:10px 12px;background:#edf4ff;color:#204e82;border-left:3px solid #3975bf;overflow-wrap:anywhere}
#ruleReviewStatus[data-state=warning]{background:#fff6de;color:#745516;border-color:#bd8e24}
#ruleReviewStatus[data-state=error]{background:#fff0ef;color:#a32921;border-color:#bf4136}
#ruleReviewStatus[data-state=ready]{background:#edf8f1;color:#246645;border-color:#299263}
.ruleTextDetails summary,#ruleAdvanced summary{cursor:pointer;font-weight:600;font-size:14px;padding:10px 0}
#ruleReferenceText{font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;overflow:auto;max-height:200px;min-height:60px;background:#f6f8fb;border:1px solid #d7e0ea;padding:10px;margin:0;font-family:Consolas,monospace;user-select:text}
.ruleTeachControls,.ruleModelControls{display:flex;align-items:flex-end;gap:10px;min-width:0;margin-top:10px}
#documentRuleForm .ruleTeachControls label,#documentRuleForm .ruleModelControls label{flex:1;min-width:0}
#documentRuleForm .ruleTeachControls button,#documentRuleForm .ruleModelControls button{font-size:13px;min-height:42px;margin:0;white-space:normal}
#ruleSelectedExcerpt{display:block;overflow-wrap:anywhere;font-size:12px;color:#36587c;max-height:75px;overflow:auto;margin-top:8px;white-space:pre-wrap}
#ruleReferenceText::selection{background:#ffe294;color:#162332}
@media(max-width:480px){.ruleTeachControls{flex-direction:column;align-items:stretch}.ruleTeachControls label,.ruleTeachControls button{width:100%}}
.ruleResultsHeading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
#documentRuleForm .ruleResultsHeading h3{font-size:15px;margin:0}
#ruleTestReading{font-size:13px;padding:8px 12px;white-space:normal;min-height:36px}
.ruleResultRow{display:grid;grid-template-columns:115px minmax(0,1fr);gap:10px;padding:10px 0;border-bottom:1px solid #e1e7ef;font-size:13px;line-height:1.5}
.ruleResultRow dt{font-weight:600}.ruleResultRow dd{margin:0;overflow-wrap:anywhere}.ruleResultRow small{display:block;font-size:12px;color:#64748b}.ruleResultRow[data-state=missing] small{color:#936217}
#ruleReviewResults dl{margin:0}
#ruleSavedConfiguration h3{font-size:16px;margin:0 0 10px}
#ruleSavedConfiguration summary{font-size:16px;font-weight:600;cursor:pointer;padding:4px 0 10px}
#ruleSavedConfiguration dl{margin:0}
#ruleSavedConfiguration .ruleResultRow{grid-template-columns:105px minmax(0,1fr)}
#ruleSavedConfiguration dd{white-space:pre-line}
#documentRuleForm #ruleSavedConfiguration:not([hidden])~.rulePreviewEmpty{flex:none;min-height:100px;padding:16px;box-sizing:border-box;text-align:center}
#documentRulePatterns{font-family:Consolas,monospace;font-size:12px!important;font-weight:400;white-space:pre}
#documentRuleForm .ruleReviewConfirmation{padding:12px 0;border-top:1px solid #d8e1ed;align-items:flex-start;margin:0}
#documentRuleForm footer{position:static;display:flex;justify-content:flex-end;gap:8px;border-top:1px solid #d8e1ed;background:white;padding:12px 18px;margin:0;flex-wrap:wrap}
#documentRuleForm footer button{min-height:40px;font-size:14px}
#documentRuleForm footer #disableDocumentRule{margin-right:auto}
@media(max-width:800px){#documentRuleModal{width:96vw;height:96dvh;max-height:96dvh}#documentRuleForm>.ruleReviewLayout{display:block;overflow:auto}#documentRuleForm .ruleReferencePane{border-right:0;border-bottom:1px solid #d8e1ed;overflow:visible;padding:12px}#rulePdfPreview{height:370px;min-height:370px;flex:none}#documentRuleForm #rulePreviewImage{max-height:420px}.rulePreviewEmpty{min-height:120px;flex:none}#documentRuleForm .ruleFieldsPane{overflow:visible;padding:14px}#documentRuleForm .grid{grid-template-columns:minmax(0,1fr)}#documentRuleForm footer{padding:10px;gap:8px}#documentRuleForm footer button{flex:1}#documentRuleForm footer #disableDocumentRule{flex-basis:100%}.ruleResultRow{grid-template-columns:95px minmax(0,1fr)}#documentRuleForm h2{font-size:18px}}
.ruleFieldNotApplicable{display:flex;align-items:center;gap:6px;margin-top:7px;font-size:12px;white-space:normal;cursor:pointer}
.ruleFieldNotApplicable input{flex:0 0 auto;width:14px;height:14px;margin:0}
.ruleResultRow[data-state="not-applicable"] dd{color:#68758a}
