/* Contacts keep the site shell; an active room uses one compact conversation. */
.site-chat { --chat-bg:var(--paper-strong); --chat-fg:var(--ink); --chat-muted:var(--ink-soft); --chat-action:var(--forest-soft); --chat-button-fg:var(--ivory); font:16px/1.4 'PT Sans',sans-serif; }
[data-theme="night"] .site-chat { --chat-bg:var(--night-card); --chat-fg:var(--ivory); --chat-muted:#d6ccb9; --chat-action:var(--gold-bright); --chat-button-fg:#171a18; }
#chat-panel { max-height:calc(100dvh - 110px); overflow-y:auto; overscroll-behavior:contain; }
#chat-panel.chat__panel--conversation { right:-6px; width:min(400px,calc(100vw - 40px)); height:min(560px,calc(100dvh - 150px)); max-height:calc(100dvh - 110px); padding:0; overflow:hidden; }
.chat__panel--conversation > section.site-chat { display:flex; flex-direction:column; height:100%; min-height:0; }
.site-chat [hidden],.site-chat__action[hidden] { display:none !important; }
.site-chat button,.site-chat input { font:inherit; }
.site-chat button { cursor:pointer; }
.site-chat button:disabled { cursor:default; opacity:.6; }
.site-chat svg { display:block; width:22px; height:22px; flex:none; }
.site-chat :focus-visible { outline:2px solid var(--chat-action); outline-offset:2px; }
.site-chat p { margin:0; overflow-wrap:anywhere; }
.site-chat__action { display:block; width:100%; min-height:44px; margin-top:12px; padding:10px 14px; border:0; border-radius:10px; background:var(--chat-action); color:var(--chat-button-fg); font-weight:700; cursor:pointer; }
.site-chat__entry { margin:16px 0 0; }
.site-chat__check { display:flex; align-items:center; gap:10px; line-height:1.4; min-height:44px; cursor:pointer; }
.site-chat__check input { flex:0 0 20px; width:20px; height:20px; margin:0; accent-color:var(--chat-action); }
.site-chat__header { flex:none; display:flex; align-items:center; justify-content:space-between; padding:6px; border-bottom:1px solid color-mix(in srgb,var(--chat-muted) 30%,transparent); }
.site-chat__contacts,.site-chat__tools { display:flex; align-items:center; }
.site-chat__tools { margin-left:0; }
#chat-panel .site-chat__contacts a,.site-chat__tools button { display:grid; place-items:center; width:44px; height:44px; min-height:44px; padding:10px; border:0; border-radius:8px; background:transparent; color:var(--chat-action); }
.site-chat__header a:hover,.site-chat__header button:hover { background:color-mix(in srgb,var(--chat-action) 10%,transparent); }
.site-chat__conversation { display:flex; flex:1; min-height:0; flex-direction:column; }
.site-chat__history { flex:1; min-height:0; display:flex; flex-direction:column; gap:12px; overflow:auto; overscroll-behavior:contain; padding:18px 14px; margin:0; list-style:none; }
.site-chat__message { flex:none; max-width:94%; padding:10px 12px; border-radius:12px; background:#eef0e9; color:var(--chat-fg); }
.site-chat__message--visitor { align-self:flex-end; background:#e2eee6; }
[data-theme="night"] .site-chat__message { background:#303530; }
[data-theme="night"] .site-chat__message--visitor { background:#394438; }
.site-chat__author { display:block; margin-bottom:4px; font-size:12px; line-height:1.3; color:var(--chat-muted); }
.site-chat__message p { white-space:pre-wrap; }
#chat-panel .site-chat__download { display:block; min-height:44px; padding:8px 0; overflow-wrap:anywhere; }
.site-chat__phone { flex:none; padding:12px; background:color-mix(in srgb,var(--chat-action) 7%,var(--chat-bg)); border-radius:12px; }
.site-chat__phone label { display:block; margin-bottom:10px; }
.site-chat__phone form > div { display:flex; min-width:0; border-radius:8px; }
.site-chat__phone form > div input:focus { outline:0; }
.site-chat__phone form > div:has(input:focus-visible) { outline:2px solid var(--chat-action); outline-offset:2px; }
.site-chat__phone .site-chat__name { margin-bottom:12px; border-radius:8px; }
.site-chat__phone input { scroll-margin-block:6px; width:100%; min-width:0; min-height:44px; padding:8px 10px; border:1px solid var(--chat-muted); border-radius:8px 0 0 8px; background:var(--chat-bg); color:var(--chat-fg); }
.site-chat__phone button { flex:none; display:grid; place-items:center; width:44px; border:0; border-radius:0 8px 8px 0; background:var(--chat-action); color:var(--chat-button-fg); }
.site-chat__phone [role="status"]:not(:empty) { margin-top:8px; }
.site-chat__typing { flex:none; padding:4px 14px 6px; font-size:13px; color:var(--chat-muted); }
.site-chat__typing::before { content:''; display:inline-block; width:6px; height:6px; margin:0 6px 2px 0; border-radius:50%; background:var(--chat-action); }
.site-chat__composer { flex:none; margin:0; padding:8px; border-top:1px solid color-mix(in srgb,var(--chat-muted) 30%,transparent); }
.site-chat__input { display:flex; align-items:flex-end; min-width:0; border:1px solid var(--chat-muted); border-radius:12px; padding:4px; background:var(--chat-bg); }
.site-chat__input:focus-within { border-color:var(--chat-action); }
.site-chat__input textarea { flex:1; display:block; min-width:0; width:100%; height:44px; min-height:44px; max-height:132px; margin:0; padding:11px 2px; border:0; border-radius:0; resize:none; background:transparent; color:var(--chat-fg); font:16px/1.4 'PT Sans',sans-serif; }
.site-chat__input textarea:focus { outline:0; }
.site-chat__input:has(textarea:focus-visible) { outline:2px solid var(--chat-action); outline-offset:2px; }
.site-chat__input textarea::placeholder { color:var(--chat-muted); opacity:1; }
.site-chat__input button { flex:none; display:grid; place-items:center; width:44px; height:44px; padding:10px; border:0; border-radius:8px; background:transparent; color:var(--chat-action); }
.site-chat__input .site-chat__send { background:var(--chat-action); color:var(--chat-button-fg); }
.site-chat__files:not(:empty) { flex:none; padding:0 8px 4px; max-height:100px; overflow:auto; }
.site-chat__files > div { display:flex; align-items:center; gap:8px; min-width:0; font-size:13px; }
.site-chat__files span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.site-chat__files button { flex:none; display:grid; place-items:center; width:44px; height:44px; border:0; background:transparent; color:var(--chat-action); }
.site-chat__status:not(:empty) { flex:none; padding:8px 12px; color:var(--chat-fg); font-size:14px; }
.site-chat__entry .site-chat__status:not(:empty) { padding:8px 0 0; }
.site-chat__announcements { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media(max-height:600px) { #chat-panel { bottom:62px; max-height:calc(100dvh - 100px); } #chat-panel.chat__panel--conversation { height:calc(100dvh - 110px); } }
.site-chat__dialog { box-sizing:border-box; width:min(440px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; padding:24px; border:1px solid var(--chat-muted); border-radius:16px; background:var(--chat-bg); color:var(--chat-fg); }
.site-chat__dialog::backdrop { background:rgb(10 18 14 / 65%); }
.site-chat__dialog h2 { margin:0 0 12px; }
.site-chat__dialog-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:20px; }
.site-chat__dialog-actions button { flex:1 1 150px; min-height:44px; margin:0; padding:10px 14px; border-radius:10px; }
.site-chat__keep { background:transparent; color:var(--chat-fg); border:1px solid var(--chat-muted); }
.site-chat__end-error:not(:empty) { margin-top:12px; }
.site-chat__form { margin-top:12px; }
.site-chat__form h3 { margin:0 0 12px; font-size:17px; }
.site-chat__form label { display:grid; gap:4px; margin:10px 0; font-size:15px; }
.site-chat__form input { box-sizing:border-box; width:100%; min-width:0; min-height:44px; padding:8px; border:1px solid var(--chat-muted); border-radius:8px; background:var(--chat-bg); color:var(--chat-fg); font:inherit; }
.site-chat__form [role="status"]:not(:empty) { margin-top:8px; }


.site-chat__contacts svg { fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
