#agent-dialog{width:min(900px,96vw);height:min(850px,92dvh);padding:0;overflow:hidden;border-radius:22px;margin:auto}
#agent-dialog[open]{display:flex;flex-direction:column;gap:0}
#agent-dialog .chat-header{display:flex;justify-content:space-between;align-items:center;flex:none;padding:16px 22px;border-bottom:1px solid #dce5dc;background:#fffdf8;gap:12px}
.chat-header strong{display:block;font-size:19px}.chat-header span{display:block;font-size:12px;color:#577368}
#agent-dialog .agent-close{position:static;min-height:44px;padding:8px 12px;margin:0;flex:none;font-size:13px}
.chat-navigation{display:flex;padding:8px 16px;gap:6px;border-bottom:1px solid #dce5dc;flex:none;background:#f1f5ef}
#agent-dialog .chat-navigation button{flex:1;min-height:44px;padding:8px 6px;font-size:13px;border:0;background:transparent;border-radius:8px;white-space:normal}
#agent-dialog .chat-navigation button[aria-current]{background:#205f50;color:white}
#agent-dialog .chat-navigation button:disabled{opacity:.5;cursor:default}
#agent-dialog .agent-workspace{display:block;flex:1;min-height:0;overflow:hidden;margin:0}
#agent-dialog .agent-conversation{display:flex;flex-direction:column;min-height:0;height:100%;max-height:none;overflow:hidden;padding:0;border:0;border-radius:0;background:#fffdf8;scrollbar-gutter:auto}
#agent-dialog [hidden]{display:none!important}
.chat-tools{display:flex;justify-content:space-between;gap:10px;padding:4px 20px;flex:none}
#agent-dialog .chat-tools button{font-size:12px;min-height:40px;padding:4px 6px;border:0;background:transparent;margin:0;color:#526e5c}
#agent-dialog #agent-chat{flex:1;min-height:80px;height:auto;max-height:none;overflow-y:auto;padding:20px 24px;scroll-behavior:smooth;overscroll-behavior:contain}
#agent-dialog #agent-chat p{max-width:85%;font-size:16px;line-height:1.55;border:0;box-shadow:none;padding:14px 16px;margin:0 0 18px;background:#eef4ed}
#agent-dialog #agent-chat .user{margin-left:auto;background:#205f50;color:white}
#agent-dialog #agent-chat .user strong{color:#fff}
#agent-dialog #agent-chat .agent-latest{background:#edf5ff;color:#19466c;border-left:3px solid #6691b3}
#agent-dialog .agent-reply-label{background:transparent;color:#285b74;padding:0;font-size:11px}
#agent-dialog #agent-form{flex:none;border-top:1px solid #dce5dc;padding:10px 20px 12px;background:#fffdf8;margin:0}
#agent-dialog #agent-message{min-height:56px;height:64px;max-height:110px;resize:vertical;margin:0 0 8px;padding:12px 14px;font-size:16px;border-radius:14px;background:white}
#agent-dialog .agent-consent{font-size:12px;line-height:1.4;align-items:center;margin:0;min-height:32px}
#agent-dialog #agent-form>.preview-note{font-size:11px;margin:3px 0 6px}
#agent-dialog #agent-form .actions{justify-content:flex-end;margin:0;gap:8px}
#agent-dialog #agent-send{background:#205f50;color:white;min-height:44px;padding:8px 20px;font-size:14px}
#agent-dialog #agent-status{font-size:12px;line-height:1.3;margin:4px 0 0}#agent-status:empty{display:none}
#agent-dialog .agent-suggestions{height:100%;max-height:none;overflow-y:auto;border:0;border-radius:0;padding:20px 28px;background:#fffdf8;scrollbar-gutter:auto}
#agent-dialog .chat-back{font-size:13px;padding:8px 12px;min-height:44px;margin-bottom:16px}
#agent-dialog #agent-apply{position:sticky;bottom:0;min-height:48px;box-shadow:0 -6px 16px #fffdf8;font-size:15px}
#agent-dialog .chat-save{flex:1;min-height:0;overflow-y:auto;margin:0;border-radius:0;padding:20px 28px;background:#fffdf8}
#agent-dialog .chat-save h2{font-size:24px}#agent-dialog .chat-save .preview-layout{gap:20px;margin-top:18px}
#agent-dialog .chat-save .agent-preview-heading h3{font-size:19px}
#agent-dialog .chat-save .agent-preview-heading button{font-size:13px;min-height:44px}
.chat-sr{position:absolute!important;width:1px;height:1px;padding:0!important;margin:-1px!important;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:740px){#agent-dialog{position:fixed;inset:auto 0 auto 0;top:var(--chat-viewport-top,0px);margin:0;width:100vw;max-width:100vw;height:var(--chat-viewport-height,100dvh);max-height:var(--chat-viewport-height,100dvh);border:0;border-radius:0;padding:0}#agent-dialog .chat-header{padding:8px 12px;padding-top:max(8px,env(safe-area-inset-top))}.chat-header strong{font-size:17px}.chat-header span{font-size:11px}.chat-navigation{padding:6px 8px;gap:3px}#agent-dialog .chat-navigation button{font-size:12px;padding:6px 3px}.chat-tools{padding:0 10px}#agent-dialog .chat-tools button{font-size:11px}#agent-dialog #agent-chat{padding:12px;min-height:60px}#agent-dialog #agent-chat p{max-width:94%;font-size:15px;padding:12px;margin-bottom:12px}#agent-dialog #agent-form{padding:8px 12px;padding-bottom:max(8px,env(safe-area-inset-bottom))}#agent-dialog #agent-message{height:52px;min-height:52px;max-height:90px}#agent-dialog #agent-form>.preview-note{font-size:10px}#agent-dialog .agent-consent{font-size:11px}#agent-dialog .agent-suggestions,#agent-dialog .chat-save{padding:16px}#agent-dialog .chat-save .preview-layout{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){#agent-dialog #agent-chat{scroll-behavior:auto}}

.chat-starters{margin:0 0 8px}.chat-starters summary{cursor:pointer;font-size:13px;font-weight:650;color:#285b74;min-height:32px;line-height:32px}.chat-starters p{font-size:12px;color:#526e5c;margin:0 0 6px}.chat-starter-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}#agent-dialog .chat-starter-options button{font-size:12px;min-height:44px;padding:6px 8px;background:#edf5ff;border:1px solid #bfd1df;color:#244f78;border-radius:12px}#agent-dialog .chat-starter-options button:hover{background:#dcecf7}.chat-starters summary:focus-visible{outline:3px solid #c8753f;outline-offset:2px}@media(max-width:740px){.chat-starter-options{grid-template-columns:repeat(2,minmax(0,1fr))}.chat-starters p{font-size:11px}.chat-starters summary{min-height:36px;line-height:36px}}

#agent-dialog #agent-send{display:grid;place-items:center;width:46px;height:46px;min-height:46px;padding:0;border-radius:50%;flex:none;box-shadow:0 3px 8px #205f5020}#agent-dialog #agent-send:hover{background:#174b3f}#agent-dialog #agent-send:focus-visible{outline:3px solid #c8753f;outline-offset:3px}

#agent-dialog .chat-navigation button.has-new-details{background:#e3f0fc;color:#194e7b;box-shadow:inset 0 0 0 2px #397eb5;font-weight:750}
#agent-dialog .chat-navigation button.has-new-details::after{content:"";display:inline-block;width:7px;height:7px;margin-left:5px;border-radius:50%;background:#236da6;vertical-align:middle}

#agent-dialog .chat-save p,#agent-dialog .chat-save .preview-note,#agent-dialog .chat-save .help,#agent-dialog .chat-save .preview-paper p{font-family:inherit;font-size:15px;line-height:1.6}
#agent-dialog .chat-save .agent-preview-heading{margin-top:16px}
#agent-dialog .chat-save .preview-storage-note{font-size:15px;line-height:1.6;margin:12px 0}
#agent-dialog .chat-save .preview-storage-note summary{cursor:pointer;color:#205f50}

#agent-dialog .agent-field-card[data-removed]{background:#f1f3ef;border-style:dashed}
#agent-dialog .agent-remove{min-height:44px;margin-top:8px;padding:8px 16px;font-size:14px}
#agent-dialog .agent-field-card select{width:100%;min-height:44px;font:inherit;padding:8px;border:1px solid #9bb5a6;border-radius:8px}

#agent-dialog .agent-resume{flex:1;min-height:0;overflow-y:auto;padding:24px;background:#fffdf8}
#agent-dialog .agent-resume h2{font-size:24px;margin-top:0}
#agent-dialog .agent-resume p,#agent-dialog .agent-resume dd{font-size:15px;line-height:1.6}
#agent-dialog .resume-details{padding:16px;background:#edf4ed;border-radius:12px}
#agent-dialog .resume-details dt{font-weight:700;margin-top:12px}
#agent-dialog .resume-details dd{margin:4px 0 12px;white-space:pre-wrap;overflow-wrap:anywhere}
#agent-dialog .agent-resume button{min-height:44px;margin:4px;font-size:15px}
#agent-dialog .resume-confirm{padding:16px;margin-top:16px;border:1px solid #ad693c;border-radius:12px}

@media(max-width:740px){#agent-dialog .chat-starters{margin:0 0 4px}#agent-dialog .chat-starters summary{font-size:12px;min-height:32px;line-height:32px}#agent-dialog .chat-starters>p{display:none}#agent-dialog .chat-starter-options{display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;max-height:62px;padding:2px 0 6px;overscroll-behavior-x:contain}#agent-dialog .chat-starter-options button{flex:0 0 auto;max-width:240px;min-height:44px;font-size:12px;padding:6px 10px;line-height:1.3;white-space:normal}}

@media(max-width:740px){#agent-dialog .chat-starters{margin:0 0 5px;min-width:0}#agent-dialog .chat-starters summary{display:none}#agent-dialog .chat-starters[open]::before{content:'Tap one or more · swipe ↔';display:block;font-size:11px;line-height:1.3;color:#526e5c;margin-bottom:3px}#agent-dialog .chat-starter-options{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px;padding:2px 0 4px;max-height:52px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}#agent-dialog .chat-starter-options button{flex:0 0 auto!important;width:auto!important;max-width:72%;min-height:44px!important;height:44px!important;padding:5px 9px!important;font-size:12px!important;line-height:1.25!important;white-space:normal!important;border-radius:10px!important;scroll-snap-align:start}#agent-dialog #agent-form.keyboard-open .chat-starters{display:none!important}}

#agent-dialog .chat-starter-options button[aria-pressed="true"]{background:#205f50;color:#fff;border-color:#205f50;box-shadow:inset 0 0 0 1px #fff}

/* Give the latest guardian/agent exchange the available workspace. */
#agent-dialog{width:min(1120px,98vw);max-width:98vw;height:96dvh;max-height:96dvh}
#agent-dialog .chat-header{padding:10px 18px}
#agent-dialog .chat-tools{padding:0 16px}
#agent-dialog .chat-tools button{min-height:32px}
#agent-dialog #agent-chat{padding:12px 20px;overflow-anchor:none}
#agent-dialog #agent-chat p{padding:10px 14px;margin-bottom:10px;line-height:1.4;white-space:pre-wrap;overflow-wrap:anywhere}
#agent-dialog #agent-form{display:grid;grid-template-columns:minmax(0,1fr) 46px;align-items:end;gap:4px 8px;padding:8px 16px}
#agent-dialog #agent-form>.chat-starters,#agent-dialog #agent-form>.agent-consent,#agent-dialog #agent-form>.preview-note,#agent-dialog #agent-status{grid-column:1/-1}
#agent-dialog #agent-message{grid-column:1;min-height:46px;height:46px;max-height:96px;margin:0;padding:10px 12px;resize:none}
#agent-dialog #agent-message:focus{height:76px}
#agent-dialog #agent-form>.actions{grid-column:2;grid-row:2;align-self:end}
#agent-dialog #agent-form:has(#agent-consent:checked)>.agent-consent,#agent-dialog #agent-form:has(#agent-consent:checked)>.preview-note{display:none}
#agent-dialog .chat-starters{margin:0 0 3px}
#agent-dialog .chat-starters summary{line-height:24px;min-height:24px}
#agent-dialog .chat-starters>p{display:none}
#agent-dialog .chat-starter-options{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px;padding-bottom:3px}
#agent-dialog .chat-starter-options button{flex:0 0 auto;max-width:280px;min-height:44px;padding:5px 10px}
@media(max-width:740px){
 #agent-dialog{width:100vw;max-width:100vw;height:var(--chat-viewport-height,100dvh);max-height:var(--chat-viewport-height,100dvh)}
 #agent-dialog .chat-header{padding:6px 10px;padding-top:max(6px,env(safe-area-inset-top))}
 #agent-dialog .chat-header>div>span{display:none}
 #agent-dialog .chat-navigation{padding:4px 6px}
 #agent-dialog .chat-tools{padding:0 10px}
 #agent-dialog #agent-chat{padding:8px 10px}
 #agent-dialog #agent-chat p{font-size:15px;padding:8px 10px;margin-bottom:8px;max-width:96%}
 #agent-dialog #agent-form{padding:6px 10px;padding-bottom:max(6px,env(safe-area-inset-bottom))}
 #agent-dialog #agent-message{height:46px;min-height:46px}
}

/* Compact workflow controls; keep comfortable touch targets. */
#agent-dialog .chat-navigation{padding:4px 10px;gap:4px}
#passport-agent #agent-dialog .chat-navigation button{font-size:13px!important;min-height:44px!important;height:44px!important;padding:4px 8px!important;border-radius:7px!important;line-height:1.25!important;font-weight:600!important}
#agent-dialog .chat-navigation button.has-new-details{box-shadow:inset 0 0 0 1px #397eb5}
#agent-dialog #agent-message{box-sizing:border-box;height:66px;min-height:66px;line-height:22px;padding:10px 12px}
#agent-dialog #agent-message:focus{height:80px;min-height:66px}
@media(max-width:740px){#agent-dialog .chat-navigation{padding:3px 6px}#passport-agent #agent-dialog .chat-navigation button{font-size:12px!important;padding:4px 5px!important}#agent-dialog #agent-message{height:66px;min-height:66px;font-size:16px;line-height:22px}}

#passport-agent #agent-dialog .chat-header :is(.agent-close,.account-signout){font-family:system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important;font-size:13px!important;font-weight:600!important;line-height:1.3!important;min-height:44px!important;padding:8px 12px!important}
@media(max-width:740px){#passport-agent #agent-dialog .chat-header :is(.agent-close,.account-signout){font-size:12px!important}}

/* One shared row prevents consent and suggestion visibility from moving Send. */
#agent-dialog #agent-form{display:flex;flex-direction:column;align-items:stretch;gap:4px}
#agent-dialog .chat-message-row{display:flex;align-items:flex-end;gap:8px;min-width:0;width:100%}
#agent-dialog .chat-message-row #agent-message{flex:1 1 auto;width:0;min-width:0;margin:0}
#agent-dialog .chat-message-row>.actions{flex:0 0 46px;width:46px;min-width:46px;margin:0;display:flex;align-items:flex-end}
#passport-agent #agent-dialog .chat-message-row #agent-send{flex:0 0 46px!important;width:46px!important;height:46px!important;min-height:46px!important;padding:0!important;margin:0!important;align-self:flex-end}

#agent-dialog .agent-guide-note{flex:none;font-size:12px;line-height:1.4;background:#edf5ff;color:#285b74;margin:0;padding:6px 14px}#agent-dialog .agent-structured-summary{background:#edf5ff;border:1px solid #bfd1df;border-radius:10px;padding:12px;margin-bottom:16px}#agent-dialog .agent-structured-summary p{white-space:pre-wrap;overflow-wrap:anywhere}#agent-dialog .agent-vaccine-editor{min-width:0}#agent-dialog .agent-vaccine-editor fieldset{min-width:0;border:1px solid #bfd1df;border-radius:8px;padding:10px;margin:8px 0}#agent-dialog .agent-vaccine-editor label{display:block;font-size:14px;margin:8px 0}#agent-dialog .agent-vaccine-editor input{width:100%;box-sizing:border-box;font:inherit;padding:8px;min-height:44px}

#passport-agent #agent-dialog #agent-photo-button{flex:0 0 44px!important;display:grid;place-items:center;width:44px!important;min-width:44px;height:44px!important;min-height:44px!important;padding:0!important;margin:0!important;border:1px solid #a8c4b3;background:#edf4ef;color:#205f50;border-radius:10px!important;align-self:flex-end}#agent-dialog .chat-photo-preview{display:flex;align-items:flex-start;gap:8px;min-width:0;padding:6px;background:#edf5ff;border-radius:10px}#agent-dialog .chat-photo-preview img{width:64px;height:64px;object-fit:cover;border-radius:8px;flex:none}#agent-dialog .chat-photo-preview>div{min-width:0;flex:1}#agent-dialog .chat-photo-preview p{font-size:12px;line-height:1.35;margin:0 0 4px}#agent-dialog .chat-photo-actions{display:flex;flex-wrap:wrap;gap:4px}#passport-agent #agent-dialog .chat-photo-actions button{font-size:12px!important;min-height:44px!important;padding:4px 6px!important;line-height:1.2!important;margin:0!important;width:auto!important;flex:0 1 auto}#agent-dialog .chat-photo-status{font-size:12px;line-height:1.3;margin:0}#agent-dialog .chat-photo-status:empty{display:none}

#agent-dialog .chat-photo-prompt{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 10px;padding:6px 10px;background:#edf5ff;border-radius:10px}#agent-dialog .chat-photo-prompt>p{flex:1 1 190px;font-size:12px;line-height:1.35;margin:0}#agent-dialog .chat-photo-prompt .chat-photo-actions{flex:none}

/* A compact, accessible activity indicator while a reply is pending. */
#agent-dialog #agent-status.is-processing{display:flex;align-items:center;gap:10px;font-size:13px;color:#205f50;background:#edf5ef;border-radius:10px;padding:9px 12px;margin:6px 0 0;min-height:38px}
#agent-dialog .agent-thinking-dog{display:inline-block;font-size:24px;line-height:1;animation:agent-dog-trot .65s ease-in-out infinite;transform-origin:50% 85%}
@keyframes agent-dog-trot{0%,100%{transform:translateY(0) rotate(-5deg)}25%{transform:translateY(-4px) rotate(3deg)}50%{transform:translateY(0) rotate(5deg)}75%{transform:translateY(-3px) rotate(-3deg)}}
@media(prefers-reduced-motion:reduce){#agent-dialog .agent-thinking-dog{animation:none}}

/* Compact review form; retain comfortable touch targets and a clear Save tab. */
#agent-dialog .chat-save{padding:16px 22px}
#agent-dialog .chat-save h2{font-size:22px;margin:0 0 8px}
#agent-dialog .chat-save .preview-layout{grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);gap:18px;margin-top:12px;align-items:start}
#agent-dialog .chat-save #preview-form{min-width:0}
#agent-dialog .chat-save #preview-form label{font-size:14px;line-height:1.35;margin:10px 0 5px}
#agent-dialog .chat-save #preview-form label:first-child{margin-top:0}
#agent-dialog .chat-save #preview-form input{min-height:44px;padding:8px 10px;font-size:14px;line-height:1.4;border-radius:8px}
#agent-dialog .chat-save #preview-form input[type=file]{padding:6px 8px}
#agent-dialog .chat-save #preview-form textarea{min-height:64px;height:64px;max-height:180px;padding:8px 10px;margin:0;font-size:14px;line-height:1.45;border-radius:8px;overflow-y:auto;resize:vertical}
#agent-dialog .chat-save p,#agent-dialog .chat-save .preview-note,#agent-dialog .chat-save .help,#agent-dialog .chat-save .preview-paper p{font-size:14px;line-height:1.45}
#agent-dialog .chat-save #preview-form .preview-note{margin:7px 0 10px;font-size:12px}
#agent-dialog .chat-save .agent-preview-heading{margin-top:10px}
#agent-dialog .chat-save .agent-preview-heading p{margin:6px 0 8px}
#agent-dialog .chat-save .preview-paper{padding:18px;border-radius:14px;border-top-width:5px}
#agent-dialog .chat-save .preview-paper .eyebrow{font-size:11px;letter-spacing:.1em;margin-bottom:8px}
#agent-dialog .chat-save .preview-portrait{width:80px;height:80px;font-size:32px}
#agent-dialog .chat-save .preview-paper h3{font-size:24px;margin:9px 0 3px}
#agent-dialog .chat-save .preview-paper h4{font-size:14px;margin:15px 0 5px}
#agent-dialog .chat-save .preview-paper p{margin:5px 0}
#agent-dialog .chat-save .preview-paper footer{font-size:12px;line-height:1.45;margin-top:16px;padding-top:12px}
#agent-dialog .chat-save .actions{gap:8px;margin-top:12px}
@media(max-width:740px){
 #agent-dialog .chat-save{padding:12px}
 #agent-dialog .chat-save h2{font-size:21px}
 #agent-dialog .chat-save .preview-layout{grid-template-columns:minmax(0,1fr);gap:14px;margin-top:10px}
 #agent-dialog .chat-save #preview-form :is(input,textarea){font-size:16px}
 #agent-dialog .chat-save .preview-paper{padding:14px}
 #agent-dialog .chat-save .preview-portrait{width:72px;height:72px;font-size:28px}
 #agent-dialog .chat-save .preview-paper h3{font-size:22px}
}

/* Share the identity row with the portrait, instead of stacking it above. */
#agent-dialog .chat-save .preview-card-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px;margin:10px 0 12px}
#agent-dialog .chat-save .preview-card-identity{min-width:0}
#agent-dialog .chat-save .preview-card-identity h3{margin:0 0 4px}
#agent-dialog .chat-save .preview-card-identity p{margin:0}
#agent-dialog .chat-save .preview-card-photo{justify-self:end}
#agent-dialog .chat-save .preview-card-photo .preview-portrait{width:108px;height:108px;font-size:40px}
@media(max-width:740px){#agent-dialog .chat-save .preview-card-heading{gap:12px;margin:8px 0 10px}#agent-dialog .chat-save .preview-card-photo .preview-portrait{width:88px;height:88px;font-size:32px}}

#agent-dialog .agent-processing-row{display:flex;align-items:center;gap:10px;width:100%;margin:8px 0}
#agent-dialog .agent-processing-row .agent-thinking-dog{flex:0 0 32px;text-align:center}
#agent-dialog .agent-processing-row .agent-bubble{flex:1;min-width:0;margin:0;overflow-wrap:anywhere}

/* Keep replies inside the composer; reveal the rest with an explicit arrow. */
#agent-dialog .chat-starters{min-width:0;max-width:100%}
#agent-dialog .chat-starters[open]::before{content:'Tap one or more suggestions';font-size:11px}
#agent-dialog .chat-starter-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow-x:hidden;overflow-y:auto;max-height:180px;scroll-snap-type:none;min-width:0;padding:2px 2px 4px}
#agent-dialog .chat-starter-options button{width:100%!important;max-width:100%!important;min-width:0;min-height:44px!important;height:auto!important;white-space:normal!important;overflow-wrap:anywhere;box-sizing:border-box}
#agent-dialog .chat-starters:not(.replies-expanded) .chat-starter-options button:nth-child(n+3){display:none}
#agent-dialog .agent-expand-replies{display:block;width:auto;min-height:36px;margin:3px auto 0;padding:4px 10px;font-size:12px;line-height:1.3;background:transparent;color:#244f78;border:1px solid #bfd1df;border-radius:8px}
#agent-dialog .agent-expand-replies[hidden]{display:none}
@media(max-width:740px){#agent-dialog .chat-starter-options{max-height:144px}#agent-dialog .chat-starter-options button{font-size:12px!important}}

#agent-dialog .agent-vaccine-reply{border:1px solid #bfd1df;border-radius:10px;padding:4px 8px;margin:4px 0;min-width:0;background:#f3f8fc}
#agent-dialog .agent-vaccine-reply summary{display:list-item!important;font-size:12px;line-height:1.4;min-height:36px;padding:8px 0;box-sizing:border-box}
#agent-dialog .agent-vaccine-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:240px;overflow:auto;padding:4px}
#agent-dialog .agent-vaccine-fields label{font-size:12px;min-width:0;margin:0}
#agent-dialog .agent-vaccine-fields label:last-of-type,#agent-dialog .agent-vaccine-fields p,#agent-dialog .agent-vaccine-fields button{grid-column:1/-1}
#agent-dialog .agent-vaccine-fields input,#agent-dialog .agent-vaccine-fields textarea{display:block;width:100%;min-width:0;box-sizing:border-box;font-size:16px;padding:6px;min-height:44px;margin:3px 0 0}
#agent-dialog .agent-vaccine-fields p{display:block;font-size:11px;margin:0}
#agent-dialog .agent-vaccine-fields button{min-height:44px;font-size:13px;padding:6px 10px}

#agent-dialog .chat-starters>p{display:block!important;font-size:11px;line-height:1.35;color:#285b74;margin:0 0 5px}

#agent-dialog .agent-caregiver-reply{border:1px solid #bfd1df;border-radius:10px;padding:4px 8px;margin:4px 0;background:#f3f8fc;min-width:0}
#agent-dialog .agent-caregiver-reply summary{display:list-item!important;font-size:12px;line-height:1.4;min-height:36px;padding:8px 0;box-sizing:border-box}
#agent-dialog .agent-caregiver-fields{display:grid;gap:6px;max-height:230px;overflow:auto;padding:3px}
#agent-dialog .agent-caregiver-fields p{display:block;font-size:11px;line-height:1.4;margin:0}
#agent-dialog .agent-caregiver-fields label{font-size:12px;margin:0}
#agent-dialog .agent-caregiver-fields textarea{display:block;box-sizing:border-box;width:100%;font-size:16px;min-height:50px;padding:6px;margin-top:3px}
#agent-dialog .agent-caregiver-fields button{min-height:44px;font-size:13px;padding:6px 10px}

/* Compact caregiver fields with a persistent action beside the heading. */
#agent-dialog .agent-caregiver-reply summary{display:flex!important;align-items:center;justify-content:space-between;gap:8px;padding:2px 0;min-height:40px;cursor:pointer}
#agent-dialog .agent-caregiver-reply summary>span{min-width:0;flex:1;font-size:12px;line-height:1.3}
#agent-dialog .agent-caregiver-reply summary>span::before{content:'▸ ';color:#285b74}
#agent-dialog .agent-caregiver-reply[open] summary>span::before{content:'▾ '}
#agent-dialog .agent-caregiver-add{flex:0 0 auto;min-height:36px;padding:5px 9px;font-size:12px;line-height:1.2;width:auto;margin:0}
#agent-dialog .agent-caregiver-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:190px}
#agent-dialog .agent-caregiver-fields p,#agent-dialog .agent-caregiver-fields label:last-of-type{grid-column:1/-1}
#agent-dialog .agent-caregiver-fields textarea{min-height:44px;resize:vertical}
@media(max-width:350px){#agent-dialog .agent-caregiver-fields{grid-template-columns:minmax(0,1fr)}}

/* Secondary chat tools live in one compact, out-of-the-way menu. */
#agent-dialog .agent-compact-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 12px;flex:none;position:relative;z-index:3;min-height:36px}
#agent-dialog .agent-compact-toolbar .agent-guide-note{margin:0!important;padding:0!important;background:transparent;font-size:11px;line-height:1.3;flex:1;min-width:0}
#agent-dialog .agent-options-menu{flex:0 0 auto}
#agent-dialog .agent-options-menu>summary{cursor:pointer;list-style:none;font-size:12px;min-height:32px;display:flex;align-items:center;padding:2px 8px;border:1px solid #c6d9ce;border-radius:8px;color:#285b50;background:#fff}
#agent-dialog .agent-options-menu>summary::-webkit-details-marker{display:none}
#agent-dialog .agent-options-menu>.chat-tools{position:absolute;right:10px;top:100%;width:min(290px,calc(100vw - 32px));display:grid;gap:4px;padding:10px;background:#fff;border:1px solid #c6d9ce;border-radius:12px;box-shadow:0 8px 24px #193e2b26;box-sizing:border-box}
#agent-dialog .agent-options-menu:not([open])>.chat-tools{display:none}
#agent-dialog .agent-options-menu .chat-tools button{text-align:left;min-height:40px;padding:6px 8px;font-size:12px;border-radius:6px}
#agent-dialog .agent-options-menu .agent-autosave-status{font-size:11px!important;line-height:1.4;margin:0 0 5px!important;padding:0!important}

/* Conversation options open as a right-side drawer. */
#agent-dialog .agent-options-menu[open]>.chat-tools{position:fixed;inset:0 0 0 auto;top:var(--chat-viewport-top,0px);width:min(300px,85vw);height:var(--chat-viewport-height,100dvh);z-index:20;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:8px;padding:16px;border-radius:0;border-left:1px solid #c6d9ce;overflow-y:auto;box-shadow:-8px 0 28px #193e2b26}
#agent-dialog .agent-options-menu .chat-tools .agent-options-close{order:-1;text-align:right;font-size:12px;min-height:40px;margin-bottom:8px;border-bottom:1px solid #d8e4dc;border-radius:0}
#agent-dialog .agent-options-menu .chat-tools>button:not(.agent-options-close){background:#f2f7f3;border:1px solid #d5e3d9;min-height:44px}

#agent-dialog .agent-options-menu .chat-tools h4{font-size:14px;margin:0 0 8px;color:#214e42}
#agent-dialog .agent-options-menu .chat-tools .chat-photo-prompt,#agent-dialog .agent-options-menu .chat-tools .chat-photo-preview{margin:4px 0;padding:8px;min-width:0}
#agent-dialog .agent-options-menu .chat-tools .chat-photo-prompt p,#agent-dialog .agent-options-menu .chat-tools .chat-photo-preview p{font-size:11px;line-height:1.4}
#agent-dialog .agent-options-menu .agent-vaccine-fields,#agent-dialog .agent-options-menu .agent-caregiver-fields{grid-template-columns:minmax(0,1fr)}
@media(min-width:1000px){
 #agent-dialog[data-view="chat"] .agent-conversation{position:relative;padding-right:280px;box-sizing:border-box}
 #agent-dialog .agent-compact-toolbar{position:static}
 #agent-dialog .agent-options-menu>summary,#agent-dialog .agent-options-menu .chat-tools .agent-options-close{display:none}
 #agent-dialog .agent-options-menu[open]>.chat-tools{position:absolute;inset:0 0 0 auto;width:280px;height:auto;box-shadow:none;border-radius:0;padding:12px;background:#f7faf7;z-index:4}
 #agent-dialog .agent-options-menu .agent-vaccine-fields,#agent-dialog .agent-options-menu .agent-caregiver-fields{max-height:none;overflow:visible}
}

#agent-dialog .agent-sync-badge{font-size:10px;color:#3d6c54;white-space:nowrap;padding:2px 5px}
#agent-dialog .agent-sync-badge[data-kind="conflict"],#agent-dialog .agent-sync-badge[data-kind="offline"]{color:#8b4a16;background:#fff1db;border-radius:5px}
#agent-dialog .agent-sync-controls{font-size:12px;border-top:1px solid #d3e0d7;padding-top:8px}
#agent-dialog .agent-sync-controls p{font-size:11px;line-height:1.4;margin:5px 0}
#agent-dialog .agent-sync-controls button{width:100%;margin:3px 0!important}
#agent-dialog .agent-sync-compare{border:1px solid #c99b62;border-radius:8px;padding:8px;background:#fff7e9}
#agent-dialog .agent-sync-controls summary{cursor:pointer;font-size:12px;min-height:36px;padding:8px 0}

#agent-dialog .agent-learn-more{border-top:1px solid #d3e0d7;padding-top:6px}
#agent-dialog .agent-learn-more summary{font-size:12px;cursor:pointer;min-height:36px;padding:8px 0;line-height:1.4}
#agent-dialog .agent-learn-more p{font-size:12px;line-height:1.45;margin:6px 0}
#agent-dialog .agent-learn-more h5{font-size:13px;margin:12px 0 4px}
#agent-dialog .agent-learn-more a{display:block;font-size:12px;min-height:36px;padding:7px 0;color:#245b82}

/* Use the modal's own header space instead of the page-level sticky offset. */
#agent-dialog .agent-conversation{top:0}
#agent-dialog .agent-compact-toolbar{min-height:30px;padding:0 10px;gap:6px}
#agent-dialog .agent-compact-toolbar .agent-guide-note{font-size:10px;line-height:1.2}
#agent-dialog .agent-options-menu>summary{min-height:30px;padding:0 7px}
#agent-dialog .agent-sync-badge{font-size:9px;padding:1px 4px}
