/* Patient record: compact clinical reading surface, scoped away from intake. */
.profile-mode{--record-ink:#25453c;--record-muted:#667b72;--record-line:#dfe7e2;--record-accent:#286c54}
.profile-mode .main{padding-bottom:12px;background:#f4f7f5}
.profile-mode .top-strip{height:44px;flex:none;font-size:11px;color:#71857b;background:#fdfefd}
.profile-mode .topbar{padding:14px 0 12px;min-height:74px;margin-bottom:8px;align-items:center;border-bottom:0}
.profile-mode .topbar h1{font-size:24px;letter-spacing:.01em;color:var(--record-ink);font-weight:700}
.profile-mode .topbar p{font-size:12px;color:var(--record-muted);line-height:1.6;margin-top:4px}
.profile-mode .topbar .button{font-size:12px;padding:8px 13px}
.profile-mode .profile-visit-bar{gap:8px 12px;margin-bottom:12px;padding:12px 14px;background:#eaf0ec;border:1px solid #dce6df;border-radius:10px}
.profile-mode .profile-visit-bar label{font-size:12px;color:#4f6c5f;gap:10px}
.profile-mode .profile-visit-bar select{border-color:#cbdcd1;border-radius:7px;color:#284e3d;font-size:12px;padding:8px 10px;background:#fff}
.profile-mode .profile-visit-bar>button{font-size:12px;padding:8px 12px;border-radius:7px}
.profile-mode #add-encounter-button{border:1px solid #c7d7cb;background:#fff;color:#3c6650;text-decoration:none}
.profile-mode #profile-plan{background:#286c54;border-color:#286c54;color:#fff}
.profile-mode #profile-plan:hover{background:#205740}
.profile-mode #profile-plan-status{gap:8px;align-items:baseline}
.profile-mode #profile-plan-status small{color:#657a6d;font-size:12px;line-height:1.5}
.profile-mode #profile-plan-status .patient-progress{font-size:11px;padding:3px 8px;border-radius:5px;background:#fff;border:1px solid #d4e0d7;color:#4f6b5b;white-space:nowrap}
.profile-mode .profile-tabs{gap:4px;background:#f4f7f5;border-color:#cfddd3;scrollbar-width:thin;scrollbar-color:#c4d3c8 transparent}
.profile-mode .profile-tabs>button{display:inline-flex;align-items:center;gap:7px;font-size:13px;font-weight:500;padding:11px 14px;color:#60766a;border-bottom:2px solid transparent;transition:color .15s,background .15s}
.profile-mode .profile-tabs>button:hover{color:#245e46;background:#eaf1ec}
.profile-mode .profile-tabs>button[aria-selected=true]{color:#215f45;background:#e5eee7;border-bottom-color:#286c54;font-weight:700}
.profile-mode .profile-tabs>button::before{content:'';display:block;flex:none;width:15px;height:15px;background:currentColor;mask:var(--record-tab-icon) center/contain no-repeat;opacity:.85}
.profile-mode [data-profile-tab=overview]{--record-tab-icon:url("./icons/profile-overview.svg")}
.profile-mode [data-profile-tab=guidance]{--record-tab-icon:url("./icons/profile-guidance.svg")}
.profile-mode [data-profile-tab=feedback]{--record-tab-icon:url("./icons/profile-history.svg")}
.profile-mode [data-profile-tab=health]{--record-tab-icon:url("./icons/profile-overview.svg")}
.profile-mode [data-profile-tab=identity]{--record-tab-icon:url("./icons/profile-identity.svg")}
.profile-mode [data-profile-tab=materials]{--record-tab-icon:url("./icons/profile-materials.svg")}
.profile-mode [data-profile-tab=history]{--record-tab-icon:url("./icons/profile-history.svg")}
.profile-mode .profile-tabs span{margin:0;font-size:11px;color:#687f70}
.profile-mode .profile-tabs .profile-tab-count:not(:empty){padding:2px 5px;border-radius:4px;background:#fff2dc;color:#8a5f22}
.profile-mode #profile-pending-count{font-size:12px;color:#8a5f22;margin-left:auto;white-space:nowrap}
.profile-mode .profile-scroll{padding:14px 2px 0;scrollbar-width:thin;scrollbar-color:#bdcdc2 transparent}
.profile-mode .profile-section{padding:17px 20px;margin-bottom:12px;border-color:var(--record-line);border-radius:9px;box-shadow:0 2px 5px #17372c03}
.profile-mode .profile-section h2{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:700;line-height:1.5;margin:0 0 15px;color:#2e5543}
.profile-mode .profile-section h2::before{content:'';width:3px;height:15px;border-radius:2px;background:#6e957c;flex:none}
.profile-mode .profile-section .profile-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 28px}
.profile-mode .profile-section[data-group=visit] .profile-fields{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 22px}
.profile-mode .profile-section[data-group=visit] .profile-field{grid-column:auto}
.profile-mode .profile-section[data-group=identity] .profile-fields{grid-template-columns:repeat(3,minmax(0,1fr))}
.profile-mode .profile-section[data-group=guidance] .profile-fields{grid-template-columns:1fr}
.profile-mode .profile-section[data-group=clinical] .profile-field[data-field=diagnosis],.profile-mode .profile-section[data-group=clinical] .profile-field[data-field=procedure]{grid-column:auto}
.profile-mode .profile-section .profile-field:has(.profile-review){grid-column:1/-1}
.profile-mode .profile-field-heading{font-size:12px;line-height:1.4;color:#657c6e;margin-bottom:7px;gap:6px}
.profile-mode .profile-value{font-size:14px;color:#29483a;line-height:1.75;margin:0}
.profile-mode .profile-missing{font-size:12px;color:#7e8f83}
.profile-mode .profile-field .field-source-icon{width:14px;height:14px;min-width:14px;font-size:10px;opacity:.8}
.profile-mode .profile-field .field-source-icon:hover{opacity:1}
.profile-mode .profile-note{font-size:12px;line-height:1.7;color:#657c6f}
.profile-mode .profile-missing-fields{padding-top:9px;margin-top:12px;border-top:1px dashed #e0e8e1;color:#6f8276;font-size:12px}
.profile-mode .profile-missing-fields summary:hover,.profile-mode .profile-other-fields>summary:hover{color:#285f45}
.profile-mode .profile-allergy{background:#fffbf0;border-color:#e6d9ba;border-left:3px solid #bd974d;padding:10px 13px;margin-bottom:12px;font-size:13px;color:#635235;border-radius:7px}
.profile-mode .profile-allergy strong{white-space:nowrap;font-size:12px;color:#7c622d}
.profile-mode .profile-material-row{padding:14px 0;gap:14px}
.profile-mode .profile-file-icon{width:38px;height:44px;border-color:#cdddce;background:#f1f6f2;font-size:11px;font-weight:700;color:#507d5e}
.profile-mode .profile-file-name{font-size:14px;color:#2e6148;font-weight:500;line-height:1.6}
.profile-mode .profile-material-row small{font-size:12px;color:#718479}
.profile-mode .profile-material-row>.text-button{border:1px solid #d5e2d8;border-radius:6px;padding:6px 12px;font-size:12px;background:#f8fbf8;text-decoration:none}
.profile-mode .profile-material-row>.text-button:hover{background:#eaf2ec}
.profile-mode .profile-history-field{border-color:var(--record-line);border-radius:8px;margin-bottom:10px}
.profile-mode .profile-history-field summary{padding:14px 18px;font-size:13px;color:#365f48;gap:10px}
.profile-mode .profile-history-field summary:hover{background:#f5f9f5}
.profile-mode .profile-history-field summary>span:last-child{margin-left:auto}
.profile-mode .profile-history-field summary::after{content:'';width:6px;height:6px;border-right:1.5px solid #75937c;border-bottom:1.5px solid #75937c;transform:rotate(45deg);flex:none;margin:0 2px 3px 5px}
.profile-mode .profile-history-field[open]>summary::after{transform:rotate(225deg);margin-top:5px}
.profile-mode .profile-history-field[open]>summary{background:#edf4ee;border-bottom:1px solid #e0e8e0}
.profile-mode .profile-history-row{padding:14px 18px 14px 25px;border-top-color:#edf1ed;border-left:3px solid #b7cdbb;margin-left:17px}
.profile-mode .profile-history-row strong{font-size:12px;font-weight:600;color:#50715c}
.profile-mode .profile-history-row small{font-size:12px;color:#6d8273}
.profile-mode .profile-history-row .text-button{font-size:12px;text-align:left;overflow-wrap:anywhere}
.profile-mode .profile-footer{padding:9px 0 0;font-size:11px;color:#708377}
.profile-mode .profile-footer #profile-history-open{display:inline-flex!important;align-items:center;gap:6px;padding:3px 0;font-size:12px;color:#60796a}
.profile-mode #profile-history-open::before{content:'';width:13px;height:13px;background:currentColor;mask:url('./icons/profile-history.svg') center/contain no-repeat}
.profile-mode .record-field-history{font-size:11px;padding:1px 5px;border:1px solid #dce6df;border-radius:4px;background:#f4f8f5;color:#50715d}
.record-history-dialog{width:min(760px,calc(100vw - 28px));max-width:none;max-height:calc(100dvh - 36px);padding:20px;border:1px solid #cfddd2;border-radius:12px;box-shadow:0 24px 90px #133c3330}
.record-history-dialog[open]{display:flex;flex-direction:column}
.record-history-dialog::backdrop{background:#163b3038}
.record-history-dialog #profile-history{min-height:0;overflow:auto;padding:3px 2px;scrollbar-gutter:stable}
.record-history-filter{display:flex;align-items:center;gap:7px;font-size:12px;color:#637b6b;margin:0 0 14px}
.record-history-filter input{width:auto;accent-color:#286c54}
.record-history-dialog .profile-source-head,.record-history-dialog .dialog-actions,.record-history-filter{flex:none}
.record-history-dialog .dialog-actions{margin-top:12px}
.profile-mode button:focus-visible,.profile-mode select:focus-visible,.profile-mode summary:focus-visible{outline:2px solid #4b8d68;outline-offset:3px}
.profile-mode .profile-source-dialog{border-radius:12px;padding:20px;border-color:#d0ded3;box-shadow:0 24px 90px #133c3330}
.profile-mode .profile-source-head h2{font-size:18px;color:#284b3b}
.profile-mode .profile-source-head p{font-size:12px;color:#65796c}
.profile-mode .profile-source-tabs{border-bottom:1px solid #dce6df;padding-bottom:10px;gap:8px}
.profile-mode .profile-source-tabs button[aria-pressed=true]{background:#e5f0e7;color:#24573e;border-color:#b7d0bc}
.profile-mode #profile-source-body,.profile-mode #source-view-text{background:#f1f4f1;border:1px solid #e0e7e1}
@media(max-width:1050px){.profile-mode .profile-section[data-group=visit] .profile-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-mode .profile-visit-bar select{max-width:310px}.profile-mode .profile-tabs>button{padding:10px 11px}}
@media(max-width:850px){.profile-mode .main{padding:0 14px 10px}.profile-mode .top-strip{height:34px}.profile-mode .profile-section[data-group=identity] .profile-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.profile-mode .topbar{min-height:65px;padding:11px 0 10px}.profile-mode .topbar h1{font-size:21px}.profile-mode .topbar p{font-size:11px}.profile-mode .profile-visit-bar{padding:10px;margin-bottom:8px;gap:8px}.profile-mode .profile-visit-bar label{display:block;font-size:11px}.profile-mode .profile-visit-bar select{max-width:100%;width:100%}.profile-mode .profile-visit-bar>button{font-size:11px;padding:7px 9px}.profile-mode #profile-plan-status small{font-size:11px}.profile-mode .profile-tabs>button{gap:5px;font-size:12px;padding:10px 9px}.profile-mode .profile-tabs>button::before{width:13px;height:13px}.profile-mode .profile-section{padding:15px;margin-bottom:10px}.profile-mode .profile-section .profile-fields,.profile-mode .profile-section[data-group=identity] .profile-fields{grid-template-columns:1fr}.profile-mode .profile-section[data-group=visit] .profile-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.profile-mode .profile-value{font-size:13px}.profile-mode .profile-field-heading{font-size:11px}.profile-mode .profile-allergy{align-items:flex-start;gap:9px;font-size:12px}.profile-mode .profile-material-row{gap:10px}.profile-mode .profile-material-row small{font-size:11px}.profile-mode .profile-source-dialog{padding:15px}}
@media(prefers-reduced-motion:reduce){.profile-mode .profile-tabs>button{transition:none}}

/* Execution feedback: patient-wide factual history. */
.profile-mode .feedback-toolbar,.profile-mode .feedback-record-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.profile-mode .feedback-toolbar{padding:18px 0 12px}.profile-mode .feedback-toolbar h2{font-size:18px;margin:0 0 6px}.profile-mode .feedback-controls{display:flex;gap:8px;flex-shrink:0}
.profile-mode .feedback-list{display:grid;gap:12px}.profile-mode .feedback-record{padding:18px 20px;border:1px solid #dce6df;border-radius:12px;background:#fff}.profile-mode .feedback-record h3{margin:0;font-size:15px;color:#214b36}
.profile-mode .feedback-meta,.profile-mode .feedback-status{font-size:12px;color:#65796c;margin:6px 0 12px;line-height:1.7}.profile-mode .feedback-line{font-size:14px;line-height:1.65;margin:5px 0;overflow-wrap:anywhere}
.profile-mode .feedback-badge{font-size:11px;border:1px solid #dce6df;border-radius:20px;padding:3px 8px;white-space:nowrap;color:#42634e}.profile-mode .feedback-badge.warning,.profile-mode .feedback-warning{color:#8a5c19;background:#fff7e8}.profile-mode .feedback-warning{font-size:12px;padding:6px 9px;border-radius:5px}
.profile-mode .feedback-corrections{border-top:1px solid #e5ece6;padding-top:10px;margin-top:12px;font-size:12px}.profile-mode .feedback-corrections summary{cursor:pointer;color:#356248}.profile-mode .feedback-history{padding:10px 12px;margin-top:10px;background:#f4f7f4;border-left:2px solid #b7cebf;overflow-wrap:anywhere}
.profile-mode .feedback-binding{font-size:12px;overflow-wrap:anywhere}.profile-mode .feedback-binding:empty{display:none}.profile-mode .feedback-binding-code{display:block;width:100%;max-width:520px;font-family:monospace;margin:10px 0}.profile-mode [data-profile-tab=feedback]::before{background-image:url('./icons/profile-guidance.svg')}
@media(max-width:700px){.profile-mode .feedback-toolbar{display:block}.profile-mode .feedback-controls{margin:10px 0}.profile-mode .feedback-record{padding:14px}.profile-mode .feedback-record-head{gap:8px}}
