.customer-chat{max-width:52rem;margin:0 auto;padding:1.2rem;border-radius:1rem;background:var(--panel,var(--surface,#eaf3ec));color:var(--ink,#193b31)}
.customer-chat textarea{display:block;width:100%;box-sizing:border-box;resize:vertical;font:inherit;min-height:5rem}
.chat-messages{max-height:58vh;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin-bottom:1rem}
.chat-message{padding:.8rem 1rem;margin:.7rem 0;border-radius:.75rem;overflow-wrap:anywhere;white-space:pre-wrap;background:var(--surface,#fff)}
.chat-message[data-role=user]{margin-left:2rem;background:var(--chat-user,#dcebdd)}
.chat-message strong{display:block;margin-bottom:.35rem}.chat-message p{margin:0}.chat-message button{margin-top:.65rem;font-size:.85rem;padding:.4rem .65rem}
.chat-actions{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin-top:.8rem}
.chat-data-note{display:inline-block;color:var(--muted);font-size:.8rem}.chat-basis{margin-top:.35rem;font-size:.8rem}.chat-site{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;margin-bottom:1rem}.chat-site select{max-width:100%}
.customer-chat dialog{max-width:32rem;width:calc(100vw - 3rem);padding:1.2rem;box-sizing:border-box;border-radius:1rem;border:0;background:var(--surface,#fff);color:inherit}.customer-chat dialog::backdrop{background:#0008}
.chat-bug{padding:1rem;margin:1rem 0;border:1px solid var(--border,#abbfb2);border-radius:.7rem}
html[data-theme=dark] .customer-chat{background:#203c32;color:#e8f4eb}html[data-theme=dark] .chat-message{background:#152b23}html[data-theme=dark] .chat-message[data-role=user]{background:#304d40}html[data-theme=dark] .customer-chat dialog{background:#203c32;color:#e8f4eb}
@media(max-width:600px){.customer-chat{padding:.85rem}.chat-message{padding:.7rem}.chat-message[data-role=user]{margin-left:1rem}.chat-actions button{flex:1}.chat-messages{max-height:52vh}}
/* Native dialog keeps chart state and document scroll position behind the chat. */
.chat-overlay{width:min(54rem,calc(100vw - 1.5rem));max-height:90dvh;padding:0;border:1px solid var(--line);border-radius:1rem;color:var(--ink);background:var(--panel);overscroll-behavior:contain}
.chat-overlay::backdrop{background:#0008}.chat-overlay-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 1.2rem;position:sticky;top:0;z-index:2;background:var(--panel);border-bottom:1px solid var(--line)}
.chat-overlay-heading h2{margin:0;font-size:1.2rem}.chat-overlay-heading button{font-size:1.4rem;padding:.15rem .65rem}.chat-overlay .customer-chat{max-width:none;margin:0;border-radius:0}.chat-overlay .chat-messages{max-height:38dvh}
.chart-days-with-chat .chart-chat-toggle{margin-left:.4rem;align-self:stretch;justify-content:center}.chart-days-with-chat.show-history .chart-chat-toggle{order:-1;margin-left:0}
@media(max-width:600px){.chart-days-with-chat:has(.chart-history-toggle){grid-template-columns:1.8rem repeat(3,minmax(0,1fr)) 4.2rem}.chart-days-with-chat .chart-chat-toggle{font-size:.8rem;margin-left:0;padding:.35rem .2rem;white-space:normal;line-height:1.15}.chat-overlay-heading{padding:.6rem .85rem}.chat-overlay{max-height:92dvh}}

/* Distinct chat action; the smiling plug is cropped from the existing Wattr mark. */
html button.secondary.customer-chat-launch{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;background:#eadfc9;color:#44392b;border-color:#b9a789}
html button.secondary.customer-chat-launch img{width:20px;height:24px;flex:none;object-fit:contain}
html button.secondary.customer-chat-launch span{line-height:1.15}
html[data-theme=dark] button.secondary.customer-chat-launch{background:#d8c5a3;color:#30281e;border-color:#b7a07a}
html button.secondary.customer-chat-launch:focus-visible{outline:3px solid #876c42;outline-offset:3px}
@media(hover:hover) and (pointer:fine){html button.secondary.customer-chat-launch:hover{background:#dfd0b4}html[data-theme=dark] button.secondary.customer-chat-launch:hover{background:#cbb58f}}
@media(max-width:600px){html .chart-days-with-chat button.secondary.customer-chat-launch{flex-direction:row;gap:.2rem}html .chart-days-with-chat button.secondary.customer-chat-launch span{max-width:2.8rem}html .chart-days-with-chat button.secondary.customer-chat-launch img{width:17px;height:22px}}
