/* A single document workspace: choices on the left, editable full text on the right. */
#modal:is(.consent-editor-dialog,.consent-review-editable) {
 width:min(1420px,96vw);max-width:1420px;height:94dvh;max-height:94dvh;padding:0;overflow:hidden;border:1px solid #dce4e9;border-radius:12px;background:#fff;--ui-dialog-inset:0px;
}
#modal:is(.consent-editor-dialog,.consent-review-editable):not(.billing-reference-dialog){padding:0;border-radius:12px}
#modal:is(.consent-editor-dialog,.consent-review-editable) #modal-content{height:100%;display:flex;flex-direction:column;min-height:0}
#modal:is(.consent-editor-dialog,.consent-review-editable) #modal-content>h2{flex:none;margin:0;padding:16px 24px;border-bottom:1px solid #e7edf1;background:#fff;font-size:19px;line-height:1.4;color:#254450}
#modal:is(.consent-editor-dialog,.consent-review-editable) #modal-form{display:flex;flex-direction:column;min-height:0;flex:1;overflow:hidden}
#modal:is(.consent-editor-dialog,.consent-review-editable) #modal-form>.grid{display:block;min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-width:none}
#modal:is(.consent-editor-dialog,.consent-review-editable) #modal-form>.grid::-webkit-scrollbar{display:none}
:is(.consent-editor-dialog,.consent-review-editable) [hidden]{display:none!important}
.consent-document-workspace{display:grid;grid-template-columns:340px minmax(0,1fr);align-items:start;min-width:0;background:#f5f7f9}
.consent-document-workspace>.consent-patient-info{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px 20px;margin:0;padding:12px 24px;background:#fff;border:0;border-bottom:1px solid #e7edf1;color:#607580;font-size:13px;line-height:1.5}
.consent-document-workspace>.consent-patient-info strong{font-size:16px;color:#183e4b}
.consent-document-sidebar{position:sticky;top:0;min-width:0;max-height:calc(94dvh - 190px);overflow:auto;overscroll-behavior:contain;padding:16px 20px;background:#fff;border-right:1px solid #e7edf1;scrollbar-width:none}
.consent-document-sidebar::-webkit-scrollbar{display:none}
.consent-document-sidebar label{display:block;margin:0 0 12px;font-size:12px;color:#617783;line-height:1.5}
.consent-document-sidebar :is(input,select,textarea){min-width:0;width:100%;margin-top:6px;padding:8px;border:1px solid #dce5eb;border-radius:6px;background:#fff}
.consent-document-sidebar .grid{grid-template-columns:minmax(0,1fr);gap:0}
.consent-document-sidebar details{padding:0;border:0;background:none;box-shadow:none}
.consent-document-sidebar details>summary{padding:12px 0;cursor:pointer;font-size:13px;font-weight:500;color:#355762}
.consent-document-sidebar details>summary span{font-size:12px;color:#69818b;margin-left:6px}
.consent-document-sidebar .consent-document-templates{border-bottom:1px solid #edf1f4;margin-bottom:14px}
.consent-document-sidebar .consent-document-templates>summary{padding-top:0;font-size:14px}
.consent-document-sidebar .consent-template-quick{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:0 0 12px}
.consent-document-sidebar .consent-template-quick button{padding:8px 4px;min-width:0;min-height:38px;border:1px solid #e0e8ec;border-radius:6px;background:#fff;color:#286476;font-size:13px}
.consent-document-sidebar .consent-template-quick small{display:none}
.consent-template-variants{display:grid;gap:5px;margin:10px 0;font-size:12px}
.consent-template-variants button{width:100%;white-space:normal;text-align:left;padding:8px;font-size:12px}
.consent-document-sidebar .consent-clinical-fields{margin:0;padding:0;border:0}
.consent-clinical-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
.consent-document-workspace:has(.consent-tooth-picker[open]){grid-template-columns:470px minmax(0,1fr)}
.consent-document-sidebar .consent-tooth-picker{border-top:1px solid #edf1f4;border-bottom:1px solid #edf1f4}
.consent-tooth-picker>summary span{overflow-wrap:anywhere}
.consent-dentition-switch{display:flex;gap:4px;width:max-content;padding:3px;border-radius:7px;background:#eef4f6}
.consent-dentition-switch button{min-width:70px;padding:6px 15px;border:0;border-radius:5px;background:transparent;color:#546f7b;font-size:13px}
.consent-dentition-switch button[aria-pressed=true]{background:#fff;color:#007e9b;box-shadow:0 1px 4px #163d531a;font-weight:650}
.consent-tooth-direction{margin:10px 0 8px;font-size:12px;color:#657e89}
.consent-tooth-cross{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;background:#f8fbfc;border:1px solid #dce8ed;border-radius:8px;padding:6px}
.consent-tooth-quadrant{min-width:0;padding:7px 6px}
.consent-tooth-quadrant:nth-child(odd){border-right:2px solid #5292a3}
.consent-tooth-quadrant:nth-child(-n+2){border-bottom:2px solid #5292a3}
.consent-tooth-quadrant>strong{display:block;margin-bottom:5px;font-size:12px;line-height:1.5;color:#37606e;font-weight:600}
.consent-tooth-quadrant:nth-child(even)>strong{text-align:right}
.consent-tooth-row{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
[data-consent-dentition-chart=primary] .consent-tooth-row{grid-template-columns:repeat(5,minmax(0,1fr))}
#consent-tooth-chart .consent-tooth-row button{min-width:0;max-width:none;min-height:38px;padding:4px 0;border:1px solid transparent;border-radius:4px;font-size:15px;line-height:1.2;font-weight:600;text-align:center;background:#fff;color:#294b58;box-shadow:none}
#consent-tooth-chart .consent-tooth-row button:hover:not(:disabled){border-color:#00a4c1;background:#e4f8fc}
#consent-tooth-chart .consent-tooth-row button.selected{background:#009fbd;border-color:#0087a2;color:white;box-shadow:inset 0 -3px 0 #00758d}
#consent-tooth-chart button:focus-visible{outline:2px solid #007e9b;outline-offset:2px;z-index:1}
.consent-tooth-selection{margin:10px 0 12px;font-size:12px;line-height:1.7;color:#007c98;overflow-wrap:anywhere}
@media(max-width:1000px){.consent-document-workspace:has(.consent-tooth-picker[open]){grid-template-columns:minmax(0,1fr)}.consent-document-workspace:has(.consent-tooth-picker[open])>.consent-document-sidebar{position:static;max-height:none}.consent-tooth-cross{max-width:700px}}
.consent-document-more{margin-top:10px;border-top:1px solid #edf1f4!important}
.consent-document-sidebar .subtle{font-size:12px;line-height:1.7}
.consent-document-main{min-width:0;padding:0 24px 24px}
.consent-document-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:15px 0;color:#71858e;font-size:12px}
.consent-document-toolbar strong{font-size:14px;color:#34535e}
.consent-document-paper{min-width:0;padding:20px 28px;background:#fff;border:1px solid #e3e9ee;border-radius:7px;box-shadow:0 2px 8px #172e3805}
.consent-document-paper label{display:block;font-size:12px;color:#71838e}
#modal .consent-document-paper input[name=name]{border:0;border-bottom:1px solid #edf1f4;border-radius:0;background:transparent;padding:8px 0 16px;font-size:20px;font-weight:600;color:#234351;box-shadow:none}
#modal .consent-document-paper textarea[name=body]{width:100%;min-height:520px;max-height:none;margin:8px 0 0;padding:8px 0;border:0;border-radius:0;box-shadow:none;background:#fff;color:#304951;font-size:15px;line-height:1.95;font-family:inherit;resize:none;overflow:hidden}
#modal .consent-document-paper textarea[name=body]:disabled{opacity:1;color:#304951;background:#fff}
.consent-document-paper [data-consent-document-context] .consent-context-review{display:flex;flex-wrap:wrap;gap:8px 20px;margin:0 0 16px;padding:0 0 14px;border:0;border-bottom:1px solid #edf1f4;background:none;font-size:12px}
.consent-document-paper .consent-context-review>div{display:flex;gap:7px;max-width:100%;overflow-wrap:anywhere}
.consent-document-paper .consent-context-review>div strong{font-weight:500}
.consent-document-paper .consent-context-review>div:has(strong:empty){display:none}
#modal:is(.consent-editor-dialog,.consent-review-editable) #modal-form>.actions{flex:none;display:flex;justify-content:flex-end;align-items:center;gap:10px;margin:0;padding:12px 20px;border-top:1px solid #e3eaef;background:#fff;position:static}
#modal:is(.consent-editor-dialog,.consent-review-editable) #modal-form>.actions>button{min-height:42px;min-width:94px;padding:9px 18px}
#modal:is(.consent-editor-dialog,.consent-review-editable) #form-error{flex:none;margin:0;padding:0 20px;color:#b23c35;font-size:13px;background:#fff7f5;max-height:100px;overflow:auto}
#modal:is(.consent-editor-dialog,.consent-review-editable) #form-error:not(:empty){padding:10px 20px;border-top:1px solid #f0d9d5}
#modal:is(.consent-editor-dialog,.consent-review-editable) #form-error p{margin:0}
.consent-review-editable .consent-review-identity{display:none}
.consent-review-editable .consent-review-save-status{margin:0;padding:9px 24px;font-size:12px;background:#f4fafb;color:#527782}
.consent-review-editable .consent-sign-controls{margin:0;padding:20px 28px;border:0;border-top:1px solid #dce7ec;background:#fff}
.consent-review-editable .consent-sign-controls canvas{max-width:800px}
:is(.consent-editor-dialog,.consent-review-editable) .consent-draft-confirm{flex:none;margin:0;padding:12px 20px;border-width:1px 0 0;border-radius:0}
:is(.consent-editor-dialog,.consent-review-editable) .consent-draft-confirm .actions{position:static;margin:8px 0 0;padding:0;border:0;box-shadow:none;background:transparent}
:is(.consent-editor-dialog,.consent-review-editable) :is(button,summary):focus-visible{outline:3px solid #70c2dc;outline-offset:2px}
@media(max-width:1000px) and (min-width:761px){.consent-document-workspace{grid-template-columns:300px minmax(0,1fr)}.consent-document-sidebar{padding:14px}.consent-document-main{padding:0 16px 16px}.consent-document-paper{padding:16px 20px}}
@media(max-width:760px){
 #modal:is(.consent-editor-dialog,.consent-review-editable){width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0}
 #modal:is(.consent-editor-dialog,.consent-review-editable):not(.billing-reference-dialog){border-radius:0}
 #modal:is(.consent-editor-dialog,.consent-review-editable) #modal-content>h2{padding:14px 16px;font-size:17px}
 .consent-document-workspace{display:block}.consent-document-workspace>.consent-patient-info{padding:10px 16px;gap:4px 12px;font-size:12px}
 .consent-document-sidebar{position:static;max-height:none;overflow:visible;padding:12px 16px;border-right:0;border-bottom:1px solid #e3eaef}
 .consent-document-sidebar .consent-template-quick{grid-template-columns:repeat(5,minmax(0,1fr))}
 .consent-document-sidebar .consent-template-quick button{min-height:44px}
 .consent-document-sidebar :is(input,select,textarea){font-size:16px}
 .consent-tooth-cross{padding:4px}.consent-tooth-quadrant{padding:6px 3px}.consent-tooth-row{gap:1px}
 #consent-tooth-chart .consent-tooth-row button{min-height:44px;font-size:14px}
 .consent-document-main{padding:0 12px 16px}.consent-document-paper{padding:16px}.consent-document-toolbar{padding:12px 4px}
 #modal .consent-document-paper input[name=name]{font-size:18px}
 #modal .consent-document-paper textarea[name=body]{font-size:16px;line-height:1.85}
 #modal:is(.consent-editor-dialog,.consent-review-editable) #modal-form>.actions{padding:10px 12px calc(10px + env(safe-area-inset-bottom));gap:8px}
 #modal:is(.consent-editor-dialog,.consent-review-editable) #modal-form>.actions>button{min-width:0;min-height:44px;padding:9px 14px;flex:1}
 .consent-review-editable .consent-sign-controls{padding:16px}.consent-review-editable .consent-review-save-status{padding:9px 16px}
}
#modal:is(.consent-editor-dialog,.consent-review-editable) #modal-form>.actions{flex-wrap:wrap}
#modal.consent-review-editable #modal-form>.actions>.consent-footer-message{flex:1 0 100%;min-width:0;max-height:90px;margin:-2px 0 2px;padding:0;background:transparent;border:0}
#modal.consent-review-editable #modal-form>.actions>.consent-footer-message:not(:empty){padding:8px 10px;border-radius:5px;background:#fff7f5}
#modal:is(.consent-editor-dialog,.consent-review-editable):not(.billing-reference-dialog) #modal-content>h2{margin:0;padding:16px 24px;font-size:19px;line-height:1.4;border-radius:0;background:#fff;color:#254450}
@media(max-width:760px){#modal:is(.consent-editor-dialog,.consent-review-editable):not(.billing-reference-dialog) #modal-content>h2{padding:14px 16px;font-size:17px}}
#modal.consent-review-editable #modal-form>.actions>.consent-footer-message:has(.success){background:#edf8f2;color:#24704e}
