.thebeauty-modal-widget {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  opacity: 0;
  transition: opacity 160ms ease;
}

.thebeauty-modal-widget[hidden] {
  display: none;
}

.thebeauty-modal-widget.is-open {
  opacity: 1;
}

.thebeauty-modal-widget__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.52);
  backdrop-filter: blur(2px);
}

.thebeauty-modal-widget__panel {
  position: relative;
  width: min(100%, 420px);
  max-height: min(78vh, 640px);
  overflow-y: auto;
  padding: 28px 24px 22px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(17, 17, 17, 0.24);
  color: #171717;
  font-family: Pretendard, "Noto Sans KR", sans-serif;
  text-align: center;
  transform: translateY(10px) scale(0.98);
  transition: transform 160ms ease;
}

.thebeauty-modal-widget.is-open .thebeauty-modal-widget__panel {
  transform: translateY(0) scale(1);
}

.thebeauty-modal-widget__title {
  margin: 0;
  color: #171717;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}

.thebeauty-modal-widget__message {
  margin: 14px 0 0;
  color: #4b4b4b;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.thebeauty-modal-widget__prompt {
  display: block;
  margin-top: 20px;
  text-align: left;
}

.thebeauty-modal-widget__prompt[hidden] {
  display: none;
}

.thebeauty-modal-widget__prompt-label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-size: 13px;
  font-weight: 600;
}

.thebeauty-modal-widget__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d5d5d5;
  border-radius: 12px;
  background: #fff;
  color: #171717;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.thebeauty-modal-widget__input:focus {
  border-color: #171717;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.1);
}

.thebeauty-modal-widget__actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.thebeauty-modal-widget__button {
  flex: 1 1 0;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.thebeauty-modal-widget__button:focus-visible {
  outline: 3px solid rgba(23, 23, 23, 0.24);
  outline-offset: 2px;
}

.thebeauty-modal-widget__button--secondary {
  background: #f1f1f1;
  color: #333;
}

.thebeauty-modal-widget__button--primary {
  background: #171717;
  color: #fff;
}

.thebeauty-modal-widget__panel[data-tone="danger"] .thebeauty-modal-widget__button--primary {
  background: #d9363e;
}

.thebeauty-modal-widget__panel[data-tone="success"] .thebeauty-modal-widget__button--primary {
  background: #18794e;
}

@media (max-width: 480px) {
  .thebeauty-modal-widget {
    align-items: end;
    padding: 16px;
  }

  .thebeauty-modal-widget__panel {
    width: 100%;
    padding: 24px 20px 18px;
    border-radius: 20px;
  }

  .thebeauty-modal-widget__title {
    font-size: 20px;
  }

  .thebeauty-modal-widget__message {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thebeauty-modal-widget,
  .thebeauty-modal-widget__panel {
    transition: none;
  }
}
