.autorig-customer-service,
.autorig-customer-service * {
  box-sizing: border-box;
}

.autorig-customer-service {
  position: fixed;
  top: 50%;
  right: max(18px, env(safe-area-inset-right));
  z-index: 90;
  color: #18202a;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  transform: translateY(-50%);
}

.autorig-customer-service button {
  font: inherit;
}

.autorig-service-toggle {
  width: 58px;
  min-height: 136px;
  padding: 14px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 3px solid #ff4d4f;
  border-radius: 999px;
  background: rgba(255, 255, 255, .97);
  color: #f04445;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .28);
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.autorig-service-toggle:hover {
  background: #fff5f5;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .34);
  transform: translateX(-2px);
}

.autorig-service-toggle:focus-visible,
.autorig-service-close:focus-visible,
.autorig-service-contact:focus-visible {
  outline: 3px solid rgba(255, 77, 79, .32);
  outline-offset: 3px;
}

.autorig-customer-service.is-open .autorig-service-toggle {
  background: #ff4d4f;
  color: #fff;
}

.autorig-service-toggle-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1;
}

.autorig-service-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #32c86e;
  box-shadow: 0 0 0 5px rgba(50, 200, 110, .14);
}

.autorig-service-panel {
  position: absolute;
  top: 50%;
  right: calc(100% + 14px);
  width: 312px;
  padding: 20px;
  border: 1px solid rgba(23, 33, 48, .12);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #f7f9fc 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
  transform: translateY(-50%);
}

.autorig-service-panel[hidden] {
  display: none;
}

.autorig-service-panel::after {
  position: absolute;
  top: 50%;
  left: 100%;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(23, 33, 48, .12);
  border-right: 1px solid rgba(23, 33, 48, .12);
  background: #fafbfd;
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}

.autorig-service-head {
  padding-right: 34px;
}

.autorig-service-head h2 {
  margin: 0;
  color: #151c26;
  font-size: 20px;
  line-height: 1.25;
}

.autorig-service-head p {
  margin: 7px 0 0;
  color: #687386;
  font-size: 13px;
  line-height: 1.55;
}

.autorig-service-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef1f6;
  color: #647084;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.autorig-service-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.autorig-service-contact {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #e4e8ef;
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.autorig-service-contact:hover {
  border-color: rgba(255, 77, 79, .55);
  background: #fff8f8;
  transform: translateY(-1px);
}

.autorig-service-contact-copy {
  color: #f04445;
  font-size: 12px;
  font-weight: 800;
}

.autorig-service-contact-label,
.autorig-service-contact-value {
  display: block;
}

.autorig-service-contact-label {
  color: #7a8496;
  font-size: 12px;
  line-height: 1.35;
}

.autorig-service-contact-value {
  margin-top: 3px;
  overflow: hidden;
  color: #172033;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autorig-service-status {
  min-height: 18px;
  margin: 12px 2px 0;
  color: #687386;
  font-size: 12px;
  line-height: 1.5;
}

.autorig-service-status.is-success {
  color: #16864a;
}

.autorig-service-status.is-error {
  color: #d9363e;
}

@media (max-width: 720px) {
  .autorig-customer-service {
    top: auto;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: none;
  }

  .autorig-service-toggle {
    width: 50px;
    min-height: 116px;
    padding: 12px 8px;
  }

  .autorig-service-toggle-text {
    font-size: 14px;
  }

  .autorig-service-panel {
    top: auto;
    right: calc(100% + 10px);
    bottom: 0;
    width: min(300px, calc(100vw - 82px));
    padding: 17px;
    transform: none;
  }

  .autorig-service-panel::after {
    top: auto;
    bottom: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .autorig-service-toggle,
  .autorig-service-contact {
    transition: none;
  }
}
