.platform-live-chat-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
}

a.platform-live-chat-bubble {
  text-decoration: none;
}

.platform-live-chat-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #4361ee;
  color: #fff;
  box-shadow: 0 8px 24px rgba(67, 97, 238, 0.35);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.platform-live-chat-bubble:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(67, 97, 238, 0.45);
}

.platform-live-chat-bubble__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform-live-chat-bubble__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.platform-live-chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  flex-direction: column;
  height: min(540px, calc(100vh - 120px));
  width: min(380px, calc(100vw - 32px));
  max-height: min(540px, calc(100vh - 120px));
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  pointer-events: none;
}

.platform-live-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.platform-live-chat-panel__view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.platform-live-chat-panel__view.d-none {
  display: none !important;
}

.platform-live-chat-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  background: linear-gradient(135deg, #4361ee 0%, #3a56d4 100%);
  color: #fff;
}

.platform-live-chat-panel__header--home {
  justify-content: flex-end;
  padding-bottom: 0;
  background: transparent;
}

.platform-live-chat-panel__header--home .platform-live-chat-panel__close {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.platform-live-chat-panel__header-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.platform-live-chat-panel__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.platform-live-chat-panel__back:hover {
  background: rgba(255, 255, 255, 0.25);
}

.platform-live-chat-panel__home-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.platform-live-chat-home {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  color: #0f172a;
}

.platform-live-chat-home__hero {
  position: relative;
  z-index: 1;
  padding: 20px 20px 24px;
  padding-right: 52px;
  background: linear-gradient(135deg, #4361ee 0%, #3a56d4 100%);
  color: #fff;
  flex-shrink: 0;
}

.platform-live-chat-home__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: visible;
  padding: 0 16px;
}

.platform-live-chat-home__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
}

.platform-live-chat-home__close:hover {
  background: rgba(255, 255, 255, 0.32);
}

.platform-live-chat-home__greeting {
  margin: 0 0 4px;
  font-size: 14px;
  color: #fff;
  opacity: 0.95;
}

.platform-live-chat-home__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.platform-live-chat-home__cta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: calc(100% - 8px);
  margin: -18px auto 10px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  flex-shrink: 0;
}

.platform-live-chat-home__cta-label {
  color: #0f172a;
}

.platform-live-chat-home__cta svg {
  color: #4361ee;
  flex-shrink: 0;
}

.platform-live-chat-home__cta:disabled {
  opacity: 0.7;
  cursor: wait;
}

.platform-live-chat-home__toolbar {
  flex-shrink: 0;
  padding: 0 0 6px;
}

.platform-live-chat-home__search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
}

.platform-live-chat-home__search:focus-within {
  border-color: #4361ee;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.platform-live-chat-home__search svg {
  flex-shrink: 0;
}

.platform-live-chat-home__search input,
.platform-live-chat-home__search input[type="search"] {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  box-shadow: none;
}

.platform-live-chat-home__search input:focus,
.platform-live-chat-home__search input:focus-visible,
.platform-live-chat-home__search input[type="search"]:focus,
.platform-live-chat-home__search input[type="search"]:focus-visible {
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: #0f172a;
  min-height: 0;
  height: auto;
  padding: 0;
  border-radius: 0;
  line-height: 1.4;
}

.platform-live-chat-home__search input::placeholder {
  color: #94a3b8;
}

.platform-live-chat-home__section {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.platform-live-chat-home__list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 16px;
}

.platform-live-chat-home .platform-live-chat-list-sentinel {
  padding: 10px 16px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

.platform-live-chat-home .platform-live-chat-list-sentinel:not([data-loading='1']) {
  min-height: 1px;
  padding: 0;
}

.platform-live-chat-home .platform-live-chat-list-sentinel:not([data-loading='1']) span {
  display: none;
}

.platform-live-chat-home__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.platform-live-chat-home__list-item.d-none {
  display: none !important;
}

.platform-live-chat-home__item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
  width: 100%;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.platform-live-chat-home__item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.platform-live-chat-home__item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-row: 1 / 3;
  grid-column: 1;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eef2ff;
  color: #4361ee;
}

.platform-live-chat-home__item-title {
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-live-chat-home__item-time {
  grid-row: 1;
  grid-column: 3;
  font-size: 11px;
  line-height: 1.3;
  color: #94a3b8;
  white-space: nowrap;
}

.platform-live-chat-home__item-preview {
  grid-row: 2;
  grid-column: 2;
  display: block;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-live-chat-home__item-badge {
  grid-row: 2;
  grid-column: 3;
  justify-self: end;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.platform-live-chat-home__empty-search {
  margin: 8px 0 0;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
}

.platform-live-chat-panel__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.platform-live-chat-panel__subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.92;
  color: #fff;
}
.platform-live-chat-msg--own .platform-live-chat-msg__body p {
  color: #fff;
}

.platform-live-chat-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
}

.platform-live-chat-panel__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.platform-live-chat-panel__view--chat {
  flex: 1;
  min-height: 0;
}

.platform-live-chat-panel__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  background: #f8fafc;
}

