/* EDLH live chat – visitor bubble and panel (warm site palette). */
.edlh-chat {
  --c-ink: #4D1157; --c-muted: #6E4A75; --c-line: #EDE0EE; --c-cream: #FDF9F3; --c-peach: #FFEED9;
  --c-orange: #FF8500; --c-g1: #FF8500; --c-g3: #FF8500; --c-ok: #2F9E5B;
  position: fixed; right: 20px; bottom: 20px; z-index: 9990;
  font: 400 15px/1.5 Lexend, system-ui, sans-serif; color: var(--c-ink);
}
.edlh-chat *, .edlh-chat *::before, .edlh-chat *::after { box-sizing: border-box; }
.edlh-chat button, .edlh-chat input, .edlh-chat textarea { font: inherit; letter-spacing: normal; text-transform: none; }

/* Launcher: small round bubble, label shown as a tooltip */
.edlh-chat .edlh-chat__launcher {
  position: relative; display: grid; place-items: center; width: 54px; height: 54px; margin: 0; padding: 0 !important;
  border: 0 !important; border-radius: 50% !important; cursor: pointer; color: #fff !important;
  background: linear-gradient(135deg, #FF8500, var(--c-g3)) !important;
  box-shadow: 0 10px 24px -8px rgba(255, 133, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.edlh-chat .edlh-chat__launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 28px -8px rgba(255, 133, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .25); }
.edlh-chat .edlh-chat__launcher:focus-visible { outline: 3px solid var(--c-ink); outline-offset: 3px; }
.edlh-chat__launcher svg { width: 24px; height: 24px; fill: #fff; }
.edlh-chat__launcher::after {
  content: ""; position: absolute; right: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: #C4B4C8; border: 2px solid #fff; transition: background-color .3s;
}
.edlh-chat__launcher.is-online::after { background: #34D399; }
.edlh-chat__label {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translate(6px, -50%); padding: 7px 12px; border-radius: 10px;
  background: var(--c-ink); color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
}
.edlh-chat__launcher:hover .edlh-chat__label, .edlh-chat__launcher:focus-visible .edlh-chat__label { opacity: 1; transform: translate(0, -50%); }
.edlh-chat__badge {
  position: absolute; top: -5px; left: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--c-ink); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.edlh-chat.is-open .edlh-chat__launcher { display: none; }

/* Panel */
.edlh-chat__panel {
  display: flex; flex-direction: column; width: 350px; height: min(520px, calc(100vh - 40px));
  background: var(--c-cream); border: 1px solid var(--c-line); border-radius: 24px; overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(80, 40, 10, .35); animation: edlh-chat-in .25s ease both;
}
.edlh-chat__panel[hidden] { display: none; }
@keyframes edlh-chat-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.edlh-chat__head {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; color: #fff;
  background: linear-gradient(120deg, var(--c-g1), var(--c-g3));
}
.edlh-chat__logo { width: 40px; height: 42px; padding: 3px; border-radius: 12px; background: #fff; object-fit: contain; flex: none; }
.edlh-chat__who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.edlh-chat__who strong { font: 700 16px/1.25 "Bricolage Grotesque", Lexend, sans-serif; }
.edlh-chat__status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .92; }
.edlh-chat__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #F3DCE9; flex: none; }
.is-online .edlh-chat__status::before { background: #4ADE80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.edlh-chat .edlh-chat__close {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0 !important; border: 0 !important; border-radius: 12px !important;
  background: rgba(255, 255, 255, .16) !important; cursor: pointer; flex: none;
}
.edlh-chat .edlh-chat__close:hover { background: rgba(255, 255, 255, .28) !important; }
.edlh-chat .edlh-chat__close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.edlh-chat__close svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; fill: none; }

.edlh-chat__log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.edlh-chat__msg { display: flex; flex-direction: column; max-width: 84%; }
.edlh-chat__msg.is-team { align-self: flex-start; }
.edlh-chat__msg.is-me { align-self: flex-end; align-items: flex-end; }
.edlh-chat__bubble { padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; }
.is-team .edlh-chat__bubble { background: #fff; border: 1px solid var(--c-line); border-bottom-left-radius: 6px; }
.is-me .edlh-chat__bubble { background: linear-gradient(120deg, var(--c-g1), var(--c-g3)); color: #fff; border-bottom-right-radius: 6px; }
.edlh-chat__meta { margin-top: 4px; padding: 0 4px; font-size: 11.5px; color: var(--c-muted); }
.edlh-chat__note { align-self: center; margin: 4px 0; padding: 6px 12px; border-radius: 999px; background: var(--c-peach); color: #FF8500; font-size: 12.5px; font-weight: 500; }

.edlh-chat__foot { padding: 12px 14px 14px; border-top: 1px solid var(--c-line); background: #fff; }
.edlh-chat__start { display: grid; gap: 10px; }
.edlh-chat__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edlh-chat__field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.edlh-chat__field label { font-size: 12.5px; font-weight: 600; color: var(--c-ink); }
.edlh-chat__opt { font-weight: 400; color: var(--c-muted); }
.edlh-chat__hint { font-size: 11.5px; line-height: 1.35; color: var(--c-muted); }
.edlh-chat input:not([type="checkbox"]), .edlh-chat textarea {
  width: 100%; min-height: 40px; margin: 0; padding: 8px 12px !important; border: 1px solid var(--c-line) !important; border-radius: 12px !important;
  background: var(--c-cream) !important; color: var(--c-ink) !important; font-size: 14.5px; box-shadow: none !important; resize: none;
}
.edlh-chat input:focus, .edlh-chat textarea:focus { outline: 0; border-color: var(--c-orange) !important; box-shadow: 0 0 0 3px rgba(255, 133, 0, .18) !important; background: #fff !important; }
.edlh-chat__consent { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: start; font-size: 12.5px; line-height: 1.4; color: var(--c-muted); }
.edlh-chat__consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--c-orange); }
.edlh-chat__consent .edlh-chat__err { grid-column: 1 / -1; }
.edlh-chat__err { font-size: 12px; color: #B42318; }
.edlh-chat__hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0; }
.edlh-chat .edlh-chat__btn {
  min-height: 44px; padding: 0 18px !important; border: 0 !important; border-radius: 999px !important; cursor: pointer; width: 100%;
  background: linear-gradient(120deg, var(--c-g1), var(--c-g3)) !important; color: #fff !important; font-weight: 600; font-size: 14.5px;
}
.edlh-chat .edlh-chat__btn:disabled { opacity: .7; cursor: wait; }
.edlh-chat .edlh-chat__btn--ghost { background: #fff !important; color: #FF8500 !important; border: 1.5px solid var(--c-orange) !important; }
.edlh-chat .edlh-chat__btn:focus-visible, .edlh-chat .edlh-chat__send:focus-visible { outline: 3px solid var(--c-ink); outline-offset: 2px; }
.edlh-chat__compose { display: flex; align-items: flex-end; gap: 8px; }
.edlh-chat__compose textarea { flex: 1; max-height: 120px; }
.edlh-chat .edlh-chat__send {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; flex: none;
  background: linear-gradient(120deg, var(--c-g1), var(--c-g3)) !important; cursor: pointer;
}
.edlh-chat__send svg { width: 20px; height: 20px; fill: #fff; }

/* Phone: label hidden, panel becomes a bottom sheet */
@media (max-width: 600px) {
  .edlh-chat { right: 14px; bottom: 14px; }
  .edlh-chat__label { display: none; }
  .edlh-chat.is-open { inset: auto 0 0 0; }
  .edlh-chat__panel { width: 100%; height: min(75vh, 100dvh - 60px); border-radius: 22px 22px 0 0; border-bottom: 0; }
  .edlh-chat__row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .edlh-chat__panel { animation: none; }
  .edlh-chat .edlh-chat__launcher { transition: none; }
}
@media print { .edlh-chat { display: none; } }
