.support-widget-shell {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 1200;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: calc(100vw - 40px);
}

.support-widget-button {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.92rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  box-shadow: 0 22px 50px rgba(15, 118, 110, 0.28);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.support-widget-button.is-alert {
  box-shadow: 0 30px 64px rgba(15, 118, 110, 0.42);
}

.support-widget-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 58px rgba(15, 118, 110, 0.34);
}

.support-widget-button i {
  font-size: 1rem;
}

.support-widget-badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #bbf7d0;
  box-shadow: 0 0 0 8px rgba(187, 247, 208, 0.18);
  flex-shrink: 0;
}

.support-widget-badge.has-count {
  width: auto;
  min-width: 24px;
  height: 24px;
  padding: 0 0.38rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #0f766e;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.28);
  font-size: 0.72rem;
  font-weight: 800;
}

.support-widget-card {
  width: min(380px, calc(100vw - 1.2rem));
  max-height: min(680px, calc(100vh - 112px));
  margin-bottom: 0.85rem;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
}

.support-widget-header {
  padding: 1.15rem 1.2rem 1rem;
  background: linear-gradient(135deg, #0f172a 0%, #0f766e 65%, #14b8a6 100%);
  color: #fff;
}

.support-widget-header-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.support-widget-header h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 800;
}

.support-widget-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
  line-height: 1.6;
}

.support-widget-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.support-widget-shell[data-open="true"] .support-widget-toggle-icon {
  transform: rotate(180deg);
}

.support-widget-toggle-icon {
  transition: transform 0.18s ease;
}

.support-widget-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.95rem;
}

.support-widget-contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.42rem 0.74rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.support-widget-body {
  padding: 1rem;
  color: #102019;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.support-widget-helper,
.support-widget-identity {
  margin-bottom: 0.95rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid rgba(15, 118, 110, 0.1);
  color: #0f5f59;
  font-size: 0.81rem;
  line-height: 1.65;
}

.support-widget-identity strong {
  display: block;
  margin-bottom: 0.18rem;
  font-size: 0.88rem;
  color: #102019;
}

.support-widget-field {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  margin-bottom: 0.82rem;
}

.support-widget-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.82rem;
}

.support-widget-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4f625a;
}

.support-widget-input,
.support-widget-textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(16, 32, 25, 0.1);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.85rem 0.95rem;
  font-size: 0.88rem;
  color: #102019;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.support-widget-textarea {
  min-height: 98px;
  resize: vertical;
}

.support-widget-input:focus,
.support-widget-textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.32);
  box-shadow: 0 0 0 0.22rem rgba(15, 118, 110, 0.12);
}

.support-widget-submit {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 0.88rem 1rem;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 38px rgba(15, 118, 110, 0.2);
}

.support-widget-submit:disabled {
  cursor: wait;
  opacity: 0.75;
}

.support-widget-submit:hover {
  transform: translateY(-1px);
}

.support-widget-attachment-controls {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.support-widget-file-input {
  width: 100%;
  border-radius: 16px;
  border: 1px dashed rgba(15, 118, 110, 0.18);
  background: rgba(244, 250, 249, 0.92);
  padding: 0.72rem 0.8rem;
  font-size: 0.8rem;
  color: #27453f;
}

.support-widget-inline-note {
  font-size: 0.74rem;
  color: #59726a;
  line-height: 1.6;
}

.support-widget-attachment-draft-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.support-widget-draft-chip {
  border: 1px solid rgba(15, 118, 110, 0.1);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: #0f5f59;
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.support-widget-draft-chip small {
  color: #62837a;
}

.support-widget-message-attachments {
  margin-top: 0.52rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.support-widget-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  max-width: 100%;
  padding: 0.42rem 0.62rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 118, 110, 0.12);
  color: inherit;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
}

.support-widget-attachment-chip span {
  overflow-wrap: anywhere;
}

.support-widget-attachment-chip small {
  color: rgba(16, 32, 25, 0.62);
  font-weight: 600;
}

.support-widget-message.customer .support-widget-attachment-chip {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.16);
}

.support-widget-message.customer .support-widget-attachment-chip small {
  color: rgba(255, 255, 255, 0.72);
}

.support-widget-thread {
  max-height: 320px;
  overflow-y: auto;
  display: grid;
  gap: 0.7rem;
  padding-right: 0.2rem;
}

.support-widget-message {
  max-width: 88%;
  padding: 0.82rem 0.9rem;
  border-radius: 18px;
  font-size: 0.84rem;
  line-height: 1.65;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.support-widget-message strong {
  display: block;
  margin-bottom: 0.18rem;
  font-size: 0.76rem;
}

.support-widget-message time {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  opacity: 0.72;
}

.support-widget-message.customer {
  margin-left: auto;
  border-bottom-right-radius: 6px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
}

.support-widget-message.agent {
  border-bottom-left-radius: 6px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.1);
  color: #102019;
}

.support-widget-reply-box {
  margin-top: 0.95rem;
}

.support-widget-status {
  margin-bottom: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.44rem 0.72rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.1);
  color: #0f5f59;
  font-size: 0.76rem;
  font-weight: 800;
}

.support-widget-error {
  margin-bottom: 0.85rem;
  padding: 0.78rem 0.9rem;
  border-radius: 16px;
  background: rgba(254, 226, 226, 0.82);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #991b1b;
  font-size: 0.79rem;
  font-weight: 700;
}

.support-widget-loading {
  display: grid;
  gap: 0.8rem;
}

.support-widget-skeleton {
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.08), rgba(15, 118, 110, 0.16), rgba(15, 118, 110, 0.08));
  background-size: 200% 100%;
  animation: support-widget-sweep 1.1s linear infinite;
}

@keyframes support-widget-sweep {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.support-widget-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 110px;
  z-index: 1210;
  display: grid;
  gap: 0.65rem;
  pointer-events: none;
}

.support-widget-toast {
  min-width: min(320px, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(11, 29, 27, 0.94);
  color: #fff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  display: grid;
  gap: 0.18rem;
}

.support-widget-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.support-widget-toast strong {
  font-size: 0.84rem;
}

.support-widget-toast span {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
  .support-widget-shell {
    right: 12px;
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: none;
    align-items: stretch;
  }

  .support-widget-button {
    width: 100%;
    justify-content: center;
  }

  .support-widget-card {
    width: 100%;
    max-height: min(640px, calc(100vh - 104px));
    max-height: min(640px, calc(100dvh - 104px));
    border-radius: 24px;
  }

  .support-widget-form-grid {
    grid-template-columns: 1fr;
  }

  .support-widget-toast-stack {
    left: 12px;
    right: 12px;
    bottom: 96px;
  }

  .support-widget-toast {
    min-width: 100%;
  }
}
