/* Scoped chat refinement; typography, navigation, and input feedback only. */
.conversation{min-width:0}
.conversation-head{flex-shrink:0}
.message-history{position:relative;display:flex;flex-direction:column;min-height:0;flex:1;overflow:hidden}
.message-history>.messages{min-height:0;scroll-behavior:auto;padding-bottom:22px}
.messages:focus-visible{outline:2px solid #7a9a82;outline-offset:-3px}
.message{margin-bottom:22px;min-width:0;animation-duration:.24s}
.message p,.message .muted{font-size:16px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8}
.byline{font-size:11px;letter-spacing:.3px;font-weight:600;color:#5b7867;margin-bottom:6px}
.message.agent+.message.agent{margin-top:-10px}
.message.agent:not(.chat-structured)+.message.agent:not(.chat-structured)>.byline{display:none}
.message.user{width:fit-content;max-width:95%;margin-left:auto;border:1px solid #e3e5e6;border-radius:14px 14px 4px 14px;background:#f0f1f2;padding:10px 14px}
.message.user p{margin:2px 0}
.message .message-image{display:block;position:relative;padding:0;max-width:100%;border:0;border-radius:9px;background:#e5ecdf;overflow:hidden;color:#fff;text-align:left;cursor:zoom-in;margin-bottom:9px}
.message .message-image img{display:block;max-width:100%;width:220px;max-height:180px;object-fit:contain;margin:0;border-radius:0}
.message .message-image span{display:block;padding:5px 10px;background:#385d49;color:#fff;font-size:11px;text-align:right}
.message-image:focus-visible,.chat-jump:focus-visible,.composer button:focus-visible{outline:3px solid #91b69a;outline-offset:3px}
.message[data-pending] p{display:flex;gap:9px;align-items:center;color:#587461;font-size:14px}
.message[data-pending] p::before{content:'';width:12px;height:12px;flex-shrink:0;border:2px solid #d5e3d2;border-top-color:#366b50;border-radius:50%;animation:chat-spin .9s linear infinite}
.message[data-error]{padding:12px;border:1px solid #e7d6b4;border-radius:9px;background:#fffaf0}
.message[data-error] p{font-size:14px;color:#775728}
.chat-jump{position:absolute;z-index:2;bottom:10px;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);padding:9px 16px;min-height:38px;border:1px solid #d1dfca;border-radius:22px;background:#fff;color:#28563e;box-shadow:0 4px 18px #20412b18;font-size:12px;white-space:nowrap;cursor:pointer}
.chat-jump:active:not(:disabled){transform:translateX(-50%) translateY(1px)}
.chat-jump[hidden]{display:none}
.composer-wrap{flex-shrink:0;border-top:1px solid #edf0e9;padding:10px 16px 8px;background:#fff}
.composer-wrap>.guided-question{padding:0;margin:0 0 9px;border:0;border-radius:0;background:none}
.composer-wrap>.guided-question .quick-action{width:100%;text-align:left;min-height:38px;padding:9px 12px;border-radius:8px;background:#f0f5eb;border-color:#dce6d4;color:#2e5d43;font-size:12px}
.composer{padding:11px 12px 9px;border-radius:13px;border-color:#ccd9c8;transition:border-color .15s,box-shadow .15s}
.composer textarea{display:block;box-sizing:border-box;min-height:50px;max-height:none;padding:0 1px;line-height:1.7;font-size:16px;resize:none;scrollbar-width:thin}
.composer>div{gap:7px;margin-top:8px;align-items:center}
.composer #attach{font-size:12px;display:inline-flex;align-items:center;gap:4px;min-height:38px;min-width:60px;padding:0 3px;white-space:nowrap}
.composer #attach span{font-size:24px;color:inherit;line-height:1}
.composer .chat-keyboard-hint{display:flex;flex-wrap:wrap;gap:0 8px;font-size:10px;line-height:1.5;color:#71816f;flex:1;min-width:0}
.composer .chat-keyboard-hint span{font-size:inherit;white-space:nowrap}
.composer .send{width:38px;min-width:38px;height:38px;min-height:38px;font-size:25px;flex-shrink:0;margin-left:auto;display:grid;place-items:center;border-radius:10px}
.composer .send:disabled{background:#e7ece3;color:#9ba995;opacity:1}
.composer .send[aria-busy=true]{font-size:0;background:#e8f0e3;color:#406c4e}
.composer .send[aria-busy=true]::before{content:'';width:15px;height:15px;border:2px solid #bfd2b9;border-top-color:#406c4e;border-radius:50%;animation:chat-spin .9s linear infinite}
.composer-note{font-size:11px;color:#758470;text-align:center;line-height:1.5;margin:6px 0 0}
.composer.is-processing+.composer-note{color:#365f45}
#chatImageDialog{width:fit-content;max-width:calc(100vw - 32px);padding:18px;border-radius:14px}
#chatImageDialog .dialog-heading{gap:30px;margin-bottom:12px}
#chatImageDialog h3{margin:0;font-size:17px}
#chatImageDialog .dialog-heading button{min-width:40px;min-height:40px}
#chatImageDialog>img{display:block;max-width:100%;max-height:68dvh;object-fit:contain;border-radius:8px;background:#f4f6f0}
#chatImageDialog>p{font-size:12px;text-align:center;color:#687d6b;margin:12px 0 0}
@keyframes chat-spin{to{transform:rotate(360deg)}}
@media(min-width:1700px){.message p,.message .muted{font-size:16px}.composer textarea{font-size:16px}.composer .chat-keyboard-hint{font-size:11px}}

@media(max-width:760px){.message-history>.messages{padding:16px 18px 24px}.message p,.message .muted{font-size:16px}.composer textarea{font-size:16px}.composer-wrap{padding-bottom:max(8px,env(safe-area-inset-bottom))}.composer-note{font-size:10px}.composer .send{min-height:40px;width:40px}.conversation-head{min-height:66px}.message .message-image img{max-height:180px}}
@media(prefers-reduced-motion:reduce){.message,.message[data-pending] p::before,.composer .send[aria-busy=true]::before{animation:none}.composer{transition:none}}

/* Conversation and operation receipts have separate visual weights. No draft changes. */
.chat-structured{margin-bottom:24px}
.chat-activity{border-left:2px solid #e1e4e5;padding:1px 0 2px 13px;margin:5px 0;color:#35433e}
.chat-activity-heading{font-size:11px;font-weight:500;color:#78817e;letter-spacing:.4px;margin-bottom:9px}
.chat-event-row{display:grid;grid-template-columns:16px auto minmax(0,1fr);align-items:baseline;gap:6px;font-size:13px;line-height:1.65;min-width:0;padding:3px 0}
.chat-event-icon{color:#798580;text-align:center;font-size:14px}
.chat-event-label{color:#69746f;font-size:13px;font-weight:400}
.chat-event-value{font-size:14px;font-weight:600;overflow-wrap:anywhere;min-width:0}
.chat-event-reference{grid-column:2/-1;font-size:11px;color:#748079;overflow-wrap:anywhere}
.chat-event-history{margin:-4px 0 5px}
.chat-event-history>summary,.chat-flow-note>summary{cursor:pointer;min-height:32px;padding:6px 0;font-size:12px;line-height:20px;color:#65716b;width:fit-content;max-width:100%;border-radius:3px}
.chat-event-history>summary:hover,.chat-flow-note>summary:hover{color:#253d35}
.chat-event-history>summary:focus-visible,.chat-flow-note>summary:focus-visible{outline:2px solid #7a9a82;outline-offset:3px}
.chat-event-history>summary::marker,.chat-flow-note>summary::marker{color:#8d9792;font-size:10px}
.chat-event-list{list-style:none;padding:0;margin:4px 0 10px}
.chat-event-list>li{padding:6px 0;border-bottom:1px solid #eff0f0}
.chat-event-list .chat-event-value{font-size:13px;font-weight:400;color:#65716b}
.chat-event-list .chat-event-label,.chat-event-list .chat-event-icon{color:#7b8580;font-size:12px}
.chat-message-copy{margin:16px 0 0}
.message-presentation>.chat-message-copy:first-child{margin-top:0}
.chat-message-text{font-size:16px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-flow-note{margin:5px 0 0;color:#647069}
.chat-activity+.chat-flow-note{padding-left:15px}
.chat-flow-copy{font-size:13px;line-height:1.8;white-space:pre-wrap;padding:4px 0 8px}
.chat-quote-receipt{padding:1px 0 4px}
.chat-receipt-prices{display:flex;flex-wrap:wrap;gap:10px 22px;margin:10px 0 13px}
.chat-receipt-price{flex:1 1 124px;min-width:0}
.chat-price-label{font-size:12px;color:#69746f;line-height:1.5;margin-bottom:3px}
.chat-receipt-amount{display:block;font-size:24px;line-height:1.5;letter-spacing:-.3px;font-variant-numeric:tabular-nums;font-weight:600;overflow-wrap:anywhere}
.chat-unit-value{display:flex;align-items:baseline;gap:4px;min-height:36px;line-height:1.8;font-variant-numeric:tabular-nums}
.chat-unit-value strong{font-size:20px;font-weight:600;overflow-wrap:anywhere;min-width:0}
.chat-unit-value>span{font-size:12px;color:#69746f;white-space:nowrap}
.chat-unit-value>.chat-unit-missing{font-size:13px;line-height:36px}
.chat-receipt-meta{display:grid;grid-template-columns:65px minmax(0,1fr);gap:5px 10px;font-size:12px;line-height:1.7;margin:0}
.chat-receipt-meta dt{color:#768078}.chat-receipt-meta dd{margin:0;overflow-wrap:anywhere}
.chat-quote-link{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:0;border:0;background:transparent;color:#235c48;font:inherit;text-align:left;text-decoration:underline;text-decoration-color:#9ab8a9;text-underline-offset:3px;overflow-wrap:anywhere;min-height:26px}
.chat-quote-link:hover:not(:disabled){color:#174833;text-decoration-color:currentColor}.chat-quote-link:focus-visible{outline:none;text-decoration-thickness:2px;text-decoration-color:currentColor}.chat-quote-link[aria-busy=true]{cursor:progress}
.saved-quote-reference{font-size:12px;color:#68766d;overflow-wrap:anywhere}.saved-quote-reference strong{color:#365b48;font-weight:550}
.chat-receipt-note{font-size:11px;color:#758078;line-height:1.7;margin-top:9px}

/* Keep a readable phone-sized conversation pane; switch views before either pane gets cramped. */
@media(min-width:761px) and (max-width:1023px){
 .mobile-view-tabs{display:flex;gap:6px;align-items:center;height:46px;padding:5px 18px;background:#fcfdfa;border-bottom:1px solid var(--line)}
 .mobile-view-tabs button{flex:1;min-height:34px;border:0;border-radius:7px;background:transparent;color:#637865;font-size:13px}
 .mobile-view-tabs button[aria-pressed=true]{background:#285d48;color:#fff}
 main{display:block;height:calc(100dvh - 110px);background:#f6f8f2}
 main[data-pane="chat"] .workspace,main[data-pane="plan"] .conversation{display:none}
 .conversation,.workspace{height:100%;min-height:0}
 .conversation{display:flex;max-width:640px;margin-inline:auto;border-inline:1px solid var(--line)}
 .workspace{display:flex}
 .workspace-scroll{overflow-y:auto;min-height:0}
}
