/* ECG Concierge chat widget — self-contained (works on every page) */
.ecgc {
  --c-bg: #0f0f10; --c-surface: #161617; --c-line: rgba(245,240,230,.10); --c-line2: rgba(245,240,230,.18);
  --c-text: #f5f0e6; --c-text2: #bab3a4; --c-text3: #8b8578; --c-cream: #faf6ec; --c-blue: #3b82f6; --c-blue2: #6ea8ff;
  --c-ease: cubic-bezier(.16, 1, .3, 1);
  position: fixed; right: 20px; bottom: 20px; z-index: 9500; font: 400 15px/1.55 'Outfit', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--c-text);
}
.ecgc *, .ecgc *::before, .ecgc *::after { box-sizing: border-box; }
.ecgc svg { display: block; }
.ecgc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* hide the previous scripted assistant on inner pages */
#ecg-chatbot-toggle, #ecg-chatbot-window, .chatbot-toggle, .chatbot-window { display: none !important; }
/* keep back-to-top buttons clear of the launcher */
.totop { bottom: 96px !important; }
#back-to-top, .back-to-top { bottom: 96px !important; }

/* launcher */
.ecgc-launch { position: relative; width: 62px; height: 62px; border-radius: 20px; border: 1px solid rgba(110,168,255,.45); padding: 0; cursor: pointer;
  background: #0b1220; box-shadow: 0 18px 40px -12px rgba(0,0,0,.8), 0 0 0 6px rgba(59,130,246,.10); transition: transform .5s var(--c-ease), box-shadow .4s, border-radius .5s var(--c-ease); }
.ecgc-launch:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 22px 44px -12px rgba(0,0,0,.85), 0 0 0 8px rgba(59,130,246,.16); }
.ecgc-launch:focus-visible { outline: 2px solid var(--c-blue2); outline-offset: 4px; }
.ecgc-launch__mark, .ecgc-launch__icon { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .3s, transform .5s var(--c-ease); }
.ecgc-launch__mark svg { width: 100%; height: 100%; border-radius: 19px; }
.ecgc-launch__icon { opacity: 0; transform: rotate(-90deg) scale(.6); color: var(--c-cream); }
.ecgc-launch__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ecgc.is-open .ecgc-launch__mark { opacity: 0; transform: rotate(90deg) scale(.6); }
.ecgc.is-open .ecgc-launch__icon { opacity: 1; transform: none; }
.ecgc.is-open .ecgc-launch { border-radius: 50%; }
.ecgc-launch__ping { position: absolute; right: -3px; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--c-blue2); border: 2px solid #0a0a0a; }
.ecgc-launch__ping::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--c-blue2); animation: ecgc-ping 2s var(--c-ease) infinite; }
.ecgc.is-open .ecgc-launch__ping, .ecgc-seen .ecgc-launch__ping { display: none; }
@keyframes ecgc-ping { to { transform: scale(2.4); opacity: 0; } }

/* teaser bubble */
.ecgc-teaser { position: absolute; right: 0; bottom: 76px; width: 260px; padding: 14px 34px 14px 16px; border-radius: 16px 16px 4px 16px; cursor: pointer;
  background: var(--c-cream); color: #111; box-shadow: 0 20px 40px -14px rgba(0,0,0,.6); display: grid; gap: 2px; animation: ecgc-in .6s var(--c-ease); }
.ecgc-teaser[hidden] { display: none; }
.ecgc-teaser b { font-size: 14.5px; }
.ecgc-teaser span { font-size: 13px; color: #4a463f; }
.ecgc-teaser__x { position: absolute; right: 8px; top: 8px; width: 24px; height: 24px; border: 0; background: none; color: #555; cursor: pointer; padding: 3px; border-radius: 50%; }
.ecgc-teaser__x svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* panel */
.ecgc-panel { position: absolute; right: 0; bottom: 78px; width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 120px)); display: flex; flex-direction: column;
  border-radius: 24px; overflow: hidden; border: 1px solid var(--c-line2);
  background: radial-gradient(120% 60% at 100% 0%, rgba(59,130,246,.12), transparent 55%), var(--c-bg);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.95); transform-origin: 100% 100%;
  opacity: 0; transform: translateY(16px) scale(.96); transition: opacity .25s, transform .45s var(--c-ease); }
.ecgc-panel[hidden] { display: none; }
.ecgc.is-open .ecgc-panel { opacity: 1; transform: none; }
@keyframes ecgc-in { from { opacity: 0; transform: translateY(10px); } }

