.home-chat { color: #213c31; min-width: 0; }
.chat-composer { margin: 0; padding: 14px 18px 11px; border: 1px solid #a4b3a4; border-radius: 14px; background: #fffefa; box-shadow: 0 3px 11px #334b310b; }
.chat-composer:focus-within { border-color: #47745f; box-shadow: 0 0 0 2px #567d601c; }
.chat-writing { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.chat-writing textarea, .chat-writing .chat-mirror {
  grid-area: 1 / 1; box-sizing: border-box; width: 100%; margin: 0; padding: 4px 1px;
  border: 0; border-radius: 0; min-height: 3.4em; max-height: min(36vh, 222px);
  font: 400 clamp(16px, 1.4vw, 19px)/1.55 var(--font-sans); letter-spacing: normal;
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; text-align: start;
}
.chat-writing textarea { background: transparent; color: #172f24; outline: none; resize: none; overflow: auto; scrollbar-width: thin; }
.product-main .chat-writing textarea::placeholder { color: #667064; opacity: 1; }
.chat-writing .chat-mirror { visibility: hidden; pointer-events: none; overflow: hidden; }
.chat-writing.expanded textarea, .chat-writing.expanded .chat-mirror { max-height: none; }
.chat-controls { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin-top: 5px; }
.home-chat button { font: inherit; cursor: pointer; }
.chat-controls .chat-attach, .chat-controls .chat-expand, .chat-reset, .chat-next {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; border: 0; padding: 4px 0;
  background: transparent; color: #476251; font-size: 13px;
}
.chat-controls .chat-attach::before { content: '+'; font-family: system-ui, sans-serif; font-size: 21px; font-weight: 350; line-height: 1; }
.chat-controls [hidden], .home-chat [hidden] { display: none; }
.chat-controls .chat-submit { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 12px; justify-content: center; min-height: 42px; padding: 5px 15px; border: 1px solid #234a38; border-radius: 9px; background: #234a38; color: #fffdf6; font-size: 15px; font-weight: 600; }
.chat-submit span[aria-hidden] { font-family: system-ui, sans-serif; font-size: 18px; line-height: 1; }
.chat-submit:hover:not(:disabled) { background: #123b2b; }
.home-chat button:focus-visible, .home-chat a:focus-visible, .home-chat summary:focus-visible { outline: 2px solid #527854; outline-offset: 3px; }
.home-chat button:disabled { opacity: .58; cursor: wait; }
.chat-file-feedback, .chat-length, .chat-status { color: #455b4d; font-size: 13px; margin: 6px 1px 0; overflow-wrap: anywhere; }
.chat-length, .chat-status[data-error] { color: #914122; }
.chat-transcript { text-align: start; margin: 0 1px 13px; overflow-wrap: anywhere; }
.chat-transcript[hidden] { display: none; }
.chat-history { margin: 0 0 8px; color: #506354; font-size: 13px; }
.chat-history summary { cursor: pointer; width: fit-content; padding: 7px 0; }
.chat-turn { padding: 13px 1px 4px; border-top: 1px solid #bdcabe; }
.chat-question { margin: 0 0 10px; font: 650 clamp(17px, 1.5vw, 21px)/1.45 var(--font-sans); color: #223d30; white-space: pre-line; max-height: 6.5em; overflow: auto; }
.chat-answer { color: #24382c; font-size: 16px; line-height: 1.75; }
.chat-answer p { margin: 0; white-space: pre-line; }
.chat-answer p + p { margin-top: .5em; }
.chat-sources { margin: 10px 0 0; padding: 0; list-style: none; }
.chat-sources li { display: flex; align-items: baseline; gap: 3px 8px; flex-wrap: wrap; padding: 2px 0; }
.chat-sources a, .chat-next { color: #22583f; text-decoration: underline; text-decoration-color: #91ab94; text-underline-offset: 4px; font-size: 14px; line-height: 1.5; }
.chat-sources a { display: inline-block; padding: 5px 0; }
.chat-source-kind, .chat-origin { font-size: 12px; color: #596a5d; }
.chat-origin { margin: 9px 0 0; }
.chat-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 15px; }
.chat-reset { margin-left: auto; }
.chat-history .chat-turn { margin-bottom: 10px; }
@media (max-width: 620px) {
  .chat-composer { border-radius: 12px; padding: 11px 12px 8px; }
  .chat-controls { column-gap: 10px; margin-top: 3px; }
  .chat-controls .chat-submit { min-height: 44px; }
}
@media print { .home-chat { display: none; } }
