/* LickNose support chat FAB + panel */
.ln-support {
  --ln-sup-yellow: #f5cb2c;
  --ln-sup-yellow-deep: #e0b40f;
  --ln-sup-ink: #15130f;
  --ln-sup-muted: #6f685d;
  --ln-sup-paper: #fffdf8;
  --ln-sup-cream: #f7f1e7;
  --ln-sup-shadow: 0 8px 22px rgba(21, 19, 15, 0.14);
  --ln-sup-fab: 44px;
  position: fixed;
  right: 14px;
  bottom: 16px;
  z-index: 10060;
  font-family: inherit;
  pointer-events: none;
}

.ln-support[hidden] {
  display: none !important;
}

.ln-support__fab,
.ln-support__panel,
.ln-support__close,
.ln-support__send,
.ln-support__attach,
.ln-support__mic,
.ln-support__form,
.ln-support__compose,
.ln-support__input,
.ln-support__preview {
  pointer-events: auto;
}

.ln-support__fab {
  position: relative;
  width: var(--ln-sup-fab);
  height: var(--ln-sup-fab);
  border: 0;
  border-radius: 50%;
  background: var(--ln-sup-yellow);
  color: var(--ln-sup-ink);
  box-shadow: var(--ln-sup-shadow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.ln-support__fab:hover,
.ln-support__fab:focus-visible {
  background: var(--ln-sup-yellow-deep);
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 10px 24px rgba(21, 19, 15, 0.18);
}

.ln-support__fab:active {
  transform: translateY(0);
}

.ln-support__fab-icon {
  display: flex;
  line-height: 0;
}

.ln-support__fab-icon svg {
  width: 20px;
  height: 20px;
}

.ln-support__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #d94848;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--ln-sup-paper);
}

.ln-support__badge[hidden] {
  display: none !important;
}

.ln-support__panel {
  position: absolute;
  right: 0;
  bottom: calc(var(--ln-sup-fab) + 10px);
  width: min(300px, calc(100vw - 24px));
  height: min(380px, calc(100vh - 130px));
  display: flex;
  flex-direction: column;
  background: var(--ln-sup-paper);
  border-radius: 18px;
  box-shadow: var(--ln-sup-shadow);
  border: 1px solid rgba(21, 19, 15, 0.08);
  overflow: hidden;
  transform-origin: bottom right;
  animation: ln-support-in 0.2s ease;
}

.ln-support__panel[hidden] {
  display: none !important;
}

.ln-support:not(.is-open) .ln-support__close,
.ln-support__panel[hidden] .ln-support__close {
  display: none !important;
  pointer-events: none !important;
}

@keyframes ln-support-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ln-support__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px 16px;
  background: linear-gradient(180deg, #fff8d9 0%, var(--ln-sup-paper) 100%);
  border-bottom: 1px solid rgba(21, 19, 15, 0.06);
}

.ln-support__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ln-sup-ink);
  line-height: 1.2;
}

.ln-support__subtitle {
  font-size: 12px;
  color: var(--ln-sup-muted);
  margin-top: 2px;
}

.ln-support__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 19, 15, 0.06);
  color: var(--ln-sup-ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.ln-support__close:hover,
.ln-support__close:focus-visible {
  background: rgba(21, 19, 15, 0.12);
  outline: none;
}

.ln-support__messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background: var(--ln-sup-cream);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ln-support__empty {
  margin: auto;
  text-align: center;
  color: var(--ln-sup-muted);
  font-size: 13px;
  padding: 16px;
  max-width: 240px;
}

.ln-support__bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ln-sup-ink);
}

.ln-support__bubble--visitor {
  align-self: flex-end;
  background: var(--ln-sup-yellow);
  border-bottom-right-radius: 6px;
}

.ln-support__bubble--admin {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(21, 19, 15, 0.06);
  border-bottom-left-radius: 6px;
}

.ln-support__bubble--system {
  align-self: center;
  background: transparent;
  color: var(--ln-sup-muted);
  font-size: 12px;
  text-align: center;
}

.ln-support__meta {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.65;
}

