/* Valakia Chat widget. Everything is under #vchat and resets what it needs, so the theme's
   styles do not leak in. The accent colour comes from the plugin settings (--vchat-accent). */
#vchat {
  --vchat-accent: #cf177f;
  --vchat-lift: 0px;   /* set by chat.js: how far to move up to clear a cookie banner / consent tab */
  --vchat-ink: #17202b;
  --vchat-muted: #5b6776;
  --vchat-line: #d9dfe7;
  --vchat-surface: #ffffff;
  --vchat-soft: #f3f5f8;
  position: fixed; right: 20px; bottom: calc(20px + var(--vchat-lift)); z-index: 99990; transition: bottom .2s ease;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--vchat-ink);
}
#vchat *, #vchat *::before, #vchat *::after { box-sizing: border-box; }
#vchat [hidden] { display: none !important; }
#vchat.vchat-wait .vchat-launcher { display: none; }

#vchat .vchat-launcher {
  display: inline-flex; align-items: center; gap: 8px; position: relative;
  padding: 12px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--vchat-accent); color: #fff; font-family: inherit; font-size: 15px; line-height: 1.3; font-weight: 600;
  box-shadow: 0 6px 20px rgba(15, 30, 55, .28);
}
#vchat .vchat-launcher:hover { filter: brightness(1.07); }
#vchat .vchat-launcher:focus-visible, #vchat .vchat-close:focus-visible, #vchat .vchat-send:focus-visible, #vchat .vchat-new:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--vchat-accent); }
#vchat .vchat-launcher.vchat-online::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .3); order: -1; }
#vchat .vchat-presence { margin: 2px 0 0; padding: 0; font-size: 12px; line-height: 1.3; color: rgba(255, 255, 255, .85); }
#vchat .vchat-presence::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
#vchat .vchat-presence.vchat-on::before { background: #3ddc84; }
#vchat .vchat-away { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--vchat-soft); color: var(--vchat-ink); font-size: 13px; }
#vchat .vchat-dot { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: #e5484d; border: 2px solid #fff; }

#vchat .vchat-panel {
  position: absolute; right: 0; bottom: 58px; width: 370px; max-width: calc(100vw - 24px); max-height: min(640px, calc(100vh - 100px - var(--vchat-lift)));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--vchat-surface); border: 1px solid var(--vchat-line); border-radius: 14px; box-shadow: 0 18px 50px rgba(15, 30, 55, .3);
}
#vchat .vchat-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 12px 16px; background: var(--vchat-accent); color: #fff; }
#vchat .vchat-header h2 { margin: 0; padding: 0; font-family: inherit; font-size: 16px; line-height: 1.3; font-weight: 600; color: inherit; letter-spacing: 0; text-transform: none; }
#vchat .vchat-close { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #fff; font-family: inherit; font-size: 24px; line-height: 1; font-weight: 400; cursor: pointer; }
#vchat .vchat-close:hover { background: rgba(255, 255, 255, .18); }
#vchat .vchat-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; overflow-y: auto; }

#vchat .vchat-intro, #vchat .vchat-status { margin: 0; color: var(--vchat-muted); font-size: 14px; }
#vchat .vchat-status { padding: 8px 10px; border-radius: 8px; background: var(--vchat-soft); }
#vchat .vchat-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
#vchat label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; font-weight: 600; color: var(--vchat-ink); text-transform: none; letter-spacing: 0; }
#vchat input:not([type="checkbox"]), #vchat textarea {
  width: 100%; margin: 0; padding: 9px 10px; border: 1px solid var(--vchat-line); border-radius: 8px;
  background: #fff; color: var(--vchat-ink); font-family: inherit; font-size: 15px; line-height: 1.4; font-weight: 400; box-shadow: none;
}
#vchat textarea { resize: vertical; min-height: 44px; }
#vchat input:focus, #vchat textarea:focus { outline: 2px solid var(--vchat-accent); outline-offset: 0; border-color: var(--vchat-accent); }
#vchat input:disabled { background: var(--vchat-soft); }
#vchat .vchat-off { opacity: .5; }
#vchat .vchat-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; cursor: pointer; }
#vchat .vchat-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--vchat-accent); }
#vchat .vchat-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#vchat .vchat-error { min-height: 18px; margin: 0; color: #c0282d; font-size: 13px; }
#vchat .vchat-error:empty { min-height: 0; }
#vchat .vchat-send { align-self: flex-end; padding: 9px 18px; border: 0; border-radius: 8px; background: var(--vchat-accent); color: #fff; font-family: inherit; font-size: 15px; line-height: 1.3; font-weight: 600; cursor: pointer; }
#vchat .vchat-send:disabled { opacity: .6; cursor: wait; }

#vchat .vchat-thread { display: flex; flex-direction: column; gap: 8px; min-height: 120px; max-height: 320px; overflow-y: auto; padding: 2px; }
#vchat .vchat-msg { max-width: 86%; padding: 8px 11px; border-radius: 12px; }
#vchat .vchat-me { align-self: flex-end; background: var(--vchat-accent); color: #fff; border-bottom-right-radius: 4px; }
#vchat .vchat-staff { align-self: flex-start; background: var(--vchat-soft); border-bottom-left-radius: 4px; }
#vchat .vchat-msg-meta { font-size: 11px; opacity: .8; margin-bottom: 2px; }
#vchat .vchat-msg-text { overflow-wrap: anywhere; }
#vchat .vchat-reply { display: flex; gap: 8px; align-items: flex-end; margin: 0; }
#vchat .vchat-reply textarea { flex: 1; }
#vchat .vchat-reply .vchat-send { align-self: stretch; }
#vchat .vchat-new { align-self: center; padding: 4px 8px; border: 0; background: none; color: var(--vchat-muted); font-family: inherit; font-size: 13px; line-height: 1.3; font-weight: 400; text-decoration: underline; cursor: pointer; }

@media (max-width: 480px) {
  #vchat { right: 12px; bottom: calc(12px + var(--vchat-lift)); }
  #vchat .vchat-panel { position: fixed; right: 8px; left: 8px; bottom: calc(70px + var(--vchat-lift)); width: auto; max-width: none; max-height: calc(100vh - 86px - var(--vchat-lift)); }
}
@media (prefers-reduced-motion: no-preference) {
  #vchat .vchat-panel:not([hidden]) { animation: vchat-in .16s ease-out; }
  @keyframes vchat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
