.care-workflow{margin:0 0 18px;border:1px solid #b9cdd4;border-radius:7px;background:#f4f8fa;overflow:hidden}
.care-workflow-intro{padding:17px 18px;background:#e8f2f5;border-bottom:1px solid #c4d6dc}
.care-workflow-intro h3{font-size:19px;margin:5px 0 7px;line-height:1.35}
.care-workflow-intro p{font-size:14px;line-height:1.5;max-width:850px;margin-bottom:12px}
.care-workflow-intro>.button{min-height:43px;font-size:15px}
.care-workflow-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:12px 14px;margin:0;list-style:none}
.care-workflow-steps li{min-width:0}
.care-workflow-steps button{width:100%;height:100%;display:flex;align-items:center;gap:9px;text-align:left;padding:10px;border:1px solid #cad7dc;border-radius:5px;background:white;color:#163b49;font:inherit;font-size:13px;line-height:1.35;cursor:pointer}
.care-workflow-steps button:hover{border-color:#3b798d;background:#f0f8fb}
.care-workflow-steps button:focus-visible{outline:3px solid #52a4bb;outline-offset:2px}
.care-workflow-steps button>span:first-child{display:inline-flex;align-items:center;justify-content:center;flex:0 0 26px;height:26px;border-radius:50%;background:#e8eef1;color:#294a57;font-weight:700}
.care-workflow-steps .done button>span:first-child{background:#dceee4;color:#1b6545}
.care-workflow-step-label{display:block}
.care-workflow-step-label small{display:block;margin-top:2px;color:#5d7480;font-size:11px;font-weight:400}
.care-workflow-tools{display:flex;flex-wrap:wrap;gap:8px;padding:0 14px 11px}
.care-workflow-tools>.button{min-height:39px;font-size:13px}
.care-workflow-save{margin:0;padding:9px 15px;border-top:1px solid #d9e3e7;color:#496373;font-size:13px;background:#fff}
.care-stock-available{align-self:center;font-size:14px;line-height:1.5;padding:11px;border:1px solid #d2e1d8;border-radius:5px;background:#f4faf6}
.care-prescription-preview p{font-size:14px;line-height:1.6}
.care-repeat-row,.care-repeat-results>div{display:flex;justify-content:space-between;align-items:start;gap:14px;padding:13px 0;border-top:1px solid #d7e0e5}
.care-repeat-row p,.care-repeat-results p{font-size:13px;line-height:1.5;color:#4a6571;margin-top:5px}
.care-repeat-results>div{display:block}
.care-repeat-results small{display:block;margin-top:5px;color:#4a6571}
@media(max-width:650px){.care-workflow-steps{grid-template-columns:repeat(2,minmax(0,1fr));padding:10px}.care-workflow-intro{padding:14px}.care-workflow-intro h3{font-size:17px}.care-workflow-tools{padding:0 10px 10px}.care-workflow-tools>.button{flex:1 1 45%}.care-repeat-row{gap:8px}.care-workflow-intro>.button{width:100%}}
@media(max-width:390px){.care-workflow-steps{grid-template-columns:1fr}}
@media print{.care-workflow,.care-workflow-tools{display:none!important}}

/* Keep clinical actions usable in narrow, folded and short viewports. */
@media screen{
 .medical-card .button,#care-modal .button{white-space:normal;overflow-wrap:anywhere;max-width:100%;min-width:0;min-height:44px}
 .medical-card .button svg,#care-modal .button svg{flex:none}
 .care-workflow-steps button{min-height:44px}
 .care-workflow-step-label{min-width:0;overflow-wrap:anywhere}
 .care-workflow-intro,.care-workflow-save,.care-stock-available,.care-repeat-results,.care-event-body,.care-stage h3{overflow-wrap:anywhere}
 .care-workflow-tools>.button{flex:1 1 210px}
 .care-repeat-row>div:first-child{min-width:0;flex:1;overflow-wrap:anywhere}
 .care-repeat-row>[data-repeat-remove]{flex:0 0 auto}
 .medical-card .field input,.medical-card .field select,.medical-card .field textarea,#care-modal .field input,#care-modal .field select,#care-modal .field textarea{font-size:16px;max-width:100%;min-width:0;min-height:44px}
 .medical-card .field textarea,#care-modal .field textarea{min-height:96px}
 .medical-card .detail-item,#care-modal .detail-item,.care-stage .card-top>div,.care-stage-times>div,.care-timing>div{min-width:0;max-width:100%}
 .care-stage .card-top>div,.care-stage-times>div,.care-timing>div{overflow-wrap:anywhere}
 #care-modal[open]{max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overflow:hidden}
 #care-form{display:flex;flex-direction:column;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);min-height:0}
 #care-modal .modal-head,#care-modal .modal-foot{flex:none}
 #care-modal .modal-head{gap:8px;align-items:flex-start}
 #care-modal .modal-head h2{flex:1;min-width:0;overflow-wrap:anywhere}
 #care-modal .modal-head .icon-btn{flex:none;min-width:44px;min-height:44px}
 #care-modal .modal-body{min-height:0;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scroll-padding:12px}
 #care-modal .modal-foot{flex-wrap:wrap;gap:8px;padding:10px 16px;padding-bottom:max(10px,env(safe-area-inset-bottom))}
 #care-modal .checkbox-field{align-items:flex-start;overflow-wrap:anywhere;min-height:44px;padding-block:8px}
 #care-modal .checkbox-field input{flex:none;margin-top:2px}
 .care-repeat-slots{max-height:260px;max-height:clamp(144px,30dvh,260px);overflow:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;padding:3px;scroll-padding:4px;border:1px solid #d6e1e5;border-radius:6px}
 .care-repeat-slots:focus-visible{outline:3px solid #52a4bb;outline-offset:2px}
 .care-repeat-slots .slot-grid{grid-template-columns:repeat(auto-fill,minmax(min(96px,100%),1fr));gap:7px}
 .care-repeat-slots .slot{min-height:48px;min-width:0;overflow-wrap:anywhere}
 .care-repeat-slots .slot[aria-pressed=true]{outline:2px solid var(--teal);outline-offset:-2px}
}
@media screen and (max-width:430px){
 #care-modal .modal-head{padding:10px 12px}
 #care-modal .modal-body{padding:12px}
 #care-modal .modal-foot{padding-inline:12px}
 #care-modal .modal-foot>.button{flex:1 1 100%}
 .medical-card .care-stage{padding:12px}
 .care-workflow-tools>.button{flex-basis:100%}
 .care-repeat-row{flex-wrap:wrap}
 .care-repeat-row>[data-repeat-remove]{margin-left:auto}
}
@media screen and (max-height:450px) and (min-width:431px){
 #care-modal .modal-head{padding:7px 12px;align-items:center}
 #care-modal .modal-head h2{font-size:16px;line-height:1.3}
 #care-modal .modal-body{padding:10px 14px}
 #care-modal .modal-foot{padding:7px 12px;flex-wrap:nowrap}
 #care-modal .modal-foot>.button{flex:1}
 .care-repeat-slots{max-height:144px}
}
