/* Website live chat (ADR-0081): the bubble and the panel, in VergeHR's brand.
   Theme tokens from styles.css (light, and dark under [data-theme="dark"]);
   logical properties so a right-to-left page mirrors itself. */
.wc-root { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 900; font-family: inherit; }
.wc-bubble {
  position: relative; display: flex; align-items: center; gap: 9px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent) 0%, #4a5fd6 100%); color: #fff; border-radius: 999px;
  padding: 13px 20px 13px 16px; font: 600 15px/1 inherit; font-family: inherit;
  box-shadow: 0 8px 26px rgba(12, 100, 174, .38); transition: transform .15s ease, box-shadow .15s ease;
}
.wc-bubble:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(12, 100, 174, .45); }
.wc-bubble:focus-visible { outline: 3px solid var(--accent-on-dark); outline-offset: 3px; }
.wc-bubble svg { width: 22px; height: 22px; }
.wc-ping { position: absolute; top: 4px; inset-inline-start: 34px; width: 10px; height: 10px; border-radius: 50%;
  background: #34d399; border: 2px solid #fff; }
.wc-root.open .wc-bubble { display: none; }
.wc-root.open { z-index: 1100; }     /* over the site's sticky header (1000), so the close button always shows */

/* --wc-bottom - how far up the panel sits (set by websitechat.js, the cookie banner lifts it), so its
   top always stays on screen, whatever the screen height or zoom. */
.wc-panel {
  display: none; flex-direction: column; width: 380px; max-width: calc(100vw - 24px);
  height: 580px; max-height: calc(100vh - var(--wc-bottom, 20px) - 16px);
  max-height: calc(100dvh - var(--wc-bottom, 20px) - 16px); background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(16, 32, 54, .22), 0 4px 14px rgba(16, 32, 54, .08);
  animation: wc-in .18s ease-out;
}
@keyframes wc-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.wc-root.open .wc-panel { display: flex; }
.wc-head {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 14px; color: #fff;
  background: linear-gradient(135deg, #0b2038 0%, #0c64ae 70%, #4a5fd6 100%);
}
.wc-avatar { flex: none; width: 38px; height: 38px; border-radius: 12px; background: #fff; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.wc-head-text { min-width: 0; }
.wc-title { font-weight: 700; font-size: 15.5px; line-height: 1.2; }
.wc-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .88; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; flex: none; box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); }
.wc-call {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; flex: none;
  padding: 0 13px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .12); color: #fff; font: 600 13px/1 inherit; font-family: inherit; cursor: pointer;
}
.wc-call svg { width: 16px; height: 16px; }
.wc-call:hover { background: rgba(255, 255, 255, .24); }
.wc-call:disabled { opacity: .5; cursor: default; }
.wc-call[hidden] { display: none; }
.wc-x { margin-inline-start: auto; flex: none; display: grid; place-items: center; background: transparent; border: 0; color: #fff;
  cursor: pointer; width: 34px; height: 34px; border-radius: 10px; }
.wc-call:not([hidden]) + .wc-x { margin-inline-start: 2px; }
.wc-x:hover { background: rgba(255, 255, 255, .14); }
.wc-x svg { width: 18px; height: 18px; }

.wc-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.wc-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.5;
  word-wrap: break-word; overflow-wrap: anywhere; }
.wc-msg.me, .wc-msg.note, .wc-msg.call { white-space: pre-wrap; }
.wc-msg p { margin: 0 0 8px; } .wc-msg p:last-child { margin-bottom: 0; }
.wc-msg ul, .wc-msg ol { margin: 4px 0 8px; padding-inline-start: 20px; }
.wc-msg li { margin: 2px 0; }
.wc-msg a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.wc-msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-end-start-radius: 5px;
  box-shadow: 0 1px 2px rgba(16, 32, 54, .04); }
.wc-msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-end-end-radius: 5px; }
.wc-msg.me a { color: #fff; }
.wc-msg.note { align-self: center; max-width: 100%; background: transparent; color: var(--muted);
  font-size: 12.5px; text-align: center; padding: 2px 6px; }
.wc-msg.call { border: 1px dashed var(--line); }
.wc-msg.me.call { background: #0a528f; }
.wc-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; border-end-start-radius: 5px; }
.wc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4;
  animation: wc-blink 1.2s infinite ease-in-out; }
.wc-typing span:nth-child(2) { animation-delay: .15s; }
.wc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes wc-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: .9; } }

.wc-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 14px 10px; background: var(--bg); }
.wc-chips:empty { display: none; }
.wc-chip { border: 1px solid var(--line); background: var(--card); color: var(--accent); border-radius: 999px;
  padding: 7px 12px; font: 600 13px/1.2 inherit; font-family: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.wc-chip:hover { border-color: var(--accent); transform: translateY(-1px); }

.wc-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; background: var(--card); }
.wc-form textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px;
  font: 14.5px/1.4 inherit; font-family: inherit; max-height: 110px; min-height: 42px; background: var(--bg); color: var(--ink);
}
.wc-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--card); }
.wc-send { flex: none; width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--accent);
  color: #fff; cursor: pointer; display: grid; place-items: center; }
.wc-send svg { width: 18px; height: 18px; }
.wc-send:hover { background: var(--accent-dark); }
.wc-send:disabled { opacity: .45; cursor: default; }
[dir="rtl"] .wc-send svg { transform: scaleX(-1); }

.wc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 0 14px 11px; font-size: 11.5px; color: var(--muted); background: var(--card); }
.wc-person { background: none; border: 0; padding: 0; color: var(--accent); font: 600 12.5px/1.3 inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.wc-person:hover { text-decoration: underline; }

.wc-hand { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--card); border-top: 1px solid var(--line); }
.wc-hand p { margin: 0; font-size: 13.5px; color: var(--ink); }
.wc-hand input, .wc-hand textarea { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font: 14px/1.4 inherit; font-family: inherit; background: var(--card); color: var(--ink); }
.wc-hand textarea { resize: vertical; min-height: 56px; }
.wc-hand .wc-row { display: flex; gap: 8px; align-items: center; }
.wc-hand .btn { padding-inline: 14px; }
.wc-hand .wc-err { color: var(--danger); font-size: 12.5px; min-height: 1em; }

[data-theme="dark"] .wc-msg.bot, [data-theme="dark"] .wc-typing { box-shadow: none; }
[data-theme="dark"] .wc-msg a { color: var(--accent-on-dark); }
[data-theme="dark"] .wc-msg.me a { color: #fff; }

/* A short window (a laptop zoomed in, a landscape phone) - the chat takes the whole screen. */
@media (max-height: 520px) {
  .wc-root.open { inset: 0 !important; }
  .wc-root.open .wc-panel { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; border: 0; animation: none; }
}
@media (max-width: 520px) {
  .wc-root { inset-inline-end: 14px; bottom: 14px; }
  .wc-root.open { inset: 0 !important; }     /* full screen, over the site's sticky header (beats the inline bottom) */
  .wc-root.open .wc-panel { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; border: 0; animation: none; }
  .wc-bubble .wc-label { display: none; }
  .wc-bubble { padding: 15px; }
  .wc-ping { inset-inline-start: auto; inset-inline-end: 6px; top: 6px; }
}
@media print { .wc-root { display: none; } }
@media (prefers-reduced-motion: reduce) { .wc-typing span { animation: none; } .wc-bubble, .wc-panel { transition: none; animation: none; } }
