/* R169: approved blue patient workspace, scoped away from public booking. */
#patients-section { --patient-blue:#2563bb; --patient-line:#dce5f1; --patient-muted:#5c718d; }
#patients-status:empty { display:none; }
.patients-page-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:4px 0 24px; }
.patients-page-heading h2 { margin:0; color:#102c48; font-size:clamp(25px,2.5vw,36px); line-height:1.2; letter-spacing:-.6px; }
.patients-page-heading p { margin:7px 0 0; color:var(--patient-muted); font-size:15px; }
.patients-heading-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.patients-heading-actions>.button { min-height:44px; }
#patients-section .button--primary { background:#245fbc; border-color:#245fbc; color:white; }
#patients-section .button--secondary { color:#24548d; border-color:#c2d3ed; background:white; }
.patients-search-bar { display:flex; align-items:end; gap:12px; margin:0 0 18px; }
.patients-search-bar .field { min-width:0; }
.patients-search-bar .field--grow { flex:1; }
.patients-search-bar input,.patients-search-bar select { min-height:46px; }
.patients-options { position:relative; flex:none; }
.patients-options summary { list-style:none; display:flex; align-items:center; gap:20px; min-height:46px; cursor:pointer; }
.patients-options summary::-webkit-details-marker { display:none; }
.patients-options-menu { position:absolute; right:0; top:calc(100% + 8px); width:230px; padding:6px; border:1px solid var(--patient-line); background:white; border-radius:12px; box-shadow:var(--shadow-sm); z-index:5; }
.patients-options-menu button { display:block; width:100%; border:0; background:white; padding:12px; text-align:left; border-radius:7px; color:#193b55; }
.patients-options-menu button:hover { background:#edf3fd; }
.patients-table-panel { overflow:hidden; }
.patients-table-wrap { position:relative; width:100%; overflow-x:auto; }
.patients-table { width:100%; border-collapse:collapse; text-align:left; }
.patients-table th { padding:17px 22px; font-size:12px; color:#506e87; background:#f8faff; font-weight:700; white-space:nowrap; border-bottom:1px solid var(--patient-line); }
.patients-table td { padding:18px 22px; border-bottom:1px solid var(--patient-line); font-size:14px; color:#1b344b; }
.patients-table tr:last-child td { border-bottom:0; }
.patients-table tbody tr:hover { background:#f6f9ff; }
.patients-table td:nth-child(3),.patients-table td:last-child { white-space:nowrap; }
.patients-table td small { display:block; margin-top:5px; color:var(--patient-muted); font-size:12px; }
.patients-table .patients-open { border:0; padding:8px 0; background:none; color:#255eaf; font-size:13px; font-weight:650; min-height:36px; white-space:nowrap; }
.patients-table .patients-open:hover { text-decoration:underline; }
.patients-name { display:flex; align-items:center; gap:14px; min-width:190px; }
.patients-name-button { width:100%; border:0; border-radius:9px; padding:4px; margin:-4px; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.patients-name-button:hover strong { color:#225bad; text-decoration:underline; text-underline-offset:3px; }
.patients-name-button:hover .patient-avatar { background:#d9e8ff; }
.patients-name-button:focus-visible,.patients-back:focus-visible { outline:3px solid #245fbc; outline-offset:4px; }
.patient-avatar { width:48px; height:48px; flex:none; border-radius:50%; display:grid; place-items:center; font-size:17px; font-weight:750; color:#245fae; background:#e7f0ff; }
.patients-detail-heading .patient-avatar { width:54px; height:54px; font-size:20px; border-radius:15px; }
.patients-detail-heading h2 { font-size:clamp(23px,2vw,29px); letter-spacing:-.45px; }
.patients-detail-heading { margin-bottom:20px; }
.patients-identity { display:flex; align-items:center; gap:20px; min-width:0; }
.patients-identity h2 { overflow-wrap:anywhere; }
.patients-back { display:inline-flex; align-items:center; gap:10px; min-height:44px; background:white; border:1px solid #b5cae9; border-radius:10px; padding:10px 16px; color:#214e82; font:inherit; font-size:14px; font-weight:650; margin:0 0 22px; box-shadow:0 2px 4px #163c5310; cursor:pointer; }
.patients-back:hover { background:#edf4ff; border-color:#2563bb; }
.patients-back>span { font-size:20px; line-height:1; }
#patient-anamnesis { scroll-margin-top:100px; }
#patient-anamnesis:focus-visible { outline:2px solid #2563bb; outline-offset:6px; }
#patients-section .field-label-row { align-items:center; flex-wrap:wrap; gap:6px; }
#patients-section .help-trigger { flex:none; vertical-align:middle; }
#patients-section .form-error[hidden] { display:none !important; }
#patients-section .patients-detail { padding:0; }
.patient-record-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; align-items:start; }
.patient-record-column { display:grid; gap:20px; min-width:0; }
.patient-card { padding:22px; border:1px solid var(--patient-line); border-radius:13px; background:white; box-shadow:0 2px 7px #1d4a6310; min-width:0; }
.patient-card h3 { display:flex; align-items:center; gap:8px; margin:0 0 20px; color:#132e4b; font-size:17px; }
.patient-card h4 { margin:20px 0 12px; color:#132e4b; font-size:15px; }
.patient-card p { line-height:1.55; margin:8px 0; }
.patient-card .patient-card-description { color:var(--patient-muted); font-size:13px; margin-top:-10px; }
.patient-data { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 24px; margin:0; }
.patient-data>div { min-width:0; }
.patient-data dt { color:var(--patient-muted); font-size:12px; margin-bottom:6px; }
.patient-data dd { margin:0; color:#15364e; font-size:15px; overflow-wrap:anywhere; }
.patient-data .patient-data-full { grid-column:1/-1; }
.patient-divider { height:1px; background:var(--patient-line); margin:20px 0; }
.patient-contact-note { color:var(--patient-muted); font-size:12px; }
.patient-appointment { padding:14px 0; border-top:1px solid var(--patient-line); }
.patient-appointment:first-of-type { padding-top:0; border-top:0; }
.patient-appointment-heading { display:flex; align-items:start; justify-content:space-between; gap:14px; }
.patient-appointment-heading strong { font-size:14px; }
.patient-appointment small { color:var(--patient-muted); }
.patient-reason { padding-top:12px; margin-top:12px; border-top:1px solid var(--patient-line); }
.patient-reason span { display:block; font-size:12px; color:var(--patient-muted); margin-bottom:5px; }
.patient-reason p { white-space:pre-wrap; font-size:14px; }
.patient-note { background:#eff6fa; padding:14px 16px; border-radius:9px; white-space:pre-wrap; }
.patient-note-meta { color:var(--patient-muted); font-size:12px; }
.patient-card>.button { margin-top:12px; }
.patient-record-footer { margin-top:20px; display:flex; align-items:start; gap:20px; flex-wrap:wrap; justify-content:space-between; }
.patient-record-footer>details { flex:1; min-width:260px; padding:14px 18px; border:1px solid var(--patient-line); border-radius:12px; background:white; margin:0 !important; }
#patients-section .patients-supplement-form { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.patients-supplement-form .form-error,.patients-supplement-form>.patient-form-actions,.patients-supplement-form>button { grid-column:1/-1; }
.patient-wide-card { max-width:840px; }
.patient-create-form,.patient-admin-form { display:grid; gap:15px; }
.patient-create-fields { display:grid; grid-template-columns:2fr 1fr; gap:16px; }
.patient-create-fields>.field:first-child { grid-column:1/-1; }
.patient-form-actions { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.patient-admin-form textarea { width:100%; resize:vertical; }
.patient-inline-action { margin-top:16px; }
.patient-badge { display:inline-block; padding:4px 9px; border-radius:20px; font-size:11px; color:#476880; background:#edf4f8; }
.patient-badge--archived { background:#f2edf7; color:#6b557b; }
.patient-clinical { margin-top:0; padding:22px; border:1px solid var(--patient-line); border-radius:13px; background:white; box-shadow:0 2px 7px #1d4a6310; }
.patient-clinical-toolbar { display:flex; justify-content:space-between; gap:16px; align-items:center; margin-bottom:18px; }
.patient-clinical-toolbar h3 { margin:0; }
.patient-clinical-toolbar p { font-size:13px; color:var(--patient-muted); margin:5px 0; }
.patient-anamnesis { padding:0; overflow:hidden; }
.patient-anamnesis>summary { padding:17px 20px !important; background:#f6f9ff; }
.patient-anamnesis-content { padding:20px; }
.patient-clinical-section { border:1px solid var(--patient-line); border-radius:10px; margin:12px 0 !important; }
.patient-clinical-section>summary { padding:14px 16px !important; }
.patient-clinical-fields { padding:0 16px 16px; display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.patient-clinical-fields .field--wide { grid-column:1/-1; }
.patient-clinical-fields textarea { min-height:85px; resize:vertical; }
.patient-clinical-checks { display:grid; grid-template-columns:1fr 1fr; gap:10px 18px; }
.patient-clinical-checks label { font-size:13px; font-weight:400; }
.patient-clinical-feedback { white-space:pre-wrap; }
.patient-clinical-status { font-size:13px; color:#4c667b; margin-bottom:15px; }
.patient-clinical-note { padding:12px 15px; border-left:3px solid #3875ca; background:#eef4ff; font-size:13px; }
.patient-clinical-readonly { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.patient-clinical-readonly dt { margin-top:12px; color:var(--patient-muted); font-size:12px; }
.patient-clinical-readonly dd { margin:4px 0 0; }
.patient-access-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:start; padding:14px 0; border-bottom:1px solid var(--patient-line); }
.patient-access-row>div { min-width:0; }
.patient-access-row>div:last-child { display:contents; }
.patient-access-row>div:last-child>button { grid-column:2; grid-row:1; }
.patient-access-row>div:last-child>form,.patient-access-row>div:last-child>p { grid-column:1/-1; }
.patient-access-row p { margin:5px 0; font-size:13px; }
.patient-access-row select { min-width:170px; }
.patient-permission-form { padding:20px; margin-top:18px; border:1px solid #c9d8ee; border-radius:12px; background:#f6f9ff; }
.patient-permission-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.patient-permission-fields>.field { min-width:0; }
.patient-permission-fields>.field--wide { grid-column:1/-1; }
.patient-permission-fields input:not([type=checkbox]),.patient-permission-fields select,.patient-permission-fields textarea { width:100%; min-width:0; }
.patient-permission-fields textarea { min-height:86px; }
.patient-permission-fields .patients-confirmation { flex:1; min-width:0; line-height:1.5; font-weight:600; }
.patient-permission-fields .patients-confirmation input[type=checkbox] { width:20px; height:20px; min-height:20px; padding:0; margin-top:0; }
.patient-permission-fields .field-label-row { max-width:100%; }
.patient-permission-fields .patient-contact-note { margin:7px 0 0; line-height:1.5; }
.patient-clinical-access-note { padding:20px; border:1px solid #ccdaee; border-radius:12px; background:#f2f6fd; }
.patient-clinical-access-note h3 { margin:0 0 10px; color:#15364e; }
.patient-clinical-access-note p,.patient-clinical-access-note li { line-height:1.6; }
.patient-clinical-access-note ol { padding-left:22px; margin-bottom:0; }
.patient-clinical-access-note li+li { margin-top:8px; }
.patient-topnav { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,.8fr) minmax(0,1.15fr); gap:0; border:1px solid var(--patient-line); border-radius:14px; padding:14px 10px; margin:0 0 22px; background:white; box-shadow:0 3px 12px #193e7010; }
.patient-topnav-group { min-width:0; padding:0 10px; border-right:1px solid var(--patient-line); }
.patient-topnav-group:last-child { border:0; }
.patient-topnav-label { display:block; padding:0 9px 7px; font-size:10px; font-weight:700; letter-spacing:1.1px; text-transform:uppercase; color:var(--patient-muted); }
.patient-topnav-items { display:flex; flex-wrap:wrap; gap:4px; }
.patient-topnav .patient-tab { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:9px 10px; border:1px solid transparent; border-radius:8px; background:transparent; color:#49617e; font:600 12px/1.4 "Segoe UI",Arial,sans-serif; cursor:pointer; text-align:center; max-width:100%; overflow-wrap:anywhere; }
.patient-topnav .patient-tab:hover { background:#f2f6fd; color:#21549d; }
.patient-topnav .patient-tab[aria-selected=true] { background:#eaf2ff; border-color:#d4e3fb; color:#225dad; box-shadow:inset 0 -2px #3e79ca; }
.patient-topnav .patient-tab:focus-visible,.patient-tab-panel:focus-visible { outline:3px solid #6394db; outline-offset:3px; }
.patient-tab-panel { min-width:0; }
.patient-tab-panel[hidden] { display:none !important; }
.patient-data-proportional { grid-template-columns:repeat(12,minmax(0,1fr)); gap:18px 20px; }
.patient-data-proportional>div { grid-column:span 3; }
.patient-data-proportional>.patient-data-name { grid-column:span 6; }
.patient-data-proportional>.patient-data-full { grid-column:1/-1; }
.patient-data dt { font-weight:600; }
.patient-data dd { min-height:42px; padding:10px 12px; border:1px solid #e0e8f4; border-radius:8px; background:#f8faff; line-height:1.45; }
.patient-assignments { margin:18px 0 0 !important; padding:16px 20px; border:1px solid var(--patient-line); border-radius:12px; background:white; }
#patients-section .patients-supplement-form { grid-template-columns:repeat(12,minmax(0,1fr)); }
.patients-supplement-form>.field { min-width:0; grid-column:span 6; }
.patients-supplement-form>.field:has(#patient-supplement-address) { grid-column:1/-1; }
.patients-supplement-form .patient-form-actions { border-top:1px solid var(--patient-line); padding-top:16px; margin-top:4px; }
.patient-tab-panel .patient-record-footer { margin-top:18px; }
@media(max-width:900px) { .patient-topnav { grid-template-columns:minmax(0,1fr) minmax(0,.85fr) minmax(0,1.1fr); padding:12px 6px; } .patient-topnav-group { padding:0 6px; } .patient-topnav .patient-tab { font-size:12px; padding:9px 8px; } .patient-data-proportional>div { grid-column:span 6; } }
@media(max-width:540px) { .patient-topnav { grid-template-columns:minmax(0,1fr); padding:4px 12px; margin-bottom:18px; } .patient-topnav-group { padding:10px 0; border-right:0; border-bottom:1px solid var(--patient-line); } .patient-topnav-label { padding-bottom:5px; } .patient-topnav .patient-tab { min-height:44px; padding:8px; font-size:12px; } .patient-data.patient-data-proportional,#patients-section .patients-supplement-form { grid-template-columns:minmax(0,1fr); } .patient-data-proportional>div,.patient-data-proportional>.patient-data-name,.patients-supplement-form>.field { grid-column:1/-1; } .patient-clinical { padding:17px; } .patient-data dd { font-size:14px; } .patient-assignments { padding:14px; } }
@media(max-width:1100px) { .patients-table th,.patients-table td { padding:16px; } .patient-record-grid { gap:16px; } .patient-card { padding:18px; } .patients-page-heading { flex-wrap:wrap; } }
@media(max-width:800px) { .patients-page-heading { align-items:start; flex-direction:column; gap:16px; } .patients-search-bar { flex-wrap:wrap; } .patients-search-bar>.field:first-child:not([hidden]) { width:100%; } .patient-record-grid { grid-template-columns:1fr; } .patients-heading-actions { width:100%; } .patient-clinical-toolbar { flex-wrap:wrap; } .patients-table td,.patients-table th { padding:14px 12px; } }
@media(max-width:520px) { .patients-table { min-width:620px; } .patients-search-bar { gap:8px; } .patients-search-bar .field--grow { flex-basis:100%; } .patients-search-bar>button { flex:1; } .patients-options { flex:1; } .patients-options summary { justify-content:space-between; } .patients-heading-actions { justify-content:flex-start; } .patients-heading-actions>.button { flex:1 1 140px; padding:11px; font-size:13px; } .patients-identity { gap:13px; } .patients-detail-heading .patient-avatar { width:50px; height:50px; font-size:19px; } .patient-data,.patient-create-fields,.patient-clinical-fields,.patient-clinical-checks,.patient-permission-fields,#patients-section .patients-supplement-form { grid-template-columns:1fr; } .patient-card,.patient-permission-form { padding:17px; } .patient-record-footer { display:block; } .patient-record-footer>details { margin-top:12px !important; min-width:0; } .patient-access-row { flex-wrap:wrap; } .patients-pagination { flex-wrap:wrap; } }

/* Ficha aprovada: cabeçalho compacto, ação na seção e cartões completos. */
.patient-icon { width:17px; height:17px; flex:none; vertical-align:middle; }
#patient-detail-page { color:#193451; font-family:"Segoe UI",Arial,sans-serif; }
#patient-detail-page .button { display:inline-flex; align-items:center; justify-content:center; gap:8px; font-size:12px; min-height:39px; border-radius:7px; }
#patient-detail-page .patients-detail-heading { margin:0 0 18px; gap:16px; }
#patient-detail-page .patients-detail-heading h2 { font-size:24px; font-weight:500; line-height:1.25; }
#patient-detail-page .patients-detail-heading p { font-size:12px; line-height:1.5; margin-top:6px; }
#patient-detail-page .patients-identity { gap:14px; }
#patient-detail-page .patient-avatar { width:52px; height:52px; border:1px solid #dce5f1; background:white; border-radius:12px; font-size:19px; font-weight:500; box-shadow:0 2px 5px #17365609; }
#patient-detail-page .patients-back { min-height:34px; margin-bottom:16px; padding:5px 0; border:0; background:none; box-shadow:none; font-size:12px; font-weight:500; }
.patient-topnav { grid-template-columns:minmax(0,1.15fr) minmax(0,.8fr) minmax(0,1.2fr); border-radius:10px; padding:12px 8px; margin-bottom:22px; }
.patient-topnav-label { font-size:9px; font-weight:500; letter-spacing:1px; padding-bottom:5px; }
.patient-topnav .patient-tab { min-height:36px; padding:8px; gap:7px; font-size:12px; font-weight:500; border-radius:5px; }
.patient-topnav-items { gap:3px; }
.patient-topnav .patient-icon { width:15px; height:15px; }
.patient-section-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 20px; margin:0 0 14px; }
.patient-section-heading>div { min-width:0; }
.patient-section-heading h3 { font-size:18px; color:#193451; font-weight:500; margin:0 0 4px; line-height:1.4; }
.patient-section-heading p { margin:0; color:var(--patient-muted); font-size:13px; line-height:1.5; }
.patient-record-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
.patient-record-grid[hidden] { display:none; }
.patient-card { padding:18px; border-radius:10px; box-shadow:0 2px 5px #193e7008; }
.patient-card h3 { font-weight:500; font-size:15px; line-height:1.5; margin:0 0 16px; }
.patient-card h3>.patient-icon { color:#2463be; }
.patient-card-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 16px; }
.patient-card-heading h3 { margin:0; }
.patient-card-action { margin:0; }
#patient-detail-page .patient-card-action { border:0; min-height:28px; padding:3px 0 3px 10px; background:none; }
.patient-data-proportional { gap:14px 16px; }
.patient-data-proportional>div { grid-column:span 3; }
.patient-data-proportional dt { font-size:12px; font-weight:400; margin-bottom:5px; }
.patient-data-proportional dd { min-height:36px; padding:8px 10px; font-size:13px; line-height:1.45; border-color:#d8e4f5; border-radius:5px; background:#f8faff; }
.patient-data-proportional>.patient-col1,.patient-supplement-group>.patient-col1 { grid-column:span 1; }
.patient-data-proportional>.patient-col2,.patient-supplement-group>.patient-col2 { grid-column:span 2; }
.patient-data-proportional>.patient-col3,.patient-supplement-group>.patient-col3 { grid-column:span 3; }
.patient-data-proportional>.patient-col4,.patient-supplement-group>.patient-col4 { grid-column:span 4; }
.patient-data-proportional>.patient-col5,.patient-supplement-group>.patient-col5 { grid-column:span 5; }
.patient-data-proportional>.patient-col6,.patient-supplement-group>.patient-col6 { grid-column:span 6; }
.patient-supplement-group>.patient-col8 { grid-column:span 8; }
.patient-supplement-group>.patient-col12 { grid-column:1/-1; }
.patient-card .patient-contact-note { font-size:12px; margin:12px 0 0; }
#patients-section .patients-supplement-form { display:grid; grid-template-columns:minmax(0,1fr); gap:20px; }
.patient-supplement-group { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:14px 16px; padding:14px 0 0; border:0; border-top:1px solid var(--patient-line); margin:0; min-width:0; }
.patient-supplement-group legend { color:#193451; font-size:14px; font-weight:600; padding-right:12px; }
.patient-supplement-group .field { min-width:0; }
.patient-supplement-group .field label { font-size:12px; font-weight:400; color:var(--patient-muted); }
.patient-supplement-group input { font-size:13px; min-height:38px; padding:8px 10px; border-radius:6px; }
.patient-identity-correction[hidden] { display:none!important; }
.patient-identity-correction>* { grid-column:1/-1; }
.patient-identity-correction>label { font-size:12px; color:var(--patient-muted); }
.patient-identity-correction textarea { width:100%; min-height:86px; padding:10px 12px; border:1px solid #c3d5ef; border-radius:6px; font:inherit; color:#193451; resize:vertical; }
.patient-identity-correction .patients-confirmation input { min-height:0; width:auto; }
.patient-supplement-card { margin-top:14px; }
.patient-assignments { margin:0 0 18px !important; }
.patient-assignments[hidden] { display:none; }
.patient-identity-dialog { width:min(760px,calc(100vw - 28px)); max-height:calc(100dvh - 40px); overflow:auto; padding:24px; border:1px solid var(--patient-line,#dce5ef); border-radius:14px; background:#fff; color:#183d62; box-shadow:0 22px 80px #17375340; }
.patient-identity-dialog::backdrop { background:#18345670; }
.patient-identity-dialog-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; }
.patient-identity-dialog h2 { margin:0; font-size:21px; line-height:1.35; }
.patient-identity-dialog p { line-height:1.6; }
.patient-identity-dialog .form-stack { display:flex; flex-direction:column; gap:12px; margin-top:22px; }
.patient-identity-dialog input:not([type=checkbox]),.patient-identity-dialog textarea { width:100%; min-height:44px; padding:10px 12px; font:inherit; border:1px solid #c7d8eb; border-radius:7px; }
.patient-identity-dialog .patients-confirmation { display:flex; align-items:flex-start; gap:9px; }
.patient-identity-dialog .patients-document-result { min-width:0; }
.patient-identity-dialog .form-error[hidden] { display:none!important; }
.patient-identity-success { padding:14px 16px; border:1px solid #c7ddef; border-radius:8px; background:#eff6ff; color:#194c7e; font-weight:600; }
@media(max-width:540px) { .patient-identity-dialog { padding:18px; } .patient-identity-dialog-header { gap:12px; } .patient-identity-dialog h2 { font-size:18px; } }
.patient-assignments .patient-section-heading h3 { font-size:17px; margin-bottom:4px; }
.patient-notes-label { color:var(--patient-muted); font-size:12px; }
.patient-notes-card .patient-note { border:1px solid #d8e4f5; border-radius:6px; background:#f8faff; min-height:135px; padding:12px; font-size:13px; line-height:1.6; margin:6px 0 12px; }
.patient-notes-card textarea { min-height:135px; font-size:13px; }
.patient-history-card .patients-audit { max-height:none; overflow:visible; }
.patient-history-event { display:flex; gap:14px; align-items:flex-start; padding:17px 0; }
.patient-history-event:first-child { padding-top:0; }
.patient-history-event:last-child { border-bottom:0; padding-bottom:0; }
.patient-history-event>.patient-icon { margin-top:3px; color:#56749b; }
.patient-history-body { min-width:0; flex:1; }
.patient-history-body>strong { font-weight:500; font-size:14px; }
.patient-history-body .patient-history-meta { color:var(--patient-muted); font-size:12px; margin:5px 0; }
.patient-history-body details { margin:8px 0 0; }
.patient-history-body details summary { font-size:12px; color:#2463be; font-weight:500; }
.patient-appointments { display:grid; gap:14px; }
.patient-appointment,.patient-appointment:first-of-type { padding:18px; border:1px solid var(--patient-line); }
.patient-appointment-heading h3 { margin:0 0 5px; }
.patient-appointment-heading p { font-size:13px; color:var(--patient-muted); margin:0; }
.patient-status-badge { display:inline-flex; align-items:center; border:1px solid #dce6f4; background:#edf3fc; color:#476388; padding:6px 10px; border-radius:6px; font-size:12px; line-height:1.4; max-width:100%; }
.patient-status-badge[data-status=cancelled],.patient-status-badge[data-status=no_show] { background:#f8f1f1; border-color:#eedada; color:#865252; }
.patient-appointment-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin:18px 0 0; gap:14px; }
.patient-appointment-meta dt { font-size:12px; color:var(--patient-muted); margin-bottom:5px; }
.patient-appointment-meta dd { font-size:13px; margin:0; overflow-wrap:anywhere; }
.patient-reason { padding-top:14px; margin-top:18px; }
.patient-reason p { margin:0; font-size:13px; line-height:1.6; }
.patient-clinical { padding:0; background:none; border:0; box-shadow:none; }
.patient-clinical-record { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:12px; }
.patient-clinical-record>div { min-width:0; }
.patient-clinical-record strong { font-weight:500; font-size:14px; }
.patient-clinical-record p { color:var(--patient-muted); font-size:12px; margin:5px 0 0; }
.patient-clinical-record-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.patient-clinical-record-actions .button { white-space:nowrap; }
.patient-anamnesis { padding:0; margin-top:14px; }
.patient-anamnesis-content { padding:18px; }
.patient-anamnesis-heading { display:flex; align-items:start; justify-content:space-between; gap:14px; margin-bottom:15px; }
.patient-anamnesis-heading h3 { margin-bottom:3px; }
.patient-anamnesis-heading .patient-contact-note { margin:0; }
.patient-anamnesis .patient-clinical-status { color:var(--patient-muted); font-size:12px; padding-bottom:15px; border-bottom:1px solid var(--patient-line); margin:0 0 16px; }
.patient-anamnesis .patient-card-description { font-size:12px; line-height:1.6; margin:0 0 18px; }
.patient-clinical-section { border:0; border-top:1px solid var(--patient-line); border-radius:0; margin:0 !important; }
.patient-clinical-section>summary { padding:15px 0 !important; font-size:13px; font-weight:500; color:#193451; }
.patient-clinical-fields { padding:0 0 18px; }
.patient-clinical-section .patient-anamnesis-content { padding:0 0 18px; }
.patient-empty-state { font-size:13px; color:var(--patient-muted); line-height:1.6; }
@media(max-width:1050px) { .patient-topnav { grid-template-columns:minmax(0,1fr) minmax(0,.8fr) minmax(0,1fr); } .patient-topnav-group { padding:0 5px; } .patient-topnav .patient-tab { font-size:11px; gap:5px; padding:7px; } }
@media(max-width:760px) { .patient-data-proportional>div,.patient-data-proportional>[class*=patient-col],.patient-supplement-group>.field { grid-column:span 6; } .patient-data-proportional>.patient-data-full,.patient-supplement-group>.patient-col12 { grid-column:1/-1; } .patient-clinical-record,.patient-card-heading { flex-wrap:wrap; } }
@media(max-width:540px) { .patient-topnav { grid-template-columns:minmax(0,1fr); padding:4px 10px; } .patient-topnav-group { padding:9px 0; } .patient-topnav .patient-tab { font-size:12px; padding:9px 7px; min-height:42px; } .patient-data.patient-data-proportional,.patient-supplement-group { grid-template-columns:minmax(0,1fr); } .patient-data-proportional>div,.patient-data-proportional>[class*=patient-col],.patient-supplement-group>.field { grid-column:1/-1; } .patient-section-heading { align-items:flex-start; } .patient-section-heading>.button { width:100%; } .patient-section-heading h3 { font-size:17px; } .patient-appointment-heading,.patient-anamnesis-heading { flex-wrap:wrap; } .patient-appointment-meta { grid-template-columns:1fr; } .patient-card { padding:16px; } .patient-anamnesis { padding:0; } .patient-anamnesis-content { padding:16px; } .patient-clinical-record-actions { width:100%; justify-content:space-between; } .patient-history-event { gap:10px; } #patient-detail-page .patients-detail-heading h2 { font-size:21px; } }

/* R174: editing keeps the same cards, rows and field surfaces. */
#patients-section .patient-record-grid.patients-supplement-form{gap:14px;margin:0}
.patient-inline-edit .patient-data-proportional dd{padding:0;display:flex;align-items:center;min-height:36px}
#patients-section .patient-inline-edit .patient-data-proportional dd>input{display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;margin:0;padding:8px 10px;min-height:0;height:100%;border:0;border-radius:5px;background:transparent;box-shadow:none;color:inherit;font:inherit;line-height:1.45}
#patients-section .patient-inline-edit .patient-data-proportional dd>input:focus{outline:2px solid #3d7ce2;outline-offset:0;background:#fff}
.patient-record-grid [data-patient-field=cpf] dd{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:5px 10px}
#patient-detail-page .patient-cpf-action{min-height:24px;padding:1px 3px;border:0;background:none;font-size:12px;text-decoration:underline}
.patient-inline-edit>.patient-identity-correction{padding:18px;border:1px solid var(--patient-line);border-radius:10px;background:white}
.patient-inline-edit>.patient-form-actions{margin:0;padding:16px 0 0}
.patient-linked-professionals{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px 10px;max-width:620px}
.patient-linked-label{font-size:12px;color:var(--patient-muted)}
.patient-linked-names{display:flex;flex-wrap:wrap;gap:6px;font-size:12px}
.patient-professional-chip{padding:5px 9px;border:1px solid #d8e4f5;border-radius:6px;background:#f8faff}
.patient-link-form{display:flex;align-items:flex-end;gap:12px;margin:12px 0 16px;flex-wrap:wrap}
.patient-link-form>.field{flex:1 1 230px;min-width:0}
.patient-link-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.patient-appointment[role=button]{cursor:pointer;transition:border-color .15s,box-shadow .15s}
.patient-appointment[role=button]:hover{border-color:#95b8e8;box-shadow:0 3px 10px #193e7012}
.patient-appointment[role=button]:focus-visible{outline:3px solid #6394db;outline-offset:3px}
.patient-appointment-open{margin:12px 0 0;color:#245da9;font-size:12px;font-weight:600}
#patients-section .patient-clinical-fields{gap:14px 16px;align-items:start}
#patients-section .patient-clinical-fields .field>label{font-size:12px;font-weight:400;color:var(--patient-muted);line-height:1.5;margin-bottom:5px}
#patients-section .patient-clinical-fields :is(input:not([type=checkbox]),select,textarea){min-height:38px;padding:8px 10px;border:1px solid #d8e4f5;border-radius:5px;background:#f8faff;color:#193451;font:13px/1.45 "Segoe UI",Arial,sans-serif;width:100%;max-width:100%;box-sizing:border-box}
#patients-section .patient-clinical-fields textarea{min-height:72px;resize:vertical}
#patients-section .patient-clinical-fields :is(input,select,textarea):focus{background:#fff}
#patients-section .patient-clinical-fields .patients-confirmation{font-size:13px;font-weight:400}
#patients-section .patient-clinical-fields .patients-confirmation input{width:auto;min-height:0}
@media(max-width:640px){.patient-linked-professionals{justify-content:flex-start;max-width:100%}.patient-linked-label{width:100%}.patient-link-form>.button{width:100%}.patient-link-actions{justify-content:flex-start}.patient-record-grid [data-patient-field=cpf] dd{gap:8px}}

/* R175: four short answers per desktop row, with narrative fields kept wide. */
#patients-section .patient-anamnesis-content{container-type:inline-size}
#patients-section .patient-clinical-fields{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
#patients-section .patient-clinical-fields>.field{display:flex;flex-direction:column;gap:0;min-width:0}
#patients-section .patient-clinical-fields>.field>label{margin-bottom:8px;overflow-wrap:anywhere}
#patients-section .patient-clinical-fields>.field>:is(input,select,textarea){margin-top:auto}
#patients-section .patient-clinical-fields>.field--half{grid-column:span 1}
#patients-section .patient-clinical-fields>.field--wide{grid-column:1/-1}
#patients-section .patient-clinical-fields>.field--compact-text>textarea{min-height:38px;height:38px}
#patients-section .patient-clinical-checks{grid-template-columns:repeat(2,minmax(0,1fr))}
#patients-section .patient-clinical-checks .patients-confirmation{align-items:flex-start;line-height:1.5;min-width:0;overflow-wrap:anywhere}
@container(min-width:960px){
  #patients-section .patient-clinical-fields{grid-template-columns:repeat(4,minmax(0,1fr))}
  #patients-section .patient-clinical-fields>.field--half{grid-column:span 2}
  #patients-section .patient-clinical-checks{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@container(max-width:520px){
  #patients-section .patient-clinical-fields,#patients-section .patient-clinical-checks{grid-template-columns:minmax(0,1fr)}
  #patients-section .patient-clinical-fields>.field{grid-column:1/-1}
}

/* R176: local patient actions keep the directory behind a viewport dialog. */
#patients-section .patient-action-dialog{width:min(980px,calc(100vw - 28px));padding:0;border:1px solid var(--patient-line);border-radius:16px;background:#f4f7fc;color:#173d66;box-shadow:0 24px 90px #122b4c50;overscroll-behavior:contain}
#patients-section .patient-action-dialog[data-kind=new]{width:min(760px,calc(100vw - 28px))}
.patient-action-dialog-header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 20px;border-bottom:1px solid var(--patient-line);background:white}
.patient-action-dialog-header h2{font-size:22px;line-height:1.25;margin:0;letter-spacing:-.4px}
.patient-action-dialog-header>.button{flex:none;min-height:40px}
.patient-action-dialog-body{padding:20px;min-width:0}
.patient-action-dialog-status:empty{display:none}
.patient-action-dialog-status{margin:0 0 14px;font-size:13px}
.patient-action-dialog #patient-back,.patient-action-dialog .patients-detail-heading{display:none}
.patient-action-dialog #patient-detail{margin:0}
.patient-action-dialog #patient-detail>.patient-card{margin:0;width:100%;max-width:none;box-sizing:border-box}
.patient-action-dialog .patient-form-actions{margin-bottom:0}
.patient-action-dialog :is(input:not([type=checkbox]),select,textarea){width:100%;max-width:100%;min-width:0;box-sizing:border-box;border:1px solid #c2d3ed;border-radius:7px;background:white;padding:10px 12px;color:#193e70;font:inherit}
.patient-action-dialog textarea{min-height:76px;resize:vertical}
.patient-action-dialog .field-label-row{font-size:13px;line-height:1.4;gap:6px;align-items:center}
.patient-action-dialog .patient-review-search{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px 12px;margin:0 0 14px}
.patient-review-search>label,.patient-review-search>.field-label-row{grid-column:1/-1;font-size:13px}
.patient-review-search>input{min-width:0;width:100%}
.patient-review-list{display:grid;gap:10px}
.patient-review-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px;border:1px solid var(--patient-line);border-radius:10px;background:white;min-width:0}
.patient-review-row>div{min-width:0;overflow-wrap:anywhere}
.patient-review-row p{font-size:13px;color:var(--patient-muted);margin:6px 0 0}
.patient-review-row .button{flex:none}
.patient-review-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.patient-action-dialog-body>.button--back{margin-bottom:14px}
.patient-action-dialog .patient-access-row{min-width:0}
.patient-action-dialog .patient-access-row>div{min-width:0}
@media(max-width:600px){.patient-action-dialog-header{padding:14px;align-items:flex-start}.patient-action-dialog-header h2{font-size:19px}.patient-action-dialog-body{padding:12px}.patient-review-row{flex-wrap:wrap}.patient-review-actions{width:100%}.patient-review-actions>.button{flex:1}.patient-action-dialog .patients-pagination{flex-wrap:wrap;gap:12px}.patient-action-dialog .patient-access-row{flex-wrap:wrap}.patient-action-dialog .patient-access-row>div{width:100%}}

/* R177: show the decision, then only the fields needed to finish it. */
.patient-flow-intro h3{margin:0 0 6px;font-size:21px;line-height:1.3;color:#173d66}
.patient-flow-intro p{margin:0 0 16px;color:#526780;font-size:14px}
.patient-identity-comparison{padding:15px 17px;border:1px solid #d6e3f4;border-radius:10px;background:#fff;min-width:0}
.patient-identity-comparison h4{margin:0 0 12px;font-size:13px;color:#3c5e87}
.patient-identity-comparison dl{display:grid;grid-template-columns:1.5fr 1fr 1fr;gap:12px;margin:0}
.patient-identity-comparison dl>div{min-width:0;overflow-wrap:anywhere}
.patient-identity-comparison dt{font-size:12px;color:#60748c;margin:0 0 4px}
.patient-identity-comparison dd{font-size:14px;color:#163c68;margin:0;line-height:1.45;font-weight:600}
.patient-identity-comparison .patient-flow-meta{margin:10px 0 0}
.patient-flow-meta{font-size:12px;color:#60748c;line-height:1.5}
.patient-merge-comparison{display:grid;gap:12px;margin:14px 0}
.patient-guided-flow [hidden],#patients-pending-notice[hidden]{display:none!important}
.patient-flow-steps{display:flex;gap:8px 22px;flex-wrap:wrap;padding:15px 0;margin:0;list-style:none;border-bottom:1px solid #d6e3f4;font-size:13px;color:#60748c}
.patient-flow-steps [aria-current=step]{font-weight:700;color:#1d58a4}
.patient-flow-choose,.patient-flow-finish{padding-top:18px}
.patient-candidate-search{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 10px;align-items:end}
.patient-candidate-search>label,.patient-candidate-search>.field-label-row{grid-column:1/-1}
.patient-flow-search-status{font-size:13px;color:#526780;margin:10px 0;min-height:0}
.patient-flow-search-status:empty{display:none}
.patient-candidate-list{display:grid;gap:12px;margin:14px 0}
.patient-candidate-list>h4{margin:0;font-size:15px}
.patient-candidate-list>.patient-flow-meta{margin:-5px 0 0}
.patient-candidate-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}
.patient-candidate-actions>div{display:flex;align-items:center;gap:8px}
.patient-candidate-actions .patient-flow-meta{margin:0}
.patient-flow-empty{padding:18px;border:1px dashed #c4d7ef;border-radius:10px;background:#edf4fd;font-size:14px}
.patient-flow-empty strong{font-weight:600}.patient-flow-empty p{margin:6px 0 0;color:#526780;line-height:1.5}
.patient-new-choice{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 0 0;border-top:1px solid #d6e3f4;font-size:14px}
.patient-new-choice>div{flex:1;min-width:0}.patient-new-choice strong{color:#183e6b}.patient-new-choice p{margin:4px 0 0;font-size:13px;color:#526780}
.patient-new-choice>.button{flex:none}
.patient-flow-finish>.patient-flow-result{margin-bottom:15px}
.patient-flow-result h3{margin:0 0 7px;font-size:20px;outline:none}
.patient-flow-result>p{margin:0 0 14px;color:#526780;font-size:14px}
.patient-flow-finish>.patient-create-fields{margin:14px 0 18px}
.patient-flow-finish>.field-label-row,.patient-flow-finish>label{margin:14px 0 7px;font-size:13px;display:flex}
.patient-flow-finish>textarea{min-height:66px}
.patient-optional-document{margin:14px 0;padding:12px 0;border-top:1px solid #d6e3f4;border-bottom:1px solid #d6e3f4;font-size:13px}
.patient-optional-document summary{cursor:pointer;color:#1c559a;font-weight:600}
.patient-optional-document>label,.patient-optional-document>.field-label-row{margin:14px 0 7px;display:flex}
.patient-flow-finish>.patients-confirmation{font-size:13px;line-height:1.5;align-items:flex-start}
.patient-flow-finish .patient-form-actions{margin-top:18px;display:flex;justify-content:space-between;gap:12px}
#patients-pending-notice{display:flex;align-items:center;gap:14px;padding:14px 18px;border:1px solid #cbdff8;border-left:4px solid #3177cc;border-radius:10px;background:#edf5ff;margin:0 0 16px;font-size:14px;color:#153f6c}
#patients-pending-notice>div{flex:1;min-width:0}#patients-pending-notice p{margin:4px 0 0;font-size:13px;color:#526780}
@media(max-width:700px){.patient-identity-comparison dl{grid-template-columns:repeat(2,minmax(0,1fr))}.patient-identity-comparison dl>div:first-child{grid-column:1/-1}.patient-new-choice{flex-wrap:wrap}.patient-new-choice>div{flex-basis:100%}.patient-new-choice>.button{flex:1}#patients-pending-notice{flex-wrap:wrap}#patients-pending-notice>div{flex-basis:100%}.patient-candidate-actions{flex-wrap:wrap}}
@media(max-width:390px){.patient-flow-intro h3,.patient-flow-result h3{font-size:18px}.patient-flow-steps{font-size:12px;gap:8px 13px}.patient-identity-comparison{padding:13px}.patient-identity-comparison dl{grid-template-columns:minmax(0,1fr)}.patient-flow-finish .patient-form-actions{flex-direction:column-reverse}.patient-flow-finish .patient-form-actions>.button{width:100%}}

/* R178: the approved reference is the layout contract, including its numbered steps. */
#patients-section .patient-reference-dialog{width:min(1020px,calc(100vw - 32px));background:#fff;border-radius:13px}
#patients-section .patient-reference-dialog[data-step="2"]{width:min(884px,calc(100vw - 32px))}
.patient-reference-dialog::backdrop{background:#18375866;backdrop-filter:blur(4px)}
.patient-reference-dialog .patient-action-dialog-header{position:relative;padding:32px 36px 0;border:0;align-items:flex-start}
.patient-reference-dialog .patient-action-dialog-header h2{font-size:32px;line-height:1.2;letter-spacing:-.6px}
.patient-reference-dialog #patient-action-dialog-close{font-size:30px;font-weight:400;line-height:1;padding:0;width:30px;min-height:30px;min-width:30px;border:0;background:transparent;box-shadow:none}
.patient-reference-dialog .patient-action-dialog-body{display:flex;flex-direction:column;padding:8px 36px 28px}
.patient-reference-dialog #patient-detail-page{order:1;min-width:0}
.patient-reference-dialog .patient-action-dialog-body>.button--back{order:2;align-self:flex-start;margin:24px 0 0;padding:14px 0 0;border:0;border-top:1px solid #dce6f3;border-radius:0;width:100%;justify-content:flex-start;color:#185cbe;background:white;box-shadow:none;font-size:15px}
.patient-reference-dialog .patient-flow-intro p{font-size:18px;line-height:1.5;color:#5b7198;margin:0}
.patient-reference-dialog .patient-flow-steps{display:flex;justify-content:center;flex-wrap:nowrap;gap:0;padding:24px 0;margin:0;border:0;font-size:15px;line-height:1.4;color:#7991b5}
.patient-reference-dialog .patient-flow-steps li{display:flex;align-items:center;gap:12px;min-width:0}
.patient-reference-dialog .patient-flow-steps li+li::before{content:"";height:2px;background:#ccdcf3;width:clamp(40px,10vw,150px);margin:0 18px;flex:none}
.patient-reference-dialog .patient-step-number{display:grid;place-items:center;width:38px;height:38px;flex:none;background:#e8edf5;color:#6c84a9;font-size:17px;border-radius:50%;font-weight:700}
.patient-reference-dialog .patient-flow-steps [aria-current=step]{color:#155bbf;font-weight:700}
.patient-reference-dialog .patient-flow-steps [aria-current=step] .patient-step-number{background:#2462c6;color:white;box-shadow:inset 0 0 0 1px #145bd0}
.patient-reference-dialog .patient-flow-steps .is-complete{color:#26518a}
.patient-reference-dialog .patient-flow-steps .is-complete .patient-step-number{background:#e6f0ff;color:#185cbe}
.patient-reference-dialog .patient-flow-choose,.patient-reference-dialog .patient-flow-finish{padding:0}
.patient-request-summary{border:1px solid #c8daf6;border-radius:9px;overflow:hidden;background:white}
.patient-request-summary h4{margin:0;padding:12px 18px;background:#f2f6fc;color:#123b71;font-size:17px;font-weight:700}
.patient-request-summary dl{display:grid;grid-template-columns:1.4fr 1fr 1fr .75fr;padding:16px 20px;margin:0}
.patient-request-summary dl>div{padding:0 20px;border-left:1px solid #dbe6f5;min-width:0;overflow-wrap:anywhere}
.patient-request-summary dl>div:first-child{padding-left:0;border:0;align-self:start}
.patient-request-summary dt{font-size:13px;font-weight:700;color:#153967;margin:0 0 4px}
.patient-request-summary dl>div:first-child dt{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.patient-request-summary dd{font-size:15px;line-height:1.4;color:#123a6e;margin:0}
.patient-request-summary dl>div:first-child dd{font-size:20px;font-weight:700}
.patient-reference-dialog .patient-candidate-list{gap:14px;margin:18px 0}
.patient-reference-dialog .patient-flow-empty{display:flex;align-items:center;gap:22px;border:0;background:#f0f5fc;padding:16px 18px;border-radius:9px;font-size:15px}
.patient-reference-dialog .patient-flow-empty strong{font-weight:700;color:#183f72}
.patient-reference-dialog .patient-flow-empty p{margin:5px 0 0;color:#5c739d;font-size:15px;line-height:1.4}
.patient-choice-icon{display:grid;place-items:center;flex:none;width:54px;height:54px;border-radius:50%;background:#e2edff;color:#1762cc}
.patient-choice-icon .patient-icon{width:30px;height:30px}
.patient-destination-choices{display:grid;grid-template-columns:1.4fr 1fr;gap:16px}
.patient-destination-card{min-width:0;padding:24px;border:1px solid #c7daf8;border-radius:9px;background:white}
.patient-destination-existing{background:#f3f7ff}
.patient-destination-heading{display:flex;gap:20px;align-items:center;margin:0 0 24px;min-width:0}
.patient-destination-heading>div{min-width:0}
.patient-destination-heading h4{margin:0 0 5px;color:#0d315f;font-size:19px;font-weight:700;line-height:1.4}
.patient-destination-heading p{margin:0;color:#355889;font-size:15px;line-height:1.45}
.patient-reference-dialog .patient-candidate-search{grid-template-columns:minmax(0,1fr) auto;gap:5px 14px;align-items:center}
.patient-reference-dialog .patient-candidate-search .field-label-row{font-size:14px;color:#254b7e;font-weight:600;margin:0}
.patient-reference-dialog .patient-candidate-search input{min-height:50px;font-size:16px}
#patients-section .patient-reference-dialog .patient-candidate-search .button{min-height:50px;padding:10px 22px;font-size:14px}
.patient-reference-dialog .patient-new-choice{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:0;font-size:15px}
.patient-reference-dialog .patient-new-choice>div{flex:0 0 auto}
#patients-section .patient-reference-dialog .patient-new-choice .button{width:100%;min-height:50px;margin-top:auto;border-color:#2465c8;color:#155bbb;font-size:15px}
.patient-reference-dialog .patient-choice-hint{font-size:14px;line-height:1.5;color:#61769c;margin:13px 0 0}
.patient-selected-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;background:#f0f5fd;border:1px solid #e2edfd;border-radius:6px;margin-bottom:18px}
.patient-reference-dialog .patient-selected-bar h3{margin:0;font-size:16px;font-weight:400;line-height:1.5;color:#1b427d}
.patient-selected-bar h3 strong{font-weight:700}
.patient-selected-bar .button{display:inline-flex;align-items:center;gap:8px;flex:none;border-color:#4380da;color:#185dbe;min-height:42px;padding:8px 12px}
.patient-selected-bar .patient-icon{width:20px;height:20px}
.patient-comparison-wrap{overflow:hidden;border-radius:6px}
.patient-identity-table{width:100%;table-layout:fixed;border-collapse:collapse;border-style:hidden;box-shadow:0 0 0 1px #dae5f4;font-size:15px;color:#173f76}
.patient-identity-table :is(th,td){border:1px solid #dbe5f3;text-align:left;padding:12px 16px;line-height:1.4;overflow-wrap:anywhere}
.patient-identity-table th{background:#f0f5fb;font-weight:700}
.patient-identity-table thead th:first-child{width:22%}
.patient-identity-table tbody td{background:white}
.patient-data-difference{display:inline-block;background:#fff0d5;color:#995d0a;padding:5px 12px;border-radius:6px;font-weight:600}
.patient-reference-dialog .patient-flow-result>p{font-size:14px;line-height:1.5;color:#5c749d;margin:14px 0 22px}
.patient-reference-dialog .patient-flow-finish>.field-label-row{font-size:15px;font-weight:650;color:#173e73;margin:0 0 7px}
.patient-reference-dialog #patient-reconcile-reason{min-height:44px;height:44px;padding:10px 16px;line-height:1.5;font-size:15px}
.patient-reference-dialog .patient-optional-document{border:0;padding:12px 0;margin:8px 0 12px;font-size:15px}
.patient-reference-dialog .patient-optional-document summary{font-weight:400}
.patient-reference-dialog .patients-confirmation{font-size:15px;font-weight:400;line-height:1.45;gap:12px;align-items:center;margin:12px 0 18px;color:#214d85}
.patient-reference-dialog .patients-confirmation input{width:20px;height:20px;accent-color:#2363c7;flex:none}
.patient-reconcile-effect{display:flex;align-items:center;gap:16px;padding:17px 20px;background:#edf4ff;border-radius:7px;color:#1453aa;font-size:14px;line-height:1.5}
.patient-reconcile-effect .patient-icon{width:28px;height:28px;flex:none}
.patient-reconcile-effect strong{font-weight:700}
.patient-reconcile-effect p{font-size:13px;color:#4c6b9a;margin:2px 0 0}
.patient-reference-dialog .patient-flow-finish .patient-form-actions{border-top:1px solid #d8e4f4;margin-top:20px;padding-top:20px}
.patient-reference-dialog .patient-form-actions .button{min-height:46px;padding:10px 22px;font-size:14px}
#patients-section #patients-pending-notice{margin:0 0 24px;padding:24px;border:1px solid #bfd7f8;border-radius:9px;background:#edf5ff;font-size:18px;gap:22px}
#patients-pending-notice .patient-pending-count{display:grid;place-items:center;background:#d6e9ff;color:#134d98;width:54px;height:54px;flex:none;border-radius:50%;font-size:25px;font-weight:700}
#patients-pending-notice strong{color:#164b91;font-size:20px}
#patients-pending-notice p{font-size:15px;margin:4px 0 0;color:#506b91}
#patients-pending-notice>.button{min-height:48px;padding:10px 24px;flex:none}
#patients-section .patients-search-bar{padding:24px 22px;background:#fff;border:1px solid #d5e3f6;border-radius:9px;align-items:center;margin-bottom:24px;gap:16px}
#patients-section .patients-search-bar>.field--grow{display:flex;align-items:center;gap:16px;min-width:0}
#patients-section .patients-search-bar>.field--grow>.field-label-row{display:flex;margin:0;white-space:nowrap;font-size:15px;font-weight:650;color:#173e72}
#patients-section .patients-search-bar>.field--grow input{flex:1;min-width:100px;font-size:16px;min-height:56px;margin:0}
#patients-section .patients-search-bar>.button[type=submit]{background:#245fbc;color:white;border-color:#245fbc;min-height:56px;padding:10px 26px}
#patients-section .patients-table .patients-open{border:1px solid #82ace8;border-radius:8px;background:#fff;padding:10px 18px;min-height:44px;color:#1457b4;font-size:14px}
#patients-section .patients-table th{font-size:14px;padding:20px 22px;color:#24476c}
#patients-section .patients-table td{font-size:15px;padding:19px 22px}
#patients-section .patients-name strong{font-weight:500}
#patients-section .patients-page-heading:not(.patients-detail-heading){min-height:70px;margin:0 0 20px}
#patients-section .patients-page-heading:not(.patients-detail-heading) h2{font-size:38px;line-height:1.25;letter-spacing:-.5px}
#patients-section .patients-heading-actions :is(.button,.compact-action>.button){font-size:16px;min-height:50px;padding:12px 22px;white-space:nowrap}
#patients-section .patients-search-bar .field-label-row{font-size:16px}
#patients-section .patients-search-bar>.button[type=submit],#patients-section .patients-options summary{font-size:15px}
#patients-section .patients-options summary{min-height:56px}
#patients-section #patients-pending-notice>.button{font-size:15px}
#patients-section .patients-table-panel .patients-table th{font-size:16px}
#patients-section .patients-table-panel .patients-table td{font-size:16px}
#patients-section .patients-table-panel .patients-open{font-size:15px;min-height:46px}
#patients-section .patient-form-dialog{background:#fff}
.patient-form-dialog .patient-action-dialog-header{padding:28px 28px 12px;border:0}
.patient-form-dialog .patient-action-dialog-header h2{font-size:29px}
.patient-form-dialog .patient-action-dialog-body{padding:0 28px 26px}
.patient-form-dialog .patient-new-form-card{border:0;border-radius:0;padding:0;box-shadow:none}
.patient-form-dialog .patient-new-form-card>h3{display:none}
.patient-form-dialog .patient-flow-meta{font-size:16px;color:#5b7198;margin:0 0 12px}
.patient-form-dialog .patient-task-steps{margin:14px 0 22px}
.patient-form-dialog .patient-create-form{gap:12px}
.patient-form-dialog .patient-create-fields{padding:20px;border:1px solid #cedff5;border-radius:9px;background:#f6f9ff;grid-template-columns:1fr 1fr;margin-bottom:8px}
.patient-form-dialog .patient-create-form .field-label-row{font-size:14px}
.patient-form-dialog .patient-create-form .patients-confirmation{font-size:14px;align-items:flex-start;gap:10px}
.patient-form-dialog .patient-form-actions{border-top:1px solid #dae5f4;padding-top:20px;justify-content:space-between}
.patient-form-dialog .patient-form-actions>.button{min-height:46px;font-size:15px}
.patient-identity-dialog .patient-task-steps{font-size:12px;flex-wrap:wrap;gap:10px 0}
.patient-identity-dialog .patient-task-steps li+li{margin-left:28px}
.patient-identity-dialog .patient-task-steps li+li::after{width:10px;right:calc(100% + 8px)}
@media(max-width:900px){#patients-section .patients-search-bar>.field--grow{display:block}#patients-section .patients-search-bar>.field--grow>.field-label-row{margin-bottom:7px}.patient-destination-choices{grid-template-columns:1.3fr 1fr}.patient-destination-card{padding:18px}.patient-destination-heading{gap:12px}.patient-destination-heading h4{font-size:16px}.patient-choice-icon{width:46px;height:46px}}
@media(max-width:650px){.patient-reference-dialog .patient-action-dialog-header{padding:22px 20px 0}.patient-reference-dialog .patient-action-dialog-header h2{font-size:25px}.patient-reference-dialog .patient-action-dialog-body{padding:8px 20px 22px}.patient-reference-dialog .patient-flow-intro p{font-size:15px}.patient-reference-dialog .patient-flow-steps{font-size:13px;padding:20px 0}.patient-reference-dialog .patient-step-number{width:30px;height:30px;font-size:14px}.patient-reference-dialog .patient-flow-steps li{gap:7px}.patient-reference-dialog .patient-flow-steps li+li::before{width:24px;margin:0 10px}.patient-request-summary dl{grid-template-columns:1fr 1fr;padding:16px;gap:15px}.patient-request-summary dl>div{padding:0;border:0}.patient-request-summary dl>div:first-child{grid-column:1/-1}.patient-destination-choices{grid-template-columns:1fr}.patient-reference-dialog .patient-flow-empty{padding:14px;gap:12px;font-size:14px}.patient-reference-dialog .patient-flow-empty p{font-size:13px}.patient-reference-dialog .patient-new-choice .button{margin-top:0}.patient-selected-bar{flex-wrap:wrap;padding:12px}.patient-identity-table{font-size:13px}.patient-identity-table :is(th,td){padding:10px 8px}.patient-identity-table thead th:first-child{width:23%}.patient-data-difference{padding:4px}.patient-reference-dialog .patients-confirmation{font-size:14px}.patient-reconcile-effect{padding:14px;gap:10px}#patients-section #patients-pending-notice{padding:18px;gap:12px;flex-wrap:wrap}#patients-pending-notice>div{flex-basis:calc(100% - 64px)}#patients-pending-notice strong{font-size:16px}#patients-pending-notice p{font-size:14px}#patients-pending-notice>.button{margin-left:62px}#patients-section .patients-search-bar{padding:16px;flex-wrap:wrap;gap:12px}#patients-section .patients-search-bar>.field--grow{flex-basis:100%}#patients-section .patients-search-bar input{width:100%}.patient-reference-dialog .patient-flow-finish .patient-form-actions{flex-direction:row;flex-wrap:wrap}.patient-reference-dialog .patient-form-actions .button{padding:10px 16px}}
@media(max-width:390px){.patient-reference-dialog .patient-action-dialog-header{padding:18px 16px 0}.patient-reference-dialog .patient-action-dialog-body{padding:8px 16px 18px}.patient-reference-dialog .patient-flow-steps{font-size:12px}.patient-reference-dialog .patient-flow-steps li{gap:5px}.patient-reference-dialog .patient-flow-steps li+li::before{width:12px;margin:0 6px}.patient-reference-dialog .patient-step-number{width:26px;height:26px;font-size:13px}.patient-reference-dialog .patient-candidate-search{gap:7px}.patient-reference-dialog .patient-candidate-search .button{padding:10px 14px}.patient-reference-dialog .patient-form-actions .button{width:auto}#patients-pending-notice>.button{margin-left:0}}
@media(max-width:650px){#patients-section .patients-page-heading:not(.patients-detail-heading){margin:6px 0 20px;min-height:0;gap:16px}#patients-section .patients-page-heading:not(.patients-detail-heading) h2{font-size:29px}#patients-section .patients-heading-actions :is(.button,.compact-action>.button){font-size:14px;min-height:44px;padding:10px 14px}.patient-form-dialog .patient-action-dialog-header{padding:20px 18px 8px}.patient-form-dialog .patient-action-dialog-body{padding:0 18px 20px}.patient-form-dialog .patient-create-fields{padding:16px;grid-template-columns:1fr}.patient-form-dialog .patient-create-form .patients-confirmation{margin:8px 0}.patient-form-dialog .patient-action-dialog-header h2{font-size:25px}}
@media(max-width:650px){.patient-identity-table thead th:first-child{width:28%}.patient-identity-table tbody th{font-size:12px;word-break:normal;overflow-wrap:normal}.patient-identity-table thead th{font-size:12px}.patient-reference-dialog #patient-reconcile-reason{height:66px;min-height:66px}#patients-section .patients-search-bar>.field--grow input,#patients-section .patients-search-bar>.button[type=submit],#patients-section .patients-options summary{min-height:48px}}
#patients-section #patients-search{padding-left:46px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23275596' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='7.5'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:17px center}
#patients-section .patient-reference-dialog .help-trigger{width:26px;height:26px;min-width:26px;font-size:14px}
#patients-section :is(.patients-search-bar,.patients-heading-actions,#patients-pending-notice) .help-trigger{width:26px;height:26px;min-width:26px;font-size:14px}
#patients-section #patients-list-title .help-trigger{width:28px;height:28px;font-size:15px}
#patients-section .patients-search-bar>.field--grow>.field-label-row>label{font-size:16px}
@media(min-width:651px){
 #patients-section .patient-reference-dialog .patient-flow-steps{font-size:16px}
 #patients-section .patient-reference-dialog .patient-destination-card{padding:26px}
 #patients-section .patient-reference-dialog .patient-destination-heading{margin-bottom:28px}
 #patients-section .patient-reference-dialog .patient-destination-heading h4{font-size:20px}
 #patients-section .patient-reference-dialog .patient-destination-heading p{font-size:16px}
 #patients-section .patient-reference-dialog .patient-candidate-search .field-label-row{font-size:16px}
 #patients-section .patient-reference-dialog .patient-candidate-search input{min-height:52px}
 #patients-section .patient-reference-dialog .patient-choice-hint{font-size:15px}
 #patients-section .patient-reference-dialog .patient-flow-empty{font-size:16px}
 #patients-section .patient-reference-dialog .patient-flow-empty p{font-size:16px}
 #patients-section .patient-reference-dialog .patient-selected-bar h3{font-size:17px}
 #patients-section .patient-reference-dialog .patient-identity-table{font-size:16px}
 #patients-section .patient-reference-dialog .patient-flow-result>p{font-size:15px}
 #patients-section .patient-reference-dialog .patient-flow-finish>.field-label-row{font-size:16px}
 #patients-section .patient-reference-dialog #patient-reconcile-reason{font-size:16px}
 #patients-section .patient-reference-dialog .patients-confirmation{font-size:16px}
 #patients-section .patient-reference-dialog .patient-reconcile-effect{font-size:15px}
 #patients-section .patient-reference-dialog .patient-reconcile-effect p{font-size:14px}
 #patients-section .patient-reference-dialog .patient-selected-bar .button{font-size:14px;min-height:46px}
 #patients-section .patient-reference-dialog .patient-form-actions .button{font-size:15px;min-height:50px;padding:10px 24px}
 #patients-section .patient-form-dialog .patient-form-actions .button{font-size:15px;min-height:48px}
 #patients-section .patients-search-bar>.field--grow>.field-label-row{font-size:16px}
 #patients-section .patients-search-bar>.field--grow input{font-size:18px}
}
