/* Patient directory: blue for the client, teal for the patient; neutral reading area. */
@media screen{
 body[data-workspace-page="clients"] .patient-workspace{align-items:start}
 .patient-directory-head{background:#f6f9fc;padding:0 14px 13px}
 .patient-directory-head h2{margin:0 -14px 12px;padding:12px 14px;background:#eef4fa;border-bottom:1px solid #dce6ef;display:flex;align-items:center}
 .patient-directory-head h2 small{margin-left:auto;font-size:11px;border:1px solid #d5e1ed;border-radius:5px;padding:2px 6px;background:#fff;color:#54708c;font-weight:500}
 .patient-directory-head h2 .cue-icon{margin-right:7px}
 .patient-directory-head .directory-dates{border-top:1px solid #e0e9f0;margin-top:10px;padding-top:10px}
 .directory-dates>strong{font-size:11px;color:#58728a;font-weight:500}
 .patient-directory-head input{background:#fff;border-color:#d8e2e9;box-shadow:none}
 .patient-owner{padding:10px 13px;gap:5px}
 .patient-owner:hover{background:#f5f8fc}
 .patient-owner.active{background:#edf4fb;box-shadow:inset 3px 0 #648aaf}
 .patient-owner.active .directory-owner-line>strong{color:#315b7a}
 .patient-owner .directory-pet{background:#f6f9f8;border:0;padding:3px 5px;color:#3e675d;border-radius:4px}
 .patient-owner.active .directory-pet{background:#fff}
 .patient-owner .directory-phone{font-variant-numeric:tabular-nums;color:#526b78}
 .patient-owner .directory-owner-meta{color:#647a86}
 .patient-directory .directory-pager{background:#f7f9fc;border-top:1px solid #e1e8ee}
 .patient-health{overflow:hidden;background:#f3f6f7}
 .patient-pet-switch{background:#fff;padding:10px 18px;border-bottom:1px solid #e2ebe7}
 .patient-pet-switch button.active{background:#e8f4ee;box-shadow:inset 0 0 0 1px #cde3d9;color:#216e5d}
 .patient-hero{background:#f0f7f4;border-bottom:1px solid #dce9e2;padding:16px 20px;gap:14px}
 .patient-eyebrow{display:flex;align-items:center;color:#4e7b6c;letter-spacing:.3px}
 .patient-eyebrow .cue-icon{width:16px;height:16px;margin-right:6px}
 .patient-hero h1{margin:5px 0 7px;color:#26483e}
 .patient-hero h1 span{color:#587267}
 .patient-hero p{color:#5b756c;line-height:1.7}
 .patient-hero .actions{gap:7px}
 .patient-hero .actions button:not(.primary){background:#ffffffd9;border-color:#d0e0d8}
 .patient-tabs{padding:5px 18px 0;background:#fff;border-bottom:1px solid #dae5e3;gap:12px}
 .patient-tabs button{padding:10px 6px;min-height:42px}
 .patient-tabs button.active{background:#eff7f3;border-radius:6px 6px 0 0;color:#176d59;border-bottom-color:#348d76}
 .patient-content{padding:16px;background:#f3f6f7}
 .patient-sheet{padding:15px;margin-bottom:14px;background:#fff;box-shadow:none;border-color:#dce5e8}
 .patient-section-head{margin:-15px -15px 14px;padding:10px 14px;background:var(--cue-wash,#f5f8fa);border-bottom:1px solid #e1e8eb;border-radius:9px 9px 0 0;min-height:44px}
 .patient-section-head h2{font-size:14px;margin:0;display:flex;align-items:center;color:#35515b}
 .patient-section-head button{font-size:12px;min-height:28px;padding:4px 8px;background:#ffffffc7;border-color:#dce5e8;box-shadow:none}
 .patient-overview{gap:14px;grid-template-columns:1.35fr 1fr;align-items:stretch}
 .patient-overview .patient-pairs{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 10px}
 .patient-pairs{gap:14px 18px}
 .patient-pairs>div{min-width:0}
 .patient-pairs label{font-size:11px;color:#657c86;margin-bottom:4px}
 .patient-pairs strong{font-size:13px;color:#304b55}
 .patient-note{margin:12px 0 0;padding-top:10px;border-top:1px solid #e8eeed;font-size:12px}
 .patient-timeline>article{position:relative;grid-template-columns:112px minmax(0,1fr);gap:16px;padding:13px 0;border-bottom:1px solid #edf1f3}
 .patient-timeline>article:last-child{border-bottom:0}
 .patient-timeline .event-date{font-variant-numeric:tabular-nums;font-size:11px}
 .patient-timeline .event-date>span{display:inline-flex;align-items:center;background:var(--cue-wash,#eff4fa);color:var(--cue,#426b97);font-size:11px;padding:3px 6px;margin-top:6px;border-radius:4px}
 .event-date .cue-icon{width:13px;height:13px;margin-right:4px}
 .patient-timeline .event-content{border-left:2px solid var(--cue-line,#cfdee6);padding-left:14px;min-width:0}
 .event-content h3{font-size:13px;font-weight:600;margin-bottom:5px}
 .event-content p{font-size:12px;line-height:1.65;margin:5px 0 9px}
 .event-content button{font-size:12px;min-height:29px;padding:5px 9px}
 .patient-content>.patient-timeline{padding:2px 16px}
 @media(max-width:1100px){.patient-overview{grid-template-columns:1fr}.patient-overview .patient-pairs{grid-template-columns:repeat(3,minmax(0,1fr))}}
 @media(max-width:900px){.patient-tabs{gap:8px;padding-left:12px;padding-right:12px}.patient-tabs button{padding-left:3px;padding-right:3px}.patient-hero{padding:14px 16px}.patient-content{padding:12px}}
 @media(max-width:700px){.patient-directory-head{padding-left:12px;padding-right:12px}.patient-directory-head h2{margin-left:-12px;margin-right:-12px}.patient-hero h1 span{display:block;margin:5px 0 0}.patient-timeline>article{grid-template-columns:88px minmax(0,1fr);gap:8px}.patient-timeline .event-content{padding-left:10px}.patient-sheet{padding:12px}.patient-section-head{margin:-12px -12px 12px}.patient-pairs{gap:12px}}
}
/* Independent master/detail panes; filters and pager remain in reach. */
@media screen and (min-width:801px){
 body[data-workspace-page="clients"] .patient-workspace{grid-template-columns:minmax(340px,34%) minmax(0,1fr);height:calc(100dvh - 210px);min-height:420px;align-items:stretch}
 body[data-workspace-page="clients"] .patient-directory{position:static;display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}
 body[data-workspace-page="clients"] .patient-directory-head{flex:none;padding-bottom:10px}
 body[data-workspace-page="clients"] .patient-directory-list{flex:1;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
 body[data-workspace-page="clients"] .directory-pager{flex:none;padding:9px;gap:6px;font-size:11px}
 body[data-workspace-page="clients"] .patient-health{height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
 body[data-workspace-page="clients"] .patient-tabs{position:sticky;top:0;z-index:2}
}
.directory-doctor{display:flex;align-items:center;gap:10px;margin-top:9px;font-size:12px;color:#54708c}
.directory-doctor select{flex:1;min-width:0;background:#fff;font-size:12px;padding:7px}
.patient-owner .directory-pets{display:flex;flex-direction:column;gap:6px;width:100%}
.patient-owner .directory-pet{display:flex;flex-direction:column;gap:3px;min-width:0;padding:5px 7px;background:#f3f7f6}
.directory-pet-identity{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.directory-pet-identity strong{font-weight:600;color:#315f54}
.directory-pet-identity small{font-size:11px}
.patient-owner .directory-diagnosis{color:#40515e;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:block;max-width:100%}
.patient-owner .directory-clinician{color:#6a7e87;font-size:11px}
.directory-doctor select:focus-visible,.patient-owner:focus-visible{outline:2px solid #168779;outline-offset:-2px}
@media(max-width:800px){body[data-workspace-page="clients"] .patient-workspace{grid-template-columns:1fr}.patient-directory-list{max-height:350px}.patient-health{overflow:visible}}
.directory-date-options{margin-top:10px;font-size:12px;color:#58728a}.directory-date-options>summary{cursor:pointer;padding:5px 0}.patient-owner{padding:8px 12px!important;gap:4px!important}.patient-owner .directory-pet{padding:3px 6px}.patient-owner .directory-owner-meta{font-size:10px}
/* Compact directory: keep clinical context without turning each owner into a tall card. */
@media screen{
 .patient-directory .patient-owner{padding:7px 12px!important;gap:3px!important}
 .patient-owner .directory-owner-line{min-height:18px;line-height:18px}
 .patient-owner .directory-pets{gap:4px}
 .patient-owner .directory-pet{display:grid;grid-template-columns:minmax(70px,1fr) auto;gap:2px 10px;padding:2px 5px;line-height:17px}
 .patient-owner .directory-pet-identity{grid-column:1/-1;gap:7px;line-height:17px}
 .patient-owner .directory-diagnosis{min-width:0;line-height:17px}
 .patient-owner .directory-clinician{font-size:11px;line-height:17px;white-space:nowrap;text-align:right}
 .patient-owner .directory-owner-meta{line-height:15px;font-size:10px;min-height:15px}
 .patient-directory-head h2{padding-top:10px;padding-bottom:10px;margin-bottom:9px}
 .directory-doctor{margin-top:7px}
 .directory-date-options{margin-top:5px}
}
@media(max-width:480px){.patient-owner .directory-pet{grid-template-columns:1fr}.patient-owner .directory-clinician{text-align:left;white-space:normal}}
/* Quiet clinical hierarchy: diagnosis is highlighted without implying severity. */
@media screen{
 .patient-owner .directory-pet{background:transparent!important;padding:3px 0;gap:5px 8px}
 .patient-owner .directory-pet-identity strong{font-size:13px;font-weight:650;color:#244c43}
 .patient-owner .directory-pet-identity small{color:#77858b;font-size:11px}
 .patient-owner .directory-diagnosis{justify-self:start;max-width:100%;box-sizing:border-box;padding:2px 7px;border-radius:5px;background:#edf3fa;border:1px solid #dce6f2;color:#3c5f83;font-size:12px;line-height:17px}
 .patient-owner.active .directory-diagnosis{background:#f8fbff;border-color:#d2dfef}
 .patient-owner .directory-clinician{align-self:center;color:#73818a;font-size:11px}
 .patient-owner .directory-owner-meta{color:#89949b;font-size:10px}
 .patient-owner .directory-phone{color:#71818a;font-size:11px}
 .patient-owner .directory-owner-line>strong{font-size:12px;color:#4a606c;font-weight:500}
}
.directory-dates select{width:100%;min-width:0;font-size:12px;padding:7px;background:#fff;border:1px solid #d8e2e9;border-radius:5px}.directory-dates label{min-width:0}
@media(min-width:801px){body[data-workspace-page="clients"] .patient-directory-head{max-height:70%;overflow-y:auto;overscroll-behavior:contain}}
@media(min-width:801px){body[data-workspace-page="clients"] .patient-directory-head:has(.directory-date-options[open]){max-height:calc(100% - 54px)}.directory-date-options .directory-dates{gap:7px}.directory-date-options .directory-dates label{font-size:11px}.directory-date-options .directory-dates input,.directory-date-options .directory-dates select{padding:6px;min-height:31px}}
.directory-breed-combo{display:block;position:relative;min-width:0}.directory-breed-combo>input{padding-right:28px!important;text-align:left}.directory-breed-combo>[data-breed-toggle]{position:absolute;right:1px;top:1px;min-height:29px;height:29px;width:25px;padding:0;border:0;background:transparent;color:#526b78}.directory-breed-menu{display:block;margin-top:4px;width:100%;box-sizing:border-box;max-height:170px;overflow:auto;border:1px solid #d8e2e9;border-radius:5px;background:white;box-shadow:0 3px 8px #193d4710;text-align:left}.directory-breed-menu[hidden]{display:none}.directory-breed-menu>button{display:block;width:100%;text-align:left;padding:7px 9px;border:0;border-radius:0;background:#fff;font-size:12px;font-weight:400}.directory-breed-menu>button[hidden]{display:none}.directory-breed-menu>button:hover,.directory-breed-menu>button:focus{background:#edf5f2;color:#176d59}
/* Use one chevron for both native selects and the editable breed picker. */
.patient-directory-head select,.directory-breed-combo>[data-breed-toggle]{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23526b78' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:12px 12px}
.patient-directory-head select{appearance:none;background-position:right 8px center;padding-right:28px!important}
.directory-breed-combo>[data-breed-toggle]{width:27px;background-position:center;font-size:0;display:block}

/* Directory reading hierarchy: quiet search surface, clear owner groups, one active accent. */
@media screen{
 body[data-workspace-page="clients"] .patient-directory{background:#fff;border-color:#dce5e7;box-shadow:0 2px 8px #17343e04}
 .patient-directory-head{background:#fff;padding:0 14px 12px;border-bottom:1px solid #dce5e7}
 .patient-directory-head h2{background:#fff;border-bottom:0;margin-bottom:0;padding:14px 14px 11px;color:#28454e;font-size:14px;font-weight:650}
 .patient-directory-head h2 small{border:0;background:#f0f4f4;border-radius:10px;color:#526b73;padding:2px 8px;font-variant-numeric:tabular-nums}
 .patient-directory-head input[type="search"]{min-height:38px;background:#f8fafb;border-color:#dbe4e7;border-radius:7px;font-size:12px}
 .patient-directory-head input[type="search"]:focus{background:#fff;border-color:#398c80}
 .directory-doctor{margin-top:10px;color:#5c7079;gap:12px}
 .directory-doctor select{border-color:#dce5e7;border-radius:6px;min-height:34px}
 .directory-date-options{margin-top:9px;color:#4e6570}
 .directory-date-options>summary{padding:7px 9px;border:1px solid #e2e9ec;border-radius:6px;background:#f8fafb;font-size:12px;line-height:18px}
 .directory-date-options[open]>summary{background:#f0f6f4;border-color:#d9e6e1;color:#286958}
 .patient-directory-head .directory-dates{border:0;background:#f8fafb;margin-top:7px;padding:10px;border-radius:6px}
 .patient-directory-list{background:#fff;scroll-padding-top:8px}
 .patient-directory .patient-owner{padding:10px 14px!important;gap:6px!important;border-bottom:1px solid #e8edef;background:#fff;border-radius:0;box-shadow:none;line-height:1.5}
 .patient-directory .patient-owner:hover{background:#f7faf9}
 .patient-directory .patient-owner.active{background:#edf6f2;box-shadow:inset 3px 0 #348b74;border-bottom-color:#dbe9e2}
 .patient-owner .directory-owner-line{align-items:center;gap:10px;line-height:20px;min-height:20px}
 .patient-owner .directory-owner-line>strong{font-size:13px;line-height:20px;font-weight:650;color:#304b55}
 .patient-owner.active .directory-owner-line>strong{color:#1f6252}
 .patient-owner .directory-phone{font-size:12px;color:#536c76;font-variant-numeric:tabular-nums;white-space:nowrap}
 .patient-owner .directory-pets{gap:6px}
 .patient-owner .directory-pet{gap:5px 8px;padding:0;line-height:19px;border:0;border-radius:0}
 .patient-owner .directory-pet+.directory-pet{padding-top:7px;border-top:1px dashed #dce5e3}
 .patient-owner .directory-pet-identity{gap:7px;line-height:20px;align-items:center}
 .patient-owner .directory-pet-identity strong{color:#244c43;font-size:13px;font-weight:600}
 .patient-owner .directory-pet-identity small{font-size:11px;color:#60757e}
 .patient-owner .directory-diagnosis{align-self:start;background:#edf3f8;border:0;border-radius:4px;padding:2px 7px;font-size:12px;line-height:18px;color:#3e617d}
 .patient-owner.active .directory-diagnosis{background:#fff;border:0;color:#3e617d}
 .patient-owner .directory-clinician{font-size:11px;color:#60757e;line-height:18px;white-space:normal;max-width:230px;overflow-wrap:anywhere;text-align:right}
 .patient-owner .directory-owner-meta{font-size:11px;line-height:16px;color:#6a7e87;min-height:0}
 .patient-directory .directory-pager{background:#fff;border-top:1px solid #dce5e7;padding:10px 12px;gap:8px;color:#586f79}
 .patient-directory .directory-pager button{min-height:32px;border-radius:6px;background:#fff;border-color:#d9e3e6}
 .patient-directory .directory-pager button:disabled{background:#f7f9fa;color:#8a9aa0}
 .patient-directory :is(input,select,summary,button):focus-visible{outline:2px solid #25836d;outline-offset:2px}
 .patient-directory .patient-owner:focus-visible{outline-offset:-3px}
 /* Keep the detail pane supportive instead of repeating colored header bands. */
 .patient-health .patient-section-head{background:#f9fbfb;border-bottom-color:#e5ebed}
 .patient-health .patient-hero{background:#f2f7f5}
 .patient-health .patient-content{background:#f5f7f8}
 .patient-health .patient-tabs button.active{background:transparent}
 @media(max-width:480px){.patient-owner .directory-clinician{text-align:left;max-width:none}.patient-directory .patient-owner{padding:10px 12px!important}}
}

/* Let the two reading panes use the remaining window, rather than subtracting a fixed height. */
@media screen and (min-width:801px) and (min-height:600px){
 body[data-workspace-page="clients"]{height:100dvh;overflow:hidden;display:flex;flex-direction:column}
 body[data-workspace-page="clients"]>#sidebar{flex:none}
 body[data-workspace-page="clients"]>.workspace{display:flex;flex-direction:column;flex:1;min-height:0}
 body[data-workspace-page="clients"] #header{flex:none}
 body[data-workspace-page="clients"] #main{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;box-sizing:border-box;margin:0 auto;padding-top:12px;padding-bottom:6px}
 body[data-workspace-page="clients"] #main>.title-row{flex:none;margin-bottom:10px}
 body[data-workspace-page="clients"] .patient-workspace{flex:1;min-height:0;height:auto}
 body[data-workspace-page="clients"] .workspace>footer{flex:none;min-height:20px;padding:3px 28px;font-size:10px;line-height:14px}
}
@media screen{
 .patient-directory .patient-owner{padding:7px 12px!important;gap:3px!important}
 .patient-owner .directory-pets{gap:4px}
 .patient-owner .directory-pet{gap:3px 8px}
 .patient-owner .directory-pet+.directory-pet{padding-top:4px}
 .patient-owner .directory-diagnosis{padding:1px 6px}
 .patient-directory-head{padding-bottom:8px}
 .patient-directory-head h2{padding-top:10px;padding-bottom:8px}
 .directory-doctor{margin-top:7px}
 .directory-date-options{margin-top:6px}
 .directory-date-options>summary{padding-top:4px;padding-bottom:4px}
 .patient-directory .directory-pager{padding:6px 10px}
}

