/* Layout for clinical templates and document previews in the existing app shell. */
.paper-preview-modal .modal-body{padding:0;overflow:auto}
.paper-preview-tools{display:flex;gap:10px 14px;align-items:center;flex-wrap:wrap;padding:10px 15px;background:var(--surface,#fff);border-bottom:1px solid var(--border,#dce8e2)}
.paper-preview-tools label,.paper-options label{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--ink,#234239)}
.paper-preview-tools select{width:auto;min-width:60px}
.paper-frame{display:block;min-height:240px;width:100%;height:min(66vh,740px);border:0;background:#e7eeeb}
.paper-options{flex:1 1 auto}
.paper-options summary{cursor:pointer;color:#245f4d;font-size:13px;font-weight:700}
#paper-fields{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
#paper-fields input:not([type=checkbox]){max-width:155px}
.record-template-wrap{display:grid;grid-template-columns:190px minmax(0,1fr);gap:16px}
.record-template-side{align-self:start;position:sticky;top:0;background:#f5faf7;border:1px solid #dbe9e1;padding:12px;border-radius:8px}
.record-template-side a,.record-template-side button{display:block;width:100%;margin-top:6px;text-align:left;white-space:normal}
.record-template-note{margin:7px 0 0;color:#4d665a;font-size:13px}
.record-template-group{margin-bottom:12px;padding:12px;border:1px solid #dae7df;border-radius:8px}
.record-template-group h3{margin:0 0 10px;font-size:15px;color:#1a5140}
.record-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px}
.record-template-grid label{display:block;font-size:13px;font-weight:700;margin-bottom:3px}
.record-template-grid textarea{width:100%;min-height:70px;resize:vertical}
.doc-section-editor{grid-column:1/-1;display:grid;gap:12px}
.doc-section-editor label{display:block;font-weight:700;margin-bottom:4px}
.doc-section-editor textarea{width:100%;min-height:74px}
.doc-service-sections h3{margin:12px 0 4px;font-size:15px;color:#1a5140}
.doc-service-sections p{white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 10px}
@media(max-width:650px){.record-template-wrap{grid-template-columns:1fr}.record-template-side{position:static}.record-template-side a{display:inline-block;width:auto;margin-right:8px}.record-template-grid{grid-template-columns:1fr}.paper-preview-tools{padding:7px}.paper-frame{height:59vh}}

.record-template-context{display:flex;gap:5px 12px;align-items:baseline;flex-wrap:wrap;background:#f4f8f6;padding:10px 12px;border:1px solid #dbe9e1;border-radius:8px}
.record-template-context span{color:#496254;font-size:13px}
.record-template-snippet{display:block;font-weight:600;margin:10px 0}
.record-template-snippet select{max-width:100%;margin-top:4px}
.record-template-more{display:flex;align-items:center;gap:6px;margin:10px 0;font-size:13px}
.record-template-grid [hidden]{display:none}

.client-paper{width:min(900px,calc(100% - 20px));max-height:90dvh;border:1px solid #cfded6;border-radius:12px;padding:0}
.client-paper::backdrop{background:#102a22a0}
.client-paper form{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:8px;background:#f4f9f6}
.client-paper form .btn{width:auto;margin:0;font-size:13px;padding:6px 10px}
.client-paper .paper-frame{height:70dvh}

.record-extra{margin-top:12px;padding-top:8px;border-top:1px solid #dbe9e1}
.record-extra summary{cursor:pointer;font-weight:650;color:#1a5140}
.record-extra .pairs{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin-bottom:0}
.record-extra .pairs div{padding:7px 9px;background:#f4f8f6}
.record-extra dt{font-size:12px;font-weight:650}
.record-extra dd{margin:3px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