.ln-support__form {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 8px 10px;
  background: var(--ln-sup-paper);
  border-top: 1px solid rgba(21, 19, 15, 0.06);
}

.ln-support__compose {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ln-support__attach,
.ln-support__mic {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 19, 15, 0.06);
  color: var(--ln-sup-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ln-support__attach:hover,
.ln-support__attach:focus-visible,
.ln-support__mic:hover,
.ln-support__mic:focus-visible {
  background: rgba(21, 19, 15, 0.12);
  outline: none;
}

.ln-support__mic.is-recording {
  background: #c62828;
  color: #fff;
  animation: ln-sup-mic-pulse 1.1s ease-in-out infinite;
}

@keyframes ln-sup-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(198, 40, 40, 0); }
}

.ln-support__preview {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.ln-support__preview img {
  display: block;
  max-width: 120px;
  max-height: 80px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(21, 19, 15, 0.1);
}

.ln-support__preview-voice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(21, 19, 15, 0.06);
  font-size: 12px;
  color: var(--ln-sup-ink);
}

.ln-support__preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--ln-sup-ink);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  cursor: pointer;
}

.ln-support__bubble img.ln-support__img {
  display: block;
  max-width: min(220px, 70vw);
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: 12px;
  margin-bottom: 6px;
  object-fit: cover;
  cursor: zoom-in;
}

.ln-support__bubble audio.ln-support__audio {
  display: block;
  width: min(220px, 70vw);
  max-width: 100%;
  margin-bottom: 6px;
  height: 36px;
}

.ln-support__input {
  flex: 1;
  resize: none;
  min-height: 36px;
  max-height: 90px;
  border: 1px solid rgba(21, 19, 15, 0.12);
  border-radius: 14px;
  padding: 8px 11px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ln-sup-ink);
  width: 100%;
  box-sizing: border-box;
}

.ln-support__input:focus {
  outline: none;
  border-color: var(--ln-sup-yellow-deep);
  box-shadow: 0 0 0 3px rgba(245, 203, 44, 0.28);
}

.ln-support__send {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--ln-sup-ink);
  color: var(--ln-sup-yellow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.ln-support__send:disabled {
  opacity: 0.45;
  cursor: default;
}

.ln-support__send:not(:disabled):hover,
.ln-support__send:not(:disabled):focus-visible {
  opacity: 0.9;
  outline: none;
}

.ln-support .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scroll-up слева от FAB (не поверх чата). При открытом чате - скрыт. */
body:has(.ln-support) .sp-scroll-up,
body.ln-home-modern:has(.ln-support) .sp-scroll-up {
  right: 66px !important;
  bottom: 18px !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 14px !important;
  z-index: 10050 !important;
  background: rgba(80, 80, 80, 0.45) !important;
}

body:has(.ln-support.is-open) .sp-scroll-up,
body.ln-home-modern:has(.ln-support.is-open) .sp-scroll-up {
  display: none !important;
}

.ln-support.is-open .ln-support__fab {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

@media (max-width: 575.98px) {
  .ln-support {
    right: 12px;
    bottom: 14px;
    --ln-sup-fab: 42px;
  }

  .ln-support__panel {
    position: fixed;
    right: 8px;
    left: 8px;
    bottom: 14px;
    width: auto;
    max-width: none;
    height: min(58vh, 420px);
    border-radius: 16px;
    z-index: 10061;
  }

  body:has(.ln-support) .sp-scroll-up,
  body.ln-home-modern:has(.ln-support) .sp-scroll-up {
    right: 62px !important;
    bottom: 16px !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
  }
}

/* Cookie banner open: lift both a bit */
body.ln-cookie-open .ln-support {
  bottom: 88px;
}

body.ln-cookie-open:has(.ln-support) .sp-scroll-up {
  bottom: 90px !important;
}

html.ln-android-app .ln-support {
  z-index: 10080;
  right: 10px;
  bottom: 10px;
}

html.ln-android-app .ln-support__panel {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  width: auto;
  max-width: none;
  height: min(70vh, 460px);
  z-index: 10081;
}
