.live-support-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 14px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #e82127 0%, #c41a1f 100%);
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(232, 33, 39, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.live-support-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(232, 33, 39, 0.5);
}

.live-support-launcher-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.live-support-launcher-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  animation: supportPulse 2s ease infinite;
}

@keyframes supportPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.live-support-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: min(380px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  z-index: 9999;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  font-family: Inter, system-ui, sans-serif;
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.live-support-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.live-support-header {
  background: linear-gradient(135deg, #111 0%, #1f1f1f 100%);
  color: #fff;
  padding: 18px 18px 14px;
}

.live-support-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-support-title {
  font-size: 16px;
  font-weight: 700;
}

.live-support-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: #86efac;
}

.live-support-online::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.live-support-close {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}

.live-support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}

.live-support-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.live-support-bubble.agent {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #111;
}

.live-support-bubble.user {
  align-self: flex-end;
  background: #e82127;
  color: #fff;
}

.live-support-bubble.system {
  align-self: center;
  background: #ecfdf5;
  color: #166534;
  font-size: 13px;
  text-align: center;
}

.live-support-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  background: #f8fafc;
}

.live-support-quick button {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
}

.live-support-quick button:hover {
  border-color: #e82127;
  color: #e82127;
}

.live-support-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.live-support-compose input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
}

.live-support-compose button {
  border: none;
  background: #e82127;
  color: #fff;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
}

.live-support-compose button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.support-page-main {
  min-height: calc(100vh - 72px);
  padding: 88px 16px 24px;
  display: flex;
  justify-content: center;
}

.live-support-page-root {
  width: min(920px, 100%);
  height: calc(100vh - 120px);
  min-height: 560px;
}

.live-support-page-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  border: 1px solid #ececec;
  font-family: Inter, system-ui, sans-serif;
}

.live-support-page-panel .live-support-messages {
  min-height: 0;
  flex: 1;
}

.live-support-page-lead {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.live-support-page-panel .live-support-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.live-support-smartsupp-shell {
  min-height: 560px;
}

.live-support-smartsupp-embed {
  position: relative;
  flex: 1;
  min-height: 420px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-support-smartsupp-loading {
  margin: 0;
  color: #666;
  font-size: 15px;
}

.live-support-smartsupp-fallback {
  margin: 0;
  padding: 12px 16px 16px;
  text-align: center;
  font-size: 13px;
  color: #666;
  border-top: 1px solid #ececec;
  background: #fff;
}

.live-support-smartsupp-fallback button {
  border: none;
  background: none;
  color: #e82127;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* Expand Smartsupp chat inside the live support page shell */
body.support-page-smartsupp.smartsupp-active #widget-button,
body.support-page-smartsupp.smartsupp-ready #widget-button {
  display: none !important;
}

body.support-page-smartsupp.smartsupp-ready #widget,
body.support-page-smartsupp.smartsupp-ready #widget-widgetRoot,
body.support-page-smartsupp.smartsupp-ready iframe[src*="smartsupp"] {
  position: fixed !important;
  top: 148px !important;
  left: 50% !important;
  right: auto !important;
  bottom: 24px !important;
  transform: translateX(-50%) !important;
  width: min(920px, calc(100vw - 32px)) !important;
  max-width: min(920px, calc(100vw - 32px)) !important;
  height: calc(100vh - 172px) !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 0 18px 18px !important;
  box-shadow: none !important;
  z-index: 9990 !important;
}

@media (max-width: 640px) {
  body.support-page-smartsupp.smartsupp-ready #widget,
  body.support-page-smartsupp.smartsupp-ready #widget-widgetRoot,
  body.support-page-smartsupp.smartsupp-ready iframe[src*="smartsupp"] {
    top: 132px !important;
    width: calc(100vw - 24px) !important;
    height: calc(100vh - 156px) !important;
  }
}

@media (max-width: 640px) {
  .live-support-launcher span.label {
    display: none;
  }

  .live-support-launcher {
    padding: 12px;
    border-radius: 50%;
    width: 58px;
    height: 58px;
    justify-content: center;
  }

  .live-support-panel {
    right: 12px;
    bottom: 82px;
    width: calc(100vw - 24px);
  }
}
