/* Contextual Care presentation extends the deployed shared design tokens. */
.app .care-nav{gap:8px}
.app .memento-nav-group{border-bottom:1px solid var(--line);padding-bottom:8px;min-width:0}
.app .memento-nav-group[hidden]{display:none}
.app .memento-nav-group>summary{display:flex;align-items:center;gap:9px;cursor:pointer;list-style:none;padding:9px 8px;border-radius:8px;font-size:12px;font-weight:750;color:var(--muted);line-height:1.4}
.app .memento-nav-group>summary::-webkit-details-marker{display:none}
.app .memento-nav-group>summary::after{content:'›';margin-left:auto;font-size:18px;transform:rotate(0)}
.app .memento-nav-group[open]>summary::after{transform:rotate(90deg)}
.app .memento-nav-links{display:grid;gap:3px;padding-left:8px}
.app .memento-nav-links>button{min-height:40px;padding:9px 12px;font-size:13px}
.app .memento-nav-links>button[aria-current=page]{background:#ffeddd;color:#92400c;box-shadow:inset 3px 0 #ad4b0b}
.app .memento-nav-group>summary:focus-visible,.app .memento-tabs>button:focus-visible{outline:3px solid #8c420e;outline-offset:3px}
.app .memento-tabs{display:flex;flex-wrap:wrap;gap:5px;padding:6px;background:#f3ebdf;border:1px solid var(--line);border-radius:15px;margin:18px 0 24px}
.app .memento-tabs>button{flex:1 1 auto;min-height:44px;padding:10px 14px;border:0;border-radius:10px;background:transparent;color:#6f6459;font-size:14px;font-weight:650;cursor:pointer}
.app .memento-tabs>button[aria-selected=true]{background:var(--card);color:#a0440c;box-shadow:0 2px 6px #3724110d}
.app .memento-tabs>button:disabled{opacity:.5;cursor:default}
.app [role=tabpanel][hidden]{display:none}
.app .memento-resident-header{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.app .memento-resident-avatar{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border-radius:50%;background:#f6e5d1;color:#8c420e;font-weight:700;font-size:18px}
.app .memento-context-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.app .memento-context-note{font-size:14px;line-height:1.65;color:var(--muted)}
.app .memento-context-error{padding:14px;border:1px solid #e9b9b1;border-radius:12px;background:#fff1ee;color:#9c3026}
.app .memento-resident-context{padding:12px 16px;background:#f7f0e7;border-radius:12px;margin-bottom:18px}
@media(max-width:900px){.app .care-nav{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.app .memento-nav-group>summary{font-size:12px}.app .memento-nav-links{padding-left:0}}
@media(max-width:700px){.app .memento-tabs{gap:4px}.app .memento-tabs>button{flex:1 1 calc(33.333% - 8px);min-width:0;padding:10px 6px;font-size:13px}.app .memento-context-grid{grid-template-columns:1fr}.app .memento-resident-header{gap:12px}}
.app .memento-personal-message{padding:16px;border:1px solid var(--line);border-radius:14px;margin-top:18px;background:#faf6ef;font-size:14px;line-height:1.6}
.app .memento-personal-message>summary{cursor:pointer;font-weight:650;color:#92400c;min-height:40px}
.app .memento-personal-message label{display:block;margin:12px 0}
.app .memento-personal-message input:not([type=checkbox]){display:block;width:100%;min-height:40px;padding:8px 12px;border:1px solid #cdbfad;border-radius:10px;background:#fff}
.app .memento-personal-message .memento-consent{display:flex;align-items:flex-start;gap:10px}
.app .memento-personal-message [type=checkbox]{width:auto;min-height:0;flex:0 0 auto;margin-top:5px}
.app .memento-personal-message audio{width:100%;height:44px;margin:16px 0}
.app .memento-personal-message .item-actions{justify-content:flex-start}
.app .memento-reminder-card{box-sizing:border-box;display:flex;flex-direction:column;min-width:0}
.app .memento-reminder-pagination{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:16px;flex:0 0 auto;font-size:13px}
.app .memento-reminder-pagination[hidden]{display:none}
.app .memento-voice-choice{padding:18px;border:1px solid var(--line);border-radius:14px;margin-top:20px;min-width:0}
.app .memento-voice-choice>label:not(.memento-consent),.app .memento-preference>label{display:block;font-size:14px;font-weight:600;margin:14px 0 8px}
.app .memento-voice-choice select,.app .memento-preference select{width:100%;min-height:40px;padding:8px 12px;border:1px solid #cdbfad;border-radius:10px;background:#fff;color:var(--ink);font:inherit}
.app .memento-voice-choice audio{width:100%;height:44px;margin-top:14px}
.app .memento-voice-choice audio[hidden],.app .memento-voice-choice label[hidden]{display:none}
.app .memento-preference{margin-top:18px;padding:16px;border:1px solid var(--line);border-radius:14px}
.app .memento-preference>summary{cursor:pointer;min-height:40px;font-weight:650}
.app .memento-preference>.btn{margin-top:14px}
.app .memento-resident-context>.field{margin-top:12px}
.app .memento-reminder-card .memento-tabs{margin-top:0;margin-bottom:16px}
.app .memento-reminder-card .memento-tabs>button{padding:8px 6px;min-height:40px;font-size:13px}

/* Existing display:flex declarations must not defeat explicit contextual visibility. */
.app .recognition-tabs[hidden],.app .memento-resident-picker[hidden]{display:none}
.app .memento-resident-header>.memento-resident-avatar+div{flex:1;min-width:0}
.app .memento-resident-header>.item-actions{flex:0 0 100%}
.modal .memento-voice-choice,.modal .memento-personal-message{box-sizing:border-box;min-width:0;padding:16px;border:1px solid #dfd0bf;border-radius:12px;margin-top:16px}
.modal .memento-voice-choice label:not(.memento-consent),.modal .memento-personal-message label{display:block;margin:12px 0 8px}
.modal .memento-voice-choice select,.modal .memento-personal-message input:not([type=checkbox]){width:100%;min-height:40px;padding:8px 12px;border:1px solid #cdbfad;border-radius:10px;font:inherit}
.modal .memento-voice-choice audio{width:100%;height:44px;margin:14px 0}
.modal .memento-voice-choice [hidden]{display:none}
.modal .memento-voice-choice .btn{min-height:40px;padding:8px 12px;border-radius:10px}
.modal .memento-personal-message .item-actions{display:flex;flex-wrap:wrap;gap:8px}
.modal .memento-consent{display:flex;align-items:flex-start;gap:10px;margin:14px 0}
.modal .memento-consent input{flex:0 0 auto;width:auto;min-height:0;margin-top:4px}

@media(max-width:900px){.app .memento-reminder-workspace .memento-reminder-card{height:auto!important;min-height:0}}

/* Expanded groups may exceed the viewport; keep every desktop Care link reachable.
   Mobile uses the existing document flow rather than a nested scrolling rail. */
@media(min-width:761px){.app.care-mode .side{overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable}}

/* Resident content follows document flow; long lists retain pagination. */
.app #residentRecord.memento-resident-workspace{flex-direction:column;height:auto;min-width:0}
.app #residentRecord.memento-resident-workspace>.record-head,.app #residentRecord.memento-resident-workspace>.memento-tabs{flex-shrink:0}
.app #residentRecord.memento-resident-workspace>[role=tabpanel]{flex:0 0 auto;min-height:0;overflow:visible;padding:3px}
.app #residentRecord.memento-resident-workspace>.record-grid{align-content:start}
.app #residentRecord .memento-paged-items>[hidden]{display:none}
.app #residentRecord .memento-record-pagination{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:12px 0 16px;font-size:12px;line-height:1.5}
.app #residentRecord .memento-record-pagination>.btn{min-height:36px;padding:6px 10px;font-size:12px;border-radius:9px;flex:0 0 auto}
.app #residentRecord .memento-record-pagination>span{text-align:center;color:var(--muted)}
.app #residentRecord .memento-record-pagination>.btn:disabled{opacity:.5;cursor:default}
.app #residentRecord [role=tabpanel]:focus-visible{outline:2px solid #8c420e;outline-offset:-2px}
@media(max-width:700px){.app #residentRecord .memento-record-pagination{gap:5px;font-size:11px}.app #residentRecord .memento-record-pagination>.btn{padding:6px 8px}}

/* Compact the resident reminder editor to fit the shared workspace. */
.app #resident-context-reminders .memento-resident-context{margin-bottom:10px;padding:8px 12px;font-size:13px}
.app #resident-context-reminders .memento-reminder-workspace{gap:14px;align-items:start;grid-template-columns:repeat(2,minmax(0,1fr))}
.app #resident-context-reminders .card{padding:12px}
.app #resident-context-reminders .card h3{font-size:18px;margin-bottom:6px}
.app #resident-context-reminders .memento-tabs{margin:0 0 10px;padding:4px;gap:3px}
.app #resident-context-reminders .memento-tabs>button{min-height:36px;padding:6px;font-size:12px}
.app #resident-context-reminders .form{gap:10px}
.app #resident-context-reminders .field{gap:4px}
.app #resident-context-reminders .field :is(input,select){padding:7px 10px;min-height:40px}
.app #resident-context-reminders .form-actions{margin-top:8px}
.app #resident-context-reminders .form-actions>.btn{min-height:40px;padding:7px 12px}
.app #resident-context-reminders .memento-voice-choice{padding:10px;margin-top:0;font-size:12px;line-height:1.4}
.app #resident-context-reminders .memento-voice-choice>label{margin:6px 0 4px;font-size:12px}
.app #resident-context-reminders .memento-voice-choice select{padding:6px 10px;min-height:36px;font-size:13px}
.app #resident-context-reminders .memento-voice-choice p{font-size:12px;line-height:1.4;margin:6px 0}
.app #resident-context-reminders .memento-voice-choice p:empty{display:none}
.app #resident-context-reminders .memento-voice-choice audio{height:36px;margin-top:6px}
.app #resident-context-reminders :is(.memento-personal-message,.memento-preference){padding:8px;margin-top:8px;font-size:12px}
.app #resident-context-reminders :is(.memento-personal-message,.memento-preference)>summary{min-height:28px}
.app #resident-context-reminders .memento-resident-reminder-switch{display:none}
@media(max-width:900px){
 .app #resident-context-reminders .memento-reminder-workspace{grid-template-columns:minmax(0,1fr)}
 
 .app #resident-context-reminders .memento-resident-reminder-switch{display:flex;gap:8px;margin:0 0 10px}
 .app #resident-context-reminders .memento-resident-reminder-switch>.btn{min-height:36px;padding:6px 10px;font-size:12px}
 .app #resident-context-reminders .memento-resident-reminder-switch>[aria-pressed=true]{background:#ffeddd;color:#92400c;border-color:#ad4b0b}
 .app #resident-context-reminders[data-reminder-view=editor] .memento-reminder-card{display:none}
 .app #resident-context-reminders[data-reminder-view=list] #remForm{position:absolute;left:-10000px;top:0;width:calc(100% - 6px);visibility:hidden;pointer-events:none}
 .app #resident-context-reminders[data-reminder-view=list] .memento-reminder-card{height:430px!important}
}
.app #resident-context-reminders .form{grid-template-columns:repeat(2,minmax(0,1fr))}
.app #resident-context-reminders .form>.full{grid-column:1/-1}
.app #resident-context-reminders .field :is(input,select){min-width:0;width:100%}
.app #resident-context-reminders .day-picker{gap:5px}
.app #resident-context-reminders .day-picker label{display:inline-flex;align-items:center;gap:4px;padding:6px;font-size:12px;min-height:32px}
.app #resident-context-reminders .day-picker input[type=checkbox]{width:16px;height:16px;min-height:0;padding:0;flex:0 0 16px}

.app #resident-context-reminders .memento-personal-message p{margin:6px 0;font-size:12px;line-height:1.4}
.app #resident-context-reminders .memento-personal-message label{margin:6px 0}
.app #resident-context-reminders .memento-personal-message .btn{min-height:36px;padding:6px 8px;font-size:12px}
.app #resident-context-reminders .memento-personal-message input:not([type=checkbox]){min-height:36px;padding:6px 10px}
.app #resident-context-reminders .memento-personal-message audio{height:36px;margin:6px 0}
.app #resident-context-reminders .memento-personal-message .item-actions{margin-top:6px;gap:6px}

.app #resident-context-reminders{position:relative}

/* Resident-only recognition composition; standalone Family presentation is preserved. */
.app #residentRecognition.memento-resident-recognition{width:100%;max-width:980px;margin:0 auto}
.app #residentRecognition.memento-resident-recognition>.memento-tabs{margin-bottom:18px}
.app #residentRecognition .recognition-hero{margin:8px 0 18px;gap:12px}
.app #residentRecognition .recognition-hero h2{font-size:22px;letter-spacing:-.3px}
.app #residentRecognition .recognition-summary>div{padding:16px}
.app #residentRecognition .recognition-improvement,.app #residentRecognition .memento-recognition-evidence{margin:14px 0;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--card,#fffdfa)}
.app #residentRecognition .memento-recognition-evidence h3{font-size:17px;margin:0 0 12px}
.app #residentRecognition .memento-recognition-evidence dl{display:grid;grid-template-columns:minmax(120px,1fr) minmax(0,2fr);gap:10px 16px;margin:0;font-size:14px;line-height:1.5}
.app #residentRecognition .memento-recognition-evidence dt{color:var(--muted)}
.app #residentRecognition .memento-recognition-evidence dd{margin:0;overflow-wrap:anywhere}
.app #residentRecognition .recognition-actions{gap:8px;margin-top:14px}
.app #residentRecognition .recognition-actions>.btn{min-height:40px;padding:8px 12px;flex:0 1 auto}
.app #residentRecognition .recognition-badge{font-size:12px;padding:6px 10px;white-space:normal}
@media(max-width:600px){.app #residentRecognition>.memento-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.app #residentRecognition>.memento-tabs>button{padding:8px 5px;min-width:0;font-size:12px;white-space:normal}.app #residentRecognition .memento-recognition-evidence dl{grid-template-columns:1fr;gap:3px}.app #residentRecognition .memento-recognition-evidence dd{margin-bottom:9px}}
