#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:'Suggested replies · 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}}
