.chat-widget{position:fixed;right:max(16px,calc((100vw - 460px)/2 + 16px));bottom:92px;z-index:40;font-family:var(--font-sans);color:var(--ink)}
.chat-toggle{width:56px;height:56px;border-radius:50%;border:1px solid var(--brand);background:var(--brand);color:#fff;display:grid;place-items:center;font-size:24px;font-weight:700;box-shadow:var(--shadow);cursor:pointer}
.chat-toggle:focus-visible{outline:2px solid var(--brand);outline-offset:3px}
.chat-panel{position:fixed;right:max(16px,calc((100vw - 460px)/2 + 16px));bottom:160px;width:min(360px,calc(100vw - 32px));height:min(480px,calc(100vh - 132px));background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);display:grid;grid-template-rows:auto 1fr auto;overflow:hidden}
.chat-panel[hidden]{display:none}
.chat-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:14px 14px 12px;border-bottom:1px solid var(--line);background:#fff}
.chat-title{font-size:var(--fs-small);font-weight:700;line-height:1.35}
.chat-sub{font-size:var(--fs-label);color:var(--muted);line-height:1.45;margin-top:2px}
.chat-close{border:1px solid var(--line);background:#fff;border-radius:8px;width:34px;height:34px;font-size:20px;line-height:1;color:var(--muted);cursor:pointer}
.chat-log{padding:14px;overflow:auto;background:#fafcfb;display:flex;flex-direction:column;gap:10px}
.chat-msg{max-width:88%;border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:var(--fs-small);line-height:1.7;background:#fff;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-msg.user{align-self:flex-end;background:var(--brand);border-color:var(--brand);color:#fff}
.chat-msg.assistant{align-self:flex-start}
.chat-msg.notice{border-color:rgba(21,122,82,.2);background:#f4fbf7;color:var(--brand)}
.chat-msg.error{border-color:rgba(179,64,31,.35);background:#fff8f5;color:var(--err)}
.chat-msg a{color:var(--brand);font-weight:700;text-decoration:none}
.chat-msg.user a{color:#fff;text-decoration:underline}
.chat-consent{max-width:100%}
.chat-consent-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.chat-consent-actions button{border:1px solid var(--brand);border-radius:8px;background:#fff;color:var(--brand);font:inherit;font-weight:700;padding:8px 10px;cursor:pointer}
.chat-consent-actions button:first-child{background:var(--brand);color:#fff}
.chat-form{display:grid;grid-template-columns:1fr auto;gap:8px;padding:12px;border-top:1px solid var(--line);background:#fff}
.chat-input{min-width:0;border:1px solid var(--line);border-radius:var(--radius);padding:11px 12px;font-size:16px;font-family:inherit;color:var(--ink)}
.chat-input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(21,122,82,.12)}
.chat-send{border:none;border-radius:var(--radius);background:var(--brand);color:#fff;font-size:var(--fs-small);font-weight:700;padding:0 14px;cursor:pointer}
.chat-send:disabled{background:#fff;color:var(--muted);border:1px solid var(--line);cursor:not-allowed}
@media(max-width:620px){
  .chat-widget{right:16px;bottom:88px}
  .chat-panel{position:fixed;inset:0;width:auto;height:auto;border-radius:0;border:none}
}
