#lcd-chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  font-family: Arial, sans-serif;
}

.lcd-chat-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  background: var(--lcd-primary, #6b7280);
  color: #fff;
  width: 76px;
  height: 76px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
  overflow: visible;
}

.lcd-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
}

.lcd-chat-icon {
  font-size: 31px;
  line-height: 1;
  position: relative;
  z-index: 2;
}

.lcd-chat-icon-image {
  width: 48px;
  height: 48px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  display: block;
  position: relative;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.18);
}

.lcd-chat-hover-label {
  position: absolute;
  right: 90px;
  top: 50%;
  transform: translateY(-50%);
  background: #374151;
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.lcd-chat-toggle:hover .lcd-chat-hover-label {
  opacity: 1;
  transform: translateY(-50%) translateX(-2px);
}

.lcd-headset-frame {
  position: absolute;
  inset: -10px;
  pointer-events: none;
  z-index: 1;
}

.lcd-headset-band {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 28px;
  border: 4px solid var(--lcd-primary, #6b7280);
  border-bottom: none;
  border-radius: 38px 38px 0 0;
  box-sizing: border-box;
  opacity: 0.95;
}

.lcd-headset-ear {
  position: absolute;
  top: 16px;
  width: 10px;
  height: 25px;
  background: var(--lcd-primary, #6b7280);
  border-radius: 10px;
  opacity: 0.95;
}

.lcd-headset-ear.left {
  left: 3px;
}

.lcd-headset-ear.right {
  right: 3px;
}

.lcd-headset-mic {
  position: absolute;
  right: -1px;
  bottom: 12px;
  width: 18px;
  height: 4px;
  background: var(--lcd-primary, #6b7280);
  border-radius: 4px;
  transform: rotate(28deg);
  transform-origin: left center;
  opacity: 0.95;
}

.lcd-chat-panel {
  position: absolute;
  right: 0;
  bottom: 90px;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.lcd-chat-panel-header {
  background: var(--lcd-primary, #6b7280);
  color: #fff;
  padding: 16px 18px;
  font-size: 16px;
}

.lcd-chat-start-form,
.lcd-chat-message-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.lcd-chat-start-form label,
.lcd-chat-message-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lcd-chat-start-form span {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.lcd-chat-start-form input,
.lcd-chat-start-form select,
.lcd-chat-message-form input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.lcd-chat-start-form input:focus,
.lcd-chat-start-form select:focus,
.lcd-chat-message-form input:focus {
  border-color: var(--lcd-primary, #6b7280);
}

.lcd-chat-submit,
.lcd-chat-message-form button {
  border: none;
  border-radius: 12px;
  background: var(--lcd-primary, #6b7280);
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.lcd-chat-room {
  border-top: 1px solid #e5e7eb;
}

.lcd-chat-messages {
  max-height: 320px;
  overflow-y: auto;
  padding: 16px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lcd-chat-message {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.lcd-chat-message small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.7;
}

.lcd-chat-message.is-visitor {
  align-self: flex-end;
  background: var(--lcd-primary, #6b7280);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.lcd-chat-message.is-agent {
  align-self: flex-start;
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
}

.lcd-chat-status {
  padding: 0 16px 16px;
  color: #6b7280;
  font-size: 12px;
}

@media (max-width: 640px) {
  #lcd-chat-widget {
    right: 16px;
    bottom: 16px;
  }

  .lcd-chat-toggle {
    width: 72px;
    height: 72px;
  }

  .lcd-chat-icon-image {
    width: 46px;
    height: 46px;
  }

  .lcd-chat-panel {
    width: min(360px, calc(100vw - 20px));
    bottom: 86px;
  }

  .lcd-chat-hover-label {
    display: none;
  }

  .lcd-headset-band {
    width: 54px;
    height: 26px;
  }
}