/* Live chat widget (chat.js). Uses the site palette from site.css. */
.vbchat { --vbchat-lift: 0px; position: fixed; right: 18px; bottom: calc(18px + var(--vbchat-lift)); z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font-family: var(--font); }
.vbchat-btn { position: relative; display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.1rem; border: 0; border-radius: 999px; background: var(--mint); color: #06100a; font: 600 .95rem/1 var(--font); cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06); transition: transform .15s ease, background .15s ease; }
.vbchat-btn:hover { background: #7cf5a3; }
.vbchat-btn:active { transform: scale(.97); }
.vbchat-btn:focus-visible, .vbchat-close:focus-visible, .vbchat-send:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.vbchat.is-open .vbchat-btn-label { display: none; }
.vbchat-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font: 700 .72rem/20px var(--font); text-align: center; }
.vbchat-panel { width: min(370px, calc(100vw - 36px)); height: min(540px, calc(100vh - 120px - var(--vbchat-lift))); display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 24px 60px rgba(0,0,0,.55); overflow: hidden; }
.vbchat-panel[hidden] { display: none; }
.vbchat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.1rem .9rem; border-bottom: 1px solid var(--line); background: var(--bg-3); }
.vbchat-head div { display: grid; gap: .15rem; }
.vbchat-head strong { font-size: 1rem; }
.vbchat-head span { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.vbchat-close { border: 0; background: transparent; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.vbchat-close:hover { color: var(--text); }
.vbchat-msgs { list-style: none; margin: 0; padding: 1rem; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; }
.vbchat-msg { max-width: 85%; display: grid; gap: .2rem; }
.vbchat-msg p { margin: 0; padding: .6rem .85rem; border-radius: 14px; font-size: .92rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.vbchat-msg-admin { align-self: flex-start; }
.vbchat-msg-admin p { background: var(--bg-3); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.vbchat-msg-visitor { align-self: flex-end; text-align: right; }
.vbchat-msg-visitor p { background: var(--mint); color: #06100a; border-bottom-right-radius: 4px; text-align: left; }
.vbchat-time { color: var(--muted); font: .7rem var(--mono); }
.vbchat-ask { margin: 0 1rem .6rem; padding: .7rem .8rem; border: 1px solid var(--mint-dim); border-radius: 12px; background: rgba(94,240,140,.06); }
.vbchat-ask p { margin: 0 0 .5rem; font-size: .82rem; color: var(--muted); line-height: 1.4; }
.vbchat-ask-row { display: flex; gap: .4rem; }
.vbchat-ask input { flex: 1; min-width: 0; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: .9rem var(--font); }
.vbchat-ask button { padding: .5rem .8rem; border: 0; border-radius: 10px; background: var(--mint); color: #06100a; font: 600 .85rem var(--font); cursor: pointer; }
.vbchat-err { margin: 0 1rem .5rem; color: var(--danger); font-size: .82rem; }
.vbchat-form { display: flex; gap: .5rem; align-items: flex-end; padding: .7rem .8rem .4rem; border-top: 1px solid var(--line); }
.vbchat-form textarea { flex: 1; resize: none; max-height: 120px; padding: .6rem .8rem; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: .92rem/1.4 var(--font); }
.vbchat-form textarea:focus, .vbchat-ask input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-dim); }
.vbchat-send { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: var(--mint); color: #06100a; cursor: pointer; }
.vbchat-send:disabled { opacity: .5; cursor: default; }
.vbchat-note { margin: 0; padding: 0 1rem .7rem; color: var(--muted); font-size: .7rem; line-height: 1.35; }
@media (max-width: 480px) {
  .vbchat { right: 12px; bottom: calc(12px + var(--vbchat-lift)); }
  .vbchat.is-open { left: 12px; }
  .vbchat-panel { width: 100%; height: calc(100vh - 100px - var(--vbchat-lift)); }
}
@media (prefers-reduced-motion: reduce) { .vbchat-btn { transition: none; } }