.platform-live-chat-load-older {
  padding: 6px 0 10px;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

.platform-live-chat-panel__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  margin: 0;
  padding: 10px 16px 8px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.platform-live-chat-panel__form .platform-live-chat-composer__toolbar {
  margin-bottom: 4px;
}

.platform-live-chat-panel__form .platform-live-chat-composer__editor {
  min-height: 56px;
  border-color: #cbd5e1;
}

.platform-live-chat-panel__form .platform-live-chat-composer__editor:focus {
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.platform-live-chat-panel__send {
  align-self: stretch;
  width: 100%;
  min-height: 0;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: #4361ee;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.platform-live-chat-panel__send:hover {
  background: #3a56d4;
}

.platform-live-chat-panel__send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.platform-live-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 98%;
  margin-bottom: 12px;
}

.platform-live-chat-msg--pending {
  opacity: 0.72;
}

.platform-live-chat-msg--pending .platform-live-chat-msg__time {
  font-style: italic;
}

.platform-live-chat-msg--own {
  align-self: flex-end;
  align-items: flex-end;
}

.platform-live-chat-msg--other {
  align-self: flex-start;
  align-items: flex-start;
}

.platform-live-chat-msg__body {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.platform-live-chat-msg--own .platform-live-chat-msg__body {
  background: #4361ee;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.platform-live-chat-msg--other .platform-live-chat-msg__body {
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.platform-live-chat-msg__time {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}

.platform-live-chat-msg__empty {
  margin: 0;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}
#platform-chat-widget-messages .platform-live-chat-message__attachment img {
  width: 80px;
  height: 80px;
}
@media (max-width: 575px) {
  .platform-live-chat-root {
    right: 16px;
    bottom: 16px;
  }

  .platform-live-chat-bubble {
    width: 52px;
    height: 52px;
  }

  .platform-live-chat-panel {
    bottom: 64px;
    width: calc(100vw - 32px);
  }
}

/* Isolate widget from Crancy dashboard global form/button resets */
#crancy-dark-light .platform-live-chat-root,
#crancy-dark-light .platform-live-chat-root * {
  box-sizing: border-box;
}

#crancy-dark-light .platform-live-chat-root button {
  width: auto;
  max-width: none;
  height: auto;
  min-height: 0;
  line-height: inherit;
  font-weight: inherit;
  background-image: none;
}

#crancy-dark-light .platform-live-chat-root form {
  margin-bottom: 0;
}

#crancy-dark-light .platform-live-chat-root h3,
#crancy-dark-light .platform-live-chat-root p {
  margin-bottom: 0;
}

#crancy-dark-light .platform-live-chat-root label {
  margin-bottom: 0;
}

#crancy-dark-light .platform-live-chat-root input,
#crancy-dark-light .platform-live-chat-root textarea {
  font-weight: inherit;
}

#crancy-dark-light .platform-live-chat-root input:focus,
#crancy-dark-light .platform-live-chat-root textarea:focus {
  color: inherit !important;
}

#crancy-dark-light .platform-live-chat-root .platform-live-chat-bubble {
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #4361ee;
  color: #fff;
}

#crancy-dark-light .platform-live-chat-root .platform-live-chat-home__cta {
  width: calc(100% - 8px);
  height: auto;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  line-height: 1.4;
}

#crancy-dark-light .platform-live-chat-root .platform-live-chat-home__item {
  width: 100%;
  height: auto;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  text-align: left;
}

#crancy-dark-light
  .platform-live-chat-root
  .platform-live-chat-home__item-preview {
  margin-bottom: 0;
  padding-bottom: 2px;
}

#crancy-dark-light
  .platform-live-chat-root
  .platform-live-chat-home__search
  input,
#crancy-dark-light
  .platform-live-chat-root
  .platform-live-chat-home__search
  input[type="search"],
#crancy-dark-light
  .platform-live-chat-root
  .platform-live-chat-home__search
  input:focus,
#crancy-dark-light
  .platform-live-chat-root
  .platform-live-chat-home__search
  input:focus-visible,
#crancy-dark-light
  .platform-live-chat-root
  .platform-live-chat-home__search
  input[type="search"]:focus,
#crancy-dark-light
  .platform-live-chat-root
  .platform-live-chat-home__search
  input[type="search"]:focus-visible {
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0;
  background: transparent !important;
  color: #0f172a !important;
  line-height: 1.4;
}

#crancy-dark-light .platform-live-chat-root .platform-live-chat-panel__back,
#crancy-dark-light .platform-live-chat-root .platform-live-chat-panel__close,
#crancy-dark-light .platform-live-chat-root .platform-live-chat-home__close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  line-height: 1;
}

#crancy-dark-light .platform-live-chat-root .platform-live-chat-panel__send {
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: #4361ee;
  color: #fff;
  line-height: 1.4;
}

#crancy-dark-light
  .platform-live-chat-root
  .platform-live-chat-composer__toolbar
  button {
  width: auto;
  height: auto;
  padding: 4px;
  border: none;
  background: transparent;
  color: #64748b;
}
