/* Website live chat widget (assets/js/livechat-widget.js): an "Ask us anything" pill at the
   bottom centre that opens a large chat window. */
.lc-root {
  --lc-ink: #1f2328; --lc-muted: #5f6670; --lc-line: #e3e5e8; --lc-soft: #f1f2f4;
  --lc-accent: #1D51A3; --lc-brand: #1D51A3;
  --lc-glow: linear-gradient(90deg, #1D51A3, #4f7cc4 35%, #f04a50 70%, #EC1C24);
  font-family: inherit; color: var(--lc-ink);
}
html.lc-lock, html.lc-lock body { overflow: hidden; }

/* ---------------- launcher pill ---------------- */
.lc-launcher {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1035;
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 26px 0 20px;
  border: 3px solid transparent; border-radius: 999px; cursor: pointer;
  background: linear-gradient(#fff, #fff) padding-box, var(--lc-glow) border-box;
  color: var(--lc-ink); font: inherit; font-weight: 700; font-size: .95rem; letter-spacing: -.005em;
  box-shadow: 0 0 22px rgba(29, 81, 163, .32), 0 0 30px rgba(236, 28, 36, .22), 0 8px 22px -8px rgba(0, 0, 0, .35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.lc-launcher:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 0 28px rgba(29, 81, 163, .42), 0 0 38px rgba(236, 28, 36, .3), 0 10px 26px -8px rgba(0, 0, 0, .4); }
.lc-launcher:focus-visible { outline: 3px solid var(--lc-accent); outline-offset: 4px; }
.lc-spark { display: inline-flex; color: var(--lc-accent); }
.lc-spark svg { width: 22px; height: 22px; }
.lc-badge { position: absolute; top: -8px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--lc-brand); color: #fff; font-size: 12px; line-height: 22px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.lc-root.is-open .lc-launcher { opacity: 0; pointer-events: none; }

/* ---------------- window ---------------- */
.lc-backdrop { position: fixed; inset: 0; z-index: 1060; background: rgba(10, 12, 20, .55); backdrop-filter: blur(3px); animation: lcFade .2s ease-out; }
.lc-backdrop[hidden], .lc-panel[hidden] { display: none; }
.lc-panel {
  position: fixed; z-index: 1061; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(1500px, calc(100vw - 48px)); height: min(660px, calc(100vh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5);
  animation: lcIn .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes lcIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } }
@keyframes lcFade { from { opacity: 0; } }

.lc-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--lc-line); }
.lc-head-mark { display: inline-flex; color: var(--lc-accent); }
.lc-head-mark svg { width: 24px; height: 24px; }
.lc-head strong { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-tag { font-size: .62rem; font-weight: 800; letter-spacing: .06em; color: #15803d; background: #dcfce7; padding: 3px 7px; border-radius: 5px; }
.lc-head-spacer { flex: 1; }
.lc-newchat { display: none; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--lc-line); border-radius: 999px; background: transparent; color: var(--lc-ink); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; margin-right: 4px; }
.lc-newchat:hover { background: var(--lc-soft); }
.lc-newchat svg { width: 16px; height: 16px; }
.lc-root.is-talking .lc-newchat { display: inline-flex; }
.lc-icon-btn { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--lc-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.lc-icon-btn:hover { background: var(--lc-soft); color: var(--lc-ink); }
.lc-icon-btn svg { width: 20px; height: 20px; }
.lc-menu-wrap { position: relative; }
.lc-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; padding: 6px; background: #fff; border: 1px solid var(--lc-line); border-radius: 12px; box-shadow: 0 14px 36px -10px rgba(0, 0, 0, .25); z-index: 2; }
.lc-menu[hidden] { display: none; }
.lc-menu a, .lc-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: .9rem; color: var(--lc-ink); text-decoration: none; cursor: pointer; }
.lc-menu a:hover, .lc-menu button:hover { background: var(--lc-soft); }

/* ---------------- body ---------------- */
.lc-body { flex: 1; overflow-y: auto; padding: 28px 24px 12px; display: flex; flex-direction: column; }
.lc-welcome { margin: auto; text-align: center; max-width: 720px; padding: 10px 0 20px; }
/* Name + email step, shown under the visitor's first message. */
.lc-gate { width: 100%; max-width: 780px; margin: 16px auto 0; padding: 18px; border: 1px solid var(--lc-line); border-radius: 16px; background: #fafbfc; }
.lc-gate[hidden] { display: none; }
.lc-gate p { margin: 0 0 14px; font-size: .92rem; color: var(--lc-muted); }
.lc-gate p strong { color: var(--lc-ink); }
.lc-gate-fields { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; align-items: start; }
.lc-gate label { display: grid; align-content: start; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--lc-ink); }
.lc-gate input { width: 100%; padding: 11px 14px; border: 1px solid #d6d9de; border-radius: 12px; font: inherit; font-size: .92rem; font-weight: 400; background: #fff; color: var(--lc-ink); }
.lc-gate input:focus { outline: none; border-color: var(--lc-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.lc-gate-hint { min-height: 1.1em; font-size: .8rem; font-weight: 500; color: var(--lc-muted); }
.lc-gate-hint.is-error { color: #c0262d; }
.lc-gate-hint.is-warn { color: #9a6700; }
.lc-gate-hint.is-ok { color: #15803d; }
.lc-gate-hint button { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--lc-accent); text-decoration: underline; cursor: pointer; }
.lc-gate-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; }
.lc-gate-back { border: 0; background: none; color: var(--lc-muted); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; padding: 8px 10px; }
.lc-gate-back:hover { color: var(--lc-ink); }
.lc-gate-btn { padding: 10px 24px; border: 0; border-radius: 999px; background: var(--lc-ink); color: #fff; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; }
.lc-gate-btn:disabled { opacity: .6; }
.lc-welcome[hidden] { display: none; }
.lc-welcome-mark { display: inline-flex; color: var(--lc-accent); margin-bottom: 12px; }
.lc-welcome-mark svg { width: 34px; height: 34px; }
.lc-welcome h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); font-weight: 500; margin: 0 0 8px; color: var(--lc-ink); letter-spacing: -.01em; }
.lc-welcome p { color: var(--lc-muted); margin: 0 0 26px; font-size: .95rem; }
.lc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.lc-chip { padding: 12px 20px; border-radius: 999px; border: 1px solid #d6d9de; background: var(--lc-soft); color: var(--lc-ink); font: inherit; font-size: .95rem; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s; }
.lc-chip:hover { background: #e7e9ed; border-color: #c4c8cf; }

.lc-thread { width: 100%; max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.lc-msg { display: flex; gap: 10px; align-items: flex-end; }
.lc-msg.lc-me { justify-content: flex-end; }
.lc-who { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: #eef2ff; color: var(--lc-accent); display: inline-flex; align-items: center; justify-content: center; }
.lc-who svg { width: 16px; height: 16px; }
.lc-text { max-width: min(78%, 600px); padding: 11px 15px; border-radius: 18px; font-size: .95rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.lc-them .lc-text { background: var(--lc-soft); border-bottom-left-radius: 6px; }
.lc-me .lc-text { background: var(--lc-ink); color: #fff; border-bottom-right-radius: 6px; }
.lc-text small { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 4px; font-size: .7rem; }
.lc-them .lc-text small { justify-content: flex-start; color: var(--lc-muted); }
.lc-me .lc-text small { color: rgba(255, 255, 255, .65); }
.lc-me { flex-wrap: wrap; }
.lc-tick { display: inline-flex; }
.lc-tick svg { width: 16px; height: 11px; }
.lc-tick[data-read="true"] { color: #53bdeb; }
.lc-seen { flex-basis: 100%; text-align: right; margin-top: -8px; font-size: .72rem; font-weight: 600; color: var(--lc-muted); }


.lc-ended { max-width: 780px; margin: 16px auto 0; text-align: center; font-size: .88rem; color: var(--lc-muted); }
.lc-ended[hidden] { display: none; }
.lc-ended button { border: 0; background: none; color: var(--lc-accent); font: inherit; font-weight: 700; cursor: pointer; }

/* ---------------- composer ---------------- */
.lc-foot { padding: 10px 24px 14px; }
.lc-compose { position: relative; display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; padding: 8px 10px 8px 14px; border: 1px solid #d6d9de; border-radius: 999px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.lc-compose[hidden] { display: none; }
.lc-compose:focus-within { border-color: #aeb4bd; box-shadow: 0 4px 18px -6px rgba(0, 0, 0, .15); }
.lc-plus { flex-shrink: 0; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--lc-soft); color: var(--lc-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.lc-plus:hover, .lc-plus[aria-expanded="true"] { background: #e2e5e9; }
.lc-plus svg { width: 20px; height: 20px; }
.lc-compose textarea { flex: 1; border: 0; outline: none; resize: none; font: inherit; font-size: 1rem; line-height: 1.45; padding: 8px 2px; max-height: 120px; background: transparent; color: var(--lc-ink); }
.lc-compose textarea::placeholder { color: #6b7280; }
.lc-send { flex-shrink: 0; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #8a9099; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, color .15s; }
.lc-send.is-ready { background: var(--lc-ink); color: #fff; }
.lc-send svg { width: 22px; height: 22px; }
.lc-topics { position: absolute; left: 0; bottom: calc(100% + 10px); display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; padding: 12px; background: #fff; border: 1px solid var(--lc-line); border-radius: 16px; box-shadow: 0 14px 36px -10px rgba(0, 0, 0, .25); }
.lc-topics[hidden] { display: none; }
.lc-topics .lc-chip { padding: 8px 14px; font-size: .88rem; }
.lc-fine { margin: 10px auto 0; max-width: 760px; text-align: center; font-size: .74rem; color: var(--lc-muted); }
.lc-fine a { color: var(--lc-accent); }

/* ---------------- dark theme ---------------- */
[data-theme="dark"] .lc-root { --lc-ink: #eceef1; --lc-muted: #a3a9b3; --lc-line: #2a2d33; --lc-soft: #22252b; }
[data-theme="dark"] .lc-launcher { background: linear-gradient(#15171c, #15171c) padding-box, var(--lc-glow) border-box; }
[data-theme="dark"] .lc-spark, [data-theme="dark"] .lc-head-mark, [data-theme="dark"] .lc-welcome-mark { color: #60a5fa; }
[data-theme="dark"] .lc-panel, [data-theme="dark"] .lc-menu, [data-theme="dark"] .lc-topics, [data-theme="dark"] .lc-compose, [data-theme="dark"] .lc-gate input { background: #15171c; }
[data-theme="dark"] .lc-gate { background: #1b1e23; }
[data-theme="dark"] .lc-chip { border-color: #343841; }
[data-theme="dark"] .lc-chip:hover, [data-theme="dark"] .lc-plus:hover { background: #2c3038; }
[data-theme="dark"] .lc-compose, [data-theme="dark"] .lc-gate input { border-color: #343841; }
[data-theme="dark"] .lc-me .lc-text { background: #1D51A3; }
[data-theme="dark"] .lc-send.is-ready, [data-theme="dark"] .lc-gate-btn { background: #eceef1; color: #15171c; }
[data-theme="dark"] .lc-who { background: #1e2a4a; color: #60a5fa; }
[data-theme="dark"] .lc-badge { box-shadow: 0 0 0 2px #15171c; }

/* ---------------- small screens: full-screen window ---------------- */
@media (max-width: 640px) {
  .lc-launcher { bottom: 16px; height: 46px; padding: 0 20px 0 16px; font-size: .9rem; }
  .lc-panel { width: 100vw; height: 100dvh; border-radius: 0; }
  .lc-body { padding: 20px 14px 8px; }
  .lc-foot { padding: 8px 12px 12px; }
  .lc-chips { gap: 10px; }
  .lc-chip { padding: 10px 16px; font-size: .9rem; }
  .lc-gate-fields { grid-template-columns: 1fr; }
  .lc-head { padding: 12px 10px 12px 16px; gap: 8px; }
  .lc-head strong { font-size: 1rem; }
  .lc-newchat { padding: 0 10px; }
  .lc-newchat span { display: none; }
  .lc-text { max-width: 85%; }
}