.ecgc-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--c-line); background: rgba(10,10,10,.5); backdrop-filter: blur(10px); }
.ecgc-head__mark svg { width: 40px; height: 40px; border-radius: 11px; }
.ecgc-head__txt { flex: 1; min-width: 0; display: grid; }
.ecgc-head__txt b { font: 500 20px/1.15 'Cormorant Garamond', Georgia, serif; color: var(--c-cream); letter-spacing: .01em; }
.ecgc-head__txt small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-text3); }
.ecgc-dot { width: 7px; height: 7px; border-radius: 50%; background: #7fd4a4; box-shadow: 0 0 0 3px rgba(127,212,164,.15); }
.ecgc-icon { width: 38px; height: 38px; border-radius: 50%; border: 1px solid transparent; background: none; color: var(--c-text2); cursor: pointer; display: grid; place-items: center; transition: background .3s, color .3s, border-color .3s; }
.ecgc-icon:hover { background: rgba(245,240,230,.06); color: var(--c-cream); border-color: var(--c-line); }
.ecgc-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.ecgc-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(245,240,230,.15) transparent; }
.ecgc-msg { display: flex; gap: 8px; align-items: flex-end; animation: ecgc-in .45s var(--c-ease); }
.ecgc-msg--user { justify-content: flex-end; }
.ecgc-av svg { width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; }
.ecgc-b { max-width: 84%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.ecgc-msg--bot .ecgc-b { background: var(--c-surface); border: 1px solid var(--c-line); border-bottom-left-radius: 4px; color: var(--c-text); }
.ecgc-msg--user .ecgc-b { background: var(--c-cream); color: #121212; border-bottom-right-radius: 4px; }
.ecgc-b p { margin: 0; }
.ecgc-b p + p, .ecgc-b ul + p, .ecgc-b p + ul { margin-top: 8px; }
.ecgc-b ul { margin: 6px 0 0; padding-left: 18px; }
.ecgc-b li { margin: 3px 0; }
.ecgc-b li::marker { color: var(--c-blue2); }
.ecgc-b strong { color: var(--c-cream); font-weight: 600; }
.ecgc-msg--user .ecgc-b strong { color: #000; }
.ecgc-b a { color: var(--c-blue2); text-decoration: underline; text-underline-offset: 3px; }
.ecgc-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.ecgc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-text3); animation: ecgc-bounce 1.2s infinite ease-in-out; }
.ecgc-typing i:nth-child(2) { animation-delay: .15s; } .ecgc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ecgc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.ecgc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 12px; }
.ecgc-chips[hidden] { display: none; }
.ecgc-chips button { border: 1px solid var(--c-line2); background: rgba(245,240,230,.03); color: var(--c-text); font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: border-color .3s, color .3s, background .3s; }
.ecgc-chips button:hover { border-color: var(--c-blue2); color: var(--c-blue2); background: rgba(59,130,246,.08); }

.ecgc-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 8px 8px 8px 14px; border-radius: 18px; border: 1px solid var(--c-line2); background: var(--c-surface); transition: border-color .3s; }
.ecgc-form:focus-within { border-color: rgba(110,168,255,.6); }
.ecgc-form textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--c-text); font: inherit; font-size: 14.5px; line-height: 1.45; max-height: 120px; padding: 6px 0; }
.ecgc-form textarea::placeholder { color: var(--c-text3); }
.ecgc-send { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; border: 0; background: var(--c-cream); color: #0a0a0a; cursor: pointer; display: grid; place-items: center; transition: background .3s, color .3s, transform .3s; }
.ecgc-send:hover { background: var(--c-blue); color: #fff; }
.ecgc-send:disabled { opacity: .45; cursor: default; }
.ecgc-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ecgc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0; padding: 10px 16px 14px; font-size: 11px; color: var(--c-text3); }
.ecgc-foot a { color: var(--c-cream); font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; border-bottom: 1px solid rgba(110,168,255,.6); }
.ecgc-foot span { text-align: right; }

@media (max-width: 640px) {
  .ecgc { right: 14px; bottom: 14px; }
  .ecgc-launch { width: 56px; height: 56px; border-radius: 18px; }
  .ecgc-panel { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; transform-origin: 50% 100%; }
  .ecgc.is-open .ecgc-launch { opacity: 0; pointer-events: none; }
  .totop, #back-to-top, .back-to-top { bottom: 84px !important; }
  .ecgc-foot span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ecgc *, .ecgc *::before, .ecgc *::after { animation: none !important; transition: none !important; }
}

/* shield the widget from page-wide p / button / textarea / list styles on inner pages */
.ecgc .ecgc-b p, .ecgc .ecgc-b li, .ecgc .ecgc-b ul { color: inherit !important; font-size: inherit !important; line-height: inherit !important; font-family: inherit !important; letter-spacing: normal !important; }
.ecgc .ecgc-b p { margin: 0 !important; }
.ecgc .ecgc-b p + p, .ecgc .ecgc-b ul + p, .ecgc .ecgc-b p + ul { margin-top: 8px !important; }
.ecgc .ecgc-b ul { list-style: disc !important; padding-left: 18px !important; margin: 6px 0 0 !important; }
.ecgc .ecgc-b li { display: list-item !important; margin: 3px 0 !important; padding: 0 !important; }
.ecgc .ecgc-b li::before { content: none !important; }
.ecgc .ecgc-msg--user .ecgc-b, .ecgc .ecgc-msg--user .ecgc-b p { color: #121212 !important; }
.ecgc .ecgc-msg--bot .ecgc-b { color: var(--c-text) !important; }
.ecgc .ecgc-form textarea { background: transparent !important; border: 0 !important; box-shadow: none !important; outline: 0 !important; padding: 6px 0 !important; margin: 0 !important;
  color: var(--c-text) !important; font: 400 14.5px/1.45 'Outfit', 'Inter', system-ui, sans-serif !important; min-height: 0 !important; height: auto; border-radius: 0 !important; width: auto !important; }
.ecgc .ecgc-send { background: var(--c-cream) !important; color: #0a0a0a !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
.ecgc .ecgc-send:hover { background: var(--c-blue) !important; color: #fff !important; }
.ecgc .ecgc-chips button { min-height: 0 !important; width: auto !important; box-shadow: none !important; }
.ecgc .ecgc-head__txt b, .ecgc .ecgc-head__txt small { color: inherit; }
.ecgc .ecgc-head__txt b { color: var(--c-cream) !important; }
