.support-center-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.support-center-trigger,
.engagement-close {
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  font-size: 0;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
}

.support-center-trigger::-moz-focus-inner,
.engagement-close::-moz-focus-inner {
  border: 0;
  padding: 0;
}

.support-center-trigger {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 11px;
  background: rgba(255, 255, 255, .94);
  color: #334155;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(15, 23, 42, .08);
}

.support-center-trigger:hover {
  background: #fff;
  color: #6d28d9;
}

.support-center-trigger svg,
.engagement-close svg {
  display: block;
  flex: 0 0 auto;
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-center-trigger svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.9;
}

.support-center-badge {
  position: absolute;
  right: -5px;
  top: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font: 700 10px/17px system-ui;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.support-center-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  width: 205px;
  padding: 7px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  z-index: 260;
}

.support-center-popover[hidden] {
  display: none;
}

.support-center-popover button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 11px;
  color: #1e293b;
  text-align: left;
  cursor: pointer;
  font: 600 13px/1.25 system-ui;
}

.support-center-popover button:hover {
  background: #f4f0ff;
  color: #6d28d9;
}

.support-center-popover svg {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-center-popover .menu-badge,
.feedback-tab-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fee2e2;
  color: #be123c;
  text-align: center;
  font: 700 10px/1.4 system-ui;
}

.engagement-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(15, 23, 42, .28);
  display: grid;
  place-items: center;
  padding: 18px;
}

.engagement-dialog-open .kg-global-shortcuts {
  visibility: hidden !important;
  pointer-events: none !important;
}

.engagement-form-error {
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
}

.engagement-backdrop[hidden] {
  display: none;
}

.engagement-dialog {
  width: min(720px, 96vw);
  max-height: min(780px, 92vh);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, .3);
  overflow: hidden;
}

.engagement-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.engagement-dialog h2 {
  margin: 0;
  font-size: 20px;
}

.engagement-dialog header p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
}

.engagement-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
}

.engagement-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.engagement-close svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.engagement-body {
  padding: 18px 20px;
  overflow: auto;
}

.engagement-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.engagement-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #ddd6fe;
  background: #faf8ff;
  color: #6d28d9;
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
}

.engagement-tabs button.active {
  background: #6d28d9;
  color: #fff;
}

.engagement-tabs button.active .feedback-tab-badge {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

.engagement-form {
  display: grid;
  gap: 12px;
}

.engagement-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.engagement-form input,
.engagement-form select,
.engagement-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
  color: #0f172a;
  background: #fff;
}

.engagement-form textarea {
  min-height: 130px;
  resize: vertical;
}

.engagement-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.engagement-primary {
  justify-self: end;
  border: 0;
  border-radius: 11px;
  background: #6d28d9;
  color: #fff;
  padding: 10px 17px;
  font-weight: 700;
  cursor: pointer;
}

.engagement-note {
  color: #64748b;
  font-size: 11px;
}

.my-feedback-list,
.message-list {
  display: grid;
  gap: 10px;
}

.my-feedback-card,
.message-card {
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  padding: 13px;
  background: #fff;
}

.my-feedback-card.unread-reply {
  border-color: #c4b5fd;
  background: #faf8ff;
}

.my-feedback-card header,
.message-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.my-feedback-card header > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.my-feedback-card h3,
.message-card h3 {
  margin: 0;
  font-size: 14px;
}

.my-feedback-card time,
.message-card time {
  font-size: 10px;
  color: #94a3b8;
}

.my-feedback-card p,
.message-card p {
  margin: 8px 0;
  color: #475569;
  white-space: pre-wrap;
  font-size: 12px;
}

.feedback-status,
.feedback-reply-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
}

.feedback-status {
  background: #f1f5f9;
  color: #475569;
}

.feedback-status.in_progress {
  background: #fef3c7;
  color: #92400e;
}

.feedback-status.resolved {
  background: #dcfce7;
  color: #166534;
}

.feedback-status.closed {
  background: #e2e8f0;
  color: #475569;
}

.feedback-reply-badge {
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 700;
}

.feedback-replies {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed #cbd5e1;
}

.feedback-replies article {
  padding: 7px 9px;
  border-radius: 9px;
  background: #f8fafc;
  margin-top: 6px;
  font-size: 11px;
}

.message-card.unread {
  border-color: #c4b5fd;
  background: #faf8ff;
}

.message-card button,
.message-toolbar button {
  border: 1px solid #ddd6fe;
  border-radius: 9px;
  background: #fff;
  color: #6d28d9;
  padding: 6px 10px;
  cursor: pointer;
}

.message-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.engagement-empty {
  padding: 32px 16px;
  text-align: center;
  color: #94a3b8;
  border: 1px dashed #cbd5e1;
  border-radius: 13px;
}

.contact-service-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.contact-service-title {
  margin: 4px 0 0;
  color: #334155;
  font-weight: 700;
  font-size: 18px;
}

.contact-service-subtitle,
.contact-service-tip {
  margin: 0;
  color: #64748b;
  line-height: 1.5;
}

.contact-service-subtitle {
  font-size: 13px;
}

.contact-service-qrcode {
  width: min(280px, 100%);
  max-width: 280px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 6px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
}

.contact-service-tip {
  font-size: 11px;
}

.engagement-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 850;
  background: #172033;
  color: #fff;
  padding: 9px 14px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
}

.engagement-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.engagement-toast.error {
  background: #991b1b;
}

@media (max-width: 700px) {
  .engagement-form-row {
    grid-template-columns: 1fr;
  }

  .support-center-popover {
    right: -4px;
  }

  .engagement-dialog {
    width: 100%;
    max-height: 94vh;
  }
}
