#visit-form .visit-field-template-trigger{color:#009fba;border:0;background:transparent;font-size:13px;padding:4px 8px;min-height:30px;white-space:nowrap}
#visit-form .visit-field-template-trigger[aria-expanded=true]{background:#e7f8fb;color:#00869b}
.visit-field-template-panel{position:fixed;z-index:95;right:20px;top:100px;bottom:100px;width:min(390px,calc(100vw - 24px));display:flex;flex-direction:column;gap:12px;padding:16px;background:#fff;border:1px solid #dce6e9;border-radius:10px;box-shadow:0 12px 40px #243b5326;font-size:14px}
.visit-field-template-panel header,.visit-field-template-panel footer{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.visit-field-template-panel header strong{color:#008fa6;font-size:16px}.visit-field-template-panel button{min-height:34px}.visit-field-template-panel label{display:flex;gap:8px;align-items:center}.visit-field-template-panel label select{min-width:0;flex:1}
.visit-template-filters{display:grid;grid-template-columns:minmax(0,1fr) 120px;gap:8px}.visit-template-filters input,.visit-template-filters select{width:100%;min-width:0;margin:0}.visit-template-note{margin:0;font-size:12px;color:#6d7c86}.visit-template-results{overflow:auto;overscroll-behavior:contain;flex:1;min-height:0;display:flex;flex-direction:column;gap:4px}.visit-template-results>button{display:block;text-align:left;background:#fff;border:0;border-bottom:1px solid #edf1f3;padding:11px 8px;flex-shrink:0;border-radius:0;color:#263a44}.visit-template-results>button:hover,.visit-template-results>button:focus-visible{background:#ecfafd}.visit-template-results strong{display:block;font-size:14px;font-weight:500}.visit-template-results span{display:block;font-size:12px;font-weight:400;color:#6d7c86;line-height:1.65;margin-top:5px;white-space:pre-wrap}.visit-field-template-panel footer{font-size:12px;color:#008d9f}.visit-field-template-panel [hidden]{display:none!important}
@media(max-width:720px){.visit-field-template-panel{top:auto;bottom:max(12px,env(safe-area-inset-bottom));left:12px;right:12px;width:auto;height:min(60vh,520px);padding:14px}.clinical-field-heading{flex-wrap:wrap}.clinical-field-heading .actions{flex-wrap:wrap;gap:2px}}
@media print{.visit-field-template-panel,.visit-field-template-trigger{display:none!important}}
.visit-template-modes{display:flex;gap:0;border-bottom:1px solid #e2eaed}.visit-template-modes button{flex:1;border:0;border-radius:0;background:transparent;color:#6b7b84}.visit-template-modes button[aria-pressed=true]{color:#009fba;border-bottom:2px solid #00a6bd;background:#f0fbfd}.visit-template-results.is-terms{display:block}.visit-term-group{margin:0 0 16px}.visit-term-group h4{font-size:12px;color:#7e8e96;font-weight:400;margin:0 0 7px}.visit-term-group>div{display:flex;flex-wrap:wrap;gap:6px}.visit-term-group button{border:1px solid #dfebee;background:#fff;border-radius:4px;font-size:13px;padding:5px 9px;min-height:32px;color:#3a535f}.visit-term-group button:hover,.visit-term-group button:focus-visible{color:#0096aa;border-color:#00a8be;background:#ecfafc}
.visit-field-template-panel{width:min(500px,calc(100vw - 24px))}.visit-template-fields{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;flex-shrink:0;padding-bottom:3px}.visit-template-fields button{border:0;background:transparent;white-space:nowrap;color:#6f8089;padding:4px 9px;font-size:13px}.visit-template-fields button[aria-pressed=true]{background:#e8f9fc;color:#009bb2}.visit-template-browser{display:grid;grid-template-columns:100px minmax(0,1fr);gap:12px;flex:1;min-height:0;overflow:hidden}.visit-template-browser [data-template-groups]{overflow:auto;border-right:1px solid #e8eef1;padding-right:8px}.visit-template-browser [data-template-groups] button{display:block;text-align:left;white-space:normal;width:100%;border:0;border-radius:3px;background:transparent;font-size:13px;color:#637a86;padding:8px 6px;margin-bottom:3px}.visit-template-browser [data-template-groups] button[aria-current=true]{color:#009bb2;background:#ecfafd}.visit-template-filters{grid-template-columns:minmax(0,1fr)}.visit-template-filters select{display:none}.visit-template-browser .visit-template-results{height:100%}
@media(max-width:720px){.visit-field-template-panel{width:auto}.visit-template-browser{grid-template-columns:80px minmax(0,1fr);gap:8px}.visit-template-browser [data-template-groups] button{font-size:12px;padding:7px 5px}}

@media(min-width:1151px){.visit-field-template-panel{right:80px}}
.visit-field-template-panel{width:min(420px,calc(100vw - 24px));height:350px;bottom:auto;gap:7px;padding:10px;overflow:hidden;border-radius:7px;box-shadow:0 5px 22px #243b5324}
.visit-field-template-panel header{flex-wrap:nowrap;gap:5px;flex-shrink:0}.visit-field-template-panel header strong{font-size:13px;flex:1;white-space:nowrap}.visit-field-template-panel header button{font-size:12px;padding:3px 7px;min-height:28px;white-space:nowrap}
.visit-field-template-panel .visit-template-fields,.visit-field-template-panel .visit-template-note{display:none}.visit-field-template-panel .visit-template-modes,.visit-field-template-panel .visit-template-filters,.visit-field-template-panel>label,.visit-field-template-panel footer{flex-shrink:0}.visit-field-template-panel .visit-template-modes button{min-height:29px;font-size:12px;padding:4px}.visit-field-template-panel input,.visit-field-template-panel select{font-size:13px;min-height:30px;padding:5px 8px}.visit-field-template-panel>label{font-size:12px;margin:0}.visit-field-template-panel footer:has([data-template-status]:empty){display:none}.visit-field-template-panel footer button{min-height:26px;font-size:12px;padding:3px 5px}.visit-field-template-panel .visit-template-browser{grid-template-columns:80px minmax(0,1fr);gap:8px}.visit-field-template-panel [data-template-groups] button{padding:5px 3px;font-size:12px;min-height:28px}.visit-field-template-panel .visit-term-group{margin-bottom:10px}.visit-field-template-panel .visit-term-group h4{margin-bottom:5px}.visit-field-template-panel .visit-term-group button{padding:3px 6px;font-size:12px;min-height:28px}.visit-field-template-panel .visit-term-group>div{gap:4px}
.clinical-term-manager{min-width:0}.clinical-term-manager>[data-term-library-results]{max-height:52vh;overflow:auto}.clinical-term-manager article{display:flex;gap:12px;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid #e8eef1}.clinical-term-manager article>div:first-child{min-width:0;flex:1}.clinical-term-manager article strong{font-size:14px;font-weight:500}.clinical-term-manager article small{display:block;color:#7b8b95}.clinical-term-manager article p{font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;margin:5px 0}.clinical-term-manager [data-term-library-status]{font-size:12px;color:#71838c}
