#patient-dialog{width:min(600px,calc(100vw - 32px));border-radius:5px;color:#0d073b;font:15px/1.5 Inter,Arial,sans-serif}#patient-dialog::backdrop{background:rgba(0,0,0,.6)}.patient-profile-form{max-height:calc(100dvh - 32px);display:flex;flex-direction:column}.patient-profile-form header{display:flex;justify-content:space-between;align-items:center;padding:24px}.patient-profile-form h2{font-size:20px;font-weight:500;margin:0}.patient-profile-form header button{font:28px/1 Arial,sans-serif;padding:0 4px;border:0;background:transparent;color:#777}.patient-profile-fields{display:grid;grid-template-columns:1fr 1fr;gap:20px 16px;padding:0 24px 28px;overflow-y:auto}.patient-profile-fields label,.patient-team-label{font-size:13px;line-height:1.6;font-weight:400;color:#757575}.patient-profile-fields input,.patient-profile-fields select{display:block;width:100%;height:36px;min-height:36px;border:1px solid #b5b5b5;border-radius:4px;color:#0d073b;font:14px Inter,Arial,sans-serif;padding:6px 10px;margin:2px 0 0;box-sizing:border-box}.patient-profile-fields .full-width{grid-column:1/-1}.patient-profile-fields .notice{margin:0}.patient-profile-form footer{display:flex;justify-content:flex-end;gap:8px;padding:16px 24px;border-top:1px solid #ddd}.patient-profile-form footer button{font:500 14px Inter,Arial,sans-serif;padding:8px 15px;min-height:36px;border-radius:4px}.patient-profile-form .primary{background:#ff8a65;border-color:#ff8a65;color:#0d073b}.patient-profile-form footer .secondary{color:#b7411b;border-color:#aaa}.patient-profile-form :focus-visible{outline:2px solid #0d073b;outline-offset:2px}.patient-team-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-height:36px;border:1px solid #b5b5b5;border-radius:4px;padding:3px 8px;margin-top:2px}.patient-team-chip{display:inline-flex;align-items:center;gap:6px;border-radius:16px;background:#ededf1;padding:1px 6px;font-size:13px}.patient-team-chip button,[data-toggle-team]{border:0;background:transparent;padding:0;color:#646075;min-height:24px;line-height:1}.patient-team-chip button{font-size:20px}[data-toggle-team]{margin-left:auto;min-width:28px}.patient-team-options{display:grid;margin-top:4px;border:1px solid #ddd;border-radius:4px;background:#fff;padding:4px;max-height:150px;overflow-y:auto}.patient-team-options button{border:0;border-radius:2px;background:#fff;text-align:left;padding:8px;font:14px Inter,Arial,sans-serif}.patient-team-options button:hover{background:#fff0e9}.patient-team-options span{padding:6px;color:#777;font-size:13px}@media(max-width:460px){.patient-profile-fields{grid-template-columns:1fr;gap:14px;padding:0 20px 20px}.patient-profile-form header{padding:20px}.patient-profile-form footer{padding:14px 20px}}
#patient-dialog .patient-profile-fields label,#patient-dialog .patient-team-label{line-height:15px}
#patient-dialog .patient-profile-fields input,#patient-dialog .patient-profile-fields select{line-height:24px;padding:5px 14px;margin-top:1px}
#patient-dialog .patient-team-label{display:block}
#patient-dialog .patient-team-chips{margin-top:4px}
#patient-dialog .patient-profile-fields{padding-bottom:28px}
#patient-dialog .patient-phone-control{display:flex;align-items:center;height:36px;border:1px solid #b5b5b5;border-radius:4px;margin-top:1px;min-width:0}
#patient-dialog .patient-phone-country{display:flex;position:relative;align-items:center;min-width:78px;padding-left:12px;white-space:nowrap;font:14px Inter,Arial,sans-serif;color:#0d073b}
#patient-dialog .patient-phone-country select{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
#patient-dialog .patient-phone-country:focus-within{outline:2px solid #0d073b;outline-offset:2px}
#patient-dialog .patient-phone-control input{min-width:0;border:0;flex:1;margin:0;height:34px;min-height:34px;padding:5px 8px;background:transparent}
#patient-dialog .patient-profile-form h2{display:flex;align-items:center;gap:8px}#patient-dialog .patient-profile-form h2 svg{color:#777;flex-shrink:0}
.personal-grid .metric h3{margin:0 0 10px;font-size:.85rem}
.personal-grid .metric dl{display:grid;gap:10px;margin:0}
.personal-grid .metric dl>div{display:grid;gap:2px}
.personal-grid .metric dt{color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.04em}
.personal-grid .metric dd{margin:0;font-size:.8125rem}
.personal-grid{margin-bottom:14px}
@media(max-width:460px){.personal-grid{grid-template-columns:1fr}}
.overview-section{margin-bottom:18px;padding:14px;border:1px solid var(--line);border-radius:7px}
.overview-section .section-heading{margin-bottom:10px}
.sub-tabs{display:flex;gap:14px;margin-bottom:10px;border-bottom:1px solid var(--line)}
.sub-tabs button{border:0;background:transparent;padding:0 0 8px;font-size:.8rem;font-weight:600;color:var(--muted);border-bottom:2px solid transparent;cursor:pointer}
.sub-tabs button.active{color:var(--teal-dark);border-bottom-color:var(--teal)}
.text-button{border:0;background:transparent;color:var(--teal-dark);font-size:.8125rem;font-weight:600;padding:0;cursor:pointer}
.record-button{width:100%;text-align:left;background:#fff;font:inherit;cursor:pointer}
.radio-row{display:flex;flex-wrap:wrap;gap:12px;font-size:.8125rem;color:var(--ink);font-weight:400}
.radio-row label{display:inline-flex;align-items:center;gap:5px;color:inherit;font-size:inherit;font-weight:inherit}
.radio-row input{width:auto;min-height:auto}
.inline-field{display:flex;align-items:center;gap:6px}
.inline-field input{flex:1}
.status-pill{border:1px solid var(--line);border-radius:20px;padding:3px 12px;font-size:.75rem;font-weight:650;background:#fff;cursor:pointer}
.chart-title-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.chart-title-row h2{margin:0}
.segmented-toggle{display:inline-flex;border:1px solid var(--line);border-radius:6px;overflow:hidden}
.segmented-toggle button{border:0;background:#fff;padding:4px 11px;font-size:.75rem;font-weight:600;color:var(--muted);cursor:pointer}
.segmented-toggle button.active{background:var(--teal);color:#fff}
.donut-row{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin:8px 0 12px}
.donut{width:120px;height:120px;border-radius:50%;flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative}
.donut::after{content:'';position:absolute;inset:18px;border-radius:50%;background:#fff}
.donut span{position:relative;z-index:1;font-weight:700;font-size:1.05rem}
.donut-empty{background:#f1f3f3;border:2px dashed var(--line)}
.donut-caption{margin:0}
.donut-legend{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:.8rem}
.donut-legend li{display:flex;align-items:center;gap:7px}
.donut-legend i{width:10px;height:10px;border-radius:50%;display:inline-block}
.donut-total{color:var(--muted);font-size:.85rem;font-weight:600}
.note-blocks{display:grid;gap:10px;margin-top:4px}
.note-block{position:relative;display:flex;align-items:flex-start;gap:8px;padding:8px;border:1px solid var(--line);border-radius:6px}
.note-block-body{flex:1;min-width:0}
.note-block-remove{flex:0 0 auto;color:var(--muted);font-size:16px;border:0;background:transparent;cursor:pointer}
.note-block-heading{font-size:1.05rem;font-weight:650;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:4px 0}
.note-block textarea{min-height:80px}
.note-block-add{margin-top:4px}
.note-block-type-picker{display:inline-flex;gap:6px;margin-left:10px;flex-wrap:wrap}
.note-block-type-picker button{min-height:30px;padding:4px 10px;font-size:.78rem}
.note-checklist{display:grid;gap:6px}
.note-checklist-item{display:flex;align-items:center;gap:8px}
.note-checklist-item input[type=text]{flex:1;min-height:32px}
.note-checklist-item input[type=checkbox]{width:auto;min-height:auto}
.note-checklist-item button{border:0;background:transparent;color:var(--muted);cursor:pointer}
.note-checklist-read{margin:0;padding-left:0;list-style:none;display:grid;gap:4px;font-size:.85rem}
.cp-note{font-size:.875rem;line-height:1.5;overflow-wrap:anywhere}
.cp-note p{margin:0 0 10px}
.cp-note h3,.cp-note h4,.cp-note h5,.cp-note h6{margin:14px 0 8px;font-size:1rem;font-weight:650}
.cp-note h5,.cp-note h6{font-size:.9rem}
.cp-note hr{border:0;border-top:1px solid var(--line);margin:14px 0}
.cp-note .cp-label{margin:12px 0 2px;font-weight:650}
.cp-note .cp-hint{margin:0 0 2px;color:var(--muted);font-size:.8rem;font-style:italic}
.cp-note .cp-unanswered{color:var(--muted)}
.cp-note .cp-image{display:block;max-width:240px;max-height:120px;margin:4px 0 8px;border:1px solid var(--line);border-radius:6px;background:#fff}
.note-table{width:100%;border-collapse:collapse}
.note-table td{border:1px solid var(--line);padding:4px}
.note-table td input{border:0;min-height:28px;padding:3px 4px}
.note-table-actions{display:flex;gap:10px;margin-top:6px}
.documentation-controls{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.documentation-controls input[type=search]{max-width:320px}
.note-group{margin-bottom:16px}
.note-group-heading{margin:0 0 8px;font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.tag.failed,.tag.suppressed{background:#fff0ed;color:var(--danger)}
/* .tag's global text-transform:capitalize Title-Cases every word, fine for
   a single status word but wrong for a full sentence-style label like
   "Not sent: client turned off email" (team-lead's exact wording). */
.tag-plain{text-transform:none}
.settings-columns{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media(max-width:460px){.settings-columns{grid-template-columns:1fr}}
@media(max-width:460px){.overview-section{padding:11px}}

/* Opening a chart changes the directory into a full workspace. */
.patient-layout.chart-active{grid-template-columns:minmax(0,1fr)}
.patient-layout.chart-active .directory-panel{display:none}
.patient-layout.chart-active .chart-panel{min-width:0;padding:clamp(18px,2.6vw,38px)}
@media(max-width:1250px){
  .patient-layout.chart-active .chart-header{flex-direction:column}
  .patient-layout.chart-active .chart-header>div:first-child,.patient-layout.chart-active .chart-header .chart-actions{flex:0 1 auto;width:100%}
  .patient-layout.chart-active .chart-actions{justify-content:flex-start}
  .patient-layout.chart-active .cp-account{grid-template-columns:minmax(0,1fr);gap:16px}
  .patient-layout.chart-active .cp-account .cp-card{min-width:0;padding:16px}
  .patient-layout.chart-active .cp-account-table{margin:0}
  .patient-layout.chart-active .cp-account-head{grid-template-columns:40px minmax(0,1fr);gap:0 12px;padding:12px}
  .patient-layout.chart-active .cp-account-head span:nth-child(n+3){display:none}
  .patient-layout.chart-active .cp-account-row{grid-template-columns:40px minmax(0,1fr) auto;gap:4px 12px;padding:12px}
  .patient-layout.chart-active .cp-account-row>[role=cell]:nth-child(3),.patient-layout.chart-active .cp-account-row>[role=cell]:nth-child(4){grid-column:3}
  .patient-layout.chart-active .cp-account-row>[role=cell]:nth-child(5){display:none}
}

/* Give clinical writing its own canvas instead of a narrow modal. */
#note-record-dialog{width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border-radius:0;background:#f5f4f1;box-shadow:none}
#note-record-dialog .patient-profile-form{width:min(1100px,100%);height:100%;max-height:none;margin:auto;background:#fff;box-shadow:0 0 45px rgb(43 32 29 / 7%)}
#note-record-dialog .patient-profile-form header,#note-record-dialog .patient-profile-form footer{padding-inline:clamp(20px,4vw,56px)}
#note-record-dialog .patient-profile-fields{display:block;flex:1;padding:28px clamp(20px,4vw,56px) 60px}
#note-record-dialog .patient-profile-fields>*{margin-bottom:22px}
#note-record-dialog .note-block textarea{min-height:300px;line-height:1.65;resize:vertical}
@media(max-width:700px){#note-record-dialog .patient-profile-fields{padding-top:20px}#note-record-dialog .note-block textarea{min-height:220px}}

/* Note templates: the Acupuncture Note is a form (fields, a pain scale, a checkbox group and a body chart to draw on),
   so its blocks sit directly on the page instead of in boxes, with 44px touch targets for iPad. */
#note-record-dialog .note-blocks{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;align-items:start}
#note-record-dialog .note-block{grid-column:1/-1}
#note-record-dialog .note-block[data-width=half]{grid-column:auto}
#note-record-dialog .note-form-block{display:block;padding:0;border:0}
#note-record-dialog .note-section-title{margin:18px 0 0;padding-bottom:6px;border-bottom:1px solid var(--line);font-size:1.15rem;font-weight:650}
#note-record-dialog h4.note-section-title{margin-top:4px;border:0;font-size:1rem;color:var(--muted)}
#note-record-dialog .note-form-block:first-child .note-section-title{margin-top:0}
.note-field,.note-choices,.note-scale{display:block;min-width:0;margin:0;padding:0;border:0}
.note-field-label{display:block;margin-bottom:4px;padding:0;font-size:.85rem;font-weight:600;color:#404040}
.note-required{color:var(--danger)}
#note-record-dialog .note-field textarea,#note-record-dialog .note-field input{display:block;width:100%;min-height:44px;margin:0;padding:10px 12px;border:1px solid #b5b5b5;border-radius:4px;font:16px/1.45 Inter,Arial,sans-serif;resize:none;overflow:hidden;box-sizing:border-box}
#note-record-dialog .note-field [aria-invalid=true]{border-color:var(--danger);box-shadow:0 0 0 1px var(--danger)}
.note-field-error{display:block;margin-top:4px;font-size:.8rem;color:var(--danger)}
.note-field-error[hidden]{display:none}
.note-choice-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px}
#note-record-dialog .note-choice{display:flex;align-items:center;gap:10px;min-height:44px;padding:6px 12px;border:1px solid #b5b5b5;border-radius:4px;cursor:pointer;font-size:.95rem;font-weight:400;color:#0d073b}
#note-record-dialog .note-choice input{flex:none;width:22px;height:22px;min-height:0;margin:0}
#note-record-dialog .note-choice:has(input:checked){border-color:#0d073b;background:#ededf1;font-weight:600}
#note-record-dialog .note-choice:has(input:focus-visible){outline:2px solid #0d073b;outline-offset:2px}
.note-scale-row{display:grid;grid-template-columns:repeat(11,minmax(44px,1fr));gap:6px}
.note-scale-button{min-height:44px;border:1px solid #b5b5b5;border-radius:4px;background:#fff;color:#0d073b;font:600 1rem Inter,Arial,sans-serif;cursor:pointer}
.note-scale-button[aria-pressed=true]{border-color:#0d073b;background:#0d073b;color:#fff}
@media(max-width:560px){.note-scale-row{grid-template-columns:repeat(6,1fr)}}
.bodychart{display:flex;flex-direction:column;align-items:center;gap:10px}
.bodychart-surface{position:relative;width:min(100%,calc((100dvh - 230px) * 1.34));aspect-ratio:670/500;margin-inline:auto;border:1px solid var(--line);border-radius:6px;background:#fff;overflow:hidden;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.bodychart-surface img{display:block;width:100%;height:100%;pointer-events:none}
.bodychart-svg{position:absolute;inset:0;width:100%;height:100%}
.bodychart-surface[data-bodychart-surface]{touch-action:none}
.bodychart-svg[data-bodychart-svg]{cursor:crosshair;touch-action:none;pointer-events:all}
.bodychart-hint{margin:0;color:var(--muted);font-size:.9rem;text-align:center}
.bodychart-input{display:flex;align-items:center;gap:8px;min-height:44px;cursor:pointer}
.bodychart-input input{width:20px;height:20px;accent-color:#E16E37}
.bodychart-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px}
.bodychart-pens{display:flex;gap:8px}
.bodychart-pen,.bodychart-tools .secondary{min-height:44px;padding:0 16px;border:1px solid #b5b5b5;border-radius:4px;font:500 .95rem Inter,Arial,sans-serif;color:#0d073b}.bodychart-tools .secondary:disabled{color:#8a8a99;cursor:default}
.bodychart-pen{display:inline-flex;align-items:center;gap:8px;background:#fff;color:#0d073b;cursor:pointer}
.bodychart-pen i{width:18px;height:18px;border-radius:50%}
.bodychart-pen[aria-pressed=true]{border-color:#0d073b;box-shadow:inset 0 0 0 1px #0d073b;background:#ededf1}
.bodychart-read{margin:0}
.bodychart-read .bodychart-surface{width:min(100%,640px);margin-inline:0}
.bodychart-read figcaption{margin-top:6px;font-size:.85rem;color:var(--muted)}
.bodychart-legend{display:flex;flex-wrap:wrap;gap:4px 16px;margin:0;padding:0;list-style:none}
.bodychart-legend li{display:flex;align-items:center;gap:6px}
.bodychart-legend i{width:10px;height:10px;border-radius:50%}
.note-read-item p{margin:0}
.note-read-label{font-size:.85rem;font-weight:600;color:#404040}
.note-read-chips{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 0;padding:0;list-style:none}
.note-read-chips li{padding:4px 10px;border-radius:16px;background:#ededf1;font-size:.9rem}
#note-record-dialog [data-note-notice]{position:sticky;bottom:0;z-index:2;box-shadow:0 -6px 12px #fff}
@media(max-width:700px){#note-record-dialog .note-blocks{grid-template-columns:minmax(0,1fr)}#note-record-dialog .note-block[data-width=half]{grid-column:1/-1}#note-record-dialog .bodychart{margin-inline:-20px}}
#note-record-dialog .bodychart-tools .text-button{min-height:44px;padding:0 8px;color:var(--muted)}
#note-record-dialog [data-note-notice]:not([hidden]){display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px}
#note-record-dialog [data-note-notice] button{min-height:44px;padding:0 16px;background:#fff}
/* Consent: a missing one is a real button, the red pill plus a "Sign now" chip so touch users see it is tappable without hover. */
.tag.consent-sign{gap:7px;min-height:36px;padding:3px 4px 3px 11px;border:0;cursor:pointer;white-space:nowrap;text-transform:none}
.tag.consent-sign span{display:inline-flex;align-items:center;min-height:28px;padding:0 11px;border-radius:999px;background:var(--danger);color:#fff;font-size:.75rem;text-transform:none}
.tag.consent-sign:hover span{background:#7d3029}
.tag.consent-sign:disabled{opacity:.6;cursor:wait}
.tag.consent-state{min-height:28px;text-transform:none}
/* The directory is a fixed-layout table, so in a narrow panel (iPad portrait, phone, or beside an open chart) the pill stacks: Missing over an underlined Sign now. */
.directory-panel{container-type:inline-size}
@container (max-width:760px){
.tag.consent-sign{flex-direction:column;align-items:flex-start;gap:1px;min-height:44px;padding:5px 11px;border-radius:12px}
.tag.consent-sign span{min-height:0;padding:0;background:none;color:inherit;text-decoration:underline;text-underline-offset:2px}
.tag.consent-sign:hover span{background:none}
.directory-table td:nth-child(2){padding-inline:6px}
}
/* On phones keep the two actions readable; show visit history under the name. */
@container (max-width:600px){
.directory-table th:nth-child(1){width:46%}.directory-table th:nth-child(2){width:26%}.directory-table th:nth-child(4){width:28%}
.directory-table th:nth-child(3),.directory-table .last-visit-cell{display:none}
.directory-table th,.directory-table td{padding-inline:8px}
.directory-table .patient-last-visit{display:block;margin-top:4px;font-size:.6875rem}
.directory-table .client-payment{padding-inline:8px;font-size:.8125rem}
}
.form-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}

.appointment-history-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.appointment-datetime-fields{min-width:0;display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:10px}
.appointment-datetime-fields>label{min-width:0}
.appointment-datetime-fields input,.appointment-datetime-fields select{min-width:0;width:100%}
.appointment-date-preview{grid-column:1/-1}
.appointment-date-preview{grid-column:1/-1;margin:0;font-size:.8125rem}
#reschedule-dialog .dialog-body{display:grid;gap:14px}
#reschedule-dialog footer{flex-wrap:wrap}
.schedule-notification{display:flex;align-items:center;gap:10px}
.schedule-notification input{width:18px;min-height:18px}
.schedule-client-results{display:grid;gap:6px}
@media(max-width:600px){.appointment-history-actions{justify-content:flex-start}.record:has(.appointment-history-actions){flex-direction:column}}
.bodychart-size{display:flex;align-items:center;gap:8px;white-space:nowrap}.bodychart-size input{width:90px;accent-color:#E16E37}.bodychart-size output{min-width:2ch}

/* A record is one generous open target; explicit secondary actions stay distinct. */
.timeline-item.record-tappable{position:relative;isolation:isolate;cursor:pointer}
.record-tappable:hover{background:var(--surface,#F7F7F5);border-color:#b5b5b5}
.record-tappable .record-open{position:static;min-height:44px;border:0;background:transparent;box-shadow:none;text-decoration:none;white-space:nowrap}
.record-tappable .record-open::after{content:"";position:absolute;inset:0;z-index:1;border-radius:inherit}
.record-tappable .record-open:focus-visible{outline:none}
.record-tappable .record-open:focus-visible::after{outline:2px solid #E16E37;outline-offset:2px}
.record-tappable :is(button,a,input,select,textarea,details):not(.record-open){position:relative;z-index:2}

/* Client header: compact actions that keep their own height when rows wrap. */
#patient-chart .chart-header{align-items:flex-start;gap:24px;padding:24px}
#patient-chart .chart-header>div:first-child{flex:1 1 320px;min-width:0}
#patient-chart .chart-header .chart-actions{flex:0 1 510px;align-self:flex-start;align-items:center;align-content:flex-start;gap:8px}
#patient-chart .chart-actions :is(.primary,.secondary,.danger,.icon-button){height:40px;min-height:40px;line-height:20px;padding:9px 12px;border-radius:6px;white-space:nowrap}
#patient-chart .chart-actions .icon-button{width:40px;padding:0;flex-shrink:0}
#patient-chart .back-to-directory{min-height:36px;padding:7px 12px;margin-bottom:12px;border-radius:6px}
#patient-chart .chart-title-row{gap:8px;align-items:center}
#patient-chart .chart-title-row h2{line-height:1.3}
#patient-chart .chart-title-row :is(.tag,.status-pill){min-height:32px;padding:5px 10px;border-radius:6px;line-height:20px;font-size:12px}
#patient-chart .chart-header p{line-height:1.5;max-width:48ch;overflow-wrap:anywhere}
.tag.consent-sign{min-height:32px;gap:8px;padding:5px 10px;border-radius:6px;line-height:20px}
.tag.consent-sign span{min-height:0;padding:0 0 0 8px;border-left:1px solid currentColor;border-radius:0;background:transparent;color:inherit;line-height:20px}
.tag.consent-sign:hover{background:#fbe9e7}
.tag.consent-sign:hover span{background:transparent}
@container (max-width:760px){.directory-table .tag.consent-sign{min-height:44px;gap:2px;border-radius:6px}.directory-table .tag.consent-sign span{border:0;padding:0;line-height:16px}}
@media(max-width:900px){#patient-chart .chart-header{flex-direction:column;gap:16px}#patient-chart .chart-header>div:first-child,#patient-chart .chart-header .chart-actions{flex:auto;width:100%}#patient-chart .chart-header .chart-actions{justify-content:flex-start}}
@media(max-width:600px){#patient-chart .chart-header{padding:18px}#patient-chart .chart-actions :is(.primary,.secondary,.danger,.icon-button){height:44px;min-height:44px}#patient-chart .chart-actions .icon-button{width:44px}}

/* One clear gear opens client actions and settings. */
#patient-chart .chart-actions .patient-actions-button{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;min-height:48px;font-size:24px;line-height:1;color:var(--ink)}

/* Adapt to the chart's usable width, including the shared sidebar. Grid keeps
   horizontal sizing from becoming vertical fixed heights when stacked. */
.patient-layout.chart-active #patient-chart{container:patient-chart / inline-size;padding:0}
#patient-chart .chart-header{display:grid;grid-template-columns:minmax(240px,1fr) minmax(0,510px);gap:24px}
#patient-chart .chart-header>div:first-child,#patient-chart .chart-header .chart-actions{width:auto;min-width:0}
#patient-chart .chart-header .chart-actions{justify-content:flex-end}
#patient-chart .chart-content :is(.metric,.overview-section,.record-list){min-width:0;overflow-wrap:anywhere}
@container patient-chart (max-width:1000px){
  #patient-chart .chart-header{grid-template-columns:minmax(0,1fr);gap:16px}
  #patient-chart .chart-header .chart-actions{justify-content:flex-start}
}
@container patient-chart (max-width:560px){
  #patient-chart .chart-header{padding:16px}
  #patient-chart .chart-content{padding:14px}
  #patient-chart :is(.overview-grid,.personal-grid,.settings-columns){grid-template-columns:minmax(0,1fr)}
  #patient-chart .chart-actions :is(.primary,.secondary,.danger){white-space:normal;height:auto;min-height:44px}
}

@media(max-width:600px){.timeline-item:has([data-schedule-follow-up]){flex-direction:column}}
