.wcv-chat { --wcv-accent: #2f6b4f; position: fixed; right: 18px; bottom: 18px; z-index: 99999; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wcv-chat *, .wcv-chat *::before, .wcv-chat *::after { box-sizing: border-box; }
.wcv-chat [hidden] { display: none !important; }

.wcv-chat__toggle { background: var(--wcv-accent); color: #fff; border: 0; border-radius: 50%; width: 58px; height: 58px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.28); }

.wcv-chat__balloon { --wcv-balloon: #d9480f; position: absolute; right: 2px; bottom: 70px; display: flex; align-items: center; background: var(--wcv-balloon); color: #fff; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.28); animation: wcv-pop .35s ease-out; }
.wcv-chat__balloon::after { content: ""; position: absolute; right: 20px; bottom: -7px; border: 8px solid transparent; border-top-color: var(--wcv-balloon); border-bottom: 0; }
.wcv-chat__balloon-text { background: transparent; color: inherit; border: 0; font: inherit; font-weight: 600; font-style: italic; white-space: nowrap; padding: 11px 6px 11px 16px; cursor: pointer; }
.wcv-chat__balloon-close { background: transparent; color: inherit; border: 0; font-size: 20px; line-height: 1; padding: 6px 10px 6px 4px; cursor: pointer; opacity: .9; }
.wcv-chat__balloon-text:focus-visible, .wcv-chat__balloon-close:focus-visible { outline: 3px solid #fff; outline-offset: -3px; border-radius: 12px; }
@keyframes wcv-pop { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wcv-chat__balloon { animation: none; } }
.wcv-chat__toggle:hover { filter: brightness(1.1); }
.wcv-chat__toggle:focus-visible, .wcv-chat__send:focus-visible, .wcv-chat__close:focus-visible, .wcv-chat__input:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.wcv-chat__toggle.is-open { display: none; }

.wcv-chat__panel { position: absolute; right: 0; bottom: 0; width: 360px; max-width: calc(100vw - 36px); height: 560px; max-height: calc(100vh - 36px); display: flex; flex-direction: column; background: #fff; color: #1d2327; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.28); overflow: hidden; }

.wcv-chat__head { display: flex; align-items: center; gap: 8px; background: var(--wcv-accent); color: #fff; padding: 12px 14px; }
.wcv-chat__sub { font-size: 12px; opacity: .85; flex: 1; }
.wcv-chat__close { background: transparent; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; display: inline-flex; align-items: center; gap: 6px; }
.wcv-chat__close-label { display: none; font-size: 15px; font-weight: 600; }

.wcv-chat__log { flex: 1; overflow-y: auto; padding: 14px; background: #f6f7f7; display: flex; flex-direction: column; gap: 8px; }
.wcv-chat__msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.wcv-chat__msg--bot { background: #fff; border: 1px solid #dcdcde; align-self: flex-start; }
.wcv-chat__msg--user { background: var(--wcv-accent); color: #fff; align-self: flex-end; }
.wcv-chat__msg--user a { color: #fff; }
.wcv-chat__msg a { color: #0a58ca; text-decoration: underline; }
.wcv-chat__msg.is-typing { opacity: .6; }

.wcv-chat__form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #dcdcde; background: #fff; }
.wcv-chat__input { flex: 1; min-width: 0; border: 1px solid #8c8f94; border-radius: 8px; padding: 9px 10px; font: inherit; }
.wcv-chat__send { background: var(--wcv-accent); color: #fff; border: 0; border-radius: 8px; padding: 0 16px; font: inherit; font-weight: 600; cursor: pointer; }
.wcv-chat__send:disabled { opacity: .5; cursor: default; }

.wcv-chat__msg--note { align-self: stretch; max-width: 100%; background: #fff8e1; border: 1px solid #f0d98a; color: #50410a; font-size: 13px; }

.wcv-chat__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wcv-chat__action { display: flex; }
.wcv-chat__chip { background: #fff; color: var(--wcv-accent); border: 1px solid var(--wcv-accent); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.wcv-chat__chip:hover { background: #f0f6f3; }
.wcv-chat__chip:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.wcv-chat__chip--primary { background: var(--wcv-accent); color: #fff; }
.wcv-chat__chip--primary:hover { background: var(--wcv-accent); filter: brightness(1.1); }

.wcv-chat__inquiry { background: #fff; color: var(--wcv-accent); border: 0; border-top: 1px solid #dcdcde; padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; }
.wcv-chat__inquiry:hover { background: #f0f6f3; }
.wcv-chat__inquiry:focus-visible { outline: 3px solid #1a73e8; outline-offset: -3px; }

.wcv-chat__lead { background: #fff; border: 1px solid #dcdcde; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.wcv-chat__lead-note { margin: 0; font-size: 12px; color: #50575e; }
.wcv-chat__field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.wcv-chat__field input, .wcv-chat__field textarea { border: 1px solid #8c8f94; border-radius: 6px; padding: 7px 8px; font: inherit; width: 100%; }
.wcv-chat__field input:focus-visible, .wcv-chat__field textarea:focus-visible { outline: 3px solid #1a73e8; outline-offset: 1px; }
.wcv-chat__lead-status { color: #b32d2e; font-size: 13px; min-height: 1em; }
.wcv-chat__lead-row { display: flex; gap: 8px; align-items: center; }
.wcv-chat__lead-row .wcv-chat__send { padding: 9px 18px; }
.wcv-chat__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 480px) {
  .wcv-chat { right: 10px; bottom: 10px; font-size: 14px; }
  /* Phone: full-screen sheet sized to the visible screen, with a big Close button */
  .wcv-chat__panel { position: fixed; left: 0; right: 0; top: 0; bottom: auto; width: 100%; max-width: none; height: var(--wcv-vh, 100dvh); max-height: none; border-radius: 0; }
  .wcv-chat__head { padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .wcv-chat__close { background: rgba(255,255,255,.2); border-radius: 8px; padding: 8px 12px; min-height: 44px; }
  .wcv-chat__close-label { display: inline; }
  .wcv-chat__input { font-size: 16px; }
  .wcv-chat__form { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}
