.phis-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0}.phis-toolbar .spacer{flex:1}.phis-label{font-size:11px;padding:2px 6px;border-radius:4px;background:#e8eef5;color:#34455c;margin-left:5px;white-space:nowrap}.phis-label.imported{background:#d7f1f0;color:#12625e}.phis-highlight{outline:2px solid #229a93;outline-offset:-2px}
#phis-dialog{width:min(1200px,96vw);max-height:93vh;padding:0;border:1px solid #d1dbe6;border-radius:12px;color:#23354a;background:#f7f9fc}#phis-dialog::backdrop{background:#10253d80}.phis-header{position:sticky;top:0;background:white;padding:18px 22px;border-bottom:1px solid #dae2ec;z-index:2}.phis-header h2{margin:0 0 8px;font-size:19px}.phis-header .btn{float:right}.phis-body{padding:18px 22px}.phis-nav{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}.phis-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.phis-doc,.phis-section{background:white;border:1px solid #dce4ed;border-radius:8px;padding:16px;margin:12px 0}.phis-doc pre{white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;line-height:1.7;font-size:13px}.phis-body label{display:block;margin:9px 0;font-size:13px}.phis-body input:not([type=checkbox]),.phis-body select,.phis-body textarea{box-sizing:border-box;max-width:100%;padding:8px;border:1px solid #c3cfdf;border-radius:5px;font:inherit}.phis-body textarea{width:100%;min-height:90px;resize:vertical}.phis-body input[type=checkbox]{margin-right:8px}.phis-body .row{display:flex;gap:10px;flex-wrap:wrap;align-items:end}.phis-body .row label{flex:1}.phis-body blockquote{white-space:pre-wrap;margin:8px 0;padding:8px 12px;border-left:3px solid #91b5c3;color:#586c80;font-size:12px}.phis-body .note{white-space:pre-wrap}.phis-entry{display:grid;grid-template-columns:minmax(140px,1fr) 110px 2fr;gap:8px;align-items:center;border-bottom:1px solid #e3e9f1;padding:10px 0}.phis-entry textarea{min-height:55px}.phis-message{padding:10px;color:#9a3b16;white-space:pre-wrap}.phis-saved{color:#176a60;font-size:12px}.phis-busy{opacity:.7;pointer-events:none}.phis-body h3{font-size:15px}.phis-result{white-space:pre-wrap;line-height:1.7}.phis-results button{margin:8px 0}.phis-workflow{display:flex;flex-wrap:wrap;gap:8px}.phis-workflow span{padding:5px 9px;background:#edf1f7;border-radius:6px;font-size:12px}.phis-workflow .done{background:#dbf1e6;color:#1a6748}
/* The PHIS panel uses a light surface even when the dashboard follows dark mode. */
#phis-dialog{color-scheme:light;--card:#fff;--tx:#23354a;--tx2:#586c80;--tx3:#687b90;--line:#c3cfdf;--gray-bg:#edf1f7;--blue:#185fa5;--teal:#12625e}
#phis-dialog .btn{background:#fff;color:#23354a;border-color:#c3cfdf}
#phis-dialog .btn:hover{background:#edf4f8;border-color:#687b90}
#phis-dialog .btn.pri{background:#12625e;color:#fff;border-color:#12625e}
#phis-dialog .btn.pri:hover{background:#0d4d49;border-color:#0d4d49}
#phis-dialog .phis-nav .btn.pri{background:#d7f1f0;color:#124f4b;border-color:#24857e;font-weight:700;box-shadow:inset 0 -2px 0 #24857e}
#phis-dialog input:not([type=checkbox]),#phis-dialog select,#phis-dialog textarea{background:#fff;color:#23354a}
@media(max-width:700px){.phis-grid{grid-template-columns:1fr}.phis-entry{grid-template-columns:1fr 100px}.phis-entry textarea,.phis-entry blockquote{grid-column:1/-1}.phis-header,.phis-body{padding:12px}.phis-toolbar .spacer{display:none}}
/* Full-height editable consultation letter, also readable on narrow screens. */
#phis-dialog textarea[data-ph-field="draft"],#phis-dialog textarea[data-cons][data-part="reply"]{height:min(68dvh,760px);min-height:360px;font-size:16px;line-height:1.85;padding:18px;resize:vertical;tab-size:4}
@media(max-width:700px){#phis-dialog textarea[data-ph-field="draft"],#phis-dialog textarea[data-cons][data-part="reply"]{height:65dvh;min-height:320px;padding:12px}}

.consult-request-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 16px; line-height: 1.85; padding: 18px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; color: #172033; }
.phis-reply-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid var(--line);font-size:14px;overflow-wrap:anywhere}.phis-reply-row small{display:block;color:var(--tx3);margin-top:4px}.phis-reply-row .btn{flex-shrink:0}.phis-reply-dashboard{margin-bottom:12px}.phis-section[id^="phis-reply-"]{scroll-margin-top:140px}.phis-reply-dashboard h2{flex-wrap:wrap}
@media(max-width:700px){.phis-reply-row{align-items:flex-start;flex-wrap:wrap}}
.phis-sample-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:20px;align-items:center;padding:16px 0;border-bottom:1px solid #dbe3ed}.phis-sample-row:last-child{border-bottom:0}.phis-sample-identity strong{display:block;font-size:18px;color:#173b64}.phis-sample-identity span{display:block;margin-top:5px;font-size:15px;color:#465d77}.phis-sample-info{font-size:16px;font-weight:600;color:#244c7c;background:#e8f0fc;border-radius:5px;padding:7px 12px;text-align:right}.phis-sample-row .btn{font-size:16px;min-width:72px}@media(max-width:600px){.phis-sample-row{grid-template-columns:minmax(0,1fr) auto;gap:10px}.phis-sample-identity{grid-column:1/-1}.phis-sample-info{text-align:left;justify-self:start}}

.phis-visit-panel{margin:18px 0;padding:18px;background:#eef4fb;border:1px solid #c6d6e9;border-radius:8px}
.phis-visit-panel h4{margin:0 0 12px;font-size:17px;color:#173b64}
.phis-visit-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:start}
#phis-dialog .phis-visit-grid label,.phis-visit-grid>div{margin:0;font-size:15px;font-weight:600}
#phis-dialog .phis-visit-grid input,#phis-dialog .phis-visit-grid select{display:block;width:100%;margin-top:8px;font-size:16px;min-height:44px;background:white}
.phis-visit-grid strong{display:block;margin-top:8px;padding:10px 0;font-size:18px}
@media(max-width:700px){.phis-visit-grid{grid-template-columns:1fr}}
